]> git.saurik.com Git - bison.git/blob - ChangeLog
a08ef7466c801c6b6097683a6eaddaa31b6d7bf0
[bison.git] / ChangeLog
1 2006-12-13 Bob Rossi <bob@brasko.net>
2
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.
9
10 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
11
12 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
13 strange test case titles. Reported by Bob Rossi.
14
15 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
16
17 * TODO: Add pointer to Sylvain Schmitz's work on static detection
18 of potential ambiguities in GLR grammers.
19
20 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
21
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.
25
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
29 names.
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
37 C string literals.
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
47 all_but_ext.
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.
61
62 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
63
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
71 output file names.
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
75 the skeletons.
76 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
77 (Conflicting output files): New tests.
78
79 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
80
81 * doc/bison.texinfo: Fix a couple of typos.
82
83 2006-12-08 Bob Rossi <bob@brasko.net>
84
85 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
86 Rename to...
87 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
88 update all uses.
89 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
90 (yypush_parse): Rename yypvars argument to yyps and remove redundant
91 local pv.
92 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
93 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
94
95 2006-12-07 Bob Rossi <bob@brasko.net>
96 and Joel Denny <jdenny@ces.clemson.edu>
97
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.
103
104 2006-12-05 Bob Rossi <bob@brasko.net>
105
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
112 push or pure mode.
113 (yypushparse): Add b4_declare_parser_variables.
114 Init new local variables, and remove init code for removed
115 yypvars variables.
116 (yyparse): Delete.
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.
123
124 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
125
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
131 also experimental.
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).
135
136 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
137
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
153 with argument.
154 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
155 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
156 Remove the `=' from %output.
157
158 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
159
160 Don't escape $ in test case titles since Autoconf 2.61 now does that
161 correctly.
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.
166
167 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
168
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):
173 Update.
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
178 comment.
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.
186
187 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
188
189 Don't let %prec take a nonterminal.
190 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
191 token.
192 * tests/input.at (%prec takes a token): New test checking that %prec
193 won't take a nonterminal.
194
195 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
196
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.
202
203 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
204
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,
213 which frees more.
214 * src/scan-gram.l (gram_scanner_free): Likewise.
215 * src/scan-skel.l (scan_skel): Likewise.
216
217 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
218
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
227 same as 0.
228
229 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
230
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
235 gnulib changes.
236
237 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
238 and Paul Eggert <eggert@cs.ucla.edu>
239
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):
246 Likewise.
247 (tr): Now operates in-place. All uses changed.
248 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
249 values.
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
258 will be freed.
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
276 these strings.
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
282 Valgrind.
283 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
284 complain.
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.
289
290 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
291
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.
296
297 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
298
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.
310
311 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
312 than LIST_FREE directly.
313
314 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
315
316 Finish implementing --warnings=error, which should not be implied by
317 --warnings=all (or by its synonyms -W and --warnings without
318 subarguments).
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.
321 Invoke...
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
325 above".
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.
329
330 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
331
332 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
333 empty subargument list. For example: `bison --warnings= parser.y'.
334
335 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
336
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.
339
340 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
341
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
353 for <*> and <!>.
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
357 tagless versions.
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
366 tagless versions.
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
377 extend.
378 (Default %printer and %destructor for user-defined end token): Extend.
379 (Default %printer and %destructor are not for error or $undefined):
380 Update.
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.
385
386 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
387
388 Don't apply the default %destructor/%printer to an unreferenced midrule
389 value. Mentioned at
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
398 values): New test.
399 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
400 for change to dummy symbol names.
401
402 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
403
404 Warn about unset midrule $$ if the corresponding $n is used.
405 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
406 $n usage.
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
411 parent rule.
412 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
413 warning.
414
415 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
416
417 More improvements to the documentation of the prologue alternatives:
418 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
419 Bison manual.
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.
423
424 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
425
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.
434
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
438 alternatives to...
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
442 %code-top.
443
444 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
445
446 DJGPP specific issues.
447
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.
452
453 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
454
455 Replace %*-header with %provides, %requires, %code. See discussion at
456 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
457
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
461 and b4_*end_header.
462 * data/glr.cc: Likewise.
463 * data/lalr1.cc: Likewise.
464 * data/push.c: Likewise.
465 * data/yacc.c: Likewise.
466
467 * doc/bison.texinfo: Remove %before-header, rename
468 %{start,end,after}-header to %requires, %provides, %code.
469
470 * src/parse-gram.y: Likewise (also rename token names accordingly).
471 * src/scan-gram.l: Likewise.
472 * tests/actions.at: Likewise.
473
474 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
475
476 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
477 Problem reported by Joel E. Denny.
478
479 2006-10-14 Jim Meyering <jim@meyering.net>
480
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,
485 rather than 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.
491
492 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
493
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):
500 Likewise.
501
502 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
503
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
526 HAVE_CONFIG_H lines.
527 * tests/glr-regression.at (Missed %merge type warnings when ...):
528 Likewise.
529 * tests/regression.at (Braced code in declaration in rules section):
530 Likewise.
531 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
532 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
533 Include <config.h> unconditionally.
534
535 * bootstrap: Sync from coreutils, as follows:
536
537 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
538
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.
542
543 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
544
545 * bootstrap (usage, main program, symlink_to_gnulib): Add option
546 --copy. Inspired by a suggestion from Bruno Haible.
547
548 2006-10-03 Jim Meyering <jim@meyering.net>
549
550 * bootstrap: Undo last change to this file, since now gnulib-tool
551 sticks with the automake default in generating dependencies.
552
553 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
554
555 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
556 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
557
558 * doc/bison.1: Add copyright notice.
559
560 * data/glr.c: Don't include <stdarg.h>; not used.
561
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
567 of this change in
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.
586
587 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
588 accommodates the 2006-10-08 change.
589
590 2006-10-11 Bob Rossi <bob@brasko.net>
591
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.
597
598 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
599
600 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
601 in a push parser. Reindent slightly to match yacc.c better.
602
603 2006-10-11 Bob Rossi <bob@brasko.net>
604
605 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
606 yymsg_alloc fields.
607 (yypvarsinit, yypushparse): Remove init of removed fields.
608 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
609
610 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
611
612 * THANKS: Add Paolo Bonzini and Bob Rossi.
613
614 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
615
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
625 only if specified.
626
627 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
628
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.
643
644 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
645
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.
653
654 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
655
656 Merge bootstrap changes from coreutils.
657
658 2006-09-28 Jim Meyering <jim@meyering.net>
659
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.
664
665 2006-09-23 Jim Meyering <jim@meyering.net>
666
667 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
668
669 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
670
671 * bootstrap: Add support for --force.
672 (usage): New function. Describe usage less tersely.
673 (CVS_only_file): New var.
674
675 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
676
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.
680
681 2006-09-20 Bob Rossi <bob@brasko.net>
682
683 * data/push.c (yyresult_get): Remove function.
684 (YYPUSH_MORE): Add #define.
685 (yypushparse): Modify return value.
686
687 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
688
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,
693 stamp-h1.
694
695 Sync bootstrap from coreutils, as follows:
696
697 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
698
699 * bootstrap (symlink_to_gnulib): New function.
700 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
701 to copies-of-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).
705
706 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
707
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.
711
712 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
713
714 Use some of gnulib's new modules, taken from coreutils.
715
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.
723 (gl_EARLY): Add.
724 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
725 (gl_INIT): Add
726 (GNULIB_AUTOCONF_SNIPPET): Remove.
727 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
728 the pickiest.
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.
752
753
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>.
756
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.
760
761 * src/scan-code.l: Always initialize braces_level; the old code
762 left it uninitialized and therefore had undefined behavior.
763
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
768 use assert.
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.
774
775 2006-09-15 Bob Rossi <bob@brasko.net>
776
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.
789
790 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
791
792 * NEWS: Version 2.3a.
793 * configure.ac (AC_INIT): Likewise.
794
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
798 was there.
799
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
803 Paolo Bonzini.
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
813 if YYYDEBUG.
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
817 set_debug_level.
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.
821
822 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
823
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.
829
830 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
831
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.
835
836 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
837
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.
848
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.
855
856 * README-cvs: Fix typo: "&" should be "&&". Problem reported
857 by Jim Meyering.
858 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
859 This adjusts to recent gnulib changes.
860
861 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
862
863 Finish implementation of per-type %destructor/%printer. Discussed
864 starting at
865 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
866 and
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
882 the default.
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.
889
890 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
891
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
902 %symbol-default.
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
913 %printer's.
914 * tests/actions.at, tests/input.at: Add %symbol-default to all default
915 %destructor/%printer declarations.
916
917 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
918
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): ...
933 this.
934
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.
939
940 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
941
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
946 cases listed below.
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):
950 New test cases.
951
952 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
953
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
959 nonterminals.
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.
963
964 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
965
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.
978 Remove those slots.
979 * tests/regression.at (Undeclared string literal): Remove test case
980 added in previous commit since non-aliased string literals are allowed
981 again.
982 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
983 remove unnecessary string literal declarations.
984 * tests/sets.at (Firsts): Likewise.
985
986 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
987
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
993 symbol.
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
1008 aliases.
1009 * tests/sets.at (Firsts): Likewise.
1010
1011 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1012
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
1019 seen.
1020
1021 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1022 unused global.
1023
1024 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1025
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
1031 the character code.
1032 * tests/input.at (String aliases for character tokens): New test.
1033
1034 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1035
1036 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1037
1038 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1039
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).
1046
1047 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1048 function, since it simplifies our code a bit.
1049
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.
1056
1057 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1058
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".
1068
1069 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1070
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
1077 also overwritten.
1078
1079 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1080
1081 * doc/bison.texinfo: Fix some typos.
1082
1083 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1084
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.
1087
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.
1092
1093 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1094
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>,
1102 and
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
1117 again.
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.
1136
1137 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1138
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>
1142 and
1143 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1144
1145 Make the skeletons consistent in how they pop the end token and invoke
1146 its %destructor.
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.
1153
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.
1159
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
1162 %destructor.
1163
1164 * tests/actions.at (Printers and Destructors): Test all the above.
1165
1166 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1167
1168 Update to latest gnulib and gettext versions.
1169 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1170 Add fopen-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
1175 rejects them.
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,
1187 strdup.h.
1188 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1189 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1190
1191 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1192
1193 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1194 it with --assume-autoconf='latest-stable'.
1195
1196 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1197
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
1200 YYSTYPE' and `{'.
1201 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1202 those from muscle_tab.c since the old ones are misleading.
1203
1204 2006-07-13 Akim Demaille <akim@epita.fr>
1205
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.
1214 Use them.
1215 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1216 as value.
1217 * src/scan-gram.l (getargs.h): Don't include it.
1218
1219 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1220
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.
1228
1229 2006-07-12 Akim Demaille <akim@epita.fr>
1230
1231 * data/c.m4: Comment changes.
1232
1233 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
1234
1235 * src/complain.c (error_message, ERROR_MESSAGE): New.
1236 To factor...
1237 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1238 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1239
1240 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1241
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
1255 %union.
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.
1259 (typed): remove.
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.
1269
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.
1273
1274 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1275 object is now static.
1276
1277 * src/getargs.c (flags_argmatch): Return void, not int,
1278 to pacify ./configure --enable-gcc-warnings.
1279
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).
1282
1283 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1284
1285 Implement --warnings/-W.
1286 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1287 replaced by...
1288 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1289 Adjust callers.
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.
1295
1296 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1297
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.
1303
1304 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1305
1306 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1307 to be in alphabetical order.
1308 (trace_args): Spelling fixes.
1309
1310 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1311
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.
1317
1318 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1319
1320 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1321 need the full POSIX semantics (and weren't implementing them
1322 anyway).
1323
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
1333 Autoconf 2.60.
1334 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1335 Do not check for uintptr_t, since new stdint module does the right
1336 thing.
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
1345 to gnulib changes.
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>
1358 to get the decl.
1359
1360 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1361
1362 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1363 New, default to 1.
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
1366 default.
1367 * tests/calc.at: Adjust.
1368
1369 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1370
1371 * data/c.m4 (b4_basename): New.
1372 (b4_syncline): Also output the location of its invocation (from
1373 the skeleton).
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.
1378
1379 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1380
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.
1385
1386 * src/scan-gram.l (scanner_cursor): Declare it static.
1387
1388 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1389
1390 In warnings, say "previous declaration" rather than "first
1391 declaration".
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.
1399
1400 2006-06-27 Akim Demaille <akim@epita.fr>
1401
1402 * doc/Doxyfile.in: New.
1403 * doc/Makefile.am: Use it.
1404 * src/lalr.h, src/symtab.h: Initial doxygenation.
1405
1406 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1407
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
1410 patch.
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
1415 the current rule.
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.
1425
1426 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1427
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>
1431 and
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
1434 rule's $$.
1435 * src/reader.c (grammar_current_rule_end): Don't invoke
1436 grammar_rule_check yet since not all symbol declarations may have been
1437 parsed yet.
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
1442 rule.
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
1455 where necessary.
1456 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1457 members.
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
1467 implementing...
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.
1473
1474 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1475
1476 More cleanup.
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.
1484
1485 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1486
1487 Clean up yesterday's patch.
1488 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1489 to...
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.
1494
1495 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1496
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
1504 global variables.
1505 * tests/regression.at (Braced code in declaration in rules section):
1506 New test to catch the error fixed by the above patch.
1507
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
1513 current_rule.
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
1518 translate_action.
1519
1520 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1521
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
1555 extern's.
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.
1563
1564 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1565
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.
1573
1574 Some minor fixes.
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
1579 printer members.
1580 * tests/input.at (Incompatible Aliases): Update output with correct
1581 printer location.
1582
1583 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1584
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>,
1592 and
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
1618 file.
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
1622 %after-definitions.
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
1640 pre-prologue.
1641
1642 2006-06-20 Akim Demaille <akim@epita.fr>
1643
1644 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1645 (symbol_get): Use it.
1646 * src/parse-gram.y: Use it.
1647
1648 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1649
1650 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1651 build succeeds when configured with --enable-gcc-warnings.
1652
1653 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1654
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.
1660
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.
1673
1674 2006-06-19 Akim Demaille <akim@epita.fr>
1675
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'.
1682 Sort tokens.
1683 (CHAR): New token.
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.
1691
1692 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1693
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>,
1699 and
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
1704 token #define's.
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.
1714
1715 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1716
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
1724
1725 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1726
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>
1730 and then at
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
1745 spellings.
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.
1758 Update other uses.
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
1764 look_ahead_token.
1765 (print_core, state_default_rule, print_reductions, print_results):
1766 Update uses.
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.
1789 * yacc.c: 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.
1797
1798 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1799
1800 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1801
1802 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1803
1804 * TODO: Add request from Nelson H. F. Beebe to be able to install
1805 Bison without installing the yacc script.
1806
1807 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1808
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
1814 <config.h>.
1815
1816 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1817
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
1820 missing #include's.
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
1824 invocation.
1825
1826 * src/.cvsignore: Add scan-code.c.
1827
1828 2006-06-07 Akim Demaille <akim@epita.fr>
1829
1830 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1831 to...
1832 * src/scan-code.l: here.
1833 * tests/input.at (Torturing the Scanner): Fix another location
1834 error.
1835
1836 2006-06-07 Akim Demaille <akim@epita.fr>
1837
1838 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1839
1840 2006-06-06 Akim Demaille <akim@epita.fr>
1841
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
1845 into simple tokens.
1846 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1847 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1848 rename as...
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
1855 gram_scanner_free.
1856 * src/output.c: Include scan-code.h.
1857 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1858 Use boundary_set.
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...
1874 (GRAM_DECL): this.
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):
1881 these to...
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.
1898
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.
1902
1903 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1904
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>.
1908
1909 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1910
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.
1925
1926 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1927
1928 * NEWS: Version 2.3.
1929 * configure.ac (AC_INIT): Likewise.
1930
1931 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1932
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):
1938 Document this.
1939
1940 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1941
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
1944 releasing 2.3.
1945
1946 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1947
1948 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1949 Problem reported by Akim Demaille.
1950
1951 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1952
1953 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1954
1955 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1956
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>.
1960
1961 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1962
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.
1969
1970 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1971
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
1976 not used.
1977 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
1978
1979 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1980
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.
1993
1994 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
1995
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).
2007
2008 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2009
2010 * NEWS: Version 2.2.
2011 * configure.ac (AC_INIT): Likewise.
2012
2013 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2014
2015 * data/glr.c (yyreportTree): Make room in yystates for the state
2016 preceding the RHS. This fixes the segmentation fault reported by Derek
2017 M. Jones in
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
2021 same thread.
2022 * THANKS: Add Derek M. Jones.
2023 Update my email address.
2024 Fix typo in Steve Murphy's name.
2025
2026 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2027
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.
2039
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.
2044
2045 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2046
2047 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2048 scheme.
2049 Reported by Steve Murphy.
2050
2051 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2052
2053 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2054 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2055
2056 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2057
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.
2061
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.
2071
2072 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2073
2074 * etc/bench.pm: Shorten bench names.
2075
2076 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2077
2078 * src/output.h, src/output.c (error_verbose): Move to...
2079 * src/getargs.h, src/getargs.c: here.
2080 Sort the flags.
2081 Adjust dependencies.
2082
2083 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2084
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.
2090
2091 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2092
2093 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2094 incompatibility, not a bug. Mention that it wasn't fixed as of
2095 flex 2.5.33.
2096
2097 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2098
2099 * examples/extexi: Enforce the precedence of concatenation over
2100 >>.
2101 Reported by Tommy Nordgren.
2102
2103 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2104
2105 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2106 with the member "token".
2107 Reported by Martin Nylin.
2108
2109 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2110
2111 * data/glr.c: Switch to Bison 2.2 special-exception language in
2112 the copyright notice. Use more-regular format for titles and
2113 copyright notices.
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.
2119
2120 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
2121
2122 * data/glr.cc: Remove dead code.
2123
2124 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2125
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.
2129
2130 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2131
2132 * doc/bison.texinfo (Multiple start-symbols): New.
2133
2134 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2135
2136 * etc/README, etc/bench.pl: New.
2137
2138 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
2139
2140 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2141 rule.
2142 Reported by Mickael Labau.
2143 * tests/input.at (Torturing the Scanner): Test it.
2144
2145 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2146
2147 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2148 Problem reported by Bob Rossi.
2149
2150 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2151
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.
2156
2157 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2158
2159 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2160 of AT_NAME_PREFIX when %name-prefix is not used.
2161
2162 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2163
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'.
2177
2178 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2179
2180 * TODO: Remove dead items.
2181
2182 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2183
2184 * doc/FAQ: Remove, merged into...
2185 * doc/bison.texinfo (FAQ): this.
2186 * doc/Makefile.am (EXTRA_DIST): Adjust.
2187
2188 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2189
2190 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2191 even if empty.
2192 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2193 * doc/bison.texinfo (Calc++ Scanner): Use it.
2194
2195 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2196
2197 Fix two nits reported by twlevo, plus one more that I discovered.
2198
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.
2202
2203 * src/reader.h (token_name): Likewise.
2204
2205 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2206
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
2211 copyright notice.
2212 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2213 * src/conflicts.c (solved_conflicts_obstack): Now static.
2214
2215 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2216
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.
2220
2221 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2222
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.
2230
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.
2234
2235 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2236
2237 * tests/glr-regression.at (Uninitialized location when reporting
2238 ambiguity): New test case.
2239 * data/glr.c (yyresolveLocations): New function, which uses
2240 YYLLOC_DEFAULT.
2241 (yyresolveValue): Invoke yyresolveLocations before reporting an
2242 ambiguity.
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.
2246
2247 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2248
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
2252 case.
2253 * data/glr.c (yyparse): Check for zero stacks remaining before
2254 attempting to shift the lookahead so that you don't lose it.
2255
2256 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2257
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.
2266
2267 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2268 in existing testcases.
2269
2270 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2271
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
2288 interface.
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.
2293
2294 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2295
2296 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2297 led to a segmentation fault in GNU Pascal. Problem reported
2298 by Waldek Hebisch.
2299
2300 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2301
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.
2305
2306 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2307
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.
2318
2319 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2320
2321 * NEWS: Clarify symbols versus types in unused-value warnings.
2322
2323 * configure.ac (AC_INIT): Bump version number.
2324
2325 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2326
2327 * NEWS: Version 2.1a.
2328 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2329 since C99 requires this.
2330
2331 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2332
2333 * m4/c-working.m4: New file.
2334 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2335
2336 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2337
2338 * Makefile.maint: Merge from coreutils.
2339
2340 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2341
2342 More portability fixes for problems summarized by Nelson H. F. Beebe.
2343
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
2349 in 64-bit mode.
2350
2351 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2352
2353 More portability fixes for problems summarized by Nelson H. F. Beebe.
2354
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.
2357
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++
2362 compilers.
2363
2364 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2365
2366 More portability fixes for problems summarized by Nelson H. F. Beebe.
2367
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.
2373
2374 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2375
2376 Various DJGGP specific issues in /djgpp
2377
2378 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2379
2380 More portability fixes for problems summarized by Nelson H. F. Beebe.
2381
2382 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2383 '#include <map>' works and that you can apply ++ to iterators.
2384
2385 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2386
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>.
2389
2390 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2391 that '#include <string>' works.
2392
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
2397 multiple copies)".
2398
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
2403 <iso646.h>.
2404
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
2407 Suite Version 2.0.
2408
2409 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2410
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
2417 effect.
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
2424 point to.
2425
2426 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2427 after `--report' documentation.
2428
2429 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2430
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.
2434
2435 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2436
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
2439 normal case.
2440
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.
2463
2464 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2465
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
2471 adjusted.
2472
2473 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2474
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
2478 their arguments.
2479 * data/lalr1.cc: Likewise.
2480 * data/yacc.cc: Likewise.
2481
2482 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2483
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.
2491 All uses changed.
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.
2496
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.
2500
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
2509 visible elsewhere.
2510 * src/scan-skel.l: Accept the above decls.
2511 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2512 is used.
2513
2514 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2515
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.
2521 All uses changed.
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
2568 that for us.
2569 * .x-sc_require_config_h: New file.
2570 * .x-sc_unmarked_diagnostics: New file.
2571
2572 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2573
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
2578 pedantic compilers.
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):
2593 Likewise.
2594 * src/reader.c (packgram, reader): Likewise.
2595 * src/state.c (transitions_to, state_new, state_reduction_find):
2596 Likewise.
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.
2604
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.
2608
2609 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2610
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.
2621
2622 * bootstrap: Undo changes to gnulib files that autoreconf made.
2623
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'.
2645
2646 2006-01-19 Akim Demaille <akim@epita.fr>
2647
2648 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2649 location, not just parts of it.
2650
2651 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2652
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
2656 the wishlist.
2657
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.
2673
2674 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2675 with "file system".
2676
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.
2682
2683 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2684
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'.
2691
2692 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2693
2694 * data/glr.c (yysplitStack): A little stylistic rewrite.
2695
2696 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2697
2698 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2699
2700 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2701
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
2716 actions.
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
2721 yyclearin.
2722 (Bison Symbols): In the yychar entry, don't call it the `current'
2723 look-ahead.
2724 In the yylloc and yylval entries, mention look-ahead usage.
2725
2726 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2727
2728 * tests/glr-regression.at: Update copyright year to 2006.
2729
2730 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2731
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
2742 user action.
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.
2760
2761 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2762
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.
2767
2768 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2769
2770 * tests/glr-regression.at: For consistency with my newer test cases,
2771 don't thank myself.
2772
2773 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2774
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
2788 masked this bug.
2789 (Leaked merged semantic value if user action cuts parse): New test
2790 case.
2791
2792 2006-01-05 Akim Demaille <akim@epita.fr>
2793
2794 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2795
2796 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2797
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
2802 b4_c_modern.
2803 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2804 than rolling our own.
2805
2806 2006-01-04 Akim Demaille <akim@epita.fr>
2807
2808 Also warn about non-used mid-rule values.
2809 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2810 member.
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.
2815 Check its rule.
2816 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2817 Use it.
2818 * tests/actions.at (Exotic Dollars): Adjust.
2819
2820 2006-01-04 Akim Demaille <akim@epita.fr>
2821
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.
2826
2827 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2828
2829 * doc/bison.texinfo (Bison Options): Say more accurately what
2830 --yacc does.
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.
2834
2835 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2836
2837 Warn about dubious constructions like "%token T T".
2838 Reported by twlevo.
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.
2844
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.
2849 All uses changed.
2850
2851 * src/muscle_tab.c (muscle_grow): Fix comment.
2852
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.
2856
2857 2006-01-03 Akim Demaille <akim@epita.fr>
2858
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
2864 #line consistency.
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
2870 and AT_SKEL_CC_IF.
2871 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2872 AT_LALR1_CC_IF.
2873 Be sure to initialize the first position's filename.
2874 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2875 mandated anyway.
2876 (AT_CHECK_CALC_GLR_CC): New.
2877 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2878
2879 2006-01-02 Akim Demaille <akim@epita.fr>
2880
2881 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2882 c.m4.
2883 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
2884 * data/glr.cc: Do not include stack.hh.
2885
2886 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2887
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.
2893
2894 2005-12-29 Akim <akim@sulaco.local>
2895
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.
2900
2901 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2902
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):
2907 New functions.
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.
2919
2920 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2921 GCC warnings.
2922
2923 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2924
2925 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2926 Remove unnecessary forward static decls.
2927
2928 2005-12-27 Akim Demaille <akim@epita.fr>
2929
2930 * src/reader.c (grammar_current_rule_check): Also check that $$
2931 is used.
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):
2935 Rename as...
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
2941 YYERROR or other.
2942 * tests/actions.at (Exotic Dollars): Instead of using unused
2943 values, check that the warning is issued.
2944
2945 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2946
2947 * NEWS: Improve wording for unused-value warnings.
2948
2949 2005-12-22 Akim Demaille <akim@epita.fr>
2950
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.
2956
2957 2005-12-22 Akim Demaille <akim@epita.fr>
2958
2959 * NEWS: Warn about unused values.
2960 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2961 a `used' member.
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
2966 used.
2967 * src/symtab.c (symbol_print): Accept 0.
2968 * tests/existing.at: Remove the type information.
2969 Empty the actions.
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):
2975 Likewise.
2976
2977 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
2978 rule_useful_p.
2979
2980 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
2981
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
2985 previous wording.
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.
2992
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
3001 text slightly.
3002 * tests/cxx-type.at: Cast results of malloc, for C++.
3003
3004 2005-12-21 Joel E. Denny <address@hidden>
3005
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.
3009
3010 2005-12-21 Joel E. Denny <address@hidden>
3011
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
3021 weren't necessary.
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
3025 globally.
3026 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3027 `if (YYID (N))' to pacify lint.
3028
3029 2005-12-21 Akim Demaille <akim@epita.fr>
3030
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.
3044
3045 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3046
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.
3060
3061 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3062
3063 * bootstrap (build_cvs_prefix): Remove; unused.
3064 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3065 when getting gnulib.
3066
3067 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3068
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
3072 a pointer.
3073 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3074 consistency.
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
3078 lint.
3079
3080 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3081
3082 * tests/sets.at (Accept): Fix typos in regular expression used to
3083 sed out the final state number.
3084
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.
3124
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.
3128
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
3140 is C++ only.
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.
3146
3147 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3148
3149 * tests/glr-regression.at
3150 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3151 Close memory leak reported by twlevo.
3152
3153 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3154
3155 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3156 all stacks.
3157 (yyparse): Iterate another stack in order to call user destructors.
3158 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3159 New test case.
3160 (Duplicated user destructor for lookahead): This test now is expected
3161 to succeed.
3162
3163 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3164
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.
3178
3179 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3180
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
3184 supported in C.
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.
3188
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
3192 change.
3193 * tests/conflicts.at (%expect not enough, %expect too much):
3194 (%expect with reduce conflicts): Adjust to new behavior.
3195
3196 2005-11-18 Akim Demaille <akim@epita.fr>
3197
3198 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3199 errors.
3200 * NEWS: Document this.
3201 * doc/bison.texinfo (Expect Decl): Likewise.
3202
3203 2005-11-16 Akim Demaille <akim@epita.fr>
3204
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
3208 literal integers.
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).
3215 (yyparse): Adjust.
3216 * tests/calc.at: Adjust the expected length of the traces.
3217
3218 2005-11-14 Akim Demaille <akim@epita.fr>
3219
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.
3223
3224 2005-11-14 Akim Demaille <akim@epita.fr>
3225
3226 * data/glr.c (yy_reduce_print): Fix the $ number.
3227
3228 2005-11-14 Akim Demaille <akim@epita.fr>
3229
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
3234 non-pointer types.
3235
3236 2005-11-14 Akim Demaille <akim@epita.fr>
3237
3238 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3239
3240 2005-11-14 Akim Demaille <akim@epita.fr>
3241
3242 * data/glr.cc: New.
3243 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
3244
3245 2005-11-12 Akim Demaille <akim@epita.fr>
3246
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
3252 compatibility.
3253 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3254
3255 2005-11-12 Akim Demaille <akim@epita.fr>
3256
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".
3260
3261 2005-11-12 Akim Demaille <akim@epita.fr>
3262
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.
3267
3268 2005-11-11 Akim Demaille <akim@epita.fr>
3269
3270 * data/glr.c: Comment changes.
3271
3272 2005-11-11 Akim Demaille <akim@epita.fr>
3273
3274 When yydebug, report semantic and location values for reductions.
3275 * data/glr.c (yy_reduce_print): Report the semantic values and the
3276 locations.
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
3282 traces.
3283
3284 2005-11-10 Akim Demaille <akim@epita.fr>
3285
3286 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3287 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3288 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3289
3290 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3291
3292 * m4/cxx.m4, examples/Makefile.am: Don't build
3293 examples/calc++ if no C++ compiler is available. (trivial change)
3294
3295 2005-11-09 Akim Demaille <akim@epita.fr>
3296
3297 * src/scan-skel.l: Use a couple of asserts.
3298
3299 2005-11-03 Akim Demaille <akim@epita.fr>
3300
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
3304 final_state.
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.
3313
3314 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3315
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):
3323 New test.
3324
3325 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3326
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
3330 Hilfinger).
3331
3332 2005-10-22 Akim <akim@epita.fr>
3333
3334 * Makefile.cfg: Adjust to config -> build-aux.
3335 Reported by twledo.
3336
3337 2005-10-21 Akim Demaille <akim@epita.fr>
3338
3339 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3340 the %parse-params.
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.
3346
3347 2005-10-21 Akim Demaille <akim@epita.fr>
3348
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:
3352 Move to...
3353 * build-aux/prev-version, build-aux/announce-gen,
3354 * build-aux/Makefile.am: here.
3355
3356 2005-10-14 Akim Demaille <akim@epita.fr>
3357
3358 * examples/calc++/test: Use set -x only when VERBOSE.
3359
3360 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3361
3362 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3363 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3364
3365 2005-10-13 Akim Demaille <akim@epita.fr>
3366
3367 * src/scan-skel.l: Output the base name parts of the parser and
3368 header file names.
3369 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
3370 additional checks.
3371 Use this to exercise C++ outputs in subdirs.
3372 Reported by Oleg Smolsky.
3373
3374 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3375
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
3380 already defined it.
3381
3382 2005-10-12 Akim Demaille <akim@epita.fr>
3383
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.
3387
3388 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3389
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
3398 as __STDC__.
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.
3402
3403 2005-10-10 Akim Demaille <akim@epita.fr>
3404
3405 * examples/calc++/test: Be quiet unless VERBOSE.
3406
3407 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3408
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):
3415 (YYCHK1):
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'.
3419 (YYUSE): New macro.
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.
3425
3426
3427 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3428 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3429
3430 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3431
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
3441 putc and puts.
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.
3452
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.
3458
3459 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3460
3461 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3462
3463 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3464
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
3479 to printf.
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.
3490
3491 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3492 this confuses xgettext.
3493
3494 2005-10-02 Akim Demaille <akim@epita.fr>
3495
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.
3503 Use it.
3504 * doc/bison.texinfo (Require Decl): New.
3505 (Calc++ Parser): Use %require.
3506
3507 2005-10-02 Akim Demaille <akim@epita.fr>
3508
3509 * data/location.cc: New.
3510
3511 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3512 Akim Demaille <akim@epita.fr>
3513
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.
3518 (dir_prefix): New.
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.
3533
3534 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3535
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
3538 for posix systems.
3539
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
3542 for posix systems.
3543
3544 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3545 handle the lack of pipe/fork functionality on non-posix systems.
3546
3547 * djgpp/Makefile.maint: DJGPP specific file.
3548
3549 * djgpp/README.in: DJGPP specific file.
3550
3551 * djgpp/config.bat: DJGPP specific configuration file.
3552
3553 * djgpp/config.sed: DJGPP specific configuration file.
3554
3555 * djgpp/config.site: DJGPP specific configuration file.
3556
3557 * djgpp/config_h.sed: DJGPP specific configuration file.
3558
3559 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3560
3561 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3562
3563 2005-10-02 Akim Demaille <akim@epita.fr>
3564
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.
3573
3574 2005-10-01 Akim Demaille <akim@epita.fr>
3575
3576 * examples/extexi: Restore the #line generation.
3577
3578 2005-09-30 Akim Demaille <akim@epita.fr>,
3579 Alexandre Duret-Lutz <adl@gnu.org>
3580
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.
3595
3596 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3597
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.
3603
3604 2005-09-29 Akim Demaille <akim@epita.fr>
3605
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
3612 local variables.
3613 (yysyntax_error_): Takes the state number as argument.
3614 (yyreduce_print_): Use the argument yyrule, not the former
3615 attribute yyn_.
3616
3617 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3618
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'.
3625
3626 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3627
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.
3632
3633 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3634 it itself.
3635 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3636 don't use alloca any more.
3637
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.
3643
3644 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3645
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
3649 Solaris, AIX, MSC.
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
3652 stdlib.h.
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.
3658
3659 * HACKING (release): Forwarn the Translation Project about
3660 stable releses.
3661
3662 2005-09-20 Akim Demaille <akim@epita.fr>
3663
3664 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3665
3666 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3667
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.
3677
3678 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3679 yynerrs is the number of errors reported, not the number of
3680 errors encountered.
3681
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.
3687
3688 2005-09-19 Akim Demaille <akim@epita.fr>
3689
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.
3696
3697 2005-09-19 Akim Demaille <akim@epita.fr>
3698
3699 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3700 least Mac OSX with a /usr/local install of gettext.
3701
3702 2005-09-19 Akim Demaille <akim@epita.fr>
3703
3704 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3705 and yytoken for similarity with the other skeletons.
3706
3707 2005-09-19 Akim Demaille <akim@epita.fr>
3708
3709 * NEWS, configure.ac: update version number to 2.1a.
3710
3711 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3712
3713 * NEWS: Version 2.1.
3714
3715 * NEWS: Remove notice of yytname change, since it was never in an
3716 official release.
3717 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3718 diagnostic.
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.
3728
3729 2005-09-16 Akim Demaille <akim@epita.fr>
3730
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.
3735
3736 2005-09-16 Akim Demaille <akim@epita.fr>
3737
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
3745 as default values.
3746
3747 2005-09-16 Akim Demaille <akim@epita.fr>
3748
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.
3757
3758 2005-09-16 Akim Demaille <akim@epita.fr>
3759
3760 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3761 since it's in Bison's name space.
3762
3763 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3764
3765 * data/glr.c (yyresolveValue): Add default case to pacify
3766 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3767
3768 * NEWS: Document when yyparse started to return 2.
3769 * doc/bison.texinfo (Parser Function): Document when yyparse
3770 returns 2.
3771
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
3774 changed.
3775 (class position): file_name -> filename (reverting). All uses changed.
3776
3777 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3778
3779 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3780 do anything if $@ exists. This reverts part of the 2005-07-07
3781 patch.
3782
3783 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3784
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
3792 value.
3793
3794 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3795
3796 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3797 Suggested by twlevo@xs4all.nl.
3798
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.
3802
3803 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3804 standards. Use "file name" or "file" or "name", depending on
3805 the context.
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.
3811 All uses changed.
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.
3820
3821 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3822
3823 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3824 to accommodate latest gnulib.
3825
3826 * tests/glr-regression.at (Duplicate representation of merged trees):
3827 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3828
3829 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3830 needed.
3831
3832 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3833
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).
3837
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
3842
3843 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3844
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.
3848
3849 * bootstrap (no_cache): New var, to accommodate different wget
3850 variants. Use it instead of '-C off'. Problem reported by
3851 twlevo@xs4all.nl.
3852
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.
3856
3857 2005-08-25 Akim Demaille <akim@epita.fr>
3858
3859 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3860
3861 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3862
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
3869
3870 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3871
3872 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3873 Add strnlen.c.
3874 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3875 lib-prefix.m4, po.m4.
3876
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.
3884
3885 * src/files.c: Remove obsolete FIXME comment.
3886
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.
3894
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>
3898 (trivial change).
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.
3903
3904 * configure.ac (AC_INIT): Bump to 2.0c.
3905
3906 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3907
3908 * NEWS: Version 2.0b.
3909
3910 * Makefile.am (SUBDIRS): Put examples before tests, so that
3911 "make check" doesn't finish with "All 1 tests passed".
3912
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.
3920
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.
3923
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
3928 it as an index.
3929
3930 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3931 the user's name space. All uses changed to __attribute__
3932 ((__unused__)).
3933 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3934 Add __attribute__ ((__noreturn__)).
3935
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.
3954 (dd_c): New macro.
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.
3963
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.
3972
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.
3977
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.
3982
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.
3987
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):
3993 Likewise.
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.
4000 (output_skeleton):
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".
4012
4013 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4014 not @VAR@.
4015
4016 * tests/torture.at: Revamp to avoid misuse of atoi that
4017 "make maintainer-distcheck" complained about.
4018
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.
4022
4023 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4024
4025 * configure.ac: Update version number.
4026
4027 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4028 accidentally.
4029 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4030 autogenerated by the maintainer.
4031 * examples/calc++/.cvsignore: Add *.yy.
4032
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.
4036
4037 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4038
4039 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4040 from maintainer-distcheck about casting the argument of 'free'.
4041
4042 * NEWS: Mention recent yytname changes.
4043 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4044
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
4049 team.
4050
4051 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4052 now that token names are already quoted.
4053
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.
4061
4062 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4063
4064 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4065 again if the first call fails.
4066
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.
4082
4083 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4084
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
4089 spaces.
4090 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4091 as the stack isn't valid in that case.
4092
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
4097 is used.
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):
4101 Likewise.
4102
4103 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4104 overly-picky compilers that reject 'char *foo = "bar";'.
4105
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.
4109
4110 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4111 warnings from GCC 4.
4112
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.
4117 All uses changed.
4118 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4119
4120 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4121
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.
4140
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
4151 eases translation.
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".
4156
4157 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4158
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.
4164
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
4168 get lost. See
4169 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4170
4171 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4172 Now auto-generated.
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
4183 is virtual.
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
4191 skeletons.
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.
4197
4198 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4199 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4200 void, not int.
4201 * tests/glr-regression.at (Badly Collapsed GLR States):
4202 Likewise.
4203 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4204 yylex should return 0 at EOF rather than aborting.
4205
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.
4209 All uses removed.
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
4215 struct.
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).
4225
4226 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4227
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.
4236
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.
4242
4243 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4244
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.
4262
4263 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4264
4265 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4266 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4267
4268 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4269
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.
4274
4275 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4276
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
4303 its value.
4304 * src/main.c (main): Bind the bison-runtime domain, too.
4305
4306 2005-07-12 Bruno Haible <bruno@clisp.org>
4307
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.
4330 Define aclocaldir.
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.
4337
4338 2005-07-12 Akim Demaille <akim@epita.fr>
4339
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.
4343 Add separators.
4344
4345 2005-07-12 Akim Demaille <akim@epita.fr>
4346
4347 * src/parse-gram.y: Use %printer instead of YYPRINT.
4348
4349 2005-07-12 Akim Demaille <akim@epita.fr>
4350
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.
4354
4355 2005-07-12 Akim Demaille <akim@epita.fr>
4356
4357 * data/glr.c (b4_syncline): Fix (swap) the definitions of
4358 b4_at_dollar and b4_dollar_dollar.
4359
4360 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4361
4362 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4363 and Pennello's paper.
4364
4365 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4366
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.
4370
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.
4375
4376 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4377
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
4388 in action.
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
4395 calc++-parser.yy.
4396 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4397
4398 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4399 implied by the other modules.
4400
4401 2005-07-06 Akim Demaille <akim@epita.fr>
4402
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.
4411
4412 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4413
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.
4419
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
4435 exhausted.
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
4444 changed.
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
4449 the initial stack.
4450
4451 2005-07-05 Akim Demaille <akim@epita.fr>
4452
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.
4458
4459 2005-06-24 Akim Demaille <akim@epita.fr>
4460
4461 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4462 class typedefs.
4463
4464 2005-06-22 Akim Demaille <akim@epita.fr>
4465
4466 * doc/bison.texinfo (C++ Language Interface): First stab.
4467 (C++ Parsers): Remove.
4468
4469 2005-06-22 Akim Demaille <akim@epita.fr>
4470
4471 * data/lalr1.cc (yylex_): Honor %lex-param.
4472
4473 2005-06-22 Akim Demaille <akim@epita.fr>
4474
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.
4481
4482 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4483
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.
4487
4488 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4489
4490 * data/glr.c: Modify treatment of unused parameters to permit use
4491 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4492
4493 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4494
4495 Fix infringement on user name space reported by Janos Zoltan Szabo.
4496 * data/yacc.c (yyparse): strlen -> yystrlen.
4497
4498 2005-05-30 Akim Demaille <akim@epita.fr>
4499
4500 * data/lalr1.cc (_): New.
4501 Translate the various messages.
4502
4503 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4504
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.
4513
4514 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4515
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
4518 with %d format.
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.
4523
4524 2005-05-24 Bruno Haible <bruno@clisp.org>
4525
4526 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4527 error message syntax used by gcc-4.0.
4528
4529 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4530
4531 * README: Mention m4 1.4.3. Remove obsolete advice about
4532 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4533
4534 * bootstrap: Remove workaround for problem I encountered with
4535 gettext 0.14.1; it seems to be fixed now.
4536
4537 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4538
4539 * NEWS: Version 2.0a.
4540
4541 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4542 the previous change.
4543
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
4548 its subfiles.
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):
4557 Remove.
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.
4565
4566 * bootstrap: Add stdio-safer, unistd-safer modules.
4567 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4568 we don't need it).
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.
4577
4578 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4579 yesterday's yacc.c fix.
4580
4581 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4582
4583 * data/glr.c, data/lalr1.cc: Update copyright date.
4584
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
4593 end of input ()".
4594
4595 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4596
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.
4601
4602 (struct yyGLRState): Add some comments.
4603 (struct yySemanticOption): Add some comments.
4604 (union yyGLRStackItem): Add comment.
4605
4606 (yymergeOptionSets): Correct this to properly perform the union,
4607 avoiding infinite reported by Michael Rosien.
4608 Update comment.
4609
4610 * tests/glr-regression.at: Add test for GLR merging error reported
4611 by M. Rosien.
4612
4613 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4614
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.
4650
4651 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4652
4653 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4654 Problem reported by Ralf Menzel.
4655
4656 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4657
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
4661 from here....
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.
4666
4667 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4668
4669 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4670
4671 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4672
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
4678 in diagnostics.
4679 * tests/input.at (Torturing the Scanner): Likewise.
4680 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4681
4682 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4683
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.
4687
4688 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4689
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
4694 quotes it for us.
4695 * src/scan-gram.l: Include quotearg.h.
4696 ("\""): Omit quote.
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
4701 in token strings.
4702
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.
4709
4710 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4711
4712 * NEWS: Bison-generated C parsers now use the _ macro to
4713 translate strings.
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.
4719
4720 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4721
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.
4727
4728 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4729
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.
4734
4735 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4736
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.
4741
4742 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4743
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.
4746
4747 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4748
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.
4752
4753 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4754
4755 Respond to problems reported by twlevo@xs4all.nl.
4756
4757 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4758
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.
4762
4763 * data/yacc.c (yyparse): Omit spaces before #line.
4764
4765 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4766
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
4769 Roland McGrath.
4770
4771 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4772
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>.
4780
4781 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4782 not needed.
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.
4787
4788 * src/vcg.c (output_edge): Don't quote linestyle arg.
4789 Problem reported by twlevo@xs4all.nl.
4790
4791 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4792
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.
4796
4797 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4798
4799 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4800 putsym. Typo reported by Sebastian Piping.
4801
4802 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4803
4804 * doc/bison.texinfo (Language and Grammar): some -> same
4805 (Epilogue): int he -> in the
4806 Typos reported by Sebastian Piping via Justin Pence.
4807
4808 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4809
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.
4816
4817 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4818
4819 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4820 wants to redefine G_VIEW.
4821
4822 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4823
4824 * src/vcg.c (get_view_str): Remove case for normal_view.
4825 Problem reported by twlevo@xs4all.nl.
4826
4827 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4828
4829 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4830 Problem reported by twlevo@xs4all.nl.
4831
4832 * doc/bison.texinfo: Change @dircategory from "GNU programming
4833 tools" to "Software development". Requested by Richard Stallman
4834 via Karl Berry.
4835
4836 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4837
4838 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4839 Problem reported by twlevo@xs4all.nl.
4840
4841 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4842
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
4846 twlevo@xs4all.nl.
4847
4848 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4849
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.
4854
4855 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4856
4857 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4858 already. Let config.h define any nonstandard values.
4859
4860 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4861
4862 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4863 for the benefit of slower hosts. Problem reported by
4864 Nelson H. F. Beebe.
4865
4866 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4867
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)".
4872
4873 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4874
4875 * TODO: Mention that we should allow NUL bytes in tokens.
4876
4877 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4880 Problem reported by Hans Aberg.
4881
4882 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4883
4884 * src/getargs.c (version): Happy new year; update overall
4885 program copyright date from 2004 to 2005.
4886
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
4891 is closed.
4892
4893 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4894
4895 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4896 to fix an oversight in the Bison 2.0 manual.
4897
4898 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4899
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.
4904
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.
4909
4910 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4911 for yymsg, too.
4912
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.
4916
4917 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4918
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
4932 to 1.
4933
4934 * doc/bison.texinfo (Location Default Action): Mention that n must
4935 be zero when k is zero. Suggested by Frank Heckenbach.
4936
4937 2004-12-22 Akim Demaille <akim@epita.fr>
4938
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.
4953
4954 2004-12-21 Akim Demaille <akim@epita.fr>
4955
4956 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4957
4958 2004-12-21 Akim Demaille <akim@epita.fr>
4959
4960 Don't impose std::string for filenames.
4961
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
4966 included first.
4967 Forward declare them before the user code.
4968 * tests/Makefile.am (check-local, installcheck-local): Pass
4969 TESTSUITEFLAGS to the TESTSUITE.
4970
4971 2004-12-20 Akim Demaille <akim@epita.fr>
4972
4973 Use more STL like names: my_class instead of MyClass.
4974
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.
4982
4983 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
4984
4985 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4986
4987 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
4988 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4989
4990 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
4991
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.
4995
4996 This change does not affect the generated parsers; that's a different
4997 task, as some users will want to conserve memory there.
4998
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.
5003
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.
5014
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):
5020 Likewise.
5021 * src/tables.c (vector_number, tally, action_number,
5022 ACTION_NUMBER_MINIMUM): Likewise.
5023 * src/output.c (muscle_insert_short_int_table): Remove.
5024
5025 2004-12-17 Akim Demaille <akim@epita.fr>
5026
5027 * data/lalr1.cc: Extensive Doxygenation.
5028 (error_): Rename as...
5029 (error): this, since it is visible to the user.
5030 Adjust callers.
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
5034 Parser::error.
5035 * tests/input.at: Escape $.
5036
5037 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5038
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.
5046
5047 2004-12-16 Akim Demaille <akim@epita.fr>
5048
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.
5052
5053 2004-12-16 Akim Demaille <akim@epita.fr>
5054
5055 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5056 real.
5057
5058 2004-12-16 Akim Demaille <akim@epita.fr>
5059
5060 Use #define to handle the %name-prefix.
5061
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.
5066
5067 2004-12-16 Akim Demaille <akim@epita.fr>
5068
5069 Move lalr1.cc internals into yy*.
5070
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_):
5078 Rename as...
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_):
5087 these.
5088
5089 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5090
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.
5100 All uses changed.
5101 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5102
5103 2004-12-15 Akim Demaille <akim@epita.fr>
5104
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.
5111
5112 2004-12-15 Akim Demaille <akim@epita.fr>
5113
5114 * data/lalr1.cc (lex_): Rename as...
5115 (yylex_): this.
5116 Move the trace here.
5117 Take the %name-prefix into account.
5118 Reported by Alexandre Duret-Lutz.
5119
5120 2004-12-15 Akim Demaille <akim@epita.fr>
5121
5122 Simplify the C++ parser constructor.
5123
5124 * data/lalr1.cc (debug_): Rename as...
5125 (yydebug_): so that the parser's internals are always in the yy*
5126 pseudo namespace.
5127 Adjust uses.
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.
5134
5135 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5136 constructor calls.
5137
5138 2004-12-15 Akim Demaille <akim@epita.fr>
5139
5140 Remove b4_root related material: failure experiment
5141 (which goal was to allow to derive from a class).
5142
5143 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5144 definitions and uses.
5145
5146 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5147
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.
5151
5152 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5153 the default definition of YYLLOC_DEFAULT. Problem reported
5154 by Frank Heckenbach.
5155
5156 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5157
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.
5165 All uses changed.
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
5171 the index is 0.
5172
5173 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5174
5175 * HACKING: Update email addresses to send announcements to.
5176
5177 * configure.ac (AC_INIT): Bump version to 1.875f.
5178
5179 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5180
5181 * NEWS: Version 1.875e.
5182 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5183
5184 * src/scan-skel.l: Include "complain.h", for "fatal".
5185
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,
5190 not int.
5191 * src/relation.c: Likewise.
5192 (top, infinity): Now of type relation_node, not int.
5193 (traverse, relation_transpose): Use relation_node, not int.
5194
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.
5198
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.
5203
5204 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5205
5206 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5207 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5208 unless otherwise specified below.
5209
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
5225 token_translations.
5226 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5227 (token_actions): Likewise for yydefact, actrow, conflrow,
5228 conflict_list.
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.
5233
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.
5237
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):
5246 Likewise.
5247
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.
5251
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]
5257 and end_R[i].
5258 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5259
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.
5262
5263 * src/table.c (table_grow): When conflict_table grew, the grown
5264 area wasn't cleared. Fix this.
5265
5266 * lib/.cvsignore: Add strdup.c, strdup.h.
5267 * m4/.cvsignore: Add strdup.m4.
5268
5269 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5270
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.
5279
5280 2004-11-23 Akim Demaille <akim@epita.fr>
5281
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.
5286
5287 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5288
5289 * bootstrap (gnulib_modules): Add extensions.
5290 Problem reported by Jim Meyering.
5291
5292 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5293
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.
5299
5300 2004-11-17 Akim Demaille <akim@epita.fr>
5301
5302 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5303
5304 2004-11-17 Akim Demaille <akim@epita.fr>,
5305 Alexandre Duret-Lutz <adl@gnu.org>
5306
5307 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5308 changes.
5309 (YYCDEBUG): Adjust.
5310 Use it instead of cdebug_.
5311 (Parser::debug_stream, Parser::set_debug_stream): New.
5312 (Parser::symprint_): Define cdebug_ for temporary backward
5313 compatibility.
5314 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5315 debug_stream ().
5316
5317 2004-11-17 Akim Demaille <akim@epita.fr>
5318
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.
5323
5324 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5325
5326 * data/glr.c (yyloc_default): Remove; not used.
5327 Problem reported by Frank Heckenbach.
5328
5329 2004-10-25 Akim Demaille <akim@epita.fr>
5330
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
5344 line.
5345
5346 2004-10-22 Akim Demaille <akim@epita.fr>
5347 and Paul Eggert <eggert@cs.ucla.edu>
5348
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.
5360
5361 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5362
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>.
5366
5367 2004-10-11 Akim Demaille <akim@epita.fr>
5368
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
5375 value.
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
5381 type_location.
5382 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5383 * tests/input.at (Incompatible Aliases): New.
5384
5385 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5386
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".
5392
5393 2004-10-06 Akim Demaille <akim@epita.fr>
5394
5395 * src/parse-gram.y (add_param): Fix the truncation of trailing
5396 spaces.
5397
5398 2004-10-05 Akim Demaille <akim@epita.fr>
5399
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.
5406
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
5409 stacked symbol.
5410 Adjust uses to make sure the code is triggered on empty
5411 reductions.
5412 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5413 expected output: empty reductions have empty locations.
5414
5415 2004-09-29 Akim Demaille <akim@epita.fr>
5416
5417 * data/lalr1.cc: Move towards a more standard C++ coding style
5418 for templates: Class < T > -> Class<T>.
5419
5420 2004-09-29 Akim Demaille <akim@epita.fr>
5421
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 ->
5425 type* var).
5426
5427 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5428
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.
5431
5432 2004-09-27 Akim Demaille <akim@epita.fr>
5433
5434 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5435
5436 2004-09-27 Akim Demaille <akim@epita.fr>
5437
5438 * data/lalr1.cc (b4_parse_param_decl_1): New.
5439 (b4_parse_param_decl): Use it to have different names between attribute
5440 and argument names.
5441 (b4_cc_constructor_call): Likewise.
5442
5443 2004-09-24 Akim Demaille <akim@epita.fr>
5444
5445 * src/parse-gram.y (add_param): Strip the leading and trailing
5446 blanks from a formal argument declaration.
5447 (YY_LOCATION_PRINT): New.
5448
5449 2004-09-24 Akim Demaille <akim@epita.fr>
5450
5451 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5452 after the location.
5453
5454 2004-09-24 Akim Demaille <akim@epita.fr>
5455
5456 * doc/bison.texinfo (Table of Symbols): Sort.
5457
5458 2004-09-21 Akim Demaille <akim@epita.fr>
5459
5460 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5461 the useless parentheses.
5462 Suggested by Paul Eggert.
5463
5464 2004-09-20 Akim Demaille <akim@epita.fr>
5465
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.
5469
5470 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5471 example.
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
5479 look-ahead.
5480 Push them in the stacks.
5481 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5482
5483 2004-09-20 Akim Demaille <akim@epita.fr>
5484
5485 * doc/bison.texinfo (Initial Action Decl): New.
5486
5487 2004-09-20 Akim Demaille <akim@epita.fr>
5488
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
5493 location.
5494 yylloc is not always available.
5495 * data/glr.c: Likewise.
5496 Also, honor initial-actions.
5497
5498 2004-09-20 Akim Demaille <akim@epita.fr>
5499
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.
5519
5520 * src/scan-skel.l: Instead of abort, report error messages to ease
5521 understanding skeleton scanning failures.
5522
5523 2004-09-16 Akim Demaille <akim@epita.fr>
5524
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
5530 from yacc.c.
5531 We should probably use vector here though.
5532
5533 2004-09-16 Akim Demaille <akim@epita.fr>
5534
5535 Have more complete shift traces.
5536
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.
5547
5548 2004-09-08 Akim Demaille <akim@epita.fr>
5549
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
5562 string.
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.
5573
5574 2004-09-06 Akim Demaille <akim@epita.fr>
5575
5576 * data/lalr1.cc: Adjust the indentation of the labels.
5577 (Parser::pop): New.
5578 Use it.
5579
5580 2004-09-06 Akim Demaille <akim@epita.fr>
5581
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
5589 hand".
5590
5591 2004-09-03 Akim Demaille <akim@epita.fr>
5592
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.
5599
5600 2004-09-02 Akim Demaille <akim@epita.fr>
5601
5602 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5603
5604 2004-09-02 Akim Demaille <akim@epita.fr>
5605
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
5610 two.
5611 Use it instead of direct symprint_ calls.
5612 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5613 one.
5614
5615 2004-09-02 Akim Demaille <akim@epita.fr>
5616
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
5620 hand.
5621 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5622 %printer calls to use cdebug_ when using lalr1.cc.
5623
5624 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5625
5626 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5627 with #ifdef YYDEBUG.
5628
5629 2004-08-26 Akim Demaille <akim@epita.fr>
5630
5631 * doc/bison.texinfo (Implementing Loops): Rename as...
5632 (Implementing Gotos/Loops): this.
5633
5634 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5635
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.
5644
5645 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5646
5647 * src/scan-action.l: Remove. Scanning of semantic actions is
5648 handled in scan-gram.l.
5649
5650 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5651
5652 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5653
5654 * src/location.h (struct): The file member is a uniqstr.
5655 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5656
5657 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5658
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>.
5662
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.
5675
5676 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5677
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
5681 respect to".
5682
5683 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5684
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.
5689
5690 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
5691
5692 * doc/bison.texinfo (Simple GLR Parsers): New section.
5693
5694 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5695
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
5707 report_lookaheads.
5708 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5709 compute_lookaheads.
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.
5718
5719 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5720
5721 * README: Update location of patched M4 distribution.
5722
5723 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5724
5725 Don't assume the C++ compiler takes the same arguments as the C compiler
5726 (trivial change).
5727 * configure.ac (O0CXXFLAGS): New var.
5728 * tests/atlocal.in (CXXFLAGS): Use it.
5729
5730 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5731
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
5735
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.
5742
5743 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5744
5745 * tests/calc.at, tests/actions.at: Workaround for SGI
5746 C++ compiler. (trivial change)
5747
5748 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5749
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
5756 to change this.
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
5761 currently needed.
5762
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>.
5766
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).
5769
5770 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5771
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.
5775
5776 * doc/bison.texinfo (Decl Summary): Also mention that %union
5777 can depend on prerequisite types. Problem reported by Tim
5778 Van Holder.
5779
5780 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5781
5782 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5783 * README-alpha: Don't tell people not to package this.
5784
5785 * bootstrap: Don't assume $(...) works; use `...` instead.
5786 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5787 gettext better.
5788
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
5791 defined as a macro.
5792
5793 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5794
5795 Undo change made earlier today: it caused autopoint to not bring
5796 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5797 autopoint's.
5798
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.
5803
5804 The gettext version checking is causing more trouble than it's
5805 curing; remove it. Problem reported by Paul Hilfinger.
5806
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.
5810
5811 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5812
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
5817
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.
5822
5823 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5824
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>.
5829
5830 * configure.ac (AC_INIT): Update to 1.875e.
5831
5832 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5833
5834 * NEWS: Version 1.875d.
5835 * configure.ac (AC_INIT): Likewise.
5836 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5837
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.
5844
5845 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5846
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.
5852
5853 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5854
5855 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5856
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
5864 actions.
5865
5866 * NEWS: Document %expect-rr.
5867
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.
5872
5873 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5874 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5875 strtoul.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.
5882
5883 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5884 gets copied to the output file.
5885
5886 2004-04-28 Paul Eggert <eggert@twinsun.com>
5887
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
5890 and Automake.
5891
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.
5897
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
5902 does this for us.
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
5920 for us.
5921
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
5926 for us.
5927 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5928 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5929
5930 * src/files.c: Include gnulib's xstrndup.h.
5931
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.
5936 Include <stpcpy.h>.
5937
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.
5961
5962 * po/ChangeLog: Remove: all but one entry was a duplicate
5963 of this file, and I moved that 2000-11-02 entry here.
5964
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,
5976 xstrndup.h.
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.
5983
5984
5985 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
5986 support it. (The latest stable gzip doesn't.)
5987
5988 2004-04-27 Paul Eggert <eggert@twinsun.com>
5989
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
5992 change.
5993
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
6001 unconditionally.
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
6008 unconditionally.
6009
6010 * src/complain.c (_): Remove useless defn, as system.h defines this.
6011
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.
6017
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.
6023
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
6026 unused declaration.
6027
6028 * tests/synclines.at (%union synch line): Put a dummy member in
6029 the union, because empty unions aren't allowed in C. Caught
6030 by GCC 3.4.0.
6031
6032 2004-04-13 Jim Meyering <jim@meyering.net>
6033
6034 * src/conflicts.c (conflicts_print): Correct format string typo:
6035 use `%%' to produce literal `%'. (trivial change)
6036
6037 2004-03-30 Paul Eggert <eggert@twinsun.com>
6038
6039 * src/getargs.c (version): Update copyright year to 2004.
6040
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+=):
6048 Likewise.
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):
6059 Likewise.
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.
6074
6075 * src/output.c (muscle_insert_short_int_table): Renamed from
6076 muscle_insert_short_table. All uses changed.
6077
6078 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6079
6080 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6081 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6082 Add %expect-rr rule.
6083
6084 * src/scan-gram.l: Recognize %expect-rr.
6085
6086 * src/conflicts.h (expected_sr_conflicts): Rename from
6087 expected_conflicts.
6088 (expected_rr_conflicts): Declare.
6089
6090 * src/conflicts.c (expected_sr_conflicts): Rename from
6091 expected_conflicts.
6092 (expected_rr_conflicts): Define.
6093 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6094 for GLR parsers.
6095 Use expected_sr_conflicts in place of expected_conflicts.
6096 Warn if expected_rr_conflicts used in non-GLR parser.
6097
6098 * doc/bison.texinfo: Add documentation for %expect-rr.
6099
6100 2004-03-08 Paul Eggert <eggert@gnu.org>
6101
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>.
6104
6105 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6106 in lalr1.cc.
6107 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6108 * src/scan-gram.l (scan_integer): New function.
6109 ({int}): Use it.
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.
6114
6115 2004-02-25 Paul Eggert <eggert@twinsun.com>
6116
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>.
6121
6122 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6123
6124 Support %destructor and merge error locations in lalr1.cc.
6125
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.
6139
6140 2004-02-02 Paul Eggert <eggert@twinsun.com>
6141
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
6146 for us.
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.
6150
6151 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6152
6153 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6154 (yyreportSyntaxError): Handle case where lookahead token is
6155 YYEMPTY.
6156
6157 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6158
6159 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6160 resulting parsers are compilable with C++.
6161
6162 2003-12-23 Paul Eggert <eggert@twinsun.com>
6163
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.
6169
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
6173 including it.
6174 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6175 multiple inclusion warnings.
6176
6177 2003-12-02 Akim Demaille <akim@epita.fr>
6178
6179 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6180 conditions.
6181 From Bruno Haible.
6182
6183 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6184
6185 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6186
6187 2003-10-07 Paul Eggert <eggert@twinsun.com>
6188
6189 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6190 if testsuite doesn't exist.
6191
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.
6196
6197 2003-10-05 Paul Eggert <eggert@twinsun.com>
6198
6199 * NEWS: Don't document %no-default-prec, as it's still
6200 too experimental.
6201 * doc/bison.texinfo: Document %no-default-prec only if
6202 the defaultprec flag is set. Normally it's not.
6203
6204 2003-10-04 Paul Eggert <eggert@twinsun.com>
6205
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.
6211
6212 2003-10-01 Paul Eggert <eggert@twinsun.com>
6213
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.
6219
6220 2003-10-01 Akim Demaille <akim@epita.fr>
6221
6222 VCG no longer supports long_straight_phase.
6223
6224 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6225 * src/print_graph.c (print_graph): Adjust.
6226
6227 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
6228 and Paul Eggert <eggert@twinsun.com>
6229
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.
6240
6241 2003-09-30 Paul Eggert <eggert@twinsun.com>
6242
6243 * tests/testsuite.at: Include local.at, not input.at, fixing
6244 a typo in the 2003-08-25 patch.
6245
6246 2003-08-27 Akim Demaille <akim@epita.fr>
6247
6248 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6249 GCC warnings.
6250
6251 2003-08-26 Akim Demaille <akim@epita.fr>
6252
6253 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6254 "<\#" to avoid magic from Gnus when posting parts of this script.
6255
6256 2003-08-26 Akim Demaille <akim@epita.fr>
6257
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.
6262
6263 2003-08-25 Akim Demaille <akim@epita.fr>
6264
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.
6269
6270 2003-08-25 Akim Demaille <akim@epita.fr>
6271
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.
6277
6278 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6279 with...
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
6284 not to use it.
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.
6288
6289 2003-08-25 Akim Demaille <akim@epita.fr>
6290
6291 * doc/bison.texinfo: Don't promote stdout for error messages.
6292
6293 2003-08-25 Akim Demaille <akim@epita.fr>
6294
6295 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6296 From Alexandre Duret-Lutz.
6297
6298 2003-08-25 Akim Demaille <akim@epita.fr>
6299
6300 Version 1.875c.
6301
6302 2003-08-25 Akim Demaille <akim@epita.fr>
6303
6304 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6305 Use them.
6306
6307 2003-08-25 Akim Demaille <akim@epita.fr>
6308
6309 * data/lalr1.cc (Parser::reduce_print_): New.
6310 Use it.
6311
6312 2003-08-25 Akim Demaille <akim@epita.fr>
6313
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.
6319
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
6331 fail.
6332
6333 2003-08-25 Akim Demaille <akim@epita.fr>
6334
6335 Tune local.at so that people can "autom4te -l autotest calc.at -o
6336 calc" for instance, to extract a sub test suite.
6337
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
6342 2.57.
6343 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6344 be ignore.
6345
6346 2003-08-04 Paul Eggert <eggert@twinsun.com>
6347
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.
6352
6353 2003-07-26 Paul Eggert <eggert@twinsun.com>
6354
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.
6360
6361 2003-07-25 Paul Eggert <eggert@twinsun.com>
6362
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.
6369
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.
6377
6378 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6379
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>
6383 (trivial change)
6384
6385 2003-06-25 Akim Demaille <akim@epita.fr>
6386
6387 * config/depcomp, config/install-sh: Update from masters.
6388
6389 2003-06-20 Paul Eggert <eggert@twinsun.com>
6390
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.
6398
6399 2003-06-19 Paul Eggert <eggert@twinsun.com>
6400
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>.
6406
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
6410 to the C standard.
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.
6414
6415 2003-06-17 Paul Eggert <eggert@twinsun.com>
6416
6417 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6418 avoid warnings from picky compilers about redefinition of PARAMS.
6419
6420 2003-06-17 Paul Eggert <eggert@twinsun.com>
6421
6422 Version 1.875b.
6423
6424 * NEWS: Document 1.875b.
6425
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.
6442
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.
6448
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
6455 from libbitset.
6456
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.
6460
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.
6467
6468 * lib/.cvsignore: Add stdbool.h.
6469 * m4/.cvsignore: Add nls.m4, po.m4.
6470
6471 Upgrade to CVS gnulib.
6472 * stdbool_.h: File renamed from stdbool.h.in.
6473 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6474 AC_HEADER_STDBOOL.
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.
6485
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.
6491
6492 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6493
6494 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6495 first.
6496 (yyrecoverSyntaxError): Correct the logic for setting and testing
6497 yyerrState.
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).
6501
6502 Fixes to avoid problem that $-N rules in GLR parsers can cause
6503 buffer overruns, corrupting state.
6504
6505 * src/output.c (prepare_rules): Output max_left_semantic_context
6506 definition.
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.
6513
6514 Fixes to problems with location handling in GLR parsers reported by
6515 Frank Heckenbach (2003/06/05).
6516
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
6520 locations not used.
6521 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6522 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
6523
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
6533 in value.
6534
6535 2003-06-03 Paul Eggert <eggert@twinsun.com>
6536
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.
6551
6552 2003-06-02 Paul Eggert <eggert@twinsun.com>
6553
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.
6557
6558 2003-06-01 Paul Eggert <eggert@twinsun.com>
6559
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.
6568
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.
6578
6579 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6580 as possibly unused.
6581 (yyfill): New function.
6582 (YYFILL): Use it.
6583 (yyuserAction): Change type of yynormal to bool, so that it matches
6584 the new yyfill signature. Mark it as possibly unused.
6585
6586
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>
6592
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
6609 existing test.
6610
6611 2003-05-24 Paul Eggert <eggert@twinsun.com>
6612
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
6617 -ansi -Wall -gall).
6618 * data/yacc.c (union yyalloc): Likewise.
6619 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
6620
6621 Switch from 'int' to 'bool' where that makes sense.
6622
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,
6652 or_and_cmp).
6653 * src/conflicts.c (count_rr_conflicts): Likewise.
6654 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6655 All uses changed.
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.
6681
6682 * config/install-sh: Sync from automake 1.7.5.
6683
6684 2003-05-14 Paul Eggert <eggert@twinsun.com>
6685
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
6693 grammar.
6694
6695 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6696
6697 %parse-param support for lalr1.cc.
6698
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
6702 definitions.
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++.
6710
6711 2003-05-12 Paul Eggert <eggert@twinsun.com>
6712
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.
6718
6719 2003-05-05 Paul Eggert <eggert@twinsun.com>
6720
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>.
6725
6726 2003-05-03 Paul Eggert <eggert@twinsun.com>
6727
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>.
6732
6733 2003-04-29 Akim Demaille <akim@epita.fr>
6734
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.
6744
6745 2003-04-29 Akim Demaille <akim@epita.fr>
6746
6747 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6748
6749 2003-04-29 Akim Demaille <akim@epita.fr>
6750
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
6753 Markovitch below.
6754
6755 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6756
6757 * data/yacc.c: (b4_lex_param): Corrected for the case where
6758 %lex-param is provided and %pure-parser isn't.
6759
6760 2003-04-27 Paul Eggert <eggert@twinsun.com>
6761
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.
6767
6768 2003-04-26 Paul Eggert <eggert@twinsun.com>
6769
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>.
6776
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>.
6782
6783 2003-04-21 Paul Eggert <eggert@twinsun.com>
6784
6785 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6786 to gnulib.
6787
6788 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6789
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)
6793
6794 2003-04-17 Paul Eggert <eggert@twinsun.com>
6795
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.
6804
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>.
6809
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.
6813
6814 * tests/existing.at (GNU pic Grammar): New test case, taken from
6815 Lemberg's email.
6816
6817 2003-03-31 Akim Demaille <akim@epita.fr>
6818
6819 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6820
6821 2003-03-31 Akim Demaille <akim@epita.fr>
6822
6823 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6824 output.
6825
6826 2003-03-31 Akim Demaille <akim@epita.fr>
6827
6828 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6829 From Paul Hilfinger.
6830
6831 2003-03-29 Akim Demaille <akim@epita.fr>
6832
6833 * m4/error.m4: Do not put under dynamic conditions some code which
6834 expansion is under static control.
6835
6836 2003-03-29 Akim Demaille <akim@epita.fr>
6837
6838 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6839
6840 2003-03-29 Akim Demaille <akim@epita.fr>
6841
6842 * doc/bison.texinfo (Strings are Destroyed): New.
6843
6844 2003-03-13 Paul Eggert <eggert@twinsun.com>
6845
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.
6850
6851 2003-03-12 Paul Eggert <eggert@twinsun.com>
6852
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.
6860
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>.
6866
6867 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6868 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6869 AC_HEADER_SYS_WAIT.
6870
6871 Merge changes from gnulib. This was prompted because the CVS
6872 snapshot didn't build on Solaris 7 due to strnlen problems.
6873
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}
6881
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
6889 above.
6890
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
6893 gnulib sources.
6894
6895 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6896 Add.
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.
6910
6911 * src/system.h: Include <stdbool.h> unconditionally.
6912
6913 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6914 assuming at least C89 in the bitset code for some time now.
6915
6916 2003-03-03 Akim Demaille <akim@epita.fr>
6917
6918 * ro.po: New.
6919
6920 2003-03-02 Akim Demaille <akim@epita.fr>
6921
6922 * doc/bison.texinfo (Table of Symbols): Reactivate the
6923 documentation for %lex-param, and %parse-param.
6924
6925 2003-03-02 Akim Demaille <akim@epita.fr>
6926
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.
6931
6932 2003-03-02 Akim Demaille <akim@epita.fr>
6933
6934 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6935 message.
6936
6937 2003-03-02 Akim Demaille <akim@epita.fr>
6938
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.
6942
6943 2003-03-02 Akim Demaille <akim@epita.fr>
6944
6945 Create tests/local.at for Bison generic testing macros.
6946
6947 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6948 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6949 This new file.
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.
6956
6957 2003-03-01 Paul Eggert <eggert@twinsun.com>
6958
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.
6967
6968 2003-03-01 Akim Demaille <akim@epita.fr>
6969
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.
6974
6975 2003-02-28 Paul Eggert <eggert@twinsun.com>
6976
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>.
6980
6981 2003-02-26 Paul Eggert <eggert@twinsun.com>
6982
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.
6988
6989 2003-02-24 Paul Eggert <eggert@twinsun.com>
6990
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.
6997
6998 * config/depcomp: Sync with Automake 1.7.3.
6999
7000 2003-02-21 Akim Demaille <akim@epita.fr>
7001
7002 * data/lalr1.cc: Use temporary variables instead of casts to
7003 change integer types.
7004 Suggested by Paul Eggert.
7005
7006 2003-02-21 Akim Demaille <akim@epita.fr>
7007
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.
7011
7012 2003-02-20 Akim Demaille <akim@epita.fr>
7013
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
7017 operator<<.
7018 Use "last" so that we subtract from Positions, not from unsigned.
7019
7020 2003-02-20 Akim Demaille <akim@epita.fr>
7021
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.
7027
7028 2003-02-20 Akim Demaille <akim@epita.fr>
7029
7030 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7031 AT_YACC_IF.
7032 Redefine AT_YYERROR_SEES_LOC_IF using it.
7033 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7034 not defined.
7035 Don't use the location in yy::Parser::error_ and
7036 yy::Parser::print_ when not %locations.
7037 Activate more lalr1.cc tests.
7038
7039 2003-02-19 Akim Demaille <akim@epita.fr>
7040
7041 * data/lalr1.cc: When displaying a line number, be sure to make it
7042 an int.
7043
7044 2003-02-19 Akim Demaille <akim@epita.fr>
7045
7046 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7047 Remove, useless.
7048 (YYABORT, YYACCEPT, YYERROR): New.
7049 * tests/calc.at: Renable the lalr1.cc test.
7050
7051 2003-02-19 Akim Demaille <akim@epita.fr>
7052
7053 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7054 error recovery, mixing with/without pops and discarding of the
7055 lookahead.
7056 Exercise YYERROR.
7057 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7058
7059 2003-02-17 Paul Eggert <eggert@twinsun.com>
7060
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>.
7065
7066 2003-02-12 Paul Eggert <eggert@twinsun.com>
7067
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.
7074
7075 The bug still remains in data/lalr1.cc, as I didn't have time
7076 to fix it there.
7077
7078 2003-02-06 Akim Demaille <akim@epita.fr>
7079
7080 * configure.ac (GXX): Rename as...
7081 (CXX): this, to keep the original Autoconf semantics.
7082 Require 2.57.
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
7092 iterator names.
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
7099 lalr1.cc is used.
7100 Adjust the C locations to match those from Emacs: first column is
7101 column 0.
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)
7110 New macros.
7111 (AT_CHECK_POPDEFS): Undefine them.
7112 (AT_CHECK_CALC_LALR1_CC): New.
7113 Use it for the first lalr1.cc test.
7114
7115 2003-02-04 Akim Demaille <akim@epita.fr>
7116
7117 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7118 Location as is defined.
7119
7120 2003-02-04 Akim Demaille <akim@epita.fr>
7121
7122 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7123 name_ being defined.
7124
7125 2003-02-03 Paul Eggert <eggert@twinsun.com>
7126
7127 * src/gram.h (start_symbol): Remove unused decl.
7128
7129 Use more-consistent naming conventions for local vars.
7130
7131 * src/derives.c (derives_compute): Change type of local var from
7132 int to rule_number.
7133 * src/gram.c (grammar_rules_partial_print): Likewise.
7134 * src/print.c (print_core): Likewise.
7135 * src/reduce.c (reduce_grammar_tables): Likewise.
7136
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.
7140
7141 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7142
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):
7147 Likewise.
7148 * src/state.c (transitions_to): Likewise.
7149 * src/state.h: Likewise.
7150 * src/tables.c (symbol_number_to_vector_number): Likewise.
7151
7152 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7153 char * var.
7154
7155 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7156 var.
7157
7158 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7159 var.
7160
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.
7164
7165 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7166 char * var.
7167 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7168 uniqstr var.
7169 * src/uniqstr.h: Likewise.
7170
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.
7177
7178 2003-02-02 Akim Demaille <akim@epita.fr>
7179
7180 * src/scan-skel.l: Scan more than one inert character per yylex
7181 invocation.
7182
7183 2003-02-01 Paul Eggert <eggert@twinsun.com>
7184
7185 Version 1.875a.
7186
7187 * po/LINGUAS: Add ms.
7188
7189 2003-01-30 Akim Demaille <akim@epita.fr>
7190
7191 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7192
7193 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7194
7195 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7196 of $1.
7197
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>.
7201
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
7205 incrementally.
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
7209 as needed.
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.
7217 (yydoAction): Ditto
7218
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.
7225
7226 2003-01-28 Paul Eggert <eggert@twinsun.com>
7227
7228 * data/lalr1.cc: Do not use @output_header_name@ unless
7229 b4_defines_flag is set. This fixes two bugs reported by
7230 Tim Van Holder in
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>.
7233
7234 2003-01-21 Paul Eggert <eggert@twinsun.com>
7235
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
7241 should vanish.
7242 (yyerrlab1): Move code to YERROR.
7243 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7244 This reverts some of the 2002-12-27 change.
7245
7246 2003-01-17 Paul Eggert <eggert@twinsun.com>
7247
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>.
7251
7252 2003-01-13 Akim Demaille <akim@epita.fr>,
7253 Quoc Peyrot <chojin@lrde.epita.fr>,
7254 Robert Anisko <anisko_r@lrde.epita.fr>
7255
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.
7262
7263 2003-01-11 Paul Eggert <eggert@twinsun.com>
7264
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).
7275
7276 * src/getargs.c (version): Update copyright year.
7277
7278 2003-01-09 Akim Demaille <akim@epita.fr>
7279
7280 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7281
7282 2003-01-08 Paul Eggert <eggert@twinsun.com>
7283
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.
7288
7289 2003-01-06 Paul Eggert <eggert@twinsun.com>
7290
7291 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7292 the GLR paper of Scott, Johnstone and Hussain.
7293
7294 2003-01-04 Paul Eggert <eggert@twinsun.com>
7295
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.
7302
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.
7306
7307 2003-01-03 Paul Eggert <eggert@twinsun.com>
7308
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.
7313
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.
7317
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.
7323
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).
7327
7328 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7329 Reported by Nelson H. F. Beebe.
7330
7331 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7332
7333 2003-01-02 Paul Eggert <eggert@twinsun.com>
7334
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.
7338
7339 2003-01-01 Paul Eggert <eggert@twinsun.com>
7340
7341 * Version 1.875.
7342
7343 2002-12-30 Paul Eggert <eggert@twinsun.com>
7344
7345 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7346 Moved here from...
7347 (<INITIAL>","): Here. This causes stray "," to be treated
7348 more uniformly.
7349
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
7353 src/reader.c.
7354
7355 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7356 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7357
7358 2002-12-28 Paul Eggert <eggert@twinsun.com>
7359
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
7362 Thomas Olsson.
7363
7364 2002-12-28 Paul Eggert <eggert@twinsun.com>
7365
7366 Version 1.75f.
7367
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
7376 all languages.
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.
7386
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.
7391
7392 2002-12-27 Paul Eggert <eggert@twinsun.com>
7393
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>.
7397
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.
7414
7415 2002-12-26 Paul Eggert <eggert@twinsun.com>
7416
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..
7421
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.
7427
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 ".".
7430
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
7438 that name.
7439
7440 2002-12-25 Paul Eggert <eggert@twinsun.com>
7441
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".
7447
7448 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7449 with -g option.
7450
7451 * src/parse-gram.y (declaration): Use enum "report_states" rather
7452 than its numeric value 1.
7453
7454 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7455 opening a new one. This fixes Debian bug 165349, reported by
7456 Bruce Stephens.
7457
7458 2002-12-24 Paul Eggert <eggert@twinsun.com>
7459
7460 Version 1.75e.
7461
7462 * Makefile.maint (cvs-update): Don't assume that the shell
7463 supports $(...), as Solaris sh doesn't.
7464
7465 * src/parse-gram.y (lloc_default): Remove test for empty
7466 nonterminals at the end, since it didn't change the result.
7467
7468 2002-12-24 Paul Eggert <eggert@twinsun.com>
7469
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.
7473
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'.
7480
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.
7484
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.
7493
7494 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7495 does not specify a union tag. This is for compatibility with
7496 Solaris 9 yacc.
7497
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.
7508
7509 * src/reader.h (braced_code, current_braced_code): Remove.
7510 (token_name): New decl.
7511
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.
7529
7530 * NEWS, doc/bison.texinfo: Document the above.
7531 * NEWS: Fix years and program names in copyright notice.
7532
7533 2002-12-17 Paul Eggert <eggert@twinsun.com>
7534
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.
7538
7539 2002-12-15 Paul Eggert <eggert@twinsun.com>
7540
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.
7546
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
7552 that sets yychar.
7553
7554 2002-12-13 Paul Eggert <eggert@twinsun.com>
7555
7556 Version 1.75d.
7557
7558 POSIX requires a "yacc" command.
7559 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7560 (MOSTLYCLEANFILES): Add yacc.
7561 (yacc): New rule.
7562 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
7563 as an alias for bison y.
7564
7565 * po/LINGUAS: Add da.
7566
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.
7570
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
7575 gnulib.
7576 * config/install-sh: Sync with autotools.
7577
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.
7584
7585 2002-12-12 Paul Eggert <eggert@twinsun.com>
7586
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.
7590
7591 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7592
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
7600
7601 * src/derives.c (derives_compute): Do not bother invoking
7602 int_of_rule_number, since rule numbers are integers.
7603
7604 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7605 rather than XMALLOC (char, N).
7606
7607 * src/files.c (filename_split): Rewrite to avoid cast.
7608
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.
7616
7617 * src/gram.h (int_of_rule_number): Remove; no longer used.
7618
7619 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7620 since the resulting storage is always stored into.
7621
7622 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7623 where it's needed.
7624
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):
7631 Likewise.
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):
7646 Likewise.
7647 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7648
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.
7654
7655 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7656 local var instead of casting to unsigned char, to avoid casts.
7657
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
7662 too much storage.
7663 (state_new): Initialize all members.
7664
7665 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7666
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.
7671
7672 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7673 (symbol_processor): Remove.
7674 (symbols_do): Remove decl; now static.
7675
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
7682 new macros.
7683
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.
7689
7690 * src/vcg.h: Correct misspellings.
7691
7692 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7693
7694
7695 * src/getargs.c (getargs): Don't assume EOF == -1.
7696
7697 2002-12-09 Paul Eggert <eggert@twinsun.com>
7698
7699 Change identifier spellings to avoid collisions with names
7700 that are reserved by POSIX.
7701
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.
7781
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,
7786 get-errno.c.
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
7790 instead of errno.
7791 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7792 Likewise.
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.
7797
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.
7815
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):
7819 Remove; unused.
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.
7829
7830
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
7834 G_NODE_ALIGNEMENT.
7835
7836
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.
7841
7842
7843 Sort include-file uses.
7844
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".
7852
7853 2002-12-08 Paul Eggert <eggert@twinsun.com>
7854
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>.
7861
7862 2002-12-06 Paul Eggert <eggert@twinsun.com>
7863
7864 Add support for rules that do not have trailing semicolons, as
7865 POSIX requires. Improve the quality of locations in Bison
7866 diagnostics.
7867
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.
7888 (rules): Use it.
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
7898 rolling our own.
7899 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7900 of *loc.
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,
7911 not the location.
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
7919 a subsequent colon.
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.
7938
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.
7942
7943 2002-12-06 Paul Eggert <eggert@twinsun.com>
7944
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.
7948
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.
7952
7953 2002-12-02 Paul Eggert <eggert@twinsun.com>
7954
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>.
7959
7960 2002-11-30 Paul Eggert <eggert@twinsun.com>
7961
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.
7965
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.
7971
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.
7976
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,
7981 for consistency.
7982
7983 2002-11-29 Paul Eggert <eggert@twinsun.com>
7984
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
7990 returns "int".
7991
7992 %parse-param and %lex-param now take just one argument, the
7993 declaration; the argument name is deduced from the declaration.
7994
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.
7998 (COMMA): Remove.
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.
8003
8004 2002-11-27 Paul Eggert <eggert@twinsun.com>
8005
8006 Rename identifiers to avoid real and potential collisions.
8007
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.
8014 All uses changed.
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.
8027
8028 * src/parse-gram.y (gram_error): loc is now const *.
8029 * src/reader.h (gram_error): Likewise.
8030
8031 2002-11-24 Paul Eggert <eggert@twinsun.com>
8032
8033 Version 1.75c.
8034
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.
8041
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.
8045
8046 * lib/error.c: Sync with gnulib.
8047
8048 2002-11-22 Paul Eggert <eggert@twinsun.com>
8049
8050 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8051 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8052 * lib/xmalloc.c: Likewise.
8053
8054 2002-11-20 Paul Eggert <eggert@twinsun.com>
8055
8056 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8057
8058 2002-11-20 Paul Eggert <eggert@twinsun.com>
8059
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.
8063
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.
8069
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.
8088
8089 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8090 (ARGMATCH_CONSTRAINT): New macro.
8091 (ARGMATCH_ASSERT): Use it.
8092
8093 * src/system.h (verify): New macro.
8094 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8095 rather than assert.
8096 * src/tables.c (tables_generate): Likewise.
8097
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.
8102
8103 2002-11-18 Paul Eggert <eggert@twinsun.com>
8104
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>.
8109
8110 2002-11-18 Akim Demaille <akim@epita.fr>
8111
8112 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8113 space.
8114 From Tim Van Holder.
8115
8116 2002-11-17 Paul Eggert <eggert@twinsun.com>
8117
8118 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8119 to "SyntaxError" for consistency with my 2002-11-15 change.
8120
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
8125 {} if needed.
8126 (yyhasResolvedValue): Remove unused function.
8127 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8128 loop body.
8129 (yyreportSyntaxError): Renamed from yyreportParseError.
8130 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8131 All uses changed.
8132 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8133 extern when possible. Remove unused initializations.
8134
8135 2002-11-16 Akim Demaille <akim@epita.fr>
8136
8137 Augment the similarity between GLR and LALR traces.
8138
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
8143 YYDPRINT here.
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.
8147
8148 2002-11-16 Akim Demaille <akim@epita.fr>
8149
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.
8155 (QPUTS): New.
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'.
8162
8163 2002-11-16 Akim Demaille <akim@epita.fr>
8164
8165 Make the ``Printers and Destructors'' test more verbose, taking
8166 `yacc.c''s behavior as (possibly wrong) reference.
8167
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.
8172
8173 2002-11-16 Paul Eggert <eggert@twinsun.com>
8174
8175 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8176
8177 2002-11-15 Paul Eggert <eggert@twinsun.com>
8178
8179 * tests/actions.at (Actions after errors): New test case.
8180
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.
8188
8189 2002-11-15 Akim Demaille <akim@epita.fr>
8190
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.
8198
8199 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8200
8201 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8202 definition; avoids potential autoreconf problems.
8203
8204 2002-11-15 Akim Demaille <akim@epita.fr>
8205
8206 Always check the value returned by yyparse.
8207
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.
8211 Adjust calls.
8212 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8213 returned by yyparse.
8214
8215 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8216
8217 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8218 on input.at test.
8219
8220 2002-11-14 Paul Eggert <eggert@twinsun.com>
8221
8222 * src/output.c (output_skeleton): Call xfopen instead of
8223 duplicating xfopen's body.
8224
8225 Fix bugs reported by Nelson H. F. Beebe in
8226 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
8227
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.
8232
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.
8238
8239 2002-11-14 Akim Demaille <akim@epita.fr>
8240
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.
8245
8246 2002-11-14 Akim Demaille <akim@epita.fr>
8247
8248 * tests/atlocal.in (CPPFLAGS): We have config.h.
8249 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8250 New.
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'.
8258
8259 2002-11-14 Akim Demaille <akim@epita.fr>
8260
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.
8265
8266 2002-11-13 Paul Eggert <eggert@twinsun.com>
8267
8268 Fix some bugs reported by Albert Chin-A-Young in
8269 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
8270
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.
8275
8276 * tests/input.at (Torturing the Scanner): Remove lines containing
8277 solitary backslashes, as they tickle a bug in the HP C compiler.
8278
8279 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8280 comments, since they're not portable. Use GNU coding style.
8281
8282 2002-11-13 Akim Demaille <akim@epita.fr>
8283
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.
8288 Use it.
8289
8290 2002-11-12 Paul Eggert <eggert@twinsun.com>
8291
8292 Version 1.75b.
8293
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>.
8299
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.
8304
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>.
8309
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
8315 N_ and _.
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.
8320
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.
8324
8325 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8326
8327 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8328 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8329 linker.
8330
8331 2002-11-12 Akim Demaille <akim@epita.fr>
8332
8333 * Makefile.maint: Sync with Autoconf:
8334 (local_updates): New.
8335
8336 2002-11-12 Akim Demaille <akim@epita.fr>
8337
8338 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8339
8340 2002-11-12 Akim Demaille <akim@epita.fr>
8341
8342 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8343 locations.
8344
8345 2002-11-12 Akim Demaille <akim@epita.fr>
8346
8347 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8348 not yyvalue.
8349
8350 2002-11-12 Akim Demaille <akim@epita.fr>
8351
8352 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8353 Use it to test the GLR parser.
8354
8355 2002-11-12 Akim Demaille <akim@epita.fr>
8356
8357 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8358 defines it.
8359 * data/glr.c (yystos): New.
8360 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8361 (YYDSYMPRINT): New.
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
8368 yacc.c.
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.
8373
8374 2002-11-12 Akim Demaille <akim@epita.fr>
8375
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.
8385
8386 2002-11-12 Akim Demaille <akim@epita.fr>
8387
8388 * doc/bison.texinfo (Destructor Decl): New.
8389
8390 2002-11-12 Akim Demaille <akim@epita.fr>
8391
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
8399 the file name.
8400
8401 2002-11-12 Akim Demaille <akim@epita.fr>
8402
8403 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8404 Restore.
8405 * src/scan-gram.l (last_string): Is global to the file, not to
8406 yylex.
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.
8412
8413 2002-11-12 Akim Demaille <akim@epita.fr>
8414
8415 * src/getargs.c (long_options): Remove duplicates.
8416 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8417 Remove.
8418 * doc/bison.rnh: Remove.
8419 * doc/bison.texinfo (VMS Invocation): Remove.
8420
8421 2002-11-12 Akim Demaille <akim@epita.fr>
8422
8423 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8424 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8425
8426 Use struniq for symbols.
8427
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):
8437 Returns a strniq.
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.
8443
8444 Use struniq for file names.
8445
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
8453 file names.
8454 Don't free the input file name.
8455
8456 2002-11-12 Akim Demaille <akim@epita.fr>
8457
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.
8464 (yyprint): Adjust.
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.
8468
8469 2002-11-11 Paul Eggert <eggert@twinsun.com>
8470
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>
8475
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.
8482
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.
8487
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
8492 names.
8493 * data/lalr1.cc: Likewise.
8494 * data/yacc.c: Likewise.
8495
8496 * src/files.c (output_infix): Remove; all uses removed.
8497 * src/files.h: Likewise.
8498
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
8501 needed any more.
8502 * data/yacc.c: Likewise.
8503 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8504
8505 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8506 * data/yacc.c: Likewise.
8507
8508 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8509 strings now.
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.
8518
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.
8522
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 ].
8529
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.
8535
8536 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8537 __oline__, #output, $@, and @{ do not have unintended meanings.
8538
8539 2002-11-09 Paul Eggert <eggert@twinsun.com>
8540
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
8545 table.
8546 (yygetLRActions, yyrecoverParseError): Use them.
8547
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.
8552
8553 * tests/regression.at (Invalid inputs): Adjust wording in
8554 diagnostic to match the new behavior.
8555
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
8561 GCC 3.2.
8562
8563 2002-11-07 Paul Eggert <eggert@twinsun.com>
8564
8565 * src/parse-gram.y (CHARACTER): Remove unused token.
8566 All uses removed.
8567
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.
8571
8572 Remove nounput option. At an unexpected end of file, we now unput
8573 the minimal input necessary to end cleanly; this simplifies the
8574 code.
8575
8576 Avoid unbounded token sizes where this is easy.
8577
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.
8586
8587 2002-11-07 Akim Demaille <akim@epita.fr>
8588
8589 Let yyerror always receive the msg as last argument, so that
8590 yyerror can be variadic.
8591
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.
8599
8600 2002-11-06 Akim Demaille <akim@epita.fr>
8601
8602 #line should have quoted strings.
8603 Ideally, this should be done by m4_quotearg.
8604
8605 * src/scan-skel.l: Include quotearg.h.
8606 Quote __ofile__.
8607 * src/output.c (symbol_printers_output)
8608 (symbol_destructors_output): Quote the file name.
8609
8610 2002-11-06 Akim Demaille <akim@epita.fr>
8611
8612 * tests/regression.at (Invalid inputs): Adjust to the recent
8613 messages.
8614
8615 2002-11-06 Akim Demaille <akim@epita.fr>
8616
8617 Restore --no-lines.
8618 Reported by Jim Kent.
8619
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.
8626
8627 2002-11-06 Akim Demaille <akim@epita.fr>
8628
8629 * src/main.c (main): Free `infile'.
8630 * src/scan-gram.l (handle_syncline): New.
8631 Recognize `#line'.
8632 * src/output.c (user_actions_output, symbol_destructors_output)
8633 (symbol_printers_output): Use the location's file name, not
8634 infile.
8635 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8636
8637 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8638
8639 * src/tables.c (matching_state): Don't allow states to match if
8640 either has GLR conflict entries.
8641
8642 2002-11-05 Paul Eggert <eggert@twinsun.com>
8643
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
8647 accordingly.
8648
8649 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8650 Also, remove one static variable in the scanner.
8651
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.
8659
8660 2002-11-05 Akim Demaille <akim@epita.fr>
8661
8662 * src/scan-gram.l: When it starts with `%', complain about the
8663 whole directive, not just that `invalid character: %'.
8664
8665 2002-11-04 Akim Demaille <akim@epita.fr>
8666
8667 * Makefile.maint: Update from Autoconf.
8668 (update, cvs-update, po-update, do-po-update): New.
8669
8670 2002-11-04 Akim Demaille <akim@epita.fr>
8671
8672 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8673 and yyerror.
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.
8678
8679 2002-11-04 Akim Demaille <akim@epita.fr>
8680
8681 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8682 clashes.
8683 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8684 font-lock-mode.
8685 Use complain_at.
8686 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8687 slot 0.
8688
8689 2002-11-03 Paul Eggert <eggert@twinsun.com>
8690
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.
8695
8696 2002-11-03 Akim Demaille <akim@epita.fr>
8697
8698 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8699 New.
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.
8713 Adjust callers.
8714 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8715 When using a pure parser, also need the parse-params.
8716 Adjust callers.
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.
8730
8731 2002-11-03 Akim Demaille <akim@epita.fr>
8732
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.
8737
8738 2002-11-03 Paul Eggert <eggert@twinsun.com>
8739
8740 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8741 to count columns correctly, and to check for invalid inputs.
8742
8743 Use mbsnwidth to count columns correctly. Account for tabs, too.
8744 Include mbswidth.h.
8745 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8746 (extend_location): New function.
8747 (YY_LINES): Remove.
8748
8749 Handle CRLF in C code rather than in Lex code.
8750 (YY_INPUT): New macro.
8751 (no_cr_read): New function.
8752
8753 Scan UCNs, even though we don't fully handle them yet.
8754 (convert_ucn_to_byte): New function.
8755
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.;
8759 all uses changed.
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).
8764
8765 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8766
8767 ({int}, handle_action_dollar, handle_action_at): Check for integer
8768 overflow.
8769
8770 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8771
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.
8777
8778 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8779 with quote slot used by complain_at.
8780
8781 * tests/input.at: Add tests for backslash-newline, m4 quotes
8782 in symbols, long literals, and funny escapes in strings.
8783
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.
8789
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.
8794
8795 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8796 no longer used.
8797
8798 2002-11-02 Paul Eggert <eggert@twinsun.com>
8799
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.
8803
8804 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8805 bug in trigraph handling.
8806
8807 * src/output.c (prepare_symbols): When printing token names,
8808 escape "[" as "@<:@" and likewise for "]".
8809
8810 * src/system.h (errno): Remove declaration, as we are now
8811 assuming C89 or better, and C89 guarantees errno.
8812
8813 2002-10-30 Paul Eggert <eggert@twinsun.com>
8814
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
8818 returned zero.
8819 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8820 indicates one.
8821 * src/output.c (output_skeleton): Use xfclose rather than fclose
8822 and ferror. xfclose now checks ferror.
8823
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.
8827
8828 2002-10-30 Akim Demaille <akim@epita.fr>
8829
8830 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8831 #if.
8832
8833 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8834
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.
8838
8839 2002-10-24 Paul Eggert <eggert@twinsun.com>
8840
8841 Version 1.75a.
8842
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.
8848
8849 2002-10-24 Akim Demaille <akim@epita.fr>
8850
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
8854 first output.
8855
8856 2002-10-24 Akim Demaille <akim@epita.fr>
8857
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.
8864
8865 2002-10-23 Paul Eggert <eggert@twinsun.com>
8866
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.
8872
8873 2002-10-22 Akim Demaille <akim@epita.fr>
8874
8875 * src/system.h: Include sys/types.
8876 Reported by Bert Deknuydt.
8877
8878 2002-10-23 Paul Eggert <eggert@twinsun.com>
8879
8880 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8881 Suggested by Art Haas.
8882
8883 2002-10-22 Paul Eggert <eggert@twinsun.com>
8884
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.
8890
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
8896
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.
8900
8901 2002-10-22 Akim Demaille <akim@epita.fr>
8902
8903 * data/README: New.
8904
8905 2002-10-21 Paul Eggert <eggert@twinsun.com>
8906
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.
8916
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.
8921
8922 * src/main.c (main): Use exit to exit with failure.
8923
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.
8929
8930 * src/getarg.c (getargs): Remove duplicate code for
8931 "Try `bison --help'".
8932
8933 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8934 What was that "2" for?
8935
8936 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8937 * src/getargs.c (usage): Likewise.
8938
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.
8942
8943 2002-10-20 Paul Eggert <eggert@twinsun.com>
8944
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.
8957
8958 2002-10-20 Akim Demaille <akim@epita.fr>
8959
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.
8967
8968 2002-10-20 Akim Demaille <akim@epita.fr>
8969
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
8977 `int foo, foo'.
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.
8981
8982 2002-10-20 Akim Demaille <akim@epita.fr>
8983
8984 * src/output.c (prepare): Move the definition of `tokens_number',
8985 `nterms_number', `undef_token_number', `user_token_number_max'
8986 to...
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 `<'.
8996
8997 2002-10-20 Akim Demaille <akim@epita.fr>
8998
8999 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9000
9001 2002-10-20 Akim Demaille <akim@epita.fr>
9002
9003 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9004 * data/c.m4: here.
9005
9006 2002-10-20 Akim Demaille <akim@epita.fr>
9007
9008 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9009 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9010 `pair'.
9011 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9012 `name' to...
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):
9015 These.
9016
9017 2002-10-19 Paul Eggert <eggert@twinsun.com>
9018
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.
9039
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.
9044
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.
9048
9049 * src/output.c (prepare): Use xstrdup to convert char const *
9050 to char *, to avoid GCC warning.
9051
9052 2002-10-19 Akim Demaille <akim@epita.fr>
9053
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
9058 b4_c_function_call.
9059
9060 2002-10-19 Akim Demaille <akim@epita.fr>
9061
9062 Prototype support of %lex-param and %parse-param.
9063
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.
9067 Add the "," token.
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.
9083
9084 2002-10-19 Akim Demaille <akim@epita.fr>
9085
9086 * src/getargs.c (usage): Take status as argument and exit
9087 accordingly.
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 ()'.
9092
9093 2002-10-18 Paul Eggert <eggert@twinsun.com>
9094
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.
9098
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.
9102
9103 2002-10-17 Akim Demaille <akim@epita.fr>
9104
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.
9110 And s/@prec/%prec/!
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.
9114
9115 2002-10-16 Paul Eggert <eggert@twinsun.com>
9116
9117 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9118 MUSCLE_TAB_H.
9119
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.
9127
9128 2002-10-15 Paul Eggert <eggert@twinsun.com>
9129
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.
9134
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.
9139
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):
9191 Likewise.
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.
9203
9204 2002-10-14 Akim Demaille <akim@epita.fr>
9205
9206 Version 1.75.
9207
9208 2002-10-14 Akim Demaille <akim@epita.fr>
9209
9210 * tests/Makefile.am (maintainer-check-posix): New.
9211
9212 2002-10-14 Akim Demaille <akim@epita.fr>
9213
9214 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9215 member.
9216
9217 2002-10-14 Akim Demaille <akim@epita.fr>
9218
9219 * src/tables.c (table_ninf_remap): base -> tab.
9220 Reported by Matt Rosing.
9221
9222 2002-10-14 Paul Eggert <eggert@twinsun.com>
9223
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.
9230
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.
9237
9238 2002-10-13 Paul Eggert <eggert@twinsun.com>
9239
9240 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9241 true due to limited range of data type" warning from GCC.
9242
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.
9246
9247 2002-10-13 Akim Demaille <akim@epita.fr>
9248
9249 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9250 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9251
9252 2002-10-13 Akim Demaille <akim@epita.fr>
9253
9254 * Makefile.maint: Update from Autoconf 2.54.
9255 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9256
9257 2002-10-13 Akim Demaille <akim@epita.fr>
9258
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.
9262
9263 2002-10-13 Akim Demaille <akim@epita.fr>
9264
9265 Let nondeterministic skeletons be usable with deterministic
9266 tables.
9267
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.
9275
9276 * src/tables.c (pack_table): Always create conflict_table.
9277 (token_actions): Always create conflict_list.
9278 * data/glr.c (YYFLAG): Remove, unused.
9279
9280 2002-10-13 Akim Demaille <akim@epita.fr>
9281
9282 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9283 (O0FLAGS): New.
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.
9290
9291 2002-10-13 Akim Demaille <akim@epita.fr>
9292
9293 * data/glr.c: Formatting changes.
9294 Tweak some trace messages to match yacc.c's.
9295
9296 2002-10-13 Akim Demaille <akim@epita.fr>
9297
9298 GLR parsers sometimes raise parse errors instead of performing the
9299 default reduction.
9300 Reported by Charles-Henry de Boysson.
9301
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
9305 GLR's traces.
9306 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9307 Test GLR parsers.
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
9312 YYTABLE_NINF to 0.
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.
9323
9324 2002-10-13 Paul Eggert <eggert@twinsun.com>
9325
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
9330 the first one.
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.
9336
9337 2002-10-12 Paul Eggert <eggert@twinsun.com>
9338
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>.
9345
9346 * lib/timevar.c: Update copyright date and clarify comments.
9347 (get_time) [IN_GCC]: Keep the GCC version for reference.
9348
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.
9353
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>.
9358
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>.
9364
9365 2002-10-11 Paul Eggert <eggert@twinsun.com>
9366
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/>.
9371
9372 2002-10-11 Akim Demaille <akim@epita.fr>
9373
9374 * tests/regression.at Characters Escapes): New.
9375 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9376 characters.
9377 Reported by Jan Nieuwenhuizen.
9378
9379 2002-10-11 Akim Demaille <akim@epita.fr>
9380
9381 * po/id.po: New.
9382
9383 2002-10-10 Paul Eggert <eggert@twinsun.com>
9384
9385 Portability fixes for bitsets; this also avoids several GCC
9386 warnings.
9387
9388 * lib/abitset.c: Include <stddef.h>, for offsetof.
9389 * lib/lbitset.c: Likewise.
9390
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.
9396
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.
9401
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.
9425
9426 * lib/abitset.h: Include bitset.h, not bbitset.h.
9427 * lib/ebitset.h: Likewise.
9428 * lib/lbitset.h: Likewise.
9429
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.
9436
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,
9447 etc.
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):
9455 Likewise.
9456
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
9460 definition.
9461 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9462 New decls.
9463 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9464 New functions.
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
9469 decls.
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.
9475
9476 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9477 Declare.
9478
9479 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9480 GCC warning.
9481 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9482 Use offsetof, for simplicity.
9483
9484 2002-10-06 Paul Eggert <eggert@twinsun.com>
9485
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.
9492
9493 2002-10-04 Paul Eggert <eggert@twinsun.com>
9494
9495 Version 1.50.
9496
9497 * configure.ac (AC_INIT), NEWS: Increment version number.
9498
9499 * doc/bison.texinfo: Minor spelling, grammar, and white space
9500 fixes.
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.
9504
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.
9510
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.
9516
9517 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9518 POSIX 1003.1-2001 has removed fgrep.
9519
9520 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9521
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.
9525
9526 2002-10-01 Paul Eggert <eggert@twinsun.com>
9527
9528 More fixes for 64-bit hosts and large bitsets.
9529
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):
9542 Likewise.
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):
9549 Likewise.
9550 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9551 Likewise.
9552
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):
9557 Likewise.
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.
9566
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):
9578 Likewise.
9579 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
9580
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.
9588
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.
9594
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).
9598
9599 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9600 when computing sizes.
9601 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9602
9603 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9604 and avoid cast to unsigned.
9605
9606 2002-09-30 Akim Demaille <akim@epita.fr>
9607
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.
9611
9612 2002-09-30 Art Haas <ahaas@neosoft.com>
9613
9614 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9615 invocations.
9616 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9617 defined.
9618
9619 2002-09-27 Akim Demaille <akim@epita.fr>
9620
9621 Version 1.49c.
9622
9623 2002-09-27 Akim Demaille <akim@epita.fr>
9624
9625 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9626 (Because of AC_LIBSOURCE).
9627
9628 2002-09-27 Akim Demaille <akim@epita.fr>
9629
9630 Playing with Autoscan.
9631
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.
9636
9637 2002-09-27 Akim Demaille <akim@epita.fr>
9638
9639 Playing with Autoscan.
9640
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
9645 Coreutils 4.5.1.
9646
9647 2002-09-24 Akim Demaille <akim@epita.fr>
9648
9649 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9650 (Frequently Asked Questions, Parser Stack Overflow): New.
9651
9652 2002-09-13 Akim Demaille <akim@epita.fr>
9653
9654 Playing with autoscan.
9655
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.
9660
9661 2002-09-13 Akim Demaille <akim@epita.fr>
9662
9663 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9664 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9665
9666 2002-09-13 Akim Demaille <akim@epita.fr>
9667
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.
9673
9674 2002-09-12 Akim Demaille <akim@epita.fr>
9675
9676 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9677
9678 2002-09-12 Akim Demaille <akim@epita.fr>
9679
9680 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9681 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9682 Reported by Martin Mokrejs.
9683
9684 2002-09-10 Akim Demaille <akim@epita.fr>
9685
9686 * src/parse-gram.y: Associate a human readable string to each
9687 token type.
9688 * tests/regression.at (Invalid inputs): Adjust.
9689
9690 2002-09-10 Gary V. Vaughan <gary@gnu.org>
9691
9692 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9693 with an Autoconf-2.5x style configure.ac.
9694
9695 2002-09-06 Paul Eggert <eggert@twinsun.com>
9696
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.
9700
9701 2002-09-06 Akim Demaille <akim@epita.fr>
9702
9703 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9704 here to...
9705 * data/yacc.c: here.
9706
9707 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9708 LocationType.
9709 (b4_ltype): Default to yy::Location from location.hh.
9710
9711 2002-09-04 Jim Meyering <jim@meyering.net>
9712
9713 * data/yacc.c: Guard the declaration of yytoknum also with
9714 `#ifdef YYPRINT', so it is declared only when used.
9715
9716 2002-09-04 Akim Demaille <akim@epita.fr>
9717
9718 * configure.in: Rename as...
9719 * configure.ac: this.
9720 Bump to 1.49c.
9721
9722 2002-09-04 Akim Demaille <akim@epita.fr>
9723
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.
9727
9728 2002-08-12 Paul Eggert <eggert@twinsun.com>
9729
9730 Version 1.49b.
9731
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.
9742
9743 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9744
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
9749 same width as int.
9750 (yypstates): Do not assume that ptrdiff_t is the same width
9751 as int, and similarly for yyposn and YYINDEX.
9752
9753 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9754
9755 * lib/Makefile.am (INCLUDES): Do not include from the intl
9756 directory, which has been removed.
9757 * src/Makefile.am (INCLUDES): Likewise.
9758
9759 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9760 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9761 New vars.
9762
9763 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9764 * tests/Makefile.am (EXTRA_DIST): Likewise.
9765
9766 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9767 Do not assume that bitset_windex is the same width as unsigned.
9768
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.
9776
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.
9781
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.
9788
9789 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9790 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9791
9792 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9793 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9794 check for void *.
9795
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.
9800
9801 * lib/bitset_stats.c: Include "gettext.h".
9802 (_): New macro.
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.
9806
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.
9820
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.
9826
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,
9830 lib/timevar.c.
9831 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9832 manual recommends.
9833 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9834
9835 * src/complain.c (strerror_r): Remove decl; not needed.
9836 (strerror): Use same pattern as ../lib/error.c.
9837
9838 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9839
9840 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9841
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.
9844
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.
9850
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.
9853
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).
9858
9859 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9860 it's not portable.
9861
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'.
9864
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.
9868
9869 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9870 Use it for the two large tests.
9871
9872 2002-08-02 Akim Demaille <akim@epita.fr>
9873
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
9883 reduced to...
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.
9890
9891 2002-08-01 Akim Demaille <akim@epita.fr>
9892
9893 Instead of attaching lookaheads and duplicating the rules being
9894 reduced by a state, attach the lookaheads to the reductions.
9895
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
9901 to 0.
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.
9915
9916 2002-08-01 Akim Demaille <akim@epita.fr>
9917
9918 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9919 `rule_number_t**'.
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.
9930
9931 2002-08-01 Akim Demaille <akim@epita.fr>
9932
9933 * lib/timevar.c (get_time): Include children time.
9934 * src/lalr.h (LA, LArule): Don't export them: used with the
9935 state_t.
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
9940 table_size, not >.
9941 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9942 (tables_generate): do it, since that's also it which allocates
9943 them.
9944 Don't free LA and LArule, main does.
9945
9946 2002-07-31 Akim Demaille <akim@epita.fr>
9947
9948 Separate parser tables computation and output.
9949
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.
9971
9972 2002-07-31 Akim Demaille <akim@epita.fr>
9973
9974 Steal GCC's --time-report support.
9975
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
9983 --trace=time.
9984 * src/main.c (stage): Remove.
9985 (main): Replace `stage' invocations with timevar calls.
9986 * src/output.c: Insert pertinent timevar calls.
9987
9988 2002-07-31 Akim Demaille <akim@epita.fr>
9989
9990 Let --trace have arguments.
9991
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
9995 argument.
9996 Change all the uses of trace_flag to reflect the new flags.
9997 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
9998
9999 Strengthen `stage' portability.
10000
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.
10007
10008 2002-07-30 Akim Demaille <akim@epita.fr>
10009
10010 In verbose parse error message, don't report `error' as an
10011 expected token.
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
10016 that state.
10017
10018 2002-07-30 Akim Demaille <akim@epita.fr>
10019
10020 Normalize conflict related messages.
10021
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.
10027
10028 2002-07-30 Akim Demaille <akim@epita.fr>
10029
10030 Report rules which are never reduced by the parser: those hidden
10031 by conflicts.
10032
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.
10044
10045 2002-07-30 Akim Demaille <akim@epita.fr>
10046
10047 `stage' was accidently included in a previous patch.
10048 Initiate its autoconfiscation.
10049
10050 * configure.in: Look for malloc.h and sys/times.h.
10051 * src/main.c (stage): Adjust.
10052 Report only when trace_flag.
10053
10054 2002-07-29 Akim Demaille <akim@epita.fr>
10055
10056 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10057 state_number_t.
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.
10063
10064 2002-07-29 Akim Demaille <akim@epita.fr>
10065
10066 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10067
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.
10073 Adjust.
10074
10075 2002-07-29 Akim Demaille <akim@epita.fr>
10076
10077 * src/reduce.c (reduce_grammar): When the language is empty,
10078 complain about the start symbol, not the axiom.
10079 Use its location.
10080 * tests/reduce.at (Empty Language): New.
10081
10082 2002-07-26 Akim Demaille <akim@epita.fr>
10083
10084 * src/reader.h, src/reader.c (gram_error): ... can't get
10085 yycontrol without making too strong assumptions on the parser
10086 itself.
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
10090 visible here.
10091 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10092 for the time being: %locations ought to provide it to yyerror.
10093
10094 2002-07-25 Akim Demaille <akim@epita.fr>
10095
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.
10099
10100 2002-07-25 Akim Demaille <akim@epita.fr>
10101
10102 Stop storing rules from 1 to nrules + 1.
10103
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
10113 shift and reduce.
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
10117 expected output.
10118 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10119
10120 2002-07-25 Akim Demaille <akim@epita.fr>
10121
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.
10127
10128 2002-07-25 Akim Demaille <akim@epita.fr>
10129
10130 * data/yacc.c (yyreport_parse_error): New, extracted from...
10131 (yyparse): here.
10132 (yydestruct, yysymprint): Move above yyparse.
10133 Be K&R compliant.
10134
10135 2002-07-25 Akim Demaille <akim@epita.fr>
10136
10137 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10138 replace...
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.
10142
10143 2002-07-25 Akim Demaille <akim@epita.fr>
10144
10145 * src/gram.h (TIEM_NUMBER_MAX): New.
10146 (item_number_of_rule_number, rule_number_of_item_number): Rename
10147 as...
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,
10170 replaced with...
10171 (YYPACT_NINF, YYTABLE_NINF): these.
10172 (yypact, yytable): Compute their types instead of hard-coded
10173 `short'.
10174 * tests/regression.at (Web2c Actions): Adjust.
10175
10176 2002-07-19 Akim Demaille <akim@epita.fr>
10177
10178 * src/scan-gram.l (id): Can start with an underscore.
10179
10180 2002-07-16 Akim Demaille <akim@epita.fr>
10181
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
10185 `right'.
10186 (symbol_check_alias_consistence): Adjust.
10187
10188 2002-07-09 Akim Demaille <akim@epita.fr>
10189
10190 * doc/bison.texinfo: Properly set the ``header'' part.
10191 Use @dircategory ``GNU programming tools'' as per Texinfo's
10192 documentation.
10193 Use @copying.
10194
10195 2002-07-09 Akim Demaille <akim@epita.fr>
10196
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.
10202
10203 2002-07-09 Akim Demaille <akim@epita.fr>
10204
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):
10211 Adjust.
10212
10213 2002-07-09 Akim Demaille <akim@epita.fr>
10214
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.
10219
10220 2002-07-09 Akim Demaille <akim@epita.fr>
10221
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>.
10225
10226 2002-07-09 Akim Demaille <akim@epita.fr>
10227
10228 * data/yacc.c: Output the copyright notive in the header.
10229
10230 2002-07-03 Akim Demaille <akim@epita.fr>
10231
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',
10237 unused.
10238 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10239 * data/lalr1.cc (nsym_): Remove, unused.
10240
10241 2002-07-03 Akim Demaille <akim@epita.fr>
10242
10243 * src/lalr.h, src/lalr.c (goto_number_t): New.
10244 * src/lalr.c (goto_list_t): New.
10245 Propagate them.
10246 * src/nullable.c (rule_list_t): New.
10247 Propagate.
10248 * src/types.h: Remove.
10249
10250 2002-07-03 Akim Demaille <akim@epita.fr>
10251
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.
10257
10258 2002-07-03 Akim Demaille <akim@epita.fr>
10259
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.
10267
10268 2002-07-03 Akim Demaille <akim@epita.fr>
10269
10270 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10271
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.
10286 (state_free): New.
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'.
10291
10292 2002-07-02 Akim Demaille <akim@epita.fr>
10293
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.
10299
10300 2002-07-01 Paul Eggert <eggert@twinsun.com>
10301
10302 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10303 char, so that negative chars don't collide with $.
10304
10305 2002-06-30 Akim Demaille <akim@epita.fr>
10306
10307 Have the GLR tests be `warning' checked, and fix the warnings.
10308
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.
10323 Use them.
10324 * tests/cxx-gram.at: Use quotation to protect $1.
10325 Use AT_COMPILE to enable warnings hunts.
10326 Prototype yylex and yyerror.
10327 `Use' argc.
10328 Include `string.h', not `strings.h'.
10329 Produce and prototype stmtMerge only when used.
10330 yylex takes a location.
10331
10332 2002-06-30 Akim Demaille <akim@epita.fr>
10333
10334 We spend a lot of time in quotearg, in particular when --verbose.
10335
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.
10339
10340 2002-06-30 Akim Demaille <akim@epita.fr>
10341
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.
10345
10346 2002-06-30 Akim Demaille <akim@epita.fr>
10347
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.
10354
10355 2002-06-30 Akim Demaille <akim@epita.fr>
10356
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.
10368
10369 2002-06-30 Akim Demaille <akim@epita.fr>
10370
10371 Display items as we display rules.
10372
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.
10381
10382 2002-06-30 Akim Demaille <akim@epita.fr>
10383
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.
10388
10389 2002-06-30 Akim Demaille <akim@epita.fr>
10390
10391 * src/output.c (action_row): Let default_rule be always a rule
10392 number.
10393
10394 2002-06-30 Akim Demaille <akim@epita.fr>
10395
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.
10404
10405 2002-06-30 Akim Demaille <akim@epita.fr>
10406
10407 * src/print_graph.c: Use report_flag.
10408
10409 2002-06-30 Akim Demaille <akim@epita.fr>
10410
10411 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10412 to...
10413 * src/relation.h, src/relation.c (traverse, relation_digraph)
10414 (relation_print, relation_transpose): New.
10415
10416 2002-06-30 Akim Demaille <akim@epita.fr>
10417
10418 * src/state.h, src/state.c (shifts_to): New.
10419 * src/lalr.c (build_relations): Use it.
10420
10421 2002-06-30 Akim Demaille <akim@epita.fr>
10422
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.
10430
10431 2002-06-30 Akim Demaille <akim@epita.fr>
10432
10433 * src/symtab.c (symbol_new): Initialize the `printer' member.
10434
10435 2002-06-30 Akim Demaille <akim@epita.fr>
10436
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.
10442
10443 2002-06-30 Akim Demaille <akim@epita.fr>
10444
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
10449 argument.
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...
10454 (shifts_t): this.
10455 Adjust all dependencies.
10456 * src/state.h (state_t): Remove the `next' member.
10457
10458 2002-06-30 Akim Demaille <akim@epita.fr>
10459
10460 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10461 escaped in slot 0.
10462
10463 2002-06-30 Akim Demaille <akim@epita.fr>
10464
10465 Use hash.h for the state hash table.
10466
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
10473 used.
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'.
10482
10483 2002-06-30 Akim Demaille <akim@epita.fr>
10484
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.
10491
10492 2002-06-30 Akim Demaille <akim@epita.fr>
10493
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.
10498
10499 2002-06-30 Akim Demaille <akim@epita.fr>
10500
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*.
10505
10506 2002-06-30 Akim Demaille <akim@epita.fr>
10507
10508 Make the test suite pass with warnings checked.
10509
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.
10514
10515 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10516
10517 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
10518 reorganize first lines parallel to yacc.c.
10519
10520 2002-06-28 Akim Demaille <akim@epita.fr>
10521
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.
10525
10526 2002-06-28 Akim Demaille <akim@epita.fr>
10527
10528 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10529 unused variables.
10530 * src/output.c (merger_output): static.
10531
10532 2002-06-28 Akim Demaille <akim@epita.fr>
10533
10534 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
10535 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10536 pacify GCC.
10537 * src/output.c (save_row): Initialize all the variables to pacify GCC.
10538
10539 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10540
10541 Accumulated changelog for new GLR parsing features.
10542
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.
10551
10552 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10553
10554 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10555 Akim Demaille.
10556
10557 * data/bison.glr: Change name to glr.c
10558 * data/glr.c: Renamed from bison.glr.
10559 * data/Makefile.am: Add glr.c
10560
10561 * src/getargs.c:
10562
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.
10565
10566 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10567
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.
10571
10572 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10573
10574 * data/bison.glr: Bring up to date with changes to bison.simple.
10575
10576 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10577
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.
10585
10586 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10587
10588 * src/reader.h: Add declaration for free_merger_functions.
10589
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.
10596
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.
10615
10616 * src/gram.c (glr_parser): New flag.
10617 (grammar_free): Call free_merger_functions.
10618
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
10623 interface.
10624 (conflicts_print): Ditto.
10625 (count_total_conflicts): New function.
10626
10627 * src/reader.h (merger_list): New type.
10628 (merge_functions): New variable.
10629
10630 * src/lex.h (tok_dprec, tok_merge): New token types.
10631
10632 * src/gram.h (rule_s): Add dprec and merger fields.
10633 (glr_parser): New flag.
10634
10635 * src/conflicts.h (count_total_conflicts): New function.
10636
10637 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10638
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").
10644
10645 * data/bison.glr: New skeleton for GLR parsing.
10646
10647 * tests/cxx-gram.at: New tests for GLR parsing.
10648
10649 * tests/testsuite.at: Include cxx-gram.at.
10650
10651 * tests/Makefile.am: Add cxx-gram.at.
10652
10653 * src/parse-gram.y:
10654
10655 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10656
10657 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
10658
10659 2002-06-27 Akim Demaille <akim@epita.fr>
10660
10661 * src/options.h, src/options.c: Remove.
10662 * src/getargs.c (short_options, long_options): New.
10663
10664 2002-06-27 Akim Demaille <akim@epita.fr>
10665
10666 * data/bison.simple, data/bison.c++: Rename as...
10667 * data/yacc.c, data/lalr1.cc: these.
10668 * doc/bison.texinfo (Environment Variables): Remove.
10669
10670 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10671
10672 * src/getargs.c (report_argmatch): Initialize strtok().
10673
10674 2002-06-20 Akim Demaille <akim@epita.fr>
10675
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.
10680
10681 2002-06-20 Akim Demaille <akim@epita.fr>
10682
10683 * data/bison.simple (yydestructor): Rename as...
10684 (yydestruct): this.
10685
10686 2002-06-20 Akim Demaille <akim@epita.fr>
10687
10688 * src/symtab.h, src/symtab.c (symbol_type_set)
10689 (symbol_destructor_set, symbol_precedence_set): The location is
10690 the last argument.
10691 Adjust all callers.
10692
10693 2002-06-20 Akim Demaille <akim@epita.fr>
10694
10695 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10696 internals.
10697 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10698 Takes a location.
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.
10704
10705 2002-06-20 Akim Demaille <akim@epita.fr>
10706
10707 * data/bison.simple (YYLEX): Fix the declaration when
10708 %pure-parser.
10709
10710 2002-06-20 Akim Demaille <akim@epita.fr>
10711
10712 * data/bison.simple (yysymprint): Don't print the token number,
10713 just its name.
10714 * tests/actions.at (Destructors): Rename as...
10715 (Printers and Destructors): this.
10716 Also exercise %printer.
10717
10718 2002-06-20 Akim Demaille <akim@epita.fr>
10719
10720 * data/bison.simple (YYDSYMPRINT): New.
10721 Use it to remove many of the #if YYDEBUG/if (yydebug).
10722
10723 2002-06-20 Akim Demaille <akim@epita.fr>
10724
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!).
10741
10742 2002-06-20 Akim Demaille <akim@epita.fr>
10743
10744 * src/scan-gram.l: Complete the scanner with the missing patterns
10745 to pacify Flex.
10746 Use `quote' and `symbol_tag_get' where appropriate.
10747
10748 2002-06-19 Akim Demaille <akim@epita.fr>
10749
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
10755 user code here.
10756
10757 2002-06-19 Akim Demaille <akim@epita.fr>
10758
10759 * data/bison.simple (b4_pure_if): New.
10760 Use it instead of #ifdef YYPURE.
10761
10762 2002-06-19 Akim Demaille <akim@epita.fr>
10763
10764 * data/bison.simple (b4_location_if): New.
10765 Use it instead of #ifdef YYLSP_NEEDED.
10766
10767 2002-06-19 Akim Demaille <akim@epita.fr>
10768
10769 Prepare @$ in %destructor, but currently don't bind it in the
10770 skeleton, as %location use is not cleaned up yet.
10771
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'.
10778 Adjust callers.
10779 * data/bison.simple (b4_eval): Remove.
10780 (b4_symbol_destructor): Adjust.
10781 * tests/input.at (Invalid @n): Adjust.
10782
10783 2002-06-19 Zack Weinberg <zack@codesourcery.com>
10784
10785 * doc/bison.texinfo: Document ability to have multiple
10786 prologue sections.
10787
10788 2002-06-18 Akim Demaille <akim@epita.fr>
10789
10790 * src/files.c (compute_base_names): When computing the output file
10791 names from the input file name, strip the directory part.
10792
10793 2002-06-18 Akim Demaille <akim@epita.fr>
10794
10795 * data/bison.simple.new: Comment changes.
10796 Reported by Andreas Schwab.
10797
10798 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10799
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.
10803
10804 2002-06-18 Akim Demaille <akim@epita.fr>
10805
10806 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10807 new member.
10808 (symbol_destructor_set): Adjust.
10809 * src/output.c (symbol_destructors_output): Output the destructor
10810 locations.
10811 Output the symbol name.
10812 * data/bison.simple (b4_symbol_destructor): Adjust.
10813
10814 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10815 and Akim Demaille <akim@epita.fr>
10816
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.
10820
10821 2002-06-17 Akim Demaille <akim@epita.fr>
10822
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
10826 member.
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.
10840
10841 2002-06-17 Akim Demaille <akim@epita.fr>
10842
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
10847 the full M4 block.
10848 * src/symtab.c: Don't access directly to the symbol tag, use
10849 symbol_tag_get.
10850 * src/parse-gram.y: Use symbol_list_free.
10851
10852 2002-06-17 Akim Demaille <akim@epita.fr>
10853
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.
10862
10863 2002-06-17 Akim Demaille <akim@epita.fr>
10864
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.
10873
10874 2002-06-15 Akim Demaille <akim@epita.fr>
10875
10876 * src/parse-gram.y: Move %token in the declaration section so that
10877 we don't depend upon CVS Bison.
10878
10879 2002-06-15 Akim Demaille <akim@epita.fr>
10880
10881 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10882 * src/print.c (print_core): Use it.
10883
10884 2002-06-15 Akim Demaille <akim@epita.fr>
10885
10886 * src/conflicts.c (log_resolution): Accept the rule involved in
10887 the sr conflicts instead of the lookahead number that points to
10888 that rule.
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.
10895
10896 2002-06-15 Akim Demaille <akim@epita.fr>
10897
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.
10903 (lalr): Adjust.
10904
10905 2002-06-15 Akim Demaille <akim@epita.fr>
10906
10907 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10908 out of...
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.
10913
10914 2002-06-15 Akim Demaille <akim@epita.fr>
10915
10916 Copy BYacc's nice way to report the grammar.
10917
10918 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10919 New.
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.
10923
10924 2002-06-15 Akim Demaille <akim@epita.fr>
10925
10926 Complete and rationalize `useless thing' warnings.
10927
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.
10936 Report it as such.
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.
10942
10943 2002-06-15 Akim Demaille <akim@epita.fr>
10944
10945 Let symbols have a location.
10946
10947 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10948 (getsym): Adjust.
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
10953 location.
10954 * tests/regression.at (Invalid inputs): Adjust.
10955
10956 2002-06-15 Akim Demaille <akim@epita.fr>
10957
10958 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10959 (input): Don't try to initialize yylloc here, do it in the
10960 scanner.
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
10974 the line numbers.
10975
10976 2002-06-14 Akim Demaille <akim@epita.fr>
10977
10978 Grammar declarations may be found in the grammar section.
10979
10980 * src/parse-gram.y (rules_or_grammar_declaration): New.
10981 (declarations): Each declaration may end with a semicolon, not
10982 just...
10983 (grammar_declaration): `"%union"'.
10984 (grammar): Branch to rules_or_grammar_declaration.
10985
10986 2002-06-14 Akim Demaille <akim@epita.fr>
10987
10988 * src/main.c (main): Invoke scanner_free.
10989
10990 2002-06-14 Akim Demaille <akim@epita.fr>
10991
10992 * src/output.c (m4_invoke): Extracted from...
10993 (output_skeleton): here.
10994 Free tempfile.
10995
10996 2002-06-14 Akim Demaille <akim@epita.fr>
10997
10998 * src/parse-gram.y (directives, directive, gram)
10999 (grammar_directives, precedence_directives, precedence_directive):
11000 Rename as...
11001 (declarations, declaration, grammar, grammar_declaration)
11002 (precedence_declaration, precedence_declarator): these.
11003 (symbol_declaration): New.
11004
11005 2002-06-14 Akim Demaille <akim@epita.fr>
11006
11007 * src/files.c (action_obstack): Remove, unused.
11008 (output_obstack): Remove it, and all its dependencies, as it is no
11009 longer needed.
11010 * src/reader.c (epilogue_set): Build the epilogue in the
11011 muscle_obstack.
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.
11017
11018 2002-06-14 Akim Demaille <akim@epita.fr>
11019
11020 * src/location.h: New, extracted from...
11021 * src/reader.h: here.
11022 * src/Makefile.am (noinst_HEADERS): Merge into
11023 (bison_SOURCES): this.
11024 Add location.h.
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.
11028
11029 2002-06-14 Akim Demaille <akim@epita.fr>
11030
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.
11034
11035 2002-06-12 Akim Demaille <akim@epita.fr>
11036
11037 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11038 eager.
11039 * tests/actions.at (Exotic Dollars): New.
11040
11041 2002-06-12 Akim Demaille <akim@epita.fr>
11042
11043 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11044 ['"/] too eagerly.
11045 * tests/input.at (Torturing the Scanner): New.
11046
11047 2002-06-11 Akim Demaille <akim@epita.fr>
11048
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.
11054
11055 2002-06-11 Akim Demaille <akim@epita.fr>
11056
11057 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11058 Adjust all callers.
11059 (scanner_last_string_free): New.
11060
11061 2002-06-11 Akim Demaille <akim@epita.fr>
11062
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.
11067
11068 2002-06-11 Akim Demaille <akim@epita.fr>
11069
11070 Have Bison grammars parsed by a Bison grammar.
11071
11072 * src/reader.c, src/reader.h (prologue_augment): New.
11073 * src/reader.c (copy_definition): Remove.
11074
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.
11085
11086 * src/reader.c (read_declarations): Remove, unused.
11087
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.
11094
11095 * src/reader.c (copy_dollar): Replace with...
11096 * src/scan-gram.h (handle_dollar): this.
11097 * src/parse-gram.y: Remove `%thong'.
11098
11099 * src/reader.c (copy_at): Replace with...
11100 * src/scan-gram.h (handle_at): this.
11101
11102 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11103 New.
11104
11105 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11106 time being.
11107
11108 * src/reader.h, src/reader.c (grammar_rule_end): New.
11109
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
11115 type name.
11116
11117 * src/parse-gram.y: Be sure to handle properly the beginning of
11118 rules.
11119
11120 * src/parse-gram.y: Handle %type.
11121 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11122
11123 * src/parse-gram.y: More directives support.
11124 * src/options.c: No longer handle source directives.
11125
11126 * src/parse-gram.y: Fix %output.
11127
11128 * src/parse-gram.y: Handle %union.
11129 Use the prologue locations.
11130 * src/reader.c (parse_union_decl): Remove.
11131
11132 * src/reader.h, src/reader.c (epilogue_set): New.
11133 * src/parse-gram.y: Use it.
11134
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.
11138 Adjust.
11139 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11140
11141 * src/output.c (actions_output): Don't output braces, as they are
11142 already handled by the scanner.
11143
11144 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11145 characters to themselves.
11146
11147 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11148 that the epilogue has a proper #line.
11149
11150 * src/parse-gram.y: Handle precedence/associativity.
11151
11152 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11153 a terminal.
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.
11157
11158 * src/scan-gram.l: Escape M4 characters.
11159
11160 * src/scan-gram.l: Working properly with escapes in user
11161 strings/characters.
11162
11163 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11164 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11165 grammar.
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
11168 of memory.
11169
11170 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11171 stricter %token grammar.
11172
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.
11176
11177 * tests/regression.at (Invalid %directive): Remove, as it is now
11178 meaningless.
11179 (Invalid inputs): Adjust to the new error messages.
11180 (Token definitions): The new grammar doesn't allow too many
11181 eccentricities.
11182
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.
11190
11191 2002-06-11 Akim Demaille <akim@epita.fr>
11192
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
11198 (readgram): here.
11199 Remove `action_flag', `rulelength', unused now.
11200
11201 2002-06-11 Akim Demaille <akim@epita.fr>
11202
11203 * src/reader.c (grammar_current_rule_prec_set).
11204 (grammar_current_rule_check): New, eved out from...
11205 (readgram): here.
11206 Remove `xaction', `first_rhs': useless.
11207 * tests/input.at (Type clashes): New.
11208 * tests/existing.at (GNU Cim Grammar): Adjust.
11209
11210 2002-06-11 Akim Demaille <akim@epita.fr>
11211
11212 * src/reader.c (grammar_midrule_action): New, Eved out from
11213 (readgram): here.
11214
11215 2002-06-11 Akim Demaille <akim@epita.fr>
11216
11217 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11218 New.
11219 (readgram): Use them as replacement of inlined code, crule and
11220 crule1.
11221
11222 2002-06-11 Akim Demaille <akim@epita.fr>
11223
11224 * src/reader.c (grammar_end, grammar_symbol_append): New.
11225 (readgram): Use them.
11226 Make the use of `p' as local as possible.
11227
11228 2002-06-10 Akim Demaille <akim@epita.fr>
11229
11230 GCJ's parser requires the tokens to be defined before the prologue.
11231
11232 * data/bison.simple: Output the token definition before the user's
11233 prologue.
11234 * tests/regression.at (Braces parsing, Duplicate string)
11235 (Mixing %token styles): Check the output from bison.
11236 (Early token definitions): New.
11237
11238 2002-06-10 Akim Demaille <akim@epita.fr>
11239
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
11242 use it in...
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.
11246
11247 2002-06-10 Akim Demaille <akim@epita.fr>
11248
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.
11254
11255 2002-06-10 Akim Demaille <akim@epita.fr>
11256
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.
11261
11262 * src/reader.c (parse_thong_decl): Remove.
11263 * src/options.c (option_table): Remove "thong".
11264 * src/lex.h (tok_thong): Remove.
11265
11266 2002-06-10 Akim Demaille <akim@epita.fr>
11267
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.
11272
11273 2002-06-09 Akim Demaille <akim@epita.fr>
11274
11275 Move symbols handling code out of the reader.
11276
11277 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11278 (axiom): Move to...
11279 * src/symtab.h, src/symtab.c: here.
11280
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.
11285
11286 * src/reader.c (symbol_check_defined, symbol_make_alias)
11287 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11288 (token_translations_init)
11289 Move to...
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
11294 argument.
11295
11296 2002-06-03 Akim Demaille <akim@epita.fr>
11297
11298 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11299 then statements.
11300
11301 2002-06-03 Akim Demaille <akim@epita.fr>
11302
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
11307 comma.
11308 * src/getargs.c (usage): Split long literal strings.
11309 Reported by Hans Aberg.
11310
11311 2002-05-28 Akim Demaille <akim@epita.fr>
11312
11313 * data/bison.c++: Use C++ ostreams.
11314 (cdebug_): New member.
11315
11316 2002-05-28 Akim Demaille <akim@epita.fr>
11317
11318 * src/output.c (output_skeleton): Be sure to allocate enough room
11319 for `/' _and_ for `\0' in full_skeleton.
11320
11321 2002-05-28 Akim Demaille <akim@epita.fr>
11322
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.
11328
11329 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11330
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.
11335
11336 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11337
11338 * src/conflicts.c (log_resolution): Correct typo:
11339 obstack_printf should be obstack_fgrow1.
11340
11341 2002-05-26 Akim Demaille <akim@epita.fr>
11342
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.
11348 Adjust callers.
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
11354 information.
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.
11359
11360 2002-05-26 Akim Demaille <akim@epita.fr>
11361
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):
11367 Rename as...
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.
11371
11372 2002-05-26 Akim Demaille <akim@epita.fr>
11373
11374 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11375 `Error:' lines.
11376 * data/bison.simple (yystos) [YYDEBUG]: New.
11377 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11378 error recovery.
11379 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11380
11381 2002-05-25 Akim Demaille <akim@epita.fr>
11382
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
11387 by...
11388 (report_flag): this.
11389 Adjust all dependencies.
11390 (report_args, report_types, report_argmatch): New.
11391 (usage, getargs): Report/support -r, --report.
11392 * src/options.h
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
11396 struct.
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.
11403
11404 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11405 and Paul Eggert <eggert@twinsun.com>
11406
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.
11413
11414 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11415
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.
11424
11425 * tests/regression.at: Modify expected output to agree with change
11426 to yyr1 and yytranslate.
11427
11428 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11429
11430 * src/reader.c (parse_action): Use copy_character instead of
11431 obstack_1grow.
11432
11433 2002-05-13 Akim Demaille <akim@epita.fr>
11434
11435 * tests/regression.at (Token definitions): Prototype yylex and
11436 yyerror.
11437
11438 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11439
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
11442 32-bit arithmetic.
11443 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11444
11445 2002-05-07 Akim Demaille <akim@epita.fr>
11446
11447 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11448 avoid GCC warnings.
11449
11450 2002-05-07 Akim Demaille <akim@epita.fr>
11451
11452 Kill GCC warnings.
11453
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
11461 `Type'.
11462 (muscle_insert_int_table): Remove, unused.
11463 (prepare_rules): Remove `max'.
11464
11465 2002-05-06 Akim Demaille <akim@epita.fr>
11466
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):
11470 here.
11471 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11472
11473 2002-05-06 Akim Demaille <akim@epita.fr>
11474
11475 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11476 hash_do_for_each.
11477
11478 2002-05-06 Akim Demaille <akim@epita.fr>
11479
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'.
11483 Adjust callers.
11484
11485 2002-05-06 Akim Demaille <akim@epita.fr>
11486
11487 * src/reader.c (packgram): No longer end `ritem' with a 0
11488 sentinel: it is not used.
11489
11490 2002-05-05 Akim Demaille <akim@epita.fr>
11491
11492 New experimental feature: display the lookaheads in the report and
11493 graph.
11494
11495 * src/print (print_core): When --trace-flag, display the rules
11496 lookaheads.
11497 * src/print_graph.c (print_core): Likewise.
11498 Swap the arguments.
11499 Adjust caller.
11500
11501 2002-05-05 Akim Demaille <akim@epita.fr>
11502
11503 * tests/torture.at (Many lookaheads): New test.
11504
11505 2002-05-05 Akim Demaille <akim@epita.fr>
11506
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.
11517 Move to...
11518 * src/gram.h, src/gram.c (grammar_free): here.
11519 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11520 b4_translate_max.
11521
11522 2002-05-05 Akim Demaille <akim@epita.fr>
11523
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'.
11529 Free rline and r1.
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.
11533
11534 2002-05-04 Akim Demaille <akim@epita.fr>
11535
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.
11542
11543 2002-05-03 Paul Eggert <eggert@twinsun.com>
11544
11545 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11546 for K&R C.
11547
11548 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11549
11550 * Makefile.am (SUBDIRS): Remove intl.
11551 (EXTRA_DIST): Add config/config.rpath.
11552
11553 2002-05-03 Akim Demaille <akim@epita.fr>
11554
11555 * data/bison.simple (m4_if): Don't output empty enums.
11556 And actually, output valid enum definitions :(.
11557
11558 2002-05-03 Akim Demaille <akim@epita.fr>
11559
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.
11564
11565 2002-05-03 Akim Demaille <akim@epita.fr>
11566
11567 * configure.in (GETTEXT_VERSION): New.
11568 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11569
11570 2002-05-03 Akim Demaille <akim@epita.fr>
11571
11572 * data/bison.simple (b4_token_enum): New.
11573 (b4_token_defines): Use it to output tokens both as #define and
11574 enums.
11575 Suggested by Paul Eggert.
11576 * src/output.c (token_definitions_output): Don't output spurious
11577 white spaces.
11578
11579 2002-05-03 Akim Demaille <akim@epita.fr>
11580
11581 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11582
11583 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
11584
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.
11587
11588 2002-05-02 Akim Demaille <akim@epita.fr>
11589
11590 * data/bison.simple (yyparse): Do not implement @$ = @1.
11591 (YYLLOC_DEFAULT): Adjust to do it.
11592 * doc/bison.texinfo (Location Default Action): Fix.
11593
11594 2002-05-02 Akim Demaille <akim@epita.fr>
11595
11596 * src/reader.c (parse_braces): Merge into...
11597 (parse_action): this.
11598
11599 2002-05-02 Akim Demaille <akim@epita.fr>
11600
11601 * configure.in (ALL_LINGUAS): Remove.
11602 * po/LINGUAS, hr.po: New.
11603
11604 2002-05-02 Akim Demaille <akim@epita.fr>
11605
11606 Remove the so called hairy (semantic) parsers.
11607
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
11613 support.
11614 * src/output.c, src/output.h (guards_output): Remove.
11615 (prepare): Adjust.
11616 (token_definitions_output): Don't output the `T'
11617 tokens (???).
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
11621 members.
11622 Adjust dependencies.
11623 (parse_guard): Remove.
11624 * data/bison.hairy: Remove.
11625 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11626 BISON_HAIRY.
11627
11628 2002-05-02 Akim Demaille <akim@epita.fr>
11629
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.
11633 Adjust callers.
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
11639 always use `-n'.
11640 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11641 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11642
11643 2002-05-02 Akim Demaille <akim@epita.fr>
11644
11645 * configure.in (AC_INIT): Bump to 1.49b.
11646 (AM_INIT_AUTOMAKE): Short invocation.
11647
11648 2002-05-02 Akim Demaille <akim@epita.fr>
11649
11650 Version 1.49a.
11651
11652 2002-05-01 Akim Demaille <akim@epita.fr>
11653
11654 * src/skeleton.h: Remove.
11655
11656 2002-05-01 Akim Demaille <akim@epita.fr>
11657
11658 * src/skeleton.h: Fix the #endif.
11659 Reported by Magnus Fromreide.
11660
11661 2002-04-26 Paul Eggert <eggert@twinsun.com>
11662
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.
11666
11667 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
11668
11669 * src/scan-skel.l: Postprocess quadrigraphs.
11670
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.
11678
11679 * tests/calc.at: Exercise M4 quoting.
11680
11681 2002-04-25 Akim Demaille <akim@epita.fr>
11682
11683 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11684 between `!' and the command.
11685 Reported by Paul Eggert.
11686
11687 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
11688
11689 * tests/calc.at: Exercise prologue splitting.
11690
11691 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11692 `b4_post_prologue' instead of `b4_prologue'.
11693
11694 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11695 muscles.
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.
11703
11704 2002-04-23 Paul Eggert <eggert@twinsun.com>
11705
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).
11709
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.
11714
11715 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11716
11717 2002-04-23 Akim Demaille <akim@epita.fr>
11718
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.
11724
11725 2002-04-22 Akim Demaille <akim@epita.fr>
11726
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.
11731
11732 2002-04-22 Akim Demaille <akim@epita.fr>
11733
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.
11737
11738 2002-04-22 Akim Demaille <akim@epita.fr>
11739
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.
11743
11744 2002-04-22 Akim Demaille <akim@epita.fr>
11745
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)).
11755
11756 2002-04-22 Akim Demaille <akim@epita.fr>
11757
11758 Propagate more token_number_t.
11759
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.
11769
11770 2002-04-22 Akim Demaille <akim@epita.fr>
11771
11772 * src/output.h, src/output.c (get_lines_number): Remove.
11773
11774 2002-04-19 Akim Demaille <akim@epita.fr>
11775
11776 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11777 as Lex/Flex'.
11778 (Debugging): More details about enabling the debugging features.
11779 (Table of Symbols): Describe $$, $n, @$, and @n.
11780 Suggested by Tim Josling.
11781
11782 2002-04-19 Akim Demaille <akim@epita.fr>
11783
11784 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11785
11786 2002-04-10 Akim Demaille <akim@epita.fr>
11787
11788 * src/system.h: Rely on HAVE_LIMITS_H.
11789 Suggested by Paul Eggert.
11790
11791 2002-04-09 Akim Demaille <akim@epita.fr>
11792
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.
11801 Adjust the tests.
11802 Error message are for stderr, not stdout.
11803
11804 2002-04-09 Akim Demaille <akim@epita.fr>
11805
11806 * src/gram.h, src/gram.c (error_token_number): Remove, use
11807 errtoken->number.
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
11814 hard coded 2.
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
11817 might not be 2).
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.
11824
11825 * tests/conflicts.at (Solved SR Conflicts)
11826 (Unresolved SR Conflicts): Adjust.
11827 * tests/regression.at (Web2c Actions): Adjust.
11828
11829 2002-04-08 Akim Demaille <akim@epita.fr>
11830
11831 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11832 Adding #line.
11833 Remove the duplicate `typedefs'.
11834 (RhsNumberType): Fix the declaration and various other typos.
11835 Use __ofile__.
11836 * data/bison.simple: Use __ofile__.
11837 * src/scan-skel.l: Handle __ofile__.
11838
11839 2002-04-08 Akim Demaille <akim@epita.fr>
11840
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
11844 numbers.
11845 Adjust all dependencies (pretty many).
11846 * src/reduce.c (rule): Remove this `short *' pointer: use
11847 item_number_t.
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
11857 500.
11858 * tests/regression.at (Web2c Actions): Ajust.
11859
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
11864 C), it passes.
11865 * src/state.h (state_h): Code input lines on ints, not shorts.
11866
11867 2002-04-08 Akim Demaille <akim@epita.fr>
11868
11869 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11870 and then the grammar.
11871
11872 2002-04-08 Akim Demaille <akim@epita.fr>
11873
11874 * src/system.h: No longer using strndup.
11875
11876 2002-04-07 Akim Demaille <akim@epita.fr>
11877
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):
11882 New.
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
11886 253.
11887 * tests/regression.at (Web2c Actions): Adjust.
11888
11889 2002-04-07 Akim Demaille <akim@epita.fr>
11890
11891 * tests/torture.at (Big triangle): New.
11892 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11893 * tests/existing.at: here.
11894
11895 2002-04-07 Akim Demaille <akim@epita.fr>
11896
11897 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11898 nritems.
11899 Adjust dependencies.
11900
11901 2002-04-07 Akim Demaille <akim@epita.fr>
11902
11903 * src/reader.c: Normalize increments to prefix form.
11904
11905 2002-04-07 Akim Demaille <akim@epita.fr>
11906
11907 * src/reader.c, symtab.c: Remove debugging code.
11908
11909 2002-04-07 Akim Demaille <akim@epita.fr>
11910
11911 Rename all the `bucket's as `symbol_t'.
11912
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...
11916 (symbol_t): this.
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.
11925
11926 2002-04-07 Akim Demaille <akim@epita.fr>
11927
11928 Use lib/hash for the symbol table.
11929
11930 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11931 EOF.
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
11941 members.
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.
11946
11947 2002-04-07 Akim Demaille <akim@epita.fr>
11948
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):
11953 Initialize.
11954 (reader): Don't.
11955 (errtoken, eoftoken, undeftoken, axiom): Extern.
11956
11957 2002-04-07 Akim Demaille <akim@epita.fr>
11958
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.
11963
11964 2002-04-07 Akim Demaille <akim@epita.fr>
11965
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.
11968
11969 2002-04-07 Akim Demaille <akim@epita.fr>
11970
11971 * src/lalr.h (LA): Is a bitsetv, not bitset*.
11972
11973 2002-04-07 Akim Demaille <akim@epita.fr>
11974
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.
11978
11979 2002-04-07 Akim Demaille <akim@epita.fr>
11980
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.
11985
11986 2002-04-07 Akim Demaille <akim@epita.fr>
11987
11988 As a result of the previous patch, it is no longer needed
11989 to reorder ritem itself.
11990
11991 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
11992
11993 2002-04-07 Akim Demaille <akim@epita.fr>
11994
11995 Be sure never to walk through RITEMS, but use only data related to
11996 the rules themselves. RITEMS should be banished.
11997
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.
12011
12012 2002-04-07 Akim Demaille <akim@epita.fr>
12013
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
12019 new_state.
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'.
12023
12024 As a result, now the rule 0, reducing to $axiom, is visible in the
12025 outputs. Adjust the test suite.
12026
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.
12031
12032 2002-04-07 Akim Demaille <akim@epita.fr>
12033
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.
12037
12038 2002-04-07 Akim Demaille <akim@epita.fr>
12039
12040 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12041 bucket.
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'.
12049
12050 2002-04-07 Akim Demaille <akim@epita.fr>
12051
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.
12062
12063 2002-04-07 Akim Demaille <akim@epita.fr>
12064
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...
12068
12069 2002-04-07 Akim Demaille <akim@epita.fr>
12070
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.
12074
12075 2002-04-07 Akim Demaille <akim@epita.fr>
12076
12077 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12078 Normalize loops to using `< nrules + 1', not `<= nrules'.
12079
12080 2002-04-07 Akim Demaille <akim@epita.fr>
12081
12082 * TODO: Update.
12083
12084 2002-04-07 Akim Demaille <akim@epita.fr>
12085
12086 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12087 bucket.value as bucket.number.
12088
12089 2002-04-07 Akim Demaille <akim@epita.fr>
12090
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.
12095
12096 2002-04-04 Paul Eggert <eggert@twinsun.com>
12097
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.
12103
12104 2002-04-03 Paul Eggert <eggert@twinsun.com>
12105
12106 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12107 YYERROR_VERBOSE is nonzero, not whether it is defined.
12108
12109 Merge changes from bison-1_29-branch.
12110
12111 2002-03-20 Paul Eggert <eggert@twinsun.com>
12112
12113 Merge fixes from Debian bison_1.34-1.diff.
12114
12115 * configure.in (AC_PREREQ): 2.53.
12116
12117 2002-03-20 Akim Demaille <akim@epita.fr>
12118
12119 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12120
12121 2002-03-19 Paul Eggert <eggert@twinsun.com>
12122
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.
12127
12128 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12129 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12130
12131 2002-03-19 Akim Demaille <akim@epita.fr>
12132
12133 Test and fix the #line outputs.
12134
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.
12141
12142 2002-03-19 Akim Demaille <akim@epita.fr>
12143
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.
12148
12149 2002-03-19 Akim Demaille <akim@epita.fr>
12150
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'.
12157
12158 2002-03-14 Akim Demaille <akim@epita.fr>
12159
12160 Use Gettext 0.11.1.
12161
12162 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
12163
12164 * data/bison.c++: Make the user able to add members to the generated
12165 parser by subclassing.
12166
12167 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
12168
12169 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12170 a character.
12171 Reported by Nicolas Tisserand and Nicolas Burrus.
12172
12173 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12174
12175 * src/reader.c: Warn about lacking semi-colons, do not complain.
12176
12177 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12178
12179 * data/bison.c++: Remove a debug line.
12180
12181 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12182
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.
12186
12187 2002-03-04 Akim Demaille <akim@epita.fr>
12188
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
12194 with a semi-colon.
12195
12196 2002-03-04 Akim Demaille <akim@epita.fr>
12197
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
12201 RTC.
12202 * src/warshall.h, src/warshall.c: Remove.
12203 * tests/sets.at (Broken Closure): Adjust.
12204
12205 2002-03-04 Akim Demaille <akim@epita.fr>
12206
12207 * src/output.c (output_skeleton): tempdir is const.
12208 bytes_read is unused.
12209
12210 2002-03-04 Akim Demaille <akim@epita.fr>
12211
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:
12214 Update.
12215 From Michael Hayes.
12216
12217 2002-03-04 Akim Demaille <akim@epita.fr>
12218
12219 * src/closure.c (closure): `r' is unused.
12220
12221 2002-03-04 Akim Demaille <akim@epita.fr>
12222
12223 * tests/sets.at (Broken Closure): Add the ending `;'.
12224 * src/reader.at (readgram): Complain if a rule is not ended with a
12225 semi-colon.
12226
12227 2002-03-04 Akim Demaille <akim@epita.fr>
12228
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.
12234
12235 2002-03-04 Akim Demaille <akim@epita.fr>
12236
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.
12240
12241 2002-03-04 Akim Demaille <akim@epita.fr>
12242
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.
12247
12248 2002-03-04 Akim Demaille <akim@epita.fr>
12249
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.
12253
12254 2002-03-04 Akim Demaille <akim@epita.fr>
12255
12256 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12257 before returning.
12258 Reported by Benoit Perrot.
12259
12260 2002-03-04 Akim Demaille <akim@epita.fr>
12261
12262 Use bitset operations when possible, not loops over bits.
12263
12264 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12265 bitset_or.
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.
12269
12270 2002-03-04 Akim Demaille <akim@epita.fr>
12271
12272 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12273 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12274 Ditto.
12275
12276 2002-03-04 Akim Demaille <akim@epita.fr>
12277
12278 * src/lalr.c (F): Now a bitset*.
12279 Adjust all dependencies.
12280
12281 2002-03-04 Akim Demaille <akim@epita.fr>
12282
12283 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12284 Adjust all dependencies.
12285
12286 2002-03-04 Akim Demaille <akim@epita.fr>
12287
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
12291 bitset*.
12292 Adjust all dependencies.
12293
12294 2002-03-04 Akim Demaille <akim@epita.fr>
12295
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.
12300
12301 2002-03-04 Akim Demaille <akim@epita.fr>
12302
12303 * src/print.c: Convert to use bitset.h, not hand coded iterations
12304 over ints.
12305
12306 2002-03-04 Akim Demaille <akim@epita.fr>
12307
12308 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12309
12310 2002-03-04 Akim Demaille <akim@epita.fr>
12311
12312 * src/closure.c (ruleset): Be a bitset.
12313 (rulesetsize): Remove.
12314
12315 2002-03-04 Akim Demaille <akim@epita.fr>
12316
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.
12321
12322 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
12323
12324 * data/bison.c++: Merge the two generated headers. Insert a copyright
12325 notice in each output file.
12326
12327 2002-02-28 Akim Demaille <akim@epita.fr>
12328
12329 * data/bison.c++: Copy the prologue of bison.simple to fetch
12330 useful M4 definitions, such as b4_header_guard.
12331
12332 2002-02-25 Akim Demaille <akim@epita.fr>
12333
12334 * src/getargs.c (version): Give the name of the authors, and use a
12335 translator friendly scheme for the bgr
12336 copyright notice.
12337
12338 2002-02-25 Akim Demaille <akim@epita.fr>
12339
12340 * src/output.c (header_output): Remove, now handled completely via
12341 M4.
12342
12343 2002-02-25 Akim Demaille <akim@epita.fr>
12344
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
12348 hard coded name.
12349
12350 2002-02-25 Akim Demaille <akim@epita.fr>
12351
12352 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12353 Fileutils 4.1.5.
12354 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12355 * src/output.c (output_skeleton): Use mkstemp to create a real
12356 temporary file.
12357 Move the filling of `skeleton' and its muscle to...
12358 (prepare): here.
12359 (output): Move the definition of the prologue muscle to...
12360 (prepare): here.
12361 * src/system.h (DEFAULT_TMPDIR): New.
12362
12363 2002-02-14 Paul Eggert <eggert@twinsun.com>
12364
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.
12369
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.
12377
12378 2002-02-14 Akim Demaille <akim@epita.fr>
12379
12380 * tests/regression.at (else): Adjust to Andreas' change.
12381
12382 2002-02-14 Akim Demaille <akim@epita.fr>
12383
12384 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12385
12386 2002-02-13 Andreas Schwab <schwab@suse.de>
12387
12388 * src/output.c (output_rule_data): Don't output NULL, it might
12389 not be defined yet.
12390
12391 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
12392
12393 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12394 (Copyright notice): Update.
12395
12396 2002-02-11 Akim Demaille <akim@epita.fr>
12397
12398 * tests/regression.at (%nonassoc and eof): Don't include
12399 nonportable headers.
12400
12401 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
12402
12403 * data/bison.c++: Correct error recovery. Make the user able to
12404 initialize the starting location.
12405
12406 2002-02-07 Akim Demaille <akim@epita.fr>
12407
12408 * tests/input.at: New.
12409
12410 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12411
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.
12415
12416 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12417
12418 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12419 C++ parsers.
12420 (yy::b4_name::parse): Use print_.
12421
12422 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12423
12424 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12425
12426 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12427
12428 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12429 C++ parsers.
12430 (yy::b4_name::parse): Build verbose error messages, and use error_.
12431
12432 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12433
12434 * data/bison.c++: Fix m4 quoting in comments.
12435
12436 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12437
12438 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12439 not expanded by m4.
12440
12441 2002-02-05 Akim Demaille <akim@epita.fr>
12442
12443 * data/bison.c++: Adjust to the M4 back end.
12444 More is certainly needed.
12445
12446 2002-02-05 Akim Demaille <akim@epita.fr>
12447
12448 Give a try to M4 as a back end.
12449
12450 * lib/readpipe.c: New, from wdiff.
12451 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12452 BISON_HAIRY.
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
12461 action member.
12462 Adjust callers.
12463 (output_skeleton): Don't look for the skeleton location, let m4 do
12464 that.
12465 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12466 file will be used.
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
12477 to date.
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.
12482
12483 2002-02-05 Akim Demaille <akim@epita.fr>
12484
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.
12488
12489 2002-02-05 Akim Demaille <akim@epita.fr>
12490
12491 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12492 which have no values.
12493
12494 2002-02-05 Akim Demaille <akim@epita.fr>
12495
12496 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12497 * data/: here.
12498
12499 2002-01-29 Paul Eggert <eggert@twinsun.com>
12500
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).
12504
12505 2002-01-27 Akim Demaille <akim@epita.fr>
12506
12507 Fix `%nonassoc and eof'.
12508
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);
12512 with
12513 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12514 !!!
12515 * tests/regression.at (%nonassoc and eof): Adjust to newest
12516 Autotest: `.' is not in the PATH.
12517
12518 2002-01-27 Akim Demaille <akim@epita.fr>
12519
12520 * tests/sets.at (AT_EXTRACT_SETS): New.
12521 (Nullable): Use it.
12522 (Firsts): New.
12523
12524 2002-01-26 Akim Demaille <akim@epita.fr>
12525
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.
12529
12530 2002-01-25 Akim Demaille <akim@epita.fr>
12531
12532 * tests/regression.at (%nonassoc and eof): New.
12533 Suggested by Robert Anisko.
12534
12535 2002-01-24 Akim Demaille <akim@epita.fr>
12536
12537 Bison dumps core when trying to complain about broken input files.
12538 Reported by Cris van Pelt.
12539
12540 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12541 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12542 into...
12543 (Invalid inputs): Strengthen: exercise parse_percent_token.
12544
12545 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
12546
12547 * src/Makefile.am: Add bison.c++.
12548 * src/bison.c++: New skeleton.
12549
12550 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
12551
12552 * po/it.po: New.
12553
12554 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12555
12556 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12557
12558 2002-01-20 Marc Autret <marc@gnu.org>
12559
12560 * src/files.c (compute_output_file_names): Fix
12561
12562 2002-01-20 Marc Autret <marc@gnu.org>
12563
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.
12568
12569 2002-01-20 Marc Autret <marc@gnu.org>
12570
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.
12574
12575 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12576
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).
12581
12582 2002-01-11 Akim Demaille <akim@epita.fr>
12583
12584 * configure.in: Use AC_FUNC_STRNLEN.
12585 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
12586
12587 2002-01-09 Akim Demaille <akim@epita.fr>
12588
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
12593 `output-suffix'.
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.
12600
12601 2002-01-09 Akim Demaille <akim@epita.fr>
12602
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.
12608
12609 2002-01-08 Akim Demaille <akim@epita.fr>
12610
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.
12617
12618 2002-01-08 Akim Demaille <akim@epita.fr>
12619
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
12624 prototype.
12625
12626 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12627
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.
12633
12634 2002-01-06 Akim Demaille <akim@epita.fr>
12635
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.
12641
12642 2002-01-06 Akim Demaille <akim@epita.fr>
12643
12644 Bison is dead wrong in its RR conflict reports.
12645
12646 * tests/torture.at (GNU Cim Grammar): New.
12647 * src/conflicts.c (count_rr_conflicts): Fix.
12648
12649 2002-01-06 Akim Demaille <akim@epita.fr>
12650
12651 Creating package.m4 from configure.ac causes too many problems.
12652
12653 * tests/Makefile.am (package.m4): Create it by hand,
12654 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12655
12656 2002-01-06 Akim Demaille <akim@epita.fr>
12657
12658 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12659 skeleton.h.
12660
12661 2002-01-04 Paul Eggert <eggert@twinsun.com>
12662
12663 * doc/bison.texinfo (Debugging):
12664 Remove YYSTDERR; it's no longer defined or used.
12665 Also, s/cstdio.h/cstdio/.
12666
12667 2002-01-03 Akim Demaille <akim@epita.fr>
12668
12669 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12670
12671 2002-01-03 Akim Demaille <akim@epita.fr>
12672
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
12675 args.
12676
12677 2002-01-03 Akim Demaille <akim@epita.fr>
12678
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/.
12685
12686 2002-01-03 Akim Demaille <akim@epita.fr>
12687
12688 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12689 for non system headers.
12690
12691 2002-01-02 Akim Demaille <akim@epita.fr>
12692
12693 Equip the skeleton chain with location tracking, runtime trace,
12694 pure parser and scanner.
12695
12696 * src/parse-skel.y: Request a pure parser, locations, and prefix
12697 renaming.
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.
12703 Handle locations.
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.
12707
12708 2001-12-30 Akim Demaille <akim@epita.fr>
12709
12710 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12711 replace `gb' with BLANKS.
12712 * src/scan-skel.l: Adjust.
12713
12714 2001-12-30 Akim Demaille <akim@epita.fr>
12715
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
12721 not visible.
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.
12726
12727 2001-12-30 Akim Demaille <akim@epita.fr>
12728
12729 * src/skeleton.h: New.
12730 * src/output.c (output_parser, output_master_parser): Remove, dead
12731 code.
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'.
12743
12744 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
12745
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...
12750
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
12755 names.
12756
12757 * src/files.h (strsuffix, stringappend): Add declarations.
12758 (tab_extension): Add declaration.
12759 (short_base_name): Add declaration.
12760
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
12766 names.
12767 (short_base_name): No longer static.
12768
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.
12774
12775 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12776
12777 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
12778 parse-skel.y.
12779
12780 * src/parse-skel.y: New file.
12781 * src/scan-skel.l: New file.
12782
12783 2001-12-29 Akim Demaille <akim@epita.fr>
12784
12785 %name-prefix is broken.
12786
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
12790 %name-prefix.
12791
12792 Renaming yylval but not yylloc is not consistent. Now we do.
12793
12794 * src/bison.simple: Prefix yylloc if used.
12795 * doc/bison.texinfo (Decl Summary): Document that.
12796
12797 2001-12-29 Akim Demaille <akim@epita.fr>
12798
12799 * doc/bison.texinfo: Promote `%long-directive' over
12800 `%long_directive'.
12801 Remove all references to fixed-output-files, yacc is enough.
12802
12803 2001-12-29 Akim Demaille <akim@epita.fr>
12804
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.
12809
12810 2001-12-29 Akim Demaille <akim@epita.fr>
12811
12812 * src/output.c (header_output): Don't forget to export YYLTYPE and
12813 yylloc.
12814 * tests/headers.at (export YYLTYPE): New, make sure it does.
12815 * tests/regression.at (%union and --defines, Invalid CPP headers):
12816 Move to...
12817 * tests/headers.at: here.
12818
12819 2001-12-29 Akim Demaille <akim@epita.fr>
12820
12821 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12822
12823 2001-12-29 Akim Demaille <akim@epita.fr>
12824
12825 * tests/actions.at (Mid-rule actions): Output on a single line
12826 instead of several.
12827
12828 2001-12-29 Akim Demaille <akim@epita.fr>
12829
12830 * doc/bison.texinfo: Formatting changes.
12831
12832 2001-12-29 Akim Demaille <akim@epita.fr>
12833
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.
12836
12837 * src/output.c (token_definitions_output): New.
12838 (output_parser, header_output): Use it.
12839 * src/reader.c (symbols_save): Remove.
12840
12841 2001-12-29 Akim Demaille <akim@epita.fr>
12842
12843 * src/bison.simple: Do not provide a default for YYSTYPE and
12844 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12845 default.
12846
12847 2001-12-29 Akim Demaille <akim@epita.fr>
12848
12849 Mid-rule actions are simply... ignored!
12850
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
12853 rule.
12854 * tests/actions.at (Mid-rule actions): New.
12855
12856 2001-12-29 Akim Demaille <akim@epita.fr>
12857
12858 Memory leak.
12859
12860 * src/reader.c (reader): Free grammar.
12861
12862 2001-12-29 Akim Demaille <akim@epita.fr>
12863
12864 Memory leak.
12865
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.
12869
12870 2001-12-29 Akim Demaille <akim@epita.fr>
12871
12872 * src/options.h, src/options.c (create_long_option_table): Rename
12873 as...
12874 (long_option_table_new): this, with a clearer prototype.
12875 (percent_table): Remove, unused,
12876 * src/getargs.c (getargs): Adjust.
12877
12878 2001-12-29 Akim Demaille <akim@epita.fr>
12879
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
12882 as states.
12883
12884 2001-12-29 Akim Demaille <akim@epita.fr>
12885
12886 * src/lalr.c (build_relations): Rename `states' as `states1'.
12887 Sorry, I don't understand exactly what it is, no better name...
12888
12889 2001-12-29 Akim Demaille <akim@epita.fr>
12890
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
12894 as rules.
12895
12896 2001-12-29 Akim Demaille <akim@epita.fr>
12897
12898 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12899 ago.
12900
12901 2001-12-29 Akim Demaille <akim@epita.fr>
12902
12903 * src/reader.c, src/reader.h (user_toknums): Remove.
12904 Adjust all users to use symbols[i]->user_token_number.
12905
12906 2001-12-29 Akim Demaille <akim@epita.fr>
12907
12908 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12909 Adjust all users to use symbols[i]->prec or ->assoc.
12910
12911 2001-12-29 Akim Demaille <akim@epita.fr>
12912
12913 * src/reader.c, src/reader.h (tags): Remove.
12914 Adjust all users to use symbols[i]->tag.
12915
12916 2001-12-29 Akim Demaille <akim@epita.fr>
12917
12918 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12919 and rule_table.
12920 * src/reader.c (packsymbols): Fill this table.
12921 Drop sprec.
12922 * src/conflicts.c (resolve_sr_conflict): Adjust.
12923 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12924 single table.
12925 Use symbols[i]->tag instead of tags[i].
12926
12927 2001-12-29 Akim Demaille <akim@epita.fr>
12928
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.
12932
12933 2001-12-29 Akim Demaille <akim@epita.fr>
12934
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
12940 harmless).
12941
12942 2001-12-29 Akim Demaille <akim@epita.fr>
12943
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.
12948
12949 2001-12-29 Akim Demaille <akim@epita.fr>
12950
12951 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12952 visible, and some states have now a different number.
12953
12954 2001-12-29 Akim Demaille <akim@epita.fr>
12955
12956 * src/reader.c (readgram): Bind the initial rule's lineno to that
12957 of the first rule.
12958 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12959 (Solved SR Conflicts): Adjust rule 0's line number.
12960
12961 2001-12-29 Akim Demaille <akim@epita.fr>
12962
12963 Fix the `GAWK Grammar' failure.
12964
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
12968 to 0.
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.
12973
12974 2001-12-29 Akim Demaille <akim@epita.fr>
12975
12976 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
12977 rule line numbers.
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
12981 now.
12982
12983 2001-12-29 Akim Demaille <akim@epita.fr>
12984
12985 * src/lalr.c (lookaheads_print): New.
12986 (lalr): Call it when --trace-flag.
12987 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
12988 are dumped.
12989
12990 2001-12-29 Akim Demaille <akim@epita.fr>
12991
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.
13001
13002 2001-12-29 Akim Demaille <akim@epita.fr>
13003
13004 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13005 the 0-sentinel.
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.
13011
13012 2001-12-29 Akim Demaille <akim@epita.fr>
13013
13014 * src/output.c: Comment changes.
13015
13016 2001-12-27 Paul Eggert <eggert@twinsun.com>
13017
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.
13022
13023 Also, catch up with 1.31's YYSTD.
13024
13025 2001-12-27 Akim Demaille <akim@epita.fr>
13026
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
13034 expect.
13035
13036 2001-12-27 Akim Demaille <akim@epita.fr>
13037
13038 * tests/regression.at (Unresolved SR Conflicts):
13039 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13040 below.
13041
13042 2001-12-27 Akim Demaille <akim@epita.fr>
13043
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
13055 items.
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.
13061
13062 2001-12-27 Akim Demaille <akim@epita.fr>
13063
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.
13068
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.
13077
13078 2001-12-27 Akim Demaille <akim@epita.fr>
13079
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
13085 is the eoftoken.
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.
13097
13098 2001-12-27 Akim Demaille <akim@epita.fr>
13099
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
13103 missing.
13104 * lib/strchr.c: New.
13105 * src/reader.c (symbols_save): Use strchr.
13106
13107 2001-12-27 Akim Demaille <akim@epita.fr>
13108
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.
13114
13115 2001-12-27 Akim Demaille <akim@epita.fr>
13116
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.
13124
13125 2001-12-27 Akim Demaille <akim@epita.fr>
13126
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.
13133
13134 2001-12-27 Akim Demaille <akim@epita.fr>
13135
13136 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13137
13138 2001-12-27 Akim Demaille <akim@epita.fr>
13139
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
13143 print_reductions.
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.
13148
13149 2001-12-27 Akim Demaille <akim@epita.fr>
13150
13151 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13152 `$n' and `@n'.
13153
13154 2001-12-27 Akim Demaille <akim@epita.fr>
13155
13156 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13157 (build_relations): Adjust.
13158
13159 2001-12-27 Akim Demaille <akim@epita.fr>
13160
13161 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13162 duplication.
13163
13164 2001-12-27 Akim Demaille <akim@epita.fr>
13165
13166 * src/reader.c (packgram): Catch nitems overflows.
13167
13168 2001-12-27 Akim Demaille <akim@epita.fr>
13169
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
13176 mandatory.
13177
13178 2001-12-27 Akim Demaille <akim@epita.fr>
13179
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
13182 members.
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
13189 guard.
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
13199 required.
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
13204 parser.
13205
13206 2001-12-27 Akim Demaille <akim@epita.fr>
13207
13208 * src/reader.c (symbol_list_new): Be sure to initialize all the
13209 fields.
13210
13211 2001-12-27 Akim Demaille <akim@epita.fr>
13212
13213 All the hacks using a final pseudo state are now useless.
13214
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).
13219
13220 2001-12-27 Akim Demaille <akim@epita.fr>
13221
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
13224 lookaheadsp.
13225
13226 2001-12-27 Akim Demaille <akim@epita.fr>
13227
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.
13243
13244 2001-12-27 Akim Demaille <akim@epita.fr>
13245
13246 * src/bison.hairy: Formatting/comment changes.
13247 ANSIfy.
13248 Remove `register' indications.
13249 Add plenty of `static'.
13250
13251 2001-12-27 Akim Demaille <akim@epita.fr>
13252
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.
13258
13259 2001-12-22 Akim Demaille <akim@epita.fr>
13260
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
13263 short.
13264 Reported by Wayne Green.
13265
13266 2001-12-22 Akim Demaille <akim@epita.fr>
13267
13268 Some actions of web2c.y are improperly triggered.
13269 Reported by Mike Castle.
13270
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.
13275
13276 2001-12-22 Akim Demaille <akim@epita.fr>
13277
13278 Reductions in web2c.y are improperly reported.
13279 Reported by Mike Castle.
13280
13281 * src/conflicts.c (print_reductions): Fix.
13282 * tests/regression.at (Web2c): New.
13283
13284 2001-12-18 Akim Demaille <akim@epita.fr>
13285
13286 Some host fail on `assert (!"foo")', which expands to
13287 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13288 Reported by Nelson Beebee.
13289
13290 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13291 `#define it_succeeded 0' and `assert (it_succeeded)'.
13292
13293 2001-12-17 Marc Autret <autret_m@epita.fr>
13294
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).
13298
13299 2001-12-17 Paul Eggert <eggert@twinsun.com>
13300
13301 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13302 YYDEBUG must be defined to a nonzero value.
13303
13304 * src/bison.simple (yytname): Do not assume that the user defines
13305 YYDEBUG to a properly parenthesized expression.
13306
13307 2001-12-17 Akim Demaille <akim@epita.fr>
13308
13309 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13310 nlookaheads is a new member.
13311 Adjust all users.
13312 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13313 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13314 state.
13315
13316 2001-12-17 Akim Demaille <akim@epita.fr>
13317
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,
13320 let...
13321 * src/reader.c (reader): Do it.
13322
13323 2001-12-17 Akim Demaille <akim@epita.fr>
13324
13325 * src/conflicts.c (print_reductions): Formatting changes.
13326
13327 2001-12-17 Akim Demaille <akim@epita.fr>
13328
13329 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13330 (flush_reduce): New.
13331 (resolve_sr_conflict): Adjust.
13332
13333 2001-12-17 Akim Demaille <akim@epita.fr>
13334
13335 * src/output.c (output_obstack): Be static and rename as...
13336 (format_obstack): this, to avoid any confusion with files.c's
13337 output_obstack.
13338 * src/reader.h (muscle_obstack): Move to...
13339 * src/output.h: here, since it's defined in output.c.
13340
13341 2001-12-17 Akim Demaille <akim@epita.fr>
13342
13343 * src/output.c (action_row, save_column, default_goto)
13344 (sort_actions, matching_state, pack_vector): Better variable
13345 locality.
13346
13347 2001-12-17 Akim Demaille <akim@epita.fr>
13348
13349 * src/output.c: Various formatting changes.
13350
13351 2001-12-17 Akim Demaille <akim@epita.fr>
13352
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.
13358
13359 2001-12-16 Marc Autret <autret_m@epita.fr>
13360
13361 * src/output.c (actions_output): Fix. When we use %no-lines,
13362 there is one less line per action.
13363
13364 2001-12-16 Marc Autret <autret_m@epita.fr>
13365
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
13370 output muscles.
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.
13375
13376 2001-12-15 Marc Autret <autret_m@epita.fr>
13377
13378 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13379
13380 2001-12-15 Marc Autret <autret_m@epita.fr>
13381
13382 * src/output.c (output_gram): Keep track of the hairy one.
13383
13384 2001-12-15 Akim Demaille <akim@epita.fr>
13385
13386 Make `make distcheck' work.
13387
13388 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13389 system.h which uses libgettext.h.
13390
13391 2001-12-15 Akim Demaille <akim@epita.fr>
13392
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.
13397
13398 2001-12-15 Akim Demaille <akim@epita.fr>
13399
13400 The header can also be produced directly, without any obstack!
13401 Yahoo!
13402
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
13408 anyway.
13409 (output_token_translations): Merge into...
13410 (symbols_output): this.
13411 Rename as...
13412 (symbols_save): this.
13413 (reader): Adjust.
13414 * src/output.c (header_output): New.
13415 (output): Call it.
13416
13417 2001-12-15 Akim Demaille <akim@epita.fr>
13418
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.
13424 Rename as...
13425 (copy_comment): this.
13426
13427 2001-12-15 Akim Demaille <akim@epita.fr>
13428
13429 * src/lex.c, src/lex.h (xgetc): No longer static.
13430 * src/reader.c (parse_union_decl): Revamp.
13431
13432 2001-12-15 Akim Demaille <akim@epita.fr>
13433
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.
13437
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.
13443
13444 2001-12-15 Akim Demaille <akim@epita.fr>
13445
13446 Attach actions to rules, instead of pre-outputting them to
13447 actions_obstack.
13448
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.
13456 (output): Do it.
13457 (prepare): Don't save the `action' muscle.
13458 * src/bison.simple: s/%%action/%%actions/.
13459
13460 2001-12-15 Akim Demaille <akim@epita.fr>
13461
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.
13465
13466 2001-12-14 Akim Demaille <akim@epita.fr>
13467
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.
13471
13472 2001-12-14 Akim Demaille <akim@epita.fr>
13473
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
13478 token strings.
13479
13480 2001-12-13 Paul Eggert <eggert@twinsun.com>
13481
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.
13486
13487 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13488
13489 2001-12-13 Akim Demaille <akim@epita.fr>
13490
13491 The computation of nullable is broken: it doesn't handle empty
13492 RHS's properly.
13493
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.
13498
13499 Work around Autotest bugs.
13500
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
13507 frames.
13508 Move to...
13509 * tests/sets.at: here.
13510
13511 2001-12-13 Akim Demaille <akim@epita.fr>
13512
13513 * src/closure.c (closure): Use nrules instead of playing tricks
13514 with BITS_PER_WORD.
13515
13516 2001-12-13 Akim Demaille <akim@epita.fr>
13517
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
13520 nonterminal.
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.
13529
13530 2001-12-13 Akim Demaille <akim@epita.fr>
13531
13532 * src/reader.c (readgram): Remove dead code, an strip useless
13533 braces.
13534 (get_type): Remove, unused.
13535
13536 2001-12-12 Akim Demaille <akim@epita.fr>
13537
13538 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13539 on that of lib/error.c.
13540
13541 2001-12-12 Akim Demaille <akim@epita.fr>
13542
13543 Some hosts don't like `/' in includes.
13544
13545 * src/system.h: Include libgettext.h without qualifying the path.
13546 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13547 $(top_srcdir).
13548
13549 2001-12-11 Marc Autret <autret_m@epita.fr>
13550
13551 * src/output.c (output_parser): Remove useless muscle.
13552
13553 2001-12-11 Marc Autret <autret_m@epita.fr>
13554
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.
13559
13560 2001-12-10 Marc Autret <autret_m@epita.fr>
13561
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.
13566
13567 2001-12-10 Marc Autret <autret_m@epita.fr>
13568
13569 * src/reader.c (symbols_output): Clean up.
13570 * src/output.c (output_gram, output): Clean up.
13571
13572 2001-12-10 Akim Demaille <akim@epita.fr>
13573
13574 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13575 * src/LR0.c (set_state_table): here.
13576 * src/lalr.c (lalr): Call it.
13577
13578 2001-12-10 Akim Demaille <akim@epita.fr>
13579
13580 * src/state.h (shifts): Remove the `number' member: shifts are
13581 attached to state, hence no longer need to be labelled with a
13582 state number.
13583
13584 2001-12-10 Akim Demaille <akim@epita.fr>
13585
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.
13588
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.
13596
13597 2001-12-10 Akim Demaille <akim@epita.fr>
13598
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.
13603
13604 2001-12-10 Akim Demaille <akim@epita.fr>
13605
13606 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13607 only when appropriate: when insert_start_shifting_state' is not
13608 invoked.
13609 * tests/regression.at (Rule Line Numbers): Adjust.
13610
13611 2001-12-10 Akim Demaille <akim@epita.fr>
13612
13613 * src/LR0.c (augment_automaton): Now that all states have shifts,
13614 merge the two cases addition shifts to the initial state.
13615
13616 2001-12-10 Akim Demaille <akim@epita.fr>
13617
13618 * src/lalr.c (set_state_table): Move to...
13619 * src/LR0.c: here.
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.
13623
13624 2001-12-10 Akim Demaille <akim@epita.fr>
13625
13626 * src/LR0.h (first_shift, first_reduction): Remove.
13627 * src/lalr.c: Don't use first_shift: find shifts through the
13628 states.
13629
13630 2001-12-10 Akim Demaille <akim@epita.fr>
13631
13632 * src/LR0.c: Attach shifts to states as soon as they are
13633 computed.
13634 * src/lalr.c (set_state_table): Instead of assigning shifts to
13635 state, just assert that the mapping was properly done.
13636
13637 2001-12-10 Akim Demaille <akim@epita.fr>
13638
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!
13648
13649 2001-12-10 Akim Demaille <akim@epita.fr>
13650
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?
13658
13659 2001-12-10 Akim Demaille <akim@epita.fr>
13660
13661 * src/muscle_tab.c (muscle_init): NULL is a better default than
13662 `"0"'.
13663
13664 2001-12-10 Akim Demaille <akim@epita.fr>
13665
13666 * src/reader.c (reader): Calling symbols_output once is enough.
13667
13668 2001-12-10 Akim Demaille <akim@epita.fr>
13669
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
13672 member.
13673
13674 * src/state.h (struct reductions): Remove member `number' and
13675 `next'.
13676 * src/LR0.c (first_reduction, last_reduction): Remove.
13677 (save_reductions): Don't link the new reductions, store them in
13678 this_state.
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
13683 members.
13684
13685 2001-12-10 Akim Demaille <akim@epita.fr>
13686
13687 * src/options.c (OPTN, DRTV, BOTH): New.
13688 (option_table): Use them.
13689
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
13693 reasons.
13694
13695 2001-12-10 Akim Demaille <akim@epita.fr>
13696
13697 * src/output.c (output, prepare): Make sure the values of the
13698 muscles `action' and `prologue' are 0-terminated.
13699
13700 2001-12-10 Akim Demaille <akim@epita.fr>
13701
13702 Clean up GCC warnings.
13703
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.
13711
13712 2001-12-10 Akim Demaille <akim@epita.fr>
13713
13714 * configure.in: Require 2.52g.
13715 M4 is not needed, but AUTOM4TE is.
13716 * m4/m4.m4: Remove.
13717 * tests/Makefile.am: Adjust.
13718
13719 2001-12-10 Akim Demaille <akim@epita.fr>
13720
13721 One structure for states is enough, even though theoretically
13722 there are LR(0) states and LALR(1) states.
13723
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
13731 `state_table'.
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.
13734
13735 2001-12-10 Akim Demaille <akim@epita.fr>
13736
13737 Bison dumps core on bash.y.
13738 Reported by Pascal Bart.
13739
13740 * src/warshall.c (bitmatrix_print): New.
13741 (TC): Use it.
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.
13745
13746 2001-12-05 Akim Demaille <akim@epita.fr>
13747
13748 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13749 its argument.
13750 Reported by Peter Hamorsky.
13751
13752 2001-12-05 Akim Demaille <akim@epita.fr>
13753
13754 * src/conflicts.c (err_table): Remove.
13755 (resolve_sr_conflict): Adjust.
13756 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13757 Rename as...
13758 (state_t.reductions, state_t.shifts): this.
13759
13760 2001-12-05 Akim Demaille <akim@epita.fr>
13761
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.
13768
13769 2001-12-05 Akim Demaille <akim@epita.fr>
13770
13771 * src/output.c (pack_vector): Use assert, not berror.
13772 * src/main.c (berror): Remove, unused.
13773
13774 2001-12-05 Akim Demaille <akim@epita.fr>
13775
13776 New experimental feature: if --verbose --trace output all the
13777 items of a state, not only its kernel.
13778
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.
13783
13784 2001-12-05 Akim Demaille <akim@epita.fr>
13785
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.
13789
13790 2001-12-05 Akim Demaille <akim@epita.fr>
13791
13792 * src/closure.c (print_closure): Improve.
13793 (closure): Use it for printing input and output.
13794
13795 2001-12-05 Akim Demaille <akim@epita.fr>
13796
13797 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13798 indexed by nonterminals.
13799
13800 2001-12-05 Akim Demaille <akim@epita.fr>
13801
13802 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13803 what it was!).
13804 * src/warshall.h: Remove accidental duplication of the content.
13805
13806 2001-12-05 Akim Demaille <akim@epita.fr>
13807
13808 * src/closure.c (set_fderives): De-obfuscate.
13809
13810 2001-12-05 Akim Demaille <akim@epita.fr>
13811
13812 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13813
13814 2001-12-05 Akim Demaille <akim@epita.fr>
13815
13816 * src/closure.c (set_firsts): De-obfuscate.
13817
13818 2001-12-05 Akim Demaille <akim@epita.fr>
13819
13820 * src/output.c (action_row): De-obfuscate
13821 using the good o' techniques: arrays not pointers, variable
13822 locality, BITISSET, RESETBIT etc.
13823
13824 2001-12-05 Akim Demaille <akim@epita.fr>
13825
13826 Pessimize the code to simplify it: from now on, all the states
13827 have a valid SHIFTS, which NSHIFTS is possibly 0.
13828
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.
13833
13834 2001-12-05 Akim Demaille <akim@epita.fr>
13835
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''.
13840
13841 2001-12-05 Akim Demaille <akim@epita.fr>
13842
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.
13846
13847 2001-12-05 Akim Demaille <akim@epita.fr>
13848
13849 * src/state.h (SHIFT_SYMBOL): New.
13850 * src/conflicts.c: Use it to deobfuscate.
13851
13852 2001-12-05 Akim Demaille <akim@epita.fr>
13853
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.
13857
13858 2001-12-05 Akim Demaille <akim@epita.fr>
13859
13860 * src/conflicts.c (print_reductions): Arrays, not pointers.
13861 Use BITISSET.
13862
13863 2001-12-05 Akim Demaille <akim@epita.fr>
13864
13865 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13866
13867 2001-12-05 Akim Demaille <akim@epita.fr>
13868
13869 * src/conflicts.c (print_reductions): Improve variable locality.
13870
13871 2001-12-05 Akim Demaille <akim@epita.fr>
13872
13873 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13874
13875 2001-12-05 Akim Demaille <akim@epita.fr>
13876
13877 * src/conflicts.c (print_reductions): Improve variable locality.
13878
13879 2001-12-05 Akim Demaille <akim@epita.fr>
13880
13881 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13882 * src/lalr.c: Use them.
13883
13884 2001-12-05 Akim Demaille <akim@epita.fr>
13885
13886 * src/LR0.c (augment_automaton): Formatting changes.
13887 Better variable locality.
13888
13889 2001-12-05 Akim Demaille <akim@epita.fr>
13890
13891 * src/lalr.c (matrix_print): New.
13892 (transpose): Use it.
13893 Use arrays instead of pointers.
13894
13895 2001-12-05 Akim Demaille <akim@epita.fr>
13896
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.
13900
13901 2001-12-05 Akim Demaille <akim@epita.fr>
13902
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
13906 deallocation.
13907 Improve variable locality.
13908 Avoid variables used as mere abbreviations.
13909 (compute_lookaheads): Use arrays instead of pointers.
13910
13911 2001-12-05 Akim Demaille <akim@epita.fr>
13912
13913 * src/lalr.c (initialize_F): Improve variable locality.
13914 Avoid variables used as mere abbreviations.
13915
13916 2001-12-05 Akim Demaille <akim@epita.fr>
13917
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.
13922
13923 2001-12-05 Akim Demaille <akim@epita.fr>
13924
13925 * src/lalr.c (traverse): Use arrays instead of pointers.
13926
13927 2001-12-05 Akim Demaille <akim@epita.fr>
13928
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'.
13932
13933 2001-12-05 Akim Demaille <akim@epita.fr>
13934
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.
13939
13940 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13941 static.
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
13946 given state.
13947 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13948 only, and...
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
13953 be null.
13954
13955 2001-12-05 Akim Demaille <akim@epita.fr>
13956
13957 * src/nullable.c (set_nullable): Deobfuscate the handling of
13958 ritem.
13959 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13960
13961 2001-12-05 Akim Demaille <akim@epita.fr>
13962
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
13968 ritem.
13969
13970 2001-12-04 Paul Eggert <eggert@twinsun.com>
13971
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.
13979
13980 2001-11-30 Akim Demaille <akim@epita.fr>
13981
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.
13989
13990 2001-11-27 Paul Eggert <eggert@twinsun.com>
13991
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.
14000
14001 2001-11-29 Paul Eggert <eggert@twinsun.com>
14002
14003 Name space cleanup in generated parser.
14004
14005 * doc/bison.texinfo (Bison Parser): Discuss system headers
14006 and their effect on the user name space.
14007
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).
14012
14013 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14014 on user names when possible.
14015
14016 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14017 Simplify test for whather <alloca.h> exists.
14018
14019 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14020
14021 (<stdio.h>): Include if YYDEBUG.
14022
14023 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14024 ! defined (yyoverflow) && ! defined (yymemcpy).
14025
14026 (yymemcpy, yyparse): Rename local variables as needed so that
14027 they all begin with 'yy'.
14028
14029 (yystrlen, yystpcpy): New functions.
14030
14031 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14032 All uses changed.
14033
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.
14037
14038 2001-11-30 Akim Demaille <akim@epita.fr>
14039
14040 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14041 before their first uses.
14042 (YYBISON, YYPURE): Move to the top of the output.
14043
14044 2001-11-30 Akim Demaille <akim@epita.fr>
14045
14046 * tests/reduce.at (Useless Nonterminals): Fix.
14047
14048 2001-11-30 Akim Demaille <akim@epita.fr>
14049
14050 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14051 if body instead of `;' to pacify GCC's warnings.
14052
14053 2001-11-30 Akim Demaille <akim@epita.fr>
14054
14055 Instead of mapping the LHS of unused rules to -1, keep the LHS
14056 valid, but flag the rules as invalid.
14057
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.
14064
14065 2001-11-30 Akim Demaille <akim@epita.fr>
14066
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.
14071
14072 2001-11-30 Akim Demaille <akim@epita.fr>
14073
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.
14078
14079 2001-11-30 Akim Demaille <akim@epita.fr>
14080
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.
14085
14086 2001-11-29 Paul Eggert <eggert@twinsun.com>
14087
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):
14091 New macros.
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.
14095
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.
14100
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.
14104
14105 2001-11-29 Marc Autret <autret_m@epita.fr>
14106
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.
14110
14111 2001-11-28 Marc Autret <autret_m@epita.fr>
14112
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.
14117
14118 2001-11-28 Marc Autret <autret_m@epita.fr>
14119
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
14127 percent option.
14128 Include output.h.
14129
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
14134 option.
14135
14136 2001-11-28 Marc Autret <autret_m@epita.fr>
14137
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 '_'.
14142
14143 2001-11-28 Marc Autret <autret_m@epita.fr>
14144
14145 * src/bison.simple: Fix debug.
14146 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14147
14148 2001-11-28 Akim Demaille <akim@epita.fr>
14149
14150 * src/LR0.c (shifts_new): New.
14151 (save_shifts, insert_start_shift, augment_automaton): Use it.
14152
14153 2001-11-28 Akim Demaille <akim@epita.fr>
14154
14155 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14156 keep ruleno only.
14157
14158 2001-11-28 Akim Demaille <akim@epita.fr>
14159
14160 * src/closure.c (closure): Instead of looping over word in array
14161 then bits in words, loop over bits in array.
14162
14163 2001-11-28 Akim Demaille <akim@epita.fr>
14164
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
14167 clearer.
14168
14169 2001-11-28 Akim Demaille <akim@epita.fr>
14170
14171 * src/closure.c (closure): `r' and `c' are new variables, used to
14172 de-obfuscate accesses to RULESET and CORE.
14173
14174 2001-11-28 Akim Demaille <akim@epita.fr>
14175
14176 * src/reduce.c (reduce_print): Use ngettext.
14177 (dump_grammar): Improve the trace accuracy.
14178
14179 2001-11-28 Akim Demaille <akim@epita.fr>
14180
14181 * src/reduce.c (dump_grammar): Don't translate trace messages.
14182
14183 2001-11-28 Akim Demaille <akim@epita.fr>
14184
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.
14189
14190 2001-11-27 Paul Eggert <eggert@twinsun.com>
14191
14192 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14193 use alloca when we didn't want to, and vice versa.
14194
14195 2001-11-27 Marc Autret <autret_m@epita.fr>
14196
14197 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14198 initialization.
14199 * src/output.c (prepare): Remove its update.
14200
14201 2001-11-27 Marc Autret <autret_m@epita.fr>
14202
14203 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14204 Use %error-verbose.
14205
14206 2001-11-27 Marc Autret <autret_m@epita.fr>
14207
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.
14218
14219 2001-11-27 Akim Demaille <akim@epita.fr>
14220
14221 * src/system.h: Use intl/libgettext.h.
14222 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14223
14224 2001-11-27 Akim Demaille <akim@epita.fr>
14225
14226 * tests/torture.at (Exploding the Stack Size with Malloc):
14227 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14228
14229 2001-11-27 Akim Demaille <akim@epita.fr>
14230
14231 * src/files.c: Include error.h.
14232 Reported by Hans Aberg.
14233
14234 2001-11-26 Marc Autret <autret_m@epita.fr>
14235
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
14242 percent option.
14243 * src/lex.h (token_t): Add tok_include.
14244
14245 2001-11-26 Akim Demaille <akim@epita.fr>
14246
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.
14251
14252 2001-11-26 Akim Demaille <akim@epita.fr>
14253
14254 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14255 size_ts.
14256
14257 2001-11-26 Akim Demaille <akim@epita.fr>
14258
14259 * src/complain.c, src/complain.h (error): Remove, provided by
14260 lib/error.[ch].
14261
14262 2001-11-26 Akim Demaille <akim@epita.fr>
14263
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.
14268
14269 2001-11-26 Akim Demaille <akim@epita.fr>
14270
14271 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14272 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14273
14274 2001-11-26 Akim Demaille <akim@epita.fr>
14275
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.
14280
14281 2001-11-23 Akim Demaille <akim@epita.fr>
14282
14283 * lib/alloca.c: Update, from fileutils.
14284
14285 2001-11-23 Akim Demaille <akim@epita.fr>
14286
14287 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14288
14289 2001-11-23 Akim Demaille <akim@epita.fr>
14290
14291 * src/system.h: Include alloca.h.
14292 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14293
14294 2001-11-23 Akim Demaille <akim@epita.fr>
14295
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.
14301
14302 2001-11-23 Akim Demaille <akim@epita.fr>
14303
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.
14306
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.
14316
14317 2001-11-22 Marc Autret <autret_m@epita.fr>
14318
14319 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14320
14321 2001-11-22 Marc Autret <autret_m@epita.fr>
14322
14323 * src/muscle_tab.c (muscle_init): Remove initialization of
14324 skeleton muscle.
14325 * src/output.c (output_master_parser): Do it here.
14326
14327 2001-11-20 Akim Demaille <akim@epita.fr>
14328
14329 * po/sv.po: New.
14330 * configure.in (ALL_LINGUAS): Adjust.
14331 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14332 longer contains strings to translate.
14333
14334 2001-11-19 Akim Demaille <akim@epita.fr>
14335
14336 * src/conflicts.c (conflicts_print): Add a missing \n.
14337
14338 2001-11-19 Akim Demaille <akim@epita.fr>
14339
14340 * src/nullable.c (nullable_print): New.
14341 (set_nullable): Call it when tracing.
14342 Better locality of variables.
14343
14344 2001-11-19 Akim Demaille <akim@epita.fr>
14345
14346 * src/print.c (print_actions): Better locality of variables.
14347
14348 2001-11-19 Akim Demaille <akim@epita.fr>
14349
14350 * src/derives.c (print_derives): Fix and enrich.
14351 * src/closure.c (print_fderives): Likewise.
14352
14353 2001-11-19 Akim Demaille <akim@epita.fr>
14354
14355 * src/closure.c (itemsetend): Remove, replaced with...
14356 (itemsetsize): new.
14357
14358 2001-11-19 Akim Demaille <akim@epita.fr>
14359
14360 * src/LR0.c (kernel_end): Remove, replaced with...
14361 (kernel_size): new.
14362
14363 2001-11-19 Akim Demaille <akim@epita.fr>
14364
14365 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14366 to clarify.
14367
14368 2001-11-19 Akim Demaille <akim@epita.fr>
14369
14370 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14371
14372 2001-11-19 Akim Demaille <akim@epita.fr>
14373
14374 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14375 trace messages.
14376 * src/LR0.c: Likewise.
14377 (allocate_itemsets): Use arrays instead of pointers to clarify.
14378
14379 2001-11-19 Akim Demaille <akim@epita.fr>
14380
14381 * src/getargs.c (statistics_flag): Replace with...
14382 (trace_flag): New.
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.
14387
14388 2001-11-19 Akim Demaille <akim@epita.fr>
14389
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.
14393
14394 2001-11-19 Akim Demaille <akim@epita.fr>
14395
14396 * src/LR0.c (new_state, get_state): Complete TRACE code.
14397 * src/closure.c: Include `reader.h' to get `tags', needed by the
14398 trace code.
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
14403 than goto.
14404 Use `#if TRACE' instead of `#if 0' for tracing code.
14405
14406 2001-11-19 Akim Demaille <akim@epita.fr>
14407
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.
14412
14413 2001-11-19 Akim Demaille <akim@epita.fr>
14414
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
14418 allocation.
14419
14420 2001-11-19 Akim Demaille <akim@epita.fr>
14421
14422 * src/LR0.c (new_state): Complete trace code.
14423 * src/nullable.c (set_nullable): Don't translate traces.
14424
14425 2001-11-19 Akim Demaille <akim@epita.fr>
14426
14427 * src/print_graph.c (print_core): Better locality of variables.
14428 * src/print.c (print_core): Likewise.
14429
14430 2001-11-19 Akim Demaille <akim@epita.fr>
14431
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.
14439
14440 2001-11-19 Akim Demaille <akim@epita.fr>
14441
14442 * src/bison.simple (yyparse): When verbosely reporting an error,
14443 no longer put additional quotes around token names.
14444 * tests/calc.at: Adjust.
14445
14446 2001-11-19 Akim Demaille <akim@epita.fr>
14447
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.
14451
14452 2001-11-19 Akim Demaille <akim@epita.fr>
14453
14454 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14455 (rule_t): this.
14456 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14457
14458 2001-11-19 Akim Demaille <akim@epita.fr>
14459
14460 * src/gram.h (rule_t): New.
14461 (rule_table): 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.
14466
14467 2001-11-19 Akim Demaille <akim@epita.fr>
14468
14469 * src/reader.c (symbols_output): New, extracted from...
14470 (packsymbols): Here.
14471 (reader): Call it.
14472
14473 2001-11-19 Akim Demaille <akim@epita.fr>
14474
14475 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14476 (maxrhs): this new function.
14477
14478 2001-11-19 Akim Demaille <akim@epita.fr>
14479
14480 * src/lalr.c (F): New macro to access the variable F.
14481 Adjust.
14482
14483 2001-11-19 Akim Demaille <akim@epita.fr>
14484
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.
14488
14489 2001-11-19 Akim Demaille <akim@epita.fr>
14490
14491 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14492 (set_state_table): handle the `lookaheads' members.
14493
14494 2001-11-19 Akim Demaille <akim@epita.fr>
14495
14496 * src/lalr.h (lookaheads): Removed array, whose contents is now
14497 a member of...
14498 (state_t): this structure.
14499 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14500 Adjust.
14501
14502 2001-11-19 Akim Demaille <akim@epita.fr>
14503
14504 * src/lalr.h (consistent): Removed array, whose contents is now
14505 a member of...
14506 (state_t): this structure.
14507 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14508 Adjust.
14509
14510 2001-11-19 Akim Demaille <akim@epita.fr>
14511
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:
14516 Adjust.
14517
14518 2001-11-19 Akim Demaille <akim@epita.fr>
14519
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.
14527
14528 2001-11-14 Akim Demaille <akim@epita.fr>
14529
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.
14540
14541 2001-11-14 Akim Demaille <akim@epita.fr>
14542
14543 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14544 defined only if yyoverflow is defined, to avoid `warning: unused
14545 variable `yyvs1''.
14546 Reported by The Test Suite.
14547
14548 2001-11-14 Akim Demaille <akim@epita.fr>
14549
14550 * src/print.c: Include reduce.h.
14551 Reported by Hans Aberg.
14552
14553 2001-11-14 Akim Demaille <akim@epita.fr>
14554
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
14560 arg_offset.
14561 arg is const.
14562 Be sure to strdup `arg' when used, since there is no reason for
14563 token_buffer not to change.
14564
14565 2001-11-14 Akim Demaille <akim@epita.fr>
14566
14567 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14568 definition.
14569 * src/main.c (main): Use them.
14570 Suggested by Hans Aberg.
14571
14572 2001-11-12 Akim Demaille <akim@epita.fr>
14573
14574 * src/system.h (ngettext): Now that we use ngettext, be sure to
14575 provide a default definition when NLS are not used.
14576
14577 2001-11-12 Akim Demaille <akim@epita.fr>
14578
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.
14587
14588 2001-11-12 Akim Demaille <akim@epita.fr>
14589
14590 %expect was not functioning at all.
14591
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.
14599
14600 2001-11-12 Akim Demaille <akim@epita.fr>
14601
14602 * tests/regression.at (Conflicts): Rename as...
14603 (Unresolved SR Conflicts): this.
14604 (Solved SR Conflicts): New.
14605
14606 2001-11-12 Akim Demaille <akim@epita.fr>
14607
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.
14613 Also free V1.
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;
14617
14618 2001-11-12 Akim Demaille <akim@epita.fr>
14619
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.
14623
14624 2001-11-12 Akim Demaille <akim@epita.fr>
14625
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.
14637
14638 2001-11-12 Akim Demaille <akim@epita.fr>
14639
14640 * tests/regression.at (Invalid input): Remove, duplicate with
14641 ``Invalid input: 1''.
14642
14643 2001-11-12 Akim Demaille <akim@epita.fr>
14644
14645 * tests/torture.at (AT_DATA_STACK_TORTURE)
14646 (Exploding the Stack Size with Alloca)
14647 (Exploding the Stack Size with Malloc): New.
14648
14649 2001-11-12 Akim Demaille <akim@epita.fr>
14650
14651 * src/bison.simple (YYSTACK_REALLOC): New.
14652 (yyparse) [!yyoverflow]: Use it and free the old stack.
14653 Reported by Per Allansson.
14654
14655 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
14656
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.
14663 From Akim.
14664
14665 2001-11-05 Akim Demaille <akim@epita.fr>
14666
14667 * src/reader.c (symbols_output): New, extracted from...
14668 (packsymbols): here.
14669 (reader): Adjust.
14670
14671 2001-11-05 Akim Demaille <akim@epita.fr>
14672
14673 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14674
14675 2001-11-05 Akim Demaille <akim@epita.fr>
14676
14677 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14678 pattern.
14679
14680 2001-11-05 Akim Demaille <akim@epita.fr>
14681
14682 * src/options.h (struct option_table_struct): set_flags is void*.
14683 * src/options.c (longopts): Support `--output' and `%output'.
14684 (usage): Adjust.
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.
14693
14694 2001-11-04 Akim Demaille <akim@epita.fr>
14695
14696 * doc/bison.texinfo (Decl Summary): Split the list into
14697 `directives for grammars' and `directives for bison'.
14698 Sort'em.
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.
14707
14708 2001-11-02 Akim Demaille <akim@epita.fr>
14709
14710 * doc/refcard.tex: Update.
14711
14712 2001-11-02 Akim Demaille <akim@epita.fr>
14713
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.
14719
14720 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14721 Number it 0.
14722 Let yylex return it instead of a plain 0.
14723 Reported by Dick Streefland.
14724
14725 2001-11-02 Akim Demaille <akim@epita.fr>
14726
14727 * tests/regression.at (Mixing %token styles): New test.
14728
14729 2001-11-02 Akim Demaille <akim@epita.fr>
14730
14731 * src/reader.c (parse_thong_decl): Formatting changes.
14732 (token_translations_init): New, extracted from...
14733 (packsymbols): Here.
14734 Adjust.
14735
14736 2001-11-01 Akim Demaille <akim@epita.fr>
14737
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
14741 guards.
14742 Reported by Wwp.
14743
14744 2001-11-01 Akim Demaille <akim@epita.fr>
14745
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
14749 too.
14750 Reported by Wwp.
14751
14752 2001-11-01 Akim Demaille <akim@epita.fr>
14753
14754 * tests/calc.at: Catch up with 1.30.
14755 * configure.in: Bump to 1.49a.
14756 Adjust to newer Autotest.
14757
14758 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
14759
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.
14764
14765 2001-10-18 Akim Demaille <akim@epita.fr>
14766
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).
14772
14773 2001-10-14 Marc Autret <autret_m@epita.fr>
14774
14775 * src/options.c (create_long_option_table): Fix.
14776
14777 2001-10-10 Akim Demaille <akim@epita.fr>
14778
14779 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14780
14781 2001-10-04 Akim Demaille <akim@epita.fr>
14782
14783 * src/reader.c (parse_union_decl): Push the caracters in
14784 union_obstack, not attrs_obstack.
14785
14786 2001-10-04 Akim Demaille <akim@epita.fr>
14787
14788 Merge in the branch 1.29.
14789
14790 * src/reader.c (packsymbols): Use a temporary obstack for
14791 `%%tokendef', since output_stack is already used elsewhere.
14792
14793 2001-10-02 Akim Demaille <akim@epita.fr>
14794
14795 Bump 1.29d.
14796
14797 2001-10-02 Akim Demaille <akim@epita.fr>
14798
14799 Version 1.29c.
14800
14801 2001-10-02 Akim Demaille <akim@epita.fr>
14802
14803 * tests/regression.at (Invalid CPP headers): New.
14804 From Alexander Belopolsky.
14805 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14806
14807 2001-10-02 Akim Demaille <akim@epita.fr>
14808
14809 * tests/regression.at (Invalid input): New.
14810 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14811 Reported by Shura.
14812
14813 2001-10-02 Akim Demaille <akim@epita.fr>
14814
14815 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14816
14817 2001-10-02 Akim Demaille <akim@epita.fr>
14818
14819 * src/output.c (output_parser): Assert `skeleton'.
14820 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14821 systems.
14822 From Shura.
14823
14824 2001-10-01 Marc Autret <autret_m@epita.fr>
14825
14826 * src/lex.h: Echo modifications.
14827 * src/lex.c (unlex): Parameter is now token_t.
14828 From Hans Aberg.
14829
14830 2001-10-01 Marc Autret <autret_m@epita.fr>
14831
14832 * src/main.c: Include lex.h.
14833 From Hans Aberg.
14834
14835 2001-09-29 Akim Demaille <akim@epita.fr>
14836
14837 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14838
14839 2001-09-28 Akim Demaille <akim@epita.fr>
14840
14841 * tests/testsuite.at: Update to newer Autotest.
14842 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14843
14844 2001-09-27 Akim Demaille <akim@epita.fr>
14845
14846 Position independent wrapper.
14847
14848 * tests/bison: Remove.
14849 * tests/bison.in: New.
14850 * configure.in: Adjust.
14851
14852 2001-09-27 Paul Eggert <eggert@twinsun.com>
14853
14854 Port quotearg fixes from tar 1.13.24.
14855
14856 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14857 tm to be declared.
14858 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14859 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14860
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).
14865
14866 2001-09-27 Akim Demaille <akim@epita.fr>
14867
14868 Bump to 1.29c.
14869
14870 2001-09-27 Akim Demaille <akim@epita.fr>
14871
14872 Version 1.29b.
14873
14874 2001-09-25 Akim Demaille <akim@epita.fr>
14875
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...
14880 (lex_init): this.
14881 (lex_free): New.
14882 * src/main.c (main): Use it.
14883
14884 2001-09-24 Marc Autret <autret_m@epita.fr>
14885
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.
14897
14898 2001-09-24 Marc Autret <autret_m@epita.fr>
14899
14900 * src/files.c (compute_output_file_names): Fix.
14901
14902 2001-09-24 Marc Autret <autret_m@epita.fr>,
14903 Akim Demaille <akim@epita.fr>
14904
14905 * src/reader.c (reader): Remove call to free_symtab ().
14906 * src/main.c (main): Call it here.
14907 Include symtab.h.
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
14913 FILE *.
14914 * src/files.c (compute_output_file_names, close_files): New.
14915 (output_files): Adjust.
14916 * src/main.c (main): Adjust.
14917
14918 2001-09-23 Marc Autret <autret_m@epita.fr>
14919
14920 * src/files.c (compute_header_macro): Computes header macro name
14921 from spec_defines_file when given.
14922
14923 2001-09-23 Marc Autret <autret_m@epita.fr>
14924
14925 * src/files.c (output_files): Add default extensions.
14926
14927 2001-09-22 Akim Demaille <akim@epita.fr>
14928
14929 * src/conflicts.c (finalize_conflicts): Rename as...
14930 (free_conflicts): this.
14931
14932 2001-09-22 Akim Demaille <akim@epita.fr>
14933
14934 * src/gram.c (gram_free): Rename back as...
14935 (dummy): this.
14936 (output_token_translations): Free `token_translations'.
14937 * src/symtab.c (free_symtab): Free the tag field.
14938
14939 2001-09-22 Akim Demaille <akim@epita.fr>
14940
14941 Remove `translations' as it is always set to true.
14942
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...
14950 (gram_free): this.
14951
14952 2001-09-22 Akim Demaille <akim@epita.fr>
14953
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.
14958
14959 2001-09-22 Akim Demaille <akim@epita.fr>
14960
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.
14965 From Pascal Bart.
14966
14967 2001-09-21 Akim Demaille <akim@epita.fr>
14968
14969 Version 1.29a.
14970 * Makefile.maint, config/config.guess, config/config.sub,
14971 * config/missing: Update from masters.
14972 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
14973 upon package.m4.
14974 * configure.in (ALL_LINGUAS): Add `tr'.
14975
14976 2001-09-21 Akim Demaille <akim@epita.fr>
14977
14978 * tests/Makefile.am (package.m4): Move to...
14979 ($(srcdir)/$(TESTSUITE)): here.
14980
14981 2001-09-20 Akim Demaille <akim@epita.fr>
14982
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.
14989
14990 2001-09-18 Marc Autret <autret_m@epita.fr>
14991
14992 * doc/bison.1: Update.
14993 * doc/bison.texinfo (Bison Options): Update --defines and --graph
14994 descriptions.
14995 (Option Cross Key): Update.
14996 Add --graph.
14997
14998 2001-09-18 Marc Autret <autret_m@epita.fr>
14999
15000 * tests/regression.at: New test (comment in %union).
15001
15002 2001-09-18 Marc Autret <autret_m@epita.fr>
15003
15004 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15005 do that.
15006 Reported by Keith Browne.
15007
15008 2001-09-18 Marc Autret <autret_m@epita.fr>
15009
15010 * tests/output.at: Add tests for --defines and --graph.
15011
15012 2001-09-18 Marc Autret <autret_m@epita.fr>
15013
15014 * tests/output.at: Removes tests of %{header,src}_extension features.
15015
15016 2001-09-18 Akim Demaille <akim@epita.fr>
15017
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.
15022
15023 2001-09-18 Marc Autret <autret_m@epita.fr>
15024
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.
15031
15032 2001-09-18 Marc Autret <autret_m@epita.fr>
15033
15034 Turn off %{source,header}_extension feature.
15035
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.
15046
15047 2001-09-10 Akim Demaille <akim@epita.fr>
15048
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.
15053
15054 2001-09-10 Akim Demaille <akim@epita.fr>
15055
15056 * tests/calc.at: Use m4_match.
15057 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15058
15059 2001-09-10 Marc Autret <autret_m@epita.fr>,
15060 Akim Demaille <akim@epita.fr>
15061
15062 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15063 enum color_e.
15064 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15065 to `normal'.
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
15073 part.
15074 (unlexed): Is a token_t.
15075
15076 2001-09-10 Akim Demaille <akim@epita.fr>
15077
15078 * configure.in: Bump to 1.29a.
15079
15080 2001-09-07 Akim Demaille <akim@epita.fr>
15081
15082 Version 1.29.
15083
15084 2001-08-30 Akim Demaille <akim@epita.fr>
15085
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.
15094
15095 2001-08-29 Akim Demaille <akim@epita.fr>
15096
15097 Bump to 1.28e.
15098
15099 2001-08-29 Akim Demaille <akim@epita.fr>
15100
15101 Version 1.28d.
15102
15103 2001-08-29 Paul Eggert <eggert@twinsun.com>
15104
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
15107 the C Standard.
15108
15109 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15110
15111 * doc/bison.texinfo (Location Tracking Calc): New node.
15112
15113 2001-08-29 Paul Eggert <eggert@twinsun.com>
15114
15115 * src/output.c (output): Do not define const, as this now
15116 causes more problems than it cures.
15117
15118 2001-08-29 Akim Demaille <akim@epita.fr>
15119
15120 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15121 the nodes.
15122 Be sure to tag the `detailmenu'.
15123
15124 2001-08-29 Akim Demaille <akim@epita.fr>
15125
15126 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15127 download in a tmp dir.
15128
15129 2001-08-28 Marc Autret <autret_m@epita.fr>
15130
15131 * config/depcomp: New file.
15132
15133 2001-08-28 Marc Autret <autret_m@epita.fr>
15134
15135 * doc/bison.1 (mandoc): Adjust.
15136 From Juan Manuel Guerrero.
15137
15138 2001-08-28 Marc Autret <autret_m@epita.fr>
15139
15140 * src/print_graph.c (print_state): Fix.
15141
15142 2001-08-27 Marc Autret <autret_m@epita.fr>
15143
15144 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15145 char * members.
15146 Echo modifications to the functions prototypes.
15147 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15148
15149 2001-08-27 Marc Autret <autret_m@epita.fr>
15150
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.
15156
15157 2001-08-27 Akim Demaille <akim@epita.fr>
15158
15159 * Makefile.maint: Sync. again with CVS Autoconf.
15160
15161 2001-08-27 Akim Demaille <akim@epita.fr>
15162
15163 * Makefile.maint: Formatting changes.
15164 (po-update, cvs-update, update): New targets.
15165 (AMTAR): Remove.
15166
15167 2001-08-27 Akim Demaille <akim@epita.fr>
15168
15169 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15170 * Makefile.maint: Sync. with CVS Autoconf.
15171
15172 2001-08-27 Marc Autret <autret_m@epita.fr>
15173
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.
15181 (G_INFONAME): 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'.
15186
15187 2001-08-27 Marc Autret <autret_m@epita.fr>
15188
15189 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15190 This one shadowed a global parameter.
15191
15192 2001-08-24 Marc Autret <autret_m@epita.fr>
15193
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.
15198
15199 2001-08-23 Marc Autret <autret_m@epita.fr>
15200
15201 * src/lex.c (percent_table): Typo: s/naem/name/.
15202 Add graph option.
15203 Normalize new options declarations.
15204
15205 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15206
15207 * tests/suite.at: Exercise %header_extension and %source_extension.
15208
15209 2001-08-16 Marc Autret <autret_m@epita.fr>
15210
15211 * src/reader.c (parse_dquoted_param): New.
15212 (parse_header_extension_decl): Use it.
15213 (parse_source_extension_decl): Likewise.
15214
15215 2001-08-16 Marc Autret <autret_m@epita.fr>
15216
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.
15223
15224 2001-08-16 Marc Autret <autret_m@epita.fr>
15225
15226 * src/getargs.c (usage): Update with ``-g, --graph''.
15227
15228 2001-08-16 Marc Autret <autret_m@epita.fr>
15229
15230 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15231 (Option Cross Key): Likewise.
15232 * doc/bison.1: Update.
15233
15234 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
15235
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.
15240
15241 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15242
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.
15251
15252 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15253
15254 * src/bison.simple: Add new `#line' directive.
15255
15256 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
15257
15258 * src/bison.simple: New `#line' directive.
15259 * src/output.c (output_parser): Support new dynamic muscle input_line.
15260
15261 2001-09-22 Marc Autret <autret_m@epita.fr>
15262
15263 * src/output.c (output_master_parser): New.
15264 (output_parser): Be more re-entrant.
15265
15266 2001-09-21 Marc Autret <autret_m@epita.fr>
15267
15268 * src/reader.c (copy_definition, parse_union_decl): Update and use
15269 `linef' muscle.
15270 (copy_action): Likewise.
15271 Use obstack_1grow ().
15272 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15273
15274 2001-09-21 Marc Autret <autret_m@epita.fr>
15275
15276 * src/options.c (option_table): Adjust.
15277 * src/lex.c (parse_percent_token): Fix.
15278
15279 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15280
15281 * src/options.c (symtab.h): Include it, need by lex.h.
15282
15283 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15284
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.
15296
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.
15307
15308 2001-09-20 Marc Autret <autret_m@epita.fr>
15309
15310 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15311 sections of Bison.
15312
15313 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
15314
15315 * src/bison.simple: s/%%filename/%%skeleton.
15316 * src/muscle_tab.c (getargs.h): Include it.
15317 (muscle_init): Insert new muscle skeleton.
15318
15319 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
15320
15321 * src/output.c (output_parser): Delete unused variable actions_dumped.
15322
15323 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
15324
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.
15328
15329 2001-09-02 Marc Autret <autret_m@epita.fr>
15330
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.
15338
15339 * src/reader.h (muscle_obstack): Extern declaration update.
15340
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.
15348
15349 * src/muscle_tab.h: Update double inclusion macros.
15350 (macro_entry_s): Rename muscle_entry_s.
15351 Update prototypes.
15352
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.
15359
15360 * src/main.c: Include muscle_tab.h.
15361 (main): Call muscle_init ().
15362 * src/Makefile.am (bison_SOURCES): Echo modifications.
15363
15364 2001-09-02 Marc Autret <autret_m@epita.fr>
15365
15366 Now the files macro_tab.[ch] are named muscle_tab.[ch].
15367
15368 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15369
15370 2001-09-02 Marc Autret <autret_m@epita.fr>
15371
15372 * src/macrotab.c, src/macrotab.h: Remove.
15373
15374 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
15375
15376 * src/reader.c (copy_guard): Use muscle to specify the `#line'
15377 filename.
15378
15379 2001-09-01 Marc Autret <autret_m@epita.fr>
15380
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.
15383
15384 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15385
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.
15390
15391 2001-08-31 Marc Autret <autret_m@epita.fr>
15392
15393 * src/bison.simple (YYLSP_NEEDED): New definition.
15394 * src/output.c (prepare): Add macro insertion of `locations_flag'
15395
15396 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15397
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
15406 name_prefix.
15407
15408 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15409
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.
15413
15414 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15415
15416 * src/reader.c (read_additionnal_code): Rename %%user_code to
15417 %%epilogue.
15418 * src/output.c (output): Rename %%declarations to %%prologue.
15419 * src/bison.simple: Echo modifications.
15420
15421 2001-08-31 Marc Autret <autret_m@epita.fr>
15422
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.
15428
15429 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15430
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.
15435
15436 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
15437
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.
15448
15449 2001-08-30 Marc Autret <autret_m@epita.fr>
15450
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.
15455 Standardize.
15456
15457 2001-08-29 Marc Autret <autret_m@epita.fr>
15458
15459 * src/bison.simple: Add %%user_code directive at the end.
15460 * src/reader.c (read_additionnal_code): New.
15461 (reader): Use it.
15462 * src/output.c (output_program): Remove.
15463 (output): Update.
15464
15465 2001-08-28 Marc Autret <autret_m@epita.fr>
15466
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.
15470
15471 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
15472
15473 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
15474 directive.
15475 * src/bison.simple: Add `%%definitions'.
15476
15477 2001-08-28 Marc Autret <autret_m@epita.fr>
15478
15479 * config/depcomp: New file.
15480
15481 2001-08-27 Paul Eggert <eggert@twinsun.com>
15482
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
15485 the C Standard.
15486
15487 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15488
15489 * src/output.c (output): Remove the initialization of the macro
15490 obstack. It was done too late here.
15491
15492 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15493 completely wrong.
15494 (reader): Initialize the macro obstack here, since we need it to grow
15495 '%define' directives.
15496
15497 * src/reader.h: Declare the macro obstack as extern.
15498
15499 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15500
15501 * src/output.c (output_parser): Fix. Store single '%' characters in
15502 the output obstack instead of throwing them away.
15503
15504 2001-08-27 Akim Demaille <akim@epita.fr>
15505
15506 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15507
15508 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15509
15510 * lib/Makefile.am: Adjust.
15511
15512 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15513
15514 * src/bison.simple: Update and add '%%' directives.
15515
15516 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15517
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.
15525
15526 * src/reader.c (parse_macro_decl): New function used to parse macro
15527 declarations.
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
15532 bound to true.
15533 (read_declarations): Add case for macro definition.
15534 (copy_identifier): New.
15535 (parse_macro_decl): Read macro identifiers using copy_identifier
15536 rather than lex.
15537
15538 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15539
15540 * src/output.c (prepare): Add prefixed names.
15541 (output_parser): Output semantic actions.
15542 (output_parser): Fix bug on '%%line' directives.
15543
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.
15549
15550 * src/output.c: Remove some C dedicated output.
15551 Improve the use of macro and output obstacks.
15552 (output_defines): Remove.
15553
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'.
15564
15565 * src/output.c (output_table_data): New function.
15566 (output_short_table): Remove.
15567 (output_short_or_char_table): Remove.
15568
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.
15574
15575 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15576
15577 * src/main.c (main): Initialize the macro table.
15578
15579 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15580
15581 * src/lex.c (percent_table): Add tok_define.
15582 * src/lex.h: Add tok_define.
15583
15584 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15585
15586 * src/macrotab.c: New file.
15587 * src/macrotab.h: New file.
15588 * src/Makefile.am: Update.
15589
15590 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15591
15592 * lib/hash.c: New file.
15593 * lib/hash.h: New file.
15594 * lib/Makefile.am: Update.
15595
15596 2001-08-15 Akim Demaille <akim@epita.fr>
15597
15598 Version 1.28c.
15599
15600 2001-08-15 Marc Autret <autret_m@epita.fr>
15601
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.
15609
15610 2001-08-15 Akim Demaille <akim@epita.fr>
15611
15612 * doc/bison.texinfo (Table of Symbols): Document
15613 YYSTACK_USE_ALLOCA.
15614
15615 2001-08-15 Akim Demaille <akim@epita.fr>
15616
15617 * missing: Update from CVS Automake.
15618 * config/config.guess, config/config.sub, config/texinfo.tex:
15619 Update from gnu.org.
15620
15621 2001-08-15 Akim Demaille <akim@epita.fr>
15622
15623 * Makefile.maint: Sync with CVS Autoconf.
15624
15625 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
15626
15627 * doc/bison.texinfo: Include GNU Free Documentation License from
15628 `fdl.texi'.
15629 * doc/fdl.texi: Add to package.
15630
15631 2001-08-14 Marc Autret <autret_m@epita.fr>
15632
15633 Turn on %{source,header}_extension features.
15634
15635 * src/lex.c (percent_table): Un-CPP out header_extension and
15636 source_extension.
15637 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
15638 (compute_exts_from_src): Remove conditions. It restores priorities
15639 between options.
15640
15641 2001-08-14 Marc Autret <autret_m@epita.fr>
15642
15643 * src/files.c (compute_base_names): Add extensions computing when
15644 `--file-prefix' used.
15645 Standardize function calls.
15646
15647 2001-08-13 Marc Autret <autret_m@epita.fr>
15648
15649 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
15650 defining it (defined but null disables alloca).
15651
15652 2001-08-13 Marc Autret <autret_m@epita.fr>
15653
15654 * src/bison.simple (_yy_memcpy): CPP reformat.
15655
15656 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
15657
15658 * tests/atconfig.in (CPPFLAGS): Fix.
15659
15660 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
15661
15662 * doc/bison.texinfo: Include GNU General Public License from
15663 `gpl.texi'.
15664 * doc/gpl.texi: Add to package.
15665
15666 2001-08-10 Marc Autret <autret_m@epita.fr>
15667
15668 * src/print_graph.h: Fix.
15669 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15670
15671 2001-08-10 Akim Demaille <akim@epita.fr>
15672
15673 * src/system.h: Provide default declarations for stpcpy, strndup,
15674 and strnlen.
15675
15676 2001-08-10 Robert Anisko <anisko_r@epita.fr>
15677
15678 * doc/bison.texinfo (Locations): Update @$ stuff.
15679
15680 2001-08-09 Robert Anisko <anisko_r@epita.fr>
15681
15682 * src/bison.simple (YYLLOC_DEFAULT): Update.
15683 (yyparse): Adjust.
15684
15685 2001-08-08 Marc Autret <autret_m@epita.fr>
15686
15687 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
15688 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15689 Reported by Fabrice Bauzac.
15690
15691 2001-08-08 Marc Autret <autret_m@epita.fr>
15692
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
15702 blue.
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.
15709
15710 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
15711
15712 * tests/atconfig.in (CPPFLAGS): Fix.
15713
15714 2001-08-07 Akim Demaille <akim@epita.fr>
15715
15716 * src/print_graph.c (quote): New.
15717 (print_core): Use it.
15718
15719 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
15720
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.
15728 Use `quote'.
15729 * src/files.c (output_files): Output the VCG file.
15730 * src/main.c (main): Invoke print_graph ();
15731
15732 2001-08-06 Marc Autret <autret_m@epita.fr>
15733
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.
15738
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.
15750
15751 2001-08-06 Marc Autret <autret_m@epita.fr>
15752
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.
15756
15757 2001-08-06 Marc Autret <autret_m@epita.fr>
15758
15759 Add of %source_extension and %header_extension which specify
15760 the source or/and the header output file extension.
15761
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.
15773
15774 2001-08-06 Marc Autret <autret_m@epita.fr>
15775
15776 * configure.in: Bump to 1.28c.
15777 * doc/bison.texinfo: Texinfo thingies.
15778
15779 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
15780
15781 * tests/atconfig.in (CPPFLAGS): Add.
15782 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15783
15784 2001-08-03 Akim Demaille <akim@epita.fr>
15785
15786 Version 1.28b.
15787
15788 2001-08-03 Akim Demaille <akim@epita.fr>
15789
15790 * tests/Makefile.am (check-local): Ship testsuite.
15791 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15792 Include `string.h'.
15793
15794 2001-08-03 Akim Demaille <akim@epita.fr>
15795
15796 * configure.in: Try using -Wformat when compiling.
15797
15798 2001-08-03 Akim Demaille <akim@epita.fr>
15799
15800 * configure.in: Bump to 1.28b.
15801
15802 2001-08-03 Akim Demaille <akim@epita.fr>
15803
15804 * src/complain.c: Adjust strerror_r portability issues.
15805
15806 2001-08-03 Akim Demaille <akim@epita.fr>
15807
15808 Version 1.28a.
15809
15810 2001-08-03 Akim Demaille <akim@epita.fr>
15811
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.
15817
15818 2001-08-03 Akim Demaille <akim@epita.fr>
15819
15820 * src/reader.c (readgram): Display hidden chars in error messages.
15821
15822 2001-08-03 Akim Demaille <akim@epita.fr>
15823
15824 Update to gettext 0.10.39.
15825
15826 2001-08-03 Akim Demaille <akim@epita.fr>
15827
15828 * lib/strspn.c: New.
15829
15830 2001-08-01 Marc Autret <autret_m@epita.fr>
15831
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.
15847
15848 2001-08-01 Robert Anisko <anisko_r@epita.fr>
15849
15850 * doc/bison.texi: Document @$.
15851 (Locations): New section.
15852
15853 2001-07-18 Akim Demaille <akim@epita.fr>
15854
15855 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15856 * config/prev-version.txt, config/move-if-change: New.
15857 * Makefile.am: Adjust.
15858
15859 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
15860
15861 * src/bison.simple (yyparse): Suppress warning `comparaison
15862 between signed and unsigned'.
15863
15864 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
15865
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'.
15871
15872 2001-07-14 Akim Demaille <akim@epita.fr>
15873
15874 * config/: New.
15875 * configure.in: Require Autoconf 2.50.
15876 Update to gettext 0.10.38.
15877
15878 2001-03-16 Akim Demaille <akim@epita.fr>
15879
15880 * doc/bison.texinfo: ANSIfy the examples.
15881
15882 2001-03-16 Akim Demaille <akim@epita.fr>
15883
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.
15889
15890 2001-03-16 Akim Demaille <akim@epita.fr>
15891
15892 * m4/strerror_r.m4: New.
15893 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15894 * lib/error.h, lib/error.c: Update.
15895
15896 2001-03-16 Akim Demaille <akim@epita.fr>
15897
15898 * src/getargs.c (longopts): Clean up.
15899
15900 2001-02-21 Akim Demaille <akim@epita.fr>
15901
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
15904 longer a buffer.
15905
15906 2001-02-08 Akim Demaille <akim@epita.fr>
15907
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.
15911
15912 2001-02-08 Akim Demaille <akim@epita.fr>
15913
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.
15921
15922 2001-02-02 Akim Demaille <akim@epita.fr>
15923
15924 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
15925 * lib/xalloc.h, lib/xmalloc.c: Update.
15926
15927 2001-01-19 Akim Demaille <akim@epita.fr>
15928
15929 Get rid of the ad hoc handling of token_buffer in the scanner: use
15930 the obstacks.
15931
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.
15936
15937 2001-01-19 Akim Demaille <akim@epita.fr>
15938
15939 * src/lex.h: Rename all the tokens:
15940 s/\bENDFILE\b/tok_eof/g;
15941 s/\bIDENTIFIER\b/tok_identifier/g;
15942 etc.
15943 Let them be enums, not #define, to ease debugging.
15944 Adjust all the code.
15945
15946 2001-01-18 Akim Demaille <akim@epita.fr>
15947
15948 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15949 * src/lex.c (maxtoken, grow_token_buffer): Static.
15950
15951 2001-01-18 Akim Demaille <akim@epita.fr>
15952
15953 Since we now use obstacks, more % directives can be enabled.
15954
15955 * src/lex.c (percent_table): Also accept `%yacc',
15956 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15957 `%debug'.
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.
15970
15971 2000-12-20 Akim Demaille <akim@epita.fr>
15972
15973 Also handle the output file (--verbose) with obstacks.
15974
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.
15982
15983 2000-12-20 Akim Demaille <akim@epita.fr>
15984
15985 * src/files.c (open_files): Fix the computation of short_base_name
15986 in the case of `-o foo.tab.c'.
15987
15988 2000-12-20 Akim Demaille <akim@epita.fr>
15989
15990 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
15991 (copy_dollar): Now that everything uses obstacks, get rid of the
15992 FILE * parameters.
15993
15994 2000-12-20 Akim Demaille <akim@epita.fr>
15995
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.
15999
16000 2000-12-20 Akim Demaille <akim@epita.fr>
16001
16002 * src/bison.s1: Remove, we now use directly...
16003 * src/bison.simple: this.
16004 * src/Makefile.am: Use pkgdata instead of data.
16005
16006 2000-12-20 Akim Demaille <akim@epita.fr>
16007
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.
16013
16014 2000-12-19 Akim Demaille <akim@epita.fr>
16015
16016 * src/files.c (outfile, defsfile, actfile): Removed as global
16017 vars.
16018 (open_files): Don't compute them.
16019 (output_files): Adjust.
16020 (base_name, short_base_name): Be global.
16021 Adjust dependencies.
16022
16023 2000-12-19 Akim Demaille <akim@epita.fr>
16024
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
16029 short_base_name.
16030 (open_files): Use it.
16031 * tests/suite.at (Checking output file names): New test.
16032
16033 2000-12-19 Akim Demaille <akim@epita.fr>
16034
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
16038 `$'.
16039 * src/bison.s1: s/$/%% actions/.
16040 * src/bison.hairy: Likewise.
16041
16042 2000-12-19 Akim Demaille <akim@epita.fr>
16043
16044 * src/output.c (output_parser): Compute the `#line' lines when
16045 there are.
16046 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16047 Suggested by Hans Aberg.
16048
16049 2000-12-19 Akim Demaille <akim@epita.fr>
16050
16051 Let the handling of the skeleton files be local to the procedures
16052 that use it.
16053
16054 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16055 longer static.
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
16060 skeleton.
16061 * src/reader.c (read_declarations): When %semantic_parser, open
16062 fguard.
16063
16064 2000-12-19 Akim Demaille <akim@epita.fr>
16065
16066 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16067 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16068
16069 2000-12-19 Akim Demaille <akim@epita.fr>
16070
16071 * src/files.c (open_files): Yipee! We no longer need all the code
16072 looking for `/tmp' since we have no tmp file.
16073
16074 2000-12-19 Akim Demaille <akim@epita.fr>
16075
16076 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16077 New macros.
16078 * src/files.c (open_files): Less dependency on MSDOS etc.
16079
16080 2000-12-14 Akim Demaille <akim@epita.fr>
16081
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.
16087
16088 2000-12-12 Akim Demaille <akim@epita.fr>
16089
16090 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16091 (copy_guard): Quote the file names.
16092 Reported by Laurent Mascherpa.
16093
16094 2000-12-12 Akim Demaille <akim@epita.fr>
16095
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.
16100
16101 2000-11-17 Akim Demaille <akim@epita.fr>
16102
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 *'
16108 variable is valid.
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
16111 append characters.
16112
16113 2000-11-17 Akim Demaille <akim@epita.fr>
16114
16115 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16116 as...
16117 (suite.m4, regression.m4, calc.m4): these.
16118 * tests/atgeneral.m4: Update from CVS Autoconf.
16119
16120 2000-11-17 Akim Demaille <akim@epita.fr>
16121
16122 * tests/regression.m4 (%union and --defines): New test,
16123 demonstrating a current bug in the obstack implementation.
16124
16125 2000-11-17 Akim Demaille <akim@epita.fr>
16126
16127 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16128 macros.
16129 Use them to declare the variables which are global or local to
16130 `yyparse'.
16131
16132 2000-11-17 Akim Demaille <akim@epita.fr>
16133
16134 * acconfig.h: Remove, no longer used.
16135
16136 2000-11-07 Akim Demaille <akim@epita.fr>
16137
16138 * src: s/Copyright (C)/Copyright/g.
16139
16140 2000-11-07 Akim Demaille <akim@epita.fr>
16141
16142 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16143 defining.
16144 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16145
16146 2000-11-07 Akim Demaille <akim@epita.fr>
16147
16148 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16149 Merge in a single CPP if/else.
16150
16151 2000-11-07 Akim Demaille <akim@epita.fr>
16152
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.
16163
16164 2000-11-03 Akim Demaille <akim@epita.fr>
16165
16166 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16167 s/PFILE1/BISON_HAIRY/.
16168 Adjust dependencies.
16169
16170 2000-11-03 Akim Demaille <akim@epita.fr>
16171
16172 For some reason, this was not applied.
16173
16174 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16175 `unlink': it's no longer used.
16176
16177 2000-11-03 Akim Demaille <akim@epita.fr>
16178
16179 * src/files.c (skeleton_find): New function, eved out of...
16180 (open_files, open_extra_files): here.
16181
16182 2000-11-03 Akim Demaille <akim@epita.fr>
16183
16184 Don't use `atexit'.
16185
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.
16193
16194 2000-11-02 Akim Demaille <akim@epita.fr>
16195
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.
16199
16200 2000-11-02 Akim Demaille <akim@epita.fr>
16201
16202 Remove the last uses of mktemp and unlink/delete.
16203
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
16210 obstacks.
16211 (output_token_defines, reader_output_yylsp): Use obstacks.
16212 * src/system.h (obstack_fgrow3): New.
16213 * po/POTFILES.in: Adjust.
16214
16215 2000-11-01 Akim Demaille <akim@epita.fr>
16216
16217 Change each use of `fattrs' into a use of `attrs_obstack'.
16218
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.
16224
16225 2000-11-01 Akim Demaille <akim@epita.fr>
16226
16227 Introduce obstacks.
16228 Change each use of `faction' into a use of `action_obstack'.
16229
16230 * lib/obstack.h, lib/obstack.c: New files.
16231 * src/files.c (faction): Remove.
16232 (action_obstack): New.
16233 Adjust all dependencies.
16234
16235 2000-10-20 Akim Demaille <akim@epita.fr>
16236
16237 * lib/quote.h (PARAMS): New macro. Use it.
16238
16239 2000-10-16 Akim Demaille <akim@epita.fr>
16240
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.
16244
16245 2000-10-16 Akim Demaille <akim@epita.fr>
16246
16247 * src/symtab.c (bucket_new): New function.
16248 (getsym): Use it.
16249
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.
16255
16256 2000-10-16 Akim Demaille <akim@epita.fr>
16257
16258 * src/lex.c (read_typename): New function.
16259 (lex): Use it.
16260 * src/reader.c (copy_dollar): Likewise.
16261
16262 2000-10-16 Akim Demaille <akim@epita.fr>
16263
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.
16269
16270 2000-10-16 Akim Demaille <akim@epita.fr>
16271
16272 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16273 `read_signed_integer'.
16274
16275 2000-10-16 Akim Demaille <akim@epita.fr>
16276
16277 * src/reader.c (copy_dollar): New function.
16278 (copy_guard, copy_action): Use it.
16279
16280 2000-10-16 Akim Demaille <akim@epita.fr>
16281
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'.
16287
16288 2000-10-04 Akim Demaille <akim@epita.fr>
16289
16290 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16291
16292 2000-10-04 Akim Demaille <akim@epita.fr>
16293
16294 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16295
16296 2000-10-04 Akim Demaille <akim@epita.fr>
16297
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.
16301
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
16305 properly.
16306
16307 2000-10-04 Akim Demaille <akim@epita.fr>
16308
16309 * src/reader.c (parse_expect_decl): Keep `count' within the size
16310 of `buffer'.
16311 From Neil Booth.
16312
16313 2000-10-02 Paul Eggert <eggert@twinsun.com>
16314
16315 * bison.s1 (yyparse): Assign the default value
16316 unconditionally, to avoid a GCC warning and make the parser a
16317 tad smaller.
16318
16319 2000-10-02 Akim Demaille <akim@epita.fr>
16320
16321 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16322 options.
16323
16324 2000-10-02 Akim Demaille <akim@epita.fr>
16325
16326 * src/derives.c, src/print.c, src/reduce.c: To ease the
16327 translation, move some `\n' out of the translated strings.
16328
16329 2000-10-02 Akim Demaille <akim@epita.fr>
16330
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.
16336
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'.
16344 Sort the options.
16345 * tests/calc.m4: Test it.
16346
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'.
16351
16352 2000-10-02 Akim Demaille <akim@epita.fr>
16353
16354 Also test parse error messages, including with YYERROR_VERBOSE.
16355
16356 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16357 associative).
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.
16364
16365 2000-10-02 Akim Demaille <akim@epita.fr>
16366
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:
16371
16372 #if YYDEBUG
16373 if (yydebug)
16374 {
16375 ...
16376 }
16377 #endif
16378
16379 into
16380
16381 if (yydebug)
16382 {
16383 ...
16384 }
16385
16386 unfortunately this leads to a CPP conflict when
16387 `--name-prefix=foo' is used since it produces `#define yydebug
16388 foodebug'.
16389
16390 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16391 (YYDPRINTF): New macro.
16392 Spread its use.
16393 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16394 the bison options.
16395 Also test `--verbose', `--defines' and `--name-prefix'.
16396
16397 2000-10-02 Akim Demaille <akim@epita.fr>
16398
16399 Improve the readability of the produced parsers.
16400
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
16405 of its line.
16406 New variable, `number_of_dollar_signs', to check there's exactly
16407 one `$' in the parser skeleton.
16408
16409 2000-10-02 Akim Demaille <akim@epita.fr>
16410
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.
16416
16417 2000-10-02 Akim Demaille <akim@epita.fr>
16418
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'.
16429
16430 2000-10-02 Akim Demaille <akim@epita.fr>
16431
16432 * src/getargs.c (fixed_outfiles): Rename as...
16433 (yaccflag): for consistency and accuracy.
16434 Adjust dependencies.
16435
16436 2000-10-02 Akim Demaille <akim@epita.fr>
16437
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.
16446
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
16449 files.
16450 Adjust dependencies.
16451 * src/warshall.h: New file.
16452 Propagate.
16453
16454 2000-10-02 Akim Demaille <akim@epita.fr>
16455
16456 Various anti-`extern in *.c' changes.
16457
16458 * src/system.h: Include `assert.h'.
16459
16460 2000-10-02 Akim Demaille <akim@epita.fr>
16461
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.
16469
16470 Remove a lot of now useless `extern' statements in most files.
16471
16472 2000-10-02 Akim Demaille <akim@epita.fr>
16473
16474 * src/LR0.h: New file.
16475 Propagate its use.
16476
16477 2000-10-02 Akim Demaille <akim@epita.fr>
16478
16479 * src/print.h: New file.
16480 Propagate its use.
16481 * src/print.c: Formatting and ordering changes.
16482 (verbose, terse): Replace with...
16483 (print_results): this new function.
16484 Adjust dependencies.
16485
16486 2000-10-02 Akim Demaille <akim@epita.fr>
16487
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.
16494
16495 2000-10-02 Akim Demaille <akim@epita.fr>
16496
16497 * src/nullable.h: New file.
16498 Propagate its inclusion.
16499 * src/nullable.c: Formatting changes.
16500
16501 2000-10-02 Akim Demaille <akim@epita.fr>
16502
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.
16508
16509 2000-10-02 Akim Demaille <akim@epita.fr>
16510
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.
16516 Propagate its use.
16517
16518 2000-10-02 Akim Demaille <akim@epita.fr>
16519
16520 * src/reader.h: New file.
16521 Propagate its use instead of tedious list of `extern' and
16522 prototypes.
16523 * src/reader.c: Formatting changes, topological sort,
16524 s/register//.
16525
16526 2000-10-02 Akim Demaille <akim@epita.fr>
16527
16528 * src/lex.h: Prototype `lex.c' exported functions.
16529 * src/reader.c: Adjust.
16530 * src/lex.c: Formatting changes.
16531 (safegetc): Rename as...
16532 (xgetc): this.
16533
16534 2000-10-02 Akim Demaille <akim@epita.fr>
16535
16536 * src/lalr.h: New file.
16537 Propagate its inclusion instead of prototypes and `extern'.
16538 * src/lalr.c: Formatting changes, topological sorting etc.
16539
16540 2000-10-02 Akim Demaille <akim@epita.fr>
16541
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.
16545
16546 2000-10-02 Akim Demaille <akim@epita.fr>
16547
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
16551 shorts.
16552
16553 * src/reader.c (user_toknums): Be a short table instead of an int
16554 table.
16555 Adjust dependencies.
16556
16557 Factor the short table outputs.
16558
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.
16562
16563 2000-10-02 Akim Demaille <akim@epita.fr>
16564
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
16570 from output.c.
16571
16572 2000-09-21 Akim Demaille <akim@epita.fr>
16573
16574 * src/atgeneral.m4: Update from Autoconf.
16575
16576 2000-09-21 Akim Demaille <akim@epita.fr>
16577
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
16584 cloture.h.
16585 (initialize_states): Rename as...
16586 (new_states): this.
16587 * src/Makefile.am (noinst_HEADERS): Adjust.
16588
16589 2000-09-20 Akim Demaille <akim@epita.fr>
16590
16591 * src/acconfig.h: Don't protect config.h against multiple
16592 inclusion.
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.
16598
16599 2000-09-20 Akim Demaille <akim@epita.fr>
16600
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.
16605
16606 2000-09-20 Akim Demaille <akim@epita.fr>
16607
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'.
16613
16614 2000-09-19 Akim Demaille <akim@epita.fr>
16615
16616 * src/output.c: Formatting changes.
16617 * src/machine.h: Remove, leaving its contents in...
16618 * src/system.h: here.
16619 Include stdio.h.
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.
16625
16626 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16627 scope.
16628 (yyerror): Returns void, not int.
16629 * doc/bison.texinfo: Formatting changes.
16630
16631 2000-09-19 Akim Demaille <akim@epita.fr>
16632
16633 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16634 portable.
16635
16636 2000-09-18 Akim Demaille <akim@epita.fr>
16637
16638 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16639 * src/Makefile.am (INCLUDES): Don't.
16640 Be ready to fetch headers in lib/.
16641
16642 2000-09-18 Akim Demaille <akim@epita.fr>
16643
16644 * doc/bison.texinfo: Update the copyright.
16645 ANSIfy and GNUify the examples.
16646 Remove the old menu.
16647
16648 2000-09-18 Akim Demaille <akim@epita.fr>
16649
16650 First set of tests: use the `calc' example from the documentation.
16651
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.
16661
16662 2000-09-18 Akim Demaille <akim@epita.fr>
16663
16664 Add support for an Autotest test suite for Bison.
16665
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
16669 files.
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.
16676
16677 2000-04-14 Akim Demaille <akim@epita.fr>
16678
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'
16685 message.
16686 (parse_union_decl, copy_guard, copy_action): Use the same
16687 `unmatched' message.
16688 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16689
16690 2000-03-31 Akim Demaille <akim@epita.fr>
16691
16692 * src/files.c (tryopen, tryclose): Move to the top.
16693 Be static.
16694
16695 2000-03-31 Akim Demaille <akim@epita.fr>
16696
16697 * src/main.c (main): Don't call `done', exit does it.
16698
16699 2000-03-31 Akim Demaille <akim@epita.fr>
16700
16701 * allocate.c: s/return (foo)/return foo/.
16702 * lalr.c: Likewise.
16703 * LR0.c: Likewise.
16704 * output.c: Likewise.
16705 * reader.c: Likewise.
16706 * symtab.c: Likewise.
16707 * vmsgetargs.c: Likewise.
16708
16709 2000-03-31 Akim Demaille <akim@epita.fr>
16710
16711 Clean up the error reporting functions.
16712
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):
16720 Remove.
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'.
16727
16728 * src/getargs.c (usage): More `fputs', less `fprintf'.
16729
16730 2000-03-28 Akim Demaille <akim@epita.fr>
16731
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
16736 useless.
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.
16745
16746 2000-03-28 Akim Demaille <akim@epita.fr>
16747
16748 * src/getargs.c (usage): Refresh the help message.
16749
16750 2000-03-17 Akim Demaille <akim@epita.fr>
16751
16752 * src/getopt1.c: Updated from textutils 2.0e
16753 * src/getopt.c: Likewise.
16754 * src/getopt.h: Likewise.
16755
16756 2000-03-17 Akim Demaille <akim@epita.fr>
16757
16758 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16759 the file name, not the whole `#line LINE FILE'.
16760
16761 2000-03-17 Akim Demaille <akim@epita.fr>
16762
16763 On syntax errors, report the token on which we choked.
16764
16765 * src/bison.s1 (yyparse): In the label yyerrlab, when
16766 YYERROR_VERBOSE, add yychar in msg.
16767
16768 2000-03-17 Akim Demaille <akim@epita.fr>
16769
16770 * src/reader.c (copy_at): New function.
16771 (copy_guard): Use it.
16772 (copy_action): Use it.
16773
16774 2000-03-17 Akim Demaille <akim@epita.fr>
16775
16776 Be kind to translators, save some useless translations.
16777
16778 * src/main.c (banner): New function.
16779 (fatal_banner): Use it.
16780 (warn_banner): Use it.
16781
16782 2000-03-17 Akim Demaille <akim@epita.fr>
16783
16784 * src/reader.c (copy_definition): Use copy_string and
16785 copy_comment. Removed now unused `match', `ended',
16786 `cplus_comment'.
16787 (copy_comment, copy_string): Moved, to be visible from
16788 copy_definition.
16789
16790 2000-03-17 Akim Demaille <akim@epita.fr>
16791
16792 * src/reader.c (copy_string): Declare `static inline'. No
16793 problems with inline, since it is checked by configure.
16794 (copy_comment): Likewise.
16795
16796 2000-03-17 Akim Demaille <akim@epita.fr>
16797
16798 * src/reader.c (packsymbols): Formatting changes.
16799
16800 2000-03-17 Akim Demaille <akim@epita.fr>
16801
16802 * src/reader.c (copy_comment): New function, factored out from:
16803 (copy_action): Use it. Removed now unused `match', `ended',
16804 `cplus_comment'.
16805 (copy_guard): Likewise.
16806
16807 2000-03-17 Akim Demaille <akim@epita.fr>
16808
16809 * src/reader.c (copy_string): New function, factored out from:
16810 (copy_action): Use it.
16811 (copy_guard): Likewise.
16812
16813 2000-03-17 Akim Demaille <akim@epita.fr>
16814
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).
16820
16821 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16822 yyval.
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
16831 translators.
16832
16833 2000-03-17 Akim Demaille <akim@epita.fr>
16834
16835 * src/bison.s1: Formatting and cosmetics changes.
16836 * src/reader.c: Likewise.
16837 Update the Copyright notice.
16838
16839 2000-03-17 Akim Demaille <akim@epita.fr>
16840
16841 * src/bison.s1 (#line): All set to `#line' only, since the
16842 Makefile now handles them.
16843
16844 2000-03-16 Akim Demaille <akim@epita.fr>
16845
16846 * src/output.c (output_rule_data): Output the documentation of
16847 some of the tables.
16848 (Copyright notice): Update.
16849 Formatting changes.
16850
16851 2000-03-16 Akim Demaille <akim@epita.fr>
16852
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'.
16857
16858 2000-03-16 Akim Demaille <akim@epita.fr>
16859
16860 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16861 and related variables so that the similarities are highlighted.
16862
16863 2000-03-16 Akim Demaille <akim@epita.fr>
16864
16865 * src/bison.s1: Properly indent CPP directives.
16866
16867 2000-03-16 Akim Demaille <akim@epita.fr>
16868
16869 * src/bison.s1: Properly indent the `alloca' CPP section.
16870
16871 2000-03-16 Akim Demaille <akim@epita.fr>
16872
16873 Do not hard code values of directories in `configure.in'.
16874 Update the `configure' tool chain.
16875
16876 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16877 src/makefile.am.
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
16885 autoheader.
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
16892 locale files.
16893 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16894 builddir.
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.
16901
16902 2000-03-10 Akim Demaille <akim@epita.fr>
16903
16904 * src/closure.c:
16905 Formatting changes of various comments.
16906 Respect the GNU coding standards at various places.
16907 Don't use `_()' when no translation is needed.
16908
16909 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16910
16911 * src/files.c:
16912 OS/2 honors TMPDIR environment variable.
16913
16914 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16915
16916 * doc/bison.texinfo: Tweaked spelling and grammar.
16917 Updated ISBN.
16918 Removed reference to price of printed copy.
16919 Mention BISON_SIMPLE and BISON_HAIRY.
16920
16921 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16922
16923 * configure.in, NEWS:
16924 Bison 1.29 released.
16925
16926 1999-10-27 Jesse Thilo <jthilo@gnu.org>
16927
16928 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16929 Added reference card.
16930
16931 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16932
16933 * po/ru.po: Added Russian translation.
16934
16935 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16936
16937 * configure.in: Added Russian translation.
16938
16939 1999-07-06 Jesse Thilo <jthilo@gnu.org>
16940
16941 * configure.in, NEWS, README:
16942 Released version 1.28.
16943
16944 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16945
16946 * src/system.h:
16947 Squashed redefinition warning on some systems.
16948
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
16951 concatentation.
16952
16953 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16954
16955 * po/POTFILES.in: Got rid of version.c.
16956
16957 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16958
16959 * acconfig.h, configure.in:
16960 Have configure build version string instead of relying on ANSI string
16961 concatentation.
16962
16963 1999-06-08 Jesse Thilo <jthilo@gnu.org>
16964
16965 * doc/bison.1:
16966 Dropped mention of `+' for long-named options.
16967
16968 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16969
16970 * src/files.c: Added <unistd.h> for unlink().
16971
16972 * src/Makefile.am, src/system.h:
16973 I18n fixes.
16974
16975 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16976
16977 * README: Added a FAQ list.
16978
16979 * configure.in, acconfig.h:
16980 I18n fixes.
16981
16982 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16983
16984 * doc/FAQ, doc/Makefile.am:
16985 Added a FAQ list.
16986
16987 1999-05-19 Jesse Thilo <jthilo@gnu.org>
16988
16989 * src/alloc.h, src/symtab.h, src/version.c:
16990 Protected inclusion of "config.h" with HAVE_CONFIG_H.
16991
16992 1999-04-18 Jesse Thilo <jthilo@gnu.org>
16993
16994 * src/.cvsignore, src/Makefile.am:
16995 Reorganized: sources in `src', documentation in `doc'.
16996
16997 * src/lex.c (literalchar):
16998 fixed the code for escaping double quotes (thanks
16999 Jonathan Czisny.)
17000
17001 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17002
17003 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17004 Adjusted paths to reflect directory reorganization.
17005
17006 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17007
17008 * doc/.cvsignore, doc/Makefile.am:
17009 Reorganized: sources in `src', documentation in `doc'.
17010
17011 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17012
17013 * configure.in:
17014 Updated AC_INIT file to reflect directory reorganization.
17015
17016 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17017 Reorganized: sources in `src', documentation in `doc'.
17018
17019 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17020
17021 * src/allocate.c:
17022 Don't declare calloc() and realloc() if not necessary.
17023
17024 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17025
17026 * configure.in, acconfig.h, acinclude.m4:
17027 Don't declare calloc() and realloc() if not necessary.
17028
17029 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17030
17031 * po/.cvsignore: Added i18n support.
17032
17033 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17034
17035 * acconfig.h, configure.in, Makefile.am:
17036 Added i18n support.
17037
17038 1999-03-22 Jesse Thilo <jthilo@gnu.org>
17039
17040 * src/bison.s1: Fixed #line numbers.
17041
17042 1999-03-15 Jesse Thilo <jthilo@gnu.org>
17043
17044 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17045 Added PO files from Translation Project.
17046
17047 1999-03-03 Jesse Thilo <jthilo@gnu.org>
17048
17049 * Makefile.am:
17050 Added support for non-ANSI compilers (ansi2knr).
17051
17052 1999-02-16 Jesse Thilo <jthilo@gnu.org>
17053
17054 * configure.in: Bumped version number to 1.27.
17055
17056 * Makefile.am:
17057 Added `bison.simple' to list of files removed by `make distclean'.
17058
17059 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17060
17061 * src/files.c, src/files.h:
17062 Defined locations of parser files in config.h instead of Makefile.
17063
17064 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17065
17066 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17067 Defined locations of parser files in config.h instead of Makefile.
17068
17069 1999-02-09 Jesse Thilo <jthilo@gnu.org>
17070
17071 * Makefile.am:
17072 Removed inappropriate use of $< macro.
17073
17074 1999-02-05 Jesse Thilo <jthilo@gnu.org>
17075
17076 * po/Makefile.in.in, po/POTFILES.in:
17077 Add `po' directory skeleton.
17078
17079 1999-01-27 Jesse Thilo <jthilo@gnu.org>
17080
17081 * README: Document help-bison list.
17082
17083 * configure.in: Add check for mkstemp().
17084
17085 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17086
17087 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17088 Hush a few compiler warnings.
17089
17090 * src/files.c:
17091 Add tryclose(), which verifies that fclose was successful.
17092 Hush a couple of compiler warnings.
17093
17094 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17095
17096 * Makefile.am, OChangeLog:
17097 ChangeLog is now automatically generated. Include the old version as
17098 OChangeLog.
17099
17100 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17101
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.
17104
17105 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17106
17107 * doc/bison.texinfo: Fix formatting glitch.
17108
17109 * doc/bison.texinfo: Update FSF address.
17110
17111 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17112
17113 * acconfig.h: Update FSF address.
17114
17115 1999-01-08 Jesse Thilo <jthilo@gnu.org>
17116
17117 * src/system.h:
17118 Don't define PACKAGE here, since config.h defines it.
17119
17120 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17121
17122 * src/reader.c: Update copyright date.
17123
17124 * src/main.c:
17125 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17126 favor of output directly to stderr (avoids buffer overruns).
17127
17128 * src/reader.c: Some checks for premature EOF.
17129
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.
17132
17133 * src/files.c: Honor TMPDIR on Unix hosts.
17134 Use prototypes if the compiler understands them.
17135
17136 * src/reader.c:
17137 Fix a couple of buffer overrun bugs.
17138 Use prototypes if the compiler understands them.
17139
17140 * src/system.h: Include unistd.h and ctype.h.
17141 Use #ifdef instead of #if for NLS symbols.
17142
17143 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17144
17145 * doc/bison.texinfo:
17146 Delete comment "consider using @set for edition number, etc..." since
17147 we now are doing so.
17148
17149 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17150
17151 * configure.in:
17152 Use prototypes if the compiler understands them.
17153
17154 * NEWS: Document 1.26 highlights.
17155
17156 * Makefile.am: Require Automake 1.3 or later.
17157
17158 * acconfig.h:
17159 Use prototypes if the compiler understands them.
17160
17161 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17162
17163 * src/version.c:
17164 Use VERSION symbol from automake for version number.
17165
17166 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17167
17168 * acconfig.h, configure.in, version.cin:
17169 Use VERSION symbol from automake for version number.
17170
17171 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17172
17173 * Makefile.am:
17174 Distribute original version of simple parser (bison.s1), not built
17175 version (bison.simple).
17176
17177 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17178
17179 * doc/bison.texinfo: Add info dir entry.
17180
17181 * doc/bison.texinfo:
17182 Let automake put version number into documentation.
17183
17184 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17185
17186 * src/bison.cld, src/build.com, src/vmshlp.mar:
17187 Add non-RCS files from /gd/gnu/bison.
17188
17189 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17190
17191 * doc/bison.1:
17192 Document the BISON_HAIRY and BISON_SIMPLE variables.
17193
17194 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17195
17196 * src/version.c: Build version.c automatically.
17197
17198 * src/reader.c:
17199 Fix token numbering (used to start at 258, not 257).
17200
17201 * src/system.h: Include config.h.
17202
17203 * src/getargs.c: Update bug report address.
17204
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.
17207
17208 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17209
17210 * Makefile.am:
17211 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17212
17213 * configure.in, version.cin:
17214 Build version.c automatically.
17215
17216 * AUTHORS: Add AUTHORS file.
17217
17218 * README: Update bug report address.
17219
17220 * bison.simple:
17221 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17222
17223 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17224 Add automake stuff.
17225
17226 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17227
17228 * doc/bison.texinfo: Clean up some formatting.
17229
17230 1998-05-05 Richard Stallman <rms@gnu.org>
17231
17232 * doc/bison.texinfo:
17233 Explain better why to make a pure parser.
17234
17235 1998-01-05 Richard Stallman <rms@gnu.org>
17236
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
17240 they are open.
17241
17242 1997-08-25 Richard Stallman <rms@gnu.org>
17243
17244 * src/reader.c (stack_offset;):
17245 Change some warni to warns.
17246
17247 * src/lex.c (literalchar): Use warns, not warni.
17248
17249 1997-06-28 Richard Stallman <rms@gnu.org>
17250
17251 * src/bison.s1: Add a Bison version comment.
17252
17253 * src/main.c (fatal, warn, berror):
17254 Use program_name.
17255
17256 1997-06-28 Richard Stallman <rms@gnu.org>
17257
17258 * Makefile.in (bison_version): New variable.
17259 (dist): Use that variable.
17260 (bison.s1): Substitute the Bison version into bison.simple.
17261
17262 * bison.simple: Add a Bison version comment.
17263
17264 1997-06-18 Richard Stallman <rms@gnu.org>
17265
17266 * src/main.c (fatal, warn, berror):
17267 Make error messages standard.
17268 (toomany): Improve error message text.
17269
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.
17272
17273 1997-06-18 Richard Stallman <rms@gnu.org>
17274
17275 * Makefile.in: new.h renamed to alloc.h.
17276
17277 1997-05-24 Richard Stallman <rms@gnu.org>
17278
17279 * src/lex.c (literalchar):
17280 Fix the code for escaping \, " and '.
17281
17282 (lex): Avoid trouble when there are many chars
17283 to discard in a char literal with just several chars in it.
17284
17285 1997-05-17 Richard Stallman <rms@gnu.org>
17286
17287 * src/bison.s1:
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.
17294
17295 1997-05-17 Richard Stallman <rms@gnu.org>
17296
17297 * bison.simple:
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.
17304
17305 1997-04-23 Richard Stallman <rms@gnu.org>
17306
17307 * src/bison.s1:
17308 (alloca) [__hpux]: Always define as __builtin_alloca.
17309
17310 1997-04-23 Richard Stallman <rms@gnu.org>
17311
17312 * bison.simple:
17313 (alloca) [__hpux]: Always define as __builtin_alloca.
17314
17315 1997-04-22 Richard Stallman <rms@gnu.org>
17316
17317 * src/bison.s1:
17318 [__hpux]: Include alloca.h (right for HPUX 10)
17319 instead of declaring alloca (right for HPUX 9).
17320
17321 * src/bison.s1 (__yy_memcpy):
17322 Declare arg `count' as unsigned int.
17323 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17324
17325 1997-04-22 Richard Stallman <rms@gnu.org>
17326
17327 * bison.simple:
17328 [__hpux]: Include alloca.h (right for HPUX 10)
17329 instead of declaring alloca (right for HPUX 9).
17330
17331 * bison.simple (__yy_memcpy):
17332 Declare arg `count' as unsigned int.
17333 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17334
17335 1997-01-03 Richard Stallman <rms@gnu.org>
17336
17337 * src/allocate.c: [__STDC__ or _MSC_VER]:
17338 Declare calloc and realloc to return void *.
17339
17340 1997-01-02 Richard Stallman <rms@gnu.org>
17341
17342 * src/system.h:
17343 [_MSC_VER]: Include stdlib.h and process.h.
17344 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17345
17346 * src/main.c (main): Return FAILURE as a value.
17347 (printable_version): Declare arg as int, not char.
17348
17349 1997-01-02 Richard Stallman <rms@gnu.org>
17350
17351 * Makefile.in (dist):
17352 Explicitly check for symlinks, and copy them.
17353
17354 1996-12-19 Richard Stallman <rms@gnu.org>
17355
17356 * src/files.c:
17357 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17358
17359 1996-12-18 Paul Eggert <eggert@gnu.org>
17360
17361 * src/bison.s1 (yyparse):
17362 If __GNUC__ and YYPARSE_PARAM are both defined,
17363 declare yyparse to have a void * argument.
17364
17365 1996-12-18 Paul Eggert <eggert@gnu.org>
17366
17367 * bison.simple (yyparse):
17368 If __GNUC__ and YYPARSE_PARAM are both defined,
17369 declare yyparse to have a void * argument.
17370
17371 1996-12-17 Richard Stallman <rms@gnu.org>
17372
17373 * src/reduce.c (nbits): Add some casts.
17374
17375 1996-08-12 Richard Stallman <rms@gnu.org>
17376
17377 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17378
17379 1996-08-12 Richard Stallman <rms@gnu.org>
17380
17381 * bison.simple: Test _MSDOS as well as _MSDOS_.
17382
17383 1996-07-31 Richard Stallman <rms@gnu.org>
17384
17385 * src/bison.s1:
17386 [__sun && __i386]: Include alloca.h.
17387
17388 1996-07-31 Richard Stallman <rms@gnu.org>
17389
17390 * bison.simple:
17391 [__sun && __i386]: Include alloca.h.
17392
17393 1996-07-30 Richard Stallman <rms@gnu.org>
17394
17395 * src/bison.s1: Comment change.
17396
17397 * src/bison.s1: Test _MSDOS_, not MSDOS.
17398
17399 1996-07-30 Richard Stallman <rms@gnu.org>
17400
17401 * bison.simple: Comment change.
17402
17403 * bison.simple: Test _MSDOS_, not MSDOS.
17404
17405 1996-06-01 Richard Stallman <rms@gnu.org>
17406
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.
17409
17410 * src/main.c:
17411 Insert `_' macro around many string constants.
17412
17413 (main): Call setlocale, bindtextdomain and textdomain.
17414
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.
17421
17422 1996-06-01 Richard Stallman <rms@gnu.org>
17423
17424 * POTFILES.in: New file.
17425
17426 * Makefile.in (allocate.o):
17427 Define target explicitly.
17428
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.
17436
17437 1996-05-12 Richard Stallman <rms@gnu.org>
17438
17439 * src/bison.s1:
17440 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17441
17442 1996-05-12 Richard Stallman <rms@gnu.org>
17443
17444 * bison.simple:
17445 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17446
17447 1996-05-11 Richard Stallman <rms@gnu.org>
17448
17449 * src/bison.s1 (__yy_memcpy):
17450 Really reorder the args, as was supposedly done on Feb 14 1995.
17451 (yyparse): Calls changed accordingly.
17452
17453 1996-05-11 Richard Stallman <rms@gnu.org>
17454
17455 * Makefile.in (dist): Don't use $(srcdir).
17456
17457 * bison.simple (__yy_memcpy):
17458 Really reorder the args, as was supposedly done on Feb 14 1995.
17459 (yyparse): Calls changed accordingly.
17460
17461 1996-01-27 Richard Stallman <rms@gnu.org>
17462
17463 * src/output.c (output_rule_data):
17464 Test YYERROR_VERBOSE in the conditional
17465 around the definition of ttyname.
17466
17467 1995-12-29 Richard Stallman <rms@gnu.org>
17468
17469 * src/bison.s1:
17470 Fix line numbers in #line commands.
17471
17472 1995-12-29 Richard Stallman <rms@gnu.org>
17473
17474 * bison.simple:
17475 Fix line numbers in #line commands.
17476
17477 1995-12-27 Richard Stallman <rms@gnu.org>
17478
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.
17483
17484 1995-12-27 Richard Stallman <rms@gnu.org>
17485
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.
17490
17491 1995-11-29 Richard Stallman <rms@gnu.org>
17492
17493 * doc/bison.texinfo:
17494 Describe literal string tokens, %raw, %no_lines, %token_table.
17495
17496 1995-11-29 Daniel Hagerty <hag@gnu.org>
17497
17498 * doc/bison.texinfo: Fixed update date
17499
17500 1995-10-16 Richard Stallman <rms@gnu.org>
17501
17502 * src/version.c: Version 1.25.
17503
17504 1995-10-16 Richard Stallman <rms@gnu.org>
17505
17506 * NEWS: *** empty log message ***
17507
17508 1995-10-16 Richard Stallman <rms@gnu.org>
17509
17510 * doc/bison.1, doc/bison.rnh:
17511 Add new options.
17512
17513 1995-10-15 Richard Stallman <rms@gnu.org>
17514
17515 * src/vmsgetargs.c, src/getargs.c:
17516 Added -n, -k, and -raw switches.
17517 (noparserflag, toknumflag, rawtoknumflag): New variables.
17518
17519 * src/symtab.h (SALIAS):
17520 New #define for adding aliases to %token.
17521 (struct bucket): Added `alias' field.
17522
17523 * src/reduce.c (reduce_grammar):
17524 Revise error message.
17525 (print_notices): Remove final `.' from error message.
17526
17527 * src/reader.c (reader_output_yylsp):
17528 New function.
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.
17554
17555 * src/output.c:
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.
17560
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.
17566
17567 * src/lex.h:
17568 Added THONG and NOOP for alias processing.
17569 Added SETOPT for the new code that allows setting options with %flags.
17570
17571 * src/lex.c:
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
17586 an incorrect '/'.
17587 (skip_white_space, lex): Revised most error messages
17588 and changed fatal to warn to avoid aborting.
17589 (percent_table): Added %thong declarations.
17590
17591 * src/gram.h: Comment changes.
17592
17593 * src/files.c (openfiles, open_extra_files, done):
17594 Add faction flag
17595 and actfile file. Handle noparserflag. Both for -n switch.
17596
17597 * src/conflicts.c (resolve_sr_conflict):
17598 Remove use of alloca.
17599
17600 1995-06-01 Jim Meyering <meyering@gnu.org>
17601
17602 * doc/bison.texinfo: *** empty log message ***
17603
17604 1995-05-06 Richard Stallman <rms@gnu.org>
17605
17606 * src/bison.s1: Comment change.
17607
17608 1995-05-06 Richard Stallman <rms@gnu.org>
17609
17610 * bison.simple: Comment change.
17611
17612 1995-05-03 Richard Stallman <rms@gnu.org>
17613
17614 * src/version.c: Version now 1.24.
17615
17616 * src/bison.s1: Change distribution terms.
17617
17618 * src/version.c: Version now 1.23.
17619
17620 1995-05-03 Richard Stallman <rms@gnu.org>
17621
17622 * doc/bison.texinfo:
17623 Rewrite "Conditions for Using Bison".
17624 Update version to 1.24.
17625
17626 1995-05-03 Richard Stallman <rms@gnu.org>
17627
17628 * bison.simple: Change distribution terms.
17629
17630 1995-02-23 Richard Stallman <rms@gnu.org>
17631
17632 * src/files.c: Test __VMS_POSIX as well as VMS.
17633
17634 1995-02-14 Jim Meyering <meyering@gnu.org>
17635
17636 * src/bison.s1 (__yy_memcpy):
17637 Renamed from __yy_bcopy to avoid
17638 confusion. Reverse FROM and TO arguments to be consistent with
17639 those of memcpy.
17640
17641 1995-02-14 Jim Meyering <meyering@gnu.org>
17642
17643 * bison.simple (__yy_memcpy):
17644 Renamed from __yy_bcopy to avoid
17645 confusion. Reverse FROM and TO arguments to be consistent with
17646 those of memcpy.
17647
17648 1994-11-10 David J. MacKenzie <djm@gnu.org>
17649
17650 * NEWS: reformat
17651
17652 * NEWS: New file.
17653
17654 * Makefile.in (DISTFILES): Include NEWS.
17655
17656 * Makefile.in (DISTFILES):
17657 Include install-sh, not install.sh.
17658
17659 * configure.in: Update to Autoconf v2 macro names.
17660
17661 1994-10-05 David J. MacKenzie <djm@gnu.org>
17662
17663 * Makefile.in: fix typo
17664
17665 * Makefile.in (prefix, exec_prefix):
17666 Let configure set them.
17667
17668 1994-09-28 David J. MacKenzie <djm@gnu.org>
17669
17670 * Makefile.in: Set datadir to $(prefix)/share.
17671
17672 1994-09-15 Richard Stallman <rms@gnu.org>
17673
17674 * src/bison.s1:
17675 Update copyright notice and GPL version.
17676
17677 1994-09-15 Richard Stallman <rms@gnu.org>
17678
17679 * bison.simple:
17680 Update copyright notice and GPL version.
17681
17682 1994-07-12 Richard Stallman <rms@gnu.org>
17683
17684 * src/reduce.c, src/reader.c:
17685 entered into RCS
17686
17687 1994-05-05 David J. MacKenzie <djm@gnu.org>
17688
17689 * Makefile.in: entered into RCS
17690
17691 1994-03-26 Richard Stallman <rms@gnu.org>
17692
17693 * src/bison.s1: entered into RCS
17694
17695 1994-03-26 Richard Stallman <rms@gnu.org>
17696
17697 * bison.simple: entered into RCS
17698
17699 1994-03-25 Richard Stallman <rms@gnu.org>
17700
17701 * src/main.c: entered into RCS
17702
17703 1994-03-24 Richard Stallman <rms@gnu.org>
17704
17705 * src/conflicts.c: entered into RCS
17706
17707 1994-01-02 Richard Stallman <rms@gnu.org>
17708
17709 * Makefile.in: *** empty log message ***
17710
17711 1993-11-21 Richard Stallman <rms@gnu.org>
17712
17713 * src/bison.s1: *** empty log message ***
17714
17715 1993-11-21 Richard Stallman <rms@gnu.org>
17716
17717 * doc/bison.texinfo: entered into RCS
17718
17719 * doc/bison.texinfo: *** empty log message ***
17720
17721 1993-11-21 Richard Stallman <rms@gnu.org>
17722
17723 * bison.simple: *** empty log message ***
17724
17725 1993-10-25 David J. MacKenzie <djm@gnu.org>
17726
17727 * doc/bison.texinfo: *** empty log message ***
17728
17729 1993-10-19 Richard Stallman <rms@gnu.org>
17730
17731 * src/bison.s1: *** empty log message ***
17732
17733 1993-10-19 Richard Stallman <rms@gnu.org>
17734
17735 * bison.simple: *** empty log message ***
17736
17737 1993-10-14 Richard Stallman <rms@gnu.org>
17738
17739 * src/bison.s1: *** empty log message ***
17740
17741 1993-10-14 Richard Stallman <rms@gnu.org>
17742
17743 * bison.simple: *** empty log message ***
17744
17745 1993-09-14 David J. MacKenzie <djm@gnu.org>
17746
17747 * doc/bison.texinfo: *** empty log message ***
17748
17749 1993-09-13 Noah Friedman <friedman@gnu.org>
17750
17751 * Makefile.in: *** empty log message ***
17752
17753 1993-09-10 Richard Stallman <rms@gnu.org>
17754
17755 * src/conflicts.c: *** empty log message ***
17756
17757 * src/system.h: entered into RCS
17758
17759 1993-09-10 Richard Stallman <rms@gnu.org>
17760
17761 * doc/bison.1: entered into RCS
17762
17763 1993-09-06 Noah Friedman <friedman@gnu.org>
17764
17765 * src/version.c: entered into RCS
17766
17767 1993-09-06 Noah Friedman <friedman@gnu.org>
17768
17769 * Makefile.in: *** empty log message ***
17770
17771 1993-07-30 David J. MacKenzie <djm@gnu.org>
17772
17773 * Makefile.in: *** empty log message ***
17774
17775 1993-07-24 Richard Stallman <rms@gnu.org>
17776
17777 * src/bison.s1: *** empty log message ***
17778
17779 1993-07-24 Richard Stallman <rms@gnu.org>
17780
17781 * bison.simple: *** empty log message ***
17782
17783 1993-07-08 David J. MacKenzie <djm@gnu.org>
17784
17785 * Makefile.in: *** empty log message ***
17786
17787 1993-07-04 Richard Stallman <rms@gnu.org>
17788
17789 * src/bison.s1: *** empty log message ***
17790
17791 1993-07-04 Richard Stallman <rms@gnu.org>
17792
17793 * bison.simple: *** empty log message ***
17794
17795 1993-06-26 David J. MacKenzie <djm@gnu.org>
17796
17797 * src/getargs.c: entered into RCS
17798
17799 1993-06-26 David J. MacKenzie <djm@gnu.org>
17800
17801 * doc/bison.texinfo: *** empty log message ***
17802
17803 * doc/bison.1: New file.
17804
17805 1993-06-25 Richard Stallman <rms@gnu.org>
17806
17807 * src/getargs.c: New file.
17808
17809 1993-06-16 Richard Stallman <rms@gnu.org>
17810
17811 * src/bison.s1: *** empty log message ***
17812
17813 1993-06-16 Richard Stallman <rms@gnu.org>
17814
17815 * bison.simple: *** empty log message ***
17816
17817 1993-06-03 Richard Stallman <rms@gnu.org>
17818
17819 * src/bison.s1: New file.
17820
17821 1993-06-03 Richard Stallman <rms@gnu.org>
17822
17823 * doc/bison.texinfo: *** empty log message ***
17824
17825 1993-06-03 Richard Stallman <rms@gnu.org>
17826
17827 * bison.simple: New file.
17828
17829 1993-05-19 Richard Stallman <rms@gnu.org>
17830
17831 * doc/bison.texinfo: New file.
17832
17833 1993-05-07 Noah Friedman <friedman@gnu.org>
17834
17835 * Makefile.in: *** empty log message ***
17836
17837 1993-04-28 Noah Friedman <friedman@gnu.org>
17838
17839 * src/reader.c: *** empty log message ***
17840
17841 1993-04-23 Noah Friedman <friedman@gnu.org>
17842
17843 * src/alloc.h: entered into RCS
17844
17845 1993-04-20 David J. MacKenzie <djm@gnu.org>
17846
17847 * src/version.c: *** empty log message ***
17848
17849 * src/files.c, src/allocate.c:
17850 entered into RCS
17851
17852 * src/reader.c: *** empty log message ***
17853
17854 * src/lex.c: entered into RCS
17855
17856 * src/conflicts.c: New file.
17857
17858 * src/symtab.c: entered into RCS
17859
17860 * src/alloc.h: New file.
17861
17862 * src/LR0.c: entered into RCS
17863
17864 1993-04-18 Noah Friedman <friedman@gnu.org>
17865
17866 * src/reader.c: New file.
17867
17868 * src/version.c: *** empty log message ***
17869
17870 1993-04-18 Noah Friedman <friedman@gnu.org>
17871
17872 * Makefile.in: *** empty log message ***
17873
17874 1993-04-17 Noah Friedman <friedman@gnu.org>
17875
17876 * Makefile.in: *** empty log message ***
17877
17878 1993-04-15 Richard Stallman <rms@gnu.org>
17879
17880 * src/main.c, src/files.c:
17881 New file.
17882
17883 1993-04-15 Noah Friedman <friedman@gnu.org>
17884
17885 * configure.in: entered into RCS
17886
17887 * configure.in: *** empty log message ***
17888
17889 * configure.in: New file.
17890
17891 1993-04-14 Richard Stallman <rms@gnu.org>
17892
17893 * Makefile.in: New file.
17894
17895 1993-04-13 Richard Stallman <rms@gnu.org>
17896
17897 * src/version.c: New file.
17898
17899 1993-03-25 Richard Stallman <rms@gnu.org>
17900
17901 * src/output.c: entered into RCS
17902
17903 1992-09-25 Richard Stallman <rms@gnu.org>
17904
17905 * configure.bat: entered into RCS
17906
17907 1992-06-22 Richard Stallman <rms@gnu.org>
17908
17909 * src/vmsgetargs.c: entered into RCS
17910
17911 1992-06-22 Richard Stallman <rms@gnu.org>
17912
17913 * doc/bison.rnh: entered into RCS
17914
17915 1992-04-20 David J. MacKenzie <djm@gnu.org>
17916
17917 * README: entered into RCS
17918
17919 1992-01-22 Richard Stallman <rms@gnu.org>
17920
17921 * src/machine.h: entered into RCS
17922
17923 1991-12-21 Richard Stallman <rms@gnu.org>
17924
17925 * src/lalr.c, src/closure.c:
17926 entered into RCS
17927
17928 1991-12-20 Richard Stallman <rms@gnu.org>
17929
17930 * src/state.h: entered into RCS
17931
17932 1991-12-18 Richard Stallman <rms@gnu.org>
17933
17934 * src/print.c, src/nullable.c, src/derives.c:
17935 entered into RCS
17936
17937 1991-11-03 David J. MacKenzie <djm@gnu.org>
17938
17939 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17940 entered into RCS
17941
17942 1988-09-09 Richard Stallman <rms@gnu.org>
17943
17944 * src/bison.hairy: entered into RCS
17945
17946 1987-12-16 Richard Stallman <rms@gnu.org>
17947
17948 * REFERENCES: entered into RCS
17949
17950
17951 -----
17952
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.
17956
17957 Copying and distribution of this file, with or without
17958 modification, are permitted provided the copyright notice and this
17959 notice are preserved.
17960
17961 $Id$