1 2006-12-13 Bob Rossi <bob@brasko.net>
3 * data/push.c (yypstate_init): Rename to...
4 (yypstate_new): ... this and use b4_c_function_def.
5 (yypstate_delete): New.
6 (yypush_parse): Change parameters yynval and yynlloc to be const.
7 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
8 yypstate_delete functions.
10 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
12 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
13 strange test case titles. Reported by Bob Rossi.
15 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
17 * TODO: Add pointer to Sylvain Schmitz's work on static detection
18 of potential ambiguities in GLR grammers.
20 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
22 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
23 `bison ', use m4_index instead of m4_substr since chopping up a string
24 containing M4-special characters causes problems here.
26 Fix a couple of bugs related to special characters in user-specified
27 file names, and make it easier for skeletons to compute output file
28 names with the same file name prefix as Bison-computed output file
30 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
31 b4_parser_file_name and b4_spec_defines_file instead of
32 @output_parser_name@ and @output_header_name@, which are now redundant.
33 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
34 b4_parser_file_name, b4_spec_defines_file, and the new
35 @basename(FILENAME@) instead of @output_parser_name@ and
36 @output_header_name@, which inappropriately escaped the file names as
38 * src/files.c (all_but_ext): Remove static qualifier.
39 (compute_output_file_names): Move `free (all_but_ext)' to...
40 (output_file_names_free): ... here since all_but_ext is needed later.
41 * src/files.h (all_but_ext): Extern.
42 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
43 exactly what MUSCLE_INSERT_STRING used to do.
44 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
45 characters are escaped properly.
46 * src/output.c (prepare): Define muscle file_name_all_but_ext as
48 For pkgdatadir muscle, maintain previous functionality by using
49 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
50 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
51 digraphs would never be expanded. Hopefully no one has M4-special
52 characters in his Bison installation path.
53 * src/scan-skel.l: Don't parse @output_header_name@ and
54 @output_parser_name@ anymore since they're now redundant.
55 In @output, use decode_at_digraphs.
56 Parse a new @basename command that invokes last_component.
57 (decode_at_digraphs): New.
58 (BASE_QPUTS): Remove unused.
59 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
60 (Output file name): New tests.
62 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
64 Warn about output files that are generated by the skeletons and that
65 conflict with other output files.
66 * data/glr.c: Don't generate the header file here when glr.cc does.
67 * src/files.c (file_names, file_names_count): New static globals.
68 (compute_output_file_names): Invoke output_file_name_check for files
69 not generated by the skeletons and remove existing checks.
70 (output_file_name_check): New function that warns about conflicting
72 (output_file_names_free): Free file_names.
73 * src/files.h (output_file_name_check): Declare.
74 * src/scan-skel.l: Invoke output_file_name_check for files generated by
76 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
77 (Conflicting output files): New tests.
79 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
81 * doc/bison.texinfo: Fix a couple of typos.
83 2006-12-08 Bob Rossi <bob@brasko.net>
85 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
87 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
89 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
90 (yypush_parse): Rename yypvars argument to yyps and remove redundant
92 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
93 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
95 2006-12-07 Bob Rossi <bob@brasko.net>
96 and Joel Denny <jdenny@ces.clemson.edu>
98 * data/push.c (yypvarsinit): Change return type from void* to struct
99 yypvars*. No longer cast to void* on return.
100 (struct yypvars): Remove yylen since it need not be remembered between
101 yypushparse invocations.
102 (yypushparse): Don't copy between yylen and pv->yylen.
104 2006-12-05 Bob Rossi <bob@brasko.net>
106 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
107 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
108 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
109 (struct yypvars): Remove b4_declare_parser_variables.
110 (yypvarsinit): Remove init code for removed variables.
111 (global scope): Do not declare b4_declare_parser_variables if
113 (yypushparse): Add b4_declare_parser_variables.
114 Init new local variables, and remove init code for removed
117 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
118 and yyparse for other modes.
119 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
120 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
121 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
122 (AT_PURE_LEX_IF): True if pure or push parser.
124 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
126 Document Yacc prologue alternatives and default %destructor's and
127 %printer's as experimental. Don't mention Java yet. Discussed at
128 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
129 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
130 (2.3a): Annotate this entry to say the old forms of these features were
132 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
133 Bison Symbols): Say they're experimental. Comment out any mention
134 of Java (we'll want this back eventually).
136 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
138 Support a file name argument to %defines. Deprecate `=' in
139 %file-prefix, %name-prefix, and %output. Discussed at
140 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
141 * NEWS (2.3a+): Mention.
142 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
143 form of %defines, and remove `=' from entries for %file-prefix,
144 %name-prefix, and %output.
145 * src/parse-gram.y (prologue_declaration): Implement.
146 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
147 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
148 all but one occurrence of %name-prefix.
149 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
150 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
151 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
152 occurrence of each of %file-prefix and %output. Add check for %defines
154 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
155 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
156 Remove the `=' from %output.
158 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
160 Don't escape $ in test case titles since Autoconf 2.61 now does that
162 * tests/actions.at (Default %printer and %destructor are not for error
163 or $undefined): Here.
164 (Default %printer and %destructor are not for $accept): Here.
165 * tests/input.at (Invalid $n and @n): Here.
167 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
169 Rename <!> to <>. Discussed starting at
170 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
171 * NEWS (2.3a+): Update.
172 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
174 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
175 * src/scan-gram.l (INITIAL): Implement.
176 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
177 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
179 * tests/actions.at (Default tagless %printer and %destructor,
180 Default tagged and per-type %printer and %destructor,
181 Default %printer and %destructor are not for error or $undefined,
182 Default %printer and %destructor are not for $accept,
183 Default %printer and %destructor for mid-rule values): Update.
184 * tests/input.at (Default %printer and %destructor redeclared,
185 Unused values with default %destructor): Update.
187 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
189 Don't let %prec take a nonterminal.
190 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
192 * tests/input.at (%prec takes a token): New test checking that %prec
193 won't take a nonterminal.
195 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
197 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
198 it was double-quoted.
199 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
200 grammar is maintained with Bison's highest standards.
201 * src/getargs.c: Fix some typos in Doxygen comments.
203 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
205 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
206 later. Reported by Paul Eggert in
207 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
208 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
209 * src/scan-code.l (translate_action): Don't bother invoking
210 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
211 (code_scanner_free): Instead of invoking
212 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
214 * src/scan-gram.l (gram_scanner_free): Likewise.
215 * src/scan-skel.l (scan_skel): Likewise.
217 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
219 * src/files.c (tr): Change return type to void.
220 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
221 has been called previously for the same key.
222 (muscle_find): Return storage instead of value so that
223 --enable-gcc-warnings doesn't produce warnings that the return discards
224 const. aver that the value and storage are the same since storage
225 could potentially be NULL when value is not.
226 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
229 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
231 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
232 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
233 us a slightly cleaner distribution, and also works.
234 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
237 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
238 and Paul Eggert <eggert@cs.ucla.edu>
240 Don't let Bison leak memory except when it complains.
241 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
242 (spec_defines_file, dir_prefix): Now char *, not const char *,
243 since they are freed.
244 * src/files.c: Likewise.
245 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
247 (tr): Now operates in-place. All uses changed.
248 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
250 (compute_file_name_parts, compute_output_file_names): Don't store
251 read-only data in variables that will be freed.
252 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
253 src_extension, and header_extension.
254 (output_file_names_free): New public function to free
255 spec_verbose_file, spec_graph_file, spec_defines_file,
256 parser_file_name, and dir_prefix.
257 * src/getargs.c (getargs): Don't store read-only data in variables that
259 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
260 (which previously existed but was unused), and quotearg_free.
261 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
262 * src/muscle_tab.c: Likewise.
263 (muscle_entry): Make the value char const *,
264 and add a new storage member that is char * and can be freed.
265 (muscle_entry_free): New private function.
266 (muscle_init): Use it instead of free.
267 (muscle_insert, muscle_grow): Update and use new storage member.
268 (muscle_code_grow): Free the string passed to muscle_grow
269 since it's not needed anymore.
270 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
271 add a new `char *code' member.
272 ("{...}"): Declare semantic type as code.
273 * src/scan-code.h (translate_rule_action):
274 (translate_symbol_action, translate_code, translate_action): Return
275 `char const *' rather than `char *' since external code should not free
277 * src/scan-code.l: Likewise.
278 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
279 which is "{...}" in the parser.
280 * tests/Makefile.am (maintainer-check-valgrind): Set
281 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
283 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
285 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
286 expecting a non-zero exit status sets --leak-check=summary and
287 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
288 this case, and we don't want to hear about it.
290 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
292 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
293 instead of from the template, to simplify configuration a bit.
294 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
295 and m4/wint_t.m4, as they are needed with the latest gnulib.
297 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
299 Disable unset/unused mid-rule value warnings by default, and recognize
300 --warnings=midrule-values to enable them. Discussed starting at
301 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
302 * NEWS (2.3a+): Mention.
303 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
304 warnings): Add entry for midrule-values subargument.
305 * src/reader.c (symbol_should_be_used): Don't return true just because
306 the value is a set/used mid-rule value unless
307 --warnings=midrule-values was specified.
308 * tests/input.at (Unused values, Unused values before symbol
309 declarations): Run tests with and without --warnings=midrule-values.
311 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
312 than LIST_FREE directly.
314 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
316 Finish implementing --warnings=error, which should not be implied by
317 --warnings=all (or by its synonyms -W and --warnings without
319 * src/complain.c (set_warning_issued): New function to report that
320 warnings are being treated as errors and to record an error if so.
322 (warn_at, warn): ... here.
323 * src/getargs.c (warnings_args, warnings_types): Reorder so that
324 "error - warnings are errors" does not appear above "all - all of the
326 (getargs): For -W and --warnings without subarguments, don't let
327 FLAGS_ARGMATCH set warnings_error in warnings_flag.
328 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
330 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
332 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
333 empty subargument list. For example: `bison --warnings= parser.y'.
335 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
337 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
338 the parser header file so that gcc doesn't warn.
340 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
342 Split the default %destructor/%printer into two kinds: <*> and <!>.
343 Discussed starting at
344 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
345 * NEWS (2.3a+): Mention.
346 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
347 previous change today related to mid-rules.
348 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
349 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
350 (TYPE_TAG_ANY): Add as <*>.
351 (TYPE_TAG_NONE): Add as <!>.
352 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
354 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
355 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
356 * src/symlist.c (symbol_list_default_new): Split into tagged and
358 (symbol_list_destructor_set, symbol_list_printer_set): Split
359 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
360 SYMLIST_DEFAULT_TAGLESS.
361 * src/symlist.h: Update symbol_list_default*_new prototypes.
362 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
363 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
364 * src/symtab.c (default_destructor, default_destructor_location,
365 default_printer, default_printer_location): Split each into tagged and
367 (symbol_destructor_get, symbol_destructor_location_get,
368 symbol_printer_get, symbol_printer_location_get): Implement tagged
369 default and tagless default cases.
370 (default_destructor_set, default_printer_set): Split each into tagged
371 and tagless versions.
372 * src/symtab.h: Update prototypes.
373 * tests/actions.at (Default %printer and %destructor): Rename to...
374 (Default tagless %printer and %destructor): ... this, and extend.
375 (Per-type %printer and %destructor): Rename to...
376 (Default tagged and per-type %printer and %destructor): ... this, and
378 (Default %printer and %destructor for user-defined end token): Extend.
379 (Default %printer and %destructor are not for error or $undefined):
381 (Default %printer and %destructor are not for $accept): Update.
382 (Default %printer and %destructor for mid-rule values): Extend.
383 * tests/input.at (Default %printer and %destructor redeclared): Extend.
384 (Unused values with default %destructor): Extend.
386 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
388 Don't apply the default %destructor/%printer to an unreferenced midrule
390 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
391 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
392 like $@n instead of just @n so that the default %destructor/%printer
393 logic doesn't see them as user-defined symbols.
394 (symbol_is_dummy): Check for both forms of the name.
395 * src/reader.c (packgram): Remove the `$' from each midrule symbol
396 name for which the midrule value is referenced in any action.
397 * tests/actions.at (Default %printer and %destructor for mid-rule
399 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
400 for change to dummy symbol names.
402 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
404 Warn about unset midrule $$ if the corresponding $n is used.
405 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
407 (packgram): Before invoking grammar_rule_check on any rule, make sure
408 all actions have already been scanned in order to set `used' flags.
409 Otherwise, checking that a midrule's $$ is set will not always work
410 properly because the midrule check must forward-reference the midrule's
412 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
415 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
417 More improvements to the documentation of the prologue alternatives:
418 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
420 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
421 some text to clarify the relative importance of the new directives and
422 to show how these directives may be viewed as code labels.
424 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
426 Similar to the recently removed %before-header, add %code-top as the
427 alternative to the pre-prologue. Mentioned at
428 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
429 Also, let the prologue alternatives appear in the grammar section.
430 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
431 (prologue_declaration): Move the existing prologue alternatives to...
432 (grammar_declaration): ... here and add %code-top.
433 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
435 Clean up and extend documentation for the prologue alternatives.
436 * NEWS (2.3a+): Describe prologue alternatives.
437 * doc/bison.texinfo (Prologue): Move discussion of prologue
439 (Prologue Alternatives): ... this new section, and extend it to discuss
440 all 4 directives in detail.
441 (Bison Symbols): Clean up discussion of prologue alternatives and add
444 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
446 DJGPP specific issues.
448 * djgpp/config.bat: config.hin has been moved to lib. Adjust
449 config.bat accordingly.
450 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
451 * djgpp/config.site: Likewise.
453 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
455 Replace %*-header with %provides, %requires, %code. See discussion at
456 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
458 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
459 (b4_user_start_header): Remove.
460 * data/glr.c: Use new macros instead of b4_*start_header
462 * data/glr.cc: Likewise.
463 * data/lalr1.cc: Likewise.
464 * data/push.c: Likewise.
465 * data/yacc.c: Likewise.
467 * doc/bison.texinfo: Remove %before-header, rename
468 %{start,end,after}-header to %requires, %provides, %code.
470 * src/parse-gram.y: Likewise (also rename token names accordingly).
471 * src/scan-gram.l: Likewise.
472 * tests/actions.at: Likewise.
474 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
476 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
477 Problem reported by Joel E. Denny.
479 2006-10-14 Jim Meyering <jim@meyering.net>
481 (Sync from coreutils.)
482 Work also when the working directory (with e.g. coreutils sources)
483 is version controlled with git, rather than CVS.
484 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
486 In messages and comments, say e.g., "checked-out sources",
487 rather than "CVS sources".
488 (version_controlled_file): New function. Work for git as well as
489 for CVS. Don't use grep's -q option.
490 (slurp): Call it here, in place of CVS-specific code.
492 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
494 Fix testsuite for ./configure --enable-gcc-warnings:
495 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
496 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
497 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
498 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
499 * test/regression.at (Diagnostic that expects two alternatives):
502 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
504 * bootstrap.conf (gnulib_modules): Add config-h.
505 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
506 worry about HAVE_CONFIG_H.
507 * lib/abitset.c: Likewise.
508 * lib/bitset.c: Likewise.
509 * lib/bitset_stats.c: Likewise.
510 * lib/bitsetv-print.c: Likewise.
511 * lib/bitsetv.c: Likewise.
512 * lib/ebitset.c: Likewise.
513 * lib/get-errno.c: Likewise.
514 * lib/lbitset.c: Likewise.
515 * lib/subpipe.c: Likewise.
516 * lib/timevar.c: Likewise.
517 * lib/vbitset.c: Likewise.
518 * lib/bitset.c: Include "bitset.h" first, to test interface.
519 * lib/bitset_stats.c: Include "bitset_stats.h" first.
520 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
521 * lib/bitsetv.c: Include "bitsetv.h" first.
522 * lib/get-errno.c: Include "get-errno.h" first.
523 * m4/.cvsignore: Add config-h.m4.
524 * tests/actions.at (Default %printer and %destructor for ...):
525 Adjust expected line numbers in output to reflect removal of #if
527 * tests/glr-regression.at (Missed %merge type warnings when ...):
529 * tests/regression.at (Braced code in declaration in rules section):
531 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
532 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
533 Include <config.h> unconditionally.
535 * bootstrap: Sync from coreutils, as follows:
537 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
539 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
540 variable was sometimes used without being initialized. This
541 messed up the installation of the INSTALL file in some cases.
543 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
545 * bootstrap (usage, main program, symlink_to_gnulib): Add option
546 --copy. Inspired by a suggestion from Bruno Haible.
548 2006-10-03 Jim Meyering <jim@meyering.net>
550 * bootstrap: Undo last change to this file, since now gnulib-tool
551 sticks with the automake default in generating dependencies.
553 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
555 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
556 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
558 * doc/bison.1: Add copyright notice.
560 * data/glr.c: Don't include <stdarg.h>; not used.
562 * NEWS: The -g and --graph options now output graphs in Graphviz
563 DOT format, not VCG format.
564 * doc/bison.1: Likewise.
565 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
566 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
568 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
569 * TODO: Remove Graphviz entry.
570 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
571 remove vcg.c, vcg.h, vcg_defaults.h.
572 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
573 * src/graphviz.c, src/graphviz.h: New files.
574 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
575 * src/files.h: Make comment more generic.
576 * src/main.c (main): Likewise.
577 * src/print_graph.h: Likewise.
578 * src/getargs.c (usage): Make usage description more generic.
579 * src/print_graph.c: Include graphviz.h rather than vcg.h.
580 (static_graph, fgraph): Remove. All uses changed to pass
581 arguments instead of sharing a static var.
582 (print_core, print_actions, print_state, print_graph):
583 Output graphviz format rather than VCG format.
584 * tests/.cvsignore: Remove *.vcg; add *.dot.
585 * tests/output.at: Expect *.dot files, not *.vcg files.
587 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
588 accommodates the 2006-10-08 change.
590 2006-10-11 Bob Rossi <bob@brasko.net>
592 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
593 (b4_yyssa, b4_yyerror_range): New macros.
594 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
595 (yypvarsinit): Remove init of removed fields.
596 (yypushparse): Remove use of removed fields; use new macros instead.
598 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
600 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
601 in a push parser. Reindent slightly to match yacc.c better.
603 2006-10-11 Bob Rossi <bob@brasko.net>
605 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
607 (yypvarsinit, yypushparse): Remove init of removed fields.
608 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
610 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
612 * THANKS: Add Paolo Bonzini and Bob Rossi.
614 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
616 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
617 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
618 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
619 b4_define_user_cde and uses): Remove.
620 (b4_comment, b4_prefix, b4_sync_start): New.
621 * data/bison.m4: New file, with most of the content removed from c.m4.
622 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
623 * src/output.c (output_skeleton): Pass bison.m4.
624 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
627 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
629 Fix test failure reported by Tom Lane in
630 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
631 and try to make such failures easier to catch in the future.
632 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
633 that's now the caller's responsibility.
634 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
635 Set yychar = YYEOF if it's negative.
636 * tests/actions.at (yylex): Abort if asked to read past EOF.
637 * tests/conflicts.at (yylex): Likewise.
638 * tests/cxx-type.at (yylex): Likewise.
639 * tests/glr-regression.at (yylex): Likewise.
640 * tests/input.at (yylex): Likewise.
641 * tests/regression.at (yylex): Likewise.
642 * tests/torture.at (yylex): Likewise.
644 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
646 Fix problems with translating English-language diagnostics.
647 * bootstrap: Fix bug introduced in recent bootstrap changes, with
648 respect to bison-runtime pot generation. The YY_ stuff
649 wasn't being captured.
650 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
651 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
652 * runtime-po/POTFILES.in: Add data/push.c.
654 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
656 Merge bootstrap changes from coreutils.
658 2006-09-28 Jim Meyering <jim@meyering.net>
660 Automatically generated dependencies are important even
661 when all of the sources in a directory come from gnulib.
662 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
663 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
665 2006-09-23 Jim Meyering <jim@meyering.net>
667 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
669 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
671 * bootstrap: Add support for --force.
672 (usage): New function. Describe usage less tersely.
673 (CVS_only_file): New var.
675 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
677 * data/push.c (YYPUSH_MORE): Make it an enum instead.
678 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
679 Adjust white space and comments to match GNU style better.
681 2006-09-20 Bob Rossi <bob@brasko.net>
683 * data/push.c (yyresult_get): Remove function.
684 (YYPUSH_MORE): Add #define.
685 (yypushparse): Modify return value.
687 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
689 * stamp-h.in: Remove; no longer needed.
690 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
691 Remove config.h, config.hin, intl (no longer created).
692 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
695 Sync bootstrap from coreutils, as follows:
697 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
699 * bootstrap (symlink_to_gnulib): New function.
700 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
702 (cp_mark_as_generated, slurp, gnulib_files):
703 Avoid making a copy if it's the same as the old version.
704 (gnulib_files): Add support for this variable (used by Bison).
706 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
708 * src/getargs.c (usage): Rework to use conventions similar to
709 coreutils, to make translation a bit easier and the code a bit
710 smaller. Problem reported by Tim Van Holder.
712 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
714 Use some of gnulib's new modules, taken from coreutils.
716 * bootstrap: Sync from coreutils, except add support for gnulib_files.
717 * bootstrap.conf: New file.
718 (gnulib_modules): Add configmake, inttypes, unistd.
719 (XGETTEXT_OPTIONS): Add complain, complain_at,
720 fatal, fatal_at, warn, warn_at, unexpected_end.
721 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
722 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
724 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
726 (GNULIB_AUTOCONF_SNIPPET): Remove.
727 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
729 * lib/.cvsignore: Add inttypes_.h.
730 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
731 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
732 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
733 no-longer-necessary initializations.
734 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
735 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
736 use the unistd module.
737 * src/system.h: Likewise.
738 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
739 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
740 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
741 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
742 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
743 * src/system.h: Include inttypes.h unconditionally, now that we
744 use the inttypes module. Don't bother to include stdint.h, since
745 inttypes.h now does that for us.
746 (LOCALEDIR): Remove, now that we use the configmake module.
747 * src/getargs.c: Include configmake.h.
748 * src/main.c: Likewise.
749 * src/output.c: Likewise.
750 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
751 not from $abs_top_builddir, since config.h moved.
754 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
755 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
757 * src/parse-gram.y (symbol_declaration): Don't put statements
758 before declarations; it's not portable to C89.
759 * src/scan-code.l (handle_action_at): Likewise.
761 * src/scan-code.l: Always initialize braces_level; the old code
762 left it uninitialized and therefore had undefined behavior.
764 Don't attempt to redefine 'assert', since it runs afoul of
765 systems where standard headers (mistakenly) include <assert.h>.
766 Instead, define and use our own alternative, called 'aver'.
767 * src/reader.c: Don't include assert.h, since we no longer
769 * src/scan-code.l: Likewise.
770 * src/system.h (assert): Remove, replacing with....
771 (aver): New function, taking a bool arg. All uses changed.
772 * src/tables.c (pack_vector): Ensure that aver arg is bool,
773 not merely an integer.
775 2006-09-15 Bob Rossi <bob@brasko.net>
777 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
778 * data/c.m4 (YYPUSH): New.
779 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
780 * src/getargs.c (push_parser): New var.
781 * src/getargs.h (push_parser): New declaration.
782 * src/output.c (prepare): Add macro insertion of `push_flag'.
783 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
784 (prologue_declaration): Parse %push-parser.
785 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
786 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
787 list of removed lines from the traces observed.
788 (AT_CHECK_CALC_LALR): Added push parser tests.
790 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
792 * NEWS: Version 2.3a.
793 * configure.ac (AC_INIT): Likewise.
795 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
796 "#define YYSTYPE int" that caused "make maintainer-check" to fail
797 due to header ordering dependencies. I don't know why the #define
800 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
801 runtime cost when YYDEBUG is not defined, and so that some tests
802 that used to fail now work. Problem and initial suggestion by
804 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
805 * data/glr.cc (b4_parser_class_name):
806 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
807 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
808 (yydebug_) [YYDEBUG]: New member.
809 (yycdebug_): Now defined only if YYDEBUG.
810 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
811 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
812 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
814 (debug_stream, set_debug_stream, debug_level, set_debug_level):
815 Define only if YYDEBUG.
816 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
818 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
819 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
820 AT_CHECK_CALC_GLR_CC that are working now.
822 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
824 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
825 We don't need them in glr.cc, and glr.c defines them.
826 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
827 assumes that defining it to anything is the same as defining
828 it to 1. Problem reported by Paolo Bonzini.
830 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
832 * data/c.m4 (b4_null, b4_case): Define.
833 * src/output.c (prepare_symbols): Use b4_null.
834 (user_actions_output): Use b4_case.
836 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
838 * data/glr.c (b4_shared_declarations): Put start-header first,
839 before any #includes that we generate, so that feature-test
840 macros work. Problem reported by Michael Deutschmann in
841 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
842 * data/lalr1.cc: Likewise.
843 * doc/bison.texinfo (Prologue): Document that feature-test macros
844 should be defined before any Bison declarations.
845 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
846 that depend on location.hh after, not before, Bison decls, since
847 we now include location.hh after the first user prologue.
849 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
850 Sander Brandenburg in
851 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
852 Also, fix minor white space and comment issues.
853 (Prologue): Mention that it's better to define feature-test macros
854 before Bison declarations. Problem reported by Michael Deutschmann.
856 * README-cvs: Fix typo: "&" should be "&&". Problem reported
858 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
859 This adjusts to recent gnulib changes.
861 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
863 Finish implementation of per-type %destructor/%printer. Discussed
865 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
867 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
868 * NEWS (2.3+): Add a description of this feature to the default
869 %destructor/%printer description.
870 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
871 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
872 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
873 list node contains a semantic type.
874 * src/symtab.c, src/symtab.h: Extend with a table that associates
875 semantic types with their %destructor's and %printer's.
876 (semantic_type_from_uniqstr, semantic_type_get,
877 semantic_type_destructor_set, semantic_type_printer_set): New functions
878 composing the public interface of that table.
879 (symbol_destructor_get, symbol_destructor_location_get,
880 symbol_printer_get, symbol_printer_location_get): If there's no
881 per-symbol %destructor/%printer, look up the per-type before trying
883 * tests/actions.at (Per-type %printer and %destructor): New test case.
884 * tests/input.at (Default %printer and %destructor redeclared):
885 Extend to check that multiple occurrences of %symbol-default in a
886 single %destructor/%printer declaration is an error.
887 (Per-type %printer and %destructor redeclared, Unused values with
888 per-type %destructor): New test cases.
890 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
892 Require default %destructor/%printer to be declared using
893 %symbol-default instead of an empty symbol list, and start working on
894 new per-type %destructor/%printer. Discussed at
895 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
896 * NEWS (2.3+): Add %symbol-default to example.
897 * bison.texinfo (Freeing Discarded Symbols): Likewise.
898 (Bison Symbols): Add entry for %symbol-default.
899 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
900 (generic_symlist, generic_symlist_item): New nonterminals for creating
901 a list in which each item is a symbol, semantic type, or
903 (grammar_declaration): Use generic_symlist in %destructor and %printer
904 declarations instead of symbols.1 or an empty list.
905 (symbol_declaration, precedence_declaration, symbols.1): Update actions
906 for changes to symbol_list.
907 * src/reader.c: Update for changes to symbol_list.
908 * src/scan-code.l: Likewise.
909 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
910 * src/symlist.c, src/symlist.h: Extend such that a list node may
911 represent a semantic type or a %symbol-default in addition to just an
912 ordinary symbol. Add switched functions for setting %destructor's and
914 * tests/actions.at, tests/input.at: Add %symbol-default to all default
915 %destructor/%printer declarations.
917 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
919 Whether the default %destructor/%printer applies to a particular symbol
920 isn't a question of whether the user *declares* that symbol (in %token,
921 for example). It's a question of whether the user by any means
922 *defines* the symbol at all (by simply using a char token, for
923 example). $end is defined by Bison whereas any other token with token
924 number 0 is defined by the user. The error token is always defined by
925 Bison regardless of whether the user declares it with %token, but we
926 may one day let the user define error as a nonterminal instead.
927 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
928 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
929 the meaning of "user-defined".
930 * tests/actions.at (Default %printer and %destructor for user-declared
931 end token): Rename to...
932 (Default %printer and %destructor for user-defined end token): ...
935 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
936 computation of whether to apply the default, don't maintain a list of
937 every Bison-defined symbol. Instead, just check for a first character
938 of '$', which a user symbol cannot have, and check for the error token.
940 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
942 Don't apply the default %destructor or %printer to the error token,
943 $undefined, or $accept. This change fits the general rule that the
944 default %destructor and %printer are only for user-declared symbols,
945 and it solves several difficulties that are described in the new test
947 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
948 * tests/actions.at (Default %printer and %destructor are not for error
949 or $undefined, Default %printer and %destructor are not for $accept):
952 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
954 Allow %start after the first rule.
955 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
956 when parsing the first rule.
957 (check_and_convert_grammar): Search for it here after all grammar
958 declarations have been parsed. Skip midrules, which have dummy LHS
960 * src/symtab.c (symbol_is_dummy): New function.
961 * src/symtab.h (symbol_is_dummy): Declare it.
962 * tests/input.at (%start after first rule): New test.
964 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
966 Redo some of the previous commit: add back the ability to use
967 non-aliased/undeclared string literals since it might be useful to
968 those declaring %token-table.
969 * src/reader.c (check_and_convert_grammar): Undo changes in previous
970 commit: don't worry about complaints from symbols_pack.
971 * src/symtab.c (symbol_new, symbol_class_set,
972 symbol_check_alias_consistency): Undo changes in previous commit: count
973 each string literal as a new symbol and token, assign it a symbol
974 number, and don't complain about non-aliased string literals.
975 (symbols_pack): Since symbol_make_alias still does not decrement symbol
976 and token counts but does still set aliased tokens to the same number,
977 symbol_pack_processor now leaves empty slots in the symbols array.
979 * tests/regression.at (Undeclared string literal): Remove test case
980 added in previous commit since non-aliased string literals are allowed
982 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
983 remove unnecessary string literal declarations.
984 * tests/sets.at (Firsts): Likewise.
986 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
988 Don't allow an undeclared string literal, but allow a string literal to
989 be used before its declaration.
990 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
991 symbols_pack complained.
992 * src/symtab.c (symbol_new): Don't count a string literal as a new
994 (symbol_class_set): Don't count a string literal as a new token, and
995 don't assign it a symbol number since symbol_make_alias does that.
996 (symbol_make_alias): It's not necessary to decrement the symbol and
997 token counts anymore. Don't assume that an alias declaration occurs
998 before any uses of the identifier or string, and thus don't assert that
999 one of them has the highest symbol number so far.
1000 (symbol_check_alias_consistency): Complain if there's a string literal
1001 that wasn't declared as an alias.
1002 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1003 symbol_pack asserts that every token has been assigned a symbol number
1004 although undeclared string literals have not.
1005 * tests/regression.at (String alias declared after use, Undeclared
1006 string literal): New test cases.
1007 (Characters Escapes, Web2c Actions): Declare string literals as
1009 * tests/sets.at (Firsts): Likewise.
1011 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1013 In the grammar scanner, STRING_FINISH unclosed constructs and return
1014 them to the parser in order to improve error messages.
1015 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1016 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1017 * tests/input.at (Unclosed constructs): New test case.
1018 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1021 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1024 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1026 Handle string aliases for character tokens correctly.
1027 * src/symtab.c (symbol_user_token_number_set): If the token has an
1028 alias, check and set its alias's user token number instead of its own,
1029 which is set to indicate the alias. Previously, every occurrence of
1030 the character token in the grammar overwrote that alias indicator with
1032 * tests/input.at (String aliases for character tokens): New test.
1034 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1036 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1038 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1040 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1041 to prevent failures when building on older platforms.
1042 Check for autopoint failure.
1043 Set XGETTEXT_OPTIONS to values that check for C format strings,
1044 so that translators are warned about them (this also helps
1045 prevent core dumps).
1047 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1048 function, since it simplifies our code a bit.
1050 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1051 rather than -W, so we don't get bogus warnings about sign comparisons.
1052 Add -Wpointer-arith, since that warning is useful (it reports code
1053 that does not conform to C89 and that some compilers reject).
1054 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1055 since it's no longer needed.
1057 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1059 Clean up scanners a bit.
1060 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1061 definitions so gcc won't warn when obstack_for_string is unused.
1062 * src/scan-code.l: config.h and system.h are already #include'd by
1063 scan-code-c.c, so get rid of them here.
1064 * src/scan-gram.l: Likewise.
1065 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1066 definitions rather than duplicating the rest of it.
1067 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1069 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1071 Suppress signed/unsigned comparison warnings for yycheck.
1072 * data/c.m4 (b4_safest_int_type): New macro.
1073 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1074 a signed int type, cast it to b4_safest_int_type first.
1075 * data/yacc.c: Likewise.
1076 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1079 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1081 * doc/bison.texinfo: Fix some typos.
1083 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1085 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1086 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1088 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1089 the latest gnulib does this a different way.
1090 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1091 translation was patched, so stop omitting it.
1093 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1095 Enable declaration of default %printer/%destructor. Make the parser
1096 use these for all user-declared grammar symbols for which the user does
1097 not declare a specific %printer/%destructor. Thus, the parser uses it
1098 for token 0 if the user declares it but not if Bison generates it as
1099 $end. Discussed starting at
1100 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1101 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1103 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1104 * NEWS (2.3+): Mention.
1105 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1106 declare a %destructor for a mid-rule's semantic value. It's just
1107 impossible to declare one specific to it.
1108 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1109 code. Describe default %destructor form.
1110 * src/parse-gram.y (grammar_declaration): Parse default
1111 %printer/%destructor declarations.
1112 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1113 and symbol_destructor_location_get rather than accessing the destructor
1114 and destructor_location members of struct symbol.
1115 (symbol_printers_output): Likewise but for %printer's.
1116 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1118 * src/symtab.c (default_destructor, default_destructor_location,
1119 default_printer, default_printer_location): New static global
1120 variables to record the default %destructor and %printer.
1121 (symbol_destructor_get, symbol_destructor_location_get,
1122 symbol_printer_get, symbol_printer_location_get): New functions to
1123 compute the appropriate %destructor and %printer for a symbol.
1124 (default_destructor_set, default_printer_set): New functions to set the
1125 default %destructor and %printer.
1126 * src/symtab.h: Prototype all those new functions.
1127 * tests/actions.at (Default %printer and %destructor): New test to
1128 check that the right %printer and %destructor are called, that they're
1129 not called for $end, and that $$ and @$ work correctly.
1130 (Default %printer and %destructor for user-declared end token): New
1131 test to check that the default %printer and %destructor are called for
1132 a user-declared end token.
1133 * tests/input.at (Default %printer and %destructor redeclared, Unused
1134 values with default %destructor): New tests to check related grammar
1135 warnings and errors.
1137 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1139 Clean up handling of %destructor for the end token (token 0).
1140 Discussed starting at
1141 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1143 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1145 Make the skeletons consistent in how they pop the end token and invoke
1147 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1148 state, which has token number 0, since this would invoke the
1149 %destructor for the end token.
1150 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1151 until after shifting the end token, or else it won't be popped.
1152 * data/yacc.c (yyparse): Likewise.
1154 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1155 it's the end token. Upon termination, destroy an unshifted lookahead
1156 even when it's the end token.
1157 * data/lalr1.cc (yy::parser::parse): Likewise.
1158 * data/yacc.c (yyparse): Likewise.
1160 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1161 value warnings for the end token when the user gives the end token a
1164 * tests/actions.at (Printers and Destructors): Test all the above.
1166 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1168 Update to latest gnulib and gettext versions.
1169 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1171 (gnulib_files): Add m4/warning.m4. Don't worry about files
1172 overwritten by autopoint.
1173 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1174 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1176 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1177 so that we can remove the intl files at a better time.
1178 (intl_files_to_remove): Remove aclocal.m4, since it gets
1179 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1180 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1181 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1182 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1183 Remove datarootdir hack; no longer needed.
1184 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1185 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1186 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1188 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1189 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1191 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1193 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1194 it with --assume-autoconf='latest-stable'.
1196 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1198 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1199 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1201 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1202 those from muscle_tab.c since the old ones are misleading.
1204 2006-07-13 Akim Demaille <akim@epita.fr>
1206 Support %define "KEY" {VALUE}.
1207 * src/scan-code.h, src/scan-code.l (translate_action)
1208 (translate_rule_action, translate_symbol_action, translate_code):
1209 Return char *, not const char *.
1210 * src/parse-gram.y (declaration): Rename as...
1211 (prologue_declaration): this.
1212 (string_content): Remove this nonterminal, use STRING.
1213 (braceless, content, content.opt): New nonterminal.
1215 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1217 * src/scan-gram.l (getargs.h): Don't include it.
1219 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1221 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1222 rather than a for-loop that declares a local bool variable. This
1223 should work around a compatibility problem with a Cray x1e C++
1224 compiler reported by Hung Nguyen in
1225 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1226 The for-loop was introduced in the 2004-11-17 change but I don't
1227 know why it was needed.
1229 2006-07-12 Akim Demaille <akim@epita.fr>
1231 * data/c.m4: Comment changes.
1233 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
1235 * src/complain.c (error_message, ERROR_MESSAGE): New.
1237 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1238 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1240 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1242 * NEWS: Instead of %union, you can define and use your own union type
1243 YYSTYPE if your grammar contains at least one <type> tag.
1244 Your YYSTYPE need not be a macro; it can be a typedef.
1245 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1246 (Union Decl, Decl Summary): Document this.
1247 * data/glr.c (YYSTYPE): Implement this.
1248 * data/glr.cc (YYSTYPE): Likewise.
1249 * data/lalr1.cc (YYSTYPE): Likewise.
1250 * data/yacc.c (YYSTYPE): Likewise.
1251 * src/output.c (prepare): Output tag_seen_flag.
1252 * src/parse-gram.y (declaration, grammar_declaration):
1253 Use 'union_seen' rather than 'typed' to determine whether
1254 %union has been seen, since grammars can now be typed without
1256 (symbol_declaration, type.opt, symbol_def):
1257 Keep track of whether a tag has been seen.
1258 * src/reader.c (union_seen, tag_seen): New vars.
1260 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1261 * src/scan-code.l (untyped_var_seen): New variable.
1262 (handle_action_dollar): Adjust to above changes.
1263 (handle_action_dollar, handle_action_at):
1264 Improve overflow checking for outlandish numbers.
1265 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1266 avoid new diagnostics generated by above changes.
1267 * tests/regression.at (YYSTYPE typedef): Add test to check
1268 for type tags without %union.
1270 * src/symlist.c (symbol_list_length): Return int, not unsigned
1271 int, since callers expect int. This may need to get revisited
1272 once we have proper integer overflow checking.
1274 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1275 object is now static.
1277 * src/getargs.c (flags_argmatch): Return void, not int,
1278 to pacify ./configure --enable-gcc-warnings.
1280 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1281 since last_string is already defined to FLEX_PREFIX (last_string).
1283 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1285 Implement --warnings/-W.
1286 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1288 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1290 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1291 (warnings_args, warnings_types): New.
1292 (getargs, short_options, long_options): Accept -W/--warnings.
1293 Sort the options by alphabetical order, upper case letter right
1294 before its lower case.
1296 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1298 Change %merge result type clash warnings to errors. Discussed at
1299 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1300 * src/reader.c (record_merge_function_type): Use complain_at.
1301 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1302 declared later): Update test case results.
1304 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1306 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1307 to be in alphabetical order.
1308 (trace_args): Spelling fixes.
1310 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1312 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1313 so they don't collide with user-defined macros.
1314 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1315 this was never guaranteed, and now that we're using gnulib stdint,
1316 which defines int_fast16_t to long int, the problem is exposed.
1318 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1320 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1321 need the full POSIX semantics (and weren't implementing them
1324 Adjust to Autoconf 2.60 and today's gnulib.
1325 * bootstrap (gnulib_modules): Add stdint.
1326 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1327 no longer copies it.
1328 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1329 since stdint needs the former and wcwidth (which is now required
1330 by mbswidth) needs the latter.
1331 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1332 work around a compatibility glitch between gettext 0.14.6 and
1334 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1335 Do not check for uintptr_t, since new stdint module does the right
1337 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1338 Add stdint.h, stdint_.h, wcwidth.h.
1339 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1340 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1341 stdint.m4, wchar_t.m4, wcwidth.m4.
1342 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1343 usual order for ../lib/*.h files.
1344 (file_name_split): Use last_component, not base_name, to adjust
1346 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1347 for ../lib/*.h files.
1348 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1349 Define unconditionally, since we now assume the stdint module.
1350 * src/scan-skel.l: Include <dirname.h>.
1351 (BASE_QPUTS): Use last_component, not base_name.
1352 * src/system.h: Include <unlocked-io.h> in the usual order
1353 for ../lib/*.h files. Include <stdint.h> unconditionally,
1354 since we now use the stdint module.
1355 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1356 HAVE_UINTPTR_T, since we now use the stdint module.
1357 (base_name): Remove decl, since files now include <dirname.h>
1360 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1362 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1364 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1365 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1367 * tests/calc.at: Adjust.
1369 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1371 * data/c.m4 (b4_basename): New.
1372 (b4_syncline): Also output the location of its invocation (from
1374 (b4_user_action, b4_define_user_action, b4_user_actions)
1375 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1376 (b4_user_stype): New.
1377 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1379 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1381 In the grammar file, the first column is 1 not 0 on the first line as
1382 on every other line.
1383 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1384 * tests/input.at (Torturing the Scanner): Update output.
1386 * src/scan-gram.l (scanner_cursor): Declare it static.
1388 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1390 In warnings, say "previous declaration" rather than "first
1392 * src/symtab.c (redeclaration): Do that here.
1393 * src/reader.c (record_merge_function_type): In the case of a result
1394 type clash, report the previous declaration rather than the very first
1395 one in the grammar file.
1396 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1397 declared later): Add a third declaration to check this behavior.
1398 * tests/input.at (Incompatible Aliases): Update output.
1400 2006-06-27 Akim Demaille <akim@epita.fr>
1402 * doc/Doxyfile.in: New.
1403 * doc/Makefile.am: Use it.
1404 * src/lalr.h, src/symtab.h: Initial doxygenation.
1406 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1408 Don't miss %merge result type warnings just because the LHS types are
1409 declared after the %merge. This continues the effort of the previous
1411 * src/reader.c (get_merge_function): Don't set the merger type yet.
1412 (record_merge_function_type): New function for setting the merger type
1413 and checking for clashes.
1414 (grammar_current_rule_merge_set): Set the location of the %merge for
1416 (packgram): Invoke record_merge_function_type for each rule now that
1417 all symbol type declarations have been parsed.
1418 * src/reader.h (merger_list.type_declaration_location): New member
1419 storing the location of the first %merge from which the type for this
1420 merging function was derived.
1421 * src/symlist.h (symbol_list.merger_declaration_location): New member
1422 storing the location of a rule's %merge, if any.
1423 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1424 declared later): New test to catch the error fixed by the above patch.
1426 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1428 Get action warnings (grammar_rule_check) right even when symbol
1429 declarations appear after the rules. Discussed at
1430 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1432 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1433 Don't mistake the type of $$ in a midrule to be that of its parent
1435 * src/reader.c (grammar_current_rule_end): Don't invoke
1436 grammar_rule_check yet since not all symbol declarations may have been
1438 (grammar_midrule_action): Likewise.
1439 Don't record whether the midrule's $$ has been used yet since actions
1440 haven't been translated yet.
1441 Record the midrule's parent rule and its RHS index within the parent
1443 (grammar_current_rule_action_append): Don't translate the action yet
1444 since not all symbol declarations may have been parsed yet and, thus,
1445 warnings about types for $$, $n, @$, and @n can't be reported yet.
1446 (packgram): Translate the action and invoke grammar_rule_check now that
1447 all symbol declarations have been parsed.
1448 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1449 after parsing the entire grammar file, the symbol list here in the case
1450 of a midrule is actually the midrule's empty RHS, so reference its
1451 parent rule's RHS where necessary.
1452 On the other hand, now that you can already know it's a midrule, you
1453 aren't forced to think $$ has the same type as its parent rule's $$.
1454 (handle_action_at): In the case of a midrule, reference the parent rule
1456 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1458 (symbol_list_length): Now that this is invoked after all rules have
1459 been parsed, a NULL symbol (rather than a NULL symbol list node)
1460 terminates a rule. symbol_list_print already does this correctly.
1461 * src/symlist.h (symbol_list.midrule_parent_rule,
1462 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1463 remember their relationships with their parents.
1464 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1465 fixed by the above patch.
1466 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1468 (Unused values): ... this old test case and...
1469 (Unused values before symbol declarations): ... this new test case.
1470 This one is the same as `Unused values' except that all symbol
1471 declarations appear after the rules in order to catch the rest of the
1472 errors fixed by the above patch.
1474 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1477 * src/reader.c (current_rule): Declare it static since it's no longer
1478 used outside this file.
1479 (grammar_current_rule_action_append): Remove redundant arguments from
1480 translate_rule_action invocation.
1481 * src/reader.h (current_rule): Remove this unused extern.
1482 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1483 * src/scan-code.l (translate_rule_action): Likewise.
1485 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1487 Clean up yesterday's patch.
1488 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1490 * src/reader.c (grammar_current_rule_action_append): ... here for
1491 consistency with grammar_current_rule_symbol_append.
1492 * tests/regression.at (Braced code in declaration in rules section):
1493 Make yyerror and yylex static as usual.
1495 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1497 Fix bug that mistakes braced code in a declaration in the rules section
1498 to be a rule action. Mentioned at
1499 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1500 * src/scan-gram.l: Move midrule action detection from the start of the
1501 scanning of any braced code to...
1502 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1503 action. For readability, use $2 and @2 rather than the equivalent
1505 * tests/regression.at (Braced code in declaration in rules section):
1506 New test to catch the error fixed by the above patch.
1508 Work on code readability some.
1509 * src/scan-code.l (current_rule): Get rid of this misleading and
1510 redundant declaration: it's actually extern'ed in reader.h.
1511 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1512 translate_action): Add a rule argument and use it instead of the global
1514 (translate_rule_action): This already receives current_rule through an
1515 argument, so pass it on to translate_action instead of assigning
1516 current_rule to current_rule.
1517 (translate_symbol_action, translate_code): Pass rule = NULL to
1520 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1522 Rename %before-definitions to %start-header and %after-definitions to
1523 %end-header. Don't use these declarations to separate pre-prologue
1524 blocks from post-prologue blocks. Add new order-independent
1525 declarations %before-header and %after-header as alternatives to the
1526 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1527 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1528 * NEWS (2.3+): Update for these changes.
1529 * data/glr.c (b4_before_definitions): Update to...
1530 (b4_start_header): ... this.
1531 (b4_after_definitions): Update to...
1532 (b4_end_header): ... this.
1533 * data/glr.cc: Likewise.
1534 * data/lalr1.cc: Likewise.
1535 * data/yacc.c: Likewise.
1536 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1537 prologue blocks with %*-header declarations.
1538 (Calc++ Parser): Likewise.
1539 (Bison Declaration Summary): Update names.
1540 (Bison Symbols): Update description.
1541 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1542 (PERCENT_END_HEADER): ... this.
1543 (PERCENT_BEFORE_DEFINITIONS): Update to...
1544 (PERCENT_START_HEADER): ... this.
1545 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1546 (declaration): Update token names and m4 macro names.
1547 When parsing %end-header and %start-header, invoke translate_code
1548 before muscle_code_grow, and no longer set global booleans to remember
1549 whether these declarations have been seen.
1550 Parse new %after-header and %before-header.
1551 * src/reader.c (before_definitions, after_definitions): Remove.
1552 (prologue_augment): Accept a new bool argument to specify whether to
1553 augment the pre-prologue or post-prologue.
1554 * src/reader.h (before_definitions, after_definitions): Remove these
1556 (prologue_augment): Add new bool argument.
1557 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
1558 (PERCENT_END_HEADER): ... this.
1559 (PERCENT_BEFORE_DEFINITIONS): Update to...
1560 (PERCENT_START_HEADER): ... this.
1561 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1562 * tests/actions.at (Printers and Destructors): Update names.
1564 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1566 Add comparison operators for C++ location classes. Discussed at
1567 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
1568 * data/c++.m4 (b4_define_location_comparison): New boolean %define
1569 declaration indicating whether filename_type has an operator==. If
1570 filename_type is `std::string', it defaults to `1', `0' otherwise.
1571 * data/location.cc: Iff b4_define_location_comparison is `1', add
1572 operator== and operator!= for class position and for class location.
1575 * src/scan-action.l: Remove unused file.
1576 * src/symtab.c (symbol_printer_set): Use printer_location not
1577 destructor_location.
1578 * src/symtab.h (struct symbol): Replace incorrect source comment for
1580 * tests/input.at (Incompatible Aliases): Update output with correct
1583 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1585 Don't put the pre-prologue in the header file. For the yacc.c code
1586 file and the glr.c header and code files, move the pre-prologue before
1587 the token definitions. Add new %before-definitions and
1588 %after-definitions to declare code that will go in both the header file
1589 and code file. Discussed at
1590 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
1591 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
1593 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
1594 * NEWS (2.3+): Describe these changes.
1595 * data/glr.c (b4_pre_prologue): Move from within to before...
1596 (b4_shared_declarations): ... this.
1597 Add new b4_before_definitions before b4_token_enums.
1598 Add new b4_after_definitions at the end.
1599 * data/glr.cc (b4_pre_prologue): Replace with...
1600 (b4_before_definitions): ... this in the header file.
1601 (b4_after_definitions): New near the end of the header file.
1602 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
1603 code file right before including the header file.
1604 (b4_before_definitions): New in the previous position of
1605 b4_pre_prologue in the header file.
1606 (b4_after_definitions): New near the end of the header file.
1607 * data/yacc.c: Clean up some m4 quoting especially in the header file.
1608 (b4_token_enums_defines): In the code file, move to right before
1609 YYSTYPE for consistency with the header file.
1610 (b4_before_definitions): New right before b4_token_enums_defines in
1611 both the header and code file.
1612 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
1613 header and code file.
1614 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
1615 of prologues for %union dependencies.
1616 (Bison Declaration Summary): In %defines description, mention the
1617 effect of %before-definitions and %after-definitions on the header
1619 (Calc++ Parser): Forward declare driver in a %before-definitions rather
1620 than in the pre-prologue so that make check succeeds.
1621 (Bison Symbols): Add entries for %before-definitions and
1623 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
1624 %before-definitions.
1625 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
1626 (declaration): Parse those declarations and append to
1627 b4_before_definitions and b4_after_definitions, respectively.
1628 * src/reader.c (before_definitions, after_definitions): New bools to
1629 track whether those declarations have been seen.
1630 (prologue_augment): Add to the post-prologue if %union,
1631 %before-definitions, or %after-definitions has been seen.
1632 * src/reader.h (before_definitions, after_definitions): New extern's.
1633 * src/scan-gram.l: Scan the new declarations.
1634 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
1635 prologue block in a %before-definitions or a %after-definitions based
1636 on whether the %union is declared.
1637 * tests/regression.at (Early token definitions with --yacc, Early token
1638 definitions without --yacc): Move tests for token definitions into the
1639 post-prologue since token names are no longer defined in the
1642 2006-06-20 Akim Demaille <akim@epita.fr>
1644 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1645 (symbol_get): Use it.
1646 * src/parse-gram.y: Use it.
1648 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1650 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1651 build succeeds when configured with --enable-gcc-warnings.
1653 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1655 * src/parse-gram.y (char_name): New function.
1656 (CHAR, STRING, string_content): For %printer, properly escape.
1657 (ID): Prefer fputs to fprintf.
1658 (id): Reindent to be consistent with other rules.
1659 Properly quote char.
1661 The Translation Project changed its way of publishing translations
1662 to maintainers. I haven't received any responses to my request
1663 for supporting the old way, or for documenting the new way. I
1664 have modified 'bootstrap' to use screen scraping
1665 (in this case, HTML scraping). This is unreliable and inelegant,
1666 but I don't see any better way. Yuck.
1667 * bootstrap (TP_URL, WGET_COMMAND): New vars.
1668 (get_translations): New function, which uses HTML scraping to
1669 deduce locations of latest translations.
1670 Use this function to grab both bison and bison-runtime .po files.
1671 Don't bother priming the pump for the runtime-po domain any more,
1672 as it's now translated better than bison is.
1674 2006-06-19 Akim Demaille <akim@epita.fr>
1676 * src/scan-gram.l: No longer "parse" things after `%union' until
1677 `{'. Rather, return a single "%union" token.
1678 No longer make symbols: return strings, and leave the conversion
1679 to symbols to the parser.
1680 (SC_PRE_CODE, token_type): Remove.
1681 * src/parse-gram.y (%union): New field `character'.
1684 (ID, ID_COLON): Now that the scanner no longer makes them
1685 identifiers, adjust all uses to invoke symbol_get.
1686 (id_colon): New, wraps the conversion from string to symbol.
1687 (%union): Accept a possible union_name.
1688 (symbol): Now can be a char.
1689 * data/c.m4 (b4_union_name): Leave a default value.
1690 * data/glr.c, data/yacc.c: Use it.
1692 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1694 For associating token numbers with token names for "yacc.c", don't use
1695 #define statements unless `--yacc' is specified; always use enum
1696 yytokentype. Most important discussions start at:
1697 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1698 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1700 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1701 * NEWS (2.3+): Mention.
1702 * data/c.m4 (b4_yacc_if): New.
1703 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1705 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1706 on token name definitions.
1707 * src/getargs.c (usage): Capitalize `Yacc' in English.
1708 * src/output.c (prepare): Define b4_yacc_flag.
1709 * tests/regression.at (Early token definitions): Test that tokens names
1710 are defined before the pre-prologue not just before the post-prologue.
1711 Remove this test case and copy to...
1712 (Early token definitions with --yacc): ... this to test #define's.
1713 (Early token definitions without --yacc): ... and this to test enums.
1715 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1717 * NEWS: Reword the post-2.3 change to not be so optimistic about
1718 removing the old "look-ahead" spelling.
1719 Update previous look-ahead/lookahead change reports.
1720 * REFERENCES: look-ahead -> lookahead (since that's
1721 what he actually wrote).
1722 * doc/refcard.tex: look ahead -> lookahead,
1723 look-ahead -> lookahead
1725 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1727 For consistency, use `lookahead' instead of `look-ahead' or
1728 `look_ahead'. Discussed starting at
1729 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1731 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1732 * NEWS: For the next release, note the change to `--report'.
1733 * TODO, doc/bison.1: Update English.
1734 * doc/bison.texinfo: Update English.
1735 (Understanding Your Parser, Bison Options): Document as
1736 `--report=lookahead' rather than `--report=look-ahead'.
1737 * src/conflicts.c: Update English in comments.
1738 (lookahead_set): Rename from look_ahead_set.
1739 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1740 (resolve_sr_conflict): Rename local look_ahead_tokens to
1741 lookahead_tokens, and update other uses.
1742 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1743 count_rr_conflicts, conflicts_free): Update uses.
1744 * src/getargs.c (report_args): Move "lookahead" before alternate
1746 (report_types): Update uses.
1747 (usage): For `--report' usage description, state `lookahead' spelling
1748 rather than `look-ahead'.
1749 * src/getargs.h (report.report_lookahead_tokens): Rename from
1750 report_look_ahead_tokens.
1751 * src/lalr.c: Update English in comments.
1752 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1753 (state_lookahead_tokens_count): Rename from
1754 state_look_ahead_tokens_count.
1755 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1756 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1757 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1759 Update English in output.
1760 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1761 * src/print.c: Update English in comments.
1762 (lookahead_set): Rename from look_ahead_set.
1763 (print_reduction): Rename argument lookahead_token from
1765 (print_core, state_default_rule, print_reductions, print_results):
1767 * src/print_graph.c: Update English in comments.
1768 (print_core): Update uses.
1769 * src/state.c: Update English in comments.
1770 (reductions_new): Update uses.
1771 (state_rule_lookahead_tokens_print): Rename from
1772 state_rule_look_ahead_tokens_print, and update other uses.
1773 * src/state.h: Update English in comments.
1774 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1775 (state_rule_lookahead_tokens_print): Rename from
1776 state_rule_look_ahead_tokens_print.
1777 * src/tables.c: Update English in comments.
1778 (conflict_row, action_row): Update uses.
1779 * tests/glr-regression.at
1780 (Incorrect lookahead during deterministic GLR,
1781 Incorrect lookahead during nondeterministic GLR): Rename
1782 print_look_ahead to print_lookahead.
1783 * tests/torture.at: Update English in comments.
1784 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1785 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1786 (Many lookahead tokens): Update uses.
1787 * data/glr.c: Update English in comments.
1788 * lalr1.cc: Likewise.
1790 * src/conflicts.h: Likewise.
1791 * src/lalr.h: Likewise.
1792 * src/main.c: Likewise.
1793 * src/output.c: Likewise.
1794 * src/parse-gram.c: Likewise.
1795 * src/tables.h: Likewise.
1796 * tests/calc.at: Likewise.
1798 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1800 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1802 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1804 * TODO: Add request from Nelson H. F. Beebe to be able to install
1805 Bison without installing the yacc script.
1807 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1809 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1810 and yytext if they're already #define'd.
1811 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1812 * src/scan-code-c.c: ... here.
1813 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1816 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1818 Get Bison to build again when configured with --enable-gcc-warnings.
1819 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1821 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1822 loc argument as it shadows a global.
1823 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1826 * src/.cvsignore: Add scan-code.c.
1828 2006-06-07 Akim Demaille <akim@epita.fr>
1830 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1832 * src/scan-code.l: here.
1833 * tests/input.at (Torturing the Scanner): Fix another location
1836 2006-06-07 Akim Demaille <akim@epita.fr>
1838 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1840 2006-06-06 Akim Demaille <akim@epita.fr>
1842 Extract the parsing of user actions from the grammar scanner.
1843 As a consequence, the relation between the grammar scanner and
1844 parser is much simpler. We can also split "composite tokens" back
1846 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1847 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1849 * src/location.h, src/location.c (add_column_width)
1850 (location_compute): these.
1851 Fix the column count: the initial column is 0.
1852 (location_print): Be robust to ending column being 0.
1853 * src/location.h (boundary_set): New.
1854 * src/main.c: Adjust to scanner_free being renamed as
1856 * src/output.c: Include scan-code.h.
1857 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1859 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
1860 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
1861 which is now, again, a separate token.
1862 Adjust all dependencies.
1863 Whereever actions with $ and @ are used, use translate_code.
1864 (action): Remove this nonterminal which is now useless.
1865 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
1866 (grammar_current_rule_action_append): Use translate_code.
1867 (packgram): Bound check ruleno, itemno, and rule_length.
1868 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
1869 (last_string, last_braced_code_loc, max_left_semantic_context)
1870 (scanner_initialize, scanner_free, scanner_last_string_free)
1871 (gram_out, gram_lineno, YY_DECL_): Move to...
1872 * src/scan-gram.h: this new file.
1873 (YY_DECL): Rename as...
1875 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
1876 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1877 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1878 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1879 Move these declarations, and...
1880 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
1882 * src/flex-scanner.h: this new file.
1883 * src/scan-gram.l (rule_length, rule_length_overflow)
1884 (increment_rule_length): Remove.
1885 (last_braced_code_loc): Rename as...
1886 (gram_last_braced_code_loc): this.
1887 Adjust to the changes of the parser.
1888 Move all the handling of $ and @ into...
1889 * src/scan-code.l: here.
1890 * src/scan-gram.l (handle_dollar, handle_at): Remove.
1891 (handle_action_dollar, handle_action_at): Move to...
1892 * src/scan-code.l: here.
1893 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
1894 scan-code.h, scan-code-c.c, scan-gram.h.
1895 (EXTRA_bison_SOURCES): Add scan-code.l.
1896 (BUILT_SOURCES): Add scan-code.c.
1897 (yacc): Be robust to white spaces.
1899 * tests/conflicts.at, tests/input.at, tests/reduce.at,
1900 * tests/regression.at: Adjust the column numbers.
1901 * tests/regression.at: Adjust the error message.
1903 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1905 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1906 Use Akim's wording from
1907 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
1909 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1911 Between Bison releases, manually append `+' to the previous Bison
1912 release number, and use that as a signal to automatically print the
1913 ChangeLog's CVS Id keyword from --version. Discussed starting at
1914 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
1915 * ChangeLog: Add Id header.
1916 * configure.ac (AC_INIT): Append `+' to `2.3'.
1917 * src/.cvsignore: Add revision.c.
1918 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1919 (BUILT_SOURCES): Add revision.c.
1920 (revision.c): New target rule. This file defines a new global variable
1921 named revision. It initializes it with either the Id from ChangeLog
1922 or, if VERSION doesn't contain `+', with the empty string.
1923 * src/getargs.c (version): Print the value of revision.
1924 * src/revision.h: Extern revision.
1926 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1928 * NEWS: Version 2.3.
1929 * configure.ac (AC_INIT): Likewise.
1931 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1933 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1934 with no arguments, not as an object-like macro. This is for
1935 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1936 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1937 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1940 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1942 * src/getargs.c (usage): Back out yesterday's modification of the
1943 --help output so that we don't have to wait for translation before
1946 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1948 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1949 Problem reported by Akim Demaille.
1951 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1953 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1955 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1957 * data/yacc.c (yy_reduce_print): Omit trailing white space in
1958 generated source code. Problem reported by Frans Englich in
1959 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
1961 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1963 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
1964 shell, not within 'make', so that 'make' by an ordinary builder
1965 (using GNU make) does not worry about configuring gzip. This also
1966 works around a bug reported independently by Keith Thompson and by
1967 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
1968 stderr rather than stdout, messing up the build logs.
1970 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1972 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
1973 to make sure that YYID will never be unused. This fixes a 'make
1974 maintainer-check' failure caused by the recent changes to the 'Trivial
1975 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
1977 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
1979 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1981 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
1982 state before an empty RHS is always resolved here. Only the location
1983 of that state is guaranteed to be resolved, and that's enough. This
1984 fixes the remaining bug reported by Derek M. Jones in
1985 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1986 * tests/glr-regression.at (Uninitialized location when reporting
1987 ambiguity): Test the above case.
1988 Also, the embedded comments in this test case claim it checks the case
1989 of an empty RHS that has inherited the initial location. However, the
1990 corresponding LHS was already resolved, so yyresolveLocations didn't
1991 actually have reason to modify it. Fix this by forcing
1992 nondeterministic operation at the beginning of the parse.
1994 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
1996 * data/c.m4 (b4_yy_symbol_print_generate):
1997 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
1998 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
1999 of the bugs reported today by Derek M Jones in
2000 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2001 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2002 defined to be a type name without parens or brackets.
2003 (Location Type): Similarly for YYLTYPE.
2004 * tests/regression.at (Trivial grammars): Put in a test for this
2005 bug that will be caught by 'make maintainer-check' (though not,
2006 alas, by 'make check' unless your compiler is picky).
2008 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2010 * NEWS: Version 2.2.
2011 * configure.ac (AC_INIT): Likewise.
2013 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2015 * data/glr.c (yyreportTree): Make room in yystates for the state
2016 preceding the RHS. This fixes the segmentation fault reported by Derek
2018 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2019 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2020 to the user. Reported for yyreportTree by Derek M. Jones later in the
2022 * THANKS: Add Derek M. Jones.
2023 Update my email address.
2024 Fix typo in Steve Murphy's name.
2026 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2028 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2029 checking against YYLAST that caused the parser to miss a potential
2030 alternative in its diagnostic.
2031 Problem reported by Maria Jose Moron Fernandez in
2032 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2033 * data/lalr1.cc (yysyntax_error_): Likewise.
2034 * data/yacc.c (yysyntax_error): Likewise.
2035 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2036 tokens, in case we run into an older C compiler.
2037 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2038 Use them to check for the off-by-one error fixed above.
2040 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2041 YYSIZE_T, not size_t.
2042 * tests/regression.at (Trivial grammars): New test, to catch
2043 the error fixed by the above patch.
2045 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2047 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2049 Reported by Steve Murphy.
2051 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2053 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2054 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2056 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2058 Implement --trace=m4.
2059 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2060 * src/output.c (output_skeleton): When set, pass -dV to m4.
2062 Factor the handling of flags in m4.
2063 * src/output.c (prepare): Rename the muscle names debug, defines,
2064 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2065 * data/c.m4: Adjust.
2066 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2067 Use b4_define_flag_if to define other b4_FLAG_if macros.
2068 (b4_location_if): As a consequence, rename as...
2069 (b4_locations_if): this, for consistency.
2070 Adjust all the skeletons.
2072 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2074 * etc/bench.pm: Shorten bench names.
2076 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2078 * src/output.h, src/output.c (error_verbose): Move to...
2079 * src/getargs.h, src/getargs.c: here.
2081 Adjust dependencies.
2083 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2085 * data/c.m4 (b4_copyright): Put the special exception for Bison
2086 skeletons here, so we don't have to put it in each skeleton. All
2087 uses changed. Suggested by Akim Demaille. Also, wrap the
2088 copyright notice, in case it is longer than 80 columns. Replace
2089 comma by newline after title.
2091 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2093 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2094 incompatibility, not a bug. Mention that it wasn't fixed as of
2097 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2099 * examples/extexi: Enforce the precedence of concatenation over
2101 Reported by Tommy Nordgren.
2103 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2105 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2106 with the member "token".
2107 Reported by Martin Nylin.
2109 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2111 * data/glr.c: Switch to Bison 2.2 special-exception language in
2112 the copyright notice. Use more-regular format for titles and
2114 * data/glr.cc: Likewise.
2115 * data/location.cc: Likewise.
2116 * data/yacc.cc: Likewise.
2117 * doc/bison.texinfo (Conditions): Document this.
2118 * NEWS: likewise. Upgrade version to 2.2.
2120 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
2122 * data/glr.cc: Remove dead code.
2124 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2126 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2127 that variable and the line breaks the bootstrap. Problem reported
2128 by Juan M. Guerrero.
2130 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2132 * doc/bison.texinfo (Multiple start-symbols): New.
2134 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2136 * etc/README, etc/bench.pl: New.
2138 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
2140 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2142 Reported by Mickael Labau.
2143 * tests/input.at (Torturing the Scanner): Test it.
2145 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2147 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2148 Problem reported by Bob Rossi.
2150 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2152 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2153 and didn't really work.
2154 For the index, use @ifnotinfo, not @iftex.
2155 Minor cleanups of spacing and terminology.
2157 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2159 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2160 of AT_NAME_PREFIX when %name-prefix is not used.
2162 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2164 Apply --prefix to C++ skeletons too: they change the namespace.
2165 The test suite already exercize these cases.
2166 * data/c++.m4 (b4_namespace): New.
2167 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2168 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2169 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2170 * doc/bison.texinfo: Document it.
2171 (Option Cross Key): Use @multitable in all formats. It looks
2172 nicer, even in TeX outputs.
2173 (Rules): Use the same code whatever the output type is.
2174 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2175 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2176 * tests/calc.at: Use it, instead of hard coding `yy'.
2178 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2180 * TODO: Remove dead items.
2182 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2184 * doc/FAQ: Remove, merged into...
2185 * doc/bison.texinfo (FAQ): this.
2186 * doc/Makefile.am (EXTRA_DIST): Adjust.
2188 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2190 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2192 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2193 * doc/bison.texinfo (Calc++ Scanner): Use it.
2195 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2197 Fix two nits reported by twlevo, plus one more that I discovered.
2199 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2200 this is the usual Bison style.
2201 * src/location.h (location_print): Likewise.
2203 * src/reader.h (token_name): Likewise.
2205 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2207 Fix some nits reported by twlevo.
2208 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2209 and "POSIX". Use more-modern syntax for URLs. Mention C++
2210 and ask for Java. Don't hardwire OS version numbers. Add
2212 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2213 * src/conflicts.c (solved_conflicts_obstack): Now static.
2215 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2217 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2218 page. Say "you can use it" not "you may use it" as on the web page;
2219 we're describing capabilities not granting permission.
2221 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2223 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2224 shadowing warnings. Use usual patter for iterating through RHS.
2225 * tests/glr-regression.at
2226 (Uninitialized location when reporting ambiguity):
2227 Modify yylex so that it uses its argument, rather than trying
2228 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2229 const char -> char const.
2231 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2232 Don't use tabs inside commands; it messes up 'ps'.
2233 Problem reported by twlevo.
2235 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2237 * tests/glr-regression.at (Uninitialized location when reporting
2238 ambiguity): New test case.
2239 * data/glr.c (yyresolveLocations): New function, which uses
2241 (yyresolveValue): Invoke yyresolveLocations before reporting an
2243 * doc/bison.texinfo (Default Action for Locations): Note
2244 YYLLOC_DEFAULT's usage for ambiguity locations.
2245 (GLR Semantic Actions): Cross-reference those notes.
2247 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2249 * tests/glr-regression.at (Leaked semantic values when reporting
2250 ambiguity): Remove unnecessary union and type declarations.
2251 (Leaked lookahead after nondeterministic parse syntax error): New test
2253 * data/glr.c (yyparse): Check for zero stacks remaining before
2254 attempting to shift the lookahead so that you don't lose it.
2256 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2258 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2259 * tests/glr-regression.at (Leaked semantic values when reporting
2260 ambiguity): New test case.
2261 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2262 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2263 now unnecessary yystackp parameter.
2264 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2265 destructors can be called.
2267 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2268 in existing testcases.
2270 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2272 Don't leak semantic values for parent RHS when a user action cuts the
2273 parser, and clean up related code a bit.
2274 * tests/glr-regression.at (Leaked merged semantic value if user action
2275 cuts parse): Rename to...
2276 (Leaked semantic values if user action cuts parse): ... this. Add check
2277 for leaked parent RHS values.
2278 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2279 between an unresolved state (non-empty chain of semantic options) and
2280 an incomplete one (signaled by an empty chain).
2281 (yyresolveStates): Document the interface. Move all manipulation of a
2282 successfully or unsuccessfully resolved yyGLRState to...
2283 (yyresolveValue): ... here so that yyresolveValue always leaves a
2284 yyGLRState with consistent data and thus is easier to understand.
2285 Remove the yyvalp and yylocp parameters since they are always just
2286 taken from the yys parameter. When reporting a discarded merged value
2287 in debugging output, note that it is incompletely merged. Document the
2289 (yyresolveAction): If resolving any of the RHS states fails, destroy
2290 them all rather than leaking them. Thus, as long as user actions are
2291 written to clean up the RHS correctly, yyresolveAction always cleans up
2292 the RHS of a semantic option. Document the interface.
2294 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2296 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2297 led to a segmentation fault in GNU Pascal. Problem reported
2300 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2302 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2303 mid-rule action inside a nonterminal symbol in order to declare a
2304 destructor for its semantic value.
2306 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2308 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2309 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2310 __cplusplus && ! defined _STDLIB_H && !
2311 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2312 defined free))]: Include <stdlib.h> rather than rolling our own
2313 declarations of malloc and free, to avoid problems with
2314 incompatible declarations (using 'throw') C++'s stdlib.h. This
2315 should fix Debian bug 340012
2316 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2317 reported by Guillaume Melquiond.
2319 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2321 * NEWS: Clarify symbols versus types in unused-value warnings.
2323 * configure.ac (AC_INIT): Bump version number.
2325 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2327 * NEWS: Version 2.1a.
2328 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2329 since C99 requires this.
2331 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2333 * m4/c-working.m4: New file.
2334 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2336 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2338 * Makefile.maint: Merge from coreutils.
2340 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2342 More portability fixes for problems summarized by Nelson H. F. Beebe.
2344 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2345 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2346 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2347 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2348 messes up because C++ code is compiled in 32-bit mode but linked
2351 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2353 More portability fixes for problems summarized by Nelson H. F. Beebe.
2355 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2356 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2358 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2359 nodist_PROGRAMS, since we don't need to actually compile the
2360 example if we're just doing a plain 'make'. This avoids bothering
2361 the installer unnecessarily about problems due to weird C++
2364 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2366 More portability fixes for problems summarized by Nelson H. F. Beebe.
2368 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2369 than #include "...", and compile with -I'.'. The old method was
2370 not portable, according to Posix and the C standard, and it does
2371 not work with Sun C 5.7, where previous #line directives affect
2372 the working directory used in later #include "..." directives.
2374 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2376 Various DJGGP specific issues in /djgpp
2378 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2380 More portability fixes for problems summarized by Nelson H. F. Beebe.
2382 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2383 '#include <map>' works and that you can apply ++ to iterators.
2385 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2387 Work around portability problems summarized by Nelson H. F. Beebe in
2388 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2390 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2391 that '#include <string>' works.
2393 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2394 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2395 "warning: sorry: semantics of inline function static data `const
2396 unsigned char translate_table[262]' are wrong (you'll wind up with
2399 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2400 or, xor to not_, and_, or_, and xor_, respectively. This works
2401 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2402 random system header somewhere that includes the equivalent of
2405 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2406 -E" works; it apparently doesn't work with PathScale EKO Compiler
2409 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2411 During deterministic GLR operation, user actions should be able to
2412 influence the parse by changing yychar. To make this easier to fix and
2413 to make glr.c easier to evolve in general, don't maintain yytoken in
2414 parallel with yychar; just compute yytoken when needed.
2415 * tests/glr-regression.at (Incorrect lookahead during deterministic
2416 GLR): Check that setting yychar in a user action has the intended
2418 * data/glr.c (yyGLRStack): Remove yytokenp member.
2419 (yyclearin): Don't set *yytokenp.
2420 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2421 yychar rather than *yytokenp to determine the current lookahead.
2422 Compute yytoken locally when needed.
2423 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2426 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2427 after `--report' documentation.
2429 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2431 * src/parse-gram.y (grammar_declaration): Location of printer
2432 symbol is @1, not list->location. Bug reported by twlevo.
2433 * tests/input.at (Incompatible Aliases): Adjust to above change.
2435 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2437 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2438 all the test at once. This makes the output easier to read in the
2441 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2442 got from <http://bro-ids.org/download.html>. The bug is that
2443 when two actions appeared in succession, the second one was
2444 scanned before the first one was added to the grammar rule
2445 as a midrule action. Bison then output the incorrect warning
2446 "parse.y:905.17-906.36: warning: unused value: $3".
2447 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2448 associated with a value.
2449 (rhs): Don't invoke grammar_current_rule_action_append.
2450 (action): Invoke it here instead.
2451 * src/reader.c (grammar_midrule_action): Now extern.
2452 (grammar_current_rule_action_append): Don't invoke
2453 grammar_midrule_action; that is now the scanner's job.
2454 * src/reader.h (last_string, last_braced_code_loc):
2455 (grammar_midrule_action): New decls.
2456 * src/scan-gram.l (last_string): Now extern, sigh.
2457 (last_braced_code_loc): New extern variable.
2458 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2459 rule already has an action.
2460 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2461 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2462 Add some tests to check that the above changes fixed the bug.
2464 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2466 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2467 All used changed. Check whether the symbol has a destructor,
2468 not whether it is typed.
2469 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2470 that the values are still reported as unused. All line numbers
2473 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2475 Work around a bug in bro 0.8, which underparenthesizes its
2476 definition of YYLLOC_DEFAULT.
2477 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2479 * data/lalr1.cc: Likewise.
2480 * data/yacc.cc: Likewise.
2482 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2484 Work around a bug in Pike 7.0, and give the Pike folks a
2485 better way to override the usual int widths.
2486 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2487 user can override the types.
2488 (short): #undef, to work around a bug in Pike 7.0.
2489 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2490 (union yyalloc.yyss): Use yytype_int16 rather than short.
2492 (yysigned_char): Remove.
2493 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2494 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2495 * tests/regression.at (Web2c Actions): Adjust to above changes.
2497 * src/reader.c (check_and_convert_grammar): New function.
2498 (reader): Close the input file even if something went wrong during
2499 parsing. Minor file descriptor leak reported by twlevo.
2501 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2502 to pacify gcc -Wswitch-default.
2503 * src/scan-gram.l (adjust_location): Use a default: break; case
2504 to pacify gcc -Wswitch-default.
2505 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2506 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2507 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2508 Move these decls to scan-skel.l, since they don't need to be
2510 * src/scan-skel.l: Accept the above decls.
2511 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2514 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2516 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2517 since we don't want to insist on a version number at the start
2518 of the changelog every time.
2519 * Makefile.maint: Sync from coreutils a bit better.
2520 (sc_trailing_blank): Renamed from sc_trailing_space.
2522 (sc_no_if_have_config_h, sc_require_config_h):
2523 (sc_prohibit_assert_without_use): New rules.
2524 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2525 (sc_dd_max_sym_length): Fix leading spaces in rule.
2526 (sc_system_h_headers): Prefix with @.
2527 (sc_useless_cpp_parens, m4-check): Output line numbers.
2528 (changelog-check): Allow version only in head.
2529 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2530 satisfy new Makefile.maint rule.
2531 * data/glr.c: Likewise.
2532 * data/glr.cc: Likewise.
2533 * data/lalr1.cc: Likewise.
2534 * data/yacc.c: Likewise.
2535 * lib/ebitsetv.c: Likewise.
2536 * lib/lbitset.c: Likewise.
2537 * lib/subpipe.c: Likewise.
2538 * lib/timevar.c: Likewise.
2539 * src/system.h: Likewise.
2540 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2541 * djgpp/Makefile.maint: Add copyright notice.
2542 * djgpp/README.in: Likewise.
2543 * djgpp/config.bat: Likewise.
2544 * djgpp/config.site: Likewise.
2545 * djgpp/config_h.sed: Likewise.
2546 * djgpp/djunpack.bat: Likewise.
2547 * djgpp/config.sed: Fix copyright notice to match standard format.
2548 * djgpp/subpipe.h: Likewise.
2549 * lib/bitsetv-print.c: Likewise.
2550 * lib/bitsetv.c: Likewise.
2551 * lib/subpipe.h: Likewise.
2552 * lib/timevar.c: Likewise.
2553 * lib/timevar.h: Likewise.
2554 * djgpp/subpipe.c: Use standard recipe for config.h.
2555 * lib/abitset.c: Likewise.
2556 * lib/bitset.c: Likewise.
2557 * lib/bitset_stats.c: Likewise.
2558 * lib/bitsetv-print.c: Likewise.
2559 * lib/bitsetv.c: Likewise.
2560 * lib/ebitsetv.c: Likewise.
2561 * lib/get-errno.c: Likewise.
2562 * lib/lbitset.c: Likewise.
2563 * lib/subpipe.c: Likewise.
2564 * lib/timevar.c: Likewise.
2565 * lib/vbitset.c: Likewise.
2566 * tests/local.at: Likewise.
2567 * src/scan-gram.l: Don't include verify.h, since system.h does
2569 * .x-sc_require_config_h: New file.
2570 * .x-sc_unmarked_diagnostics: New file.
2572 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2574 Be a bit more systematic about using 'abort'.
2575 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
2576 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
2577 Put 'default: abort ();' before some other case, to satisfy older
2579 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2580 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
2581 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
2582 * src/conflicts.c (resolve_sr_conflict): Likewise.
2583 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
2584 (get_decision_str, get_orientation_str, get_node_alignment_str):
2585 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
2586 (get_linestyle_str, get_arrowstyle_str): Likewise.
2587 * src/conflicts.c (resolve_sr_conflict):
2588 Use a default case rather than one for the one remaining enum
2589 value, to catch invalid enum values as well.
2590 * src/lalr.c (set_goto_map, map_goto):
2591 Prefer "assert (FOO);" to "if (!FOO) abort ();".
2592 * src/nullable.c (nullable_compute, token_definitions_output):
2594 * src/reader.c (packgram, reader): Likewise.
2595 * src/state.c (transitions_to, state_new, state_reduction_find):
2597 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
2598 (symbol_pack): Likewise.
2599 * src/tables.c (conflict_row, pack_vector): Likewise.
2600 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
2601 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
2602 * src/system.h: Don't include <assert.h>.
2603 (assert): New macro.
2605 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
2606 (Destructor Decl, Parser Function, Pure Calling):
2607 Describe rules for braces inside C code more carefully.
2609 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2611 Fix some porting glitches found by Nelson H. F. Beebe.
2612 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
2613 compilers that don't understand that abort () does not return.
2614 * src/state.c (transitions_to): Likewise.
2615 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2616 that '#include <cstdlib>' works.
2617 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
2618 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
2619 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
2620 for the benefit of some pre-C99 compilers.
2622 * bootstrap: Undo changes to gnulib files that autoreconf made.
2624 Minor fixups to get 'make maintainer-check' to work.
2625 * configure.ac: Don't use -Wnested-externs, as it's incompatible
2626 with the new verify.h implementation.
2627 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
2628 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
2629 * data/yacc.c (YYUSE): Likewise.
2630 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
2631 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
2632 * src/parse-gram.y (declaration): Don't pass a string constant
2633 to a function that expects char *, since GCC might complain
2634 about the constant value.
2635 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
2636 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
2637 before #defining them.
2638 * tests/glr-regression.at
2639 (Incorrectly initialized location for empty right-hand side in GLR):
2640 In yyerror, use the msg arg.
2641 (Corrupted semantic options if user action cuts parse):
2642 (Incorrect lookahead during deterministic GLR):
2643 (Incorrect lookahead during nondeterministic GLR):
2644 Don't name a local var 'index'; it shadows string.h's 'index'.
2646 2006-01-19 Akim Demaille <akim@epita.fr>
2648 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2649 location, not just parts of it.
2651 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2653 * NEWS: Document the fact that multiple %unions are now allowed.
2654 * doc/bison.texinfo (Union Decl): Likewise.
2655 * TODO: This feature is now implemented, so remove it from
2658 * Makefile.maint: Merge with coreutils Makefile.maint.
2659 (CVS_LIST): Use build-aux version if available.
2660 (VERSION_REGEXP): New macro.
2661 (syntax-check-rules): Add sc_no_if_have_config_h,
2662 sc_prohibit_assert_without_use, sc_require_config_h,
2663 sc_useless_cpp_parens.
2664 (sc_obsolete_symbols): Check for O_NDELAY.
2665 (sc_dd_max_sym_length): Track coreutils.
2666 (sc_unmarked_diagnostics): Look in all files, not just *.c.
2667 (sc_useless_cpp_parens): New rule.
2668 (news-date-check): Look for version or today's date.
2669 (changelog-check): Don't require version number near head.
2670 (copyright-check): Use current year instead of hardwiring 2005.
2671 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
2672 (announcement): Add --gpg-key-ID.
2674 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2677 Avoid undefined behavior that addressed just before the start of an
2678 array. Problem reported by twlevo.
2679 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2680 * src/lalr.c (build_relations): Rely on new sentinel.
2681 * src/gram.c (gram_free): Adjust to new sentinel.
2683 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2685 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2686 yylookaheadNeeds. All uses updated.
2687 (yysplitStack): Rename local yynewLookaheadStatuses to
2688 yynewLookaheadNeeds.
2689 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2690 GLR): In comments, change `lookahead status' to `lookahead need'.
2692 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2694 * data/glr.c (yysplitStack): A little stylistic rewrite.
2696 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2698 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2700 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2702 * doc/bison.texinfo: Fix some typos.
2703 (GLR Semantic Actions): New subsection discussing special
2704 considerations because GLR semantic actions might be deferred.
2705 (Actions): Mention look-ahead usage of yylval.
2706 (Actions and Locations): Mention look-ahead usage of yylloc.
2707 (Special Features for Use in Actions): Add YYEOF entry and mention it
2708 in the yychar entry.
2709 In the yychar entry, remove mention of the local yychar case (pure
2710 parser) since this is irrelevant information when writing semantic
2711 actions and since it's already discussed in `Bison Symbols' where
2712 yychar is otherwise described as an external variable.
2713 In the yychar entry, don't call it the `current' look-ahead since it
2714 isn't when semantic actions are deferred.
2715 In the yychar and yyclearin entries, add note about deferred semantic
2717 Add yylloc and yylval entries discussing look-ahead usage.
2718 (Look-Ahead Tokens): When discussing yychar, don't call it the
2719 `current' look-ahead, and do mention yylval and yylloc.
2720 (Error Recovery): Cross-reference `Action Features' when mentioning
2722 (Bison Symbols): In the yychar entry, don't call it the `current'
2724 In the yylloc and yylval entries, mention look-ahead usage.
2726 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2728 * tests/glr-regression.at: Update copyright year to 2006.
2730 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2732 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2733 use during nondeterministic operation to track which stacks have
2734 actually needed the current lookahead.
2735 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2736 Allocate, deallocate, resize, and otherwise shuffle space for
2737 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2738 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2739 appropriately during nondeterministic operation.
2740 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2741 members to store the current lookahead to be used by the deferred
2743 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2744 from which the RHS is taken. Set the lookahead members of the new
2745 yySemanticOption according to the lookahead status for stack yyk.
2746 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2747 yyaddDeferredAction.
2748 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2749 members of yySemanticOption before invoking yyuserAction, and then set
2750 them back to their current values afterward.
2751 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2752 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2753 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2754 titles for consistency.
2755 (Leaked merged semantic value if user action cuts parse): In order to
2756 suppress lint warnings, use arguments in merge function, and assign
2757 char value < 128 in main.
2758 (Incorrect lookahead during deterministic GLR): New test case.
2759 (Incorrect lookahead during nondeterministic GLR): New test case.
2761 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2763 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
2764 !yyvaluep as signal that no semantic value is available to print.
2765 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2766 to print a semantic value.
2768 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2770 * tests/glr-regression.at: For consistency with my newer test cases,
2773 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2775 * data/glr.c (yyresolveValue): When merging semantic options, if at
2776 least one user action succeeds but a later one cuts the parse, then
2777 destroy the semantic value before returning rather than leaking it.
2778 (yyresolveStates): If a user action cuts the parse and thus
2779 yyresolveValue fails, ignore the (unset) semantic value rather than
2780 corrupting the yyGLRState, and empty the semantic options list since
2781 the user actions should have called all necessary destructors.
2782 Simplify code with YYCHK.
2783 * tests/glr-regression.at (Corrupted semantic options if user action
2784 cuts parse): New test case.
2785 (Undesirable destructors if user action cuts parse): New test case.
2786 Before applying any of this patch, this test case never actually failed
2787 for me... but only because the corrupted semantic options usually
2789 (Leaked merged semantic value if user action cuts parse): New test
2792 2006-01-05 Akim Demaille <akim@epita.fr>
2794 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2796 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2798 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2799 _MSC_VER. Problem reported by Cenzato Marco.
2800 (b4_c_function_def): Use it.
2801 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2803 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2804 than rolling our own.
2806 2006-01-04 Akim Demaille <akim@epita.fr>
2808 Also warn about non-used mid-rule values.
2809 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2811 (symbol_list_new): Adjust.
2812 * src/reader.c (symbol_typed_p): New.
2813 (grammar_rule_check): Use it.
2814 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2816 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2818 * tests/actions.at (Exotic Dollars): Adjust.
2820 2006-01-04 Akim Demaille <akim@epita.fr>
2822 * src/reader.c (grammar_midrule_action): If $$ is set in a
2823 mid-rule, move the `used' bit to its lhs.
2824 * tests/input.at (Unused values): New.
2825 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2827 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2829 * doc/bison.texinfo (Bison Options): Say more accurately what
2831 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2832 about declarations in the grammar when in Yacc mode, as POSIX does
2833 not require a diagnostic when the grammar uses extensions.
2835 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2837 Warn about dubious constructions like "%token T T".
2839 * src/symtab.h (struct symbol.declared): New member.
2840 * src/symtab.c (symbol_new): Initialize it to false.
2841 (symbol_class_set): New arg DECLARING, specifying whether
2842 this is a declaration that we want to warn about, if there
2843 is more than one of them. All uses changed.
2845 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
2846 Allow multiple %union directives, whose contents concatenate.
2847 * src/parse-gram.y (grammar_declaration): Likewise.
2848 Use muscle_code_grow, so that we don't need stype_line any more.
2851 * src/muscle_tab.c (muscle_grow): Fix comment.
2853 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
2854 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
2855 Update copyright year to 2006.
2857 2006-01-03 Akim Demaille <akim@epita.fr>
2859 Have glr.cc pass (some of) the calc.at tests.
2860 * data/glr.cc (b4_parse_param_orig): New.
2861 (b4_parse_param): Improve its definition, and bound it more
2862 clearly in the skeleton.
2863 (b4_epilogue): Append, instead of prepending, in order to keep
2865 Simplify the generation of auxiliary functions: locations and
2866 purity are mandated.
2867 (b4_global_tokens_and_yystype): Honor it.
2868 * data/location.cc (c++.m4): Don't include it.
2869 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
2871 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2873 Be sure to initialize the first position's filename.
2874 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2876 (AT_CHECK_CALC_GLR_CC): New.
2877 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2879 2006-01-02 Akim Demaille <akim@epita.fr>
2881 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2883 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
2884 * data/glr.cc: Do not include stack.hh.
2886 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2888 * data/glr.c: Reformat whitespace with tabs.
2889 (b4_lpure_formals): Remove this unused m4 macro.
2890 * tests/cxx-type.at: Reformat whitespace with tabs.
2891 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
2892 since it's a member. Rename type to isNterm for clarity.
2894 2005-12-29 Akim <akim@sulaco.local>
2896 Let glr.cc catch up with symbol_value_print.
2897 * data/glr.cc (b4_yysymprint_generate): Replace by...
2898 (b4_yy_symbol_print_generate): this.
2899 (yy_symbol_print, yy_symbol_value_print): Declare them.
2901 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2903 * src/location.h (boundary): Note that a line or column equal
2904 to INT_MAX indicates an overflow.
2905 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
2906 (rule_length_overflow, increment_rule_length, add_column_width):
2908 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
2909 (<SC_BRACED_CODE>"}"):
2910 Use increment_rule_length rather than incrementing it by hand.
2911 (adjust_location, handle_syncline): Diagnose overflow.
2912 (handle_action_dollar, handle_action_at):
2913 Fix bug with monstrosities like $-2147483648.
2914 Remove now-unnecessary checks.
2915 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2916 (convert_ucn_to_byte): Verify assumptions.
2917 (handle_syncline): New arg LOC. All callers changed.
2918 Don't store through a value derived from char const * pointer.
2920 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2923 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2925 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2926 Remove unnecessary forward static decls.
2928 2005-12-27 Akim Demaille <akim@epita.fr>
2930 * src/reader.c (grammar_current_rule_check): Also check that $$
2932 Take the rule to check as argument, hence rename as...
2933 (grammar_rule_check): this.
2934 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2936 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2937 (grammar_midrule_action, grammar_symbol_append): Now static.
2938 * tests/torture.at (input): Don't rely on the default action
2939 being always performed.
2940 * tests/calc.at: "Set" $$ even when the action is "cut" with
2942 * tests/actions.at (Exotic Dollars): Instead of using unused
2943 values, check that the warning is issued.
2945 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2947 * NEWS: Improve wording for unused-value warnings.
2949 2005-12-22 Akim Demaille <akim@epita.fr>
2951 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2952 (b4_yysymprint_generate): Rename as...
2953 (b4_yy_symbol_print_generate): this.
2954 Generate yy_symbol_print instead of yysymprint.
2955 Generate also yy_symbol_value_print, and use it.
2957 2005-12-22 Akim Demaille <akim@epita.fr>
2959 * NEWS: Warn about unused values.
2960 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2962 (symbol_list_n_get, symbol_list_n_used_set): New.
2963 (symbol_list_n_type_name_get): Use symbol_list_n_get.
2964 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
2965 * src/reader.c (grammar_current_rule_check): Check that values are
2967 * src/symtab.c (symbol_print): Accept 0.
2968 * tests/existing.at: Remove the type information.
2970 Remove useless actions (beware of mid-rule actions: perl -000
2971 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
2972 * tests/actions.at (Exotic Dollars): Use unused values.
2973 * tests/calc.at: Likewise.
2974 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2977 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
2980 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
2982 Undo 2005-12-01 tentative license wording change. The wording is
2983 still being reviewed by the lawyers, and we don't want to wait for
2984 them before publishing a test release. For now, revert to the
2986 * NEWS: Undo 2005-12-01 change.
2987 * data/glr.c: Revert to previous license wording.
2988 * data/glr.cc: Likewise.
2989 * data/lalr1.cc: Likewise.
2990 * data/location.cc: Likewise.
2991 * data/yacc.c: Likewise.
2993 * NEWS: Reword %destructor vs YYABORT etc.
2994 * data/glr.c: Use American spacing, for consistency.
2995 * data/glr.cc: Likewise.
2996 * data/lalr1.cc: Likewise.
2997 * data/yacc.c: Likewise.
2998 * data/yacc.c: Reformat comments slightly.
2999 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3000 for consistency. Fix some spelling errors and reword recently-included
3002 * tests/cxx-type.at: Cast results of malloc, for C++.
3004 2005-12-21 Joel E. Denny <address@hidden>
3006 * tests/cxx-type.at: Construct a tree, count the parents of shared
3007 nodes, and free each node once and only once. Previously, the memory
3008 for semantic values was leaked instead.
3010 2005-12-21 Joel E. Denny <address@hidden>
3012 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3013 (yylval, yylloc): If pure, #define to yystackp->yyval and
3014 yystackp->yyloc similar to yychar and yynerrs.
3015 (yyparse): If pure, remove local yylval and yylloc. Add local
3016 yystackp to accommodate pure definitions of yylval and yylloc.
3017 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3018 yylvalp and yyllocp to &yylval and &yylloc.
3019 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3020 namespace. Previously, nerrs and char were missing, but lval and lloc
3022 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3023 yylvalp and yyllocp parameters since, if pure, these are now always
3024 accessible through yystackp. If not pure, they are still accessible
3026 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3027 `if (YYID (N))' to pacify lint.
3029 2005-12-21 Akim Demaille <akim@epita.fr>
3031 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3032 destroy the RHS symbols of a rule.
3033 * data/yacc.c (yylen): Initialize to 0.
3034 Keep its value to the number of items to possibly shift.
3035 In particular, a regular successful parse that ends on YYFINAL by
3036 a (internal) YYACCEPT must not have yylen != 0.
3037 (yyerrorlab, yyreturn): Pop the RHS.
3038 Reorder a bit to emphasize the `shifting' bits of code.
3039 (YYPOPSTACK): Now accept a number of items to pop.
3040 * data/lalr1.cc: Likewise.
3041 * data/glr.c: Formatting changes.
3042 Use goto instead of fall through.
3043 * doc/bison.texinfo (Destructor Decl): Complete.
3045 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3047 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3048 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3049 * djgpp/config.bat: Replace every occurence of the file name
3050 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3051 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3052 * djgpp/config.sed: Replace every occurence of the file name
3053 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3054 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3055 * djgpp/djunpack.bat: DJGPP specific file.
3056 * djgpp/fnchange.lst: DJGPP specific file.
3057 * djgpp/README.in: Add new information about how to unpack the bison
3058 source on MSDOS and other systems which have 8.3 file name restrictions
3059 using djunpack.bat and fnchange.lst.
3061 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3063 * bootstrap (build_cvs_prefix): Remove; unused.
3064 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3065 when getting gnulib.
3067 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3069 * data/glr.c: Reorder typedef declarations for structs to match order
3070 of struct declarations.
3071 Rename yystack everywhere to yystackp except in yyparse where it's not
3073 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3075 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3076 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3077 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3080 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3082 * tests/sets.at (Accept): Fix typos in regular expression used to
3083 sed out the final state number.
3085 Work around portability problem on Solaris 10: flex-generated
3086 files include <stdio.h> before <config.h>, which messes up
3087 because the latter defines __EXTENSIONS__. Address the problem
3088 by creating two new little files that include <config.h> first,
3089 then include the flex-generated files. Rewrite everyone else
3090 to include <config.h> first, as well.
3091 * lib/timevar.c: Always include "config.h".
3092 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3093 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3094 (EXTRA_bison_SOURCES): New macro.
3095 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3096 * src/system.h: Don't include config.h.
3097 * src/LR0.c: Include <config.h> first.
3098 * src/assoc.c: Likewise.
3099 * src/closure.c: Likewise.
3100 * src/complain.c: Likewise.
3101 * src/conflicts.c: Likewise.
3102 * src/derives.c: Likewise.
3103 * src/files.c: Likewise.
3104 * src/getargs.c: Likewise.
3105 * src/gram.c: Likewise.
3106 * src/lalr.c: Likewise.
3107 * src/location.c: Likewise.
3108 * src/main.c: Likewise.
3109 * src/muscle_tab.c: Likewise.
3110 * src/nullable.c: Likewise.
3111 * src/output.c: Likewise.
3112 * src/parse-gram.y: Likewise.
3113 * src/print.c: Likewise.
3114 * src/print_graph.c: Likewise.
3115 * src/reader.c: Likewise.
3116 * src/reduce.c: Likewise.
3117 * src/relation.c: Likewise.
3118 * src/state.c: Likewise.
3119 * src/symlist.c: Likewise.
3120 * src/symtab.c: Likewise.
3121 * src/tables.c: Likewise.
3122 * src/uniqstr.c: Likewise.
3123 * src/vcg.c: Likewise.
3125 * src/parse-gram.y: Fix minor problems uncovered by lint.
3126 (current_lhs, current_lhs_location): Now static.
3127 (current_assoc): Remove unused variable.
3129 Cleanups so that Bison-generated parsers have less lint.
3130 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3131 Prepend /*ARGSUSED*/, for lint's sake.
3132 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3133 definition if 'lint' is defined.
3134 (YYID): New macro (or function, if lint).
3135 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3136 * data/yacc.c: Likewise.
3137 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3138 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3139 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3141 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3142 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3143 Use YYID(0) rather than 0, for lint.
3144 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3145 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3147 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3149 * tests/glr-regression.at
3150 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3151 Close memory leak reported by twlevo.
3153 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3155 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3157 (yyparse): Iterate another stack in order to call user destructors.
3158 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3160 (Duplicated user destructor for lookahead): This test now is expected
3163 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3165 * NEWS: Document the following change.
3166 * data/yacc.c: Say "parser skeleton" rather than "file", since
3167 it's no longer just a file.
3168 * data/glr.c: Grant a special exception for C GLR parsers, that
3169 reads like the already-existing exception for C LALR(1) parsers.
3170 * data/glr.cc: Likewise.
3171 * data/lalr1.cc: Likewise.
3172 * data/location.cc: Likewise.
3173 * data/yacc.c: Reword the "written by" statement to clarify that
3174 it was the parser skeleton, not the entire output file.
3175 * data/glr.c: Written by Paul Hilfinger.
3176 * data/glr.cc: Written by Akim Demaille.
3177 * data/lalr1.cc: Likewise.
3179 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3181 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3182 Fix typos in previous change that broke 'make check'.
3183 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3185 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3186 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3187 We can revert this once things settle down.
3189 * src/conflicts.c (conflicts_print): Don't print file name twice
3190 when %expect fails because there were no conflicts.
3191 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3193 * tests/conflicts.at (%expect not enough, %expect too much):
3194 (%expect with reduce conflicts): Adjust to new behavior.
3196 2005-11-18 Akim Demaille <akim@epita.fr>
3198 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3200 * NEWS: Document this.
3201 * doc/bison.texinfo (Expect Decl): Likewise.
3203 2005-11-16 Akim Demaille <akim@epita.fr>
3205 Generalize the display of semantic values and locations in traces.
3206 * data/glr.c (yy_reduce_print): Fix indices (again).
3207 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3209 * data/lalr1.cc (yyreduce_print): Rename as...
3210 (yy_reduce_print): this.
3211 Display values and locations.
3212 * data/yacc.c (yy_reduce_print): Likewise.
3213 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3214 (yysymprint): Move higher to be visible from yy_reduce_print).
3216 * tests/calc.at: Adjust the expected length of the traces.
3218 2005-11-14 Akim Demaille <akim@epita.fr>
3220 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3221 from 1 to N, while values and location start at 0.
3222 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3224 2005-11-14 Akim Demaille <akim@epita.fr>
3226 * data/glr.c (yy_reduce_print): Fix the $ number.
3228 2005-11-14 Akim Demaille <akim@epita.fr>
3230 "Use" parse parameters.
3231 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3232 * data/glr.c, data/glr.cc: Use them.
3233 * data/glr.c (YYUSE): Have a C++ definition that supports
3236 2005-11-14 Akim Demaille <akim@epita.fr>
3238 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3240 2005-11-14 Akim Demaille <akim@epita.fr>
3243 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
3245 2005-11-12 Akim Demaille <akim@epita.fr>
3247 Let position and location be PODs.
3248 * data/location.cc (position::initialize, location::initialize): New.
3249 (position::position, location::location): Define only if
3250 b4_location_constructors is defined.
3251 * data/lalr1.cc (b4_location_constructors): Define it for backward
3253 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3255 2005-11-12 Akim Demaille <akim@epita.fr>
3257 * data/lalr1.cc: Move the body of the ctor and dtor into the
3258 parser file (instead of the header).
3259 Wrap the implementations in a "namespace yy".
3261 2005-11-12 Akim Demaille <akim@epita.fr>
3263 Have glr.c include its header file when created.
3264 * data/glr.c (b4_shared_declarations): New.
3265 Output them verbatim in the parser if !%defines, otherwise
3266 output then in the header file, and include it instead.
3268 2005-11-11 Akim Demaille <akim@epita.fr>
3270 * data/glr.c: Comment changes.
3272 2005-11-11 Akim Demaille <akim@epita.fr>
3274 When yydebug, report semantic and location values for reductions.
3275 * data/glr.c (yy_reduce_print): Report the semantic values and the
3277 (YY_REDUCE_PRINT): Adjust.
3278 (yyglrReduce): Use them.
3279 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3280 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3281 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3284 2005-11-10 Akim Demaille <akim@epita.fr>
3286 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3287 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3288 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3290 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3292 * m4/cxx.m4, examples/Makefile.am: Don't build
3293 examples/calc++ if no C++ compiler is available. (trivial change)
3295 2005-11-09 Akim Demaille <akim@epita.fr>
3297 * src/scan-skel.l: Use a couple of asserts.
3299 2005-11-03 Akim Demaille <akim@epita.fr>
3301 In some (weird) cases, the final state number is incorrect.
3302 Reported by Alexandre Duret-Lutz.
3303 * src/LR0.c (state_list_append): Remove the computation of
3305 (save_reductions): Do it here.
3306 (get_state): Alpha conversion.
3307 (generate_states): Use a for loop.
3308 * src/gram.h (item_number_is_rule_number)
3309 (item_number_is_symbol_number): New.
3310 * src/state.c: Use assert.
3311 * src/system.h: Include assert.h.
3312 * tests/sets.at (Accept): New.
3314 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3316 * data/glr.c (yyfill): Adjust comment.
3317 (yyresolveAction): Initialize default location properly
3318 for empty right-hand sides.
3319 (yydoAction): Ditto.
3320 Add comment explaining apparently dead code.
3321 * tests/glr-regression.at
3322 (Incorrectly initialized location for empty right-hand side in GLR):
3325 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3327 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3328 gnulib when interrupted. This fixes some race conditions and
3329 works around some portability problems (one noted by Paul
3332 2005-10-22 Akim <akim@epita.fr>
3334 * Makefile.cfg: Adjust to config -> build-aux.
3337 2005-10-21 Akim Demaille <akim@epita.fr>
3339 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3341 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3342 * data/yacc.c (b4_Pure_if): Rename as...
3343 (b4_yacc_pure_if): this.
3344 (YY_SYMBOL_PRINT, yyparse): Adjust.
3345 * doc/bison.texinfo: Formatting changes.
3347 2005-10-21 Akim Demaille <akim@epita.fr>
3349 Finish the transition config -> build-aux.
3350 * configure.ac, Makefile.am: Use build-aux.
3351 * config/prev-version, config/announce-gen, config/Makefile.am:
3353 * build-aux/prev-version, build-aux/announce-gen,
3354 * build-aux/Makefile.am: here.
3356 2005-10-14 Akim Demaille <akim@epita.fr>
3358 * examples/calc++/test: Use set -x only when VERBOSE.
3360 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3362 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3363 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3365 2005-10-13 Akim Demaille <akim@epita.fr>
3367 * src/scan-skel.l: Output the base name parts of the parser and
3369 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
3371 Use this to exercise C++ outputs in subdirs.
3372 Reported by Oleg Smolsky.
3374 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3376 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3377 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3378 Problem reported by John P. Hartmann.
3379 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3382 2005-10-12 Akim Demaille <akim@epita.fr>
3384 * src/parse-gram.y (version_check): Exit 63 to please missing
3385 (stands for "version mismatch).
3386 * tests/input.at, doc/bison.texinfo: Adjust.
3388 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3390 Work around portability problems with Visual Age C compiler
3391 (xlc and xlC_r) reported by John P. Hartmann.
3392 * data/location.cc (initial_column, initial_line): Remove.
3393 All uses replaced by 0 and 1.
3394 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3395 that xlc complains about.
3396 * src/scan-skel.l (skel_wrap): Likewise.
3397 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
3399 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3400 __STDC_VERSION__. Use it everywhere instead of looking at
3401 __STDC__ and __cplusplus.
3403 2005-10-10 Akim Demaille <akim@epita.fr>
3405 * examples/calc++/test: Be quiet unless VERBOSE.
3407 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3409 * data/c.m4 (yydestruct, yysymprint):
3410 Use YYUSE instead of casting to void.
3411 * data/glr.c (YYUSE): New macro.
3412 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3413 Use it instead of rolling our own.
3414 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3416 Use /*CONSTCOND*/ to suppress lint warnings.
3417 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3418 (YY_STACK_PRINT): Use 'false' not '0'.
3420 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3421 * data/yacc.c (YYUSE): New macro.
3422 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3423 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3424 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3427 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3428 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3430 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3432 Undo the parts of the unlocked-I/O change that substituted
3433 putc or puts for printf. This might hurt performance a bit,
3434 but some people prefer the printf style.
3435 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3436 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3437 All uses replaced by YYFPRINTF and YYDPRINTF.
3438 * data/yacc.c: Likewise.
3439 * lib/bitset.c (bitset_print): Likewise.
3440 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3442 * lib/lbitset.c (debug_lbitset): Likewise.
3443 * src/closure.c (print_firsts, print_fderives): Likewise.
3444 * src/gram.c (grammar_dump): Likewise.
3445 * src/lalr.c (look_ahead_tokens_print): Likewise.
3446 * src/output.c (escaped_output): Likewise.
3447 (user_actions_output): Break apart two printfs.
3448 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3449 * src/reduce.c (reduce_print): Likewise.
3450 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3451 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3453 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3454 Use assignments rather than casts-to-void to suppress
3455 unused-variable warnings. This pacifies 'lint'.
3456 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3457 unused-variable warnings.
3459 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3461 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3463 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3465 Use unlocked I/O for a minor performance improvement on hosts like
3466 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3467 is to use the gnlib unlocked-io module, and to prefer putc and
3468 puts to printf when either will work (since the latter doesn't
3469 come in an unlocked flavor).
3470 * bootstrap (gnulib_modules): Add unlocked-io.
3471 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3472 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3473 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3474 and similarly for puts and putc and printf.
3475 * data/yacc.c: Likewise.
3476 * lib/bitset.c (bitset_print): Likewise.
3477 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3478 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3480 * lib/lbitset.c (debug_lbitset): Likewise.
3481 * src/closure.c (print_firsts, print_fderives): Likewise.
3482 * src/gram.c (grammar_dump): Likewise.
3483 * src/lalr.c (look_ahead_tokens_print): Likewise.
3484 * src/output.c (escaped_output): Likewise.
3485 (user_actions_output): Coalesce two printfs.
3486 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
3487 * src/reduce.c (reduce_print): Likewise.
3488 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3489 * src/system.h: Include unlocked-io.h rather than stdio.h.
3491 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3492 this confuses xgettext.
3494 2005-10-02 Akim Demaille <akim@epita.fr>
3496 * bootstrap (gnulib_modules): Add strverscmp.
3497 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3498 * m4/.cvsignore: Add strverscmp.m4.
3499 * src/parse-gram.y (%require): New token, new rule.
3500 (version_check): New.
3501 * src/scan-gram.l (%require): Adjust.
3502 * tests/input.at (AT_REQUIRE): New.
3504 * doc/bison.texinfo (Require Decl): New.
3505 (Calc++ Parser): Use %require.
3507 2005-10-02 Akim Demaille <akim@epita.fr>
3509 * data/location.cc: New.
3511 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3512 Akim Demaille <akim@epita.fr>
3514 Make sure -odir/foo.cc creates dir/location.hh etc.
3515 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3516 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3517 (spec_defines_file): Now const.
3519 (short_base_name): Remove.
3520 * src/files.c: Adjust.
3521 (dirname.h): Include.
3522 (base_name): Don't prototype it.
3523 (finput): Remove, duplicates gram_in.
3524 (full_base_name, short_base_name): Replace by...
3525 (all_but_ext, all_but_tab_ext): these.
3526 (compute_base_names): Rename as...
3527 (compute_file_name_parts): this.
3528 Update to compute the new variables, including dir_prefix.
3529 Adjust dependencies.
3530 * src/output.c (prepare): Output them.
3531 * src/reader.c: Adjust to use gram_in, not finput.
3532 * src/scan-skel.l (@dir_prefix@): New.
3534 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3536 * lib/subpipe.c: New function end_of_output_subpipe() added
3537 to allow support for non-posix systems. This is a no-op function
3540 * lib/subpipe.h: New function end_of_output_subpipe() added
3541 to allow support for non-posix systems. This is a no-op function
3544 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3545 handle the lack of pipe/fork functionality on non-posix systems.
3547 * djgpp/Makefile.maint: DJGPP specific file.
3549 * djgpp/README.in: DJGPP specific file.
3551 * djgpp/config.bat: DJGPP specific configuration file.
3553 * djgpp/config.sed: DJGPP specific configuration file.
3555 * djgpp/config.site: DJGPP specific configuration file.
3557 * djgpp/config_h.sed: DJGPP specific configuration file.
3559 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3561 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3563 2005-10-02 Akim Demaille <akim@epita.fr>
3565 * data/location.cc: New, extract from...
3566 * data/lalr1.cc: here.
3567 (location.hh): Include it after the user prologue, in case the
3568 filename type is defined by the user.
3569 Forward declation location and position before the pre-prologue.
3570 (yyresult_): Rename as...
3571 (yyresult): this, it's a local variable, not an attribute.
3572 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
3574 2005-10-01 Akim Demaille <akim@epita.fr>
3576 * examples/extexi: Restore the #line generation.
3578 2005-09-30 Akim Demaille <akim@epita.fr>,
3579 Alexandre Duret-Lutz <adl@gnu.org>
3581 Move the token type and YYSTYPE in the parser class.
3582 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
3583 (parser::token): New, from the moved free definition of tokens.
3584 (parser::semantic_value): Now a full definition instead of an
3585 indirection to YYSTYPE.
3586 (b4_post_prologue): No longer included in the header file, but
3587 in the implementation file.
3588 * doc/bison.texi (C+ Language Interface): Update.
3589 * src/parse-gram.y: Support unary %define.
3590 * tests/actions.at: Define global_tokens_and_yystype for backward
3591 compatibility until we update the tests.
3592 * tests/calc.at: Idem.
3593 (first_line, first_column, last_line, last_column): Define for lalr1.cc
3594 to simplify the code.
3596 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3598 Port to SunOS 4.1.4, which lacks strtoul and strerror.
3599 Ah, the good old days! Problem reported by Peter Klein.
3600 * bootstrap (gnulib_modules): Add strerror, strtoul.
3601 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
3602 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
3604 2005-09-29 Akim Demaille <akim@epita.fr>
3606 * data/c.m4 (b4_error_verbose_if): New.
3607 * data/lalr1.cc: Use it.
3608 (YYERROR_VERBOSE_IF): Remove.
3609 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
3610 parser members, replaced by...
3611 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
3613 (yysyntax_error_): Takes the state number as argument.
3614 (yyreduce_print_): Use the argument yyrule, not the former
3617 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3619 * bootstrap (gnulib_modules): Add verify.
3620 * lib/.cvsignore: Add verify.h.
3621 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
3622 * src/system.h (verify): Remove.
3623 Include verify.h instead.
3624 * src/tables.c (tables_generate): Use new API for 'verify'.
3626 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3628 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
3629 local variables whose names begin with 'yy'.
3630 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
3631 Trivial changes from Joel E. Denny.
3633 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3635 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3636 don't use alloca any more.
3638 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
3639 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
3640 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
3641 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
3642 to match yacc.c, to test more hosts.
3644 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3646 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
3647 doesn't affect behavior.
3648 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
3650 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
3651 This works a bit better with glibc, if user code has already included
3653 * doc/bison.texinfo (Bison Parser): Document that users can't
3654 arbitrarily use malloc and free for other purposes. Document
3655 that <alloca.h> and <malloc.h> might be included.
3656 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
3657 user must declare alloca.
3659 * HACKING (release): Forwarn the Translation Project about
3662 2005-09-20 Akim Demaille <akim@epita.fr>
3664 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3666 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3668 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
3669 (YYSTACK_ALLOC_MAXIMUM): Use it.
3670 (yysyntax_error): New function.
3671 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
3672 multiple syntax errors are reported, and alloca is being used.
3673 Instead, reallocate buffers twice as big each time, so that
3674 we waste at most half the allocated memory. Start with a small
3675 (128-byte) buffer that will suffice in most cases anyway.
3676 Use yysyntax_error to do most of the work.
3678 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3679 yynerrs is the number of errors reported, not the number of
3682 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3683 Mark it as expected to fail.
3684 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3685 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3686 Don't start user-code symbols with "yy", to avoid name space problems.
3688 2005-09-19 Akim Demaille <akim@epita.fr>
3690 Remove the traits, failed experiment.
3691 It never proved useful, and anyway because of the current
3692 definition, it was not possible to have several specialization of
3693 this traits, making it useless.
3694 * data/lalr1.cc (yy:traits): Remove.
3695 Inline its definitions in the parser class.
3697 2005-09-19 Akim Demaille <akim@epita.fr>
3699 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3700 least Mac OSX with a /usr/local install of gettext.
3702 2005-09-19 Akim Demaille <akim@epita.fr>
3704 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3705 and yytoken for similarity with the other skeletons.
3707 2005-09-19 Akim Demaille <akim@epita.fr>
3709 * NEWS, configure.ac: update version number to 2.1a.
3711 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3713 * NEWS: Version 2.1.
3715 * NEWS: Remove notice of yytname change, since it was never in an
3717 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3719 * src/output.c (prepare): Likewise.
3720 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3721 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3722 is not defined. This is an awful hack, but it's enough for now.
3723 All callers changed.
3724 * tests/glr-regression-at (make_value): Args are const pointers now,
3725 to avoid GCC warning.
3726 (Duplicated user destructor for lookahead): New test. Currently
3727 skipped. It fails on my host but I'm not sure it'll always fail.
3729 2005-09-16 Akim Demaille <akim@epita.fr>
3731 * src/symtab.h (struct symbol): Declare the printer and destructor
3732 as const, to avoid accidental calls to free.
3733 (symbol_destructor_set, symbol_printer_set): Adjust.
3734 * src/symtab.c: Adjust.
3736 2005-09-16 Akim Demaille <akim@epita.fr>
3738 * data/c.m4 (b4_token_enums): New.
3739 (b4_token_defines): Rename as...
3740 (b4_token_enums_defines): this.
3741 (b4_token_defines): New, output only the #defines.
3742 * data/yacc.c, data/glr.c: Adjust.
3743 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3744 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3747 2005-09-16 Akim Demaille <akim@epita.fr>
3749 * data/lalr1.cc (yylex_): Remove, inline its code.
3750 (yyreport_syntax_error_): Remove, replaced by...
3751 (yysyntax_error_): this which returns a string and leaves to the
3752 caller the call to the users' error function.
3753 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3754 Move from members of the parser object...
3755 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3756 to local variables of the parse function.
3758 2005-09-16 Akim Demaille <akim@epita.fr>
3760 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3761 since it's in Bison's name space.
3763 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3765 * data/glr.c (yyresolveValue): Add default case to pacify
3766 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3768 * NEWS: Document when yyparse started to return 2.
3769 * doc/bison.texinfo (Parser Function): Document when yyparse
3772 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3773 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3775 (class position): file_name -> filename (reverting). All uses changed.
3777 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3779 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3780 do anything if $@ exists. This reverts part of the 2005-07-07
3783 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3785 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3786 contains obsolete information and isn't worth distributing as a
3787 separate file anyway.
3788 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3789 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3790 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3791 (yyparse): Abort if user code uses longjmp to throw an unexpected
3794 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3796 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3797 Suggested by twlevo@xs4all.nl.
3799 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3800 This avoids a diagnostic from gcc -Wswitch-enum.
3801 Problem reported by twlevo@xs4all.nl.
3803 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3804 standards. Use "file name" or "file" or "name", depending on
3806 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3807 not to hack/foo.tab.c.
3808 (Calc++ Top Level): 2nd arg of main is not const.
3809 * data/glr.c: b4_filename -> b4_file_name.
3810 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3812 (class position): filename -> file_name. All uses changed.
3813 * data/yacc.c: b4_filename -> b4_file_name.
3814 * lib/bitset.h: filename -> file_name in local vars.
3815 * lib/bitset_stats.c: Likewise.
3816 * src/files.c: Likewise.
3817 * src/scan-skel.l ("@output ".*\n): Likewise.
3818 * src/files.c (file_name_split): Renamed from filename_split.
3819 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
3821 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3823 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3824 to accommodate latest gnulib.
3826 * tests/glr-regression.at (Duplicate representation of merged trees):
3827 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3829 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3832 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3834 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3835 All uses changed. Invoke user destructor after an error during a
3836 split parse (trivial change from Joel E. Denny).
3838 * tests/glr-regression.at
3839 (User destructor after an error during a split parse): New test case.
3840 Problem reported by Joel E. Denny in:
3841 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3843 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3845 * README-cvs: Give URLs for recommended tools.
3846 Mention Gzip version problem, and bootstrapping issues.
3847 Remove troubleshooting section, as it's somewhat obsolete.
3849 * bootstrap (no_cache): New var, to accommodate different wget
3850 variants. Use it instead of '-C off'. Problem reported by
3853 * data/glr.c (yydestroyStackItem): New function.
3854 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
3855 debugging information. Problem reported by Joel E. Denny.
3857 2005-08-25 Akim Demaille <akim@epita.fr>
3859 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3861 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3863 * data/glr.c (yyrecoverSyntaxError, yyreturn):
3864 Don't invoke destructor on unresolved entries.
3865 * tests/glr-regression.at
3866 (User destructor for unresolved GLR semantic value): New test case.
3867 Problem reported by Joel E. Denny in:
3868 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
3870 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3872 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3874 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3875 lib-prefix.m4, po.m4.
3877 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
3878 in yydestruct diagnostic, since it might not be an error.
3879 Problem reported by Joel Denny near end of
3880 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3881 * data/lalr1.cc (yyerturn): Likewise.
3882 * data/yacc.c (yyreturn): Likewise.
3883 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
3885 * src/files.c: Remove obsolete FIXME comment.
3887 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
3888 with the other templates, and to fix bogus run-on messages such
3889 as the one reported at the end of
3890 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3891 All callers changed to avoid the newline.
3892 (yyprocessOneStack): Output two lines rather than one, to accommodate
3893 the above change. This changes the debug output format slightly.
3895 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
3896 reported by Joel E. Denny in
3897 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
3899 * tests/glr-regression.at (Duplicate representation of merged trees):
3900 New test, from Joel E. Denny in:
3901 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
3902 * THANKS: Add Joel E. Denny.
3904 * configure.ac (AC_INIT): Bump to 2.0c.
3906 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3908 * NEWS: Version 2.0b.
3910 * Makefile.am (SUBDIRS): Put examples before tests, so that
3911 "make check" doesn't finish with "All 1 tests passed".
3913 * tests/regression.at (Token definitions): Don't rely on
3914 AT_PARSER_CHECK for data that contains backslashes. It currently
3915 uses 'echo', and 'echo' isn't portable if its argument contains
3916 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3917 that the byte '\0xff' is not printable in the C locale; it is,
3918 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3919 not printable, so use '\0x81' to test.
3921 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3922 version of GCC, since the macro is used with non-GCC compilers.
3924 Fix core dump reported by Pablo De Napoli in
3925 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3926 * tests/regression.at (Invalid inputs with {}): New test.
3927 * src/parse-gram.y (token_name): Translate type before using
3930 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3931 the user's name space. All uses changed to __attribute__
3933 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3934 Add __attribute__ ((__noreturn__)).
3936 * etc/clcommit: Remove. We weren't using it, and it failed
3937 "make maintainer-distcheck".
3938 * Makefile.maint: Merge from coreutils.
3939 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3940 (syntax-check-rules): Change list of rules as described below.
3941 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3942 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3943 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3944 (sc_trailing_space): New rules.
3945 (sc_xalloc_h_in_src): Remove.
3946 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3947 (sc_space_tab, sc_error_exit_success, sc_changelog):
3948 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3949 (makefile-check, po-check, author_mark_check):
3950 (makefile_path_separator_check, copyright-check):
3951 Use grep -n, to make it easier to find violations.
3952 Use CVS_LIST and CVS_LIST_EXCEPT.
3953 (header_regexp, h_re): Remove.
3955 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3956 (my-distcheck): Use more-modern GCC flags.
3957 (signatures, %.asc): Remove.
3958 (rel-files, announcement): Remove signatures.
3959 Restore old updating code, even though we don't use it, so
3960 that we're the same as coreutils.
3961 (alpha, beta, major): Depend on news-date-check.
3962 Make the upload commands.
3964 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
3965 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
3966 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
3967 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
3968 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
3969 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
3970 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
3971 * tests/sets.at: Likewise.
3973 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
3974 we comment out the Autoconf version number.
3975 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
3976 it's error-prone and "make maintainer-distcheck" rejects it.
3978 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
3979 Indent calls to "error" to pacify "make maintainer-distcheck",
3980 when the calls are not intended to be translated.
3981 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
3983 * src/Makefile.am (DEFS): Use +=, to pacify
3984 "make maintainer-distcheck".
3985 (bison_SOURCES): Add scan-skel.h.
3986 (sc_tight_scope): New rule, from coreutils.
3988 * src/files.c (src_extension, header_extension):
3989 Now static, not extern.
3990 * src/getargs.c (short_options): Likewise.
3991 * src/muscle_tab.c (muscle_table): Likewise.
3992 * src/parse-gram.y (current_class, current_type, current_prec):
3994 * src/reader.c (grammar_end, previous_rule_end): Likewise.
3995 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
3996 * src/main.c (main): Cast bindtextdomain and textdomain calls to
3997 void, to avoid warning when NLS is disabled.
3998 * src/output.c: Include scan-skel.h.
3999 (scan_skel): Remove decl, since scan-skel.h does this.
4001 Indent calls to "error" to pacify "make maintainer-distcheck".
4002 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4003 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4004 "make maintainer-distcheck".
4005 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4006 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4007 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4008 (skel_lex_destroy, scan_skel): Move these decls to...
4009 * src/scan-skel.h: New file.
4010 * src/uniqstr.c (uniqstr_assert):
4011 Indent calls to "error" to pacify "make maintainer-distcheck".
4013 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4016 * tests/torture.at: Revamp to avoid misuse of atoi that
4017 "make maintainer-distcheck" complained about.
4019 * examples/extexi (message): Don't print a message more than once,
4020 and omit line-number decoration that makes Emacs compile think
4021 that informative messages are worth worrying about.
4023 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4025 * configure.ac: Update version number.
4027 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4029 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4030 autogenerated by the maintainer.
4031 * examples/calc++/.cvsignore: Add *.yy.
4033 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4034 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4035 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4037 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4039 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4040 from maintainer-distcheck about casting the argument of 'free'.
4042 * NEWS: Mention recent yytname changes.
4043 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4045 * bootstrap: For translations that have not yet been upgraded to
4046 the new runtime-po domain, prime the pump by extracting the
4047 relevant strings from the obsolete translations. This code can be
4048 removed once the bison-runtime domain has been translated by each
4051 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4052 now that token names are already quoted.
4054 Fix problem reported by Anthony Heading.
4055 * data/glr.c (YYTOKEN_TABLE): New macro.
4056 (yytname): Define if YYTOKEN_TABLE.
4057 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4058 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4059 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4060 * src/output.c (prepare_symbols): Output token_table_flag.
4062 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4064 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4065 again if the first call fails.
4067 * data/glr.c (yytnamerr): New function.
4068 (yyreportSyntaxError): Use it to dequote most string literals.
4069 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4070 with other skeletons. All uses changed.
4071 (yytnameerr_): New function.
4072 (yyreport_syntax_error): Use it to dequote most string literals.
4073 * data/yacc.c (yytnamerr): New function.
4074 (yyerrlab): Use it to decode most string literals.
4075 * doc/bison.texinfo (Decl Summary, Calling Convention):
4076 Clarify quoting convention of yytname.
4077 * src/output.c (prepare_symbols): Quote all names. This undoes
4078 the 2005-04-17 change, which is now accomplished (mostly) via
4079 changes in the parsers as described above.
4080 * tests/regression.at (Token definitions, Web2c Actions):
4081 Undo most 2005-04-17 change here, too.
4083 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4085 Fix more problems reported by twlevo@xs4all.nl.
4086 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4087 remove trailing spaces. This loses the exit status of ./types,
4088 and isn't needed since ./types shouldn't be emitting trailing
4090 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4091 as the stack isn't valid in that case.
4093 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4094 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4095 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4096 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4098 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4099 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4100 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4103 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4104 overly-picky compilers that reject 'char *foo = "bar";'.
4106 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4107 to FILE * parameter, not to stderr. This fixes a typo introduced
4108 in the 2005-07-12 change.
4110 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4111 warnings from GCC 4.
4113 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4114 (yyglrShiftDefer, yysplitStack):
4115 Remove unused parameters b4_pure_formals. All uses changed.
4116 (yyglrShift): Remove unused parameters b4_user_formals.
4118 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4120 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4122 Destructor cleanups and regularization among the three skeletons.
4123 * NEWS: Document the behavior changes.
4124 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4125 stack before failing, as the cleanup code will do it for us now.
4126 * data/lalr1.cc (yyerrlab): Likewise.
4127 * data/glr.c (yyparse): Pop everything off the stack before
4128 freeing it, so that destructors get called properly.
4129 * data/lalr1.cc (yyreturn): Likewise.
4130 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4131 This is more consistent.
4132 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4133 why destructors might be called. 1.875 -> 2.1.
4134 (Destructor Decl, Decl Summary, Table of Symbols):
4135 Some English-language cleanups for %destructor.
4136 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4137 Add output line for destructor of start symbol.
4138 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4139 because of that same extra output line.
4141 * NEWS: Document minor wording changes in diagnostics of
4142 Bison-generated parsers.
4143 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4144 Remove unused formals. All uses changed.
4145 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4146 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4147 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4148 Rename yyoverflowab to yyexhaustedlab.
4149 When memory exhaustion occurs during syntax-error reporting,
4150 report it separately rather than in a single diagnostic; this
4152 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4153 (Memory Exhausted): Renamed from Parser Stack Overflow.
4154 Revamp wording slightly to prefer "memory exhaustion".
4155 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4157 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4159 Add i18n support to the GLR skeleton. Partially fix the C++
4160 skeleton; a C++ expert needs to finish this. Remove debugging
4161 msgids; there's little point to having them translated, since they
4162 can be understood only by someone who can read the
4163 (English-language) source code.
4165 Generate runtime-po/bison-runtime.pot automatically, so that we
4166 don't have to worry about garbage getting in that file. We'll
4167 make sure after the next official release that old msgids don't
4169 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4171 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4173 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4174 Fix typos in explanations of the runtime file.
4175 * bootstrap: Change gettext keyword from YYI18N to YY_.
4176 Use standard Makefile.in.in in runtime-po, since we'll arrange
4177 for backward-compatible bison-runtime.po files in a different way.
4178 * data/glr.c (YY_): New macro, from yacc.c.
4179 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4180 Translate messages intended for users.
4181 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4182 the wording in the other skeletons. We don't know that the memory
4184 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4185 Use same method that yacc.c uses.
4186 Don't translate debugging messages.
4187 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4188 it doesn't work (yet), and requires C++ expertise to fix.
4189 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4190 Move defn to a more logical place, to be consistent with other
4192 Don't translate debugging messages.
4193 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4194 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4195 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4196 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4198 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4199 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4201 * tests/glr-regression.at (Badly Collapsed GLR States):
4203 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4204 yylex should return 0 at EOF rather than aborting.
4206 Improve tests for stack overflow in GLR parser.
4207 Problem reported by twlevo@xs4all.nl.
4208 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4210 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4211 can handle the problem.
4212 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4213 (yyparse): New local variable yyresult to record the result.
4214 Use result of setjmp to set it, rather than storing itinto
4216 (yyDone): Remove label.
4217 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4218 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4219 if YYABORT is used).
4220 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4221 yyparse status; put status > 1 into diagnostic.
4222 Check that status==2 works.
4223 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4224 Use exit status 3 for failure to open (which shouldn't happen).
4226 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4228 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4229 1 on syntax error; just let yyparse do its thing.
4230 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4231 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4232 (Exploding the Stack Size with Alloca):
4233 (Exploding the Stack Size with Malloc):
4234 Expect exit status 2, not 1, since the parser is supposed to blow
4235 its stack. Problem reported by twlevo@xs4all.nl.
4237 * data/glr.c (yyparse): Don't assume that the initial calls
4238 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4239 Print a stack-overflow message and fail instead.
4240 Initialize the line-number information before creating the stack,
4241 so that the stack-overflow message can report line zero safely.
4243 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4245 Fix problems reported by twlevo@xs4all.nl.
4246 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4247 (yyuserMerge): Provide a default case if b4_mergers is empty.
4248 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4249 * tests/glr-regression.at
4250 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4251 Add casts to pacify C++ compilers.
4252 * tests/glr-regression.at (Improper merging of GLR delayed action
4253 sets): Declare yylex before using it.
4254 * tests/Makefile.am (maintainer-check-g++): Fix a stray
4255 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4256 test for valgrind; valgrind is independent of g++.
4257 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4258 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4259 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4260 Use a destructor, so that we can expand the stack. Change
4261 YYSTYPE to char * so that we can free it. Cast result of malloc.
4263 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4265 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4266 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4268 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4270 * PACKAGING: New file, suggested by Bruno Haible and taken from
4271 similar wording in gettext's PACKAGING file.
4272 * NEWS: Mention PACKAGING.
4273 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4275 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4277 * NEWS: Document recent i18n improvements.
4278 * bootstrap: Get runtime translations into runtime-po.
4279 Create runtime-po files automatically, if possible.
4280 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4281 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4282 does not infringe on the user's name space.
4283 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4284 * doc/bison.texinfo (Internationalization): Revamp the English
4285 and Texinfo syntax a bit, to try to make it clearer.
4286 (Bison Options, Option Cross Key): Mention --print-localedir.
4287 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4288 YYENABLE_NLS. Quote a bit more.
4289 * runtime-po/.cvsignore: New file.
4290 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4291 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4292 * runtime-po/quot.sed: Likewise.
4293 * runtime-po/boldquot.sed: Likewise.
4294 * runtime-po/en@quot.header: Likewise.
4295 * runtime-po/en@boldquot.header: Likewise.
4296 * runtime-po/insert-header.sin: Likewise.
4297 * runtime-po/remove-potcdate.sin: Likewise.
4298 * runtime-po/Makevars: Likewise.
4299 * runtime-po/LINGUAS: Likewise.
4300 * runtime-po/de.po: Likewise; we will rely on the translation project
4301 to maintain this, so "bootstrap" should get it.
4302 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
4304 * src/main.c (main): Bind the bison-runtime domain, too.
4306 2005-07-12 Bruno Haible <bruno@clisp.org>
4308 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4309 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4310 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4311 * runtime-po: New directory.
4312 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4313 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4314 * runtime-po/Rules-quot: New file, copied from po/.
4315 * runtime-po/quot.sed: Likewise.
4316 * runtime-po/boldquot.sed: Likewise.
4317 * runtime-po/en@quot.header: Likewise.
4318 * runtime-po/en@boldquot.header: Likewise.
4319 * runtime-po/insert-header.sin: Likewise.
4320 * runtime-po/remove-potcdate.sin: Likewise.
4321 * runtime-po/Makevars: New file.
4322 * runtime-po/POTFILES.in: New file.
4323 * runtime-po/LINGUAS: New file.
4324 * runtime-po/bison-runtime.pot: New file.
4325 * runtime-po/de.po: New file.
4326 * m4/bison.m4: New file.
4327 * Makefile.am (SUBDIRS): Add runtime-po.
4328 (aclocaldir, aclocal_DATA): New variables.
4329 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4331 * src/getargs.c (usage): Document --print-localedir option.
4332 (PRINT_LOCALEDIR_OPTION): New enum item.
4333 (long_options): Add --print-localedir option.
4334 (getargs): Handle --print-localedir option.
4335 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4336 (Internationalization): New section.
4338 2005-07-12 Akim Demaille <akim@epita.fr>
4340 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4341 for consistency with the rest of the code.
4342 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4345 2005-07-12 Akim Demaille <akim@epita.fr>
4347 * src/parse-gram.y: Use %printer instead of YYPRINT.
4349 2005-07-12 Akim Demaille <akim@epita.fr>
4351 * src/symtab.h, src/symtab.c (symbol_print): New.
4352 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4353 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4355 2005-07-12 Akim Demaille <akim@epita.fr>
4357 * data/glr.c (b4_syncline): Fix (swap) the definitions of
4358 b4_at_dollar and b4_dollar_dollar.
4360 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4362 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4363 and Pennello's paper.
4365 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4367 * data/yacc.c (yyparse): Undo previous patch. Instead,
4368 set yylsp[0] and yyvsp[0] only if the initial action
4369 sets yylloc and yylval, respectively.
4371 * data/yacc.c (yyparse): In the initial action, set
4372 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4373 This avoids the use of undefined variables if the initial
4374 action does not set yylloc and/or yylval.
4376 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4378 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4379 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4380 Remove from CVS. These files are automatically generated.
4381 * examples/extexi: Clarify that this file is now part of Bison,
4382 not GNU M4, and that it works with any POSIX-compatible Awk.
4383 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4384 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4385 so that we also get calc++-parser.yy. Geneate it.
4386 Use $(AWK), not gawk, since any conforming Awk will do.
4387 Put comment before action, since older 'make' can't handle comment
4389 $(BUILT_SOURCES): List all built sources, not just some of them.
4390 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4391 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4392 $($(calc_sources_generated)): Remove unnecessary test for existence
4393 of target. (This had a shell syntax error anyway; a stray "x".)
4394 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4396 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4398 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4399 implied by the other modules.
4401 2005-07-06 Akim Demaille <akim@epita.fr>
4403 Bind examples/calc++ to the package.
4404 * examples/calc++/Makefile: Remove, replaced by...
4405 * examples/calc++/Makefile.am: ... this new file.
4406 * examples/calc++/test: Remove input.
4407 * examples/calc++/compile: Remove.
4408 * examples/Makefile.am: New.
4409 * configure.ac, Makefile.am: Adjust.
4410 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4412 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4414 * data/glr.c (yyFail): Drastically simplify; since the format argument
4415 never had any % directives, we can simply pass it to yyerror.
4416 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4417 be modified later, as that is the usual style in glr.c.
4418 Problems reported by Paul Hilfinger.
4420 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4421 and size overflow errors.
4422 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4423 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4424 (YYSIZEMAX): New macro.
4425 (yystpcpy): New function, taken from yacc.c.
4426 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4427 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4428 so that we don't have to maintain their signatures.
4429 (yyFail): Check for buffer overflow, by using vsnprintf rather
4430 than vsprintf. Allocate a bigger buffer if possible.
4431 Report an error if buffer allocation fails.
4432 (yyStackOverflow): New function.
4433 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4434 the initialization was successful. It might fail if storage was
4436 (yyexpandGLRStack): Add more checks for storage allocation failure.
4437 Use yyStackOverflow to report failures.
4438 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4439 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4440 Don't assume stack number fits in int.
4441 (yysplitStack): Check for storage allocation failure.
4442 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4443 can print diagnostics on storage allocation failure. All callers
4445 (yyresolveValue): Use yybool for boolean.
4446 (yyreportSyntaxError): Check for size-calculation overflow.
4447 This code is taken from yacc.c.
4448 (yyparse): Check for storage allocation errors when allocating
4451 2005-07-05 Akim Demaille <akim@epita.fr>
4453 Extract calc++ from the documentation.
4454 * doc/bison.texinfo (Calc++): Add the extraction marks.
4455 * examples/extexi: New, from the aborted GNU Programming 2E.
4456 Separate the different paragraph of a file with empty lines.
4457 * examples/Makefile: Use it to extract the whole calc++ example.
4459 2005-06-24 Akim Demaille <akim@epita.fr>
4461 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4464 2005-06-22 Akim Demaille <akim@epita.fr>
4466 * doc/bison.texinfo (C++ Language Interface): First stab.
4467 (C++ Parsers): Remove.
4469 2005-06-22 Akim Demaille <akim@epita.fr>
4471 * data/lalr1.cc (yylex_): Honor %lex-param.
4473 2005-06-22 Akim Demaille <akim@epita.fr>
4475 Start a set of simple examples.
4476 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4477 * examples/calc++/calc++-driver.hh,
4478 * examples/calc++/calc++-parser.yy,
4479 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4480 * examples/calc++/compile, examples/calc++/test: New.
4482 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4484 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4485 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4486 which stems from the 2005-05-27 patch.
4488 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4490 * data/glr.c: Modify treatment of unused parameters to permit use
4491 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4493 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4495 Fix infringement on user name space reported by Janos Zoltan Szabo.
4496 * data/yacc.c (yyparse): strlen -> yystrlen.
4498 2005-05-30 Akim Demaille <akim@epita.fr>
4500 * data/lalr1.cc (_): New.
4501 Translate the various messages.
4503 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4505 Fix infringement on user name space reported by Bruno Haible.
4506 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4507 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4508 the user's name space.
4509 (alloca): Include <stdlib.h> to get it, if it's not built in.
4510 (YYMALLOC, YYFREE): Define only if needed.
4511 (malloc, free): Declare, but only if needed, as this infringes on
4512 the user name space.
4514 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4516 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4517 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4519 * lib/ebitset.c (min, max): Undef before defining.
4520 * lib/vbitset.c (min, max): Likewise.
4521 * lib/subpipe.c (create_subpipe): Save local variables in case
4522 vfork clobbers them.
4524 2005-05-24 Bruno Haible <bruno@clisp.org>
4526 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4527 error message syntax used by gcc-4.0.
4529 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4531 * README: Mention m4 1.4.3. Remove obsolete advice about
4532 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4534 * bootstrap: Remove workaround for problem I encountered with
4535 gettext 0.14.1; it seems to be fixed now.
4537 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4539 * NEWS: Version 2.0a.
4541 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4542 the previous change.
4544 Various maintainer cleanups.
4545 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4546 conftest*, for benefit of CVS commands run at the same time as
4547 "configure". Add build-aux, since "bootstrap" now creates it and
4549 * Makefile.cfg (move_if_change): Remove.
4550 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
4551 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
4552 (po_repo, do-po-update, po-update, wget_files, get-targets):
4553 (config.guess-url_prefix, config.sub-url_prefix):
4554 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
4555 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
4556 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
4558 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
4559 this is now the recommended name.
4560 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
4561 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
4562 ylwrap. These files now go into build-aux.
4563 * config/move-if-change: Remove.
4564 * config/prev-version.txt: Bump from 1.75 to 2.0.
4566 * bootstrap: Add stdio-safer, unistd-safer modules.
4567 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4569 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
4570 fopen-safer.c, stdio-safer.h, unistd-safer.h.
4571 * lib/subpipe.c: Include "unistd-safer.h".
4572 (create_subpipe): Make sure all the newly-created
4573 file descriptors are > 2, so that diagnostics don't
4574 get sent down them (which might cause Bison to hang, in theory).
4575 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
4576 * src/files.c (xfopen): Use fopen_safer, not fopen.
4578 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4579 yesterday's yacc.c fix.
4581 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4583 * data/glr.c, data/lalr1.cc: Update copyright date.
4585 Fix a destructor bug reported by Wolfgang Spraul in
4586 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
4587 * data/yacc.c (yyabortlab): Don't call destructor, and
4588 don't set yychar to EMPTY.
4589 (yyoverflowlab): Don't call destructor.
4590 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
4591 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
4592 since we no longer output the message "discarding lookahead token
4595 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4597 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
4598 fix a small glitch in debugging output.
4599 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
4600 after YY_SYMBOL_PRINT where needed.
4602 (struct yyGLRState): Add some comments.
4603 (struct yySemanticOption): Add some comments.
4604 (union yyGLRStackItem): Add comment.
4606 (yymergeOptionSets): Correct this to properly perform the union,
4607 avoiding infinite reported by Michael Rosien.
4610 * tests/glr-regression.at: Add test for GLR merging error reported
4613 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4615 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
4616 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
4617 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
4618 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
4619 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
4620 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
4621 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
4622 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
4623 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
4624 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
4625 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
4626 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
4627 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
4628 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
4629 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
4630 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
4631 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
4632 src/derives.h, src/files.c, src/files.h, src/getargs.c,
4633 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
4634 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
4635 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
4636 src/output.h, src/parse-gram.c, src/parse-gram.h,
4637 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
4638 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
4639 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
4640 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
4641 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
4642 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
4643 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
4644 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
4645 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
4646 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
4647 tests/reduce.at, tests/regression.at, tests/sets.at,
4648 tests/synclines.at, tests/testsuite.at, tests/torture.at:
4649 Update FSF postal mail address.
4651 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4653 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4654 Problem reported by Ralf Menzel.
4656 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4658 * tests/actions.at: Test that stack overflow invokes destructors.
4659 From Marcus Holland-Moritz.
4660 * data/yacc.c (yyerrlab): Move the code that destroys the stack
4662 (yyreturn): to here. That way, destructors are called properly
4663 even if the stack overflows, or the user calls YYACCEPT or
4664 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
4665 (yyoverflowlab): Destroy the lookahead.
4667 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4669 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4671 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4673 * NEWS: Bison-generated C parsers no longer quote literal strings
4674 associated with tokens.
4675 * src/output.c (prepare_symbols): Don't escape strings,
4676 since users don't want to see C escapes.
4677 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4679 * tests/input.at (Torturing the Scanner): Likewise.
4680 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4682 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4684 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4685 the data size is known to be too small and we can't increase it.
4686 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4688 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4690 * src/parse-gram.y: Include quotearg.h.
4691 (string_as_id): Quote $1 before using it as a key, since the
4692 lexer no longer quotes it for us.
4693 (string_content): Don't strip quotes, since lexer no longer
4695 * src/scan-gram.l: Include quotearg.h.
4697 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4698 a key, since the rest of the lexer doesn't quote it.
4699 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4700 * tests/regression.at (Token definitions): Check for backslashes
4703 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4704 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4705 (yyparse): Revamp code to generate long syntax error message, to
4706 make it easier to translate, and to avoid problems with arithmetic
4707 overflow. Change "virtual memory" to "memory" in diagnostic, since
4708 we don't know whether the memory is virtual.
4710 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4712 * NEWS: Bison-generated C parsers now use the _ macro to
4714 * data/yacc.c (_) [!defined _]: New macro.
4715 All English strings wrapped inside this macro.
4716 * doc/bison.texinfo (Bison Parser): Document _.
4717 * po/POTFILES.in: Include src/parse-gram.c, since it now
4718 includes translateable strings that parse-gram.y doesn't.
4720 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4722 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4723 reverting the 2004-10-11 change to this function.
4724 (symbol_check_alias_consistency): Don't call symbol_type_set
4725 if the type name is already correct.
4726 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4728 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4730 * tests/regression.at (Token definitions): Don't use a token named
4731 c, as that generates a "#define c ..." that runs afoul of buggy
4732 stdlib.h that uses the identifier c as a member of struct
4733 drand48_data. Problem reported by Horst Wente.
4735 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4737 * bootstrap: Change translation URL from
4738 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4739 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4740 redirection glitches. Problem reported by twlevo@xs4all.nl.
4742 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4744 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4745 after operands; POSIX says this isn't portable for the c99 command.
4747 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4749 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4750 immediately if a data overrun has occurred; this may help us track
4751 down what may be a spurious failure on MacOS.
4753 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4755 Respond to problems reported by twlevo@xs4all.nl.
4757 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4759 * src/vcg.h: Comment fix.
4760 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4761 (G_CMAX): Change to -1 instead of INT_MAX.
4763 * data/yacc.c (yyparse): Omit spaces before #line.
4765 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4767 * src/tables.c (state_number_to_vector_number): Put it inside an
4768 "#if 0", since it's not currently used. Problem reported by
4771 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4773 * src/output.c (escaped_output): Renamed from
4774 escaped_file_name_output, since we now use it for symbol tags as
4775 well. All uses changed.
4776 (symbol_destructors_output, symbol_printers_output):
4777 Escape symbol tags too.
4778 Problem reported by Matyas Forstner in
4779 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4781 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4783 * src/output.c (user_actions_output, token_definitions_output,
4784 symbol_destructors_output, symbol_printers_output): Likewise.
4785 * src/reader.c (prologue_augment): Likewise.
4786 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4788 * src/vcg.c (output_edge): Don't quote linestyle arg.
4789 Problem reported by twlevo@xs4all.nl.
4791 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4793 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4794 example, reported by Derek M Jones. Also, make the example even
4795 more outrageous, to better illustrate how bad the problem is.
4797 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4799 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4800 putsym. Typo reported by Sebastian Piping.
4802 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4804 * doc/bison.texinfo (Language and Grammar): some -> same
4805 (Epilogue): int he -> in the
4806 Typos reported by Sebastian Piping via Justin Pence.
4808 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4810 * tests/glr-regression.at (Improper handling of embedded actions
4811 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4812 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4813 with dollar signs in test names.
4814 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4815 for a similar reason.
4817 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4819 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4820 wants to redefine G_VIEW.
4822 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4824 * src/vcg.c (get_view_str): Remove case for normal_view.
4825 Problem reported by twlevo@xs4all.nl.
4827 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4829 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4830 Problem reported by twlevo@xs4all.nl.
4832 * doc/bison.texinfo: Change @dircategory from "GNU programming
4833 tools" to "Software development". Requested by Richard Stallman
4836 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4838 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4839 Problem reported by twlevo@xs4all.nl.
4841 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4843 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
4844 keyword; it's not needed with modern compilers, and it doesn't
4845 affect correctness with older compilers. Suggested by
4848 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4850 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
4851 gcc -Wswitch-default.
4852 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4853 * data/yacc.c (yyparse): Likewise.
4855 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4857 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4858 already. Let config.h define any nonstandard values.
4860 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4862 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4863 for the benefit of slower hosts. Problem reported by
4866 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4868 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
4869 being defined and not used.
4870 * data/lalr1.cc (yyparse): Likewise.
4871 Use "if (false)" rather than "if (0)".
4873 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4875 * TODO: Mention that we should allow NUL bytes in tokens.
4877 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4879 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4880 Problem reported by Hans Aberg.
4882 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4884 * src/getargs.c (version): Happy new year; update overall
4885 program copyright date from 2004 to 2005.
4887 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
4888 Problem reported by Hans Aberg.
4889 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
4890 (Output file names.): Add a test for the case when standard output
4893 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4895 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4896 to fix an oversight in the Bison 2.0 manual.
4898 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4900 * NEWS: Version 2.0. Reformat the existing news items since
4901 1.875, so that related items are grouped together.
4902 * configure.ac (AC_INIT): Bump version to 2.0.
4903 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
4905 * tests/torture.at (Exploding the Stack Size with Alloca): Set
4906 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
4907 otherwise, we're not testing alloca. Unfortunately there's no
4908 simple way to consult HAVE_ALLOCA here.
4910 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4913 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
4914 hand. This avoids a warning about comparing int to size_t when
4915 GCC warnings are enabled.
4917 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4919 * NEWS: Bison-generated parsers no longer default to using the
4920 alloca function (when available) to extend the parser stack, due
4921 to widespread problems in unchecked stack-overflow detection.
4922 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4923 responsibility to set it to a positive value. This lets the user
4924 specify a value that is not a preprocessor constant.
4925 * data/yacc.c (YYMAXDEPTH): Likewise.
4926 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4927 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4928 to be a compile-time constant. However, explain the constraints on it.
4929 Also, explain the constraints on YYINITDEPTH.
4930 (Table of Symbols): Explain that alloca is no longer the default.
4931 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4934 * doc/bison.texinfo (Location Default Action): Mention that n must
4935 be zero when k is zero. Suggested by Frank Heckenbach.
4937 2004-12-22 Akim Demaille <akim@epita.fr>
4939 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4940 (parser::state_type, parser::semantic_type, parser::location_type):
4941 Private, not public.
4942 (parser::parse): Return ints, not bool.
4943 Returning a bool introduces a problem: 0 corresponds to false, and
4944 it seems weird to return false on success. Returning true changes
4945 the conventions for yyparse.
4946 Alternatively we could return void and send an exception.
4947 There is no clear consensus (yet?).
4948 (state_stack, semantic_stack, location_stack): Rename as...
4949 (state_stack_type, semantic_stack_type, location_stack_type): these.
4950 Private, not public.
4951 * tests/c++.at: New.
4952 * tests/testsuite.at, tests/Makefile.am: Adjust.
4954 2004-12-21 Akim Demaille <akim@epita.fr>
4956 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4958 2004-12-21 Akim Demaille <akim@epita.fr>
4960 Don't impose std::string for filenames.
4962 * data/lalr1.cc (b4_filename_type): New.
4963 (position::filename): Use it.
4964 (parser.hh): Move the inclusion of stack.hh and location.hh below
4965 the user code, so that needed headers for the filename type can be
4967 Forward declare them before the user code.
4968 * tests/Makefile.am (check-local, installcheck-local): Pass
4969 TESTSUITEFLAGS to the TESTSUITE.
4971 2004-12-20 Akim Demaille <akim@epita.fr>
4973 Use more STL like names: my_class instead of MyClass.
4975 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
4976 (SemanticStack, SemanticType, StateStack, StateType)
4977 (TokenNumberType, Stack, Slice, Traits, Parser::location)
4978 (Parser::value): Rename as...
4979 (location_stack, location_type, rhs_number_type, semantic_stack)
4980 (semantic_type, state_stack, state_type, token_number_type, stack)
4981 (slice, traits, parser::yylloc, parser::yylval): these.
4983 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
4985 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4987 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
4988 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4990 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
4992 Remove uses of 'short int' and 'unsigned short int'. This raises
4993 some arbitrary limits. It uses more memory but nowadays that's
4994 not much of an issue.
4996 This change does not affect the generated parsers; that's a different
4997 task, as some users will want to conserve memory there.
4999 Ideally we should use size_t to represent all object counts, and
5000 something like ptrdiff_t to represent signed differences of object
5001 counts; but that will require more code-cleanup than I have the
5002 time to do right now.
5004 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5005 Use size_t, not int or short int, to count objects.
5006 * src/closure.c (nritemset, closure): Likewise.
5007 * src/closure.h (nritemset, closure): Likewise.
5008 * src/nullable.c (nullable_compute): Likewise.
5009 * src/print.c (print_core): Likewise.
5010 * src/print_graph.c (print_core): Likewise.
5011 * src/state.c (state_compare, state_hash): Likewise.
5012 * src/state.h (struct state): Likewise.
5013 * src/tables.c (default_goto, goto_actions): Likewise.
5015 * src/gram.h (rule_number, rule): Use int, not short int.
5016 * src/output.c (prepare_rules): Likewise.
5017 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5018 errs, reductions): Likewise.
5019 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5021 * src/tables.c (vector_number, tally, action_number,
5022 ACTION_NUMBER_MINIMUM): Likewise.
5023 * src/output.c (muscle_insert_short_int_table): Remove.
5025 2004-12-17 Akim Demaille <akim@epita.fr>
5027 * data/lalr1.cc: Extensive Doxygenation.
5028 (error_): Rename as...
5029 (error): this, since it is visible to the user.
5031 (Parser::message): Now an automatic variable from...
5032 (Parser::yyreport_syntax_error_): here.
5033 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5035 * tests/input.at: Escape $.
5037 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5039 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5040 Parenthesize rhs to avoid obscure problems with mistakes like
5041 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5042 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5043 b4_rhs_location): Likewise.
5044 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5045 b4_rhs_location): Likewise.
5047 2004-12-16 Akim Demaille <akim@epita.fr>
5049 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5050 yacc.c: be sure to stay within yycheck_.
5051 * tests/actions.at: Re-enable C++ tests.
5053 2004-12-16 Akim Demaille <akim@epita.fr>
5055 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5058 2004-12-16 Akim Demaille <akim@epita.fr>
5060 Use #define to handle the %name-prefix.
5062 * data/glr.c, data/yacc.c: Comment changes.
5063 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5064 so that one can refer to yylex in the parser file, and have it
5065 renamed, as is the case with other skeletons.
5067 2004-12-16 Akim Demaille <akim@epita.fr>
5069 Move lalr1.cc internals into yy*.
5071 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5072 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5073 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5074 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5075 (empty_, final_, terror_, errcode_, ntokens_)
5076 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5077 (looka_, ilooka_, error_range_, nerrs_):
5079 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5080 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5081 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5082 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5083 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5084 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5085 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5086 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5089 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5091 Fix some problems reported by twlevo at xs4all.
5092 * src/symtab.c (symbol_new): Report an error if the input grammar
5093 contains too many symbols. This is better than calling abort() later.
5094 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5095 (struct node, struct graph):
5096 Rename member expand to stretch. All uses changed.
5097 (struct graph): Remove member layoutalgorithm. All uses removed.
5098 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5099 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5101 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5103 2004-12-15 Akim Demaille <akim@epita.fr>
5105 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5106 Add more Doxygen comments.
5107 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5108 (report_syntax_error_, translate_): Rename as...
5109 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5110 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5112 2004-12-15 Akim Demaille <akim@epita.fr>
5114 * data/lalr1.cc (lex_): Rename as...
5116 Move the trace here.
5117 Take the %name-prefix into account.
5118 Reported by Alexandre Duret-Lutz.
5120 2004-12-15 Akim Demaille <akim@epita.fr>
5122 Simplify the C++ parser constructor.
5124 * data/lalr1.cc (debug_): Rename as...
5125 (yydebug_): so that the parser's internals are always in the yy*
5128 (b4_parse_param_decl): Remove the leading comma as it is now only
5129 called as unique argument list.
5130 (Parser::Parser): Remove the constructor accepting a location and
5131 an initial debugging level.
5132 Remove from the other ctor the argument for the debugging level.
5133 (debug_level_type, debug_level, set_debug_level): New.
5135 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5138 2004-12-15 Akim Demaille <akim@epita.fr>
5140 Remove b4_root related material: failure experiment
5141 (which goal was to allow to derive from a class).
5143 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5144 definitions and uses.
5146 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5148 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5149 not 2, since it's not portable to subtract 1 from the start of an
5150 array. The new item 0 is never set or used. All uses changed.
5152 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5153 the default definition of YYLLOC_DEFAULT. Problem reported
5154 by Frank Heckenbach.
5156 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5158 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5159 the normal case and one for the error case. Just use the
5160 first one uniformly. Problem reported by Frank Heckenbach.
5161 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5162 use exactly the same macro in both places.
5163 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5164 so that the normal-case YYRHSLOC works for the error case too.
5166 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5167 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5168 * doc/bison.texinfo (Location Default Action): Don't claim that
5169 we have an array of locations. Use the same macro for both glr
5170 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5173 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5175 * HACKING: Update email addresses to send announcements to.
5177 * configure.ac (AC_INIT): Bump version to 1.875f.
5179 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5181 * NEWS: Version 1.875e.
5182 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5184 * src/scan-skel.l: Include "complain.h", for "fatal".
5186 * src/relation.h (relation_print, relation_digraph):
5187 Relation sizes are of type relation_node, not size_t (this is
5188 merely a doc fix, since the two types are equivalent).
5189 (relation_transpose): Relation sizes are of type relation_node,
5191 * src/relation.c: Likewise.
5192 (top, infinity): Now of type relation_node, not int.
5193 (traverse, relation_transpose): Use relation_node, not int.
5195 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5196 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5197 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5199 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
5200 specifying whether the test should be skipped. Use it tp
5201 specify that the [%defines %skeleton "lalr1.cc"] tests currently
5202 fail on some hosts, and should be skipped.
5204 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5206 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5207 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5208 unless otherwise specified below.
5210 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5211 to allocate kernel_base, kernel_items, kernel_size, since
5212 they needn't be initialized to 0.
5213 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5214 * src/closure.c (new_closure): Likewise, for itemset.
5215 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5216 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5217 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5218 (build_relations): Likewise for edge, states1, includes.
5219 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5220 * src/reader.c (packgram): Likewise, for ritem, rules.
5221 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5222 * src/relation.c (relation_digraph): Likewise for VERTICES.
5223 (relation_transpose): Likewise for new_R, end_R.
5224 * src/symtab.c (symbols_token_translations_init): Likewise for
5226 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5227 (token_actions): Likewise for yydefact, actrow, conflrow,
5229 (save_column): Likewise for froms[symno], tos[symno].
5230 (goto_actions): Likewise for state_count.
5231 (pack_table): Likewise for base, pos, check.
5232 (tables_generate): Likewise for width.
5234 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5235 for initial core. Just have a separate core, so we needn't worry
5236 about whether kernel_size and kernel_base are initialized.
5238 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5239 kernel_size, kernel_items): Remove unnecessary initialization.
5240 * src/conflicts.c (conflicts): Likewise.
5241 * src/derives.c (derives): Likewise.
5242 * src/muscle_tablc (muscle_insert): Likewise.
5243 * src/relation.c (relation_digraph): Likewise.
5244 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5245 conflrow, conflict_table, conflict_list, table, check):
5248 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5249 This is because all callers pass unsigned int.
5250 * src/closure.h (new_closure): Likewise.
5252 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5253 (build_relations): Initialize includes[i] in all cases.
5254 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5255 and rules[ruleno].precsym. Initialize members in order.
5256 * src/relation.c (relation_transpose): Always initialize new_R[i]
5258 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5260 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5261 conflict_list[0] was always 0, but now it isn't initialized.
5263 * src/table.c (table_grow): When conflict_table grew, the grown
5264 area wasn't cleared. Fix this.
5266 * lib/.cvsignore: Add strdup.c, strdup.h.
5267 * m4/.cvsignore: Add strdup.m4.
5269 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5271 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5272 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5273 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5274 ngotos + 1 without checking for overflow.
5275 (build_relations): Use END_NODE, not -1, to denote end of edges.
5276 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5277 build_relations): Use goto_number, not int, for goto numbers.
5278 * src/tables.c (save_column, default_goto): Likewise.
5280 2004-11-23 Akim Demaille <akim@epita.fr>
5282 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5283 of #defining from yystype.
5284 Don't typedef yystype, C++ does not need it.
5285 This lets it possible to forward declare it as union.
5287 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5289 * bootstrap (gnulib_modules): Add extensions.
5290 Problem reported by Jim Meyering.
5292 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5294 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5295 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5296 src/system.h, src/tables.c: XFREE -> free, to accommodate
5297 recent change to gnulib xalloc.h.
5298 Problem reported by Jim Meyering.
5300 2004-11-17 Akim Demaille <akim@epita.fr>
5302 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5304 2004-11-17 Akim Demaille <akim@epita.fr>,
5305 Alexandre Duret-Lutz <adl@gnu.org>
5307 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5310 Use it instead of cdebug_.
5311 (Parser::debug_stream, Parser::set_debug_stream): New.
5312 (Parser::symprint_): Define cdebug_ for temporary backward
5314 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5317 2004-11-17 Akim Demaille <akim@epita.fr>
5319 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5320 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5321 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5322 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5324 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5326 * data/glr.c (yyloc_default): Remove; not used.
5327 Problem reported by Frank Heckenbach.
5329 2004-10-25 Akim Demaille <akim@epita.fr>
5331 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5332 Introduce another definition to address simple location arrays.
5333 (yyGLRStack): New member: yyerror_range.
5334 (yyrecoverSyntaxError, yyparse): Update it.
5335 (yyrecoverSyntaxError): Use it when shifting the error token to
5336 have an accurate range, equivalent to the one computed by both
5337 yacc.c and lalr1.cc.
5338 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5339 that column numbers start at column 0, as per GNU Coding
5340 Standards, the others tests, and the doc.
5341 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5342 Adjust to the above change (first column is 0).
5343 And adjust the location of the "<error>", now covering the whole
5346 2004-10-22 Akim Demaille <akim@epita.fr>
5347 and Paul Eggert <eggert@cs.ucla.edu>
5349 Remove some arbitrary limits on goto numbers and relations.
5350 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5351 initial values, since they're never used.
5352 (set_goto_map): ngotos is now unsigned, so test for overflow
5353 by seeing whether it wraps around to zero.
5354 * src/lalr.h (goto_number): Now size_t, not short int.
5355 (GOTO_NUMBER_MAXIMUM): Remove.
5356 * src/relation.c (relation_print, traverse, relation_transpose):
5357 Check for END_NODE rather than looking at sign.
5358 * src/relation.h (END_NODE): New macro.
5359 (relation_node): Now size_t, not short int.
5361 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5363 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5364 keyword, not an identifier. Problem reported by Baron Schwartz in
5365 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5367 2004-10-11 Akim Demaille <akim@epita.fr>
5369 * src/symtab.c (symbol_check_alias_consistency): Also check
5370 type names, destructors, and printers.
5371 Reported by Alexandre Duret-Lutz.
5372 Recode the handling of associativity and precedence in terms
5373 of symbol_precedence_set.
5374 Accept no redeclaration at all, not even equal to the previous
5376 (redeclaration): New.
5377 Use it to factor redeclaration complaints.
5378 (symbol_make_alias): Don't set the type of the alias, let
5379 symbol_check_alias_consistency do it as for other features.
5380 * src/symtab.h (symbol): Add new member prec_location, and
5382 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5383 * tests/input.at (Incompatible Aliases): New.
5385 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5387 .cvsignore fixes to accommodate gnulib changes,
5388 and the practice of naming build directories "_build".
5389 * .cvsignore: Add "_*". Sort.
5390 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5391 * m4/.cvsignore: Add "*_gl.m4".
5393 2004-10-06 Akim Demaille <akim@epita.fr>
5395 * src/parse-gram.y (add_param): Fix the truncation of trailing
5398 2004-10-05 Akim Demaille <akim@epita.fr>
5400 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5401 whether the reducion was empty or not. This leaves room to
5402 improve the use of YYLLOC_DEFAULT in such a case.
5403 lalr1.cc is still experimental, so changing this is acceptable.
5404 And finally, there are probably not many users who changed the
5405 handling of locations in GLR, so changing is admissible too.
5407 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5408 empty reduction, set @$ to an empty location ending the previously
5410 Adjust uses to make sure the code is triggered on empty
5412 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5413 expected output: empty reductions have empty locations.
5415 2004-09-29 Akim Demaille <akim@epita.fr>
5417 * data/lalr1.cc: Move towards a more standard C++ coding style
5418 for templates: Class < T > -> Class<T>.
5420 2004-09-29 Akim Demaille <akim@epita.fr>
5422 * data/lalr1.cc: Reinstall the former ctor, for sake of
5423 compatibility, but warn it will be removed.
5424 Move towards a more standard C++ coding style (i.e., type *var ->
5427 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5429 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5430 since it's less likely to work if NULs are involved in the future.
5432 2004-09-27 Akim Demaille <akim@epita.fr>
5434 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5436 2004-09-27 Akim Demaille <akim@epita.fr>
5438 * data/lalr1.cc (b4_parse_param_decl_1): New.
5439 (b4_parse_param_decl): Use it to have different names between attribute
5441 (b4_cc_constructor_call): Likewise.
5443 2004-09-24 Akim Demaille <akim@epita.fr>
5445 * src/parse-gram.y (add_param): Strip the leading and trailing
5446 blanks from a formal argument declaration.
5447 (YY_LOCATION_PRINT): New.
5449 2004-09-24 Akim Demaille <akim@epita.fr>
5451 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5454 2004-09-24 Akim Demaille <akim@epita.fr>
5456 * doc/bison.texinfo (Table of Symbols): Sort.
5458 2004-09-21 Akim Demaille <akim@epita.fr>
5460 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5461 the useless parentheses.
5462 Suggested by Paul Eggert.
5464 2004-09-20 Akim Demaille <akim@epita.fr>
5466 Let the initial-action act on the look-ahead, and use it for the
5467 "initial push" (corresponding to an hypothetical beginning-of-file).
5468 And let lalr1.cc honor %initial-action.
5470 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5472 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5473 (Parser::Parser): Remove the ctor that used to initialize it.
5474 (Parser::parse): Like in the other skeletons, issue the "starting
5475 parse" message before any action.
5476 Honor %initial-action.
5477 Initialize the stacks with the lookahead.
5478 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5480 Push them in the stacks.
5481 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5483 2004-09-20 Akim Demaille <akim@epita.fr>
5485 * doc/bison.texinfo (Initial Action Decl): New.
5487 2004-09-20 Akim Demaille <akim@epita.fr>
5489 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5490 clearer criterion to define it.
5491 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5492 When reducing on an empty RHS, use the latest stacked location as
5494 yylloc is not always available.
5495 * data/glr.c: Likewise.
5496 Also, honor initial-actions.
5498 2004-09-20 Akim Demaille <akim@epita.fr>
5500 * data/yacc.c (YY_LOCATION_PRINT): New.
5501 Define when we know YYLTYPE's structure, i.e., when the default
5502 YYLLOC_DEFAULT is used.
5503 * data/c.m4 (b4_yysymprint_generate): Use it.
5504 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5505 value of the result.
5506 (error_start_): Replace with...
5507 (error_range_): this location array.
5508 This allows to replace code relying on the implementation of
5509 locations by portable code.
5510 * data/yacc.c (yylerrsp): Replace with...
5511 (yyerror_range): this.
5512 Every time a token is popped, update yyerror_range[0], to have an
5513 accurate location for the error token.
5514 * data/glr.c (YY_LOCATION_PRINT): New.
5515 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5516 deference a pointer.
5517 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5518 report the location in %printers.
5520 * src/scan-skel.l: Instead of abort, report error messages to ease
5521 understanding skeleton scanning failures.
5523 2004-09-16 Akim Demaille <akim@epita.fr>
5525 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5526 (iterator, const_iterator): these, to be more in the C++ spirit.
5527 Also, return reverse iterators so that when displaying the stack
5528 we display its bottom first.
5529 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5531 We should probably use vector here though.
5533 2004-09-16 Akim Demaille <akim@epita.fr>
5535 Have more complete shift traces.
5537 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5538 to report Shifts instead of ad hoc YYDPRINTF invocations,
5539 including for the error token.
5540 * data/lalr1.cc (symprint_): Output the location.
5541 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5542 output the location within the %printer.
5543 Activate GLR tests, at least to make sure they compile properly.
5544 They still don't pass though.
5545 * tests/calc.at: Adjust expect verbose output, since now "Entering
5546 state..." is on a different line than the "Shifting" message.
5548 2004-09-08 Akim Demaille <akim@epita.fr>
5550 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
5551 Bison directive from the Bison file to the invocation of this
5552 macro, so that these directives are passed to
5553 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
5554 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
5555 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
5556 the extra Bison directives instead of the whole series.
5557 Change the grammar so that there are recoverable errors, and
5558 unrecoverable errors. Now we can have the parser give up before
5559 consuming the whole input. As a result we now can observe that
5560 the lookahead is freed when needed.
5561 Change the parser source to parse argv[1] instead of a hard coded
5563 Simplify yylex, and give a value and location to EOF.
5564 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
5565 passed directives already coded in the file.
5566 Add some tests to check the location of "error".
5567 For some tests, the C++ parser is correct, and not yacc.c.
5568 For other tests, they provide different, but unsatisfying, values,
5569 so keep the C++ value so that at least one parser is "correct"
5570 according to the test suite.
5571 (Actions after errors): Remove, this is subsumed by the
5572 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
5574 2004-09-06 Akim Demaille <akim@epita.fr>
5576 * data/lalr1.cc: Adjust the indentation of the labels.
5580 2004-09-06 Akim Demaille <akim@epita.fr>
5582 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
5583 argument, an informative message.
5584 Call YY_SYMBOL_PRINT.
5585 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
5586 * data/lalr1.cc (destruct_): Likewise.
5587 In addition, no longer depend on b4_yysymprint_generate and
5588 b4_yydestruct_generate to generate these functions, do it "by
5591 2004-09-03 Akim Demaille <akim@epita.fr>
5593 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
5594 invoked, yydestruct the lookahead.
5595 * tests/calc.at (Calculator $1): Update the expected lengths of
5596 traces: there is an added line for the discarded lookahead.
5597 * doc/bison.texinfo (Destructor Decl): Some rewording.
5598 Define "discarded" symbols.
5600 2004-09-02 Akim Demaille <akim@epita.fr>
5602 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5604 2004-09-02 Akim Demaille <akim@epita.fr>
5606 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
5607 (YYDSYMPRINTF): Rename as...
5608 (YY_SYMBOL_PRINT): this.
5609 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
5611 Use it instead of direct symprint_ calls.
5612 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5615 2004-09-02 Akim Demaille <akim@epita.fr>
5617 * data/lalr1.cc (b4_yysymprint_generate): New.
5618 (symprint_): New member function, defined when YYDEBUG.
5619 Use it consistently instead of token/nterm debugging output by
5621 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5622 %printer calls to use cdebug_ when using lalr1.cc.
5624 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5626 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5627 with #ifdef YYDEBUG.
5629 2004-08-26 Akim Demaille <akim@epita.fr>
5631 * doc/bison.texinfo (Implementing Loops): Rename as...
5632 (Implementing Gotos/Loops): this.
5634 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5636 Adjust to latest gnulib.
5637 * bootstrap (gnulib_modules): Add xalloc-die.
5638 Set LC_ALL=C so that file names sort consistently.
5639 Prefer the gnulib copies of gettext.m4, glibc21.m4,
5640 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
5641 uintmax_t.m4, ulonglong.m4.
5642 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
5643 po.m4 since we are now using _gl.m4 instead.
5645 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5647 * src/scan-action.l: Remove. Scanning of semantic actions is
5648 handled in scan-gram.l.
5650 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5652 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5654 * src/location.h (struct): The file member is a uniqstr.
5655 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5657 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5659 Fix bug with non-%union parsers that have printers or destructors,
5660 which led to a Bison core dump. Reported by Peter Fales in
5661 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
5663 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
5664 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
5665 not to our own type.
5666 * src/output.c (symbol_destructors_output, symbol_printers_output):
5667 Don't assume %union.
5668 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
5669 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
5670 UNION-FLAG. All callers changed.
5671 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
5672 Use type char, not unsigned int, when declaring an array of char;
5673 this lets us remove a cast.
5674 (Printers and Destructors): Add non-%union test cases.
5676 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5678 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5679 GLR writeups. E.g., avoid frenchspacing and the future tense,
5680 change "lookahead" to "look-ahead", and change "wrt" to "with
5683 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5685 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5686 New sections, split off from the GLR Parsers section. Put the new
5687 Simple GLR Parser near the start of the GLR section, for clarity.
5688 Rewrite connective text.
5690 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
5692 * doc/bison.texinfo (Simple GLR Parsers): New section.
5694 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5696 * NEWS, TODO, doc/bison.texinfo:
5697 Use "look-ahead" instead of "lookahead", to be consistent.
5698 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5699 while we're fixing "look-ahead".
5700 * src/conflicts.c (shift_set): Renamed from shiftset.
5701 (look_ahead_set): Renamed from lookaheadset.
5702 * src/print.c: Likewise.
5703 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5704 name for "lookahead".
5705 (report_types, usage): Likewise.
5706 * src/getargs.h (report_look_ahead_tokens): Renamed from
5708 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5710 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5711 (look_ahead_tokens_print): Renamed from lookaheads_print.
5712 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5713 state_rule_lookaheads_print.
5714 * src/state.h: Likewise.
5715 (reductions.look_ahead_tokens): Renamed from lookaheads.
5716 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5717 AT_DATA_LOOKAHEADS_GRAMMAR.
5719 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5721 * README: Update location of patched M4 distribution.
5723 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5725 Don't assume the C++ compiler takes the same arguments as the C compiler
5727 * configure.ac (O0CXXFLAGS): New var.
5728 * tests/atlocal.in (CXXFLAGS): Use it.
5730 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5732 Fix some "make check" problems with C++ reported by
5733 Albert Chin-A-Young for Tru64 C++ in this thread:
5734 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5736 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5737 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5738 Output to a .cc file for C++, not to a .c file.
5739 * tests/calc.at (AT_CHECK_CALC): Likewise.
5740 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5741 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5743 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5745 * tests/calc.at, tests/actions.at: Workaround for SGI
5746 C++ compiler. (trivial change)
5748 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5750 Spent a few hours checking out which prerequisite versions the
5751 current sources actually require. I went all the way back to
5752 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5753 a seemingly endless set of combinations of versions more recent
5754 than that. The bottom line is that the current sources require
5755 fairly recent versions of the build tools, and it'll be some work
5757 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5758 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5759 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5760 Add comments explaining why those particular versions are
5763 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5764 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
5765 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
5767 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5768 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5770 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5772 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5773 0.11.5. Suggested by Bruno Haible.
5774 * bootstrap: Remove gettext version checking.
5776 * doc/bison.texinfo (Decl Summary): Also mention that %union
5777 can depend on prerequisite types. Problem reported by Tim
5780 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5782 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5783 * README-alpha: Don't tell people not to package this.
5785 * bootstrap: Don't assume $(...) works; use `...` instead.
5786 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5789 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5790 put into the -d output file, and mention what to do if YYSTYPE is
5793 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5795 Undo change made earlier today: it caused autopoint to not bring
5796 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5799 * bootstrap: Check that gettext version matches what's in
5800 configure.ac. Warn users to ignore robots.txt ERROR 404.
5801 * bootstrap: Undo today's earlier change (logged below).
5802 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
5804 The gettext version checking is causing more trouble than it's
5805 curing; remove it. Problem reported by Paul Hilfinger.
5807 * bootstrap: Issue a warning that one can expect a message
5808 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5809 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5811 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5813 Ensure that the C++ compiler used for testing actually works on a
5814 simple test program; if not, skip the C++-related tests. Problem
5815 reported by Vin Shelton in:
5816 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
5818 * m4/cxx.m4: New file.
5819 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5820 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5821 * tests/local.at (AT_COMPILE_CXX): Use it.
5823 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5825 * data/glr.c (yylloc): Output this macro even if locations are not
5826 being generated, as the GLR parser needs it even in that case.
5827 Problem reported by Troy A. Johnson
5828 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5830 * configure.ac (AC_INIT): Update to 1.875e.
5832 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5834 * NEWS: Version 1.875d.
5835 * configure.ac (AC_INIT): Likewise.
5836 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5838 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5839 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5840 lalr1.cc runs afoul of the first, and the last two are no longer
5841 supported by GCC 3.4.0.
5842 * README: Mention GNU m4 1.4 or later; mention m4 patches.
5843 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
5845 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5847 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
5848 unsigned int, for compatibility with latest gnulib hash module.
5849 * src/state.c (state_hash, state_hasher): Likewise.
5850 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
5851 * src/uniqstr.c (hash_uniqstr): Likewise.
5853 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5855 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5857 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
5858 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
5859 character and string literals.
5860 (unexpected_end): New function.
5861 (unexpected_eof): Use it.
5862 (unexpected_newline): New function.
5863 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
5866 * NEWS: Document %expect-rr.
5868 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
5869 Fix typo by replacing $1 with $option.
5870 Remove more 'intl'-related files.
5871 Don't DEFUN AM_INTL_SUBDIR twice.
5873 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5874 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5876 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
5877 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
5878 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
5879 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
5880 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
5881 * src/.cvsignore: Add *.output.
5883 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5884 gets copied to the output file.
5886 2004-04-28 Paul Eggert <eggert@twinsun.com>
5888 Get files from the gnulib and po repositories, instead of relying
5889 on them being in our CVS. Upgrade to latest versions of gnulib
5892 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
5893 * bootstrap: Bootstrap from gnulib and po repositories.
5894 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
5895 * README-cvs: Document these changes. Remove version numbers from
5896 mentions of build tools, since they change so often. Mention Flex.
5898 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
5899 (gl_USE_SYSTEM_EXTENSIONS): Add.
5900 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
5901 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
5903 (AC_ISC_POSIX): Remove; we no longer support this
5904 ancient OS, as it gets in the way of latest Autoconf & gnulib.
5905 (AC_HEADER_STDC): Remove: we now assume C89 or better.
5906 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
5907 Do not check for C89 headers, except for locale.h which is used
5908 by the Yacc library and must port to K&R hosts.
5909 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
5910 Do not check for C89 functions, except for setlocale which is
5911 used by the Yacc library.
5912 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
5913 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
5914 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
5915 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5916 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5917 AM_GNU_GETTEXT): Remove; now done by:
5918 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5919 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5922 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5923 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5924 Define to empty, as gnulib.mk will do the rest for us.
5925 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5927 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5928 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5930 * src/files.c: Include gnulib's xstrndup.h.
5932 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5933 (REALLOC): Use xnrealloc, for likewise.
5934 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5935 (strnlen, memrchr): Remove decls; functions no longer used.
5938 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5939 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5940 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5941 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5942 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5943 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5944 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5945 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5946 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5947 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5948 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5949 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5950 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5951 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5952 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5953 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5954 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5955 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5956 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5957 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
5958 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
5959 Remove, as these files are now generated automatically
5960 by bootstrap or automake.
5962 * po/ChangeLog: Remove: all but one entry was a duplicate
5963 of this file, and I moved that 2000-11-02 entry here.
5965 * config/.cvsignore: Add Makefile, depcomp, install-sh.
5966 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
5967 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
5968 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
5969 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
5970 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
5971 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
5972 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
5973 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
5974 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
5975 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
5977 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
5978 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
5979 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
5980 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
5981 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
5982 * src/.cvsignore: Remove *_.c.
5985 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
5986 support it. (The latest stable gzip doesn't.)
5988 2004-04-27 Paul Eggert <eggert@twinsun.com>
5990 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
5991 case, as stos_ is now used by destructors due to the 2004-02-09
5994 Remove more K&R C support.
5995 * lib/libiberty.y (PARAMS): Remove. All uses removed.
5996 * lib/subpipe.c (errno): Remove decl.
5997 Include <stdlib.h> unconditionally.
5998 (EXIT_FAILURE): Remove macro.
5999 * src/complain.c (vfprintf, strerror): Remove.
6000 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6002 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6003 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6004 (strchr, strspn, memchr): Remove decls.
6005 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6006 unconditionally. Do not declare perror.
6007 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6010 * src/complain.c (_): Remove useless defn, as system.h defines this.
6012 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6013 with latest obstack.h.
6014 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6015 to procedure types, as obstack.h now does that for us.
6016 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6018 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6019 so that this include file can stand alone.
6020 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6021 does this now. Include subpipe.h first after config.h, to
6022 test whether it can stand alone.
6024 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6025 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6028 * tests/synclines.at (%union synch line): Put a dummy member in
6029 the union, because empty unions aren't allowed in C. Caught
6032 2004-04-13 Jim Meyering <jim@meyering.net>
6034 * src/conflicts.c (conflicts_print): Correct format string typo:
6035 use `%%' to produce literal `%'. (trivial change)
6037 2004-03-30 Paul Eggert <eggert@twinsun.com>
6039 * src/getargs.c (version): Update copyright year to 2004.
6041 * data/c.m4 (b4_int_type): Use 'short int' rather than
6042 'short', and similarly for 'long', 'unsigned', etc.
6043 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6044 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6045 yy_yypstack, yydumpstack): Likewise.
6046 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6047 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6049 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6050 yy_stack_print, yyparse): Likewise.
6051 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6052 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6053 * lib/bitset.c (bitset_print): Likewise.
6054 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6055 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6056 * lib/bitsetv.c (bitsetv_dump): Likewise.
6057 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6058 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6060 * src/LR0.c (allocate_itemsets): Likewise.
6061 * src/gram.h (rule_number, rule): Likewise.
6062 * src/lalr.h (goto_number): Likewise.
6063 * src/nullable.c (nullable_compute): Likewise.
6064 * src/output.c (prepare_rules): Likewise.
6065 * src/relation.c (relation_print, relation_digraph): Likewise.
6066 * src/relation.h (relation_node): Likewise.
6067 * src/state.h (state_number, transitions, errs, reductions,
6068 struct state): Likewise.
6069 * src/symtab.h (symbol_number, struct symbol): Likewise.
6070 * src/tables.c (vector_number, tally, action_number,
6071 default_goto, goto_actions): Likewise.
6072 * tests/existing.at (GNU Cim Grammar): Likewise.
6073 * tests/regression.at (Web2c Actions): Likewise.
6075 * src/output.c (muscle_insert_short_int_table): Renamed from
6076 muscle_insert_short_table. All uses changed.
6078 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6080 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6081 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6082 Add %expect-rr rule.
6084 * src/scan-gram.l: Recognize %expect-rr.
6086 * src/conflicts.h (expected_sr_conflicts): Rename from
6088 (expected_rr_conflicts): Declare.
6090 * src/conflicts.c (expected_sr_conflicts): Rename from
6092 (expected_rr_conflicts): Define.
6093 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6095 Use expected_sr_conflicts in place of expected_conflicts.
6096 Warn if expected_rr_conflicts used in non-GLR parser.
6098 * doc/bison.texinfo: Add documentation for %expect-rr.
6100 2004-03-08 Paul Eggert <eggert@gnu.org>
6102 Add support for hex token numbers. Suggested by Odd Arild Olsen in
6103 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
6105 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6107 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6108 * src/scan-gram.l (scan_integer): New function.
6110 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6111 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6112 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6113 Say "long int", not "long", for uniformity with GNU style.
6115 2004-02-25 Paul Eggert <eggert@twinsun.com>
6117 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6118 compilers. This fixes a problem with Intel's C++ compiler being
6119 chatty, reported by Guido Trentalancia in
6120 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
6122 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6124 Support %destructor and merge error locations in lalr1.cc.
6126 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6127 (Parser::stos_): Define unconditionally.
6128 (Parser::destruct_): New method. Generate its body with
6129 b4_yydestruct_generate.
6130 (Parser::error_start_): New attribute.
6131 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6132 token which are discarded.
6133 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6134 error_start_ when erroneous token are discarded.
6135 (Parser::parse) <yyerrlab1>: Compute the location of the error
6136 token so that it covers all the discarded tokens.
6137 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6138 it can be called with `%skeleton "lalr1.cc"', and do that.
6140 2004-02-02 Paul Eggert <eggert@twinsun.com>
6142 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6143 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6144 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6145 There's no need to mention top_builddir since Automake does that
6147 (INCLUDES): Remove, as Automake says it's obsolescent.
6148 Contents migrated into AM_CPPFLAGS as described above.
6149 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6151 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6153 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6154 (yyreportSyntaxError): Handle case where lookahead token is
6157 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6159 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6160 resulting parsers are compilable with C++.
6162 2003-12-23 Paul Eggert <eggert@twinsun.com>
6164 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6165 * src/output.c (output_skeleton): Rename local var.
6166 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6167 Bison tokens, as this runs afoul of the 2003-10-07 change that
6168 disallowed NUL bytes in character constants or string literals.
6170 * tests/local.at: Require Autoconf 2.59's Autotest.
6171 * tests/testsuite.at: Don't include local.at, since we now assume
6172 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6174 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6175 multiple inclusion warnings.
6177 2003-12-02 Akim Demaille <akim@epita.fr>
6179 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6183 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6185 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6187 2003-10-07 Paul Eggert <eggert@twinsun.com>
6189 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6190 if testsuite doesn't exist.
6192 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6193 literals, unfortunately.
6194 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6195 Complain about NUL bytes in character constants or string literals.
6197 2003-10-05 Paul Eggert <eggert@twinsun.com>
6199 * NEWS: Don't document %no-default-prec, as it's still
6201 * doc/bison.texinfo: Document %no-default-prec only if
6202 the defaultprec flag is set. Normally it's not.
6204 2003-10-04 Paul Eggert <eggert@twinsun.com>
6206 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6207 non-modifiable lvalue, instead of a modifiable one.
6208 * doc/bison.texinfo (Actions): Document that $$ can
6209 be assigned to. Do not claim that $$ and $N are
6210 array element references: user code should not rely on this.
6212 2003-10-01 Paul Eggert <eggert@twinsun.com>
6214 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6215 (grammar_declaration): Use it.
6216 * src/scan-gram.l: New token %no-default-prec.
6217 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6218 * NEWS, doc/bison.texinfo: Document the above.
6220 2003-10-01 Akim Demaille <akim@epita.fr>
6222 VCG no longer supports long_straight_phase.
6224 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6225 * src/print_graph.c (print_graph): Adjust.
6227 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
6228 and Paul Eggert <eggert@twinsun.com>
6230 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6231 Table of Symbols): Document %default-prec.
6232 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6233 (grammar_declaration): Set default_prec on %default-prec.
6234 * src/scan-gram.l (%default-prec): New token.
6235 * src/reader.h (default_prec): New flag.
6236 * src/reader.c: Likewise.
6237 (packgram): Handle it.
6238 * tests/conflicts.at (%default-prec without %prec,
6239 %default-prec with %prec, %default-prec 1): New tests.
6241 2003-09-30 Paul Eggert <eggert@twinsun.com>
6243 * tests/testsuite.at: Include local.at, not input.at, fixing
6244 a typo in the 2003-08-25 patch.
6246 2003-08-27 Akim Demaille <akim@epita.fr>
6248 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6251 2003-08-26 Akim Demaille <akim@epita.fr>
6253 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6254 "<\#" to avoid magic from Gnus when posting parts of this script.
6256 2003-08-26 Akim Demaille <akim@epita.fr>
6258 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6259 (Parser::parse): here.
6260 Adjust: nerrs and errstatus is now replaced by...
6261 (Parser::nerrs_, Parser::errstatus_): New.
6263 2003-08-25 Akim Demaille <akim@epita.fr>
6265 * config/announce-gen, Makefile.cfg: New.
6266 * Makefile.am: Adjust.
6267 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6268 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6270 2003-08-25 Akim Demaille <akim@epita.fr>
6272 When reducing initial empty rules, Bison parser read an initial
6273 location that is not defined. This results in garbage, and that
6274 affects Bison's own parser. Therefore we need (i) to extend Bison
6275 to support a means to initialize this location, and (ii) to use
6276 this CVS Bison to fix CVS Bison's parser.
6278 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6280 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6281 * src/parse-gram.y: Adjust.
6282 (%initial-action): New.
6283 (%error-verbose): Since we require CVS Bison, there is no reason
6285 * src/scan-gram.l: Adjust.
6286 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6287 * data/yacc.c (yyparse): Use b4_initial_action.
6289 2003-08-25 Akim Demaille <akim@epita.fr>
6291 * doc/bison.texinfo: Don't promote stdout for error messages.
6293 2003-08-25 Akim Demaille <akim@epita.fr>
6295 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6296 From Alexandre Duret-Lutz.
6298 2003-08-25 Akim Demaille <akim@epita.fr>
6302 2003-08-25 Akim Demaille <akim@epita.fr>
6304 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6307 2003-08-25 Akim Demaille <akim@epita.fr>
6309 * data/lalr1.cc (Parser::reduce_print_): New.
6312 2003-08-25 Akim Demaille <akim@epita.fr>
6314 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6315 error recovery loops. This patch is based on
6316 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
6317 Also, augment the similarity between lalr1.cc and yacc.c.
6318 Note: the locations of error recovery rules are not correct yet.
6320 * data/lalr1.cc: Comment changes to augment the similarity between
6321 lalr1.cc and yacc.c.
6322 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6323 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6324 yyerrlab), when hitting EOF, pop the whole stack here instead of
6325 merely falling thru the default error handling mechanism.
6326 (yyerrorlab): New label, with the old contents of YYERROR,
6327 plus the following change: pop the stack of rhs corresponding
6328 to the production that invoked YYERROR. That is how Yacc
6329 behaves (required by POSIX).
6330 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6333 2003-08-25 Akim Demaille <akim@epita.fr>
6335 Tune local.at so that people can "autom4te -l autotest calc.at -o
6336 calc" for instance, to extract a sub test suite.
6338 * tests/testsuite.at: Move the initialization, Autotest version
6339 requirement, and AT_TESTED invocation into...
6340 * tests/local.at: here.
6341 * tests/testsuite.at: Include it for compatibility with Autoconf
6343 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6346 2003-08-04 Paul Eggert <eggert@twinsun.com>
6348 Rework code slightly to avoid gcc -Wtraditional warnings.
6349 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6350 The returned value is now stored in *YY0. All callers changed.
6351 * src/output.c (merge_output): Adjust to the above change.
6353 2003-07-26 Paul Eggert <eggert@twinsun.com>
6355 * data/glr.c (YYASSERT): New macro.
6356 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6357 yyresolveStates, yyprocessOneStack):
6358 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6359 Derived from a suggestion by Frank Heckenbach.
6361 2003-07-25 Paul Eggert <eggert@twinsun.com>
6363 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6364 for portability to K&R C (after ansi2knr, presumably). See
6365 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
6366 by Frank Heckenbach, though I have omitted the structure-initialization
6367 part of his glr-knr.diff patch since I recall that the Portable
6368 C Compiler didn't require that change.
6370 Let the user specify how to allocate and free memory.
6371 Derived from a suggestion by Frank Heckenbach in
6372 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
6373 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6374 All uses of free, malloc, realloc changed to use these macros,
6375 and unnecessary casts removed.
6376 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6378 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6380 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6381 use s.empty() rather than s == "" to test for empty string; see
6382 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
6385 2003-06-25 Akim Demaille <akim@epita.fr>
6387 * config/depcomp, config/install-sh: Update from masters.
6389 2003-06-20 Paul Eggert <eggert@twinsun.com>
6391 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6392 and return properly parenthesized result.
6393 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6394 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6395 Remove unnecessary parentheses from uses.
6396 * doc/bison.texinfo (Location Default Action): Describe the
6397 conventions for parentheses.
6399 2003-06-19 Paul Eggert <eggert@twinsun.com>
6401 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6402 yyreportTree): Do not assume that size_t is the same width as int,
6403 when printing sizes. Print sizes using an unsigned format.
6404 Problem reported by Frank Heckenbach in
6405 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
6407 Port to Forte Developer 7 C compiler.
6408 * data/glr.c (struct YYLTYPE): If locations are not being used,
6409 declare a single dummy member, as empty structs do not conform
6411 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6412 the Forte Developer 7 C compiler complains that end-of-loop
6413 code is not reached.
6415 2003-06-17 Paul Eggert <eggert@twinsun.com>
6417 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6418 avoid warnings from picky compilers about redefinition of PARAMS.
6420 2003-06-17 Paul Eggert <eggert@twinsun.com>
6424 * NEWS: Document 1.875b.
6426 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6427 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6428 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6429 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6430 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6431 per recent gettext manual's suggestion.
6432 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6433 Use prototypes, not old-style definitions.
6434 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6435 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6436 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6437 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6438 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6439 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6440 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6441 vbitset_or_and_cmp, vbitset_copy): Likewise.
6443 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6444 Do not include <stdlib.h>.
6445 (PARAMS): Define unconditionally for C89.
6446 (ATTRIBUTE_NORETURN): Remove.
6447 (ATTRIBUTE_UNUSED): Define unconditionally.
6449 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
6450 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
6451 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6452 * lib/vbitset.c, lib/vbitset.h: New files.
6453 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6454 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6457 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6458 `How Can I Reset @code{yyparse}', since texinfo does not allow
6459 arbitrary @ in node names.
6461 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6462 shouldn't be needed according to the gettext 0.12.1 documentation
6463 but which seem to be needed anyway: codeset.m4 glibc21.m4
6464 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
6465 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
6466 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
6468 * lib/.cvsignore: Add stdbool.h.
6469 * m4/.cvsignore: Add nls.m4, po.m4.
6471 Upgrade to CVS gnulib.
6472 * stdbool_.h: File renamed from stdbool.h.in.
6473 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6475 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6476 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6477 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6478 (MOSTLYCLEANFILES): New var.
6479 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6480 (stdbool.h): New rule.
6481 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6482 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6483 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6484 m4/quote.m4: Upgrade to today's gnulib.
6486 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6487 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6488 the tests right now.
6489 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6490 yyerror are declared before use; C99 requires this.
6492 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6494 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6496 (yyrecoverSyntaxError): Correct the logic for setting and testing
6498 Correct comment on handling EOF.
6499 Allow states with only a default reduction, rather than failing
6500 (I can't quite reconstruct why these were not allowed before).
6502 Fixes to avoid problem that $-N rules in GLR parsers can cause
6503 buffer overruns, corrupting state.
6505 * src/output.c (prepare_rules): Output max_left_semantic_context
6507 * src/reader.h (max_left_semantic_context): New variable declaration.
6508 * src/scan-gram.l (max_left_semantic_context): Define.
6509 (handle_action_dollar): Update max_left_semantic_context.
6510 * data/glr.c (YYMAXLEFT): New definition.
6511 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6512 (yyresolveAction): Ditto.
6514 Fixes to problems with location handling in GLR parsers reported by
6515 Frank Heckenbach (2003/06/05).
6517 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6518 (YYRHSLOC): Add parentheses, and define only if locations used.
6519 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6521 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6522 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
6524 * tests/cxx-type.at: Exercise location information; update tests
6525 to differentiate output with and without locations.
6526 Remove forward declarations of yylex and yyerror---caused errors
6527 because default YYLTYPE not yet defined.
6528 Change semantic actions to compute strings, rather than printing
6529 them directly (to test proper passing of semantics values). Change
6530 output to prefix notation and update test data and expected results.
6531 (yylex): Track locations.
6532 (stmtMerge): Return value rather than printing, and include arguments
6535 2003-06-03 Paul Eggert <eggert@twinsun.com>
6537 Avoid warnings generated by GCC 2.95.4 when Bison is
6538 configured with --enable-gcc-warnings.
6539 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6540 yy::]b4_parser_class_name[::translate_,
6541 yy::Stack::operator[] (unsigned),
6542 yy::Stack::operator[] (unsigned) const,
6543 yy::Slice::operator[] (unsigned),
6544 yy::Slice::operator[] (unsigned) const):
6545 Rename local vars to avoid warnings.
6546 * tests/glr-regression.at (Improper handling of embedded actions
6547 and $-N in GLR parsers): Remove unused local variable from yylex.
6548 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6549 (void) as arg when not pure, since we now assume C89 when building
6550 Bison. Pacify GCC by using parameter.
6552 2003-06-02 Paul Eggert <eggert@twinsun.com>
6554 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
6555 yy::Location::lines, yy::Location::columns): Rename arguments
6556 to avoid shadowing; this removes a warning generated by GCC 3.3.
6558 2003-06-01 Paul Eggert <eggert@twinsun.com>
6560 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
6561 to g++, as GCC 3.3 complains if you do it.
6562 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
6563 everything that WARNING_CFLAGS has, except omit warnings
6564 not suitable for C++.
6565 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
6566 * tests/atlocal.in (CXXFLAGS): New var.
6567 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
6569 Fix a GLR parser bug I reported in February; see
6570 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
6571 The problem was that GLR parsers did not conform to the C standard,
6572 because actions like { $1 = $2 + $3; } expanded to expressions
6573 that invoked YYFILL in separate subexpressions, and YYFILL assigned
6574 to a local variable. The C standard says that expressions
6575 like (var = f ()) + (var = f ()) have undefined behavior.
6576 Another problem was that GCC sometimes issues warnings that
6577 yyfill and its parameters are unused.
6579 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6581 (yyfill): New function.
6583 (yyuserAction): Change type of yynormal to bool, so that it matches
6584 the new yyfill signature. Mark it as possibly unused.
6587 Follow up on a bug I reported in February, where a Bison-generated
6588 parser can loop. Provide a test case and a fix for yacc.c. I
6589 don't have a fix for lalr1.cc or for glr.c, unfortunately.
6590 The original bug report is in:
6591 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
6593 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
6594 macro's size was becoming unwieldy.
6595 (yyerrlab): Do not discard an empty lookahead symbol, as this
6596 might destroy garbage.
6597 (yyerrorlab): New label, with the old contents of YYERROR,
6598 plus the following change: pop the stack of rhs corresponding
6599 to the production that invoked YYERROR. That is how Yacc
6600 behaves, and POSIX requires this behavior.
6601 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
6602 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
6603 Define 'alarm' to do nothing if unistd.h is not available.
6604 Add a new rule "exp: '-' error;" to test the above change to
6605 data/yacc.c. Use 'alarm' to abort any test taking longer than
6606 10 seconds, as it's probably looping.
6607 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
6608 Also, the new yacc.c generates two fewer diagnostics for an
6611 2003-05-24 Paul Eggert <eggert@twinsun.com>
6613 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
6614 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
6615 This fixes a problem reported by John Bowman when the Compaq/HP
6616 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
6618 * data/yacc.c (union yyalloc): Likewise.
6619 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
6621 Switch from 'int' to 'bool' where that makes sense.
6623 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
6624 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
6625 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
6626 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
6627 Return or accept bool, not int. All callers changed.
6628 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
6629 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
6630 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
6631 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
6632 bitset_or_and_cmp_): Likewise.
6633 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
6634 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
6635 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
6636 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
6637 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
6638 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
6639 bitset_stats_or_and_cmp): Likewise.
6640 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
6641 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
6642 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
6643 ebitset_xor_cmp): Likewise.
6644 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
6645 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
6646 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
6647 lbitset_xor_cmp): Likewise.
6648 * lib/bbitset.h: Include <stdbool.h>.
6649 (struct bitset_vtable): The following members now return bool, not
6650 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
6651 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
6653 * src/conflicts.c (count_rr_conflicts): Likewise.
6654 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6656 * lib/ebitset.c (ebitset_obstack_init): Likewise.
6657 * lib/lbitset.c (lbitset_obstack_init): Likewise.
6658 * src/getargs.c (debug_flag, defines_flag, locations_flag,
6659 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6660 graph_flag): Likewise.
6661 * src/getargs.h (debug_flag, defines_flag, locations_flag,
6662 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6663 graph_flag): Likewise.
6664 * src/output.c (error_verbose): Likewise.
6665 * src/output.h (error_verbose): Likewise.
6666 * src/reader.c (start_flag, typed): Likewise.
6667 * src/reader.h (typed): Likewise.
6668 * src/getargs.c (LOCATIONS_OPTION): New constant.
6669 (long_options, getargs): Use it.
6670 * src/lalr.c (build_relations): Use bool, not int.
6671 * src/nullable.c (nullable_compute): Likewise.
6672 * src/print.c (print_reductions): Likewise.
6673 * src/tables.c (action_row, pack_vector): Likewise.
6674 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6675 * src/output.c (prepare): Use it.
6676 * src/output.c (token_definitions_output,
6677 symbol_destructors_output, symbol_destructors_output): Use string,
6678 not boolean integer, to keep track of whether to output separator.
6679 * src/print_graph.c (print_core): Likewise.
6680 * src/state.c (state_rule_lookaheads_print): Likewise.
6682 * config/install-sh: Sync from automake 1.7.5.
6684 2003-05-14 Paul Eggert <eggert@twinsun.com>
6686 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6687 semicolon after a grammar declaration, in the interest of possible
6688 future changes to the Bison input language.
6689 Do not allow a stray semicolon at the start of the grammar.
6690 (rhses.1): Allow one or more semicolons after any rule, including
6691 just before "|" as required by POSIX.
6692 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6695 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6697 %parse-param support for lalr1.cc.
6699 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6700 b4_cc_constructor_calls, b4_cc_constructor_call,
6701 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6703 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6704 parse-param arguments.
6705 (yy::b4_parser_class_name): Declare instance variables to
6706 hold parse-param arguments.
6707 * tests/calc.at: s/value/semantic_value/ because value clashes
6708 with a member of yy::b4_parser_class_name. Adjust C++ code
6709 to handle %parse-param. Enable %parse-param test in C++.
6711 2003-05-12 Paul Eggert <eggert@twinsun.com>
6713 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6714 English a bit. Fix fclose typo. Change "const char" to "char
6715 const", and use ANSI C rather than K&R for "main". Suggest
6716 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6717 and suggest yy_switch_to_buffer.
6719 2003-05-05 Paul Eggert <eggert@twinsun.com>
6721 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6722 C89. This avoids a diagnostic on compilers that define __STDC__
6723 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
6724 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
6726 2003-05-03 Paul Eggert <eggert@twinsun.com>
6728 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6729 Do not overrun array bounds.
6730 This should fix a bug reported today by Olatunji Oluwabukunmi in
6731 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
6733 2003-04-29 Akim Demaille <akim@epita.fr>
6735 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6736 * src/getargs.c, src/getargs.h: here, as bool, not int.
6737 (nondeterministic_parser): New.
6738 * src/parse-gram.y, src/scan-gram.l: Support
6739 %nondeterministic-parser.
6740 * src/output.c (prepare): Use nondeterministic_parser instead
6741 of glr_parser where appropriate.
6742 * src/tables.c (conflict_row, action_row, save_row)
6743 (token_actions, token_actions, pack_vector): Ditto.
6745 2003-04-29 Akim Demaille <akim@epita.fr>
6747 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6749 2003-04-29 Akim Demaille <akim@epita.fr>
6751 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6752 with %pure-parser and %locations to exercise the patch from Yakov
6755 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6757 * data/yacc.c: (b4_lex_param): Corrected for the case where
6758 %lex-param is provided and %pure-parser isn't.
6760 2003-04-27 Paul Eggert <eggert@twinsun.com>
6762 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
6763 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
6764 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6765 if it is not defined.
6766 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6768 2003-04-26 Paul Eggert <eggert@twinsun.com>
6770 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6771 Declare to be of type suitable for the ninf value itself, not of
6772 type suitable for the corresponding table, since the latter might
6773 be unsigned but the ninf value might be negative. This fixes a
6774 bug reported by Alexandre Duret-Lutz in
6775 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
6777 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6778 invokes it. We shouldn't invoke it twice because it will attempt
6779 to put error.o in the archive twice. This fixes a glitch reported
6780 by Martin Mokrejs in
6781 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
6783 2003-04-21 Paul Eggert <eggert@twinsun.com>
6785 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6788 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6790 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6791 Fix obvious typo that results in uncompilable GLR parsers
6792 when both %pure-parser and %locations are used. (trivial change)
6794 2003-04-17 Paul Eggert <eggert@twinsun.com>
6796 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6797 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6798 Do not insert the expected token via unput, as this runs afoul
6799 of a POSIX-compatibility bug in flex 2.5.31.
6800 All uses changed to BEGIN the parent state,
6801 since we no longer insert the expected token via unput.
6802 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6803 that is no longer emitted after the above change.
6805 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6806 the first one. This change is from Paul Hilfinger, and it fixes
6807 regression reported by Werner Lemberg in
6808 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
6810 (resolve_sr_conflict): Don't invoke state_errs_set
6811 unless one or more tokens have been explicitly made errors.
6812 Otherwise, the above change causes Bison to abort.
6814 * tests/existing.at (GNU pic Grammar): New test case, taken from
6817 2003-03-31 Akim Demaille <akim@epita.fr>
6819 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6821 2003-03-31 Akim Demaille <akim@epita.fr>
6823 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6826 2003-03-31 Akim Demaille <akim@epita.fr>
6828 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6829 From Paul Hilfinger.
6831 2003-03-29 Akim Demaille <akim@epita.fr>
6833 * m4/error.m4: Do not put under dynamic conditions some code which
6834 expansion is under static control.
6836 2003-03-29 Akim Demaille <akim@epita.fr>
6838 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6840 2003-03-29 Akim Demaille <akim@epita.fr>
6842 * doc/bison.texinfo (Strings are Destroyed): New.
6844 2003-03-13 Paul Eggert <eggert@twinsun.com>
6846 * .cvsignore: Add configure.lineno.
6847 * src/.cvsignore: Add yacc.
6848 * tests/.cvsignore: Add testsuite.log.
6849 * doc/fdl.texi: Sync with latest FSF version.
6851 2003-03-12 Paul Eggert <eggert@twinsun.com>
6853 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
6854 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
6855 cursor, instead of leaving it undefined. This fixes a bug
6856 reported by Tim Van Holder in
6857 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
6858 * tests/input.at (Torturing the Scanner): Test the scanner on
6859 an empty input file, which was Tim Van Holder's test case.
6861 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
6862 <sys/resource.h> can be included, include sys/time.h and
6863 sys/times.h first, if available. This works around the SunOS
6864 4.1.4 porting bug reported by Bruce Becker in
6865 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
6867 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6868 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6871 Merge changes from gnulib. This was prompted because the CVS
6872 snapshot didn't build on Solaris 7 due to strnlen problems.
6874 These changes need to be merged back into gnulib:
6875 * lib/hash.c: Include <stdbool.h> unconditionally.
6876 * m4/onceonly.m4 (m4_quote): New macro.
6877 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
6878 Quote AC_FOREACH variable-expansions properly.
6879 The 2003-01-03 obstack.h change also needs merging.
6880 {end of changes requiring merging}
6882 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6883 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
6884 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
6885 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
6886 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
6887 New files, imported from gnulib.
6888 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
6891 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
6892 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
6895 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6897 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
6898 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
6899 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
6900 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
6901 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
6902 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
6903 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
6904 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
6905 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
6906 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
6907 (jm_PREREQ_ARGMATCH): Remove.
6908 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
6909 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
6911 * src/system.h: Include <stdbool.h> unconditionally.
6913 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6914 assuming at least C89 in the bitset code for some time now.
6916 2003-03-03 Akim Demaille <akim@epita.fr>
6920 2003-03-02 Akim Demaille <akim@epita.fr>
6922 * doc/bison.texinfo (Table of Symbols): Reactivate the
6923 documentation for %lex-param, and %parse-param.
6925 2003-03-02 Akim Demaille <akim@epita.fr>
6927 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6928 generate verbose error messages.
6929 Use the number of tokens as an upper bound in yytname, as it
6930 cannot be a non terminal.
6932 2003-03-02 Akim Demaille <akim@epita.fr>
6934 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6937 2003-03-02 Akim Demaille <akim@epita.fr>
6939 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6940 Use them to exercise yycheck overrun.
6941 Based on Andrew Suffield's grammar.
6943 2003-03-02 Akim Demaille <akim@epita.fr>
6945 Create tests/local.at for Bison generic testing macros.
6947 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6948 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6950 * tests/calc.at (AT_CHECK_CALC): Adjust.
6951 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6952 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6953 * tests/local.at: here.
6954 (AT_COMPILE_CXX): Tags the tests using it as c++.
6955 Ignore the test if CXX is not functional.
6957 2003-03-01 Paul Eggert <eggert@twinsun.com>
6959 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
6960 not loc->end, since loc->end might contain garbage and this leads
6961 to undefined behavior on some platforms.
6962 (id_loc, token_start): Use (IF_LINTed) initial values that do not
6963 depend on *loc, so that the reader doesn't give the the false
6964 impression that *loc is initialized.
6965 (<INITIAL>"%%"): Do not bother setting code_start, since its value
6966 does not survive the return.
6968 2003-03-01 Akim Demaille <akim@epita.fr>
6970 * src/scan-gram.l (code_start): Always initialize it when entering
6971 into yylex, as SC_EPILOGUE is activated *before* the corresponding
6972 yylex invocation. An alternative would be making it static, but
6973 then it starts with the second %%'s beginning, instead of its end.
6975 2003-02-28 Paul Eggert <eggert@twinsun.com>
6977 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
6978 around a UnixWare 7.1.1 porting bug reported by John Hughes in
6979 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
6981 2003-02-26 Paul Eggert <eggert@twinsun.com>
6983 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
6984 Remove Sequent/Pyramid discussion (nobody uses them any more).
6985 Merge VMS and MS-DOS discussion; these ports may well be dead
6986 but let's keep mentioning them for now. Put <> around email
6987 addresses. Add copyright notice.
6989 2003-02-24 Paul Eggert <eggert@twinsun.com>
6991 * data/glr.c (yy_reduce_print): yylineno -> yylno,
6992 to avoid collision with flex use of yylineno.
6993 Problem reported by Bruce Lilly in
6994 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
6995 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6996 * data/yacc.c (yy_reduce_print): Likewise.
6998 * config/depcomp: Sync with Automake 1.7.3.
7000 2003-02-21 Akim Demaille <akim@epita.fr>
7002 * data/lalr1.cc: Use temporary variables instead of casts to
7003 change integer types.
7004 Suggested by Paul Eggert.
7006 2003-02-21 Akim Demaille <akim@epita.fr>
7008 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7009 to avoid confusions with lalr1.cc's notion of Position.
7010 Suggested by Paul Eggert.
7012 2003-02-20 Akim Demaille <akim@epita.fr>
7014 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7015 before initial_columns.
7016 (location.hh): Use consistent variable names when defining the
7018 Use "last" so that we subtract from Positions, not from unsigned.
7020 2003-02-20 Akim Demaille <akim@epita.fr>
7022 * data/lalr1.cc (position.hh): New subfile, including the extended
7023 and Doxygen'ed documentation of class Position.
7024 (location.hh): Use it.
7025 Document a` la Doxygen.
7026 With the help of Benoit Perrot.
7028 2003-02-20 Akim Demaille <akim@epita.fr>
7030 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7032 Redefine AT_YYERROR_SEES_LOC_IF using it.
7033 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7035 Don't use the location in yy::Parser::error_ and
7036 yy::Parser::print_ when not %locations.
7037 Activate more lalr1.cc tests.
7039 2003-02-19 Akim Demaille <akim@epita.fr>
7041 * data/lalr1.cc: When displaying a line number, be sure to make it
7044 2003-02-19 Akim Demaille <akim@epita.fr>
7046 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7048 (YYABORT, YYACCEPT, YYERROR): New.
7049 * tests/calc.at: Renable the lalr1.cc test.
7051 2003-02-19 Akim Demaille <akim@epita.fr>
7053 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7054 error recovery, mixing with/without pops and discarding of the
7057 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7059 2003-02-17 Paul Eggert <eggert@twinsun.com>
7061 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7062 * tests/testsuite.at (AT_COMPILE): Use them.
7063 This fixes the testsuite problem reported by Robert Lentz in
7064 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
7066 2003-02-12 Paul Eggert <eggert@twinsun.com>
7068 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7069 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
7070 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
7071 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7072 Check for malloc failure, for consistency with yacc.c.
7073 (yytname_size): Remove, for consistency with yacc.c.
7075 The bug still remains in data/lalr1.cc, as I didn't have time
7078 2003-02-06 Akim Demaille <akim@epita.fr>
7080 * configure.ac (GXX): Rename as...
7081 (CXX): this, to keep the original Autoconf semantics.
7083 * data/lalr1.cc: Fix b4_copyright invocations.
7084 If YYDEBUG is not defined, don't depend upon name_ being defined.
7085 (location.hh): Include string and iostream.
7086 (Position::filename): New member.
7087 (Position::Position ()): New.
7088 (operator<< (Position)): New.
7089 (operator- (Position, int)): New.
7090 (Location::first, Location::last): Rename as...
7091 (Location::begin, Location::end): these, to mock the conventional
7093 (operator<< (Location)): New.
7094 * tests/atlocal.in (CXX): New.
7095 * tests/testsuite.at (AT_COMPILE_CXX): New.
7096 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7097 locations in a more synthetic way.
7098 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7100 Adjust the C locations to match those from Emacs: first column is
7102 Change all the expected results.
7103 Conform to the GCS: simplify the locations when applicable.
7104 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7105 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7106 these CPP macros with the m4 macros new defined by...
7107 (AT_CHECK_PUSHDEFS): this, i.e.:
7108 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
7109 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7111 (AT_CHECK_POPDEFS): Undefine them.
7112 (AT_CHECK_CALC_LALR1_CC): New.
7113 Use it for the first lalr1.cc test.
7115 2003-02-04 Akim Demaille <akim@epita.fr>
7117 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7118 Location as is defined.
7120 2003-02-04 Akim Demaille <akim@epita.fr>
7122 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7123 name_ being defined.
7125 2003-02-03 Paul Eggert <eggert@twinsun.com>
7127 * src/gram.h (start_symbol): Remove unused decl.
7129 Use more-consistent naming conventions for local vars.
7131 * src/derives.c (derives_compute): Change type of local var from
7133 * src/gram.c (grammar_rules_partial_print): Likewise.
7134 * src/print.c (print_core): Likewise.
7135 * src/reduce.c (reduce_grammar_tables): Likewise.
7137 * src/gram.c (grammar_dump): Change name of item_number *
7138 local var from r to rp.
7139 * src/nullable.c (nullable_compute): Likewise.
7141 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7143 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7144 for symbol or symbol_number var.
7145 * src/reader.c (grammar_start_symbol_set): Likewise.
7146 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7148 * src/state.c (transitions_to): Likewise.
7149 * src/state.h: Likewise.
7150 * src/tables.c (symbol_number_to_vector_number): Likewise.
7152 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7155 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7158 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7161 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7162 Use str, not s, for char * var. Use ch, not c, for character var.
7163 Use size for size var.
7165 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7167 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7169 * src/uniqstr.h: Likewise.
7171 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7172 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7173 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7174 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7175 param to have same name as that of enum, so that we don't use
7176 "s" to stand for a non-state.
7178 2003-02-02 Akim Demaille <akim@epita.fr>
7180 * src/scan-skel.l: Scan more than one inert character per yylex
7183 2003-02-01 Paul Eggert <eggert@twinsun.com>
7187 * po/LINGUAS: Add ms.
7189 2003-01-30 Akim Demaille <akim@epita.fr>
7191 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7193 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7195 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7198 Changes in response to error report by S. Eken: GLR mode does not
7199 handle negative $ indices or $ indices in embedded rules correctly.
7200 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
7202 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7203 (b4_rhs_location): Ditto.
7204 (yyfill): New function to copy from stack tree into array
7206 (yyuserAction): Modify to allow incremental move of semantic values
7207 to rhs array when in GLR mode.
7208 Define YYFILL to use in user-defined actions to fill semantic array
7210 Remove dummy use of yystack, as there is now a guaranteed use.
7211 (yydoAction): Modify to allow incremental move of semantic values
7212 to rhs array when in GLR mode.
7213 (yyresolveAction): Ditto.
7214 (yyglrShiftDefer): Update comment.
7215 (yyresolveStates): Use X == NULL for pointers, not !X.
7216 (yyglrReduce): Ditto.
7219 * tests/glr-regr1.at: Rename to ...
7220 * tests/glr-regression.at: Add new regression test for the problems
7221 described above (adapted from S. Eken).
7222 Update copyright notice.
7223 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7224 * tests/Makefile.am: Ditto.
7226 2003-01-28 Paul Eggert <eggert@twinsun.com>
7228 * data/lalr1.cc: Do not use @output_header_name@ unless
7229 b4_defines_flag is set. This fixes two bugs reported by
7231 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7232 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
7234 2003-01-21 Paul Eggert <eggert@twinsun.com>
7236 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7237 we don't need to worry about yyerrlab1 being reported as an
7238 "unused label" by non-GCC C compilers. The downside is that if
7239 locations are used then a couple of statements are duplicated each
7240 time YYERROR is invoked, but the upside is that the warnings
7242 (yyerrlab1): Move code to YERROR.
7243 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7244 This reverts some of the 2002-12-27 change.
7246 2003-01-17 Paul Eggert <eggert@twinsun.com>
7248 * src/output.c (symbol_printers_output): Fix typo that led
7249 to core dump. Problem reported by Antonio Rus in
7250 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
7252 2003-01-13 Akim Demaille <akim@epita.fr>,
7253 Quoc Peyrot <chojin@lrde.epita.fr>,
7254 Robert Anisko <anisko_r@lrde.epita.fr>
7256 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7257 when the stacks contain one element, as the loop would otherwise
7258 free the last state, and then use the top state (the one we just
7259 popped). This means that the initial elements will not be freed
7260 explicitly, as is the case in yacc.c; it is not a problem, as
7261 these elements have fake values.
7263 2003-01-11 Paul Eggert <eggert@twinsun.com>
7265 * NEWS: %expect-violations are now just warnings, reverting
7266 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7267 bootstrapping problem reported by Matthias Klose; see
7268 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
7269 * src/conflicts.c (conflicts_print): Likewise.
7270 * tests/conflicts.at (%expect not enough, %expect too much,
7271 %expect with reduce conflicts): Likewise.
7272 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7273 that the warning is enabled if the number of conflicts changes
7274 (not necessarily increases).
7276 * src/getargs.c (version): Update copyright year.
7278 2003-01-09 Akim Demaille <akim@epita.fr>
7280 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7282 2003-01-08 Paul Eggert <eggert@twinsun.com>
7284 * Makefile.maint (WGETFLAGS):
7285 New macro, containing "-C off" to disable proxy caches.
7286 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7287 (rel-check): Use $(WGET) instead of wget.
7289 2003-01-06 Paul Eggert <eggert@twinsun.com>
7291 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7292 the GLR paper of Scott, Johnstone and Hussain.
7294 2003-01-04 Paul Eggert <eggert@twinsun.com>
7296 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7297 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7298 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7299 (EXTRA_LIBRARIES): New var, for liby.a.
7300 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7301 (EXTRA_SCRIPTS): New var, for yacc.
7303 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7304 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7305 Problem reported by Nelson H. F. Beebe.
7307 2003-01-03 Paul Eggert <eggert@twinsun.com>
7309 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7310 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7311 when compiling Bison 1.875's `bitset bset = obstack_alloc
7312 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7314 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7315 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7316 grow to a huge size with typical invocation.
7318 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7319 Use the pattern recommended by Autoconf 2.57, except also protect
7320 against double-definition.
7321 * src/system.h: Likewise.
7322 Portability issues reported by Nelson H. F. Beebe.
7324 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7325 All uses changed. Provide a definition in both C and C++.
7326 (yytrue, yyfalse): Define even if defined (__cplusplus).
7328 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7329 Reported by Nelson H. F. Beebe.
7331 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7333 2003-01-02 Paul Eggert <eggert@twinsun.com>
7335 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7336 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7337 Bug reported by Nelson H. F. Beebe.
7339 2003-01-01 Paul Eggert <eggert@twinsun.com>
7343 2002-12-30 Paul Eggert <eggert@twinsun.com>
7345 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7347 (<INITIAL>","): Here. This causes stray "," to be treated
7350 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
7351 last brace in braced code when not in Yacc mode, for compatibility
7352 with Bison 1.35. This resurrects the 2001-12-15 patch to
7355 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7356 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7358 2002-12-28 Paul Eggert <eggert@twinsun.com>
7360 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7361 that of SYM's type. This fixes Debian bug 168069, reported by
7364 2002-12-28 Paul Eggert <eggert@twinsun.com>
7368 Switch back to the Yacc style of conflict reports, undoing some
7369 of the 2002-07-30 change.
7370 * doc/bison.texinfo (Understanding): Use Yacc style for
7371 conflict reports. Also, use new way of locating rules.
7372 * src/conflicts.c (conflict_report):
7373 Renamed from conflict_report_yacc, removing the old
7374 'conflict_report'. Translate the entire conflict report at once,
7375 so that we don't assume that "," has the same interpretation in
7377 (conflicts_output): Use Yacc-style conflict report for each state,
7378 instead of our more-complicated style.
7379 (conflicts_print): Use Yacc-style conflict report, except print
7380 the input file name when not emulating Yacc.
7381 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7382 Conflicted Reduction, %expect not enough, %expect too much,
7383 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7384 * tests/existing.at (GNU Cim Grammar): Likewise.
7385 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7387 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7388 fatal): Don't invoke fflush; it's not needed and it might even be
7389 harmful for stdout, as stdout might not be open.
7390 * src/reduce.c (reduce_print): Likewise.
7392 2002-12-27 Paul Eggert <eggert@twinsun.com>
7394 Fix a bug where error locations were not being recorded correctly.
7395 This problem was originally reported by Paul Hilfinger in
7396 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
7398 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7399 top of the location stack's error locations.
7400 (yyerrlab): Set it. When discarding a token, push its location
7401 onto yylerrsp so that we don't lose track of the error's end.
7402 (yyerrlab1): Now is only the target of YYERROR, so that we can
7403 properly record the location of the action that failed. For GCC
7404 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7405 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7406 (yyerrlab2): New label, which yyerrlab now falls through to.
7407 Compute the error's location by applying YYLLOC_DEFAULT to
7408 the locations of all the symbols that went into the error.
7409 * doc/bison.texinfo (Location Default Action): Mention that
7410 YYLLOC_DEFAULT is also invoked for syntax errors.
7411 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7412 Error locations include the locations of all the tokens that were
7413 discarded, not just the last token.
7415 2002-12-26 Paul Eggert <eggert@twinsun.com>
7417 * src/files.c: Include quote.h.
7418 (compute_output_file_names): Warn if we detect conflicting
7419 outputs to the same file. This should catch the misunderstanding
7420 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7422 * src/conflicts.c (conflicts_print): If the user specifies
7423 "%expect N", report an error if there are any reduce/reduce
7424 conflicts. This is what the manual says should happen.
7425 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7426 * tests/conflicts.at (%expect with reduce conflicts): New test.
7428 Don't use m4_include on relative file names, as it doesn't work as
7429 desired if there happens to be a file with that name under ".".
7431 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7432 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7433 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7434 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7435 * src/output.c (output_skeleton): Use full path names when
7436 specifying a file to include; don't rely on include path, as
7437 it's unreliable when the working file contains a file with
7440 2002-12-25 Paul Eggert <eggert@twinsun.com>
7442 Remove obsolete references to bison.simple and bison.hairy.
7443 Problem mentioned by Aubin Mahe in
7444 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
7445 * data/glr.c: Comment fix.
7446 * doc/bison.1: Remove references. Also, mention "yacc".
7448 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7451 * src/parse-gram.y (declaration): Use enum "report_states" rather
7452 than its numeric value 1.
7454 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7455 opening a new one. This fixes Debian bug 165349, reported by
7458 2002-12-24 Paul Eggert <eggert@twinsun.com>
7462 * Makefile.maint (cvs-update): Don't assume that the shell
7463 supports $(...), as Solaris sh doesn't.
7465 * src/parse-gram.y (lloc_default): Remove test for empty
7466 nonterminals at the end, since it didn't change the result.
7468 2002-12-24 Paul Eggert <eggert@twinsun.com>
7470 If the user does not define YYSTYPE as a macro, Bison now declares it
7471 using typedef instead of defining it as a macro. POSIX requires this.
7472 For consistency, YYLTYPE is also declared instead of defined.
7474 %union directives can now have a tag before the `{', e.g., the
7475 directive `%union foo {...}' now generates the C code
7476 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7477 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7478 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7479 instead of `yyltype'.
7481 `yystype' and `yyltype' are now obsolescent macros instead of being
7482 typedefs or tags; they are no longer documented and will be
7483 withdrawn in a future release.
7485 * data/glr.c (b4_location_type): Remove.
7486 (YYSTYPE): Renamed from yystype.
7487 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7488 (struct YYLTYPE): Renamed from struct yyltype.
7489 (YYLTYPE): Renamed from yyltype.
7490 (yyltype, yystype): New (and obsolescent) macros,
7491 for backward compatibility.
7492 * data/yacc.c: Likewise.
7494 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7495 does not specify a union tag. This is for compatibility with
7498 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7499 const *, since it is now modified by stripping surrounding { }.
7500 (current_braced_code): Remove.
7501 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7502 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7503 trailing " {...}". Now of type <chars>.
7504 (grammar_declaration): Adjust to bundled tokens.
7505 (code_content): Remove; stripping is now done by add_param.
7506 (print_token_value): Print contents of bundled tokens.
7507 (token_name): New function.
7509 * src/reader.h (braced_code, current_braced_code): Remove.
7510 (token_name): New decl.
7512 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7513 token_type, not braced_code code_kind. All uses changed.
7514 (SC_PRE_CODE): New state, for scanning after a keyword that
7515 has (or usually has) an immediately-following braced code.
7516 (token_type): New local var, to keep track of which token type
7517 to return when scanning braced code.
7518 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
7519 <INITIAL>"%parse-param", <INITIAL>"%printer",
7520 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7521 instead of returning a token type immediately.
7522 (<INITIAL>"{"): Set token type.
7523 (<SC_BRACED_CODE>"}"): Use it.
7524 (handle_action_dollar, handle_action_at): Now returns bool
7525 indicating success. Fail if ! current_rule; this prevents a core dump.
7526 (handle_symbol_code_dollar, handle_symbol_code_at):
7527 Remove; merge body into caller.
7528 (handle_dollar, handle_at): Complain in invalid contexts.
7530 * NEWS, doc/bison.texinfo: Document the above.
7531 * NEWS: Fix years and program names in copyright notice.
7533 2002-12-17 Paul Eggert <eggert@twinsun.com>
7535 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7536 Reporting, Table of Symbols): Omit mentions of %lex-param and
7537 %parse-param from the documentation for now.
7539 2002-12-15 Paul Eggert <eggert@twinsun.com>
7541 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7542 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7543 lookahead symbol, and which sets yychar in parser actions) and it
7544 disagreed with the Bison documentation. Bug
7545 reported by Andrew Walrond.
7547 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7548 as the caller now does that.
7549 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7550 (YYEMPTY): Parenthesize right hand side, since others use it.
7551 (yyparse): Don't assume that our generated code is the only code
7554 2002-12-13 Paul Eggert <eggert@twinsun.com>
7558 POSIX requires a "yacc" command.
7559 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7560 (MOSTLYCLEANFILES): Add yacc.
7562 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
7563 as an alias for bison y.
7565 * po/LINGUAS: Add da.
7567 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
7568 problem with latest <getopt.h>.
7569 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
7571 * doc/fdl.texi: Upgrade to 1.2.
7572 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
7573 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
7574 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
7576 * config/install-sh: Sync with autotools.
7578 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
7579 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
7580 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
7581 locations are requested.
7582 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
7583 locations are requested.
7585 2002-12-12 Paul Eggert <eggert@twinsun.com>
7587 Remove unportable casts and storage allocation tricks.
7588 While we're at it, remove almost all casts, since they
7589 usually aren't needed and are a sign of trouble.
7591 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7593 * src/derives.c (derives_compute): Do not subtract NTOKENS from
7594 the pointer DSET returned by malloc; this isn't portable.
7595 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
7596 Similarly for DERIVES.
7597 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
7598 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
7599 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
7601 * src/derives.c (derives_compute): Do not bother invoking
7602 int_of_rule_number, since rule numbers are integers.
7604 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7605 rather than XMALLOC (char, N).
7607 * src/files.c (filename_split): Rewrite to avoid cast.
7609 * src/gram.h (symbol_number_as_item_number,
7610 item_number_as_symbol_number, rule_number_as_item_number,
7611 item_number_as_rule_number):
7612 Now inline functions rather than macros, to avoid casts.
7613 * src/state.h (state_number_as_int): Likewise.
7614 * src/tables.c (state_number_to_vector_number,
7615 symbol_number_to_vector_number): Likewise.
7617 * src/gram.h (int_of_rule_number): Remove; no longer used.
7619 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7620 since the resulting storage is always stored into.
7622 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7625 * src/muscle_tab.c (muscle_m4_output):
7626 Now inline. Return bool, not int.
7627 * src/state.c (state_compare): Likewise.
7628 * src/symtab.c (symbol_check_defined,
7629 symbol_check_alias_consistency, symbol_pack, symbol_translation,
7630 hash_compare_symbol, hash_symbol):
7632 * src/uniqstr.c (uniqstr_print): Likewise.
7633 * src/muscle_tab.c (muscle_m4_output_processor):
7634 New function, to avoid casts.
7635 * src/state.c (state_comparator, stage_hasher): Likewise.
7636 * src/symtab.c (symbol_check_defined_processor,
7637 symbol_check_alias_consistency_processor, symbol_pack_processor,
7638 symbol_translation_processor, hash_symbol_comparator,
7639 hash_symbol_hasher): Likewise.
7640 * src/uniqstr.c (uniqstr_print_processor): Likewise.
7641 * src/muscle_tab.c (muscles_m4_output):
7642 Use new functions instead of casting old functions unportably.
7643 * src/state.c (state_hash_new): Likewise.
7644 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
7645 symbols_token_translations_init):
7647 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7649 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
7650 var instead of casting to long, to avoid casts.
7651 (prepare_states): Use MALLOC rather than alloca, so that we don't
7652 have to worry about alloca.
7653 * src/state.c (state_hash_lookup): Likewise.
7655 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7656 local var instead of casting to unsigned char, to avoid casts.
7658 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
7659 STATE_ALLOC): Remove.
7660 (transitions_new, errs_new, reductions_new, state_new): Use malloc
7661 rather than calloc, and use offsetof to avoid allocating slightly
7663 (state_new): Initialize all members.
7665 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7667 * src/symtab.c (symbol_free): Remove; unused.
7668 (symbol_get): Remove cast in lhs of assignment.
7669 (symbols_do): Now static. Accept generic arguments, not
7670 hashing-related ones.
7672 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7673 (symbol_processor): Remove.
7674 (symbols_do): Remove decl; now static.
7676 * src/system.h (alloca): Remove; decl no longer needed.
7677 (<stddef.h>): Include, for offsetof.
7678 (<inttypes.>, <stdint.h>): Include if available.
7679 (uintptr_t): New type, if system lacks it.
7680 (CALLOC, MALLOC, REALLOC): New macros.
7681 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7684 * src/tables.c (table_size): Now int, to pacify GCC.
7685 (table_grow, table_ninf_remap): Use signed table size.
7686 (save_row): Don't bother initializing locals when not needed.
7687 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7688 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7690 * src/vcg.h: Correct misspellings.
7692 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7695 * src/getargs.c (getargs): Don't assume EOF == -1.
7697 2002-12-09 Paul Eggert <eggert@twinsun.com>
7699 Change identifier spellings to avoid collisions with names
7700 that are reserved by POSIX.
7702 Don't use names ending in _t, since POSIX reserves them.
7703 For consistency, remove _e and _s endings -- they're weren't
7704 needed to remove ambiguity. All uses changed.
7705 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7706 turn was just renamed from struniq_t.
7707 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7708 which in turn was just renamed from struniq_processor_t.
7709 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7710 in turn was renamed from hash_compare_struniq_t.
7711 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7712 (state_list): Renamed from state_list_t.
7713 * src/assoc.h (assoc): Renamed from assoc_t.
7714 * src/conflicts.c (enum conflict_resolution): Renamed from
7715 enum conflict_resolution_e.
7716 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7717 (rule_list): Renamed from rule_list_t.
7718 * src/getargs.h (enum trace): Renamed from enum trace_e.
7719 (enum report): Renamed from enum report_e.
7720 * src/gram.h (item_number): Renamed from item_number_t.
7721 (rule_number): Renamed from rule_number_t.
7722 (struct rule_s): Remove the "rule_s" part; not used.
7723 (rule): Renamed from rule_t.
7724 (rule_filter): Renamed from rule_filter_t.
7725 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7726 (goto_list): Renamed from goto_list_t.
7727 * src/lalr.h (goto_number): Renamed from goto_number_t.
7728 * src/location.h (location): Renamed from location_t.
7729 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7730 and moved here from:
7731 * src/muscle_tab.h (muscle_entry_t): here.
7732 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7733 (rule_list): Renamed from rule_list_t.
7734 * src/print_graph.c (static_graph): Renamed from graph.
7735 * src/reader.h (braced_code): Renamed from braced_code_t.
7736 Remove brace_code_e tag.
7737 * src/relation.h (relation_node): Renamed from relation_node_t.
7738 (relation_nodes): Renamed from relation_nodes_t.
7739 (relation): Renamed from relation_t.
7740 * src/state.h (state_number): Renamed from state_number_t.
7741 (struct state): Renamed from struct state_s.
7742 (state): Renamed from state_t.
7743 (transitions): Renamed from transitions_t. Unused (and
7744 misspelled) transtion_s tag removed.
7745 (errs): Renamed from errs_t. Unused errs_s tag removed.
7746 (reductions): Renamed from reductions_t. Unused tag
7747 reductions_s removed.
7748 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7749 (struct symbol_list): Renamed from struct symbol_list_s.
7750 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7751 (struct symbol): Renamed from struct symbol_s.
7752 (symbol): Renamed from symbol_t.
7753 * src/tables.c (vector_number): Renamed from vector_number_t.
7754 (action_number): Renamed from action_t.
7755 * src/tables.h (base_number): Renamed from base_t.
7756 * src/vcg.h (enum color): Renamed from enum color_e.
7757 (enum textmode): Renamed from enum textmode_e.
7758 (enum shape): Renamed from enum shape_e.
7759 (struct colorentry): Renamed from struct colorentry_s.
7760 (struct classname): Renamed from struct classname_s.
7761 (struct infoname): Renamed from struct infoname_s.
7762 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7763 (enum decision): Renamed from enum decision_e.
7764 (enum orientation): Renamed from enum orientation_e.
7765 (enum alignment): Renamed from enum alignment_e.
7766 (enum arrow_mode): Renamed from enum arrow_mode_e.
7767 (enum crossing_type): Renamed from enum crossing_type_e.
7768 (enum view): Renamed from enum view_e.
7769 (struct node): Renamed from struct node_s.
7770 (node): Renamed from node_t.
7771 (enum linestyle): Renamed from enum linestyle_e.
7772 (enum arrowstyle): Renamed from enum arrowstyle_e.
7773 (struct edge): Renamed from struct edge.
7774 (edge): Renamed from edge_t.
7775 (struct graph): Renamed from struct graph_s.
7776 (graph): Renamed from graph_t.
7777 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7778 Rename value_t -> value.
7779 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7780 value_t_as_yystype -> value_as_yystype.
7782 Don't include <errno.h> in the mainstream code, since it
7783 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7784 * lib/get-errno.c, lib/get-errno.h: New files.
7785 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7787 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7788 * src/output.c (output_skeleton): Likewise.
7789 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7791 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7793 (handle_action_dollar, handle_action_at): Likewise.
7794 * src/system.h: Do not include <errno.h>.
7795 (TAB_EXT): Renamed from EXT_TAB.
7796 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7798 Avoid str[a-z]*, since <string.h> reserves that name space.
7799 Change all instances of "struniq" in names to "uniqstr", and
7800 likewise for "STRUNIQ" and "UNIQSTR".
7801 * src/uniqstr.c: Renamed from src/struniq.c.
7802 * src/uniqstr.h: Renamed from src/struniq.h.
7803 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7804 * src/files.c (strsuffix): Remove; unused.
7805 (concat2): Renamed from stringappend. Now static.
7806 * src/files.h (strsuffix, stringappend): Remove; unused.
7807 * src/parse-gram.y (<chars>): Renamed from <string>.
7808 (<uniqstr>): Renamed from <struniq>.
7809 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7810 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7811 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7812 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7813 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7814 (N_EXPAND): Renamed from N_STRETCH.
7816 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7817 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7818 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7820 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7821 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7822 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7823 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7824 (BASE_MAXIMUM): Renamed from BASE_MAX.
7825 (BASE_MINIMUM): Renamed from BASE_MIN.
7826 (ACTION_MAX): Remove; unused.
7827 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7828 Unnecessary casts removed from above defines.
7831 Fix misspelling in names.
7832 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7833 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7837 * lib/timevar.c (timevar_report): Renamed from time_report,
7838 for consistency with other names.
7839 * lib/timevar.h (timevar_report): New decl.
7840 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7843 Sort include-file uses.
7845 Reorder all include files under src to be in the order "system.h".
7846 then the ../lib include files in angle brackets (alphabetized),
7847 then the . include files in double-quotes (alphabetized). Fix
7848 dependency breakages encountered in this process, as follows:
7849 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
7850 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
7851 * src/state.h: Include "symtab.h".
7853 2002-12-08 Paul Eggert <eggert@twinsun.com>
7855 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
7856 since this causes problems when __file__ contains character
7857 sequences like "@" that are treated specially by src/scan-skel.l.
7858 Instead, just use the file's basename. This fixes the bug
7859 reported by Martin Mokrejs in
7860 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
7862 2002-12-06 Paul Eggert <eggert@twinsun.com>
7864 Add support for rules that do not have trailing semicolons, as
7865 POSIX requires. Improve the quality of locations in Bison
7868 * src/location.c: Include <quotearg.h>.
7869 (empty_location): Now const.
7870 (location_print): New function. Follow the recommendation of the
7871 GNU Coding Standards for locations that span file boundaries.
7872 * src/location.h: Do not include <quotearg.h>; no longer needed.
7873 (boundary): New type.
7874 (location_t): Use it. This allows locations to span file boundaries.
7875 All member uses changed: file -> start.file or end.file (as needed),
7876 first_line -> start.line, first_column -> start.column,
7877 last_line -> end.line, last_column -> end.column.
7878 (equal_boundaries): New function.
7879 (LOCATION_RESET, LOCATION_STEP): Remove.
7880 (LOCATION_PRINT): Remove. All callers changed to use location_print.
7881 (empty_location): Now const.
7882 (location_print): New decl.
7883 * src/parse-gram.y (lloc_default): New function, which handles
7884 empty locations more accurately.
7885 (YYLLOC_DEFAULT): Use it.
7886 (%token COLON): Remove.
7887 (%token ID_COLON): New token.
7889 (declarations, rules): Remove trailing semicolon.
7890 (declaration, rules_or_grammar_declaration):
7891 Allow empty (";") declaration.
7892 (symbol_def): Remove empty actions; no longer needed.
7893 (rules_or_grammar_declaration): Remove trailing semicolon.
7894 (semi_colon.opt): Remove.
7895 * src/reader.h: Include location.h.
7896 (scanner_cursor): New decl.
7897 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
7899 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7901 (STEP): Remove. No longer needed, now that adjust_location does
7902 the work. All uses removed.
7903 (scanner_cursor): New var.
7904 (adjust_location): Renamed from extend_location. It now sets
7905 *loc and adjusts the scanner cursor. All uses changed.
7906 Don't bother testing for CR.
7907 (handle_syncline): Remove location arg; now updates scanner cursor.
7908 All callers changed.
7909 (unexpected_end_of_file): Now accepts start boundary of token or
7910 comment, not location. All callers changed. Update scanner cursor,
7912 (SC_AFTER_IDENTIFIER): New state.
7913 (context_state): Renamed from c_context. All uses changed.
7914 (id_loc, code_start, token_start): New local vars.
7915 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7916 processing of Yacc white space and equivalents here.
7917 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7918 instead of returning ID immediately, since we need to search for
7920 (<INITIAL>"'", "\""): Save token_start.
7921 (<INITIAL>"%{", "{", "%%"): Save code_start.
7922 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7923 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7924 BEGIN context_state at end, not INITIAL.
7925 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7926 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7927 Return correct token start.
7928 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7929 the start of a character, string or multiline comment is found.
7930 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7931 Reduction): Adjust reported locations to match the more-precise
7932 results now expected.
7933 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7934 * tests/reduce.at (Useless Rules, Reduced Automaton,
7935 Underivable Rules): Likewise.
7936 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7937 or "|"' now that so many other tokens are allowed by the new grammar.
7939 * src/complain.h (current_file): Remove duplicate decl;
7940 current_file is now owned by files.h.
7941 * src/complain.c, src/scan-gram.l: Include files.h.
7943 2002-12-06 Paul Eggert <eggert@twinsun.com>
7945 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7946 promotes to int; it might be unsigned int.
7947 * data/yacc.c (yy_reduce_print): Likewise.
7949 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7950 be #defined in the prologue, not in the Bison declarations.
7951 This fixes Debian Bug 102878, reported by Shaul Karl.
7953 2002-12-02 Paul Eggert <eggert@twinsun.com>
7955 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7956 * lib/strtoul.c: New file, from gnulib.
7957 This fixes a porting bug reported by Peter Klein in
7958 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
7960 2002-11-30 Paul Eggert <eggert@twinsun.com>
7962 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
7963 and put only a forward declaration in the prologue. This is for
7964 consistency with the other scanner helper functions.
7966 Type clashes now generate warnings, not errors, since it
7967 appears that POSIX may allow some grammars with type clashes.
7968 * src/reader.c (grammar_current_rule_check): Warn about
7969 type clashes instead of complaining.
7970 * tests/input.at (Type Clashes): Expect warnings, not complaints.
7972 Add Yacc library, since POSIX requires it.
7973 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
7974 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
7975 * lib/main.c, lib/yyerror.c: New files.
7977 gram_error can be static; it need not be extern.
7978 * src/reader.h (gram_error): Remove decl.
7979 * src/parse-gram.y (gram_error): Now static. Add static decl.
7980 (print_token_value): Omit parameter names from forward decl,
7983 2002-11-29 Paul Eggert <eggert@twinsun.com>
7985 * doc/bison.texinfo: Emphasize that yylex and yyerror must
7986 be declared before being used. E.g., one should typically
7987 declare them in the prologue. Use GNU coding style in examples.
7988 Put "const" consistently after the type it modifies. Mention
7989 that C99 supports "inline". Mention that yyerror traditionally
7992 %parse-param and %lex-param now take just one argument, the
7993 declaration; the argument name is deduced from the declaration.
7995 * doc/bison.texinfo (Parser Function, Pure Calling, Error
7996 Reporting, Table of Symbols): Document this.
7997 * src/parse-gram.y (add_param): New function.
7999 (declaration): Implement new rule for %parse-param and %lex-param.
8000 * src/scan-gram.l: "," now elicits a warning, rather than being
8001 a token; this is more compatible with byacc.
8002 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8004 2002-11-27 Paul Eggert <eggert@twinsun.com>
8006 Rename identifiers to avoid real and potential collisions.
8008 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8009 to avoid collision with lex macro described by Bruce Lilly in
8010 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8011 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8012 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8013 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8015 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8016 The name "yycontrol" violates the name space rules, and this stuff
8017 wasn't being used anyway.
8018 (input): Remove action; this stuff wasn't being used.
8019 (gram_error): Rename local variable yylloc -> loc.
8020 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8021 (YY_DECL): Don't use "yy" at start of local variables.
8022 All uses changed, e.g., yylloc -> loc.
8023 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8024 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8025 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8026 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8028 * src/parse-gram.y (gram_error): loc is now const *.
8029 * src/reader.h (gram_error): Likewise.
8031 2002-11-24 Paul Eggert <eggert@twinsun.com>
8035 * tests/actions.at (Actions after errors): Use an output format
8036 more similar to that of the Printers and Destructors test.
8037 Test the position of the ';' token too.
8038 (Printers and Destructors): Likewise.
8039 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8040 unnecessarily alarming people when the test fails.
8042 * data/yacc.c (yyerrlab1): Move this label down, so that the
8043 parser does not discard the lookahead token if the user code
8044 invokes YYERROR. This change is required for POSIX conformance.
8046 * lib/error.c: Sync with gnulib.
8048 2002-11-22 Paul Eggert <eggert@twinsun.com>
8050 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8051 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8052 * lib/xmalloc.c: Likewise.
8054 2002-11-20 Paul Eggert <eggert@twinsun.com>
8056 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8058 2002-11-20 Paul Eggert <eggert@twinsun.com>
8060 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8061 should use `if (! x) abort ();' rather than `assert (x);', and
8062 anyway it's one less thing to worry about configuring.
8064 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8065 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8066 and replace all instances of assert with abort.
8067 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8068 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8070 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8071 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8072 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8073 hash_find_entry, hash_rehash, hash_insert): Likewise.
8074 * src/conflicts.c (resolve_sr_conflict): Likewise.
8075 * src/lalr.c (set_goto_map, map_goto): Likewise.
8076 * src/nullable.c (nullable_compute): Likewise.
8077 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8078 * src/reader.c (packgram, reader): Likewise.
8079 * src/state.c (state_new, state_free, state_transitions_set,
8080 state_reduction_find): Likewise.
8081 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8082 symbol_pack): Likewise.
8083 * src/tables.c (conflict_row, pack_vector): Likewise.
8084 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8085 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8086 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8087 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8089 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8090 (ARGMATCH_CONSTRAINT): New macro.
8091 (ARGMATCH_ASSERT): Use it.
8093 * src/system.h (verify): New macro.
8094 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8096 * src/tables.c (tables_generate): Likewise.
8098 * src/struniq.c (struniq_assert): Now returns void, and aborts
8099 if the assertion is false.
8100 (struniq_assert_p): Remove.
8101 * src/struniq.h: Likewise.
8103 2002-11-18 Paul Eggert <eggert@twinsun.com>
8105 * data/glr.c (yygetLRActions): Replace `yyindex' with
8106 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8107 This fixes the regression with Sun ONE Studio 7 cc that I reported in
8108 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
8110 2002-11-18 Akim Demaille <akim@epita.fr>
8112 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8114 From Tim Van Holder.
8116 2002-11-17 Paul Eggert <eggert@twinsun.com>
8118 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8119 to "SyntaxError" for consistency with my 2002-11-15 change.
8121 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8122 not define to {}, since this breaks the common use of `YYDPRINTF
8123 ((...));' if a single statement is desired (e.g. before `else').
8124 Work around GCC warnings by surrounding corresponding calls with
8126 (yyhasResolvedValue): Remove unused function.
8127 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8129 (yyreportSyntaxError): Renamed from yyreportParseError.
8130 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8132 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8133 extern when possible. Remove unused initializations.
8135 2002-11-16 Akim Demaille <akim@epita.fr>
8137 Augment the similarity between GLR and LALR traces.
8139 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8140 (YY_REDUCE_PRINT): New.
8141 (yyparse): Use them.
8142 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8144 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8145 state reached after the reduction/recovery, since...
8146 (yyparse, yyprocessOneStack): Report the state we are entering in.
8148 2002-11-16 Akim Demaille <akim@epita.fr>
8150 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8151 Add support for --trace=skeleton.
8152 * src/scan-skel.l: %option debug.
8153 Scan strings of non-@ or \n instead of character by character.
8154 (scan_skel): Handle trace_skeleton.
8156 (@output_parser_name@, @output_header_name@): ``Restore'' their
8157 support (used to be M4 macros).
8158 * data/yacc.c: Quote larger chunks, a la glr.c.
8159 * data/lalr1.cc: Likewise.
8160 The header guards are no longer available, so use some other
8161 string than `YYLSP_NEEDED'.
8163 2002-11-16 Akim Demaille <akim@epita.fr>
8165 Make the ``Printers and Destructors'' test more verbose, taking
8166 `yacc.c''s behavior as (possibly wrong) reference.
8168 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8169 instead of fprint on stdout.
8170 Set and report the last_line of the symbols.
8171 Consistently display values and locations.
8173 2002-11-16 Paul Eggert <eggert@twinsun.com>
8175 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8177 2002-11-15 Paul Eggert <eggert@twinsun.com>
8179 * tests/actions.at (Actions after errors): New test case.
8181 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8182 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8183 tests/action.at, tests/calc.at, tests/conflicts.at,
8184 tests/cxx-type.at, tests/regression.at:
8185 "parse error" -> "syntax error" for POSIX compatibility.
8186 "parsing stack overflow..." -> "parser stack overflow" so
8187 that code matches Bison documentation.
8189 2002-11-15 Akim Demaille <akim@epita.fr>
8191 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8192 take two BRACED_CODE, not two string_content.
8193 Free the scanner's obstack when we are done.
8194 (code_content): New.
8195 * tests/calc.at: Adjust.
8196 * doc/bison.texinfo: Adjust.
8197 Also, make sure to include the `,' for these declarations.
8199 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8201 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8202 definition; avoids potential autoreconf problems.
8204 2002-11-15 Akim Demaille <akim@epita.fr>
8206 Always check the value returned by yyparse.
8208 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8209 returned by yyparse.
8210 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8212 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8213 returned by yyparse.
8215 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8217 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8220 2002-11-14 Paul Eggert <eggert@twinsun.com>
8222 * src/output.c (output_skeleton): Call xfopen instead of
8223 duplicating xfopen's body.
8225 Fix bugs reported by Nelson H. F. Beebe in
8226 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
8228 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8229 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8230 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8231 file twice in the grammar, as an extra check.
8233 * tests/input.at (Torturing the Scanner): Surround the
8234 backslash-newline tests with "#if 0", to make it less likely that
8235 we'll run into compiler bugs. Bring back solitary \ inside
8236 comment, but add a closing comment to work around HP C bug. Don't
8237 test backslash-newline in C character constant.
8239 2002-11-14 Akim Demaille <akim@epita.fr>
8241 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8242 status of the compiler.
8243 Calling `exit 1' is no longer needed.
8244 Reported by Nelson H. F. Beebe.
8246 2002-11-14 Akim Demaille <akim@epita.fr>
8248 * tests/atlocal.in (CPPFLAGS): We have config.h.
8249 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8251 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8252 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8253 * tests/regression.at, tests/torture.at: Use them for all the
8254 grammars that are to be compiled.
8255 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8256 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8257 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8259 2002-11-14 Akim Demaille <akim@epita.fr>
8261 * doc/bison.texinfo: Various formatting changes (alignments in
8262 samples, additional @group/@end group, GCS in samples.
8263 Use @deffn instead of simple @table to define the directives,
8264 macros, variables etc.
8266 2002-11-13 Paul Eggert <eggert@twinsun.com>
8268 Fix some bugs reported by Albert Chin-A-Young in
8269 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
8271 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8272 -o c"; the HP C compiler chatters during compilation.
8273 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8274 * tests/headers.at (export YYLTYPE): Likewise.
8276 * tests/input.at (Torturing the Scanner): Remove lines containing
8277 solitary backslashes, as they tickle a bug in the HP C compiler.
8279 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8280 comments, since they're not portable. Use GNU coding style.
8282 2002-11-13 Akim Demaille <akim@epita.fr>
8284 * data/yacc.c: Leave bigger chunks of quoted text.
8285 (YYDSYMPRINTF): New.
8286 Use it to report symbol activities.
8287 * data/glr.c (YYDSYMPRINTF): New.
8290 2002-11-12 Paul Eggert <eggert@twinsun.com>
8294 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8295 (yyglrReduce): Return yyok, not 0.
8296 This should avoid the enumerated-type warnings reported
8297 by Nelson H. F. Beebe in
8298 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
8300 * lib/bbitset.h (BITSET_INLINE): Remove.
8301 * lib/bitset.h [! BITSET_INLINE]: Remove.
8302 (bitset_set, bitset_reset, bitset_test): Rename local vars
8303 to avoid shadowing warnings by GCC.
8305 * data/glr.c (inline): Remove #define. It's the user's
8306 responsibility to #define it away, just like 'const'.
8307 This fixes one of the bugs reported by Nelson H. F. Beebe in
8308 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
8310 * Makefile.maint (po-check): Scan .l and .y files instead of the
8311 .c and the .h files that they generate. This fixes the bug
8312 reported by Tim Van Holder in:
8313 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
8314 Look for N_ as well as for _. Try to avoid matching #define for
8316 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8317 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8318 * src/scan-gram.l: Revamp regular expressions so that " and '
8319 do not confuse xgettext.
8321 * src/struniq.h (struniq_new): Do not declare the return type
8322 to be 'const'; this violates the C standard.
8323 * src/struniq.c (struniq_new): Likewise.
8325 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8327 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8328 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8331 2002-11-12 Akim Demaille <akim@epita.fr>
8333 * Makefile.maint: Sync with Autoconf:
8334 (local_updates): New.
8336 2002-11-12 Akim Demaille <akim@epita.fr>
8338 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8340 2002-11-12 Akim Demaille <akim@epita.fr>
8342 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8345 2002-11-12 Akim Demaille <akim@epita.fr>
8347 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8350 2002-11-12 Akim Demaille <akim@epita.fr>
8352 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8353 Use it to test the GLR parser.
8355 2002-11-12 Akim Demaille <akim@epita.fr>
8357 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8359 * data/glr.c (yystos): New.
8360 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8362 (yyval): Don't define it, it is handled via M4.
8363 (yyrecoverParseError): Free verbosely the discarded symbols.
8364 * data/yacc.c (yysymprint): Remove, rather...
8365 (b4_yysymprint_generate): invoke.
8366 * data/c.m4 (b4_yysymprint_generate): New.
8367 Accept pointers as arguments, as opposed to the version from
8369 (b4_yydestruct_generate): Likewise.
8370 * tests/cations.at (Printers and Destructors): Use Bison directives
8371 instead of CPP macros.
8372 Don't rely on internal details.
8374 2002-11-12 Akim Demaille <akim@epita.fr>
8376 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8377 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8378 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8379 it against YYEMPTY and so forth), work on yytoken (i.e., set
8380 it to YYEMPTY etc.).
8381 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8382 (b4_symbol_actions): Remove.
8383 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8384 for 0, end-of-input.
8386 2002-11-12 Akim Demaille <akim@epita.fr>
8388 * doc/bison.texinfo (Destructor Decl): New.
8390 2002-11-12 Akim Demaille <akim@epita.fr>
8392 * src/tables.c (tables_generate): Use free for pointers that
8393 cannot be NULL, not XFREE.
8394 (pack_vector): Use assert, not fatal, for bound violations.
8395 * src/state.c (state_new): Likewise.
8396 * src/reader.c (reader): Likewise.
8397 * src/lalr.c (set_goto_map): Likewise.
8398 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
8401 2002-11-12 Akim Demaille <akim@epita.fr>
8403 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8405 * src/scan-gram.l (last_string): Is global to the file, not to
8407 * src/parse-gram.y (input): Don't append the epilogue here,
8408 (epilogue.opt): do it here, and free the scanner's obstack.
8409 * src/reader.c (epilogue_set): Rename as...
8410 (epilogue_augment): this.
8411 * data/c.m4 (b4_epilogue): Defaults to empty.
8413 2002-11-12 Akim Demaille <akim@epita.fr>
8415 * src/getargs.c (long_options): Remove duplicates.
8416 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8418 * doc/bison.rnh: Remove.
8419 * doc/bison.texinfo (VMS Invocation): Remove.
8421 2002-11-12 Akim Demaille <akim@epita.fr>
8423 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8424 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8426 Use struniq for symbols.
8428 * src/symtab.h (symbol_t): The tag member is a struniq.
8429 (symbol_type_set): Adjust.
8430 * src/symtab.c (symbol_new): Takes a struniq.
8431 (symbol_free): Don't free the tag member.
8432 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8433 (hash_compare_symbol, hash_symbol): these.
8434 Use the fact that tags as struniqs.
8435 (symbol_get): Use struniq_new.
8436 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8438 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8439 and type members are struniqs.
8440 * src/reader.c (get_merge_function)
8441 (grammar_current_rule_merge_set): Adjust.
8442 (TYPE, current_type): Are struniq.
8444 Use struniq for file names.
8446 * src/files.h, src/files.c (infile): Split into...
8447 (grammar_file, current_file): these.
8448 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8449 * src/reduce.c (reduce_print): Likewise.
8450 * src/getargs.c (getargs): Likewise.
8451 * src/complain.h, src/complain.c: Likewise.
8452 * src/main.c (main): Call struniqs_new early enough to use it for
8454 Don't free the input file name.
8456 2002-11-12 Akim Demaille <akim@epita.fr>
8458 * src/symtab.c (symbol_free): Remove dead deactivated code:
8459 type_name are properly removed.
8460 Don't use XFREE to free items that cannot be NULL.
8461 * src/struniq.h, src/struniq.c: New.
8462 * src/main.c (main): Initialize/free struniqs.
8463 * src/parse-gram.y (%union): Add astruniq member.
8465 * src/scan-gram.l (<{tag}>): Return a struniq.
8466 Free the obstack bit that used to store it.
8467 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8469 2002-11-11 Paul Eggert <eggert@twinsun.com>
8471 Revamp to fix many (but not all) of the C- and M4-related quoting
8472 problems. Among other things, this fixes the Bison bug reported
8473 by Jan Hubicka when processing the Bash grammar; see:
8474 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
8476 Use new @ escapes consistently. Represent brackets with @{ and @}
8477 rather than @<:@ and @:>@, since this works a bit better with dumb
8478 editors like vi. Represent @ with @@, since @ is now consistently
8479 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8480 __ofile__, to avoid unexpected expansions. Similarly, use @output
8481 rather than #output.
8483 * data/c.m4 (b4_copyright): Omit file name from comment, since
8484 the file name could contain "*/".
8485 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8486 be quoted. All uses changed.
8488 * data/glr.c: Use new @ escapes consistently.
8489 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8490 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8491 Remove, since they couldn't handle arbitrary characters in file
8493 * data/lalr1.cc: Likewise.
8494 * data/yacc.c: Likewise.
8496 * src/files.c (output_infix): Remove; all uses removed.
8497 * src/files.h: Likewise.
8499 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8500 mishandled funny characters in file names, and anyway it isn't
8502 * data/yacc.c: Likewise.
8503 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8505 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8506 * data/yacc.c: Likewise.
8508 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8510 (muscle_init): Quote filename as a C string.
8511 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8512 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8513 * src/output.c (escaped_file_name_output): New function.
8514 (prepare_symbols): Quote tokens for M4.
8515 (prepare): Don't insert output_infix, output_prefix,
8516 output_parser_name, output_header_name; this is now down by scan-skel.
8517 Insert skeleton as a C string.
8519 * src/output.c (user_actions_output, symbol_destructors_output,
8520 symbol_printers_output): Quote filenames for C and M4.
8521 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8523 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8524 escapes other than \\ and \'; this simplifies the code.
8525 (<SC_STRING>): Likewise, for \\ and \".
8526 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8527 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8528 Use new escapes @{ and @} for [ and ].
8530 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8531 them with auto vars.
8532 Switch to new escape scheme, where @ is the escape character uniformly.
8533 Abort if a stray escape character is found. Avoid unbounded input
8534 buffer when parsing non-escaped text.
8536 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8537 __oline__, #output, $@, and @{ do not have unintended meanings.
8539 2002-11-09 Paul Eggert <eggert@twinsun.com>
8541 Fix the test failure due to GCC warnings described in
8542 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
8543 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8544 evaluate to 0 if it's impossible for NINF to be in the respective
8546 (yygetLRActions, yyrecoverParseError): Use them.
8548 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8549 counted in the token inserted at end of file. Now takes
8550 location_t *, not location_t, so that the location can be
8551 adjusted. All uses changed.
8553 * tests/regression.at (Invalid inputs): Adjust wording in
8554 diagnostic to match the new behavior.
8556 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
8557 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
8558 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
8559 abort ();'. This reduces the runtime of the "Many lookaheads"
8560 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
8563 2002-11-07 Paul Eggert <eggert@twinsun.com>
8565 * src/parse-gram.y (CHARACTER): Remove unused token.
8568 * src/scan-gram.l: Remove stack option. We no longer use the
8569 stack, since the stack was never deeper than 1; instead, use the
8570 new auto var c_context to record the stacked value.
8572 Remove nounput option. At an unexpected end of file, we now unput
8573 the minimal input necessary to end cleanly; this simplifies the
8576 Avoid unbounded token sizes where this is easy.
8578 (unexpected_end_of_file): New function.
8579 Use it to systematize the error message on unexpected EOF.
8580 (last-string): Now auto, not static.
8581 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
8582 (scanner_last_string_free): Remove; not used.
8583 (percent_percent_count): Move decl to just before use.
8584 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
8585 not the (never otherwised-used) CHARACTER.
8587 2002-11-07 Akim Demaille <akim@epita.fr>
8589 Let yyerror always receive the msg as last argument, so that
8590 yyerror can be variadic.
8592 * data/yacc.c (b4_yyerror_args): New.
8593 Use it when calling yyerror.
8594 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
8595 Use it when calling yyerror.
8596 * doc/bison.texinfo (Error Reporting): Adjust.
8597 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
8598 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
8600 2002-11-06 Akim Demaille <akim@epita.fr>
8602 #line should have quoted strings.
8603 Ideally, this should be done by m4_quotearg.
8605 * src/scan-skel.l: Include quotearg.h.
8607 * src/output.c (symbol_printers_output)
8608 (symbol_destructors_output): Quote the file name.
8610 2002-11-06 Akim Demaille <akim@epita.fr>
8612 * tests/regression.at (Invalid inputs): Adjust to the recent
8615 2002-11-06 Akim Demaille <akim@epita.fr>
8618 Reported by Jim Kent.
8620 * data/c.m4 (b4_syncline): New.
8621 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
8622 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
8623 * src/output.c (user_actions_output): Likewise.
8624 (prepare): Define 'b4_synclines_flag'.
8625 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
8627 2002-11-06 Akim Demaille <akim@epita.fr>
8629 * src/main.c (main): Free `infile'.
8630 * src/scan-gram.l (handle_syncline): New.
8632 * src/output.c (user_actions_output, symbol_destructors_output)
8633 (symbol_printers_output): Use the location's file name, not
8635 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8637 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8639 * src/tables.c (matching_state): Don't allow states to match if
8640 either has GLR conflict entries.
8642 2002-11-05 Paul Eggert <eggert@twinsun.com>
8644 * src/scan-gram.l: Use more accurate diagnostics, e.g.
8645 "integer out of range" rather than "invalid value".
8646 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
8649 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8650 Also, remove one static variable in the scanner.
8652 * src/scan-gram.l (braces_level): Now auto, not static.
8653 Initialize to zero if the compiler is being picky.
8654 (INITIAL): Clear braces_level instead of incrementing it.
8655 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
8656 as POSIX 1003.1-2001 requires.
8657 * src/system.h (IF_LINT): New macro, taken from coreutils.
8658 * configure.ac: Define "lint" if --enable-gcc-warnings.
8660 2002-11-05 Akim Demaille <akim@epita.fr>
8662 * src/scan-gram.l: When it starts with `%', complain about the
8663 whole directive, not just that `invalid character: %'.
8665 2002-11-04 Akim Demaille <akim@epita.fr>
8667 * Makefile.maint: Update from Autoconf.
8668 (update, cvs-update, po-update, do-po-update): New.
8670 2002-11-04 Akim Demaille <akim@epita.fr>
8672 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8674 Have yyerror `use' its arguments.
8675 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8676 returns true when location & yacc & pure & parse-param.
8677 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8679 2002-11-04 Akim Demaille <akim@epita.fr>
8681 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8683 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8686 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8689 2002-11-03 Paul Eggert <eggert@twinsun.com>
8691 * src/reader.c (get_merge_function, grammar_current_rule_check):
8692 Use consistent diagnostics for reporting type name clashes.
8693 Quote the types with <>, for consistency with Yacc.
8694 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8696 2002-11-03 Akim Demaille <akim@epita.fr>
8698 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8700 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8701 (b4_parse_param): Remove.
8702 Use b4_identification.
8703 Propagate b4_pure_args where needed to pass them to yyerror.
8704 * data/glr.m4 (b4_parse_param): Remove.
8705 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8706 (b4_lpure_formals): New.
8707 Use b4_identification.
8708 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8709 b4_user_formals and b4_user_args.
8710 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8711 (yyreportAmbiguity): When using a pure parser, also need
8712 the location, and the parse-params.
8714 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8715 When using a pure parser, also need the parse-params.
8717 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8718 (%pure-parser + %parse-param) LALR and GLR parsers.
8719 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8720 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8721 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8722 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8723 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8724 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8725 * doc/bison.texinfo: Untabify the whole file.
8726 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8727 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8728 (Error Reporting): Adjust to these new directives.
8729 Document %error-verbose, deprecate YYERROR_VERBOSE.
8731 2002-11-03 Akim Demaille <akim@epita.fr>
8733 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8734 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8735 command line options.
8736 * tests/cxx-type.at: Formatting changes.
8738 2002-11-03 Paul Eggert <eggert@twinsun.com>
8740 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8741 to count columns correctly, and to check for invalid inputs.
8743 Use mbsnwidth to count columns correctly. Account for tabs, too.
8745 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8746 (extend_location): New function.
8749 Handle CRLF in C code rather than in Lex code.
8750 (YY_INPUT): New macro.
8751 (no_cr_read): New function.
8753 Scan UCNs, even though we don't fully handle them yet.
8754 (convert_ucn_to_byte): New function.
8756 Handle backslash-newline correctly in C code.
8757 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8758 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8760 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8761 Use {splice} wherever C allows backslash-newline.
8762 YY_STEP after space, newline, vertical-tab.
8763 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
8765 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8767 ({int}, handle_action_dollar, handle_action_at): Check for integer
8770 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8772 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8773 as well as \000. Check for UCHAR_MAX, not 255.
8774 Allow \x with an arbitrary positive number of digits, as in C.
8775 Check for overflow here.
8776 Allow \? and UCNs, for compatibility with C.
8778 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8779 with quote slot used by complain_at.
8781 * tests/input.at: Add tests for backslash-newline, m4 quotes
8782 in symbols, long literals, and funny escapes in strings.
8784 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8785 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8786 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8787 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8788 * m4/mbswidth.m4: New file, from GNU coreutils.
8790 * doc/bison.texinfo (Grammar Outline): Document // comments.
8791 (Symbols): Document that trigraphs have no special meaning in Bison,
8792 nor is backslash-newline allowed.
8793 (Actions): Document that trigraphs have no special meaning.
8795 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8798 2002-11-02 Paul Eggert <eggert@twinsun.com>
8800 * src/reader.c: Don't include quote.h; not needed.
8801 (get_merge_function): Reword warning to be consistent with
8802 type clash diagnostic in grammar_current_rule_check.
8804 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8805 bug in trigraph handling.
8807 * src/output.c (prepare_symbols): When printing token names,
8808 escape "[" as "@<:@" and likewise for "]".
8810 * src/system.h (errno): Remove declaration, as we are now
8811 assuming C89 or better, and C89 guarantees errno.
8813 2002-10-30 Paul Eggert <eggert@twinsun.com>
8815 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8816 Check for close failures.
8817 * src/files.h (xfclose): Return void, not int, since it always
8819 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8821 * src/output.c (output_skeleton): Use xfclose rather than fclose
8822 and ferror. xfclose now checks ferror.
8824 * data/glr.c (YYLEFTMOST_STATE): Remove.
8825 (yyreportTree): Use a stack-based leftmost state. This avoids
8826 our continuing battles with bogus warnings about initializers.
8828 2002-10-30 Akim Demaille <akim@epita.fr>
8830 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8833 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8835 * tests/glr-regr1.at: New test for reported regressions.
8836 * tests/testsuite.at: Add glr-regr1.at test.
8837 * tests/Makefile.am: Add glr-regr1.at test.
8839 2002-10-24 Paul Eggert <eggert@twinsun.com>
8843 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
8844 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
8845 we use malloc. Don't assume 'A' through 'Z' are contiguous.
8846 Don't assume strdup exists; POSIX says its an XSI extension.
8847 Check for buffer overflow on input.
8849 2002-10-24 Akim Demaille <akim@epita.fr>
8851 * src/output.c (output_skeleton): Don't disable M4sugar comments
8852 too soon: it results in comments being expanded.
8853 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
8856 2002-10-24 Akim Demaille <akim@epita.fr>
8858 * data/yacc.c (m4_int_type): New.
8859 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
8860 char' as only yacc.c wants K&R portability.
8861 * data/glr.c (yysigned_char): Remove.
8862 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8863 Reported by Quoc Peyrot.
8865 2002-10-23 Paul Eggert <eggert@twinsun.com>
8867 * src/main.c (main): With --trace=time, report times even if a
8868 non-fatal error occurs. Formerly, the times were reported in some
8869 such cases but not in others.
8870 * src/reader.c (reader): Just return if a complaint has been issued,
8871 instead of exiting, so that 'main' can report times.
8873 2002-10-22 Akim Demaille <akim@epita.fr>
8875 * src/system.h: Include sys/types.
8876 Reported by Bert Deknuydt.
8878 2002-10-23 Paul Eggert <eggert@twinsun.com>
8880 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8881 Suggested by Art Haas.
8883 2002-10-22 Paul Eggert <eggert@twinsun.com>
8885 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
8886 decl; not needed any more.
8887 * src/main.c (main): Use return to exit, undoing yesterday's change.
8888 The last OS that we could find where this wouldn't work is
8889 SunOS 3.5, and that's too old to worry about now.
8891 * data/glr.c (struct yyltype): Define members even when not
8892 doing locations. This is more consistent with yacc.c, and it
8893 works around the following bug reports:
8894 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
8895 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
8897 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
8898 @acronym consistently. Standardize on "Yacc" instead of "YACC",
8899 "Algol" instead of "ALGOL". Give a bit more history about BNF.
8901 2002-10-22 Akim Demaille <akim@epita.fr>
8905 2002-10-21 Paul Eggert <eggert@twinsun.com>
8907 Be consistent about 'bool'; the old code used an enum in one
8908 module and an int in another, and this violates the C standard.
8909 * m4/stdbool.m4: New file, from coreutils 4.5.3.
8910 * configure.ac (AC_HEADER_STDBOOL): Add.
8911 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
8912 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
8913 * src/symtab.c (hash_compare_symbol_t): Likewise.
8914 * src/system.h (bool, false, true): Use a definition consistent
8915 with ../lib/hash.c. All uses changed.
8917 * src/complain.c (warning_issued): Renamed from warn_message_count,
8918 so that we needn't worry about integer overflow (!).
8919 Now of type bool. All uses changed.
8920 (complaint_issued): Renamed from complain_message_count; likewise.
8922 * src/main.c (main): Use exit to exit with failure.
8924 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8925 rather than 1 and 0.
8926 * src/main.c (main): Likewise.
8927 * src/getargs.c (getargs): Likewise.
8928 * src/reader.c (reader): Likewise.
8930 * src/getarg.c (getargs): Remove duplicate code for
8931 "Try `bison --help'".
8933 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8934 What was that "2" for?
8936 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8937 * src/getargs.c (usage): Likewise.
8939 * src/getargs.c (getargs): When there are too few operands, report
8940 the last one. When there are too many, report the first extra
8941 one. This is how diffutils does it.
8943 2002-10-20 Paul Eggert <eggert@twinsun.com>
8945 Remove K&R vestiges.
8946 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8947 * src/complain.c (VA_START): Remove. Assume prototypes.
8948 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8949 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8950 fatal): Assume prototypes.
8951 * src/complain.h: Assume prototypes.
8952 * src/system.h (PARAMS): Remove.
8953 Include <limits.h> unconditionally, since it's guaranteeed even
8954 for a freestanding C89 compiler.
8955 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8956 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8958 2002-10-20 Akim Demaille <akim@epita.fr>
8960 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
8961 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
8962 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
8963 (yyresolveStates, yyresolveAction, yyresolveStack)
8964 (yyprocessOneStack): Use them.
8965 (yy_reduce_print): New.
8966 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
8968 2002-10-20 Akim Demaille <akim@epita.fr>
8970 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
8971 arguments and output `void'.
8972 (b4_c_function): Rename as...
8973 (b4_c_function_def): this.
8974 (b4_c_function_decl, b4_c_ansi_function_def)
8975 (b4_c_ansi_function_decl): New.
8976 Change the interpretation of the arguments: before `int, foo', now
8978 * data/yacc.c (yyparse): Prototype and define thanks to these.
8979 Adjust b4_c_function_def uses.
8980 * data/glr.c (yyparse): Likewise, but ANSI only.
8982 2002-10-20 Akim Demaille <akim@epita.fr>
8984 * src/output.c (prepare): Move the definition of `tokens_number',
8985 `nterms_number', `undef_token_number', `user_token_number_max'
8987 (prepare_tokens): Here.
8988 (prepare_tokens): Rename as...
8989 (prepare_symbols): this.
8990 (prepare): Move the definition of `rules_number' to...
8991 (prepare_rules): here.
8992 (prepare): Move the definition of `last', `final_state_number',
8993 `states_number' to...
8994 (prepare_states): here.
8995 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
8997 2002-10-20 Akim Demaille <akim@epita.fr>
8999 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9001 2002-10-20 Akim Demaille <akim@epita.fr>
9003 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9006 2002-10-20 Akim Demaille <akim@epita.fr>
9008 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9009 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9011 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9013 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9014 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9017 2002-10-19 Paul Eggert <eggert@twinsun.com>
9019 Do not create a temporary file, as that involves security and
9020 cleanup headaches. Instead, use a pair of pipes.
9021 Derived from a suggestion by Florian Krohm.
9022 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9023 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9024 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9025 (BISON_PREREQ_SUBPIPE): Add.
9026 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9027 Add subpipe.h, subpipe.c.
9028 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9029 * po/POTFILES.in: Add lib/subpipe.c.
9030 * src/output.c: Include "subpipe.h".
9031 (m4_invoke): Remove decl.
9032 (scan_skel): New decl.
9033 (output_skeleton): Use pipe rather than temporary file for m4 input.
9034 Check that m4sugar.m4 is readable, to avoid deadlock.
9035 Check for pipe I/O error.
9036 * src/scan-skel.l (readpipe): Remove decl.
9037 (scan_skel): New function, to be used in place of m4_invoke.
9038 Read from stream rather than file.
9040 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9041 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9042 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9043 this generates a more-accurate value anyway.
9045 * lib/timevar.c (timervar_accumulate): Rename locals to
9046 avoid confusion with similarly-named more-global.
9047 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9049 * src/output.c (prepare): Use xstrdup to convert char const *
9050 to char *, to avoid GCC warning.
9052 2002-10-19 Akim Demaille <akim@epita.fr>
9054 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9055 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9056 Use them to have `calc.y' ready for %pure-parser.
9057 * data/yacc.c (YYLEX): Pass a yylex return type to
9060 2002-10-19 Akim Demaille <akim@epita.fr>
9062 Prototype support of %lex-param and %parse-param.
9064 * src/parse-gram.y: Add the definition of the %lex-param and
9065 %parse-param tokens, plus their rules.
9066 Drop the `_' version of %glr-parser.
9068 * src/scan-gram.l (INITIAL): Scan them.
9069 * src/muscle_tab.c: Comment changes.
9070 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9071 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9072 (muscle_entry_s): The `value' member is no longer const.
9073 Adjust all dependencies.
9074 * src/muscle_tab.c (muscle_init): Adjust: use
9075 MUSCLE_INSERT_STRING.
9076 Initialize the obstack earlier.
9077 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9078 (muscle_pair_list_grow): New.
9079 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9080 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9081 * tests/calc.at: Use %locations, not --locations.
9082 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9084 2002-10-19 Akim Demaille <akim@epita.fr>
9086 * src/getargs.c (usage): Take status as argument and exit
9088 Report the traditional `Try ... --help' message when status != 0.
9089 (usage, version): Don't take a FILE * as arg, it is pointless.
9090 (getargs): When there is an incorrect number of arguments, make it
9091 an error, and report it GNUlically thanks to `usage ()'.
9093 2002-10-18 Paul Eggert <eggert@twinsun.com>
9095 * data/glr.c (yyreportParseError): Don't assume that sprintf
9096 yields the length of the printed string, as this is not true
9097 on SunOS 4.1.4. Reported by Peter Klein.
9099 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9100 * tests/conflicts.at (%nonassoc and eof): Likewise.
9101 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9103 2002-10-17 Akim Demaille <akim@epita.fr>
9105 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9106 * src/getargs.c (trace_types, trace_args): Adjust.
9107 * src/reader.c (grammar_current_rule_prec_set)
9108 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9109 Standardize error messages.
9111 (reader): Use trace_flag to enable scanner/parser debugging,
9112 instead of an adhoc scheme.
9113 * src/scan-gram.l: Remove trailing debugging code.
9115 2002-10-16 Paul Eggert <eggert@twinsun.com>
9117 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9120 * NEWS: Officially drop support for building Bison with K&R C,
9121 since it didn't work anyway and it's not worth worrying about.
9122 * Makefile.maint (wget_files): Remove ansi2knr.c.
9123 (ansi2knr.c-url_prefix): Remove.
9124 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9125 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9126 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9128 2002-10-15 Paul Eggert <eggert@twinsun.com>
9130 Stop using the "enum_" trick for K&R-style function definitions;
9131 it confused me, and I was the author! Instead, assume that people
9132 who want to use K&R C compilers (when using these modules in GCC,
9133 perhaps?) will run ansi2knr.
9135 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9136 All uses of "enum_" changed to "enum ".
9137 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9138 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9140 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9141 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9142 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9143 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9144 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9145 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9146 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9147 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9148 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9149 Use function prototypes; this removes the need for declaring
9150 static functions simply to provide their prototypes.
9151 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9152 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9153 bitset_count_, bitset_create, bitset_dump, bitset_first,
9154 bitset_free, bitset_init, bitset_last, bitset_next,
9155 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9156 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9157 bitset_print, bitset_release_memory, bitset_toggle_,
9158 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9159 debug_bitset): Likewise.
9160 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9161 * lib/bitset_stats.c (bitset_log_histogram_print,
9162 bitset_percent_histogram_print, bitset_stats_and,
9163 bitset_stats_and_cmp, bitset_stats_and_or,
9164 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9165 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9166 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9167 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9168 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9169 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9170 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9171 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9172 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9173 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9174 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9175 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9176 bitset_stats_zero): Likewise.
9177 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9178 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9179 bitsetv_dump, debug_bitsetv): Likewise.
9180 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9181 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9182 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9183 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9184 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9185 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9186 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9187 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9188 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9189 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9190 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9192 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9193 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9194 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9195 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9196 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9197 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9198 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9199 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9200 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9201 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9202 lbitset_xor_cmp, lbitset_zero): Likewise.
9204 2002-10-14 Akim Demaille <akim@epita.fr>
9208 2002-10-14 Akim Demaille <akim@epita.fr>
9210 * tests/Makefile.am (maintainer-check-posix): New.
9212 2002-10-14 Akim Demaille <akim@epita.fr>
9214 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9217 2002-10-14 Akim Demaille <akim@epita.fr>
9219 * src/tables.c (table_ninf_remap): base -> tab.
9220 Reported by Matt Rosing.
9222 2002-10-14 Paul Eggert <eggert@twinsun.com>
9224 * tests/action.at, tests/calc.at, tests/conflicts.at,
9225 tests/cxx-type.at, tests/headers.at, tests/input.at,
9226 tests/regression.at, tests/synclines.at, tests/torture.at:
9227 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9228 so that the tests still work even if POSIXLY_CORRECT is set.
9229 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
9231 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9232 for portability to K&R hosts. Fix typo: signed char is guaranteed
9233 only to 127, not to 128.
9234 * data/glr.c (yysigned_char): New type.
9235 * data/yacc.c (yysigned_char): Likewise.
9236 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9238 2002-10-13 Paul Eggert <eggert@twinsun.com>
9240 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9241 true due to limited range of data type" warning from GCC.
9243 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9244 by wrapping enum yytokentype's definition inside #ifndef
9245 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9247 2002-10-13 Akim Demaille <akim@epita.fr>
9249 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9250 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9252 2002-10-13 Akim Demaille <akim@epita.fr>
9254 * Makefile.maint: Update from Autoconf 2.54.
9255 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9257 2002-10-13 Akim Demaille <akim@epita.fr>
9259 * src/print.c (print_state): Separate the list of solved conflicts
9260 from the other items.
9261 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9263 2002-10-13 Akim Demaille <akim@epita.fr>
9265 Let nondeterministic skeletons be usable with deterministic
9268 With the patch, GAWK compiled by GCC without -O2 passes its test
9269 suite using a GLR parser driven by LALR tables. It fails with -O2
9270 because `struct stat' gives two different answers on my machine:
9271 88 (definition of an auto var) and later 96 (memset on this var).
9272 Hence the stack is badly corrumpted. The headers inclusion is to
9273 blame: if I move the awk.h inclusion before GLR's system header
9274 inclusion, the two struct stat have the same size.
9276 * src/tables.c (pack_table): Always create conflict_table.
9277 (token_actions): Always create conflict_list.
9278 * data/glr.c (YYFLAG): Remove, unused.
9280 2002-10-13 Akim Demaille <akim@epita.fr>
9282 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9284 (VALGRIND, GXX): New.
9285 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9286 * tests/bison.in: Run $PREBISON a pre-command.
9287 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9288 (maintainer-check-g++): New.
9289 * Makefile.am (maintainer-check): New.
9291 2002-10-13 Akim Demaille <akim@epita.fr>
9293 * data/glr.c: Formatting changes.
9294 Tweak some trace messages to match yacc.c's.
9296 2002-10-13 Akim Demaille <akim@epita.fr>
9298 GLR parsers sometimes raise parse errors instead of performing the
9300 Reported by Charles-Henry de Boysson.
9302 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
9303 check the length of the traces when %glr.
9304 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9306 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9308 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9309 (yyltype): Remove the yy prefix from the member names.
9310 (yytable): Complete its comment.
9311 (yygetLRActions): Map error action number from YYTABLE from
9313 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9314 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9315 not satisfying as we could compare an YYACTION computed from
9316 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9317 only value for error actions.
9318 (yyreportParseError): In verbose parse error messages, don't issue
9319 `error' in the list of expected tokens.
9320 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9321 next action to perform to match glr.c's decoding.
9322 (yytable): Complete its comment.
9324 2002-10-13 Paul Eggert <eggert@twinsun.com>
9326 Fix problem reported by Henrik Grubbstroem in
9327 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
9328 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9329 because the Bison parser reads the second action before reducing
9331 * src/scan-gram.l (rule_length): New static var.
9332 Use it to keep track of the rule length in the scanner, since
9333 we can't expect the parser to be in lock-step sync with the scanner.
9334 (handle_action_dollar, handle_action_at): Use this var.
9335 * tests/actions.at (Exotic Dollars): Test for the problem.
9337 2002-10-12 Paul Eggert <eggert@twinsun.com>
9339 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9340 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9341 Include <sys/time.h> when checking for clock_t and struct tms.
9342 Use same include order as source.
9343 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
9344 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
9346 * lib/timevar.c: Update copyright date and clarify comments.
9347 (get_time) [IN_GCC]: Keep the GCC version for reference.
9349 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9350 GCC version as of today, then merge Bison's changes.
9351 Change "GCC" to "Bison" in copyright notice. timevar.def's
9352 author is Akim, so change that too.
9354 * src/reader.c (grammar_current_rule_check):
9355 Don't worry about the default action if $$ is untyped.
9356 Prevents bogus warnings reported by Jim Gifford in
9357 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
9359 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9360 * data/glr.c, data/lalr1.cc, data/yacc.c:
9361 Output token definitions before the first part of user declarations.
9362 Fixes compatibility problem reported by Jim Gifford for kbd in
9363 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
9365 2002-10-11 Paul Eggert <eggert@twinsun.com>
9367 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9368 (yyparse): here. This undoes some of the 2002-07-25 change.
9369 Compatibility problem reported by Ralf S. Engelschall with
9370 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9372 2002-10-11 Akim Demaille <akim@epita.fr>
9374 * tests/regression.at Characters Escapes): New.
9375 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9377 Reported by Jan Nieuwenhuizen.
9379 2002-10-11 Akim Demaille <akim@epita.fr>
9383 2002-10-10 Paul Eggert <eggert@twinsun.com>
9385 Portability fixes for bitsets; this also avoids several GCC
9388 * lib/abitset.c: Include <stddef.h>, for offsetof.
9389 * lib/lbitset.c: Likewise.
9391 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9392 properly for vectors of objects. Do not assume that adding a
9393 header size to a multiple of a word size yields a value that is
9394 properly aligned for the whole union.
9395 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9397 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9398 unique names for structures.
9399 * lib/ebitset.c (ebitset_bytes): Likewise.
9400 * lib/lbitset.c (lbitset_bytes): Likewise.
9402 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9403 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9404 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9405 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9406 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9407 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9408 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9409 to improve the type-checking that GCC can do.
9410 * lib/bitset.c (bitset_op4_cmp): Likewise.
9411 * lib/bitset_stats.c (bitset_stats_count,
9412 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9413 bitset_stats_copy, bitset_stats_disjoint_p,
9414 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9415 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9416 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9417 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9418 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9419 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9420 bitset_stats_or_and_cmp): Likewise.
9421 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9422 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9423 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9424 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9426 * lib/abitset.h: Include bitset.h, not bbitset.h.
9427 * lib/ebitset.h: Likewise.
9428 * lib/lbitset.h: Likewise.
9430 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9431 All instances of parameters of type enum bitset_opts are now of
9432 type enum_bitset_opts, to conform to the C Standard, and similarly
9433 for enum_bitset_type.
9434 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9435 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9437 Do not use "struct bitset_struct" to mean different things in
9438 different modules. Not only is this confusing, it violates
9439 the C Standard, which requires that structure types in different
9440 modules must be compatible if one is to be passed to the other.
9441 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9442 All instances of "struct bitset_struct *" replaced with "bitset".
9443 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9444 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9445 struct lbitset_struct, struct bitset_stats_struct): New types.
9446 All uses of struct bitset_struct changed to union bitset_union,
9448 * lib/abitset.c (struct abitset_struct, abitset,
9449 struct bitset_struct): Remove.
9450 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9451 struct bitset_struct): Remove.
9452 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9453 bitset_struct): Remove.
9454 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9457 Do not call a function of type T using a call that assumes the
9458 function is of a different type U. Standard C requires that a
9459 function must be called with a type that is compatible with its
9461 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9463 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9465 * lib/ebitset.c (PFV): Remove.
9466 * lib/lbitset.c (PFV): Likewise.
9467 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9468 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9470 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9471 (ebitset_vtable): Use them.
9472 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9473 lbitset_xor): New functions.
9474 (lbitset_vtable): Use them.
9476 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9479 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9481 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9482 Use offsetof, for simplicity.
9484 2002-10-06 Paul Eggert <eggert@twinsun.com>
9486 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9487 the same width as int. This reapplies a hunk of the 2002-08-12 patch
9488 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
9489 which was inadvertently undone by the 2002-09-30 patch.
9490 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9491 the same width as int.
9493 2002-10-04 Paul Eggert <eggert@twinsun.com>
9497 * configure.ac (AC_INIT), NEWS: Increment version number.
9499 * doc/bison.texinfo: Minor spelling, grammar, and white space
9501 (Symbols): Mention that any negative value returned from yylex
9502 signifies end-of-input. Warn about negative chars. Mention
9503 the portable Standard C character set.
9505 The GNU coding standard says CFLAGS and YFLAGS are reserved
9506 for the installer to set.
9507 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9508 * src/Makefile.am (AM_CFLAGS): Likewise.
9509 (AM_YFLAGS): Renamed from YFLAGS.
9511 Fix some MAX and MIN problems.
9512 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9513 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9514 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9515 * src/reader.c (reader): Use it.
9517 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9518 POSIX 1003.1-2001 has removed fgrep.
9520 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9522 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9523 interpreted as signed.
9524 * lib/ebitset.c (ebitset_list): Fix bug.
9526 2002-10-01 Paul Eggert <eggert@twinsun.com>
9528 More fixes for 64-bit hosts and large bitsets.
9530 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9531 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9532 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9533 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9534 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9535 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9536 bitset_count_): Likewise.
9537 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9538 bitset_first, bitset_last): Likewise.
9539 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9540 bitset_stats_list_reverse, bitset_stats_size,
9541 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9543 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9544 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9545 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9546 bitsetv_reflexive_transitive_closure): Likewise.
9547 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9548 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9550 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9553 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
9554 Use size_t, not unsigned int, to count bytes.
9555 * lib/abitset.h (abitset_bytes): Likewise.
9556 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
9558 * lib/bitset.h (bitset_bytes): Likewise.
9559 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
9560 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
9561 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9562 * lib/ebitset.c (ebitset_bytes): Likewise.
9563 * lib/ebitset.h (ebitset_bytes): Likewise.
9564 * lib/lbitset.c (lbitset_bytes): Likewise.
9565 * lib/lbitset.h (lbitset_bytes): Likewise.
9567 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
9568 abitset_subset_p, abitset_disjoint_p, abitset_and,
9569 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
9570 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
9571 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
9572 abitset_or_and, abitset_or_and_cmp):
9573 Use bitset_windex instead of unsigned int.
9574 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9575 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
9576 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
9577 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
9579 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
9581 * lib/bitset.c (bitset_print):
9582 Use proper printf formats for widths of integer types.
9583 * lib/bitset_stats.c (bitset_percent_histogram_print,
9584 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
9585 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9586 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9587 * lib/lbitset.c (lbitset_bytes): Likewise.
9589 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
9590 BITSET_SIZE_MAX): New macros.
9591 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
9592 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
9593 to BITSET_WINDEX_MAX.
9595 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
9596 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
9597 since we now return the bitset_bindex type (not int).
9599 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9600 when computing sizes.
9601 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9603 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9604 and avoid cast to unsigned.
9606 2002-09-30 Akim Demaille <akim@epita.fr>
9608 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9609 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
9610 Updates from Michael Hayes.
9612 2002-09-30 Art Haas <ahaas@neosoft.com>
9614 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9616 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9619 2002-09-27 Akim Demaille <akim@epita.fr>
9623 2002-09-27 Akim Demaille <akim@epita.fr>
9625 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9626 (Because of AC_LIBSOURCE).
9628 2002-09-27 Akim Demaille <akim@epita.fr>
9630 Playing with Autoscan.
9632 * configure.ac: Remove the old LIBOBJ tweaks.
9633 (AC_REPLACE_FUNCS): Add strrchr and strtol.
9634 * lib/strrchr.c: New.
9635 * lib/strtol.c: New, from the Coreutils 4.5.1.
9637 2002-09-27 Akim Demaille <akim@epita.fr>
9639 Playing with Autoscan.
9641 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
9642 * lib/Makefile.am (libbison_a_SOURCES): No longer include
9643 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
9644 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
9647 2002-09-24 Akim Demaille <akim@epita.fr>
9649 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9650 (Frequently Asked Questions, Parser Stack Overflow): New.
9652 2002-09-13 Akim Demaille <akim@epita.fr>
9654 Playing with autoscan.
9656 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
9657 * src/files.c (skeleton_find): Remove, unused.
9658 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
9659 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
9661 2002-09-13 Akim Demaille <akim@epita.fr>
9663 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9664 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9666 2002-09-13 Akim Demaille <akim@epita.fr>
9668 * configure.ac: Require 2.54.
9669 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
9670 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
9671 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
9672 Remove, provided by Autoconf macros.
9674 2002-09-12 Akim Demaille <akim@epita.fr>
9676 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9678 2002-09-12 Akim Demaille <akim@epita.fr>
9680 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9681 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9682 Reported by Martin Mokrejs.
9684 2002-09-10 Akim Demaille <akim@epita.fr>
9686 * src/parse-gram.y: Associate a human readable string to each
9688 * tests/regression.at (Invalid inputs): Adjust.
9690 2002-09-10 Gary V. Vaughan <gary@gnu.org>
9692 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9693 with an Autoconf-2.5x style configure.ac.
9695 2002-09-06 Paul Eggert <eggert@twinsun.com>
9697 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9698 exception applies only to yacc.c. This is a modification of a
9699 patch originally suggested by Akim Demaille.
9701 2002-09-06 Akim Demaille <akim@epita.fr>
9703 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9705 * data/yacc.c: here.
9707 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9709 (b4_ltype): Default to yy::Location from location.hh.
9711 2002-09-04 Jim Meyering <jim@meyering.net>
9713 * data/yacc.c: Guard the declaration of yytoknum also with
9714 `#ifdef YYPRINT', so it is declared only when used.
9716 2002-09-04 Akim Demaille <akim@epita.fr>
9718 * configure.in: Rename as...
9719 * configure.ac: this.
9722 2002-09-04 Akim Demaille <akim@epita.fr>
9724 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9725 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9726 translate maintainer only messages.
9728 2002-08-12 Paul Eggert <eggert@twinsun.com>
9732 * Makefile.am (SUBDIRS): Remove intl.
9733 (DISTCLEANFILES): Remove.
9734 * NEWS: Mention that GNU M4 is now required. Clarify what is
9735 meant by "larger grammars". Mention the pt_BR translation.
9736 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9737 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9738 Bump version from 0.11.2 to 0.11.5.
9739 (BISON_PREREQ_STAGE): Remove.
9740 (AM_GNU_GETTEXT): Use external gettext.
9741 (AC_OUTPUT): Remove intl/Makefile.
9743 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9745 * data/glr.c: Include string.h, for strlen.
9746 (yyreportParseError): Use size_t for yysize.
9747 (yy_yypstack): No longer nested inside yypstates, as nested
9748 functions are not portable. Do not assume size_t is the
9750 (yypstates): Do not assume that ptrdiff_t is the same width
9751 as int, and similarly for yyposn and YYINDEX.
9753 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9755 * lib/Makefile.am (INCLUDES): Do not include from the intl
9756 directory, which has been removed.
9757 * src/Makefile.am (INCLUDES): Likewise.
9759 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9760 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9763 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9764 * tests/Makefile.am (EXTRA_DIST): Likewise.
9766 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9767 Do not assume that bitset_windex is the same width as unsigned.
9769 * lib/abitset.c (abitset_unused_clear): Do not assume that
9770 bitset_word is the same width as int.
9771 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9772 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9773 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9774 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9775 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9777 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9778 portability to one's complement hosts!).
9779 * lib/ebitset.c (ebitset_op1): Likewise.
9780 * lib/lbitset.c (lbitset_op1): Likewise.
9782 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9783 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9784 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9785 Sync with fileutils.
9786 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9787 lib/gettext.h: Sync with diffutils.
9789 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9790 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9792 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9793 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9796 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9797 size_t; the old version tried to do this but casted improperly.
9798 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9799 (bitset_test): Now returns int, not unsigned long.
9801 * lib/bitset_stats.c: Include "gettext.h".
9803 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9804 name locals "index", as it generates unnecessary warnings on some
9805 hosts that have an "index" function.
9807 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9808 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9809 they need translation.
9810 * src/LR0.c (state_list_append, new_itemsets, get_state,
9811 append_states, generate_states): Likewise.
9812 * src/assoc.c (assoc_to_string): Likewise.
9813 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9814 * src/gram.c (grammar_dump): Likewise.
9815 * src/injections.c (injections_compute): Likewise.
9816 * src/lalr.c (lookaheads_print): Likewise.
9817 * src/relation.c (relation_transpose): Likewise.
9818 * src/scan-gram.l: Likewise.
9819 * src/tables.c (table_grow, pack_vector): Likewise.
9821 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9822 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9823 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9824 * m4/mbstate_t.m4: Sync with fileutils.
9825 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9827 * po/LINGUAS: Add pt_BR.
9828 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9829 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9831 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9833 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9835 * src/complain.c (strerror_r): Remove decl; not needed.
9836 (strerror): Use same pattern as ../lib/error.c.
9838 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9840 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9842 * src/main.c (main): Cast result of bindtextdomain and textdomain
9843 to void, to avoid a GCC warning when --disable-nls is in effect.
9845 * src/scan-gram.l: Use strings rather than escapes when possible,
9846 to minimize the number of warnings from xgettext.
9847 (handle_action_dollar, handle_action_at): Don't use isdigit,
9848 as it mishandles negative chars and it may not work as expected
9849 outside the C locale.
9851 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
9852 this is a GCC extension and is not portable to other compilers.
9854 * src/system.h (alloca): Use same pattern as ../lib/error.c.
9855 Do not include <ctype.h>; no longer needed.
9856 Do not include <malloc.h>; no longer needed (and generates
9857 warnings on OpenBSD 3.0).
9859 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9862 * tests/regression.at: Do not use 'cc -c input.c -o input';
9863 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
9865 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
9866 exit status as failure, not just exit status 1. Sun C exits
9867 with status 2 sometimes.
9869 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9870 Use it for the two large tests.
9872 2002-08-02 Akim Demaille <akim@epita.fr>
9874 * src/conflicts.c (conflicts_output): Don't output rules never
9875 reduced here, since anyway that computation doesn't work.
9876 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
9877 (rule_useless_p, rule_never_reduced_p): New.
9878 (grammar_rules_partial_print): Use a filter instead of a range.
9879 Display the title only if needed.
9880 (grammar_rules_print): Adjust.
9881 (grammar_rules_never_reduced_report): New.
9882 * src/tables.c (action_row): Move the computation of rules never
9884 (token_actions): here.
9885 * src/main.c (main): Make the parser before making the report, so
9886 that rules never reduced are computed.
9887 Call grammar_rules_never_reduced_report.
9888 * src/print.c (print_results): Report rules never reduced.
9889 * tests/conflicts.at, tests/reduce.at: Adjust.
9891 2002-08-01 Akim Demaille <akim@epita.fr>
9893 Instead of attaching lookaheads and duplicating the rules being
9894 reduced by a state, attach the lookaheads to the reductions.
9896 * src/state.h (state_t): Remove the `lookaheads',
9897 `lookaheads_rule' member.
9898 (reductions_t): Add a `lookaheads' member.
9899 Use a regular array for the `rules'.
9900 * src/state.c (reductions_new): Initialize the lookaheads member
9902 (state_rule_lookaheads_print): Adjust.
9903 * src/state.h, src/state.c (state_reductions_find): New.
9904 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
9905 (count_rr_conflicts): Adjust.
9906 * src/lalr.c (LArule): Remove.
9907 (add_lookback_edge): Adjust.
9908 (state_lookaheads_count): New.
9909 (states_lookaheads_initialize): Merge into...
9910 (initialize_LA): this.
9911 (lalr_free): Adjust.
9912 * src/main.c (main): Don't free nullable and derives too early: it
9913 is used by --verbose.
9914 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
9916 2002-08-01 Akim Demaille <akim@epita.fr>
9918 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9920 (set_derives, free_derives): Rename as...
9921 (derives_compute, derives_free): this.
9922 Adjust all dependencies.
9923 * src/nullable.c (set_nullable, free_nullable): Rename as...
9924 (nullable_compute, nullable_free): these.
9925 (rule_list_t): Store rule_t *, not rule_number_t.
9926 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9927 pointers, instead of their numbers.
9928 * src/main.c (main): Call nullable_free, and derives_free earlier,
9929 as they were lo longer used.
9931 2002-08-01 Akim Demaille <akim@epita.fr>
9933 * lib/timevar.c (get_time): Include children time.
9934 * src/lalr.h (LA, LArule): Don't export them: used with the
9936 * src/lalr.c (LA, LArule): Static.
9937 * src/lalr.h, src/lalr.c (lalr_free): New.
9938 * src/main.c (main): Call it.
9939 * src/tables.c (pack_vector): Check whether loc is >= to the
9941 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9942 (tables_generate): do it, since that's also it which allocates
9944 Don't free LA and LArule, main does.
9946 2002-07-31 Akim Demaille <akim@epita.fr>
9948 Separate parser tables computation and output.
9950 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9951 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9952 (yydefgoto, yydefact, high): Move to...
9953 * src/tables.h, src/tables.c: here.
9954 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9955 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9956 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9957 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
9958 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
9959 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
9960 (action_row, save_row, token_actions, save_column, default_goto)
9961 (goto_actions, sort_actions, matching_state, pack_vector)
9962 (table_ninf_remap, pack_table, prepare_actions): Move to...
9963 * src/tables.c: here.
9964 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
9965 * src/output.c (token_actions, output_base, output_conflicts)
9966 (output_check): Merge into...
9967 (prepare_actions): this.
9968 (actions_output): Rename as...
9969 (user_actions_output): this.
9970 * src/main.c (main): Call tables_generate and tables_free.
9972 2002-07-31 Akim Demaille <akim@epita.fr>
9974 Steal GCC's --time-report support.
9976 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
9977 stolen/adjusted from GCC.
9978 * m4/stage.m4: Remove time related checks.
9979 * m4/timevar.m4: New.
9980 * configure.in: Adjust.
9981 * src/system.h: Adjust to using timevar.h.
9982 * src/getargs.h, src/getargs.c: Support trace_time for
9984 * src/main.c (stage): Remove.
9985 (main): Replace `stage' invocations with timevar calls.
9986 * src/output.c: Insert pertinent timevar calls.
9988 2002-07-31 Akim Demaille <akim@epita.fr>
9990 Let --trace have arguments.
9992 * src/getargs.h (enum trace_e): New.
9993 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
9994 (long_options, short_options): --trace/-T takes an optional
9996 Change all the uses of trace_flag to reflect the new flags.
9997 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
9999 Strengthen `stage' portability.
10001 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10002 * configure.in: Use it.
10003 Don't check for malloc.h and sys/times.h.
10004 * src/system.h: Include them when appropriate.
10005 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10006 times and struct tms are available.
10008 2002-07-30 Akim Demaille <akim@epita.fr>
10010 In verbose parse error message, don't report `error' as an
10012 * tests/actions.at (Printers and Destructors): Adjust.
10013 * tests/calc.at (Calculator $1): Adjust.
10014 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10015 error message, do not report the parser accepts the error token in
10018 2002-07-30 Akim Demaille <akim@epita.fr>
10020 Normalize conflict related messages.
10022 * src/complain.h, src/complain.c (warn, complain): New.
10023 * src/conflicts.c (conflicts_print): Use them.
10024 (conflict_report_yacc): New, extracted from...
10025 (conflicts_print): here.
10026 * tests/conflicts.at, tests/existing.at: Adjust.
10028 2002-07-30 Akim Demaille <akim@epita.fr>
10030 Report rules which are never reduced by the parser: those hidden
10033 * src/LR0.c (save_reductions): Don't make the final state too
10034 different: save its reduction (accept) instead of having a state
10035 without any action (no shift or goto, no reduce).
10036 Note: the final state is now a ``regular'' state, i.e., the
10037 parsers now contain `reduce 0' as default reduction.
10038 Nevertheless, since they decide to `accept' when yystate =
10039 final_state, they still will not reduce rule 0.
10040 * src/print.c (print_actions, print_reduction): Adjust.
10041 * src/output.c (action_row): Track reduced rules.
10042 (token_actions): Report rules never reduced.
10043 * tests/conflicts.at, tests/regression.at: Adjust.
10045 2002-07-30 Akim Demaille <akim@epita.fr>
10047 `stage' was accidently included in a previous patch.
10048 Initiate its autoconfiscation.
10050 * configure.in: Look for malloc.h and sys/times.h.
10051 * src/main.c (stage): Adjust.
10052 Report only when trace_flag.
10054 2002-07-29 Akim Demaille <akim@epita.fr>
10056 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10058 (errs_t): symbol_t*, not symbol_number_t.
10059 (reductions_t): rule_t*, not rule_number_t.
10060 (FOR_EACH_SHIFT): New.
10061 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10062 * src/print.c, src/print_graph.c: Adjust.
10064 2002-07-29 Akim Demaille <akim@epita.fr>
10066 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10068 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10069 (endtoken, accept): these.
10070 * src/reader.c (reader): Set endtoken's default tag to "$end".
10071 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10072 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10075 2002-07-29 Akim Demaille <akim@epita.fr>
10077 * src/reduce.c (reduce_grammar): When the language is empty,
10078 complain about the start symbol, not the axiom.
10080 * tests/reduce.at (Empty Language): New.
10082 2002-07-26 Akim Demaille <akim@epita.fr>
10084 * src/reader.h, src/reader.c (gram_error): ... can't get
10085 yycontrol without making too strong assumptions on the parser
10087 * src/output.c (prepare_tokens): Use the real 0th value of
10088 token_translations instead of `0'.
10089 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10091 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10092 for the time being: %locations ought to provide it to yyerror.
10094 2002-07-25 Akim Demaille <akim@epita.fr>
10096 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10097 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10098 * tests/regression.at (Web2c Actions): Adjust.
10100 2002-07-25 Akim Demaille <akim@epita.fr>
10102 Stop storing rules from 1 to nrules + 1.
10104 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10105 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10106 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10107 Iterate from 0 to nrules.
10108 Use rule_number_as_item_number and item_number_as_rule_number.
10109 Adjust to `derive' now containing possibly 0.
10110 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10111 Handle the `- 1' part in rule numbers from/to item numbers.
10112 * src/conflicts.c (log_resolution): Fix the message which reversed
10114 * src/output.c (action_row): Initialize default_rule to -1.
10115 (token_actions): Adjust.
10116 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10118 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10120 2002-07-25 Akim Demaille <akim@epita.fr>
10122 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10123 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10124 (b4_c_knr_arg_decl): New.
10125 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10126 yyreport_parse_error.
10128 2002-07-25 Akim Demaille <akim@epita.fr>
10130 * data/yacc.c (yyreport_parse_error): New, extracted from...
10132 (yydestruct, yysymprint): Move above yyparse.
10135 2002-07-25 Akim Demaille <akim@epita.fr>
10137 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10139 (b4_sint_type, b4_uint_type): these.
10140 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10141 * tests/regression.at (Web2c Actions): Adjust.
10143 2002-07-25 Akim Demaille <akim@epita.fr>
10145 * src/gram.h (TIEM_NUMBER_MAX): New.
10146 (item_number_of_rule_number, rule_number_of_item_number): Rename
10148 (rule_number_as_item_number, item_number_as_rule_number): these.
10149 Adjust dependencies.
10150 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10151 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10152 (symbol_number_to_vector_number): New.
10153 (order): Of vector_number_t* type.
10154 (base_t, BASE_MAX, BASE_MIN): New.
10155 (froms, tos, width, pos, check): Of base_t type.
10156 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10157 (actrow): Of action_number_t type.
10158 (conflrow): Of unsigned int type.
10159 (table_ninf, base_ninf): New.
10160 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10161 (muscle_insert_int_table, muscle_insert_base_table)
10162 (muscle_insert_rule_number_table): New.
10163 (prepare_tokens): Output `toknum' as int_table.
10164 (action_row): Returns a rule_number_t.
10165 Use ACTION_MIN, not SHRT_MIN.
10166 (token_actions): yydefact is rule_number_t*.
10167 (table_ninf_remap): New.
10168 (pack_table): Use it for `base' and `table'.
10169 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10171 (YYPACT_NINF, YYTABLE_NINF): these.
10172 (yypact, yytable): Compute their types instead of hard-coded
10174 * tests/regression.at (Web2c Actions): Adjust.
10176 2002-07-19 Akim Demaille <akim@epita.fr>
10178 * src/scan-gram.l (id): Can start with an underscore.
10180 2002-07-16 Akim Demaille <akim@epita.fr>
10182 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10183 Adjust all former `associativity' dependencies.
10184 * src/symtab.c (symbol_new): Default associativity is `undef', not
10186 (symbol_check_alias_consistence): Adjust.
10188 2002-07-09 Akim Demaille <akim@epita.fr>
10190 * doc/bison.texinfo: Properly set the ``header'' part.
10191 Use @dircategory ``GNU programming tools'' as per Texinfo's
10195 2002-07-09 Akim Demaille <akim@epita.fr>
10197 * lib/quotearg.h: Protect against multiple inclusions.
10198 * src/location.h (location_t): Add a `file' member.
10199 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10200 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10201 `error_one_per_line' support.
10203 2002-07-09 Akim Demaille <akim@epita.fr>
10205 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10206 * src/reader.c (lineno): Remove.
10207 Adjust all dependencies.
10208 (get_merge_function): Take a location and use complain_at.
10209 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10210 * tests/regression.at (Invalid inputs, Mixing %token styles):
10213 2002-07-09 Akim Demaille <akim@epita.fr>
10215 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10216 recovery rule, and forbid extensions when --yacc.
10217 (gram_error): Use complain_at.
10218 * src/reader.c (reader): Exit if there were parse errors.
10220 2002-07-09 Akim Demaille <akim@epita.fr>
10222 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10223 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10224 Reported by R Blake <blakers@mac.com>.
10226 2002-07-09 Akim Demaille <akim@epita.fr>
10228 * data/yacc.c: Output the copyright notive in the header.
10230 2002-07-03 Akim Demaille <akim@epita.fr>
10232 * src/output.c (froms, tos): Are state_number_t.
10233 (save_column): sp, sp1, and sp2 are state_number_t.
10234 (prepare): Rename `final' as `final_state_number', `nnts' as
10235 `nterms_number', `nrules' as `rules_number', `nstates' as
10236 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10238 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10239 * data/lalr1.cc (nsym_): Remove, unused.
10241 2002-07-03 Akim Demaille <akim@epita.fr>
10243 * src/lalr.h, src/lalr.c (goto_number_t): New.
10244 * src/lalr.c (goto_list_t): New.
10246 * src/nullable.c (rule_list_t): New.
10248 * src/types.h: Remove.
10250 2002-07-03 Akim Demaille <akim@epita.fr>
10252 * src/closure.c (print_fderives): Use rule_rhs_print.
10253 * src/derives.c (print_derives): Use rule_rhs_print.
10254 (rule_list_t): New, replaces `shorts'.
10255 (set_derives): Add comments.
10256 * tests/sets.at (Nullable, Firsts): Adjust.
10258 2002-07-03 Akim Demaille <akim@epita.fr>
10260 * src/output.c (prepare_actions): Free `tally' and `width'.
10261 (prepare_actions): Allocate and free `order'.
10262 * src/symtab.c (symbols_free): Free `symbols'.
10263 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10264 * src/output.c (m4_invoke): Move to...
10265 * src/scan-skel.l: here.
10266 (<<EOF>>): Close yyout, and free its name.
10268 2002-07-03 Akim Demaille <akim@epita.fr>
10270 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10272 * src/LR0.c (new_state): Merge into...
10273 (state_list_append): this.
10274 (new_states): Merge into...
10275 (generate_states): here.
10276 (set_states): Don't ensure a proper `errs' state member here, do it...
10277 * src/conflicts.c (conflicts_solve): here.
10278 * src/state.h, src/state.c: Comment changes.
10279 (state_t): Rename member `shifts' as `transitions'.
10280 Adjust all dependencies.
10281 (errs_new): For consistency, also take the values as argument.
10282 (errs_dup): Remove.
10283 (state_errs_set): New.
10284 (state_reductions_set, state_transitions_set): Assert that no
10285 previous value was assigned.
10287 (states_free): Use it.
10288 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10289 temporary storage: use `errs' and `nerrs' as elsewhere.
10290 (set_conflicts): Allocate and free this `errs'.
10292 2002-07-02 Akim Demaille <akim@epita.fr>
10294 * lib/libiberty.h: New.
10295 * lib: Update the bitset implementation from upstream.
10296 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10297 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10298 * src/main.c: Adjust bitset stats calls.
10300 2002-07-01 Paul Eggert <eggert@twinsun.com>
10302 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10303 char, so that negative chars don't collide with $.
10305 2002-06-30 Akim Demaille <akim@epita.fr>
10307 Have the GLR tests be `warning' checked, and fix the warnings.
10309 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10310 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10311 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10312 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10313 (yyaddDeferredAction): static.
10314 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10315 (yyreportParseError): yyprefix is const.
10316 yytokenp is used only when verbose.
10317 (yy__GNUC__): Replace with __GNUC__.
10318 (yypdumpstack): yyi is size_t.
10319 (yypreference): Un-yy local variables and arguments, to avoid
10320 clashes with `yyr1'. Anyway, we are not in the user name space.
10321 (yytname_size): be an int, as is compared with ints.
10322 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10324 * tests/cxx-gram.at: Use quotation to protect $1.
10325 Use AT_COMPILE to enable warnings hunts.
10326 Prototype yylex and yyerror.
10328 Include `string.h', not `strings.h'.
10329 Produce and prototype stmtMerge only when used.
10330 yylex takes a location.
10332 2002-06-30 Akim Demaille <akim@epita.fr>
10334 We spend a lot of time in quotearg, in particular when --verbose.
10336 * src/symtab.c (symbol_get): Store a quoted version of the key.
10337 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10338 Adjust all callers.
10340 2002-06-30 Akim Demaille <akim@epita.fr>
10342 * src/state.h (reductions_t): Rename member `nreds' as num.
10343 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10344 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10346 2002-06-30 Akim Demaille <akim@epita.fr>
10348 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10349 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10350 (shifts_to): Rename as...
10351 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10352 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10353 (TRANSITION_IS_DISABLED, transitions_to): these.
10355 2002-06-30 Akim Demaille <akim@epita.fr>
10357 * src/print.c (print_shifts, print_gotos): Merge into...
10358 (print_transitions): this.
10359 (print_transitions, print_errs, print_reductions): Align the
10360 lookaheads columns.
10361 (print_core, print_transitions, print_errs, print_state,
10362 print_grammar): Output empty lines separator before, not after.
10363 (state_default_rule_compute): Rename as...
10364 (state_default_rule): this.
10365 * tests/conflicts.at (Defaulted Conflicted Reduction),
10366 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10367 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10369 2002-06-30 Akim Demaille <akim@epita.fr>
10371 Display items as we display rules.
10373 * src/gram.h, src/gram.c (rule_lhs_print): New.
10374 * src/gram.c (grammar_rules_partial_print): Use it.
10375 * src/print.c (print_core): Likewise.
10376 * tests/conflicts.at (Defaulted Conflicted Reduction),
10377 (Unresolved SR Conflicts): Adjust.
10378 (Unresolved SR Conflicts): Adjust and rename as...
10379 (Resolved SR Conflicts): this, as was meant.
10380 * tests/regression.at (Web2c Report): Adjust.
10382 2002-06-30 Akim Demaille <akim@epita.fr>
10384 * src/print.c (state_default_rule_compute): New, extracted from...
10385 (print_reductions): here.
10386 Pessimize, but clarify the code.
10387 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10389 2002-06-30 Akim Demaille <akim@epita.fr>
10391 * src/output.c (action_row): Let default_rule be always a rule
10394 2002-06-30 Akim Demaille <akim@epita.fr>
10396 * src/closure.c (print_firsts, print_fderives, closure):
10397 Use BITSET_EXECUTE.
10398 * src/lalr.c (lookaheads_print): Likewise.
10399 * src/state.c (state_rule_lookaheads_print): Likewise.
10400 * src/print_graph.c (print_core): Likewise.
10401 * src/print.c (print_reductions): Likewise.
10402 * src/output.c (action_row): Likewise.
10403 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10405 2002-06-30 Akim Demaille <akim@epita.fr>
10407 * src/print_graph.c: Use report_flag.
10409 2002-06-30 Akim Demaille <akim@epita.fr>
10411 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10413 * src/relation.h, src/relation.c (traverse, relation_digraph)
10414 (relation_print, relation_transpose): New.
10416 2002-06-30 Akim Demaille <akim@epita.fr>
10418 * src/state.h, src/state.c (shifts_to): New.
10419 * src/lalr.c (build_relations): Use it.
10421 2002-06-30 Akim Demaille <akim@epita.fr>
10423 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10424 (item_number_of_rule_number, rule_number_of_item_number): New.
10425 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10426 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10427 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10428 Propagate their use.
10429 Much remains to be done, in particular wrt `shorts' from types.h.
10431 2002-06-30 Akim Demaille <akim@epita.fr>
10433 * src/symtab.c (symbol_new): Initialize the `printer' member.
10435 2002-06-30 Akim Demaille <akim@epita.fr>
10437 * src/LR0.c (save_reductions): Remove, replaced by...
10438 * src/state.h, src/state.c (state_reductions_set): New.
10439 (reductions, errs): Rename as...
10440 (reductions_t, errs_t): these.
10441 Adjust all dependencies.
10443 2002-06-30 Akim Demaille <akim@epita.fr>
10445 * src/LR0.c (state_list_t, state_list_append): New.
10446 (first_state, last_state): Now symbol_list_t.
10447 (this_state): Remove.
10448 (new_itemsets, append_states, save_reductions): Take a state_t as
10450 (set_states, generate_states): Adjust.
10451 (save_shifts): Remove, replaced by...
10452 * src/state.h, src/state.c (state_shifts_set): New.
10453 (shifts): Rename as...
10455 Adjust all dependencies.
10456 * src/state.h (state_t): Remove the `next' member.
10458 2002-06-30 Akim Demaille <akim@epita.fr>
10460 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10463 2002-06-30 Akim Demaille <akim@epita.fr>
10465 Use hash.h for the state hash table.
10467 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10468 (allocate_storage): Use state_hash_new.
10469 (free_storage): Use state_hash_free.
10470 (new_state, get_state): Adjust.
10471 * src/lalr.h, src/lalr.c (states): Move to...
10472 * src/states.h (state_t): Remove the `link' member, no longer
10474 * src/states.h, src/states.c: here.
10475 (state_hash_new, state_hash_free, state_hash_lookup)
10476 (state_hash_insert, states_free): New.
10477 * src/states.c (state_table, state_compare, state_hash): New.
10478 * src/output.c (output_actions): Do not free states now, since we
10479 still need to know the final_state number in `prepare', called
10480 afterwards. Do it...
10481 * src/main.c (main): here: call states_free after `output'.
10483 2002-06-30 Akim Demaille <akim@epita.fr>
10485 * src/state.h, src/state.c (state_new): New, extracted from...
10486 * src/LR0.c (new_state): here.
10487 * src/state.h (STATE_ALLOC): Move to...
10488 * src/state.c: here.
10489 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10490 * src/state.h, src/state.c: here.
10492 2002-06-30 Akim Demaille <akim@epita.fr>
10494 * src/reader.c (gensym): Rename as...
10495 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10496 (getsym): Rename as...
10497 (symbol_get): this.
10499 2002-06-30 Akim Demaille <akim@epita.fr>
10501 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10502 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10503 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10504 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10506 2002-06-30 Akim Demaille <akim@epita.fr>
10508 Make the test suite pass with warnings checked.
10510 * tests/actions.at (Printers and Destructors): Improve.
10511 Avoid unsigned vs. signed issues.
10512 * tests/calc.at: Don't exercise the scanner here, do it...
10513 * tests/input.at (Torturing the Scanner): here.
10515 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10517 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
10518 reorganize first lines parallel to yacc.c.
10520 2002-06-28 Akim Demaille <akim@epita.fr>
10522 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10523 (b4_token_enum, b4_token_defines): New, factored from...
10524 * data/lalr1.cc, data/yacc.c, glr.c: here.
10526 2002-06-28 Akim Demaille <akim@epita.fr>
10528 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10530 * src/output.c (merger_output): static.
10532 2002-06-28 Akim Demaille <akim@epita.fr>
10534 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
10535 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10537 * src/output.c (save_row): Initialize all the variables to pacify GCC.
10539 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10541 Accumulated changelog for new GLR parsing features.
10543 * src/conflicts.c (count_total_conflicts): Change name to
10544 conflicts_total_count.
10545 * src/conflicts.h: Ditto.
10546 * src/output.c (token_actions): Use the new name.
10547 (output_conflicts): Change conflp => conflict_list_heads, and
10548 confl => conflict_list for better readability.
10549 * data/glr.c: Use the new names.
10550 * NEWS: Add self to GLR announcement.
10552 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10554 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10557 * data/bison.glr: Change name to glr.c
10558 * data/glr.c: Renamed from bison.glr.
10559 * data/Makefile.am: Add glr.c
10563 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
10564 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
10566 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10568 * data/bison.glr: Be sure to restore the
10569 current #line when returning to the skeleton contents after having
10570 exposed the input file's #line.
10572 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10574 * data/bison.glr: Bring up to date with changes to bison.simple.
10576 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10578 * data/bison.glr: Correct definitions that use b4_prefix.
10579 Various reformatting.
10580 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
10581 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
10582 yytokenp argument; now part of stack.
10583 (yychar): Define to behave as documented.
10584 (yyclearin): Ditto.
10586 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10588 * src/reader.h: Add declaration for free_merger_functions.
10590 * src/reader.c (merge_functions): New variable.
10591 (get_merge_function): New function.
10592 (free_merger_functions): New function.
10593 (readgram): Check for %prec that is not followed by a symbol.
10594 Handle %dprec and %merge declarations.
10595 (packgram): Initialize dprec and merger fields in rules array.
10597 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
10598 conflict_list_cnt, conflict_list_free): New variables.
10599 (table_grow): Also grow conflict_table.
10600 (prepare_rules): Output dprec and merger tables.
10601 (conflict_row): New function.
10602 (action_row): Output conflict lists for GLR parser. Don't use
10603 default reduction in conflicted states for GLR parser so that there
10604 are spaces for the conflict lists.
10605 (save_row): Also save conflict information.
10606 (token_actions): Allocate conflict list.
10607 (merger_output): New function.
10608 (pack_vector): Pack conflict table, too.
10609 (output_conflicts): New function to output yyconflp and yyconfl.
10610 (output_check): Allocate conflict_tos.
10611 (output_actions): Output conflict tables, also.
10612 (output_skeleton): Output b4_mergers definition.
10613 (prepare): Output b4_max_rhs_length definition.
10614 Use 'bison.glr' as default skeleton for GLR parsers.
10616 * src/gram.c (glr_parser): New flag.
10617 (grammar_free): Call free_merger_functions.
10619 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
10620 all pairs of conflicting reductions, rather than just all tokens
10621 causing conflicts. Needed to size conflict tables.
10622 (conflicts_output): Modify call to count_rr_conflicts for new
10624 (conflicts_print): Ditto.
10625 (count_total_conflicts): New function.
10627 * src/reader.h (merger_list): New type.
10628 (merge_functions): New variable.
10630 * src/lex.h (tok_dprec, tok_merge): New token types.
10632 * src/gram.h (rule_s): Add dprec and merger fields.
10633 (glr_parser): New flag.
10635 * src/conflicts.h (count_total_conflicts): New function.
10637 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10639 * doc/bison.texinfo (Generalized LR Parsing): New section.
10640 (GLR Parsers): New section.
10641 (Language and Grammar): Mention GLR parsing.
10642 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
10643 Correct typo ("tge" -> "the").
10645 * data/bison.glr: New skeleton for GLR parsing.
10647 * tests/cxx-gram.at: New tests for GLR parsing.
10649 * tests/testsuite.at: Include cxx-gram.at.
10651 * tests/Makefile.am: Add cxx-gram.at.
10653 * src/parse-gram.y:
10655 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10657 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
10659 2002-06-27 Akim Demaille <akim@epita.fr>
10661 * src/options.h, src/options.c: Remove.
10662 * src/getargs.c (short_options, long_options): New.
10664 2002-06-27 Akim Demaille <akim@epita.fr>
10666 * data/bison.simple, data/bison.c++: Rename as...
10667 * data/yacc.c, data/lalr1.cc: these.
10668 * doc/bison.texinfo (Environment Variables): Remove.
10670 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10672 * src/getargs.c (report_argmatch): Initialize strtok().
10674 2002-06-20 Akim Demaille <akim@epita.fr>
10676 * data/bison.simple (b4_symbol_actions): New, replaces...
10677 (b4_symbol_destructor, b4_symbol_printer): these.
10678 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10679 user token numbers.
10681 2002-06-20 Akim Demaille <akim@epita.fr>
10683 * data/bison.simple (yydestructor): Rename as...
10684 (yydestruct): this.
10686 2002-06-20 Akim Demaille <akim@epita.fr>
10688 * src/symtab.h, src/symtab.c (symbol_type_set)
10689 (symbol_destructor_set, symbol_precedence_set): The location is
10691 Adjust all callers.
10693 2002-06-20 Akim Demaille <akim@epita.fr>
10695 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10697 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10699 * src/symtab.h, src/symtab.c (symbol_class_set)
10700 (symbol_user_token_number_set): Likewise.
10701 Adjust all callers.
10702 Promote complain_at.
10703 * tests/input.at (Type Clashes): Adjust.
10705 2002-06-20 Akim Demaille <akim@epita.fr>
10707 * data/bison.simple (YYLEX): Fix the declaration when
10710 2002-06-20 Akim Demaille <akim@epita.fr>
10712 * data/bison.simple (yysymprint): Don't print the token number,
10714 * tests/actions.at (Destructors): Rename as...
10715 (Printers and Destructors): this.
10716 Also exercise %printer.
10718 2002-06-20 Akim Demaille <akim@epita.fr>
10720 * data/bison.simple (YYDSYMPRINT): New.
10721 Use it to remove many of the #if YYDEBUG/if (yydebug).
10723 2002-06-20 Akim Demaille <akim@epita.fr>
10725 * src/symtab.h, src/symtab.c (symbol_t): printer and
10726 printer_location are new members.
10727 (symbol_printer_set): New.
10728 * src/parse-gram.y (PERCENT_PRINTER): New token.
10729 Handle its associated rule.
10730 * src/scan-gram.l: Adjust.
10731 (handle_destructor_at, handle_destructor_dollar): Rename as...
10732 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10733 * src/output.c (symbol_printers_output): New.
10734 (output_skeleton): Call it.
10735 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10736 since there are already many grammar files with a user `yyprint'.
10737 Replace the calls to YYPRINT to calls to yysymprint.
10738 * tests/calc.at: Adjust.
10739 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10740 taking advantage of parser very internal details (stack size!).
10742 2002-06-20 Akim Demaille <akim@epita.fr>
10744 * src/scan-gram.l: Complete the scanner with the missing patterns
10746 Use `quote' and `symbol_tag_get' where appropriate.
10748 2002-06-19 Akim Demaille <akim@epita.fr>
10750 * tests/actions.at (Destructors): Augment to test locations.
10751 * data/bison.simple (yydestructor): Pass it the current location
10752 if locations are enabled.
10753 Prototype only when __STDC__ or C++.
10754 Change the argument names to move into the yy name space: there is
10757 2002-06-19 Akim Demaille <akim@epita.fr>
10759 * data/bison.simple (b4_pure_if): New.
10760 Use it instead of #ifdef YYPURE.
10762 2002-06-19 Akim Demaille <akim@epita.fr>
10764 * data/bison.simple (b4_location_if): New.
10765 Use it instead of #ifdef YYLSP_NEEDED.
10767 2002-06-19 Akim Demaille <akim@epita.fr>
10769 Prepare @$ in %destructor, but currently don't bind it in the
10770 skeleton, as %location use is not cleaned up yet.
10772 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10773 (handle_action_at): New.
10774 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10775 a braced_code_t and a location as additional arguments.
10776 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10777 unquote one when outputting `b4_dollar_dollar'.
10779 * data/bison.simple (b4_eval): Remove.
10780 (b4_symbol_destructor): Adjust.
10781 * tests/input.at (Invalid @n): Adjust.
10783 2002-06-19 Zack Weinberg <zack@codesourcery.com>
10785 * doc/bison.texinfo: Document ability to have multiple
10788 2002-06-18 Akim Demaille <akim@epita.fr>
10790 * src/files.c (compute_base_names): When computing the output file
10791 names from the input file name, strip the directory part.
10793 2002-06-18 Akim Demaille <akim@epita.fr>
10795 * data/bison.simple.new: Comment changes.
10796 Reported by Andreas Schwab.
10798 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10800 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10801 there are no `label `yyoverflowlab' defined but not used' warnings
10802 when yyoverflow is defined.
10804 2002-06-18 Akim Demaille <akim@epita.fr>
10806 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10808 (symbol_destructor_set): Adjust.
10809 * src/output.c (symbol_destructors_output): Output the destructor
10811 Output the symbol name.
10812 * data/bison.simple (b4_symbol_destructor): Adjust.
10814 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10815 and Akim Demaille <akim@epita.fr>
10817 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10818 what's left on the stack when the error recovery hits EOF.
10819 * tests/actions.at (Destructors): Complete to exercise this case.
10821 2002-06-17 Akim Demaille <akim@epita.fr>
10823 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10824 arguments is really empty, not only equal to `[]'.
10825 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10827 (symbol_destructor_set): New.
10828 * src/output.c (symbol_destructors_output): New.
10829 * src/reader.h (brace_code_t, current_braced_code): New.
10830 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10831 (handle_dollar): Rename as...
10832 (handle_action_dollar): this.
10833 (handle_destructor_dollar): New.
10834 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10835 (grammar_declaration): Use it.
10836 * data/bison.simple (yystos): Is always defined.
10837 (yydestructor): New.
10838 * tests/actions.at (Destructors): New.
10839 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10841 2002-06-17 Akim Demaille <akim@epita.fr>
10843 * src/symlist.h, src/symlist.c (symbol_list_length): New.
10844 * src/scan-gram.l (handle_dollar, handle_at): Compute the
10845 rule_length only when needed.
10846 * src/output.c (actions_output, token_definitions_output): Output
10848 * src/symtab.c: Don't access directly to the symbol tag, use
10850 * src/parse-gram.y: Use symbol_list_free.
10852 2002-06-17 Akim Demaille <akim@epita.fr>
10854 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
10855 (symbol_list_prepend, get_type_name): Move to...
10856 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
10857 (symbol_list_prepend, symbol_list_n_type_name_get): here.
10858 Adjust all callers.
10859 (symbol_list_free): New.
10860 * src/scan-gram.l (handle_dollar): Takes a location.
10861 * tests/input.at (Invalid $n): Adjust.
10863 2002-06-17 Akim Demaille <akim@epita.fr>
10865 * src/reader.h, src/reader.c (symbol_list_new): Export it.
10866 (symbol_list_prepend): New.
10867 * src/parse-gram.y (%union): `list' is a new member.
10868 (symbols.1): New, replaces...
10869 (terms_to_prec.1, nterms_to_type.1): these.
10870 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
10871 Take a location as additional argument.
10872 Adjust all callers.
10874 2002-06-15 Akim Demaille <akim@epita.fr>
10876 * src/parse-gram.y: Move %token in the declaration section so that
10877 we don't depend upon CVS Bison.
10879 2002-06-15 Akim Demaille <akim@epita.fr>
10881 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10882 * src/print.c (print_core): Use it.
10884 2002-06-15 Akim Demaille <akim@epita.fr>
10886 * src/conflicts.c (log_resolution): Accept the rule involved in
10887 the sr conflicts instead of the lookahead number that points to
10889 (flush_reduce): Accept the current lookahead vector as argument,
10890 instead of the index in LA.
10891 (resolve_sr_conflict): Accept the current number of lookahead
10892 bitset to consider for the STATE, instead of the index in LA.
10893 (set_conflicts): Adjust.
10894 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
10896 2002-06-15 Akim Demaille <akim@epita.fr>
10898 * src/state.h (state_t): Replace the `lookaheadsp' member, a
10899 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
10900 Adjust all dependencies.
10901 * src/lalr.c (initialize_lookaheads): Split into...
10902 (states_lookaheads_count, states_lookaheads_initialize): these.
10905 2002-06-15 Akim Demaille <akim@epita.fr>
10907 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10909 (grammar_rules_print): here.
10910 * src/reduce.c (reduce_output): Use it.
10911 * tests/reduce.at (Useless Rules, Reduced Automaton)
10912 (Underivable Rules): Adjust.
10914 2002-06-15 Akim Demaille <akim@epita.fr>
10916 Copy BYacc's nice way to report the grammar.
10918 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10920 Don't print the rules' location, it is confusing and useless.
10921 (rule_print): Use grammar_rhs_print.
10922 * src/print.c (print_grammar): Use grammar_rules_print.
10924 2002-06-15 Akim Demaille <akim@epita.fr>
10926 Complete and rationalize `useless thing' warnings.
10928 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10929 (symbol_tag_print): New.
10930 Use them everywhere in place of accessing directly the tag member.
10931 * src/gram.h, src/gram.c (rule_print): New.
10932 Use it where a rule used to be printed `by hand'.
10933 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10934 (reduce_grammar_tables): Report the useless rules.
10935 (reduce_print): Useless things are a warning, not an error.
10937 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10938 (Reduced Automaton, Underivable Rules): Adjust.
10939 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10940 * tests/conflicts.at (Unresolved SR Conflicts)
10941 (Solved SR Conflicts): Adjust.
10943 2002-06-15 Akim Demaille <akim@epita.fr>
10945 Let symbols have a location.
10947 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10949 Adjust all callers.
10950 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10951 Use location_t, not int.
10952 * src/symtab.c (symbol_check_defined): Take advantage of the
10954 * tests/regression.at (Invalid inputs): Adjust.
10956 2002-06-15 Akim Demaille <akim@epita.fr>
10958 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10959 (input): Don't try to initialize yylloc here, do it in the
10961 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
10962 * src/gram.h (rule_t): Change line and action_line into location
10963 and action_location, of location_t type.
10964 Adjust all dependencies.
10965 * src/location.h, src/location.c (empty_location): New.
10966 * src/reader.h, src/reader.c (grammar_start_symbol_set)
10967 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
10968 (grammar_current_rule_symbol_append)
10969 (grammar_current_rule_action_append): Expect a location as argument.
10970 * src/reader.c (grammar_midrule_action): Adjust to attach an
10971 action's location as dummy symbol location.
10972 * src/symtab.h, src/symtab.c (startsymbol_location): New.
10973 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
10976 2002-06-14 Akim Demaille <akim@epita.fr>
10978 Grammar declarations may be found in the grammar section.
10980 * src/parse-gram.y (rules_or_grammar_declaration): New.
10981 (declarations): Each declaration may end with a semicolon, not
10983 (grammar_declaration): `"%union"'.
10984 (grammar): Branch to rules_or_grammar_declaration.
10986 2002-06-14 Akim Demaille <akim@epita.fr>
10988 * src/main.c (main): Invoke scanner_free.
10990 2002-06-14 Akim Demaille <akim@epita.fr>
10992 * src/output.c (m4_invoke): Extracted from...
10993 (output_skeleton): here.
10996 2002-06-14 Akim Demaille <akim@epita.fr>
10998 * src/parse-gram.y (directives, directive, gram)
10999 (grammar_directives, precedence_directives, precedence_directive):
11001 (declarations, declaration, grammar, grammar_declaration)
11002 (precedence_declaration, precedence_declarator): these.
11003 (symbol_declaration): New.
11005 2002-06-14 Akim Demaille <akim@epita.fr>
11007 * src/files.c (action_obstack): Remove, unused.
11008 (output_obstack): Remove it, and all its dependencies, as it is no
11010 * src/reader.c (epilogue_set): Build the epilogue in the
11012 * src/output.h, src/output.c (muscle_obstack): Move to...
11013 * src/muscle_tab.h, src/muscle_tab.h: here.
11014 (muscle_init): Initialize muscle_obstack.
11015 (muscle_free): New.
11016 * src/main.c (main): Call it.
11018 2002-06-14 Akim Demaille <akim@epita.fr>
11020 * src/location.h: New, extracted from...
11021 * src/reader.h: here.
11022 * src/Makefile.am (noinst_HEADERS): Merge into
11023 (bison_SOURCES): this.
11025 * src/parse-gram.y: Use location_t instead of Bison's.
11026 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11027 Use location_t instead of ints.
11029 2002-06-14 Akim Demaille <akim@epita.fr>
11031 * data/bison.simple, data/bison.c++: Be sure to restore the
11032 current #line when returning to the skeleton contents after having
11033 exposed the input file's #line.
11035 2002-06-12 Akim Demaille <akim@epita.fr>
11037 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11039 * tests/actions.at (Exotic Dollars): New.
11041 2002-06-12 Akim Demaille <akim@epita.fr>
11043 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11045 * tests/input.at (Torturing the Scanner): New.
11047 2002-06-11 Akim Demaille <akim@epita.fr>
11049 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11050 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11051 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11052 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11053 * src/reader.c (reader): Use it.
11055 2002-06-11 Akim Demaille <akim@epita.fr>
11057 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11058 Adjust all callers.
11059 (scanner_last_string_free): New.
11061 2002-06-11 Akim Demaille <akim@epita.fr>
11063 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11064 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11065 (last_string, YY_OBS_FREE): New.
11066 Use them when returning an ID.
11068 2002-06-11 Akim Demaille <akim@epita.fr>
11070 Have Bison grammars parsed by a Bison grammar.
11072 * src/reader.c, src/reader.h (prologue_augment): New.
11073 * src/reader.c (copy_definition): Remove.
11075 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11076 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11077 (grammar_current_rule_prec_set, grammar_current_rule_check)
11078 (grammar_current_rule_symbol_append)
11079 (grammar_current_rule_action_append): Export.
11080 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11081 (symbol_list_action_append): Remove.
11082 Hook the routines from reader.
11083 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11084 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11086 * src/reader.c (read_declarations): Remove, unused.
11088 * src/parse-gram.y: Handle the epilogue.
11089 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11090 (grammar_start_symbol_set): this.
11091 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11092 * src/reader.c (readgram): Remove, unused.
11093 (reader): Adjust to insert eoftoken and axiom where appropriate.
11095 * src/reader.c (copy_dollar): Replace with...
11096 * src/scan-gram.h (handle_dollar): this.
11097 * src/parse-gram.y: Remove `%thong'.
11099 * src/reader.c (copy_at): Replace with...
11100 * src/scan-gram.h (handle_at): this.
11102 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11105 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11108 * src/reader.h, src/reader.c (grammar_rule_end): New.
11110 * src/parse.y (current_type, current_class): New.
11111 Implement `%nterm', `%token' support.
11112 Merge `%term' into `%token'.
11113 (string_as_id): New.
11114 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11117 * src/parse-gram.y: Be sure to handle properly the beginning of
11120 * src/parse-gram.y: Handle %type.
11121 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11123 * src/parse-gram.y: More directives support.
11124 * src/options.c: No longer handle source directives.
11126 * src/parse-gram.y: Fix %output.
11128 * src/parse-gram.y: Handle %union.
11129 Use the prologue locations.
11130 * src/reader.c (parse_union_decl): Remove.
11132 * src/reader.h, src/reader.c (epilogue_set): New.
11133 * src/parse-gram.y: Use it.
11135 * data/bison.simple, data/bison.c++: b4_stype is now either not
11136 defined, then default to int, or to the contents of %union,
11137 without `union' itself.
11139 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11141 * src/output.c (actions_output): Don't output braces, as they are
11142 already handled by the scanner.
11144 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11145 characters to themselves.
11147 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11148 that the epilogue has a proper #line.
11150 * src/parse-gram.y: Handle precedence/associativity.
11152 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11154 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11155 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11156 at all to define terminals that cannot be emitted.
11158 * src/scan-gram.l: Escape M4 characters.
11160 * src/scan-gram.l: Working properly with escapes in user
11161 strings/characters.
11163 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11164 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11166 Use more modest sizes, as for the time being the parser does not
11167 release memory, and therefore the process swallows a huge amount
11170 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11171 stricter %token grammar.
11173 * src/symtab.h (associativity): Add `undef_assoc'.
11174 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11175 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11177 * tests/regression.at (Invalid %directive): Remove, as it is now
11179 (Invalid inputs): Adjust to the new error messages.
11180 (Token definitions): The new grammar doesn't allow too many
11183 * src/lex.h, src/lex.c: Remove.
11184 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11185 (copy_character, copy_string2, copy_string, copy_identifier)
11186 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11187 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11188 (parse_action): Remove.
11189 * po/POTFILES.in: Adjust.
11191 2002-06-11 Akim Demaille <akim@epita.fr>
11193 * src/reader.c (parse_action): Don't store directly into the
11194 rule's action member: return the action as a string.
11195 Don't require `rule_length' as an argument: compute it.
11196 (grammar_current_rule_symbol_append)
11197 (grammar_current_rule_action_append): New, eved out from
11199 Remove `action_flag', `rulelength', unused now.
11201 2002-06-11 Akim Demaille <akim@epita.fr>
11203 * src/reader.c (grammar_current_rule_prec_set).
11204 (grammar_current_rule_check): New, eved out from...
11206 Remove `xaction', `first_rhs': useless.
11207 * tests/input.at (Type clashes): New.
11208 * tests/existing.at (GNU Cim Grammar): Adjust.
11210 2002-06-11 Akim Demaille <akim@epita.fr>
11212 * src/reader.c (grammar_midrule_action): New, Eved out from
11215 2002-06-11 Akim Demaille <akim@epita.fr>
11217 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11219 (readgram): Use them as replacement of inlined code, crule and
11222 2002-06-11 Akim Demaille <akim@epita.fr>
11224 * src/reader.c (grammar_end, grammar_symbol_append): New.
11225 (readgram): Use them.
11226 Make the use of `p' as local as possible.
11228 2002-06-10 Akim Demaille <akim@epita.fr>
11230 GCJ's parser requires the tokens to be defined before the prologue.
11232 * data/bison.simple: Output the token definition before the user's
11234 * tests/regression.at (Braces parsing, Duplicate string)
11235 (Mixing %token styles): Check the output from bison.
11236 (Early token definitions): New.
11238 2002-06-10 Akim Demaille <akim@epita.fr>
11240 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11241 assigning twice the same user number to a token, so that we can
11243 * src/lex.c (lex): here.
11244 Also use `symbol_class_set' instead of hand written code.
11245 * src/reader.c (parse_assoc_decl): Likewise.
11247 2002-06-10 Akim Demaille <akim@epita.fr>
11249 * src/symtab.c, src/symtab.c (symbol_class_set)
11250 (symbol_user_token_number_set): New.
11251 * src/reader.c (parse_token_decl): Use them.
11252 Use a switch instead of ifs.
11253 Use a single argument.
11255 2002-06-10 Akim Demaille <akim@epita.fr>
11257 Remove `%thong' support as it is undocumented, unused, duplicates
11258 `%token's job, and creates useless e-mail traffic with people who
11259 want to know what it is, why it is undocumented, unused, and
11260 duplicates `%token's job.
11262 * src/reader.c (parse_thong_decl): Remove.
11263 * src/options.c (option_table): Remove "thong".
11264 * src/lex.h (tok_thong): Remove.
11266 2002-06-10 Akim Demaille <akim@epita.fr>
11268 * src/symtab.c, src/symtab.c (symbol_type_set)
11269 (symbol_precedence_set): New.
11270 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11271 (value_components_used): Remove, unused.
11273 2002-06-09 Akim Demaille <akim@epita.fr>
11275 Move symbols handling code out of the reader.
11277 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11278 (axiom): Move to...
11279 * src/symtab.h, src/symtab.c: here.
11281 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11282 * src/reader.c (startval): Rename as...
11283 * src/symtab.h, src/symtab.c (startsymbol): this.
11284 * src/reader.c: Adjust.
11286 * src/reader.c (symbol_check_defined, symbol_make_alias)
11287 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11288 (token_translations_init)
11290 * src/symtab.c: here.
11291 * src/reader.c (packsymbols): Move to...
11292 * src/symtab.h, src/symtab.c (symbols_pack): here.
11293 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11296 2002-06-03 Akim Demaille <akim@epita.fr>
11298 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11301 2002-06-03 Akim Demaille <akim@epita.fr>
11303 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11304 structs with non literals.
11305 * src/scan-skel.l: never-interactive.
11306 * src/conflicts.c (enum conflict_resolution_e): No trailing
11308 * src/getargs.c (usage): Split long literal strings.
11309 Reported by Hans Aberg.
11311 2002-05-28 Akim Demaille <akim@epita.fr>
11313 * data/bison.c++: Use C++ ostreams.
11314 (cdebug_): New member.
11316 2002-05-28 Akim Demaille <akim@epita.fr>
11318 * src/output.c (output_skeleton): Be sure to allocate enough room
11319 for `/' _and_ for `\0' in full_skeleton.
11321 2002-05-28 Akim Demaille <akim@epita.fr>
11323 * data/bison.c++: Catch up with bison.simple:
11324 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11325 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11326 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11327 and popping traces.
11329 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11331 * src/output.c (output_skeleton): Put an explicit path in front of
11332 the skeleton file name, rather than relying on the -I directory,
11333 to partially alleviate effects of having a skeleton file lying around
11334 in the current directory.
11336 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11338 * src/conflicts.c (log_resolution): Correct typo:
11339 obstack_printf should be obstack_fgrow1.
11341 2002-05-26 Akim Demaille <akim@epita.fr>
11343 * src/state.h (state_t): `solved_conflicts' is a new member.
11344 * src/LR0.c (new_state): Set it to 0.
11345 * src/conflicts.h, src/conflicts.c (print_conflicts)
11346 (free_conflicts, solve_conflicts): Rename as...
11347 (conflicts_print, conflicts_free, conflicts_solve): these.
11349 * src/conflicts.c (enum conflict_resolution_e)
11350 (solved_conflicts_obstack): New, used by...
11351 (log_resolution): this.
11352 Adjust to attach the conflict resolution to each state.
11353 Complete the description with the precedence/associativity
11355 (resolve_sr_conflict): Adjust.
11356 * src/print.c (print_state): Output its solved_conflicts.
11357 * tests/conflicts.at (Unresolved SR Conflicts)
11358 (Solved SR Conflicts): Exercise --report=all.
11360 2002-05-26 Akim Demaille <akim@epita.fr>
11362 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11363 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11364 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11365 (token_number_t, item_number_as_token_number)
11366 (token_number_as_item_number, muscle_insert_token_number_table):
11368 (symbol_number_t, item_number_as_symbol_number)
11369 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11370 these, since it is more appropriate.
11372 2002-05-26 Akim Demaille <akim@epita.fr>
11374 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11376 * data/bison.simple (yystos) [YYDEBUG]: New.
11377 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11379 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11381 2002-05-25 Akim Demaille <akim@epita.fr>
11383 * doc/bison.texinfo (Debugging): Split into...
11384 (Tracing): this new section, its former contents, and...
11385 (Understanding): this new section.
11386 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11388 (report_flag): this.
11389 Adjust all dependencies.
11390 (report_args, report_types, report_argmatch): New.
11391 (usage, getargs): Report/support -r, --report.
11393 (struct option_table_struct): Rename as..,
11394 (struct option_table_s): this.
11395 Rename the `set_flag' member to `flag' to match with getopt_long's
11397 * src/options.c (option_table): Split verbose into an entry for
11398 %verbose, and another for --verbose.
11399 Support --report/-r, so remove -r from the obsolete --raw.
11400 * src/print.c: Attach full item sets and lookaheads reports to
11401 report_flag instead of trace_flag.
11402 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11404 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11405 and Paul Eggert <eggert@twinsun.com>
11407 * data/bison.simple (yyparse): Correct error handling to conform to
11408 POSIX and yacc. Specifically, after syntax error is discovered,
11409 do not reduce further before shifting the error token.
11410 Clean up the code a bit by removing the labels yyerrdefault,
11411 yyerrhandle, yyerrpop.
11412 * NEWS: Document the above.
11414 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11416 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11417 type; it isn't always big enough, since it doesn't necessarily
11418 include non-terminals.
11419 (yytranslate): Expand definition of yy_token_number_type, so that
11420 the latter can be removed.
11421 (yy_token_number_type): Remove, only one use.
11422 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11423 don't use TokenNumberType as element type.
11425 * tests/regression.at: Modify expected output to agree with change
11426 to yyr1 and yytranslate.
11428 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11430 * src/reader.c (parse_action): Use copy_character instead of
11433 2002-05-13 Akim Demaille <akim@epita.fr>
11435 * tests/regression.at (Token definitions): Prototype yylex and
11438 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11440 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
11441 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11443 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11445 2002-05-07 Akim Demaille <akim@epita.fr>
11447 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11448 avoid GCC warnings.
11450 2002-05-07 Akim Demaille <akim@epita.fr>
11454 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11455 over the RHS of each rule.
11456 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11457 * src/state.h (state_t): Member `nitems' is unsigned short.
11458 * src/LR0.c (get_state): Adjust.
11459 * src/reader.c (packgram): Likewise.
11460 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11462 (muscle_insert_int_table): Remove, unused.
11463 (prepare_rules): Remove `max'.
11465 2002-05-06 Akim Demaille <akim@epita.fr>
11467 * src/closure.c (print_firsts): Display of the symbol tags.
11468 (bitmatrix_print): Move to...
11469 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11471 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11473 2002-05-06 Akim Demaille <akim@epita.fr>
11475 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11478 2002-05-06 Akim Demaille <akim@epita.fr>
11480 * src/LR0.c (new_state, get_state): Instead of using the global
11481 `kernel_size' and `kernel_base', have two new arguments:
11482 `core_size' and `core'.
11485 2002-05-06 Akim Demaille <akim@epita.fr>
11487 * src/reader.c (packgram): No longer end `ritem' with a 0
11488 sentinel: it is not used.
11490 2002-05-05 Akim Demaille <akim@epita.fr>
11492 New experimental feature: display the lookaheads in the report and
11495 * src/print (print_core): When --trace-flag, display the rules
11497 * src/print_graph.c (print_core): Likewise.
11498 Swap the arguments.
11501 2002-05-05 Akim Demaille <akim@epita.fr>
11503 * tests/torture.at (Many lookaheads): New test.
11505 2002-05-05 Akim Demaille <akim@epita.fr>
11507 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11508 (GENERATE_MUSCLE_INSERT_TABLE): this.
11509 (output_int_table, output_unsigned_int_table, output_short_table)
11510 (output_token_number_table, output_item_number_table): Replace with...
11511 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11512 (muscle_insert_short_table, muscle_insert_token_number_table)
11513 (muscle_insert_item_number_table): these.
11514 Adjust all callers.
11515 (prepare_tokens): Don't free `translations', since...
11516 * src/reader.h, src/reader.c (grammar_free): do it.
11518 * src/gram.h, src/gram.c (grammar_free): here.
11519 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11522 2002-05-05 Akim Demaille <akim@epita.fr>
11524 * src/output.c (output_unsigned_int_table): New.
11525 (prepare_rules): `i' is unsigned.
11526 `prhs', `rline', `r2' are unsigned int.
11527 Rename muscle `rhs_number_max' as `rhs_max'.
11528 Output muscles `prhs_max', `rline_max', and `r2_max'.
11530 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11531 to compute types instead of constant types.
11532 * tests/regression.at (Web2c Actions): Adjust.
11534 2002-05-04 Akim Demaille <akim@epita.fr>
11536 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11537 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11538 Adjust dependencies.
11539 * src/output.c (token_definitions_output): Be sure not to output a
11540 `#define 'a'' when fed with `%token 'a' "a"'.
11541 * tests/regression.at (Token definitions): New.
11543 2002-05-03 Paul Eggert <eggert@twinsun.com>
11545 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11548 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11550 * Makefile.am (SUBDIRS): Remove intl.
11551 (EXTRA_DIST): Add config/config.rpath.
11553 2002-05-03 Akim Demaille <akim@epita.fr>
11555 * data/bison.simple (m4_if): Don't output empty enums.
11556 And actually, output valid enum definitions :(.
11558 2002-05-03 Akim Demaille <akim@epita.fr>
11560 * configure.bat: Remove, completely obsolete.
11561 * Makefile.am (EXTRA_DIST): Adjust.
11562 Don't distribute config.rpath...
11563 * config/Makefile.am (EXTRA_DIST): Do it.
11565 2002-05-03 Akim Demaille <akim@epita.fr>
11567 * configure.in (GETTEXT_VERSION): New.
11568 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11570 2002-05-03 Akim Demaille <akim@epita.fr>
11572 * data/bison.simple (b4_token_enum): New.
11573 (b4_token_defines): Use it to output tokens both as #define and
11575 Suggested by Paul Eggert.
11576 * src/output.c (token_definitions_output): Don't output spurious
11579 2002-05-03 Akim Demaille <akim@epita.fr>
11581 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11583 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
11585 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
11586 Update the stack class, give a try to deque as the default container.
11588 2002-05-02 Akim Demaille <akim@epita.fr>
11590 * data/bison.simple (yyparse): Do not implement @$ = @1.
11591 (YYLLOC_DEFAULT): Adjust to do it.
11592 * doc/bison.texinfo (Location Default Action): Fix.
11594 2002-05-02 Akim Demaille <akim@epita.fr>
11596 * src/reader.c (parse_braces): Merge into...
11597 (parse_action): this.
11599 2002-05-02 Akim Demaille <akim@epita.fr>
11601 * configure.in (ALL_LINGUAS): Remove.
11602 * po/LINGUAS, hr.po: New.
11604 2002-05-02 Akim Demaille <akim@epita.fr>
11606 Remove the so called hairy (semantic) parsers.
11608 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
11609 * src/gram.h, src/gram.c (semantic_parser): Remove.
11610 (rule_t): Remove the guard and guard_line members.
11611 * src/lex.h (token_t): remove tok_guard.
11612 * src/options.c (option_table): Remove %guard and %semantic_parser
11614 * src/output.c, src/output.h (guards_output): Remove.
11616 (token_definitions_output): Don't output the `T'
11618 (output_skeleton): Don't output the guards.
11619 * src/files.c, src/files.c (attrsfile): Remove.
11620 * src/reader.c (symbol_list): Remove the guard and guard_line
11622 Adjust dependencies.
11623 (parse_guard): Remove.
11624 * data/bison.hairy: Remove.
11625 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11628 2002-05-02 Akim Demaille <akim@epita.fr>
11630 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
11631 (parse_guard): Rename the formal argument `stack_offset' as
11632 `rule_length', which is more readable.
11634 (copy_at, copy_dollar): Instead of outputting the hard coded
11635 values of $$, $n and so forth, output invocation to b4_lhs_value,
11636 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
11637 Note: this patch partially drops `semantic-parser' support: it
11638 always does `rule_length - n', where semantic parsers ought to
11640 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11641 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11643 2002-05-02 Akim Demaille <akim@epita.fr>
11645 * configure.in (AC_INIT): Bump to 1.49b.
11646 (AM_INIT_AUTOMAKE): Short invocation.
11648 2002-05-02 Akim Demaille <akim@epita.fr>
11652 2002-05-01 Akim Demaille <akim@epita.fr>
11654 * src/skeleton.h: Remove.
11656 2002-05-01 Akim Demaille <akim@epita.fr>
11658 * src/skeleton.h: Fix the #endif.
11659 Reported by Magnus Fromreide.
11661 2002-04-26 Paul Eggert <eggert@twinsun.com>
11663 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
11664 Define if we define YYSTYPE and YYLTYPE, respectively.
11665 (YYCOPY): Fix [] quoting problem in the non-GCC case.
11667 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
11669 * src/scan-skel.l: Postprocess quadrigraphs.
11671 * src/reader.c (copy_character): New function, used to output
11672 single characters while replacing `[' and `]' with quadrigraphs, to
11673 avoid troubles with M4 quotes.
11674 (copy_comment): Output characters with copy_character.
11675 (read_additionnal_code): Likewise.
11676 (copy_string2): Likewise.
11677 (copy_definition): Likewise.
11679 * tests/calc.at: Exercise M4 quoting.
11681 2002-04-25 Akim Demaille <akim@epita.fr>
11683 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11684 between `!' and the command.
11685 Reported by Paul Eggert.
11687 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
11689 * tests/calc.at: Exercise prologue splitting.
11691 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11692 `b4_post_prologue' instead of `b4_prologue'.
11694 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11696 (output): Free pre_prologue_obstack and post_prologue_obstack.
11697 * src/files.h, src/files.c (attrs_obstack): Remove.
11698 (pre_prologue_obstack, post_prologue_obstack): New.
11699 * src/reader.c (copy_definition): Add a parameter to specify the
11700 obstack to fill, instead of using attrs_obstack unconditionally.
11701 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11702 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11704 2002-04-23 Paul Eggert <eggert@twinsun.com>
11706 * data/bison.simple: Remove unnecessary commentary and white
11707 space differences from 1_29-branch.
11708 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11710 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11711 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11712 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11713 constructors or destructors.
11715 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11717 2002-04-23 Akim Demaille <akim@epita.fr>
11719 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11720 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11721 location with columns.
11722 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11723 All reported by Paul Eggert.
11725 2002-04-22 Akim Demaille <akim@epita.fr>
11727 * src/reduce.c (dump_grammar): Move to...
11728 * src/gram.h, src/gram.c (grammar_dump): here.
11729 Be sure to separate long item numbers.
11730 Don't read the members of a rule's prec if its nil.
11732 2002-04-22 Akim Demaille <akim@epita.fr>
11734 * src/output.c (table_size, table_grow): New.
11735 (MAXTABLE): Remove, replace uses with table_size.
11736 (pack_vector): Instead of dying when the table is too big, grow it.
11738 2002-04-22 Akim Demaille <akim@epita.fr>
11740 * data/bison.simple (yyr1): Its type is that of a token number.
11741 * data/bison.c++ (r1_): Likewise.
11742 * tests/regression.at (Web2c Actions): Adjust.
11744 2002-04-22 Akim Demaille <akim@epita.fr>
11746 * src/reader.c (token_translations_init): 256 is now the default
11747 value for the error token, i.e., it will be assigned another
11748 number if the user assigned 256 to one of her tokens.
11749 (reader): Don't force 256 to error.
11750 * doc/bison.texinfo (Symbols): Adjust.
11751 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11752 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11753 etc. instead of 10, 20, 30 (which was used to `jump' over error
11754 (256) and undefined (2)).
11756 2002-04-22 Akim Demaille <akim@epita.fr>
11758 Propagate more token_number_t.
11760 * src/gram.h (token_number_as_item_number)
11761 (item_number_as_token_number): New.
11762 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11763 Use it to create output_item_number_table and
11764 output_token_number_table.
11765 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11766 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11767 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11768 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11770 2002-04-22 Akim Demaille <akim@epita.fr>
11772 * src/output.h, src/output.c (get_lines_number): Remove.
11774 2002-04-19 Akim Demaille <akim@epita.fr>
11776 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11778 (Debugging): More details about enabling the debugging features.
11779 (Table of Symbols): Describe $$, $n, @$, and @n.
11780 Suggested by Tim Josling.
11782 2002-04-19 Akim Demaille <akim@epita.fr>
11784 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11786 2002-04-10 Akim Demaille <akim@epita.fr>
11788 * src/system.h: Rely on HAVE_LIMITS_H.
11789 Suggested by Paul Eggert.
11791 2002-04-09 Akim Demaille <akim@epita.fr>
11793 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11794 full stderr, and strip it according to the bison options, instead
11795 of composing the error message from different bits.
11796 This makes it easier to check for several error messages.
11797 Adjust all the invocations.
11798 Add an invocation exercising the error token.
11799 Add an invocation demonstrating a stupid error message.
11800 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11802 Error message are for stderr, not stdout.
11804 2002-04-09 Akim Demaille <akim@epita.fr>
11806 * src/gram.h, src/gram.c (error_token_number): Remove, use
11808 * src/reader.c (reader): Don't specify the user token number (2)
11809 for $undefined, as it uselessly prevents using it.
11810 * src/gram.h (token_number_t): Move to...
11811 * src/symtab.h: here.
11812 (state_t.number): Is a token_number_t.
11813 * src/print.c, src/reader.c: Use undeftoken->number instead of
11815 (Even though this 2 is not the same as above: the number of the
11816 undeftoken remains being 2, it is its user token number which
11818 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11819 `user_token_number_max'.
11820 Output `undef_token_number'.
11821 * data/bison.simple, data/bison.c++: Use them.
11822 Be sure to map invalid yylex return values to
11823 `undef_token_number'. This saves us from gratuitous SEGV.
11825 * tests/conflicts.at (Solved SR Conflicts)
11826 (Unresolved SR Conflicts): Adjust.
11827 * tests/regression.at (Web2c Actions): Adjust.
11829 2002-04-08 Akim Demaille <akim@epita.fr>
11831 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11833 Remove the duplicate `typedefs'.
11834 (RhsNumberType): Fix the declaration and various other typos.
11836 * data/bison.simple: Use __ofile__.
11837 * src/scan-skel.l: Handle __ofile__.
11839 2002-04-08 Akim Demaille <akim@epita.fr>
11841 * src/gram.h (item_number_t): New, the type of item numbers in
11842 RITEM. Note that it must be able to code symbol numbers as
11843 positive number, and the negation of rule numbers as negative
11845 Adjust all dependencies (pretty many).
11846 * src/reduce.c (rule): Remove this `short *' pointer: use
11848 * src/system.h (MINSHORT, MAXSHORT): Remove.
11849 Include `limits.h'.
11850 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
11851 (shortcpy): Remove.
11852 (MAXTABLE): Move to...
11853 * src/output.c (MAXTABLE): here.
11854 (prepare_rules): Use output_int_table to output rhs.
11855 * data/bison.simple, data/bison.c++: Adjust.
11856 * tests/torture.at (Big triangle): Move the limit from 254 to
11858 * tests/regression.at (Web2c Actions): Ajust.
11860 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
11861 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
11862 passes, but produces negative #line number, once fixed, GCC is
11863 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
11865 * src/state.h (state_h): Code input lines on ints, not shorts.
11867 2002-04-08 Akim Demaille <akim@epita.fr>
11869 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11870 and then the grammar.
11872 2002-04-08 Akim Demaille <akim@epita.fr>
11874 * src/system.h: No longer using strndup.
11876 2002-04-07 Akim Demaille <akim@epita.fr>
11878 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
11879 * src/output.c (output_table_data): Return the longest number.
11880 (prepare_tokens): Output `token_number_max').
11881 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
11883 Use them to define yy_token_number_type/TokenNumberType.
11884 Use this type for yytranslate.
11885 * tests/torture.at (Big triangle): Push the limit from 124 to
11887 * tests/regression.at (Web2c Actions): Adjust.
11889 2002-04-07 Akim Demaille <akim@epita.fr>
11891 * tests/torture.at (Big triangle): New.
11892 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11893 * tests/existing.at: here.
11895 2002-04-07 Akim Demaille <akim@epita.fr>
11897 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11899 Adjust dependencies.
11901 2002-04-07 Akim Demaille <akim@epita.fr>
11903 * src/reader.c: Normalize increments to prefix form.
11905 2002-04-07 Akim Demaille <akim@epita.fr>
11907 * src/reader.c, symtab.c: Remove debugging code.
11909 2002-04-07 Akim Demaille <akim@epita.fr>
11911 Rename all the `bucket's as `symbol_t'.
11913 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
11914 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
11915 * src/symtab.c, src/symtab.h (bucket): Rename as...
11917 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11918 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11919 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11920 (buckets_new, buckets_free, buckets_do): Rename as...
11921 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11922 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11923 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11924 (symbols_new, symbols_free, symbols_do): these.
11926 2002-04-07 Akim Demaille <akim@epita.fr>
11928 Use lib/hash for the symbol table.
11930 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11932 * src/lex.c (lex): Set the `number' member of new terminals.
11933 * src/reader.c (bucket_check_defined, bucket_make_alias)
11934 (bucket_check_alias_consistence, bucket_translation): New.
11935 (reader, grammar_free, readgram, token_translations_init)
11936 (packsymbols): Adjust.
11937 (reader): Number the predefined tokens.
11938 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11939 for predefined tokens.
11940 * src/symtab.h (bucket): Remove all the hash table related
11942 * src/symtab.c (symtab): Replace by...
11943 (bucket_table): this.
11944 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11945 (buckets_new, buckets_do): New.
11947 2002-04-07 Akim Demaille <akim@epita.fr>
11949 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11950 (start_symbol, max_user_token_number, semantic_parser)
11951 (error_token_number): Initialize.
11952 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11955 (errtoken, eoftoken, undeftoken, axiom): Extern.
11957 2002-04-07 Akim Demaille <akim@epita.fr>
11959 * src/gram.h (rule_s): prec and precsym are now pointers
11960 to the bucket giving the priority/associativity.
11961 Member `associativity' removed: useless.
11962 * src/reduce.c, src/conflicts.c: Adjust.
11964 2002-04-07 Akim Demaille <akim@epita.fr>
11966 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
11967 Properly escape the symbols' TAG when outputting them.
11969 2002-04-07 Akim Demaille <akim@epita.fr>
11971 * src/lalr.h (LA): Is a bitsetv, not bitset*.
11973 2002-04-07 Akim Demaille <akim@epita.fr>
11975 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
11976 (LArule): this, which is an array to rule_t*.
11977 * src/print.c, src/conflicts.c: Adjust.
11979 2002-04-07 Akim Demaille <akim@epita.fr>
11981 * src/gram.h (rule_t): Rename `number' as `user_number'.
11982 `number' is a new member.
11983 Adjust dependencies.
11984 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
11986 2002-04-07 Akim Demaille <akim@epita.fr>
11988 As a result of the previous patch, it is no longer needed
11989 to reorder ritem itself.
11991 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
11993 2002-04-07 Akim Demaille <akim@epita.fr>
11995 Be sure never to walk through RITEMS, but use only data related to
11996 the rules themselves. RITEMS should be banished.
11998 * src/output.c (output_token_translations): Rename as...
11999 (prepare_tokens): this.
12000 In addition to `translate', prepare the muscles `tname' and
12001 `toknum', which were handled by...
12002 (output_rule_data): this.
12003 Remove, and move the remainder of its outputs into...
12004 (prepare_rules): this new routines, which also merges content from
12005 (output_gram): this.
12006 (prepare_rules): Be sure never to walk through RITEMS.
12007 (output_stos): Rename as...
12008 (prepare_stos): this.
12009 (output): Always invoke prepare_states, after all, just don't use it
12010 in the output if you don't need it.
12012 2002-04-07 Akim Demaille <akim@epita.fr>
12014 * src/LR0.c (new_state): Display `nstates' as the name of the
12015 newly created state.
12016 Adjust to initialize first_state and last_state if needed.
12017 Be sure to distinguish the initial from the final state.
12018 (new_states): Create the itemset of the initial state, and use
12020 * src/closure.c (closure): Now that the initial state has its
12021 items properly set, there is no need for a special case when
12022 creating `ruleset'.
12024 As a result, now the rule 0, reducing to $axiom, is visible in the
12025 outputs. Adjust the test suite.
12027 * tests/conflicts.at (Solved SR Conflicts)
12028 (Unresolved SR Conflicts): Adjust.
12029 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12030 * tests/conflicts.at (S/R in initial): New.
12032 2002-04-07 Akim Demaille <akim@epita.fr>
12034 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12035 the RHS of the rules.
12036 * src/output.c (output_gram): Likewise.
12038 2002-04-07 Akim Demaille <akim@epita.fr>
12040 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12042 Adjust all dependencies.
12043 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12044 `number' of the buckets too.
12045 * src/gram.h: Include `symtab.h'.
12046 (associativity): Move to...
12047 * src/symtab.h: here.
12048 No longer include `gram.h'.
12050 2002-04-07 Akim Demaille <akim@epita.fr>
12052 * src/gram.h, src/gram.c (rules_rhs_length): New.
12053 (ritem_longest_rhs): Use it.
12054 * src/gram.h (rule_t): `number' is a new member.
12055 * src/reader.c (packgram): Set it.
12056 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12057 the end of `rules', and count them out of `nrules'.
12058 (reduce_output, dump_grammar): Adjust.
12059 * src/print.c (print_grammar): It is no longer needed to check for
12060 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12061 * tests/reduce.at (Reduced Automaton): New test.
12063 2002-04-07 Akim Demaille <akim@epita.fr>
12065 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12066 lacking `+ 1' to nrules, Bison reported as useless a token if it
12067 was used solely to set the precedence of the last rule...
12069 2002-04-07 Akim Demaille <akim@epita.fr>
12071 * data/bison.c++, data/bison.simple: Don't output the current file
12072 name in #line, to avoid useless diffs between two identical
12073 outputs under different names.
12075 2002-04-07 Akim Demaille <akim@epita.fr>
12077 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12078 Normalize loops to using `< nrules + 1', not `<= nrules'.
12080 2002-04-07 Akim Demaille <akim@epita.fr>
12084 2002-04-07 Akim Demaille <akim@epita.fr>
12086 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12087 bucket.value as bucket.number.
12089 2002-04-07 Akim Demaille <akim@epita.fr>
12091 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12092 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12093 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12094 RHS, instead of being an index in RITEMS.
12096 2002-04-04 Paul Eggert <eggert@twinsun.com>
12098 * doc/bison.texinfo: Update copyright date.
12099 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12100 (Symbols): Warn about running Bison in one character set,
12101 but compiling and/or running in an incompatible one.
12102 Warn about character code 256, too.
12104 2002-04-03 Paul Eggert <eggert@twinsun.com>
12106 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12107 YYERROR_VERBOSE is nonzero, not whether it is defined.
12109 Merge changes from bison-1_29-branch.
12111 2002-03-20 Paul Eggert <eggert@twinsun.com>
12113 Merge fixes from Debian bison_1.34-1.diff.
12115 * configure.in (AC_PREREQ): 2.53.
12117 2002-03-20 Akim Demaille <akim@epita.fr>
12119 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12121 2002-03-19 Paul Eggert <eggert@twinsun.com>
12123 * src/bison.simple (YYCOPY): New macro.
12124 (YYSTACK_RELOCATE): Use it.
12125 Remove Type arg; no longer needed. All callers changed.
12126 (yymemcpy): Remove; no longer needed.
12128 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12129 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12131 2002-03-19 Akim Demaille <akim@epita.fr>
12133 Test and fix the #line outputs.
12135 * tests/atlocal.at (GCC): New.
12136 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
12137 (Prologue synch line, %union synch line, Postprologue synch line)
12138 (Action synch line, Epilogue synch line): New tests.
12139 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12140 * data/bison.simple, data/bison.c++: Use it.
12142 2002-03-19 Akim Demaille <akim@epita.fr>
12144 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12145 (Solved SR Conflicts, %expect not enough, %expect right)
12146 (%expect too much): Move to...
12147 * tests/conflicts.at: this new file.
12149 2002-03-19 Akim Demaille <akim@epita.fr>
12151 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12152 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12153 that we can move to enums for instance.
12154 * src/output.c (token_definitions_output): Output a list of
12155 `token-name, token-number' instead of the #define.
12156 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12158 2002-03-14 Akim Demaille <akim@epita.fr>
12160 Use Gettext 0.11.1.
12162 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
12164 * data/bison.c++: Make the user able to add members to the generated
12165 parser by subclassing.
12167 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
12169 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12171 Reported by Nicolas Tisserand and Nicolas Burrus.
12173 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12175 * src/reader.c: Warn about lacking semi-colons, do not complain.
12177 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12179 * data/bison.c++: Remove a debug line.
12181 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12183 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12184 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12185 provide a default implementation.
12187 2002-03-04 Akim Demaille <akim@epita.fr>
12189 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12190 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12191 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12192 * tests/semantic.at (Parsing Guards): Similarly.
12193 * src/reader.at (readgram): Complain if the last rule is not ended
12196 2002-03-04 Akim Demaille <akim@epita.fr>
12198 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12199 * src/closure.c: here.
12200 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12202 * src/warshall.h, src/warshall.c: Remove.
12203 * tests/sets.at (Broken Closure): Adjust.
12205 2002-03-04 Akim Demaille <akim@epita.fr>
12207 * src/output.c (output_skeleton): tempdir is const.
12208 bytes_read is unused.
12210 2002-03-04 Akim Demaille <akim@epita.fr>
12212 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12213 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12215 From Michael Hayes.
12217 2002-03-04 Akim Demaille <akim@epita.fr>
12219 * src/closure.c (closure): `r' is unused.
12221 2002-03-04 Akim Demaille <akim@epita.fr>
12223 * tests/sets.at (Broken Closure): Add the ending `;'.
12224 * src/reader.at (readgram): Complain if a rule is not ended with a
12227 2002-03-04 Akim Demaille <akim@epita.fr>
12229 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12230 (count_sr_conflicts): Use bitset_count.
12231 * src/reduce.c (inaccessable_symbols): Ditto.
12232 (bits_size): Remove.
12233 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12235 2002-03-04 Akim Demaille <akim@epita.fr>
12237 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12238 * src/reduce.c: Remove the `bitset_zero's following the
12239 `bitset_create's, as now it is performed by the latter.
12241 2002-03-04 Akim Demaille <akim@epita.fr>
12243 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12244 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12245 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12246 latest sources from Michael.
12248 2002-03-04 Akim Demaille <akim@epita.fr>
12250 * src/output.c (output): Don't free the grammar.
12251 * src/reader.c (grammar_free): New.
12252 * src/main.c (main): Call it and don't free symtab here.
12254 2002-03-04 Akim Demaille <akim@epita.fr>
12256 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12258 Reported by Benoit Perrot.
12260 2002-03-04 Akim Demaille <akim@epita.fr>
12262 Use bitset operations when possible, not loops over bits.
12264 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12266 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12267 * src/reduce.c (useless_nonterminals): Formatting changes.
12268 * src/warshall.c (TC): Use bitset_or.
12270 2002-03-04 Akim Demaille <akim@epita.fr>
12272 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12273 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12276 2002-03-04 Akim Demaille <akim@epita.fr>
12278 * src/lalr.c (F): Now a bitset*.
12279 Adjust all dependencies.
12281 2002-03-04 Akim Demaille <akim@epita.fr>
12283 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12284 Adjust all dependencies.
12286 2002-03-04 Akim Demaille <akim@epita.fr>
12288 * src/L0.c, src/LR0.h (nstates): Be size_t.
12289 Adjust comparisons (signed vs unsigned).
12290 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12292 Adjust all dependencies.
12294 2002-03-04 Akim Demaille <akim@epita.fr>
12296 * src/closure.c (firsts): Now, also a bitset.
12297 Adjust all dependencies.
12298 (varsetsize): Remove, now unused.
12299 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12301 2002-03-04 Akim Demaille <akim@epita.fr>
12303 * src/print.c: Convert to use bitset.h, not hand coded iterations
12306 2002-03-04 Akim Demaille <akim@epita.fr>
12308 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12310 2002-03-04 Akim Demaille <akim@epita.fr>
12312 * src/closure.c (ruleset): Be a bitset.
12313 (rulesetsize): Remove.
12315 2002-03-04 Akim Demaille <akim@epita.fr>
12317 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12318 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12319 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12320 * src/closure.c (fderives): Be an array of bitsets.
12322 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
12324 * data/bison.c++: Merge the two generated headers. Insert a copyright
12325 notice in each output file.
12327 2002-02-28 Akim Demaille <akim@epita.fr>
12329 * data/bison.c++: Copy the prologue of bison.simple to fetch
12330 useful M4 definitions, such as b4_header_guard.
12332 2002-02-25 Akim Demaille <akim@epita.fr>
12334 * src/getargs.c (version): Give the name of the authors, and use a
12335 translator friendly scheme for the bgr
12338 2002-02-25 Akim Demaille <akim@epita.fr>
12340 * src/output.c (header_output): Remove, now handled completely via
12343 2002-02-25 Akim Demaille <akim@epita.fr>
12345 * m4/m4.m4: New, from CVS Autoconf.
12346 * configure.in: Invoke it.
12347 * src/output.c (output_skeleton): Use its result instead of the
12350 2002-02-25 Akim Demaille <akim@epita.fr>
12352 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12354 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12355 * src/output.c (output_skeleton): Use mkstemp to create a real
12357 Move the filling of `skeleton' and its muscle to...
12359 (output): Move the definition of the prologue muscle to...
12361 * src/system.h (DEFAULT_TMPDIR): New.
12363 2002-02-14 Paul Eggert <eggert@twinsun.com>
12365 Remove the support for C++ namespace cleanliness; it was
12366 causing more problems than it was curing, since it didn't work
12367 properly on some nonstandard C++ compilers. This can wait
12368 for a proper C++ parser.
12370 * NEWS: Document this.
12371 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12372 of C++, as it's treated like C now.
12373 * src/bison.simple (YYSTD): Remove.
12374 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12375 Treat C++ just like Standard C instead of trying to support
12376 namespace cleanliness.
12378 2002-02-14 Akim Demaille <akim@epita.fr>
12380 * tests/regression.at (else): Adjust to Andreas' change.
12382 2002-02-14 Akim Demaille <akim@epita.fr>
12384 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12386 2002-02-13 Andreas Schwab <schwab@suse.de>
12388 * src/output.c (output_rule_data): Don't output NULL, it might
12389 not be defined yet.
12391 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
12393 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12394 (Copyright notice): Update.
12396 2002-02-11 Akim Demaille <akim@epita.fr>
12398 * tests/regression.at (%nonassoc and eof): Don't include
12399 nonportable headers.
12401 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
12403 * data/bison.c++: Correct error recovery. Make the user able to
12404 initialize the starting location.
12406 2002-02-07 Akim Demaille <akim@epita.fr>
12408 * tests/input.at: New.
12410 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12412 * data/bison.c++: Replace some direct m4 expansions by constants. Be
12413 more consistent when naming methods and variables. Put preprocessor
12414 directives around tables only needed for debugging.
12416 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12418 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12420 (yy::b4_name::parse): Use print_.
12422 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12424 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12426 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12428 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12430 (yy::b4_name::parse): Build verbose error messages, and use error_.
12432 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12434 * data/bison.c++: Fix m4 quoting in comments.
12436 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12438 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12439 not expanded by m4.
12441 2002-02-05 Akim Demaille <akim@epita.fr>
12443 * data/bison.c++: Adjust to the M4 back end.
12444 More is certainly needed.
12446 2002-02-05 Akim Demaille <akim@epita.fr>
12448 Give a try to M4 as a back end.
12450 * lib/readpipe.c: New, from wdiff.
12451 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12453 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12454 specific values. Now it is m4 that performs the lookup.
12455 * src/parse-skel.y: Remove.
12456 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12457 * src/output.c (actions_output, guards_output)
12458 (token_definitions_output): No longer keeps track of the output
12459 line number, hence remove the second argument.
12460 (guards_output): Check against the guard member of a rule, not the
12463 (output_skeleton): Don't look for the skeleton location, let m4 do
12465 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12467 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12468 (prepare): Given that for the time being changesyntax is not
12469 usable in M4, rename the muscles using `-' to `_'.
12470 Define `defines_flag', `output_parser_name' and `output_header_name'.
12471 * src/output.h (actions_output, guards_output)
12472 (token_definitions_output): Adjust prototypes.
12473 * src/scan-skel.l: Instead of scanning the skeletons, it now
12474 processes the output of m4: `__oline__' and `#output'.
12475 * data/bison.simple: Adjust to be used by M4(sugar).
12476 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12478 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12479 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12480 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12481 shamelessly stolen from CVS Autoconf.
12483 2002-02-05 Akim Demaille <akim@epita.fr>
12485 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12486 * configure.in: Check for the declarations of free and malloc.
12487 * src/muscle_tab.c: Adjust.
12489 2002-02-05 Akim Demaille <akim@epita.fr>
12491 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12492 which have no values.
12494 2002-02-05 Akim Demaille <akim@epita.fr>
12496 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12499 2002-01-29 Paul Eggert <eggert@twinsun.com>
12501 * src/bison.simple (YYSIZE_T): Do not define merely because
12502 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12503 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12505 2002-01-27 Akim Demaille <akim@epita.fr>
12507 Fix `%nonassoc and eof'.
12509 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12510 which were not properly copied! Replace
12511 memcpy (res->errs, src->errs, src->nerrs);
12513 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12515 * tests/regression.at (%nonassoc and eof): Adjust to newest
12516 Autotest: `.' is not in the PATH.
12518 2002-01-27 Akim Demaille <akim@epita.fr>
12520 * tests/sets.at (AT_EXTRACT_SETS): New.
12521 (Nullable): Use it.
12524 2002-01-26 Akim Demaille <akim@epita.fr>
12526 * tests/actions.at, tests/calc.at, tests/headers.at,
12527 * tests/torture.at: Adjust to the newest Autotest which no longer
12528 forces `.' in the PATH.
12530 2002-01-25 Akim Demaille <akim@epita.fr>
12532 * tests/regression.at (%nonassoc and eof): New.
12533 Suggested by Robert Anisko.
12535 2002-01-24 Akim Demaille <akim@epita.fr>
12537 Bison dumps core when trying to complain about broken input files.
12538 Reported by Cris van Pelt.
12540 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12541 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12543 (Invalid inputs): Strengthen: exercise parse_percent_token.
12545 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
12547 * src/Makefile.am: Add bison.c++.
12548 * src/bison.c++: New skeleton.
12550 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
12554 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12556 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12558 2002-01-20 Marc Autret <marc@gnu.org>
12560 * src/files.c (compute_output_file_names): Fix
12562 2002-01-20 Marc Autret <marc@gnu.org>
12564 * tests/output.at: New test.
12565 * src/files.c (compute_base_names): Don't map extensions when
12566 the YACC flag is set, use defaults.
12567 Reported by Evgeny Stambulchik.
12569 2002-01-20 Marc Autret <marc@gnu.org>
12571 * src/system.h: Need to define __attribute__ away for non-GCC
12572 compilers as well (i.e., the vendor C compiler).
12573 Suggested by Albert Chin-A-Young.
12575 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12577 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
12578 canonical definition.
12579 * src/system.h: Use the canonical definition for PARAMS (avoids
12580 a conflict with the macro from lib/hash.h).
12582 2002-01-11 Akim Demaille <akim@epita.fr>
12584 * configure.in: Use AC_FUNC_STRNLEN.
12585 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
12587 2002-01-09 Akim Demaille <akim@epita.fr>
12589 * src/files.c, src/files.h (output_infix): New.
12590 (tab_extension): Remove.
12591 (compute_base_names): Compute the former, drop the latter.
12592 * src/output.c (prepare): Insert the muscles `output-infix', and
12594 * src/parse-skel.y (string, string.1): New.
12595 (section.header): Use it.
12596 (section.yacc): Remove.
12597 (prefix): Remove too.
12598 * src/scan-skel.l: Adjust.
12599 * src/bison.simple, src/bison.hairy: Adjust.
12601 2002-01-09 Akim Demaille <akim@epita.fr>
12603 * configure.in (WERROR_CFLAGS): Compute it.
12604 * src/Makefile.am (CFLAGS): Pass it.
12605 * tests/atlocal.in (CFLAGS): Idem.
12606 * src/files.c: Fix a few warnings.
12607 (get_extension_index): Remove, unused.
12609 2002-01-08 Akim Demaille <akim@epita.fr>
12611 * src/getargs.c (AS_FILE_NAME): New.
12612 (getargs): Use it to convert DOSish file names.
12613 * src/files.c (base_name): Rename as full_base_name to avoid
12614 clashes with `base_name ()'.
12615 (filename_split): New.
12616 (compute_base_names): N-th rewrite, using filename_split.
12618 2002-01-08 Akim Demaille <akim@epita.fr>
12620 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
12621 New, stolen from the Fileutils 4.1.
12622 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12623 * configure.in: Check for the presence of memrchr, and of its
12626 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12628 * lib/hash.h (__P): Added definition for this macro.
12629 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
12630 BUILT_SOURCES, to ensure they are generated first.
12631 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
12632 %error-verbose to allow bootstrapping with bison 1.30x.
12634 2002-01-06 Akim Demaille <akim@epita.fr>
12636 * src/reader.c (parse_braces): Don't fetch the next char, the
12637 convention is to fetch on entry.
12638 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
12639 'switch' without a following semicolon.
12640 * tests/regression.at (braces parsing): New.
12642 2002-01-06 Akim Demaille <akim@epita.fr>
12644 Bison is dead wrong in its RR conflict reports.
12646 * tests/torture.at (GNU Cim Grammar): New.
12647 * src/conflicts.c (count_rr_conflicts): Fix.
12649 2002-01-06 Akim Demaille <akim@epita.fr>
12651 Creating package.m4 from configure.ac causes too many problems.
12653 * tests/Makefile.am (package.m4): Create it by hand,
12654 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12656 2002-01-06 Akim Demaille <akim@epita.fr>
12658 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12661 2002-01-04 Paul Eggert <eggert@twinsun.com>
12663 * doc/bison.texinfo (Debugging):
12664 Remove YYSTDERR; it's no longer defined or used.
12665 Also, s/cstdio.h/cstdio/.
12667 2002-01-03 Akim Demaille <akim@epita.fr>
12669 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12671 2002-01-03 Akim Demaille <akim@epita.fr>
12673 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12674 tracing code to --trace, wait for a better --trace option, with
12677 2002-01-03 Akim Demaille <akim@epita.fr>
12679 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12680 The ISO C++ standard is extremely clear about it: stderr is
12681 considered a macro, not a regular symbol (see table 94 `Header
12682 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12683 Therefore std:: does not apply to it. It still does with fprintf.
12684 Also, s/cstdio.h/cstdio/.
12686 2002-01-03 Akim Demaille <akim@epita.fr>
12688 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12689 for non system headers.
12691 2002-01-02 Akim Demaille <akim@epita.fr>
12693 Equip the skeleton chain with location tracking, runtime trace,
12694 pure parser and scanner.
12696 * src/parse-skel.y: Request a pure parser, locations, and prefix
12698 (%union): Having several members with the same type does not help
12699 type mismatches, simplify.
12700 (YYPRINT, yyprint): New.
12701 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12702 (skel_error): this.
12704 * src/scan-skel.l: Adjust to these changes.
12705 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12706 (LOCATION_PRINT, skel_control_t): New.
12708 2001-12-30 Akim Demaille <akim@epita.fr>
12710 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12711 replace `gb' with BLANKS.
12712 * src/scan-skel.l: Adjust.
12714 2001-12-30 Akim Demaille <akim@epita.fr>
12716 * src/system.h: We don't need nor want bcopy.
12717 Throw away MS-DOS crap: we don't need getpid.
12718 * configure.in: We don't need strndup. It was even causing
12719 problems: because Flex includes the headers *before* us,
12720 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12722 * lib/xstrndup.c: New.
12723 * src/scan-skel.l: Use it.
12724 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12725 * src/parse-skel.y: Use %directives instead of #defines.
12727 2001-12-30 Akim Demaille <akim@epita.fr>
12729 * src/skeleton.h: New.
12730 * src/output.c (output_parser, output_master_parser): Remove, dead
12732 * src/output.h (get_lines_number, actions_output, guards_output)
12733 (token_definitions_output): Prototype them.
12734 * src/parse-skel.y: Add the license notice.
12735 Include output.h and skeleton.h.
12736 (process_skeleton): Returns void, and takes a single parameter.
12737 * src/scan-skel.l: Add the license notice.
12738 Include skeleton.h.
12739 Don't use %option yylineno: it seems that then Flex imagines
12740 REJECT has been used, and therefore it won't reallocate its
12741 buffers (which makes no other sense to me than a bug). It results
12742 in warnings for `unused: yy_flex_realloc'.
12744 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
12746 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12747 (MUSCLE_INSERT_PREFIX): ...to there.
12748 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12749 (MUSCLE_INSERT_PREFIX): Move from here...
12751 * src/bison.hairy: Add a section directive. Put braces around muscle
12752 names. This parser skeleton is still broken, but Bison should not
12753 choke on a bad muscle 'syntax'.
12754 * src/bison.simple: Add a section directive. Put braces around muscle
12757 * src/files.h (strsuffix, stringappend): Add declarations.
12758 (tab_extension): Add declaration.
12759 (short_base_name): Add declaration.
12761 * src/files.c (strsuffix, stringappend): No longer static. These
12762 functions are used in the skeleton parser.
12763 (tab_extension): New.
12764 (compute_base_names): Use the computations done in this function
12765 to guess if the generated parsers should have '.tab' in their
12767 (short_base_name): No longer static.
12769 * src/output.c (output_skeleton): New.
12770 (output): Disable call to output_master_parser, and give a try to
12771 a new skeleton handling system.
12772 (guards_output, actions_output): No longer static.
12773 (token_definitions_output, get_lines_number): No longer static.
12775 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12777 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
12780 * src/parse-skel.y: New file.
12781 * src/scan-skel.l: New file.
12783 2001-12-29 Akim Demaille <akim@epita.fr>
12785 %name-prefix is broken.
12787 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12788 Adjust all dependencies.
12789 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12792 Renaming yylval but not yylloc is not consistent. Now we do.
12794 * src/bison.simple: Prefix yylloc if used.
12795 * doc/bison.texinfo (Decl Summary): Document that.
12797 2001-12-29 Akim Demaille <akim@epita.fr>
12799 * doc/bison.texinfo: Promote `%long-directive' over
12801 Remove all references to fixed-output-files, yacc is enough.
12803 2001-12-29 Akim Demaille <akim@epita.fr>
12805 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12806 user prologue. These are defaults.
12807 * tests/actions.at (Mid-rule actions): Make sure the user can
12808 define YYDEBUG and YYERROR_VERBOSE.
12810 2001-12-29 Akim Demaille <akim@epita.fr>
12812 * src/output.c (header_output): Don't forget to export YYLTYPE and
12814 * tests/headers.at (export YYLTYPE): New, make sure it does.
12815 * tests/regression.at (%union and --defines, Invalid CPP headers):
12817 * tests/headers.at: here.
12819 2001-12-29 Akim Demaille <akim@epita.fr>
12821 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12823 2001-12-29 Akim Demaille <akim@epita.fr>
12825 * tests/actions.at (Mid-rule actions): Output on a single line
12826 instead of several.
12828 2001-12-29 Akim Demaille <akim@epita.fr>
12830 * doc/bison.texinfo: Formatting changes.
12832 2001-12-29 Akim Demaille <akim@epita.fr>
12834 Don't store the token defs in a muscle, just be ready to output it
12835 on command. Now possible via `symbols'. Fixes a memory leak.
12837 * src/output.c (token_definitions_output): New.
12838 (output_parser, header_output): Use it.
12839 * src/reader.c (symbols_save): Remove.
12841 2001-12-29 Akim Demaille <akim@epita.fr>
12843 * src/bison.simple: Do not provide a default for YYSTYPE and
12844 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12847 2001-12-29 Akim Demaille <akim@epita.fr>
12849 Mid-rule actions are simply... ignored!
12851 * src/reader.c (readgram): Be sure to attach mid-rule actions to
12852 the empty-rule associated to the dummy symbol, not to the host
12854 * tests/actions.at (Mid-rule actions): New.
12856 2001-12-29 Akim Demaille <akim@epita.fr>
12860 * src/reader.c (reader): Free grammar.
12862 2001-12-29 Akim Demaille <akim@epita.fr>
12866 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12867 since it allocates it for each state, although only one is needed.
12868 (allocate_storage): Do it here.
12870 2001-12-29 Akim Demaille <akim@epita.fr>
12872 * src/options.h, src/options.c (create_long_option_table): Rename
12874 (long_option_table_new): this, with a clearer prototype.
12875 (percent_table): Remove, unused,
12876 * src/getargs.c (getargs): Adjust.
12878 2001-12-29 Akim Demaille <akim@epita.fr>
12880 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
12881 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
12884 2001-12-29 Akim Demaille <akim@epita.fr>
12886 * src/lalr.c (build_relations): Rename `states' as `states1'.
12887 Sorry, I don't understand exactly what it is, no better name...
12889 2001-12-29 Akim Demaille <akim@epita.fr>
12891 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
12892 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
12893 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12896 2001-12-29 Akim Demaille <akim@epita.fr>
12898 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12901 2001-12-29 Akim Demaille <akim@epita.fr>
12903 * src/reader.c, src/reader.h (user_toknums): Remove.
12904 Adjust all users to use symbols[i]->user_token_number.
12906 2001-12-29 Akim Demaille <akim@epita.fr>
12908 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12909 Adjust all users to use symbols[i]->prec or ->assoc.
12911 2001-12-29 Akim Demaille <akim@epita.fr>
12913 * src/reader.c, src/reader.h (tags): Remove.
12914 Adjust all users to use symbols[i]->tag.
12916 2001-12-29 Akim Demaille <akim@epita.fr>
12918 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12920 * src/reader.c (packsymbols): Fill this table.
12922 * src/conflicts.c (resolve_sr_conflict): Adjust.
12923 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12925 Use symbols[i]->tag instead of tags[i].
12927 2001-12-29 Akim Demaille <akim@epita.fr>
12929 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12930 In addition, put a comment in there, to replace...
12931 * tests/regression.at (%union and C comments): Remove.
12933 2001-12-29 Akim Demaille <akim@epita.fr>
12935 * tests/regression.at (Web2c Actions): Blindly move the actual
12936 output as expected output. The contents *seem* right to me, but I
12937 can't pretend reading perfectly parser tables... Nonetheless, all
12938 the other tests pass correctly, the table look OK, even though the
12939 presence of `$axiom' is to be noted: AFAICS it is useless (but
12942 2001-12-29 Akim Demaille <akim@epita.fr>
12944 * src/reader.c (readgram): Don't add the rule 0 if there were no
12945 rules read. In other words, add it _after_ having performed
12946 grammar sanity checks.
12947 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12949 2001-12-29 Akim Demaille <akim@epita.fr>
12951 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12952 visible, and some states have now a different number.
12954 2001-12-29 Akim Demaille <akim@epita.fr>
12956 * src/reader.c (readgram): Bind the initial rule's lineno to that
12958 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12959 (Solved SR Conflicts): Adjust rule 0's line number.
12961 2001-12-29 Akim Demaille <akim@epita.fr>
12963 Fix the `GAWK Grammar' failure.
12965 * src/LR0.c (final_state): Initialize to -1 so that we do compute
12966 the reductions of the first state which was mistakenly confused
12967 with the final state because precisely final_state was initialized
12969 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
12970 now noticed by Bison.
12971 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
12972 have a reduction on $default.
12974 2001-12-29 Akim Demaille <akim@epita.fr>
12976 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
12978 * src/closure.c (print_closure): Likewise.
12979 * src/derives.c (print_derives): Likewise.
12980 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
12983 2001-12-29 Akim Demaille <akim@epita.fr>
12985 * src/lalr.c (lookaheads_print): New.
12986 (lalr): Call it when --trace-flag.
12987 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
12990 2001-12-29 Akim Demaille <akim@epita.fr>
12992 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
12993 when walking through ritem, even via rule->rhs.
12994 * src/reduce.c (dump_grammar, useful_production, reduce_output)
12995 (useful_production, useless_nonterminals): Likewise.
12996 (reduce_grammar_tables): Likewise, plus update nritems.
12997 * src/nullable.c (set_nullable): Likewise.
12998 * src/lalr.c (build_relations): Likewise.
12999 * tests/sets.at (Nullable): Adjust.
13000 Fortunately, now, the $axiom is no longer nullable.
13002 2001-12-29 Akim Demaille <akim@epita.fr>
13004 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13006 * src/gram.c (ritem_longest_rhs): Likewise.
13007 * src/reduce.c (nonterminals_reduce): Likewise.
13008 * src/print_graph.c (print_graph): Likewise.
13009 * src/output.c (output_rule_data): Likewise.
13010 * src/nullable.c (set_nullable): Likewise.
13012 2001-12-29 Akim Demaille <akim@epita.fr>
13014 * src/output.c: Comment changes.
13016 2001-12-27 Paul Eggert <eggert@twinsun.com>
13018 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13019 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13020 Sparc, as they were causing more porting problems than the
13021 (minor) performance improvement was worth.
13023 Also, catch up with 1.31's YYSTD.
13025 2001-12-27 Akim Demaille <akim@epita.fr>
13027 * src/output.c (output_gram): Rely on nritems, not the
13028 0-sentinel. See below.
13029 Use -1 as separator, not 0.
13030 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13031 Rely on -1 as separator in yyrhs, instead of 0.
13032 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13033 twice `Now at end of input', therefore there are two lines less to
13036 2001-12-27 Akim Demaille <akim@epita.fr>
13038 * tests/regression.at (Unresolved SR Conflicts):
13039 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13042 2001-12-27 Akim Demaille <akim@epita.fr>
13044 * src/LR0.c (new_state): Recognize the final state by the fact it
13045 is reached by eoftoken.
13046 (insert_start_shifting_state, insert_eof_shifting_state)
13047 (insert_accepting_state, augment_automaton): Remove, since now
13048 these states are automatically computed from the initial state.
13049 (generate_states): Adjust.
13050 * src/print.c: When reporting a rule number to the user, substract
13051 1, so that the axiom rule is rule 0, and the first user rule is 1.
13052 * src/reduce.c: Likewise.
13053 * src/print_graph.c (print_core): For the time being, just as for
13054 the report, depend upon --trace-flags to dump the full set of
13056 * src/reader.c (readgram): Once the grammar read, insert the rule
13057 0: `$axiom: START-SYMBOL $'.
13058 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13059 number of the states has changed (the final state is no longer
13060 necessarily the last), catch up.
13062 2001-12-27 Akim Demaille <akim@epita.fr>
13064 Try to make the use of the eoftoken valid. Given that its value
13065 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13066 is used instead of > 0 where appropriate, (ii), depend upon nritems
13067 instead of the 0-sentinel.
13069 * src/gram.h, src/gram.c (nritems): New.
13070 Expected to be duplication of nitems, but for the time being...
13071 * src/reader.c (packgram): Assert nritems and nitems are equal.
13072 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13073 * src/closure.c (print_closure, print_fderives): Likewise.
13074 * src/gram.c (ritem_print): Likewise.
13075 * src/print.c (print_core, print_grammar): Likewise.
13076 * src/print_graph.c: Likewise.
13078 2001-12-27 Akim Demaille <akim@epita.fr>
13080 * src/main.c (main): If there are complains after grammar
13081 reductions, then output the report anyway if requested, then die.
13082 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13083 * src/reader.c (eoftoken): New.
13084 (parse_token_decl): If the token being defined has value `0', it
13086 (packsymbols): No longer hack `tags' to insert `$' by hand.
13087 Be sure to preserve the value of the eoftoken.
13088 (reader): Make sure eoftoken is defined.
13089 Initialize nsyms to 0: now eoftoken is created just like the others.
13090 * src/print.c (print_grammar): Don't special case the eof token.
13091 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13092 lie anyway, albeit pleasant.
13093 * tests/calc.at: Exercise error messages with eoftoken.
13094 Change the grammar so that empty input is invalid.
13095 Adjust expectations.
13096 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13098 2001-12-27 Akim Demaille <akim@epita.fr>
13100 * configure.in: Check the protos of strchr ans strspn.
13101 Replace strchr if needed.
13102 * src/system.h: Provide the protos of strchr, strspn and memchr if
13104 * lib/strchr.c: New.
13105 * src/reader.c (symbols_save): Use strchr.
13107 2001-12-27 Akim Demaille <akim@epita.fr>
13109 * src/print.c, src/print_graph.c (escape): New.
13110 Use it to quote the TAGS outputs.
13111 * src/print_graph.c (print_state): Now errors are in red, and
13112 reductions in green.
13113 Prefer high to wide: output the state number on a line of its own.
13115 2001-12-27 Akim Demaille <akim@epita.fr>
13117 * src/state.h, src/state.c (reductions_new): New.
13118 * src/LR0.c (set_state_table): Let all the states have a
13119 `reductions', even if reduced to 0.
13120 (save_reductions): Adjust.
13121 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13122 * src/print.c (print_reductions, print_actions): Adjust.
13123 * src/output.c (action_row): Adjust.
13125 2001-12-27 Akim Demaille <akim@epita.fr>
13127 * src/state.h, src/state.c (errs_new, errs_dup): New.
13128 * src/LR0.c (set_state_table): Let all the states have an errs,
13129 even if reduced to 0.
13130 * src/print.c (print_errs, print_reductions): Adjust.
13131 * src/output.c (output_actions, action_row): Adjust.
13132 * src/conflicts.c (resolve_sr_conflict): Adjust.
13134 2001-12-27 Akim Demaille <akim@epita.fr>
13136 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13138 2001-12-27 Akim Demaille <akim@epita.fr>
13140 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13141 * src/print.c: here.
13142 (lookaheadset, shiftset): New, used as additional storage by
13144 (print_results): Adjust.
13145 (print_shifts, print_gotos, print_errs): New, extracted from...
13146 (print_actions): here.
13147 * src/print_graph.c (print_actions): Remove dead code.
13149 2001-12-27 Akim Demaille <akim@epita.fr>
13151 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13154 2001-12-27 Akim Demaille <akim@epita.fr>
13156 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13157 (build_relations): Adjust.
13159 2001-12-27 Akim Demaille <akim@epita.fr>
13161 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13164 2001-12-27 Akim Demaille <akim@epita.fr>
13166 * src/reader.c (packgram): Catch nitems overflows.
13168 2001-12-27 Akim Demaille <akim@epita.fr>
13170 * src/files.c, src/files.h (guard_obstack): Remove.
13171 * src/output.c (output): Adjust.
13172 * src/reader.c (parse_braces): New, factoring...
13173 (copy_action, copy_guard): these two which are renamed as...
13174 (parse_action, parse_guard): these.
13175 As a voluntary consequence, using braces around guards is now
13178 2001-12-27 Akim Demaille <akim@epita.fr>
13180 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13181 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13183 (symbol_list_new): Adjust.
13184 (copy_action): action_line is the first line, not the last.
13185 (copy_guard): Just as for actions, store the `action' only, not
13186 the switch/case/break flesh.
13187 Don't parse the user action that might follow the guard, let...
13188 (readgram): do it, i.e., now, there can be an action after a
13190 In other words the guard is just explicitly optional.
13191 (packgram): Adjust.
13192 * src/output.c (guards_output): New.
13193 (output_parser): Call it when needed.
13194 (output): Also free the guard and attrs obstacks.
13195 * src/files.c, src/files.h (obstack_save): Remove.
13196 (output_files): Remove.
13197 As a result, if one needs the former `.act' file, using an
13198 appropriate skeleton which requires actions and guards is now
13200 * src/main.c (main): Adjust.
13201 * tests/semantic.at: New.
13202 * tests/regression.at: Use `input.y' as input file name.
13203 Avoid 8+3 problems by requiring input.c when the test needs the
13206 2001-12-27 Akim Demaille <akim@epita.fr>
13208 * src/reader.c (symbol_list_new): Be sure to initialize all the
13211 2001-12-27 Akim Demaille <akim@epita.fr>
13213 All the hacks using a final pseudo state are now useless.
13215 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13216 * src/lalr.c (nLA): New.
13217 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13218 instead of lookaheadsp from the pseudo state (nstate + 1).
13220 2001-12-27 Akim Demaille <akim@epita.fr>
13222 * src/output.c (action_row, token_actions): Use a state_t instead
13223 of a integer, and nlookaheads instead of the following state's
13226 2001-12-27 Akim Demaille <akim@epita.fr>
13228 * src/conflicts.c (log_resolution, flush_shift)
13229 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13230 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13231 (conflicts_print, print_reductions): Use a state_t instead of an
13232 integer when referring to a state.
13233 As much as possible, depend upon nlookaheads, instead of the
13234 `lookaheadsp' member of the following state (since lookaheads of
13235 successive states are successive, the difference between state n + 1
13236 and n served as the number of lookaheads for state n).
13237 * src/lalr.c (add_lookback_edge): Likewise.
13238 * src/print.c (print_core, print_actions, print_state)
13239 (print_results): Likewise.
13240 * src/print_graph.c (print_core, print_actions, print_state)
13241 (print_graph): Likewise.
13242 * src/conflicts.h: Adjust.
13244 2001-12-27 Akim Demaille <akim@epita.fr>
13246 * src/bison.hairy: Formatting/comment changes.
13248 Remove `register' indications.
13249 Add plenty of `static'.
13251 2001-12-27 Akim Demaille <akim@epita.fr>
13253 * src/output.c (prepare): Drop the muscle `ntbase' which
13254 duplicates ntokens.
13255 * src/bison.simple: Formatting/comment changes.
13256 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13257 is an undocumented synonym.
13259 2001-12-22 Akim Demaille <akim@epita.fr>
13261 * src/output.c (output_table_data): Change the prototype to use
13262 `int' for array ranges: some invocations do pass an int, not a
13264 Reported by Wayne Green.
13266 2001-12-22 Akim Demaille <akim@epita.fr>
13268 Some actions of web2c.y are improperly triggered.
13269 Reported by Mike Castle.
13271 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13272 * tests/regression.at (Web2c): Rename as...
13273 (Web2c Report): this.
13274 (Web2c Actions): New.
13276 2001-12-22 Akim Demaille <akim@epita.fr>
13278 Reductions in web2c.y are improperly reported.
13279 Reported by Mike Castle.
13281 * src/conflicts.c (print_reductions): Fix.
13282 * tests/regression.at (Web2c): New.
13284 2001-12-18 Akim Demaille <akim@epita.fr>
13286 Some host fail on `assert (!"foo")', which expands to
13287 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13288 Reported by Nelson Beebee.
13290 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13291 `#define it_succeeded 0' and `assert (it_succeeded)'.
13293 2001-12-17 Marc Autret <autret_m@epita.fr>
13295 * src/bison.simple: Don't hard code the skeleton line and filename.
13296 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13297 New line counter 'skeleton_line' (skeleton-line muscle).
13299 2001-12-17 Paul Eggert <eggert@twinsun.com>
13301 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13302 YYDEBUG must be defined to a nonzero value.
13304 * src/bison.simple (yytname): Do not assume that the user defines
13305 YYDEBUG to a properly parenthesized expression.
13307 2001-12-17 Akim Demaille <akim@epita.fr>
13309 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13310 nlookaheads is a new member.
13312 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13313 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13316 2001-12-17 Akim Demaille <akim@epita.fr>
13318 * src/files.h, src/files.c (open_files, close_files): Remove.
13319 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13321 * src/reader.c (reader): Do it.
13323 2001-12-17 Akim Demaille <akim@epita.fr>
13325 * src/conflicts.c (print_reductions): Formatting changes.
13327 2001-12-17 Akim Demaille <akim@epita.fr>
13329 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13330 (flush_reduce): New.
13331 (resolve_sr_conflict): Adjust.
13333 2001-12-17 Akim Demaille <akim@epita.fr>
13335 * src/output.c (output_obstack): Be static and rename as...
13336 (format_obstack): this, to avoid any confusion with files.c's
13338 * src/reader.h (muscle_obstack): Move to...
13339 * src/output.h: here, since it's defined in output.c.
13341 2001-12-17 Akim Demaille <akim@epita.fr>
13343 * src/output.c (action_row, save_column, default_goto)
13344 (sort_actions, matching_state, pack_vector): Better variable
13347 2001-12-17 Akim Demaille <akim@epita.fr>
13349 * src/output.c: Various formatting changes.
13351 2001-12-17 Akim Demaille <akim@epita.fr>
13353 * src/files.c (output_files): Free the output_obstack.
13354 * src/main.c (main): Call print and print_graph conditionally.
13355 * src/print.c (print): Work unconditionally.
13356 * src/print_graph.c (print_graph): Work unconditionally.
13357 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13359 2001-12-16 Marc Autret <autret_m@epita.fr>
13361 * src/output.c (actions_output): Fix. When we use %no-lines,
13362 there is one less line per action.
13364 2001-12-16 Marc Autret <autret_m@epita.fr>
13366 * src/bison.simple: Remove a useless #line directive.
13367 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13368 * src/output.c (get_lines_number): New.
13369 (output_parser): Adjust, now takes care about the lines of a
13371 Fix line numbering.
13372 (actions_output): Computes the number of lines taken by actions.
13373 (output_master_parser): Insert new skeleton which is the name of
13374 the output parser file name.
13376 2001-12-15 Marc Autret <autret_m@epita.fr>
13378 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13380 2001-12-15 Marc Autret <autret_m@epita.fr>
13382 * src/output.c (output_gram): Keep track of the hairy one.
13384 2001-12-15 Akim Demaille <akim@epita.fr>
13386 Make `make distcheck' work.
13388 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13389 system.h which uses libgettext.h.
13391 2001-12-15 Akim Demaille <akim@epita.fr>
13393 * src/nullable.c (set_nullable): Useless rules must be skipped,
13394 otherwise, since we range over their symbols, we might look at a
13395 nonterminal which no longer ``exists'', i.e., it is not counted in
13396 `nvars', hence we overflow our arrays.
13398 2001-12-15 Akim Demaille <akim@epita.fr>
13400 The header can also be produced directly, without any obstack!
13403 * src/files.c, src/files.h (defines_obstack): Remove.
13404 (compute_header_macro): Global.
13405 (defines_obstack_save): Remove.
13406 * src/reader.c (parse_union_decl): No longer output to
13407 defines_obstack: its content can be found in the `stype' muscle
13409 (output_token_translations): Merge into...
13410 (symbols_output): this.
13412 (symbols_save): this.
13414 * src/output.c (header_output): New.
13417 2001-12-15 Akim Demaille <akim@epita.fr>
13419 * src/reader.c (parse_union_decl): Instead of handling two obstack
13420 simultaneously, use one to define the `stype' muscle, and use the
13421 value of the latter to fill defines_obstack.
13422 (copy_comment): Remove.
13423 (copy_comment2): Work for a single obstack.
13425 (copy_comment): this.
13427 2001-12-15 Akim Demaille <akim@epita.fr>
13429 * src/lex.c, src/lex.h (xgetc): No longer static.
13430 * src/reader.c (parse_union_decl): Revamp.
13432 2001-12-15 Akim Demaille <akim@epita.fr>
13434 Still making progress in separating Bison into (i) input, (ii)
13435 process, (iii) output: now we can directly output the parser file
13436 without using table_obstack at all.
13438 * src/files.c, src/files.h (table_obstack): Bye bye.
13439 (parser_file_name): New.
13440 * src/files.c (compute_output_file_names): Compute it.
13441 * src/output.c (actions_output, output_parser)
13442 (output_master_parser): To a file instead of an obstack.
13444 2001-12-15 Akim Demaille <akim@epita.fr>
13446 Attach actions to rules, instead of pre-outputting them to
13449 * src/gram.h (rule_t): action and action_line are new members.
13450 * src/reader.c (symbol_list): Likewise.
13451 (copy_action): Save the actions within the rule.
13452 (packgram): Save them in rule_table.
13453 * src/output.c (actions_output): New.
13454 (output_parser): Use it on `%%actions'.
13455 (output_rule_data): Don't free rule_table.
13457 (prepare): Don't save the `action' muscle.
13458 * src/bison.simple: s/%%action/%%actions/.
13460 2001-12-15 Akim Demaille <akim@epita.fr>
13462 * src/reader.c (copy_action): When --yacc, don't append a `;'
13463 to the user action: let it fail if lacking.
13464 Suggested by Arnold Robbins and Tom Tromey.
13466 2001-12-14 Akim Demaille <akim@epita.fr>
13468 * src/lex.c (literalchar): Simply return the char you decoded, non
13469 longer mess around with obstacks and int pointers.
13470 Adjust all callers.
13472 2001-12-14 Akim Demaille <akim@epita.fr>
13474 * src/lex.c (literalchar): Don't escape the special characters,
13475 just decode them, and keep them as char (before, eol was output as
13476 the 2 char string `\n' etc.).
13477 * src/output.c (output_rule_data): Use quotearg to output the
13480 2001-12-13 Paul Eggert <eggert@twinsun.com>
13482 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13483 Do not infringe on the global user namespace when using C++.
13484 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13485 All uses of `fprintf' and `stderr' changed.
13487 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13489 2001-12-13 Akim Demaille <akim@epita.fr>
13491 The computation of nullable is broken: it doesn't handle empty
13494 * tests/torture.at (GNU AWK Grammar): New.
13495 * tests/sets.at (Nullable): New.
13496 * src/nullable.c (set_nullable): Instead of blindly looping over
13497 `ritems', loop over the rules, and then over their rhs's.
13499 Work around Autotest bugs.
13501 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13502 frame, because Autotest understand lines starting with a `+' as
13503 traces from the shell. Then, they are not processed properly.
13504 Admittedly an Autotest bug, but we don't have time to wait for
13505 Autotest to catch up.
13506 * tests/regression.at (Broken Closure): Adjust to the new table
13509 * tests/sets.at: here.
13511 2001-12-13 Akim Demaille <akim@epita.fr>
13513 * src/closure.c (closure): Use nrules instead of playing tricks
13514 with BITS_PER_WORD.
13516 2001-12-13 Akim Demaille <akim@epita.fr>
13518 * src/print.c (print_actions): Output the handling of `$' as the
13519 traces do: shifting the token EOF. Before EOF was treated as a
13521 * tests/regression.at: Adjust some tests.
13522 * src/print_graph.c (print_core): Complete the set of items via
13523 closure. The next-to-final and final states are still unsatisfying,
13524 but that's to be addressed elsewhere.
13525 No longer output the rule numbers, but do output the state number.
13526 A single loop for the shifts + gotos is enough, but picked a
13527 distinct color for each.
13528 (print_graph): Initialize and finalize closure.
13530 2001-12-13 Akim Demaille <akim@epita.fr>
13532 * src/reader.c (readgram): Remove dead code, an strip useless
13534 (get_type): Remove, unused.
13536 2001-12-12 Akim Demaille <akim@epita.fr>
13538 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13539 on that of lib/error.c.
13541 2001-12-12 Akim Demaille <akim@epita.fr>
13543 Some hosts don't like `/' in includes.
13545 * src/system.h: Include libgettext.h without qualifying the path.
13546 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13549 2001-12-11 Marc Autret <autret_m@epita.fr>
13551 * src/output.c (output_parser): Remove useless muscle.
13553 2001-12-11 Marc Autret <autret_m@epita.fr>
13555 * src/bison.simple: Remove #line just before %%epilogue. It
13556 is now handled in ...
13557 * src/reader.c (read_additionnal_code): Add the output of a
13558 #line for the epilogue.
13560 2001-12-10 Marc Autret <autret_m@epita.fr>
13562 * src/reader.c (copy_definition): Re-use CPP-outed code which
13563 replace precedent remove.
13564 * src/bison.simple: Remove #line before %%prologue because
13565 %%input-line is wrong at this time.
13567 2001-12-10 Marc Autret <autret_m@epita.fr>
13569 * src/reader.c (symbols_output): Clean up.
13570 * src/output.c (output_gram, output): Clean up.
13572 2001-12-10 Akim Demaille <akim@epita.fr>
13574 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13575 * src/LR0.c (set_state_table): here.
13576 * src/lalr.c (lalr): Call it.
13578 2001-12-10 Akim Demaille <akim@epita.fr>
13580 * src/state.h (shifts): Remove the `number' member: shifts are
13581 attached to state, hence no longer need to be labelled with a
13584 2001-12-10 Akim Demaille <akim@epita.fr>
13586 Now that states have a complete set of members, the linked list of
13587 shifts is useless: just fill directly the state's shifts member.
13589 * src/state.h (shifts): Remove the `next' member.
13590 * src/LR0.c (first_state, last_state): Remove.
13591 Adjust the callers.
13592 (augment_automaton): Don't look for the shifts that must be added
13593 a shift on EOF: it is those of the state we looked for! But now,
13594 since shifts are attached, it is no longer needed to looking
13595 merely by its id: its number.
13597 2001-12-10 Akim Demaille <akim@epita.fr>
13599 * src/LR0.c (augment_automaton): Better variable locality.
13600 Remove an impossible branch: if there is a state corresponding to
13601 the start symbol being shifted, then there is shift for the start
13602 symbol from the initial state.
13604 2001-12-10 Akim Demaille <akim@epita.fr>
13606 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13607 only when appropriate: when insert_start_shifting_state' is not
13609 * tests/regression.at (Rule Line Numbers): Adjust.
13611 2001-12-10 Akim Demaille <akim@epita.fr>
13613 * src/LR0.c (augment_automaton): Now that all states have shifts,
13614 merge the two cases addition shifts to the initial state.
13616 2001-12-10 Akim Demaille <akim@epita.fr>
13618 * src/lalr.c (set_state_table): Move to...
13620 * src/lalr.c (lalr): Don't call it...
13621 * src/LR0.c (generate_states): do it.
13622 * src/LR0.h (first_state): Remove, only the table is used.
13624 2001-12-10 Akim Demaille <akim@epita.fr>
13626 * src/LR0.h (first_shift, first_reduction): Remove.
13627 * src/lalr.c: Don't use first_shift: find shifts through the
13630 2001-12-10 Akim Demaille <akim@epita.fr>
13632 * src/LR0.c: Attach shifts to states as soon as they are
13634 * src/lalr.c (set_state_table): Instead of assigning shifts to
13635 state, just assert that the mapping was properly done.
13637 2001-12-10 Akim Demaille <akim@epita.fr>
13639 * src/LR0.c (insert_start_shift): Rename as...
13640 (insert_start_shifting_state): this.
13641 (insert_eof_shifting_state, insert_accepting_state): New.
13642 (augment_automaton): Adjust.
13643 Better locality of the variables.
13644 When looking if the start_symbol is shifted from the initial
13645 state, using `while (... symbol != start_symbol ...)' sounds
13646 better than `while (... symbol < start_symbol ...)': If fail
13647 to see how the order between symbols could be relevant!
13649 2001-12-10 Akim Demaille <akim@epita.fr>
13651 * src/getargs.h: Don't declare `spec_name_prefix' and
13652 `spec_file_prefix', declared by src/files.h.
13653 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
13654 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
13655 * src/output.c (prepare): Adjust.
13656 * src/reader.c (symbols_output): Likewise.
13657 * src/vmsgetargs.c: Vaguely adjust, but who cares?
13659 2001-12-10 Akim Demaille <akim@epita.fr>
13661 * src/muscle_tab.c (muscle_init): NULL is a better default than
13664 2001-12-10 Akim Demaille <akim@epita.fr>
13666 * src/reader.c (reader): Calling symbols_output once is enough.
13668 2001-12-10 Akim Demaille <akim@epita.fr>
13670 Now that states have a complete set of members, the linked list of
13671 reductions is useless: just fill directly the state's reductions
13674 * src/state.h (struct reductions): Remove member `number' and
13676 * src/LR0.c (first_reduction, last_reduction): Remove.
13677 (save_reductions): Don't link the new reductions, store them in
13679 * src/lalr.c (set_state_table): No need to attach reductions to
13680 states, it's already done.
13681 * src/output.c (output_actions): No longer free the shifts, then
13682 the reductions, then the states: free all the states and their
13685 2001-12-10 Akim Demaille <akim@epita.fr>
13687 * src/options.c (OPTN, DRTV, BOTH): New.
13688 (option_table): Use them.
13690 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13691 the job of system.h.
13692 * src/options.c: Don't include stdio.h and xalloc.h for the same
13695 2001-12-10 Akim Demaille <akim@epita.fr>
13697 * src/output.c (output, prepare): Make sure the values of the
13698 muscles `action' and `prologue' are 0-terminated.
13700 2001-12-10 Akim Demaille <akim@epita.fr>
13702 Clean up GCC warnings.
13704 * src/reader.c (copy_action): `buf' is not used.
13705 (parse_skel_decl): Be static.
13706 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13707 * src/options.h (create_long_option_table): Have a real prototype.
13708 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13709 (hash_delete_at): Return const void *.
13710 Adjust casts to preserve the const.
13712 2001-12-10 Akim Demaille <akim@epita.fr>
13714 * configure.in: Require 2.52g.
13715 M4 is not needed, but AUTOM4TE is.
13716 * m4/m4.m4: Remove.
13717 * tests/Makefile.am: Adjust.
13719 2001-12-10 Akim Demaille <akim@epita.fr>
13721 One structure for states is enough, even though theoretically
13722 there are LR(0) states and LALR(1) states.
13724 * src/lalr.h (state_t): Remove.
13725 (state_table): Be state_t **, not state_t *.
13726 * src/state.h (core, CORE_ALLOC): Rename as...
13727 (state_t, STATE_ALLOC): this.
13728 Add the LALR(1) members: shifts, reductions, errs.
13729 * src/LR0.c (state_table): Rename as...
13730 (state_hash): this, to avoid name clashes with the global
13732 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13733 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13735 2001-12-10 Akim Demaille <akim@epita.fr>
13737 Bison dumps core on bash.y.
13738 Reported by Pascal Bart.
13740 * src/warshall.c (bitmatrix_print): New.
13742 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
13743 j must be the outer loop.
13744 * tests/regression.at (Broken Closure): New.
13746 2001-12-05 Akim Demaille <akim@epita.fr>
13748 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13750 Reported by Peter Hamorsky.
13752 2001-12-05 Akim Demaille <akim@epita.fr>
13754 * src/conflicts.c (err_table): Remove.
13755 (resolve_sr_conflict): Adjust.
13756 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13758 (state_t.reductions, state_t.shifts): this.
13760 2001-12-05 Akim Demaille <akim@epita.fr>
13762 * src/reduce.c (reduce_grammar_tables): No longer disable the
13763 removal of useless rules via CPP but via `if (0)', so that the
13764 compiler still check the code is valid.
13765 For instance, it should have noticed `rline' no longer exists: use
13766 the `line' member of rule_t.
13767 * src/gram.c (dummy, rline): Remove, unused.
13769 2001-12-05 Akim Demaille <akim@epita.fr>
13771 * src/output.c (pack_vector): Use assert, not berror.
13772 * src/main.c (berror): Remove, unused.
13774 2001-12-05 Akim Demaille <akim@epita.fr>
13776 New experimental feature: if --verbose --trace output all the
13777 items of a state, not only its kernel.
13779 * src/print.c (print_core): If `trace_flag', then invoke closure
13780 before outputting the items of the state (print_core is no longer
13781 a correct name them).
13782 (print_results): Invoke new_closure/free_closure if needed.
13784 2001-12-05 Akim Demaille <akim@epita.fr>
13786 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13787 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13788 (nitemset): for consistency with the rest of the project.
13790 2001-12-05 Akim Demaille <akim@epita.fr>
13792 * src/closure.c (print_closure): Improve.
13793 (closure): Use it for printing input and output.
13795 2001-12-05 Akim Demaille <akim@epita.fr>
13797 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13798 indexed by nonterminals.
13800 2001-12-05 Akim Demaille <akim@epita.fr>
13802 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13804 * src/warshall.h: Remove accidental duplication of the content.
13806 2001-12-05 Akim Demaille <akim@epita.fr>
13808 * src/closure.c (set_fderives): De-obfuscate.
13810 2001-12-05 Akim Demaille <akim@epita.fr>
13812 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13814 2001-12-05 Akim Demaille <akim@epita.fr>
13816 * src/closure.c (set_firsts): De-obfuscate.
13818 2001-12-05 Akim Demaille <akim@epita.fr>
13820 * src/output.c (action_row): De-obfuscate
13821 using the good o' techniques: arrays not pointers, variable
13822 locality, BITISSET, RESETBIT etc.
13824 2001-12-05 Akim Demaille <akim@epita.fr>
13826 Pessimize the code to simplify it: from now on, all the states
13827 have a valid SHIFTS, which NSHIFTS is possibly 0.
13829 * src/LR0.c (shifts_new): Be global and move to..
13830 * src/state.c, src/state.h: here.
13831 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13832 * src/print_graph: Adjust.
13834 2001-12-05 Akim Demaille <akim@epita.fr>
13836 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13837 * src/conflicts.c: Use it.
13838 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13839 incorrectly ``simplified''.
13841 2001-12-05 Akim Demaille <akim@epita.fr>
13843 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
13844 using the good o' techniques: arrays not pointers, variable
13845 locality, BITISSET, RESETBIT etc.
13847 2001-12-05 Akim Demaille <akim@epita.fr>
13849 * src/state.h (SHIFT_SYMBOL): New.
13850 * src/conflicts.c: Use it to deobfuscate.
13852 2001-12-05 Akim Demaille <akim@epita.fr>
13854 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
13855 (print_reductions): De-obfuscate using the good o' techniques:
13856 arrays not pointers, variable locality, BITISSET.
13858 2001-12-05 Akim Demaille <akim@epita.fr>
13860 * src/conflicts.c (print_reductions): Arrays, not pointers.
13863 2001-12-05 Akim Demaille <akim@epita.fr>
13865 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13867 2001-12-05 Akim Demaille <akim@epita.fr>
13869 * src/conflicts.c (print_reductions): Improve variable locality.
13871 2001-12-05 Akim Demaille <akim@epita.fr>
13873 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13875 2001-12-05 Akim Demaille <akim@epita.fr>
13877 * src/conflicts.c (print_reductions): Improve variable locality.
13879 2001-12-05 Akim Demaille <akim@epita.fr>
13881 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13882 * src/lalr.c: Use them.
13884 2001-12-05 Akim Demaille <akim@epita.fr>
13886 * src/LR0.c (augment_automaton): Formatting changes.
13887 Better variable locality.
13889 2001-12-05 Akim Demaille <akim@epita.fr>
13891 * src/lalr.c (matrix_print): New.
13892 (transpose): Use it.
13893 Use arrays instead of pointers.
13895 2001-12-05 Akim Demaille <akim@epita.fr>
13897 * src/lalr.c (maxrhs): Move to...
13898 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
13899 * src/lalr.c (build_relations): Adjust.
13901 2001-12-05 Akim Demaille <akim@epita.fr>
13903 * src/lalr.c (transpose): Free the memory allocated to the
13904 argument, as it is replaced by the results by the unique caller.
13905 (build_relations): Merely invoke transpose: it handles the memory
13907 Improve variable locality.
13908 Avoid variables used as mere abbreviations.
13909 (compute_lookaheads): Use arrays instead of pointers.
13911 2001-12-05 Akim Demaille <akim@epita.fr>
13913 * src/lalr.c (initialize_F): Improve variable locality.
13914 Avoid variables used as mere abbreviations.
13916 2001-12-05 Akim Demaille <akim@epita.fr>
13918 * src/derives.c (print_derives): Display the ruleno.
13919 * src/lalr.c (initialize_F, transpose): Better variable locality
13920 to improve readability.
13921 Avoid variables used as mere abbreviations.
13923 2001-12-05 Akim Demaille <akim@epita.fr>
13925 * src/lalr.c (traverse): Use arrays instead of pointers.
13927 2001-12-05 Akim Demaille <akim@epita.fr>
13929 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13930 the handling of squeue.
13931 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13933 2001-12-05 Akim Demaille <akim@epita.fr>
13935 Because useless nonterminals are now kept alive (instead of being
13936 `destroyed'), we now sometimes examine them, and store information
13937 related to them. Hence we need to know their number, and adjust
13938 memory allocations.
13940 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13942 * src/LR0.c (allocate_itemsets): The memory allocated to
13943 `symbol_count' was used for two different purpose: once to count
13944 the number of occurrences of each symbol, and later reassigned to
13945 `shift_symbol', containing the symbol that can be shifted from a
13947 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13949 (new_itemsets): Allocate `shift_symbol' here.
13950 (allocate_itemsets): symbol_count includes useless nonterminals.
13951 Make room for them.
13952 (free_storage): Use `free', not `XFREE', for pointers that cannot
13955 2001-12-05 Akim Demaille <akim@epita.fr>
13957 * src/nullable.c (set_nullable): Deobfuscate the handling of
13959 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13961 2001-12-05 Akim Demaille <akim@epita.fr>
13963 * src/gram.c, src/gram.h (ritem_print): New.
13964 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
13965 (This useless function was defined only to work around VMS linkers
13966 that can't handle compilation units with variables only).
13967 * src/reduce.c (dump_grammar): Use it to trace the construction of
13970 2001-12-04 Paul Eggert <eggert@twinsun.com>
13972 * src/bison.simple (union yyalloc): Change member names
13973 to be the same as the stack names.
13974 (yyparse): yyptr is now union yyalloc *, not char *.
13975 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
13976 and may generate better code on some machines.
13977 (yystpcpy): Use prototype if __STDC__ is defined, not just
13978 if __cplusplus is defined.
13980 2001-11-30 Akim Demaille <akim@epita.fr>
13982 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
13983 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
13984 Gettext doesn't compile cleanly, and dies with -Werror.
13985 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
13986 Include WARNING_CFLAGS here.
13987 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
13988 before being defined.
13990 2001-11-27 Paul Eggert <eggert@twinsun.com>
13992 * lib/quotearg.h (quotearg_n, quotearg_n_style):
13993 First arg is int, not unsigned.
13994 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
13995 (SIZE_MAX, UINT_MAX): New macros.
13996 (quotearg_n_options): Abort if N is negative.
13997 Avoid overflow check on hosts where size_t is 64 bits and int
13998 is 32 bits, as overflow is impossible there.
13999 Fix off-by-one typo that caused unnecessary reallocation.
14001 2001-11-29 Paul Eggert <eggert@twinsun.com>
14003 Name space cleanup in generated parser.
14005 * doc/bison.texinfo (Bison Parser): Discuss system headers
14006 and their effect on the user name space.
14008 * src/bison.simple:
14009 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14010 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14011 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14013 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14014 on user names when possible.
14016 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14017 Simplify test for whather <alloca.h> exists.
14019 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14021 (<stdio.h>): Include if YYDEBUG.
14023 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14024 ! defined (yyoverflow) && ! defined (yymemcpy).
14026 (yymemcpy, yyparse): Rename local variables as needed so that
14027 they all begin with 'yy'.
14029 (yystrlen, yystpcpy): New functions.
14031 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14034 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14035 instead of relying on string.h functions. Use YYSTACK_ALLOC
14036 and YYSTACK_FREE instead of malloc and free.
14038 2001-11-30 Akim Demaille <akim@epita.fr>
14040 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14041 before their first uses.
14042 (YYBISON, YYPURE): Move to the top of the output.
14044 2001-11-30 Akim Demaille <akim@epita.fr>
14046 * tests/reduce.at (Useless Nonterminals): Fix.
14048 2001-11-30 Akim Demaille <akim@epita.fr>
14050 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14051 if body instead of `;' to pacify GCC's warnings.
14053 2001-11-30 Akim Demaille <akim@epita.fr>
14055 Instead of mapping the LHS of unused rules to -1, keep the LHS
14056 valid, but flag the rules as invalid.
14058 * src/gram.h (rule_t): `useful' is a new member.
14059 * src/print.c (print_grammar): Adjust.
14060 * src/derives.c (set_derives): Likewise.
14061 * src/reader.c (packgram, reduce_output): Likewise.
14062 * src/reduce.c (reduce_grammar_tables): Likewise.
14063 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14065 2001-11-30 Akim Demaille <akim@epita.fr>
14067 * src/reduce.c (reduce_output): Formatting changes.
14068 * src/print.c (print_results, print_grammar): Likewise.
14069 * tests/regression.at (Rule Line Numbers)
14070 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14072 2001-11-30 Akim Demaille <akim@epita.fr>
14074 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14075 useless nonterminals, move them at the end of the symbol arrays.
14076 (reduce_output): Adjust.
14077 * tests/reduce.at (Useless Nonterminals): Adjust.
14079 2001-11-30 Akim Demaille <akim@epita.fr>
14081 * src/reduce.c: Various comment/formatting changes.
14082 (nonterminals_reduce): New, extracted from...
14083 (reduce_grammar_tables): here.
14084 (reduce_grammar): Call nonterminals_reduce.
14086 2001-11-29 Paul Eggert <eggert@twinsun.com>
14088 * src/bison.simple (YYSTACK_REALLOC): Remove.
14089 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14090 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14092 (union yyalloc): New type.
14093 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14094 an arbitrary restriction on hosts where size_t is wider than int.
14096 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14097 a parser stack overflow. Allocate just one block of memory for all
14098 three stacks, instead of allocating three blocks; this typically is
14099 faster and reduces fragmentation.
14101 Do not limit the number of items in the stack to a value that fits
14102 in 'int', as this is an arbitrary limit on hosts with 64-bit
14103 size_t and 32-bit int.
14105 2001-11-29 Marc Autret <autret_m@epita.fr>
14107 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14108 of defining YYERROR_VERBOSE.
14109 [AT_DATA]: $4 is now out of C declarations in the prologue.
14111 2001-11-28 Marc Autret <autret_m@epita.fr>
14113 * src/reader.c (parse_dquoted_param): New.
14114 (parse_skel_decl): Use it.
14115 * src/lex.h: Add its prototype.
14116 * src/lex.c (literalchar): Become not static.
14118 2001-11-28 Marc Autret <autret_m@epita.fr>
14120 * src/output.h: And put its extern declaration here.
14121 * src/output.c (error_verbose): Define here.
14122 (prepare): Echo name modification.
14123 * src/getargs.h: Clean its extern declaration.
14124 * src/getargs.c (error_verbose_flag): Remove.
14125 (getargs): Remove case 'e'.
14126 * src/options.c (option_table): 'error-verbose' is now seen as simple
14130 * src/reader.c (read_declarations): Remove case tok_include.
14131 (parse_include_decl): Remove.
14132 * src/lex.h (token_t): Remove tok_include.
14133 * src/options.c (option_table): 'include' is now a simple command line
14136 2001-11-28 Marc Autret <autret_m@epita.fr>
14138 * src/bison.simple: Adjust muscle names.
14139 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14140 * src/output.c (prepare): s/_/-/ for the muscles names.
14141 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14143 2001-11-28 Marc Autret <autret_m@epita.fr>
14145 * src/bison.simple: Fix debug.
14146 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14148 2001-11-28 Akim Demaille <akim@epita.fr>
14150 * src/LR0.c (shifts_new): New.
14151 (save_shifts, insert_start_shift, augment_automaton): Use it.
14153 2001-11-28 Akim Demaille <akim@epita.fr>
14155 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14158 2001-11-28 Akim Demaille <akim@epita.fr>
14160 * src/closure.c (closure): Instead of looping over word in array
14161 then bits in words, loop over bits in array.
14163 2001-11-28 Akim Demaille <akim@epita.fr>
14165 * src/closure.c (closure): No longer optimize the special case
14166 where all the bits of `ruleset[r]' are set to 0, to make the code
14169 2001-11-28 Akim Demaille <akim@epita.fr>
14171 * src/closure.c (closure): `r' and `c' are new variables, used to
14172 de-obfuscate accesses to RULESET and CORE.
14174 2001-11-28 Akim Demaille <akim@epita.fr>
14176 * src/reduce.c (reduce_print): Use ngettext.
14177 (dump_grammar): Improve the trace accuracy.
14179 2001-11-28 Akim Demaille <akim@epita.fr>
14181 * src/reduce.c (dump_grammar): Don't translate trace messages.
14183 2001-11-28 Akim Demaille <akim@epita.fr>
14185 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14186 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14187 as all tags are free'ed afterwards.
14188 From Enrico Scholz.
14190 2001-11-27 Paul Eggert <eggert@twinsun.com>
14192 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14193 use alloca when we didn't want to, and vice versa.
14195 2001-11-27 Marc Autret <autret_m@epita.fr>
14197 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14199 * src/output.c (prepare): Remove its update.
14201 2001-11-27 Marc Autret <autret_m@epita.fr>
14203 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14204 Use %error-verbose.
14206 2001-11-27 Marc Autret <autret_m@epita.fr>
14208 * src/bison.simple: Remove YYERROR_VERBOSE using.
14209 Use %%error_verbose.
14210 (yyparse): Likewise.
14211 * src/output.c (prepare): Give its final value.
14212 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14213 * src/getargs.h: Add its extern declaration.
14214 * src/getargs.c (error_verbose_flag): New int.
14215 (getargs): Update to catch new case.
14216 * src/options.c (option_table): 'error-verbose' is a new option.
14217 (shortopts): Update.
14219 2001-11-27 Akim Demaille <akim@epita.fr>
14221 * src/system.h: Use intl/libgettext.h.
14222 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14224 2001-11-27 Akim Demaille <akim@epita.fr>
14226 * tests/torture.at (Exploding the Stack Size with Malloc):
14227 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14229 2001-11-27 Akim Demaille <akim@epita.fr>
14231 * src/files.c: Include error.h.
14232 Reported by Hans Aberg.
14234 2001-11-26 Marc Autret <autret_m@epita.fr>
14236 * src/reader.c (parse_include_decl): New, not yet implemented.
14237 (read_declarations): Add case tok_include.
14238 * src/getargs.h (include): Add its extern definition.
14239 * src/getargs.c (include): New const char *.
14240 (getargs): Add case '-I'.
14241 * src/options.c (option_table): Add include as command line and
14243 * src/lex.h (token_t): Add tok_include.
14245 2001-11-26 Akim Demaille <akim@epita.fr>
14247 * src/reader.c (readgram): Make sure rules for mid-rule actions
14248 have a lineno equal to that of their host rule.
14249 Reported by Hans Aberg.
14250 * tests/regression.at (Rule Line Numbers): New.
14252 2001-11-26 Akim Demaille <akim@epita.fr>
14254 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14257 2001-11-26 Akim Demaille <akim@epita.fr>
14259 * src/complain.c, src/complain.h (error): Remove, provided by
14262 2001-11-26 Akim Demaille <akim@epita.fr>
14264 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14265 issue an error message.
14266 * tests/regression.at (Invalid %directive): New.
14267 Reported by Hans Aberg.
14269 2001-11-26 Akim Demaille <akim@epita.fr>
14271 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14272 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14274 2001-11-26 Akim Demaille <akim@epita.fr>
14276 * src/conflicts.c (conflicts_print): Don't complain at all when
14277 there are no reduce/reduce conflicts, and as many shift/reduce
14278 conflicts as expected.
14279 * tests/regression.at (%expect right): Adjust.
14281 2001-11-23 Akim Demaille <akim@epita.fr>
14283 * lib/alloca.c: Update, from fileutils.
14285 2001-11-23 Akim Demaille <akim@epita.fr>
14287 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14289 2001-11-23 Akim Demaille <akim@epita.fr>
14291 * src/system.h: Include alloca.h.
14292 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14294 2001-11-23 Akim Demaille <akim@epita.fr>
14296 * src/print_graph.c (print_actions): Remove `rule', unused.
14297 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14298 pacify GCC's signed < unsigned warnings.
14299 * src/closure.c (itemsetsize): Likewise.
14300 * src/reader.c (symbol_list_new): Static.
14302 2001-11-23 Akim Demaille <akim@epita.fr>
14304 Attaching lineno to buckets is stupid, since only one copy of each
14305 symbol is kept, only the line of the first occurrence is kept too.
14307 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14308 * src/reader.c (rline_allocated): Remove, unused.
14309 (symbol_list): Have a `line' member.
14310 (symbol_list_new): New.
14311 (readgram): Use it.
14312 * src/print.c (print_grammar): Output the rule line numbers.
14313 * tests/regression.at (Solved SR Conflicts)
14314 (Unresolved SR Conflicts): Adjust.
14315 Reported by Hans Aberg.
14317 2001-11-22 Marc Autret <autret_m@epita.fr>
14319 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14321 2001-11-22 Marc Autret <autret_m@epita.fr>
14323 * src/muscle_tab.c (muscle_init): Remove initialization of
14325 * src/output.c (output_master_parser): Do it here.
14327 2001-11-20 Akim Demaille <akim@epita.fr>
14330 * configure.in (ALL_LINGUAS): Adjust.
14331 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14332 longer contains strings to translate.
14334 2001-11-19 Akim Demaille <akim@epita.fr>
14336 * src/conflicts.c (conflicts_print): Add a missing \n.
14338 2001-11-19 Akim Demaille <akim@epita.fr>
14340 * src/nullable.c (nullable_print): New.
14341 (set_nullable): Call it when tracing.
14342 Better locality of variables.
14344 2001-11-19 Akim Demaille <akim@epita.fr>
14346 * src/print.c (print_actions): Better locality of variables.
14348 2001-11-19 Akim Demaille <akim@epita.fr>
14350 * src/derives.c (print_derives): Fix and enrich.
14351 * src/closure.c (print_fderives): Likewise.
14353 2001-11-19 Akim Demaille <akim@epita.fr>
14355 * src/closure.c (itemsetend): Remove, replaced with...
14356 (itemsetsize): new.
14358 2001-11-19 Akim Demaille <akim@epita.fr>
14360 * src/LR0.c (kernel_end): Remove, replaced with...
14361 (kernel_size): new.
14363 2001-11-19 Akim Demaille <akim@epita.fr>
14365 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14368 2001-11-19 Akim Demaille <akim@epita.fr>
14370 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14372 2001-11-19 Akim Demaille <akim@epita.fr>
14374 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14376 * src/LR0.c: Likewise.
14377 (allocate_itemsets): Use arrays instead of pointers to clarify.
14379 2001-11-19 Akim Demaille <akim@epita.fr>
14381 * src/getargs.c (statistics_flag): Replace with...
14383 (longopts): Accept --trace instead of --statistics.
14384 * src/getargs.h, src/options.c: Adjust.
14385 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14386 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14388 2001-11-19 Akim Demaille <akim@epita.fr>
14390 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
14391 pointers to clarify the code.
14392 (save_reductions, save_shifts): Factor common parts of alternatives.
14394 2001-11-19 Akim Demaille <akim@epita.fr>
14396 * src/LR0.c (new_state, get_state): Complete TRACE code.
14397 * src/closure.c: Include `reader.h' to get `tags', needed by the
14399 Rename the conditional DEBUG as TRACE.
14400 Output consistently TRACEs to stderr, not stdout.
14401 * src/derives.c: Likewise.
14402 * src/reduce.c: (inaccessable_symbols): Using if is better style
14404 Use `#if TRACE' instead of `#if 0' for tracing code.
14406 2001-11-19 Akim Demaille <akim@epita.fr>
14408 * src/system.h (LIST_FREE, shortcpy): New.
14409 * src/LR0.c: Use them.
14410 * src/output.c (free_itemsets, free_reductions, free_shifts):
14411 Remove, replaced by LIST_FREE.
14413 2001-11-19 Akim Demaille <akim@epita.fr>
14415 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14416 (REDUCTIONS_ALLOC): New.
14417 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14420 2001-11-19 Akim Demaille <akim@epita.fr>
14422 * src/LR0.c (new_state): Complete trace code.
14423 * src/nullable.c (set_nullable): Don't translate traces.
14425 2001-11-19 Akim Demaille <akim@epita.fr>
14427 * src/print_graph.c (print_core): Better locality of variables.
14428 * src/print.c (print_core): Likewise.
14430 2001-11-19 Akim Demaille <akim@epita.fr>
14432 * src/vcg.c: You do the output, so you are responsible of the
14433 handling of VCG syntax, in particular: use quotearg.
14434 * src/print_graph.c: Don't.
14435 (print_actions): Don't output the actions as part of the nodes,
14436 since that's the job of the edges.
14437 (print_state): Don't output by hand: fill the node description,
14438 and ask for its output.
14440 2001-11-19 Akim Demaille <akim@epita.fr>
14442 * src/bison.simple (yyparse): When verbosely reporting an error,
14443 no longer put additional quotes around token names.
14444 * tests/calc.at: Adjust.
14446 2001-11-19 Akim Demaille <akim@epita.fr>
14448 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14449 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14450 * src/output.c: Adjust.
14452 2001-11-19 Akim Demaille <akim@epita.fr>
14454 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14456 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14458 2001-11-19 Akim Demaille <akim@epita.fr>
14460 * src/gram.h (rule_t): New.
14462 (rrhs, rlhs): Remove, part of state_t.
14463 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14464 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14465 * src/reader.c, src/reduce.c: Adjust.
14467 2001-11-19 Akim Demaille <akim@epita.fr>
14469 * src/reader.c (symbols_output): New, extracted from...
14470 (packsymbols): Here.
14473 2001-11-19 Akim Demaille <akim@epita.fr>
14475 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14476 (maxrhs): this new function.
14478 2001-11-19 Akim Demaille <akim@epita.fr>
14480 * src/lalr.c (F): New macro to access the variable F.
14483 2001-11-19 Akim Demaille <akim@epita.fr>
14485 * src/lalr.h (LA): New macro to access the variable LA.
14486 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14487 * src/lalr.c: Adjust.
14489 2001-11-19 Akim Demaille <akim@epita.fr>
14491 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14492 (set_state_table): handle the `lookaheads' members.
14494 2001-11-19 Akim Demaille <akim@epita.fr>
14496 * src/lalr.h (lookaheads): Removed array, whose contents is now
14498 (state_t): this structure.
14499 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14502 2001-11-19 Akim Demaille <akim@epita.fr>
14504 * src/lalr.h (consistent): Removed array, whose contents is now
14506 (state_t): this structure.
14507 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14510 2001-11-19 Akim Demaille <akim@epita.fr>
14512 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14513 contents are now members of...
14514 (state_t): this structure.
14515 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14518 2001-11-19 Akim Demaille <akim@epita.fr>
14520 * src/lalr.h (state_t): New.
14521 (state_table): Be a state_t * instead of a core **.
14522 (accessing_symbol): Remove, part of state_t.
14523 * src/lalr.c: Adjust.
14524 (set_accessing_symbol): Merge into...
14525 (set_state_table): this.
14526 * src/print_graph.c, src/conflicts.c: Adjust.
14528 2001-11-14 Akim Demaille <akim@epita.fr>
14530 * tests/calc.at, tests/output.at, tests/regression.at,
14531 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14532 now the tests are run in private dirs, therefore AC_CLEANUP and
14533 family can be simplified to 0-ary.
14534 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14535 use abs. path to find config.h.
14536 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14537 stderr, there can be way too much random noise.
14538 Instead pass -Werror to GCC and rely on the exit status.
14539 Reported by Wolfram Wagner.
14541 2001-11-14 Akim Demaille <akim@epita.fr>
14543 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14544 defined only if yyoverflow is defined, to avoid `warning: unused
14546 Reported by The Test Suite.
14548 2001-11-14 Akim Demaille <akim@epita.fr>
14550 * src/print.c: Include reduce.h.
14551 Reported by Hans Aberg.
14553 2001-11-14 Akim Demaille <akim@epita.fr>
14555 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
14556 Revert a previous patch: these are really const.
14557 * src/conflicts.c (conflict_report): Additional useless pair of
14558 braces to pacify GCC's warnings for `if () if () {} else {}'.
14559 * src/lex.c (parse_percent_token): Replace equal_offset with
14562 Be sure to strdup `arg' when used, since there is no reason for
14563 token_buffer not to change.
14565 2001-11-14 Akim Demaille <akim@epita.fr>
14567 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14569 * src/main.c (main): Use them.
14570 Suggested by Hans Aberg.
14572 2001-11-12 Akim Demaille <akim@epita.fr>
14574 * src/system.h (ngettext): Now that we use ngettext, be sure to
14575 provide a default definition when NLS are not used.
14577 2001-11-12 Akim Demaille <akim@epita.fr>
14579 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
14580 Use @kbd to denote user input.
14581 (Language and Grammar): ANSIfy the example.
14582 Adjust its layout for info/notinfo.
14583 (Location Tracking Calc): Output error messages to stderr.
14584 Output locations in a more GNUtically correct way.
14585 Fix a couple of Englishos.
14586 Adjust @group/@end group pairs.
14588 2001-11-12 Akim Demaille <akim@epita.fr>
14590 %expect was not functioning at all.
14592 * src/conflicts.c (expected_conflicts): Set to -1.
14593 (conflict_report): Use ngettext.
14594 (conflicts_print): Check %expect and make its violation an error.
14595 * doc/bison.texinfo (Expect Decl): Adjust.
14596 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
14597 * tests/regression.at (%expect not enough, %expect right)
14598 (%expect too much): New.
14600 2001-11-12 Akim Demaille <akim@epita.fr>
14602 * tests/regression.at (Conflicts): Rename as...
14603 (Unresolved SR Conflicts): this.
14604 (Solved SR Conflicts): New.
14606 2001-11-12 Akim Demaille <akim@epita.fr>
14608 * src/reduce.c (print_results): Rename as...
14609 (reduce_output): This.
14610 Output to OUT, passed as argument, instead of output_obstack.
14611 (dump_grammar): Likewise.
14612 (reduce_free): New.
14614 (reduce_grammar): No longer call reduce_output, since...
14615 * src/print.c (print_results): do it.
14616 * src/main.c (main): Call reduce_free;
14618 2001-11-12 Akim Demaille <akim@epita.fr>
14620 * src/conflicts.c (print_reductions): Accept OUT as argument.
14621 Output to it, not to output_obstack.
14622 * src/print.c (print_actions): Adjust.
14624 2001-11-12 Akim Demaille <akim@epita.fr>
14626 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
14627 the result instead of using...
14628 (src_total, rrc_total, src_count, rrc_count): Remove.
14629 (any_conflicts): Remove.
14630 (print_conflicts): Split into...
14631 (conflicts_print, conflicts_output): New.
14632 * src/conflicts.h: Adjust.
14633 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
14634 * src/print.c (print_grammar): Issue `\n' between two rules.
14635 * tests/regression.at (Conflicts): New.
14636 Reported by Tom Lane.
14638 2001-11-12 Akim Demaille <akim@epita.fr>
14640 * tests/regression.at (Invalid input): Remove, duplicate with
14641 ``Invalid input: 1''.
14643 2001-11-12 Akim Demaille <akim@epita.fr>
14645 * tests/torture.at (AT_DATA_STACK_TORTURE)
14646 (Exploding the Stack Size with Alloca)
14647 (Exploding the Stack Size with Malloc): New.
14649 2001-11-12 Akim Demaille <akim@epita.fr>
14651 * src/bison.simple (YYSTACK_REALLOC): New.
14652 (yyparse) [!yyoverflow]: Use it and free the old stack.
14653 Reported by Per Allansson.
14655 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
14657 * src/bison.simple: Define type yystype instead of YYSTYPE, and
14658 define CPP macro, which substitute YYSTYPE by yystype.
14659 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
14660 with yyltype/YYLTYPE. This allows inclusion of the generated
14661 header within the parser if the compiler, such as GGC, accepts
14662 multiple equivalent #defines.
14665 2001-11-05 Akim Demaille <akim@epita.fr>
14667 * src/reader.c (symbols_output): New, extracted from...
14668 (packsymbols): here.
14671 2001-11-05 Akim Demaille <akim@epita.fr>
14673 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14675 2001-11-05 Akim Demaille <akim@epita.fr>
14677 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14680 2001-11-05 Akim Demaille <akim@epita.fr>
14682 * src/options.h (struct option_table_struct): set_flags is void*.
14683 * src/options.c (longopts): Support `--output' and `%output'.
14685 * src/lex.h (tok_setopt): Remove, replaced with...
14686 (tok_intopt, tok_stropt): these new guys.
14687 * src/lex.c (getopt.h): Not needed.
14688 (token_buffer, unlexed_token_buffer): Not const.
14689 (percent_table): Promote `-' over `_' in directive names.
14690 Active `%name-prefix', `file-prefix', and `output'.
14691 (parse_percent_token): Accept possible arguments to directives.
14692 Promote `-' over `_' in directive names.
14694 2001-11-04 Akim Demaille <akim@epita.fr>
14696 * doc/bison.texinfo (Decl Summary): Split the list into
14697 `directives for grammars' and `directives for bison'.
14699 Add description of `%name-prefix', `file-prefix', and `output'.
14700 Promote `-' over `_' in directive names.
14701 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14702 Simplify the description of `--name-prefix'.
14703 Promote `-' over `_' in directive names.
14704 Promote `--output' over `--output-file'.
14705 Fix the description of `--defines'.
14706 * tests/output.at: Exercise %file-prefix and %output.
14708 2001-11-02 Akim Demaille <akim@epita.fr>
14710 * doc/refcard.tex: Update.
14712 2001-11-02 Akim Demaille <akim@epita.fr>
14714 * src/symtab.h (SUNDEF): New.
14715 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14716 stand for `uninitialized', instead of 0.
14717 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14718 * src/lex.c (lex): Adjust.
14720 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14722 Let yylex return it instead of a plain 0.
14723 Reported by Dick Streefland.
14725 2001-11-02 Akim Demaille <akim@epita.fr>
14727 * tests/regression.at (Mixing %token styles): New test.
14729 2001-11-02 Akim Demaille <akim@epita.fr>
14731 * src/reader.c (parse_thong_decl): Formatting changes.
14732 (token_translations_init): New, extracted from...
14733 (packsymbols): Here.
14736 2001-11-01 Akim Demaille <akim@epita.fr>
14738 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14739 Check that `9foo.y' produces correct cpp guards.
14740 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14744 2001-11-01 Akim Demaille <akim@epita.fr>
14746 * tests/regression.at (Invalid input: 2): New.
14747 * src/lex.c (unlexed_token_buffer): New.
14748 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14752 2001-11-01 Akim Demaille <akim@epita.fr>
14754 * tests/calc.at: Catch up with 1.30.
14755 * configure.in: Bump to 1.49a.
14756 Adjust to newer Autotest.
14758 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
14760 * src/conflicts.c: Move global variables rrc_total and src_total ...
14761 (print_conflicts): here.
14762 * src/output.c (output): Free global variable user_toknums.
14763 * src/lex.c (token_obstack): Become static.
14765 2001-10-18 Akim Demaille <akim@epita.fr>
14767 * tests/atlocal.in (GCC): Add.
14768 * tests/calc.at: s/m4_match/m4_bmatch/.
14769 s/m4_patsubst/m4_bpatsubst/.
14770 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14771 * configure.in: AC_SUBST(GCC).
14773 2001-10-14 Marc Autret <autret_m@epita.fr>
14775 * src/options.c (create_long_option_table): Fix.
14777 2001-10-10 Akim Demaille <akim@epita.fr>
14779 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14781 2001-10-04 Akim Demaille <akim@epita.fr>
14783 * src/reader.c (parse_union_decl): Push the caracters in
14784 union_obstack, not attrs_obstack.
14786 2001-10-04 Akim Demaille <akim@epita.fr>
14788 Merge in the branch 1.29.
14790 * src/reader.c (packsymbols): Use a temporary obstack for
14791 `%%tokendef', since output_stack is already used elsewhere.
14793 2001-10-02 Akim Demaille <akim@epita.fr>
14797 2001-10-02 Akim Demaille <akim@epita.fr>
14801 2001-10-02 Akim Demaille <akim@epita.fr>
14803 * tests/regression.at (Invalid CPP headers): New.
14804 From Alexander Belopolsky.
14805 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14807 2001-10-02 Akim Demaille <akim@epita.fr>
14809 * tests/regression.at (Invalid input): New.
14810 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14813 2001-10-02 Akim Demaille <akim@epita.fr>
14815 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14817 2001-10-02 Akim Demaille <akim@epita.fr>
14819 * src/output.c (output_parser): Assert `skeleton'.
14820 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14824 2001-10-01 Marc Autret <autret_m@epita.fr>
14826 * src/lex.h: Echo modifications.
14827 * src/lex.c (unlex): Parameter is now token_t.
14830 2001-10-01 Marc Autret <autret_m@epita.fr>
14832 * src/main.c: Include lex.h.
14835 2001-09-29 Akim Demaille <akim@epita.fr>
14837 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14839 2001-09-28 Akim Demaille <akim@epita.fr>
14841 * tests/testsuite.at: Update to newer Autotest.
14842 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14844 2001-09-27 Akim Demaille <akim@epita.fr>
14846 Position independent wrapper.
14848 * tests/bison: Remove.
14849 * tests/bison.in: New.
14850 * configure.in: Adjust.
14852 2001-09-27 Paul Eggert <eggert@twinsun.com>
14854 Port quotearg fixes from tar 1.13.24.
14856 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14858 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14859 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14861 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
14862 * m4/mbrtowc.m4: New file.
14863 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
14864 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
14866 2001-09-27 Akim Demaille <akim@epita.fr>
14870 2001-09-27 Akim Demaille <akim@epita.fr>
14874 2001-09-25 Akim Demaille <akim@epita.fr>
14876 * src/system.h: Include `xalloc.h'.
14877 Remove it from the C files.
14878 * src/files.c (output_files): Free the obstacks.
14879 * src/lex.c (init_lex): Rename as...
14882 * src/main.c (main): Use it.
14884 2001-09-24 Marc Autret <autret_m@epita.fr>
14886 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
14887 to output informations in fout (FILE*).
14888 (open_graph, close_graph): Likewise.
14889 (output_graph, output_edge, output_node): Likewise.
14890 * src/vcg.h: Update function prototypes.
14891 * src/print_graph.c (print_graph): Open output graph file.
14892 (print_actions): Adjust.
14893 * src/files.h: Remove extern declaration.
14894 * src/files.c: Remove graph_obstack declaration.
14895 (open_files): Remove graph_obstack initialization.
14896 (output_files): Remove graph_obstack saving.
14898 2001-09-24 Marc Autret <autret_m@epita.fr>
14900 * src/files.c (compute_output_file_names): Fix.
14902 2001-09-24 Marc Autret <autret_m@epita.fr>,
14903 Akim Demaille <akim@epita.fr>
14905 * src/reader.c (reader): Remove call to free_symtab ().
14906 * src/main.c (main): Call it here.
14908 * src/conflicts.c (initialize_conflicts): Rename as...
14909 (solve_conflicts): this.
14910 * src/print.c (print_core, print_actions, print_state)
14911 (print_grammar): Dump to a file instead a `output_obstack'.
14912 (print_results): Dump `output_obstack', and then proceed with the
14914 * src/files.c (compute_output_file_names, close_files): New.
14915 (output_files): Adjust.
14916 * src/main.c (main): Adjust.
14918 2001-09-23 Marc Autret <autret_m@epita.fr>
14920 * src/files.c (compute_header_macro): Computes header macro name
14921 from spec_defines_file when given.
14923 2001-09-23 Marc Autret <autret_m@epita.fr>
14925 * src/files.c (output_files): Add default extensions.
14927 2001-09-22 Akim Demaille <akim@epita.fr>
14929 * src/conflicts.c (finalize_conflicts): Rename as...
14930 (free_conflicts): this.
14932 2001-09-22 Akim Demaille <akim@epita.fr>
14934 * src/gram.c (gram_free): Rename back as...
14936 (output_token_translations): Free `token_translations'.
14937 * src/symtab.c (free_symtab): Free the tag field.
14939 2001-09-22 Akim Demaille <akim@epita.fr>
14941 Remove `translations' as it is always set to true.
14943 * src/gram.h: Adjust.
14944 * src/reader.c (packsymbols, parse_token_decl): Adjust
14945 * src/print.c (print_grammar): Adjust.
14946 * src/output.c (output_token_translations): Adjust.
14947 * src/lex.c (lex): Adjust.
14948 * src/gram.c: Be sure the set pointers to NULL.
14949 (dummy): Rename as...
14952 2001-09-22 Akim Demaille <akim@epita.fr>
14954 * configure.in: Invoke AM_LIB_DMALLOC.
14955 * src/system.h: Use dmalloc.
14956 * src/LR0.c: Be sure to have pointers initialized to NULL.
14957 (allocate_itemsets): Allocate kernel_items only if needed.
14959 2001-09-22 Akim Demaille <akim@epita.fr>
14961 * configure.in: Bump to 1.29b.
14962 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
14963 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
14964 need xmalloc.c in calc.y.
14967 2001-09-21 Akim Demaille <akim@epita.fr>
14970 * Makefile.maint, config/config.guess, config/config.sub,
14971 * config/missing: Update from masters.
14972 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
14974 * configure.in (ALL_LINGUAS): Add `tr'.
14976 2001-09-21 Akim Demaille <akim@epita.fr>
14978 * tests/Makefile.am (package.m4): Move to...
14979 ($(srcdir)/$(TESTSUITE)): here.
14981 2001-09-20 Akim Demaille <akim@epita.fr>
14983 * src/complain.c: No longer try to be standalone: use system.h.
14984 Don't assume __STDC__ is defined to 1. Just test if it is defined.
14985 * src/complain.h: Likewise.
14986 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
14987 Remove the unused variable `n'.
14988 From Albert Chin-A-Young.
14990 2001-09-18 Marc Autret <autret_m@epita.fr>
14992 * doc/bison.1: Update.
14993 * doc/bison.texinfo (Bison Options): Update --defines and --graph
14995 (Option Cross Key): Update.
14998 2001-09-18 Marc Autret <autret_m@epita.fr>
15000 * tests/regression.at: New test (comment in %union).
15002 2001-09-18 Marc Autret <autret_m@epita.fr>
15004 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15006 Reported by Keith Browne.
15008 2001-09-18 Marc Autret <autret_m@epita.fr>
15010 * tests/output.at: Add tests for --defines and --graph.
15012 2001-09-18 Marc Autret <autret_m@epita.fr>
15014 * tests/output.at: Removes tests of %{header,src}_extension features.
15016 2001-09-18 Akim Demaille <akim@epita.fr>
15018 * tests/Makefile.am (package.m4): New.
15019 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15020 (_AT_CHECK_CALC_ERROR): Likewise.
15021 Factor the `, ' part of verbose error messages.
15023 2001-09-18 Marc Autret <autret_m@epita.fr>
15025 * src/getargs.c (longopts): Declare --defines and --graph as options
15026 with optional arguments.
15027 * src/files.h: Add extern declarations.
15028 * src/files.c (spec_graph_file, spec_defines_file): New.
15029 (output_files): Update.
15030 Remove CPP-outed code.
15032 2001-09-18 Marc Autret <autret_m@epita.fr>
15034 Turn off %{source,header}_extension feature.
15036 * src/files.c (compute_exts_from_gf): Update.
15037 (compute_exts_from_src): Update.
15038 (output_files): CPP-out useless code.
15039 * src/files.h: Remove {header,source}_extension extern declarations.
15040 * src/reader.c (parse_dquoted_param): CPP-out.
15041 (parse_header_extension_decl): Remove.
15042 (parse_source_extension_decl): Remove.
15043 (read_declarations): Remove cases tok_{hdrext,srcext}.
15044 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15045 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15047 2001-09-10 Akim Demaille <akim@epita.fr>
15049 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15050 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15051 (AT_CHECK_OUTPUT): this.
15052 Merely check ls' exit status, its output is useless.
15054 2001-09-10 Akim Demaille <akim@epita.fr>
15056 * tests/calc.at: Use m4_match.
15057 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15059 2001-09-10 Marc Autret <autret_m@epita.fr>,
15060 Akim Demaille <akim@epita.fr>
15062 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15064 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15066 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15067 * src/lex.h: Adjust prototype.
15068 (token_t): Add `tok_undef'.
15069 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15070 (parse_percent_token): Now returns token_t.
15071 Add default statement in switch.
15072 (lex): Separate `c' as an input variable, from the token_t result
15074 (unlexed): Is a token_t.
15076 2001-09-10 Akim Demaille <akim@epita.fr>
15078 * configure.in: Bump to 1.29a.
15080 2001-09-07 Akim Demaille <akim@epita.fr>
15084 2001-08-30 Akim Demaille <akim@epita.fr>
15086 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15087 * m4/atconfig.m4: Remove.
15088 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15089 * tests/bison: New.
15090 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15091 m4_if, m4_patsubst, and m4_regexp.
15092 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15093 `input' file instead of echo.
15095 2001-08-29 Akim Demaille <akim@epita.fr>
15099 2001-08-29 Akim Demaille <akim@epita.fr>
15103 2001-08-29 Paul Eggert <eggert@twinsun.com>
15105 * src/bison.simple (yyparse): Don't take the address of an
15106 item before the start of an array, as that doesn't conform to
15109 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15111 * doc/bison.texinfo (Location Tracking Calc): New node.
15113 2001-08-29 Paul Eggert <eggert@twinsun.com>
15115 * src/output.c (output): Do not define const, as this now
15116 causes more problems than it cures.
15118 2001-08-29 Akim Demaille <akim@epita.fr>
15120 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15122 Be sure to tag the `detailmenu'.
15124 2001-08-29 Akim Demaille <akim@epita.fr>
15126 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15127 download in a tmp dir.
15129 2001-08-28 Marc Autret <autret_m@epita.fr>
15131 * config/depcomp: New file.
15133 2001-08-28 Marc Autret <autret_m@epita.fr>
15135 * doc/bison.1 (mandoc): Adjust.
15136 From Juan Manuel Guerrero.
15138 2001-08-28 Marc Autret <autret_m@epita.fr>
15140 * src/print_graph.c (print_state): Fix.
15142 2001-08-27 Marc Autret <autret_m@epita.fr>
15144 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15146 Echo modifications to the functions prototypes.
15147 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15149 2001-08-27 Marc Autret <autret_m@epita.fr>
15151 * src/vcg.c: Include `xalloc.h'.
15152 (add_colorentry): New.
15153 (add_classname): New.
15154 (add_infoname): New.
15155 * src/vcg.h: Add new prototypes.
15157 2001-08-27 Akim Demaille <akim@epita.fr>
15159 * Makefile.maint: Sync. again with CVS Autoconf.
15161 2001-08-27 Akim Demaille <akim@epita.fr>
15163 * Makefile.maint: Formatting changes.
15164 (po-update, cvs-update, update): New targets.
15167 2001-08-27 Akim Demaille <akim@epita.fr>
15169 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15170 * Makefile.maint: Sync. with CVS Autoconf.
15172 2001-08-27 Marc Autret <autret_m@epita.fr>
15174 * src/vcg.h (struct infoname_s): New.
15175 (struct colorentry_s): New.
15176 (graph_s): New fields {vertical,horizontal}_order in structure.
15177 Add `infoname' field.
15178 Add `colorentry' field;
15179 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15180 (G_HORIZONTAL_ORDER): New.
15182 (G_COLORENTRY): New.
15183 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15184 Add output of `infoname'.
15185 Add output of `colorentry'.
15187 2001-08-27 Marc Autret <autret_m@epita.fr>
15189 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15190 This one shadowed a global parameter.
15192 2001-08-24 Marc Autret <autret_m@epita.fr>
15194 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15195 instead of `unsigned'.
15196 (print_state): Do not call obstack_object_size () in obstack_grow ()
15197 to avoid macro variables shadowing.
15199 2001-08-23 Marc Autret <autret_m@epita.fr>
15201 * src/lex.c (percent_table): Typo: s/naem/name/.
15203 Normalize new options declarations.
15205 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15207 * tests/suite.at: Exercise %header_extension and %source_extension.
15209 2001-08-16 Marc Autret <autret_m@epita.fr>
15211 * src/reader.c (parse_dquoted_param): New.
15212 (parse_header_extension_decl): Use it.
15213 (parse_source_extension_decl): Likewise.
15215 2001-08-16 Marc Autret <autret_m@epita.fr>
15217 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15218 (get_xxxx_str): Use assert () instead of complain ().
15219 Remove return invokations in default cases.
15220 (get_decision_str): Modify default behaviour. Remove second argument.
15221 Echo modifications on calls.
15222 (output_graph): Fix.
15224 2001-08-16 Marc Autret <autret_m@epita.fr>
15226 * src/getargs.c (usage): Update with ``-g, --graph''.
15228 2001-08-16 Marc Autret <autret_m@epita.fr>
15230 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15231 (Option Cross Key): Likewise.
15232 * doc/bison.1: Update.
15234 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
15236 * src/output.c (output_master_parser): Don't finish action_obstack.
15237 (output_parser): Don't care about the muscle action, here.
15238 (prepare): Copy the action_obstack in the action muscle.
15239 (output): Free action_obstack.
15241 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15243 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15244 will contain `%union' declaration.
15245 (parse_union_decl): Delete #line directive output.
15246 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15247 informations about %union.
15248 (parse_union_decl): Copy the union_obstack in the muscle stype.
15249 * src/bison.simple: Add new #line directive.
15250 Add typdef %%stype YYSTYPE.
15252 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15254 * src/bison.simple: Add new `#line' directive.
15256 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
15258 * src/bison.simple: New `#line' directive.
15259 * src/output.c (output_parser): Support new dynamic muscle input_line.
15261 2001-09-22 Marc Autret <autret_m@epita.fr>
15263 * src/output.c (output_master_parser): New.
15264 (output_parser): Be more re-entrant.
15266 2001-09-21 Marc Autret <autret_m@epita.fr>
15268 * src/reader.c (copy_definition, parse_union_decl): Update and use
15270 (copy_action): Likewise.
15271 Use obstack_1grow ().
15272 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15274 2001-09-21 Marc Autret <autret_m@epita.fr>
15276 * src/options.c (option_table): Adjust.
15277 * src/lex.c (parse_percent_token): Fix.
15279 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15281 * src/options.c (symtab.h): Include it, need by lex.h.
15283 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15285 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15286 is now an option_table_struct*.
15287 (option_strcmp): New function option_strcmp.
15288 (parse_percent_token): Call option_strcmp.
15289 * src/getargs.c (xalloc.h, options.h): Include it.
15290 (getargs): Call create_long_option_table.
15291 (getargs): Free longopts at the end of the function.
15292 (shortopts): Move in options.c.
15293 * src/options.c (create_long_option_table): New function. Convert
15294 information from option_table to option structure.
15295 * src/reader.c (options.h): Include it.
15297 * src/Makefile.am: Adjust.
15298 * src/options.c (option_table): Create from longopts and percent_table.
15299 * src/getargs.c (longopts): Delete.
15300 * src/lex.c (struct percent_table_struct): Delete.
15301 (percent_table): Delete.
15302 (options.h): Include it.
15303 * src/options.c: Create.
15304 * src/options.h: Create.
15305 Declare enum opt_access_e.
15306 Define struct option_table_struct.
15308 2001-09-20 Marc Autret <autret_m@epita.fr>
15310 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15313 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
15315 * src/bison.simple: s/%%filename/%%skeleton.
15316 * src/muscle_tab.c (getargs.h): Include it.
15317 (muscle_init): Insert new muscle skeleton.
15319 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
15321 * src/output.c (output_parser): Delete unused variable actions_dumped.
15323 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
15325 * src/output.c (output): Delete call to reader_output_yylsp.
15326 * src/reader.c (reader): Likewise.
15327 * src/reader.h: Delete declaration of reader_output_yylsp.
15329 2001-09-02 Marc Autret <autret_m@epita.fr>
15331 * src/reader.c: Include muscle_tab.h.
15332 (parse_union_decl): Update.
15333 (parse_macro_decl): Rename parse_muscle_decl.
15334 Update to use renamed functions and variable.
15335 (read_declarations, copy_action, read_additionnal_code, : Updated
15336 with correct variables and functions names.
15337 (packsymbols, reader): Likewise.
15339 * src/reader.h (muscle_obstack): Extern declaration update.
15341 * src/output.c: Include muscle_tab.h
15342 In all functions using macro_insert, change by using muscle_insert ().
15343 (macro_obstack): Rename muscle_obstack.
15344 Echo modifications in the whole file.
15345 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15346 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15347 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15349 * src/muscle_tab.h: Update double inclusion macros.
15350 (macro_entry_s): Rename muscle_entry_s.
15353 * src/muscle_tab.c: Include muscle_tab.h.
15354 Rename macro_tabble to muscle_table.
15355 (mhash1, mhash2, mcmp): Use muscle_entry.
15356 (macro_init): Rename muscle_init. Update.
15357 (macro_insert): Rename muscle_insert. Update.
15358 (macro_find): Rename muscle_find. Update.
15360 * src/main.c: Include muscle_tab.h.
15361 (main): Call muscle_init ().
15362 * src/Makefile.am (bison_SOURCES): Echo modifications.
15364 2001-09-02 Marc Autret <autret_m@epita.fr>
15366 Now the files macro_tab.[ch] are named muscle_tab.[ch].
15368 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15370 2001-09-02 Marc Autret <autret_m@epita.fr>
15372 * src/macrotab.c, src/macrotab.h: Remove.
15374 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
15376 * src/reader.c (copy_guard): Use muscle to specify the `#line'
15379 2001-09-01 Marc Autret <autret_m@epita.fr>
15381 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15382 to an explicit value to activate the feature. We do it here.
15384 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15386 * src/output.c (prepare): Delete the `filename' muscule insertion.
15387 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15388 (parse_union_decl): Likewise.
15389 * src/macrotab.c (macro_init): Initialize filename by infile.
15391 2001-08-31 Marc Autret <autret_m@epita.fr>
15393 * src/bison.simple (YYLSP_NEEDED): New definition.
15394 * src/output.c (prepare): Add macro insertion of `locations_flag'
15396 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15398 * src/output.c (prepare): Delete insertion of previous muscles,
15399 and insert the `prefix' muscles.
15400 * src/macrotab.c (macro_init): Likewise.
15401 (macro_init): Initialization prefix directive by `yy'.
15402 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
15403 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15404 yylval, yydebug, yyerror, yynerrs and yyparse.
15405 New directive `#define' to substitute yydebug, ... with option
15408 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15410 * src/main.c (main): Standardize.
15411 * src/output.c (output_table_data, output_parser): Likewise.
15412 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15414 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15416 * src/reader.c (read_additionnal_code): Rename %%user_code to
15418 * src/output.c (output): Rename %%declarations to %%prologue.
15419 * src/bison.simple: Echo modifications.
15421 2001-08-31 Marc Autret <autret_m@epita.fr>
15423 * src/reader.c (readgram): CleanUp.
15424 (output_token_defines): Likewise.
15425 (packsymbols): Likewise.
15426 (reader): Likewise.
15427 * src/output.c (output): CPP-out useless code.
15429 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15431 * src/reader.c (reader): Delete obsolete call to function
15432 output_trailers and output_headers.
15433 * src/output.h: Remove obsolete functions prototypes of output_headers
15434 and output_trailers.
15436 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
15438 * src/main.c: Include macrotab.h.
15439 * src/macrotab.h (macro_entry_s): Constify fields.
15440 Adjust functions prototypes.
15441 * src/macrotab.c (macro_insert): Constify key and value.
15442 (macro_find): Constify key.
15443 (macro_insert): Include 'xalloc.h'
15444 (macro_insert): Use XMALLOC.
15445 (macro_find): Constify return value.
15446 * src/output.c (output_table_data): Rename table to table_data.
15447 (output_parser): Constify macro_key, macro_value.
15449 2001-08-30 Marc Autret <autret_m@epita.fr>
15451 * src/reader.c (parse_skel_decl): New.
15452 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
15453 * src/lex.h (token_t): New token `tok_skel'.
15454 * src/lex.c (percent_table): Add skeleton option entry.
15457 2001-08-29 Marc Autret <autret_m@epita.fr>
15459 * src/bison.simple: Add %%user_code directive at the end.
15460 * src/reader.c (read_additionnal_code): New.
15462 * src/output.c (output_program): Remove.
15465 2001-08-28 Marc Autret <autret_m@epita.fr>
15467 * src/output.c (output_actions): Clean up.
15468 (output_gram): CPP-out useless code.
15469 * src/reader.c (reader): Clean up, CPP-out useless code.
15471 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
15473 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
15475 * src/bison.simple: Add `%%definitions'.
15477 2001-08-28 Marc Autret <autret_m@epita.fr>
15479 * config/depcomp: New file.
15481 2001-08-27 Paul Eggert <eggert@twinsun.com>
15483 * src/bison.simple (yyparse): Don't take the address of an
15484 item before the start of an array, as that doesn't conform to
15487 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15489 * src/output.c (output): Remove the initialization of the macro
15490 obstack. It was done too late here.
15492 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15494 (reader): Initialize the macro obstack here, since we need it to grow
15495 '%define' directives.
15497 * src/reader.h: Declare the macro obstack as extern.
15499 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15501 * src/output.c (output_parser): Fix. Store single '%' characters in
15502 the output obstack instead of throwing them away.
15504 2001-08-27 Akim Demaille <akim@epita.fr>
15506 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15508 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15510 * lib/Makefile.am: Adjust.
15512 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15514 * src/bison.simple: Update and add '%%' directives.
15516 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15518 * src/reader.c (reader): Remove calls to 'output_headers' and
15519 'output_trailers'. Remove some C output.
15520 (readgram): Disable a piece of code that was writing a default
15521 definition for 'YYSTYPE'.
15522 (reader_output_yylsp): Remove.
15523 (packsymbols): Output token defintions to a macro.
15524 (copy_definition): Disable C output.
15526 * src/reader.c (parse_macro_decl): New function used to parse macro
15528 (copy_string2): Put the body of copy_string into this new function.
15529 Add a parameter to let the caller choose whether he wants to copy the
15530 string delimiters or not.
15531 (copy_string): Be a simple call to copy_string2 with the last argument
15533 (read_declarations): Add case for macro definition.
15534 (copy_identifier): New.
15535 (parse_macro_decl): Read macro identifiers using copy_identifier
15538 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15540 * src/output.c (prepare): Add prefixed names.
15541 (output_parser): Output semantic actions.
15542 (output_parser): Fix bug on '%%line' directives.
15544 * src/output.c (output_headers): Remove. The C code printed by this
15545 function should now be in the skeletons.
15546 (output_trailers): Remove.
15547 (output): Disable call to 'reader_output_yylsp'.
15548 (output_rule_data): Do not output tables to the table obstack.
15550 * src/output.c: Remove some C dedicated output.
15551 Improve the use of macro and output obstacks.
15552 (output_defines): Remove.
15554 * src/output.c (output_token_translations): Associate 'translate'
15555 table with a macro. No output to the table obstack.
15556 (output_gram): Same for 'rhs' and 'prhs'.
15557 (output_stos): Same for 'stos'.
15558 (output_rule_data): Same for 'r1' and 'r2'.
15559 (token_actions): Same for 'defact'.
15560 (goto_actions): Same for 'defgoto'.
15561 (output_base): Same for 'pact' and 'pgoto'.
15562 (output_table): Same for 'table'.
15563 (output_check): Same for 'check'.
15565 * src/output.c (output_table_data): New function.
15566 (output_short_table): Remove.
15567 (output_short_or_char_table): Remove.
15569 * src/output.c (output_parser): Replace most of the skeleton copy code
15570 with something new. Skeletons are now processed character by character
15571 rather than line by line, and Bison looks for '%%' macros. This is the
15572 first step in making Bison's output process (a lot) more flexible.
15573 (output_parser): Use the macro table.
15575 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15577 * src/main.c (main): Initialize the macro table.
15579 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15581 * src/lex.c (percent_table): Add tok_define.
15582 * src/lex.h: Add tok_define.
15584 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15586 * src/macrotab.c: New file.
15587 * src/macrotab.h: New file.
15588 * src/Makefile.am: Update.
15590 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15592 * lib/hash.c: New file.
15593 * lib/hash.h: New file.
15594 * lib/Makefile.am: Update.
15596 2001-08-15 Akim Demaille <akim@epita.fr>
15600 2001-08-15 Marc Autret <autret_m@epita.fr>
15602 * src/reader.c (readgram): Indent output macro YYSTYPE.
15603 (packsymbols): Likewise.
15604 (output_token_defines): Likewise.
15605 * src/files.c: Standardize.
15606 (compute_header_macro): New.
15607 (defines_obstack_save): New. Use compute_header_macro.
15608 (output_files): Update. Use defines_obstack_save.
15610 2001-08-15 Akim Demaille <akim@epita.fr>
15612 * doc/bison.texinfo (Table of Symbols): Document
15613 YYSTACK_USE_ALLOCA.
15615 2001-08-15 Akim Demaille <akim@epita.fr>
15617 * missing: Update from CVS Automake.
15618 * config/config.guess, config/config.sub, config/texinfo.tex:
15619 Update from gnu.org.
15621 2001-08-15 Akim Demaille <akim@epita.fr>
15623 * Makefile.maint: Sync with CVS Autoconf.
15625 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
15627 * doc/bison.texinfo: Include GNU Free Documentation License from
15629 * doc/fdl.texi: Add to package.
15631 2001-08-14 Marc Autret <autret_m@epita.fr>
15633 Turn on %{source,header}_extension features.
15635 * src/lex.c (percent_table): Un-CPP out header_extension and
15637 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
15638 (compute_exts_from_src): Remove conditions. It restores priorities
15641 2001-08-14 Marc Autret <autret_m@epita.fr>
15643 * src/files.c (compute_base_names): Add extensions computing when
15644 `--file-prefix' used.
15645 Standardize function calls.
15647 2001-08-13 Marc Autret <autret_m@epita.fr>
15649 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
15650 defining it (defined but null disables alloca).
15652 2001-08-13 Marc Autret <autret_m@epita.fr>
15654 * src/bison.simple (_yy_memcpy): CPP reformat.
15656 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
15658 * tests/atconfig.in (CPPFLAGS): Fix.
15660 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
15662 * doc/bison.texinfo: Include GNU General Public License from
15664 * doc/gpl.texi: Add to package.
15666 2001-08-10 Marc Autret <autret_m@epita.fr>
15668 * src/print_graph.h: Fix.
15669 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15671 2001-08-10 Akim Demaille <akim@epita.fr>
15673 * src/system.h: Provide default declarations for stpcpy, strndup,
15676 2001-08-10 Robert Anisko <anisko_r@epita.fr>
15678 * doc/bison.texinfo (Locations): Update @$ stuff.
15680 2001-08-09 Robert Anisko <anisko_r@epita.fr>
15682 * src/bison.simple (YYLLOC_DEFAULT): Update.
15685 2001-08-08 Marc Autret <autret_m@epita.fr>
15687 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
15688 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15689 Reported by Fabrice Bauzac.
15691 2001-08-08 Marc Autret <autret_m@epita.fr>
15693 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15694 * src/vcg.c (output_node): Fix.
15695 * src/vcg.h: Cleanup.
15696 * src/print_graph.c: Add comments.
15697 (node_output_size): New global variable. Simplify the formatting of
15698 the VCG graph output.
15699 (print_actions): Unused code is now used. It notifies the final state
15700 and no action states in the VCG graph. It also give the reduce actions.
15701 The `shift and goto' edges are red and the `go to state' edges are
15703 Get the current node name and node_obstack by argument.
15704 (node_obstack): New variable.
15705 (print_state): Manage node_obstack.
15706 (print_core): Use node_obstack given by argument.
15707 A node is not only computed here but in print_actions also.
15708 (print_graph): CPP out useless code instead of commenting it.
15710 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
15712 * tests/atconfig.in (CPPFLAGS): Fix.
15714 2001-08-07 Akim Demaille <akim@epita.fr>
15716 * src/print_graph.c (quote): New.
15717 (print_core): Use it.
15719 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
15721 * src/vcg.c (complain.h): Include it.
15722 Unepitaize `return' invocations.
15723 [NDEBUG] (main): Remove.
15724 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
15725 * src/files.c (open_files): Initialize graph_obstack.
15726 * src/print_graph.c (print_actions): CPP out useless code.
15727 (print_core): Don't output the last `\n' in labels.
15729 * src/files.c (output_files): Output the VCG file.
15730 * src/main.c (main): Invoke print_graph ();
15732 2001-08-06 Marc Autret <autret_m@epita.fr>
15734 Automaton VCG graph output.
15735 Using option ``-g'' or long option ``--graph'', you can generate
15736 a gram_filename.vcg file containing a VCG description of the LALR (1)
15737 automaton of your grammar.
15739 * src/main.c: Call to print_graph() function.
15740 * src/getargs.h: Update.
15741 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15742 (graph_flag): New flag.
15743 (longopts): Update.
15744 (getargs): Add case `g'.
15745 * src/files.c (graph_obstack): New obstack struct.
15746 (open_files): Initialize new obstack.
15747 (output_files): Saves graph_obstack if required.
15748 * src/files.h (graph_obstack): New extern declaration.
15749 * src/Makefile.am: Add new source files.
15751 2001-08-06 Marc Autret <autret_m@epita.fr>
15753 * src/print_graph.c, src/print_graph.h (graph): New.
15754 * src/vcg.h: New file.
15755 * src/vcg.c: New file, VCG graph handling.
15757 2001-08-06 Marc Autret <autret_m@epita.fr>
15759 Add of %source_extension and %header_extension which specify
15760 the source or/and the header output file extension.
15762 * src/files.c (compute_base_names): Remove initialisation of
15763 src_extension and header_extension.
15764 (compute_exts_from_gf): Update.
15765 (compute_exts_from_src): Update.
15766 (output_files): Update.
15767 * src/reader.c (parse_header_extension_decl): New.
15768 (parse_source_extension_decl): New.
15769 (read_declarations): New case statements for the new tokens.
15770 * src/lex.c (percent_table): Add entries for %source_extension
15771 and %header_extension.
15772 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15774 2001-08-06 Marc Autret <autret_m@epita.fr>
15776 * configure.in: Bump to 1.28c.
15777 * doc/bison.texinfo: Texinfo thingies.
15779 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
15781 * tests/atconfig.in (CPPFLAGS): Add.
15782 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15784 2001-08-03 Akim Demaille <akim@epita.fr>
15788 2001-08-03 Akim Demaille <akim@epita.fr>
15790 * tests/Makefile.am (check-local): Ship testsuite.
15791 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15792 Include `string.h'.
15794 2001-08-03 Akim Demaille <akim@epita.fr>
15796 * configure.in: Try using -Wformat when compiling.
15798 2001-08-03 Akim Demaille <akim@epita.fr>
15800 * configure.in: Bump to 1.28b.
15802 2001-08-03 Akim Demaille <akim@epita.fr>
15804 * src/complain.c: Adjust strerror_r portability issues.
15806 2001-08-03 Akim Demaille <akim@epita.fr>
15810 2001-08-03 Akim Demaille <akim@epita.fr>
15812 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15813 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15814 * src/getargs.c: Include complain.h.
15815 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15816 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15818 2001-08-03 Akim Demaille <akim@epita.fr>
15820 * src/reader.c (readgram): Display hidden chars in error messages.
15822 2001-08-03 Akim Demaille <akim@epita.fr>
15824 Update to gettext 0.10.39.
15826 2001-08-03 Akim Demaille <akim@epita.fr>
15828 * lib/strspn.c: New.
15830 2001-08-01 Marc Autret <autret_m@epita.fr>
15832 * doc/bison.texinfo: Update.
15833 * doc/bison.1 (mandoc): Update.
15834 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15835 * src/files.c: Support output files extensions computing.
15836 (src_extension): New static variable.
15837 (header_extension): New static variable.
15838 (tr): New function.
15839 (get_extension_index): New function, gets the index of an extension
15840 filename in a string.
15841 (compute_exts_from_gf): New function, computes extensions from the
15842 grammar file extension.
15843 (compute_exts_from_src): New functions, computes extensions from the
15844 C source file extension, file given by ``-o'' option.
15845 (compute_base_names): Update.
15846 (output_files): Update.
15848 2001-08-01 Robert Anisko <anisko_r@epita.fr>
15850 * doc/bison.texi: Document @$.
15851 (Locations): New section.
15853 2001-07-18 Akim Demaille <akim@epita.fr>
15855 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15856 * config/prev-version.txt, config/move-if-change: New.
15857 * Makefile.am: Adjust.
15859 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
15861 * src/bison.simple (yyparse): Suppress warning `comparaison
15862 between signed and unsigned'.
15864 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
15866 * src/getargs.h (raw_flag): Remove.
15867 * src/getargs.c: Die on `-r'/`--raw'.
15868 * src/lex.c (parse_percent_token): Die on `%raw'.
15869 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
15870 * tests/calc.at: Suppress test with option `--raw'.
15872 2001-07-14 Akim Demaille <akim@epita.fr>
15875 * configure.in: Require Autoconf 2.50.
15876 Update to gettext 0.10.38.
15878 2001-03-16 Akim Demaille <akim@epita.fr>
15880 * doc/bison.texinfo: ANSIfy the examples.
15882 2001-03-16 Akim Demaille <akim@epita.fr>
15884 * getargs.c (skeleton): New variable.
15885 (longopts): --skeleton is a new option.
15886 (shortopts, getargs): -S is a new option.
15887 * getargs.h: Declare skeleton.
15888 * output.c (output_parser): Use it.
15890 2001-03-16 Akim Demaille <akim@epita.fr>
15892 * m4/strerror_r.m4: New.
15893 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15894 * lib/error.h, lib/error.c: Update.
15896 2001-03-16 Akim Demaille <akim@epita.fr>
15898 * src/getargs.c (longopts): Clean up.
15900 2001-02-21 Akim Demaille <akim@epita.fr>
15902 * src/reader.c (gensym): `gensym_count' is your own.
15903 Use a static buf to create the symbol name, as token_buffer is no
15906 2001-02-08 Akim Demaille <akim@epita.fr>
15908 * src/conflicts.c (conflict_report): Be sure not to append to res
15909 between two calls, which could happen if both first sprintf were
15910 skipped, but not the first cp += strlen.
15912 2001-02-08 Akim Demaille <akim@epita.fr>
15914 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
15915 New, from fileutils 4.0.37.
15916 * configure.in: Require Autoconf 2.49c. I took some time before
15917 making this decision. This is the only way out for portability
15918 issues in Bison, it would mean way too much duplicate effort to
15919 import in Bison features implemented in 2.49c since 2.13.
15920 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15922 2001-02-02 Akim Demaille <akim@epita.fr>
15924 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
15925 * lib/xalloc.h, lib/xmalloc.c: Update.
15927 2001-01-19 Akim Demaille <akim@epita.fr>
15929 Get rid of the ad hoc handling of token_buffer in the scanner: use
15932 * src/lex.c (token_obstack): New.
15933 (init_lex): Initialize it. No longer call...
15934 (grow_token_buffer): this. Remove it.
15935 Adjust all the places which used it to use the obstack.
15937 2001-01-19 Akim Demaille <akim@epita.fr>
15939 * src/lex.h: Rename all the tokens:
15940 s/\bENDFILE\b/tok_eof/g;
15941 s/\bIDENTIFIER\b/tok_identifier/g;
15943 Let them be enums, not #define, to ease debugging.
15944 Adjust all the code.
15946 2001-01-18 Akim Demaille <akim@epita.fr>
15948 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15949 * src/lex.c (maxtoken, grow_token_buffer): Static.
15951 2001-01-18 Akim Demaille <akim@epita.fr>
15953 Since we now use obstacks, more % directives can be enabled.
15955 * src/lex.c (percent_table): Also accept `%yacc',
15956 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15958 Handle the actions for `%semantic_parser' and `%pure_parser' here,
15959 instead of returning a token.
15960 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
15961 * src/reader.c (read_declarations): Adjust.
15962 * src/files.c (open_files): Don't call `compute_base_names', don't
15963 compute `attrsfile' since they depend upon data which might be
15964 *in* the input file now.
15965 (output_files): Do it here.
15966 * src/output.c (output_headers): Document the fact that this patch
15967 introduces a guaranteed SEGV for semantic parsers.
15968 * doc/bison.texinfo: Document them.
15969 * tests/suite.at: Exercise these %options.
15971 2000-12-20 Akim Demaille <akim@epita.fr>
15973 Also handle the output file (--verbose) with obstacks.
15975 * files.c (foutput): Remove.
15976 (output_obstack): New.
15977 Adjust all dependencies.
15978 * src/conflicts.c: Return a string.
15979 * src/system.h (obstack_grow_string): Rename as...
15980 (obstack_sgrow): this. Be ready to work with non literals.
15981 (obstack_fgrow4): New.
15983 2000-12-20 Akim Demaille <akim@epita.fr>
15985 * src/files.c (open_files): Fix the computation of short_base_name
15986 in the case of `-o foo.tab.c'.
15988 2000-12-20 Akim Demaille <akim@epita.fr>
15990 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
15991 (copy_dollar): Now that everything uses obstacks, get rid of the
15994 2000-12-20 Akim Demaille <akim@epita.fr>
15996 * src/files.c (open_files): Actually the `.output' file is based
15997 on the short_base_name, not base_name.
15998 * tests/suite.at (Checking output file names): Adjust.
16000 2000-12-20 Akim Demaille <akim@epita.fr>
16002 * src/bison.s1: Remove, we now use directly...
16003 * src/bison.simple: this.
16004 * src/Makefile.am: Use pkgdata instead of data.
16006 2000-12-20 Akim Demaille <akim@epita.fr>
16008 * src/files.c (guard_obstack): New.
16009 (open_files): Initialize it.
16010 (output_files): Dump it...
16011 * src/files.h: Export it.
16012 * src/reader.c (copy_guard): Use it.
16014 2000-12-19 Akim Demaille <akim@epita.fr>
16016 * src/files.c (outfile, defsfile, actfile): Removed as global
16018 (open_files): Don't compute them.
16019 (output_files): Adjust.
16020 (base_name, short_base_name): Be global.
16021 Adjust dependencies.
16023 2000-12-19 Akim Demaille <akim@epita.fr>
16025 * src/files.c (strsuffix): New.
16026 (stringappend): Be just like strcat but allocate.
16027 (base_names): Eve out from open_files.
16028 Try to simplify the rather hairy computation of base_name and
16030 (open_files): Use it.
16031 * tests/suite.at (Checking output file names): New test.
16033 2000-12-19 Akim Demaille <akim@epita.fr>
16035 * src/system.h (obstack_grow_literal_string): Rename as...
16036 (obstack_grow_string): this.
16037 * src/output.c (output_parser): Recognize `%% actions' instead of
16039 * src/bison.s1: s/$/%% actions/.
16040 * src/bison.hairy: Likewise.
16042 2000-12-19 Akim Demaille <akim@epita.fr>
16044 * src/output.c (output_parser): Compute the `#line' lines when
16046 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16047 Suggested by Hans Aberg.
16049 2000-12-19 Akim Demaille <akim@epita.fr>
16051 Let the handling of the skeleton files be local to the procedures
16054 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16056 (fparser, open_extra_files): Remove.
16057 (open_files, output_files): Don't take care of fparser.
16058 * src/files.h: Adjust.
16059 * src/output.c (output_parser): Open and close the file to the
16061 * src/reader.c (read_declarations): When %semantic_parser, open
16064 2000-12-19 Akim Demaille <akim@epita.fr>
16066 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16067 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16069 2000-12-19 Akim Demaille <akim@epita.fr>
16071 * src/files.c (open_files): Yipee! We no longer need all the code
16072 looking for `/tmp' since we have no tmp file.
16074 2000-12-19 Akim Demaille <akim@epita.fr>
16076 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16078 * src/files.c (open_files): Less dependency on MSDOS etc.
16080 2000-12-14 Akim Demaille <akim@epita.fr>
16082 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16083 Provide a default definition.
16084 Use it when executing the default @ action.
16085 * src/reader.c (reader_output_yylsp): No longer include
16086 `timestamp' and `text' in the default YYLTYPE.
16088 2000-12-12 Akim Demaille <akim@epita.fr>
16090 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16091 (copy_guard): Quote the file names.
16092 Reported by Laurent Mascherpa.
16094 2000-12-12 Akim Demaille <akim@epita.fr>
16096 * src/output.c (output_headers, output_program, output): Be sure
16097 to escape special characters when outputting filenames.
16098 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16099 (output_headers): Don't depend on them, Use ACTSTR.
16101 2000-11-17 Akim Demaille <akim@epita.fr>
16103 * lib/obstack.h: Formatting changes.
16104 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16105 prevents type checking.
16106 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16107 cast the value to (void *): assigning a `foo *' to a `void *'
16109 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16110 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16113 2000-11-17 Akim Demaille <akim@epita.fr>
16115 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16117 (suite.m4, regression.m4, calc.m4): these.
16118 * tests/atgeneral.m4: Update from CVS Autoconf.
16120 2000-11-17 Akim Demaille <akim@epita.fr>
16122 * tests/regression.m4 (%union and --defines): New test,
16123 demonstrating a current bug in the obstack implementation.
16125 2000-11-17 Akim Demaille <akim@epita.fr>
16127 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16129 Use them to declare the variables which are global or local to
16132 2000-11-17 Akim Demaille <akim@epita.fr>
16134 * acconfig.h: Remove, no longer used.
16136 2000-11-07 Akim Demaille <akim@epita.fr>
16138 * src: s/Copyright (C)/Copyright/g.
16140 2000-11-07 Akim Demaille <akim@epita.fr>
16142 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16144 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16146 2000-11-07 Akim Demaille <akim@epita.fr>
16148 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16149 Merge in a single CPP if/else.
16151 2000-11-07 Akim Demaille <akim@epita.fr>
16153 * src/output.c (output): Remove useless variables.
16154 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16155 argument `data' for consistency with the prototypes.
16156 Qualify it `const'.
16157 (obstack_copy, obstack_copy0): Rename the second argument as
16158 `address' for consistency. Qualify it `const'.
16159 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16160 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16161 `const' their input argument (`data' or `address').
16162 Adjust the corresponding macros to include `const' in casts.
16164 2000-11-03 Akim Demaille <akim@epita.fr>
16166 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16167 s/PFILE1/BISON_HAIRY/.
16168 Adjust dependencies.
16170 2000-11-03 Akim Demaille <akim@epita.fr>
16172 For some reason, this was not applied.
16174 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16175 `unlink': it's no longer used.
16177 2000-11-03 Akim Demaille <akim@epita.fr>
16179 * src/files.c (skeleton_find): New function, eved out of...
16180 (open_files, open_extra_files): here.
16182 2000-11-03 Akim Demaille <akim@epita.fr>
16184 Don't use `atexit'.
16186 * src/files.c (obstack_save): New function.
16187 (done): Rename as...
16188 (output_files): this.
16189 Use `obstack_save'.
16190 * src/main.c (main): Don't use `atexit' to register `done', since
16191 it no longer has to remove tmp files, just call `output_files'
16192 when there are no errors.
16194 2000-11-02 Akim Demaille <akim@epita.fr>
16196 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16197 `unlink': it's no longer used.
16198 * src/files.h: Formatting changes.
16200 2000-11-02 Akim Demaille <akim@epita.fr>
16202 Remove the last uses of mktemp and unlink/delete.
16204 * src/files.c (fdefines, ftable): Removed.
16205 (defines_ostack, table_obstack): New.
16206 Adjust dependencies of the former into uses of the latter.
16207 * src/output.c (output_short_or_char_table, output_short_table):
16208 Convert to using obstacks.
16209 * src/reader.c (copy_comment2): Accept one FILE * and two
16211 (output_token_defines, reader_output_yylsp): Use obstacks.
16212 * src/system.h (obstack_fgrow3): New.
16213 * po/POTFILES.in: Adjust.
16215 2000-11-01 Akim Demaille <akim@epita.fr>
16217 Change each use of `fattrs' into a use of `attrs_obstack'.
16219 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16220 * src/files.c (fattrs): Remove.
16221 (attrs_obstack): New.
16222 Adjust all dependencies.
16223 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16225 2000-11-01 Akim Demaille <akim@epita.fr>
16227 Introduce obstacks.
16228 Change each use of `faction' into a use of `action_obstack'.
16230 * lib/obstack.h, lib/obstack.c: New files.
16231 * src/files.c (faction): Remove.
16232 (action_obstack): New.
16233 Adjust all dependencies.
16235 2000-10-20 Akim Demaille <akim@epita.fr>
16237 * lib/quote.h (PARAMS): New macro. Use it.
16239 2000-10-16 Akim Demaille <akim@epita.fr>
16241 * src/output.c (output_short_or_char_table): New function.
16242 (output_short_table, output_token_translations): Use it.
16243 (goto_actions): Use output_short_table.
16245 2000-10-16 Akim Demaille <akim@epita.fr>
16247 * src/symtab.c (bucket_new): New function.
16250 * src/output.c (output_short_table): New argument to display the
16251 comment associated with the table.
16252 Adjust dependencies.
16253 (output_gram): Use it.
16254 (output_rule_data): Nicer output layout for YYTNAME.
16256 2000-10-16 Akim Demaille <akim@epita.fr>
16258 * src/lex.c (read_typename): New function.
16260 * src/reader.c (copy_dollar): Likewise.
16262 2000-10-16 Akim Demaille <akim@epita.fr>
16264 * src/reader.c (copy_comment2): Expect the input stream to be on
16265 the `/' which is suspected to open a comment, instead of being
16266 called after `//' or `/*' was read.
16267 (copy_comment, copy_definition, parse_union_decl, copy_action)
16268 (copy_guard): Adjust.
16270 2000-10-16 Akim Demaille <akim@epita.fr>
16272 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16273 `read_signed_integer'.
16275 2000-10-16 Akim Demaille <akim@epita.fr>
16277 * src/reader.c (copy_dollar): New function.
16278 (copy_guard, copy_action): Use it.
16280 2000-10-16 Akim Demaille <akim@epita.fr>
16282 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16283 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16284 New files, from Fileutils 4.0.27.
16285 * src/main.c (printable_version): Remove.
16286 * src/lex.c, src/reader.c: Use `quote'.
16288 2000-10-04 Akim Demaille <akim@epita.fr>
16290 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16292 2000-10-04 Akim Demaille <akim@epita.fr>
16294 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16296 2000-10-04 Akim Demaille <akim@epita.fr>
16298 When a literal string is used to define two different tokens,
16299 `bison -v' segfaults.
16300 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16302 * tests/regression.m4: New file.
16303 Include the core of the sample provided by Piotr Gackiewicz.
16304 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16307 2000-10-04 Akim Demaille <akim@epita.fr>
16309 * src/reader.c (parse_expect_decl): Keep `count' within the size
16313 2000-10-02 Paul Eggert <eggert@twinsun.com>
16315 * bison.s1 (yyparse): Assign the default value
16316 unconditionally, to avoid a GCC warning and make the parser a
16319 2000-10-02 Akim Demaille <akim@epita.fr>
16321 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16324 2000-10-02 Akim Demaille <akim@epita.fr>
16326 * src/derives.c, src/print.c, src/reduce.c: To ease the
16327 translation, move some `\n' out of the translated strings.
16329 2000-10-02 Akim Demaille <akim@epita.fr>
16331 The location tracking mechanism is precious for parse error
16332 messages. Nevertheless, it is enabled only when `@n' is used in
16333 the grammar, which is a different issue (you can use it in error
16334 message, but not in the grammar per se). Therefore, there should
16335 be another means to enable it.
16337 * src/getargs.c (getargs): Support `--locations'.
16338 (usage): Report it.
16339 * src/getargs.h (locationsflag): Export it.
16340 * src/lex.c (percent_table): Support `%locations'.
16341 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16342 with `locationsflag'.
16343 * doc/bison.texinfo: Document `--locations' and `%locations'.
16345 * tests/calc.m4: Test it.
16347 For regularity of the names, replace each
16348 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16349 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16350 In addition replace each `flag' with `_flag'.
16352 2000-10-02 Akim Demaille <akim@epita.fr>
16354 Also test parse error messages, including with YYERROR_VERBOSE.
16356 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16358 Use it to check the computations.
16359 Use it to check `nonassoc' is honored.
16360 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16361 `--yyerror-verbose'.
16362 (_AT_CHECK_CALC): Adjust to this option.
16363 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16365 2000-10-02 Akim Demaille <akim@epita.fr>
16367 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16368 the latter demonstrates a flaw in the handling of non debugging
16369 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16370 was used in order to simplify:
16386 unfortunately this leads to a CPP conflict when
16387 `--name-prefix=foo' is used since it produces `#define yydebug
16390 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16391 (YYDPRINTF): New macro.
16393 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16395 Also test `--verbose', `--defines' and `--name-prefix'.
16397 2000-10-02 Akim Demaille <akim@epita.fr>
16399 Improve the readability of the produced parsers.
16401 * src/bison.s1: Formatting changes.
16402 Improve the comment related to the `$' mark.
16403 (yydefault): Don't fall through to `yyresume': `goto' there.
16404 * src/output.c (output_parser): When the `$' is met, skip the end
16406 New variable, `number_of_dollar_signs', to check there's exactly
16407 one `$' in the parser skeleton.
16409 2000-10-02 Akim Demaille <akim@epita.fr>
16411 * lib/xstrdup.c: New file, from the fileutils.
16412 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16413 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16414 instead of strlen + xmalloc + strcpy.
16415 * src/symtab.c (copys): Remove, use xstrdup instead.
16417 2000-10-02 Akim Demaille <akim@epita.fr>
16419 * src/gram.h (associativity): New enum type which replaces the
16420 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16421 `right_assoc', `left_assoc' and `non_assoc'.
16422 Adjust all dependencies.
16423 * src/reader.c: Formatting changes.
16424 (LTYPESTR): Don't define it, use it as a literal in
16425 `reader_output_yylsp'.
16426 * src/symtab.h (symbol_class): New enum type which replaces the
16427 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16428 `sunknown', `stoken and `snterm'.
16430 2000-10-02 Akim Demaille <akim@epita.fr>
16432 * src/getargs.c (fixed_outfiles): Rename as...
16433 (yaccflag): for consistency and accuracy.
16434 Adjust dependencies.
16436 2000-10-02 Akim Demaille <akim@epita.fr>
16438 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16439 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16440 difficult and introduced a lot of core dump. It turns out that
16441 Bison used an implementation of `xmalloc' based on `calloc', and
16442 at various places it does depend upon the initialization to 0. I
16443 have not tried to isolate the pertinent places, and all the former
16444 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16445 someone should address this issue.
16447 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16448 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16450 Adjust dependencies.
16451 * src/warshall.h: New file.
16454 2000-10-02 Akim Demaille <akim@epita.fr>
16456 Various anti-`extern in *.c' changes.
16458 * src/system.h: Include `assert.h'.
16460 2000-10-02 Akim Demaille <akim@epita.fr>
16462 * src/state.h (nstates, final_state, first_state, first_shift)
16463 (first_reduction): Move their exportation from here...
16464 * src/LR0.h: to here.
16465 Adjust dependencies.
16466 * src/getargs.c (statisticsflag): New variable.
16467 Add support for `--statistics'.
16468 Adjust dependencies.
16470 Remove a lot of now useless `extern' statements in most files.
16472 2000-10-02 Akim Demaille <akim@epita.fr>
16474 * src/LR0.h: New file.
16477 2000-10-02 Akim Demaille <akim@epita.fr>
16479 * src/print.h: New file.
16481 * src/print.c: Formatting and ordering changes.
16482 (verbose, terse): Replace with...
16483 (print_results): this new function.
16484 Adjust dependencies.
16486 2000-10-02 Akim Demaille <akim@epita.fr>
16488 * src/conflicts.c (conflict_report): New function.
16489 (conflict_log, verbose_conflict_log): Replace with...
16490 (print_conflicts): this function.
16491 Adjust dependencies.
16492 * src/conflicts.h: New file.
16493 Propagate its inclusion.
16495 2000-10-02 Akim Demaille <akim@epita.fr>
16497 * src/nullable.h: New file.
16498 Propagate its inclusion.
16499 * src/nullable.c: Formatting changes.
16501 2000-10-02 Akim Demaille <akim@epita.fr>
16503 * src/reduce.h: New file.
16504 Propagate its inclusion.
16505 * src/reduce.c: Topological sort and other formatting changes.
16506 (bool, TRUE, FALSE): Move their definition to...
16507 * src/system.h: here.
16509 2000-10-02 Akim Demaille <akim@epita.fr>
16511 * src/files.c: Formatting changes.
16512 (tryopen, tryclose, openfiles): Rename as...
16513 (xfopen, xfclose, open_files): this.
16514 (stringappend): static.
16515 * src/files.h: Complete the list of exported symbols.
16518 2000-10-02 Akim Demaille <akim@epita.fr>
16520 * src/reader.h: New file.
16521 Propagate its use instead of tedious list of `extern' and
16523 * src/reader.c: Formatting changes, topological sort,
16526 2000-10-02 Akim Demaille <akim@epita.fr>
16528 * src/lex.h: Prototype `lex.c' exported functions.
16529 * src/reader.c: Adjust.
16530 * src/lex.c: Formatting changes.
16531 (safegetc): Rename as...
16534 2000-10-02 Akim Demaille <akim@epita.fr>
16536 * src/lalr.h: New file.
16537 Propagate its inclusion instead of prototypes and `extern'.
16538 * src/lalr.c: Formatting changes, topological sorting etc.
16540 2000-10-02 Akim Demaille <akim@epita.fr>
16542 * src/output.c (token_actions): Introduce a temporary array,
16543 YYDEFACT, that makes it possible for this function to use
16544 output_short_table.
16546 2000-10-02 Akim Demaille <akim@epita.fr>
16548 `user_toknums' is output as a `short[]' in `output.c', while it is
16549 defined as a `int[]' in `reader.c'. For consistency with the
16550 other output tables, `user_toknums' is now defined as a table of
16553 * src/reader.c (user_toknums): Be a short table instead of an int
16555 Adjust dependencies.
16557 Factor the short table outputs.
16559 * src/output.c (output_short_table): New function.
16560 * src/output.c (output_gram, output_stos, output_rule_data)
16561 (output_base, output_table, output_check): Use it.
16563 2000-10-02 Akim Demaille <akim@epita.fr>
16565 * src/output.c (output): Topological sort of the functions, in
16566 order to get rid of the `static' prototypes.
16567 No longer use `register'.
16568 * src/output.h: New file.
16569 Propagate its inclusion in files explicitly prototyping functions
16572 2000-09-21 Akim Demaille <akim@epita.fr>
16574 * src/atgeneral.m4: Update from Autoconf.
16576 2000-09-21 Akim Demaille <akim@epita.fr>
16578 * src/closure.h: New file.
16579 * src/closure.c: Formatting changes, topological sort over the
16580 functions, use of closure.h.
16581 (initialize_closure, finalize_closure): Rename as...
16582 (new_closure, free_closure): these. Adjust dependencies.
16583 * src/LR0.c: Formatting changes, topological sort, use of
16585 (initialize_states): Rename as...
16586 (new_states): this.
16587 * src/Makefile.am (noinst_HEADERS): Adjust.
16589 2000-09-20 Akim Demaille <akim@epita.fr>
16591 * src/acconfig.h: Don't protect config.h against multiple
16593 Don't define PARAMS.
16594 * src/system.h: Define PARAMS.
16595 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
16596 purpose of config.h. system.h must not try to fix wrong
16597 definitions in config.h.
16599 2000-09-20 Akim Demaille <akim@epita.fr>
16601 * src/derives.h: New file.
16602 * src/main.c, src/derives.h: Use it.
16603 Formatting changes.
16604 * src/Makefile.am (noinst_HEADERS): Adjust.
16606 2000-09-20 Akim Demaille <akim@epita.fr>
16608 * tests/atgeneral.m4: Update from Autoconf.
16609 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
16610 (AT_CHECK_CALC): New macros.
16611 Use these macros to test bison with options `', `--raw',
16612 `--debug', `--yacc', `--yacc --debug'.
16614 2000-09-19 Akim Demaille <akim@epita.fr>
16616 * src/output.c: Formatting changes.
16617 * src/machine.h: Remove, leaving its contents in...
16618 * src/system.h: here.
16620 Adjust all dependencies on stdio.h and machine.h.
16621 * src/getargs.h: New file.
16622 Let all `extern' declarations about getargs.c be replaced with
16623 inclusion of `getargs.h'.
16624 * src/Makefile.am (noinst_HEADERS): Adjust.
16626 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16628 (yyerror): Returns void, not int.
16629 * doc/bison.texinfo: Formatting changes.
16631 2000-09-19 Akim Demaille <akim@epita.fr>
16633 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16636 2000-09-18 Akim Demaille <akim@epita.fr>
16638 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16639 * src/Makefile.am (INCLUDES): Don't.
16640 Be ready to fetch headers in lib/.
16642 2000-09-18 Akim Demaille <akim@epita.fr>
16644 * doc/bison.texinfo: Update the copyright.
16645 ANSIfy and GNUify the examples.
16646 Remove the old menu.
16648 2000-09-18 Akim Demaille <akim@epita.fr>
16650 First set of tests: use the `calc' example from the documentation.
16652 * src/bison.s1 (yyparse): Condition the code using `yytname' which
16653 is defined only when YYDEBUG is.
16654 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
16655 * src/files.c (tryopen, tryclose): Formatting changes.
16656 Move to the top and be static.
16657 * src/reader.c (read_signed_integer): Likewise.
16658 * tests/calc.m4: New file.
16659 * Makefile.am, suite.m4: Adjust.
16660 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
16662 2000-09-18 Akim Demaille <akim@epita.fr>
16664 Add support for an Autotest test suite for Bison.
16666 * m4/m4.m4, m4/atconfig.m4: New files.
16667 * m4/Makefile.am (EXTRA_DIST): Adjust.
16668 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
16670 * src/getargs.c: Display a more standard --version message.
16671 * src/reader.c (reader): Formatting changes.
16672 No longer depend upon VERSION_STRING.
16673 * configure.in: No longer use `dnl'.
16674 Set up the test suite and the new directory `tests/.
16675 (VERSION_STRING): Remove.
16677 2000-04-14 Akim Demaille <akim@epita.fr>
16679 * src/reader.c (copy_comment2): New function, same as former
16680 `copy_comment', but outputs into two FILE *.
16681 (copy_comment): Use it.
16682 (parse_union_decl): Use it.
16683 (get_type, parse_start_decl): Use the same `invalid' message.
16684 (parse_start_decl, parse_union_decl): Use the same `multiple'
16686 (parse_union_decl, copy_guard, copy_action): Use the same
16687 `unmatched' message.
16688 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16690 2000-03-31 Akim Demaille <akim@epita.fr>
16692 * src/files.c (tryopen, tryclose): Move to the top.
16695 2000-03-31 Akim Demaille <akim@epita.fr>
16697 * src/main.c (main): Don't call `done', exit does it.
16699 2000-03-31 Akim Demaille <akim@epita.fr>
16701 * allocate.c: s/return (foo)/return foo/.
16702 * lalr.c: Likewise.
16704 * output.c: Likewise.
16705 * reader.c: Likewise.
16706 * symtab.c: Likewise.
16707 * vmsgetargs.c: Likewise.
16709 2000-03-31 Akim Demaille <akim@epita.fr>
16711 Clean up the error reporting functions.
16713 * src/report.c: New file.
16714 * src/report.h: Likewise.
16715 * src/Makefile.am: Adjust.
16716 * m4/error.m4: New file.
16717 * m4/Makefile.am: Adjust.
16718 * configure.in (jm_PREREQ_ERROR): Call it.
16719 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16721 (fatal, fatals): Remove. All callers use complain.c::fatal.
16722 (warn, warni, warns, warnss, warnss): Remove. All callers use
16723 complain.c::complain.
16724 (toomany): Remove, use fatal instead.
16725 * src/files.c (done): No argument, use complain_message_count.
16726 * src/main.c (main): Register `done' to `atexit'.
16728 * src/getargs.c (usage): More `fputs', less `fprintf'.
16730 2000-03-28 Akim Demaille <akim@epita.fr>
16732 * lib/: New directory.
16733 * Makefile.am (SUBDIRS): Adjust.
16734 * configure.in: Adjust.
16735 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16737 * src/alloca.c: Moved to lib/.
16738 * src/getopt.c: Likewise.
16739 * src/getopt1.c: Likewise.
16740 * src/getopt.h: Likewise.
16741 * src/ansi2knr.c: Likewise.
16742 * src/ansi2knr.1: Likewise.
16743 * src/Makefile.am: Adjust.
16744 * lib/Makefile.am: New file.
16746 2000-03-28 Akim Demaille <akim@epita.fr>
16748 * src/getargs.c (usage): Refresh the help message.
16750 2000-03-17 Akim Demaille <akim@epita.fr>
16752 * src/getopt1.c: Updated from textutils 2.0e
16753 * src/getopt.c: Likewise.
16754 * src/getopt.h: Likewise.
16756 2000-03-17 Akim Demaille <akim@epita.fr>
16758 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16759 the file name, not the whole `#line LINE FILE'.
16761 2000-03-17 Akim Demaille <akim@epita.fr>
16763 On syntax errors, report the token on which we choked.
16765 * src/bison.s1 (yyparse): In the label yyerrlab, when
16766 YYERROR_VERBOSE, add yychar in msg.
16768 2000-03-17 Akim Demaille <akim@epita.fr>
16770 * src/reader.c (copy_at): New function.
16771 (copy_guard): Use it.
16772 (copy_action): Use it.
16774 2000-03-17 Akim Demaille <akim@epita.fr>
16776 Be kind to translators, save some useless translations.
16778 * src/main.c (banner): New function.
16779 (fatal_banner): Use it.
16780 (warn_banner): Use it.
16782 2000-03-17 Akim Demaille <akim@epita.fr>
16784 * src/reader.c (copy_definition): Use copy_string and
16785 copy_comment. Removed now unused `match', `ended',
16787 (copy_comment, copy_string): Moved, to be visible from
16790 2000-03-17 Akim Demaille <akim@epita.fr>
16792 * src/reader.c (copy_string): Declare `static inline'. No
16793 problems with inline, since it is checked by configure.
16794 (copy_comment): Likewise.
16796 2000-03-17 Akim Demaille <akim@epita.fr>
16798 * src/reader.c (packsymbols): Formatting changes.
16800 2000-03-17 Akim Demaille <akim@epita.fr>
16802 * src/reader.c (copy_comment): New function, factored out from:
16803 (copy_action): Use it. Removed now unused `match', `ended',
16805 (copy_guard): Likewise.
16807 2000-03-17 Akim Demaille <akim@epita.fr>
16809 * src/reader.c (copy_string): New function, factored out from:
16810 (copy_action): Use it.
16811 (copy_guard): Likewise.
16813 2000-03-17 Akim Demaille <akim@epita.fr>
16815 Change the handling of @s so that they behave exactly like $s.
16816 There is now a pseudo variable @$ (readble and writable), location
16817 of the lhs of the rule (by default ranging from the location of
16818 the first symbol of the rhs, to the location of the last symbol,
16819 or, if the rhs is empty, YYLLOC).
16821 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16823 (yyparse): When providing a default semantic action, provide a
16824 default location action.
16825 (after the $): No longer change `*YYLSP', just stack YYLOC the
16826 same way you stack YYVAL.
16827 * src/reader.c (read_declarations): Use warns.
16828 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16829 (copy_action, case '@'): Likewise.
16830 Use a standard error message, to save useless work from
16833 2000-03-17 Akim Demaille <akim@epita.fr>
16835 * src/bison.s1: Formatting and cosmetics changes.
16836 * src/reader.c: Likewise.
16837 Update the Copyright notice.
16839 2000-03-17 Akim Demaille <akim@epita.fr>
16841 * src/bison.s1 (#line): All set to `#line' only, since the
16842 Makefile now handles them.
16844 2000-03-16 Akim Demaille <akim@epita.fr>
16846 * src/output.c (output_rule_data): Output the documentation of
16847 some of the tables.
16848 (Copyright notice): Update.
16849 Formatting changes.
16851 2000-03-16 Akim Demaille <akim@epita.fr>
16853 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
16854 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
16855 One `#if YYDEBUG' remains, since it uses variables which are
16856 defined only if `YYDEBUG != 0'.
16858 2000-03-16 Akim Demaille <akim@epita.fr>
16860 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16861 and related variables so that the similarities are highlighted.
16863 2000-03-16 Akim Demaille <akim@epita.fr>
16865 * src/bison.s1: Properly indent CPP directives.
16867 2000-03-16 Akim Demaille <akim@epita.fr>
16869 * src/bison.s1: Properly indent the `alloca' CPP section.
16871 2000-03-16 Akim Demaille <akim@epita.fr>
16873 Do not hard code values of directories in `configure.in'.
16874 Update the `configure' tool chain.
16876 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16878 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
16879 (AC_OUTPUT): Add m4/Makefile.
16880 Bump to bison 1.28a, 1.29 has never been released.
16881 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
16882 handled via src/Makefile.am.
16883 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
16884 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
16886 * Makefile.am (SUBDIRS): Add m4.
16887 (ACLOCAL_AM_FLAGS): New variable.
16888 (AUTOMAKE_OPTIONS): Add check-news.
16889 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
16890 the proper line number and file name.
16891 (DEFS): Propagate the location of bison library files and of the
16893 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16895 * acinclude.m4: Remove, replaced by the directory m4.
16896 * m4/Makefile.am (EXTRA_DIST): New variable.
16897 * m4/gettext.m4: New file, from the fileutils.
16898 * m4/lcmessage.m4: Likewise
16899 * m4/progtest.m4: Likewise.
16900 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
16902 2000-03-10 Akim Demaille <akim@epita.fr>
16905 Formatting changes of various comments.
16906 Respect the GNU coding standards at various places.
16907 Don't use `_()' when no translation is needed.
16909 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16912 OS/2 honors TMPDIR environment variable.
16914 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16916 * doc/bison.texinfo: Tweaked spelling and grammar.
16918 Removed reference to price of printed copy.
16919 Mention BISON_SIMPLE and BISON_HAIRY.
16921 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16923 * configure.in, NEWS:
16924 Bison 1.29 released.
16926 1999-10-27 Jesse Thilo <jthilo@gnu.org>
16928 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16929 Added reference card.
16931 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16933 * po/ru.po: Added Russian translation.
16935 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16937 * configure.in: Added Russian translation.
16939 1999-07-06 Jesse Thilo <jthilo@gnu.org>
16941 * configure.in, NEWS, README:
16942 Released version 1.28.
16944 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16947 Squashed redefinition warning on some systems.
16949 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16950 Have configure build version string instead of relying on ANSI string
16953 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16955 * po/POTFILES.in: Got rid of version.c.
16957 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16959 * acconfig.h, configure.in:
16960 Have configure build version string instead of relying on ANSI string
16963 1999-06-08 Jesse Thilo <jthilo@gnu.org>
16966 Dropped mention of `+' for long-named options.
16968 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16970 * src/files.c: Added <unistd.h> for unlink().
16972 * src/Makefile.am, src/system.h:
16975 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16977 * README: Added a FAQ list.
16979 * configure.in, acconfig.h:
16982 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16984 * doc/FAQ, doc/Makefile.am:
16987 1999-05-19 Jesse Thilo <jthilo@gnu.org>
16989 * src/alloc.h, src/symtab.h, src/version.c:
16990 Protected inclusion of "config.h" with HAVE_CONFIG_H.
16992 1999-04-18 Jesse Thilo <jthilo@gnu.org>
16994 * src/.cvsignore, src/Makefile.am:
16995 Reorganized: sources in `src', documentation in `doc'.
16997 * src/lex.c (literalchar):
16998 fixed the code for escaping double quotes (thanks
17001 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17003 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17004 Adjusted paths to reflect directory reorganization.
17006 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17008 * doc/.cvsignore, doc/Makefile.am:
17009 Reorganized: sources in `src', documentation in `doc'.
17011 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17014 Updated AC_INIT file to reflect directory reorganization.
17016 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17017 Reorganized: sources in `src', documentation in `doc'.
17019 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17022 Don't declare calloc() and realloc() if not necessary.
17024 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17026 * configure.in, acconfig.h, acinclude.m4:
17027 Don't declare calloc() and realloc() if not necessary.
17029 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17031 * po/.cvsignore: Added i18n support.
17033 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17035 * acconfig.h, configure.in, Makefile.am:
17036 Added i18n support.
17038 1999-03-22 Jesse Thilo <jthilo@gnu.org>
17040 * src/bison.s1: Fixed #line numbers.
17042 1999-03-15 Jesse Thilo <jthilo@gnu.org>
17044 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17045 Added PO files from Translation Project.
17047 1999-03-03 Jesse Thilo <jthilo@gnu.org>
17050 Added support for non-ANSI compilers (ansi2knr).
17052 1999-02-16 Jesse Thilo <jthilo@gnu.org>
17054 * configure.in: Bumped version number to 1.27.
17057 Added `bison.simple' to list of files removed by `make distclean'.
17059 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17061 * src/files.c, src/files.h:
17062 Defined locations of parser files in config.h instead of Makefile.
17064 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17066 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17067 Defined locations of parser files in config.h instead of Makefile.
17069 1999-02-09 Jesse Thilo <jthilo@gnu.org>
17072 Removed inappropriate use of $< macro.
17074 1999-02-05 Jesse Thilo <jthilo@gnu.org>
17076 * po/Makefile.in.in, po/POTFILES.in:
17077 Add `po' directory skeleton.
17079 1999-01-27 Jesse Thilo <jthilo@gnu.org>
17081 * README: Document help-bison list.
17083 * configure.in: Add check for mkstemp().
17085 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17087 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17088 Hush a few compiler warnings.
17091 Add tryclose(), which verifies that fclose was successful.
17092 Hush a couple of compiler warnings.
17094 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17096 * Makefile.am, OChangeLog:
17097 ChangeLog is now automatically generated. Include the old version as
17100 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17102 * 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:
17103 Update FSF address.
17105 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17107 * doc/bison.texinfo: Fix formatting glitch.
17109 * doc/bison.texinfo: Update FSF address.
17111 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17113 * acconfig.h: Update FSF address.
17115 1999-01-08 Jesse Thilo <jthilo@gnu.org>
17118 Don't define PACKAGE here, since config.h defines it.
17120 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17122 * src/reader.c: Update copyright date.
17125 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17126 favor of output directly to stderr (avoids buffer overruns).
17128 * src/reader.c: Some checks for premature EOF.
17130 * 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:
17131 Use prototypes if the compiler understands them.
17133 * src/files.c: Honor TMPDIR on Unix hosts.
17134 Use prototypes if the compiler understands them.
17137 Fix a couple of buffer overrun bugs.
17138 Use prototypes if the compiler understands them.
17140 * src/system.h: Include unistd.h and ctype.h.
17141 Use #ifdef instead of #if for NLS symbols.
17143 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17145 * doc/bison.texinfo:
17146 Delete comment "consider using @set for edition number, etc..." since
17147 we now are doing so.
17149 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17152 Use prototypes if the compiler understands them.
17154 * NEWS: Document 1.26 highlights.
17156 * Makefile.am: Require Automake 1.3 or later.
17159 Use prototypes if the compiler understands them.
17161 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17164 Use VERSION symbol from automake for version number.
17166 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17168 * acconfig.h, configure.in, version.cin:
17169 Use VERSION symbol from automake for version number.
17171 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17174 Distribute original version of simple parser (bison.s1), not built
17175 version (bison.simple).
17177 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17179 * doc/bison.texinfo: Add info dir entry.
17181 * doc/bison.texinfo:
17182 Let automake put version number into documentation.
17184 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17186 * src/bison.cld, src/build.com, src/vmshlp.mar:
17187 Add non-RCS files from /gd/gnu/bison.
17189 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17192 Document the BISON_HAIRY and BISON_SIMPLE variables.
17194 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17196 * src/version.c: Build version.c automatically.
17199 Fix token numbering (used to start at 258, not 257).
17201 * src/system.h: Include config.h.
17203 * src/getargs.c: Update bug report address.
17205 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17206 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17208 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17211 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17213 * configure.in, version.cin:
17214 Build version.c automatically.
17216 * AUTHORS: Add AUTHORS file.
17218 * README: Update bug report address.
17221 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17223 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17224 Add automake stuff.
17226 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17228 * doc/bison.texinfo: Clean up some formatting.
17230 1998-05-05 Richard Stallman <rms@gnu.org>
17232 * doc/bison.texinfo:
17233 Explain better why to make a pure parser.
17235 1998-01-05 Richard Stallman <rms@gnu.org>
17237 * src/files.c (openfiles):
17238 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17239 find a temporary directory, if possible. Do not unlink files while
17242 1997-08-25 Richard Stallman <rms@gnu.org>
17244 * src/reader.c (stack_offset;):
17245 Change some warni to warns.
17247 * src/lex.c (literalchar): Use warns, not warni.
17249 1997-06-28 Richard Stallman <rms@gnu.org>
17251 * src/bison.s1: Add a Bison version comment.
17253 * src/main.c (fatal, warn, berror):
17256 1997-06-28 Richard Stallman <rms@gnu.org>
17258 * Makefile.in (bison_version): New variable.
17259 (dist): Use that variable.
17260 (bison.s1): Substitute the Bison version into bison.simple.
17262 * bison.simple: Add a Bison version comment.
17264 1997-06-18 Richard Stallman <rms@gnu.org>
17266 * src/main.c (fatal, warn, berror):
17267 Make error messages standard.
17268 (toomany): Improve error message text.
17270 * 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:
17271 new.h renamed to alloc.h.
17273 1997-06-18 Richard Stallman <rms@gnu.org>
17275 * Makefile.in: new.h renamed to alloc.h.
17277 1997-05-24 Richard Stallman <rms@gnu.org>
17279 * src/lex.c (literalchar):
17280 Fix the code for escaping \, " and '.
17282 (lex): Avoid trouble when there are many chars
17283 to discard in a char literal with just several chars in it.
17285 1997-05-17 Richard Stallman <rms@gnu.org>
17288 Use malloc, if using alloca is troublesome.
17289 (YYSTACK_USE_ALLOCA): New flag macro.
17290 Define it for some systems and compilers.
17291 (YYSTACK_ALLOC): New macro.
17292 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17293 If it was malloc'd, free 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-04-23 Richard Stallman <rms@gnu.org>
17308 (alloca) [__hpux]: Always define as __builtin_alloca.
17310 1997-04-23 Richard Stallman <rms@gnu.org>
17313 (alloca) [__hpux]: Always define as __builtin_alloca.
17315 1997-04-22 Richard Stallman <rms@gnu.org>
17318 [__hpux]: Include alloca.h (right for HPUX 10)
17319 instead of declaring alloca (right for HPUX 9).
17321 * src/bison.s1 (__yy_memcpy):
17322 Declare arg `count' as unsigned int.
17323 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
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 * bison.simple (__yy_memcpy):
17332 Declare arg `count' as unsigned int.
17333 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17335 1997-01-03 Richard Stallman <rms@gnu.org>
17337 * src/allocate.c: [__STDC__ or _MSC_VER]:
17338 Declare calloc and realloc to return void *.
17340 1997-01-02 Richard Stallman <rms@gnu.org>
17343 [_MSC_VER]: Include stdlib.h and process.h.
17344 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17346 * src/main.c (main): Return FAILURE as a value.
17347 (printable_version): Declare arg as int, not char.
17349 1997-01-02 Richard Stallman <rms@gnu.org>
17351 * Makefile.in (dist):
17352 Explicitly check for symlinks, and copy them.
17354 1996-12-19 Richard Stallman <rms@gnu.org>
17357 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17359 1996-12-18 Paul Eggert <eggert@gnu.org>
17361 * src/bison.s1 (yyparse):
17362 If __GNUC__ and YYPARSE_PARAM are both defined,
17363 declare yyparse to have a void * argument.
17365 1996-12-18 Paul Eggert <eggert@gnu.org>
17367 * bison.simple (yyparse):
17368 If __GNUC__ and YYPARSE_PARAM are both defined,
17369 declare yyparse to have a void * argument.
17371 1996-12-17 Richard Stallman <rms@gnu.org>
17373 * src/reduce.c (nbits): Add some casts.
17375 1996-08-12 Richard Stallman <rms@gnu.org>
17377 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17379 1996-08-12 Richard Stallman <rms@gnu.org>
17381 * bison.simple: Test _MSDOS as well as _MSDOS_.
17383 1996-07-31 Richard Stallman <rms@gnu.org>
17386 [__sun && __i386]: Include alloca.h.
17388 1996-07-31 Richard Stallman <rms@gnu.org>
17391 [__sun && __i386]: Include alloca.h.
17393 1996-07-30 Richard Stallman <rms@gnu.org>
17395 * src/bison.s1: Comment change.
17397 * src/bison.s1: Test _MSDOS_, not MSDOS.
17399 1996-07-30 Richard Stallman <rms@gnu.org>
17401 * bison.simple: Comment change.
17403 * bison.simple: Test _MSDOS_, not MSDOS.
17405 1996-06-01 Richard Stallman <rms@gnu.org>
17407 * 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:
17408 Insert `_' macro around many string constants.
17411 Insert `_' macro around many string constants.
17413 (main): Call setlocale, bindtextdomain and textdomain.
17415 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17416 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17417 [ENABLE_NLS]: Include libintl.h.
17418 [ENABLE_NLS] (gettext): Define.
17419 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17420 (N_, PACKAGE, LOCALEDIR): New macros.
17422 1996-06-01 Richard Stallman <rms@gnu.org>
17424 * POTFILES.in: New file.
17426 * Makefile.in (allocate.o):
17427 Define target explicitly.
17429 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17430 (LDFLAGS): Set to @LDFLAGS@.
17431 (configure): Run autoconf only if preceding `cd' succeeds.
17432 (bison.s1): Redirect output to temporary file then move the
17433 temporary to the target, rather than redirecting directly to bison.s1.
17434 (clean): Remove config.status and config.log.
17435 (distclean): Don't remove config.status here.
17437 1996-05-12 Richard Stallman <rms@gnu.org>
17440 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17442 1996-05-12 Richard Stallman <rms@gnu.org>
17445 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17447 1996-05-11 Richard Stallman <rms@gnu.org>
17449 * src/bison.s1 (__yy_memcpy):
17450 Really reorder the args, as was supposedly done on Feb 14 1995.
17451 (yyparse): Calls changed accordingly.
17453 1996-05-11 Richard Stallman <rms@gnu.org>
17455 * Makefile.in (dist): Don't use $(srcdir).
17457 * bison.simple (__yy_memcpy):
17458 Really reorder the args, as was supposedly done on Feb 14 1995.
17459 (yyparse): Calls changed accordingly.
17461 1996-01-27 Richard Stallman <rms@gnu.org>
17463 * src/output.c (output_rule_data):
17464 Test YYERROR_VERBOSE in the conditional
17465 around the definition of ttyname.
17467 1995-12-29 Richard Stallman <rms@gnu.org>
17470 Fix line numbers in #line commands.
17472 1995-12-29 Richard Stallman <rms@gnu.org>
17475 Fix line numbers in #line commands.
17477 1995-12-27 Richard Stallman <rms@gnu.org>
17479 * src/bison.s1 (YYPARSE_PARAM_DECL):
17480 In C++, make it always null.
17481 (YYPARSE_PARAM_ARG): New macro.
17482 (yyparse): Use YYPARSE_PARAM_ARG.
17484 1995-12-27 Richard Stallman <rms@gnu.org>
17486 * bison.simple (YYPARSE_PARAM_DECL):
17487 In C++, make it always null.
17488 (YYPARSE_PARAM_ARG): New macro.
17489 (yyparse): Use YYPARSE_PARAM_ARG.
17491 1995-11-29 Richard Stallman <rms@gnu.org>
17493 * doc/bison.texinfo:
17494 Describe literal string tokens, %raw, %no_lines, %token_table.
17496 1995-11-29 Daniel Hagerty <hag@gnu.org>
17498 * doc/bison.texinfo: Fixed update date
17500 1995-10-16 Richard Stallman <rms@gnu.org>
17502 * src/version.c: Version 1.25.
17504 1995-10-16 Richard Stallman <rms@gnu.org>
17506 * NEWS: *** empty log message ***
17508 1995-10-16 Richard Stallman <rms@gnu.org>
17510 * doc/bison.1, doc/bison.rnh:
17513 1995-10-15 Richard Stallman <rms@gnu.org>
17515 * src/vmsgetargs.c, src/getargs.c:
17516 Added -n, -k, and -raw switches.
17517 (noparserflag, toknumflag, rawtoknumflag): New variables.
17519 * src/symtab.h (SALIAS):
17520 New #define for adding aliases to %token.
17521 (struct bucket): Added `alias' field.
17523 * src/reduce.c (reduce_grammar):
17524 Revise error message.
17525 (print_notices): Remove final `.' from error message.
17527 * src/reader.c (reader_output_yylsp):
17529 (readgram): Use `#if 0' around code that accepted %command
17530 inside grammar rules: The documentation doesn't allow it,
17531 and it will fail since the %command processors scan for the next %.
17532 (parse_token_decl): Extended the %token
17533 declaration to allow a multi-character symbol as an alias.
17534 (parse_thong_decl): New function.
17535 (read_declarations): Added %thong declarations.
17536 (read_declarations): Handle NOOP to deal with allowing
17537 % declarations as another means to specify the flags.
17538 (readgram): Allow %prec prior to semantics embedded in a rule.
17539 (skip_to_char, read_declarations, copy_definition)
17540 (parse_token_decl, parse_start_decl, parse_type_decl)
17541 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17542 (get_type_name, copy_guard, copy_action, readgram)
17543 (get_type, packsymbols): Revised most error messages.
17544 Changed `fatal' to `warnxxx' to avoid aborting for error.
17545 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17546 (read_declarations): Improve the error message for
17547 an invalid character. Do not abort.
17548 (read_declarations, copy_guard, copy_action): Use
17549 printable_version to avoid unprintable characters in printed output.
17550 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
17551 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
17552 Allow the type of a non-terminal can be given
17553 more than once, as long as all specifications give the same type.
17556 (output_headers, output_trailers, output, output_gram)
17557 (output_rule_data): Implement noparserflag variable.
17558 Implement toknumflag variable.
17559 (output): Call reader_output_yylsp to output LTYPESTR.
17561 * src/main.c (main):
17562 If reader sees an error, don't process the grammar.
17563 (fatals): Updated to not use VARARGS1.
17564 (printable_version, int_to_string, warn, warni, warns, warnss)
17565 (warnsss): New error reporting functions. Avoid abort for error.
17568 Added THONG and NOOP for alias processing.
17569 Added SETOPT for the new code that allows setting options with %flags.
17572 Include getopt.h. Add some extern decls.
17573 (safegetc): New function to deal with EOF gracefully.
17574 (literalchar); new function to deal with reading \ escapes.
17575 (lex): Use literalchar.
17576 (lex): Implemented "..." tokens.
17577 (literalchar, lex, parse_percent_token): Made tokenbuffer
17578 always contain the token. This includes growing the token
17579 buffer while reading an integer.
17580 (parse_percent_token): Replaced if-else statement with percent_table.
17581 (parse_percent_token): Added % declarations as another
17582 way to specify the flags -n, -l, and -r. Also added hooks for
17583 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
17584 major changes to files.c.
17585 (lex) Retain in the incoming stream a character following
17587 (skip_white_space, lex): Revised most error messages
17588 and changed fatal to warn to avoid aborting.
17589 (percent_table): Added %thong declarations.
17591 * src/gram.h: Comment changes.
17593 * src/files.c (openfiles, open_extra_files, done):
17595 and actfile file. Handle noparserflag. Both for -n switch.
17597 * src/conflicts.c (resolve_sr_conflict):
17598 Remove use of alloca.
17600 1995-06-01 Jim Meyering <meyering@gnu.org>
17602 * doc/bison.texinfo: *** empty log message ***
17604 1995-05-06 Richard Stallman <rms@gnu.org>
17606 * src/bison.s1: Comment change.
17608 1995-05-06 Richard Stallman <rms@gnu.org>
17610 * bison.simple: Comment change.
17612 1995-05-03 Richard Stallman <rms@gnu.org>
17614 * src/version.c: Version now 1.24.
17616 * src/bison.s1: Change distribution terms.
17618 * src/version.c: Version now 1.23.
17620 1995-05-03 Richard Stallman <rms@gnu.org>
17622 * doc/bison.texinfo:
17623 Rewrite "Conditions for Using Bison".
17624 Update version to 1.24.
17626 1995-05-03 Richard Stallman <rms@gnu.org>
17628 * bison.simple: Change distribution terms.
17630 1995-02-23 Richard Stallman <rms@gnu.org>
17632 * src/files.c: Test __VMS_POSIX as well as VMS.
17634 1995-02-14 Jim Meyering <meyering@gnu.org>
17636 * src/bison.s1 (__yy_memcpy):
17637 Renamed from __yy_bcopy to avoid
17638 confusion. Reverse FROM and TO arguments to be consistent with
17641 1995-02-14 Jim Meyering <meyering@gnu.org>
17643 * bison.simple (__yy_memcpy):
17644 Renamed from __yy_bcopy to avoid
17645 confusion. Reverse FROM and TO arguments to be consistent with
17648 1994-11-10 David J. MacKenzie <djm@gnu.org>
17654 * Makefile.in (DISTFILES): Include NEWS.
17656 * Makefile.in (DISTFILES):
17657 Include install-sh, not install.sh.
17659 * configure.in: Update to Autoconf v2 macro names.
17661 1994-10-05 David J. MacKenzie <djm@gnu.org>
17663 * Makefile.in: fix typo
17665 * Makefile.in (prefix, exec_prefix):
17666 Let configure set them.
17668 1994-09-28 David J. MacKenzie <djm@gnu.org>
17670 * Makefile.in: Set datadir to $(prefix)/share.
17672 1994-09-15 Richard Stallman <rms@gnu.org>
17675 Update copyright notice and GPL version.
17677 1994-09-15 Richard Stallman <rms@gnu.org>
17680 Update copyright notice and GPL version.
17682 1994-07-12 Richard Stallman <rms@gnu.org>
17684 * src/reduce.c, src/reader.c:
17687 1994-05-05 David J. MacKenzie <djm@gnu.org>
17689 * Makefile.in: entered into RCS
17691 1994-03-26 Richard Stallman <rms@gnu.org>
17693 * src/bison.s1: entered into RCS
17695 1994-03-26 Richard Stallman <rms@gnu.org>
17697 * bison.simple: entered into RCS
17699 1994-03-25 Richard Stallman <rms@gnu.org>
17701 * src/main.c: entered into RCS
17703 1994-03-24 Richard Stallman <rms@gnu.org>
17705 * src/conflicts.c: entered into RCS
17707 1994-01-02 Richard Stallman <rms@gnu.org>
17709 * Makefile.in: *** empty log message ***
17711 1993-11-21 Richard Stallman <rms@gnu.org>
17713 * src/bison.s1: *** empty log message ***
17715 1993-11-21 Richard Stallman <rms@gnu.org>
17717 * doc/bison.texinfo: entered into RCS
17719 * doc/bison.texinfo: *** empty log message ***
17721 1993-11-21 Richard Stallman <rms@gnu.org>
17723 * bison.simple: *** empty log message ***
17725 1993-10-25 David J. MacKenzie <djm@gnu.org>
17727 * doc/bison.texinfo: *** empty log message ***
17729 1993-10-19 Richard Stallman <rms@gnu.org>
17731 * src/bison.s1: *** empty log message ***
17733 1993-10-19 Richard Stallman <rms@gnu.org>
17735 * bison.simple: *** empty log message ***
17737 1993-10-14 Richard Stallman <rms@gnu.org>
17739 * src/bison.s1: *** empty log message ***
17741 1993-10-14 Richard Stallman <rms@gnu.org>
17743 * bison.simple: *** empty log message ***
17745 1993-09-14 David J. MacKenzie <djm@gnu.org>
17747 * doc/bison.texinfo: *** empty log message ***
17749 1993-09-13 Noah Friedman <friedman@gnu.org>
17751 * Makefile.in: *** empty log message ***
17753 1993-09-10 Richard Stallman <rms@gnu.org>
17755 * src/conflicts.c: *** empty log message ***
17757 * src/system.h: entered into RCS
17759 1993-09-10 Richard Stallman <rms@gnu.org>
17761 * doc/bison.1: entered into RCS
17763 1993-09-06 Noah Friedman <friedman@gnu.org>
17765 * src/version.c: entered into RCS
17767 1993-09-06 Noah Friedman <friedman@gnu.org>
17769 * Makefile.in: *** empty log message ***
17771 1993-07-30 David J. MacKenzie <djm@gnu.org>
17773 * Makefile.in: *** empty log message ***
17775 1993-07-24 Richard Stallman <rms@gnu.org>
17777 * src/bison.s1: *** empty log message ***
17779 1993-07-24 Richard Stallman <rms@gnu.org>
17781 * bison.simple: *** empty log message ***
17783 1993-07-08 David J. MacKenzie <djm@gnu.org>
17785 * Makefile.in: *** empty log message ***
17787 1993-07-04 Richard Stallman <rms@gnu.org>
17789 * src/bison.s1: *** empty log message ***
17791 1993-07-04 Richard Stallman <rms@gnu.org>
17793 * bison.simple: *** empty log message ***
17795 1993-06-26 David J. MacKenzie <djm@gnu.org>
17797 * src/getargs.c: entered into RCS
17799 1993-06-26 David J. MacKenzie <djm@gnu.org>
17801 * doc/bison.texinfo: *** empty log message ***
17803 * doc/bison.1: New file.
17805 1993-06-25 Richard Stallman <rms@gnu.org>
17807 * src/getargs.c: New file.
17809 1993-06-16 Richard Stallman <rms@gnu.org>
17811 * src/bison.s1: *** empty log message ***
17813 1993-06-16 Richard Stallman <rms@gnu.org>
17815 * bison.simple: *** empty log message ***
17817 1993-06-03 Richard Stallman <rms@gnu.org>
17819 * src/bison.s1: New file.
17821 1993-06-03 Richard Stallman <rms@gnu.org>
17823 * doc/bison.texinfo: *** empty log message ***
17825 1993-06-03 Richard Stallman <rms@gnu.org>
17827 * bison.simple: New file.
17829 1993-05-19 Richard Stallman <rms@gnu.org>
17831 * doc/bison.texinfo: New file.
17833 1993-05-07 Noah Friedman <friedman@gnu.org>
17835 * Makefile.in: *** empty log message ***
17837 1993-04-28 Noah Friedman <friedman@gnu.org>
17839 * src/reader.c: *** empty log message ***
17841 1993-04-23 Noah Friedman <friedman@gnu.org>
17843 * src/alloc.h: entered into RCS
17845 1993-04-20 David J. MacKenzie <djm@gnu.org>
17847 * src/version.c: *** empty log message ***
17849 * src/files.c, src/allocate.c:
17852 * src/reader.c: *** empty log message ***
17854 * src/lex.c: entered into RCS
17856 * src/conflicts.c: New file.
17858 * src/symtab.c: entered into RCS
17860 * src/alloc.h: New file.
17862 * src/LR0.c: entered into RCS
17864 1993-04-18 Noah Friedman <friedman@gnu.org>
17866 * src/reader.c: New file.
17868 * src/version.c: *** empty log message ***
17870 1993-04-18 Noah Friedman <friedman@gnu.org>
17872 * Makefile.in: *** empty log message ***
17874 1993-04-17 Noah Friedman <friedman@gnu.org>
17876 * Makefile.in: *** empty log message ***
17878 1993-04-15 Richard Stallman <rms@gnu.org>
17880 * src/main.c, src/files.c:
17883 1993-04-15 Noah Friedman <friedman@gnu.org>
17885 * configure.in: entered into RCS
17887 * configure.in: *** empty log message ***
17889 * configure.in: New file.
17891 1993-04-14 Richard Stallman <rms@gnu.org>
17893 * Makefile.in: New file.
17895 1993-04-13 Richard Stallman <rms@gnu.org>
17897 * src/version.c: New file.
17899 1993-03-25 Richard Stallman <rms@gnu.org>
17901 * src/output.c: entered into RCS
17903 1992-09-25 Richard Stallman <rms@gnu.org>
17905 * configure.bat: entered into RCS
17907 1992-06-22 Richard Stallman <rms@gnu.org>
17909 * src/vmsgetargs.c: entered into RCS
17911 1992-06-22 Richard Stallman <rms@gnu.org>
17913 * doc/bison.rnh: entered into RCS
17915 1992-04-20 David J. MacKenzie <djm@gnu.org>
17917 * README: entered into RCS
17919 1992-01-22 Richard Stallman <rms@gnu.org>
17921 * src/machine.h: entered into RCS
17923 1991-12-21 Richard Stallman <rms@gnu.org>
17925 * src/lalr.c, src/closure.c:
17928 1991-12-20 Richard Stallman <rms@gnu.org>
17930 * src/state.h: entered into RCS
17932 1991-12-18 Richard Stallman <rms@gnu.org>
17934 * src/print.c, src/nullable.c, src/derives.c:
17937 1991-11-03 David J. MacKenzie <djm@gnu.org>
17939 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17942 1988-09-09 Richard Stallman <rms@gnu.org>
17944 * src/bison.hairy: entered into RCS
17946 1987-12-16 Richard Stallman <rms@gnu.org>
17948 * REFERENCES: entered into RCS
17953 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
17954 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17955 Software Foundation, Inc.
17957 Copying and distribution of this file, with or without
17958 modification, are permitted provided the copyright notice and this
17959 notice are preserved.