1 2006-12-14 Bob Rossi <bob@brasko.net>
3 * data/push.c (yypush_parse): Declare prototype regardless of
6 2006-12-14 Bob Rossi <bob@brasko.net>
8 * data/push.c (yyparse): Remove the prototype and the #define when in
11 2006-12-13 Bob Rossi <bob@brasko.net>
13 * data/push.c (yypstate_init): Rename to...
14 (yypstate_new): ... this and use b4_c_function_def.
15 (yypstate_delete): New.
16 (yypush_parse): Change parameters yynval and yynlloc to be const.
17 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
18 yypstate_delete functions.
20 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
22 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
23 strange test case titles. Reported by Bob Rossi.
25 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
27 * TODO: Add pointer to Sylvain Schmitz's work on static detection
28 of potential ambiguities in GLR grammers.
30 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
32 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
33 `bison ', use m4_index instead of m4_substr since chopping up a string
34 containing M4-special characters causes problems here.
36 Fix a couple of bugs related to special characters in user-specified
37 file names, and make it easier for skeletons to compute output file
38 names with the same file name prefix as Bison-computed output file
40 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
41 b4_parser_file_name and b4_spec_defines_file instead of
42 @output_parser_name@ and @output_header_name@, which are now redundant.
43 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
44 b4_parser_file_name, b4_spec_defines_file, and the new
45 @basename(FILENAME@) instead of @output_parser_name@ and
46 @output_header_name@, which inappropriately escaped the file names as
48 * src/files.c (all_but_ext): Remove static qualifier.
49 (compute_output_file_names): Move `free (all_but_ext)' to...
50 (output_file_names_free): ... here since all_but_ext is needed later.
51 * src/files.h (all_but_ext): Extern.
52 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
53 exactly what MUSCLE_INSERT_STRING used to do.
54 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
55 characters are escaped properly.
56 * src/output.c (prepare): Define muscle file_name_all_but_ext as
58 For pkgdatadir muscle, maintain previous functionality by using
59 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
60 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
61 digraphs would never be expanded. Hopefully no one has M4-special
62 characters in his Bison installation path.
63 * src/scan-skel.l: Don't parse @output_header_name@ and
64 @output_parser_name@ anymore since they're now redundant.
65 In @output, use decode_at_digraphs.
66 Parse a new @basename command that invokes last_component.
67 (decode_at_digraphs): New.
68 (BASE_QPUTS): Remove unused.
69 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
70 (Output file name): New tests.
72 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
74 Warn about output files that are generated by the skeletons and that
75 conflict with other output files.
76 * data/glr.c: Don't generate the header file here when glr.cc does.
77 * src/files.c (file_names, file_names_count): New static globals.
78 (compute_output_file_names): Invoke output_file_name_check for files
79 not generated by the skeletons and remove existing checks.
80 (output_file_name_check): New function that warns about conflicting
82 (output_file_names_free): Free file_names.
83 * src/files.h (output_file_name_check): Declare.
84 * src/scan-skel.l: Invoke output_file_name_check for files generated by
86 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
87 (Conflicting output files): New tests.
89 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
91 * doc/bison.texinfo: Fix a couple of typos.
93 2006-12-08 Bob Rossi <bob@brasko.net>
95 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
97 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
99 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
100 (yypush_parse): Rename yypvars argument to yyps and remove redundant
102 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
103 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
105 2006-12-07 Bob Rossi <bob@brasko.net>
106 and Joel Denny <jdenny@ces.clemson.edu>
108 * data/push.c (yypvarsinit): Change return type from void* to struct
109 yypvars*. No longer cast to void* on return.
110 (struct yypvars): Remove yylen since it need not be remembered between
111 yypushparse invocations.
112 (yypushparse): Don't copy between yylen and pv->yylen.
114 2006-12-05 Bob Rossi <bob@brasko.net>
116 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
117 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
118 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
119 (struct yypvars): Remove b4_declare_parser_variables.
120 (yypvarsinit): Remove init code for removed variables.
121 (global scope): Do not declare b4_declare_parser_variables if
123 (yypushparse): Add b4_declare_parser_variables.
124 Init new local variables, and remove init code for removed
127 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
128 and yyparse for other modes.
129 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
130 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
131 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
132 (AT_PURE_LEX_IF): True if pure or push parser.
134 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
136 Document Yacc prologue alternatives and default %destructor's and
137 %printer's as experimental. Don't mention Java yet. Discussed at
138 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
139 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
140 (2.3a): Annotate this entry to say the old forms of these features were
142 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
143 Bison Symbols): Say they're experimental. Comment out any mention
144 of Java (we'll want this back eventually).
146 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
148 Support a file name argument to %defines. Deprecate `=' in
149 %file-prefix, %name-prefix, and %output. Discussed at
150 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
151 * NEWS (2.3a+): Mention.
152 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
153 form of %defines, and remove `=' from entries for %file-prefix,
154 %name-prefix, and %output.
155 * src/parse-gram.y (prologue_declaration): Implement.
156 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
157 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
158 all but one occurrence of %name-prefix.
159 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
160 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
161 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
162 occurrence of each of %file-prefix and %output. Add check for %defines
164 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
165 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
166 Remove the `=' from %output.
168 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
170 Don't escape $ in test case titles since Autoconf 2.61 now does that
172 * tests/actions.at (Default %printer and %destructor are not for error
173 or $undefined): Here.
174 (Default %printer and %destructor are not for $accept): Here.
175 * tests/input.at (Invalid $n and @n): Here.
177 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
179 Rename <!> to <>. Discussed starting at
180 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
181 * NEWS (2.3a+): Update.
182 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
184 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
185 * src/scan-gram.l (INITIAL): Implement.
186 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
187 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
189 * tests/actions.at (Default tagless %printer and %destructor,
190 Default tagged and per-type %printer and %destructor,
191 Default %printer and %destructor are not for error or $undefined,
192 Default %printer and %destructor are not for $accept,
193 Default %printer and %destructor for mid-rule values): Update.
194 * tests/input.at (Default %printer and %destructor redeclared,
195 Unused values with default %destructor): Update.
197 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
199 Don't let %prec take a nonterminal.
200 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
202 * tests/input.at (%prec takes a token): New test checking that %prec
203 won't take a nonterminal.
205 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
207 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
208 it was double-quoted.
209 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
210 grammar is maintained with Bison's highest standards.
211 * src/getargs.c: Fix some typos in Doxygen comments.
213 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
215 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
216 later. Reported by Paul Eggert in
217 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
218 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
219 * src/scan-code.l (translate_action): Don't bother invoking
220 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
221 (code_scanner_free): Instead of invoking
222 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
224 * src/scan-gram.l (gram_scanner_free): Likewise.
225 * src/scan-skel.l (scan_skel): Likewise.
227 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
229 * src/files.c (tr): Change return type to void.
230 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
231 has been called previously for the same key.
232 (muscle_find): Return storage instead of value so that
233 --enable-gcc-warnings doesn't produce warnings that the return discards
234 const. aver that the value and storage are the same since storage
235 could potentially be NULL when value is not.
236 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
239 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
241 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
242 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
243 us a slightly cleaner distribution, and also works.
244 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
247 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
248 and Paul Eggert <eggert@cs.ucla.edu>
250 Don't let Bison leak memory except when it complains.
251 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
252 (spec_defines_file, dir_prefix): Now char *, not const char *,
253 since they are freed.
254 * src/files.c: Likewise.
255 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
257 (tr): Now operates in-place. All uses changed.
258 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
260 (compute_file_name_parts, compute_output_file_names): Don't store
261 read-only data in variables that will be freed.
262 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
263 src_extension, and header_extension.
264 (output_file_names_free): New public function to free
265 spec_verbose_file, spec_graph_file, spec_defines_file,
266 parser_file_name, and dir_prefix.
267 * src/getargs.c (getargs): Don't store read-only data in variables that
269 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
270 (which previously existed but was unused), and quotearg_free.
271 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
272 * src/muscle_tab.c: Likewise.
273 (muscle_entry): Make the value char const *,
274 and add a new storage member that is char * and can be freed.
275 (muscle_entry_free): New private function.
276 (muscle_init): Use it instead of free.
277 (muscle_insert, muscle_grow): Update and use new storage member.
278 (muscle_code_grow): Free the string passed to muscle_grow
279 since it's not needed anymore.
280 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
281 add a new `char *code' member.
282 ("{...}"): Declare semantic type as code.
283 * src/scan-code.h (translate_rule_action):
284 (translate_symbol_action, translate_code, translate_action): Return
285 `char const *' rather than `char *' since external code should not free
287 * src/scan-code.l: Likewise.
288 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
289 which is "{...}" in the parser.
290 * tests/Makefile.am (maintainer-check-valgrind): Set
291 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
293 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
295 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
296 expecting a non-zero exit status sets --leak-check=summary and
297 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
298 this case, and we don't want to hear about it.
300 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
302 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
303 instead of from the template, to simplify configuration a bit.
304 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
305 and m4/wint_t.m4, as they are needed with the latest gnulib.
307 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
309 Disable unset/unused mid-rule value warnings by default, and recognize
310 --warnings=midrule-values to enable them. Discussed starting at
311 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
312 * NEWS (2.3a+): Mention.
313 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
314 warnings): Add entry for midrule-values subargument.
315 * src/reader.c (symbol_should_be_used): Don't return true just because
316 the value is a set/used mid-rule value unless
317 --warnings=midrule-values was specified.
318 * tests/input.at (Unused values, Unused values before symbol
319 declarations): Run tests with and without --warnings=midrule-values.
321 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
322 than LIST_FREE directly.
324 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
326 Finish implementing --warnings=error, which should not be implied by
327 --warnings=all (or by its synonyms -W and --warnings without
329 * src/complain.c (set_warning_issued): New function to report that
330 warnings are being treated as errors and to record an error if so.
332 (warn_at, warn): ... here.
333 * src/getargs.c (warnings_args, warnings_types): Reorder so that
334 "error - warnings are errors" does not appear above "all - all of the
336 (getargs): For -W and --warnings without subarguments, don't let
337 FLAGS_ARGMATCH set warnings_error in warnings_flag.
338 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
340 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
342 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
343 empty subargument list. For example: `bison --warnings= parser.y'.
345 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
347 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
348 the parser header file so that gcc doesn't warn.
350 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
352 Split the default %destructor/%printer into two kinds: <*> and <!>.
353 Discussed starting at
354 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
355 * NEWS (2.3a+): Mention.
356 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
357 previous change today related to mid-rules.
358 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
359 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
360 (TYPE_TAG_ANY): Add as <*>.
361 (TYPE_TAG_NONE): Add as <!>.
362 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
364 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
365 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
366 * src/symlist.c (symbol_list_default_new): Split into tagged and
368 (symbol_list_destructor_set, symbol_list_printer_set): Split
369 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
370 SYMLIST_DEFAULT_TAGLESS.
371 * src/symlist.h: Update symbol_list_default*_new prototypes.
372 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
373 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
374 * src/symtab.c (default_destructor, default_destructor_location,
375 default_printer, default_printer_location): Split each into tagged and
377 (symbol_destructor_get, symbol_destructor_location_get,
378 symbol_printer_get, symbol_printer_location_get): Implement tagged
379 default and tagless default cases.
380 (default_destructor_set, default_printer_set): Split each into tagged
381 and tagless versions.
382 * src/symtab.h: Update prototypes.
383 * tests/actions.at (Default %printer and %destructor): Rename to...
384 (Default tagless %printer and %destructor): ... this, and extend.
385 (Per-type %printer and %destructor): Rename to...
386 (Default tagged and per-type %printer and %destructor): ... this, and
388 (Default %printer and %destructor for user-defined end token): Extend.
389 (Default %printer and %destructor are not for error or $undefined):
391 (Default %printer and %destructor are not for $accept): Update.
392 (Default %printer and %destructor for mid-rule values): Extend.
393 * tests/input.at (Default %printer and %destructor redeclared): Extend.
394 (Unused values with default %destructor): Extend.
396 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
398 Don't apply the default %destructor/%printer to an unreferenced midrule
400 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
401 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
402 like $@n instead of just @n so that the default %destructor/%printer
403 logic doesn't see them as user-defined symbols.
404 (symbol_is_dummy): Check for both forms of the name.
405 * src/reader.c (packgram): Remove the `$' from each midrule symbol
406 name for which the midrule value is referenced in any action.
407 * tests/actions.at (Default %printer and %destructor for mid-rule
409 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
410 for change to dummy symbol names.
412 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
414 Warn about unset midrule $$ if the corresponding $n is used.
415 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
417 (packgram): Before invoking grammar_rule_check on any rule, make sure
418 all actions have already been scanned in order to set `used' flags.
419 Otherwise, checking that a midrule's $$ is set will not always work
420 properly because the midrule check must forward-reference the midrule's
422 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
425 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
427 More improvements to the documentation of the prologue alternatives:
428 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
430 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
431 some text to clarify the relative importance of the new directives and
432 to show how these directives may be viewed as code labels.
434 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
436 Similar to the recently removed %before-header, add %code-top as the
437 alternative to the pre-prologue. Mentioned at
438 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
439 Also, let the prologue alternatives appear in the grammar section.
440 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
441 (prologue_declaration): Move the existing prologue alternatives to...
442 (grammar_declaration): ... here and add %code-top.
443 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
445 Clean up and extend documentation for the prologue alternatives.
446 * NEWS (2.3a+): Describe prologue alternatives.
447 * doc/bison.texinfo (Prologue): Move discussion of prologue
449 (Prologue Alternatives): ... this new section, and extend it to discuss
450 all 4 directives in detail.
451 (Bison Symbols): Clean up discussion of prologue alternatives and add
454 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
456 DJGPP specific issues.
458 * djgpp/config.bat: config.hin has been moved to lib. Adjust
459 config.bat accordingly.
460 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
461 * djgpp/config.site: Likewise.
463 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
465 Replace %*-header with %provides, %requires, %code. See discussion at
466 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
468 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
469 (b4_user_start_header): Remove.
470 * data/glr.c: Use new macros instead of b4_*start_header
472 * data/glr.cc: Likewise.
473 * data/lalr1.cc: Likewise.
474 * data/push.c: Likewise.
475 * data/yacc.c: Likewise.
477 * doc/bison.texinfo: Remove %before-header, rename
478 %{start,end,after}-header to %requires, %provides, %code.
480 * src/parse-gram.y: Likewise (also rename token names accordingly).
481 * src/scan-gram.l: Likewise.
482 * tests/actions.at: Likewise.
484 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
486 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
487 Problem reported by Joel E. Denny.
489 2006-10-14 Jim Meyering <jim@meyering.net>
491 (Sync from coreutils.)
492 Work also when the working directory (with e.g. coreutils sources)
493 is version controlled with git, rather than CVS.
494 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
496 In messages and comments, say e.g., "checked-out sources",
497 rather than "CVS sources".
498 (version_controlled_file): New function. Work for git as well as
499 for CVS. Don't use grep's -q option.
500 (slurp): Call it here, in place of CVS-specific code.
502 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
504 Fix testsuite for ./configure --enable-gcc-warnings:
505 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
506 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
507 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
508 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
509 * test/regression.at (Diagnostic that expects two alternatives):
512 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
514 * bootstrap.conf (gnulib_modules): Add config-h.
515 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
516 worry about HAVE_CONFIG_H.
517 * lib/abitset.c: Likewise.
518 * lib/bitset.c: Likewise.
519 * lib/bitset_stats.c: Likewise.
520 * lib/bitsetv-print.c: Likewise.
521 * lib/bitsetv.c: Likewise.
522 * lib/ebitset.c: Likewise.
523 * lib/get-errno.c: Likewise.
524 * lib/lbitset.c: Likewise.
525 * lib/subpipe.c: Likewise.
526 * lib/timevar.c: Likewise.
527 * lib/vbitset.c: Likewise.
528 * lib/bitset.c: Include "bitset.h" first, to test interface.
529 * lib/bitset_stats.c: Include "bitset_stats.h" first.
530 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
531 * lib/bitsetv.c: Include "bitsetv.h" first.
532 * lib/get-errno.c: Include "get-errno.h" first.
533 * m4/.cvsignore: Add config-h.m4.
534 * tests/actions.at (Default %printer and %destructor for ...):
535 Adjust expected line numbers in output to reflect removal of #if
537 * tests/glr-regression.at (Missed %merge type warnings when ...):
539 * tests/regression.at (Braced code in declaration in rules section):
541 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
542 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
543 Include <config.h> unconditionally.
545 * bootstrap: Sync from coreutils, as follows:
547 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
549 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
550 variable was sometimes used without being initialized. This
551 messed up the installation of the INSTALL file in some cases.
553 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
555 * bootstrap (usage, main program, symlink_to_gnulib): Add option
556 --copy. Inspired by a suggestion from Bruno Haible.
558 2006-10-03 Jim Meyering <jim@meyering.net>
560 * bootstrap: Undo last change to this file, since now gnulib-tool
561 sticks with the automake default in generating dependencies.
563 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
565 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
566 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
568 * doc/bison.1: Add copyright notice.
570 * data/glr.c: Don't include <stdarg.h>; not used.
572 * NEWS: The -g and --graph options now output graphs in Graphviz
573 DOT format, not VCG format.
574 * doc/bison.1: Likewise.
575 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
576 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
578 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
579 * TODO: Remove Graphviz entry.
580 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
581 remove vcg.c, vcg.h, vcg_defaults.h.
582 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
583 * src/graphviz.c, src/graphviz.h: New files.
584 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
585 * src/files.h: Make comment more generic.
586 * src/main.c (main): Likewise.
587 * src/print_graph.h: Likewise.
588 * src/getargs.c (usage): Make usage description more generic.
589 * src/print_graph.c: Include graphviz.h rather than vcg.h.
590 (static_graph, fgraph): Remove. All uses changed to pass
591 arguments instead of sharing a static var.
592 (print_core, print_actions, print_state, print_graph):
593 Output graphviz format rather than VCG format.
594 * tests/.cvsignore: Remove *.vcg; add *.dot.
595 * tests/output.at: Expect *.dot files, not *.vcg files.
597 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
598 accommodates the 2006-10-08 change.
600 2006-10-11 Bob Rossi <bob@brasko.net>
602 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
603 (b4_yyssa, b4_yyerror_range): New macros.
604 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
605 (yypvarsinit): Remove init of removed fields.
606 (yypushparse): Remove use of removed fields; use new macros instead.
608 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
610 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
611 in a push parser. Reindent slightly to match yacc.c better.
613 2006-10-11 Bob Rossi <bob@brasko.net>
615 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
617 (yypvarsinit, yypushparse): Remove init of removed fields.
618 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
620 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
622 * THANKS: Add Paolo Bonzini and Bob Rossi.
624 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
626 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
627 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
628 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
629 b4_define_user_cde and uses): Remove.
630 (b4_comment, b4_prefix, b4_sync_start): New.
631 * data/bison.m4: New file, with most of the content removed from c.m4.
632 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
633 * src/output.c (output_skeleton): Pass bison.m4.
634 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
637 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
639 Fix test failure reported by Tom Lane in
640 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
641 and try to make such failures easier to catch in the future.
642 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
643 that's now the caller's responsibility.
644 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
645 Set yychar = YYEOF if it's negative.
646 * tests/actions.at (yylex): Abort if asked to read past EOF.
647 * tests/conflicts.at (yylex): Likewise.
648 * tests/cxx-type.at (yylex): Likewise.
649 * tests/glr-regression.at (yylex): Likewise.
650 * tests/input.at (yylex): Likewise.
651 * tests/regression.at (yylex): Likewise.
652 * tests/torture.at (yylex): Likewise.
654 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
656 Fix problems with translating English-language diagnostics.
657 * bootstrap: Fix bug introduced in recent bootstrap changes, with
658 respect to bison-runtime pot generation. The YY_ stuff
659 wasn't being captured.
660 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
661 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
662 * runtime-po/POTFILES.in: Add data/push.c.
664 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
666 Merge bootstrap changes from coreutils.
668 2006-09-28 Jim Meyering <jim@meyering.net>
670 Automatically generated dependencies are important even
671 when all of the sources in a directory come from gnulib.
672 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
673 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
675 2006-09-23 Jim Meyering <jim@meyering.net>
677 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
679 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
681 * bootstrap: Add support for --force.
682 (usage): New function. Describe usage less tersely.
683 (CVS_only_file): New var.
685 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
687 * data/push.c (YYPUSH_MORE): Make it an enum instead.
688 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
689 Adjust white space and comments to match GNU style better.
691 2006-09-20 Bob Rossi <bob@brasko.net>
693 * data/push.c (yyresult_get): Remove function.
694 (YYPUSH_MORE): Add #define.
695 (yypushparse): Modify return value.
697 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
699 * stamp-h.in: Remove; no longer needed.
700 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
701 Remove config.h, config.hin, intl (no longer created).
702 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
705 Sync bootstrap from coreutils, as follows:
707 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
709 * bootstrap (symlink_to_gnulib): New function.
710 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
712 (cp_mark_as_generated, slurp, gnulib_files):
713 Avoid making a copy if it's the same as the old version.
714 (gnulib_files): Add support for this variable (used by Bison).
716 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
718 * src/getargs.c (usage): Rework to use conventions similar to
719 coreutils, to make translation a bit easier and the code a bit
720 smaller. Problem reported by Tim Van Holder.
722 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
724 Use some of gnulib's new modules, taken from coreutils.
726 * bootstrap: Sync from coreutils, except add support for gnulib_files.
727 * bootstrap.conf: New file.
728 (gnulib_modules): Add configmake, inttypes, unistd.
729 (XGETTEXT_OPTIONS): Add complain, complain_at,
730 fatal, fatal_at, warn, warn_at, unexpected_end.
731 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
732 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
734 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
736 (GNULIB_AUTOCONF_SNIPPET): Remove.
737 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
739 * lib/.cvsignore: Add inttypes_.h.
740 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
741 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
742 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
743 no-longer-necessary initializations.
744 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
745 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
746 use the unistd module.
747 * src/system.h: Likewise.
748 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
749 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
750 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
751 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
752 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
753 * src/system.h: Include inttypes.h unconditionally, now that we
754 use the inttypes module. Don't bother to include stdint.h, since
755 inttypes.h now does that for us.
756 (LOCALEDIR): Remove, now that we use the configmake module.
757 * src/getargs.c: Include configmake.h.
758 * src/main.c: Likewise.
759 * src/output.c: Likewise.
760 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
761 not from $abs_top_builddir, since config.h moved.
764 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
765 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
767 * src/parse-gram.y (symbol_declaration): Don't put statements
768 before declarations; it's not portable to C89.
769 * src/scan-code.l (handle_action_at): Likewise.
771 * src/scan-code.l: Always initialize braces_level; the old code
772 left it uninitialized and therefore had undefined behavior.
774 Don't attempt to redefine 'assert', since it runs afoul of
775 systems where standard headers (mistakenly) include <assert.h>.
776 Instead, define and use our own alternative, called 'aver'.
777 * src/reader.c: Don't include assert.h, since we no longer
779 * src/scan-code.l: Likewise.
780 * src/system.h (assert): Remove, replacing with....
781 (aver): New function, taking a bool arg. All uses changed.
782 * src/tables.c (pack_vector): Ensure that aver arg is bool,
783 not merely an integer.
785 2006-09-15 Bob Rossi <bob@brasko.net>
787 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
788 * data/c.m4 (YYPUSH): New.
789 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
790 * src/getargs.c (push_parser): New var.
791 * src/getargs.h (push_parser): New declaration.
792 * src/output.c (prepare): Add macro insertion of `push_flag'.
793 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
794 (prologue_declaration): Parse %push-parser.
795 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
796 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
797 list of removed lines from the traces observed.
798 (AT_CHECK_CALC_LALR): Added push parser tests.
800 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
802 * NEWS: Version 2.3a.
803 * configure.ac (AC_INIT): Likewise.
805 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
806 "#define YYSTYPE int" that caused "make maintainer-check" to fail
807 due to header ordering dependencies. I don't know why the #define
810 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
811 runtime cost when YYDEBUG is not defined, and so that some tests
812 that used to fail now work. Problem and initial suggestion by
814 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
815 * data/glr.cc (b4_parser_class_name):
816 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
817 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
818 (yydebug_) [YYDEBUG]: New member.
819 (yycdebug_): Now defined only if YYDEBUG.
820 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
821 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
822 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
824 (debug_stream, set_debug_stream, debug_level, set_debug_level):
825 Define only if YYDEBUG.
826 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
828 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
829 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
830 AT_CHECK_CALC_GLR_CC that are working now.
832 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
834 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
835 We don't need them in glr.cc, and glr.c defines them.
836 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
837 assumes that defining it to anything is the same as defining
838 it to 1. Problem reported by Paolo Bonzini.
840 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
842 * data/c.m4 (b4_null, b4_case): Define.
843 * src/output.c (prepare_symbols): Use b4_null.
844 (user_actions_output): Use b4_case.
846 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
848 * data/glr.c (b4_shared_declarations): Put start-header first,
849 before any #includes that we generate, so that feature-test
850 macros work. Problem reported by Michael Deutschmann in
851 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
852 * data/lalr1.cc: Likewise.
853 * doc/bison.texinfo (Prologue): Document that feature-test macros
854 should be defined before any Bison declarations.
855 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
856 that depend on location.hh after, not before, Bison decls, since
857 we now include location.hh after the first user prologue.
859 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
860 Sander Brandenburg in
861 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
862 Also, fix minor white space and comment issues.
863 (Prologue): Mention that it's better to define feature-test macros
864 before Bison declarations. Problem reported by Michael Deutschmann.
866 * README-cvs: Fix typo: "&" should be "&&". Problem reported
868 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
869 This adjusts to recent gnulib changes.
871 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
873 Finish implementation of per-type %destructor/%printer. Discussed
875 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
877 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
878 * NEWS (2.3+): Add a description of this feature to the default
879 %destructor/%printer description.
880 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
881 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
882 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
883 list node contains a semantic type.
884 * src/symtab.c, src/symtab.h: Extend with a table that associates
885 semantic types with their %destructor's and %printer's.
886 (semantic_type_from_uniqstr, semantic_type_get,
887 semantic_type_destructor_set, semantic_type_printer_set): New functions
888 composing the public interface of that table.
889 (symbol_destructor_get, symbol_destructor_location_get,
890 symbol_printer_get, symbol_printer_location_get): If there's no
891 per-symbol %destructor/%printer, look up the per-type before trying
893 * tests/actions.at (Per-type %printer and %destructor): New test case.
894 * tests/input.at (Default %printer and %destructor redeclared):
895 Extend to check that multiple occurrences of %symbol-default in a
896 single %destructor/%printer declaration is an error.
897 (Per-type %printer and %destructor redeclared, Unused values with
898 per-type %destructor): New test cases.
900 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
902 Require default %destructor/%printer to be declared using
903 %symbol-default instead of an empty symbol list, and start working on
904 new per-type %destructor/%printer. Discussed at
905 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
906 * NEWS (2.3+): Add %symbol-default to example.
907 * bison.texinfo (Freeing Discarded Symbols): Likewise.
908 (Bison Symbols): Add entry for %symbol-default.
909 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
910 (generic_symlist, generic_symlist_item): New nonterminals for creating
911 a list in which each item is a symbol, semantic type, or
913 (grammar_declaration): Use generic_symlist in %destructor and %printer
914 declarations instead of symbols.1 or an empty list.
915 (symbol_declaration, precedence_declaration, symbols.1): Update actions
916 for changes to symbol_list.
917 * src/reader.c: Update for changes to symbol_list.
918 * src/scan-code.l: Likewise.
919 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
920 * src/symlist.c, src/symlist.h: Extend such that a list node may
921 represent a semantic type or a %symbol-default in addition to just an
922 ordinary symbol. Add switched functions for setting %destructor's and
924 * tests/actions.at, tests/input.at: Add %symbol-default to all default
925 %destructor/%printer declarations.
927 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
929 Whether the default %destructor/%printer applies to a particular symbol
930 isn't a question of whether the user *declares* that symbol (in %token,
931 for example). It's a question of whether the user by any means
932 *defines* the symbol at all (by simply using a char token, for
933 example). $end is defined by Bison whereas any other token with token
934 number 0 is defined by the user. The error token is always defined by
935 Bison regardless of whether the user declares it with %token, but we
936 may one day let the user define error as a nonterminal instead.
937 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
938 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
939 the meaning of "user-defined".
940 * tests/actions.at (Default %printer and %destructor for user-declared
941 end token): Rename to...
942 (Default %printer and %destructor for user-defined end token): ...
945 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
946 computation of whether to apply the default, don't maintain a list of
947 every Bison-defined symbol. Instead, just check for a first character
948 of '$', which a user symbol cannot have, and check for the error token.
950 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
952 Don't apply the default %destructor or %printer to the error token,
953 $undefined, or $accept. This change fits the general rule that the
954 default %destructor and %printer are only for user-declared symbols,
955 and it solves several difficulties that are described in the new test
957 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
958 * tests/actions.at (Default %printer and %destructor are not for error
959 or $undefined, Default %printer and %destructor are not for $accept):
962 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
964 Allow %start after the first rule.
965 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
966 when parsing the first rule.
967 (check_and_convert_grammar): Search for it here after all grammar
968 declarations have been parsed. Skip midrules, which have dummy LHS
970 * src/symtab.c (symbol_is_dummy): New function.
971 * src/symtab.h (symbol_is_dummy): Declare it.
972 * tests/input.at (%start after first rule): New test.
974 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
976 Redo some of the previous commit: add back the ability to use
977 non-aliased/undeclared string literals since it might be useful to
978 those declaring %token-table.
979 * src/reader.c (check_and_convert_grammar): Undo changes in previous
980 commit: don't worry about complaints from symbols_pack.
981 * src/symtab.c (symbol_new, symbol_class_set,
982 symbol_check_alias_consistency): Undo changes in previous commit: count
983 each string literal as a new symbol and token, assign it a symbol
984 number, and don't complain about non-aliased string literals.
985 (symbols_pack): Since symbol_make_alias still does not decrement symbol
986 and token counts but does still set aliased tokens to the same number,
987 symbol_pack_processor now leaves empty slots in the symbols array.
989 * tests/regression.at (Undeclared string literal): Remove test case
990 added in previous commit since non-aliased string literals are allowed
992 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
993 remove unnecessary string literal declarations.
994 * tests/sets.at (Firsts): Likewise.
996 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
998 Don't allow an undeclared string literal, but allow a string literal to
999 be used before its declaration.
1000 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1001 symbols_pack complained.
1002 * src/symtab.c (symbol_new): Don't count a string literal as a new
1004 (symbol_class_set): Don't count a string literal as a new token, and
1005 don't assign it a symbol number since symbol_make_alias does that.
1006 (symbol_make_alias): It's not necessary to decrement the symbol and
1007 token counts anymore. Don't assume that an alias declaration occurs
1008 before any uses of the identifier or string, and thus don't assert that
1009 one of them has the highest symbol number so far.
1010 (symbol_check_alias_consistency): Complain if there's a string literal
1011 that wasn't declared as an alias.
1012 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1013 symbol_pack asserts that every token has been assigned a symbol number
1014 although undeclared string literals have not.
1015 * tests/regression.at (String alias declared after use, Undeclared
1016 string literal): New test cases.
1017 (Characters Escapes, Web2c Actions): Declare string literals as
1019 * tests/sets.at (Firsts): Likewise.
1021 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1023 In the grammar scanner, STRING_FINISH unclosed constructs and return
1024 them to the parser in order to improve error messages.
1025 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1026 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1027 * tests/input.at (Unclosed constructs): New test case.
1028 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1031 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1034 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1036 Handle string aliases for character tokens correctly.
1037 * src/symtab.c (symbol_user_token_number_set): If the token has an
1038 alias, check and set its alias's user token number instead of its own,
1039 which is set to indicate the alias. Previously, every occurrence of
1040 the character token in the grammar overwrote that alias indicator with
1042 * tests/input.at (String aliases for character tokens): New test.
1044 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1046 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1048 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1050 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1051 to prevent failures when building on older platforms.
1052 Check for autopoint failure.
1053 Set XGETTEXT_OPTIONS to values that check for C format strings,
1054 so that translators are warned about them (this also helps
1055 prevent core dumps).
1057 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1058 function, since it simplifies our code a bit.
1060 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1061 rather than -W, so we don't get bogus warnings about sign comparisons.
1062 Add -Wpointer-arith, since that warning is useful (it reports code
1063 that does not conform to C89 and that some compilers reject).
1064 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1065 since it's no longer needed.
1067 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1069 Clean up scanners a bit.
1070 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1071 definitions so gcc won't warn when obstack_for_string is unused.
1072 * src/scan-code.l: config.h and system.h are already #include'd by
1073 scan-code-c.c, so get rid of them here.
1074 * src/scan-gram.l: Likewise.
1075 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1076 definitions rather than duplicating the rest of it.
1077 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1079 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1081 Suppress signed/unsigned comparison warnings for yycheck.
1082 * data/c.m4 (b4_safest_int_type): New macro.
1083 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1084 a signed int type, cast it to b4_safest_int_type first.
1085 * data/yacc.c: Likewise.
1086 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1089 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1091 * doc/bison.texinfo: Fix some typos.
1093 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1095 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1096 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1098 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1099 the latest gnulib does this a different way.
1100 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1101 translation was patched, so stop omitting it.
1103 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1105 Enable declaration of default %printer/%destructor. Make the parser
1106 use these for all user-declared grammar symbols for which the user does
1107 not declare a specific %printer/%destructor. Thus, the parser uses it
1108 for token 0 if the user declares it but not if Bison generates it as
1109 $end. Discussed starting at
1110 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1111 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1113 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1114 * NEWS (2.3+): Mention.
1115 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1116 declare a %destructor for a mid-rule's semantic value. It's just
1117 impossible to declare one specific to it.
1118 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1119 code. Describe default %destructor form.
1120 * src/parse-gram.y (grammar_declaration): Parse default
1121 %printer/%destructor declarations.
1122 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1123 and symbol_destructor_location_get rather than accessing the destructor
1124 and destructor_location members of struct symbol.
1125 (symbol_printers_output): Likewise but for %printer's.
1126 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1128 * src/symtab.c (default_destructor, default_destructor_location,
1129 default_printer, default_printer_location): New static global
1130 variables to record the default %destructor and %printer.
1131 (symbol_destructor_get, symbol_destructor_location_get,
1132 symbol_printer_get, symbol_printer_location_get): New functions to
1133 compute the appropriate %destructor and %printer for a symbol.
1134 (default_destructor_set, default_printer_set): New functions to set the
1135 default %destructor and %printer.
1136 * src/symtab.h: Prototype all those new functions.
1137 * tests/actions.at (Default %printer and %destructor): New test to
1138 check that the right %printer and %destructor are called, that they're
1139 not called for $end, and that $$ and @$ work correctly.
1140 (Default %printer and %destructor for user-declared end token): New
1141 test to check that the default %printer and %destructor are called for
1142 a user-declared end token.
1143 * tests/input.at (Default %printer and %destructor redeclared, Unused
1144 values with default %destructor): New tests to check related grammar
1145 warnings and errors.
1147 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1149 Clean up handling of %destructor for the end token (token 0).
1150 Discussed starting at
1151 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1153 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1155 Make the skeletons consistent in how they pop the end token and invoke
1157 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1158 state, which has token number 0, since this would invoke the
1159 %destructor for the end token.
1160 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1161 until after shifting the end token, or else it won't be popped.
1162 * data/yacc.c (yyparse): Likewise.
1164 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1165 it's the end token. Upon termination, destroy an unshifted lookahead
1166 even when it's the end token.
1167 * data/lalr1.cc (yy::parser::parse): Likewise.
1168 * data/yacc.c (yyparse): Likewise.
1170 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1171 value warnings for the end token when the user gives the end token a
1174 * tests/actions.at (Printers and Destructors): Test all the above.
1176 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1178 Update to latest gnulib and gettext versions.
1179 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1181 (gnulib_files): Add m4/warning.m4. Don't worry about files
1182 overwritten by autopoint.
1183 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1184 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1186 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1187 so that we can remove the intl files at a better time.
1188 (intl_files_to_remove): Remove aclocal.m4, since it gets
1189 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1190 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1191 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1192 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1193 Remove datarootdir hack; no longer needed.
1194 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1195 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1196 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1198 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1199 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1201 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1203 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1204 it with --assume-autoconf='latest-stable'.
1206 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1208 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1209 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1211 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1212 those from muscle_tab.c since the old ones are misleading.
1214 2006-07-13 Akim Demaille <akim@epita.fr>
1216 Support %define "KEY" {VALUE}.
1217 * src/scan-code.h, src/scan-code.l (translate_action)
1218 (translate_rule_action, translate_symbol_action, translate_code):
1219 Return char *, not const char *.
1220 * src/parse-gram.y (declaration): Rename as...
1221 (prologue_declaration): this.
1222 (string_content): Remove this nonterminal, use STRING.
1223 (braceless, content, content.opt): New nonterminal.
1225 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1227 * src/scan-gram.l (getargs.h): Don't include it.
1229 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1231 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1232 rather than a for-loop that declares a local bool variable. This
1233 should work around a compatibility problem with a Cray x1e C++
1234 compiler reported by Hung Nguyen in
1235 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1236 The for-loop was introduced in the 2004-11-17 change but I don't
1237 know why it was needed.
1239 2006-07-12 Akim Demaille <akim@epita.fr>
1241 * data/c.m4: Comment changes.
1243 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
1245 * src/complain.c (error_message, ERROR_MESSAGE): New.
1247 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1248 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1250 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1252 * NEWS: Instead of %union, you can define and use your own union type
1253 YYSTYPE if your grammar contains at least one <type> tag.
1254 Your YYSTYPE need not be a macro; it can be a typedef.
1255 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1256 (Union Decl, Decl Summary): Document this.
1257 * data/glr.c (YYSTYPE): Implement this.
1258 * data/glr.cc (YYSTYPE): Likewise.
1259 * data/lalr1.cc (YYSTYPE): Likewise.
1260 * data/yacc.c (YYSTYPE): Likewise.
1261 * src/output.c (prepare): Output tag_seen_flag.
1262 * src/parse-gram.y (declaration, grammar_declaration):
1263 Use 'union_seen' rather than 'typed' to determine whether
1264 %union has been seen, since grammars can now be typed without
1266 (symbol_declaration, type.opt, symbol_def):
1267 Keep track of whether a tag has been seen.
1268 * src/reader.c (union_seen, tag_seen): New vars.
1270 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1271 * src/scan-code.l (untyped_var_seen): New variable.
1272 (handle_action_dollar): Adjust to above changes.
1273 (handle_action_dollar, handle_action_at):
1274 Improve overflow checking for outlandish numbers.
1275 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1276 avoid new diagnostics generated by above changes.
1277 * tests/regression.at (YYSTYPE typedef): Add test to check
1278 for type tags without %union.
1280 * src/symlist.c (symbol_list_length): Return int, not unsigned
1281 int, since callers expect int. This may need to get revisited
1282 once we have proper integer overflow checking.
1284 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1285 object is now static.
1287 * src/getargs.c (flags_argmatch): Return void, not int,
1288 to pacify ./configure --enable-gcc-warnings.
1290 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1291 since last_string is already defined to FLEX_PREFIX (last_string).
1293 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1295 Implement --warnings/-W.
1296 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1298 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1300 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1301 (warnings_args, warnings_types): New.
1302 (getargs, short_options, long_options): Accept -W/--warnings.
1303 Sort the options by alphabetical order, upper case letter right
1304 before its lower case.
1306 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1308 Change %merge result type clash warnings to errors. Discussed at
1309 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1310 * src/reader.c (record_merge_function_type): Use complain_at.
1311 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1312 declared later): Update test case results.
1314 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1316 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1317 to be in alphabetical order.
1318 (trace_args): Spelling fixes.
1320 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1322 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1323 so they don't collide with user-defined macros.
1324 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1325 this was never guaranteed, and now that we're using gnulib stdint,
1326 which defines int_fast16_t to long int, the problem is exposed.
1328 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1330 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1331 need the full POSIX semantics (and weren't implementing them
1334 Adjust to Autoconf 2.60 and today's gnulib.
1335 * bootstrap (gnulib_modules): Add stdint.
1336 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1337 no longer copies it.
1338 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1339 since stdint needs the former and wcwidth (which is now required
1340 by mbswidth) needs the latter.
1341 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1342 work around a compatibility glitch between gettext 0.14.6 and
1344 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1345 Do not check for uintptr_t, since new stdint module does the right
1347 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1348 Add stdint.h, stdint_.h, wcwidth.h.
1349 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1350 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1351 stdint.m4, wchar_t.m4, wcwidth.m4.
1352 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1353 usual order for ../lib/*.h files.
1354 (file_name_split): Use last_component, not base_name, to adjust
1356 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1357 for ../lib/*.h files.
1358 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1359 Define unconditionally, since we now assume the stdint module.
1360 * src/scan-skel.l: Include <dirname.h>.
1361 (BASE_QPUTS): Use last_component, not base_name.
1362 * src/system.h: Include <unlocked-io.h> in the usual order
1363 for ../lib/*.h files. Include <stdint.h> unconditionally,
1364 since we now use the stdint module.
1365 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1366 HAVE_UINTPTR_T, since we now use the stdint module.
1367 (base_name): Remove decl, since files now include <dirname.h>
1370 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1372 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1374 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1375 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1377 * tests/calc.at: Adjust.
1379 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1381 * data/c.m4 (b4_basename): New.
1382 (b4_syncline): Also output the location of its invocation (from
1384 (b4_user_action, b4_define_user_action, b4_user_actions)
1385 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1386 (b4_user_stype): New.
1387 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1389 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1391 In the grammar file, the first column is 1 not 0 on the first line as
1392 on every other line.
1393 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1394 * tests/input.at (Torturing the Scanner): Update output.
1396 * src/scan-gram.l (scanner_cursor): Declare it static.
1398 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1400 In warnings, say "previous declaration" rather than "first
1402 * src/symtab.c (redeclaration): Do that here.
1403 * src/reader.c (record_merge_function_type): In the case of a result
1404 type clash, report the previous declaration rather than the very first
1405 one in the grammar file.
1406 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1407 declared later): Add a third declaration to check this behavior.
1408 * tests/input.at (Incompatible Aliases): Update output.
1410 2006-06-27 Akim Demaille <akim@epita.fr>
1412 * doc/Doxyfile.in: New.
1413 * doc/Makefile.am: Use it.
1414 * src/lalr.h, src/symtab.h: Initial doxygenation.
1416 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1418 Don't miss %merge result type warnings just because the LHS types are
1419 declared after the %merge. This continues the effort of the previous
1421 * src/reader.c (get_merge_function): Don't set the merger type yet.
1422 (record_merge_function_type): New function for setting the merger type
1423 and checking for clashes.
1424 (grammar_current_rule_merge_set): Set the location of the %merge for
1426 (packgram): Invoke record_merge_function_type for each rule now that
1427 all symbol type declarations have been parsed.
1428 * src/reader.h (merger_list.type_declaration_location): New member
1429 storing the location of the first %merge from which the type for this
1430 merging function was derived.
1431 * src/symlist.h (symbol_list.merger_declaration_location): New member
1432 storing the location of a rule's %merge, if any.
1433 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1434 declared later): New test to catch the error fixed by the above patch.
1436 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1438 Get action warnings (grammar_rule_check) right even when symbol
1439 declarations appear after the rules. Discussed at
1440 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1442 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1443 Don't mistake the type of $$ in a midrule to be that of its parent
1445 * src/reader.c (grammar_current_rule_end): Don't invoke
1446 grammar_rule_check yet since not all symbol declarations may have been
1448 (grammar_midrule_action): Likewise.
1449 Don't record whether the midrule's $$ has been used yet since actions
1450 haven't been translated yet.
1451 Record the midrule's parent rule and its RHS index within the parent
1453 (grammar_current_rule_action_append): Don't translate the action yet
1454 since not all symbol declarations may have been parsed yet and, thus,
1455 warnings about types for $$, $n, @$, and @n can't be reported yet.
1456 (packgram): Translate the action and invoke grammar_rule_check now that
1457 all symbol declarations have been parsed.
1458 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1459 after parsing the entire grammar file, the symbol list here in the case
1460 of a midrule is actually the midrule's empty RHS, so reference its
1461 parent rule's RHS where necessary.
1462 On the other hand, now that you can already know it's a midrule, you
1463 aren't forced to think $$ has the same type as its parent rule's $$.
1464 (handle_action_at): In the case of a midrule, reference the parent rule
1466 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1468 (symbol_list_length): Now that this is invoked after all rules have
1469 been parsed, a NULL symbol (rather than a NULL symbol list node)
1470 terminates a rule. symbol_list_print already does this correctly.
1471 * src/symlist.h (symbol_list.midrule_parent_rule,
1472 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1473 remember their relationships with their parents.
1474 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1475 fixed by the above patch.
1476 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1478 (Unused values): ... this old test case and...
1479 (Unused values before symbol declarations): ... this new test case.
1480 This one is the same as `Unused values' except that all symbol
1481 declarations appear after the rules in order to catch the rest of the
1482 errors fixed by the above patch.
1484 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1487 * src/reader.c (current_rule): Declare it static since it's no longer
1488 used outside this file.
1489 (grammar_current_rule_action_append): Remove redundant arguments from
1490 translate_rule_action invocation.
1491 * src/reader.h (current_rule): Remove this unused extern.
1492 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1493 * src/scan-code.l (translate_rule_action): Likewise.
1495 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1497 Clean up yesterday's patch.
1498 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1500 * src/reader.c (grammar_current_rule_action_append): ... here for
1501 consistency with grammar_current_rule_symbol_append.
1502 * tests/regression.at (Braced code in declaration in rules section):
1503 Make yyerror and yylex static as usual.
1505 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1507 Fix bug that mistakes braced code in a declaration in the rules section
1508 to be a rule action. Mentioned at
1509 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1510 * src/scan-gram.l: Move midrule action detection from the start of the
1511 scanning of any braced code to...
1512 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1513 action. For readability, use $2 and @2 rather than the equivalent
1515 * tests/regression.at (Braced code in declaration in rules section):
1516 New test to catch the error fixed by the above patch.
1518 Work on code readability some.
1519 * src/scan-code.l (current_rule): Get rid of this misleading and
1520 redundant declaration: it's actually extern'ed in reader.h.
1521 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1522 translate_action): Add a rule argument and use it instead of the global
1524 (translate_rule_action): This already receives current_rule through an
1525 argument, so pass it on to translate_action instead of assigning
1526 current_rule to current_rule.
1527 (translate_symbol_action, translate_code): Pass rule = NULL to
1530 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1532 Rename %before-definitions to %start-header and %after-definitions to
1533 %end-header. Don't use these declarations to separate pre-prologue
1534 blocks from post-prologue blocks. Add new order-independent
1535 declarations %before-header and %after-header as alternatives to the
1536 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1537 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1538 * NEWS (2.3+): Update for these changes.
1539 * data/glr.c (b4_before_definitions): Update to...
1540 (b4_start_header): ... this.
1541 (b4_after_definitions): Update to...
1542 (b4_end_header): ... this.
1543 * data/glr.cc: Likewise.
1544 * data/lalr1.cc: Likewise.
1545 * data/yacc.c: Likewise.
1546 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1547 prologue blocks with %*-header declarations.
1548 (Calc++ Parser): Likewise.
1549 (Bison Declaration Summary): Update names.
1550 (Bison Symbols): Update description.
1551 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1552 (PERCENT_END_HEADER): ... this.
1553 (PERCENT_BEFORE_DEFINITIONS): Update to...
1554 (PERCENT_START_HEADER): ... this.
1555 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1556 (declaration): Update token names and m4 macro names.
1557 When parsing %end-header and %start-header, invoke translate_code
1558 before muscle_code_grow, and no longer set global booleans to remember
1559 whether these declarations have been seen.
1560 Parse new %after-header and %before-header.
1561 * src/reader.c (before_definitions, after_definitions): Remove.
1562 (prologue_augment): Accept a new bool argument to specify whether to
1563 augment the pre-prologue or post-prologue.
1564 * src/reader.h (before_definitions, after_definitions): Remove these
1566 (prologue_augment): Add new bool argument.
1567 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
1568 (PERCENT_END_HEADER): ... this.
1569 (PERCENT_BEFORE_DEFINITIONS): Update to...
1570 (PERCENT_START_HEADER): ... this.
1571 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1572 * tests/actions.at (Printers and Destructors): Update names.
1574 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1576 Add comparison operators for C++ location classes. Discussed at
1577 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
1578 * data/c++.m4 (b4_define_location_comparison): New boolean %define
1579 declaration indicating whether filename_type has an operator==. If
1580 filename_type is `std::string', it defaults to `1', `0' otherwise.
1581 * data/location.cc: Iff b4_define_location_comparison is `1', add
1582 operator== and operator!= for class position and for class location.
1585 * src/scan-action.l: Remove unused file.
1586 * src/symtab.c (symbol_printer_set): Use printer_location not
1587 destructor_location.
1588 * src/symtab.h (struct symbol): Replace incorrect source comment for
1590 * tests/input.at (Incompatible Aliases): Update output with correct
1593 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1595 Don't put the pre-prologue in the header file. For the yacc.c code
1596 file and the glr.c header and code files, move the pre-prologue before
1597 the token definitions. Add new %before-definitions and
1598 %after-definitions to declare code that will go in both the header file
1599 and code file. Discussed at
1600 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
1601 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
1603 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
1604 * NEWS (2.3+): Describe these changes.
1605 * data/glr.c (b4_pre_prologue): Move from within to before...
1606 (b4_shared_declarations): ... this.
1607 Add new b4_before_definitions before b4_token_enums.
1608 Add new b4_after_definitions at the end.
1609 * data/glr.cc (b4_pre_prologue): Replace with...
1610 (b4_before_definitions): ... this in the header file.
1611 (b4_after_definitions): New near the end of the header file.
1612 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
1613 code file right before including the header file.
1614 (b4_before_definitions): New in the previous position of
1615 b4_pre_prologue in the header file.
1616 (b4_after_definitions): New near the end of the header file.
1617 * data/yacc.c: Clean up some m4 quoting especially in the header file.
1618 (b4_token_enums_defines): In the code file, move to right before
1619 YYSTYPE for consistency with the header file.
1620 (b4_before_definitions): New right before b4_token_enums_defines in
1621 both the header and code file.
1622 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
1623 header and code file.
1624 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
1625 of prologues for %union dependencies.
1626 (Bison Declaration Summary): In %defines description, mention the
1627 effect of %before-definitions and %after-definitions on the header
1629 (Calc++ Parser): Forward declare driver in a %before-definitions rather
1630 than in the pre-prologue so that make check succeeds.
1631 (Bison Symbols): Add entries for %before-definitions and
1633 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
1634 %before-definitions.
1635 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
1636 (declaration): Parse those declarations and append to
1637 b4_before_definitions and b4_after_definitions, respectively.
1638 * src/reader.c (before_definitions, after_definitions): New bools to
1639 track whether those declarations have been seen.
1640 (prologue_augment): Add to the post-prologue if %union,
1641 %before-definitions, or %after-definitions has been seen.
1642 * src/reader.h (before_definitions, after_definitions): New extern's.
1643 * src/scan-gram.l: Scan the new declarations.
1644 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
1645 prologue block in a %before-definitions or a %after-definitions based
1646 on whether the %union is declared.
1647 * tests/regression.at (Early token definitions with --yacc, Early token
1648 definitions without --yacc): Move tests for token definitions into the
1649 post-prologue since token names are no longer defined in the
1652 2006-06-20 Akim Demaille <akim@epita.fr>
1654 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1655 (symbol_get): Use it.
1656 * src/parse-gram.y: Use it.
1658 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1660 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1661 build succeeds when configured with --enable-gcc-warnings.
1663 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1665 * src/parse-gram.y (char_name): New function.
1666 (CHAR, STRING, string_content): For %printer, properly escape.
1667 (ID): Prefer fputs to fprintf.
1668 (id): Reindent to be consistent with other rules.
1669 Properly quote char.
1671 The Translation Project changed its way of publishing translations
1672 to maintainers. I haven't received any responses to my request
1673 for supporting the old way, or for documenting the new way. I
1674 have modified 'bootstrap' to use screen scraping
1675 (in this case, HTML scraping). This is unreliable and inelegant,
1676 but I don't see any better way. Yuck.
1677 * bootstrap (TP_URL, WGET_COMMAND): New vars.
1678 (get_translations): New function, which uses HTML scraping to
1679 deduce locations of latest translations.
1680 Use this function to grab both bison and bison-runtime .po files.
1681 Don't bother priming the pump for the runtime-po domain any more,
1682 as it's now translated better than bison is.
1684 2006-06-19 Akim Demaille <akim@epita.fr>
1686 * src/scan-gram.l: No longer "parse" things after `%union' until
1687 `{'. Rather, return a single "%union" token.
1688 No longer make symbols: return strings, and leave the conversion
1689 to symbols to the parser.
1690 (SC_PRE_CODE, token_type): Remove.
1691 * src/parse-gram.y (%union): New field `character'.
1694 (ID, ID_COLON): Now that the scanner no longer makes them
1695 identifiers, adjust all uses to invoke symbol_get.
1696 (id_colon): New, wraps the conversion from string to symbol.
1697 (%union): Accept a possible union_name.
1698 (symbol): Now can be a char.
1699 * data/c.m4 (b4_union_name): Leave a default value.
1700 * data/glr.c, data/yacc.c: Use it.
1702 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1704 For associating token numbers with token names for "yacc.c", don't use
1705 #define statements unless `--yacc' is specified; always use enum
1706 yytokentype. Most important discussions start at:
1707 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1708 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1710 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1711 * NEWS (2.3+): Mention.
1712 * data/c.m4 (b4_yacc_if): New.
1713 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1715 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1716 on token name definitions.
1717 * src/getargs.c (usage): Capitalize `Yacc' in English.
1718 * src/output.c (prepare): Define b4_yacc_flag.
1719 * tests/regression.at (Early token definitions): Test that tokens names
1720 are defined before the pre-prologue not just before the post-prologue.
1721 Remove this test case and copy to...
1722 (Early token definitions with --yacc): ... this to test #define's.
1723 (Early token definitions without --yacc): ... and this to test enums.
1725 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1727 * NEWS: Reword the post-2.3 change to not be so optimistic about
1728 removing the old "look-ahead" spelling.
1729 Update previous look-ahead/lookahead change reports.
1730 * REFERENCES: look-ahead -> lookahead (since that's
1731 what he actually wrote).
1732 * doc/refcard.tex: look ahead -> lookahead,
1733 look-ahead -> lookahead
1735 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1737 For consistency, use `lookahead' instead of `look-ahead' or
1738 `look_ahead'. Discussed starting at
1739 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1741 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1742 * NEWS: For the next release, note the change to `--report'.
1743 * TODO, doc/bison.1: Update English.
1744 * doc/bison.texinfo: Update English.
1745 (Understanding Your Parser, Bison Options): Document as
1746 `--report=lookahead' rather than `--report=look-ahead'.
1747 * src/conflicts.c: Update English in comments.
1748 (lookahead_set): Rename from look_ahead_set.
1749 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1750 (resolve_sr_conflict): Rename local look_ahead_tokens to
1751 lookahead_tokens, and update other uses.
1752 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1753 count_rr_conflicts, conflicts_free): Update uses.
1754 * src/getargs.c (report_args): Move "lookahead" before alternate
1756 (report_types): Update uses.
1757 (usage): For `--report' usage description, state `lookahead' spelling
1758 rather than `look-ahead'.
1759 * src/getargs.h (report.report_lookahead_tokens): Rename from
1760 report_look_ahead_tokens.
1761 * src/lalr.c: Update English in comments.
1762 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1763 (state_lookahead_tokens_count): Rename from
1764 state_look_ahead_tokens_count.
1765 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1766 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1767 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1769 Update English in output.
1770 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1771 * src/print.c: Update English in comments.
1772 (lookahead_set): Rename from look_ahead_set.
1773 (print_reduction): Rename argument lookahead_token from
1775 (print_core, state_default_rule, print_reductions, print_results):
1777 * src/print_graph.c: Update English in comments.
1778 (print_core): Update uses.
1779 * src/state.c: Update English in comments.
1780 (reductions_new): Update uses.
1781 (state_rule_lookahead_tokens_print): Rename from
1782 state_rule_look_ahead_tokens_print, and update other uses.
1783 * src/state.h: Update English in comments.
1784 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1785 (state_rule_lookahead_tokens_print): Rename from
1786 state_rule_look_ahead_tokens_print.
1787 * src/tables.c: Update English in comments.
1788 (conflict_row, action_row): Update uses.
1789 * tests/glr-regression.at
1790 (Incorrect lookahead during deterministic GLR,
1791 Incorrect lookahead during nondeterministic GLR): Rename
1792 print_look_ahead to print_lookahead.
1793 * tests/torture.at: Update English in comments.
1794 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1795 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1796 (Many lookahead tokens): Update uses.
1797 * data/glr.c: Update English in comments.
1798 * lalr1.cc: Likewise.
1800 * src/conflicts.h: Likewise.
1801 * src/lalr.h: Likewise.
1802 * src/main.c: Likewise.
1803 * src/output.c: Likewise.
1804 * src/parse-gram.c: Likewise.
1805 * src/tables.h: Likewise.
1806 * tests/calc.at: Likewise.
1808 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1810 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1812 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1814 * TODO: Add request from Nelson H. F. Beebe to be able to install
1815 Bison without installing the yacc script.
1817 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1819 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1820 and yytext if they're already #define'd.
1821 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1822 * src/scan-code-c.c: ... here.
1823 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1826 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1828 Get Bison to build again when configured with --enable-gcc-warnings.
1829 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1831 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1832 loc argument as it shadows a global.
1833 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1836 * src/.cvsignore: Add scan-code.c.
1838 2006-06-07 Akim Demaille <akim@epita.fr>
1840 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1842 * src/scan-code.l: here.
1843 * tests/input.at (Torturing the Scanner): Fix another location
1846 2006-06-07 Akim Demaille <akim@epita.fr>
1848 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1850 2006-06-06 Akim Demaille <akim@epita.fr>
1852 Extract the parsing of user actions from the grammar scanner.
1853 As a consequence, the relation between the grammar scanner and
1854 parser is much simpler. We can also split "composite tokens" back
1856 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1857 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1859 * src/location.h, src/location.c (add_column_width)
1860 (location_compute): these.
1861 Fix the column count: the initial column is 0.
1862 (location_print): Be robust to ending column being 0.
1863 * src/location.h (boundary_set): New.
1864 * src/main.c: Adjust to scanner_free being renamed as
1866 * src/output.c: Include scan-code.h.
1867 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1869 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
1870 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
1871 which is now, again, a separate token.
1872 Adjust all dependencies.
1873 Whereever actions with $ and @ are used, use translate_code.
1874 (action): Remove this nonterminal which is now useless.
1875 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
1876 (grammar_current_rule_action_append): Use translate_code.
1877 (packgram): Bound check ruleno, itemno, and rule_length.
1878 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
1879 (last_string, last_braced_code_loc, max_left_semantic_context)
1880 (scanner_initialize, scanner_free, scanner_last_string_free)
1881 (gram_out, gram_lineno, YY_DECL_): Move to...
1882 * src/scan-gram.h: this new file.
1883 (YY_DECL): Rename as...
1885 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
1886 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1887 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1888 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1889 Move these declarations, and...
1890 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
1892 * src/flex-scanner.h: this new file.
1893 * src/scan-gram.l (rule_length, rule_length_overflow)
1894 (increment_rule_length): Remove.
1895 (last_braced_code_loc): Rename as...
1896 (gram_last_braced_code_loc): this.
1897 Adjust to the changes of the parser.
1898 Move all the handling of $ and @ into...
1899 * src/scan-code.l: here.
1900 * src/scan-gram.l (handle_dollar, handle_at): Remove.
1901 (handle_action_dollar, handle_action_at): Move to...
1902 * src/scan-code.l: here.
1903 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
1904 scan-code.h, scan-code-c.c, scan-gram.h.
1905 (EXTRA_bison_SOURCES): Add scan-code.l.
1906 (BUILT_SOURCES): Add scan-code.c.
1907 (yacc): Be robust to white spaces.
1909 * tests/conflicts.at, tests/input.at, tests/reduce.at,
1910 * tests/regression.at: Adjust the column numbers.
1911 * tests/regression.at: Adjust the error message.
1913 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1915 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1916 Use Akim's wording from
1917 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
1919 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1921 Between Bison releases, manually append `+' to the previous Bison
1922 release number, and use that as a signal to automatically print the
1923 ChangeLog's CVS Id keyword from --version. Discussed starting at
1924 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
1925 * ChangeLog: Add Id header.
1926 * configure.ac (AC_INIT): Append `+' to `2.3'.
1927 * src/.cvsignore: Add revision.c.
1928 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1929 (BUILT_SOURCES): Add revision.c.
1930 (revision.c): New target rule. This file defines a new global variable
1931 named revision. It initializes it with either the Id from ChangeLog
1932 or, if VERSION doesn't contain `+', with the empty string.
1933 * src/getargs.c (version): Print the value of revision.
1934 * src/revision.h: Extern revision.
1936 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1938 * NEWS: Version 2.3.
1939 * configure.ac (AC_INIT): Likewise.
1941 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1943 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1944 with no arguments, not as an object-like macro. This is for
1945 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1946 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1947 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1950 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1952 * src/getargs.c (usage): Back out yesterday's modification of the
1953 --help output so that we don't have to wait for translation before
1956 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1958 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1959 Problem reported by Akim Demaille.
1961 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1963 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1965 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1967 * data/yacc.c (yy_reduce_print): Omit trailing white space in
1968 generated source code. Problem reported by Frans Englich in
1969 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
1971 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1973 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
1974 shell, not within 'make', so that 'make' by an ordinary builder
1975 (using GNU make) does not worry about configuring gzip. This also
1976 works around a bug reported independently by Keith Thompson and by
1977 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
1978 stderr rather than stdout, messing up the build logs.
1980 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1982 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
1983 to make sure that YYID will never be unused. This fixes a 'make
1984 maintainer-check' failure caused by the recent changes to the 'Trivial
1985 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
1987 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
1989 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1991 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
1992 state before an empty RHS is always resolved here. Only the location
1993 of that state is guaranteed to be resolved, and that's enough. This
1994 fixes the remaining bug reported by Derek M. Jones in
1995 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1996 * tests/glr-regression.at (Uninitialized location when reporting
1997 ambiguity): Test the above case.
1998 Also, the embedded comments in this test case claim it checks the case
1999 of an empty RHS that has inherited the initial location. However, the
2000 corresponding LHS was already resolved, so yyresolveLocations didn't
2001 actually have reason to modify it. Fix this by forcing
2002 nondeterministic operation at the beginning of the parse.
2004 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2006 * data/c.m4 (b4_yy_symbol_print_generate):
2007 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2008 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2009 of the bugs reported today by Derek M Jones in
2010 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2011 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2012 defined to be a type name without parens or brackets.
2013 (Location Type): Similarly for YYLTYPE.
2014 * tests/regression.at (Trivial grammars): Put in a test for this
2015 bug that will be caught by 'make maintainer-check' (though not,
2016 alas, by 'make check' unless your compiler is picky).
2018 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2020 * NEWS: Version 2.2.
2021 * configure.ac (AC_INIT): Likewise.
2023 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2025 * data/glr.c (yyreportTree): Make room in yystates for the state
2026 preceding the RHS. This fixes the segmentation fault reported by Derek
2028 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2029 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2030 to the user. Reported for yyreportTree by Derek M. Jones later in the
2032 * THANKS: Add Derek M. Jones.
2033 Update my email address.
2034 Fix typo in Steve Murphy's name.
2036 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2038 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2039 checking against YYLAST that caused the parser to miss a potential
2040 alternative in its diagnostic.
2041 Problem reported by Maria Jose Moron Fernandez in
2042 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2043 * data/lalr1.cc (yysyntax_error_): Likewise.
2044 * data/yacc.c (yysyntax_error): Likewise.
2045 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2046 tokens, in case we run into an older C compiler.
2047 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2048 Use them to check for the off-by-one error fixed above.
2050 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2051 YYSIZE_T, not size_t.
2052 * tests/regression.at (Trivial grammars): New test, to catch
2053 the error fixed by the above patch.
2055 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2057 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2059 Reported by Steve Murphy.
2061 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2063 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2064 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2066 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2068 Implement --trace=m4.
2069 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2070 * src/output.c (output_skeleton): When set, pass -dV to m4.
2072 Factor the handling of flags in m4.
2073 * src/output.c (prepare): Rename the muscle names debug, defines,
2074 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2075 * data/c.m4: Adjust.
2076 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2077 Use b4_define_flag_if to define other b4_FLAG_if macros.
2078 (b4_location_if): As a consequence, rename as...
2079 (b4_locations_if): this, for consistency.
2080 Adjust all the skeletons.
2082 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2084 * etc/bench.pm: Shorten bench names.
2086 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2088 * src/output.h, src/output.c (error_verbose): Move to...
2089 * src/getargs.h, src/getargs.c: here.
2091 Adjust dependencies.
2093 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2095 * data/c.m4 (b4_copyright): Put the special exception for Bison
2096 skeletons here, so we don't have to put it in each skeleton. All
2097 uses changed. Suggested by Akim Demaille. Also, wrap the
2098 copyright notice, in case it is longer than 80 columns. Replace
2099 comma by newline after title.
2101 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2103 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2104 incompatibility, not a bug. Mention that it wasn't fixed as of
2107 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2109 * examples/extexi: Enforce the precedence of concatenation over
2111 Reported by Tommy Nordgren.
2113 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2115 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2116 with the member "token".
2117 Reported by Martin Nylin.
2119 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2121 * data/glr.c: Switch to Bison 2.2 special-exception language in
2122 the copyright notice. Use more-regular format for titles and
2124 * data/glr.cc: Likewise.
2125 * data/location.cc: Likewise.
2126 * data/yacc.cc: Likewise.
2127 * doc/bison.texinfo (Conditions): Document this.
2128 * NEWS: likewise. Upgrade version to 2.2.
2130 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
2132 * data/glr.cc: Remove dead code.
2134 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2136 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2137 that variable and the line breaks the bootstrap. Problem reported
2138 by Juan M. Guerrero.
2140 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2142 * doc/bison.texinfo (Multiple start-symbols): New.
2144 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2146 * etc/README, etc/bench.pl: New.
2148 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
2150 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2152 Reported by Mickael Labau.
2153 * tests/input.at (Torturing the Scanner): Test it.
2155 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2157 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2158 Problem reported by Bob Rossi.
2160 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2162 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2163 and didn't really work.
2164 For the index, use @ifnotinfo, not @iftex.
2165 Minor cleanups of spacing and terminology.
2167 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2169 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2170 of AT_NAME_PREFIX when %name-prefix is not used.
2172 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2174 Apply --prefix to C++ skeletons too: they change the namespace.
2175 The test suite already exercize these cases.
2176 * data/c++.m4 (b4_namespace): New.
2177 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2178 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2179 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2180 * doc/bison.texinfo: Document it.
2181 (Option Cross Key): Use @multitable in all formats. It looks
2182 nicer, even in TeX outputs.
2183 (Rules): Use the same code whatever the output type is.
2184 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2185 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2186 * tests/calc.at: Use it, instead of hard coding `yy'.
2188 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2190 * TODO: Remove dead items.
2192 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2194 * doc/FAQ: Remove, merged into...
2195 * doc/bison.texinfo (FAQ): this.
2196 * doc/Makefile.am (EXTRA_DIST): Adjust.
2198 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2200 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2202 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2203 * doc/bison.texinfo (Calc++ Scanner): Use it.
2205 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2207 Fix two nits reported by twlevo, plus one more that I discovered.
2209 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2210 this is the usual Bison style.
2211 * src/location.h (location_print): Likewise.
2213 * src/reader.h (token_name): Likewise.
2215 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2217 Fix some nits reported by twlevo.
2218 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2219 and "POSIX". Use more-modern syntax for URLs. Mention C++
2220 and ask for Java. Don't hardwire OS version numbers. Add
2222 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2223 * src/conflicts.c (solved_conflicts_obstack): Now static.
2225 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2227 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2228 page. Say "you can use it" not "you may use it" as on the web page;
2229 we're describing capabilities not granting permission.
2231 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2233 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2234 shadowing warnings. Use usual patter for iterating through RHS.
2235 * tests/glr-regression.at
2236 (Uninitialized location when reporting ambiguity):
2237 Modify yylex so that it uses its argument, rather than trying
2238 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2239 const char -> char const.
2241 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2242 Don't use tabs inside commands; it messes up 'ps'.
2243 Problem reported by twlevo.
2245 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2247 * tests/glr-regression.at (Uninitialized location when reporting
2248 ambiguity): New test case.
2249 * data/glr.c (yyresolveLocations): New function, which uses
2251 (yyresolveValue): Invoke yyresolveLocations before reporting an
2253 * doc/bison.texinfo (Default Action for Locations): Note
2254 YYLLOC_DEFAULT's usage for ambiguity locations.
2255 (GLR Semantic Actions): Cross-reference those notes.
2257 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2259 * tests/glr-regression.at (Leaked semantic values when reporting
2260 ambiguity): Remove unnecessary union and type declarations.
2261 (Leaked lookahead after nondeterministic parse syntax error): New test
2263 * data/glr.c (yyparse): Check for zero stacks remaining before
2264 attempting to shift the lookahead so that you don't lose it.
2266 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2268 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2269 * tests/glr-regression.at (Leaked semantic values when reporting
2270 ambiguity): New test case.
2271 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2272 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2273 now unnecessary yystackp parameter.
2274 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2275 destructors can be called.
2277 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2278 in existing testcases.
2280 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2282 Don't leak semantic values for parent RHS when a user action cuts the
2283 parser, and clean up related code a bit.
2284 * tests/glr-regression.at (Leaked merged semantic value if user action
2285 cuts parse): Rename to...
2286 (Leaked semantic values if user action cuts parse): ... this. Add check
2287 for leaked parent RHS values.
2288 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2289 between an unresolved state (non-empty chain of semantic options) and
2290 an incomplete one (signaled by an empty chain).
2291 (yyresolveStates): Document the interface. Move all manipulation of a
2292 successfully or unsuccessfully resolved yyGLRState to...
2293 (yyresolveValue): ... here so that yyresolveValue always leaves a
2294 yyGLRState with consistent data and thus is easier to understand.
2295 Remove the yyvalp and yylocp parameters since they are always just
2296 taken from the yys parameter. When reporting a discarded merged value
2297 in debugging output, note that it is incompletely merged. Document the
2299 (yyresolveAction): If resolving any of the RHS states fails, destroy
2300 them all rather than leaking them. Thus, as long as user actions are
2301 written to clean up the RHS correctly, yyresolveAction always cleans up
2302 the RHS of a semantic option. Document the interface.
2304 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2306 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2307 led to a segmentation fault in GNU Pascal. Problem reported
2310 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2312 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2313 mid-rule action inside a nonterminal symbol in order to declare a
2314 destructor for its semantic value.
2316 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2318 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2319 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2320 __cplusplus && ! defined _STDLIB_H && !
2321 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2322 defined free))]: Include <stdlib.h> rather than rolling our own
2323 declarations of malloc and free, to avoid problems with
2324 incompatible declarations (using 'throw') C++'s stdlib.h. This
2325 should fix Debian bug 340012
2326 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2327 reported by Guillaume Melquiond.
2329 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2331 * NEWS: Clarify symbols versus types in unused-value warnings.
2333 * configure.ac (AC_INIT): Bump version number.
2335 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2337 * NEWS: Version 2.1a.
2338 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2339 since C99 requires this.
2341 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2343 * m4/c-working.m4: New file.
2344 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2346 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2348 * Makefile.maint: Merge from coreutils.
2350 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2352 More portability fixes for problems summarized by Nelson H. F. Beebe.
2354 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2355 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2356 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2357 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2358 messes up because C++ code is compiled in 32-bit mode but linked
2361 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2363 More portability fixes for problems summarized by Nelson H. F. Beebe.
2365 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2366 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2368 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2369 nodist_PROGRAMS, since we don't need to actually compile the
2370 example if we're just doing a plain 'make'. This avoids bothering
2371 the installer unnecessarily about problems due to weird C++
2374 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2376 More portability fixes for problems summarized by Nelson H. F. Beebe.
2378 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2379 than #include "...", and compile with -I'.'. The old method was
2380 not portable, according to Posix and the C standard, and it does
2381 not work with Sun C 5.7, where previous #line directives affect
2382 the working directory used in later #include "..." directives.
2384 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2386 Various DJGGP specific issues in /djgpp
2388 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2390 More portability fixes for problems summarized by Nelson H. F. Beebe.
2392 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2393 '#include <map>' works and that you can apply ++ to iterators.
2395 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2397 Work around portability problems summarized by Nelson H. F. Beebe in
2398 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2400 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2401 that '#include <string>' works.
2403 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2404 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2405 "warning: sorry: semantics of inline function static data `const
2406 unsigned char translate_table[262]' are wrong (you'll wind up with
2409 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2410 or, xor to not_, and_, or_, and xor_, respectively. This works
2411 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2412 random system header somewhere that includes the equivalent of
2415 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2416 -E" works; it apparently doesn't work with PathScale EKO Compiler
2419 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2421 During deterministic GLR operation, user actions should be able to
2422 influence the parse by changing yychar. To make this easier to fix and
2423 to make glr.c easier to evolve in general, don't maintain yytoken in
2424 parallel with yychar; just compute yytoken when needed.
2425 * tests/glr-regression.at (Incorrect lookahead during deterministic
2426 GLR): Check that setting yychar in a user action has the intended
2428 * data/glr.c (yyGLRStack): Remove yytokenp member.
2429 (yyclearin): Don't set *yytokenp.
2430 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2431 yychar rather than *yytokenp to determine the current lookahead.
2432 Compute yytoken locally when needed.
2433 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2436 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2437 after `--report' documentation.
2439 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2441 * src/parse-gram.y (grammar_declaration): Location of printer
2442 symbol is @1, not list->location. Bug reported by twlevo.
2443 * tests/input.at (Incompatible Aliases): Adjust to above change.
2445 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2447 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2448 all the test at once. This makes the output easier to read in the
2451 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2452 got from <http://bro-ids.org/download.html>. The bug is that
2453 when two actions appeared in succession, the second one was
2454 scanned before the first one was added to the grammar rule
2455 as a midrule action. Bison then output the incorrect warning
2456 "parse.y:905.17-906.36: warning: unused value: $3".
2457 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2458 associated with a value.
2459 (rhs): Don't invoke grammar_current_rule_action_append.
2460 (action): Invoke it here instead.
2461 * src/reader.c (grammar_midrule_action): Now extern.
2462 (grammar_current_rule_action_append): Don't invoke
2463 grammar_midrule_action; that is now the scanner's job.
2464 * src/reader.h (last_string, last_braced_code_loc):
2465 (grammar_midrule_action): New decls.
2466 * src/scan-gram.l (last_string): Now extern, sigh.
2467 (last_braced_code_loc): New extern variable.
2468 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2469 rule already has an action.
2470 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2471 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2472 Add some tests to check that the above changes fixed the bug.
2474 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2476 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2477 All used changed. Check whether the symbol has a destructor,
2478 not whether it is typed.
2479 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2480 that the values are still reported as unused. All line numbers
2483 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2485 Work around a bug in bro 0.8, which underparenthesizes its
2486 definition of YYLLOC_DEFAULT.
2487 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2489 * data/lalr1.cc: Likewise.
2490 * data/yacc.cc: Likewise.
2492 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2494 Work around a bug in Pike 7.0, and give the Pike folks a
2495 better way to override the usual int widths.
2496 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2497 user can override the types.
2498 (short): #undef, to work around a bug in Pike 7.0.
2499 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2500 (union yyalloc.yyss): Use yytype_int16 rather than short.
2502 (yysigned_char): Remove.
2503 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2504 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2505 * tests/regression.at (Web2c Actions): Adjust to above changes.
2507 * src/reader.c (check_and_convert_grammar): New function.
2508 (reader): Close the input file even if something went wrong during
2509 parsing. Minor file descriptor leak reported by twlevo.
2511 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2512 to pacify gcc -Wswitch-default.
2513 * src/scan-gram.l (adjust_location): Use a default: break; case
2514 to pacify gcc -Wswitch-default.
2515 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2516 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2517 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2518 Move these decls to scan-skel.l, since they don't need to be
2520 * src/scan-skel.l: Accept the above decls.
2521 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2524 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2526 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2527 since we don't want to insist on a version number at the start
2528 of the changelog every time.
2529 * Makefile.maint: Sync from coreutils a bit better.
2530 (sc_trailing_blank): Renamed from sc_trailing_space.
2532 (sc_no_if_have_config_h, sc_require_config_h):
2533 (sc_prohibit_assert_without_use): New rules.
2534 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2535 (sc_dd_max_sym_length): Fix leading spaces in rule.
2536 (sc_system_h_headers): Prefix with @.
2537 (sc_useless_cpp_parens, m4-check): Output line numbers.
2538 (changelog-check): Allow version only in head.
2539 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2540 satisfy new Makefile.maint rule.
2541 * data/glr.c: Likewise.
2542 * data/glr.cc: Likewise.
2543 * data/lalr1.cc: Likewise.
2544 * data/yacc.c: Likewise.
2545 * lib/ebitsetv.c: Likewise.
2546 * lib/lbitset.c: Likewise.
2547 * lib/subpipe.c: Likewise.
2548 * lib/timevar.c: Likewise.
2549 * src/system.h: Likewise.
2550 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2551 * djgpp/Makefile.maint: Add copyright notice.
2552 * djgpp/README.in: Likewise.
2553 * djgpp/config.bat: Likewise.
2554 * djgpp/config.site: Likewise.
2555 * djgpp/config_h.sed: Likewise.
2556 * djgpp/djunpack.bat: Likewise.
2557 * djgpp/config.sed: Fix copyright notice to match standard format.
2558 * djgpp/subpipe.h: Likewise.
2559 * lib/bitsetv-print.c: Likewise.
2560 * lib/bitsetv.c: Likewise.
2561 * lib/subpipe.h: Likewise.
2562 * lib/timevar.c: Likewise.
2563 * lib/timevar.h: Likewise.
2564 * djgpp/subpipe.c: Use standard recipe for config.h.
2565 * lib/abitset.c: Likewise.
2566 * lib/bitset.c: Likewise.
2567 * lib/bitset_stats.c: Likewise.
2568 * lib/bitsetv-print.c: Likewise.
2569 * lib/bitsetv.c: Likewise.
2570 * lib/ebitsetv.c: Likewise.
2571 * lib/get-errno.c: Likewise.
2572 * lib/lbitset.c: Likewise.
2573 * lib/subpipe.c: Likewise.
2574 * lib/timevar.c: Likewise.
2575 * lib/vbitset.c: Likewise.
2576 * tests/local.at: Likewise.
2577 * src/scan-gram.l: Don't include verify.h, since system.h does
2579 * .x-sc_require_config_h: New file.
2580 * .x-sc_unmarked_diagnostics: New file.
2582 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2584 Be a bit more systematic about using 'abort'.
2585 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
2586 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
2587 Put 'default: abort ();' before some other case, to satisfy older
2589 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2590 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
2591 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
2592 * src/conflicts.c (resolve_sr_conflict): Likewise.
2593 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
2594 (get_decision_str, get_orientation_str, get_node_alignment_str):
2595 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
2596 (get_linestyle_str, get_arrowstyle_str): Likewise.
2597 * src/conflicts.c (resolve_sr_conflict):
2598 Use a default case rather than one for the one remaining enum
2599 value, to catch invalid enum values as well.
2600 * src/lalr.c (set_goto_map, map_goto):
2601 Prefer "assert (FOO);" to "if (!FOO) abort ();".
2602 * src/nullable.c (nullable_compute, token_definitions_output):
2604 * src/reader.c (packgram, reader): Likewise.
2605 * src/state.c (transitions_to, state_new, state_reduction_find):
2607 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
2608 (symbol_pack): Likewise.
2609 * src/tables.c (conflict_row, pack_vector): Likewise.
2610 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
2611 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
2612 * src/system.h: Don't include <assert.h>.
2613 (assert): New macro.
2615 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
2616 (Destructor Decl, Parser Function, Pure Calling):
2617 Describe rules for braces inside C code more carefully.
2619 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2621 Fix some porting glitches found by Nelson H. F. Beebe.
2622 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
2623 compilers that don't understand that abort () does not return.
2624 * src/state.c (transitions_to): Likewise.
2625 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2626 that '#include <cstdlib>' works.
2627 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
2628 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
2629 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
2630 for the benefit of some pre-C99 compilers.
2632 * bootstrap: Undo changes to gnulib files that autoreconf made.
2634 Minor fixups to get 'make maintainer-check' to work.
2635 * configure.ac: Don't use -Wnested-externs, as it's incompatible
2636 with the new verify.h implementation.
2637 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
2638 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
2639 * data/yacc.c (YYUSE): Likewise.
2640 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
2641 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
2642 * src/parse-gram.y (declaration): Don't pass a string constant
2643 to a function that expects char *, since GCC might complain
2644 about the constant value.
2645 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
2646 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
2647 before #defining them.
2648 * tests/glr-regression.at
2649 (Incorrectly initialized location for empty right-hand side in GLR):
2650 In yyerror, use the msg arg.
2651 (Corrupted semantic options if user action cuts parse):
2652 (Incorrect lookahead during deterministic GLR):
2653 (Incorrect lookahead during nondeterministic GLR):
2654 Don't name a local var 'index'; it shadows string.h's 'index'.
2656 2006-01-19 Akim Demaille <akim@epita.fr>
2658 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2659 location, not just parts of it.
2661 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2663 * NEWS: Document the fact that multiple %unions are now allowed.
2664 * doc/bison.texinfo (Union Decl): Likewise.
2665 * TODO: This feature is now implemented, so remove it from
2668 * Makefile.maint: Merge with coreutils Makefile.maint.
2669 (CVS_LIST): Use build-aux version if available.
2670 (VERSION_REGEXP): New macro.
2671 (syntax-check-rules): Add sc_no_if_have_config_h,
2672 sc_prohibit_assert_without_use, sc_require_config_h,
2673 sc_useless_cpp_parens.
2674 (sc_obsolete_symbols): Check for O_NDELAY.
2675 (sc_dd_max_sym_length): Track coreutils.
2676 (sc_unmarked_diagnostics): Look in all files, not just *.c.
2677 (sc_useless_cpp_parens): New rule.
2678 (news-date-check): Look for version or today's date.
2679 (changelog-check): Don't require version number near head.
2680 (copyright-check): Use current year instead of hardwiring 2005.
2681 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
2682 (announcement): Add --gpg-key-ID.
2684 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2687 Avoid undefined behavior that addressed just before the start of an
2688 array. Problem reported by twlevo.
2689 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2690 * src/lalr.c (build_relations): Rely on new sentinel.
2691 * src/gram.c (gram_free): Adjust to new sentinel.
2693 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2695 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2696 yylookaheadNeeds. All uses updated.
2697 (yysplitStack): Rename local yynewLookaheadStatuses to
2698 yynewLookaheadNeeds.
2699 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2700 GLR): In comments, change `lookahead status' to `lookahead need'.
2702 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2704 * data/glr.c (yysplitStack): A little stylistic rewrite.
2706 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2708 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2710 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2712 * doc/bison.texinfo: Fix some typos.
2713 (GLR Semantic Actions): New subsection discussing special
2714 considerations because GLR semantic actions might be deferred.
2715 (Actions): Mention look-ahead usage of yylval.
2716 (Actions and Locations): Mention look-ahead usage of yylloc.
2717 (Special Features for Use in Actions): Add YYEOF entry and mention it
2718 in the yychar entry.
2719 In the yychar entry, remove mention of the local yychar case (pure
2720 parser) since this is irrelevant information when writing semantic
2721 actions and since it's already discussed in `Bison Symbols' where
2722 yychar is otherwise described as an external variable.
2723 In the yychar entry, don't call it the `current' look-ahead since it
2724 isn't when semantic actions are deferred.
2725 In the yychar and yyclearin entries, add note about deferred semantic
2727 Add yylloc and yylval entries discussing look-ahead usage.
2728 (Look-Ahead Tokens): When discussing yychar, don't call it the
2729 `current' look-ahead, and do mention yylval and yylloc.
2730 (Error Recovery): Cross-reference `Action Features' when mentioning
2732 (Bison Symbols): In the yychar entry, don't call it the `current'
2734 In the yylloc and yylval entries, mention look-ahead usage.
2736 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2738 * tests/glr-regression.at: Update copyright year to 2006.
2740 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2742 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2743 use during nondeterministic operation to track which stacks have
2744 actually needed the current lookahead.
2745 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2746 Allocate, deallocate, resize, and otherwise shuffle space for
2747 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2748 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2749 appropriately during nondeterministic operation.
2750 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2751 members to store the current lookahead to be used by the deferred
2753 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2754 from which the RHS is taken. Set the lookahead members of the new
2755 yySemanticOption according to the lookahead status for stack yyk.
2756 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2757 yyaddDeferredAction.
2758 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2759 members of yySemanticOption before invoking yyuserAction, and then set
2760 them back to their current values afterward.
2761 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2762 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2763 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2764 titles for consistency.
2765 (Leaked merged semantic value if user action cuts parse): In order to
2766 suppress lint warnings, use arguments in merge function, and assign
2767 char value < 128 in main.
2768 (Incorrect lookahead during deterministic GLR): New test case.
2769 (Incorrect lookahead during nondeterministic GLR): New test case.
2771 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2773 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
2774 !yyvaluep as signal that no semantic value is available to print.
2775 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2776 to print a semantic value.
2778 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2780 * tests/glr-regression.at: For consistency with my newer test cases,
2783 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2785 * data/glr.c (yyresolveValue): When merging semantic options, if at
2786 least one user action succeeds but a later one cuts the parse, then
2787 destroy the semantic value before returning rather than leaking it.
2788 (yyresolveStates): If a user action cuts the parse and thus
2789 yyresolveValue fails, ignore the (unset) semantic value rather than
2790 corrupting the yyGLRState, and empty the semantic options list since
2791 the user actions should have called all necessary destructors.
2792 Simplify code with YYCHK.
2793 * tests/glr-regression.at (Corrupted semantic options if user action
2794 cuts parse): New test case.
2795 (Undesirable destructors if user action cuts parse): New test case.
2796 Before applying any of this patch, this test case never actually failed
2797 for me... but only because the corrupted semantic options usually
2799 (Leaked merged semantic value if user action cuts parse): New test
2802 2006-01-05 Akim Demaille <akim@epita.fr>
2804 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2806 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2808 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2809 _MSC_VER. Problem reported by Cenzato Marco.
2810 (b4_c_function_def): Use it.
2811 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2813 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2814 than rolling our own.
2816 2006-01-04 Akim Demaille <akim@epita.fr>
2818 Also warn about non-used mid-rule values.
2819 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2821 (symbol_list_new): Adjust.
2822 * src/reader.c (symbol_typed_p): New.
2823 (grammar_rule_check): Use it.
2824 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2826 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2828 * tests/actions.at (Exotic Dollars): Adjust.
2830 2006-01-04 Akim Demaille <akim@epita.fr>
2832 * src/reader.c (grammar_midrule_action): If $$ is set in a
2833 mid-rule, move the `used' bit to its lhs.
2834 * tests/input.at (Unused values): New.
2835 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2837 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2839 * doc/bison.texinfo (Bison Options): Say more accurately what
2841 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2842 about declarations in the grammar when in Yacc mode, as POSIX does
2843 not require a diagnostic when the grammar uses extensions.
2845 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2847 Warn about dubious constructions like "%token T T".
2849 * src/symtab.h (struct symbol.declared): New member.
2850 * src/symtab.c (symbol_new): Initialize it to false.
2851 (symbol_class_set): New arg DECLARING, specifying whether
2852 this is a declaration that we want to warn about, if there
2853 is more than one of them. All uses changed.
2855 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
2856 Allow multiple %union directives, whose contents concatenate.
2857 * src/parse-gram.y (grammar_declaration): Likewise.
2858 Use muscle_code_grow, so that we don't need stype_line any more.
2861 * src/muscle_tab.c (muscle_grow): Fix comment.
2863 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
2864 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
2865 Update copyright year to 2006.
2867 2006-01-03 Akim Demaille <akim@epita.fr>
2869 Have glr.cc pass (some of) the calc.at tests.
2870 * data/glr.cc (b4_parse_param_orig): New.
2871 (b4_parse_param): Improve its definition, and bound it more
2872 clearly in the skeleton.
2873 (b4_epilogue): Append, instead of prepending, in order to keep
2875 Simplify the generation of auxiliary functions: locations and
2876 purity are mandated.
2877 (b4_global_tokens_and_yystype): Honor it.
2878 * data/location.cc (c++.m4): Don't include it.
2879 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
2881 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2883 Be sure to initialize the first position's filename.
2884 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2886 (AT_CHECK_CALC_GLR_CC): New.
2887 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2889 2006-01-02 Akim Demaille <akim@epita.fr>
2891 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2893 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
2894 * data/glr.cc: Do not include stack.hh.
2896 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2898 * data/glr.c: Reformat whitespace with tabs.
2899 (b4_lpure_formals): Remove this unused m4 macro.
2900 * tests/cxx-type.at: Reformat whitespace with tabs.
2901 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
2902 since it's a member. Rename type to isNterm for clarity.
2904 2005-12-29 Akim <akim@sulaco.local>
2906 Let glr.cc catch up with symbol_value_print.
2907 * data/glr.cc (b4_yysymprint_generate): Replace by...
2908 (b4_yy_symbol_print_generate): this.
2909 (yy_symbol_print, yy_symbol_value_print): Declare them.
2911 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2913 * src/location.h (boundary): Note that a line or column equal
2914 to INT_MAX indicates an overflow.
2915 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
2916 (rule_length_overflow, increment_rule_length, add_column_width):
2918 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
2919 (<SC_BRACED_CODE>"}"):
2920 Use increment_rule_length rather than incrementing it by hand.
2921 (adjust_location, handle_syncline): Diagnose overflow.
2922 (handle_action_dollar, handle_action_at):
2923 Fix bug with monstrosities like $-2147483648.
2924 Remove now-unnecessary checks.
2925 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2926 (convert_ucn_to_byte): Verify assumptions.
2927 (handle_syncline): New arg LOC. All callers changed.
2928 Don't store through a value derived from char const * pointer.
2930 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2933 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2935 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2936 Remove unnecessary forward static decls.
2938 2005-12-27 Akim Demaille <akim@epita.fr>
2940 * src/reader.c (grammar_current_rule_check): Also check that $$
2942 Take the rule to check as argument, hence rename as...
2943 (grammar_rule_check): this.
2944 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2946 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2947 (grammar_midrule_action, grammar_symbol_append): Now static.
2948 * tests/torture.at (input): Don't rely on the default action
2949 being always performed.
2950 * tests/calc.at: "Set" $$ even when the action is "cut" with
2952 * tests/actions.at (Exotic Dollars): Instead of using unused
2953 values, check that the warning is issued.
2955 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2957 * NEWS: Improve wording for unused-value warnings.
2959 2005-12-22 Akim Demaille <akim@epita.fr>
2961 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2962 (b4_yysymprint_generate): Rename as...
2963 (b4_yy_symbol_print_generate): this.
2964 Generate yy_symbol_print instead of yysymprint.
2965 Generate also yy_symbol_value_print, and use it.
2967 2005-12-22 Akim Demaille <akim@epita.fr>
2969 * NEWS: Warn about unused values.
2970 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2972 (symbol_list_n_get, symbol_list_n_used_set): New.
2973 (symbol_list_n_type_name_get): Use symbol_list_n_get.
2974 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
2975 * src/reader.c (grammar_current_rule_check): Check that values are
2977 * src/symtab.c (symbol_print): Accept 0.
2978 * tests/existing.at: Remove the type information.
2980 Remove useless actions (beware of mid-rule actions: perl -000
2981 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
2982 * tests/actions.at (Exotic Dollars): Use unused values.
2983 * tests/calc.at: Likewise.
2984 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2987 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
2990 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
2992 Undo 2005-12-01 tentative license wording change. The wording is
2993 still being reviewed by the lawyers, and we don't want to wait for
2994 them before publishing a test release. For now, revert to the
2996 * NEWS: Undo 2005-12-01 change.
2997 * data/glr.c: Revert to previous license wording.
2998 * data/glr.cc: Likewise.
2999 * data/lalr1.cc: Likewise.
3000 * data/location.cc: Likewise.
3001 * data/yacc.c: Likewise.
3003 * NEWS: Reword %destructor vs YYABORT etc.
3004 * data/glr.c: Use American spacing, for consistency.
3005 * data/glr.cc: Likewise.
3006 * data/lalr1.cc: Likewise.
3007 * data/yacc.c: Likewise.
3008 * data/yacc.c: Reformat comments slightly.
3009 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3010 for consistency. Fix some spelling errors and reword recently-included
3012 * tests/cxx-type.at: Cast results of malloc, for C++.
3014 2005-12-21 Joel E. Denny <address@hidden>
3016 * tests/cxx-type.at: Construct a tree, count the parents of shared
3017 nodes, and free each node once and only once. Previously, the memory
3018 for semantic values was leaked instead.
3020 2005-12-21 Joel E. Denny <address@hidden>
3022 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3023 (yylval, yylloc): If pure, #define to yystackp->yyval and
3024 yystackp->yyloc similar to yychar and yynerrs.
3025 (yyparse): If pure, remove local yylval and yylloc. Add local
3026 yystackp to accommodate pure definitions of yylval and yylloc.
3027 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3028 yylvalp and yyllocp to &yylval and &yylloc.
3029 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3030 namespace. Previously, nerrs and char were missing, but lval and lloc
3032 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3033 yylvalp and yyllocp parameters since, if pure, these are now always
3034 accessible through yystackp. If not pure, they are still accessible
3036 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3037 `if (YYID (N))' to pacify lint.
3039 2005-12-21 Akim Demaille <akim@epita.fr>
3041 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3042 destroy the RHS symbols of a rule.
3043 * data/yacc.c (yylen): Initialize to 0.
3044 Keep its value to the number of items to possibly shift.
3045 In particular, a regular successful parse that ends on YYFINAL by
3046 a (internal) YYACCEPT must not have yylen != 0.
3047 (yyerrorlab, yyreturn): Pop the RHS.
3048 Reorder a bit to emphasize the `shifting' bits of code.
3049 (YYPOPSTACK): Now accept a number of items to pop.
3050 * data/lalr1.cc: Likewise.
3051 * data/glr.c: Formatting changes.
3052 Use goto instead of fall through.
3053 * doc/bison.texinfo (Destructor Decl): Complete.
3055 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3057 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3058 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3059 * djgpp/config.bat: Replace every occurence of the file name
3060 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3061 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3062 * djgpp/config.sed: Replace every occurence of the file name
3063 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3064 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3065 * djgpp/djunpack.bat: DJGPP specific file.
3066 * djgpp/fnchange.lst: DJGPP specific file.
3067 * djgpp/README.in: Add new information about how to unpack the bison
3068 source on MSDOS and other systems which have 8.3 file name restrictions
3069 using djunpack.bat and fnchange.lst.
3071 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3073 * bootstrap (build_cvs_prefix): Remove; unused.
3074 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3075 when getting gnulib.
3077 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3079 * data/glr.c: Reorder typedef declarations for structs to match order
3080 of struct declarations.
3081 Rename yystack everywhere to yystackp except in yyparse where it's not
3083 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3085 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3086 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3087 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3090 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3092 * tests/sets.at (Accept): Fix typos in regular expression used to
3093 sed out the final state number.
3095 Work around portability problem on Solaris 10: flex-generated
3096 files include <stdio.h> before <config.h>, which messes up
3097 because the latter defines __EXTENSIONS__. Address the problem
3098 by creating two new little files that include <config.h> first,
3099 then include the flex-generated files. Rewrite everyone else
3100 to include <config.h> first, as well.
3101 * lib/timevar.c: Always include "config.h".
3102 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3103 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3104 (EXTRA_bison_SOURCES): New macro.
3105 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3106 * src/system.h: Don't include config.h.
3107 * src/LR0.c: Include <config.h> first.
3108 * src/assoc.c: Likewise.
3109 * src/closure.c: Likewise.
3110 * src/complain.c: Likewise.
3111 * src/conflicts.c: Likewise.
3112 * src/derives.c: Likewise.
3113 * src/files.c: Likewise.
3114 * src/getargs.c: Likewise.
3115 * src/gram.c: Likewise.
3116 * src/lalr.c: Likewise.
3117 * src/location.c: Likewise.
3118 * src/main.c: Likewise.
3119 * src/muscle_tab.c: Likewise.
3120 * src/nullable.c: Likewise.
3121 * src/output.c: Likewise.
3122 * src/parse-gram.y: Likewise.
3123 * src/print.c: Likewise.
3124 * src/print_graph.c: Likewise.
3125 * src/reader.c: Likewise.
3126 * src/reduce.c: Likewise.
3127 * src/relation.c: Likewise.
3128 * src/state.c: Likewise.
3129 * src/symlist.c: Likewise.
3130 * src/symtab.c: Likewise.
3131 * src/tables.c: Likewise.
3132 * src/uniqstr.c: Likewise.
3133 * src/vcg.c: Likewise.
3135 * src/parse-gram.y: Fix minor problems uncovered by lint.
3136 (current_lhs, current_lhs_location): Now static.
3137 (current_assoc): Remove unused variable.
3139 Cleanups so that Bison-generated parsers have less lint.
3140 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3141 Prepend /*ARGSUSED*/, for lint's sake.
3142 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3143 definition if 'lint' is defined.
3144 (YYID): New macro (or function, if lint).
3145 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3146 * data/yacc.c: Likewise.
3147 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3148 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3149 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3151 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3152 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3153 Use YYID(0) rather than 0, for lint.
3154 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3155 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3157 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3159 * tests/glr-regression.at
3160 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3161 Close memory leak reported by twlevo.
3163 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3165 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3167 (yyparse): Iterate another stack in order to call user destructors.
3168 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3170 (Duplicated user destructor for lookahead): This test now is expected
3173 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3175 * NEWS: Document the following change.
3176 * data/yacc.c: Say "parser skeleton" rather than "file", since
3177 it's no longer just a file.
3178 * data/glr.c: Grant a special exception for C GLR parsers, that
3179 reads like the already-existing exception for C LALR(1) parsers.
3180 * data/glr.cc: Likewise.
3181 * data/lalr1.cc: Likewise.
3182 * data/location.cc: Likewise.
3183 * data/yacc.c: Reword the "written by" statement to clarify that
3184 it was the parser skeleton, not the entire output file.
3185 * data/glr.c: Written by Paul Hilfinger.
3186 * data/glr.cc: Written by Akim Demaille.
3187 * data/lalr1.cc: Likewise.
3189 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3191 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3192 Fix typos in previous change that broke 'make check'.
3193 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3195 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3196 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3197 We can revert this once things settle down.
3199 * src/conflicts.c (conflicts_print): Don't print file name twice
3200 when %expect fails because there were no conflicts.
3201 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3203 * tests/conflicts.at (%expect not enough, %expect too much):
3204 (%expect with reduce conflicts): Adjust to new behavior.
3206 2005-11-18 Akim Demaille <akim@epita.fr>
3208 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3210 * NEWS: Document this.
3211 * doc/bison.texinfo (Expect Decl): Likewise.
3213 2005-11-16 Akim Demaille <akim@epita.fr>
3215 Generalize the display of semantic values and locations in traces.
3216 * data/glr.c (yy_reduce_print): Fix indices (again).
3217 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3219 * data/lalr1.cc (yyreduce_print): Rename as...
3220 (yy_reduce_print): this.
3221 Display values and locations.
3222 * data/yacc.c (yy_reduce_print): Likewise.
3223 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3224 (yysymprint): Move higher to be visible from yy_reduce_print).
3226 * tests/calc.at: Adjust the expected length of the traces.
3228 2005-11-14 Akim Demaille <akim@epita.fr>
3230 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3231 from 1 to N, while values and location start at 0.
3232 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3234 2005-11-14 Akim Demaille <akim@epita.fr>
3236 * data/glr.c (yy_reduce_print): Fix the $ number.
3238 2005-11-14 Akim Demaille <akim@epita.fr>
3240 "Use" parse parameters.
3241 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3242 * data/glr.c, data/glr.cc: Use them.
3243 * data/glr.c (YYUSE): Have a C++ definition that supports
3246 2005-11-14 Akim Demaille <akim@epita.fr>
3248 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3250 2005-11-14 Akim Demaille <akim@epita.fr>
3253 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
3255 2005-11-12 Akim Demaille <akim@epita.fr>
3257 Let position and location be PODs.
3258 * data/location.cc (position::initialize, location::initialize): New.
3259 (position::position, location::location): Define only if
3260 b4_location_constructors is defined.
3261 * data/lalr1.cc (b4_location_constructors): Define it for backward
3263 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3265 2005-11-12 Akim Demaille <akim@epita.fr>
3267 * data/lalr1.cc: Move the body of the ctor and dtor into the
3268 parser file (instead of the header).
3269 Wrap the implementations in a "namespace yy".
3271 2005-11-12 Akim Demaille <akim@epita.fr>
3273 Have glr.c include its header file when created.
3274 * data/glr.c (b4_shared_declarations): New.
3275 Output them verbatim in the parser if !%defines, otherwise
3276 output then in the header file, and include it instead.
3278 2005-11-11 Akim Demaille <akim@epita.fr>
3280 * data/glr.c: Comment changes.
3282 2005-11-11 Akim Demaille <akim@epita.fr>
3284 When yydebug, report semantic and location values for reductions.
3285 * data/glr.c (yy_reduce_print): Report the semantic values and the
3287 (YY_REDUCE_PRINT): Adjust.
3288 (yyglrReduce): Use them.
3289 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3290 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3291 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3294 2005-11-10 Akim Demaille <akim@epita.fr>
3296 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3297 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3298 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3300 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3302 * m4/cxx.m4, examples/Makefile.am: Don't build
3303 examples/calc++ if no C++ compiler is available. (trivial change)
3305 2005-11-09 Akim Demaille <akim@epita.fr>
3307 * src/scan-skel.l: Use a couple of asserts.
3309 2005-11-03 Akim Demaille <akim@epita.fr>
3311 In some (weird) cases, the final state number is incorrect.
3312 Reported by Alexandre Duret-Lutz.
3313 * src/LR0.c (state_list_append): Remove the computation of
3315 (save_reductions): Do it here.
3316 (get_state): Alpha conversion.
3317 (generate_states): Use a for loop.
3318 * src/gram.h (item_number_is_rule_number)
3319 (item_number_is_symbol_number): New.
3320 * src/state.c: Use assert.
3321 * src/system.h: Include assert.h.
3322 * tests/sets.at (Accept): New.
3324 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3326 * data/glr.c (yyfill): Adjust comment.
3327 (yyresolveAction): Initialize default location properly
3328 for empty right-hand sides.
3329 (yydoAction): Ditto.
3330 Add comment explaining apparently dead code.
3331 * tests/glr-regression.at
3332 (Incorrectly initialized location for empty right-hand side in GLR):
3335 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3337 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3338 gnulib when interrupted. This fixes some race conditions and
3339 works around some portability problems (one noted by Paul
3342 2005-10-22 Akim <akim@epita.fr>
3344 * Makefile.cfg: Adjust to config -> build-aux.
3347 2005-10-21 Akim Demaille <akim@epita.fr>
3349 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3351 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3352 * data/yacc.c (b4_Pure_if): Rename as...
3353 (b4_yacc_pure_if): this.
3354 (YY_SYMBOL_PRINT, yyparse): Adjust.
3355 * doc/bison.texinfo: Formatting changes.
3357 2005-10-21 Akim Demaille <akim@epita.fr>
3359 Finish the transition config -> build-aux.
3360 * configure.ac, Makefile.am: Use build-aux.
3361 * config/prev-version, config/announce-gen, config/Makefile.am:
3363 * build-aux/prev-version, build-aux/announce-gen,
3364 * build-aux/Makefile.am: here.
3366 2005-10-14 Akim Demaille <akim@epita.fr>
3368 * examples/calc++/test: Use set -x only when VERBOSE.
3370 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3372 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3373 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3375 2005-10-13 Akim Demaille <akim@epita.fr>
3377 * src/scan-skel.l: Output the base name parts of the parser and
3379 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
3381 Use this to exercise C++ outputs in subdirs.
3382 Reported by Oleg Smolsky.
3384 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3386 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3387 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3388 Problem reported by John P. Hartmann.
3389 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3392 2005-10-12 Akim Demaille <akim@epita.fr>
3394 * src/parse-gram.y (version_check): Exit 63 to please missing
3395 (stands for "version mismatch).
3396 * tests/input.at, doc/bison.texinfo: Adjust.
3398 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3400 Work around portability problems with Visual Age C compiler
3401 (xlc and xlC_r) reported by John P. Hartmann.
3402 * data/location.cc (initial_column, initial_line): Remove.
3403 All uses replaced by 0 and 1.
3404 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3405 that xlc complains about.
3406 * src/scan-skel.l (skel_wrap): Likewise.
3407 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
3409 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3410 __STDC_VERSION__. Use it everywhere instead of looking at
3411 __STDC__ and __cplusplus.
3413 2005-10-10 Akim Demaille <akim@epita.fr>
3415 * examples/calc++/test: Be quiet unless VERBOSE.
3417 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3419 * data/c.m4 (yydestruct, yysymprint):
3420 Use YYUSE instead of casting to void.
3421 * data/glr.c (YYUSE): New macro.
3422 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3423 Use it instead of rolling our own.
3424 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3426 Use /*CONSTCOND*/ to suppress lint warnings.
3427 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3428 (YY_STACK_PRINT): Use 'false' not '0'.
3430 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3431 * data/yacc.c (YYUSE): New macro.
3432 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3433 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3434 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3437 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3438 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3440 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3442 Undo the parts of the unlocked-I/O change that substituted
3443 putc or puts for printf. This might hurt performance a bit,
3444 but some people prefer the printf style.
3445 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3446 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3447 All uses replaced by YYFPRINTF and YYDPRINTF.
3448 * data/yacc.c: Likewise.
3449 * lib/bitset.c (bitset_print): Likewise.
3450 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3452 * lib/lbitset.c (debug_lbitset): Likewise.
3453 * src/closure.c (print_firsts, print_fderives): Likewise.
3454 * src/gram.c (grammar_dump): Likewise.
3455 * src/lalr.c (look_ahead_tokens_print): Likewise.
3456 * src/output.c (escaped_output): Likewise.
3457 (user_actions_output): Break apart two printfs.
3458 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3459 * src/reduce.c (reduce_print): Likewise.
3460 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3461 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3463 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3464 Use assignments rather than casts-to-void to suppress
3465 unused-variable warnings. This pacifies 'lint'.
3466 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3467 unused-variable warnings.
3469 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3471 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3473 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3475 Use unlocked I/O for a minor performance improvement on hosts like
3476 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3477 is to use the gnlib unlocked-io module, and to prefer putc and
3478 puts to printf when either will work (since the latter doesn't
3479 come in an unlocked flavor).
3480 * bootstrap (gnulib_modules): Add unlocked-io.
3481 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3482 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3483 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3484 and similarly for puts and putc and printf.
3485 * data/yacc.c: Likewise.
3486 * lib/bitset.c (bitset_print): Likewise.
3487 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3488 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3490 * lib/lbitset.c (debug_lbitset): Likewise.
3491 * src/closure.c (print_firsts, print_fderives): Likewise.
3492 * src/gram.c (grammar_dump): Likewise.
3493 * src/lalr.c (look_ahead_tokens_print): Likewise.
3494 * src/output.c (escaped_output): Likewise.
3495 (user_actions_output): Coalesce two printfs.
3496 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
3497 * src/reduce.c (reduce_print): Likewise.
3498 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3499 * src/system.h: Include unlocked-io.h rather than stdio.h.
3501 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3502 this confuses xgettext.
3504 2005-10-02 Akim Demaille <akim@epita.fr>
3506 * bootstrap (gnulib_modules): Add strverscmp.
3507 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3508 * m4/.cvsignore: Add strverscmp.m4.
3509 * src/parse-gram.y (%require): New token, new rule.
3510 (version_check): New.
3511 * src/scan-gram.l (%require): Adjust.
3512 * tests/input.at (AT_REQUIRE): New.
3514 * doc/bison.texinfo (Require Decl): New.
3515 (Calc++ Parser): Use %require.
3517 2005-10-02 Akim Demaille <akim@epita.fr>
3519 * data/location.cc: New.
3521 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3522 Akim Demaille <akim@epita.fr>
3524 Make sure -odir/foo.cc creates dir/location.hh etc.
3525 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3526 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3527 (spec_defines_file): Now const.
3529 (short_base_name): Remove.
3530 * src/files.c: Adjust.
3531 (dirname.h): Include.
3532 (base_name): Don't prototype it.
3533 (finput): Remove, duplicates gram_in.
3534 (full_base_name, short_base_name): Replace by...
3535 (all_but_ext, all_but_tab_ext): these.
3536 (compute_base_names): Rename as...
3537 (compute_file_name_parts): this.
3538 Update to compute the new variables, including dir_prefix.
3539 Adjust dependencies.
3540 * src/output.c (prepare): Output them.
3541 * src/reader.c: Adjust to use gram_in, not finput.
3542 * src/scan-skel.l (@dir_prefix@): New.
3544 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3546 * lib/subpipe.c: New function end_of_output_subpipe() added
3547 to allow support for non-posix systems. This is a no-op function
3550 * lib/subpipe.h: New function end_of_output_subpipe() added
3551 to allow support for non-posix systems. This is a no-op function
3554 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3555 handle the lack of pipe/fork functionality on non-posix systems.
3557 * djgpp/Makefile.maint: DJGPP specific file.
3559 * djgpp/README.in: DJGPP specific file.
3561 * djgpp/config.bat: DJGPP specific configuration file.
3563 * djgpp/config.sed: DJGPP specific configuration file.
3565 * djgpp/config.site: DJGPP specific configuration file.
3567 * djgpp/config_h.sed: DJGPP specific configuration file.
3569 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3571 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3573 2005-10-02 Akim Demaille <akim@epita.fr>
3575 * data/location.cc: New, extract from...
3576 * data/lalr1.cc: here.
3577 (location.hh): Include it after the user prologue, in case the
3578 filename type is defined by the user.
3579 Forward declation location and position before the pre-prologue.
3580 (yyresult_): Rename as...
3581 (yyresult): this, it's a local variable, not an attribute.
3582 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
3584 2005-10-01 Akim Demaille <akim@epita.fr>
3586 * examples/extexi: Restore the #line generation.
3588 2005-09-30 Akim Demaille <akim@epita.fr>,
3589 Alexandre Duret-Lutz <adl@gnu.org>
3591 Move the token type and YYSTYPE in the parser class.
3592 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
3593 (parser::token): New, from the moved free definition of tokens.
3594 (parser::semantic_value): Now a full definition instead of an
3595 indirection to YYSTYPE.
3596 (b4_post_prologue): No longer included in the header file, but
3597 in the implementation file.
3598 * doc/bison.texi (C+ Language Interface): Update.
3599 * src/parse-gram.y: Support unary %define.
3600 * tests/actions.at: Define global_tokens_and_yystype for backward
3601 compatibility until we update the tests.
3602 * tests/calc.at: Idem.
3603 (first_line, first_column, last_line, last_column): Define for lalr1.cc
3604 to simplify the code.
3606 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3608 Port to SunOS 4.1.4, which lacks strtoul and strerror.
3609 Ah, the good old days! Problem reported by Peter Klein.
3610 * bootstrap (gnulib_modules): Add strerror, strtoul.
3611 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
3612 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
3614 2005-09-29 Akim Demaille <akim@epita.fr>
3616 * data/c.m4 (b4_error_verbose_if): New.
3617 * data/lalr1.cc: Use it.
3618 (YYERROR_VERBOSE_IF): Remove.
3619 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
3620 parser members, replaced by...
3621 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
3623 (yysyntax_error_): Takes the state number as argument.
3624 (yyreduce_print_): Use the argument yyrule, not the former
3627 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3629 * bootstrap (gnulib_modules): Add verify.
3630 * lib/.cvsignore: Add verify.h.
3631 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
3632 * src/system.h (verify): Remove.
3633 Include verify.h instead.
3634 * src/tables.c (tables_generate): Use new API for 'verify'.
3636 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3638 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
3639 local variables whose names begin with 'yy'.
3640 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
3641 Trivial changes from Joel E. Denny.
3643 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3645 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3646 don't use alloca any more.
3648 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
3649 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
3650 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
3651 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
3652 to match yacc.c, to test more hosts.
3654 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3656 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
3657 doesn't affect behavior.
3658 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
3660 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
3661 This works a bit better with glibc, if user code has already included
3663 * doc/bison.texinfo (Bison Parser): Document that users can't
3664 arbitrarily use malloc and free for other purposes. Document
3665 that <alloca.h> and <malloc.h> might be included.
3666 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
3667 user must declare alloca.
3669 * HACKING (release): Forwarn the Translation Project about
3672 2005-09-20 Akim Demaille <akim@epita.fr>
3674 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3676 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3678 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
3679 (YYSTACK_ALLOC_MAXIMUM): Use it.
3680 (yysyntax_error): New function.
3681 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
3682 multiple syntax errors are reported, and alloca is being used.
3683 Instead, reallocate buffers twice as big each time, so that
3684 we waste at most half the allocated memory. Start with a small
3685 (128-byte) buffer that will suffice in most cases anyway.
3686 Use yysyntax_error to do most of the work.
3688 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3689 yynerrs is the number of errors reported, not the number of
3692 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3693 Mark it as expected to fail.
3694 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3695 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3696 Don't start user-code symbols with "yy", to avoid name space problems.
3698 2005-09-19 Akim Demaille <akim@epita.fr>
3700 Remove the traits, failed experiment.
3701 It never proved useful, and anyway because of the current
3702 definition, it was not possible to have several specialization of
3703 this traits, making it useless.
3704 * data/lalr1.cc (yy:traits): Remove.
3705 Inline its definitions in the parser class.
3707 2005-09-19 Akim Demaille <akim@epita.fr>
3709 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3710 least Mac OSX with a /usr/local install of gettext.
3712 2005-09-19 Akim Demaille <akim@epita.fr>
3714 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3715 and yytoken for similarity with the other skeletons.
3717 2005-09-19 Akim Demaille <akim@epita.fr>
3719 * NEWS, configure.ac: update version number to 2.1a.
3721 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3723 * NEWS: Version 2.1.
3725 * NEWS: Remove notice of yytname change, since it was never in an
3727 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3729 * src/output.c (prepare): Likewise.
3730 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3731 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3732 is not defined. This is an awful hack, but it's enough for now.
3733 All callers changed.
3734 * tests/glr-regression-at (make_value): Args are const pointers now,
3735 to avoid GCC warning.
3736 (Duplicated user destructor for lookahead): New test. Currently
3737 skipped. It fails on my host but I'm not sure it'll always fail.
3739 2005-09-16 Akim Demaille <akim@epita.fr>
3741 * src/symtab.h (struct symbol): Declare the printer and destructor
3742 as const, to avoid accidental calls to free.
3743 (symbol_destructor_set, symbol_printer_set): Adjust.
3744 * src/symtab.c: Adjust.
3746 2005-09-16 Akim Demaille <akim@epita.fr>
3748 * data/c.m4 (b4_token_enums): New.
3749 (b4_token_defines): Rename as...
3750 (b4_token_enums_defines): this.
3751 (b4_token_defines): New, output only the #defines.
3752 * data/yacc.c, data/glr.c: Adjust.
3753 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3754 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3757 2005-09-16 Akim Demaille <akim@epita.fr>
3759 * data/lalr1.cc (yylex_): Remove, inline its code.
3760 (yyreport_syntax_error_): Remove, replaced by...
3761 (yysyntax_error_): this which returns a string and leaves to the
3762 caller the call to the users' error function.
3763 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3764 Move from members of the parser object...
3765 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3766 to local variables of the parse function.
3768 2005-09-16 Akim Demaille <akim@epita.fr>
3770 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3771 since it's in Bison's name space.
3773 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3775 * data/glr.c (yyresolveValue): Add default case to pacify
3776 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3778 * NEWS: Document when yyparse started to return 2.
3779 * doc/bison.texinfo (Parser Function): Document when yyparse
3782 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3783 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3785 (class position): file_name -> filename (reverting). All uses changed.
3787 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3789 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3790 do anything if $@ exists. This reverts part of the 2005-07-07
3793 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3795 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3796 contains obsolete information and isn't worth distributing as a
3797 separate file anyway.
3798 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3799 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3800 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3801 (yyparse): Abort if user code uses longjmp to throw an unexpected
3804 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3806 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3807 Suggested by twlevo@xs4all.nl.
3809 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3810 This avoids a diagnostic from gcc -Wswitch-enum.
3811 Problem reported by twlevo@xs4all.nl.
3813 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3814 standards. Use "file name" or "file" or "name", depending on
3816 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3817 not to hack/foo.tab.c.
3818 (Calc++ Top Level): 2nd arg of main is not const.
3819 * data/glr.c: b4_filename -> b4_file_name.
3820 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3822 (class position): filename -> file_name. All uses changed.
3823 * data/yacc.c: b4_filename -> b4_file_name.
3824 * lib/bitset.h: filename -> file_name in local vars.
3825 * lib/bitset_stats.c: Likewise.
3826 * src/files.c: Likewise.
3827 * src/scan-skel.l ("@output ".*\n): Likewise.
3828 * src/files.c (file_name_split): Renamed from filename_split.
3829 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
3831 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3833 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3834 to accommodate latest gnulib.
3836 * tests/glr-regression.at (Duplicate representation of merged trees):
3837 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3839 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3842 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3844 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3845 All uses changed. Invoke user destructor after an error during a
3846 split parse (trivial change from Joel E. Denny).
3848 * tests/glr-regression.at
3849 (User destructor after an error during a split parse): New test case.
3850 Problem reported by Joel E. Denny in:
3851 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3853 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3855 * README-cvs: Give URLs for recommended tools.
3856 Mention Gzip version problem, and bootstrapping issues.
3857 Remove troubleshooting section, as it's somewhat obsolete.
3859 * bootstrap (no_cache): New var, to accommodate different wget
3860 variants. Use it instead of '-C off'. Problem reported by
3863 * data/glr.c (yydestroyStackItem): New function.
3864 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
3865 debugging information. Problem reported by Joel E. Denny.
3867 2005-08-25 Akim Demaille <akim@epita.fr>
3869 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3871 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3873 * data/glr.c (yyrecoverSyntaxError, yyreturn):
3874 Don't invoke destructor on unresolved entries.
3875 * tests/glr-regression.at
3876 (User destructor for unresolved GLR semantic value): New test case.
3877 Problem reported by Joel E. Denny in:
3878 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
3880 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3882 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3884 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3885 lib-prefix.m4, po.m4.
3887 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
3888 in yydestruct diagnostic, since it might not be an error.
3889 Problem reported by Joel Denny near end of
3890 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3891 * data/lalr1.cc (yyerturn): Likewise.
3892 * data/yacc.c (yyreturn): Likewise.
3893 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
3895 * src/files.c: Remove obsolete FIXME comment.
3897 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
3898 with the other templates, and to fix bogus run-on messages such
3899 as the one reported at the end of
3900 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3901 All callers changed to avoid the newline.
3902 (yyprocessOneStack): Output two lines rather than one, to accommodate
3903 the above change. This changes the debug output format slightly.
3905 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
3906 reported by Joel E. Denny in
3907 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
3909 * tests/glr-regression.at (Duplicate representation of merged trees):
3910 New test, from Joel E. Denny in:
3911 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
3912 * THANKS: Add Joel E. Denny.
3914 * configure.ac (AC_INIT): Bump to 2.0c.
3916 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3918 * NEWS: Version 2.0b.
3920 * Makefile.am (SUBDIRS): Put examples before tests, so that
3921 "make check" doesn't finish with "All 1 tests passed".
3923 * tests/regression.at (Token definitions): Don't rely on
3924 AT_PARSER_CHECK for data that contains backslashes. It currently
3925 uses 'echo', and 'echo' isn't portable if its argument contains
3926 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3927 that the byte '\0xff' is not printable in the C locale; it is,
3928 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3929 not printable, so use '\0x81' to test.
3931 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3932 version of GCC, since the macro is used with non-GCC compilers.
3934 Fix core dump reported by Pablo De Napoli in
3935 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3936 * tests/regression.at (Invalid inputs with {}): New test.
3937 * src/parse-gram.y (token_name): Translate type before using
3940 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3941 the user's name space. All uses changed to __attribute__
3943 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3944 Add __attribute__ ((__noreturn__)).
3946 * etc/clcommit: Remove. We weren't using it, and it failed
3947 "make maintainer-distcheck".
3948 * Makefile.maint: Merge from coreutils.
3949 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3950 (syntax-check-rules): Change list of rules as described below.
3951 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3952 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3953 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3954 (sc_trailing_space): New rules.
3955 (sc_xalloc_h_in_src): Remove.
3956 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3957 (sc_space_tab, sc_error_exit_success, sc_changelog):
3958 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3959 (makefile-check, po-check, author_mark_check):
3960 (makefile_path_separator_check, copyright-check):
3961 Use grep -n, to make it easier to find violations.
3962 Use CVS_LIST and CVS_LIST_EXCEPT.
3963 (header_regexp, h_re): Remove.
3965 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3966 (my-distcheck): Use more-modern GCC flags.
3967 (signatures, %.asc): Remove.
3968 (rel-files, announcement): Remove signatures.
3969 Restore old updating code, even though we don't use it, so
3970 that we're the same as coreutils.
3971 (alpha, beta, major): Depend on news-date-check.
3972 Make the upload commands.
3974 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
3975 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
3976 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
3977 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
3978 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
3979 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
3980 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
3981 * tests/sets.at: Likewise.
3983 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
3984 we comment out the Autoconf version number.
3985 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
3986 it's error-prone and "make maintainer-distcheck" rejects it.
3988 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
3989 Indent calls to "error" to pacify "make maintainer-distcheck",
3990 when the calls are not intended to be translated.
3991 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
3993 * src/Makefile.am (DEFS): Use +=, to pacify
3994 "make maintainer-distcheck".
3995 (bison_SOURCES): Add scan-skel.h.
3996 (sc_tight_scope): New rule, from coreutils.
3998 * src/files.c (src_extension, header_extension):
3999 Now static, not extern.
4000 * src/getargs.c (short_options): Likewise.
4001 * src/muscle_tab.c (muscle_table): Likewise.
4002 * src/parse-gram.y (current_class, current_type, current_prec):
4004 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4005 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4006 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4007 void, to avoid warning when NLS is disabled.
4008 * src/output.c: Include scan-skel.h.
4009 (scan_skel): Remove decl, since scan-skel.h does this.
4011 Indent calls to "error" to pacify "make maintainer-distcheck".
4012 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4013 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4014 "make maintainer-distcheck".
4015 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4016 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4017 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4018 (skel_lex_destroy, scan_skel): Move these decls to...
4019 * src/scan-skel.h: New file.
4020 * src/uniqstr.c (uniqstr_assert):
4021 Indent calls to "error" to pacify "make maintainer-distcheck".
4023 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4026 * tests/torture.at: Revamp to avoid misuse of atoi that
4027 "make maintainer-distcheck" complained about.
4029 * examples/extexi (message): Don't print a message more than once,
4030 and omit line-number decoration that makes Emacs compile think
4031 that informative messages are worth worrying about.
4033 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4035 * configure.ac: Update version number.
4037 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4039 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4040 autogenerated by the maintainer.
4041 * examples/calc++/.cvsignore: Add *.yy.
4043 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4044 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4045 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4047 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4049 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4050 from maintainer-distcheck about casting the argument of 'free'.
4052 * NEWS: Mention recent yytname changes.
4053 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4055 * bootstrap: For translations that have not yet been upgraded to
4056 the new runtime-po domain, prime the pump by extracting the
4057 relevant strings from the obsolete translations. This code can be
4058 removed once the bison-runtime domain has been translated by each
4061 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4062 now that token names are already quoted.
4064 Fix problem reported by Anthony Heading.
4065 * data/glr.c (YYTOKEN_TABLE): New macro.
4066 (yytname): Define if YYTOKEN_TABLE.
4067 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4068 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4069 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4070 * src/output.c (prepare_symbols): Output token_table_flag.
4072 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4074 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4075 again if the first call fails.
4077 * data/glr.c (yytnamerr): New function.
4078 (yyreportSyntaxError): Use it to dequote most string literals.
4079 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4080 with other skeletons. All uses changed.
4081 (yytnameerr_): New function.
4082 (yyreport_syntax_error): Use it to dequote most string literals.
4083 * data/yacc.c (yytnamerr): New function.
4084 (yyerrlab): Use it to decode most string literals.
4085 * doc/bison.texinfo (Decl Summary, Calling Convention):
4086 Clarify quoting convention of yytname.
4087 * src/output.c (prepare_symbols): Quote all names. This undoes
4088 the 2005-04-17 change, which is now accomplished (mostly) via
4089 changes in the parsers as described above.
4090 * tests/regression.at (Token definitions, Web2c Actions):
4091 Undo most 2005-04-17 change here, too.
4093 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4095 Fix more problems reported by twlevo@xs4all.nl.
4096 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4097 remove trailing spaces. This loses the exit status of ./types,
4098 and isn't needed since ./types shouldn't be emitting trailing
4100 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4101 as the stack isn't valid in that case.
4103 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4104 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4105 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4106 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4108 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4109 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4110 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4113 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4114 overly-picky compilers that reject 'char *foo = "bar";'.
4116 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4117 to FILE * parameter, not to stderr. This fixes a typo introduced
4118 in the 2005-07-12 change.
4120 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4121 warnings from GCC 4.
4123 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4124 (yyglrShiftDefer, yysplitStack):
4125 Remove unused parameters b4_pure_formals. All uses changed.
4126 (yyglrShift): Remove unused parameters b4_user_formals.
4128 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4130 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4132 Destructor cleanups and regularization among the three skeletons.
4133 * NEWS: Document the behavior changes.
4134 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4135 stack before failing, as the cleanup code will do it for us now.
4136 * data/lalr1.cc (yyerrlab): Likewise.
4137 * data/glr.c (yyparse): Pop everything off the stack before
4138 freeing it, so that destructors get called properly.
4139 * data/lalr1.cc (yyreturn): Likewise.
4140 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4141 This is more consistent.
4142 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4143 why destructors might be called. 1.875 -> 2.1.
4144 (Destructor Decl, Decl Summary, Table of Symbols):
4145 Some English-language cleanups for %destructor.
4146 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4147 Add output line for destructor of start symbol.
4148 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4149 because of that same extra output line.
4151 * NEWS: Document minor wording changes in diagnostics of
4152 Bison-generated parsers.
4153 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4154 Remove unused formals. All uses changed.
4155 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4156 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4157 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4158 Rename yyoverflowab to yyexhaustedlab.
4159 When memory exhaustion occurs during syntax-error reporting,
4160 report it separately rather than in a single diagnostic; this
4162 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4163 (Memory Exhausted): Renamed from Parser Stack Overflow.
4164 Revamp wording slightly to prefer "memory exhaustion".
4165 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4167 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4169 Add i18n support to the GLR skeleton. Partially fix the C++
4170 skeleton; a C++ expert needs to finish this. Remove debugging
4171 msgids; there's little point to having them translated, since they
4172 can be understood only by someone who can read the
4173 (English-language) source code.
4175 Generate runtime-po/bison-runtime.pot automatically, so that we
4176 don't have to worry about garbage getting in that file. We'll
4177 make sure after the next official release that old msgids don't
4179 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4181 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4183 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4184 Fix typos in explanations of the runtime file.
4185 * bootstrap: Change gettext keyword from YYI18N to YY_.
4186 Use standard Makefile.in.in in runtime-po, since we'll arrange
4187 for backward-compatible bison-runtime.po files in a different way.
4188 * data/glr.c (YY_): New macro, from yacc.c.
4189 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4190 Translate messages intended for users.
4191 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4192 the wording in the other skeletons. We don't know that the memory
4194 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4195 Use same method that yacc.c uses.
4196 Don't translate debugging messages.
4197 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4198 it doesn't work (yet), and requires C++ expertise to fix.
4199 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4200 Move defn to a more logical place, to be consistent with other
4202 Don't translate debugging messages.
4203 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4204 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4205 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4206 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4208 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4209 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4211 * tests/glr-regression.at (Badly Collapsed GLR States):
4213 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4214 yylex should return 0 at EOF rather than aborting.
4216 Improve tests for stack overflow in GLR parser.
4217 Problem reported by twlevo@xs4all.nl.
4218 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4220 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4221 can handle the problem.
4222 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4223 (yyparse): New local variable yyresult to record the result.
4224 Use result of setjmp to set it, rather than storing itinto
4226 (yyDone): Remove label.
4227 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4228 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4229 if YYABORT is used).
4230 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4231 yyparse status; put status > 1 into diagnostic.
4232 Check that status==2 works.
4233 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4234 Use exit status 3 for failure to open (which shouldn't happen).
4236 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4238 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4239 1 on syntax error; just let yyparse do its thing.
4240 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4241 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4242 (Exploding the Stack Size with Alloca):
4243 (Exploding the Stack Size with Malloc):
4244 Expect exit status 2, not 1, since the parser is supposed to blow
4245 its stack. Problem reported by twlevo@xs4all.nl.
4247 * data/glr.c (yyparse): Don't assume that the initial calls
4248 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4249 Print a stack-overflow message and fail instead.
4250 Initialize the line-number information before creating the stack,
4251 so that the stack-overflow message can report line zero safely.
4253 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4255 Fix problems reported by twlevo@xs4all.nl.
4256 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4257 (yyuserMerge): Provide a default case if b4_mergers is empty.
4258 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4259 * tests/glr-regression.at
4260 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4261 Add casts to pacify C++ compilers.
4262 * tests/glr-regression.at (Improper merging of GLR delayed action
4263 sets): Declare yylex before using it.
4264 * tests/Makefile.am (maintainer-check-g++): Fix a stray
4265 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4266 test for valgrind; valgrind is independent of g++.
4267 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4268 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4269 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4270 Use a destructor, so that we can expand the stack. Change
4271 YYSTYPE to char * so that we can free it. Cast result of malloc.
4273 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4275 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4276 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4278 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4280 * PACKAGING: New file, suggested by Bruno Haible and taken from
4281 similar wording in gettext's PACKAGING file.
4282 * NEWS: Mention PACKAGING.
4283 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4285 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4287 * NEWS: Document recent i18n improvements.
4288 * bootstrap: Get runtime translations into runtime-po.
4289 Create runtime-po files automatically, if possible.
4290 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4291 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4292 does not infringe on the user's name space.
4293 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4294 * doc/bison.texinfo (Internationalization): Revamp the English
4295 and Texinfo syntax a bit, to try to make it clearer.
4296 (Bison Options, Option Cross Key): Mention --print-localedir.
4297 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4298 YYENABLE_NLS. Quote a bit more.
4299 * runtime-po/.cvsignore: New file.
4300 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4301 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4302 * runtime-po/quot.sed: Likewise.
4303 * runtime-po/boldquot.sed: Likewise.
4304 * runtime-po/en@quot.header: Likewise.
4305 * runtime-po/en@boldquot.header: Likewise.
4306 * runtime-po/insert-header.sin: Likewise.
4307 * runtime-po/remove-potcdate.sin: Likewise.
4308 * runtime-po/Makevars: Likewise.
4309 * runtime-po/LINGUAS: Likewise.
4310 * runtime-po/de.po: Likewise; we will rely on the translation project
4311 to maintain this, so "bootstrap" should get it.
4312 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
4314 * src/main.c (main): Bind the bison-runtime domain, too.
4316 2005-07-12 Bruno Haible <bruno@clisp.org>
4318 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4319 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4320 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4321 * runtime-po: New directory.
4322 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4323 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4324 * runtime-po/Rules-quot: New file, copied from po/.
4325 * runtime-po/quot.sed: Likewise.
4326 * runtime-po/boldquot.sed: Likewise.
4327 * runtime-po/en@quot.header: Likewise.
4328 * runtime-po/en@boldquot.header: Likewise.
4329 * runtime-po/insert-header.sin: Likewise.
4330 * runtime-po/remove-potcdate.sin: Likewise.
4331 * runtime-po/Makevars: New file.
4332 * runtime-po/POTFILES.in: New file.
4333 * runtime-po/LINGUAS: New file.
4334 * runtime-po/bison-runtime.pot: New file.
4335 * runtime-po/de.po: New file.
4336 * m4/bison.m4: New file.
4337 * Makefile.am (SUBDIRS): Add runtime-po.
4338 (aclocaldir, aclocal_DATA): New variables.
4339 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4341 * src/getargs.c (usage): Document --print-localedir option.
4342 (PRINT_LOCALEDIR_OPTION): New enum item.
4343 (long_options): Add --print-localedir option.
4344 (getargs): Handle --print-localedir option.
4345 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4346 (Internationalization): New section.
4348 2005-07-12 Akim Demaille <akim@epita.fr>
4350 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4351 for consistency with the rest of the code.
4352 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4355 2005-07-12 Akim Demaille <akim@epita.fr>
4357 * src/parse-gram.y: Use %printer instead of YYPRINT.
4359 2005-07-12 Akim Demaille <akim@epita.fr>
4361 * src/symtab.h, src/symtab.c (symbol_print): New.
4362 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4363 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4365 2005-07-12 Akim Demaille <akim@epita.fr>
4367 * data/glr.c (b4_syncline): Fix (swap) the definitions of
4368 b4_at_dollar and b4_dollar_dollar.
4370 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4372 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4373 and Pennello's paper.
4375 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4377 * data/yacc.c (yyparse): Undo previous patch. Instead,
4378 set yylsp[0] and yyvsp[0] only if the initial action
4379 sets yylloc and yylval, respectively.
4381 * data/yacc.c (yyparse): In the initial action, set
4382 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4383 This avoids the use of undefined variables if the initial
4384 action does not set yylloc and/or yylval.
4386 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4388 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4389 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4390 Remove from CVS. These files are automatically generated.
4391 * examples/extexi: Clarify that this file is now part of Bison,
4392 not GNU M4, and that it works with any POSIX-compatible Awk.
4393 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4394 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4395 so that we also get calc++-parser.yy. Geneate it.
4396 Use $(AWK), not gawk, since any conforming Awk will do.
4397 Put comment before action, since older 'make' can't handle comment
4399 $(BUILT_SOURCES): List all built sources, not just some of them.
4400 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4401 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4402 $($(calc_sources_generated)): Remove unnecessary test for existence
4403 of target. (This had a shell syntax error anyway; a stray "x".)
4404 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4406 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4408 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4409 implied by the other modules.
4411 2005-07-06 Akim Demaille <akim@epita.fr>
4413 Bind examples/calc++ to the package.
4414 * examples/calc++/Makefile: Remove, replaced by...
4415 * examples/calc++/Makefile.am: ... this new file.
4416 * examples/calc++/test: Remove input.
4417 * examples/calc++/compile: Remove.
4418 * examples/Makefile.am: New.
4419 * configure.ac, Makefile.am: Adjust.
4420 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4422 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4424 * data/glr.c (yyFail): Drastically simplify; since the format argument
4425 never had any % directives, we can simply pass it to yyerror.
4426 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4427 be modified later, as that is the usual style in glr.c.
4428 Problems reported by Paul Hilfinger.
4430 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4431 and size overflow errors.
4432 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4433 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4434 (YYSIZEMAX): New macro.
4435 (yystpcpy): New function, taken from yacc.c.
4436 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4437 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4438 so that we don't have to maintain their signatures.
4439 (yyFail): Check for buffer overflow, by using vsnprintf rather
4440 than vsprintf. Allocate a bigger buffer if possible.
4441 Report an error if buffer allocation fails.
4442 (yyStackOverflow): New function.
4443 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4444 the initialization was successful. It might fail if storage was
4446 (yyexpandGLRStack): Add more checks for storage allocation failure.
4447 Use yyStackOverflow to report failures.
4448 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4449 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4450 Don't assume stack number fits in int.
4451 (yysplitStack): Check for storage allocation failure.
4452 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4453 can print diagnostics on storage allocation failure. All callers
4455 (yyresolveValue): Use yybool for boolean.
4456 (yyreportSyntaxError): Check for size-calculation overflow.
4457 This code is taken from yacc.c.
4458 (yyparse): Check for storage allocation errors when allocating
4461 2005-07-05 Akim Demaille <akim@epita.fr>
4463 Extract calc++ from the documentation.
4464 * doc/bison.texinfo (Calc++): Add the extraction marks.
4465 * examples/extexi: New, from the aborted GNU Programming 2E.
4466 Separate the different paragraph of a file with empty lines.
4467 * examples/Makefile: Use it to extract the whole calc++ example.
4469 2005-06-24 Akim Demaille <akim@epita.fr>
4471 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4474 2005-06-22 Akim Demaille <akim@epita.fr>
4476 * doc/bison.texinfo (C++ Language Interface): First stab.
4477 (C++ Parsers): Remove.
4479 2005-06-22 Akim Demaille <akim@epita.fr>
4481 * data/lalr1.cc (yylex_): Honor %lex-param.
4483 2005-06-22 Akim Demaille <akim@epita.fr>
4485 Start a set of simple examples.
4486 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4487 * examples/calc++/calc++-driver.hh,
4488 * examples/calc++/calc++-parser.yy,
4489 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4490 * examples/calc++/compile, examples/calc++/test: New.
4492 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4494 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4495 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4496 which stems from the 2005-05-27 patch.
4498 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4500 * data/glr.c: Modify treatment of unused parameters to permit use
4501 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4503 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4505 Fix infringement on user name space reported by Janos Zoltan Szabo.
4506 * data/yacc.c (yyparse): strlen -> yystrlen.
4508 2005-05-30 Akim Demaille <akim@epita.fr>
4510 * data/lalr1.cc (_): New.
4511 Translate the various messages.
4513 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4515 Fix infringement on user name space reported by Bruno Haible.
4516 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4517 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4518 the user's name space.
4519 (alloca): Include <stdlib.h> to get it, if it's not built in.
4520 (YYMALLOC, YYFREE): Define only if needed.
4521 (malloc, free): Declare, but only if needed, as this infringes on
4522 the user name space.
4524 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4526 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4527 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4529 * lib/ebitset.c (min, max): Undef before defining.
4530 * lib/vbitset.c (min, max): Likewise.
4531 * lib/subpipe.c (create_subpipe): Save local variables in case
4532 vfork clobbers them.
4534 2005-05-24 Bruno Haible <bruno@clisp.org>
4536 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4537 error message syntax used by gcc-4.0.
4539 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4541 * README: Mention m4 1.4.3. Remove obsolete advice about
4542 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4544 * bootstrap: Remove workaround for problem I encountered with
4545 gettext 0.14.1; it seems to be fixed now.
4547 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4549 * NEWS: Version 2.0a.
4551 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4552 the previous change.
4554 Various maintainer cleanups.
4555 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4556 conftest*, for benefit of CVS commands run at the same time as
4557 "configure". Add build-aux, since "bootstrap" now creates it and
4559 * Makefile.cfg (move_if_change): Remove.
4560 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
4561 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
4562 (po_repo, do-po-update, po-update, wget_files, get-targets):
4563 (config.guess-url_prefix, config.sub-url_prefix):
4564 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
4565 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
4566 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
4568 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
4569 this is now the recommended name.
4570 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
4571 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
4572 ylwrap. These files now go into build-aux.
4573 * config/move-if-change: Remove.
4574 * config/prev-version.txt: Bump from 1.75 to 2.0.
4576 * bootstrap: Add stdio-safer, unistd-safer modules.
4577 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4579 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
4580 fopen-safer.c, stdio-safer.h, unistd-safer.h.
4581 * lib/subpipe.c: Include "unistd-safer.h".
4582 (create_subpipe): Make sure all the newly-created
4583 file descriptors are > 2, so that diagnostics don't
4584 get sent down them (which might cause Bison to hang, in theory).
4585 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
4586 * src/files.c (xfopen): Use fopen_safer, not fopen.
4588 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4589 yesterday's yacc.c fix.
4591 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4593 * data/glr.c, data/lalr1.cc: Update copyright date.
4595 Fix a destructor bug reported by Wolfgang Spraul in
4596 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
4597 * data/yacc.c (yyabortlab): Don't call destructor, and
4598 don't set yychar to EMPTY.
4599 (yyoverflowlab): Don't call destructor.
4600 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
4601 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
4602 since we no longer output the message "discarding lookahead token
4605 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4607 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
4608 fix a small glitch in debugging output.
4609 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
4610 after YY_SYMBOL_PRINT where needed.
4612 (struct yyGLRState): Add some comments.
4613 (struct yySemanticOption): Add some comments.
4614 (union yyGLRStackItem): Add comment.
4616 (yymergeOptionSets): Correct this to properly perform the union,
4617 avoiding infinite reported by Michael Rosien.
4620 * tests/glr-regression.at: Add test for GLR merging error reported
4623 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4625 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
4626 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
4627 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
4628 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
4629 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
4630 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
4631 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
4632 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
4633 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
4634 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
4635 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
4636 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
4637 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
4638 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
4639 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
4640 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
4641 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
4642 src/derives.h, src/files.c, src/files.h, src/getargs.c,
4643 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
4644 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
4645 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
4646 src/output.h, src/parse-gram.c, src/parse-gram.h,
4647 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
4648 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
4649 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
4650 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
4651 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
4652 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
4653 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
4654 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
4655 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
4656 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
4657 tests/reduce.at, tests/regression.at, tests/sets.at,
4658 tests/synclines.at, tests/testsuite.at, tests/torture.at:
4659 Update FSF postal mail address.
4661 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4663 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4664 Problem reported by Ralf Menzel.
4666 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4668 * tests/actions.at: Test that stack overflow invokes destructors.
4669 From Marcus Holland-Moritz.
4670 * data/yacc.c (yyerrlab): Move the code that destroys the stack
4672 (yyreturn): to here. That way, destructors are called properly
4673 even if the stack overflows, or the user calls YYACCEPT or
4674 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
4675 (yyoverflowlab): Destroy the lookahead.
4677 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4679 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4681 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4683 * NEWS: Bison-generated C parsers no longer quote literal strings
4684 associated with tokens.
4685 * src/output.c (prepare_symbols): Don't escape strings,
4686 since users don't want to see C escapes.
4687 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4689 * tests/input.at (Torturing the Scanner): Likewise.
4690 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4692 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4694 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4695 the data size is known to be too small and we can't increase it.
4696 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4698 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4700 * src/parse-gram.y: Include quotearg.h.
4701 (string_as_id): Quote $1 before using it as a key, since the
4702 lexer no longer quotes it for us.
4703 (string_content): Don't strip quotes, since lexer no longer
4705 * src/scan-gram.l: Include quotearg.h.
4707 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4708 a key, since the rest of the lexer doesn't quote it.
4709 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4710 * tests/regression.at (Token definitions): Check for backslashes
4713 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4714 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4715 (yyparse): Revamp code to generate long syntax error message, to
4716 make it easier to translate, and to avoid problems with arithmetic
4717 overflow. Change "virtual memory" to "memory" in diagnostic, since
4718 we don't know whether the memory is virtual.
4720 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4722 * NEWS: Bison-generated C parsers now use the _ macro to
4724 * data/yacc.c (_) [!defined _]: New macro.
4725 All English strings wrapped inside this macro.
4726 * doc/bison.texinfo (Bison Parser): Document _.
4727 * po/POTFILES.in: Include src/parse-gram.c, since it now
4728 includes translateable strings that parse-gram.y doesn't.
4730 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4732 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4733 reverting the 2004-10-11 change to this function.
4734 (symbol_check_alias_consistency): Don't call symbol_type_set
4735 if the type name is already correct.
4736 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4738 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4740 * tests/regression.at (Token definitions): Don't use a token named
4741 c, as that generates a "#define c ..." that runs afoul of buggy
4742 stdlib.h that uses the identifier c as a member of struct
4743 drand48_data. Problem reported by Horst Wente.
4745 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4747 * bootstrap: Change translation URL from
4748 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4749 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4750 redirection glitches. Problem reported by twlevo@xs4all.nl.
4752 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4754 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4755 after operands; POSIX says this isn't portable for the c99 command.
4757 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4759 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4760 immediately if a data overrun has occurred; this may help us track
4761 down what may be a spurious failure on MacOS.
4763 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4765 Respond to problems reported by twlevo@xs4all.nl.
4767 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4769 * src/vcg.h: Comment fix.
4770 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4771 (G_CMAX): Change to -1 instead of INT_MAX.
4773 * data/yacc.c (yyparse): Omit spaces before #line.
4775 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4777 * src/tables.c (state_number_to_vector_number): Put it inside an
4778 "#if 0", since it's not currently used. Problem reported by
4781 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4783 * src/output.c (escaped_output): Renamed from
4784 escaped_file_name_output, since we now use it for symbol tags as
4785 well. All uses changed.
4786 (symbol_destructors_output, symbol_printers_output):
4787 Escape symbol tags too.
4788 Problem reported by Matyas Forstner in
4789 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4791 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4793 * src/output.c (user_actions_output, token_definitions_output,
4794 symbol_destructors_output, symbol_printers_output): Likewise.
4795 * src/reader.c (prologue_augment): Likewise.
4796 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4798 * src/vcg.c (output_edge): Don't quote linestyle arg.
4799 Problem reported by twlevo@xs4all.nl.
4801 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4803 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4804 example, reported by Derek M Jones. Also, make the example even
4805 more outrageous, to better illustrate how bad the problem is.
4807 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4809 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4810 putsym. Typo reported by Sebastian Piping.
4812 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4814 * doc/bison.texinfo (Language and Grammar): some -> same
4815 (Epilogue): int he -> in the
4816 Typos reported by Sebastian Piping via Justin Pence.
4818 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4820 * tests/glr-regression.at (Improper handling of embedded actions
4821 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4822 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4823 with dollar signs in test names.
4824 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4825 for a similar reason.
4827 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4829 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4830 wants to redefine G_VIEW.
4832 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4834 * src/vcg.c (get_view_str): Remove case for normal_view.
4835 Problem reported by twlevo@xs4all.nl.
4837 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4839 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4840 Problem reported by twlevo@xs4all.nl.
4842 * doc/bison.texinfo: Change @dircategory from "GNU programming
4843 tools" to "Software development". Requested by Richard Stallman
4846 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4848 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4849 Problem reported by twlevo@xs4all.nl.
4851 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4853 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
4854 keyword; it's not needed with modern compilers, and it doesn't
4855 affect correctness with older compilers. Suggested by
4858 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4860 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
4861 gcc -Wswitch-default.
4862 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4863 * data/yacc.c (yyparse): Likewise.
4865 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4867 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4868 already. Let config.h define any nonstandard values.
4870 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4872 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4873 for the benefit of slower hosts. Problem reported by
4876 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4878 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
4879 being defined and not used.
4880 * data/lalr1.cc (yyparse): Likewise.
4881 Use "if (false)" rather than "if (0)".
4883 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4885 * TODO: Mention that we should allow NUL bytes in tokens.
4887 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4889 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4890 Problem reported by Hans Aberg.
4892 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4894 * src/getargs.c (version): Happy new year; update overall
4895 program copyright date from 2004 to 2005.
4897 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
4898 Problem reported by Hans Aberg.
4899 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
4900 (Output file names.): Add a test for the case when standard output
4903 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4905 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4906 to fix an oversight in the Bison 2.0 manual.
4908 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4910 * NEWS: Version 2.0. Reformat the existing news items since
4911 1.875, so that related items are grouped together.
4912 * configure.ac (AC_INIT): Bump version to 2.0.
4913 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
4915 * tests/torture.at (Exploding the Stack Size with Alloca): Set
4916 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
4917 otherwise, we're not testing alloca. Unfortunately there's no
4918 simple way to consult HAVE_ALLOCA here.
4920 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4923 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
4924 hand. This avoids a warning about comparing int to size_t when
4925 GCC warnings are enabled.
4927 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4929 * NEWS: Bison-generated parsers no longer default to using the
4930 alloca function (when available) to extend the parser stack, due
4931 to widespread problems in unchecked stack-overflow detection.
4932 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4933 responsibility to set it to a positive value. This lets the user
4934 specify a value that is not a preprocessor constant.
4935 * data/yacc.c (YYMAXDEPTH): Likewise.
4936 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4937 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4938 to be a compile-time constant. However, explain the constraints on it.
4939 Also, explain the constraints on YYINITDEPTH.
4940 (Table of Symbols): Explain that alloca is no longer the default.
4941 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4944 * doc/bison.texinfo (Location Default Action): Mention that n must
4945 be zero when k is zero. Suggested by Frank Heckenbach.
4947 2004-12-22 Akim Demaille <akim@epita.fr>
4949 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4950 (parser::state_type, parser::semantic_type, parser::location_type):
4951 Private, not public.
4952 (parser::parse): Return ints, not bool.
4953 Returning a bool introduces a problem: 0 corresponds to false, and
4954 it seems weird to return false on success. Returning true changes
4955 the conventions for yyparse.
4956 Alternatively we could return void and send an exception.
4957 There is no clear consensus (yet?).
4958 (state_stack, semantic_stack, location_stack): Rename as...
4959 (state_stack_type, semantic_stack_type, location_stack_type): these.
4960 Private, not public.
4961 * tests/c++.at: New.
4962 * tests/testsuite.at, tests/Makefile.am: Adjust.
4964 2004-12-21 Akim Demaille <akim@epita.fr>
4966 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4968 2004-12-21 Akim Demaille <akim@epita.fr>
4970 Don't impose std::string for filenames.
4972 * data/lalr1.cc (b4_filename_type): New.
4973 (position::filename): Use it.
4974 (parser.hh): Move the inclusion of stack.hh and location.hh below
4975 the user code, so that needed headers for the filename type can be
4977 Forward declare them before the user code.
4978 * tests/Makefile.am (check-local, installcheck-local): Pass
4979 TESTSUITEFLAGS to the TESTSUITE.
4981 2004-12-20 Akim Demaille <akim@epita.fr>
4983 Use more STL like names: my_class instead of MyClass.
4985 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
4986 (SemanticStack, SemanticType, StateStack, StateType)
4987 (TokenNumberType, Stack, Slice, Traits, Parser::location)
4988 (Parser::value): Rename as...
4989 (location_stack, location_type, rhs_number_type, semantic_stack)
4990 (semantic_type, state_stack, state_type, token_number_type, stack)
4991 (slice, traits, parser::yylloc, parser::yylval): these.
4993 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
4995 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4997 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
4998 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5000 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5002 Remove uses of 'short int' and 'unsigned short int'. This raises
5003 some arbitrary limits. It uses more memory but nowadays that's
5004 not much of an issue.
5006 This change does not affect the generated parsers; that's a different
5007 task, as some users will want to conserve memory there.
5009 Ideally we should use size_t to represent all object counts, and
5010 something like ptrdiff_t to represent signed differences of object
5011 counts; but that will require more code-cleanup than I have the
5012 time to do right now.
5014 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5015 Use size_t, not int or short int, to count objects.
5016 * src/closure.c (nritemset, closure): Likewise.
5017 * src/closure.h (nritemset, closure): Likewise.
5018 * src/nullable.c (nullable_compute): Likewise.
5019 * src/print.c (print_core): Likewise.
5020 * src/print_graph.c (print_core): Likewise.
5021 * src/state.c (state_compare, state_hash): Likewise.
5022 * src/state.h (struct state): Likewise.
5023 * src/tables.c (default_goto, goto_actions): Likewise.
5025 * src/gram.h (rule_number, rule): Use int, not short int.
5026 * src/output.c (prepare_rules): Likewise.
5027 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5028 errs, reductions): Likewise.
5029 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5031 * src/tables.c (vector_number, tally, action_number,
5032 ACTION_NUMBER_MINIMUM): Likewise.
5033 * src/output.c (muscle_insert_short_int_table): Remove.
5035 2004-12-17 Akim Demaille <akim@epita.fr>
5037 * data/lalr1.cc: Extensive Doxygenation.
5038 (error_): Rename as...
5039 (error): this, since it is visible to the user.
5041 (Parser::message): Now an automatic variable from...
5042 (Parser::yyreport_syntax_error_): here.
5043 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5045 * tests/input.at: Escape $.
5047 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5049 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5050 Parenthesize rhs to avoid obscure problems with mistakes like
5051 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5052 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5053 b4_rhs_location): Likewise.
5054 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5055 b4_rhs_location): Likewise.
5057 2004-12-16 Akim Demaille <akim@epita.fr>
5059 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5060 yacc.c: be sure to stay within yycheck_.
5061 * tests/actions.at: Re-enable C++ tests.
5063 2004-12-16 Akim Demaille <akim@epita.fr>
5065 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5068 2004-12-16 Akim Demaille <akim@epita.fr>
5070 Use #define to handle the %name-prefix.
5072 * data/glr.c, data/yacc.c: Comment changes.
5073 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5074 so that one can refer to yylex in the parser file, and have it
5075 renamed, as is the case with other skeletons.
5077 2004-12-16 Akim Demaille <akim@epita.fr>
5079 Move lalr1.cc internals into yy*.
5081 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5082 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5083 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5084 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5085 (empty_, final_, terror_, errcode_, ntokens_)
5086 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5087 (looka_, ilooka_, error_range_, nerrs_):
5089 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5090 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5091 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5092 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5093 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5094 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5095 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5096 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5099 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5101 Fix some problems reported by twlevo at xs4all.
5102 * src/symtab.c (symbol_new): Report an error if the input grammar
5103 contains too many symbols. This is better than calling abort() later.
5104 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5105 (struct node, struct graph):
5106 Rename member expand to stretch. All uses changed.
5107 (struct graph): Remove member layoutalgorithm. All uses removed.
5108 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5109 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5111 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5113 2004-12-15 Akim Demaille <akim@epita.fr>
5115 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5116 Add more Doxygen comments.
5117 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5118 (report_syntax_error_, translate_): Rename as...
5119 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5120 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5122 2004-12-15 Akim Demaille <akim@epita.fr>
5124 * data/lalr1.cc (lex_): Rename as...
5126 Move the trace here.
5127 Take the %name-prefix into account.
5128 Reported by Alexandre Duret-Lutz.
5130 2004-12-15 Akim Demaille <akim@epita.fr>
5132 Simplify the C++ parser constructor.
5134 * data/lalr1.cc (debug_): Rename as...
5135 (yydebug_): so that the parser's internals are always in the yy*
5138 (b4_parse_param_decl): Remove the leading comma as it is now only
5139 called as unique argument list.
5140 (Parser::Parser): Remove the constructor accepting a location and
5141 an initial debugging level.
5142 Remove from the other ctor the argument for the debugging level.
5143 (debug_level_type, debug_level, set_debug_level): New.
5145 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5148 2004-12-15 Akim Demaille <akim@epita.fr>
5150 Remove b4_root related material: failure experiment
5151 (which goal was to allow to derive from a class).
5153 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5154 definitions and uses.
5156 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5158 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5159 not 2, since it's not portable to subtract 1 from the start of an
5160 array. The new item 0 is never set or used. All uses changed.
5162 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5163 the default definition of YYLLOC_DEFAULT. Problem reported
5164 by Frank Heckenbach.
5166 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5168 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5169 the normal case and one for the error case. Just use the
5170 first one uniformly. Problem reported by Frank Heckenbach.
5171 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5172 use exactly the same macro in both places.
5173 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5174 so that the normal-case YYRHSLOC works for the error case too.
5176 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5177 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5178 * doc/bison.texinfo (Location Default Action): Don't claim that
5179 we have an array of locations. Use the same macro for both glr
5180 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5183 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5185 * HACKING: Update email addresses to send announcements to.
5187 * configure.ac (AC_INIT): Bump version to 1.875f.
5189 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5191 * NEWS: Version 1.875e.
5192 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5194 * src/scan-skel.l: Include "complain.h", for "fatal".
5196 * src/relation.h (relation_print, relation_digraph):
5197 Relation sizes are of type relation_node, not size_t (this is
5198 merely a doc fix, since the two types are equivalent).
5199 (relation_transpose): Relation sizes are of type relation_node,
5201 * src/relation.c: Likewise.
5202 (top, infinity): Now of type relation_node, not int.
5203 (traverse, relation_transpose): Use relation_node, not int.
5205 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5206 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5207 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5209 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
5210 specifying whether the test should be skipped. Use it tp
5211 specify that the [%defines %skeleton "lalr1.cc"] tests currently
5212 fail on some hosts, and should be skipped.
5214 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5216 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5217 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5218 unless otherwise specified below.
5220 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5221 to allocate kernel_base, kernel_items, kernel_size, since
5222 they needn't be initialized to 0.
5223 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5224 * src/closure.c (new_closure): Likewise, for itemset.
5225 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5226 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5227 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5228 (build_relations): Likewise for edge, states1, includes.
5229 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5230 * src/reader.c (packgram): Likewise, for ritem, rules.
5231 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5232 * src/relation.c (relation_digraph): Likewise for VERTICES.
5233 (relation_transpose): Likewise for new_R, end_R.
5234 * src/symtab.c (symbols_token_translations_init): Likewise for
5236 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5237 (token_actions): Likewise for yydefact, actrow, conflrow,
5239 (save_column): Likewise for froms[symno], tos[symno].
5240 (goto_actions): Likewise for state_count.
5241 (pack_table): Likewise for base, pos, check.
5242 (tables_generate): Likewise for width.
5244 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5245 for initial core. Just have a separate core, so we needn't worry
5246 about whether kernel_size and kernel_base are initialized.
5248 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5249 kernel_size, kernel_items): Remove unnecessary initialization.
5250 * src/conflicts.c (conflicts): Likewise.
5251 * src/derives.c (derives): Likewise.
5252 * src/muscle_tablc (muscle_insert): Likewise.
5253 * src/relation.c (relation_digraph): Likewise.
5254 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5255 conflrow, conflict_table, conflict_list, table, check):
5258 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5259 This is because all callers pass unsigned int.
5260 * src/closure.h (new_closure): Likewise.
5262 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5263 (build_relations): Initialize includes[i] in all cases.
5264 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5265 and rules[ruleno].precsym. Initialize members in order.
5266 * src/relation.c (relation_transpose): Always initialize new_R[i]
5268 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5270 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5271 conflict_list[0] was always 0, but now it isn't initialized.
5273 * src/table.c (table_grow): When conflict_table grew, the grown
5274 area wasn't cleared. Fix this.
5276 * lib/.cvsignore: Add strdup.c, strdup.h.
5277 * m4/.cvsignore: Add strdup.m4.
5279 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5281 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5282 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5283 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5284 ngotos + 1 without checking for overflow.
5285 (build_relations): Use END_NODE, not -1, to denote end of edges.
5286 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5287 build_relations): Use goto_number, not int, for goto numbers.
5288 * src/tables.c (save_column, default_goto): Likewise.
5290 2004-11-23 Akim Demaille <akim@epita.fr>
5292 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5293 of #defining from yystype.
5294 Don't typedef yystype, C++ does not need it.
5295 This lets it possible to forward declare it as union.
5297 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5299 * bootstrap (gnulib_modules): Add extensions.
5300 Problem reported by Jim Meyering.
5302 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5304 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5305 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5306 src/system.h, src/tables.c: XFREE -> free, to accommodate
5307 recent change to gnulib xalloc.h.
5308 Problem reported by Jim Meyering.
5310 2004-11-17 Akim Demaille <akim@epita.fr>
5312 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5314 2004-11-17 Akim Demaille <akim@epita.fr>,
5315 Alexandre Duret-Lutz <adl@gnu.org>
5317 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5320 Use it instead of cdebug_.
5321 (Parser::debug_stream, Parser::set_debug_stream): New.
5322 (Parser::symprint_): Define cdebug_ for temporary backward
5324 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5327 2004-11-17 Akim Demaille <akim@epita.fr>
5329 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5330 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5331 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5332 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5334 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5336 * data/glr.c (yyloc_default): Remove; not used.
5337 Problem reported by Frank Heckenbach.
5339 2004-10-25 Akim Demaille <akim@epita.fr>
5341 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5342 Introduce another definition to address simple location arrays.
5343 (yyGLRStack): New member: yyerror_range.
5344 (yyrecoverSyntaxError, yyparse): Update it.
5345 (yyrecoverSyntaxError): Use it when shifting the error token to
5346 have an accurate range, equivalent to the one computed by both
5347 yacc.c and lalr1.cc.
5348 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5349 that column numbers start at column 0, as per GNU Coding
5350 Standards, the others tests, and the doc.
5351 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5352 Adjust to the above change (first column is 0).
5353 And adjust the location of the "<error>", now covering the whole
5356 2004-10-22 Akim Demaille <akim@epita.fr>
5357 and Paul Eggert <eggert@cs.ucla.edu>
5359 Remove some arbitrary limits on goto numbers and relations.
5360 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5361 initial values, since they're never used.
5362 (set_goto_map): ngotos is now unsigned, so test for overflow
5363 by seeing whether it wraps around to zero.
5364 * src/lalr.h (goto_number): Now size_t, not short int.
5365 (GOTO_NUMBER_MAXIMUM): Remove.
5366 * src/relation.c (relation_print, traverse, relation_transpose):
5367 Check for END_NODE rather than looking at sign.
5368 * src/relation.h (END_NODE): New macro.
5369 (relation_node): Now size_t, not short int.
5371 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5373 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5374 keyword, not an identifier. Problem reported by Baron Schwartz in
5375 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5377 2004-10-11 Akim Demaille <akim@epita.fr>
5379 * src/symtab.c (symbol_check_alias_consistency): Also check
5380 type names, destructors, and printers.
5381 Reported by Alexandre Duret-Lutz.
5382 Recode the handling of associativity and precedence in terms
5383 of symbol_precedence_set.
5384 Accept no redeclaration at all, not even equal to the previous
5386 (redeclaration): New.
5387 Use it to factor redeclaration complaints.
5388 (symbol_make_alias): Don't set the type of the alias, let
5389 symbol_check_alias_consistency do it as for other features.
5390 * src/symtab.h (symbol): Add new member prec_location, and
5392 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5393 * tests/input.at (Incompatible Aliases): New.
5395 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5397 .cvsignore fixes to accommodate gnulib changes,
5398 and the practice of naming build directories "_build".
5399 * .cvsignore: Add "_*". Sort.
5400 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5401 * m4/.cvsignore: Add "*_gl.m4".
5403 2004-10-06 Akim Demaille <akim@epita.fr>
5405 * src/parse-gram.y (add_param): Fix the truncation of trailing
5408 2004-10-05 Akim Demaille <akim@epita.fr>
5410 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5411 whether the reducion was empty or not. This leaves room to
5412 improve the use of YYLLOC_DEFAULT in such a case.
5413 lalr1.cc is still experimental, so changing this is acceptable.
5414 And finally, there are probably not many users who changed the
5415 handling of locations in GLR, so changing is admissible too.
5417 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5418 empty reduction, set @$ to an empty location ending the previously
5420 Adjust uses to make sure the code is triggered on empty
5422 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5423 expected output: empty reductions have empty locations.
5425 2004-09-29 Akim Demaille <akim@epita.fr>
5427 * data/lalr1.cc: Move towards a more standard C++ coding style
5428 for templates: Class < T > -> Class<T>.
5430 2004-09-29 Akim Demaille <akim@epita.fr>
5432 * data/lalr1.cc: Reinstall the former ctor, for sake of
5433 compatibility, but warn it will be removed.
5434 Move towards a more standard C++ coding style (i.e., type *var ->
5437 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5439 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5440 since it's less likely to work if NULs are involved in the future.
5442 2004-09-27 Akim Demaille <akim@epita.fr>
5444 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5446 2004-09-27 Akim Demaille <akim@epita.fr>
5448 * data/lalr1.cc (b4_parse_param_decl_1): New.
5449 (b4_parse_param_decl): Use it to have different names between attribute
5451 (b4_cc_constructor_call): Likewise.
5453 2004-09-24 Akim Demaille <akim@epita.fr>
5455 * src/parse-gram.y (add_param): Strip the leading and trailing
5456 blanks from a formal argument declaration.
5457 (YY_LOCATION_PRINT): New.
5459 2004-09-24 Akim Demaille <akim@epita.fr>
5461 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5464 2004-09-24 Akim Demaille <akim@epita.fr>
5466 * doc/bison.texinfo (Table of Symbols): Sort.
5468 2004-09-21 Akim Demaille <akim@epita.fr>
5470 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5471 the useless parentheses.
5472 Suggested by Paul Eggert.
5474 2004-09-20 Akim Demaille <akim@epita.fr>
5476 Let the initial-action act on the look-ahead, and use it for the
5477 "initial push" (corresponding to an hypothetical beginning-of-file).
5478 And let lalr1.cc honor %initial-action.
5480 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5482 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5483 (Parser::Parser): Remove the ctor that used to initialize it.
5484 (Parser::parse): Like in the other skeletons, issue the "starting
5485 parse" message before any action.
5486 Honor %initial-action.
5487 Initialize the stacks with the lookahead.
5488 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5490 Push them in the stacks.
5491 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5493 2004-09-20 Akim Demaille <akim@epita.fr>
5495 * doc/bison.texinfo (Initial Action Decl): New.
5497 2004-09-20 Akim Demaille <akim@epita.fr>
5499 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5500 clearer criterion to define it.
5501 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5502 When reducing on an empty RHS, use the latest stacked location as
5504 yylloc is not always available.
5505 * data/glr.c: Likewise.
5506 Also, honor initial-actions.
5508 2004-09-20 Akim Demaille <akim@epita.fr>
5510 * data/yacc.c (YY_LOCATION_PRINT): New.
5511 Define when we know YYLTYPE's structure, i.e., when the default
5512 YYLLOC_DEFAULT is used.
5513 * data/c.m4 (b4_yysymprint_generate): Use it.
5514 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5515 value of the result.
5516 (error_start_): Replace with...
5517 (error_range_): this location array.
5518 This allows to replace code relying on the implementation of
5519 locations by portable code.
5520 * data/yacc.c (yylerrsp): Replace with...
5521 (yyerror_range): this.
5522 Every time a token is popped, update yyerror_range[0], to have an
5523 accurate location for the error token.
5524 * data/glr.c (YY_LOCATION_PRINT): New.
5525 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5526 deference a pointer.
5527 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5528 report the location in %printers.
5530 * src/scan-skel.l: Instead of abort, report error messages to ease
5531 understanding skeleton scanning failures.
5533 2004-09-16 Akim Demaille <akim@epita.fr>
5535 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5536 (iterator, const_iterator): these, to be more in the C++ spirit.
5537 Also, return reverse iterators so that when displaying the stack
5538 we display its bottom first.
5539 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5541 We should probably use vector here though.
5543 2004-09-16 Akim Demaille <akim@epita.fr>
5545 Have more complete shift traces.
5547 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5548 to report Shifts instead of ad hoc YYDPRINTF invocations,
5549 including for the error token.
5550 * data/lalr1.cc (symprint_): Output the location.
5551 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5552 output the location within the %printer.
5553 Activate GLR tests, at least to make sure they compile properly.
5554 They still don't pass though.
5555 * tests/calc.at: Adjust expect verbose output, since now "Entering
5556 state..." is on a different line than the "Shifting" message.
5558 2004-09-08 Akim Demaille <akim@epita.fr>
5560 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
5561 Bison directive from the Bison file to the invocation of this
5562 macro, so that these directives are passed to
5563 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
5564 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
5565 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
5566 the extra Bison directives instead of the whole series.
5567 Change the grammar so that there are recoverable errors, and
5568 unrecoverable errors. Now we can have the parser give up before
5569 consuming the whole input. As a result we now can observe that
5570 the lookahead is freed when needed.
5571 Change the parser source to parse argv[1] instead of a hard coded
5573 Simplify yylex, and give a value and location to EOF.
5574 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
5575 passed directives already coded in the file.
5576 Add some tests to check the location of "error".
5577 For some tests, the C++ parser is correct, and not yacc.c.
5578 For other tests, they provide different, but unsatisfying, values,
5579 so keep the C++ value so that at least one parser is "correct"
5580 according to the test suite.
5581 (Actions after errors): Remove, this is subsumed by the
5582 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
5584 2004-09-06 Akim Demaille <akim@epita.fr>
5586 * data/lalr1.cc: Adjust the indentation of the labels.
5590 2004-09-06 Akim Demaille <akim@epita.fr>
5592 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
5593 argument, an informative message.
5594 Call YY_SYMBOL_PRINT.
5595 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
5596 * data/lalr1.cc (destruct_): Likewise.
5597 In addition, no longer depend on b4_yysymprint_generate and
5598 b4_yydestruct_generate to generate these functions, do it "by
5601 2004-09-03 Akim Demaille <akim@epita.fr>
5603 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
5604 invoked, yydestruct the lookahead.
5605 * tests/calc.at (Calculator $1): Update the expected lengths of
5606 traces: there is an added line for the discarded lookahead.
5607 * doc/bison.texinfo (Destructor Decl): Some rewording.
5608 Define "discarded" symbols.
5610 2004-09-02 Akim Demaille <akim@epita.fr>
5612 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5614 2004-09-02 Akim Demaille <akim@epita.fr>
5616 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
5617 (YYDSYMPRINTF): Rename as...
5618 (YY_SYMBOL_PRINT): this.
5619 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
5621 Use it instead of direct symprint_ calls.
5622 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5625 2004-09-02 Akim Demaille <akim@epita.fr>
5627 * data/lalr1.cc (b4_yysymprint_generate): New.
5628 (symprint_): New member function, defined when YYDEBUG.
5629 Use it consistently instead of token/nterm debugging output by
5631 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5632 %printer calls to use cdebug_ when using lalr1.cc.
5634 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5636 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5637 with #ifdef YYDEBUG.
5639 2004-08-26 Akim Demaille <akim@epita.fr>
5641 * doc/bison.texinfo (Implementing Loops): Rename as...
5642 (Implementing Gotos/Loops): this.
5644 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5646 Adjust to latest gnulib.
5647 * bootstrap (gnulib_modules): Add xalloc-die.
5648 Set LC_ALL=C so that file names sort consistently.
5649 Prefer the gnulib copies of gettext.m4, glibc21.m4,
5650 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
5651 uintmax_t.m4, ulonglong.m4.
5652 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
5653 po.m4 since we are now using _gl.m4 instead.
5655 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5657 * src/scan-action.l: Remove. Scanning of semantic actions is
5658 handled in scan-gram.l.
5660 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5662 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5664 * src/location.h (struct): The file member is a uniqstr.
5665 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5667 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5669 Fix bug with non-%union parsers that have printers or destructors,
5670 which led to a Bison core dump. Reported by Peter Fales in
5671 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
5673 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
5674 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
5675 not to our own type.
5676 * src/output.c (symbol_destructors_output, symbol_printers_output):
5677 Don't assume %union.
5678 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
5679 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
5680 UNION-FLAG. All callers changed.
5681 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
5682 Use type char, not unsigned int, when declaring an array of char;
5683 this lets us remove a cast.
5684 (Printers and Destructors): Add non-%union test cases.
5686 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5688 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5689 GLR writeups. E.g., avoid frenchspacing and the future tense,
5690 change "lookahead" to "look-ahead", and change "wrt" to "with
5693 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5695 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5696 New sections, split off from the GLR Parsers section. Put the new
5697 Simple GLR Parser near the start of the GLR section, for clarity.
5698 Rewrite connective text.
5700 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
5702 * doc/bison.texinfo (Simple GLR Parsers): New section.
5704 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5706 * NEWS, TODO, doc/bison.texinfo:
5707 Use "look-ahead" instead of "lookahead", to be consistent.
5708 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5709 while we're fixing "look-ahead".
5710 * src/conflicts.c (shift_set): Renamed from shiftset.
5711 (look_ahead_set): Renamed from lookaheadset.
5712 * src/print.c: Likewise.
5713 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5714 name for "lookahead".
5715 (report_types, usage): Likewise.
5716 * src/getargs.h (report_look_ahead_tokens): Renamed from
5718 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5720 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5721 (look_ahead_tokens_print): Renamed from lookaheads_print.
5722 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5723 state_rule_lookaheads_print.
5724 * src/state.h: Likewise.
5725 (reductions.look_ahead_tokens): Renamed from lookaheads.
5726 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5727 AT_DATA_LOOKAHEADS_GRAMMAR.
5729 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5731 * README: Update location of patched M4 distribution.
5733 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5735 Don't assume the C++ compiler takes the same arguments as the C compiler
5737 * configure.ac (O0CXXFLAGS): New var.
5738 * tests/atlocal.in (CXXFLAGS): Use it.
5740 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5742 Fix some "make check" problems with C++ reported by
5743 Albert Chin-A-Young for Tru64 C++ in this thread:
5744 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5746 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5747 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5748 Output to a .cc file for C++, not to a .c file.
5749 * tests/calc.at (AT_CHECK_CALC): Likewise.
5750 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5751 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5753 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5755 * tests/calc.at, tests/actions.at: Workaround for SGI
5756 C++ compiler. (trivial change)
5758 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5760 Spent a few hours checking out which prerequisite versions the
5761 current sources actually require. I went all the way back to
5762 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5763 a seemingly endless set of combinations of versions more recent
5764 than that. The bottom line is that the current sources require
5765 fairly recent versions of the build tools, and it'll be some work
5767 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5768 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5769 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5770 Add comments explaining why those particular versions are
5773 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5774 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
5775 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
5777 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5778 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5780 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5782 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5783 0.11.5. Suggested by Bruno Haible.
5784 * bootstrap: Remove gettext version checking.
5786 * doc/bison.texinfo (Decl Summary): Also mention that %union
5787 can depend on prerequisite types. Problem reported by Tim
5790 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5792 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5793 * README-alpha: Don't tell people not to package this.
5795 * bootstrap: Don't assume $(...) works; use `...` instead.
5796 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5799 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5800 put into the -d output file, and mention what to do if YYSTYPE is
5803 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5805 Undo change made earlier today: it caused autopoint to not bring
5806 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5809 * bootstrap: Check that gettext version matches what's in
5810 configure.ac. Warn users to ignore robots.txt ERROR 404.
5811 * bootstrap: Undo today's earlier change (logged below).
5812 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
5814 The gettext version checking is causing more trouble than it's
5815 curing; remove it. Problem reported by Paul Hilfinger.
5817 * bootstrap: Issue a warning that one can expect a message
5818 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5819 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5821 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5823 Ensure that the C++ compiler used for testing actually works on a
5824 simple test program; if not, skip the C++-related tests. Problem
5825 reported by Vin Shelton in:
5826 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
5828 * m4/cxx.m4: New file.
5829 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5830 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5831 * tests/local.at (AT_COMPILE_CXX): Use it.
5833 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5835 * data/glr.c (yylloc): Output this macro even if locations are not
5836 being generated, as the GLR parser needs it even in that case.
5837 Problem reported by Troy A. Johnson
5838 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5840 * configure.ac (AC_INIT): Update to 1.875e.
5842 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5844 * NEWS: Version 1.875d.
5845 * configure.ac (AC_INIT): Likewise.
5846 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5848 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5849 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5850 lalr1.cc runs afoul of the first, and the last two are no longer
5851 supported by GCC 3.4.0.
5852 * README: Mention GNU m4 1.4 or later; mention m4 patches.
5853 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
5855 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5857 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
5858 unsigned int, for compatibility with latest gnulib hash module.
5859 * src/state.c (state_hash, state_hasher): Likewise.
5860 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
5861 * src/uniqstr.c (hash_uniqstr): Likewise.
5863 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5865 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5867 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
5868 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
5869 character and string literals.
5870 (unexpected_end): New function.
5871 (unexpected_eof): Use it.
5872 (unexpected_newline): New function.
5873 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
5876 * NEWS: Document %expect-rr.
5878 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
5879 Fix typo by replacing $1 with $option.
5880 Remove more 'intl'-related files.
5881 Don't DEFUN AM_INTL_SUBDIR twice.
5883 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5884 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5886 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
5887 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
5888 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
5889 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
5890 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
5891 * src/.cvsignore: Add *.output.
5893 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5894 gets copied to the output file.
5896 2004-04-28 Paul Eggert <eggert@twinsun.com>
5898 Get files from the gnulib and po repositories, instead of relying
5899 on them being in our CVS. Upgrade to latest versions of gnulib
5902 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
5903 * bootstrap: Bootstrap from gnulib and po repositories.
5904 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
5905 * README-cvs: Document these changes. Remove version numbers from
5906 mentions of build tools, since they change so often. Mention Flex.
5908 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
5909 (gl_USE_SYSTEM_EXTENSIONS): Add.
5910 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
5911 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
5913 (AC_ISC_POSIX): Remove; we no longer support this
5914 ancient OS, as it gets in the way of latest Autoconf & gnulib.
5915 (AC_HEADER_STDC): Remove: we now assume C89 or better.
5916 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
5917 Do not check for C89 headers, except for locale.h which is used
5918 by the Yacc library and must port to K&R hosts.
5919 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
5920 Do not check for C89 functions, except for setlocale which is
5921 used by the Yacc library.
5922 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
5923 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
5924 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
5925 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5926 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5927 AM_GNU_GETTEXT): Remove; now done by:
5928 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5929 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5932 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5933 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5934 Define to empty, as gnulib.mk will do the rest for us.
5935 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5937 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5938 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5940 * src/files.c: Include gnulib's xstrndup.h.
5942 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5943 (REALLOC): Use xnrealloc, for likewise.
5944 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5945 (strnlen, memrchr): Remove decls; functions no longer used.
5948 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5949 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5950 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5951 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5952 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5953 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5954 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5955 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5956 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5957 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5958 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5959 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5960 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5961 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5962 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5963 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5964 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5965 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5966 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5967 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
5968 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
5969 Remove, as these files are now generated automatically
5970 by bootstrap or automake.
5972 * po/ChangeLog: Remove: all but one entry was a duplicate
5973 of this file, and I moved that 2000-11-02 entry here.
5975 * config/.cvsignore: Add Makefile, depcomp, install-sh.
5976 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
5977 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
5978 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
5979 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
5980 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
5981 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
5982 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
5983 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
5984 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
5985 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
5987 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
5988 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
5989 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
5990 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
5991 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
5992 * src/.cvsignore: Remove *_.c.
5995 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
5996 support it. (The latest stable gzip doesn't.)
5998 2004-04-27 Paul Eggert <eggert@twinsun.com>
6000 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6001 case, as stos_ is now used by destructors due to the 2004-02-09
6004 Remove more K&R C support.
6005 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6006 * lib/subpipe.c (errno): Remove decl.
6007 Include <stdlib.h> unconditionally.
6008 (EXIT_FAILURE): Remove macro.
6009 * src/complain.c (vfprintf, strerror): Remove.
6010 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6012 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6013 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6014 (strchr, strspn, memchr): Remove decls.
6015 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6016 unconditionally. Do not declare perror.
6017 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6020 * src/complain.c (_): Remove useless defn, as system.h defines this.
6022 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6023 with latest obstack.h.
6024 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6025 to procedure types, as obstack.h now does that for us.
6026 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6028 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6029 so that this include file can stand alone.
6030 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6031 does this now. Include subpipe.h first after config.h, to
6032 test whether it can stand alone.
6034 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6035 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6038 * tests/synclines.at (%union synch line): Put a dummy member in
6039 the union, because empty unions aren't allowed in C. Caught
6042 2004-04-13 Jim Meyering <jim@meyering.net>
6044 * src/conflicts.c (conflicts_print): Correct format string typo:
6045 use `%%' to produce literal `%'. (trivial change)
6047 2004-03-30 Paul Eggert <eggert@twinsun.com>
6049 * src/getargs.c (version): Update copyright year to 2004.
6051 * data/c.m4 (b4_int_type): Use 'short int' rather than
6052 'short', and similarly for 'long', 'unsigned', etc.
6053 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6054 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6055 yy_yypstack, yydumpstack): Likewise.
6056 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6057 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6059 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6060 yy_stack_print, yyparse): Likewise.
6061 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6062 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6063 * lib/bitset.c (bitset_print): Likewise.
6064 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6065 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6066 * lib/bitsetv.c (bitsetv_dump): Likewise.
6067 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6068 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6070 * src/LR0.c (allocate_itemsets): Likewise.
6071 * src/gram.h (rule_number, rule): Likewise.
6072 * src/lalr.h (goto_number): Likewise.
6073 * src/nullable.c (nullable_compute): Likewise.
6074 * src/output.c (prepare_rules): Likewise.
6075 * src/relation.c (relation_print, relation_digraph): Likewise.
6076 * src/relation.h (relation_node): Likewise.
6077 * src/state.h (state_number, transitions, errs, reductions,
6078 struct state): Likewise.
6079 * src/symtab.h (symbol_number, struct symbol): Likewise.
6080 * src/tables.c (vector_number, tally, action_number,
6081 default_goto, goto_actions): Likewise.
6082 * tests/existing.at (GNU Cim Grammar): Likewise.
6083 * tests/regression.at (Web2c Actions): Likewise.
6085 * src/output.c (muscle_insert_short_int_table): Renamed from
6086 muscle_insert_short_table. All uses changed.
6088 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6090 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6091 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6092 Add %expect-rr rule.
6094 * src/scan-gram.l: Recognize %expect-rr.
6096 * src/conflicts.h (expected_sr_conflicts): Rename from
6098 (expected_rr_conflicts): Declare.
6100 * src/conflicts.c (expected_sr_conflicts): Rename from
6102 (expected_rr_conflicts): Define.
6103 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6105 Use expected_sr_conflicts in place of expected_conflicts.
6106 Warn if expected_rr_conflicts used in non-GLR parser.
6108 * doc/bison.texinfo: Add documentation for %expect-rr.
6110 2004-03-08 Paul Eggert <eggert@gnu.org>
6112 Add support for hex token numbers. Suggested by Odd Arild Olsen in
6113 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
6115 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6117 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6118 * src/scan-gram.l (scan_integer): New function.
6120 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6121 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6122 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6123 Say "long int", not "long", for uniformity with GNU style.
6125 2004-02-25 Paul Eggert <eggert@twinsun.com>
6127 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6128 compilers. This fixes a problem with Intel's C++ compiler being
6129 chatty, reported by Guido Trentalancia in
6130 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
6132 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6134 Support %destructor and merge error locations in lalr1.cc.
6136 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6137 (Parser::stos_): Define unconditionally.
6138 (Parser::destruct_): New method. Generate its body with
6139 b4_yydestruct_generate.
6140 (Parser::error_start_): New attribute.
6141 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6142 token which are discarded.
6143 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6144 error_start_ when erroneous token are discarded.
6145 (Parser::parse) <yyerrlab1>: Compute the location of the error
6146 token so that it covers all the discarded tokens.
6147 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6148 it can be called with `%skeleton "lalr1.cc"', and do that.
6150 2004-02-02 Paul Eggert <eggert@twinsun.com>
6152 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6153 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6154 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6155 There's no need to mention top_builddir since Automake does that
6157 (INCLUDES): Remove, as Automake says it's obsolescent.
6158 Contents migrated into AM_CPPFLAGS as described above.
6159 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6161 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6163 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6164 (yyreportSyntaxError): Handle case where lookahead token is
6167 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6169 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6170 resulting parsers are compilable with C++.
6172 2003-12-23 Paul Eggert <eggert@twinsun.com>
6174 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6175 * src/output.c (output_skeleton): Rename local var.
6176 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6177 Bison tokens, as this runs afoul of the 2003-10-07 change that
6178 disallowed NUL bytes in character constants or string literals.
6180 * tests/local.at: Require Autoconf 2.59's Autotest.
6181 * tests/testsuite.at: Don't include local.at, since we now assume
6182 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6184 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6185 multiple inclusion warnings.
6187 2003-12-02 Akim Demaille <akim@epita.fr>
6189 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6193 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6195 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6197 2003-10-07 Paul Eggert <eggert@twinsun.com>
6199 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6200 if testsuite doesn't exist.
6202 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6203 literals, unfortunately.
6204 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6205 Complain about NUL bytes in character constants or string literals.
6207 2003-10-05 Paul Eggert <eggert@twinsun.com>
6209 * NEWS: Don't document %no-default-prec, as it's still
6211 * doc/bison.texinfo: Document %no-default-prec only if
6212 the defaultprec flag is set. Normally it's not.
6214 2003-10-04 Paul Eggert <eggert@twinsun.com>
6216 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6217 non-modifiable lvalue, instead of a modifiable one.
6218 * doc/bison.texinfo (Actions): Document that $$ can
6219 be assigned to. Do not claim that $$ and $N are
6220 array element references: user code should not rely on this.
6222 2003-10-01 Paul Eggert <eggert@twinsun.com>
6224 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6225 (grammar_declaration): Use it.
6226 * src/scan-gram.l: New token %no-default-prec.
6227 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6228 * NEWS, doc/bison.texinfo: Document the above.
6230 2003-10-01 Akim Demaille <akim@epita.fr>
6232 VCG no longer supports long_straight_phase.
6234 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6235 * src/print_graph.c (print_graph): Adjust.
6237 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
6238 and Paul Eggert <eggert@twinsun.com>
6240 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6241 Table of Symbols): Document %default-prec.
6242 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6243 (grammar_declaration): Set default_prec on %default-prec.
6244 * src/scan-gram.l (%default-prec): New token.
6245 * src/reader.h (default_prec): New flag.
6246 * src/reader.c: Likewise.
6247 (packgram): Handle it.
6248 * tests/conflicts.at (%default-prec without %prec,
6249 %default-prec with %prec, %default-prec 1): New tests.
6251 2003-09-30 Paul Eggert <eggert@twinsun.com>
6253 * tests/testsuite.at: Include local.at, not input.at, fixing
6254 a typo in the 2003-08-25 patch.
6256 2003-08-27 Akim Demaille <akim@epita.fr>
6258 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6261 2003-08-26 Akim Demaille <akim@epita.fr>
6263 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6264 "<\#" to avoid magic from Gnus when posting parts of this script.
6266 2003-08-26 Akim Demaille <akim@epita.fr>
6268 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6269 (Parser::parse): here.
6270 Adjust: nerrs and errstatus is now replaced by...
6271 (Parser::nerrs_, Parser::errstatus_): New.
6273 2003-08-25 Akim Demaille <akim@epita.fr>
6275 * config/announce-gen, Makefile.cfg: New.
6276 * Makefile.am: Adjust.
6277 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6278 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6280 2003-08-25 Akim Demaille <akim@epita.fr>
6282 When reducing initial empty rules, Bison parser read an initial
6283 location that is not defined. This results in garbage, and that
6284 affects Bison's own parser. Therefore we need (i) to extend Bison
6285 to support a means to initialize this location, and (ii) to use
6286 this CVS Bison to fix CVS Bison's parser.
6288 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6290 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6291 * src/parse-gram.y: Adjust.
6292 (%initial-action): New.
6293 (%error-verbose): Since we require CVS Bison, there is no reason
6295 * src/scan-gram.l: Adjust.
6296 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6297 * data/yacc.c (yyparse): Use b4_initial_action.
6299 2003-08-25 Akim Demaille <akim@epita.fr>
6301 * doc/bison.texinfo: Don't promote stdout for error messages.
6303 2003-08-25 Akim Demaille <akim@epita.fr>
6305 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6306 From Alexandre Duret-Lutz.
6308 2003-08-25 Akim Demaille <akim@epita.fr>
6312 2003-08-25 Akim Demaille <akim@epita.fr>
6314 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6317 2003-08-25 Akim Demaille <akim@epita.fr>
6319 * data/lalr1.cc (Parser::reduce_print_): New.
6322 2003-08-25 Akim Demaille <akim@epita.fr>
6324 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6325 error recovery loops. This patch is based on
6326 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
6327 Also, augment the similarity between lalr1.cc and yacc.c.
6328 Note: the locations of error recovery rules are not correct yet.
6330 * data/lalr1.cc: Comment changes to augment the similarity between
6331 lalr1.cc and yacc.c.
6332 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6333 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6334 yyerrlab), when hitting EOF, pop the whole stack here instead of
6335 merely falling thru the default error handling mechanism.
6336 (yyerrorlab): New label, with the old contents of YYERROR,
6337 plus the following change: pop the stack of rhs corresponding
6338 to the production that invoked YYERROR. That is how Yacc
6339 behaves (required by POSIX).
6340 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6343 2003-08-25 Akim Demaille <akim@epita.fr>
6345 Tune local.at so that people can "autom4te -l autotest calc.at -o
6346 calc" for instance, to extract a sub test suite.
6348 * tests/testsuite.at: Move the initialization, Autotest version
6349 requirement, and AT_TESTED invocation into...
6350 * tests/local.at: here.
6351 * tests/testsuite.at: Include it for compatibility with Autoconf
6353 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6356 2003-08-04 Paul Eggert <eggert@twinsun.com>
6358 Rework code slightly to avoid gcc -Wtraditional warnings.
6359 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6360 The returned value is now stored in *YY0. All callers changed.
6361 * src/output.c (merge_output): Adjust to the above change.
6363 2003-07-26 Paul Eggert <eggert@twinsun.com>
6365 * data/glr.c (YYASSERT): New macro.
6366 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6367 yyresolveStates, yyprocessOneStack):
6368 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6369 Derived from a suggestion by Frank Heckenbach.
6371 2003-07-25 Paul Eggert <eggert@twinsun.com>
6373 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6374 for portability to K&R C (after ansi2knr, presumably). See
6375 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
6376 by Frank Heckenbach, though I have omitted the structure-initialization
6377 part of his glr-knr.diff patch since I recall that the Portable
6378 C Compiler didn't require that change.
6380 Let the user specify how to allocate and free memory.
6381 Derived from a suggestion by Frank Heckenbach in
6382 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
6383 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6384 All uses of free, malloc, realloc changed to use these macros,
6385 and unnecessary casts removed.
6386 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6388 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6390 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6391 use s.empty() rather than s == "" to test for empty string; see
6392 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
6395 2003-06-25 Akim Demaille <akim@epita.fr>
6397 * config/depcomp, config/install-sh: Update from masters.
6399 2003-06-20 Paul Eggert <eggert@twinsun.com>
6401 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6402 and return properly parenthesized result.
6403 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6404 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6405 Remove unnecessary parentheses from uses.
6406 * doc/bison.texinfo (Location Default Action): Describe the
6407 conventions for parentheses.
6409 2003-06-19 Paul Eggert <eggert@twinsun.com>
6411 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6412 yyreportTree): Do not assume that size_t is the same width as int,
6413 when printing sizes. Print sizes using an unsigned format.
6414 Problem reported by Frank Heckenbach in
6415 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
6417 Port to Forte Developer 7 C compiler.
6418 * data/glr.c (struct YYLTYPE): If locations are not being used,
6419 declare a single dummy member, as empty structs do not conform
6421 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6422 the Forte Developer 7 C compiler complains that end-of-loop
6423 code is not reached.
6425 2003-06-17 Paul Eggert <eggert@twinsun.com>
6427 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6428 avoid warnings from picky compilers about redefinition of PARAMS.
6430 2003-06-17 Paul Eggert <eggert@twinsun.com>
6434 * NEWS: Document 1.875b.
6436 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6437 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6438 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6439 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6440 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6441 per recent gettext manual's suggestion.
6442 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6443 Use prototypes, not old-style definitions.
6444 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6445 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6446 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6447 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6448 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6449 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6450 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6451 vbitset_or_and_cmp, vbitset_copy): Likewise.
6453 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6454 Do not include <stdlib.h>.
6455 (PARAMS): Define unconditionally for C89.
6456 (ATTRIBUTE_NORETURN): Remove.
6457 (ATTRIBUTE_UNUSED): Define unconditionally.
6459 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
6460 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
6461 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6462 * lib/vbitset.c, lib/vbitset.h: New files.
6463 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6464 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6467 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6468 `How Can I Reset @code{yyparse}', since texinfo does not allow
6469 arbitrary @ in node names.
6471 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6472 shouldn't be needed according to the gettext 0.12.1 documentation
6473 but which seem to be needed anyway: codeset.m4 glibc21.m4
6474 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
6475 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
6476 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
6478 * lib/.cvsignore: Add stdbool.h.
6479 * m4/.cvsignore: Add nls.m4, po.m4.
6481 Upgrade to CVS gnulib.
6482 * stdbool_.h: File renamed from stdbool.h.in.
6483 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6485 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6486 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6487 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6488 (MOSTLYCLEANFILES): New var.
6489 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6490 (stdbool.h): New rule.
6491 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6492 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6493 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6494 m4/quote.m4: Upgrade to today's gnulib.
6496 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6497 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6498 the tests right now.
6499 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6500 yyerror are declared before use; C99 requires this.
6502 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6504 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6506 (yyrecoverSyntaxError): Correct the logic for setting and testing
6508 Correct comment on handling EOF.
6509 Allow states with only a default reduction, rather than failing
6510 (I can't quite reconstruct why these were not allowed before).
6512 Fixes to avoid problem that $-N rules in GLR parsers can cause
6513 buffer overruns, corrupting state.
6515 * src/output.c (prepare_rules): Output max_left_semantic_context
6517 * src/reader.h (max_left_semantic_context): New variable declaration.
6518 * src/scan-gram.l (max_left_semantic_context): Define.
6519 (handle_action_dollar): Update max_left_semantic_context.
6520 * data/glr.c (YYMAXLEFT): New definition.
6521 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6522 (yyresolveAction): Ditto.
6524 Fixes to problems with location handling in GLR parsers reported by
6525 Frank Heckenbach (2003/06/05).
6527 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6528 (YYRHSLOC): Add parentheses, and define only if locations used.
6529 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6531 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6532 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
6534 * tests/cxx-type.at: Exercise location information; update tests
6535 to differentiate output with and without locations.
6536 Remove forward declarations of yylex and yyerror---caused errors
6537 because default YYLTYPE not yet defined.
6538 Change semantic actions to compute strings, rather than printing
6539 them directly (to test proper passing of semantics values). Change
6540 output to prefix notation and update test data and expected results.
6541 (yylex): Track locations.
6542 (stmtMerge): Return value rather than printing, and include arguments
6545 2003-06-03 Paul Eggert <eggert@twinsun.com>
6547 Avoid warnings generated by GCC 2.95.4 when Bison is
6548 configured with --enable-gcc-warnings.
6549 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6550 yy::]b4_parser_class_name[::translate_,
6551 yy::Stack::operator[] (unsigned),
6552 yy::Stack::operator[] (unsigned) const,
6553 yy::Slice::operator[] (unsigned),
6554 yy::Slice::operator[] (unsigned) const):
6555 Rename local vars to avoid warnings.
6556 * tests/glr-regression.at (Improper handling of embedded actions
6557 and $-N in GLR parsers): Remove unused local variable from yylex.
6558 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6559 (void) as arg when not pure, since we now assume C89 when building
6560 Bison. Pacify GCC by using parameter.
6562 2003-06-02 Paul Eggert <eggert@twinsun.com>
6564 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
6565 yy::Location::lines, yy::Location::columns): Rename arguments
6566 to avoid shadowing; this removes a warning generated by GCC 3.3.
6568 2003-06-01 Paul Eggert <eggert@twinsun.com>
6570 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
6571 to g++, as GCC 3.3 complains if you do it.
6572 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
6573 everything that WARNING_CFLAGS has, except omit warnings
6574 not suitable for C++.
6575 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
6576 * tests/atlocal.in (CXXFLAGS): New var.
6577 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
6579 Fix a GLR parser bug I reported in February; see
6580 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
6581 The problem was that GLR parsers did not conform to the C standard,
6582 because actions like { $1 = $2 + $3; } expanded to expressions
6583 that invoked YYFILL in separate subexpressions, and YYFILL assigned
6584 to a local variable. The C standard says that expressions
6585 like (var = f ()) + (var = f ()) have undefined behavior.
6586 Another problem was that GCC sometimes issues warnings that
6587 yyfill and its parameters are unused.
6589 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6591 (yyfill): New function.
6593 (yyuserAction): Change type of yynormal to bool, so that it matches
6594 the new yyfill signature. Mark it as possibly unused.
6597 Follow up on a bug I reported in February, where a Bison-generated
6598 parser can loop. Provide a test case and a fix for yacc.c. I
6599 don't have a fix for lalr1.cc or for glr.c, unfortunately.
6600 The original bug report is in:
6601 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
6603 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
6604 macro's size was becoming unwieldy.
6605 (yyerrlab): Do not discard an empty lookahead symbol, as this
6606 might destroy garbage.
6607 (yyerrorlab): New label, with the old contents of YYERROR,
6608 plus the following change: pop the stack of rhs corresponding
6609 to the production that invoked YYERROR. That is how Yacc
6610 behaves, and POSIX requires this behavior.
6611 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
6612 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
6613 Define 'alarm' to do nothing if unistd.h is not available.
6614 Add a new rule "exp: '-' error;" to test the above change to
6615 data/yacc.c. Use 'alarm' to abort any test taking longer than
6616 10 seconds, as it's probably looping.
6617 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
6618 Also, the new yacc.c generates two fewer diagnostics for an
6621 2003-05-24 Paul Eggert <eggert@twinsun.com>
6623 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
6624 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
6625 This fixes a problem reported by John Bowman when the Compaq/HP
6626 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
6628 * data/yacc.c (union yyalloc): Likewise.
6629 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
6631 Switch from 'int' to 'bool' where that makes sense.
6633 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
6634 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
6635 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
6636 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
6637 Return or accept bool, not int. All callers changed.
6638 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
6639 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
6640 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
6641 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
6642 bitset_or_and_cmp_): Likewise.
6643 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
6644 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
6645 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
6646 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
6647 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
6648 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
6649 bitset_stats_or_and_cmp): Likewise.
6650 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
6651 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
6652 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
6653 ebitset_xor_cmp): Likewise.
6654 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
6655 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
6656 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
6657 lbitset_xor_cmp): Likewise.
6658 * lib/bbitset.h: Include <stdbool.h>.
6659 (struct bitset_vtable): The following members now return bool, not
6660 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
6661 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
6663 * src/conflicts.c (count_rr_conflicts): Likewise.
6664 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6666 * lib/ebitset.c (ebitset_obstack_init): Likewise.
6667 * lib/lbitset.c (lbitset_obstack_init): Likewise.
6668 * src/getargs.c (debug_flag, defines_flag, locations_flag,
6669 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6670 graph_flag): Likewise.
6671 * src/getargs.h (debug_flag, defines_flag, locations_flag,
6672 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6673 graph_flag): Likewise.
6674 * src/output.c (error_verbose): Likewise.
6675 * src/output.h (error_verbose): Likewise.
6676 * src/reader.c (start_flag, typed): Likewise.
6677 * src/reader.h (typed): Likewise.
6678 * src/getargs.c (LOCATIONS_OPTION): New constant.
6679 (long_options, getargs): Use it.
6680 * src/lalr.c (build_relations): Use bool, not int.
6681 * src/nullable.c (nullable_compute): Likewise.
6682 * src/print.c (print_reductions): Likewise.
6683 * src/tables.c (action_row, pack_vector): Likewise.
6684 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6685 * src/output.c (prepare): Use it.
6686 * src/output.c (token_definitions_output,
6687 symbol_destructors_output, symbol_destructors_output): Use string,
6688 not boolean integer, to keep track of whether to output separator.
6689 * src/print_graph.c (print_core): Likewise.
6690 * src/state.c (state_rule_lookaheads_print): Likewise.
6692 * config/install-sh: Sync from automake 1.7.5.
6694 2003-05-14 Paul Eggert <eggert@twinsun.com>
6696 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6697 semicolon after a grammar declaration, in the interest of possible
6698 future changes to the Bison input language.
6699 Do not allow a stray semicolon at the start of the grammar.
6700 (rhses.1): Allow one or more semicolons after any rule, including
6701 just before "|" as required by POSIX.
6702 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6705 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6707 %parse-param support for lalr1.cc.
6709 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6710 b4_cc_constructor_calls, b4_cc_constructor_call,
6711 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6713 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6714 parse-param arguments.
6715 (yy::b4_parser_class_name): Declare instance variables to
6716 hold parse-param arguments.
6717 * tests/calc.at: s/value/semantic_value/ because value clashes
6718 with a member of yy::b4_parser_class_name. Adjust C++ code
6719 to handle %parse-param. Enable %parse-param test in C++.
6721 2003-05-12 Paul Eggert <eggert@twinsun.com>
6723 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6724 English a bit. Fix fclose typo. Change "const char" to "char
6725 const", and use ANSI C rather than K&R for "main". Suggest
6726 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6727 and suggest yy_switch_to_buffer.
6729 2003-05-05 Paul Eggert <eggert@twinsun.com>
6731 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6732 C89. This avoids a diagnostic on compilers that define __STDC__
6733 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
6734 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
6736 2003-05-03 Paul Eggert <eggert@twinsun.com>
6738 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6739 Do not overrun array bounds.
6740 This should fix a bug reported today by Olatunji Oluwabukunmi in
6741 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
6743 2003-04-29 Akim Demaille <akim@epita.fr>
6745 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6746 * src/getargs.c, src/getargs.h: here, as bool, not int.
6747 (nondeterministic_parser): New.
6748 * src/parse-gram.y, src/scan-gram.l: Support
6749 %nondeterministic-parser.
6750 * src/output.c (prepare): Use nondeterministic_parser instead
6751 of glr_parser where appropriate.
6752 * src/tables.c (conflict_row, action_row, save_row)
6753 (token_actions, token_actions, pack_vector): Ditto.
6755 2003-04-29 Akim Demaille <akim@epita.fr>
6757 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6759 2003-04-29 Akim Demaille <akim@epita.fr>
6761 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6762 with %pure-parser and %locations to exercise the patch from Yakov
6765 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6767 * data/yacc.c: (b4_lex_param): Corrected for the case where
6768 %lex-param is provided and %pure-parser isn't.
6770 2003-04-27 Paul Eggert <eggert@twinsun.com>
6772 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
6773 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
6774 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6775 if it is not defined.
6776 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6778 2003-04-26 Paul Eggert <eggert@twinsun.com>
6780 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6781 Declare to be of type suitable for the ninf value itself, not of
6782 type suitable for the corresponding table, since the latter might
6783 be unsigned but the ninf value might be negative. This fixes a
6784 bug reported by Alexandre Duret-Lutz in
6785 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
6787 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6788 invokes it. We shouldn't invoke it twice because it will attempt
6789 to put error.o in the archive twice. This fixes a glitch reported
6790 by Martin Mokrejs in
6791 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
6793 2003-04-21 Paul Eggert <eggert@twinsun.com>
6795 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6798 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6800 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6801 Fix obvious typo that results in uncompilable GLR parsers
6802 when both %pure-parser and %locations are used. (trivial change)
6804 2003-04-17 Paul Eggert <eggert@twinsun.com>
6806 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6807 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6808 Do not insert the expected token via unput, as this runs afoul
6809 of a POSIX-compatibility bug in flex 2.5.31.
6810 All uses changed to BEGIN the parent state,
6811 since we no longer insert the expected token via unput.
6812 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6813 that is no longer emitted after the above change.
6815 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6816 the first one. This change is from Paul Hilfinger, and it fixes
6817 regression reported by Werner Lemberg in
6818 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
6820 (resolve_sr_conflict): Don't invoke state_errs_set
6821 unless one or more tokens have been explicitly made errors.
6822 Otherwise, the above change causes Bison to abort.
6824 * tests/existing.at (GNU pic Grammar): New test case, taken from
6827 2003-03-31 Akim Demaille <akim@epita.fr>
6829 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6831 2003-03-31 Akim Demaille <akim@epita.fr>
6833 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6836 2003-03-31 Akim Demaille <akim@epita.fr>
6838 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6839 From Paul Hilfinger.
6841 2003-03-29 Akim Demaille <akim@epita.fr>
6843 * m4/error.m4: Do not put under dynamic conditions some code which
6844 expansion is under static control.
6846 2003-03-29 Akim Demaille <akim@epita.fr>
6848 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6850 2003-03-29 Akim Demaille <akim@epita.fr>
6852 * doc/bison.texinfo (Strings are Destroyed): New.
6854 2003-03-13 Paul Eggert <eggert@twinsun.com>
6856 * .cvsignore: Add configure.lineno.
6857 * src/.cvsignore: Add yacc.
6858 * tests/.cvsignore: Add testsuite.log.
6859 * doc/fdl.texi: Sync with latest FSF version.
6861 2003-03-12 Paul Eggert <eggert@twinsun.com>
6863 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
6864 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
6865 cursor, instead of leaving it undefined. This fixes a bug
6866 reported by Tim Van Holder in
6867 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
6868 * tests/input.at (Torturing the Scanner): Test the scanner on
6869 an empty input file, which was Tim Van Holder's test case.
6871 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
6872 <sys/resource.h> can be included, include sys/time.h and
6873 sys/times.h first, if available. This works around the SunOS
6874 4.1.4 porting bug reported by Bruce Becker in
6875 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
6877 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6878 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6881 Merge changes from gnulib. This was prompted because the CVS
6882 snapshot didn't build on Solaris 7 due to strnlen problems.
6884 These changes need to be merged back into gnulib:
6885 * lib/hash.c: Include <stdbool.h> unconditionally.
6886 * m4/onceonly.m4 (m4_quote): New macro.
6887 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
6888 Quote AC_FOREACH variable-expansions properly.
6889 The 2003-01-03 obstack.h change also needs merging.
6890 {end of changes requiring merging}
6892 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6893 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
6894 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
6895 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
6896 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
6897 New files, imported from gnulib.
6898 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
6901 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
6902 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
6905 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6907 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
6908 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
6909 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
6910 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
6911 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
6912 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
6913 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
6914 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
6915 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
6916 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
6917 (jm_PREREQ_ARGMATCH): Remove.
6918 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
6919 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
6921 * src/system.h: Include <stdbool.h> unconditionally.
6923 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6924 assuming at least C89 in the bitset code for some time now.
6926 2003-03-03 Akim Demaille <akim@epita.fr>
6930 2003-03-02 Akim Demaille <akim@epita.fr>
6932 * doc/bison.texinfo (Table of Symbols): Reactivate the
6933 documentation for %lex-param, and %parse-param.
6935 2003-03-02 Akim Demaille <akim@epita.fr>
6937 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6938 generate verbose error messages.
6939 Use the number of tokens as an upper bound in yytname, as it
6940 cannot be a non terminal.
6942 2003-03-02 Akim Demaille <akim@epita.fr>
6944 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6947 2003-03-02 Akim Demaille <akim@epita.fr>
6949 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6950 Use them to exercise yycheck overrun.
6951 Based on Andrew Suffield's grammar.
6953 2003-03-02 Akim Demaille <akim@epita.fr>
6955 Create tests/local.at for Bison generic testing macros.
6957 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6958 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6960 * tests/calc.at (AT_CHECK_CALC): Adjust.
6961 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6962 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6963 * tests/local.at: here.
6964 (AT_COMPILE_CXX): Tags the tests using it as c++.
6965 Ignore the test if CXX is not functional.
6967 2003-03-01 Paul Eggert <eggert@twinsun.com>
6969 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
6970 not loc->end, since loc->end might contain garbage and this leads
6971 to undefined behavior on some platforms.
6972 (id_loc, token_start): Use (IF_LINTed) initial values that do not
6973 depend on *loc, so that the reader doesn't give the the false
6974 impression that *loc is initialized.
6975 (<INITIAL>"%%"): Do not bother setting code_start, since its value
6976 does not survive the return.
6978 2003-03-01 Akim Demaille <akim@epita.fr>
6980 * src/scan-gram.l (code_start): Always initialize it when entering
6981 into yylex, as SC_EPILOGUE is activated *before* the corresponding
6982 yylex invocation. An alternative would be making it static, but
6983 then it starts with the second %%'s beginning, instead of its end.
6985 2003-02-28 Paul Eggert <eggert@twinsun.com>
6987 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
6988 around a UnixWare 7.1.1 porting bug reported by John Hughes in
6989 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
6991 2003-02-26 Paul Eggert <eggert@twinsun.com>
6993 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
6994 Remove Sequent/Pyramid discussion (nobody uses them any more).
6995 Merge VMS and MS-DOS discussion; these ports may well be dead
6996 but let's keep mentioning them for now. Put <> around email
6997 addresses. Add copyright notice.
6999 2003-02-24 Paul Eggert <eggert@twinsun.com>
7001 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7002 to avoid collision with flex use of yylineno.
7003 Problem reported by Bruce Lilly in
7004 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
7005 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7006 * data/yacc.c (yy_reduce_print): Likewise.
7008 * config/depcomp: Sync with Automake 1.7.3.
7010 2003-02-21 Akim Demaille <akim@epita.fr>
7012 * data/lalr1.cc: Use temporary variables instead of casts to
7013 change integer types.
7014 Suggested by Paul Eggert.
7016 2003-02-21 Akim Demaille <akim@epita.fr>
7018 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7019 to avoid confusions with lalr1.cc's notion of Position.
7020 Suggested by Paul Eggert.
7022 2003-02-20 Akim Demaille <akim@epita.fr>
7024 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7025 before initial_columns.
7026 (location.hh): Use consistent variable names when defining the
7028 Use "last" so that we subtract from Positions, not from unsigned.
7030 2003-02-20 Akim Demaille <akim@epita.fr>
7032 * data/lalr1.cc (position.hh): New subfile, including the extended
7033 and Doxygen'ed documentation of class Position.
7034 (location.hh): Use it.
7035 Document a` la Doxygen.
7036 With the help of Benoit Perrot.
7038 2003-02-20 Akim Demaille <akim@epita.fr>
7040 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7042 Redefine AT_YYERROR_SEES_LOC_IF using it.
7043 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7045 Don't use the location in yy::Parser::error_ and
7046 yy::Parser::print_ when not %locations.
7047 Activate more lalr1.cc tests.
7049 2003-02-19 Akim Demaille <akim@epita.fr>
7051 * data/lalr1.cc: When displaying a line number, be sure to make it
7054 2003-02-19 Akim Demaille <akim@epita.fr>
7056 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7058 (YYABORT, YYACCEPT, YYERROR): New.
7059 * tests/calc.at: Renable the lalr1.cc test.
7061 2003-02-19 Akim Demaille <akim@epita.fr>
7063 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7064 error recovery, mixing with/without pops and discarding of the
7067 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7069 2003-02-17 Paul Eggert <eggert@twinsun.com>
7071 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7072 * tests/testsuite.at (AT_COMPILE): Use them.
7073 This fixes the testsuite problem reported by Robert Lentz in
7074 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
7076 2003-02-12 Paul Eggert <eggert@twinsun.com>
7078 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7079 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
7080 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
7081 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7082 Check for malloc failure, for consistency with yacc.c.
7083 (yytname_size): Remove, for consistency with yacc.c.
7085 The bug still remains in data/lalr1.cc, as I didn't have time
7088 2003-02-06 Akim Demaille <akim@epita.fr>
7090 * configure.ac (GXX): Rename as...
7091 (CXX): this, to keep the original Autoconf semantics.
7093 * data/lalr1.cc: Fix b4_copyright invocations.
7094 If YYDEBUG is not defined, don't depend upon name_ being defined.
7095 (location.hh): Include string and iostream.
7096 (Position::filename): New member.
7097 (Position::Position ()): New.
7098 (operator<< (Position)): New.
7099 (operator- (Position, int)): New.
7100 (Location::first, Location::last): Rename as...
7101 (Location::begin, Location::end): these, to mock the conventional
7103 (operator<< (Location)): New.
7104 * tests/atlocal.in (CXX): New.
7105 * tests/testsuite.at (AT_COMPILE_CXX): New.
7106 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7107 locations in a more synthetic way.
7108 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7110 Adjust the C locations to match those from Emacs: first column is
7112 Change all the expected results.
7113 Conform to the GCS: simplify the locations when applicable.
7114 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7115 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7116 these CPP macros with the m4 macros new defined by...
7117 (AT_CHECK_PUSHDEFS): this, i.e.:
7118 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
7119 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7121 (AT_CHECK_POPDEFS): Undefine them.
7122 (AT_CHECK_CALC_LALR1_CC): New.
7123 Use it for the first lalr1.cc test.
7125 2003-02-04 Akim Demaille <akim@epita.fr>
7127 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7128 Location as is defined.
7130 2003-02-04 Akim Demaille <akim@epita.fr>
7132 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7133 name_ being defined.
7135 2003-02-03 Paul Eggert <eggert@twinsun.com>
7137 * src/gram.h (start_symbol): Remove unused decl.
7139 Use more-consistent naming conventions for local vars.
7141 * src/derives.c (derives_compute): Change type of local var from
7143 * src/gram.c (grammar_rules_partial_print): Likewise.
7144 * src/print.c (print_core): Likewise.
7145 * src/reduce.c (reduce_grammar_tables): Likewise.
7147 * src/gram.c (grammar_dump): Change name of item_number *
7148 local var from r to rp.
7149 * src/nullable.c (nullable_compute): Likewise.
7151 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7153 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7154 for symbol or symbol_number var.
7155 * src/reader.c (grammar_start_symbol_set): Likewise.
7156 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7158 * src/state.c (transitions_to): Likewise.
7159 * src/state.h: Likewise.
7160 * src/tables.c (symbol_number_to_vector_number): Likewise.
7162 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7165 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7168 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7171 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7172 Use str, not s, for char * var. Use ch, not c, for character var.
7173 Use size for size var.
7175 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7177 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7179 * src/uniqstr.h: Likewise.
7181 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7182 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7183 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7184 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7185 param to have same name as that of enum, so that we don't use
7186 "s" to stand for a non-state.
7188 2003-02-02 Akim Demaille <akim@epita.fr>
7190 * src/scan-skel.l: Scan more than one inert character per yylex
7193 2003-02-01 Paul Eggert <eggert@twinsun.com>
7197 * po/LINGUAS: Add ms.
7199 2003-01-30 Akim Demaille <akim@epita.fr>
7201 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7203 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7205 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7208 Changes in response to error report by S. Eken: GLR mode does not
7209 handle negative $ indices or $ indices in embedded rules correctly.
7210 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
7212 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7213 (b4_rhs_location): Ditto.
7214 (yyfill): New function to copy from stack tree into array
7216 (yyuserAction): Modify to allow incremental move of semantic values
7217 to rhs array when in GLR mode.
7218 Define YYFILL to use in user-defined actions to fill semantic array
7220 Remove dummy use of yystack, as there is now a guaranteed use.
7221 (yydoAction): Modify to allow incremental move of semantic values
7222 to rhs array when in GLR mode.
7223 (yyresolveAction): Ditto.
7224 (yyglrShiftDefer): Update comment.
7225 (yyresolveStates): Use X == NULL for pointers, not !X.
7226 (yyglrReduce): Ditto.
7229 * tests/glr-regr1.at: Rename to ...
7230 * tests/glr-regression.at: Add new regression test for the problems
7231 described above (adapted from S. Eken).
7232 Update copyright notice.
7233 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7234 * tests/Makefile.am: Ditto.
7236 2003-01-28 Paul Eggert <eggert@twinsun.com>
7238 * data/lalr1.cc: Do not use @output_header_name@ unless
7239 b4_defines_flag is set. This fixes two bugs reported by
7241 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7242 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
7244 2003-01-21 Paul Eggert <eggert@twinsun.com>
7246 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7247 we don't need to worry about yyerrlab1 being reported as an
7248 "unused label" by non-GCC C compilers. The downside is that if
7249 locations are used then a couple of statements are duplicated each
7250 time YYERROR is invoked, but the upside is that the warnings
7252 (yyerrlab1): Move code to YERROR.
7253 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7254 This reverts some of the 2002-12-27 change.
7256 2003-01-17 Paul Eggert <eggert@twinsun.com>
7258 * src/output.c (symbol_printers_output): Fix typo that led
7259 to core dump. Problem reported by Antonio Rus in
7260 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
7262 2003-01-13 Akim Demaille <akim@epita.fr>,
7263 Quoc Peyrot <chojin@lrde.epita.fr>,
7264 Robert Anisko <anisko_r@lrde.epita.fr>
7266 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7267 when the stacks contain one element, as the loop would otherwise
7268 free the last state, and then use the top state (the one we just
7269 popped). This means that the initial elements will not be freed
7270 explicitly, as is the case in yacc.c; it is not a problem, as
7271 these elements have fake values.
7273 2003-01-11 Paul Eggert <eggert@twinsun.com>
7275 * NEWS: %expect-violations are now just warnings, reverting
7276 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7277 bootstrapping problem reported by Matthias Klose; see
7278 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
7279 * src/conflicts.c (conflicts_print): Likewise.
7280 * tests/conflicts.at (%expect not enough, %expect too much,
7281 %expect with reduce conflicts): Likewise.
7282 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7283 that the warning is enabled if the number of conflicts changes
7284 (not necessarily increases).
7286 * src/getargs.c (version): Update copyright year.
7288 2003-01-09 Akim Demaille <akim@epita.fr>
7290 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7292 2003-01-08 Paul Eggert <eggert@twinsun.com>
7294 * Makefile.maint (WGETFLAGS):
7295 New macro, containing "-C off" to disable proxy caches.
7296 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7297 (rel-check): Use $(WGET) instead of wget.
7299 2003-01-06 Paul Eggert <eggert@twinsun.com>
7301 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7302 the GLR paper of Scott, Johnstone and Hussain.
7304 2003-01-04 Paul Eggert <eggert@twinsun.com>
7306 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7307 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7308 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7309 (EXTRA_LIBRARIES): New var, for liby.a.
7310 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7311 (EXTRA_SCRIPTS): New var, for yacc.
7313 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7314 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7315 Problem reported by Nelson H. F. Beebe.
7317 2003-01-03 Paul Eggert <eggert@twinsun.com>
7319 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7320 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7321 when compiling Bison 1.875's `bitset bset = obstack_alloc
7322 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7324 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7325 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7326 grow to a huge size with typical invocation.
7328 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7329 Use the pattern recommended by Autoconf 2.57, except also protect
7330 against double-definition.
7331 * src/system.h: Likewise.
7332 Portability issues reported by Nelson H. F. Beebe.
7334 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7335 All uses changed. Provide a definition in both C and C++.
7336 (yytrue, yyfalse): Define even if defined (__cplusplus).
7338 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7339 Reported by Nelson H. F. Beebe.
7341 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7343 2003-01-02 Paul Eggert <eggert@twinsun.com>
7345 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7346 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7347 Bug reported by Nelson H. F. Beebe.
7349 2003-01-01 Paul Eggert <eggert@twinsun.com>
7353 2002-12-30 Paul Eggert <eggert@twinsun.com>
7355 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7357 (<INITIAL>","): Here. This causes stray "," to be treated
7360 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
7361 last brace in braced code when not in Yacc mode, for compatibility
7362 with Bison 1.35. This resurrects the 2001-12-15 patch to
7365 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7366 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7368 2002-12-28 Paul Eggert <eggert@twinsun.com>
7370 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7371 that of SYM's type. This fixes Debian bug 168069, reported by
7374 2002-12-28 Paul Eggert <eggert@twinsun.com>
7378 Switch back to the Yacc style of conflict reports, undoing some
7379 of the 2002-07-30 change.
7380 * doc/bison.texinfo (Understanding): Use Yacc style for
7381 conflict reports. Also, use new way of locating rules.
7382 * src/conflicts.c (conflict_report):
7383 Renamed from conflict_report_yacc, removing the old
7384 'conflict_report'. Translate the entire conflict report at once,
7385 so that we don't assume that "," has the same interpretation in
7387 (conflicts_output): Use Yacc-style conflict report for each state,
7388 instead of our more-complicated style.
7389 (conflicts_print): Use Yacc-style conflict report, except print
7390 the input file name when not emulating Yacc.
7391 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7392 Conflicted Reduction, %expect not enough, %expect too much,
7393 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7394 * tests/existing.at (GNU Cim Grammar): Likewise.
7395 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7397 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7398 fatal): Don't invoke fflush; it's not needed and it might even be
7399 harmful for stdout, as stdout might not be open.
7400 * src/reduce.c (reduce_print): Likewise.
7402 2002-12-27 Paul Eggert <eggert@twinsun.com>
7404 Fix a bug where error locations were not being recorded correctly.
7405 This problem was originally reported by Paul Hilfinger in
7406 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
7408 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7409 top of the location stack's error locations.
7410 (yyerrlab): Set it. When discarding a token, push its location
7411 onto yylerrsp so that we don't lose track of the error's end.
7412 (yyerrlab1): Now is only the target of YYERROR, so that we can
7413 properly record the location of the action that failed. For GCC
7414 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7415 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7416 (yyerrlab2): New label, which yyerrlab now falls through to.
7417 Compute the error's location by applying YYLLOC_DEFAULT to
7418 the locations of all the symbols that went into the error.
7419 * doc/bison.texinfo (Location Default Action): Mention that
7420 YYLLOC_DEFAULT is also invoked for syntax errors.
7421 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7422 Error locations include the locations of all the tokens that were
7423 discarded, not just the last token.
7425 2002-12-26 Paul Eggert <eggert@twinsun.com>
7427 * src/files.c: Include quote.h.
7428 (compute_output_file_names): Warn if we detect conflicting
7429 outputs to the same file. This should catch the misunderstanding
7430 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7432 * src/conflicts.c (conflicts_print): If the user specifies
7433 "%expect N", report an error if there are any reduce/reduce
7434 conflicts. This is what the manual says should happen.
7435 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7436 * tests/conflicts.at (%expect with reduce conflicts): New test.
7438 Don't use m4_include on relative file names, as it doesn't work as
7439 desired if there happens to be a file with that name under ".".
7441 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7442 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7443 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7444 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7445 * src/output.c (output_skeleton): Use full path names when
7446 specifying a file to include; don't rely on include path, as
7447 it's unreliable when the working file contains a file with
7450 2002-12-25 Paul Eggert <eggert@twinsun.com>
7452 Remove obsolete references to bison.simple and bison.hairy.
7453 Problem mentioned by Aubin Mahe in
7454 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
7455 * data/glr.c: Comment fix.
7456 * doc/bison.1: Remove references. Also, mention "yacc".
7458 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7461 * src/parse-gram.y (declaration): Use enum "report_states" rather
7462 than its numeric value 1.
7464 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7465 opening a new one. This fixes Debian bug 165349, reported by
7468 2002-12-24 Paul Eggert <eggert@twinsun.com>
7472 * Makefile.maint (cvs-update): Don't assume that the shell
7473 supports $(...), as Solaris sh doesn't.
7475 * src/parse-gram.y (lloc_default): Remove test for empty
7476 nonterminals at the end, since it didn't change the result.
7478 2002-12-24 Paul Eggert <eggert@twinsun.com>
7480 If the user does not define YYSTYPE as a macro, Bison now declares it
7481 using typedef instead of defining it as a macro. POSIX requires this.
7482 For consistency, YYLTYPE is also declared instead of defined.
7484 %union directives can now have a tag before the `{', e.g., the
7485 directive `%union foo {...}' now generates the C code
7486 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7487 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7488 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7489 instead of `yyltype'.
7491 `yystype' and `yyltype' are now obsolescent macros instead of being
7492 typedefs or tags; they are no longer documented and will be
7493 withdrawn in a future release.
7495 * data/glr.c (b4_location_type): Remove.
7496 (YYSTYPE): Renamed from yystype.
7497 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7498 (struct YYLTYPE): Renamed from struct yyltype.
7499 (YYLTYPE): Renamed from yyltype.
7500 (yyltype, yystype): New (and obsolescent) macros,
7501 for backward compatibility.
7502 * data/yacc.c: Likewise.
7504 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7505 does not specify a union tag. This is for compatibility with
7508 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7509 const *, since it is now modified by stripping surrounding { }.
7510 (current_braced_code): Remove.
7511 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7512 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7513 trailing " {...}". Now of type <chars>.
7514 (grammar_declaration): Adjust to bundled tokens.
7515 (code_content): Remove; stripping is now done by add_param.
7516 (print_token_value): Print contents of bundled tokens.
7517 (token_name): New function.
7519 * src/reader.h (braced_code, current_braced_code): Remove.
7520 (token_name): New decl.
7522 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7523 token_type, not braced_code code_kind. All uses changed.
7524 (SC_PRE_CODE): New state, for scanning after a keyword that
7525 has (or usually has) an immediately-following braced code.
7526 (token_type): New local var, to keep track of which token type
7527 to return when scanning braced code.
7528 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
7529 <INITIAL>"%parse-param", <INITIAL>"%printer",
7530 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7531 instead of returning a token type immediately.
7532 (<INITIAL>"{"): Set token type.
7533 (<SC_BRACED_CODE>"}"): Use it.
7534 (handle_action_dollar, handle_action_at): Now returns bool
7535 indicating success. Fail if ! current_rule; this prevents a core dump.
7536 (handle_symbol_code_dollar, handle_symbol_code_at):
7537 Remove; merge body into caller.
7538 (handle_dollar, handle_at): Complain in invalid contexts.
7540 * NEWS, doc/bison.texinfo: Document the above.
7541 * NEWS: Fix years and program names in copyright notice.
7543 2002-12-17 Paul Eggert <eggert@twinsun.com>
7545 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7546 Reporting, Table of Symbols): Omit mentions of %lex-param and
7547 %parse-param from the documentation for now.
7549 2002-12-15 Paul Eggert <eggert@twinsun.com>
7551 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7552 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7553 lookahead symbol, and which sets yychar in parser actions) and it
7554 disagreed with the Bison documentation. Bug
7555 reported by Andrew Walrond.
7557 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7558 as the caller now does that.
7559 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7560 (YYEMPTY): Parenthesize right hand side, since others use it.
7561 (yyparse): Don't assume that our generated code is the only code
7564 2002-12-13 Paul Eggert <eggert@twinsun.com>
7568 POSIX requires a "yacc" command.
7569 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7570 (MOSTLYCLEANFILES): Add yacc.
7572 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
7573 as an alias for bison y.
7575 * po/LINGUAS: Add da.
7577 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
7578 problem with latest <getopt.h>.
7579 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
7581 * doc/fdl.texi: Upgrade to 1.2.
7582 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
7583 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
7584 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
7586 * config/install-sh: Sync with autotools.
7588 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
7589 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
7590 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
7591 locations are requested.
7592 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
7593 locations are requested.
7595 2002-12-12 Paul Eggert <eggert@twinsun.com>
7597 Remove unportable casts and storage allocation tricks.
7598 While we're at it, remove almost all casts, since they
7599 usually aren't needed and are a sign of trouble.
7601 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7603 * src/derives.c (derives_compute): Do not subtract NTOKENS from
7604 the pointer DSET returned by malloc; this isn't portable.
7605 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
7606 Similarly for DERIVES.
7607 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
7608 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
7609 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
7611 * src/derives.c (derives_compute): Do not bother invoking
7612 int_of_rule_number, since rule numbers are integers.
7614 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7615 rather than XMALLOC (char, N).
7617 * src/files.c (filename_split): Rewrite to avoid cast.
7619 * src/gram.h (symbol_number_as_item_number,
7620 item_number_as_symbol_number, rule_number_as_item_number,
7621 item_number_as_rule_number):
7622 Now inline functions rather than macros, to avoid casts.
7623 * src/state.h (state_number_as_int): Likewise.
7624 * src/tables.c (state_number_to_vector_number,
7625 symbol_number_to_vector_number): Likewise.
7627 * src/gram.h (int_of_rule_number): Remove; no longer used.
7629 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7630 since the resulting storage is always stored into.
7632 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7635 * src/muscle_tab.c (muscle_m4_output):
7636 Now inline. Return bool, not int.
7637 * src/state.c (state_compare): Likewise.
7638 * src/symtab.c (symbol_check_defined,
7639 symbol_check_alias_consistency, symbol_pack, symbol_translation,
7640 hash_compare_symbol, hash_symbol):
7642 * src/uniqstr.c (uniqstr_print): Likewise.
7643 * src/muscle_tab.c (muscle_m4_output_processor):
7644 New function, to avoid casts.
7645 * src/state.c (state_comparator, stage_hasher): Likewise.
7646 * src/symtab.c (symbol_check_defined_processor,
7647 symbol_check_alias_consistency_processor, symbol_pack_processor,
7648 symbol_translation_processor, hash_symbol_comparator,
7649 hash_symbol_hasher): Likewise.
7650 * src/uniqstr.c (uniqstr_print_processor): Likewise.
7651 * src/muscle_tab.c (muscles_m4_output):
7652 Use new functions instead of casting old functions unportably.
7653 * src/state.c (state_hash_new): Likewise.
7654 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
7655 symbols_token_translations_init):
7657 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7659 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
7660 var instead of casting to long, to avoid casts.
7661 (prepare_states): Use MALLOC rather than alloca, so that we don't
7662 have to worry about alloca.
7663 * src/state.c (state_hash_lookup): Likewise.
7665 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7666 local var instead of casting to unsigned char, to avoid casts.
7668 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
7669 STATE_ALLOC): Remove.
7670 (transitions_new, errs_new, reductions_new, state_new): Use malloc
7671 rather than calloc, and use offsetof to avoid allocating slightly
7673 (state_new): Initialize all members.
7675 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7677 * src/symtab.c (symbol_free): Remove; unused.
7678 (symbol_get): Remove cast in lhs of assignment.
7679 (symbols_do): Now static. Accept generic arguments, not
7680 hashing-related ones.
7682 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7683 (symbol_processor): Remove.
7684 (symbols_do): Remove decl; now static.
7686 * src/system.h (alloca): Remove; decl no longer needed.
7687 (<stddef.h>): Include, for offsetof.
7688 (<inttypes.>, <stdint.h>): Include if available.
7689 (uintptr_t): New type, if system lacks it.
7690 (CALLOC, MALLOC, REALLOC): New macros.
7691 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7694 * src/tables.c (table_size): Now int, to pacify GCC.
7695 (table_grow, table_ninf_remap): Use signed table size.
7696 (save_row): Don't bother initializing locals when not needed.
7697 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7698 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7700 * src/vcg.h: Correct misspellings.
7702 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7705 * src/getargs.c (getargs): Don't assume EOF == -1.
7707 2002-12-09 Paul Eggert <eggert@twinsun.com>
7709 Change identifier spellings to avoid collisions with names
7710 that are reserved by POSIX.
7712 Don't use names ending in _t, since POSIX reserves them.
7713 For consistency, remove _e and _s endings -- they're weren't
7714 needed to remove ambiguity. All uses changed.
7715 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7716 turn was just renamed from struniq_t.
7717 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7718 which in turn was just renamed from struniq_processor_t.
7719 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7720 in turn was renamed from hash_compare_struniq_t.
7721 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7722 (state_list): Renamed from state_list_t.
7723 * src/assoc.h (assoc): Renamed from assoc_t.
7724 * src/conflicts.c (enum conflict_resolution): Renamed from
7725 enum conflict_resolution_e.
7726 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7727 (rule_list): Renamed from rule_list_t.
7728 * src/getargs.h (enum trace): Renamed from enum trace_e.
7729 (enum report): Renamed from enum report_e.
7730 * src/gram.h (item_number): Renamed from item_number_t.
7731 (rule_number): Renamed from rule_number_t.
7732 (struct rule_s): Remove the "rule_s" part; not used.
7733 (rule): Renamed from rule_t.
7734 (rule_filter): Renamed from rule_filter_t.
7735 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7736 (goto_list): Renamed from goto_list_t.
7737 * src/lalr.h (goto_number): Renamed from goto_number_t.
7738 * src/location.h (location): Renamed from location_t.
7739 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7740 and moved here from:
7741 * src/muscle_tab.h (muscle_entry_t): here.
7742 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7743 (rule_list): Renamed from rule_list_t.
7744 * src/print_graph.c (static_graph): Renamed from graph.
7745 * src/reader.h (braced_code): Renamed from braced_code_t.
7746 Remove brace_code_e tag.
7747 * src/relation.h (relation_node): Renamed from relation_node_t.
7748 (relation_nodes): Renamed from relation_nodes_t.
7749 (relation): Renamed from relation_t.
7750 * src/state.h (state_number): Renamed from state_number_t.
7751 (struct state): Renamed from struct state_s.
7752 (state): Renamed from state_t.
7753 (transitions): Renamed from transitions_t. Unused (and
7754 misspelled) transtion_s tag removed.
7755 (errs): Renamed from errs_t. Unused errs_s tag removed.
7756 (reductions): Renamed from reductions_t. Unused tag
7757 reductions_s removed.
7758 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7759 (struct symbol_list): Renamed from struct symbol_list_s.
7760 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7761 (struct symbol): Renamed from struct symbol_s.
7762 (symbol): Renamed from symbol_t.
7763 * src/tables.c (vector_number): Renamed from vector_number_t.
7764 (action_number): Renamed from action_t.
7765 * src/tables.h (base_number): Renamed from base_t.
7766 * src/vcg.h (enum color): Renamed from enum color_e.
7767 (enum textmode): Renamed from enum textmode_e.
7768 (enum shape): Renamed from enum shape_e.
7769 (struct colorentry): Renamed from struct colorentry_s.
7770 (struct classname): Renamed from struct classname_s.
7771 (struct infoname): Renamed from struct infoname_s.
7772 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7773 (enum decision): Renamed from enum decision_e.
7774 (enum orientation): Renamed from enum orientation_e.
7775 (enum alignment): Renamed from enum alignment_e.
7776 (enum arrow_mode): Renamed from enum arrow_mode_e.
7777 (enum crossing_type): Renamed from enum crossing_type_e.
7778 (enum view): Renamed from enum view_e.
7779 (struct node): Renamed from struct node_s.
7780 (node): Renamed from node_t.
7781 (enum linestyle): Renamed from enum linestyle_e.
7782 (enum arrowstyle): Renamed from enum arrowstyle_e.
7783 (struct edge): Renamed from struct edge.
7784 (edge): Renamed from edge_t.
7785 (struct graph): Renamed from struct graph_s.
7786 (graph): Renamed from graph_t.
7787 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7788 Rename value_t -> value.
7789 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7790 value_t_as_yystype -> value_as_yystype.
7792 Don't include <errno.h> in the mainstream code, since it
7793 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7794 * lib/get-errno.c, lib/get-errno.h: New files.
7795 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7797 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7798 * src/output.c (output_skeleton): Likewise.
7799 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7801 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7803 (handle_action_dollar, handle_action_at): Likewise.
7804 * src/system.h: Do not include <errno.h>.
7805 (TAB_EXT): Renamed from EXT_TAB.
7806 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7808 Avoid str[a-z]*, since <string.h> reserves that name space.
7809 Change all instances of "struniq" in names to "uniqstr", and
7810 likewise for "STRUNIQ" and "UNIQSTR".
7811 * src/uniqstr.c: Renamed from src/struniq.c.
7812 * src/uniqstr.h: Renamed from src/struniq.h.
7813 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7814 * src/files.c (strsuffix): Remove; unused.
7815 (concat2): Renamed from stringappend. Now static.
7816 * src/files.h (strsuffix, stringappend): Remove; unused.
7817 * src/parse-gram.y (<chars>): Renamed from <string>.
7818 (<uniqstr>): Renamed from <struniq>.
7819 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7820 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7821 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7822 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7823 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7824 (N_EXPAND): Renamed from N_STRETCH.
7826 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7827 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7828 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7830 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7831 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7832 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7833 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7834 (BASE_MAXIMUM): Renamed from BASE_MAX.
7835 (BASE_MINIMUM): Renamed from BASE_MIN.
7836 (ACTION_MAX): Remove; unused.
7837 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7838 Unnecessary casts removed from above defines.
7841 Fix misspelling in names.
7842 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7843 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7847 * lib/timevar.c (timevar_report): Renamed from time_report,
7848 for consistency with other names.
7849 * lib/timevar.h (timevar_report): New decl.
7850 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7853 Sort include-file uses.
7855 Reorder all include files under src to be in the order "system.h".
7856 then the ../lib include files in angle brackets (alphabetized),
7857 then the . include files in double-quotes (alphabetized). Fix
7858 dependency breakages encountered in this process, as follows:
7859 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
7860 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
7861 * src/state.h: Include "symtab.h".
7863 2002-12-08 Paul Eggert <eggert@twinsun.com>
7865 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
7866 since this causes problems when __file__ contains character
7867 sequences like "@" that are treated specially by src/scan-skel.l.
7868 Instead, just use the file's basename. This fixes the bug
7869 reported by Martin Mokrejs in
7870 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
7872 2002-12-06 Paul Eggert <eggert@twinsun.com>
7874 Add support for rules that do not have trailing semicolons, as
7875 POSIX requires. Improve the quality of locations in Bison
7878 * src/location.c: Include <quotearg.h>.
7879 (empty_location): Now const.
7880 (location_print): New function. Follow the recommendation of the
7881 GNU Coding Standards for locations that span file boundaries.
7882 * src/location.h: Do not include <quotearg.h>; no longer needed.
7883 (boundary): New type.
7884 (location_t): Use it. This allows locations to span file boundaries.
7885 All member uses changed: file -> start.file or end.file (as needed),
7886 first_line -> start.line, first_column -> start.column,
7887 last_line -> end.line, last_column -> end.column.
7888 (equal_boundaries): New function.
7889 (LOCATION_RESET, LOCATION_STEP): Remove.
7890 (LOCATION_PRINT): Remove. All callers changed to use location_print.
7891 (empty_location): Now const.
7892 (location_print): New decl.
7893 * src/parse-gram.y (lloc_default): New function, which handles
7894 empty locations more accurately.
7895 (YYLLOC_DEFAULT): Use it.
7896 (%token COLON): Remove.
7897 (%token ID_COLON): New token.
7899 (declarations, rules): Remove trailing semicolon.
7900 (declaration, rules_or_grammar_declaration):
7901 Allow empty (";") declaration.
7902 (symbol_def): Remove empty actions; no longer needed.
7903 (rules_or_grammar_declaration): Remove trailing semicolon.
7904 (semi_colon.opt): Remove.
7905 * src/reader.h: Include location.h.
7906 (scanner_cursor): New decl.
7907 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
7909 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7911 (STEP): Remove. No longer needed, now that adjust_location does
7912 the work. All uses removed.
7913 (scanner_cursor): New var.
7914 (adjust_location): Renamed from extend_location. It now sets
7915 *loc and adjusts the scanner cursor. All uses changed.
7916 Don't bother testing for CR.
7917 (handle_syncline): Remove location arg; now updates scanner cursor.
7918 All callers changed.
7919 (unexpected_end_of_file): Now accepts start boundary of token or
7920 comment, not location. All callers changed. Update scanner cursor,
7922 (SC_AFTER_IDENTIFIER): New state.
7923 (context_state): Renamed from c_context. All uses changed.
7924 (id_loc, code_start, token_start): New local vars.
7925 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7926 processing of Yacc white space and equivalents here.
7927 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7928 instead of returning ID immediately, since we need to search for
7930 (<INITIAL>"'", "\""): Save token_start.
7931 (<INITIAL>"%{", "{", "%%"): Save code_start.
7932 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7933 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7934 BEGIN context_state at end, not INITIAL.
7935 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7936 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7937 Return correct token start.
7938 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7939 the start of a character, string or multiline comment is found.
7940 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7941 Reduction): Adjust reported locations to match the more-precise
7942 results now expected.
7943 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7944 * tests/reduce.at (Useless Rules, Reduced Automaton,
7945 Underivable Rules): Likewise.
7946 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7947 or "|"' now that so many other tokens are allowed by the new grammar.
7949 * src/complain.h (current_file): Remove duplicate decl;
7950 current_file is now owned by files.h.
7951 * src/complain.c, src/scan-gram.l: Include files.h.
7953 2002-12-06 Paul Eggert <eggert@twinsun.com>
7955 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7956 promotes to int; it might be unsigned int.
7957 * data/yacc.c (yy_reduce_print): Likewise.
7959 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7960 be #defined in the prologue, not in the Bison declarations.
7961 This fixes Debian Bug 102878, reported by Shaul Karl.
7963 2002-12-02 Paul Eggert <eggert@twinsun.com>
7965 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7966 * lib/strtoul.c: New file, from gnulib.
7967 This fixes a porting bug reported by Peter Klein in
7968 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
7970 2002-11-30 Paul Eggert <eggert@twinsun.com>
7972 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
7973 and put only a forward declaration in the prologue. This is for
7974 consistency with the other scanner helper functions.
7976 Type clashes now generate warnings, not errors, since it
7977 appears that POSIX may allow some grammars with type clashes.
7978 * src/reader.c (grammar_current_rule_check): Warn about
7979 type clashes instead of complaining.
7980 * tests/input.at (Type Clashes): Expect warnings, not complaints.
7982 Add Yacc library, since POSIX requires it.
7983 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
7984 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
7985 * lib/main.c, lib/yyerror.c: New files.
7987 gram_error can be static; it need not be extern.
7988 * src/reader.h (gram_error): Remove decl.
7989 * src/parse-gram.y (gram_error): Now static. Add static decl.
7990 (print_token_value): Omit parameter names from forward decl,
7993 2002-11-29 Paul Eggert <eggert@twinsun.com>
7995 * doc/bison.texinfo: Emphasize that yylex and yyerror must
7996 be declared before being used. E.g., one should typically
7997 declare them in the prologue. Use GNU coding style in examples.
7998 Put "const" consistently after the type it modifies. Mention
7999 that C99 supports "inline". Mention that yyerror traditionally
8002 %parse-param and %lex-param now take just one argument, the
8003 declaration; the argument name is deduced from the declaration.
8005 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8006 Reporting, Table of Symbols): Document this.
8007 * src/parse-gram.y (add_param): New function.
8009 (declaration): Implement new rule for %parse-param and %lex-param.
8010 * src/scan-gram.l: "," now elicits a warning, rather than being
8011 a token; this is more compatible with byacc.
8012 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8014 2002-11-27 Paul Eggert <eggert@twinsun.com>
8016 Rename identifiers to avoid real and potential collisions.
8018 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8019 to avoid collision with lex macro described by Bruce Lilly in
8020 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8021 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8022 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8023 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8025 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8026 The name "yycontrol" violates the name space rules, and this stuff
8027 wasn't being used anyway.
8028 (input): Remove action; this stuff wasn't being used.
8029 (gram_error): Rename local variable yylloc -> loc.
8030 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8031 (YY_DECL): Don't use "yy" at start of local variables.
8032 All uses changed, e.g., yylloc -> loc.
8033 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8034 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8035 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8036 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8038 * src/parse-gram.y (gram_error): loc is now const *.
8039 * src/reader.h (gram_error): Likewise.
8041 2002-11-24 Paul Eggert <eggert@twinsun.com>
8045 * tests/actions.at (Actions after errors): Use an output format
8046 more similar to that of the Printers and Destructors test.
8047 Test the position of the ';' token too.
8048 (Printers and Destructors): Likewise.
8049 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8050 unnecessarily alarming people when the test fails.
8052 * data/yacc.c (yyerrlab1): Move this label down, so that the
8053 parser does not discard the lookahead token if the user code
8054 invokes YYERROR. This change is required for POSIX conformance.
8056 * lib/error.c: Sync with gnulib.
8058 2002-11-22 Paul Eggert <eggert@twinsun.com>
8060 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8061 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8062 * lib/xmalloc.c: Likewise.
8064 2002-11-20 Paul Eggert <eggert@twinsun.com>
8066 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8068 2002-11-20 Paul Eggert <eggert@twinsun.com>
8070 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8071 should use `if (! x) abort ();' rather than `assert (x);', and
8072 anyway it's one less thing to worry about configuring.
8074 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8075 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8076 and replace all instances of assert with abort.
8077 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8078 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8080 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8081 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8082 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8083 hash_find_entry, hash_rehash, hash_insert): Likewise.
8084 * src/conflicts.c (resolve_sr_conflict): Likewise.
8085 * src/lalr.c (set_goto_map, map_goto): Likewise.
8086 * src/nullable.c (nullable_compute): Likewise.
8087 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8088 * src/reader.c (packgram, reader): Likewise.
8089 * src/state.c (state_new, state_free, state_transitions_set,
8090 state_reduction_find): Likewise.
8091 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8092 symbol_pack): Likewise.
8093 * src/tables.c (conflict_row, pack_vector): Likewise.
8094 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8095 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8096 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8097 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8099 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8100 (ARGMATCH_CONSTRAINT): New macro.
8101 (ARGMATCH_ASSERT): Use it.
8103 * src/system.h (verify): New macro.
8104 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8106 * src/tables.c (tables_generate): Likewise.
8108 * src/struniq.c (struniq_assert): Now returns void, and aborts
8109 if the assertion is false.
8110 (struniq_assert_p): Remove.
8111 * src/struniq.h: Likewise.
8113 2002-11-18 Paul Eggert <eggert@twinsun.com>
8115 * data/glr.c (yygetLRActions): Replace `yyindex' with
8116 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8117 This fixes the regression with Sun ONE Studio 7 cc that I reported in
8118 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
8120 2002-11-18 Akim Demaille <akim@epita.fr>
8122 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8124 From Tim Van Holder.
8126 2002-11-17 Paul Eggert <eggert@twinsun.com>
8128 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8129 to "SyntaxError" for consistency with my 2002-11-15 change.
8131 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8132 not define to {}, since this breaks the common use of `YYDPRINTF
8133 ((...));' if a single statement is desired (e.g. before `else').
8134 Work around GCC warnings by surrounding corresponding calls with
8136 (yyhasResolvedValue): Remove unused function.
8137 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8139 (yyreportSyntaxError): Renamed from yyreportParseError.
8140 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8142 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8143 extern when possible. Remove unused initializations.
8145 2002-11-16 Akim Demaille <akim@epita.fr>
8147 Augment the similarity between GLR and LALR traces.
8149 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8150 (YY_REDUCE_PRINT): New.
8151 (yyparse): Use them.
8152 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8154 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8155 state reached after the reduction/recovery, since...
8156 (yyparse, yyprocessOneStack): Report the state we are entering in.
8158 2002-11-16 Akim Demaille <akim@epita.fr>
8160 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8161 Add support for --trace=skeleton.
8162 * src/scan-skel.l: %option debug.
8163 Scan strings of non-@ or \n instead of character by character.
8164 (scan_skel): Handle trace_skeleton.
8166 (@output_parser_name@, @output_header_name@): ``Restore'' their
8167 support (used to be M4 macros).
8168 * data/yacc.c: Quote larger chunks, a la glr.c.
8169 * data/lalr1.cc: Likewise.
8170 The header guards are no longer available, so use some other
8171 string than `YYLSP_NEEDED'.
8173 2002-11-16 Akim Demaille <akim@epita.fr>
8175 Make the ``Printers and Destructors'' test more verbose, taking
8176 `yacc.c''s behavior as (possibly wrong) reference.
8178 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8179 instead of fprint on stdout.
8180 Set and report the last_line of the symbols.
8181 Consistently display values and locations.
8183 2002-11-16 Paul Eggert <eggert@twinsun.com>
8185 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8187 2002-11-15 Paul Eggert <eggert@twinsun.com>
8189 * tests/actions.at (Actions after errors): New test case.
8191 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8192 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8193 tests/action.at, tests/calc.at, tests/conflicts.at,
8194 tests/cxx-type.at, tests/regression.at:
8195 "parse error" -> "syntax error" for POSIX compatibility.
8196 "parsing stack overflow..." -> "parser stack overflow" so
8197 that code matches Bison documentation.
8199 2002-11-15 Akim Demaille <akim@epita.fr>
8201 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8202 take two BRACED_CODE, not two string_content.
8203 Free the scanner's obstack when we are done.
8204 (code_content): New.
8205 * tests/calc.at: Adjust.
8206 * doc/bison.texinfo: Adjust.
8207 Also, make sure to include the `,' for these declarations.
8209 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8211 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8212 definition; avoids potential autoreconf problems.
8214 2002-11-15 Akim Demaille <akim@epita.fr>
8216 Always check the value returned by yyparse.
8218 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8219 returned by yyparse.
8220 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8222 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8223 returned by yyparse.
8225 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8227 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8230 2002-11-14 Paul Eggert <eggert@twinsun.com>
8232 * src/output.c (output_skeleton): Call xfopen instead of
8233 duplicating xfopen's body.
8235 Fix bugs reported by Nelson H. F. Beebe in
8236 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
8238 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8239 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8240 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8241 file twice in the grammar, as an extra check.
8243 * tests/input.at (Torturing the Scanner): Surround the
8244 backslash-newline tests with "#if 0", to make it less likely that
8245 we'll run into compiler bugs. Bring back solitary \ inside
8246 comment, but add a closing comment to work around HP C bug. Don't
8247 test backslash-newline in C character constant.
8249 2002-11-14 Akim Demaille <akim@epita.fr>
8251 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8252 status of the compiler.
8253 Calling `exit 1' is no longer needed.
8254 Reported by Nelson H. F. Beebe.
8256 2002-11-14 Akim Demaille <akim@epita.fr>
8258 * tests/atlocal.in (CPPFLAGS): We have config.h.
8259 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8261 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8262 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8263 * tests/regression.at, tests/torture.at: Use them for all the
8264 grammars that are to be compiled.
8265 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8266 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8267 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8269 2002-11-14 Akim Demaille <akim@epita.fr>
8271 * doc/bison.texinfo: Various formatting changes (alignments in
8272 samples, additional @group/@end group, GCS in samples.
8273 Use @deffn instead of simple @table to define the directives,
8274 macros, variables etc.
8276 2002-11-13 Paul Eggert <eggert@twinsun.com>
8278 Fix some bugs reported by Albert Chin-A-Young in
8279 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
8281 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8282 -o c"; the HP C compiler chatters during compilation.
8283 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8284 * tests/headers.at (export YYLTYPE): Likewise.
8286 * tests/input.at (Torturing the Scanner): Remove lines containing
8287 solitary backslashes, as they tickle a bug in the HP C compiler.
8289 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8290 comments, since they're not portable. Use GNU coding style.
8292 2002-11-13 Akim Demaille <akim@epita.fr>
8294 * data/yacc.c: Leave bigger chunks of quoted text.
8295 (YYDSYMPRINTF): New.
8296 Use it to report symbol activities.
8297 * data/glr.c (YYDSYMPRINTF): New.
8300 2002-11-12 Paul Eggert <eggert@twinsun.com>
8304 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8305 (yyglrReduce): Return yyok, not 0.
8306 This should avoid the enumerated-type warnings reported
8307 by Nelson H. F. Beebe in
8308 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
8310 * lib/bbitset.h (BITSET_INLINE): Remove.
8311 * lib/bitset.h [! BITSET_INLINE]: Remove.
8312 (bitset_set, bitset_reset, bitset_test): Rename local vars
8313 to avoid shadowing warnings by GCC.
8315 * data/glr.c (inline): Remove #define. It's the user's
8316 responsibility to #define it away, just like 'const'.
8317 This fixes one of the bugs reported by Nelson H. F. Beebe in
8318 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
8320 * Makefile.maint (po-check): Scan .l and .y files instead of the
8321 .c and the .h files that they generate. This fixes the bug
8322 reported by Tim Van Holder in:
8323 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
8324 Look for N_ as well as for _. Try to avoid matching #define for
8326 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8327 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8328 * src/scan-gram.l: Revamp regular expressions so that " and '
8329 do not confuse xgettext.
8331 * src/struniq.h (struniq_new): Do not declare the return type
8332 to be 'const'; this violates the C standard.
8333 * src/struniq.c (struniq_new): Likewise.
8335 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8337 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8338 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8341 2002-11-12 Akim Demaille <akim@epita.fr>
8343 * Makefile.maint: Sync with Autoconf:
8344 (local_updates): New.
8346 2002-11-12 Akim Demaille <akim@epita.fr>
8348 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8350 2002-11-12 Akim Demaille <akim@epita.fr>
8352 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8355 2002-11-12 Akim Demaille <akim@epita.fr>
8357 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8360 2002-11-12 Akim Demaille <akim@epita.fr>
8362 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8363 Use it to test the GLR parser.
8365 2002-11-12 Akim Demaille <akim@epita.fr>
8367 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8369 * data/glr.c (yystos): New.
8370 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8372 (yyval): Don't define it, it is handled via M4.
8373 (yyrecoverParseError): Free verbosely the discarded symbols.
8374 * data/yacc.c (yysymprint): Remove, rather...
8375 (b4_yysymprint_generate): invoke.
8376 * data/c.m4 (b4_yysymprint_generate): New.
8377 Accept pointers as arguments, as opposed to the version from
8379 (b4_yydestruct_generate): Likewise.
8380 * tests/cations.at (Printers and Destructors): Use Bison directives
8381 instead of CPP macros.
8382 Don't rely on internal details.
8384 2002-11-12 Akim Demaille <akim@epita.fr>
8386 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8387 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8388 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8389 it against YYEMPTY and so forth), work on yytoken (i.e., set
8390 it to YYEMPTY etc.).
8391 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8392 (b4_symbol_actions): Remove.
8393 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8394 for 0, end-of-input.
8396 2002-11-12 Akim Demaille <akim@epita.fr>
8398 * doc/bison.texinfo (Destructor Decl): New.
8400 2002-11-12 Akim Demaille <akim@epita.fr>
8402 * src/tables.c (tables_generate): Use free for pointers that
8403 cannot be NULL, not XFREE.
8404 (pack_vector): Use assert, not fatal, for bound violations.
8405 * src/state.c (state_new): Likewise.
8406 * src/reader.c (reader): Likewise.
8407 * src/lalr.c (set_goto_map): Likewise.
8408 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
8411 2002-11-12 Akim Demaille <akim@epita.fr>
8413 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8415 * src/scan-gram.l (last_string): Is global to the file, not to
8417 * src/parse-gram.y (input): Don't append the epilogue here,
8418 (epilogue.opt): do it here, and free the scanner's obstack.
8419 * src/reader.c (epilogue_set): Rename as...
8420 (epilogue_augment): this.
8421 * data/c.m4 (b4_epilogue): Defaults to empty.
8423 2002-11-12 Akim Demaille <akim@epita.fr>
8425 * src/getargs.c (long_options): Remove duplicates.
8426 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8428 * doc/bison.rnh: Remove.
8429 * doc/bison.texinfo (VMS Invocation): Remove.
8431 2002-11-12 Akim Demaille <akim@epita.fr>
8433 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8434 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8436 Use struniq for symbols.
8438 * src/symtab.h (symbol_t): The tag member is a struniq.
8439 (symbol_type_set): Adjust.
8440 * src/symtab.c (symbol_new): Takes a struniq.
8441 (symbol_free): Don't free the tag member.
8442 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8443 (hash_compare_symbol, hash_symbol): these.
8444 Use the fact that tags as struniqs.
8445 (symbol_get): Use struniq_new.
8446 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8448 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8449 and type members are struniqs.
8450 * src/reader.c (get_merge_function)
8451 (grammar_current_rule_merge_set): Adjust.
8452 (TYPE, current_type): Are struniq.
8454 Use struniq for file names.
8456 * src/files.h, src/files.c (infile): Split into...
8457 (grammar_file, current_file): these.
8458 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8459 * src/reduce.c (reduce_print): Likewise.
8460 * src/getargs.c (getargs): Likewise.
8461 * src/complain.h, src/complain.c: Likewise.
8462 * src/main.c (main): Call struniqs_new early enough to use it for
8464 Don't free the input file name.
8466 2002-11-12 Akim Demaille <akim@epita.fr>
8468 * src/symtab.c (symbol_free): Remove dead deactivated code:
8469 type_name are properly removed.
8470 Don't use XFREE to free items that cannot be NULL.
8471 * src/struniq.h, src/struniq.c: New.
8472 * src/main.c (main): Initialize/free struniqs.
8473 * src/parse-gram.y (%union): Add astruniq member.
8475 * src/scan-gram.l (<{tag}>): Return a struniq.
8476 Free the obstack bit that used to store it.
8477 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8479 2002-11-11 Paul Eggert <eggert@twinsun.com>
8481 Revamp to fix many (but not all) of the C- and M4-related quoting
8482 problems. Among other things, this fixes the Bison bug reported
8483 by Jan Hubicka when processing the Bash grammar; see:
8484 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
8486 Use new @ escapes consistently. Represent brackets with @{ and @}
8487 rather than @<:@ and @:>@, since this works a bit better with dumb
8488 editors like vi. Represent @ with @@, since @ is now consistently
8489 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8490 __ofile__, to avoid unexpected expansions. Similarly, use @output
8491 rather than #output.
8493 * data/c.m4 (b4_copyright): Omit file name from comment, since
8494 the file name could contain "*/".
8495 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8496 be quoted. All uses changed.
8498 * data/glr.c: Use new @ escapes consistently.
8499 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8500 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8501 Remove, since they couldn't handle arbitrary characters in file
8503 * data/lalr1.cc: Likewise.
8504 * data/yacc.c: Likewise.
8506 * src/files.c (output_infix): Remove; all uses removed.
8507 * src/files.h: Likewise.
8509 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8510 mishandled funny characters in file names, and anyway it isn't
8512 * data/yacc.c: Likewise.
8513 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8515 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8516 * data/yacc.c: Likewise.
8518 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8520 (muscle_init): Quote filename as a C string.
8521 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8522 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8523 * src/output.c (escaped_file_name_output): New function.
8524 (prepare_symbols): Quote tokens for M4.
8525 (prepare): Don't insert output_infix, output_prefix,
8526 output_parser_name, output_header_name; this is now down by scan-skel.
8527 Insert skeleton as a C string.
8529 * src/output.c (user_actions_output, symbol_destructors_output,
8530 symbol_printers_output): Quote filenames for C and M4.
8531 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8533 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8534 escapes other than \\ and \'; this simplifies the code.
8535 (<SC_STRING>): Likewise, for \\ and \".
8536 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8537 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8538 Use new escapes @{ and @} for [ and ].
8540 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8541 them with auto vars.
8542 Switch to new escape scheme, where @ is the escape character uniformly.
8543 Abort if a stray escape character is found. Avoid unbounded input
8544 buffer when parsing non-escaped text.
8546 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8547 __oline__, #output, $@, and @{ do not have unintended meanings.
8549 2002-11-09 Paul Eggert <eggert@twinsun.com>
8551 Fix the test failure due to GCC warnings described in
8552 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
8553 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8554 evaluate to 0 if it's impossible for NINF to be in the respective
8556 (yygetLRActions, yyrecoverParseError): Use them.
8558 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8559 counted in the token inserted at end of file. Now takes
8560 location_t *, not location_t, so that the location can be
8561 adjusted. All uses changed.
8563 * tests/regression.at (Invalid inputs): Adjust wording in
8564 diagnostic to match the new behavior.
8566 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
8567 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
8568 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
8569 abort ();'. This reduces the runtime of the "Many lookaheads"
8570 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
8573 2002-11-07 Paul Eggert <eggert@twinsun.com>
8575 * src/parse-gram.y (CHARACTER): Remove unused token.
8578 * src/scan-gram.l: Remove stack option. We no longer use the
8579 stack, since the stack was never deeper than 1; instead, use the
8580 new auto var c_context to record the stacked value.
8582 Remove nounput option. At an unexpected end of file, we now unput
8583 the minimal input necessary to end cleanly; this simplifies the
8586 Avoid unbounded token sizes where this is easy.
8588 (unexpected_end_of_file): New function.
8589 Use it to systematize the error message on unexpected EOF.
8590 (last-string): Now auto, not static.
8591 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
8592 (scanner_last_string_free): Remove; not used.
8593 (percent_percent_count): Move decl to just before use.
8594 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
8595 not the (never otherwised-used) CHARACTER.
8597 2002-11-07 Akim Demaille <akim@epita.fr>
8599 Let yyerror always receive the msg as last argument, so that
8600 yyerror can be variadic.
8602 * data/yacc.c (b4_yyerror_args): New.
8603 Use it when calling yyerror.
8604 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
8605 Use it when calling yyerror.
8606 * doc/bison.texinfo (Error Reporting): Adjust.
8607 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
8608 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
8610 2002-11-06 Akim Demaille <akim@epita.fr>
8612 #line should have quoted strings.
8613 Ideally, this should be done by m4_quotearg.
8615 * src/scan-skel.l: Include quotearg.h.
8617 * src/output.c (symbol_printers_output)
8618 (symbol_destructors_output): Quote the file name.
8620 2002-11-06 Akim Demaille <akim@epita.fr>
8622 * tests/regression.at (Invalid inputs): Adjust to the recent
8625 2002-11-06 Akim Demaille <akim@epita.fr>
8628 Reported by Jim Kent.
8630 * data/c.m4 (b4_syncline): New.
8631 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
8632 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
8633 * src/output.c (user_actions_output): Likewise.
8634 (prepare): Define 'b4_synclines_flag'.
8635 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
8637 2002-11-06 Akim Demaille <akim@epita.fr>
8639 * src/main.c (main): Free `infile'.
8640 * src/scan-gram.l (handle_syncline): New.
8642 * src/output.c (user_actions_output, symbol_destructors_output)
8643 (symbol_printers_output): Use the location's file name, not
8645 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8647 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8649 * src/tables.c (matching_state): Don't allow states to match if
8650 either has GLR conflict entries.
8652 2002-11-05 Paul Eggert <eggert@twinsun.com>
8654 * src/scan-gram.l: Use more accurate diagnostics, e.g.
8655 "integer out of range" rather than "invalid value".
8656 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
8659 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8660 Also, remove one static variable in the scanner.
8662 * src/scan-gram.l (braces_level): Now auto, not static.
8663 Initialize to zero if the compiler is being picky.
8664 (INITIAL): Clear braces_level instead of incrementing it.
8665 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
8666 as POSIX 1003.1-2001 requires.
8667 * src/system.h (IF_LINT): New macro, taken from coreutils.
8668 * configure.ac: Define "lint" if --enable-gcc-warnings.
8670 2002-11-05 Akim Demaille <akim@epita.fr>
8672 * src/scan-gram.l: When it starts with `%', complain about the
8673 whole directive, not just that `invalid character: %'.
8675 2002-11-04 Akim Demaille <akim@epita.fr>
8677 * Makefile.maint: Update from Autoconf.
8678 (update, cvs-update, po-update, do-po-update): New.
8680 2002-11-04 Akim Demaille <akim@epita.fr>
8682 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8684 Have yyerror `use' its arguments.
8685 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8686 returns true when location & yacc & pure & parse-param.
8687 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8689 2002-11-04 Akim Demaille <akim@epita.fr>
8691 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8693 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8696 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8699 2002-11-03 Paul Eggert <eggert@twinsun.com>
8701 * src/reader.c (get_merge_function, grammar_current_rule_check):
8702 Use consistent diagnostics for reporting type name clashes.
8703 Quote the types with <>, for consistency with Yacc.
8704 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8706 2002-11-03 Akim Demaille <akim@epita.fr>
8708 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8710 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8711 (b4_parse_param): Remove.
8712 Use b4_identification.
8713 Propagate b4_pure_args where needed to pass them to yyerror.
8714 * data/glr.m4 (b4_parse_param): Remove.
8715 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8716 (b4_lpure_formals): New.
8717 Use b4_identification.
8718 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8719 b4_user_formals and b4_user_args.
8720 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8721 (yyreportAmbiguity): When using a pure parser, also need
8722 the location, and the parse-params.
8724 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8725 When using a pure parser, also need the parse-params.
8727 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8728 (%pure-parser + %parse-param) LALR and GLR parsers.
8729 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8730 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8731 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8732 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8733 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8734 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8735 * doc/bison.texinfo: Untabify the whole file.
8736 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8737 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8738 (Error Reporting): Adjust to these new directives.
8739 Document %error-verbose, deprecate YYERROR_VERBOSE.
8741 2002-11-03 Akim Demaille <akim@epita.fr>
8743 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8744 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8745 command line options.
8746 * tests/cxx-type.at: Formatting changes.
8748 2002-11-03 Paul Eggert <eggert@twinsun.com>
8750 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8751 to count columns correctly, and to check for invalid inputs.
8753 Use mbsnwidth to count columns correctly. Account for tabs, too.
8755 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8756 (extend_location): New function.
8759 Handle CRLF in C code rather than in Lex code.
8760 (YY_INPUT): New macro.
8761 (no_cr_read): New function.
8763 Scan UCNs, even though we don't fully handle them yet.
8764 (convert_ucn_to_byte): New function.
8766 Handle backslash-newline correctly in C code.
8767 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8768 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8770 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8771 Use {splice} wherever C allows backslash-newline.
8772 YY_STEP after space, newline, vertical-tab.
8773 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
8775 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8777 ({int}, handle_action_dollar, handle_action_at): Check for integer
8780 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8782 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8783 as well as \000. Check for UCHAR_MAX, not 255.
8784 Allow \x with an arbitrary positive number of digits, as in C.
8785 Check for overflow here.
8786 Allow \? and UCNs, for compatibility with C.
8788 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8789 with quote slot used by complain_at.
8791 * tests/input.at: Add tests for backslash-newline, m4 quotes
8792 in symbols, long literals, and funny escapes in strings.
8794 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8795 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8796 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8797 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8798 * m4/mbswidth.m4: New file, from GNU coreutils.
8800 * doc/bison.texinfo (Grammar Outline): Document // comments.
8801 (Symbols): Document that trigraphs have no special meaning in Bison,
8802 nor is backslash-newline allowed.
8803 (Actions): Document that trigraphs have no special meaning.
8805 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8808 2002-11-02 Paul Eggert <eggert@twinsun.com>
8810 * src/reader.c: Don't include quote.h; not needed.
8811 (get_merge_function): Reword warning to be consistent with
8812 type clash diagnostic in grammar_current_rule_check.
8814 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8815 bug in trigraph handling.
8817 * src/output.c (prepare_symbols): When printing token names,
8818 escape "[" as "@<:@" and likewise for "]".
8820 * src/system.h (errno): Remove declaration, as we are now
8821 assuming C89 or better, and C89 guarantees errno.
8823 2002-10-30 Paul Eggert <eggert@twinsun.com>
8825 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8826 Check for close failures.
8827 * src/files.h (xfclose): Return void, not int, since it always
8829 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8831 * src/output.c (output_skeleton): Use xfclose rather than fclose
8832 and ferror. xfclose now checks ferror.
8834 * data/glr.c (YYLEFTMOST_STATE): Remove.
8835 (yyreportTree): Use a stack-based leftmost state. This avoids
8836 our continuing battles with bogus warnings about initializers.
8838 2002-10-30 Akim Demaille <akim@epita.fr>
8840 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8843 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8845 * tests/glr-regr1.at: New test for reported regressions.
8846 * tests/testsuite.at: Add glr-regr1.at test.
8847 * tests/Makefile.am: Add glr-regr1.at test.
8849 2002-10-24 Paul Eggert <eggert@twinsun.com>
8853 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
8854 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
8855 we use malloc. Don't assume 'A' through 'Z' are contiguous.
8856 Don't assume strdup exists; POSIX says its an XSI extension.
8857 Check for buffer overflow on input.
8859 2002-10-24 Akim Demaille <akim@epita.fr>
8861 * src/output.c (output_skeleton): Don't disable M4sugar comments
8862 too soon: it results in comments being expanded.
8863 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
8866 2002-10-24 Akim Demaille <akim@epita.fr>
8868 * data/yacc.c (m4_int_type): New.
8869 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
8870 char' as only yacc.c wants K&R portability.
8871 * data/glr.c (yysigned_char): Remove.
8872 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8873 Reported by Quoc Peyrot.
8875 2002-10-23 Paul Eggert <eggert@twinsun.com>
8877 * src/main.c (main): With --trace=time, report times even if a
8878 non-fatal error occurs. Formerly, the times were reported in some
8879 such cases but not in others.
8880 * src/reader.c (reader): Just return if a complaint has been issued,
8881 instead of exiting, so that 'main' can report times.
8883 2002-10-22 Akim Demaille <akim@epita.fr>
8885 * src/system.h: Include sys/types.
8886 Reported by Bert Deknuydt.
8888 2002-10-23 Paul Eggert <eggert@twinsun.com>
8890 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8891 Suggested by Art Haas.
8893 2002-10-22 Paul Eggert <eggert@twinsun.com>
8895 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
8896 decl; not needed any more.
8897 * src/main.c (main): Use return to exit, undoing yesterday's change.
8898 The last OS that we could find where this wouldn't work is
8899 SunOS 3.5, and that's too old to worry about now.
8901 * data/glr.c (struct yyltype): Define members even when not
8902 doing locations. This is more consistent with yacc.c, and it
8903 works around the following bug reports:
8904 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
8905 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
8907 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
8908 @acronym consistently. Standardize on "Yacc" instead of "YACC",
8909 "Algol" instead of "ALGOL". Give a bit more history about BNF.
8911 2002-10-22 Akim Demaille <akim@epita.fr>
8915 2002-10-21 Paul Eggert <eggert@twinsun.com>
8917 Be consistent about 'bool'; the old code used an enum in one
8918 module and an int in another, and this violates the C standard.
8919 * m4/stdbool.m4: New file, from coreutils 4.5.3.
8920 * configure.ac (AC_HEADER_STDBOOL): Add.
8921 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
8922 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
8923 * src/symtab.c (hash_compare_symbol_t): Likewise.
8924 * src/system.h (bool, false, true): Use a definition consistent
8925 with ../lib/hash.c. All uses changed.
8927 * src/complain.c (warning_issued): Renamed from warn_message_count,
8928 so that we needn't worry about integer overflow (!).
8929 Now of type bool. All uses changed.
8930 (complaint_issued): Renamed from complain_message_count; likewise.
8932 * src/main.c (main): Use exit to exit with failure.
8934 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8935 rather than 1 and 0.
8936 * src/main.c (main): Likewise.
8937 * src/getargs.c (getargs): Likewise.
8938 * src/reader.c (reader): Likewise.
8940 * src/getarg.c (getargs): Remove duplicate code for
8941 "Try `bison --help'".
8943 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8944 What was that "2" for?
8946 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8947 * src/getargs.c (usage): Likewise.
8949 * src/getargs.c (getargs): When there are too few operands, report
8950 the last one. When there are too many, report the first extra
8951 one. This is how diffutils does it.
8953 2002-10-20 Paul Eggert <eggert@twinsun.com>
8955 Remove K&R vestiges.
8956 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8957 * src/complain.c (VA_START): Remove. Assume prototypes.
8958 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8959 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8960 fatal): Assume prototypes.
8961 * src/complain.h: Assume prototypes.
8962 * src/system.h (PARAMS): Remove.
8963 Include <limits.h> unconditionally, since it's guaranteeed even
8964 for a freestanding C89 compiler.
8965 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8966 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8968 2002-10-20 Akim Demaille <akim@epita.fr>
8970 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
8971 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
8972 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
8973 (yyresolveStates, yyresolveAction, yyresolveStack)
8974 (yyprocessOneStack): Use them.
8975 (yy_reduce_print): New.
8976 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
8978 2002-10-20 Akim Demaille <akim@epita.fr>
8980 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
8981 arguments and output `void'.
8982 (b4_c_function): Rename as...
8983 (b4_c_function_def): this.
8984 (b4_c_function_decl, b4_c_ansi_function_def)
8985 (b4_c_ansi_function_decl): New.
8986 Change the interpretation of the arguments: before `int, foo', now
8988 * data/yacc.c (yyparse): Prototype and define thanks to these.
8989 Adjust b4_c_function_def uses.
8990 * data/glr.c (yyparse): Likewise, but ANSI only.
8992 2002-10-20 Akim Demaille <akim@epita.fr>
8994 * src/output.c (prepare): Move the definition of `tokens_number',
8995 `nterms_number', `undef_token_number', `user_token_number_max'
8997 (prepare_tokens): Here.
8998 (prepare_tokens): Rename as...
8999 (prepare_symbols): this.
9000 (prepare): Move the definition of `rules_number' to...
9001 (prepare_rules): here.
9002 (prepare): Move the definition of `last', `final_state_number',
9003 `states_number' to...
9004 (prepare_states): here.
9005 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9007 2002-10-20 Akim Demaille <akim@epita.fr>
9009 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9011 2002-10-20 Akim Demaille <akim@epita.fr>
9013 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9016 2002-10-20 Akim Demaille <akim@epita.fr>
9018 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9019 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9021 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9023 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9024 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9027 2002-10-19 Paul Eggert <eggert@twinsun.com>
9029 Do not create a temporary file, as that involves security and
9030 cleanup headaches. Instead, use a pair of pipes.
9031 Derived from a suggestion by Florian Krohm.
9032 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9033 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9034 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9035 (BISON_PREREQ_SUBPIPE): Add.
9036 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9037 Add subpipe.h, subpipe.c.
9038 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9039 * po/POTFILES.in: Add lib/subpipe.c.
9040 * src/output.c: Include "subpipe.h".
9041 (m4_invoke): Remove decl.
9042 (scan_skel): New decl.
9043 (output_skeleton): Use pipe rather than temporary file for m4 input.
9044 Check that m4sugar.m4 is readable, to avoid deadlock.
9045 Check for pipe I/O error.
9046 * src/scan-skel.l (readpipe): Remove decl.
9047 (scan_skel): New function, to be used in place of m4_invoke.
9048 Read from stream rather than file.
9050 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9051 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9052 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9053 this generates a more-accurate value anyway.
9055 * lib/timevar.c (timervar_accumulate): Rename locals to
9056 avoid confusion with similarly-named more-global.
9057 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9059 * src/output.c (prepare): Use xstrdup to convert char const *
9060 to char *, to avoid GCC warning.
9062 2002-10-19 Akim Demaille <akim@epita.fr>
9064 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9065 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9066 Use them to have `calc.y' ready for %pure-parser.
9067 * data/yacc.c (YYLEX): Pass a yylex return type to
9070 2002-10-19 Akim Demaille <akim@epita.fr>
9072 Prototype support of %lex-param and %parse-param.
9074 * src/parse-gram.y: Add the definition of the %lex-param and
9075 %parse-param tokens, plus their rules.
9076 Drop the `_' version of %glr-parser.
9078 * src/scan-gram.l (INITIAL): Scan them.
9079 * src/muscle_tab.c: Comment changes.
9080 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9081 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9082 (muscle_entry_s): The `value' member is no longer const.
9083 Adjust all dependencies.
9084 * src/muscle_tab.c (muscle_init): Adjust: use
9085 MUSCLE_INSERT_STRING.
9086 Initialize the obstack earlier.
9087 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9088 (muscle_pair_list_grow): New.
9089 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9090 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9091 * tests/calc.at: Use %locations, not --locations.
9092 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9094 2002-10-19 Akim Demaille <akim@epita.fr>
9096 * src/getargs.c (usage): Take status as argument and exit
9098 Report the traditional `Try ... --help' message when status != 0.
9099 (usage, version): Don't take a FILE * as arg, it is pointless.
9100 (getargs): When there is an incorrect number of arguments, make it
9101 an error, and report it GNUlically thanks to `usage ()'.
9103 2002-10-18 Paul Eggert <eggert@twinsun.com>
9105 * data/glr.c (yyreportParseError): Don't assume that sprintf
9106 yields the length of the printed string, as this is not true
9107 on SunOS 4.1.4. Reported by Peter Klein.
9109 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9110 * tests/conflicts.at (%nonassoc and eof): Likewise.
9111 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9113 2002-10-17 Akim Demaille <akim@epita.fr>
9115 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9116 * src/getargs.c (trace_types, trace_args): Adjust.
9117 * src/reader.c (grammar_current_rule_prec_set)
9118 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9119 Standardize error messages.
9121 (reader): Use trace_flag to enable scanner/parser debugging,
9122 instead of an adhoc scheme.
9123 * src/scan-gram.l: Remove trailing debugging code.
9125 2002-10-16 Paul Eggert <eggert@twinsun.com>
9127 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9130 * NEWS: Officially drop support for building Bison with K&R C,
9131 since it didn't work anyway and it's not worth worrying about.
9132 * Makefile.maint (wget_files): Remove ansi2knr.c.
9133 (ansi2knr.c-url_prefix): Remove.
9134 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9135 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9136 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9138 2002-10-15 Paul Eggert <eggert@twinsun.com>
9140 Stop using the "enum_" trick for K&R-style function definitions;
9141 it confused me, and I was the author! Instead, assume that people
9142 who want to use K&R C compilers (when using these modules in GCC,
9143 perhaps?) will run ansi2knr.
9145 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9146 All uses of "enum_" changed to "enum ".
9147 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9148 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9150 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9151 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9152 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9153 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9154 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9155 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9156 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9157 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9158 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9159 Use function prototypes; this removes the need for declaring
9160 static functions simply to provide their prototypes.
9161 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9162 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9163 bitset_count_, bitset_create, bitset_dump, bitset_first,
9164 bitset_free, bitset_init, bitset_last, bitset_next,
9165 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9166 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9167 bitset_print, bitset_release_memory, bitset_toggle_,
9168 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9169 debug_bitset): Likewise.
9170 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9171 * lib/bitset_stats.c (bitset_log_histogram_print,
9172 bitset_percent_histogram_print, bitset_stats_and,
9173 bitset_stats_and_cmp, bitset_stats_and_or,
9174 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9175 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9176 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9177 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9178 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9179 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9180 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9181 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9182 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9183 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9184 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9185 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9186 bitset_stats_zero): Likewise.
9187 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9188 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9189 bitsetv_dump, debug_bitsetv): Likewise.
9190 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9191 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9192 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9193 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9194 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9195 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9196 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9197 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9198 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9199 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9200 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9202 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9203 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9204 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9205 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9206 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9207 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9208 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9209 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9210 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9211 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9212 lbitset_xor_cmp, lbitset_zero): Likewise.
9214 2002-10-14 Akim Demaille <akim@epita.fr>
9218 2002-10-14 Akim Demaille <akim@epita.fr>
9220 * tests/Makefile.am (maintainer-check-posix): New.
9222 2002-10-14 Akim Demaille <akim@epita.fr>
9224 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9227 2002-10-14 Akim Demaille <akim@epita.fr>
9229 * src/tables.c (table_ninf_remap): base -> tab.
9230 Reported by Matt Rosing.
9232 2002-10-14 Paul Eggert <eggert@twinsun.com>
9234 * tests/action.at, tests/calc.at, tests/conflicts.at,
9235 tests/cxx-type.at, tests/headers.at, tests/input.at,
9236 tests/regression.at, tests/synclines.at, tests/torture.at:
9237 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9238 so that the tests still work even if POSIXLY_CORRECT is set.
9239 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
9241 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9242 for portability to K&R hosts. Fix typo: signed char is guaranteed
9243 only to 127, not to 128.
9244 * data/glr.c (yysigned_char): New type.
9245 * data/yacc.c (yysigned_char): Likewise.
9246 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9248 2002-10-13 Paul Eggert <eggert@twinsun.com>
9250 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9251 true due to limited range of data type" warning from GCC.
9253 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9254 by wrapping enum yytokentype's definition inside #ifndef
9255 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9257 2002-10-13 Akim Demaille <akim@epita.fr>
9259 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9260 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9262 2002-10-13 Akim Demaille <akim@epita.fr>
9264 * Makefile.maint: Update from Autoconf 2.54.
9265 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9267 2002-10-13 Akim Demaille <akim@epita.fr>
9269 * src/print.c (print_state): Separate the list of solved conflicts
9270 from the other items.
9271 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9273 2002-10-13 Akim Demaille <akim@epita.fr>
9275 Let nondeterministic skeletons be usable with deterministic
9278 With the patch, GAWK compiled by GCC without -O2 passes its test
9279 suite using a GLR parser driven by LALR tables. It fails with -O2
9280 because `struct stat' gives two different answers on my machine:
9281 88 (definition of an auto var) and later 96 (memset on this var).
9282 Hence the stack is badly corrumpted. The headers inclusion is to
9283 blame: if I move the awk.h inclusion before GLR's system header
9284 inclusion, the two struct stat have the same size.
9286 * src/tables.c (pack_table): Always create conflict_table.
9287 (token_actions): Always create conflict_list.
9288 * data/glr.c (YYFLAG): Remove, unused.
9290 2002-10-13 Akim Demaille <akim@epita.fr>
9292 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9294 (VALGRIND, GXX): New.
9295 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9296 * tests/bison.in: Run $PREBISON a pre-command.
9297 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9298 (maintainer-check-g++): New.
9299 * Makefile.am (maintainer-check): New.
9301 2002-10-13 Akim Demaille <akim@epita.fr>
9303 * data/glr.c: Formatting changes.
9304 Tweak some trace messages to match yacc.c's.
9306 2002-10-13 Akim Demaille <akim@epita.fr>
9308 GLR parsers sometimes raise parse errors instead of performing the
9310 Reported by Charles-Henry de Boysson.
9312 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
9313 check the length of the traces when %glr.
9314 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9316 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9318 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9319 (yyltype): Remove the yy prefix from the member names.
9320 (yytable): Complete its comment.
9321 (yygetLRActions): Map error action number from YYTABLE from
9323 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9324 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9325 not satisfying as we could compare an YYACTION computed from
9326 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9327 only value for error actions.
9328 (yyreportParseError): In verbose parse error messages, don't issue
9329 `error' in the list of expected tokens.
9330 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9331 next action to perform to match glr.c's decoding.
9332 (yytable): Complete its comment.
9334 2002-10-13 Paul Eggert <eggert@twinsun.com>
9336 Fix problem reported by Henrik Grubbstroem in
9337 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
9338 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9339 because the Bison parser reads the second action before reducing
9341 * src/scan-gram.l (rule_length): New static var.
9342 Use it to keep track of the rule length in the scanner, since
9343 we can't expect the parser to be in lock-step sync with the scanner.
9344 (handle_action_dollar, handle_action_at): Use this var.
9345 * tests/actions.at (Exotic Dollars): Test for the problem.
9347 2002-10-12 Paul Eggert <eggert@twinsun.com>
9349 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9350 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9351 Include <sys/time.h> when checking for clock_t and struct tms.
9352 Use same include order as source.
9353 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
9354 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
9356 * lib/timevar.c: Update copyright date and clarify comments.
9357 (get_time) [IN_GCC]: Keep the GCC version for reference.
9359 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9360 GCC version as of today, then merge Bison's changes.
9361 Change "GCC" to "Bison" in copyright notice. timevar.def's
9362 author is Akim, so change that too.
9364 * src/reader.c (grammar_current_rule_check):
9365 Don't worry about the default action if $$ is untyped.
9366 Prevents bogus warnings reported by Jim Gifford in
9367 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
9369 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9370 * data/glr.c, data/lalr1.cc, data/yacc.c:
9371 Output token definitions before the first part of user declarations.
9372 Fixes compatibility problem reported by Jim Gifford for kbd in
9373 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
9375 2002-10-11 Paul Eggert <eggert@twinsun.com>
9377 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9378 (yyparse): here. This undoes some of the 2002-07-25 change.
9379 Compatibility problem reported by Ralf S. Engelschall with
9380 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9382 2002-10-11 Akim Demaille <akim@epita.fr>
9384 * tests/regression.at Characters Escapes): New.
9385 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9387 Reported by Jan Nieuwenhuizen.
9389 2002-10-11 Akim Demaille <akim@epita.fr>
9393 2002-10-10 Paul Eggert <eggert@twinsun.com>
9395 Portability fixes for bitsets; this also avoids several GCC
9398 * lib/abitset.c: Include <stddef.h>, for offsetof.
9399 * lib/lbitset.c: Likewise.
9401 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9402 properly for vectors of objects. Do not assume that adding a
9403 header size to a multiple of a word size yields a value that is
9404 properly aligned for the whole union.
9405 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9407 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9408 unique names for structures.
9409 * lib/ebitset.c (ebitset_bytes): Likewise.
9410 * lib/lbitset.c (lbitset_bytes): Likewise.
9412 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9413 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9414 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9415 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9416 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9417 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9418 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9419 to improve the type-checking that GCC can do.
9420 * lib/bitset.c (bitset_op4_cmp): Likewise.
9421 * lib/bitset_stats.c (bitset_stats_count,
9422 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9423 bitset_stats_copy, bitset_stats_disjoint_p,
9424 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9425 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9426 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9427 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9428 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9429 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9430 bitset_stats_or_and_cmp): Likewise.
9431 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9432 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9433 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9434 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9436 * lib/abitset.h: Include bitset.h, not bbitset.h.
9437 * lib/ebitset.h: Likewise.
9438 * lib/lbitset.h: Likewise.
9440 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9441 All instances of parameters of type enum bitset_opts are now of
9442 type enum_bitset_opts, to conform to the C Standard, and similarly
9443 for enum_bitset_type.
9444 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9445 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9447 Do not use "struct bitset_struct" to mean different things in
9448 different modules. Not only is this confusing, it violates
9449 the C Standard, which requires that structure types in different
9450 modules must be compatible if one is to be passed to the other.
9451 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9452 All instances of "struct bitset_struct *" replaced with "bitset".
9453 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9454 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9455 struct lbitset_struct, struct bitset_stats_struct): New types.
9456 All uses of struct bitset_struct changed to union bitset_union,
9458 * lib/abitset.c (struct abitset_struct, abitset,
9459 struct bitset_struct): Remove.
9460 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9461 struct bitset_struct): Remove.
9462 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9463 bitset_struct): Remove.
9464 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9467 Do not call a function of type T using a call that assumes the
9468 function is of a different type U. Standard C requires that a
9469 function must be called with a type that is compatible with its
9471 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9473 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9475 * lib/ebitset.c (PFV): Remove.
9476 * lib/lbitset.c (PFV): Likewise.
9477 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9478 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9480 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9481 (ebitset_vtable): Use them.
9482 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9483 lbitset_xor): New functions.
9484 (lbitset_vtable): Use them.
9486 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9489 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9491 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9492 Use offsetof, for simplicity.
9494 2002-10-06 Paul Eggert <eggert@twinsun.com>
9496 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9497 the same width as int. This reapplies a hunk of the 2002-08-12 patch
9498 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
9499 which was inadvertently undone by the 2002-09-30 patch.
9500 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9501 the same width as int.
9503 2002-10-04 Paul Eggert <eggert@twinsun.com>
9507 * configure.ac (AC_INIT), NEWS: Increment version number.
9509 * doc/bison.texinfo: Minor spelling, grammar, and white space
9511 (Symbols): Mention that any negative value returned from yylex
9512 signifies end-of-input. Warn about negative chars. Mention
9513 the portable Standard C character set.
9515 The GNU coding standard says CFLAGS and YFLAGS are reserved
9516 for the installer to set.
9517 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9518 * src/Makefile.am (AM_CFLAGS): Likewise.
9519 (AM_YFLAGS): Renamed from YFLAGS.
9521 Fix some MAX and MIN problems.
9522 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9523 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9524 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9525 * src/reader.c (reader): Use it.
9527 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9528 POSIX 1003.1-2001 has removed fgrep.
9530 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9532 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9533 interpreted as signed.
9534 * lib/ebitset.c (ebitset_list): Fix bug.
9536 2002-10-01 Paul Eggert <eggert@twinsun.com>
9538 More fixes for 64-bit hosts and large bitsets.
9540 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9541 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9542 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9543 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9544 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9545 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9546 bitset_count_): Likewise.
9547 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9548 bitset_first, bitset_last): Likewise.
9549 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9550 bitset_stats_list_reverse, bitset_stats_size,
9551 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9553 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9554 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9555 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9556 bitsetv_reflexive_transitive_closure): Likewise.
9557 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9558 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9560 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9563 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
9564 Use size_t, not unsigned int, to count bytes.
9565 * lib/abitset.h (abitset_bytes): Likewise.
9566 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
9568 * lib/bitset.h (bitset_bytes): Likewise.
9569 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
9570 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
9571 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9572 * lib/ebitset.c (ebitset_bytes): Likewise.
9573 * lib/ebitset.h (ebitset_bytes): Likewise.
9574 * lib/lbitset.c (lbitset_bytes): Likewise.
9575 * lib/lbitset.h (lbitset_bytes): Likewise.
9577 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
9578 abitset_subset_p, abitset_disjoint_p, abitset_and,
9579 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
9580 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
9581 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
9582 abitset_or_and, abitset_or_and_cmp):
9583 Use bitset_windex instead of unsigned int.
9584 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9585 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
9586 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
9587 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
9589 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
9591 * lib/bitset.c (bitset_print):
9592 Use proper printf formats for widths of integer types.
9593 * lib/bitset_stats.c (bitset_percent_histogram_print,
9594 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
9595 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9596 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9597 * lib/lbitset.c (lbitset_bytes): Likewise.
9599 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
9600 BITSET_SIZE_MAX): New macros.
9601 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
9602 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
9603 to BITSET_WINDEX_MAX.
9605 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
9606 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
9607 since we now return the bitset_bindex type (not int).
9609 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9610 when computing sizes.
9611 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9613 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9614 and avoid cast to unsigned.
9616 2002-09-30 Akim Demaille <akim@epita.fr>
9618 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9619 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
9620 Updates from Michael Hayes.
9622 2002-09-30 Art Haas <ahaas@neosoft.com>
9624 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9626 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9629 2002-09-27 Akim Demaille <akim@epita.fr>
9633 2002-09-27 Akim Demaille <akim@epita.fr>
9635 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9636 (Because of AC_LIBSOURCE).
9638 2002-09-27 Akim Demaille <akim@epita.fr>
9640 Playing with Autoscan.
9642 * configure.ac: Remove the old LIBOBJ tweaks.
9643 (AC_REPLACE_FUNCS): Add strrchr and strtol.
9644 * lib/strrchr.c: New.
9645 * lib/strtol.c: New, from the Coreutils 4.5.1.
9647 2002-09-27 Akim Demaille <akim@epita.fr>
9649 Playing with Autoscan.
9651 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
9652 * lib/Makefile.am (libbison_a_SOURCES): No longer include
9653 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
9654 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
9657 2002-09-24 Akim Demaille <akim@epita.fr>
9659 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9660 (Frequently Asked Questions, Parser Stack Overflow): New.
9662 2002-09-13 Akim Demaille <akim@epita.fr>
9664 Playing with autoscan.
9666 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
9667 * src/files.c (skeleton_find): Remove, unused.
9668 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
9669 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
9671 2002-09-13 Akim Demaille <akim@epita.fr>
9673 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9674 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9676 2002-09-13 Akim Demaille <akim@epita.fr>
9678 * configure.ac: Require 2.54.
9679 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
9680 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
9681 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
9682 Remove, provided by Autoconf macros.
9684 2002-09-12 Akim Demaille <akim@epita.fr>
9686 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9688 2002-09-12 Akim Demaille <akim@epita.fr>
9690 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9691 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9692 Reported by Martin Mokrejs.
9694 2002-09-10 Akim Demaille <akim@epita.fr>
9696 * src/parse-gram.y: Associate a human readable string to each
9698 * tests/regression.at (Invalid inputs): Adjust.
9700 2002-09-10 Gary V. Vaughan <gary@gnu.org>
9702 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9703 with an Autoconf-2.5x style configure.ac.
9705 2002-09-06 Paul Eggert <eggert@twinsun.com>
9707 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9708 exception applies only to yacc.c. This is a modification of a
9709 patch originally suggested by Akim Demaille.
9711 2002-09-06 Akim Demaille <akim@epita.fr>
9713 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9715 * data/yacc.c: here.
9717 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9719 (b4_ltype): Default to yy::Location from location.hh.
9721 2002-09-04 Jim Meyering <jim@meyering.net>
9723 * data/yacc.c: Guard the declaration of yytoknum also with
9724 `#ifdef YYPRINT', so it is declared only when used.
9726 2002-09-04 Akim Demaille <akim@epita.fr>
9728 * configure.in: Rename as...
9729 * configure.ac: this.
9732 2002-09-04 Akim Demaille <akim@epita.fr>
9734 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9735 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9736 translate maintainer only messages.
9738 2002-08-12 Paul Eggert <eggert@twinsun.com>
9742 * Makefile.am (SUBDIRS): Remove intl.
9743 (DISTCLEANFILES): Remove.
9744 * NEWS: Mention that GNU M4 is now required. Clarify what is
9745 meant by "larger grammars". Mention the pt_BR translation.
9746 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9747 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9748 Bump version from 0.11.2 to 0.11.5.
9749 (BISON_PREREQ_STAGE): Remove.
9750 (AM_GNU_GETTEXT): Use external gettext.
9751 (AC_OUTPUT): Remove intl/Makefile.
9753 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9755 * data/glr.c: Include string.h, for strlen.
9756 (yyreportParseError): Use size_t for yysize.
9757 (yy_yypstack): No longer nested inside yypstates, as nested
9758 functions are not portable. Do not assume size_t is the
9760 (yypstates): Do not assume that ptrdiff_t is the same width
9761 as int, and similarly for yyposn and YYINDEX.
9763 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9765 * lib/Makefile.am (INCLUDES): Do not include from the intl
9766 directory, which has been removed.
9767 * src/Makefile.am (INCLUDES): Likewise.
9769 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9770 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9773 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9774 * tests/Makefile.am (EXTRA_DIST): Likewise.
9776 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9777 Do not assume that bitset_windex is the same width as unsigned.
9779 * lib/abitset.c (abitset_unused_clear): Do not assume that
9780 bitset_word is the same width as int.
9781 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9782 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9783 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9784 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9785 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9787 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9788 portability to one's complement hosts!).
9789 * lib/ebitset.c (ebitset_op1): Likewise.
9790 * lib/lbitset.c (lbitset_op1): Likewise.
9792 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9793 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9794 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9795 Sync with fileutils.
9796 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9797 lib/gettext.h: Sync with diffutils.
9799 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9800 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9802 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9803 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9806 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9807 size_t; the old version tried to do this but casted improperly.
9808 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9809 (bitset_test): Now returns int, not unsigned long.
9811 * lib/bitset_stats.c: Include "gettext.h".
9813 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9814 name locals "index", as it generates unnecessary warnings on some
9815 hosts that have an "index" function.
9817 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9818 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9819 they need translation.
9820 * src/LR0.c (state_list_append, new_itemsets, get_state,
9821 append_states, generate_states): Likewise.
9822 * src/assoc.c (assoc_to_string): Likewise.
9823 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9824 * src/gram.c (grammar_dump): Likewise.
9825 * src/injections.c (injections_compute): Likewise.
9826 * src/lalr.c (lookaheads_print): Likewise.
9827 * src/relation.c (relation_transpose): Likewise.
9828 * src/scan-gram.l: Likewise.
9829 * src/tables.c (table_grow, pack_vector): Likewise.
9831 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9832 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9833 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9834 * m4/mbstate_t.m4: Sync with fileutils.
9835 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9837 * po/LINGUAS: Add pt_BR.
9838 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9839 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9841 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9843 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9845 * src/complain.c (strerror_r): Remove decl; not needed.
9846 (strerror): Use same pattern as ../lib/error.c.
9848 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9850 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9852 * src/main.c (main): Cast result of bindtextdomain and textdomain
9853 to void, to avoid a GCC warning when --disable-nls is in effect.
9855 * src/scan-gram.l: Use strings rather than escapes when possible,
9856 to minimize the number of warnings from xgettext.
9857 (handle_action_dollar, handle_action_at): Don't use isdigit,
9858 as it mishandles negative chars and it may not work as expected
9859 outside the C locale.
9861 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
9862 this is a GCC extension and is not portable to other compilers.
9864 * src/system.h (alloca): Use same pattern as ../lib/error.c.
9865 Do not include <ctype.h>; no longer needed.
9866 Do not include <malloc.h>; no longer needed (and generates
9867 warnings on OpenBSD 3.0).
9869 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9872 * tests/regression.at: Do not use 'cc -c input.c -o input';
9873 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
9875 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
9876 exit status as failure, not just exit status 1. Sun C exits
9877 with status 2 sometimes.
9879 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9880 Use it for the two large tests.
9882 2002-08-02 Akim Demaille <akim@epita.fr>
9884 * src/conflicts.c (conflicts_output): Don't output rules never
9885 reduced here, since anyway that computation doesn't work.
9886 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
9887 (rule_useless_p, rule_never_reduced_p): New.
9888 (grammar_rules_partial_print): Use a filter instead of a range.
9889 Display the title only if needed.
9890 (grammar_rules_print): Adjust.
9891 (grammar_rules_never_reduced_report): New.
9892 * src/tables.c (action_row): Move the computation of rules never
9894 (token_actions): here.
9895 * src/main.c (main): Make the parser before making the report, so
9896 that rules never reduced are computed.
9897 Call grammar_rules_never_reduced_report.
9898 * src/print.c (print_results): Report rules never reduced.
9899 * tests/conflicts.at, tests/reduce.at: Adjust.
9901 2002-08-01 Akim Demaille <akim@epita.fr>
9903 Instead of attaching lookaheads and duplicating the rules being
9904 reduced by a state, attach the lookaheads to the reductions.
9906 * src/state.h (state_t): Remove the `lookaheads',
9907 `lookaheads_rule' member.
9908 (reductions_t): Add a `lookaheads' member.
9909 Use a regular array for the `rules'.
9910 * src/state.c (reductions_new): Initialize the lookaheads member
9912 (state_rule_lookaheads_print): Adjust.
9913 * src/state.h, src/state.c (state_reductions_find): New.
9914 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
9915 (count_rr_conflicts): Adjust.
9916 * src/lalr.c (LArule): Remove.
9917 (add_lookback_edge): Adjust.
9918 (state_lookaheads_count): New.
9919 (states_lookaheads_initialize): Merge into...
9920 (initialize_LA): this.
9921 (lalr_free): Adjust.
9922 * src/main.c (main): Don't free nullable and derives too early: it
9923 is used by --verbose.
9924 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
9926 2002-08-01 Akim Demaille <akim@epita.fr>
9928 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9930 (set_derives, free_derives): Rename as...
9931 (derives_compute, derives_free): this.
9932 Adjust all dependencies.
9933 * src/nullable.c (set_nullable, free_nullable): Rename as...
9934 (nullable_compute, nullable_free): these.
9935 (rule_list_t): Store rule_t *, not rule_number_t.
9936 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9937 pointers, instead of their numbers.
9938 * src/main.c (main): Call nullable_free, and derives_free earlier,
9939 as they were lo longer used.
9941 2002-08-01 Akim Demaille <akim@epita.fr>
9943 * lib/timevar.c (get_time): Include children time.
9944 * src/lalr.h (LA, LArule): Don't export them: used with the
9946 * src/lalr.c (LA, LArule): Static.
9947 * src/lalr.h, src/lalr.c (lalr_free): New.
9948 * src/main.c (main): Call it.
9949 * src/tables.c (pack_vector): Check whether loc is >= to the
9951 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9952 (tables_generate): do it, since that's also it which allocates
9954 Don't free LA and LArule, main does.
9956 2002-07-31 Akim Demaille <akim@epita.fr>
9958 Separate parser tables computation and output.
9960 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9961 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9962 (yydefgoto, yydefact, high): Move to...
9963 * src/tables.h, src/tables.c: here.
9964 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9965 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9966 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9967 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
9968 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
9969 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
9970 (action_row, save_row, token_actions, save_column, default_goto)
9971 (goto_actions, sort_actions, matching_state, pack_vector)
9972 (table_ninf_remap, pack_table, prepare_actions): Move to...
9973 * src/tables.c: here.
9974 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
9975 * src/output.c (token_actions, output_base, output_conflicts)
9976 (output_check): Merge into...
9977 (prepare_actions): this.
9978 (actions_output): Rename as...
9979 (user_actions_output): this.
9980 * src/main.c (main): Call tables_generate and tables_free.
9982 2002-07-31 Akim Demaille <akim@epita.fr>
9984 Steal GCC's --time-report support.
9986 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
9987 stolen/adjusted from GCC.
9988 * m4/stage.m4: Remove time related checks.
9989 * m4/timevar.m4: New.
9990 * configure.in: Adjust.
9991 * src/system.h: Adjust to using timevar.h.
9992 * src/getargs.h, src/getargs.c: Support trace_time for
9994 * src/main.c (stage): Remove.
9995 (main): Replace `stage' invocations with timevar calls.
9996 * src/output.c: Insert pertinent timevar calls.
9998 2002-07-31 Akim Demaille <akim@epita.fr>
10000 Let --trace have arguments.
10002 * src/getargs.h (enum trace_e): New.
10003 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10004 (long_options, short_options): --trace/-T takes an optional
10006 Change all the uses of trace_flag to reflect the new flags.
10007 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10009 Strengthen `stage' portability.
10011 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10012 * configure.in: Use it.
10013 Don't check for malloc.h and sys/times.h.
10014 * src/system.h: Include them when appropriate.
10015 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10016 times and struct tms are available.
10018 2002-07-30 Akim Demaille <akim@epita.fr>
10020 In verbose parse error message, don't report `error' as an
10022 * tests/actions.at (Printers and Destructors): Adjust.
10023 * tests/calc.at (Calculator $1): Adjust.
10024 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10025 error message, do not report the parser accepts the error token in
10028 2002-07-30 Akim Demaille <akim@epita.fr>
10030 Normalize conflict related messages.
10032 * src/complain.h, src/complain.c (warn, complain): New.
10033 * src/conflicts.c (conflicts_print): Use them.
10034 (conflict_report_yacc): New, extracted from...
10035 (conflicts_print): here.
10036 * tests/conflicts.at, tests/existing.at: Adjust.
10038 2002-07-30 Akim Demaille <akim@epita.fr>
10040 Report rules which are never reduced by the parser: those hidden
10043 * src/LR0.c (save_reductions): Don't make the final state too
10044 different: save its reduction (accept) instead of having a state
10045 without any action (no shift or goto, no reduce).
10046 Note: the final state is now a ``regular'' state, i.e., the
10047 parsers now contain `reduce 0' as default reduction.
10048 Nevertheless, since they decide to `accept' when yystate =
10049 final_state, they still will not reduce rule 0.
10050 * src/print.c (print_actions, print_reduction): Adjust.
10051 * src/output.c (action_row): Track reduced rules.
10052 (token_actions): Report rules never reduced.
10053 * tests/conflicts.at, tests/regression.at: Adjust.
10055 2002-07-30 Akim Demaille <akim@epita.fr>
10057 `stage' was accidently included in a previous patch.
10058 Initiate its autoconfiscation.
10060 * configure.in: Look for malloc.h and sys/times.h.
10061 * src/main.c (stage): Adjust.
10062 Report only when trace_flag.
10064 2002-07-29 Akim Demaille <akim@epita.fr>
10066 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10068 (errs_t): symbol_t*, not symbol_number_t.
10069 (reductions_t): rule_t*, not rule_number_t.
10070 (FOR_EACH_SHIFT): New.
10071 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10072 * src/print.c, src/print_graph.c: Adjust.
10074 2002-07-29 Akim Demaille <akim@epita.fr>
10076 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10078 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10079 (endtoken, accept): these.
10080 * src/reader.c (reader): Set endtoken's default tag to "$end".
10081 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10082 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10085 2002-07-29 Akim Demaille <akim@epita.fr>
10087 * src/reduce.c (reduce_grammar): When the language is empty,
10088 complain about the start symbol, not the axiom.
10090 * tests/reduce.at (Empty Language): New.
10092 2002-07-26 Akim Demaille <akim@epita.fr>
10094 * src/reader.h, src/reader.c (gram_error): ... can't get
10095 yycontrol without making too strong assumptions on the parser
10097 * src/output.c (prepare_tokens): Use the real 0th value of
10098 token_translations instead of `0'.
10099 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10101 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10102 for the time being: %locations ought to provide it to yyerror.
10104 2002-07-25 Akim Demaille <akim@epita.fr>
10106 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10107 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10108 * tests/regression.at (Web2c Actions): Adjust.
10110 2002-07-25 Akim Demaille <akim@epita.fr>
10112 Stop storing rules from 1 to nrules + 1.
10114 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10115 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10116 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10117 Iterate from 0 to nrules.
10118 Use rule_number_as_item_number and item_number_as_rule_number.
10119 Adjust to `derive' now containing possibly 0.
10120 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10121 Handle the `- 1' part in rule numbers from/to item numbers.
10122 * src/conflicts.c (log_resolution): Fix the message which reversed
10124 * src/output.c (action_row): Initialize default_rule to -1.
10125 (token_actions): Adjust.
10126 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10128 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10130 2002-07-25 Akim Demaille <akim@epita.fr>
10132 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10133 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10134 (b4_c_knr_arg_decl): New.
10135 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10136 yyreport_parse_error.
10138 2002-07-25 Akim Demaille <akim@epita.fr>
10140 * data/yacc.c (yyreport_parse_error): New, extracted from...
10142 (yydestruct, yysymprint): Move above yyparse.
10145 2002-07-25 Akim Demaille <akim@epita.fr>
10147 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10149 (b4_sint_type, b4_uint_type): these.
10150 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10151 * tests/regression.at (Web2c Actions): Adjust.
10153 2002-07-25 Akim Demaille <akim@epita.fr>
10155 * src/gram.h (TIEM_NUMBER_MAX): New.
10156 (item_number_of_rule_number, rule_number_of_item_number): Rename
10158 (rule_number_as_item_number, item_number_as_rule_number): these.
10159 Adjust dependencies.
10160 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10161 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10162 (symbol_number_to_vector_number): New.
10163 (order): Of vector_number_t* type.
10164 (base_t, BASE_MAX, BASE_MIN): New.
10165 (froms, tos, width, pos, check): Of base_t type.
10166 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10167 (actrow): Of action_number_t type.
10168 (conflrow): Of unsigned int type.
10169 (table_ninf, base_ninf): New.
10170 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10171 (muscle_insert_int_table, muscle_insert_base_table)
10172 (muscle_insert_rule_number_table): New.
10173 (prepare_tokens): Output `toknum' as int_table.
10174 (action_row): Returns a rule_number_t.
10175 Use ACTION_MIN, not SHRT_MIN.
10176 (token_actions): yydefact is rule_number_t*.
10177 (table_ninf_remap): New.
10178 (pack_table): Use it for `base' and `table'.
10179 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10181 (YYPACT_NINF, YYTABLE_NINF): these.
10182 (yypact, yytable): Compute their types instead of hard-coded
10184 * tests/regression.at (Web2c Actions): Adjust.
10186 2002-07-19 Akim Demaille <akim@epita.fr>
10188 * src/scan-gram.l (id): Can start with an underscore.
10190 2002-07-16 Akim Demaille <akim@epita.fr>
10192 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10193 Adjust all former `associativity' dependencies.
10194 * src/symtab.c (symbol_new): Default associativity is `undef', not
10196 (symbol_check_alias_consistence): Adjust.
10198 2002-07-09 Akim Demaille <akim@epita.fr>
10200 * doc/bison.texinfo: Properly set the ``header'' part.
10201 Use @dircategory ``GNU programming tools'' as per Texinfo's
10205 2002-07-09 Akim Demaille <akim@epita.fr>
10207 * lib/quotearg.h: Protect against multiple inclusions.
10208 * src/location.h (location_t): Add a `file' member.
10209 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10210 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10211 `error_one_per_line' support.
10213 2002-07-09 Akim Demaille <akim@epita.fr>
10215 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10216 * src/reader.c (lineno): Remove.
10217 Adjust all dependencies.
10218 (get_merge_function): Take a location and use complain_at.
10219 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10220 * tests/regression.at (Invalid inputs, Mixing %token styles):
10223 2002-07-09 Akim Demaille <akim@epita.fr>
10225 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10226 recovery rule, and forbid extensions when --yacc.
10227 (gram_error): Use complain_at.
10228 * src/reader.c (reader): Exit if there were parse errors.
10230 2002-07-09 Akim Demaille <akim@epita.fr>
10232 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10233 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10234 Reported by R Blake <blakers@mac.com>.
10236 2002-07-09 Akim Demaille <akim@epita.fr>
10238 * data/yacc.c: Output the copyright notive in the header.
10240 2002-07-03 Akim Demaille <akim@epita.fr>
10242 * src/output.c (froms, tos): Are state_number_t.
10243 (save_column): sp, sp1, and sp2 are state_number_t.
10244 (prepare): Rename `final' as `final_state_number', `nnts' as
10245 `nterms_number', `nrules' as `rules_number', `nstates' as
10246 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10248 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10249 * data/lalr1.cc (nsym_): Remove, unused.
10251 2002-07-03 Akim Demaille <akim@epita.fr>
10253 * src/lalr.h, src/lalr.c (goto_number_t): New.
10254 * src/lalr.c (goto_list_t): New.
10256 * src/nullable.c (rule_list_t): New.
10258 * src/types.h: Remove.
10260 2002-07-03 Akim Demaille <akim@epita.fr>
10262 * src/closure.c (print_fderives): Use rule_rhs_print.
10263 * src/derives.c (print_derives): Use rule_rhs_print.
10264 (rule_list_t): New, replaces `shorts'.
10265 (set_derives): Add comments.
10266 * tests/sets.at (Nullable, Firsts): Adjust.
10268 2002-07-03 Akim Demaille <akim@epita.fr>
10270 * src/output.c (prepare_actions): Free `tally' and `width'.
10271 (prepare_actions): Allocate and free `order'.
10272 * src/symtab.c (symbols_free): Free `symbols'.
10273 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10274 * src/output.c (m4_invoke): Move to...
10275 * src/scan-skel.l: here.
10276 (<<EOF>>): Close yyout, and free its name.
10278 2002-07-03 Akim Demaille <akim@epita.fr>
10280 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10282 * src/LR0.c (new_state): Merge into...
10283 (state_list_append): this.
10284 (new_states): Merge into...
10285 (generate_states): here.
10286 (set_states): Don't ensure a proper `errs' state member here, do it...
10287 * src/conflicts.c (conflicts_solve): here.
10288 * src/state.h, src/state.c: Comment changes.
10289 (state_t): Rename member `shifts' as `transitions'.
10290 Adjust all dependencies.
10291 (errs_new): For consistency, also take the values as argument.
10292 (errs_dup): Remove.
10293 (state_errs_set): New.
10294 (state_reductions_set, state_transitions_set): Assert that no
10295 previous value was assigned.
10297 (states_free): Use it.
10298 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10299 temporary storage: use `errs' and `nerrs' as elsewhere.
10300 (set_conflicts): Allocate and free this `errs'.
10302 2002-07-02 Akim Demaille <akim@epita.fr>
10304 * lib/libiberty.h: New.
10305 * lib: Update the bitset implementation from upstream.
10306 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10307 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10308 * src/main.c: Adjust bitset stats calls.
10310 2002-07-01 Paul Eggert <eggert@twinsun.com>
10312 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10313 char, so that negative chars don't collide with $.
10315 2002-06-30 Akim Demaille <akim@epita.fr>
10317 Have the GLR tests be `warning' checked, and fix the warnings.
10319 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10320 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10321 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10322 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10323 (yyaddDeferredAction): static.
10324 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10325 (yyreportParseError): yyprefix is const.
10326 yytokenp is used only when verbose.
10327 (yy__GNUC__): Replace with __GNUC__.
10328 (yypdumpstack): yyi is size_t.
10329 (yypreference): Un-yy local variables and arguments, to avoid
10330 clashes with `yyr1'. Anyway, we are not in the user name space.
10331 (yytname_size): be an int, as is compared with ints.
10332 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10334 * tests/cxx-gram.at: Use quotation to protect $1.
10335 Use AT_COMPILE to enable warnings hunts.
10336 Prototype yylex and yyerror.
10338 Include `string.h', not `strings.h'.
10339 Produce and prototype stmtMerge only when used.
10340 yylex takes a location.
10342 2002-06-30 Akim Demaille <akim@epita.fr>
10344 We spend a lot of time in quotearg, in particular when --verbose.
10346 * src/symtab.c (symbol_get): Store a quoted version of the key.
10347 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10348 Adjust all callers.
10350 2002-06-30 Akim Demaille <akim@epita.fr>
10352 * src/state.h (reductions_t): Rename member `nreds' as num.
10353 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10354 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10356 2002-06-30 Akim Demaille <akim@epita.fr>
10358 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10359 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10360 (shifts_to): Rename as...
10361 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10362 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10363 (TRANSITION_IS_DISABLED, transitions_to): these.
10365 2002-06-30 Akim Demaille <akim@epita.fr>
10367 * src/print.c (print_shifts, print_gotos): Merge into...
10368 (print_transitions): this.
10369 (print_transitions, print_errs, print_reductions): Align the
10370 lookaheads columns.
10371 (print_core, print_transitions, print_errs, print_state,
10372 print_grammar): Output empty lines separator before, not after.
10373 (state_default_rule_compute): Rename as...
10374 (state_default_rule): this.
10375 * tests/conflicts.at (Defaulted Conflicted Reduction),
10376 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10377 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10379 2002-06-30 Akim Demaille <akim@epita.fr>
10381 Display items as we display rules.
10383 * src/gram.h, src/gram.c (rule_lhs_print): New.
10384 * src/gram.c (grammar_rules_partial_print): Use it.
10385 * src/print.c (print_core): Likewise.
10386 * tests/conflicts.at (Defaulted Conflicted Reduction),
10387 (Unresolved SR Conflicts): Adjust.
10388 (Unresolved SR Conflicts): Adjust and rename as...
10389 (Resolved SR Conflicts): this, as was meant.
10390 * tests/regression.at (Web2c Report): Adjust.
10392 2002-06-30 Akim Demaille <akim@epita.fr>
10394 * src/print.c (state_default_rule_compute): New, extracted from...
10395 (print_reductions): here.
10396 Pessimize, but clarify the code.
10397 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10399 2002-06-30 Akim Demaille <akim@epita.fr>
10401 * src/output.c (action_row): Let default_rule be always a rule
10404 2002-06-30 Akim Demaille <akim@epita.fr>
10406 * src/closure.c (print_firsts, print_fderives, closure):
10407 Use BITSET_EXECUTE.
10408 * src/lalr.c (lookaheads_print): Likewise.
10409 * src/state.c (state_rule_lookaheads_print): Likewise.
10410 * src/print_graph.c (print_core): Likewise.
10411 * src/print.c (print_reductions): Likewise.
10412 * src/output.c (action_row): Likewise.
10413 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10415 2002-06-30 Akim Demaille <akim@epita.fr>
10417 * src/print_graph.c: Use report_flag.
10419 2002-06-30 Akim Demaille <akim@epita.fr>
10421 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10423 * src/relation.h, src/relation.c (traverse, relation_digraph)
10424 (relation_print, relation_transpose): New.
10426 2002-06-30 Akim Demaille <akim@epita.fr>
10428 * src/state.h, src/state.c (shifts_to): New.
10429 * src/lalr.c (build_relations): Use it.
10431 2002-06-30 Akim Demaille <akim@epita.fr>
10433 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10434 (item_number_of_rule_number, rule_number_of_item_number): New.
10435 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10436 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10437 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10438 Propagate their use.
10439 Much remains to be done, in particular wrt `shorts' from types.h.
10441 2002-06-30 Akim Demaille <akim@epita.fr>
10443 * src/symtab.c (symbol_new): Initialize the `printer' member.
10445 2002-06-30 Akim Demaille <akim@epita.fr>
10447 * src/LR0.c (save_reductions): Remove, replaced by...
10448 * src/state.h, src/state.c (state_reductions_set): New.
10449 (reductions, errs): Rename as...
10450 (reductions_t, errs_t): these.
10451 Adjust all dependencies.
10453 2002-06-30 Akim Demaille <akim@epita.fr>
10455 * src/LR0.c (state_list_t, state_list_append): New.
10456 (first_state, last_state): Now symbol_list_t.
10457 (this_state): Remove.
10458 (new_itemsets, append_states, save_reductions): Take a state_t as
10460 (set_states, generate_states): Adjust.
10461 (save_shifts): Remove, replaced by...
10462 * src/state.h, src/state.c (state_shifts_set): New.
10463 (shifts): Rename as...
10465 Adjust all dependencies.
10466 * src/state.h (state_t): Remove the `next' member.
10468 2002-06-30 Akim Demaille <akim@epita.fr>
10470 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10473 2002-06-30 Akim Demaille <akim@epita.fr>
10475 Use hash.h for the state hash table.
10477 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10478 (allocate_storage): Use state_hash_new.
10479 (free_storage): Use state_hash_free.
10480 (new_state, get_state): Adjust.
10481 * src/lalr.h, src/lalr.c (states): Move to...
10482 * src/states.h (state_t): Remove the `link' member, no longer
10484 * src/states.h, src/states.c: here.
10485 (state_hash_new, state_hash_free, state_hash_lookup)
10486 (state_hash_insert, states_free): New.
10487 * src/states.c (state_table, state_compare, state_hash): New.
10488 * src/output.c (output_actions): Do not free states now, since we
10489 still need to know the final_state number in `prepare', called
10490 afterwards. Do it...
10491 * src/main.c (main): here: call states_free after `output'.
10493 2002-06-30 Akim Demaille <akim@epita.fr>
10495 * src/state.h, src/state.c (state_new): New, extracted from...
10496 * src/LR0.c (new_state): here.
10497 * src/state.h (STATE_ALLOC): Move to...
10498 * src/state.c: here.
10499 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10500 * src/state.h, src/state.c: here.
10502 2002-06-30 Akim Demaille <akim@epita.fr>
10504 * src/reader.c (gensym): Rename as...
10505 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10506 (getsym): Rename as...
10507 (symbol_get): this.
10509 2002-06-30 Akim Demaille <akim@epita.fr>
10511 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10512 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10513 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10514 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10516 2002-06-30 Akim Demaille <akim@epita.fr>
10518 Make the test suite pass with warnings checked.
10520 * tests/actions.at (Printers and Destructors): Improve.
10521 Avoid unsigned vs. signed issues.
10522 * tests/calc.at: Don't exercise the scanner here, do it...
10523 * tests/input.at (Torturing the Scanner): here.
10525 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10527 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
10528 reorganize first lines parallel to yacc.c.
10530 2002-06-28 Akim Demaille <akim@epita.fr>
10532 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10533 (b4_token_enum, b4_token_defines): New, factored from...
10534 * data/lalr1.cc, data/yacc.c, glr.c: here.
10536 2002-06-28 Akim Demaille <akim@epita.fr>
10538 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10540 * src/output.c (merger_output): static.
10542 2002-06-28 Akim Demaille <akim@epita.fr>
10544 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
10545 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10547 * src/output.c (save_row): Initialize all the variables to pacify GCC.
10549 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10551 Accumulated changelog for new GLR parsing features.
10553 * src/conflicts.c (count_total_conflicts): Change name to
10554 conflicts_total_count.
10555 * src/conflicts.h: Ditto.
10556 * src/output.c (token_actions): Use the new name.
10557 (output_conflicts): Change conflp => conflict_list_heads, and
10558 confl => conflict_list for better readability.
10559 * data/glr.c: Use the new names.
10560 * NEWS: Add self to GLR announcement.
10562 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10564 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10567 * data/bison.glr: Change name to glr.c
10568 * data/glr.c: Renamed from bison.glr.
10569 * data/Makefile.am: Add glr.c
10573 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
10574 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
10576 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10578 * data/bison.glr: Be sure to restore the
10579 current #line when returning to the skeleton contents after having
10580 exposed the input file's #line.
10582 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10584 * data/bison.glr: Bring up to date with changes to bison.simple.
10586 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10588 * data/bison.glr: Correct definitions that use b4_prefix.
10589 Various reformatting.
10590 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
10591 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
10592 yytokenp argument; now part of stack.
10593 (yychar): Define to behave as documented.
10594 (yyclearin): Ditto.
10596 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10598 * src/reader.h: Add declaration for free_merger_functions.
10600 * src/reader.c (merge_functions): New variable.
10601 (get_merge_function): New function.
10602 (free_merger_functions): New function.
10603 (readgram): Check for %prec that is not followed by a symbol.
10604 Handle %dprec and %merge declarations.
10605 (packgram): Initialize dprec and merger fields in rules array.
10607 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
10608 conflict_list_cnt, conflict_list_free): New variables.
10609 (table_grow): Also grow conflict_table.
10610 (prepare_rules): Output dprec and merger tables.
10611 (conflict_row): New function.
10612 (action_row): Output conflict lists for GLR parser. Don't use
10613 default reduction in conflicted states for GLR parser so that there
10614 are spaces for the conflict lists.
10615 (save_row): Also save conflict information.
10616 (token_actions): Allocate conflict list.
10617 (merger_output): New function.
10618 (pack_vector): Pack conflict table, too.
10619 (output_conflicts): New function to output yyconflp and yyconfl.
10620 (output_check): Allocate conflict_tos.
10621 (output_actions): Output conflict tables, also.
10622 (output_skeleton): Output b4_mergers definition.
10623 (prepare): Output b4_max_rhs_length definition.
10624 Use 'bison.glr' as default skeleton for GLR parsers.
10626 * src/gram.c (glr_parser): New flag.
10627 (grammar_free): Call free_merger_functions.
10629 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
10630 all pairs of conflicting reductions, rather than just all tokens
10631 causing conflicts. Needed to size conflict tables.
10632 (conflicts_output): Modify call to count_rr_conflicts for new
10634 (conflicts_print): Ditto.
10635 (count_total_conflicts): New function.
10637 * src/reader.h (merger_list): New type.
10638 (merge_functions): New variable.
10640 * src/lex.h (tok_dprec, tok_merge): New token types.
10642 * src/gram.h (rule_s): Add dprec and merger fields.
10643 (glr_parser): New flag.
10645 * src/conflicts.h (count_total_conflicts): New function.
10647 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10649 * doc/bison.texinfo (Generalized LR Parsing): New section.
10650 (GLR Parsers): New section.
10651 (Language and Grammar): Mention GLR parsing.
10652 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
10653 Correct typo ("tge" -> "the").
10655 * data/bison.glr: New skeleton for GLR parsing.
10657 * tests/cxx-gram.at: New tests for GLR parsing.
10659 * tests/testsuite.at: Include cxx-gram.at.
10661 * tests/Makefile.am: Add cxx-gram.at.
10663 * src/parse-gram.y:
10665 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10667 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
10669 2002-06-27 Akim Demaille <akim@epita.fr>
10671 * src/options.h, src/options.c: Remove.
10672 * src/getargs.c (short_options, long_options): New.
10674 2002-06-27 Akim Demaille <akim@epita.fr>
10676 * data/bison.simple, data/bison.c++: Rename as...
10677 * data/yacc.c, data/lalr1.cc: these.
10678 * doc/bison.texinfo (Environment Variables): Remove.
10680 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10682 * src/getargs.c (report_argmatch): Initialize strtok().
10684 2002-06-20 Akim Demaille <akim@epita.fr>
10686 * data/bison.simple (b4_symbol_actions): New, replaces...
10687 (b4_symbol_destructor, b4_symbol_printer): these.
10688 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10689 user token numbers.
10691 2002-06-20 Akim Demaille <akim@epita.fr>
10693 * data/bison.simple (yydestructor): Rename as...
10694 (yydestruct): this.
10696 2002-06-20 Akim Demaille <akim@epita.fr>
10698 * src/symtab.h, src/symtab.c (symbol_type_set)
10699 (symbol_destructor_set, symbol_precedence_set): The location is
10701 Adjust all callers.
10703 2002-06-20 Akim Demaille <akim@epita.fr>
10705 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10707 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10709 * src/symtab.h, src/symtab.c (symbol_class_set)
10710 (symbol_user_token_number_set): Likewise.
10711 Adjust all callers.
10712 Promote complain_at.
10713 * tests/input.at (Type Clashes): Adjust.
10715 2002-06-20 Akim Demaille <akim@epita.fr>
10717 * data/bison.simple (YYLEX): Fix the declaration when
10720 2002-06-20 Akim Demaille <akim@epita.fr>
10722 * data/bison.simple (yysymprint): Don't print the token number,
10724 * tests/actions.at (Destructors): Rename as...
10725 (Printers and Destructors): this.
10726 Also exercise %printer.
10728 2002-06-20 Akim Demaille <akim@epita.fr>
10730 * data/bison.simple (YYDSYMPRINT): New.
10731 Use it to remove many of the #if YYDEBUG/if (yydebug).
10733 2002-06-20 Akim Demaille <akim@epita.fr>
10735 * src/symtab.h, src/symtab.c (symbol_t): printer and
10736 printer_location are new members.
10737 (symbol_printer_set): New.
10738 * src/parse-gram.y (PERCENT_PRINTER): New token.
10739 Handle its associated rule.
10740 * src/scan-gram.l: Adjust.
10741 (handle_destructor_at, handle_destructor_dollar): Rename as...
10742 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10743 * src/output.c (symbol_printers_output): New.
10744 (output_skeleton): Call it.
10745 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10746 since there are already many grammar files with a user `yyprint'.
10747 Replace the calls to YYPRINT to calls to yysymprint.
10748 * tests/calc.at: Adjust.
10749 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10750 taking advantage of parser very internal details (stack size!).
10752 2002-06-20 Akim Demaille <akim@epita.fr>
10754 * src/scan-gram.l: Complete the scanner with the missing patterns
10756 Use `quote' and `symbol_tag_get' where appropriate.
10758 2002-06-19 Akim Demaille <akim@epita.fr>
10760 * tests/actions.at (Destructors): Augment to test locations.
10761 * data/bison.simple (yydestructor): Pass it the current location
10762 if locations are enabled.
10763 Prototype only when __STDC__ or C++.
10764 Change the argument names to move into the yy name space: there is
10767 2002-06-19 Akim Demaille <akim@epita.fr>
10769 * data/bison.simple (b4_pure_if): New.
10770 Use it instead of #ifdef YYPURE.
10772 2002-06-19 Akim Demaille <akim@epita.fr>
10774 * data/bison.simple (b4_location_if): New.
10775 Use it instead of #ifdef YYLSP_NEEDED.
10777 2002-06-19 Akim Demaille <akim@epita.fr>
10779 Prepare @$ in %destructor, but currently don't bind it in the
10780 skeleton, as %location use is not cleaned up yet.
10782 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10783 (handle_action_at): New.
10784 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10785 a braced_code_t and a location as additional arguments.
10786 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10787 unquote one when outputting `b4_dollar_dollar'.
10789 * data/bison.simple (b4_eval): Remove.
10790 (b4_symbol_destructor): Adjust.
10791 * tests/input.at (Invalid @n): Adjust.
10793 2002-06-19 Zack Weinberg <zack@codesourcery.com>
10795 * doc/bison.texinfo: Document ability to have multiple
10798 2002-06-18 Akim Demaille <akim@epita.fr>
10800 * src/files.c (compute_base_names): When computing the output file
10801 names from the input file name, strip the directory part.
10803 2002-06-18 Akim Demaille <akim@epita.fr>
10805 * data/bison.simple.new: Comment changes.
10806 Reported by Andreas Schwab.
10808 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10810 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10811 there are no `label `yyoverflowlab' defined but not used' warnings
10812 when yyoverflow is defined.
10814 2002-06-18 Akim Demaille <akim@epita.fr>
10816 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10818 (symbol_destructor_set): Adjust.
10819 * src/output.c (symbol_destructors_output): Output the destructor
10821 Output the symbol name.
10822 * data/bison.simple (b4_symbol_destructor): Adjust.
10824 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10825 and Akim Demaille <akim@epita.fr>
10827 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10828 what's left on the stack when the error recovery hits EOF.
10829 * tests/actions.at (Destructors): Complete to exercise this case.
10831 2002-06-17 Akim Demaille <akim@epita.fr>
10833 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10834 arguments is really empty, not only equal to `[]'.
10835 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10837 (symbol_destructor_set): New.
10838 * src/output.c (symbol_destructors_output): New.
10839 * src/reader.h (brace_code_t, current_braced_code): New.
10840 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10841 (handle_dollar): Rename as...
10842 (handle_action_dollar): this.
10843 (handle_destructor_dollar): New.
10844 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10845 (grammar_declaration): Use it.
10846 * data/bison.simple (yystos): Is always defined.
10847 (yydestructor): New.
10848 * tests/actions.at (Destructors): New.
10849 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10851 2002-06-17 Akim Demaille <akim@epita.fr>
10853 * src/symlist.h, src/symlist.c (symbol_list_length): New.
10854 * src/scan-gram.l (handle_dollar, handle_at): Compute the
10855 rule_length only when needed.
10856 * src/output.c (actions_output, token_definitions_output): Output
10858 * src/symtab.c: Don't access directly to the symbol tag, use
10860 * src/parse-gram.y: Use symbol_list_free.
10862 2002-06-17 Akim Demaille <akim@epita.fr>
10864 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
10865 (symbol_list_prepend, get_type_name): Move to...
10866 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
10867 (symbol_list_prepend, symbol_list_n_type_name_get): here.
10868 Adjust all callers.
10869 (symbol_list_free): New.
10870 * src/scan-gram.l (handle_dollar): Takes a location.
10871 * tests/input.at (Invalid $n): Adjust.
10873 2002-06-17 Akim Demaille <akim@epita.fr>
10875 * src/reader.h, src/reader.c (symbol_list_new): Export it.
10876 (symbol_list_prepend): New.
10877 * src/parse-gram.y (%union): `list' is a new member.
10878 (symbols.1): New, replaces...
10879 (terms_to_prec.1, nterms_to_type.1): these.
10880 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
10881 Take a location as additional argument.
10882 Adjust all callers.
10884 2002-06-15 Akim Demaille <akim@epita.fr>
10886 * src/parse-gram.y: Move %token in the declaration section so that
10887 we don't depend upon CVS Bison.
10889 2002-06-15 Akim Demaille <akim@epita.fr>
10891 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10892 * src/print.c (print_core): Use it.
10894 2002-06-15 Akim Demaille <akim@epita.fr>
10896 * src/conflicts.c (log_resolution): Accept the rule involved in
10897 the sr conflicts instead of the lookahead number that points to
10899 (flush_reduce): Accept the current lookahead vector as argument,
10900 instead of the index in LA.
10901 (resolve_sr_conflict): Accept the current number of lookahead
10902 bitset to consider for the STATE, instead of the index in LA.
10903 (set_conflicts): Adjust.
10904 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
10906 2002-06-15 Akim Demaille <akim@epita.fr>
10908 * src/state.h (state_t): Replace the `lookaheadsp' member, a
10909 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
10910 Adjust all dependencies.
10911 * src/lalr.c (initialize_lookaheads): Split into...
10912 (states_lookaheads_count, states_lookaheads_initialize): these.
10915 2002-06-15 Akim Demaille <akim@epita.fr>
10917 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10919 (grammar_rules_print): here.
10920 * src/reduce.c (reduce_output): Use it.
10921 * tests/reduce.at (Useless Rules, Reduced Automaton)
10922 (Underivable Rules): Adjust.
10924 2002-06-15 Akim Demaille <akim@epita.fr>
10926 Copy BYacc's nice way to report the grammar.
10928 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10930 Don't print the rules' location, it is confusing and useless.
10931 (rule_print): Use grammar_rhs_print.
10932 * src/print.c (print_grammar): Use grammar_rules_print.
10934 2002-06-15 Akim Demaille <akim@epita.fr>
10936 Complete and rationalize `useless thing' warnings.
10938 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10939 (symbol_tag_print): New.
10940 Use them everywhere in place of accessing directly the tag member.
10941 * src/gram.h, src/gram.c (rule_print): New.
10942 Use it where a rule used to be printed `by hand'.
10943 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10944 (reduce_grammar_tables): Report the useless rules.
10945 (reduce_print): Useless things are a warning, not an error.
10947 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10948 (Reduced Automaton, Underivable Rules): Adjust.
10949 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10950 * tests/conflicts.at (Unresolved SR Conflicts)
10951 (Solved SR Conflicts): Adjust.
10953 2002-06-15 Akim Demaille <akim@epita.fr>
10955 Let symbols have a location.
10957 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10959 Adjust all callers.
10960 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10961 Use location_t, not int.
10962 * src/symtab.c (symbol_check_defined): Take advantage of the
10964 * tests/regression.at (Invalid inputs): Adjust.
10966 2002-06-15 Akim Demaille <akim@epita.fr>
10968 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10969 (input): Don't try to initialize yylloc here, do it in the
10971 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
10972 * src/gram.h (rule_t): Change line and action_line into location
10973 and action_location, of location_t type.
10974 Adjust all dependencies.
10975 * src/location.h, src/location.c (empty_location): New.
10976 * src/reader.h, src/reader.c (grammar_start_symbol_set)
10977 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
10978 (grammar_current_rule_symbol_append)
10979 (grammar_current_rule_action_append): Expect a location as argument.
10980 * src/reader.c (grammar_midrule_action): Adjust to attach an
10981 action's location as dummy symbol location.
10982 * src/symtab.h, src/symtab.c (startsymbol_location): New.
10983 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
10986 2002-06-14 Akim Demaille <akim@epita.fr>
10988 Grammar declarations may be found in the grammar section.
10990 * src/parse-gram.y (rules_or_grammar_declaration): New.
10991 (declarations): Each declaration may end with a semicolon, not
10993 (grammar_declaration): `"%union"'.
10994 (grammar): Branch to rules_or_grammar_declaration.
10996 2002-06-14 Akim Demaille <akim@epita.fr>
10998 * src/main.c (main): Invoke scanner_free.
11000 2002-06-14 Akim Demaille <akim@epita.fr>
11002 * src/output.c (m4_invoke): Extracted from...
11003 (output_skeleton): here.
11006 2002-06-14 Akim Demaille <akim@epita.fr>
11008 * src/parse-gram.y (directives, directive, gram)
11009 (grammar_directives, precedence_directives, precedence_directive):
11011 (declarations, declaration, grammar, grammar_declaration)
11012 (precedence_declaration, precedence_declarator): these.
11013 (symbol_declaration): New.
11015 2002-06-14 Akim Demaille <akim@epita.fr>
11017 * src/files.c (action_obstack): Remove, unused.
11018 (output_obstack): Remove it, and all its dependencies, as it is no
11020 * src/reader.c (epilogue_set): Build the epilogue in the
11022 * src/output.h, src/output.c (muscle_obstack): Move to...
11023 * src/muscle_tab.h, src/muscle_tab.h: here.
11024 (muscle_init): Initialize muscle_obstack.
11025 (muscle_free): New.
11026 * src/main.c (main): Call it.
11028 2002-06-14 Akim Demaille <akim@epita.fr>
11030 * src/location.h: New, extracted from...
11031 * src/reader.h: here.
11032 * src/Makefile.am (noinst_HEADERS): Merge into
11033 (bison_SOURCES): this.
11035 * src/parse-gram.y: Use location_t instead of Bison's.
11036 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11037 Use location_t instead of ints.
11039 2002-06-14 Akim Demaille <akim@epita.fr>
11041 * data/bison.simple, data/bison.c++: Be sure to restore the
11042 current #line when returning to the skeleton contents after having
11043 exposed the input file's #line.
11045 2002-06-12 Akim Demaille <akim@epita.fr>
11047 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11049 * tests/actions.at (Exotic Dollars): New.
11051 2002-06-12 Akim Demaille <akim@epita.fr>
11053 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11055 * tests/input.at (Torturing the Scanner): New.
11057 2002-06-11 Akim Demaille <akim@epita.fr>
11059 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11060 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11061 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11062 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11063 * src/reader.c (reader): Use it.
11065 2002-06-11 Akim Demaille <akim@epita.fr>
11067 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11068 Adjust all callers.
11069 (scanner_last_string_free): New.
11071 2002-06-11 Akim Demaille <akim@epita.fr>
11073 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11074 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11075 (last_string, YY_OBS_FREE): New.
11076 Use them when returning an ID.
11078 2002-06-11 Akim Demaille <akim@epita.fr>
11080 Have Bison grammars parsed by a Bison grammar.
11082 * src/reader.c, src/reader.h (prologue_augment): New.
11083 * src/reader.c (copy_definition): Remove.
11085 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11086 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11087 (grammar_current_rule_prec_set, grammar_current_rule_check)
11088 (grammar_current_rule_symbol_append)
11089 (grammar_current_rule_action_append): Export.
11090 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11091 (symbol_list_action_append): Remove.
11092 Hook the routines from reader.
11093 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11094 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11096 * src/reader.c (read_declarations): Remove, unused.
11098 * src/parse-gram.y: Handle the epilogue.
11099 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11100 (grammar_start_symbol_set): this.
11101 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11102 * src/reader.c (readgram): Remove, unused.
11103 (reader): Adjust to insert eoftoken and axiom where appropriate.
11105 * src/reader.c (copy_dollar): Replace with...
11106 * src/scan-gram.h (handle_dollar): this.
11107 * src/parse-gram.y: Remove `%thong'.
11109 * src/reader.c (copy_at): Replace with...
11110 * src/scan-gram.h (handle_at): this.
11112 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11115 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11118 * src/reader.h, src/reader.c (grammar_rule_end): New.
11120 * src/parse.y (current_type, current_class): New.
11121 Implement `%nterm', `%token' support.
11122 Merge `%term' into `%token'.
11123 (string_as_id): New.
11124 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11127 * src/parse-gram.y: Be sure to handle properly the beginning of
11130 * src/parse-gram.y: Handle %type.
11131 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11133 * src/parse-gram.y: More directives support.
11134 * src/options.c: No longer handle source directives.
11136 * src/parse-gram.y: Fix %output.
11138 * src/parse-gram.y: Handle %union.
11139 Use the prologue locations.
11140 * src/reader.c (parse_union_decl): Remove.
11142 * src/reader.h, src/reader.c (epilogue_set): New.
11143 * src/parse-gram.y: Use it.
11145 * data/bison.simple, data/bison.c++: b4_stype is now either not
11146 defined, then default to int, or to the contents of %union,
11147 without `union' itself.
11149 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11151 * src/output.c (actions_output): Don't output braces, as they are
11152 already handled by the scanner.
11154 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11155 characters to themselves.
11157 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11158 that the epilogue has a proper #line.
11160 * src/parse-gram.y: Handle precedence/associativity.
11162 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11164 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11165 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11166 at all to define terminals that cannot be emitted.
11168 * src/scan-gram.l: Escape M4 characters.
11170 * src/scan-gram.l: Working properly with escapes in user
11171 strings/characters.
11173 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11174 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11176 Use more modest sizes, as for the time being the parser does not
11177 release memory, and therefore the process swallows a huge amount
11180 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11181 stricter %token grammar.
11183 * src/symtab.h (associativity): Add `undef_assoc'.
11184 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11185 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11187 * tests/regression.at (Invalid %directive): Remove, as it is now
11189 (Invalid inputs): Adjust to the new error messages.
11190 (Token definitions): The new grammar doesn't allow too many
11193 * src/lex.h, src/lex.c: Remove.
11194 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11195 (copy_character, copy_string2, copy_string, copy_identifier)
11196 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11197 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11198 (parse_action): Remove.
11199 * po/POTFILES.in: Adjust.
11201 2002-06-11 Akim Demaille <akim@epita.fr>
11203 * src/reader.c (parse_action): Don't store directly into the
11204 rule's action member: return the action as a string.
11205 Don't require `rule_length' as an argument: compute it.
11206 (grammar_current_rule_symbol_append)
11207 (grammar_current_rule_action_append): New, eved out from
11209 Remove `action_flag', `rulelength', unused now.
11211 2002-06-11 Akim Demaille <akim@epita.fr>
11213 * src/reader.c (grammar_current_rule_prec_set).
11214 (grammar_current_rule_check): New, eved out from...
11216 Remove `xaction', `first_rhs': useless.
11217 * tests/input.at (Type clashes): New.
11218 * tests/existing.at (GNU Cim Grammar): Adjust.
11220 2002-06-11 Akim Demaille <akim@epita.fr>
11222 * src/reader.c (grammar_midrule_action): New, Eved out from
11225 2002-06-11 Akim Demaille <akim@epita.fr>
11227 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11229 (readgram): Use them as replacement of inlined code, crule and
11232 2002-06-11 Akim Demaille <akim@epita.fr>
11234 * src/reader.c (grammar_end, grammar_symbol_append): New.
11235 (readgram): Use them.
11236 Make the use of `p' as local as possible.
11238 2002-06-10 Akim Demaille <akim@epita.fr>
11240 GCJ's parser requires the tokens to be defined before the prologue.
11242 * data/bison.simple: Output the token definition before the user's
11244 * tests/regression.at (Braces parsing, Duplicate string)
11245 (Mixing %token styles): Check the output from bison.
11246 (Early token definitions): New.
11248 2002-06-10 Akim Demaille <akim@epita.fr>
11250 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11251 assigning twice the same user number to a token, so that we can
11253 * src/lex.c (lex): here.
11254 Also use `symbol_class_set' instead of hand written code.
11255 * src/reader.c (parse_assoc_decl): Likewise.
11257 2002-06-10 Akim Demaille <akim@epita.fr>
11259 * src/symtab.c, src/symtab.c (symbol_class_set)
11260 (symbol_user_token_number_set): New.
11261 * src/reader.c (parse_token_decl): Use them.
11262 Use a switch instead of ifs.
11263 Use a single argument.
11265 2002-06-10 Akim Demaille <akim@epita.fr>
11267 Remove `%thong' support as it is undocumented, unused, duplicates
11268 `%token's job, and creates useless e-mail traffic with people who
11269 want to know what it is, why it is undocumented, unused, and
11270 duplicates `%token's job.
11272 * src/reader.c (parse_thong_decl): Remove.
11273 * src/options.c (option_table): Remove "thong".
11274 * src/lex.h (tok_thong): Remove.
11276 2002-06-10 Akim Demaille <akim@epita.fr>
11278 * src/symtab.c, src/symtab.c (symbol_type_set)
11279 (symbol_precedence_set): New.
11280 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11281 (value_components_used): Remove, unused.
11283 2002-06-09 Akim Demaille <akim@epita.fr>
11285 Move symbols handling code out of the reader.
11287 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11288 (axiom): Move to...
11289 * src/symtab.h, src/symtab.c: here.
11291 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11292 * src/reader.c (startval): Rename as...
11293 * src/symtab.h, src/symtab.c (startsymbol): this.
11294 * src/reader.c: Adjust.
11296 * src/reader.c (symbol_check_defined, symbol_make_alias)
11297 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11298 (token_translations_init)
11300 * src/symtab.c: here.
11301 * src/reader.c (packsymbols): Move to...
11302 * src/symtab.h, src/symtab.c (symbols_pack): here.
11303 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11306 2002-06-03 Akim Demaille <akim@epita.fr>
11308 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11311 2002-06-03 Akim Demaille <akim@epita.fr>
11313 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11314 structs with non literals.
11315 * src/scan-skel.l: never-interactive.
11316 * src/conflicts.c (enum conflict_resolution_e): No trailing
11318 * src/getargs.c (usage): Split long literal strings.
11319 Reported by Hans Aberg.
11321 2002-05-28 Akim Demaille <akim@epita.fr>
11323 * data/bison.c++: Use C++ ostreams.
11324 (cdebug_): New member.
11326 2002-05-28 Akim Demaille <akim@epita.fr>
11328 * src/output.c (output_skeleton): Be sure to allocate enough room
11329 for `/' _and_ for `\0' in full_skeleton.
11331 2002-05-28 Akim Demaille <akim@epita.fr>
11333 * data/bison.c++: Catch up with bison.simple:
11334 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11335 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11336 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11337 and popping traces.
11339 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11341 * src/output.c (output_skeleton): Put an explicit path in front of
11342 the skeleton file name, rather than relying on the -I directory,
11343 to partially alleviate effects of having a skeleton file lying around
11344 in the current directory.
11346 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11348 * src/conflicts.c (log_resolution): Correct typo:
11349 obstack_printf should be obstack_fgrow1.
11351 2002-05-26 Akim Demaille <akim@epita.fr>
11353 * src/state.h (state_t): `solved_conflicts' is a new member.
11354 * src/LR0.c (new_state): Set it to 0.
11355 * src/conflicts.h, src/conflicts.c (print_conflicts)
11356 (free_conflicts, solve_conflicts): Rename as...
11357 (conflicts_print, conflicts_free, conflicts_solve): these.
11359 * src/conflicts.c (enum conflict_resolution_e)
11360 (solved_conflicts_obstack): New, used by...
11361 (log_resolution): this.
11362 Adjust to attach the conflict resolution to each state.
11363 Complete the description with the precedence/associativity
11365 (resolve_sr_conflict): Adjust.
11366 * src/print.c (print_state): Output its solved_conflicts.
11367 * tests/conflicts.at (Unresolved SR Conflicts)
11368 (Solved SR Conflicts): Exercise --report=all.
11370 2002-05-26 Akim Demaille <akim@epita.fr>
11372 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11373 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11374 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11375 (token_number_t, item_number_as_token_number)
11376 (token_number_as_item_number, muscle_insert_token_number_table):
11378 (symbol_number_t, item_number_as_symbol_number)
11379 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11380 these, since it is more appropriate.
11382 2002-05-26 Akim Demaille <akim@epita.fr>
11384 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11386 * data/bison.simple (yystos) [YYDEBUG]: New.
11387 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11389 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11391 2002-05-25 Akim Demaille <akim@epita.fr>
11393 * doc/bison.texinfo (Debugging): Split into...
11394 (Tracing): this new section, its former contents, and...
11395 (Understanding): this new section.
11396 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11398 (report_flag): this.
11399 Adjust all dependencies.
11400 (report_args, report_types, report_argmatch): New.
11401 (usage, getargs): Report/support -r, --report.
11403 (struct option_table_struct): Rename as..,
11404 (struct option_table_s): this.
11405 Rename the `set_flag' member to `flag' to match with getopt_long's
11407 * src/options.c (option_table): Split verbose into an entry for
11408 %verbose, and another for --verbose.
11409 Support --report/-r, so remove -r from the obsolete --raw.
11410 * src/print.c: Attach full item sets and lookaheads reports to
11411 report_flag instead of trace_flag.
11412 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11414 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11415 and Paul Eggert <eggert@twinsun.com>
11417 * data/bison.simple (yyparse): Correct error handling to conform to
11418 POSIX and yacc. Specifically, after syntax error is discovered,
11419 do not reduce further before shifting the error token.
11420 Clean up the code a bit by removing the labels yyerrdefault,
11421 yyerrhandle, yyerrpop.
11422 * NEWS: Document the above.
11424 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11426 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11427 type; it isn't always big enough, since it doesn't necessarily
11428 include non-terminals.
11429 (yytranslate): Expand definition of yy_token_number_type, so that
11430 the latter can be removed.
11431 (yy_token_number_type): Remove, only one use.
11432 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11433 don't use TokenNumberType as element type.
11435 * tests/regression.at: Modify expected output to agree with change
11436 to yyr1 and yytranslate.
11438 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11440 * src/reader.c (parse_action): Use copy_character instead of
11443 2002-05-13 Akim Demaille <akim@epita.fr>
11445 * tests/regression.at (Token definitions): Prototype yylex and
11448 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11450 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
11451 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11453 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11455 2002-05-07 Akim Demaille <akim@epita.fr>
11457 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11458 avoid GCC warnings.
11460 2002-05-07 Akim Demaille <akim@epita.fr>
11464 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11465 over the RHS of each rule.
11466 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11467 * src/state.h (state_t): Member `nitems' is unsigned short.
11468 * src/LR0.c (get_state): Adjust.
11469 * src/reader.c (packgram): Likewise.
11470 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11472 (muscle_insert_int_table): Remove, unused.
11473 (prepare_rules): Remove `max'.
11475 2002-05-06 Akim Demaille <akim@epita.fr>
11477 * src/closure.c (print_firsts): Display of the symbol tags.
11478 (bitmatrix_print): Move to...
11479 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11481 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11483 2002-05-06 Akim Demaille <akim@epita.fr>
11485 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11488 2002-05-06 Akim Demaille <akim@epita.fr>
11490 * src/LR0.c (new_state, get_state): Instead of using the global
11491 `kernel_size' and `kernel_base', have two new arguments:
11492 `core_size' and `core'.
11495 2002-05-06 Akim Demaille <akim@epita.fr>
11497 * src/reader.c (packgram): No longer end `ritem' with a 0
11498 sentinel: it is not used.
11500 2002-05-05 Akim Demaille <akim@epita.fr>
11502 New experimental feature: display the lookaheads in the report and
11505 * src/print (print_core): When --trace-flag, display the rules
11507 * src/print_graph.c (print_core): Likewise.
11508 Swap the arguments.
11511 2002-05-05 Akim Demaille <akim@epita.fr>
11513 * tests/torture.at (Many lookaheads): New test.
11515 2002-05-05 Akim Demaille <akim@epita.fr>
11517 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11518 (GENERATE_MUSCLE_INSERT_TABLE): this.
11519 (output_int_table, output_unsigned_int_table, output_short_table)
11520 (output_token_number_table, output_item_number_table): Replace with...
11521 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11522 (muscle_insert_short_table, muscle_insert_token_number_table)
11523 (muscle_insert_item_number_table): these.
11524 Adjust all callers.
11525 (prepare_tokens): Don't free `translations', since...
11526 * src/reader.h, src/reader.c (grammar_free): do it.
11528 * src/gram.h, src/gram.c (grammar_free): here.
11529 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11532 2002-05-05 Akim Demaille <akim@epita.fr>
11534 * src/output.c (output_unsigned_int_table): New.
11535 (prepare_rules): `i' is unsigned.
11536 `prhs', `rline', `r2' are unsigned int.
11537 Rename muscle `rhs_number_max' as `rhs_max'.
11538 Output muscles `prhs_max', `rline_max', and `r2_max'.
11540 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11541 to compute types instead of constant types.
11542 * tests/regression.at (Web2c Actions): Adjust.
11544 2002-05-04 Akim Demaille <akim@epita.fr>
11546 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11547 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11548 Adjust dependencies.
11549 * src/output.c (token_definitions_output): Be sure not to output a
11550 `#define 'a'' when fed with `%token 'a' "a"'.
11551 * tests/regression.at (Token definitions): New.
11553 2002-05-03 Paul Eggert <eggert@twinsun.com>
11555 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11558 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11560 * Makefile.am (SUBDIRS): Remove intl.
11561 (EXTRA_DIST): Add config/config.rpath.
11563 2002-05-03 Akim Demaille <akim@epita.fr>
11565 * data/bison.simple (m4_if): Don't output empty enums.
11566 And actually, output valid enum definitions :(.
11568 2002-05-03 Akim Demaille <akim@epita.fr>
11570 * configure.bat: Remove, completely obsolete.
11571 * Makefile.am (EXTRA_DIST): Adjust.
11572 Don't distribute config.rpath...
11573 * config/Makefile.am (EXTRA_DIST): Do it.
11575 2002-05-03 Akim Demaille <akim@epita.fr>
11577 * configure.in (GETTEXT_VERSION): New.
11578 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11580 2002-05-03 Akim Demaille <akim@epita.fr>
11582 * data/bison.simple (b4_token_enum): New.
11583 (b4_token_defines): Use it to output tokens both as #define and
11585 Suggested by Paul Eggert.
11586 * src/output.c (token_definitions_output): Don't output spurious
11589 2002-05-03 Akim Demaille <akim@epita.fr>
11591 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11593 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
11595 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
11596 Update the stack class, give a try to deque as the default container.
11598 2002-05-02 Akim Demaille <akim@epita.fr>
11600 * data/bison.simple (yyparse): Do not implement @$ = @1.
11601 (YYLLOC_DEFAULT): Adjust to do it.
11602 * doc/bison.texinfo (Location Default Action): Fix.
11604 2002-05-02 Akim Demaille <akim@epita.fr>
11606 * src/reader.c (parse_braces): Merge into...
11607 (parse_action): this.
11609 2002-05-02 Akim Demaille <akim@epita.fr>
11611 * configure.in (ALL_LINGUAS): Remove.
11612 * po/LINGUAS, hr.po: New.
11614 2002-05-02 Akim Demaille <akim@epita.fr>
11616 Remove the so called hairy (semantic) parsers.
11618 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
11619 * src/gram.h, src/gram.c (semantic_parser): Remove.
11620 (rule_t): Remove the guard and guard_line members.
11621 * src/lex.h (token_t): remove tok_guard.
11622 * src/options.c (option_table): Remove %guard and %semantic_parser
11624 * src/output.c, src/output.h (guards_output): Remove.
11626 (token_definitions_output): Don't output the `T'
11628 (output_skeleton): Don't output the guards.
11629 * src/files.c, src/files.c (attrsfile): Remove.
11630 * src/reader.c (symbol_list): Remove the guard and guard_line
11632 Adjust dependencies.
11633 (parse_guard): Remove.
11634 * data/bison.hairy: Remove.
11635 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11638 2002-05-02 Akim Demaille <akim@epita.fr>
11640 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
11641 (parse_guard): Rename the formal argument `stack_offset' as
11642 `rule_length', which is more readable.
11644 (copy_at, copy_dollar): Instead of outputting the hard coded
11645 values of $$, $n and so forth, output invocation to b4_lhs_value,
11646 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
11647 Note: this patch partially drops `semantic-parser' support: it
11648 always does `rule_length - n', where semantic parsers ought to
11650 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11651 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11653 2002-05-02 Akim Demaille <akim@epita.fr>
11655 * configure.in (AC_INIT): Bump to 1.49b.
11656 (AM_INIT_AUTOMAKE): Short invocation.
11658 2002-05-02 Akim Demaille <akim@epita.fr>
11662 2002-05-01 Akim Demaille <akim@epita.fr>
11664 * src/skeleton.h: Remove.
11666 2002-05-01 Akim Demaille <akim@epita.fr>
11668 * src/skeleton.h: Fix the #endif.
11669 Reported by Magnus Fromreide.
11671 2002-04-26 Paul Eggert <eggert@twinsun.com>
11673 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
11674 Define if we define YYSTYPE and YYLTYPE, respectively.
11675 (YYCOPY): Fix [] quoting problem in the non-GCC case.
11677 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
11679 * src/scan-skel.l: Postprocess quadrigraphs.
11681 * src/reader.c (copy_character): New function, used to output
11682 single characters while replacing `[' and `]' with quadrigraphs, to
11683 avoid troubles with M4 quotes.
11684 (copy_comment): Output characters with copy_character.
11685 (read_additionnal_code): Likewise.
11686 (copy_string2): Likewise.
11687 (copy_definition): Likewise.
11689 * tests/calc.at: Exercise M4 quoting.
11691 2002-04-25 Akim Demaille <akim@epita.fr>
11693 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11694 between `!' and the command.
11695 Reported by Paul Eggert.
11697 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
11699 * tests/calc.at: Exercise prologue splitting.
11701 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11702 `b4_post_prologue' instead of `b4_prologue'.
11704 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11706 (output): Free pre_prologue_obstack and post_prologue_obstack.
11707 * src/files.h, src/files.c (attrs_obstack): Remove.
11708 (pre_prologue_obstack, post_prologue_obstack): New.
11709 * src/reader.c (copy_definition): Add a parameter to specify the
11710 obstack to fill, instead of using attrs_obstack unconditionally.
11711 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11712 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11714 2002-04-23 Paul Eggert <eggert@twinsun.com>
11716 * data/bison.simple: Remove unnecessary commentary and white
11717 space differences from 1_29-branch.
11718 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11720 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11721 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11722 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11723 constructors or destructors.
11725 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11727 2002-04-23 Akim Demaille <akim@epita.fr>
11729 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11730 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11731 location with columns.
11732 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11733 All reported by Paul Eggert.
11735 2002-04-22 Akim Demaille <akim@epita.fr>
11737 * src/reduce.c (dump_grammar): Move to...
11738 * src/gram.h, src/gram.c (grammar_dump): here.
11739 Be sure to separate long item numbers.
11740 Don't read the members of a rule's prec if its nil.
11742 2002-04-22 Akim Demaille <akim@epita.fr>
11744 * src/output.c (table_size, table_grow): New.
11745 (MAXTABLE): Remove, replace uses with table_size.
11746 (pack_vector): Instead of dying when the table is too big, grow it.
11748 2002-04-22 Akim Demaille <akim@epita.fr>
11750 * data/bison.simple (yyr1): Its type is that of a token number.
11751 * data/bison.c++ (r1_): Likewise.
11752 * tests/regression.at (Web2c Actions): Adjust.
11754 2002-04-22 Akim Demaille <akim@epita.fr>
11756 * src/reader.c (token_translations_init): 256 is now the default
11757 value for the error token, i.e., it will be assigned another
11758 number if the user assigned 256 to one of her tokens.
11759 (reader): Don't force 256 to error.
11760 * doc/bison.texinfo (Symbols): Adjust.
11761 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11762 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11763 etc. instead of 10, 20, 30 (which was used to `jump' over error
11764 (256) and undefined (2)).
11766 2002-04-22 Akim Demaille <akim@epita.fr>
11768 Propagate more token_number_t.
11770 * src/gram.h (token_number_as_item_number)
11771 (item_number_as_token_number): New.
11772 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11773 Use it to create output_item_number_table and
11774 output_token_number_table.
11775 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11776 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11777 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11778 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11780 2002-04-22 Akim Demaille <akim@epita.fr>
11782 * src/output.h, src/output.c (get_lines_number): Remove.
11784 2002-04-19 Akim Demaille <akim@epita.fr>
11786 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11788 (Debugging): More details about enabling the debugging features.
11789 (Table of Symbols): Describe $$, $n, @$, and @n.
11790 Suggested by Tim Josling.
11792 2002-04-19 Akim Demaille <akim@epita.fr>
11794 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11796 2002-04-10 Akim Demaille <akim@epita.fr>
11798 * src/system.h: Rely on HAVE_LIMITS_H.
11799 Suggested by Paul Eggert.
11801 2002-04-09 Akim Demaille <akim@epita.fr>
11803 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11804 full stderr, and strip it according to the bison options, instead
11805 of composing the error message from different bits.
11806 This makes it easier to check for several error messages.
11807 Adjust all the invocations.
11808 Add an invocation exercising the error token.
11809 Add an invocation demonstrating a stupid error message.
11810 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11812 Error message are for stderr, not stdout.
11814 2002-04-09 Akim Demaille <akim@epita.fr>
11816 * src/gram.h, src/gram.c (error_token_number): Remove, use
11818 * src/reader.c (reader): Don't specify the user token number (2)
11819 for $undefined, as it uselessly prevents using it.
11820 * src/gram.h (token_number_t): Move to...
11821 * src/symtab.h: here.
11822 (state_t.number): Is a token_number_t.
11823 * src/print.c, src/reader.c: Use undeftoken->number instead of
11825 (Even though this 2 is not the same as above: the number of the
11826 undeftoken remains being 2, it is its user token number which
11828 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11829 `user_token_number_max'.
11830 Output `undef_token_number'.
11831 * data/bison.simple, data/bison.c++: Use them.
11832 Be sure to map invalid yylex return values to
11833 `undef_token_number'. This saves us from gratuitous SEGV.
11835 * tests/conflicts.at (Solved SR Conflicts)
11836 (Unresolved SR Conflicts): Adjust.
11837 * tests/regression.at (Web2c Actions): Adjust.
11839 2002-04-08 Akim Demaille <akim@epita.fr>
11841 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11843 Remove the duplicate `typedefs'.
11844 (RhsNumberType): Fix the declaration and various other typos.
11846 * data/bison.simple: Use __ofile__.
11847 * src/scan-skel.l: Handle __ofile__.
11849 2002-04-08 Akim Demaille <akim@epita.fr>
11851 * src/gram.h (item_number_t): New, the type of item numbers in
11852 RITEM. Note that it must be able to code symbol numbers as
11853 positive number, and the negation of rule numbers as negative
11855 Adjust all dependencies (pretty many).
11856 * src/reduce.c (rule): Remove this `short *' pointer: use
11858 * src/system.h (MINSHORT, MAXSHORT): Remove.
11859 Include `limits.h'.
11860 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
11861 (shortcpy): Remove.
11862 (MAXTABLE): Move to...
11863 * src/output.c (MAXTABLE): here.
11864 (prepare_rules): Use output_int_table to output rhs.
11865 * data/bison.simple, data/bison.c++: Adjust.
11866 * tests/torture.at (Big triangle): Move the limit from 254 to
11868 * tests/regression.at (Web2c Actions): Ajust.
11870 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
11871 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
11872 passes, but produces negative #line number, once fixed, GCC is
11873 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
11875 * src/state.h (state_h): Code input lines on ints, not shorts.
11877 2002-04-08 Akim Demaille <akim@epita.fr>
11879 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11880 and then the grammar.
11882 2002-04-08 Akim Demaille <akim@epita.fr>
11884 * src/system.h: No longer using strndup.
11886 2002-04-07 Akim Demaille <akim@epita.fr>
11888 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
11889 * src/output.c (output_table_data): Return the longest number.
11890 (prepare_tokens): Output `token_number_max').
11891 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
11893 Use them to define yy_token_number_type/TokenNumberType.
11894 Use this type for yytranslate.
11895 * tests/torture.at (Big triangle): Push the limit from 124 to
11897 * tests/regression.at (Web2c Actions): Adjust.
11899 2002-04-07 Akim Demaille <akim@epita.fr>
11901 * tests/torture.at (Big triangle): New.
11902 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11903 * tests/existing.at: here.
11905 2002-04-07 Akim Demaille <akim@epita.fr>
11907 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11909 Adjust dependencies.
11911 2002-04-07 Akim Demaille <akim@epita.fr>
11913 * src/reader.c: Normalize increments to prefix form.
11915 2002-04-07 Akim Demaille <akim@epita.fr>
11917 * src/reader.c, symtab.c: Remove debugging code.
11919 2002-04-07 Akim Demaille <akim@epita.fr>
11921 Rename all the `bucket's as `symbol_t'.
11923 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
11924 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
11925 * src/symtab.c, src/symtab.h (bucket): Rename as...
11927 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11928 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11929 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11930 (buckets_new, buckets_free, buckets_do): Rename as...
11931 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11932 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11933 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11934 (symbols_new, symbols_free, symbols_do): these.
11936 2002-04-07 Akim Demaille <akim@epita.fr>
11938 Use lib/hash for the symbol table.
11940 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11942 * src/lex.c (lex): Set the `number' member of new terminals.
11943 * src/reader.c (bucket_check_defined, bucket_make_alias)
11944 (bucket_check_alias_consistence, bucket_translation): New.
11945 (reader, grammar_free, readgram, token_translations_init)
11946 (packsymbols): Adjust.
11947 (reader): Number the predefined tokens.
11948 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11949 for predefined tokens.
11950 * src/symtab.h (bucket): Remove all the hash table related
11952 * src/symtab.c (symtab): Replace by...
11953 (bucket_table): this.
11954 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11955 (buckets_new, buckets_do): New.
11957 2002-04-07 Akim Demaille <akim@epita.fr>
11959 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11960 (start_symbol, max_user_token_number, semantic_parser)
11961 (error_token_number): Initialize.
11962 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11965 (errtoken, eoftoken, undeftoken, axiom): Extern.
11967 2002-04-07 Akim Demaille <akim@epita.fr>
11969 * src/gram.h (rule_s): prec and precsym are now pointers
11970 to the bucket giving the priority/associativity.
11971 Member `associativity' removed: useless.
11972 * src/reduce.c, src/conflicts.c: Adjust.
11974 2002-04-07 Akim Demaille <akim@epita.fr>
11976 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
11977 Properly escape the symbols' TAG when outputting them.
11979 2002-04-07 Akim Demaille <akim@epita.fr>
11981 * src/lalr.h (LA): Is a bitsetv, not bitset*.
11983 2002-04-07 Akim Demaille <akim@epita.fr>
11985 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
11986 (LArule): this, which is an array to rule_t*.
11987 * src/print.c, src/conflicts.c: Adjust.
11989 2002-04-07 Akim Demaille <akim@epita.fr>
11991 * src/gram.h (rule_t): Rename `number' as `user_number'.
11992 `number' is a new member.
11993 Adjust dependencies.
11994 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
11996 2002-04-07 Akim Demaille <akim@epita.fr>
11998 As a result of the previous patch, it is no longer needed
11999 to reorder ritem itself.
12001 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12003 2002-04-07 Akim Demaille <akim@epita.fr>
12005 Be sure never to walk through RITEMS, but use only data related to
12006 the rules themselves. RITEMS should be banished.
12008 * src/output.c (output_token_translations): Rename as...
12009 (prepare_tokens): this.
12010 In addition to `translate', prepare the muscles `tname' and
12011 `toknum', which were handled by...
12012 (output_rule_data): this.
12013 Remove, and move the remainder of its outputs into...
12014 (prepare_rules): this new routines, which also merges content from
12015 (output_gram): this.
12016 (prepare_rules): Be sure never to walk through RITEMS.
12017 (output_stos): Rename as...
12018 (prepare_stos): this.
12019 (output): Always invoke prepare_states, after all, just don't use it
12020 in the output if you don't need it.
12022 2002-04-07 Akim Demaille <akim@epita.fr>
12024 * src/LR0.c (new_state): Display `nstates' as the name of the
12025 newly created state.
12026 Adjust to initialize first_state and last_state if needed.
12027 Be sure to distinguish the initial from the final state.
12028 (new_states): Create the itemset of the initial state, and use
12030 * src/closure.c (closure): Now that the initial state has its
12031 items properly set, there is no need for a special case when
12032 creating `ruleset'.
12034 As a result, now the rule 0, reducing to $axiom, is visible in the
12035 outputs. Adjust the test suite.
12037 * tests/conflicts.at (Solved SR Conflicts)
12038 (Unresolved SR Conflicts): Adjust.
12039 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12040 * tests/conflicts.at (S/R in initial): New.
12042 2002-04-07 Akim Demaille <akim@epita.fr>
12044 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12045 the RHS of the rules.
12046 * src/output.c (output_gram): Likewise.
12048 2002-04-07 Akim Demaille <akim@epita.fr>
12050 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12052 Adjust all dependencies.
12053 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12054 `number' of the buckets too.
12055 * src/gram.h: Include `symtab.h'.
12056 (associativity): Move to...
12057 * src/symtab.h: here.
12058 No longer include `gram.h'.
12060 2002-04-07 Akim Demaille <akim@epita.fr>
12062 * src/gram.h, src/gram.c (rules_rhs_length): New.
12063 (ritem_longest_rhs): Use it.
12064 * src/gram.h (rule_t): `number' is a new member.
12065 * src/reader.c (packgram): Set it.
12066 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12067 the end of `rules', and count them out of `nrules'.
12068 (reduce_output, dump_grammar): Adjust.
12069 * src/print.c (print_grammar): It is no longer needed to check for
12070 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12071 * tests/reduce.at (Reduced Automaton): New test.
12073 2002-04-07 Akim Demaille <akim@epita.fr>
12075 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12076 lacking `+ 1' to nrules, Bison reported as useless a token if it
12077 was used solely to set the precedence of the last rule...
12079 2002-04-07 Akim Demaille <akim@epita.fr>
12081 * data/bison.c++, data/bison.simple: Don't output the current file
12082 name in #line, to avoid useless diffs between two identical
12083 outputs under different names.
12085 2002-04-07 Akim Demaille <akim@epita.fr>
12087 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12088 Normalize loops to using `< nrules + 1', not `<= nrules'.
12090 2002-04-07 Akim Demaille <akim@epita.fr>
12094 2002-04-07 Akim Demaille <akim@epita.fr>
12096 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12097 bucket.value as bucket.number.
12099 2002-04-07 Akim Demaille <akim@epita.fr>
12101 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12102 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12103 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12104 RHS, instead of being an index in RITEMS.
12106 2002-04-04 Paul Eggert <eggert@twinsun.com>
12108 * doc/bison.texinfo: Update copyright date.
12109 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12110 (Symbols): Warn about running Bison in one character set,
12111 but compiling and/or running in an incompatible one.
12112 Warn about character code 256, too.
12114 2002-04-03 Paul Eggert <eggert@twinsun.com>
12116 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12117 YYERROR_VERBOSE is nonzero, not whether it is defined.
12119 Merge changes from bison-1_29-branch.
12121 2002-03-20 Paul Eggert <eggert@twinsun.com>
12123 Merge fixes from Debian bison_1.34-1.diff.
12125 * configure.in (AC_PREREQ): 2.53.
12127 2002-03-20 Akim Demaille <akim@epita.fr>
12129 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12131 2002-03-19 Paul Eggert <eggert@twinsun.com>
12133 * src/bison.simple (YYCOPY): New macro.
12134 (YYSTACK_RELOCATE): Use it.
12135 Remove Type arg; no longer needed. All callers changed.
12136 (yymemcpy): Remove; no longer needed.
12138 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12139 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12141 2002-03-19 Akim Demaille <akim@epita.fr>
12143 Test and fix the #line outputs.
12145 * tests/atlocal.at (GCC): New.
12146 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
12147 (Prologue synch line, %union synch line, Postprologue synch line)
12148 (Action synch line, Epilogue synch line): New tests.
12149 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12150 * data/bison.simple, data/bison.c++: Use it.
12152 2002-03-19 Akim Demaille <akim@epita.fr>
12154 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12155 (Solved SR Conflicts, %expect not enough, %expect right)
12156 (%expect too much): Move to...
12157 * tests/conflicts.at: this new file.
12159 2002-03-19 Akim Demaille <akim@epita.fr>
12161 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12162 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12163 that we can move to enums for instance.
12164 * src/output.c (token_definitions_output): Output a list of
12165 `token-name, token-number' instead of the #define.
12166 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12168 2002-03-14 Akim Demaille <akim@epita.fr>
12170 Use Gettext 0.11.1.
12172 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
12174 * data/bison.c++: Make the user able to add members to the generated
12175 parser by subclassing.
12177 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
12179 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12181 Reported by Nicolas Tisserand and Nicolas Burrus.
12183 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12185 * src/reader.c: Warn about lacking semi-colons, do not complain.
12187 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12189 * data/bison.c++: Remove a debug line.
12191 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12193 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12194 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12195 provide a default implementation.
12197 2002-03-04 Akim Demaille <akim@epita.fr>
12199 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12200 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12201 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12202 * tests/semantic.at (Parsing Guards): Similarly.
12203 * src/reader.at (readgram): Complain if the last rule is not ended
12206 2002-03-04 Akim Demaille <akim@epita.fr>
12208 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12209 * src/closure.c: here.
12210 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12212 * src/warshall.h, src/warshall.c: Remove.
12213 * tests/sets.at (Broken Closure): Adjust.
12215 2002-03-04 Akim Demaille <akim@epita.fr>
12217 * src/output.c (output_skeleton): tempdir is const.
12218 bytes_read is unused.
12220 2002-03-04 Akim Demaille <akim@epita.fr>
12222 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12223 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12225 From Michael Hayes.
12227 2002-03-04 Akim Demaille <akim@epita.fr>
12229 * src/closure.c (closure): `r' is unused.
12231 2002-03-04 Akim Demaille <akim@epita.fr>
12233 * tests/sets.at (Broken Closure): Add the ending `;'.
12234 * src/reader.at (readgram): Complain if a rule is not ended with a
12237 2002-03-04 Akim Demaille <akim@epita.fr>
12239 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12240 (count_sr_conflicts): Use bitset_count.
12241 * src/reduce.c (inaccessable_symbols): Ditto.
12242 (bits_size): Remove.
12243 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12245 2002-03-04 Akim Demaille <akim@epita.fr>
12247 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12248 * src/reduce.c: Remove the `bitset_zero's following the
12249 `bitset_create's, as now it is performed by the latter.
12251 2002-03-04 Akim Demaille <akim@epita.fr>
12253 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12254 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12255 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12256 latest sources from Michael.
12258 2002-03-04 Akim Demaille <akim@epita.fr>
12260 * src/output.c (output): Don't free the grammar.
12261 * src/reader.c (grammar_free): New.
12262 * src/main.c (main): Call it and don't free symtab here.
12264 2002-03-04 Akim Demaille <akim@epita.fr>
12266 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12268 Reported by Benoit Perrot.
12270 2002-03-04 Akim Demaille <akim@epita.fr>
12272 Use bitset operations when possible, not loops over bits.
12274 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12276 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12277 * src/reduce.c (useless_nonterminals): Formatting changes.
12278 * src/warshall.c (TC): Use bitset_or.
12280 2002-03-04 Akim Demaille <akim@epita.fr>
12282 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12283 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12286 2002-03-04 Akim Demaille <akim@epita.fr>
12288 * src/lalr.c (F): Now a bitset*.
12289 Adjust all dependencies.
12291 2002-03-04 Akim Demaille <akim@epita.fr>
12293 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12294 Adjust all dependencies.
12296 2002-03-04 Akim Demaille <akim@epita.fr>
12298 * src/L0.c, src/LR0.h (nstates): Be size_t.
12299 Adjust comparisons (signed vs unsigned).
12300 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12302 Adjust all dependencies.
12304 2002-03-04 Akim Demaille <akim@epita.fr>
12306 * src/closure.c (firsts): Now, also a bitset.
12307 Adjust all dependencies.
12308 (varsetsize): Remove, now unused.
12309 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12311 2002-03-04 Akim Demaille <akim@epita.fr>
12313 * src/print.c: Convert to use bitset.h, not hand coded iterations
12316 2002-03-04 Akim Demaille <akim@epita.fr>
12318 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12320 2002-03-04 Akim Demaille <akim@epita.fr>
12322 * src/closure.c (ruleset): Be a bitset.
12323 (rulesetsize): Remove.
12325 2002-03-04 Akim Demaille <akim@epita.fr>
12327 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12328 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12329 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12330 * src/closure.c (fderives): Be an array of bitsets.
12332 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
12334 * data/bison.c++: Merge the two generated headers. Insert a copyright
12335 notice in each output file.
12337 2002-02-28 Akim Demaille <akim@epita.fr>
12339 * data/bison.c++: Copy the prologue of bison.simple to fetch
12340 useful M4 definitions, such as b4_header_guard.
12342 2002-02-25 Akim Demaille <akim@epita.fr>
12344 * src/getargs.c (version): Give the name of the authors, and use a
12345 translator friendly scheme for the bgr
12348 2002-02-25 Akim Demaille <akim@epita.fr>
12350 * src/output.c (header_output): Remove, now handled completely via
12353 2002-02-25 Akim Demaille <akim@epita.fr>
12355 * m4/m4.m4: New, from CVS Autoconf.
12356 * configure.in: Invoke it.
12357 * src/output.c (output_skeleton): Use its result instead of the
12360 2002-02-25 Akim Demaille <akim@epita.fr>
12362 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12364 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12365 * src/output.c (output_skeleton): Use mkstemp to create a real
12367 Move the filling of `skeleton' and its muscle to...
12369 (output): Move the definition of the prologue muscle to...
12371 * src/system.h (DEFAULT_TMPDIR): New.
12373 2002-02-14 Paul Eggert <eggert@twinsun.com>
12375 Remove the support for C++ namespace cleanliness; it was
12376 causing more problems than it was curing, since it didn't work
12377 properly on some nonstandard C++ compilers. This can wait
12378 for a proper C++ parser.
12380 * NEWS: Document this.
12381 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12382 of C++, as it's treated like C now.
12383 * src/bison.simple (YYSTD): Remove.
12384 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12385 Treat C++ just like Standard C instead of trying to support
12386 namespace cleanliness.
12388 2002-02-14 Akim Demaille <akim@epita.fr>
12390 * tests/regression.at (else): Adjust to Andreas' change.
12392 2002-02-14 Akim Demaille <akim@epita.fr>
12394 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12396 2002-02-13 Andreas Schwab <schwab@suse.de>
12398 * src/output.c (output_rule_data): Don't output NULL, it might
12399 not be defined yet.
12401 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
12403 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12404 (Copyright notice): Update.
12406 2002-02-11 Akim Demaille <akim@epita.fr>
12408 * tests/regression.at (%nonassoc and eof): Don't include
12409 nonportable headers.
12411 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
12413 * data/bison.c++: Correct error recovery. Make the user able to
12414 initialize the starting location.
12416 2002-02-07 Akim Demaille <akim@epita.fr>
12418 * tests/input.at: New.
12420 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12422 * data/bison.c++: Replace some direct m4 expansions by constants. Be
12423 more consistent when naming methods and variables. Put preprocessor
12424 directives around tables only needed for debugging.
12426 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12428 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12430 (yy::b4_name::parse): Use print_.
12432 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12434 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12436 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12438 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12440 (yy::b4_name::parse): Build verbose error messages, and use error_.
12442 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12444 * data/bison.c++: Fix m4 quoting in comments.
12446 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12448 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12449 not expanded by m4.
12451 2002-02-05 Akim Demaille <akim@epita.fr>
12453 * data/bison.c++: Adjust to the M4 back end.
12454 More is certainly needed.
12456 2002-02-05 Akim Demaille <akim@epita.fr>
12458 Give a try to M4 as a back end.
12460 * lib/readpipe.c: New, from wdiff.
12461 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12463 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12464 specific values. Now it is m4 that performs the lookup.
12465 * src/parse-skel.y: Remove.
12466 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12467 * src/output.c (actions_output, guards_output)
12468 (token_definitions_output): No longer keeps track of the output
12469 line number, hence remove the second argument.
12470 (guards_output): Check against the guard member of a rule, not the
12473 (output_skeleton): Don't look for the skeleton location, let m4 do
12475 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12477 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12478 (prepare): Given that for the time being changesyntax is not
12479 usable in M4, rename the muscles using `-' to `_'.
12480 Define `defines_flag', `output_parser_name' and `output_header_name'.
12481 * src/output.h (actions_output, guards_output)
12482 (token_definitions_output): Adjust prototypes.
12483 * src/scan-skel.l: Instead of scanning the skeletons, it now
12484 processes the output of m4: `__oline__' and `#output'.
12485 * data/bison.simple: Adjust to be used by M4(sugar).
12486 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12488 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12489 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12490 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12491 shamelessly stolen from CVS Autoconf.
12493 2002-02-05 Akim Demaille <akim@epita.fr>
12495 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12496 * configure.in: Check for the declarations of free and malloc.
12497 * src/muscle_tab.c: Adjust.
12499 2002-02-05 Akim Demaille <akim@epita.fr>
12501 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12502 which have no values.
12504 2002-02-05 Akim Demaille <akim@epita.fr>
12506 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12509 2002-01-29 Paul Eggert <eggert@twinsun.com>
12511 * src/bison.simple (YYSIZE_T): Do not define merely because
12512 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12513 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12515 2002-01-27 Akim Demaille <akim@epita.fr>
12517 Fix `%nonassoc and eof'.
12519 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12520 which were not properly copied! Replace
12521 memcpy (res->errs, src->errs, src->nerrs);
12523 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12525 * tests/regression.at (%nonassoc and eof): Adjust to newest
12526 Autotest: `.' is not in the PATH.
12528 2002-01-27 Akim Demaille <akim@epita.fr>
12530 * tests/sets.at (AT_EXTRACT_SETS): New.
12531 (Nullable): Use it.
12534 2002-01-26 Akim Demaille <akim@epita.fr>
12536 * tests/actions.at, tests/calc.at, tests/headers.at,
12537 * tests/torture.at: Adjust to the newest Autotest which no longer
12538 forces `.' in the PATH.
12540 2002-01-25 Akim Demaille <akim@epita.fr>
12542 * tests/regression.at (%nonassoc and eof): New.
12543 Suggested by Robert Anisko.
12545 2002-01-24 Akim Demaille <akim@epita.fr>
12547 Bison dumps core when trying to complain about broken input files.
12548 Reported by Cris van Pelt.
12550 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12551 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12553 (Invalid inputs): Strengthen: exercise parse_percent_token.
12555 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
12557 * src/Makefile.am: Add bison.c++.
12558 * src/bison.c++: New skeleton.
12560 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
12564 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12566 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12568 2002-01-20 Marc Autret <marc@gnu.org>
12570 * src/files.c (compute_output_file_names): Fix
12572 2002-01-20 Marc Autret <marc@gnu.org>
12574 * tests/output.at: New test.
12575 * src/files.c (compute_base_names): Don't map extensions when
12576 the YACC flag is set, use defaults.
12577 Reported by Evgeny Stambulchik.
12579 2002-01-20 Marc Autret <marc@gnu.org>
12581 * src/system.h: Need to define __attribute__ away for non-GCC
12582 compilers as well (i.e., the vendor C compiler).
12583 Suggested by Albert Chin-A-Young.
12585 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12587 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
12588 canonical definition.
12589 * src/system.h: Use the canonical definition for PARAMS (avoids
12590 a conflict with the macro from lib/hash.h).
12592 2002-01-11 Akim Demaille <akim@epita.fr>
12594 * configure.in: Use AC_FUNC_STRNLEN.
12595 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
12597 2002-01-09 Akim Demaille <akim@epita.fr>
12599 * src/files.c, src/files.h (output_infix): New.
12600 (tab_extension): Remove.
12601 (compute_base_names): Compute the former, drop the latter.
12602 * src/output.c (prepare): Insert the muscles `output-infix', and
12604 * src/parse-skel.y (string, string.1): New.
12605 (section.header): Use it.
12606 (section.yacc): Remove.
12607 (prefix): Remove too.
12608 * src/scan-skel.l: Adjust.
12609 * src/bison.simple, src/bison.hairy: Adjust.
12611 2002-01-09 Akim Demaille <akim@epita.fr>
12613 * configure.in (WERROR_CFLAGS): Compute it.
12614 * src/Makefile.am (CFLAGS): Pass it.
12615 * tests/atlocal.in (CFLAGS): Idem.
12616 * src/files.c: Fix a few warnings.
12617 (get_extension_index): Remove, unused.
12619 2002-01-08 Akim Demaille <akim@epita.fr>
12621 * src/getargs.c (AS_FILE_NAME): New.
12622 (getargs): Use it to convert DOSish file names.
12623 * src/files.c (base_name): Rename as full_base_name to avoid
12624 clashes with `base_name ()'.
12625 (filename_split): New.
12626 (compute_base_names): N-th rewrite, using filename_split.
12628 2002-01-08 Akim Demaille <akim@epita.fr>
12630 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
12631 New, stolen from the Fileutils 4.1.
12632 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12633 * configure.in: Check for the presence of memrchr, and of its
12636 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12638 * lib/hash.h (__P): Added definition for this macro.
12639 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
12640 BUILT_SOURCES, to ensure they are generated first.
12641 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
12642 %error-verbose to allow bootstrapping with bison 1.30x.
12644 2002-01-06 Akim Demaille <akim@epita.fr>
12646 * src/reader.c (parse_braces): Don't fetch the next char, the
12647 convention is to fetch on entry.
12648 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
12649 'switch' without a following semicolon.
12650 * tests/regression.at (braces parsing): New.
12652 2002-01-06 Akim Demaille <akim@epita.fr>
12654 Bison is dead wrong in its RR conflict reports.
12656 * tests/torture.at (GNU Cim Grammar): New.
12657 * src/conflicts.c (count_rr_conflicts): Fix.
12659 2002-01-06 Akim Demaille <akim@epita.fr>
12661 Creating package.m4 from configure.ac causes too many problems.
12663 * tests/Makefile.am (package.m4): Create it by hand,
12664 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12666 2002-01-06 Akim Demaille <akim@epita.fr>
12668 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12671 2002-01-04 Paul Eggert <eggert@twinsun.com>
12673 * doc/bison.texinfo (Debugging):
12674 Remove YYSTDERR; it's no longer defined or used.
12675 Also, s/cstdio.h/cstdio/.
12677 2002-01-03 Akim Demaille <akim@epita.fr>
12679 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12681 2002-01-03 Akim Demaille <akim@epita.fr>
12683 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12684 tracing code to --trace, wait for a better --trace option, with
12687 2002-01-03 Akim Demaille <akim@epita.fr>
12689 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12690 The ISO C++ standard is extremely clear about it: stderr is
12691 considered a macro, not a regular symbol (see table 94 `Header
12692 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12693 Therefore std:: does not apply to it. It still does with fprintf.
12694 Also, s/cstdio.h/cstdio/.
12696 2002-01-03 Akim Demaille <akim@epita.fr>
12698 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12699 for non system headers.
12701 2002-01-02 Akim Demaille <akim@epita.fr>
12703 Equip the skeleton chain with location tracking, runtime trace,
12704 pure parser and scanner.
12706 * src/parse-skel.y: Request a pure parser, locations, and prefix
12708 (%union): Having several members with the same type does not help
12709 type mismatches, simplify.
12710 (YYPRINT, yyprint): New.
12711 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12712 (skel_error): this.
12714 * src/scan-skel.l: Adjust to these changes.
12715 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12716 (LOCATION_PRINT, skel_control_t): New.
12718 2001-12-30 Akim Demaille <akim@epita.fr>
12720 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12721 replace `gb' with BLANKS.
12722 * src/scan-skel.l: Adjust.
12724 2001-12-30 Akim Demaille <akim@epita.fr>
12726 * src/system.h: We don't need nor want bcopy.
12727 Throw away MS-DOS crap: we don't need getpid.
12728 * configure.in: We don't need strndup. It was even causing
12729 problems: because Flex includes the headers *before* us,
12730 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12732 * lib/xstrndup.c: New.
12733 * src/scan-skel.l: Use it.
12734 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12735 * src/parse-skel.y: Use %directives instead of #defines.
12737 2001-12-30 Akim Demaille <akim@epita.fr>
12739 * src/skeleton.h: New.
12740 * src/output.c (output_parser, output_master_parser): Remove, dead
12742 * src/output.h (get_lines_number, actions_output, guards_output)
12743 (token_definitions_output): Prototype them.
12744 * src/parse-skel.y: Add the license notice.
12745 Include output.h and skeleton.h.
12746 (process_skeleton): Returns void, and takes a single parameter.
12747 * src/scan-skel.l: Add the license notice.
12748 Include skeleton.h.
12749 Don't use %option yylineno: it seems that then Flex imagines
12750 REJECT has been used, and therefore it won't reallocate its
12751 buffers (which makes no other sense to me than a bug). It results
12752 in warnings for `unused: yy_flex_realloc'.
12754 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
12756 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12757 (MUSCLE_INSERT_PREFIX): ...to there.
12758 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12759 (MUSCLE_INSERT_PREFIX): Move from here...
12761 * src/bison.hairy: Add a section directive. Put braces around muscle
12762 names. This parser skeleton is still broken, but Bison should not
12763 choke on a bad muscle 'syntax'.
12764 * src/bison.simple: Add a section directive. Put braces around muscle
12767 * src/files.h (strsuffix, stringappend): Add declarations.
12768 (tab_extension): Add declaration.
12769 (short_base_name): Add declaration.
12771 * src/files.c (strsuffix, stringappend): No longer static. These
12772 functions are used in the skeleton parser.
12773 (tab_extension): New.
12774 (compute_base_names): Use the computations done in this function
12775 to guess if the generated parsers should have '.tab' in their
12777 (short_base_name): No longer static.
12779 * src/output.c (output_skeleton): New.
12780 (output): Disable call to output_master_parser, and give a try to
12781 a new skeleton handling system.
12782 (guards_output, actions_output): No longer static.
12783 (token_definitions_output, get_lines_number): No longer static.
12785 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12787 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
12790 * src/parse-skel.y: New file.
12791 * src/scan-skel.l: New file.
12793 2001-12-29 Akim Demaille <akim@epita.fr>
12795 %name-prefix is broken.
12797 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12798 Adjust all dependencies.
12799 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12802 Renaming yylval but not yylloc is not consistent. Now we do.
12804 * src/bison.simple: Prefix yylloc if used.
12805 * doc/bison.texinfo (Decl Summary): Document that.
12807 2001-12-29 Akim Demaille <akim@epita.fr>
12809 * doc/bison.texinfo: Promote `%long-directive' over
12811 Remove all references to fixed-output-files, yacc is enough.
12813 2001-12-29 Akim Demaille <akim@epita.fr>
12815 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12816 user prologue. These are defaults.
12817 * tests/actions.at (Mid-rule actions): Make sure the user can
12818 define YYDEBUG and YYERROR_VERBOSE.
12820 2001-12-29 Akim Demaille <akim@epita.fr>
12822 * src/output.c (header_output): Don't forget to export YYLTYPE and
12824 * tests/headers.at (export YYLTYPE): New, make sure it does.
12825 * tests/regression.at (%union and --defines, Invalid CPP headers):
12827 * tests/headers.at: here.
12829 2001-12-29 Akim Demaille <akim@epita.fr>
12831 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12833 2001-12-29 Akim Demaille <akim@epita.fr>
12835 * tests/actions.at (Mid-rule actions): Output on a single line
12836 instead of several.
12838 2001-12-29 Akim Demaille <akim@epita.fr>
12840 * doc/bison.texinfo: Formatting changes.
12842 2001-12-29 Akim Demaille <akim@epita.fr>
12844 Don't store the token defs in a muscle, just be ready to output it
12845 on command. Now possible via `symbols'. Fixes a memory leak.
12847 * src/output.c (token_definitions_output): New.
12848 (output_parser, header_output): Use it.
12849 * src/reader.c (symbols_save): Remove.
12851 2001-12-29 Akim Demaille <akim@epita.fr>
12853 * src/bison.simple: Do not provide a default for YYSTYPE and
12854 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12857 2001-12-29 Akim Demaille <akim@epita.fr>
12859 Mid-rule actions are simply... ignored!
12861 * src/reader.c (readgram): Be sure to attach mid-rule actions to
12862 the empty-rule associated to the dummy symbol, not to the host
12864 * tests/actions.at (Mid-rule actions): New.
12866 2001-12-29 Akim Demaille <akim@epita.fr>
12870 * src/reader.c (reader): Free grammar.
12872 2001-12-29 Akim Demaille <akim@epita.fr>
12876 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12877 since it allocates it for each state, although only one is needed.
12878 (allocate_storage): Do it here.
12880 2001-12-29 Akim Demaille <akim@epita.fr>
12882 * src/options.h, src/options.c (create_long_option_table): Rename
12884 (long_option_table_new): this, with a clearer prototype.
12885 (percent_table): Remove, unused,
12886 * src/getargs.c (getargs): Adjust.
12888 2001-12-29 Akim Demaille <akim@epita.fr>
12890 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
12891 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
12894 2001-12-29 Akim Demaille <akim@epita.fr>
12896 * src/lalr.c (build_relations): Rename `states' as `states1'.
12897 Sorry, I don't understand exactly what it is, no better name...
12899 2001-12-29 Akim Demaille <akim@epita.fr>
12901 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
12902 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
12903 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12906 2001-12-29 Akim Demaille <akim@epita.fr>
12908 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12911 2001-12-29 Akim Demaille <akim@epita.fr>
12913 * src/reader.c, src/reader.h (user_toknums): Remove.
12914 Adjust all users to use symbols[i]->user_token_number.
12916 2001-12-29 Akim Demaille <akim@epita.fr>
12918 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12919 Adjust all users to use symbols[i]->prec or ->assoc.
12921 2001-12-29 Akim Demaille <akim@epita.fr>
12923 * src/reader.c, src/reader.h (tags): Remove.
12924 Adjust all users to use symbols[i]->tag.
12926 2001-12-29 Akim Demaille <akim@epita.fr>
12928 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12930 * src/reader.c (packsymbols): Fill this table.
12932 * src/conflicts.c (resolve_sr_conflict): Adjust.
12933 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12935 Use symbols[i]->tag instead of tags[i].
12937 2001-12-29 Akim Demaille <akim@epita.fr>
12939 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12940 In addition, put a comment in there, to replace...
12941 * tests/regression.at (%union and C comments): Remove.
12943 2001-12-29 Akim Demaille <akim@epita.fr>
12945 * tests/regression.at (Web2c Actions): Blindly move the actual
12946 output as expected output. The contents *seem* right to me, but I
12947 can't pretend reading perfectly parser tables... Nonetheless, all
12948 the other tests pass correctly, the table look OK, even though the
12949 presence of `$axiom' is to be noted: AFAICS it is useless (but
12952 2001-12-29 Akim Demaille <akim@epita.fr>
12954 * src/reader.c (readgram): Don't add the rule 0 if there were no
12955 rules read. In other words, add it _after_ having performed
12956 grammar sanity checks.
12957 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12959 2001-12-29 Akim Demaille <akim@epita.fr>
12961 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12962 visible, and some states have now a different number.
12964 2001-12-29 Akim Demaille <akim@epita.fr>
12966 * src/reader.c (readgram): Bind the initial rule's lineno to that
12968 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12969 (Solved SR Conflicts): Adjust rule 0's line number.
12971 2001-12-29 Akim Demaille <akim@epita.fr>
12973 Fix the `GAWK Grammar' failure.
12975 * src/LR0.c (final_state): Initialize to -1 so that we do compute
12976 the reductions of the first state which was mistakenly confused
12977 with the final state because precisely final_state was initialized
12979 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
12980 now noticed by Bison.
12981 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
12982 have a reduction on $default.
12984 2001-12-29 Akim Demaille <akim@epita.fr>
12986 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
12988 * src/closure.c (print_closure): Likewise.
12989 * src/derives.c (print_derives): Likewise.
12990 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
12993 2001-12-29 Akim Demaille <akim@epita.fr>
12995 * src/lalr.c (lookaheads_print): New.
12996 (lalr): Call it when --trace-flag.
12997 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13000 2001-12-29 Akim Demaille <akim@epita.fr>
13002 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13003 when walking through ritem, even via rule->rhs.
13004 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13005 (useful_production, useless_nonterminals): Likewise.
13006 (reduce_grammar_tables): Likewise, plus update nritems.
13007 * src/nullable.c (set_nullable): Likewise.
13008 * src/lalr.c (build_relations): Likewise.
13009 * tests/sets.at (Nullable): Adjust.
13010 Fortunately, now, the $axiom is no longer nullable.
13012 2001-12-29 Akim Demaille <akim@epita.fr>
13014 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13016 * src/gram.c (ritem_longest_rhs): Likewise.
13017 * src/reduce.c (nonterminals_reduce): Likewise.
13018 * src/print_graph.c (print_graph): Likewise.
13019 * src/output.c (output_rule_data): Likewise.
13020 * src/nullable.c (set_nullable): Likewise.
13022 2001-12-29 Akim Demaille <akim@epita.fr>
13024 * src/output.c: Comment changes.
13026 2001-12-27 Paul Eggert <eggert@twinsun.com>
13028 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13029 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13030 Sparc, as they were causing more porting problems than the
13031 (minor) performance improvement was worth.
13033 Also, catch up with 1.31's YYSTD.
13035 2001-12-27 Akim Demaille <akim@epita.fr>
13037 * src/output.c (output_gram): Rely on nritems, not the
13038 0-sentinel. See below.
13039 Use -1 as separator, not 0.
13040 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13041 Rely on -1 as separator in yyrhs, instead of 0.
13042 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13043 twice `Now at end of input', therefore there are two lines less to
13046 2001-12-27 Akim Demaille <akim@epita.fr>
13048 * tests/regression.at (Unresolved SR Conflicts):
13049 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13052 2001-12-27 Akim Demaille <akim@epita.fr>
13054 * src/LR0.c (new_state): Recognize the final state by the fact it
13055 is reached by eoftoken.
13056 (insert_start_shifting_state, insert_eof_shifting_state)
13057 (insert_accepting_state, augment_automaton): Remove, since now
13058 these states are automatically computed from the initial state.
13059 (generate_states): Adjust.
13060 * src/print.c: When reporting a rule number to the user, substract
13061 1, so that the axiom rule is rule 0, and the first user rule is 1.
13062 * src/reduce.c: Likewise.
13063 * src/print_graph.c (print_core): For the time being, just as for
13064 the report, depend upon --trace-flags to dump the full set of
13066 * src/reader.c (readgram): Once the grammar read, insert the rule
13067 0: `$axiom: START-SYMBOL $'.
13068 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13069 number of the states has changed (the final state is no longer
13070 necessarily the last), catch up.
13072 2001-12-27 Akim Demaille <akim@epita.fr>
13074 Try to make the use of the eoftoken valid. Given that its value
13075 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13076 is used instead of > 0 where appropriate, (ii), depend upon nritems
13077 instead of the 0-sentinel.
13079 * src/gram.h, src/gram.c (nritems): New.
13080 Expected to be duplication of nitems, but for the time being...
13081 * src/reader.c (packgram): Assert nritems and nitems are equal.
13082 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13083 * src/closure.c (print_closure, print_fderives): Likewise.
13084 * src/gram.c (ritem_print): Likewise.
13085 * src/print.c (print_core, print_grammar): Likewise.
13086 * src/print_graph.c: Likewise.
13088 2001-12-27 Akim Demaille <akim@epita.fr>
13090 * src/main.c (main): If there are complains after grammar
13091 reductions, then output the report anyway if requested, then die.
13092 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13093 * src/reader.c (eoftoken): New.
13094 (parse_token_decl): If the token being defined has value `0', it
13096 (packsymbols): No longer hack `tags' to insert `$' by hand.
13097 Be sure to preserve the value of the eoftoken.
13098 (reader): Make sure eoftoken is defined.
13099 Initialize nsyms to 0: now eoftoken is created just like the others.
13100 * src/print.c (print_grammar): Don't special case the eof token.
13101 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13102 lie anyway, albeit pleasant.
13103 * tests/calc.at: Exercise error messages with eoftoken.
13104 Change the grammar so that empty input is invalid.
13105 Adjust expectations.
13106 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13108 2001-12-27 Akim Demaille <akim@epita.fr>
13110 * configure.in: Check the protos of strchr ans strspn.
13111 Replace strchr if needed.
13112 * src/system.h: Provide the protos of strchr, strspn and memchr if
13114 * lib/strchr.c: New.
13115 * src/reader.c (symbols_save): Use strchr.
13117 2001-12-27 Akim Demaille <akim@epita.fr>
13119 * src/print.c, src/print_graph.c (escape): New.
13120 Use it to quote the TAGS outputs.
13121 * src/print_graph.c (print_state): Now errors are in red, and
13122 reductions in green.
13123 Prefer high to wide: output the state number on a line of its own.
13125 2001-12-27 Akim Demaille <akim@epita.fr>
13127 * src/state.h, src/state.c (reductions_new): New.
13128 * src/LR0.c (set_state_table): Let all the states have a
13129 `reductions', even if reduced to 0.
13130 (save_reductions): Adjust.
13131 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13132 * src/print.c (print_reductions, print_actions): Adjust.
13133 * src/output.c (action_row): Adjust.
13135 2001-12-27 Akim Demaille <akim@epita.fr>
13137 * src/state.h, src/state.c (errs_new, errs_dup): New.
13138 * src/LR0.c (set_state_table): Let all the states have an errs,
13139 even if reduced to 0.
13140 * src/print.c (print_errs, print_reductions): Adjust.
13141 * src/output.c (output_actions, action_row): Adjust.
13142 * src/conflicts.c (resolve_sr_conflict): Adjust.
13144 2001-12-27 Akim Demaille <akim@epita.fr>
13146 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13148 2001-12-27 Akim Demaille <akim@epita.fr>
13150 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13151 * src/print.c: here.
13152 (lookaheadset, shiftset): New, used as additional storage by
13154 (print_results): Adjust.
13155 (print_shifts, print_gotos, print_errs): New, extracted from...
13156 (print_actions): here.
13157 * src/print_graph.c (print_actions): Remove dead code.
13159 2001-12-27 Akim Demaille <akim@epita.fr>
13161 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13164 2001-12-27 Akim Demaille <akim@epita.fr>
13166 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13167 (build_relations): Adjust.
13169 2001-12-27 Akim Demaille <akim@epita.fr>
13171 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13174 2001-12-27 Akim Demaille <akim@epita.fr>
13176 * src/reader.c (packgram): Catch nitems overflows.
13178 2001-12-27 Akim Demaille <akim@epita.fr>
13180 * src/files.c, src/files.h (guard_obstack): Remove.
13181 * src/output.c (output): Adjust.
13182 * src/reader.c (parse_braces): New, factoring...
13183 (copy_action, copy_guard): these two which are renamed as...
13184 (parse_action, parse_guard): these.
13185 As a voluntary consequence, using braces around guards is now
13188 2001-12-27 Akim Demaille <akim@epita.fr>
13190 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13191 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13193 (symbol_list_new): Adjust.
13194 (copy_action): action_line is the first line, not the last.
13195 (copy_guard): Just as for actions, store the `action' only, not
13196 the switch/case/break flesh.
13197 Don't parse the user action that might follow the guard, let...
13198 (readgram): do it, i.e., now, there can be an action after a
13200 In other words the guard is just explicitly optional.
13201 (packgram): Adjust.
13202 * src/output.c (guards_output): New.
13203 (output_parser): Call it when needed.
13204 (output): Also free the guard and attrs obstacks.
13205 * src/files.c, src/files.h (obstack_save): Remove.
13206 (output_files): Remove.
13207 As a result, if one needs the former `.act' file, using an
13208 appropriate skeleton which requires actions and guards is now
13210 * src/main.c (main): Adjust.
13211 * tests/semantic.at: New.
13212 * tests/regression.at: Use `input.y' as input file name.
13213 Avoid 8+3 problems by requiring input.c when the test needs the
13216 2001-12-27 Akim Demaille <akim@epita.fr>
13218 * src/reader.c (symbol_list_new): Be sure to initialize all the
13221 2001-12-27 Akim Demaille <akim@epita.fr>
13223 All the hacks using a final pseudo state are now useless.
13225 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13226 * src/lalr.c (nLA): New.
13227 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13228 instead of lookaheadsp from the pseudo state (nstate + 1).
13230 2001-12-27 Akim Demaille <akim@epita.fr>
13232 * src/output.c (action_row, token_actions): Use a state_t instead
13233 of a integer, and nlookaheads instead of the following state's
13236 2001-12-27 Akim Demaille <akim@epita.fr>
13238 * src/conflicts.c (log_resolution, flush_shift)
13239 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13240 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13241 (conflicts_print, print_reductions): Use a state_t instead of an
13242 integer when referring to a state.
13243 As much as possible, depend upon nlookaheads, instead of the
13244 `lookaheadsp' member of the following state (since lookaheads of
13245 successive states are successive, the difference between state n + 1
13246 and n served as the number of lookaheads for state n).
13247 * src/lalr.c (add_lookback_edge): Likewise.
13248 * src/print.c (print_core, print_actions, print_state)
13249 (print_results): Likewise.
13250 * src/print_graph.c (print_core, print_actions, print_state)
13251 (print_graph): Likewise.
13252 * src/conflicts.h: Adjust.
13254 2001-12-27 Akim Demaille <akim@epita.fr>
13256 * src/bison.hairy: Formatting/comment changes.
13258 Remove `register' indications.
13259 Add plenty of `static'.
13261 2001-12-27 Akim Demaille <akim@epita.fr>
13263 * src/output.c (prepare): Drop the muscle `ntbase' which
13264 duplicates ntokens.
13265 * src/bison.simple: Formatting/comment changes.
13266 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13267 is an undocumented synonym.
13269 2001-12-22 Akim Demaille <akim@epita.fr>
13271 * src/output.c (output_table_data): Change the prototype to use
13272 `int' for array ranges: some invocations do pass an int, not a
13274 Reported by Wayne Green.
13276 2001-12-22 Akim Demaille <akim@epita.fr>
13278 Some actions of web2c.y are improperly triggered.
13279 Reported by Mike Castle.
13281 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13282 * tests/regression.at (Web2c): Rename as...
13283 (Web2c Report): this.
13284 (Web2c Actions): New.
13286 2001-12-22 Akim Demaille <akim@epita.fr>
13288 Reductions in web2c.y are improperly reported.
13289 Reported by Mike Castle.
13291 * src/conflicts.c (print_reductions): Fix.
13292 * tests/regression.at (Web2c): New.
13294 2001-12-18 Akim Demaille <akim@epita.fr>
13296 Some host fail on `assert (!"foo")', which expands to
13297 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13298 Reported by Nelson Beebee.
13300 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13301 `#define it_succeeded 0' and `assert (it_succeeded)'.
13303 2001-12-17 Marc Autret <autret_m@epita.fr>
13305 * src/bison.simple: Don't hard code the skeleton line and filename.
13306 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13307 New line counter 'skeleton_line' (skeleton-line muscle).
13309 2001-12-17 Paul Eggert <eggert@twinsun.com>
13311 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13312 YYDEBUG must be defined to a nonzero value.
13314 * src/bison.simple (yytname): Do not assume that the user defines
13315 YYDEBUG to a properly parenthesized expression.
13317 2001-12-17 Akim Demaille <akim@epita.fr>
13319 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13320 nlookaheads is a new member.
13322 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13323 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13326 2001-12-17 Akim Demaille <akim@epita.fr>
13328 * src/files.h, src/files.c (open_files, close_files): Remove.
13329 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13331 * src/reader.c (reader): Do it.
13333 2001-12-17 Akim Demaille <akim@epita.fr>
13335 * src/conflicts.c (print_reductions): Formatting changes.
13337 2001-12-17 Akim Demaille <akim@epita.fr>
13339 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13340 (flush_reduce): New.
13341 (resolve_sr_conflict): Adjust.
13343 2001-12-17 Akim Demaille <akim@epita.fr>
13345 * src/output.c (output_obstack): Be static and rename as...
13346 (format_obstack): this, to avoid any confusion with files.c's
13348 * src/reader.h (muscle_obstack): Move to...
13349 * src/output.h: here, since it's defined in output.c.
13351 2001-12-17 Akim Demaille <akim@epita.fr>
13353 * src/output.c (action_row, save_column, default_goto)
13354 (sort_actions, matching_state, pack_vector): Better variable
13357 2001-12-17 Akim Demaille <akim@epita.fr>
13359 * src/output.c: Various formatting changes.
13361 2001-12-17 Akim Demaille <akim@epita.fr>
13363 * src/files.c (output_files): Free the output_obstack.
13364 * src/main.c (main): Call print and print_graph conditionally.
13365 * src/print.c (print): Work unconditionally.
13366 * src/print_graph.c (print_graph): Work unconditionally.
13367 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13369 2001-12-16 Marc Autret <autret_m@epita.fr>
13371 * src/output.c (actions_output): Fix. When we use %no-lines,
13372 there is one less line per action.
13374 2001-12-16 Marc Autret <autret_m@epita.fr>
13376 * src/bison.simple: Remove a useless #line directive.
13377 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13378 * src/output.c (get_lines_number): New.
13379 (output_parser): Adjust, now takes care about the lines of a
13381 Fix line numbering.
13382 (actions_output): Computes the number of lines taken by actions.
13383 (output_master_parser): Insert new skeleton which is the name of
13384 the output parser file name.
13386 2001-12-15 Marc Autret <autret_m@epita.fr>
13388 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13390 2001-12-15 Marc Autret <autret_m@epita.fr>
13392 * src/output.c (output_gram): Keep track of the hairy one.
13394 2001-12-15 Akim Demaille <akim@epita.fr>
13396 Make `make distcheck' work.
13398 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13399 system.h which uses libgettext.h.
13401 2001-12-15 Akim Demaille <akim@epita.fr>
13403 * src/nullable.c (set_nullable): Useless rules must be skipped,
13404 otherwise, since we range over their symbols, we might look at a
13405 nonterminal which no longer ``exists'', i.e., it is not counted in
13406 `nvars', hence we overflow our arrays.
13408 2001-12-15 Akim Demaille <akim@epita.fr>
13410 The header can also be produced directly, without any obstack!
13413 * src/files.c, src/files.h (defines_obstack): Remove.
13414 (compute_header_macro): Global.
13415 (defines_obstack_save): Remove.
13416 * src/reader.c (parse_union_decl): No longer output to
13417 defines_obstack: its content can be found in the `stype' muscle
13419 (output_token_translations): Merge into...
13420 (symbols_output): this.
13422 (symbols_save): this.
13424 * src/output.c (header_output): New.
13427 2001-12-15 Akim Demaille <akim@epita.fr>
13429 * src/reader.c (parse_union_decl): Instead of handling two obstack
13430 simultaneously, use one to define the `stype' muscle, and use the
13431 value of the latter to fill defines_obstack.
13432 (copy_comment): Remove.
13433 (copy_comment2): Work for a single obstack.
13435 (copy_comment): this.
13437 2001-12-15 Akim Demaille <akim@epita.fr>
13439 * src/lex.c, src/lex.h (xgetc): No longer static.
13440 * src/reader.c (parse_union_decl): Revamp.
13442 2001-12-15 Akim Demaille <akim@epita.fr>
13444 Still making progress in separating Bison into (i) input, (ii)
13445 process, (iii) output: now we can directly output the parser file
13446 without using table_obstack at all.
13448 * src/files.c, src/files.h (table_obstack): Bye bye.
13449 (parser_file_name): New.
13450 * src/files.c (compute_output_file_names): Compute it.
13451 * src/output.c (actions_output, output_parser)
13452 (output_master_parser): To a file instead of an obstack.
13454 2001-12-15 Akim Demaille <akim@epita.fr>
13456 Attach actions to rules, instead of pre-outputting them to
13459 * src/gram.h (rule_t): action and action_line are new members.
13460 * src/reader.c (symbol_list): Likewise.
13461 (copy_action): Save the actions within the rule.
13462 (packgram): Save them in rule_table.
13463 * src/output.c (actions_output): New.
13464 (output_parser): Use it on `%%actions'.
13465 (output_rule_data): Don't free rule_table.
13467 (prepare): Don't save the `action' muscle.
13468 * src/bison.simple: s/%%action/%%actions/.
13470 2001-12-15 Akim Demaille <akim@epita.fr>
13472 * src/reader.c (copy_action): When --yacc, don't append a `;'
13473 to the user action: let it fail if lacking.
13474 Suggested by Arnold Robbins and Tom Tromey.
13476 2001-12-14 Akim Demaille <akim@epita.fr>
13478 * src/lex.c (literalchar): Simply return the char you decoded, non
13479 longer mess around with obstacks and int pointers.
13480 Adjust all callers.
13482 2001-12-14 Akim Demaille <akim@epita.fr>
13484 * src/lex.c (literalchar): Don't escape the special characters,
13485 just decode them, and keep them as char (before, eol was output as
13486 the 2 char string `\n' etc.).
13487 * src/output.c (output_rule_data): Use quotearg to output the
13490 2001-12-13 Paul Eggert <eggert@twinsun.com>
13492 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13493 Do not infringe on the global user namespace when using C++.
13494 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13495 All uses of `fprintf' and `stderr' changed.
13497 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13499 2001-12-13 Akim Demaille <akim@epita.fr>
13501 The computation of nullable is broken: it doesn't handle empty
13504 * tests/torture.at (GNU AWK Grammar): New.
13505 * tests/sets.at (Nullable): New.
13506 * src/nullable.c (set_nullable): Instead of blindly looping over
13507 `ritems', loop over the rules, and then over their rhs's.
13509 Work around Autotest bugs.
13511 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13512 frame, because Autotest understand lines starting with a `+' as
13513 traces from the shell. Then, they are not processed properly.
13514 Admittedly an Autotest bug, but we don't have time to wait for
13515 Autotest to catch up.
13516 * tests/regression.at (Broken Closure): Adjust to the new table
13519 * tests/sets.at: here.
13521 2001-12-13 Akim Demaille <akim@epita.fr>
13523 * src/closure.c (closure): Use nrules instead of playing tricks
13524 with BITS_PER_WORD.
13526 2001-12-13 Akim Demaille <akim@epita.fr>
13528 * src/print.c (print_actions): Output the handling of `$' as the
13529 traces do: shifting the token EOF. Before EOF was treated as a
13531 * tests/regression.at: Adjust some tests.
13532 * src/print_graph.c (print_core): Complete the set of items via
13533 closure. The next-to-final and final states are still unsatisfying,
13534 but that's to be addressed elsewhere.
13535 No longer output the rule numbers, but do output the state number.
13536 A single loop for the shifts + gotos is enough, but picked a
13537 distinct color for each.
13538 (print_graph): Initialize and finalize closure.
13540 2001-12-13 Akim Demaille <akim@epita.fr>
13542 * src/reader.c (readgram): Remove dead code, an strip useless
13544 (get_type): Remove, unused.
13546 2001-12-12 Akim Demaille <akim@epita.fr>
13548 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13549 on that of lib/error.c.
13551 2001-12-12 Akim Demaille <akim@epita.fr>
13553 Some hosts don't like `/' in includes.
13555 * src/system.h: Include libgettext.h without qualifying the path.
13556 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13559 2001-12-11 Marc Autret <autret_m@epita.fr>
13561 * src/output.c (output_parser): Remove useless muscle.
13563 2001-12-11 Marc Autret <autret_m@epita.fr>
13565 * src/bison.simple: Remove #line just before %%epilogue. It
13566 is now handled in ...
13567 * src/reader.c (read_additionnal_code): Add the output of a
13568 #line for the epilogue.
13570 2001-12-10 Marc Autret <autret_m@epita.fr>
13572 * src/reader.c (copy_definition): Re-use CPP-outed code which
13573 replace precedent remove.
13574 * src/bison.simple: Remove #line before %%prologue because
13575 %%input-line is wrong at this time.
13577 2001-12-10 Marc Autret <autret_m@epita.fr>
13579 * src/reader.c (symbols_output): Clean up.
13580 * src/output.c (output_gram, output): Clean up.
13582 2001-12-10 Akim Demaille <akim@epita.fr>
13584 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13585 * src/LR0.c (set_state_table): here.
13586 * src/lalr.c (lalr): Call it.
13588 2001-12-10 Akim Demaille <akim@epita.fr>
13590 * src/state.h (shifts): Remove the `number' member: shifts are
13591 attached to state, hence no longer need to be labelled with a
13594 2001-12-10 Akim Demaille <akim@epita.fr>
13596 Now that states have a complete set of members, the linked list of
13597 shifts is useless: just fill directly the state's shifts member.
13599 * src/state.h (shifts): Remove the `next' member.
13600 * src/LR0.c (first_state, last_state): Remove.
13601 Adjust the callers.
13602 (augment_automaton): Don't look for the shifts that must be added
13603 a shift on EOF: it is those of the state we looked for! But now,
13604 since shifts are attached, it is no longer needed to looking
13605 merely by its id: its number.
13607 2001-12-10 Akim Demaille <akim@epita.fr>
13609 * src/LR0.c (augment_automaton): Better variable locality.
13610 Remove an impossible branch: if there is a state corresponding to
13611 the start symbol being shifted, then there is shift for the start
13612 symbol from the initial state.
13614 2001-12-10 Akim Demaille <akim@epita.fr>
13616 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13617 only when appropriate: when insert_start_shifting_state' is not
13619 * tests/regression.at (Rule Line Numbers): Adjust.
13621 2001-12-10 Akim Demaille <akim@epita.fr>
13623 * src/LR0.c (augment_automaton): Now that all states have shifts,
13624 merge the two cases addition shifts to the initial state.
13626 2001-12-10 Akim Demaille <akim@epita.fr>
13628 * src/lalr.c (set_state_table): Move to...
13630 * src/lalr.c (lalr): Don't call it...
13631 * src/LR0.c (generate_states): do it.
13632 * src/LR0.h (first_state): Remove, only the table is used.
13634 2001-12-10 Akim Demaille <akim@epita.fr>
13636 * src/LR0.h (first_shift, first_reduction): Remove.
13637 * src/lalr.c: Don't use first_shift: find shifts through the
13640 2001-12-10 Akim Demaille <akim@epita.fr>
13642 * src/LR0.c: Attach shifts to states as soon as they are
13644 * src/lalr.c (set_state_table): Instead of assigning shifts to
13645 state, just assert that the mapping was properly done.
13647 2001-12-10 Akim Demaille <akim@epita.fr>
13649 * src/LR0.c (insert_start_shift): Rename as...
13650 (insert_start_shifting_state): this.
13651 (insert_eof_shifting_state, insert_accepting_state): New.
13652 (augment_automaton): Adjust.
13653 Better locality of the variables.
13654 When looking if the start_symbol is shifted from the initial
13655 state, using `while (... symbol != start_symbol ...)' sounds
13656 better than `while (... symbol < start_symbol ...)': If fail
13657 to see how the order between symbols could be relevant!
13659 2001-12-10 Akim Demaille <akim@epita.fr>
13661 * src/getargs.h: Don't declare `spec_name_prefix' and
13662 `spec_file_prefix', declared by src/files.h.
13663 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
13664 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
13665 * src/output.c (prepare): Adjust.
13666 * src/reader.c (symbols_output): Likewise.
13667 * src/vmsgetargs.c: Vaguely adjust, but who cares?
13669 2001-12-10 Akim Demaille <akim@epita.fr>
13671 * src/muscle_tab.c (muscle_init): NULL is a better default than
13674 2001-12-10 Akim Demaille <akim@epita.fr>
13676 * src/reader.c (reader): Calling symbols_output once is enough.
13678 2001-12-10 Akim Demaille <akim@epita.fr>
13680 Now that states have a complete set of members, the linked list of
13681 reductions is useless: just fill directly the state's reductions
13684 * src/state.h (struct reductions): Remove member `number' and
13686 * src/LR0.c (first_reduction, last_reduction): Remove.
13687 (save_reductions): Don't link the new reductions, store them in
13689 * src/lalr.c (set_state_table): No need to attach reductions to
13690 states, it's already done.
13691 * src/output.c (output_actions): No longer free the shifts, then
13692 the reductions, then the states: free all the states and their
13695 2001-12-10 Akim Demaille <akim@epita.fr>
13697 * src/options.c (OPTN, DRTV, BOTH): New.
13698 (option_table): Use them.
13700 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13701 the job of system.h.
13702 * src/options.c: Don't include stdio.h and xalloc.h for the same
13705 2001-12-10 Akim Demaille <akim@epita.fr>
13707 * src/output.c (output, prepare): Make sure the values of the
13708 muscles `action' and `prologue' are 0-terminated.
13710 2001-12-10 Akim Demaille <akim@epita.fr>
13712 Clean up GCC warnings.
13714 * src/reader.c (copy_action): `buf' is not used.
13715 (parse_skel_decl): Be static.
13716 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13717 * src/options.h (create_long_option_table): Have a real prototype.
13718 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13719 (hash_delete_at): Return const void *.
13720 Adjust casts to preserve the const.
13722 2001-12-10 Akim Demaille <akim@epita.fr>
13724 * configure.in: Require 2.52g.
13725 M4 is not needed, but AUTOM4TE is.
13726 * m4/m4.m4: Remove.
13727 * tests/Makefile.am: Adjust.
13729 2001-12-10 Akim Demaille <akim@epita.fr>
13731 One structure for states is enough, even though theoretically
13732 there are LR(0) states and LALR(1) states.
13734 * src/lalr.h (state_t): Remove.
13735 (state_table): Be state_t **, not state_t *.
13736 * src/state.h (core, CORE_ALLOC): Rename as...
13737 (state_t, STATE_ALLOC): this.
13738 Add the LALR(1) members: shifts, reductions, errs.
13739 * src/LR0.c (state_table): Rename as...
13740 (state_hash): this, to avoid name clashes with the global
13742 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13743 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13745 2001-12-10 Akim Demaille <akim@epita.fr>
13747 Bison dumps core on bash.y.
13748 Reported by Pascal Bart.
13750 * src/warshall.c (bitmatrix_print): New.
13752 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
13753 j must be the outer loop.
13754 * tests/regression.at (Broken Closure): New.
13756 2001-12-05 Akim Demaille <akim@epita.fr>
13758 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13760 Reported by Peter Hamorsky.
13762 2001-12-05 Akim Demaille <akim@epita.fr>
13764 * src/conflicts.c (err_table): Remove.
13765 (resolve_sr_conflict): Adjust.
13766 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13768 (state_t.reductions, state_t.shifts): this.
13770 2001-12-05 Akim Demaille <akim@epita.fr>
13772 * src/reduce.c (reduce_grammar_tables): No longer disable the
13773 removal of useless rules via CPP but via `if (0)', so that the
13774 compiler still check the code is valid.
13775 For instance, it should have noticed `rline' no longer exists: use
13776 the `line' member of rule_t.
13777 * src/gram.c (dummy, rline): Remove, unused.
13779 2001-12-05 Akim Demaille <akim@epita.fr>
13781 * src/output.c (pack_vector): Use assert, not berror.
13782 * src/main.c (berror): Remove, unused.
13784 2001-12-05 Akim Demaille <akim@epita.fr>
13786 New experimental feature: if --verbose --trace output all the
13787 items of a state, not only its kernel.
13789 * src/print.c (print_core): If `trace_flag', then invoke closure
13790 before outputting the items of the state (print_core is no longer
13791 a correct name them).
13792 (print_results): Invoke new_closure/free_closure if needed.
13794 2001-12-05 Akim Demaille <akim@epita.fr>
13796 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13797 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13798 (nitemset): for consistency with the rest of the project.
13800 2001-12-05 Akim Demaille <akim@epita.fr>
13802 * src/closure.c (print_closure): Improve.
13803 (closure): Use it for printing input and output.
13805 2001-12-05 Akim Demaille <akim@epita.fr>
13807 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13808 indexed by nonterminals.
13810 2001-12-05 Akim Demaille <akim@epita.fr>
13812 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13814 * src/warshall.h: Remove accidental duplication of the content.
13816 2001-12-05 Akim Demaille <akim@epita.fr>
13818 * src/closure.c (set_fderives): De-obfuscate.
13820 2001-12-05 Akim Demaille <akim@epita.fr>
13822 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13824 2001-12-05 Akim Demaille <akim@epita.fr>
13826 * src/closure.c (set_firsts): De-obfuscate.
13828 2001-12-05 Akim Demaille <akim@epita.fr>
13830 * src/output.c (action_row): De-obfuscate
13831 using the good o' techniques: arrays not pointers, variable
13832 locality, BITISSET, RESETBIT etc.
13834 2001-12-05 Akim Demaille <akim@epita.fr>
13836 Pessimize the code to simplify it: from now on, all the states
13837 have a valid SHIFTS, which NSHIFTS is possibly 0.
13839 * src/LR0.c (shifts_new): Be global and move to..
13840 * src/state.c, src/state.h: here.
13841 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13842 * src/print_graph: Adjust.
13844 2001-12-05 Akim Demaille <akim@epita.fr>
13846 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13847 * src/conflicts.c: Use it.
13848 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13849 incorrectly ``simplified''.
13851 2001-12-05 Akim Demaille <akim@epita.fr>
13853 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
13854 using the good o' techniques: arrays not pointers, variable
13855 locality, BITISSET, RESETBIT etc.
13857 2001-12-05 Akim Demaille <akim@epita.fr>
13859 * src/state.h (SHIFT_SYMBOL): New.
13860 * src/conflicts.c: Use it to deobfuscate.
13862 2001-12-05 Akim Demaille <akim@epita.fr>
13864 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
13865 (print_reductions): De-obfuscate using the good o' techniques:
13866 arrays not pointers, variable locality, BITISSET.
13868 2001-12-05 Akim Demaille <akim@epita.fr>
13870 * src/conflicts.c (print_reductions): Arrays, not pointers.
13873 2001-12-05 Akim Demaille <akim@epita.fr>
13875 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13877 2001-12-05 Akim Demaille <akim@epita.fr>
13879 * src/conflicts.c (print_reductions): Improve variable locality.
13881 2001-12-05 Akim Demaille <akim@epita.fr>
13883 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13885 2001-12-05 Akim Demaille <akim@epita.fr>
13887 * src/conflicts.c (print_reductions): Improve variable locality.
13889 2001-12-05 Akim Demaille <akim@epita.fr>
13891 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13892 * src/lalr.c: Use them.
13894 2001-12-05 Akim Demaille <akim@epita.fr>
13896 * src/LR0.c (augment_automaton): Formatting changes.
13897 Better variable locality.
13899 2001-12-05 Akim Demaille <akim@epita.fr>
13901 * src/lalr.c (matrix_print): New.
13902 (transpose): Use it.
13903 Use arrays instead of pointers.
13905 2001-12-05 Akim Demaille <akim@epita.fr>
13907 * src/lalr.c (maxrhs): Move to...
13908 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
13909 * src/lalr.c (build_relations): Adjust.
13911 2001-12-05 Akim Demaille <akim@epita.fr>
13913 * src/lalr.c (transpose): Free the memory allocated to the
13914 argument, as it is replaced by the results by the unique caller.
13915 (build_relations): Merely invoke transpose: it handles the memory
13917 Improve variable locality.
13918 Avoid variables used as mere abbreviations.
13919 (compute_lookaheads): Use arrays instead of pointers.
13921 2001-12-05 Akim Demaille <akim@epita.fr>
13923 * src/lalr.c (initialize_F): Improve variable locality.
13924 Avoid variables used as mere abbreviations.
13926 2001-12-05 Akim Demaille <akim@epita.fr>
13928 * src/derives.c (print_derives): Display the ruleno.
13929 * src/lalr.c (initialize_F, transpose): Better variable locality
13930 to improve readability.
13931 Avoid variables used as mere abbreviations.
13933 2001-12-05 Akim Demaille <akim@epita.fr>
13935 * src/lalr.c (traverse): Use arrays instead of pointers.
13937 2001-12-05 Akim Demaille <akim@epita.fr>
13939 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13940 the handling of squeue.
13941 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13943 2001-12-05 Akim Demaille <akim@epita.fr>
13945 Because useless nonterminals are now kept alive (instead of being
13946 `destroyed'), we now sometimes examine them, and store information
13947 related to them. Hence we need to know their number, and adjust
13948 memory allocations.
13950 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13952 * src/LR0.c (allocate_itemsets): The memory allocated to
13953 `symbol_count' was used for two different purpose: once to count
13954 the number of occurrences of each symbol, and later reassigned to
13955 `shift_symbol', containing the symbol that can be shifted from a
13957 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13959 (new_itemsets): Allocate `shift_symbol' here.
13960 (allocate_itemsets): symbol_count includes useless nonterminals.
13961 Make room for them.
13962 (free_storage): Use `free', not `XFREE', for pointers that cannot
13965 2001-12-05 Akim Demaille <akim@epita.fr>
13967 * src/nullable.c (set_nullable): Deobfuscate the handling of
13969 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13971 2001-12-05 Akim Demaille <akim@epita.fr>
13973 * src/gram.c, src/gram.h (ritem_print): New.
13974 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
13975 (This useless function was defined only to work around VMS linkers
13976 that can't handle compilation units with variables only).
13977 * src/reduce.c (dump_grammar): Use it to trace the construction of
13980 2001-12-04 Paul Eggert <eggert@twinsun.com>
13982 * src/bison.simple (union yyalloc): Change member names
13983 to be the same as the stack names.
13984 (yyparse): yyptr is now union yyalloc *, not char *.
13985 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
13986 and may generate better code on some machines.
13987 (yystpcpy): Use prototype if __STDC__ is defined, not just
13988 if __cplusplus is defined.
13990 2001-11-30 Akim Demaille <akim@epita.fr>
13992 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
13993 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
13994 Gettext doesn't compile cleanly, and dies with -Werror.
13995 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
13996 Include WARNING_CFLAGS here.
13997 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
13998 before being defined.
14000 2001-11-27 Paul Eggert <eggert@twinsun.com>
14002 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14003 First arg is int, not unsigned.
14004 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14005 (SIZE_MAX, UINT_MAX): New macros.
14006 (quotearg_n_options): Abort if N is negative.
14007 Avoid overflow check on hosts where size_t is 64 bits and int
14008 is 32 bits, as overflow is impossible there.
14009 Fix off-by-one typo that caused unnecessary reallocation.
14011 2001-11-29 Paul Eggert <eggert@twinsun.com>
14013 Name space cleanup in generated parser.
14015 * doc/bison.texinfo (Bison Parser): Discuss system headers
14016 and their effect on the user name space.
14018 * src/bison.simple:
14019 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14020 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14021 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14023 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14024 on user names when possible.
14026 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14027 Simplify test for whather <alloca.h> exists.
14029 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14031 (<stdio.h>): Include if YYDEBUG.
14033 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14034 ! defined (yyoverflow) && ! defined (yymemcpy).
14036 (yymemcpy, yyparse): Rename local variables as needed so that
14037 they all begin with 'yy'.
14039 (yystrlen, yystpcpy): New functions.
14041 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14044 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14045 instead of relying on string.h functions. Use YYSTACK_ALLOC
14046 and YYSTACK_FREE instead of malloc and free.
14048 2001-11-30 Akim Demaille <akim@epita.fr>
14050 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14051 before their first uses.
14052 (YYBISON, YYPURE): Move to the top of the output.
14054 2001-11-30 Akim Demaille <akim@epita.fr>
14056 * tests/reduce.at (Useless Nonterminals): Fix.
14058 2001-11-30 Akim Demaille <akim@epita.fr>
14060 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14061 if body instead of `;' to pacify GCC's warnings.
14063 2001-11-30 Akim Demaille <akim@epita.fr>
14065 Instead of mapping the LHS of unused rules to -1, keep the LHS
14066 valid, but flag the rules as invalid.
14068 * src/gram.h (rule_t): `useful' is a new member.
14069 * src/print.c (print_grammar): Adjust.
14070 * src/derives.c (set_derives): Likewise.
14071 * src/reader.c (packgram, reduce_output): Likewise.
14072 * src/reduce.c (reduce_grammar_tables): Likewise.
14073 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14075 2001-11-30 Akim Demaille <akim@epita.fr>
14077 * src/reduce.c (reduce_output): Formatting changes.
14078 * src/print.c (print_results, print_grammar): Likewise.
14079 * tests/regression.at (Rule Line Numbers)
14080 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14082 2001-11-30 Akim Demaille <akim@epita.fr>
14084 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14085 useless nonterminals, move them at the end of the symbol arrays.
14086 (reduce_output): Adjust.
14087 * tests/reduce.at (Useless Nonterminals): Adjust.
14089 2001-11-30 Akim Demaille <akim@epita.fr>
14091 * src/reduce.c: Various comment/formatting changes.
14092 (nonterminals_reduce): New, extracted from...
14093 (reduce_grammar_tables): here.
14094 (reduce_grammar): Call nonterminals_reduce.
14096 2001-11-29 Paul Eggert <eggert@twinsun.com>
14098 * src/bison.simple (YYSTACK_REALLOC): Remove.
14099 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14100 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14102 (union yyalloc): New type.
14103 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14104 an arbitrary restriction on hosts where size_t is wider than int.
14106 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14107 a parser stack overflow. Allocate just one block of memory for all
14108 three stacks, instead of allocating three blocks; this typically is
14109 faster and reduces fragmentation.
14111 Do not limit the number of items in the stack to a value that fits
14112 in 'int', as this is an arbitrary limit on hosts with 64-bit
14113 size_t and 32-bit int.
14115 2001-11-29 Marc Autret <autret_m@epita.fr>
14117 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14118 of defining YYERROR_VERBOSE.
14119 [AT_DATA]: $4 is now out of C declarations in the prologue.
14121 2001-11-28 Marc Autret <autret_m@epita.fr>
14123 * src/reader.c (parse_dquoted_param): New.
14124 (parse_skel_decl): Use it.
14125 * src/lex.h: Add its prototype.
14126 * src/lex.c (literalchar): Become not static.
14128 2001-11-28 Marc Autret <autret_m@epita.fr>
14130 * src/output.h: And put its extern declaration here.
14131 * src/output.c (error_verbose): Define here.
14132 (prepare): Echo name modification.
14133 * src/getargs.h: Clean its extern declaration.
14134 * src/getargs.c (error_verbose_flag): Remove.
14135 (getargs): Remove case 'e'.
14136 * src/options.c (option_table): 'error-verbose' is now seen as simple
14140 * src/reader.c (read_declarations): Remove case tok_include.
14141 (parse_include_decl): Remove.
14142 * src/lex.h (token_t): Remove tok_include.
14143 * src/options.c (option_table): 'include' is now a simple command line
14146 2001-11-28 Marc Autret <autret_m@epita.fr>
14148 * src/bison.simple: Adjust muscle names.
14149 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14150 * src/output.c (prepare): s/_/-/ for the muscles names.
14151 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14153 2001-11-28 Marc Autret <autret_m@epita.fr>
14155 * src/bison.simple: Fix debug.
14156 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14158 2001-11-28 Akim Demaille <akim@epita.fr>
14160 * src/LR0.c (shifts_new): New.
14161 (save_shifts, insert_start_shift, augment_automaton): Use it.
14163 2001-11-28 Akim Demaille <akim@epita.fr>
14165 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14168 2001-11-28 Akim Demaille <akim@epita.fr>
14170 * src/closure.c (closure): Instead of looping over word in array
14171 then bits in words, loop over bits in array.
14173 2001-11-28 Akim Demaille <akim@epita.fr>
14175 * src/closure.c (closure): No longer optimize the special case
14176 where all the bits of `ruleset[r]' are set to 0, to make the code
14179 2001-11-28 Akim Demaille <akim@epita.fr>
14181 * src/closure.c (closure): `r' and `c' are new variables, used to
14182 de-obfuscate accesses to RULESET and CORE.
14184 2001-11-28 Akim Demaille <akim@epita.fr>
14186 * src/reduce.c (reduce_print): Use ngettext.
14187 (dump_grammar): Improve the trace accuracy.
14189 2001-11-28 Akim Demaille <akim@epita.fr>
14191 * src/reduce.c (dump_grammar): Don't translate trace messages.
14193 2001-11-28 Akim Demaille <akim@epita.fr>
14195 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14196 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14197 as all tags are free'ed afterwards.
14198 From Enrico Scholz.
14200 2001-11-27 Paul Eggert <eggert@twinsun.com>
14202 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14203 use alloca when we didn't want to, and vice versa.
14205 2001-11-27 Marc Autret <autret_m@epita.fr>
14207 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14209 * src/output.c (prepare): Remove its update.
14211 2001-11-27 Marc Autret <autret_m@epita.fr>
14213 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14214 Use %error-verbose.
14216 2001-11-27 Marc Autret <autret_m@epita.fr>
14218 * src/bison.simple: Remove YYERROR_VERBOSE using.
14219 Use %%error_verbose.
14220 (yyparse): Likewise.
14221 * src/output.c (prepare): Give its final value.
14222 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14223 * src/getargs.h: Add its extern declaration.
14224 * src/getargs.c (error_verbose_flag): New int.
14225 (getargs): Update to catch new case.
14226 * src/options.c (option_table): 'error-verbose' is a new option.
14227 (shortopts): Update.
14229 2001-11-27 Akim Demaille <akim@epita.fr>
14231 * src/system.h: Use intl/libgettext.h.
14232 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14234 2001-11-27 Akim Demaille <akim@epita.fr>
14236 * tests/torture.at (Exploding the Stack Size with Malloc):
14237 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14239 2001-11-27 Akim Demaille <akim@epita.fr>
14241 * src/files.c: Include error.h.
14242 Reported by Hans Aberg.
14244 2001-11-26 Marc Autret <autret_m@epita.fr>
14246 * src/reader.c (parse_include_decl): New, not yet implemented.
14247 (read_declarations): Add case tok_include.
14248 * src/getargs.h (include): Add its extern definition.
14249 * src/getargs.c (include): New const char *.
14250 (getargs): Add case '-I'.
14251 * src/options.c (option_table): Add include as command line and
14253 * src/lex.h (token_t): Add tok_include.
14255 2001-11-26 Akim Demaille <akim@epita.fr>
14257 * src/reader.c (readgram): Make sure rules for mid-rule actions
14258 have a lineno equal to that of their host rule.
14259 Reported by Hans Aberg.
14260 * tests/regression.at (Rule Line Numbers): New.
14262 2001-11-26 Akim Demaille <akim@epita.fr>
14264 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14267 2001-11-26 Akim Demaille <akim@epita.fr>
14269 * src/complain.c, src/complain.h (error): Remove, provided by
14272 2001-11-26 Akim Demaille <akim@epita.fr>
14274 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14275 issue an error message.
14276 * tests/regression.at (Invalid %directive): New.
14277 Reported by Hans Aberg.
14279 2001-11-26 Akim Demaille <akim@epita.fr>
14281 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14282 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14284 2001-11-26 Akim Demaille <akim@epita.fr>
14286 * src/conflicts.c (conflicts_print): Don't complain at all when
14287 there are no reduce/reduce conflicts, and as many shift/reduce
14288 conflicts as expected.
14289 * tests/regression.at (%expect right): Adjust.
14291 2001-11-23 Akim Demaille <akim@epita.fr>
14293 * lib/alloca.c: Update, from fileutils.
14295 2001-11-23 Akim Demaille <akim@epita.fr>
14297 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14299 2001-11-23 Akim Demaille <akim@epita.fr>
14301 * src/system.h: Include alloca.h.
14302 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14304 2001-11-23 Akim Demaille <akim@epita.fr>
14306 * src/print_graph.c (print_actions): Remove `rule', unused.
14307 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14308 pacify GCC's signed < unsigned warnings.
14309 * src/closure.c (itemsetsize): Likewise.
14310 * src/reader.c (symbol_list_new): Static.
14312 2001-11-23 Akim Demaille <akim@epita.fr>
14314 Attaching lineno to buckets is stupid, since only one copy of each
14315 symbol is kept, only the line of the first occurrence is kept too.
14317 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14318 * src/reader.c (rline_allocated): Remove, unused.
14319 (symbol_list): Have a `line' member.
14320 (symbol_list_new): New.
14321 (readgram): Use it.
14322 * src/print.c (print_grammar): Output the rule line numbers.
14323 * tests/regression.at (Solved SR Conflicts)
14324 (Unresolved SR Conflicts): Adjust.
14325 Reported by Hans Aberg.
14327 2001-11-22 Marc Autret <autret_m@epita.fr>
14329 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14331 2001-11-22 Marc Autret <autret_m@epita.fr>
14333 * src/muscle_tab.c (muscle_init): Remove initialization of
14335 * src/output.c (output_master_parser): Do it here.
14337 2001-11-20 Akim Demaille <akim@epita.fr>
14340 * configure.in (ALL_LINGUAS): Adjust.
14341 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14342 longer contains strings to translate.
14344 2001-11-19 Akim Demaille <akim@epita.fr>
14346 * src/conflicts.c (conflicts_print): Add a missing \n.
14348 2001-11-19 Akim Demaille <akim@epita.fr>
14350 * src/nullable.c (nullable_print): New.
14351 (set_nullable): Call it when tracing.
14352 Better locality of variables.
14354 2001-11-19 Akim Demaille <akim@epita.fr>
14356 * src/print.c (print_actions): Better locality of variables.
14358 2001-11-19 Akim Demaille <akim@epita.fr>
14360 * src/derives.c (print_derives): Fix and enrich.
14361 * src/closure.c (print_fderives): Likewise.
14363 2001-11-19 Akim Demaille <akim@epita.fr>
14365 * src/closure.c (itemsetend): Remove, replaced with...
14366 (itemsetsize): new.
14368 2001-11-19 Akim Demaille <akim@epita.fr>
14370 * src/LR0.c (kernel_end): Remove, replaced with...
14371 (kernel_size): new.
14373 2001-11-19 Akim Demaille <akim@epita.fr>
14375 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14378 2001-11-19 Akim Demaille <akim@epita.fr>
14380 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14382 2001-11-19 Akim Demaille <akim@epita.fr>
14384 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14386 * src/LR0.c: Likewise.
14387 (allocate_itemsets): Use arrays instead of pointers to clarify.
14389 2001-11-19 Akim Demaille <akim@epita.fr>
14391 * src/getargs.c (statistics_flag): Replace with...
14393 (longopts): Accept --trace instead of --statistics.
14394 * src/getargs.h, src/options.c: Adjust.
14395 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14396 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14398 2001-11-19 Akim Demaille <akim@epita.fr>
14400 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
14401 pointers to clarify the code.
14402 (save_reductions, save_shifts): Factor common parts of alternatives.
14404 2001-11-19 Akim Demaille <akim@epita.fr>
14406 * src/LR0.c (new_state, get_state): Complete TRACE code.
14407 * src/closure.c: Include `reader.h' to get `tags', needed by the
14409 Rename the conditional DEBUG as TRACE.
14410 Output consistently TRACEs to stderr, not stdout.
14411 * src/derives.c: Likewise.
14412 * src/reduce.c: (inaccessable_symbols): Using if is better style
14414 Use `#if TRACE' instead of `#if 0' for tracing code.
14416 2001-11-19 Akim Demaille <akim@epita.fr>
14418 * src/system.h (LIST_FREE, shortcpy): New.
14419 * src/LR0.c: Use them.
14420 * src/output.c (free_itemsets, free_reductions, free_shifts):
14421 Remove, replaced by LIST_FREE.
14423 2001-11-19 Akim Demaille <akim@epita.fr>
14425 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14426 (REDUCTIONS_ALLOC): New.
14427 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14430 2001-11-19 Akim Demaille <akim@epita.fr>
14432 * src/LR0.c (new_state): Complete trace code.
14433 * src/nullable.c (set_nullable): Don't translate traces.
14435 2001-11-19 Akim Demaille <akim@epita.fr>
14437 * src/print_graph.c (print_core): Better locality of variables.
14438 * src/print.c (print_core): Likewise.
14440 2001-11-19 Akim Demaille <akim@epita.fr>
14442 * src/vcg.c: You do the output, so you are responsible of the
14443 handling of VCG syntax, in particular: use quotearg.
14444 * src/print_graph.c: Don't.
14445 (print_actions): Don't output the actions as part of the nodes,
14446 since that's the job of the edges.
14447 (print_state): Don't output by hand: fill the node description,
14448 and ask for its output.
14450 2001-11-19 Akim Demaille <akim@epita.fr>
14452 * src/bison.simple (yyparse): When verbosely reporting an error,
14453 no longer put additional quotes around token names.
14454 * tests/calc.at: Adjust.
14456 2001-11-19 Akim Demaille <akim@epita.fr>
14458 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14459 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14460 * src/output.c: Adjust.
14462 2001-11-19 Akim Demaille <akim@epita.fr>
14464 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14466 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14468 2001-11-19 Akim Demaille <akim@epita.fr>
14470 * src/gram.h (rule_t): New.
14472 (rrhs, rlhs): Remove, part of state_t.
14473 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14474 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14475 * src/reader.c, src/reduce.c: Adjust.
14477 2001-11-19 Akim Demaille <akim@epita.fr>
14479 * src/reader.c (symbols_output): New, extracted from...
14480 (packsymbols): Here.
14483 2001-11-19 Akim Demaille <akim@epita.fr>
14485 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14486 (maxrhs): this new function.
14488 2001-11-19 Akim Demaille <akim@epita.fr>
14490 * src/lalr.c (F): New macro to access the variable F.
14493 2001-11-19 Akim Demaille <akim@epita.fr>
14495 * src/lalr.h (LA): New macro to access the variable LA.
14496 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14497 * src/lalr.c: Adjust.
14499 2001-11-19 Akim Demaille <akim@epita.fr>
14501 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14502 (set_state_table): handle the `lookaheads' members.
14504 2001-11-19 Akim Demaille <akim@epita.fr>
14506 * src/lalr.h (lookaheads): Removed array, whose contents is now
14508 (state_t): this structure.
14509 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14512 2001-11-19 Akim Demaille <akim@epita.fr>
14514 * src/lalr.h (consistent): Removed array, whose contents is now
14516 (state_t): this structure.
14517 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14520 2001-11-19 Akim Demaille <akim@epita.fr>
14522 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14523 contents are now members of...
14524 (state_t): this structure.
14525 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14528 2001-11-19 Akim Demaille <akim@epita.fr>
14530 * src/lalr.h (state_t): New.
14531 (state_table): Be a state_t * instead of a core **.
14532 (accessing_symbol): Remove, part of state_t.
14533 * src/lalr.c: Adjust.
14534 (set_accessing_symbol): Merge into...
14535 (set_state_table): this.
14536 * src/print_graph.c, src/conflicts.c: Adjust.
14538 2001-11-14 Akim Demaille <akim@epita.fr>
14540 * tests/calc.at, tests/output.at, tests/regression.at,
14541 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14542 now the tests are run in private dirs, therefore AC_CLEANUP and
14543 family can be simplified to 0-ary.
14544 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14545 use abs. path to find config.h.
14546 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14547 stderr, there can be way too much random noise.
14548 Instead pass -Werror to GCC and rely on the exit status.
14549 Reported by Wolfram Wagner.
14551 2001-11-14 Akim Demaille <akim@epita.fr>
14553 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14554 defined only if yyoverflow is defined, to avoid `warning: unused
14556 Reported by The Test Suite.
14558 2001-11-14 Akim Demaille <akim@epita.fr>
14560 * src/print.c: Include reduce.h.
14561 Reported by Hans Aberg.
14563 2001-11-14 Akim Demaille <akim@epita.fr>
14565 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
14566 Revert a previous patch: these are really const.
14567 * src/conflicts.c (conflict_report): Additional useless pair of
14568 braces to pacify GCC's warnings for `if () if () {} else {}'.
14569 * src/lex.c (parse_percent_token): Replace equal_offset with
14572 Be sure to strdup `arg' when used, since there is no reason for
14573 token_buffer not to change.
14575 2001-11-14 Akim Demaille <akim@epita.fr>
14577 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14579 * src/main.c (main): Use them.
14580 Suggested by Hans Aberg.
14582 2001-11-12 Akim Demaille <akim@epita.fr>
14584 * src/system.h (ngettext): Now that we use ngettext, be sure to
14585 provide a default definition when NLS are not used.
14587 2001-11-12 Akim Demaille <akim@epita.fr>
14589 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
14590 Use @kbd to denote user input.
14591 (Language and Grammar): ANSIfy the example.
14592 Adjust its layout for info/notinfo.
14593 (Location Tracking Calc): Output error messages to stderr.
14594 Output locations in a more GNUtically correct way.
14595 Fix a couple of Englishos.
14596 Adjust @group/@end group pairs.
14598 2001-11-12 Akim Demaille <akim@epita.fr>
14600 %expect was not functioning at all.
14602 * src/conflicts.c (expected_conflicts): Set to -1.
14603 (conflict_report): Use ngettext.
14604 (conflicts_print): Check %expect and make its violation an error.
14605 * doc/bison.texinfo (Expect Decl): Adjust.
14606 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
14607 * tests/regression.at (%expect not enough, %expect right)
14608 (%expect too much): New.
14610 2001-11-12 Akim Demaille <akim@epita.fr>
14612 * tests/regression.at (Conflicts): Rename as...
14613 (Unresolved SR Conflicts): this.
14614 (Solved SR Conflicts): New.
14616 2001-11-12 Akim Demaille <akim@epita.fr>
14618 * src/reduce.c (print_results): Rename as...
14619 (reduce_output): This.
14620 Output to OUT, passed as argument, instead of output_obstack.
14621 (dump_grammar): Likewise.
14622 (reduce_free): New.
14624 (reduce_grammar): No longer call reduce_output, since...
14625 * src/print.c (print_results): do it.
14626 * src/main.c (main): Call reduce_free;
14628 2001-11-12 Akim Demaille <akim@epita.fr>
14630 * src/conflicts.c (print_reductions): Accept OUT as argument.
14631 Output to it, not to output_obstack.
14632 * src/print.c (print_actions): Adjust.
14634 2001-11-12 Akim Demaille <akim@epita.fr>
14636 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
14637 the result instead of using...
14638 (src_total, rrc_total, src_count, rrc_count): Remove.
14639 (any_conflicts): Remove.
14640 (print_conflicts): Split into...
14641 (conflicts_print, conflicts_output): New.
14642 * src/conflicts.h: Adjust.
14643 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
14644 * src/print.c (print_grammar): Issue `\n' between two rules.
14645 * tests/regression.at (Conflicts): New.
14646 Reported by Tom Lane.
14648 2001-11-12 Akim Demaille <akim@epita.fr>
14650 * tests/regression.at (Invalid input): Remove, duplicate with
14651 ``Invalid input: 1''.
14653 2001-11-12 Akim Demaille <akim@epita.fr>
14655 * tests/torture.at (AT_DATA_STACK_TORTURE)
14656 (Exploding the Stack Size with Alloca)
14657 (Exploding the Stack Size with Malloc): New.
14659 2001-11-12 Akim Demaille <akim@epita.fr>
14661 * src/bison.simple (YYSTACK_REALLOC): New.
14662 (yyparse) [!yyoverflow]: Use it and free the old stack.
14663 Reported by Per Allansson.
14665 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
14667 * src/bison.simple: Define type yystype instead of YYSTYPE, and
14668 define CPP macro, which substitute YYSTYPE by yystype.
14669 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
14670 with yyltype/YYLTYPE. This allows inclusion of the generated
14671 header within the parser if the compiler, such as GGC, accepts
14672 multiple equivalent #defines.
14675 2001-11-05 Akim Demaille <akim@epita.fr>
14677 * src/reader.c (symbols_output): New, extracted from...
14678 (packsymbols): here.
14681 2001-11-05 Akim Demaille <akim@epita.fr>
14683 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14685 2001-11-05 Akim Demaille <akim@epita.fr>
14687 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14690 2001-11-05 Akim Demaille <akim@epita.fr>
14692 * src/options.h (struct option_table_struct): set_flags is void*.
14693 * src/options.c (longopts): Support `--output' and `%output'.
14695 * src/lex.h (tok_setopt): Remove, replaced with...
14696 (tok_intopt, tok_stropt): these new guys.
14697 * src/lex.c (getopt.h): Not needed.
14698 (token_buffer, unlexed_token_buffer): Not const.
14699 (percent_table): Promote `-' over `_' in directive names.
14700 Active `%name-prefix', `file-prefix', and `output'.
14701 (parse_percent_token): Accept possible arguments to directives.
14702 Promote `-' over `_' in directive names.
14704 2001-11-04 Akim Demaille <akim@epita.fr>
14706 * doc/bison.texinfo (Decl Summary): Split the list into
14707 `directives for grammars' and `directives for bison'.
14709 Add description of `%name-prefix', `file-prefix', and `output'.
14710 Promote `-' over `_' in directive names.
14711 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14712 Simplify the description of `--name-prefix'.
14713 Promote `-' over `_' in directive names.
14714 Promote `--output' over `--output-file'.
14715 Fix the description of `--defines'.
14716 * tests/output.at: Exercise %file-prefix and %output.
14718 2001-11-02 Akim Demaille <akim@epita.fr>
14720 * doc/refcard.tex: Update.
14722 2001-11-02 Akim Demaille <akim@epita.fr>
14724 * src/symtab.h (SUNDEF): New.
14725 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14726 stand for `uninitialized', instead of 0.
14727 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14728 * src/lex.c (lex): Adjust.
14730 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14732 Let yylex return it instead of a plain 0.
14733 Reported by Dick Streefland.
14735 2001-11-02 Akim Demaille <akim@epita.fr>
14737 * tests/regression.at (Mixing %token styles): New test.
14739 2001-11-02 Akim Demaille <akim@epita.fr>
14741 * src/reader.c (parse_thong_decl): Formatting changes.
14742 (token_translations_init): New, extracted from...
14743 (packsymbols): Here.
14746 2001-11-01 Akim Demaille <akim@epita.fr>
14748 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14749 Check that `9foo.y' produces correct cpp guards.
14750 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14754 2001-11-01 Akim Demaille <akim@epita.fr>
14756 * tests/regression.at (Invalid input: 2): New.
14757 * src/lex.c (unlexed_token_buffer): New.
14758 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14762 2001-11-01 Akim Demaille <akim@epita.fr>
14764 * tests/calc.at: Catch up with 1.30.
14765 * configure.in: Bump to 1.49a.
14766 Adjust to newer Autotest.
14768 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
14770 * src/conflicts.c: Move global variables rrc_total and src_total ...
14771 (print_conflicts): here.
14772 * src/output.c (output): Free global variable user_toknums.
14773 * src/lex.c (token_obstack): Become static.
14775 2001-10-18 Akim Demaille <akim@epita.fr>
14777 * tests/atlocal.in (GCC): Add.
14778 * tests/calc.at: s/m4_match/m4_bmatch/.
14779 s/m4_patsubst/m4_bpatsubst/.
14780 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14781 * configure.in: AC_SUBST(GCC).
14783 2001-10-14 Marc Autret <autret_m@epita.fr>
14785 * src/options.c (create_long_option_table): Fix.
14787 2001-10-10 Akim Demaille <akim@epita.fr>
14789 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14791 2001-10-04 Akim Demaille <akim@epita.fr>
14793 * src/reader.c (parse_union_decl): Push the caracters in
14794 union_obstack, not attrs_obstack.
14796 2001-10-04 Akim Demaille <akim@epita.fr>
14798 Merge in the branch 1.29.
14800 * src/reader.c (packsymbols): Use a temporary obstack for
14801 `%%tokendef', since output_stack is already used elsewhere.
14803 2001-10-02 Akim Demaille <akim@epita.fr>
14807 2001-10-02 Akim Demaille <akim@epita.fr>
14811 2001-10-02 Akim Demaille <akim@epita.fr>
14813 * tests/regression.at (Invalid CPP headers): New.
14814 From Alexander Belopolsky.
14815 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14817 2001-10-02 Akim Demaille <akim@epita.fr>
14819 * tests/regression.at (Invalid input): New.
14820 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14823 2001-10-02 Akim Demaille <akim@epita.fr>
14825 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14827 2001-10-02 Akim Demaille <akim@epita.fr>
14829 * src/output.c (output_parser): Assert `skeleton'.
14830 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14834 2001-10-01 Marc Autret <autret_m@epita.fr>
14836 * src/lex.h: Echo modifications.
14837 * src/lex.c (unlex): Parameter is now token_t.
14840 2001-10-01 Marc Autret <autret_m@epita.fr>
14842 * src/main.c: Include lex.h.
14845 2001-09-29 Akim Demaille <akim@epita.fr>
14847 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14849 2001-09-28 Akim Demaille <akim@epita.fr>
14851 * tests/testsuite.at: Update to newer Autotest.
14852 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14854 2001-09-27 Akim Demaille <akim@epita.fr>
14856 Position independent wrapper.
14858 * tests/bison: Remove.
14859 * tests/bison.in: New.
14860 * configure.in: Adjust.
14862 2001-09-27 Paul Eggert <eggert@twinsun.com>
14864 Port quotearg fixes from tar 1.13.24.
14866 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14868 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14869 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14871 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
14872 * m4/mbrtowc.m4: New file.
14873 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
14874 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
14876 2001-09-27 Akim Demaille <akim@epita.fr>
14880 2001-09-27 Akim Demaille <akim@epita.fr>
14884 2001-09-25 Akim Demaille <akim@epita.fr>
14886 * src/system.h: Include `xalloc.h'.
14887 Remove it from the C files.
14888 * src/files.c (output_files): Free the obstacks.
14889 * src/lex.c (init_lex): Rename as...
14892 * src/main.c (main): Use it.
14894 2001-09-24 Marc Autret <autret_m@epita.fr>
14896 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
14897 to output informations in fout (FILE*).
14898 (open_graph, close_graph): Likewise.
14899 (output_graph, output_edge, output_node): Likewise.
14900 * src/vcg.h: Update function prototypes.
14901 * src/print_graph.c (print_graph): Open output graph file.
14902 (print_actions): Adjust.
14903 * src/files.h: Remove extern declaration.
14904 * src/files.c: Remove graph_obstack declaration.
14905 (open_files): Remove graph_obstack initialization.
14906 (output_files): Remove graph_obstack saving.
14908 2001-09-24 Marc Autret <autret_m@epita.fr>
14910 * src/files.c (compute_output_file_names): Fix.
14912 2001-09-24 Marc Autret <autret_m@epita.fr>,
14913 Akim Demaille <akim@epita.fr>
14915 * src/reader.c (reader): Remove call to free_symtab ().
14916 * src/main.c (main): Call it here.
14918 * src/conflicts.c (initialize_conflicts): Rename as...
14919 (solve_conflicts): this.
14920 * src/print.c (print_core, print_actions, print_state)
14921 (print_grammar): Dump to a file instead a `output_obstack'.
14922 (print_results): Dump `output_obstack', and then proceed with the
14924 * src/files.c (compute_output_file_names, close_files): New.
14925 (output_files): Adjust.
14926 * src/main.c (main): Adjust.
14928 2001-09-23 Marc Autret <autret_m@epita.fr>
14930 * src/files.c (compute_header_macro): Computes header macro name
14931 from spec_defines_file when given.
14933 2001-09-23 Marc Autret <autret_m@epita.fr>
14935 * src/files.c (output_files): Add default extensions.
14937 2001-09-22 Akim Demaille <akim@epita.fr>
14939 * src/conflicts.c (finalize_conflicts): Rename as...
14940 (free_conflicts): this.
14942 2001-09-22 Akim Demaille <akim@epita.fr>
14944 * src/gram.c (gram_free): Rename back as...
14946 (output_token_translations): Free `token_translations'.
14947 * src/symtab.c (free_symtab): Free the tag field.
14949 2001-09-22 Akim Demaille <akim@epita.fr>
14951 Remove `translations' as it is always set to true.
14953 * src/gram.h: Adjust.
14954 * src/reader.c (packsymbols, parse_token_decl): Adjust
14955 * src/print.c (print_grammar): Adjust.
14956 * src/output.c (output_token_translations): Adjust.
14957 * src/lex.c (lex): Adjust.
14958 * src/gram.c: Be sure the set pointers to NULL.
14959 (dummy): Rename as...
14962 2001-09-22 Akim Demaille <akim@epita.fr>
14964 * configure.in: Invoke AM_LIB_DMALLOC.
14965 * src/system.h: Use dmalloc.
14966 * src/LR0.c: Be sure to have pointers initialized to NULL.
14967 (allocate_itemsets): Allocate kernel_items only if needed.
14969 2001-09-22 Akim Demaille <akim@epita.fr>
14971 * configure.in: Bump to 1.29b.
14972 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
14973 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
14974 need xmalloc.c in calc.y.
14977 2001-09-21 Akim Demaille <akim@epita.fr>
14980 * Makefile.maint, config/config.guess, config/config.sub,
14981 * config/missing: Update from masters.
14982 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
14984 * configure.in (ALL_LINGUAS): Add `tr'.
14986 2001-09-21 Akim Demaille <akim@epita.fr>
14988 * tests/Makefile.am (package.m4): Move to...
14989 ($(srcdir)/$(TESTSUITE)): here.
14991 2001-09-20 Akim Demaille <akim@epita.fr>
14993 * src/complain.c: No longer try to be standalone: use system.h.
14994 Don't assume __STDC__ is defined to 1. Just test if it is defined.
14995 * src/complain.h: Likewise.
14996 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
14997 Remove the unused variable `n'.
14998 From Albert Chin-A-Young.
15000 2001-09-18 Marc Autret <autret_m@epita.fr>
15002 * doc/bison.1: Update.
15003 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15005 (Option Cross Key): Update.
15008 2001-09-18 Marc Autret <autret_m@epita.fr>
15010 * tests/regression.at: New test (comment in %union).
15012 2001-09-18 Marc Autret <autret_m@epita.fr>
15014 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15016 Reported by Keith Browne.
15018 2001-09-18 Marc Autret <autret_m@epita.fr>
15020 * tests/output.at: Add tests for --defines and --graph.
15022 2001-09-18 Marc Autret <autret_m@epita.fr>
15024 * tests/output.at: Removes tests of %{header,src}_extension features.
15026 2001-09-18 Akim Demaille <akim@epita.fr>
15028 * tests/Makefile.am (package.m4): New.
15029 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15030 (_AT_CHECK_CALC_ERROR): Likewise.
15031 Factor the `, ' part of verbose error messages.
15033 2001-09-18 Marc Autret <autret_m@epita.fr>
15035 * src/getargs.c (longopts): Declare --defines and --graph as options
15036 with optional arguments.
15037 * src/files.h: Add extern declarations.
15038 * src/files.c (spec_graph_file, spec_defines_file): New.
15039 (output_files): Update.
15040 Remove CPP-outed code.
15042 2001-09-18 Marc Autret <autret_m@epita.fr>
15044 Turn off %{source,header}_extension feature.
15046 * src/files.c (compute_exts_from_gf): Update.
15047 (compute_exts_from_src): Update.
15048 (output_files): CPP-out useless code.
15049 * src/files.h: Remove {header,source}_extension extern declarations.
15050 * src/reader.c (parse_dquoted_param): CPP-out.
15051 (parse_header_extension_decl): Remove.
15052 (parse_source_extension_decl): Remove.
15053 (read_declarations): Remove cases tok_{hdrext,srcext}.
15054 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15055 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15057 2001-09-10 Akim Demaille <akim@epita.fr>
15059 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15060 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15061 (AT_CHECK_OUTPUT): this.
15062 Merely check ls' exit status, its output is useless.
15064 2001-09-10 Akim Demaille <akim@epita.fr>
15066 * tests/calc.at: Use m4_match.
15067 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15069 2001-09-10 Marc Autret <autret_m@epita.fr>,
15070 Akim Demaille <akim@epita.fr>
15072 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15074 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15076 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15077 * src/lex.h: Adjust prototype.
15078 (token_t): Add `tok_undef'.
15079 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15080 (parse_percent_token): Now returns token_t.
15081 Add default statement in switch.
15082 (lex): Separate `c' as an input variable, from the token_t result
15084 (unlexed): Is a token_t.
15086 2001-09-10 Akim Demaille <akim@epita.fr>
15088 * configure.in: Bump to 1.29a.
15090 2001-09-07 Akim Demaille <akim@epita.fr>
15094 2001-08-30 Akim Demaille <akim@epita.fr>
15096 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15097 * m4/atconfig.m4: Remove.
15098 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15099 * tests/bison: New.
15100 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15101 m4_if, m4_patsubst, and m4_regexp.
15102 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15103 `input' file instead of echo.
15105 2001-08-29 Akim Demaille <akim@epita.fr>
15109 2001-08-29 Akim Demaille <akim@epita.fr>
15113 2001-08-29 Paul Eggert <eggert@twinsun.com>
15115 * src/bison.simple (yyparse): Don't take the address of an
15116 item before the start of an array, as that doesn't conform to
15119 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15121 * doc/bison.texinfo (Location Tracking Calc): New node.
15123 2001-08-29 Paul Eggert <eggert@twinsun.com>
15125 * src/output.c (output): Do not define const, as this now
15126 causes more problems than it cures.
15128 2001-08-29 Akim Demaille <akim@epita.fr>
15130 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15132 Be sure to tag the `detailmenu'.
15134 2001-08-29 Akim Demaille <akim@epita.fr>
15136 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15137 download in a tmp dir.
15139 2001-08-28 Marc Autret <autret_m@epita.fr>
15141 * config/depcomp: New file.
15143 2001-08-28 Marc Autret <autret_m@epita.fr>
15145 * doc/bison.1 (mandoc): Adjust.
15146 From Juan Manuel Guerrero.
15148 2001-08-28 Marc Autret <autret_m@epita.fr>
15150 * src/print_graph.c (print_state): Fix.
15152 2001-08-27 Marc Autret <autret_m@epita.fr>
15154 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15156 Echo modifications to the functions prototypes.
15157 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15159 2001-08-27 Marc Autret <autret_m@epita.fr>
15161 * src/vcg.c: Include `xalloc.h'.
15162 (add_colorentry): New.
15163 (add_classname): New.
15164 (add_infoname): New.
15165 * src/vcg.h: Add new prototypes.
15167 2001-08-27 Akim Demaille <akim@epita.fr>
15169 * Makefile.maint: Sync. again with CVS Autoconf.
15171 2001-08-27 Akim Demaille <akim@epita.fr>
15173 * Makefile.maint: Formatting changes.
15174 (po-update, cvs-update, update): New targets.
15177 2001-08-27 Akim Demaille <akim@epita.fr>
15179 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15180 * Makefile.maint: Sync. with CVS Autoconf.
15182 2001-08-27 Marc Autret <autret_m@epita.fr>
15184 * src/vcg.h (struct infoname_s): New.
15185 (struct colorentry_s): New.
15186 (graph_s): New fields {vertical,horizontal}_order in structure.
15187 Add `infoname' field.
15188 Add `colorentry' field;
15189 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15190 (G_HORIZONTAL_ORDER): New.
15192 (G_COLORENTRY): New.
15193 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15194 Add output of `infoname'.
15195 Add output of `colorentry'.
15197 2001-08-27 Marc Autret <autret_m@epita.fr>
15199 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15200 This one shadowed a global parameter.
15202 2001-08-24 Marc Autret <autret_m@epita.fr>
15204 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15205 instead of `unsigned'.
15206 (print_state): Do not call obstack_object_size () in obstack_grow ()
15207 to avoid macro variables shadowing.
15209 2001-08-23 Marc Autret <autret_m@epita.fr>
15211 * src/lex.c (percent_table): Typo: s/naem/name/.
15213 Normalize new options declarations.
15215 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15217 * tests/suite.at: Exercise %header_extension and %source_extension.
15219 2001-08-16 Marc Autret <autret_m@epita.fr>
15221 * src/reader.c (parse_dquoted_param): New.
15222 (parse_header_extension_decl): Use it.
15223 (parse_source_extension_decl): Likewise.
15225 2001-08-16 Marc Autret <autret_m@epita.fr>
15227 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15228 (get_xxxx_str): Use assert () instead of complain ().
15229 Remove return invokations in default cases.
15230 (get_decision_str): Modify default behaviour. Remove second argument.
15231 Echo modifications on calls.
15232 (output_graph): Fix.
15234 2001-08-16 Marc Autret <autret_m@epita.fr>
15236 * src/getargs.c (usage): Update with ``-g, --graph''.
15238 2001-08-16 Marc Autret <autret_m@epita.fr>
15240 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15241 (Option Cross Key): Likewise.
15242 * doc/bison.1: Update.
15244 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
15246 * src/output.c (output_master_parser): Don't finish action_obstack.
15247 (output_parser): Don't care about the muscle action, here.
15248 (prepare): Copy the action_obstack in the action muscle.
15249 (output): Free action_obstack.
15251 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15253 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15254 will contain `%union' declaration.
15255 (parse_union_decl): Delete #line directive output.
15256 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15257 informations about %union.
15258 (parse_union_decl): Copy the union_obstack in the muscle stype.
15259 * src/bison.simple: Add new #line directive.
15260 Add typdef %%stype YYSTYPE.
15262 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15264 * src/bison.simple: Add new `#line' directive.
15266 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
15268 * src/bison.simple: New `#line' directive.
15269 * src/output.c (output_parser): Support new dynamic muscle input_line.
15271 2001-09-22 Marc Autret <autret_m@epita.fr>
15273 * src/output.c (output_master_parser): New.
15274 (output_parser): Be more re-entrant.
15276 2001-09-21 Marc Autret <autret_m@epita.fr>
15278 * src/reader.c (copy_definition, parse_union_decl): Update and use
15280 (copy_action): Likewise.
15281 Use obstack_1grow ().
15282 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15284 2001-09-21 Marc Autret <autret_m@epita.fr>
15286 * src/options.c (option_table): Adjust.
15287 * src/lex.c (parse_percent_token): Fix.
15289 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15291 * src/options.c (symtab.h): Include it, need by lex.h.
15293 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15295 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15296 is now an option_table_struct*.
15297 (option_strcmp): New function option_strcmp.
15298 (parse_percent_token): Call option_strcmp.
15299 * src/getargs.c (xalloc.h, options.h): Include it.
15300 (getargs): Call create_long_option_table.
15301 (getargs): Free longopts at the end of the function.
15302 (shortopts): Move in options.c.
15303 * src/options.c (create_long_option_table): New function. Convert
15304 information from option_table to option structure.
15305 * src/reader.c (options.h): Include it.
15307 * src/Makefile.am: Adjust.
15308 * src/options.c (option_table): Create from longopts and percent_table.
15309 * src/getargs.c (longopts): Delete.
15310 * src/lex.c (struct percent_table_struct): Delete.
15311 (percent_table): Delete.
15312 (options.h): Include it.
15313 * src/options.c: Create.
15314 * src/options.h: Create.
15315 Declare enum opt_access_e.
15316 Define struct option_table_struct.
15318 2001-09-20 Marc Autret <autret_m@epita.fr>
15320 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15323 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
15325 * src/bison.simple: s/%%filename/%%skeleton.
15326 * src/muscle_tab.c (getargs.h): Include it.
15327 (muscle_init): Insert new muscle skeleton.
15329 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
15331 * src/output.c (output_parser): Delete unused variable actions_dumped.
15333 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
15335 * src/output.c (output): Delete call to reader_output_yylsp.
15336 * src/reader.c (reader): Likewise.
15337 * src/reader.h: Delete declaration of reader_output_yylsp.
15339 2001-09-02 Marc Autret <autret_m@epita.fr>
15341 * src/reader.c: Include muscle_tab.h.
15342 (parse_union_decl): Update.
15343 (parse_macro_decl): Rename parse_muscle_decl.
15344 Update to use renamed functions and variable.
15345 (read_declarations, copy_action, read_additionnal_code, : Updated
15346 with correct variables and functions names.
15347 (packsymbols, reader): Likewise.
15349 * src/reader.h (muscle_obstack): Extern declaration update.
15351 * src/output.c: Include muscle_tab.h
15352 In all functions using macro_insert, change by using muscle_insert ().
15353 (macro_obstack): Rename muscle_obstack.
15354 Echo modifications in the whole file.
15355 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15356 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15357 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15359 * src/muscle_tab.h: Update double inclusion macros.
15360 (macro_entry_s): Rename muscle_entry_s.
15363 * src/muscle_tab.c: Include muscle_tab.h.
15364 Rename macro_tabble to muscle_table.
15365 (mhash1, mhash2, mcmp): Use muscle_entry.
15366 (macro_init): Rename muscle_init. Update.
15367 (macro_insert): Rename muscle_insert. Update.
15368 (macro_find): Rename muscle_find. Update.
15370 * src/main.c: Include muscle_tab.h.
15371 (main): Call muscle_init ().
15372 * src/Makefile.am (bison_SOURCES): Echo modifications.
15374 2001-09-02 Marc Autret <autret_m@epita.fr>
15376 Now the files macro_tab.[ch] are named muscle_tab.[ch].
15378 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15380 2001-09-02 Marc Autret <autret_m@epita.fr>
15382 * src/macrotab.c, src/macrotab.h: Remove.
15384 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
15386 * src/reader.c (copy_guard): Use muscle to specify the `#line'
15389 2001-09-01 Marc Autret <autret_m@epita.fr>
15391 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15392 to an explicit value to activate the feature. We do it here.
15394 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15396 * src/output.c (prepare): Delete the `filename' muscule insertion.
15397 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15398 (parse_union_decl): Likewise.
15399 * src/macrotab.c (macro_init): Initialize filename by infile.
15401 2001-08-31 Marc Autret <autret_m@epita.fr>
15403 * src/bison.simple (YYLSP_NEEDED): New definition.
15404 * src/output.c (prepare): Add macro insertion of `locations_flag'
15406 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15408 * src/output.c (prepare): Delete insertion of previous muscles,
15409 and insert the `prefix' muscles.
15410 * src/macrotab.c (macro_init): Likewise.
15411 (macro_init): Initialization prefix directive by `yy'.
15412 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
15413 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15414 yylval, yydebug, yyerror, yynerrs and yyparse.
15415 New directive `#define' to substitute yydebug, ... with option
15418 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15420 * src/main.c (main): Standardize.
15421 * src/output.c (output_table_data, output_parser): Likewise.
15422 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15424 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15426 * src/reader.c (read_additionnal_code): Rename %%user_code to
15428 * src/output.c (output): Rename %%declarations to %%prologue.
15429 * src/bison.simple: Echo modifications.
15431 2001-08-31 Marc Autret <autret_m@epita.fr>
15433 * src/reader.c (readgram): CleanUp.
15434 (output_token_defines): Likewise.
15435 (packsymbols): Likewise.
15436 (reader): Likewise.
15437 * src/output.c (output): CPP-out useless code.
15439 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15441 * src/reader.c (reader): Delete obsolete call to function
15442 output_trailers and output_headers.
15443 * src/output.h: Remove obsolete functions prototypes of output_headers
15444 and output_trailers.
15446 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
15448 * src/main.c: Include macrotab.h.
15449 * src/macrotab.h (macro_entry_s): Constify fields.
15450 Adjust functions prototypes.
15451 * src/macrotab.c (macro_insert): Constify key and value.
15452 (macro_find): Constify key.
15453 (macro_insert): Include 'xalloc.h'
15454 (macro_insert): Use XMALLOC.
15455 (macro_find): Constify return value.
15456 * src/output.c (output_table_data): Rename table to table_data.
15457 (output_parser): Constify macro_key, macro_value.
15459 2001-08-30 Marc Autret <autret_m@epita.fr>
15461 * src/reader.c (parse_skel_decl): New.
15462 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
15463 * src/lex.h (token_t): New token `tok_skel'.
15464 * src/lex.c (percent_table): Add skeleton option entry.
15467 2001-08-29 Marc Autret <autret_m@epita.fr>
15469 * src/bison.simple: Add %%user_code directive at the end.
15470 * src/reader.c (read_additionnal_code): New.
15472 * src/output.c (output_program): Remove.
15475 2001-08-28 Marc Autret <autret_m@epita.fr>
15477 * src/output.c (output_actions): Clean up.
15478 (output_gram): CPP-out useless code.
15479 * src/reader.c (reader): Clean up, CPP-out useless code.
15481 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
15483 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
15485 * src/bison.simple: Add `%%definitions'.
15487 2001-08-28 Marc Autret <autret_m@epita.fr>
15489 * config/depcomp: New file.
15491 2001-08-27 Paul Eggert <eggert@twinsun.com>
15493 * src/bison.simple (yyparse): Don't take the address of an
15494 item before the start of an array, as that doesn't conform to
15497 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15499 * src/output.c (output): Remove the initialization of the macro
15500 obstack. It was done too late here.
15502 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15504 (reader): Initialize the macro obstack here, since we need it to grow
15505 '%define' directives.
15507 * src/reader.h: Declare the macro obstack as extern.
15509 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15511 * src/output.c (output_parser): Fix. Store single '%' characters in
15512 the output obstack instead of throwing them away.
15514 2001-08-27 Akim Demaille <akim@epita.fr>
15516 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15518 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15520 * lib/Makefile.am: Adjust.
15522 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15524 * src/bison.simple: Update and add '%%' directives.
15526 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15528 * src/reader.c (reader): Remove calls to 'output_headers' and
15529 'output_trailers'. Remove some C output.
15530 (readgram): Disable a piece of code that was writing a default
15531 definition for 'YYSTYPE'.
15532 (reader_output_yylsp): Remove.
15533 (packsymbols): Output token defintions to a macro.
15534 (copy_definition): Disable C output.
15536 * src/reader.c (parse_macro_decl): New function used to parse macro
15538 (copy_string2): Put the body of copy_string into this new function.
15539 Add a parameter to let the caller choose whether he wants to copy the
15540 string delimiters or not.
15541 (copy_string): Be a simple call to copy_string2 with the last argument
15543 (read_declarations): Add case for macro definition.
15544 (copy_identifier): New.
15545 (parse_macro_decl): Read macro identifiers using copy_identifier
15548 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15550 * src/output.c (prepare): Add prefixed names.
15551 (output_parser): Output semantic actions.
15552 (output_parser): Fix bug on '%%line' directives.
15554 * src/output.c (output_headers): Remove. The C code printed by this
15555 function should now be in the skeletons.
15556 (output_trailers): Remove.
15557 (output): Disable call to 'reader_output_yylsp'.
15558 (output_rule_data): Do not output tables to the table obstack.
15560 * src/output.c: Remove some C dedicated output.
15561 Improve the use of macro and output obstacks.
15562 (output_defines): Remove.
15564 * src/output.c (output_token_translations): Associate 'translate'
15565 table with a macro. No output to the table obstack.
15566 (output_gram): Same for 'rhs' and 'prhs'.
15567 (output_stos): Same for 'stos'.
15568 (output_rule_data): Same for 'r1' and 'r2'.
15569 (token_actions): Same for 'defact'.
15570 (goto_actions): Same for 'defgoto'.
15571 (output_base): Same for 'pact' and 'pgoto'.
15572 (output_table): Same for 'table'.
15573 (output_check): Same for 'check'.
15575 * src/output.c (output_table_data): New function.
15576 (output_short_table): Remove.
15577 (output_short_or_char_table): Remove.
15579 * src/output.c (output_parser): Replace most of the skeleton copy code
15580 with something new. Skeletons are now processed character by character
15581 rather than line by line, and Bison looks for '%%' macros. This is the
15582 first step in making Bison's output process (a lot) more flexible.
15583 (output_parser): Use the macro table.
15585 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15587 * src/main.c (main): Initialize the macro table.
15589 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15591 * src/lex.c (percent_table): Add tok_define.
15592 * src/lex.h: Add tok_define.
15594 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15596 * src/macrotab.c: New file.
15597 * src/macrotab.h: New file.
15598 * src/Makefile.am: Update.
15600 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15602 * lib/hash.c: New file.
15603 * lib/hash.h: New file.
15604 * lib/Makefile.am: Update.
15606 2001-08-15 Akim Demaille <akim@epita.fr>
15610 2001-08-15 Marc Autret <autret_m@epita.fr>
15612 * src/reader.c (readgram): Indent output macro YYSTYPE.
15613 (packsymbols): Likewise.
15614 (output_token_defines): Likewise.
15615 * src/files.c: Standardize.
15616 (compute_header_macro): New.
15617 (defines_obstack_save): New. Use compute_header_macro.
15618 (output_files): Update. Use defines_obstack_save.
15620 2001-08-15 Akim Demaille <akim@epita.fr>
15622 * doc/bison.texinfo (Table of Symbols): Document
15623 YYSTACK_USE_ALLOCA.
15625 2001-08-15 Akim Demaille <akim@epita.fr>
15627 * missing: Update from CVS Automake.
15628 * config/config.guess, config/config.sub, config/texinfo.tex:
15629 Update from gnu.org.
15631 2001-08-15 Akim Demaille <akim@epita.fr>
15633 * Makefile.maint: Sync with CVS Autoconf.
15635 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
15637 * doc/bison.texinfo: Include GNU Free Documentation License from
15639 * doc/fdl.texi: Add to package.
15641 2001-08-14 Marc Autret <autret_m@epita.fr>
15643 Turn on %{source,header}_extension features.
15645 * src/lex.c (percent_table): Un-CPP out header_extension and
15647 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
15648 (compute_exts_from_src): Remove conditions. It restores priorities
15651 2001-08-14 Marc Autret <autret_m@epita.fr>
15653 * src/files.c (compute_base_names): Add extensions computing when
15654 `--file-prefix' used.
15655 Standardize function calls.
15657 2001-08-13 Marc Autret <autret_m@epita.fr>
15659 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
15660 defining it (defined but null disables alloca).
15662 2001-08-13 Marc Autret <autret_m@epita.fr>
15664 * src/bison.simple (_yy_memcpy): CPP reformat.
15666 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
15668 * tests/atconfig.in (CPPFLAGS): Fix.
15670 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
15672 * doc/bison.texinfo: Include GNU General Public License from
15674 * doc/gpl.texi: Add to package.
15676 2001-08-10 Marc Autret <autret_m@epita.fr>
15678 * src/print_graph.h: Fix.
15679 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15681 2001-08-10 Akim Demaille <akim@epita.fr>
15683 * src/system.h: Provide default declarations for stpcpy, strndup,
15686 2001-08-10 Robert Anisko <anisko_r@epita.fr>
15688 * doc/bison.texinfo (Locations): Update @$ stuff.
15690 2001-08-09 Robert Anisko <anisko_r@epita.fr>
15692 * src/bison.simple (YYLLOC_DEFAULT): Update.
15695 2001-08-08 Marc Autret <autret_m@epita.fr>
15697 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
15698 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15699 Reported by Fabrice Bauzac.
15701 2001-08-08 Marc Autret <autret_m@epita.fr>
15703 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15704 * src/vcg.c (output_node): Fix.
15705 * src/vcg.h: Cleanup.
15706 * src/print_graph.c: Add comments.
15707 (node_output_size): New global variable. Simplify the formatting of
15708 the VCG graph output.
15709 (print_actions): Unused code is now used. It notifies the final state
15710 and no action states in the VCG graph. It also give the reduce actions.
15711 The `shift and goto' edges are red and the `go to state' edges are
15713 Get the current node name and node_obstack by argument.
15714 (node_obstack): New variable.
15715 (print_state): Manage node_obstack.
15716 (print_core): Use node_obstack given by argument.
15717 A node is not only computed here but in print_actions also.
15718 (print_graph): CPP out useless code instead of commenting it.
15720 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
15722 * tests/atconfig.in (CPPFLAGS): Fix.
15724 2001-08-07 Akim Demaille <akim@epita.fr>
15726 * src/print_graph.c (quote): New.
15727 (print_core): Use it.
15729 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
15731 * src/vcg.c (complain.h): Include it.
15732 Unepitaize `return' invocations.
15733 [NDEBUG] (main): Remove.
15734 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
15735 * src/files.c (open_files): Initialize graph_obstack.
15736 * src/print_graph.c (print_actions): CPP out useless code.
15737 (print_core): Don't output the last `\n' in labels.
15739 * src/files.c (output_files): Output the VCG file.
15740 * src/main.c (main): Invoke print_graph ();
15742 2001-08-06 Marc Autret <autret_m@epita.fr>
15744 Automaton VCG graph output.
15745 Using option ``-g'' or long option ``--graph'', you can generate
15746 a gram_filename.vcg file containing a VCG description of the LALR (1)
15747 automaton of your grammar.
15749 * src/main.c: Call to print_graph() function.
15750 * src/getargs.h: Update.
15751 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15752 (graph_flag): New flag.
15753 (longopts): Update.
15754 (getargs): Add case `g'.
15755 * src/files.c (graph_obstack): New obstack struct.
15756 (open_files): Initialize new obstack.
15757 (output_files): Saves graph_obstack if required.
15758 * src/files.h (graph_obstack): New extern declaration.
15759 * src/Makefile.am: Add new source files.
15761 2001-08-06 Marc Autret <autret_m@epita.fr>
15763 * src/print_graph.c, src/print_graph.h (graph): New.
15764 * src/vcg.h: New file.
15765 * src/vcg.c: New file, VCG graph handling.
15767 2001-08-06 Marc Autret <autret_m@epita.fr>
15769 Add of %source_extension and %header_extension which specify
15770 the source or/and the header output file extension.
15772 * src/files.c (compute_base_names): Remove initialisation of
15773 src_extension and header_extension.
15774 (compute_exts_from_gf): Update.
15775 (compute_exts_from_src): Update.
15776 (output_files): Update.
15777 * src/reader.c (parse_header_extension_decl): New.
15778 (parse_source_extension_decl): New.
15779 (read_declarations): New case statements for the new tokens.
15780 * src/lex.c (percent_table): Add entries for %source_extension
15781 and %header_extension.
15782 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15784 2001-08-06 Marc Autret <autret_m@epita.fr>
15786 * configure.in: Bump to 1.28c.
15787 * doc/bison.texinfo: Texinfo thingies.
15789 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
15791 * tests/atconfig.in (CPPFLAGS): Add.
15792 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15794 2001-08-03 Akim Demaille <akim@epita.fr>
15798 2001-08-03 Akim Demaille <akim@epita.fr>
15800 * tests/Makefile.am (check-local): Ship testsuite.
15801 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15802 Include `string.h'.
15804 2001-08-03 Akim Demaille <akim@epita.fr>
15806 * configure.in: Try using -Wformat when compiling.
15808 2001-08-03 Akim Demaille <akim@epita.fr>
15810 * configure.in: Bump to 1.28b.
15812 2001-08-03 Akim Demaille <akim@epita.fr>
15814 * src/complain.c: Adjust strerror_r portability issues.
15816 2001-08-03 Akim Demaille <akim@epita.fr>
15820 2001-08-03 Akim Demaille <akim@epita.fr>
15822 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15823 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15824 * src/getargs.c: Include complain.h.
15825 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15826 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15828 2001-08-03 Akim Demaille <akim@epita.fr>
15830 * src/reader.c (readgram): Display hidden chars in error messages.
15832 2001-08-03 Akim Demaille <akim@epita.fr>
15834 Update to gettext 0.10.39.
15836 2001-08-03 Akim Demaille <akim@epita.fr>
15838 * lib/strspn.c: New.
15840 2001-08-01 Marc Autret <autret_m@epita.fr>
15842 * doc/bison.texinfo: Update.
15843 * doc/bison.1 (mandoc): Update.
15844 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15845 * src/files.c: Support output files extensions computing.
15846 (src_extension): New static variable.
15847 (header_extension): New static variable.
15848 (tr): New function.
15849 (get_extension_index): New function, gets the index of an extension
15850 filename in a string.
15851 (compute_exts_from_gf): New function, computes extensions from the
15852 grammar file extension.
15853 (compute_exts_from_src): New functions, computes extensions from the
15854 C source file extension, file given by ``-o'' option.
15855 (compute_base_names): Update.
15856 (output_files): Update.
15858 2001-08-01 Robert Anisko <anisko_r@epita.fr>
15860 * doc/bison.texi: Document @$.
15861 (Locations): New section.
15863 2001-07-18 Akim Demaille <akim@epita.fr>
15865 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15866 * config/prev-version.txt, config/move-if-change: New.
15867 * Makefile.am: Adjust.
15869 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
15871 * src/bison.simple (yyparse): Suppress warning `comparaison
15872 between signed and unsigned'.
15874 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
15876 * src/getargs.h (raw_flag): Remove.
15877 * src/getargs.c: Die on `-r'/`--raw'.
15878 * src/lex.c (parse_percent_token): Die on `%raw'.
15879 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
15880 * tests/calc.at: Suppress test with option `--raw'.
15882 2001-07-14 Akim Demaille <akim@epita.fr>
15885 * configure.in: Require Autoconf 2.50.
15886 Update to gettext 0.10.38.
15888 2001-03-16 Akim Demaille <akim@epita.fr>
15890 * doc/bison.texinfo: ANSIfy the examples.
15892 2001-03-16 Akim Demaille <akim@epita.fr>
15894 * getargs.c (skeleton): New variable.
15895 (longopts): --skeleton is a new option.
15896 (shortopts, getargs): -S is a new option.
15897 * getargs.h: Declare skeleton.
15898 * output.c (output_parser): Use it.
15900 2001-03-16 Akim Demaille <akim@epita.fr>
15902 * m4/strerror_r.m4: New.
15903 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15904 * lib/error.h, lib/error.c: Update.
15906 2001-03-16 Akim Demaille <akim@epita.fr>
15908 * src/getargs.c (longopts): Clean up.
15910 2001-02-21 Akim Demaille <akim@epita.fr>
15912 * src/reader.c (gensym): `gensym_count' is your own.
15913 Use a static buf to create the symbol name, as token_buffer is no
15916 2001-02-08 Akim Demaille <akim@epita.fr>
15918 * src/conflicts.c (conflict_report): Be sure not to append to res
15919 between two calls, which could happen if both first sprintf were
15920 skipped, but not the first cp += strlen.
15922 2001-02-08 Akim Demaille <akim@epita.fr>
15924 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
15925 New, from fileutils 4.0.37.
15926 * configure.in: Require Autoconf 2.49c. I took some time before
15927 making this decision. This is the only way out for portability
15928 issues in Bison, it would mean way too much duplicate effort to
15929 import in Bison features implemented in 2.49c since 2.13.
15930 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15932 2001-02-02 Akim Demaille <akim@epita.fr>
15934 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
15935 * lib/xalloc.h, lib/xmalloc.c: Update.
15937 2001-01-19 Akim Demaille <akim@epita.fr>
15939 Get rid of the ad hoc handling of token_buffer in the scanner: use
15942 * src/lex.c (token_obstack): New.
15943 (init_lex): Initialize it. No longer call...
15944 (grow_token_buffer): this. Remove it.
15945 Adjust all the places which used it to use the obstack.
15947 2001-01-19 Akim Demaille <akim@epita.fr>
15949 * src/lex.h: Rename all the tokens:
15950 s/\bENDFILE\b/tok_eof/g;
15951 s/\bIDENTIFIER\b/tok_identifier/g;
15953 Let them be enums, not #define, to ease debugging.
15954 Adjust all the code.
15956 2001-01-18 Akim Demaille <akim@epita.fr>
15958 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15959 * src/lex.c (maxtoken, grow_token_buffer): Static.
15961 2001-01-18 Akim Demaille <akim@epita.fr>
15963 Since we now use obstacks, more % directives can be enabled.
15965 * src/lex.c (percent_table): Also accept `%yacc',
15966 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15968 Handle the actions for `%semantic_parser' and `%pure_parser' here,
15969 instead of returning a token.
15970 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
15971 * src/reader.c (read_declarations): Adjust.
15972 * src/files.c (open_files): Don't call `compute_base_names', don't
15973 compute `attrsfile' since they depend upon data which might be
15974 *in* the input file now.
15975 (output_files): Do it here.
15976 * src/output.c (output_headers): Document the fact that this patch
15977 introduces a guaranteed SEGV for semantic parsers.
15978 * doc/bison.texinfo: Document them.
15979 * tests/suite.at: Exercise these %options.
15981 2000-12-20 Akim Demaille <akim@epita.fr>
15983 Also handle the output file (--verbose) with obstacks.
15985 * files.c (foutput): Remove.
15986 (output_obstack): New.
15987 Adjust all dependencies.
15988 * src/conflicts.c: Return a string.
15989 * src/system.h (obstack_grow_string): Rename as...
15990 (obstack_sgrow): this. Be ready to work with non literals.
15991 (obstack_fgrow4): New.
15993 2000-12-20 Akim Demaille <akim@epita.fr>
15995 * src/files.c (open_files): Fix the computation of short_base_name
15996 in the case of `-o foo.tab.c'.
15998 2000-12-20 Akim Demaille <akim@epita.fr>
16000 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16001 (copy_dollar): Now that everything uses obstacks, get rid of the
16004 2000-12-20 Akim Demaille <akim@epita.fr>
16006 * src/files.c (open_files): Actually the `.output' file is based
16007 on the short_base_name, not base_name.
16008 * tests/suite.at (Checking output file names): Adjust.
16010 2000-12-20 Akim Demaille <akim@epita.fr>
16012 * src/bison.s1: Remove, we now use directly...
16013 * src/bison.simple: this.
16014 * src/Makefile.am: Use pkgdata instead of data.
16016 2000-12-20 Akim Demaille <akim@epita.fr>
16018 * src/files.c (guard_obstack): New.
16019 (open_files): Initialize it.
16020 (output_files): Dump it...
16021 * src/files.h: Export it.
16022 * src/reader.c (copy_guard): Use it.
16024 2000-12-19 Akim Demaille <akim@epita.fr>
16026 * src/files.c (outfile, defsfile, actfile): Removed as global
16028 (open_files): Don't compute them.
16029 (output_files): Adjust.
16030 (base_name, short_base_name): Be global.
16031 Adjust dependencies.
16033 2000-12-19 Akim Demaille <akim@epita.fr>
16035 * src/files.c (strsuffix): New.
16036 (stringappend): Be just like strcat but allocate.
16037 (base_names): Eve out from open_files.
16038 Try to simplify the rather hairy computation of base_name and
16040 (open_files): Use it.
16041 * tests/suite.at (Checking output file names): New test.
16043 2000-12-19 Akim Demaille <akim@epita.fr>
16045 * src/system.h (obstack_grow_literal_string): Rename as...
16046 (obstack_grow_string): this.
16047 * src/output.c (output_parser): Recognize `%% actions' instead of
16049 * src/bison.s1: s/$/%% actions/.
16050 * src/bison.hairy: Likewise.
16052 2000-12-19 Akim Demaille <akim@epita.fr>
16054 * src/output.c (output_parser): Compute the `#line' lines when
16056 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16057 Suggested by Hans Aberg.
16059 2000-12-19 Akim Demaille <akim@epita.fr>
16061 Let the handling of the skeleton files be local to the procedures
16064 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16066 (fparser, open_extra_files): Remove.
16067 (open_files, output_files): Don't take care of fparser.
16068 * src/files.h: Adjust.
16069 * src/output.c (output_parser): Open and close the file to the
16071 * src/reader.c (read_declarations): When %semantic_parser, open
16074 2000-12-19 Akim Demaille <akim@epita.fr>
16076 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16077 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16079 2000-12-19 Akim Demaille <akim@epita.fr>
16081 * src/files.c (open_files): Yipee! We no longer need all the code
16082 looking for `/tmp' since we have no tmp file.
16084 2000-12-19 Akim Demaille <akim@epita.fr>
16086 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16088 * src/files.c (open_files): Less dependency on MSDOS etc.
16090 2000-12-14 Akim Demaille <akim@epita.fr>
16092 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16093 Provide a default definition.
16094 Use it when executing the default @ action.
16095 * src/reader.c (reader_output_yylsp): No longer include
16096 `timestamp' and `text' in the default YYLTYPE.
16098 2000-12-12 Akim Demaille <akim@epita.fr>
16100 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16101 (copy_guard): Quote the file names.
16102 Reported by Laurent Mascherpa.
16104 2000-12-12 Akim Demaille <akim@epita.fr>
16106 * src/output.c (output_headers, output_program, output): Be sure
16107 to escape special characters when outputting filenames.
16108 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16109 (output_headers): Don't depend on them, Use ACTSTR.
16111 2000-11-17 Akim Demaille <akim@epita.fr>
16113 * lib/obstack.h: Formatting changes.
16114 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16115 prevents type checking.
16116 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16117 cast the value to (void *): assigning a `foo *' to a `void *'
16119 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16120 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16123 2000-11-17 Akim Demaille <akim@epita.fr>
16125 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16127 (suite.m4, regression.m4, calc.m4): these.
16128 * tests/atgeneral.m4: Update from CVS Autoconf.
16130 2000-11-17 Akim Demaille <akim@epita.fr>
16132 * tests/regression.m4 (%union and --defines): New test,
16133 demonstrating a current bug in the obstack implementation.
16135 2000-11-17 Akim Demaille <akim@epita.fr>
16137 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16139 Use them to declare the variables which are global or local to
16142 2000-11-17 Akim Demaille <akim@epita.fr>
16144 * acconfig.h: Remove, no longer used.
16146 2000-11-07 Akim Demaille <akim@epita.fr>
16148 * src: s/Copyright (C)/Copyright/g.
16150 2000-11-07 Akim Demaille <akim@epita.fr>
16152 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16154 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16156 2000-11-07 Akim Demaille <akim@epita.fr>
16158 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16159 Merge in a single CPP if/else.
16161 2000-11-07 Akim Demaille <akim@epita.fr>
16163 * src/output.c (output): Remove useless variables.
16164 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16165 argument `data' for consistency with the prototypes.
16166 Qualify it `const'.
16167 (obstack_copy, obstack_copy0): Rename the second argument as
16168 `address' for consistency. Qualify it `const'.
16169 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16170 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16171 `const' their input argument (`data' or `address').
16172 Adjust the corresponding macros to include `const' in casts.
16174 2000-11-03 Akim Demaille <akim@epita.fr>
16176 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16177 s/PFILE1/BISON_HAIRY/.
16178 Adjust dependencies.
16180 2000-11-03 Akim Demaille <akim@epita.fr>
16182 For some reason, this was not applied.
16184 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16185 `unlink': it's no longer used.
16187 2000-11-03 Akim Demaille <akim@epita.fr>
16189 * src/files.c (skeleton_find): New function, eved out of...
16190 (open_files, open_extra_files): here.
16192 2000-11-03 Akim Demaille <akim@epita.fr>
16194 Don't use `atexit'.
16196 * src/files.c (obstack_save): New function.
16197 (done): Rename as...
16198 (output_files): this.
16199 Use `obstack_save'.
16200 * src/main.c (main): Don't use `atexit' to register `done', since
16201 it no longer has to remove tmp files, just call `output_files'
16202 when there are no errors.
16204 2000-11-02 Akim Demaille <akim@epita.fr>
16206 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16207 `unlink': it's no longer used.
16208 * src/files.h: Formatting changes.
16210 2000-11-02 Akim Demaille <akim@epita.fr>
16212 Remove the last uses of mktemp and unlink/delete.
16214 * src/files.c (fdefines, ftable): Removed.
16215 (defines_ostack, table_obstack): New.
16216 Adjust dependencies of the former into uses of the latter.
16217 * src/output.c (output_short_or_char_table, output_short_table):
16218 Convert to using obstacks.
16219 * src/reader.c (copy_comment2): Accept one FILE * and two
16221 (output_token_defines, reader_output_yylsp): Use obstacks.
16222 * src/system.h (obstack_fgrow3): New.
16223 * po/POTFILES.in: Adjust.
16225 2000-11-01 Akim Demaille <akim@epita.fr>
16227 Change each use of `fattrs' into a use of `attrs_obstack'.
16229 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16230 * src/files.c (fattrs): Remove.
16231 (attrs_obstack): New.
16232 Adjust all dependencies.
16233 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16235 2000-11-01 Akim Demaille <akim@epita.fr>
16237 Introduce obstacks.
16238 Change each use of `faction' into a use of `action_obstack'.
16240 * lib/obstack.h, lib/obstack.c: New files.
16241 * src/files.c (faction): Remove.
16242 (action_obstack): New.
16243 Adjust all dependencies.
16245 2000-10-20 Akim Demaille <akim@epita.fr>
16247 * lib/quote.h (PARAMS): New macro. Use it.
16249 2000-10-16 Akim Demaille <akim@epita.fr>
16251 * src/output.c (output_short_or_char_table): New function.
16252 (output_short_table, output_token_translations): Use it.
16253 (goto_actions): Use output_short_table.
16255 2000-10-16 Akim Demaille <akim@epita.fr>
16257 * src/symtab.c (bucket_new): New function.
16260 * src/output.c (output_short_table): New argument to display the
16261 comment associated with the table.
16262 Adjust dependencies.
16263 (output_gram): Use it.
16264 (output_rule_data): Nicer output layout for YYTNAME.
16266 2000-10-16 Akim Demaille <akim@epita.fr>
16268 * src/lex.c (read_typename): New function.
16270 * src/reader.c (copy_dollar): Likewise.
16272 2000-10-16 Akim Demaille <akim@epita.fr>
16274 * src/reader.c (copy_comment2): Expect the input stream to be on
16275 the `/' which is suspected to open a comment, instead of being
16276 called after `//' or `/*' was read.
16277 (copy_comment, copy_definition, parse_union_decl, copy_action)
16278 (copy_guard): Adjust.
16280 2000-10-16 Akim Demaille <akim@epita.fr>
16282 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16283 `read_signed_integer'.
16285 2000-10-16 Akim Demaille <akim@epita.fr>
16287 * src/reader.c (copy_dollar): New function.
16288 (copy_guard, copy_action): Use it.
16290 2000-10-16 Akim Demaille <akim@epita.fr>
16292 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16293 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16294 New files, from Fileutils 4.0.27.
16295 * src/main.c (printable_version): Remove.
16296 * src/lex.c, src/reader.c: Use `quote'.
16298 2000-10-04 Akim Demaille <akim@epita.fr>
16300 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16302 2000-10-04 Akim Demaille <akim@epita.fr>
16304 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16306 2000-10-04 Akim Demaille <akim@epita.fr>
16308 When a literal string is used to define two different tokens,
16309 `bison -v' segfaults.
16310 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16312 * tests/regression.m4: New file.
16313 Include the core of the sample provided by Piotr Gackiewicz.
16314 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16317 2000-10-04 Akim Demaille <akim@epita.fr>
16319 * src/reader.c (parse_expect_decl): Keep `count' within the size
16323 2000-10-02 Paul Eggert <eggert@twinsun.com>
16325 * bison.s1 (yyparse): Assign the default value
16326 unconditionally, to avoid a GCC warning and make the parser a
16329 2000-10-02 Akim Demaille <akim@epita.fr>
16331 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16334 2000-10-02 Akim Demaille <akim@epita.fr>
16336 * src/derives.c, src/print.c, src/reduce.c: To ease the
16337 translation, move some `\n' out of the translated strings.
16339 2000-10-02 Akim Demaille <akim@epita.fr>
16341 The location tracking mechanism is precious for parse error
16342 messages. Nevertheless, it is enabled only when `@n' is used in
16343 the grammar, which is a different issue (you can use it in error
16344 message, but not in the grammar per se). Therefore, there should
16345 be another means to enable it.
16347 * src/getargs.c (getargs): Support `--locations'.
16348 (usage): Report it.
16349 * src/getargs.h (locationsflag): Export it.
16350 * src/lex.c (percent_table): Support `%locations'.
16351 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16352 with `locationsflag'.
16353 * doc/bison.texinfo: Document `--locations' and `%locations'.
16355 * tests/calc.m4: Test it.
16357 For regularity of the names, replace each
16358 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16359 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16360 In addition replace each `flag' with `_flag'.
16362 2000-10-02 Akim Demaille <akim@epita.fr>
16364 Also test parse error messages, including with YYERROR_VERBOSE.
16366 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16368 Use it to check the computations.
16369 Use it to check `nonassoc' is honored.
16370 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16371 `--yyerror-verbose'.
16372 (_AT_CHECK_CALC): Adjust to this option.
16373 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16375 2000-10-02 Akim Demaille <akim@epita.fr>
16377 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16378 the latter demonstrates a flaw in the handling of non debugging
16379 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16380 was used in order to simplify:
16396 unfortunately this leads to a CPP conflict when
16397 `--name-prefix=foo' is used since it produces `#define yydebug
16400 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16401 (YYDPRINTF): New macro.
16403 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16405 Also test `--verbose', `--defines' and `--name-prefix'.
16407 2000-10-02 Akim Demaille <akim@epita.fr>
16409 Improve the readability of the produced parsers.
16411 * src/bison.s1: Formatting changes.
16412 Improve the comment related to the `$' mark.
16413 (yydefault): Don't fall through to `yyresume': `goto' there.
16414 * src/output.c (output_parser): When the `$' is met, skip the end
16416 New variable, `number_of_dollar_signs', to check there's exactly
16417 one `$' in the parser skeleton.
16419 2000-10-02 Akim Demaille <akim@epita.fr>
16421 * lib/xstrdup.c: New file, from the fileutils.
16422 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16423 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16424 instead of strlen + xmalloc + strcpy.
16425 * src/symtab.c (copys): Remove, use xstrdup instead.
16427 2000-10-02 Akim Demaille <akim@epita.fr>
16429 * src/gram.h (associativity): New enum type which replaces the
16430 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16431 `right_assoc', `left_assoc' and `non_assoc'.
16432 Adjust all dependencies.
16433 * src/reader.c: Formatting changes.
16434 (LTYPESTR): Don't define it, use it as a literal in
16435 `reader_output_yylsp'.
16436 * src/symtab.h (symbol_class): New enum type which replaces the
16437 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16438 `sunknown', `stoken and `snterm'.
16440 2000-10-02 Akim Demaille <akim@epita.fr>
16442 * src/getargs.c (fixed_outfiles): Rename as...
16443 (yaccflag): for consistency and accuracy.
16444 Adjust dependencies.
16446 2000-10-02 Akim Demaille <akim@epita.fr>
16448 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16449 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16450 difficult and introduced a lot of core dump. It turns out that
16451 Bison used an implementation of `xmalloc' based on `calloc', and
16452 at various places it does depend upon the initialization to 0. I
16453 have not tried to isolate the pertinent places, and all the former
16454 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16455 someone should address this issue.
16457 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16458 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16460 Adjust dependencies.
16461 * src/warshall.h: New file.
16464 2000-10-02 Akim Demaille <akim@epita.fr>
16466 Various anti-`extern in *.c' changes.
16468 * src/system.h: Include `assert.h'.
16470 2000-10-02 Akim Demaille <akim@epita.fr>
16472 * src/state.h (nstates, final_state, first_state, first_shift)
16473 (first_reduction): Move their exportation from here...
16474 * src/LR0.h: to here.
16475 Adjust dependencies.
16476 * src/getargs.c (statisticsflag): New variable.
16477 Add support for `--statistics'.
16478 Adjust dependencies.
16480 Remove a lot of now useless `extern' statements in most files.
16482 2000-10-02 Akim Demaille <akim@epita.fr>
16484 * src/LR0.h: New file.
16487 2000-10-02 Akim Demaille <akim@epita.fr>
16489 * src/print.h: New file.
16491 * src/print.c: Formatting and ordering changes.
16492 (verbose, terse): Replace with...
16493 (print_results): this new function.
16494 Adjust dependencies.
16496 2000-10-02 Akim Demaille <akim@epita.fr>
16498 * src/conflicts.c (conflict_report): New function.
16499 (conflict_log, verbose_conflict_log): Replace with...
16500 (print_conflicts): this function.
16501 Adjust dependencies.
16502 * src/conflicts.h: New file.
16503 Propagate its inclusion.
16505 2000-10-02 Akim Demaille <akim@epita.fr>
16507 * src/nullable.h: New file.
16508 Propagate its inclusion.
16509 * src/nullable.c: Formatting changes.
16511 2000-10-02 Akim Demaille <akim@epita.fr>
16513 * src/reduce.h: New file.
16514 Propagate its inclusion.
16515 * src/reduce.c: Topological sort and other formatting changes.
16516 (bool, TRUE, FALSE): Move their definition to...
16517 * src/system.h: here.
16519 2000-10-02 Akim Demaille <akim@epita.fr>
16521 * src/files.c: Formatting changes.
16522 (tryopen, tryclose, openfiles): Rename as...
16523 (xfopen, xfclose, open_files): this.
16524 (stringappend): static.
16525 * src/files.h: Complete the list of exported symbols.
16528 2000-10-02 Akim Demaille <akim@epita.fr>
16530 * src/reader.h: New file.
16531 Propagate its use instead of tedious list of `extern' and
16533 * src/reader.c: Formatting changes, topological sort,
16536 2000-10-02 Akim Demaille <akim@epita.fr>
16538 * src/lex.h: Prototype `lex.c' exported functions.
16539 * src/reader.c: Adjust.
16540 * src/lex.c: Formatting changes.
16541 (safegetc): Rename as...
16544 2000-10-02 Akim Demaille <akim@epita.fr>
16546 * src/lalr.h: New file.
16547 Propagate its inclusion instead of prototypes and `extern'.
16548 * src/lalr.c: Formatting changes, topological sorting etc.
16550 2000-10-02 Akim Demaille <akim@epita.fr>
16552 * src/output.c (token_actions): Introduce a temporary array,
16553 YYDEFACT, that makes it possible for this function to use
16554 output_short_table.
16556 2000-10-02 Akim Demaille <akim@epita.fr>
16558 `user_toknums' is output as a `short[]' in `output.c', while it is
16559 defined as a `int[]' in `reader.c'. For consistency with the
16560 other output tables, `user_toknums' is now defined as a table of
16563 * src/reader.c (user_toknums): Be a short table instead of an int
16565 Adjust dependencies.
16567 Factor the short table outputs.
16569 * src/output.c (output_short_table): New function.
16570 * src/output.c (output_gram, output_stos, output_rule_data)
16571 (output_base, output_table, output_check): Use it.
16573 2000-10-02 Akim Demaille <akim@epita.fr>
16575 * src/output.c (output): Topological sort of the functions, in
16576 order to get rid of the `static' prototypes.
16577 No longer use `register'.
16578 * src/output.h: New file.
16579 Propagate its inclusion in files explicitly prototyping functions
16582 2000-09-21 Akim Demaille <akim@epita.fr>
16584 * src/atgeneral.m4: Update from Autoconf.
16586 2000-09-21 Akim Demaille <akim@epita.fr>
16588 * src/closure.h: New file.
16589 * src/closure.c: Formatting changes, topological sort over the
16590 functions, use of closure.h.
16591 (initialize_closure, finalize_closure): Rename as...
16592 (new_closure, free_closure): these. Adjust dependencies.
16593 * src/LR0.c: Formatting changes, topological sort, use of
16595 (initialize_states): Rename as...
16596 (new_states): this.
16597 * src/Makefile.am (noinst_HEADERS): Adjust.
16599 2000-09-20 Akim Demaille <akim@epita.fr>
16601 * src/acconfig.h: Don't protect config.h against multiple
16603 Don't define PARAMS.
16604 * src/system.h: Define PARAMS.
16605 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
16606 purpose of config.h. system.h must not try to fix wrong
16607 definitions in config.h.
16609 2000-09-20 Akim Demaille <akim@epita.fr>
16611 * src/derives.h: New file.
16612 * src/main.c, src/derives.h: Use it.
16613 Formatting changes.
16614 * src/Makefile.am (noinst_HEADERS): Adjust.
16616 2000-09-20 Akim Demaille <akim@epita.fr>
16618 * tests/atgeneral.m4: Update from Autoconf.
16619 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
16620 (AT_CHECK_CALC): New macros.
16621 Use these macros to test bison with options `', `--raw',
16622 `--debug', `--yacc', `--yacc --debug'.
16624 2000-09-19 Akim Demaille <akim@epita.fr>
16626 * src/output.c: Formatting changes.
16627 * src/machine.h: Remove, leaving its contents in...
16628 * src/system.h: here.
16630 Adjust all dependencies on stdio.h and machine.h.
16631 * src/getargs.h: New file.
16632 Let all `extern' declarations about getargs.c be replaced with
16633 inclusion of `getargs.h'.
16634 * src/Makefile.am (noinst_HEADERS): Adjust.
16636 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16638 (yyerror): Returns void, not int.
16639 * doc/bison.texinfo: Formatting changes.
16641 2000-09-19 Akim Demaille <akim@epita.fr>
16643 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16646 2000-09-18 Akim Demaille <akim@epita.fr>
16648 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16649 * src/Makefile.am (INCLUDES): Don't.
16650 Be ready to fetch headers in lib/.
16652 2000-09-18 Akim Demaille <akim@epita.fr>
16654 * doc/bison.texinfo: Update the copyright.
16655 ANSIfy and GNUify the examples.
16656 Remove the old menu.
16658 2000-09-18 Akim Demaille <akim@epita.fr>
16660 First set of tests: use the `calc' example from the documentation.
16662 * src/bison.s1 (yyparse): Condition the code using `yytname' which
16663 is defined only when YYDEBUG is.
16664 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
16665 * src/files.c (tryopen, tryclose): Formatting changes.
16666 Move to the top and be static.
16667 * src/reader.c (read_signed_integer): Likewise.
16668 * tests/calc.m4: New file.
16669 * Makefile.am, suite.m4: Adjust.
16670 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
16672 2000-09-18 Akim Demaille <akim@epita.fr>
16674 Add support for an Autotest test suite for Bison.
16676 * m4/m4.m4, m4/atconfig.m4: New files.
16677 * m4/Makefile.am (EXTRA_DIST): Adjust.
16678 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
16680 * src/getargs.c: Display a more standard --version message.
16681 * src/reader.c (reader): Formatting changes.
16682 No longer depend upon VERSION_STRING.
16683 * configure.in: No longer use `dnl'.
16684 Set up the test suite and the new directory `tests/.
16685 (VERSION_STRING): Remove.
16687 2000-04-14 Akim Demaille <akim@epita.fr>
16689 * src/reader.c (copy_comment2): New function, same as former
16690 `copy_comment', but outputs into two FILE *.
16691 (copy_comment): Use it.
16692 (parse_union_decl): Use it.
16693 (get_type, parse_start_decl): Use the same `invalid' message.
16694 (parse_start_decl, parse_union_decl): Use the same `multiple'
16696 (parse_union_decl, copy_guard, copy_action): Use the same
16697 `unmatched' message.
16698 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16700 2000-03-31 Akim Demaille <akim@epita.fr>
16702 * src/files.c (tryopen, tryclose): Move to the top.
16705 2000-03-31 Akim Demaille <akim@epita.fr>
16707 * src/main.c (main): Don't call `done', exit does it.
16709 2000-03-31 Akim Demaille <akim@epita.fr>
16711 * allocate.c: s/return (foo)/return foo/.
16712 * lalr.c: Likewise.
16714 * output.c: Likewise.
16715 * reader.c: Likewise.
16716 * symtab.c: Likewise.
16717 * vmsgetargs.c: Likewise.
16719 2000-03-31 Akim Demaille <akim@epita.fr>
16721 Clean up the error reporting functions.
16723 * src/report.c: New file.
16724 * src/report.h: Likewise.
16725 * src/Makefile.am: Adjust.
16726 * m4/error.m4: New file.
16727 * m4/Makefile.am: Adjust.
16728 * configure.in (jm_PREREQ_ERROR): Call it.
16729 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16731 (fatal, fatals): Remove. All callers use complain.c::fatal.
16732 (warn, warni, warns, warnss, warnss): Remove. All callers use
16733 complain.c::complain.
16734 (toomany): Remove, use fatal instead.
16735 * src/files.c (done): No argument, use complain_message_count.
16736 * src/main.c (main): Register `done' to `atexit'.
16738 * src/getargs.c (usage): More `fputs', less `fprintf'.
16740 2000-03-28 Akim Demaille <akim@epita.fr>
16742 * lib/: New directory.
16743 * Makefile.am (SUBDIRS): Adjust.
16744 * configure.in: Adjust.
16745 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16747 * src/alloca.c: Moved to lib/.
16748 * src/getopt.c: Likewise.
16749 * src/getopt1.c: Likewise.
16750 * src/getopt.h: Likewise.
16751 * src/ansi2knr.c: Likewise.
16752 * src/ansi2knr.1: Likewise.
16753 * src/Makefile.am: Adjust.
16754 * lib/Makefile.am: New file.
16756 2000-03-28 Akim Demaille <akim@epita.fr>
16758 * src/getargs.c (usage): Refresh the help message.
16760 2000-03-17 Akim Demaille <akim@epita.fr>
16762 * src/getopt1.c: Updated from textutils 2.0e
16763 * src/getopt.c: Likewise.
16764 * src/getopt.h: Likewise.
16766 2000-03-17 Akim Demaille <akim@epita.fr>
16768 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16769 the file name, not the whole `#line LINE FILE'.
16771 2000-03-17 Akim Demaille <akim@epita.fr>
16773 On syntax errors, report the token on which we choked.
16775 * src/bison.s1 (yyparse): In the label yyerrlab, when
16776 YYERROR_VERBOSE, add yychar in msg.
16778 2000-03-17 Akim Demaille <akim@epita.fr>
16780 * src/reader.c (copy_at): New function.
16781 (copy_guard): Use it.
16782 (copy_action): Use it.
16784 2000-03-17 Akim Demaille <akim@epita.fr>
16786 Be kind to translators, save some useless translations.
16788 * src/main.c (banner): New function.
16789 (fatal_banner): Use it.
16790 (warn_banner): Use it.
16792 2000-03-17 Akim Demaille <akim@epita.fr>
16794 * src/reader.c (copy_definition): Use copy_string and
16795 copy_comment. Removed now unused `match', `ended',
16797 (copy_comment, copy_string): Moved, to be visible from
16800 2000-03-17 Akim Demaille <akim@epita.fr>
16802 * src/reader.c (copy_string): Declare `static inline'. No
16803 problems with inline, since it is checked by configure.
16804 (copy_comment): Likewise.
16806 2000-03-17 Akim Demaille <akim@epita.fr>
16808 * src/reader.c (packsymbols): Formatting changes.
16810 2000-03-17 Akim Demaille <akim@epita.fr>
16812 * src/reader.c (copy_comment): New function, factored out from:
16813 (copy_action): Use it. Removed now unused `match', `ended',
16815 (copy_guard): Likewise.
16817 2000-03-17 Akim Demaille <akim@epita.fr>
16819 * src/reader.c (copy_string): New function, factored out from:
16820 (copy_action): Use it.
16821 (copy_guard): Likewise.
16823 2000-03-17 Akim Demaille <akim@epita.fr>
16825 Change the handling of @s so that they behave exactly like $s.
16826 There is now a pseudo variable @$ (readble and writable), location
16827 of the lhs of the rule (by default ranging from the location of
16828 the first symbol of the rhs, to the location of the last symbol,
16829 or, if the rhs is empty, YYLLOC).
16831 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16833 (yyparse): When providing a default semantic action, provide a
16834 default location action.
16835 (after the $): No longer change `*YYLSP', just stack YYLOC the
16836 same way you stack YYVAL.
16837 * src/reader.c (read_declarations): Use warns.
16838 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16839 (copy_action, case '@'): Likewise.
16840 Use a standard error message, to save useless work from
16843 2000-03-17 Akim Demaille <akim@epita.fr>
16845 * src/bison.s1: Formatting and cosmetics changes.
16846 * src/reader.c: Likewise.
16847 Update the Copyright notice.
16849 2000-03-17 Akim Demaille <akim@epita.fr>
16851 * src/bison.s1 (#line): All set to `#line' only, since the
16852 Makefile now handles them.
16854 2000-03-16 Akim Demaille <akim@epita.fr>
16856 * src/output.c (output_rule_data): Output the documentation of
16857 some of the tables.
16858 (Copyright notice): Update.
16859 Formatting changes.
16861 2000-03-16 Akim Demaille <akim@epita.fr>
16863 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
16864 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
16865 One `#if YYDEBUG' remains, since it uses variables which are
16866 defined only if `YYDEBUG != 0'.
16868 2000-03-16 Akim Demaille <akim@epita.fr>
16870 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16871 and related variables so that the similarities are highlighted.
16873 2000-03-16 Akim Demaille <akim@epita.fr>
16875 * src/bison.s1: Properly indent CPP directives.
16877 2000-03-16 Akim Demaille <akim@epita.fr>
16879 * src/bison.s1: Properly indent the `alloca' CPP section.
16881 2000-03-16 Akim Demaille <akim@epita.fr>
16883 Do not hard code values of directories in `configure.in'.
16884 Update the `configure' tool chain.
16886 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16888 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
16889 (AC_OUTPUT): Add m4/Makefile.
16890 Bump to bison 1.28a, 1.29 has never been released.
16891 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
16892 handled via src/Makefile.am.
16893 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
16894 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
16896 * Makefile.am (SUBDIRS): Add m4.
16897 (ACLOCAL_AM_FLAGS): New variable.
16898 (AUTOMAKE_OPTIONS): Add check-news.
16899 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
16900 the proper line number and file name.
16901 (DEFS): Propagate the location of bison library files and of the
16903 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16905 * acinclude.m4: Remove, replaced by the directory m4.
16906 * m4/Makefile.am (EXTRA_DIST): New variable.
16907 * m4/gettext.m4: New file, from the fileutils.
16908 * m4/lcmessage.m4: Likewise
16909 * m4/progtest.m4: Likewise.
16910 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
16912 2000-03-10 Akim Demaille <akim@epita.fr>
16915 Formatting changes of various comments.
16916 Respect the GNU coding standards at various places.
16917 Don't use `_()' when no translation is needed.
16919 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16922 OS/2 honors TMPDIR environment variable.
16924 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16926 * doc/bison.texinfo: Tweaked spelling and grammar.
16928 Removed reference to price of printed copy.
16929 Mention BISON_SIMPLE and BISON_HAIRY.
16931 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16933 * configure.in, NEWS:
16934 Bison 1.29 released.
16936 1999-10-27 Jesse Thilo <jthilo@gnu.org>
16938 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16939 Added reference card.
16941 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16943 * po/ru.po: Added Russian translation.
16945 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16947 * configure.in: Added Russian translation.
16949 1999-07-06 Jesse Thilo <jthilo@gnu.org>
16951 * configure.in, NEWS, README:
16952 Released version 1.28.
16954 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16957 Squashed redefinition warning on some systems.
16959 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16960 Have configure build version string instead of relying on ANSI string
16963 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16965 * po/POTFILES.in: Got rid of version.c.
16967 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16969 * acconfig.h, configure.in:
16970 Have configure build version string instead of relying on ANSI string
16973 1999-06-08 Jesse Thilo <jthilo@gnu.org>
16976 Dropped mention of `+' for long-named options.
16978 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16980 * src/files.c: Added <unistd.h> for unlink().
16982 * src/Makefile.am, src/system.h:
16985 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16987 * README: Added a FAQ list.
16989 * configure.in, acconfig.h:
16992 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16994 * doc/FAQ, doc/Makefile.am:
16997 1999-05-19 Jesse Thilo <jthilo@gnu.org>
16999 * src/alloc.h, src/symtab.h, src/version.c:
17000 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17002 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17004 * src/.cvsignore, src/Makefile.am:
17005 Reorganized: sources in `src', documentation in `doc'.
17007 * src/lex.c (literalchar):
17008 fixed the code for escaping double quotes (thanks
17011 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17013 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17014 Adjusted paths to reflect directory reorganization.
17016 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17018 * doc/.cvsignore, doc/Makefile.am:
17019 Reorganized: sources in `src', documentation in `doc'.
17021 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17024 Updated AC_INIT file to reflect directory reorganization.
17026 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17027 Reorganized: sources in `src', documentation in `doc'.
17029 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17032 Don't declare calloc() and realloc() if not necessary.
17034 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17036 * configure.in, acconfig.h, acinclude.m4:
17037 Don't declare calloc() and realloc() if not necessary.
17039 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17041 * po/.cvsignore: Added i18n support.
17043 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17045 * acconfig.h, configure.in, Makefile.am:
17046 Added i18n support.
17048 1999-03-22 Jesse Thilo <jthilo@gnu.org>
17050 * src/bison.s1: Fixed #line numbers.
17052 1999-03-15 Jesse Thilo <jthilo@gnu.org>
17054 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17055 Added PO files from Translation Project.
17057 1999-03-03 Jesse Thilo <jthilo@gnu.org>
17060 Added support for non-ANSI compilers (ansi2knr).
17062 1999-02-16 Jesse Thilo <jthilo@gnu.org>
17064 * configure.in: Bumped version number to 1.27.
17067 Added `bison.simple' to list of files removed by `make distclean'.
17069 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17071 * src/files.c, src/files.h:
17072 Defined locations of parser files in config.h instead of Makefile.
17074 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17076 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17077 Defined locations of parser files in config.h instead of Makefile.
17079 1999-02-09 Jesse Thilo <jthilo@gnu.org>
17082 Removed inappropriate use of $< macro.
17084 1999-02-05 Jesse Thilo <jthilo@gnu.org>
17086 * po/Makefile.in.in, po/POTFILES.in:
17087 Add `po' directory skeleton.
17089 1999-01-27 Jesse Thilo <jthilo@gnu.org>
17091 * README: Document help-bison list.
17093 * configure.in: Add check for mkstemp().
17095 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17097 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17098 Hush a few compiler warnings.
17101 Add tryclose(), which verifies that fclose was successful.
17102 Hush a couple of compiler warnings.
17104 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17106 * Makefile.am, OChangeLog:
17107 ChangeLog is now automatically generated. Include the old version as
17110 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17112 * src/gram.h, src/lalr.c, src/lex.c, src/lex.h, src/machine.h, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/state.h, src/symtab.c, src/symtab.h, src/types.h, src/vmsgetargs.c, src/warshall.c, src/allocate.c, src/alloc.h, src/bison.s1, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/files.h, src/getargs.c, src/gram.c, src/LR0.c:
17113 Update FSF address.
17115 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17117 * doc/bison.texinfo: Fix formatting glitch.
17119 * doc/bison.texinfo: Update FSF address.
17121 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17123 * acconfig.h: Update FSF address.
17125 1999-01-08 Jesse Thilo <jthilo@gnu.org>
17128 Don't define PACKAGE here, since config.h defines it.
17130 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17132 * src/reader.c: Update copyright date.
17135 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17136 favor of output directly to stderr (avoids buffer overruns).
17138 * src/reader.c: Some checks for premature EOF.
17140 * src/allocate.c, src/alloc.h, src/closure.c, src/conflicts.c, src/derives.c, src/getargs.c, src/gram.c, src/lalr.c, src/lex.c, src/LR0.c, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reduce.c, src/symtab.c, src/symtab.h, src/warshall.c:
17141 Use prototypes if the compiler understands them.
17143 * src/files.c: Honor TMPDIR on Unix hosts.
17144 Use prototypes if the compiler understands them.
17147 Fix a couple of buffer overrun bugs.
17148 Use prototypes if the compiler understands them.
17150 * src/system.h: Include unistd.h and ctype.h.
17151 Use #ifdef instead of #if for NLS symbols.
17153 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17155 * doc/bison.texinfo:
17156 Delete comment "consider using @set for edition number, etc..." since
17157 we now are doing so.
17159 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17162 Use prototypes if the compiler understands them.
17164 * NEWS: Document 1.26 highlights.
17166 * Makefile.am: Require Automake 1.3 or later.
17169 Use prototypes if the compiler understands them.
17171 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17174 Use VERSION symbol from automake for version number.
17176 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17178 * acconfig.h, configure.in, version.cin:
17179 Use VERSION symbol from automake for version number.
17181 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17184 Distribute original version of simple parser (bison.s1), not built
17185 version (bison.simple).
17187 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17189 * doc/bison.texinfo: Add info dir entry.
17191 * doc/bison.texinfo:
17192 Let automake put version number into documentation.
17194 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17196 * src/bison.cld, src/build.com, src/vmshlp.mar:
17197 Add non-RCS files from /gd/gnu/bison.
17199 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17202 Document the BISON_HAIRY and BISON_SIMPLE variables.
17204 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17206 * src/version.c: Build version.c automatically.
17209 Fix token numbering (used to start at 258, not 257).
17211 * src/system.h: Include config.h.
17213 * src/getargs.c: Update bug report address.
17215 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17216 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17218 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17221 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17223 * configure.in, version.cin:
17224 Build version.c automatically.
17226 * AUTHORS: Add AUTHORS file.
17228 * README: Update bug report address.
17231 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17233 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17234 Add automake stuff.
17236 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17238 * doc/bison.texinfo: Clean up some formatting.
17240 1998-05-05 Richard Stallman <rms@gnu.org>
17242 * doc/bison.texinfo:
17243 Explain better why to make a pure parser.
17245 1998-01-05 Richard Stallman <rms@gnu.org>
17247 * src/files.c (openfiles):
17248 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17249 find a temporary directory, if possible. Do not unlink files while
17252 1997-08-25 Richard Stallman <rms@gnu.org>
17254 * src/reader.c (stack_offset;):
17255 Change some warni to warns.
17257 * src/lex.c (literalchar): Use warns, not warni.
17259 1997-06-28 Richard Stallman <rms@gnu.org>
17261 * src/bison.s1: Add a Bison version comment.
17263 * src/main.c (fatal, warn, berror):
17266 1997-06-28 Richard Stallman <rms@gnu.org>
17268 * Makefile.in (bison_version): New variable.
17269 (dist): Use that variable.
17270 (bison.s1): Substitute the Bison version into bison.simple.
17272 * bison.simple: Add a Bison version comment.
17274 1997-06-18 Richard Stallman <rms@gnu.org>
17276 * src/main.c (fatal, warn, berror):
17277 Make error messages standard.
17278 (toomany): Improve error message text.
17280 * src/LR0.c, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/lalr.c, src/lex.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/symtab.c:
17281 new.h renamed to alloc.h.
17283 1997-06-18 Richard Stallman <rms@gnu.org>
17285 * Makefile.in: new.h renamed to alloc.h.
17287 1997-05-24 Richard Stallman <rms@gnu.org>
17289 * src/lex.c (literalchar):
17290 Fix the code for escaping \, " and '.
17292 (lex): Avoid trouble when there are many chars
17293 to discard in a char literal with just several chars in it.
17295 1997-05-17 Richard Stallman <rms@gnu.org>
17298 Use malloc, if using alloca is troublesome.
17299 (YYSTACK_USE_ALLOCA): New flag macro.
17300 Define it for some systems and compilers.
17301 (YYSTACK_ALLOC): New macro.
17302 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17303 If it was malloc'd, free it.
17305 1997-05-17 Richard Stallman <rms@gnu.org>
17308 Use malloc, if using alloca is troublesome.
17309 (YYSTACK_USE_ALLOCA): New flag macro.
17310 Define it for some systems and compilers.
17311 (YYSTACK_ALLOC): New macro.
17312 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17313 If it was malloc'd, free it.
17315 1997-04-23 Richard Stallman <rms@gnu.org>
17318 (alloca) [__hpux]: Always define as __builtin_alloca.
17320 1997-04-23 Richard Stallman <rms@gnu.org>
17323 (alloca) [__hpux]: Always define as __builtin_alloca.
17325 1997-04-22 Richard Stallman <rms@gnu.org>
17328 [__hpux]: Include alloca.h (right for HPUX 10)
17329 instead of declaring alloca (right for HPUX 9).
17331 * src/bison.s1 (__yy_memcpy):
17332 Declare arg `count' as unsigned int.
17333 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17335 1997-04-22 Richard Stallman <rms@gnu.org>
17338 [__hpux]: Include alloca.h (right for HPUX 10)
17339 instead of declaring alloca (right for HPUX 9).
17341 * bison.simple (__yy_memcpy):
17342 Declare arg `count' as unsigned int.
17343 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17345 1997-01-03 Richard Stallman <rms@gnu.org>
17347 * src/allocate.c: [__STDC__ or _MSC_VER]:
17348 Declare calloc and realloc to return void *.
17350 1997-01-02 Richard Stallman <rms@gnu.org>
17353 [_MSC_VER]: Include stdlib.h and process.h.
17354 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17356 * src/main.c (main): Return FAILURE as a value.
17357 (printable_version): Declare arg as int, not char.
17359 1997-01-02 Richard Stallman <rms@gnu.org>
17361 * Makefile.in (dist):
17362 Explicitly check for symlinks, and copy them.
17364 1996-12-19 Richard Stallman <rms@gnu.org>
17367 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17369 1996-12-18 Paul Eggert <eggert@gnu.org>
17371 * src/bison.s1 (yyparse):
17372 If __GNUC__ and YYPARSE_PARAM are both defined,
17373 declare yyparse to have a void * argument.
17375 1996-12-18 Paul Eggert <eggert@gnu.org>
17377 * bison.simple (yyparse):
17378 If __GNUC__ and YYPARSE_PARAM are both defined,
17379 declare yyparse to have a void * argument.
17381 1996-12-17 Richard Stallman <rms@gnu.org>
17383 * src/reduce.c (nbits): Add some casts.
17385 1996-08-12 Richard Stallman <rms@gnu.org>
17387 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17389 1996-08-12 Richard Stallman <rms@gnu.org>
17391 * bison.simple: Test _MSDOS as well as _MSDOS_.
17393 1996-07-31 Richard Stallman <rms@gnu.org>
17396 [__sun && __i386]: Include alloca.h.
17398 1996-07-31 Richard Stallman <rms@gnu.org>
17401 [__sun && __i386]: Include alloca.h.
17403 1996-07-30 Richard Stallman <rms@gnu.org>
17405 * src/bison.s1: Comment change.
17407 * src/bison.s1: Test _MSDOS_, not MSDOS.
17409 1996-07-30 Richard Stallman <rms@gnu.org>
17411 * bison.simple: Comment change.
17413 * bison.simple: Test _MSDOS_, not MSDOS.
17415 1996-06-01 Richard Stallman <rms@gnu.org>
17417 * src/reduce.c, src/reader.c, src/print.c, src/output.c, src/nullable.c, src/lex.c, src/lalr.c, src/getargs.c, src/derives.c, src/conflicts.c, src/closure.c, src/allocate.c:
17418 Insert `_' macro around many string constants.
17421 Insert `_' macro around many string constants.
17423 (main): Call setlocale, bindtextdomain and textdomain.
17425 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17426 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17427 [ENABLE_NLS]: Include libintl.h.
17428 [ENABLE_NLS] (gettext): Define.
17429 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17430 (N_, PACKAGE, LOCALEDIR): New macros.
17432 1996-06-01 Richard Stallman <rms@gnu.org>
17434 * POTFILES.in: New file.
17436 * Makefile.in (allocate.o):
17437 Define target explicitly.
17439 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17440 (LDFLAGS): Set to @LDFLAGS@.
17441 (configure): Run autoconf only if preceding `cd' succeeds.
17442 (bison.s1): Redirect output to temporary file then move the
17443 temporary to the target, rather than redirecting directly to bison.s1.
17444 (clean): Remove config.status and config.log.
17445 (distclean): Don't remove config.status here.
17447 1996-05-12 Richard Stallman <rms@gnu.org>
17450 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17452 1996-05-12 Richard Stallman <rms@gnu.org>
17455 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17457 1996-05-11 Richard Stallman <rms@gnu.org>
17459 * src/bison.s1 (__yy_memcpy):
17460 Really reorder the args, as was supposedly done on Feb 14 1995.
17461 (yyparse): Calls changed accordingly.
17463 1996-05-11 Richard Stallman <rms@gnu.org>
17465 * Makefile.in (dist): Don't use $(srcdir).
17467 * bison.simple (__yy_memcpy):
17468 Really reorder the args, as was supposedly done on Feb 14 1995.
17469 (yyparse): Calls changed accordingly.
17471 1996-01-27 Richard Stallman <rms@gnu.org>
17473 * src/output.c (output_rule_data):
17474 Test YYERROR_VERBOSE in the conditional
17475 around the definition of ttyname.
17477 1995-12-29 Richard Stallman <rms@gnu.org>
17480 Fix line numbers in #line commands.
17482 1995-12-29 Richard Stallman <rms@gnu.org>
17485 Fix line numbers in #line commands.
17487 1995-12-27 Richard Stallman <rms@gnu.org>
17489 * src/bison.s1 (YYPARSE_PARAM_DECL):
17490 In C++, make it always null.
17491 (YYPARSE_PARAM_ARG): New macro.
17492 (yyparse): Use YYPARSE_PARAM_ARG.
17494 1995-12-27 Richard Stallman <rms@gnu.org>
17496 * bison.simple (YYPARSE_PARAM_DECL):
17497 In C++, make it always null.
17498 (YYPARSE_PARAM_ARG): New macro.
17499 (yyparse): Use YYPARSE_PARAM_ARG.
17501 1995-11-29 Richard Stallman <rms@gnu.org>
17503 * doc/bison.texinfo:
17504 Describe literal string tokens, %raw, %no_lines, %token_table.
17506 1995-11-29 Daniel Hagerty <hag@gnu.org>
17508 * doc/bison.texinfo: Fixed update date
17510 1995-10-16 Richard Stallman <rms@gnu.org>
17512 * src/version.c: Version 1.25.
17514 1995-10-16 Richard Stallman <rms@gnu.org>
17516 * NEWS: *** empty log message ***
17518 1995-10-16 Richard Stallman <rms@gnu.org>
17520 * doc/bison.1, doc/bison.rnh:
17523 1995-10-15 Richard Stallman <rms@gnu.org>
17525 * src/vmsgetargs.c, src/getargs.c:
17526 Added -n, -k, and -raw switches.
17527 (noparserflag, toknumflag, rawtoknumflag): New variables.
17529 * src/symtab.h (SALIAS):
17530 New #define for adding aliases to %token.
17531 (struct bucket): Added `alias' field.
17533 * src/reduce.c (reduce_grammar):
17534 Revise error message.
17535 (print_notices): Remove final `.' from error message.
17537 * src/reader.c (reader_output_yylsp):
17539 (readgram): Use `#if 0' around code that accepted %command
17540 inside grammar rules: The documentation doesn't allow it,
17541 and it will fail since the %command processors scan for the next %.
17542 (parse_token_decl): Extended the %token
17543 declaration to allow a multi-character symbol as an alias.
17544 (parse_thong_decl): New function.
17545 (read_declarations): Added %thong declarations.
17546 (read_declarations): Handle NOOP to deal with allowing
17547 % declarations as another means to specify the flags.
17548 (readgram): Allow %prec prior to semantics embedded in a rule.
17549 (skip_to_char, read_declarations, copy_definition)
17550 (parse_token_decl, parse_start_decl, parse_type_decl)
17551 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17552 (get_type_name, copy_guard, copy_action, readgram)
17553 (get_type, packsymbols): Revised most error messages.
17554 Changed `fatal' to `warnxxx' to avoid aborting for error.
17555 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17556 (read_declarations): Improve the error message for
17557 an invalid character. Do not abort.
17558 (read_declarations, copy_guard, copy_action): Use
17559 printable_version to avoid unprintable characters in printed output.
17560 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
17561 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
17562 Allow the type of a non-terminal can be given
17563 more than once, as long as all specifications give the same type.
17566 (output_headers, output_trailers, output, output_gram)
17567 (output_rule_data): Implement noparserflag variable.
17568 Implement toknumflag variable.
17569 (output): Call reader_output_yylsp to output LTYPESTR.
17571 * src/main.c (main):
17572 If reader sees an error, don't process the grammar.
17573 (fatals): Updated to not use VARARGS1.
17574 (printable_version, int_to_string, warn, warni, warns, warnss)
17575 (warnsss): New error reporting functions. Avoid abort for error.
17578 Added THONG and NOOP for alias processing.
17579 Added SETOPT for the new code that allows setting options with %flags.
17582 Include getopt.h. Add some extern decls.
17583 (safegetc): New function to deal with EOF gracefully.
17584 (literalchar); new function to deal with reading \ escapes.
17585 (lex): Use literalchar.
17586 (lex): Implemented "..." tokens.
17587 (literalchar, lex, parse_percent_token): Made tokenbuffer
17588 always contain the token. This includes growing the token
17589 buffer while reading an integer.
17590 (parse_percent_token): Replaced if-else statement with percent_table.
17591 (parse_percent_token): Added % declarations as another
17592 way to specify the flags -n, -l, and -r. Also added hooks for
17593 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
17594 major changes to files.c.
17595 (lex) Retain in the incoming stream a character following
17597 (skip_white_space, lex): Revised most error messages
17598 and changed fatal to warn to avoid aborting.
17599 (percent_table): Added %thong declarations.
17601 * src/gram.h: Comment changes.
17603 * src/files.c (openfiles, open_extra_files, done):
17605 and actfile file. Handle noparserflag. Both for -n switch.
17607 * src/conflicts.c (resolve_sr_conflict):
17608 Remove use of alloca.
17610 1995-06-01 Jim Meyering <meyering@gnu.org>
17612 * doc/bison.texinfo: *** empty log message ***
17614 1995-05-06 Richard Stallman <rms@gnu.org>
17616 * src/bison.s1: Comment change.
17618 1995-05-06 Richard Stallman <rms@gnu.org>
17620 * bison.simple: Comment change.
17622 1995-05-03 Richard Stallman <rms@gnu.org>
17624 * src/version.c: Version now 1.24.
17626 * src/bison.s1: Change distribution terms.
17628 * src/version.c: Version now 1.23.
17630 1995-05-03 Richard Stallman <rms@gnu.org>
17632 * doc/bison.texinfo:
17633 Rewrite "Conditions for Using Bison".
17634 Update version to 1.24.
17636 1995-05-03 Richard Stallman <rms@gnu.org>
17638 * bison.simple: Change distribution terms.
17640 1995-02-23 Richard Stallman <rms@gnu.org>
17642 * src/files.c: Test __VMS_POSIX as well as VMS.
17644 1995-02-14 Jim Meyering <meyering@gnu.org>
17646 * src/bison.s1 (__yy_memcpy):
17647 Renamed from __yy_bcopy to avoid
17648 confusion. Reverse FROM and TO arguments to be consistent with
17651 1995-02-14 Jim Meyering <meyering@gnu.org>
17653 * bison.simple (__yy_memcpy):
17654 Renamed from __yy_bcopy to avoid
17655 confusion. Reverse FROM and TO arguments to be consistent with
17658 1994-11-10 David J. MacKenzie <djm@gnu.org>
17664 * Makefile.in (DISTFILES): Include NEWS.
17666 * Makefile.in (DISTFILES):
17667 Include install-sh, not install.sh.
17669 * configure.in: Update to Autoconf v2 macro names.
17671 1994-10-05 David J. MacKenzie <djm@gnu.org>
17673 * Makefile.in: fix typo
17675 * Makefile.in (prefix, exec_prefix):
17676 Let configure set them.
17678 1994-09-28 David J. MacKenzie <djm@gnu.org>
17680 * Makefile.in: Set datadir to $(prefix)/share.
17682 1994-09-15 Richard Stallman <rms@gnu.org>
17685 Update copyright notice and GPL version.
17687 1994-09-15 Richard Stallman <rms@gnu.org>
17690 Update copyright notice and GPL version.
17692 1994-07-12 Richard Stallman <rms@gnu.org>
17694 * src/reduce.c, src/reader.c:
17697 1994-05-05 David J. MacKenzie <djm@gnu.org>
17699 * Makefile.in: entered into RCS
17701 1994-03-26 Richard Stallman <rms@gnu.org>
17703 * src/bison.s1: entered into RCS
17705 1994-03-26 Richard Stallman <rms@gnu.org>
17707 * bison.simple: entered into RCS
17709 1994-03-25 Richard Stallman <rms@gnu.org>
17711 * src/main.c: entered into RCS
17713 1994-03-24 Richard Stallman <rms@gnu.org>
17715 * src/conflicts.c: entered into RCS
17717 1994-01-02 Richard Stallman <rms@gnu.org>
17719 * Makefile.in: *** empty log message ***
17721 1993-11-21 Richard Stallman <rms@gnu.org>
17723 * src/bison.s1: *** empty log message ***
17725 1993-11-21 Richard Stallman <rms@gnu.org>
17727 * doc/bison.texinfo: entered into RCS
17729 * doc/bison.texinfo: *** empty log message ***
17731 1993-11-21 Richard Stallman <rms@gnu.org>
17733 * bison.simple: *** empty log message ***
17735 1993-10-25 David J. MacKenzie <djm@gnu.org>
17737 * doc/bison.texinfo: *** empty log message ***
17739 1993-10-19 Richard Stallman <rms@gnu.org>
17741 * src/bison.s1: *** empty log message ***
17743 1993-10-19 Richard Stallman <rms@gnu.org>
17745 * bison.simple: *** empty log message ***
17747 1993-10-14 Richard Stallman <rms@gnu.org>
17749 * src/bison.s1: *** empty log message ***
17751 1993-10-14 Richard Stallman <rms@gnu.org>
17753 * bison.simple: *** empty log message ***
17755 1993-09-14 David J. MacKenzie <djm@gnu.org>
17757 * doc/bison.texinfo: *** empty log message ***
17759 1993-09-13 Noah Friedman <friedman@gnu.org>
17761 * Makefile.in: *** empty log message ***
17763 1993-09-10 Richard Stallman <rms@gnu.org>
17765 * src/conflicts.c: *** empty log message ***
17767 * src/system.h: entered into RCS
17769 1993-09-10 Richard Stallman <rms@gnu.org>
17771 * doc/bison.1: entered into RCS
17773 1993-09-06 Noah Friedman <friedman@gnu.org>
17775 * src/version.c: entered into RCS
17777 1993-09-06 Noah Friedman <friedman@gnu.org>
17779 * Makefile.in: *** empty log message ***
17781 1993-07-30 David J. MacKenzie <djm@gnu.org>
17783 * Makefile.in: *** empty log message ***
17785 1993-07-24 Richard Stallman <rms@gnu.org>
17787 * src/bison.s1: *** empty log message ***
17789 1993-07-24 Richard Stallman <rms@gnu.org>
17791 * bison.simple: *** empty log message ***
17793 1993-07-08 David J. MacKenzie <djm@gnu.org>
17795 * Makefile.in: *** empty log message ***
17797 1993-07-04 Richard Stallman <rms@gnu.org>
17799 * src/bison.s1: *** empty log message ***
17801 1993-07-04 Richard Stallman <rms@gnu.org>
17803 * bison.simple: *** empty log message ***
17805 1993-06-26 David J. MacKenzie <djm@gnu.org>
17807 * src/getargs.c: entered into RCS
17809 1993-06-26 David J. MacKenzie <djm@gnu.org>
17811 * doc/bison.texinfo: *** empty log message ***
17813 * doc/bison.1: New file.
17815 1993-06-25 Richard Stallman <rms@gnu.org>
17817 * src/getargs.c: New file.
17819 1993-06-16 Richard Stallman <rms@gnu.org>
17821 * src/bison.s1: *** empty log message ***
17823 1993-06-16 Richard Stallman <rms@gnu.org>
17825 * bison.simple: *** empty log message ***
17827 1993-06-03 Richard Stallman <rms@gnu.org>
17829 * src/bison.s1: New file.
17831 1993-06-03 Richard Stallman <rms@gnu.org>
17833 * doc/bison.texinfo: *** empty log message ***
17835 1993-06-03 Richard Stallman <rms@gnu.org>
17837 * bison.simple: New file.
17839 1993-05-19 Richard Stallman <rms@gnu.org>
17841 * doc/bison.texinfo: New file.
17843 1993-05-07 Noah Friedman <friedman@gnu.org>
17845 * Makefile.in: *** empty log message ***
17847 1993-04-28 Noah Friedman <friedman@gnu.org>
17849 * src/reader.c: *** empty log message ***
17851 1993-04-23 Noah Friedman <friedman@gnu.org>
17853 * src/alloc.h: entered into RCS
17855 1993-04-20 David J. MacKenzie <djm@gnu.org>
17857 * src/version.c: *** empty log message ***
17859 * src/files.c, src/allocate.c:
17862 * src/reader.c: *** empty log message ***
17864 * src/lex.c: entered into RCS
17866 * src/conflicts.c: New file.
17868 * src/symtab.c: entered into RCS
17870 * src/alloc.h: New file.
17872 * src/LR0.c: entered into RCS
17874 1993-04-18 Noah Friedman <friedman@gnu.org>
17876 * src/reader.c: New file.
17878 * src/version.c: *** empty log message ***
17880 1993-04-18 Noah Friedman <friedman@gnu.org>
17882 * Makefile.in: *** empty log message ***
17884 1993-04-17 Noah Friedman <friedman@gnu.org>
17886 * Makefile.in: *** empty log message ***
17888 1993-04-15 Richard Stallman <rms@gnu.org>
17890 * src/main.c, src/files.c:
17893 1993-04-15 Noah Friedman <friedman@gnu.org>
17895 * configure.in: entered into RCS
17897 * configure.in: *** empty log message ***
17899 * configure.in: New file.
17901 1993-04-14 Richard Stallman <rms@gnu.org>
17903 * Makefile.in: New file.
17905 1993-04-13 Richard Stallman <rms@gnu.org>
17907 * src/version.c: New file.
17909 1993-03-25 Richard Stallman <rms@gnu.org>
17911 * src/output.c: entered into RCS
17913 1992-09-25 Richard Stallman <rms@gnu.org>
17915 * configure.bat: entered into RCS
17917 1992-06-22 Richard Stallman <rms@gnu.org>
17919 * src/vmsgetargs.c: entered into RCS
17921 1992-06-22 Richard Stallman <rms@gnu.org>
17923 * doc/bison.rnh: entered into RCS
17925 1992-04-20 David J. MacKenzie <djm@gnu.org>
17927 * README: entered into RCS
17929 1992-01-22 Richard Stallman <rms@gnu.org>
17931 * src/machine.h: entered into RCS
17933 1991-12-21 Richard Stallman <rms@gnu.org>
17935 * src/lalr.c, src/closure.c:
17938 1991-12-20 Richard Stallman <rms@gnu.org>
17940 * src/state.h: entered into RCS
17942 1991-12-18 Richard Stallman <rms@gnu.org>
17944 * src/print.c, src/nullable.c, src/derives.c:
17947 1991-11-03 David J. MacKenzie <djm@gnu.org>
17949 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17952 1988-09-09 Richard Stallman <rms@gnu.org>
17954 * src/bison.hairy: entered into RCS
17956 1987-12-16 Richard Stallman <rms@gnu.org>
17958 * REFERENCES: entered into RCS
17963 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
17964 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17965 Software Foundation, Inc.
17967 Copying and distribution of this file, with or without
17968 modification, are permitted provided the copyright notice and this
17969 notice are preserved.