]> git.saurik.com Git - bison.git/blob - ChangeLog
8f996fa1d3d655e4b7daa519b1c4c26d32f45f62
[bison.git] / ChangeLog
1 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2
3 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4 since it wasn't used; only the typedef name 'semantic_type' is needed.
5 Also, omit trailing white space.
6
7 * bootstrap: Sync from coreutils.
8 (gnulib_extra_files): Add build-aux/announce.gen.
9 (slurp): Adjust .gitignore files like .cvsignore files.
10 * build-aux/announce-gen: Remove from CVS, since bootstrap
11 now creates this.
12
13 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
14
15 Make %push-parser imply %pure-parser. This fixes several bugs; see
16 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
17 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
18 pure_parser = true.
19 * data/push.c: Don't bother testing b4_push_if when deciding whether
20 to expand b4_declare_parser_variables globally.
21 (yypush_parse): Likewise in here.
22
23 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
24 (yy_reduce_print): Reformat M4 for readability.
25
26 2006-12-15 Bob Rossi <bob@brasko.net>
27 and Joel Denny <jdenny@ces.clemson.edu>
28
29 * data/push.c (yypstate): Add typedef, and update all uses of
30 struct yypstate to just yypstate.
31 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
32
33 2006-12-14 Bob Rossi <bob@brasko.net>
34
35 * data/push.c (yypush_parse): Declare prototype regardless of
36 %locations option.
37
38 2006-12-14 Bob Rossi <bob@brasko.net>
39
40 * data/push.c (yyparse): Remove the prototype and the #define when in
41 push-parser mode.
42
43 2006-12-13 Bob Rossi <bob@brasko.net>
44
45 * data/push.c (yypstate_init): Rename to...
46 (yypstate_new): ... this and use b4_c_function_def.
47 (yypstate_delete): New.
48 (yypush_parse): Change parameters yynval and yynlloc to be const.
49 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
50 yypstate_delete functions.
51
52 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
53
54 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
55 strange test case titles. Reported by Bob Rossi.
56
57 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
58
59 * TODO: Add pointer to Sylvain Schmitz's work on static detection
60 of potential ambiguities in GLR grammers.
61
62 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
63
64 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
65 `bison ', use m4_index instead of m4_substr since chopping up a string
66 containing M4-special characters causes problems here.
67
68 Fix a couple of bugs related to special characters in user-specified
69 file names, and make it easier for skeletons to compute output file
70 names with the same file name prefix as Bison-computed output file
71 names.
72 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
73 b4_parser_file_name and b4_spec_defines_file instead of
74 @output_parser_name@ and @output_header_name@, which are now redundant.
75 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
76 b4_parser_file_name, b4_spec_defines_file, and the new
77 @basename(FILENAME@) instead of @output_parser_name@ and
78 @output_header_name@, which inappropriately escaped the file names as
79 C string literals.
80 * src/files.c (all_but_ext): Remove static qualifier.
81 (compute_output_file_names): Move `free (all_but_ext)' to...
82 (output_file_names_free): ... here since all_but_ext is needed later.
83 * src/files.h (all_but_ext): Extern.
84 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
85 exactly what MUSCLE_INSERT_STRING used to do.
86 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
87 characters are escaped properly.
88 * src/output.c (prepare): Define muscle file_name_all_but_ext as
89 all_but_ext.
90 For pkgdatadir muscle, maintain previous functionality by using
91 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
92 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
93 digraphs would never be expanded. Hopefully no one has M4-special
94 characters in his Bison installation path.
95 * src/scan-skel.l: Don't parse @output_header_name@ and
96 @output_parser_name@ anymore since they're now redundant.
97 In @output, use decode_at_digraphs.
98 Parse a new @basename command that invokes last_component.
99 (decode_at_digraphs): New.
100 (BASE_QPUTS): Remove unused.
101 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
102 (Output file name): New tests.
103
104 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
105
106 Warn about output files that are generated by the skeletons and that
107 conflict with other output files.
108 * data/glr.c: Don't generate the header file here when glr.cc does.
109 * src/files.c (file_names, file_names_count): New static globals.
110 (compute_output_file_names): Invoke output_file_name_check for files
111 not generated by the skeletons and remove existing checks.
112 (output_file_name_check): New function that warns about conflicting
113 output file names.
114 (output_file_names_free): Free file_names.
115 * src/files.h (output_file_name_check): Declare.
116 * src/scan-skel.l: Invoke output_file_name_check for files generated by
117 the skeletons.
118 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
119 (Conflicting output files): New tests.
120
121 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
122
123 * doc/bison.texinfo: Fix a couple of typos.
124
125 2006-12-08 Bob Rossi <bob@brasko.net>
126
127 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
128 Rename to...
129 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
130 update all uses.
131 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
132 (yypush_parse): Rename yypvars argument to yyps and remove redundant
133 local pv.
134 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
135 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
136
137 2006-12-07 Bob Rossi <bob@brasko.net>
138 and Joel Denny <jdenny@ces.clemson.edu>
139
140 * data/push.c (yypvarsinit): Change return type from void* to struct
141 yypvars*. No longer cast to void* on return.
142 (struct yypvars): Remove yylen since it need not be remembered between
143 yypushparse invocations.
144 (yypushparse): Don't copy between yylen and pv->yylen.
145
146 2006-12-05 Bob Rossi <bob@brasko.net>
147
148 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
149 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
150 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
151 (struct yypvars): Remove b4_declare_parser_variables.
152 (yypvarsinit): Remove init code for removed variables.
153 (global scope): Do not declare b4_declare_parser_variables if
154 push or pure mode.
155 (yypushparse): Add b4_declare_parser_variables.
156 Init new local variables, and remove init code for removed
157 yypvars variables.
158 (yyparse): Delete.
159 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
160 and yyparse for other modes.
161 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
162 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
163 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
164 (AT_PURE_LEX_IF): True if pure or push parser.
165
166 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
167
168 Document Yacc prologue alternatives and default %destructor's and
169 %printer's as experimental. Don't mention Java yet. Discussed at
170 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
171 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
172 (2.3a): Annotate this entry to say the old forms of these features were
173 also experimental.
174 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
175 Bison Symbols): Say they're experimental. Comment out any mention
176 of Java (we'll want this back eventually).
177
178 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
179
180 Support a file name argument to %defines. Deprecate `=' in
181 %file-prefix, %name-prefix, and %output. Discussed at
182 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
183 * NEWS (2.3a+): Mention.
184 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
185 form of %defines, and remove `=' from entries for %file-prefix,
186 %name-prefix, and %output.
187 * src/parse-gram.y (prologue_declaration): Implement.
188 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
189 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
190 all but one occurrence of %name-prefix.
191 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
192 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
193 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
194 occurrence of each of %file-prefix and %output. Add check for %defines
195 with argument.
196 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
197 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
198 Remove the `=' from %output.
199
200 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
201
202 Don't escape $ in test case titles since Autoconf 2.61 now does that
203 correctly.
204 * tests/actions.at (Default %printer and %destructor are not for error
205 or $undefined): Here.
206 (Default %printer and %destructor are not for $accept): Here.
207 * tests/input.at (Invalid $n and @n): Here.
208
209 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
210
211 Rename <!> to <>. Discussed starting at
212 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
213 * NEWS (2.3a+): Update.
214 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
215 Update.
216 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
217 * src/scan-gram.l (INITIAL): Implement.
218 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
219 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
220 comment.
221 * tests/actions.at (Default tagless %printer and %destructor,
222 Default tagged and per-type %printer and %destructor,
223 Default %printer and %destructor are not for error or $undefined,
224 Default %printer and %destructor are not for $accept,
225 Default %printer and %destructor for mid-rule values): Update.
226 * tests/input.at (Default %printer and %destructor redeclared,
227 Unused values with default %destructor): Update.
228
229 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
230
231 Don't let %prec take a nonterminal.
232 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
233 token.
234 * tests/input.at (%prec takes a token): New test checking that %prec
235 won't take a nonterminal.
236
237 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
238
239 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
240 it was double-quoted.
241 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
242 grammar is maintained with Bison's highest standards.
243 * src/getargs.c: Fix some typos in Doxygen comments.
244
245 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
246
247 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
248 later. Reported by Paul Eggert in
249 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
250 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
251 * src/scan-code.l (translate_action): Don't bother invoking
252 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
253 (code_scanner_free): Instead of invoking
254 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
255 which frees more.
256 * src/scan-gram.l (gram_scanner_free): Likewise.
257 * src/scan-skel.l (scan_skel): Likewise.
258
259 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
260
261 * src/files.c (tr): Change return type to void.
262 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
263 has been called previously for the same key.
264 (muscle_find): Return storage instead of value so that
265 --enable-gcc-warnings doesn't produce warnings that the return discards
266 const. aver that the value and storage are the same since storage
267 could potentially be NULL when value is not.
268 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
269 same as 0.
270
271 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
272
273 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
274 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
275 us a slightly cleaner distribution, and also works.
276 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
277 gnulib changes.
278
279 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
280 and Paul Eggert <eggert@cs.ucla.edu>
281
282 Don't let Bison leak memory except when it complains.
283 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
284 (spec_defines_file, dir_prefix): Now char *, not const char *,
285 since they are freed.
286 * src/files.c: Likewise.
287 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
288 Likewise.
289 (tr): Now operates in-place. All uses changed.
290 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
291 values.
292 (compute_file_name_parts, compute_output_file_names): Don't store
293 read-only data in variables that will be freed.
294 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
295 src_extension, and header_extension.
296 (output_file_names_free): New public function to free
297 spec_verbose_file, spec_graph_file, spec_defines_file,
298 parser_file_name, and dir_prefix.
299 * src/getargs.c (getargs): Don't store read-only data in variables that
300 will be freed.
301 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
302 (which previously existed but was unused), and quotearg_free.
303 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
304 * src/muscle_tab.c: Likewise.
305 (muscle_entry): Make the value char const *,
306 and add a new storage member that is char * and can be freed.
307 (muscle_entry_free): New private function.
308 (muscle_init): Use it instead of free.
309 (muscle_insert, muscle_grow): Update and use new storage member.
310 (muscle_code_grow): Free the string passed to muscle_grow
311 since it's not needed anymore.
312 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
313 add a new `char *code' member.
314 ("{...}"): Declare semantic type as code.
315 * src/scan-code.h (translate_rule_action):
316 (translate_symbol_action, translate_code, translate_action): Return
317 `char const *' rather than `char *' since external code should not free
318 these strings.
319 * src/scan-code.l: Likewise.
320 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
321 which is "{...}" in the parser.
322 * tests/Makefile.am (maintainer-check-valgrind): Set
323 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
324 Valgrind.
325 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
326 complain.
327 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
328 expecting a non-zero exit status sets --leak-check=summary and
329 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
330 this case, and we don't want to hear about it.
331
332 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
333
334 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
335 instead of from the template, to simplify configuration a bit.
336 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
337 and m4/wint_t.m4, as they are needed with the latest gnulib.
338
339 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
340
341 Disable unset/unused mid-rule value warnings by default, and recognize
342 --warnings=midrule-values to enable them. Discussed starting at
343 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
344 * NEWS (2.3a+): Mention.
345 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
346 warnings): Add entry for midrule-values subargument.
347 * src/reader.c (symbol_should_be_used): Don't return true just because
348 the value is a set/used mid-rule value unless
349 --warnings=midrule-values was specified.
350 * tests/input.at (Unused values, Unused values before symbol
351 declarations): Run tests with and without --warnings=midrule-values.
352
353 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
354 than LIST_FREE directly.
355
356 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
357
358 Finish implementing --warnings=error, which should not be implied by
359 --warnings=all (or by its synonyms -W and --warnings without
360 subarguments).
361 * src/complain.c (set_warning_issued): New function to report that
362 warnings are being treated as errors and to record an error if so.
363 Invoke...
364 (warn_at, warn): ... here.
365 * src/getargs.c (warnings_args, warnings_types): Reorder so that
366 "error - warnings are errors" does not appear above "all - all of the
367 above".
368 (getargs): For -W and --warnings without subarguments, don't let
369 FLAGS_ARGMATCH set warnings_error in warnings_flag.
370 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
371
372 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
373
374 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
375 empty subargument list. For example: `bison --warnings= parser.y'.
376
377 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
378
379 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
380 the parser header file so that gcc doesn't warn.
381
382 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
383
384 Split the default %destructor/%printer into two kinds: <*> and <!>.
385 Discussed starting at
386 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
387 * NEWS (2.3a+): Mention.
388 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
389 previous change today related to mid-rules.
390 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
391 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
392 (TYPE_TAG_ANY): Add as <*>.
393 (TYPE_TAG_NONE): Add as <!>.
394 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
395 for <*> and <!>.
396 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
397 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
398 * src/symlist.c (symbol_list_default_new): Split into tagged and
399 tagless versions.
400 (symbol_list_destructor_set, symbol_list_printer_set): Split
401 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
402 SYMLIST_DEFAULT_TAGLESS.
403 * src/symlist.h: Update symbol_list_default*_new prototypes.
404 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
405 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
406 * src/symtab.c (default_destructor, default_destructor_location,
407 default_printer, default_printer_location): Split each into tagged and
408 tagless versions.
409 (symbol_destructor_get, symbol_destructor_location_get,
410 symbol_printer_get, symbol_printer_location_get): Implement tagged
411 default and tagless default cases.
412 (default_destructor_set, default_printer_set): Split each into tagged
413 and tagless versions.
414 * src/symtab.h: Update prototypes.
415 * tests/actions.at (Default %printer and %destructor): Rename to...
416 (Default tagless %printer and %destructor): ... this, and extend.
417 (Per-type %printer and %destructor): Rename to...
418 (Default tagged and per-type %printer and %destructor): ... this, and
419 extend.
420 (Default %printer and %destructor for user-defined end token): Extend.
421 (Default %printer and %destructor are not for error or $undefined):
422 Update.
423 (Default %printer and %destructor are not for $accept): Update.
424 (Default %printer and %destructor for mid-rule values): Extend.
425 * tests/input.at (Default %printer and %destructor redeclared): Extend.
426 (Unused values with default %destructor): Extend.
427
428 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
429
430 Don't apply the default %destructor/%printer to an unreferenced midrule
431 value. Mentioned at
432 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
433 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
434 like $@n instead of just @n so that the default %destructor/%printer
435 logic doesn't see them as user-defined symbols.
436 (symbol_is_dummy): Check for both forms of the name.
437 * src/reader.c (packgram): Remove the `$' from each midrule symbol
438 name for which the midrule value is referenced in any action.
439 * tests/actions.at (Default %printer and %destructor for mid-rule
440 values): New test.
441 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
442 for change to dummy symbol names.
443
444 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
445
446 Warn about unset midrule $$ if the corresponding $n is used.
447 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
448 $n usage.
449 (packgram): Before invoking grammar_rule_check on any rule, make sure
450 all actions have already been scanned in order to set `used' flags.
451 Otherwise, checking that a midrule's $$ is set will not always work
452 properly because the midrule check must forward-reference the midrule's
453 parent rule.
454 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
455 warning.
456
457 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
458
459 More improvements to the documentation of the prologue alternatives:
460 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
461 Bison manual.
462 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
463 some text to clarify the relative importance of the new directives and
464 to show how these directives may be viewed as code labels.
465
466 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
467
468 Similar to the recently removed %before-header, add %code-top as the
469 alternative to the pre-prologue. Mentioned at
470 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
471 Also, let the prologue alternatives appear in the grammar section.
472 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
473 (prologue_declaration): Move the existing prologue alternatives to...
474 (grammar_declaration): ... here and add %code-top.
475 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
476
477 Clean up and extend documentation for the prologue alternatives.
478 * NEWS (2.3a+): Describe prologue alternatives.
479 * doc/bison.texinfo (Prologue): Move discussion of prologue
480 alternatives to...
481 (Prologue Alternatives): ... this new section, and extend it to discuss
482 all 4 directives in detail.
483 (Bison Symbols): Clean up discussion of prologue alternatives and add
484 %code-top.
485
486 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
487
488 DJGPP specific issues.
489
490 * djgpp/config.bat: config.hin has been moved to lib. Adjust
491 config.bat accordingly.
492 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
493 * djgpp/config.site: Likewise.
494
495 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
496
497 Replace %*-header with %provides, %requires, %code. See discussion at
498 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
499
500 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
501 (b4_user_start_header): Remove.
502 * data/glr.c: Use new macros instead of b4_*start_header
503 and b4_*end_header.
504 * data/glr.cc: Likewise.
505 * data/lalr1.cc: Likewise.
506 * data/push.c: Likewise.
507 * data/yacc.c: Likewise.
508
509 * doc/bison.texinfo: Remove %before-header, rename
510 %{start,end,after}-header to %requires, %provides, %code.
511
512 * src/parse-gram.y: Likewise (also rename token names accordingly).
513 * src/scan-gram.l: Likewise.
514 * tests/actions.at: Likewise.
515
516 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
517
518 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
519 Problem reported by Joel E. Denny.
520
521 2006-10-14 Jim Meyering <jim@meyering.net>
522
523 (Sync from coreutils.)
524 Work also when the working directory (with e.g. coreutils sources)
525 is version controlled with git, rather than CVS.
526 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
527 rather than CVS.
528 In messages and comments, say e.g., "checked-out sources",
529 rather than "CVS sources".
530 (version_controlled_file): New function. Work for git as well as
531 for CVS. Don't use grep's -q option.
532 (slurp): Call it here, in place of CVS-specific code.
533
534 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
535
536 Fix testsuite for ./configure --enable-gcc-warnings:
537 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
538 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
539 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
540 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
541 * test/regression.at (Diagnostic that expects two alternatives):
542 Likewise.
543
544 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
545
546 * bootstrap.conf (gnulib_modules): Add config-h.
547 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
548 worry about HAVE_CONFIG_H.
549 * lib/abitset.c: Likewise.
550 * lib/bitset.c: Likewise.
551 * lib/bitset_stats.c: Likewise.
552 * lib/bitsetv-print.c: Likewise.
553 * lib/bitsetv.c: Likewise.
554 * lib/ebitset.c: Likewise.
555 * lib/get-errno.c: Likewise.
556 * lib/lbitset.c: Likewise.
557 * lib/subpipe.c: Likewise.
558 * lib/timevar.c: Likewise.
559 * lib/vbitset.c: Likewise.
560 * lib/bitset.c: Include "bitset.h" first, to test interface.
561 * lib/bitset_stats.c: Include "bitset_stats.h" first.
562 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
563 * lib/bitsetv.c: Include "bitsetv.h" first.
564 * lib/get-errno.c: Include "get-errno.h" first.
565 * m4/.cvsignore: Add config-h.m4.
566 * tests/actions.at (Default %printer and %destructor for ...):
567 Adjust expected line numbers in output to reflect removal of #if
568 HAVE_CONFIG_H lines.
569 * tests/glr-regression.at (Missed %merge type warnings when ...):
570 Likewise.
571 * tests/regression.at (Braced code in declaration in rules section):
572 Likewise.
573 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
574 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
575 Include <config.h> unconditionally.
576
577 * bootstrap: Sync from coreutils, as follows:
578
579 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
580
581 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
582 variable was sometimes used without being initialized. This
583 messed up the installation of the INSTALL file in some cases.
584
585 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
586
587 * bootstrap (usage, main program, symlink_to_gnulib): Add option
588 --copy. Inspired by a suggestion from Bruno Haible.
589
590 2006-10-03 Jim Meyering <jim@meyering.net>
591
592 * bootstrap: Undo last change to this file, since now gnulib-tool
593 sticks with the automake default in generating dependencies.
594
595 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
596
597 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
598 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
599
600 * doc/bison.1: Add copyright notice.
601
602 * data/glr.c: Don't include <stdarg.h>; not used.
603
604 * NEWS: The -g and --graph options now output graphs in Graphviz
605 DOT format, not VCG format.
606 * doc/bison.1: Likewise.
607 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
608 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
609 of this change in
610 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
611 * TODO: Remove Graphviz entry.
612 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
613 remove vcg.c, vcg.h, vcg_defaults.h.
614 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
615 * src/graphviz.c, src/graphviz.h: New files.
616 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
617 * src/files.h: Make comment more generic.
618 * src/main.c (main): Likewise.
619 * src/print_graph.h: Likewise.
620 * src/getargs.c (usage): Make usage description more generic.
621 * src/print_graph.c: Include graphviz.h rather than vcg.h.
622 (static_graph, fgraph): Remove. All uses changed to pass
623 arguments instead of sharing a static var.
624 (print_core, print_actions, print_state, print_graph):
625 Output graphviz format rather than VCG format.
626 * tests/.cvsignore: Remove *.vcg; add *.dot.
627 * tests/output.at: Expect *.dot files, not *.vcg files.
628
629 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
630 accommodates the 2006-10-08 change.
631
632 2006-10-11 Bob Rossi <bob@brasko.net>
633
634 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
635 (b4_yyssa, b4_yyerror_range): New macros.
636 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
637 (yypvarsinit): Remove init of removed fields.
638 (yypushparse): Remove use of removed fields; use new macros instead.
639
640 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
641
642 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
643 in a push parser. Reindent slightly to match yacc.c better.
644
645 2006-10-11 Bob Rossi <bob@brasko.net>
646
647 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
648 yymsg_alloc fields.
649 (yypvarsinit, yypushparse): Remove init of removed fields.
650 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
651
652 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
653
654 * THANKS: Add Paolo Bonzini and Bob Rossi.
655
656 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
657
658 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
659 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
660 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
661 b4_define_user_cde and uses): Remove.
662 (b4_comment, b4_prefix, b4_sync_start): New.
663 * data/bison.m4: New file, with most of the content removed from c.m4.
664 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
665 * src/output.c (output_skeleton): Pass bison.m4.
666 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
667 only if specified.
668
669 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
670
671 Fix test failure reported by Tom Lane in
672 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
673 and try to make such failures easier to catch in the future.
674 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
675 that's now the caller's responsibility.
676 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
677 Set yychar = YYEOF if it's negative.
678 * tests/actions.at (yylex): Abort if asked to read past EOF.
679 * tests/conflicts.at (yylex): Likewise.
680 * tests/cxx-type.at (yylex): Likewise.
681 * tests/glr-regression.at (yylex): Likewise.
682 * tests/input.at (yylex): Likewise.
683 * tests/regression.at (yylex): Likewise.
684 * tests/torture.at (yylex): Likewise.
685
686 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
687
688 Fix problems with translating English-language diagnostics.
689 * bootstrap: Fix bug introduced in recent bootstrap changes, with
690 respect to bison-runtime pot generation. The YY_ stuff
691 wasn't being captured.
692 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
693 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
694 * runtime-po/POTFILES.in: Add data/push.c.
695
696 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
697
698 Merge bootstrap changes from coreutils.
699
700 2006-09-28 Jim Meyering <jim@meyering.net>
701
702 Automatically generated dependencies are important even
703 when all of the sources in a directory come from gnulib.
704 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
705 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
706
707 2006-09-23 Jim Meyering <jim@meyering.net>
708
709 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
710
711 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
712
713 * bootstrap: Add support for --force.
714 (usage): New function. Describe usage less tersely.
715 (CVS_only_file): New var.
716
717 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
718
719 * data/push.c (YYPUSH_MORE): Make it an enum instead.
720 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
721 Adjust white space and comments to match GNU style better.
722
723 2006-09-20 Bob Rossi <bob@brasko.net>
724
725 * data/push.c (yyresult_get): Remove function.
726 (YYPUSH_MORE): Add #define.
727 (yypushparse): Modify return value.
728
729 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
730
731 * stamp-h.in: Remove; no longer needed.
732 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
733 Remove config.h, config.hin, intl (no longer created).
734 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
735 stamp-h1.
736
737 Sync bootstrap from coreutils, as follows:
738
739 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
740
741 * bootstrap (symlink_to_gnulib): New function.
742 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
743 to copies-of-gnulib.
744 (cp_mark_as_generated, slurp, gnulib_files):
745 Avoid making a copy if it's the same as the old version.
746 (gnulib_files): Add support for this variable (used by Bison).
747
748 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
749
750 * src/getargs.c (usage): Rework to use conventions similar to
751 coreutils, to make translation a bit easier and the code a bit
752 smaller. Problem reported by Tim Van Holder.
753
754 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
755
756 Use some of gnulib's new modules, taken from coreutils.
757
758 * bootstrap: Sync from coreutils, except add support for gnulib_files.
759 * bootstrap.conf: New file.
760 (gnulib_modules): Add configmake, inttypes, unistd.
761 (XGETTEXT_OPTIONS): Add complain, complain_at,
762 fatal, fatal_at, warn, warn_at, unexpected_end.
763 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
764 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
765 (gl_EARLY): Add.
766 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
767 (gl_INIT): Add
768 (GNULIB_AUTOCONF_SNIPPET): Remove.
769 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
770 the pickiest.
771 * lib/.cvsignore: Add inttypes_.h.
772 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
773 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
774 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
775 no-longer-necessary initializations.
776 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
777 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
778 use the unistd module.
779 * src/system.h: Likewise.
780 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
781 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
782 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
783 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
784 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
785 * src/system.h: Include inttypes.h unconditionally, now that we
786 use the inttypes module. Don't bother to include stdint.h, since
787 inttypes.h now does that for us.
788 (LOCALEDIR): Remove, now that we use the configmake module.
789 * src/getargs.c: Include configmake.h.
790 * src/main.c: Likewise.
791 * src/output.c: Likewise.
792 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
793 not from $abs_top_builddir, since config.h moved.
794
795
796 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
797 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
798
799 * src/parse-gram.y (symbol_declaration): Don't put statements
800 before declarations; it's not portable to C89.
801 * src/scan-code.l (handle_action_at): Likewise.
802
803 * src/scan-code.l: Always initialize braces_level; the old code
804 left it uninitialized and therefore had undefined behavior.
805
806 Don't attempt to redefine 'assert', since it runs afoul of
807 systems where standard headers (mistakenly) include <assert.h>.
808 Instead, define and use our own alternative, called 'aver'.
809 * src/reader.c: Don't include assert.h, since we no longer
810 use assert.
811 * src/scan-code.l: Likewise.
812 * src/system.h (assert): Remove, replacing with....
813 (aver): New function, taking a bool arg. All uses changed.
814 * src/tables.c (pack_vector): Ensure that aver arg is bool,
815 not merely an integer.
816
817 2006-09-15 Bob Rossi <bob@brasko.net>
818
819 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
820 * data/c.m4 (YYPUSH): New.
821 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
822 * src/getargs.c (push_parser): New var.
823 * src/getargs.h (push_parser): New declaration.
824 * src/output.c (prepare): Add macro insertion of `push_flag'.
825 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
826 (prologue_declaration): Parse %push-parser.
827 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
828 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
829 list of removed lines from the traces observed.
830 (AT_CHECK_CALC_LALR): Added push parser tests.
831
832 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
833
834 * NEWS: Version 2.3a.
835 * configure.ac (AC_INIT): Likewise.
836
837 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
838 "#define YYSTYPE int" that caused "make maintainer-check" to fail
839 due to header ordering dependencies. I don't know why the #define
840 was there.
841
842 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
843 runtime cost when YYDEBUG is not defined, and so that some tests
844 that used to fail now work. Problem and initial suggestion by
845 Paolo Bonzini.
846 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
847 * data/glr.cc (b4_parser_class_name):
848 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
849 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
850 (yydebug_) [YYDEBUG]: New member.
851 (yycdebug_): Now defined only if YYDEBUG.
852 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
853 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
854 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
855 if YYYDEBUG.
856 (debug_stream, set_debug_stream, debug_level, set_debug_level):
857 Define only if YYDEBUG.
858 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
859 set_debug_level.
860 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
861 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
862 AT_CHECK_CALC_GLR_CC that are working now.
863
864 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
865
866 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
867 We don't need them in glr.cc, and glr.c defines them.
868 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
869 assumes that defining it to anything is the same as defining
870 it to 1. Problem reported by Paolo Bonzini.
871
872 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
873
874 * data/c.m4 (b4_null, b4_case): Define.
875 * src/output.c (prepare_symbols): Use b4_null.
876 (user_actions_output): Use b4_case.
877
878 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
879
880 * data/glr.c (b4_shared_declarations): Put start-header first,
881 before any #includes that we generate, so that feature-test
882 macros work. Problem reported by Michael Deutschmann in
883 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
884 * data/lalr1.cc: Likewise.
885 * doc/bison.texinfo (Prologue): Document that feature-test macros
886 should be defined before any Bison declarations.
887 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
888 that depend on location.hh after, not before, Bison decls, since
889 we now include location.hh after the first user prologue.
890
891 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
892 Sander Brandenburg in
893 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
894 Also, fix minor white space and comment issues.
895 (Prologue): Mention that it's better to define feature-test macros
896 before Bison declarations. Problem reported by Michael Deutschmann.
897
898 * README-cvs: Fix typo: "&" should be "&&". Problem reported
899 by Jim Meyering.
900 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
901 This adjusts to recent gnulib changes.
902
903 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
904
905 Finish implementation of per-type %destructor/%printer. Discussed
906 starting at
907 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
908 and
909 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
910 * NEWS (2.3+): Add a description of this feature to the default
911 %destructor/%printer description.
912 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
913 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
914 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
915 list node contains a semantic type.
916 * src/symtab.c, src/symtab.h: Extend with a table that associates
917 semantic types with their %destructor's and %printer's.
918 (semantic_type_from_uniqstr, semantic_type_get,
919 semantic_type_destructor_set, semantic_type_printer_set): New functions
920 composing the public interface of that table.
921 (symbol_destructor_get, symbol_destructor_location_get,
922 symbol_printer_get, symbol_printer_location_get): If there's no
923 per-symbol %destructor/%printer, look up the per-type before trying
924 the default.
925 * tests/actions.at (Per-type %printer and %destructor): New test case.
926 * tests/input.at (Default %printer and %destructor redeclared):
927 Extend to check that multiple occurrences of %symbol-default in a
928 single %destructor/%printer declaration is an error.
929 (Per-type %printer and %destructor redeclared, Unused values with
930 per-type %destructor): New test cases.
931
932 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
933
934 Require default %destructor/%printer to be declared using
935 %symbol-default instead of an empty symbol list, and start working on
936 new per-type %destructor/%printer. Discussed at
937 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
938 * NEWS (2.3+): Add %symbol-default to example.
939 * bison.texinfo (Freeing Discarded Symbols): Likewise.
940 (Bison Symbols): Add entry for %symbol-default.
941 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
942 (generic_symlist, generic_symlist_item): New nonterminals for creating
943 a list in which each item is a symbol, semantic type, or
944 %symbol-default.
945 (grammar_declaration): Use generic_symlist in %destructor and %printer
946 declarations instead of symbols.1 or an empty list.
947 (symbol_declaration, precedence_declaration, symbols.1): Update actions
948 for changes to symbol_list.
949 * src/reader.c: Update for changes to symbol_list.
950 * src/scan-code.l: Likewise.
951 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
952 * src/symlist.c, src/symlist.h: Extend such that a list node may
953 represent a semantic type or a %symbol-default in addition to just an
954 ordinary symbol. Add switched functions for setting %destructor's and
955 %printer's.
956 * tests/actions.at, tests/input.at: Add %symbol-default to all default
957 %destructor/%printer declarations.
958
959 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
960
961 Whether the default %destructor/%printer applies to a particular symbol
962 isn't a question of whether the user *declares* that symbol (in %token,
963 for example). It's a question of whether the user by any means
964 *defines* the symbol at all (by simply using a char token, for
965 example). $end is defined by Bison whereas any other token with token
966 number 0 is defined by the user. The error token is always defined by
967 Bison regardless of whether the user declares it with %token, but we
968 may one day let the user define error as a nonterminal instead.
969 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
970 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
971 the meaning of "user-defined".
972 * tests/actions.at (Default %printer and %destructor for user-declared
973 end token): Rename to...
974 (Default %printer and %destructor for user-defined end token): ...
975 this.
976
977 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
978 computation of whether to apply the default, don't maintain a list of
979 every Bison-defined symbol. Instead, just check for a first character
980 of '$', which a user symbol cannot have, and check for the error token.
981
982 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
983
984 Don't apply the default %destructor or %printer to the error token,
985 $undefined, or $accept. This change fits the general rule that the
986 default %destructor and %printer are only for user-declared symbols,
987 and it solves several difficulties that are described in the new test
988 cases listed below.
989 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
990 * tests/actions.at (Default %printer and %destructor are not for error
991 or $undefined, Default %printer and %destructor are not for $accept):
992 New test cases.
993
994 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
995
996 Allow %start after the first rule.
997 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
998 when parsing the first rule.
999 (check_and_convert_grammar): Search for it here after all grammar
1000 declarations have been parsed. Skip midrules, which have dummy LHS
1001 nonterminals.
1002 * src/symtab.c (symbol_is_dummy): New function.
1003 * src/symtab.h (symbol_is_dummy): Declare it.
1004 * tests/input.at (%start after first rule): New test.
1005
1006 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1007
1008 Redo some of the previous commit: add back the ability to use
1009 non-aliased/undeclared string literals since it might be useful to
1010 those declaring %token-table.
1011 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1012 commit: don't worry about complaints from symbols_pack.
1013 * src/symtab.c (symbol_new, symbol_class_set,
1014 symbol_check_alias_consistency): Undo changes in previous commit: count
1015 each string literal as a new symbol and token, assign it a symbol
1016 number, and don't complain about non-aliased string literals.
1017 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1018 and token counts but does still set aliased tokens to the same number,
1019 symbol_pack_processor now leaves empty slots in the symbols array.
1020 Remove those slots.
1021 * tests/regression.at (Undeclared string literal): Remove test case
1022 added in previous commit since non-aliased string literals are allowed
1023 again.
1024 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1025 remove unnecessary string literal declarations.
1026 * tests/sets.at (Firsts): Likewise.
1027
1028 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1029
1030 Don't allow an undeclared string literal, but allow a string literal to
1031 be used before its declaration.
1032 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1033 symbols_pack complained.
1034 * src/symtab.c (symbol_new): Don't count a string literal as a new
1035 symbol.
1036 (symbol_class_set): Don't count a string literal as a new token, and
1037 don't assign it a symbol number since symbol_make_alias does that.
1038 (symbol_make_alias): It's not necessary to decrement the symbol and
1039 token counts anymore. Don't assume that an alias declaration occurs
1040 before any uses of the identifier or string, and thus don't assert that
1041 one of them has the highest symbol number so far.
1042 (symbol_check_alias_consistency): Complain if there's a string literal
1043 that wasn't declared as an alias.
1044 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1045 symbol_pack asserts that every token has been assigned a symbol number
1046 although undeclared string literals have not.
1047 * tests/regression.at (String alias declared after use, Undeclared
1048 string literal): New test cases.
1049 (Characters Escapes, Web2c Actions): Declare string literals as
1050 aliases.
1051 * tests/sets.at (Firsts): Likewise.
1052
1053 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1054
1055 In the grammar scanner, STRING_FINISH unclosed constructs and return
1056 them to the parser in order to improve error messages.
1057 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1058 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1059 * tests/input.at (Unclosed constructs): New test case.
1060 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1061 seen.
1062
1063 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1064 unused global.
1065
1066 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1067
1068 Handle string aliases for character tokens correctly.
1069 * src/symtab.c (symbol_user_token_number_set): If the token has an
1070 alias, check and set its alias's user token number instead of its own,
1071 which is set to indicate the alias. Previously, every occurrence of
1072 the character token in the grammar overwrote that alias indicator with
1073 the character code.
1074 * tests/input.at (String aliases for character tokens): New test.
1075
1076 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1077
1078 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1079
1080 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1081
1082 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1083 to prevent failures when building on older platforms.
1084 Check for autopoint failure.
1085 Set XGETTEXT_OPTIONS to values that check for C format strings,
1086 so that translators are warned about them (this also helps
1087 prevent core dumps).
1088
1089 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1090 function, since it simplifies our code a bit.
1091
1092 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1093 rather than -W, so we don't get bogus warnings about sign comparisons.
1094 Add -Wpointer-arith, since that warning is useful (it reports code
1095 that does not conform to C89 and that some compilers reject).
1096 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1097 since it's no longer needed.
1098
1099 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1100
1101 Clean up scanners a bit.
1102 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1103 definitions so gcc won't warn when obstack_for_string is unused.
1104 * src/scan-code.l: config.h and system.h are already #include'd by
1105 scan-code-c.c, so get rid of them here.
1106 * src/scan-gram.l: Likewise.
1107 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1108 definitions rather than duplicating the rest of it.
1109 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1110
1111 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1112
1113 Suppress signed/unsigned comparison warnings for yycheck.
1114 * data/c.m4 (b4_safest_int_type): New macro.
1115 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1116 a signed int type, cast it to b4_safest_int_type first.
1117 * data/yacc.c: Likewise.
1118 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1119 also overwritten.
1120
1121 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1122
1123 * doc/bison.texinfo: Fix some typos.
1124
1125 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1126
1127 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1128 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1129
1130 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1131 the latest gnulib does this a different way.
1132 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1133 translation was patched, so stop omitting it.
1134
1135 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1136
1137 Enable declaration of default %printer/%destructor. Make the parser
1138 use these for all user-declared grammar symbols for which the user does
1139 not declare a specific %printer/%destructor. Thus, the parser uses it
1140 for token 0 if the user declares it but not if Bison generates it as
1141 $end. Discussed starting at
1142 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1143 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1144 and
1145 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1146 * NEWS (2.3+): Mention.
1147 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1148 declare a %destructor for a mid-rule's semantic value. It's just
1149 impossible to declare one specific to it.
1150 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1151 code. Describe default %destructor form.
1152 * src/parse-gram.y (grammar_declaration): Parse default
1153 %printer/%destructor declarations.
1154 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1155 and symbol_destructor_location_get rather than accessing the destructor
1156 and destructor_location members of struct symbol.
1157 (symbol_printers_output): Likewise but for %printer's.
1158 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1159 again.
1160 * src/symtab.c (default_destructor, default_destructor_location,
1161 default_printer, default_printer_location): New static global
1162 variables to record the default %destructor and %printer.
1163 (symbol_destructor_get, symbol_destructor_location_get,
1164 symbol_printer_get, symbol_printer_location_get): New functions to
1165 compute the appropriate %destructor and %printer for a symbol.
1166 (default_destructor_set, default_printer_set): New functions to set the
1167 default %destructor and %printer.
1168 * src/symtab.h: Prototype all those new functions.
1169 * tests/actions.at (Default %printer and %destructor): New test to
1170 check that the right %printer and %destructor are called, that they're
1171 not called for $end, and that $$ and @$ work correctly.
1172 (Default %printer and %destructor for user-declared end token): New
1173 test to check that the default %printer and %destructor are called for
1174 a user-declared end token.
1175 * tests/input.at (Default %printer and %destructor redeclared, Unused
1176 values with default %destructor): New tests to check related grammar
1177 warnings and errors.
1178
1179 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1180
1181 Clean up handling of %destructor for the end token (token 0).
1182 Discussed starting at
1183 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1184 and
1185 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1186
1187 Make the skeletons consistent in how they pop the end token and invoke
1188 its %destructor.
1189 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1190 state, which has token number 0, since this would invoke the
1191 %destructor for the end token.
1192 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1193 until after shifting the end token, or else it won't be popped.
1194 * data/yacc.c (yyparse): Likewise.
1195
1196 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1197 it's the end token. Upon termination, destroy an unshifted lookahead
1198 even when it's the end token.
1199 * data/lalr1.cc (yy::parser::parse): Likewise.
1200 * data/yacc.c (yyparse): Likewise.
1201
1202 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1203 value warnings for the end token when the user gives the end token a
1204 %destructor.
1205
1206 * tests/actions.at (Printers and Destructors): Test all the above.
1207
1208 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1209
1210 Update to latest gnulib and gettext versions.
1211 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1212 Add fopen-safer.
1213 (gnulib_files): Add m4/warning.m4. Don't worry about files
1214 overwritten by autopoint.
1215 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1216 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1217 rejects them.
1218 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1219 so that we can remove the intl files at a better time.
1220 (intl_files_to_remove): Remove aclocal.m4, since it gets
1221 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1222 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1223 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1224 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1225 Remove datarootdir hack; no longer needed.
1226 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1227 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1228 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1229 strdup.h.
1230 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1231 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1232
1233 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1234
1235 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1236 it with --assume-autoconf='latest-stable'.
1237
1238 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1239
1240 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1241 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1242 YYSTYPE' and `{'.
1243 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1244 those from muscle_tab.c since the old ones are misleading.
1245
1246 2006-07-13 Akim Demaille <akim@epita.fr>
1247
1248 Support %define "KEY" {VALUE}.
1249 * src/scan-code.h, src/scan-code.l (translate_action)
1250 (translate_rule_action, translate_symbol_action, translate_code):
1251 Return char *, not const char *.
1252 * src/parse-gram.y (declaration): Rename as...
1253 (prologue_declaration): this.
1254 (string_content): Remove this nonterminal, use STRING.
1255 (braceless, content, content.opt): New nonterminal.
1256 Use them.
1257 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1258 as value.
1259 * src/scan-gram.l (getargs.h): Don't include it.
1260
1261 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1262
1263 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1264 rather than a for-loop that declares a local bool variable. This
1265 should work around a compatibility problem with a Cray x1e C++
1266 compiler reported by Hung Nguyen in
1267 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1268 The for-loop was introduced in the 2004-11-17 change but I don't
1269 know why it was needed.
1270
1271 2006-07-12 Akim Demaille <akim@epita.fr>
1272
1273 * data/c.m4: Comment changes.
1274
1275 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
1276
1277 * src/complain.c (error_message, ERROR_MESSAGE): New.
1278 To factor...
1279 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1280 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1281
1282 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1283
1284 * NEWS: Instead of %union, you can define and use your own union type
1285 YYSTYPE if your grammar contains at least one <type> tag.
1286 Your YYSTYPE need not be a macro; it can be a typedef.
1287 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1288 (Union Decl, Decl Summary): Document this.
1289 * data/glr.c (YYSTYPE): Implement this.
1290 * data/glr.cc (YYSTYPE): Likewise.
1291 * data/lalr1.cc (YYSTYPE): Likewise.
1292 * data/yacc.c (YYSTYPE): Likewise.
1293 * src/output.c (prepare): Output tag_seen_flag.
1294 * src/parse-gram.y (declaration, grammar_declaration):
1295 Use 'union_seen' rather than 'typed' to determine whether
1296 %union has been seen, since grammars can now be typed without
1297 %union.
1298 (symbol_declaration, type.opt, symbol_def):
1299 Keep track of whether a tag has been seen.
1300 * src/reader.c (union_seen, tag_seen): New vars.
1301 (typed): remove.
1302 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1303 * src/scan-code.l (untyped_var_seen): New variable.
1304 (handle_action_dollar): Adjust to above changes.
1305 (handle_action_dollar, handle_action_at):
1306 Improve overflow checking for outlandish numbers.
1307 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1308 avoid new diagnostics generated by above changes.
1309 * tests/regression.at (YYSTYPE typedef): Add test to check
1310 for type tags without %union.
1311
1312 * src/symlist.c (symbol_list_length): Return int, not unsigned
1313 int, since callers expect int. This may need to get revisited
1314 once we have proper integer overflow checking.
1315
1316 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1317 object is now static.
1318
1319 * src/getargs.c (flags_argmatch): Return void, not int,
1320 to pacify ./configure --enable-gcc-warnings.
1321
1322 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1323 since last_string is already defined to FLEX_PREFIX (last_string).
1324
1325 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1326
1327 Implement --warnings/-W.
1328 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1329 replaced by...
1330 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1331 Adjust callers.
1332 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1333 (warnings_args, warnings_types): New.
1334 (getargs, short_options, long_options): Accept -W/--warnings.
1335 Sort the options by alphabetical order, upper case letter right
1336 before its lower case.
1337
1338 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1339
1340 Change %merge result type clash warnings to errors. Discussed at
1341 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1342 * src/reader.c (record_merge_function_type): Use complain_at.
1343 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1344 declared later): Update test case results.
1345
1346 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1347
1348 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1349 to be in alphabetical order.
1350 (trace_args): Spelling fixes.
1351
1352 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1353
1354 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1355 so they don't collide with user-defined macros.
1356 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1357 this was never guaranteed, and now that we're using gnulib stdint,
1358 which defines int_fast16_t to long int, the problem is exposed.
1359
1360 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1361
1362 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1363 need the full POSIX semantics (and weren't implementing them
1364 anyway).
1365
1366 Adjust to Autoconf 2.60 and today's gnulib.
1367 * bootstrap (gnulib_modules): Add stdint.
1368 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1369 no longer copies it.
1370 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1371 since stdint needs the former and wcwidth (which is now required
1372 by mbswidth) needs the latter.
1373 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1374 work around a compatibility glitch between gettext 0.14.6 and
1375 Autoconf 2.60.
1376 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1377 Do not check for uintptr_t, since new stdint module does the right
1378 thing.
1379 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1380 Add stdint.h, stdint_.h, wcwidth.h.
1381 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1382 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1383 stdint.m4, wchar_t.m4, wcwidth.m4.
1384 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1385 usual order for ../lib/*.h files.
1386 (file_name_split): Use last_component, not base_name, to adjust
1387 to gnulib changes.
1388 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1389 for ../lib/*.h files.
1390 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1391 Define unconditionally, since we now assume the stdint module.
1392 * src/scan-skel.l: Include <dirname.h>.
1393 (BASE_QPUTS): Use last_component, not base_name.
1394 * src/system.h: Include <unlocked-io.h> in the usual order
1395 for ../lib/*.h files. Include <stdint.h> unconditionally,
1396 since we now use the stdint module.
1397 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1398 HAVE_UINTPTR_T, since we now use the stdint module.
1399 (base_name): Remove decl, since files now include <dirname.h>
1400 to get the decl.
1401
1402 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1403
1404 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1405 New, default to 1.
1406 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1407 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1408 default.
1409 * tests/calc.at: Adjust.
1410
1411 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1412
1413 * data/c.m4 (b4_basename): New.
1414 (b4_syncline): Also output the location of its invocation (from
1415 the skeleton).
1416 (b4_user_action, b4_define_user_action, b4_user_actions)
1417 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1418 (b4_user_stype): New.
1419 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1420
1421 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1422
1423 In the grammar file, the first column is 1 not 0 on the first line as
1424 on every other line.
1425 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1426 * tests/input.at (Torturing the Scanner): Update output.
1427
1428 * src/scan-gram.l (scanner_cursor): Declare it static.
1429
1430 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1431
1432 In warnings, say "previous declaration" rather than "first
1433 declaration".
1434 * src/symtab.c (redeclaration): Do that here.
1435 * src/reader.c (record_merge_function_type): In the case of a result
1436 type clash, report the previous declaration rather than the very first
1437 one in the grammar file.
1438 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1439 declared later): Add a third declaration to check this behavior.
1440 * tests/input.at (Incompatible Aliases): Update output.
1441
1442 2006-06-27 Akim Demaille <akim@epita.fr>
1443
1444 * doc/Doxyfile.in: New.
1445 * doc/Makefile.am: Use it.
1446 * src/lalr.h, src/symtab.h: Initial doxygenation.
1447
1448 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1449
1450 Don't miss %merge result type warnings just because the LHS types are
1451 declared after the %merge. This continues the effort of the previous
1452 patch.
1453 * src/reader.c (get_merge_function): Don't set the merger type yet.
1454 (record_merge_function_type): New function for setting the merger type
1455 and checking for clashes.
1456 (grammar_current_rule_merge_set): Set the location of the %merge for
1457 the current rule.
1458 (packgram): Invoke record_merge_function_type for each rule now that
1459 all symbol type declarations have been parsed.
1460 * src/reader.h (merger_list.type_declaration_location): New member
1461 storing the location of the first %merge from which the type for this
1462 merging function was derived.
1463 * src/symlist.h (symbol_list.merger_declaration_location): New member
1464 storing the location of a rule's %merge, if any.
1465 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1466 declared later): New test to catch the error fixed by the above patch.
1467
1468 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1469
1470 Get action warnings (grammar_rule_check) right even when symbol
1471 declarations appear after the rules. Discussed at
1472 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1473 and
1474 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1475 Don't mistake the type of $$ in a midrule to be that of its parent
1476 rule's $$.
1477 * src/reader.c (grammar_current_rule_end): Don't invoke
1478 grammar_rule_check yet since not all symbol declarations may have been
1479 parsed yet.
1480 (grammar_midrule_action): Likewise.
1481 Don't record whether the midrule's $$ has been used yet since actions
1482 haven't been translated yet.
1483 Record the midrule's parent rule and its RHS index within the parent
1484 rule.
1485 (grammar_current_rule_action_append): Don't translate the action yet
1486 since not all symbol declarations may have been parsed yet and, thus,
1487 warnings about types for $$, $n, @$, and @n can't be reported yet.
1488 (packgram): Translate the action and invoke grammar_rule_check now that
1489 all symbol declarations have been parsed.
1490 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1491 after parsing the entire grammar file, the symbol list here in the case
1492 of a midrule is actually the midrule's empty RHS, so reference its
1493 parent rule's RHS where necessary.
1494 On the other hand, now that you can already know it's a midrule, you
1495 aren't forced to think $$ has the same type as its parent rule's $$.
1496 (handle_action_at): In the case of a midrule, reference the parent rule
1497 where necessary.
1498 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1499 members.
1500 (symbol_list_length): Now that this is invoked after all rules have
1501 been parsed, a NULL symbol (rather than a NULL symbol list node)
1502 terminates a rule. symbol_list_print already does this correctly.
1503 * src/symlist.h (symbol_list.midrule_parent_rule,
1504 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1505 remember their relationships with their parents.
1506 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1507 fixed by the above patch.
1508 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1509 implementing...
1510 (Unused values): ... this old test case and...
1511 (Unused values before symbol declarations): ... this new test case.
1512 This one is the same as `Unused values' except that all symbol
1513 declarations appear after the rules in order to catch the rest of the
1514 errors fixed by the above patch.
1515
1516 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1517
1518 More cleanup.
1519 * src/reader.c (current_rule): Declare it static since it's no longer
1520 used outside this file.
1521 (grammar_current_rule_action_append): Remove redundant arguments from
1522 translate_rule_action invocation.
1523 * src/reader.h (current_rule): Remove this unused extern.
1524 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1525 * src/scan-code.l (translate_rule_action): Likewise.
1526
1527 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1528
1529 Clean up yesterday's patch.
1530 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1531 to...
1532 * src/reader.c (grammar_current_rule_action_append): ... here for
1533 consistency with grammar_current_rule_symbol_append.
1534 * tests/regression.at (Braced code in declaration in rules section):
1535 Make yyerror and yylex static as usual.
1536
1537 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1538
1539 Fix bug that mistakes braced code in a declaration in the rules section
1540 to be a rule action. Mentioned at
1541 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1542 * src/scan-gram.l: Move midrule action detection from the start of the
1543 scanning of any braced code to...
1544 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1545 action. For readability, use $2 and @2 rather than the equivalent
1546 global variables.
1547 * tests/regression.at (Braced code in declaration in rules section):
1548 New test to catch the error fixed by the above patch.
1549
1550 Work on code readability some.
1551 * src/scan-code.l (current_rule): Get rid of this misleading and
1552 redundant declaration: it's actually extern'ed in reader.h.
1553 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1554 translate_action): Add a rule argument and use it instead of the global
1555 current_rule.
1556 (translate_rule_action): This already receives current_rule through an
1557 argument, so pass it on to translate_action instead of assigning
1558 current_rule to current_rule.
1559 (translate_symbol_action, translate_code): Pass rule = NULL to
1560 translate_action.
1561
1562 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1563
1564 Rename %before-definitions to %start-header and %after-definitions to
1565 %end-header. Don't use these declarations to separate pre-prologue
1566 blocks from post-prologue blocks. Add new order-independent
1567 declarations %before-header and %after-header as alternatives to the
1568 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1569 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1570 * NEWS (2.3+): Update for these changes.
1571 * data/glr.c (b4_before_definitions): Update to...
1572 (b4_start_header): ... this.
1573 (b4_after_definitions): Update to...
1574 (b4_end_header): ... this.
1575 * data/glr.cc: Likewise.
1576 * data/lalr1.cc: Likewise.
1577 * data/yacc.c: Likewise.
1578 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1579 prologue blocks with %*-header declarations.
1580 (Calc++ Parser): Likewise.
1581 (Bison Declaration Summary): Update names.
1582 (Bison Symbols): Update description.
1583 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1584 (PERCENT_END_HEADER): ... this.
1585 (PERCENT_BEFORE_DEFINITIONS): Update to...
1586 (PERCENT_START_HEADER): ... this.
1587 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1588 (declaration): Update token names and m4 macro names.
1589 When parsing %end-header and %start-header, invoke translate_code
1590 before muscle_code_grow, and no longer set global booleans to remember
1591 whether these declarations have been seen.
1592 Parse new %after-header and %before-header.
1593 * src/reader.c (before_definitions, after_definitions): Remove.
1594 (prologue_augment): Accept a new bool argument to specify whether to
1595 augment the pre-prologue or post-prologue.
1596 * src/reader.h (before_definitions, after_definitions): Remove these
1597 extern's.
1598 (prologue_augment): Add new bool argument.
1599 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
1600 (PERCENT_END_HEADER): ... this.
1601 (PERCENT_BEFORE_DEFINITIONS): Update to...
1602 (PERCENT_START_HEADER): ... this.
1603 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1604 * tests/actions.at (Printers and Destructors): Update names.
1605
1606 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1607
1608 Add comparison operators for C++ location classes. Discussed at
1609 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
1610 * data/c++.m4 (b4_define_location_comparison): New boolean %define
1611 declaration indicating whether filename_type has an operator==. If
1612 filename_type is `std::string', it defaults to `1', `0' otherwise.
1613 * data/location.cc: Iff b4_define_location_comparison is `1', add
1614 operator== and operator!= for class position and for class location.
1615
1616 Some minor fixes.
1617 * src/scan-action.l: Remove unused file.
1618 * src/symtab.c (symbol_printer_set): Use printer_location not
1619 destructor_location.
1620 * src/symtab.h (struct symbol): Replace incorrect source comment for
1621 printer members.
1622 * tests/input.at (Incompatible Aliases): Update output with correct
1623 printer location.
1624
1625 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1626
1627 Don't put the pre-prologue in the header file. For the yacc.c code
1628 file and the glr.c header and code files, move the pre-prologue before
1629 the token definitions. Add new %before-definitions and
1630 %after-definitions to declare code that will go in both the header file
1631 and code file. Discussed at
1632 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
1633 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
1634 and
1635 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
1636 * NEWS (2.3+): Describe these changes.
1637 * data/glr.c (b4_pre_prologue): Move from within to before...
1638 (b4_shared_declarations): ... this.
1639 Add new b4_before_definitions before b4_token_enums.
1640 Add new b4_after_definitions at the end.
1641 * data/glr.cc (b4_pre_prologue): Replace with...
1642 (b4_before_definitions): ... this in the header file.
1643 (b4_after_definitions): New near the end of the header file.
1644 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
1645 code file right before including the header file.
1646 (b4_before_definitions): New in the previous position of
1647 b4_pre_prologue in the header file.
1648 (b4_after_definitions): New near the end of the header file.
1649 * data/yacc.c: Clean up some m4 quoting especially in the header file.
1650 (b4_token_enums_defines): In the code file, move to right before
1651 YYSTYPE for consistency with the header file.
1652 (b4_before_definitions): New right before b4_token_enums_defines in
1653 both the header and code file.
1654 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
1655 header and code file.
1656 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
1657 of prologues for %union dependencies.
1658 (Bison Declaration Summary): In %defines description, mention the
1659 effect of %before-definitions and %after-definitions on the header
1660 file.
1661 (Calc++ Parser): Forward declare driver in a %before-definitions rather
1662 than in the pre-prologue so that make check succeeds.
1663 (Bison Symbols): Add entries for %before-definitions and
1664 %after-definitions.
1665 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
1666 %before-definitions.
1667 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
1668 (declaration): Parse those declarations and append to
1669 b4_before_definitions and b4_after_definitions, respectively.
1670 * src/reader.c (before_definitions, after_definitions): New bools to
1671 track whether those declarations have been seen.
1672 (prologue_augment): Add to the post-prologue if %union,
1673 %before-definitions, or %after-definitions has been seen.
1674 * src/reader.h (before_definitions, after_definitions): New extern's.
1675 * src/scan-gram.l: Scan the new declarations.
1676 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
1677 prologue block in a %before-definitions or a %after-definitions based
1678 on whether the %union is declared.
1679 * tests/regression.at (Early token definitions with --yacc, Early token
1680 definitions without --yacc): Move tests for token definitions into the
1681 post-prologue since token names are no longer defined in the
1682 pre-prologue.
1683
1684 2006-06-20 Akim Demaille <akim@epita.fr>
1685
1686 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1687 (symbol_get): Use it.
1688 * src/parse-gram.y: Use it.
1689
1690 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1691
1692 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1693 build succeeds when configured with --enable-gcc-warnings.
1694
1695 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1696
1697 * src/parse-gram.y (char_name): New function.
1698 (CHAR, STRING, string_content): For %printer, properly escape.
1699 (ID): Prefer fputs to fprintf.
1700 (id): Reindent to be consistent with other rules.
1701 Properly quote char.
1702
1703 The Translation Project changed its way of publishing translations
1704 to maintainers. I haven't received any responses to my request
1705 for supporting the old way, or for documenting the new way. I
1706 have modified 'bootstrap' to use screen scraping
1707 (in this case, HTML scraping). This is unreliable and inelegant,
1708 but I don't see any better way. Yuck.
1709 * bootstrap (TP_URL, WGET_COMMAND): New vars.
1710 (get_translations): New function, which uses HTML scraping to
1711 deduce locations of latest translations.
1712 Use this function to grab both bison and bison-runtime .po files.
1713 Don't bother priming the pump for the runtime-po domain any more,
1714 as it's now translated better than bison is.
1715
1716 2006-06-19 Akim Demaille <akim@epita.fr>
1717
1718 * src/scan-gram.l: No longer "parse" things after `%union' until
1719 `{'. Rather, return a single "%union" token.
1720 No longer make symbols: return strings, and leave the conversion
1721 to symbols to the parser.
1722 (SC_PRE_CODE, token_type): Remove.
1723 * src/parse-gram.y (%union): New field `character'.
1724 Sort tokens.
1725 (CHAR): New token.
1726 (ID, ID_COLON): Now that the scanner no longer makes them
1727 identifiers, adjust all uses to invoke symbol_get.
1728 (id_colon): New, wraps the conversion from string to symbol.
1729 (%union): Accept a possible union_name.
1730 (symbol): Now can be a char.
1731 * data/c.m4 (b4_union_name): Leave a default value.
1732 * data/glr.c, data/yacc.c: Use it.
1733
1734 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1735
1736 For associating token numbers with token names for "yacc.c", don't use
1737 #define statements unless `--yacc' is specified; always use enum
1738 yytokentype. Most important discussions start at:
1739 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1740 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1741 and
1742 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1743 * NEWS (2.3+): Mention.
1744 * data/c.m4 (b4_yacc_if): New.
1745 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1746 token #define's.
1747 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1748 on token name definitions.
1749 * src/getargs.c (usage): Capitalize `Yacc' in English.
1750 * src/output.c (prepare): Define b4_yacc_flag.
1751 * tests/regression.at (Early token definitions): Test that tokens names
1752 are defined before the pre-prologue not just before the post-prologue.
1753 Remove this test case and copy to...
1754 (Early token definitions with --yacc): ... this to test #define's.
1755 (Early token definitions without --yacc): ... and this to test enums.
1756
1757 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1758
1759 * NEWS: Reword the post-2.3 change to not be so optimistic about
1760 removing the old "look-ahead" spelling.
1761 Update previous look-ahead/lookahead change reports.
1762 * REFERENCES: look-ahead -> lookahead (since that's
1763 what he actually wrote).
1764 * doc/refcard.tex: look ahead -> lookahead,
1765 look-ahead -> lookahead
1766
1767 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1768
1769 For consistency, use `lookahead' instead of `look-ahead' or
1770 `look_ahead'. Discussed starting at
1771 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1772 and then at
1773 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1774 * NEWS: For the next release, note the change to `--report'.
1775 * TODO, doc/bison.1: Update English.
1776 * doc/bison.texinfo: Update English.
1777 (Understanding Your Parser, Bison Options): Document as
1778 `--report=lookahead' rather than `--report=look-ahead'.
1779 * src/conflicts.c: Update English in comments.
1780 (lookahead_set): Rename from look_ahead_set.
1781 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1782 (resolve_sr_conflict): Rename local look_ahead_tokens to
1783 lookahead_tokens, and update other uses.
1784 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1785 count_rr_conflicts, conflicts_free): Update uses.
1786 * src/getargs.c (report_args): Move "lookahead" before alternate
1787 spellings.
1788 (report_types): Update uses.
1789 (usage): For `--report' usage description, state `lookahead' spelling
1790 rather than `look-ahead'.
1791 * src/getargs.h (report.report_lookahead_tokens): Rename from
1792 report_look_ahead_tokens.
1793 * src/lalr.c: Update English in comments.
1794 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1795 (state_lookahead_tokens_count): Rename from
1796 state_look_ahead_tokens_count.
1797 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1798 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1799 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1800 Update other uses.
1801 Update English in output.
1802 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1803 * src/print.c: Update English in comments.
1804 (lookahead_set): Rename from look_ahead_set.
1805 (print_reduction): Rename argument lookahead_token from
1806 look_ahead_token.
1807 (print_core, state_default_rule, print_reductions, print_results):
1808 Update uses.
1809 * src/print_graph.c: Update English in comments.
1810 (print_core): Update uses.
1811 * src/state.c: Update English in comments.
1812 (reductions_new): Update uses.
1813 (state_rule_lookahead_tokens_print): Rename from
1814 state_rule_look_ahead_tokens_print, and update other uses.
1815 * src/state.h: Update English in comments.
1816 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1817 (state_rule_lookahead_tokens_print): Rename from
1818 state_rule_look_ahead_tokens_print.
1819 * src/tables.c: Update English in comments.
1820 (conflict_row, action_row): Update uses.
1821 * tests/glr-regression.at
1822 (Incorrect lookahead during deterministic GLR,
1823 Incorrect lookahead during nondeterministic GLR): Rename
1824 print_look_ahead to print_lookahead.
1825 * tests/torture.at: Update English in comments.
1826 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1827 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1828 (Many lookahead tokens): Update uses.
1829 * data/glr.c: Update English in comments.
1830 * lalr1.cc: Likewise.
1831 * yacc.c: Likewise.
1832 * src/conflicts.h: Likewise.
1833 * src/lalr.h: Likewise.
1834 * src/main.c: Likewise.
1835 * src/output.c: Likewise.
1836 * src/parse-gram.c: Likewise.
1837 * src/tables.h: Likewise.
1838 * tests/calc.at: Likewise.
1839
1840 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1841
1842 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1843
1844 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1845
1846 * TODO: Add request from Nelson H. F. Beebe to be able to install
1847 Bison without installing the yacc script.
1848
1849 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1850
1851 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1852 and yytext if they're already #define'd.
1853 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1854 * src/scan-code-c.c: ... here.
1855 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1856 <config.h>.
1857
1858 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1859
1860 Get Bison to build again when configured with --enable-gcc-warnings.
1861 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1862 missing #include's.
1863 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1864 loc argument as it shadows a global.
1865 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1866 invocation.
1867
1868 * src/.cvsignore: Add scan-code.c.
1869
1870 2006-06-07 Akim Demaille <akim@epita.fr>
1871
1872 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1873 to...
1874 * src/scan-code.l: here.
1875 * tests/input.at (Torturing the Scanner): Fix another location
1876 error.
1877
1878 2006-06-07 Akim Demaille <akim@epita.fr>
1879
1880 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1881
1882 2006-06-06 Akim Demaille <akim@epita.fr>
1883
1884 Extract the parsing of user actions from the grammar scanner.
1885 As a consequence, the relation between the grammar scanner and
1886 parser is much simpler. We can also split "composite tokens" back
1887 into simple tokens.
1888 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1889 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1890 rename as...
1891 * src/location.h, src/location.c (add_column_width)
1892 (location_compute): these.
1893 Fix the column count: the initial column is 0.
1894 (location_print): Be robust to ending column being 0.
1895 * src/location.h (boundary_set): New.
1896 * src/main.c: Adjust to scanner_free being renamed as
1897 gram_scanner_free.
1898 * src/output.c: Include scan-code.h.
1899 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1900 Use boundary_set.
1901 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
1902 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
1903 which is now, again, a separate token.
1904 Adjust all dependencies.
1905 Whereever actions with $ and @ are used, use translate_code.
1906 (action): Remove this nonterminal which is now useless.
1907 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
1908 (grammar_current_rule_action_append): Use translate_code.
1909 (packgram): Bound check ruleno, itemno, and rule_length.
1910 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
1911 (last_string, last_braced_code_loc, max_left_semantic_context)
1912 (scanner_initialize, scanner_free, scanner_last_string_free)
1913 (gram_out, gram_lineno, YY_DECL_): Move to...
1914 * src/scan-gram.h: this new file.
1915 (YY_DECL): Rename as...
1916 (GRAM_DECL): this.
1917 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
1918 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1919 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1920 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1921 Move these declarations, and...
1922 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
1923 these to...
1924 * src/flex-scanner.h: this new file.
1925 * src/scan-gram.l (rule_length, rule_length_overflow)
1926 (increment_rule_length): Remove.
1927 (last_braced_code_loc): Rename as...
1928 (gram_last_braced_code_loc): this.
1929 Adjust to the changes of the parser.
1930 Move all the handling of $ and @ into...
1931 * src/scan-code.l: here.
1932 * src/scan-gram.l (handle_dollar, handle_at): Remove.
1933 (handle_action_dollar, handle_action_at): Move to...
1934 * src/scan-code.l: here.
1935 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
1936 scan-code.h, scan-code-c.c, scan-gram.h.
1937 (EXTRA_bison_SOURCES): Add scan-code.l.
1938 (BUILT_SOURCES): Add scan-code.c.
1939 (yacc): Be robust to white spaces.
1940
1941 * tests/conflicts.at, tests/input.at, tests/reduce.at,
1942 * tests/regression.at: Adjust the column numbers.
1943 * tests/regression.at: Adjust the error message.
1944
1945 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1946
1947 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1948 Use Akim's wording from
1949 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
1950
1951 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1952
1953 Between Bison releases, manually append `+' to the previous Bison
1954 release number, and use that as a signal to automatically print the
1955 ChangeLog's CVS Id keyword from --version. Discussed starting at
1956 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
1957 * ChangeLog: Add Id header.
1958 * configure.ac (AC_INIT): Append `+' to `2.3'.
1959 * src/.cvsignore: Add revision.c.
1960 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1961 (BUILT_SOURCES): Add revision.c.
1962 (revision.c): New target rule. This file defines a new global variable
1963 named revision. It initializes it with either the Id from ChangeLog
1964 or, if VERSION doesn't contain `+', with the empty string.
1965 * src/getargs.c (version): Print the value of revision.
1966 * src/revision.h: Extern revision.
1967
1968 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1969
1970 * NEWS: Version 2.3.
1971 * configure.ac (AC_INIT): Likewise.
1972
1973 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1974
1975 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1976 with no arguments, not as an object-like macro. This is for
1977 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1978 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1979 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1980 Document this.
1981
1982 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1983
1984 * src/getargs.c (usage): Back out yesterday's modification of the
1985 --help output so that we don't have to wait for translation before
1986 releasing 2.3.
1987
1988 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1989
1990 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1991 Problem reported by Akim Demaille.
1992
1993 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1994
1995 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1996
1997 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1998
1999 * data/yacc.c (yy_reduce_print): Omit trailing white space in
2000 generated source code. Problem reported by Frans Englich in
2001 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
2002
2003 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
2004
2005 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
2006 shell, not within 'make', so that 'make' by an ordinary builder
2007 (using GNU make) does not worry about configuring gzip. This also
2008 works around a bug reported independently by Keith Thompson and by
2009 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
2010 stderr rather than stdout, messing up the build logs.
2011
2012 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2013
2014 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2015 to make sure that YYID will never be unused. This fixes a 'make
2016 maintainer-check' failure caused by the recent changes to the 'Trivial
2017 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2018 not used.
2019 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2020
2021 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2022
2023 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2024 state before an empty RHS is always resolved here. Only the location
2025 of that state is guaranteed to be resolved, and that's enough. This
2026 fixes the remaining bug reported by Derek M. Jones in
2027 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2028 * tests/glr-regression.at (Uninitialized location when reporting
2029 ambiguity): Test the above case.
2030 Also, the embedded comments in this test case claim it checks the case
2031 of an empty RHS that has inherited the initial location. However, the
2032 corresponding LHS was already resolved, so yyresolveLocations didn't
2033 actually have reason to modify it. Fix this by forcing
2034 nondeterministic operation at the beginning of the parse.
2035
2036 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2037
2038 * data/c.m4 (b4_yy_symbol_print_generate):
2039 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2040 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2041 of the bugs reported today by Derek M Jones in
2042 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2043 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2044 defined to be a type name without parens or brackets.
2045 (Location Type): Similarly for YYLTYPE.
2046 * tests/regression.at (Trivial grammars): Put in a test for this
2047 bug that will be caught by 'make maintainer-check' (though not,
2048 alas, by 'make check' unless your compiler is picky).
2049
2050 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2051
2052 * NEWS: Version 2.2.
2053 * configure.ac (AC_INIT): Likewise.
2054
2055 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2056
2057 * data/glr.c (yyreportTree): Make room in yystates for the state
2058 preceding the RHS. This fixes the segmentation fault reported by Derek
2059 M. Jones in
2060 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2061 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2062 to the user. Reported for yyreportTree by Derek M. Jones later in the
2063 same thread.
2064 * THANKS: Add Derek M. Jones.
2065 Update my email address.
2066 Fix typo in Steve Murphy's name.
2067
2068 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2069
2070 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2071 checking against YYLAST that caused the parser to miss a potential
2072 alternative in its diagnostic.
2073 Problem reported by Maria Jose Moron Fernandez in
2074 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2075 * data/lalr1.cc (yysyntax_error_): Likewise.
2076 * data/yacc.c (yysyntax_error): Likewise.
2077 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2078 tokens, in case we run into an older C compiler.
2079 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2080 Use them to check for the off-by-one error fixed above.
2081
2082 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2083 YYSIZE_T, not size_t.
2084 * tests/regression.at (Trivial grammars): New test, to catch
2085 the error fixed by the above patch.
2086
2087 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2088
2089 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2090 scheme.
2091 Reported by Steve Murphy.
2092
2093 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2094
2095 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2096 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2097
2098 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2099
2100 Implement --trace=m4.
2101 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2102 * src/output.c (output_skeleton): When set, pass -dV to m4.
2103
2104 Factor the handling of flags in m4.
2105 * src/output.c (prepare): Rename the muscle names debug, defines,
2106 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2107 * data/c.m4: Adjust.
2108 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2109 Use b4_define_flag_if to define other b4_FLAG_if macros.
2110 (b4_location_if): As a consequence, rename as...
2111 (b4_locations_if): this, for consistency.
2112 Adjust all the skeletons.
2113
2114 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2115
2116 * etc/bench.pm: Shorten bench names.
2117
2118 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2119
2120 * src/output.h, src/output.c (error_verbose): Move to...
2121 * src/getargs.h, src/getargs.c: here.
2122 Sort the flags.
2123 Adjust dependencies.
2124
2125 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2126
2127 * data/c.m4 (b4_copyright): Put the special exception for Bison
2128 skeletons here, so we don't have to put it in each skeleton. All
2129 uses changed. Suggested by Akim Demaille. Also, wrap the
2130 copyright notice, in case it is longer than 80 columns. Replace
2131 comma by newline after title.
2132
2133 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2134
2135 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2136 incompatibility, not a bug. Mention that it wasn't fixed as of
2137 flex 2.5.33.
2138
2139 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2140
2141 * examples/extexi: Enforce the precedence of concatenation over
2142 >>.
2143 Reported by Tommy Nordgren.
2144
2145 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2146
2147 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2148 with the member "token".
2149 Reported by Martin Nylin.
2150
2151 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2152
2153 * data/glr.c: Switch to Bison 2.2 special-exception language in
2154 the copyright notice. Use more-regular format for titles and
2155 copyright notices.
2156 * data/glr.cc: Likewise.
2157 * data/location.cc: Likewise.
2158 * data/yacc.cc: Likewise.
2159 * doc/bison.texinfo (Conditions): Document this.
2160 * NEWS: likewise. Upgrade version to 2.2.
2161
2162 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
2163
2164 * data/glr.cc: Remove dead code.
2165
2166 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2167
2168 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2169 that variable and the line breaks the bootstrap. Problem reported
2170 by Juan M. Guerrero.
2171
2172 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2173
2174 * doc/bison.texinfo (Multiple start-symbols): New.
2175
2176 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2177
2178 * etc/README, etc/bench.pl: New.
2179
2180 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
2181
2182 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2183 rule.
2184 Reported by Mickael Labau.
2185 * tests/input.at (Torturing the Scanner): Test it.
2186
2187 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2188
2189 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2190 Problem reported by Bob Rossi.
2191
2192 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2193
2194 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2195 and didn't really work.
2196 For the index, use @ifnotinfo, not @iftex.
2197 Minor cleanups of spacing and terminology.
2198
2199 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2200
2201 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2202 of AT_NAME_PREFIX when %name-prefix is not used.
2203
2204 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2205
2206 Apply --prefix to C++ skeletons too: they change the namespace.
2207 The test suite already exercize these cases.
2208 * data/c++.m4 (b4_namespace): New.
2209 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2210 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2211 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2212 * doc/bison.texinfo: Document it.
2213 (Option Cross Key): Use @multitable in all formats. It looks
2214 nicer, even in TeX outputs.
2215 (Rules): Use the same code whatever the output type is.
2216 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2217 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2218 * tests/calc.at: Use it, instead of hard coding `yy'.
2219
2220 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2221
2222 * TODO: Remove dead items.
2223
2224 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2225
2226 * doc/FAQ: Remove, merged into...
2227 * doc/bison.texinfo (FAQ): this.
2228 * doc/Makefile.am (EXTRA_DIST): Adjust.
2229
2230 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2231
2232 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2233 even if empty.
2234 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2235 * doc/bison.texinfo (Calc++ Scanner): Use it.
2236
2237 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2238
2239 Fix two nits reported by twlevo, plus one more that I discovered.
2240
2241 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2242 this is the usual Bison style.
2243 * src/location.h (location_print): Likewise.
2244
2245 * src/reader.h (token_name): Likewise.
2246
2247 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2248
2249 Fix some nits reported by twlevo.
2250 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2251 and "POSIX". Use more-modern syntax for URLs. Mention C++
2252 and ask for Java. Don't hardwire OS version numbers. Add
2253 copyright notice.
2254 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2255 * src/conflicts.c (solved_conflicts_obstack): Now static.
2256
2257 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2258
2259 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2260 page. Say "you can use it" not "you may use it" as on the web page;
2261 we're describing capabilities not granting permission.
2262
2263 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2264
2265 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2266 shadowing warnings. Use usual patter for iterating through RHS.
2267 * tests/glr-regression.at
2268 (Uninitialized location when reporting ambiguity):
2269 Modify yylex so that it uses its argument, rather than trying
2270 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2271 const char -> char const.
2272
2273 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2274 Don't use tabs inside commands; it messes up 'ps'.
2275 Problem reported by twlevo.
2276
2277 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2278
2279 * tests/glr-regression.at (Uninitialized location when reporting
2280 ambiguity): New test case.
2281 * data/glr.c (yyresolveLocations): New function, which uses
2282 YYLLOC_DEFAULT.
2283 (yyresolveValue): Invoke yyresolveLocations before reporting an
2284 ambiguity.
2285 * doc/bison.texinfo (Default Action for Locations): Note
2286 YYLLOC_DEFAULT's usage for ambiguity locations.
2287 (GLR Semantic Actions): Cross-reference those notes.
2288
2289 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2290
2291 * tests/glr-regression.at (Leaked semantic values when reporting
2292 ambiguity): Remove unnecessary union and type declarations.
2293 (Leaked lookahead after nondeterministic parse syntax error): New test
2294 case.
2295 * data/glr.c (yyparse): Check for zero stacks remaining before
2296 attempting to shift the lookahead so that you don't lose it.
2297
2298 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2299
2300 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2301 * tests/glr-regression.at (Leaked semantic values when reporting
2302 ambiguity): New test case.
2303 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2304 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2305 now unnecessary yystackp parameter.
2306 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2307 destructors can be called.
2308
2309 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2310 in existing testcases.
2311
2312 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2313
2314 Don't leak semantic values for parent RHS when a user action cuts the
2315 parser, and clean up related code a bit.
2316 * tests/glr-regression.at (Leaked merged semantic value if user action
2317 cuts parse): Rename to...
2318 (Leaked semantic values if user action cuts parse): ... this. Add check
2319 for leaked parent RHS values.
2320 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2321 between an unresolved state (non-empty chain of semantic options) and
2322 an incomplete one (signaled by an empty chain).
2323 (yyresolveStates): Document the interface. Move all manipulation of a
2324 successfully or unsuccessfully resolved yyGLRState to...
2325 (yyresolveValue): ... here so that yyresolveValue always leaves a
2326 yyGLRState with consistent data and thus is easier to understand.
2327 Remove the yyvalp and yylocp parameters since they are always just
2328 taken from the yys parameter. When reporting a discarded merged value
2329 in debugging output, note that it is incompletely merged. Document the
2330 interface.
2331 (yyresolveAction): If resolving any of the RHS states fails, destroy
2332 them all rather than leaking them. Thus, as long as user actions are
2333 written to clean up the RHS correctly, yyresolveAction always cleans up
2334 the RHS of a semantic option. Document the interface.
2335
2336 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2337
2338 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2339 led to a segmentation fault in GNU Pascal. Problem reported
2340 by Waldek Hebisch.
2341
2342 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2343
2344 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2345 mid-rule action inside a nonterminal symbol in order to declare a
2346 destructor for its semantic value.
2347
2348 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2349
2350 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2351 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2352 __cplusplus && ! defined _STDLIB_H && !
2353 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2354 defined free))]: Include <stdlib.h> rather than rolling our own
2355 declarations of malloc and free, to avoid problems with
2356 incompatible declarations (using 'throw') C++'s stdlib.h. This
2357 should fix Debian bug 340012
2358 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2359 reported by Guillaume Melquiond.
2360
2361 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2362
2363 * NEWS: Clarify symbols versus types in unused-value warnings.
2364
2365 * configure.ac (AC_INIT): Bump version number.
2366
2367 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2368
2369 * NEWS: Version 2.1a.
2370 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2371 since C99 requires this.
2372
2373 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2374
2375 * m4/c-working.m4: New file.
2376 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2377
2378 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2379
2380 * Makefile.maint: Merge from coreutils.
2381
2382 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2383
2384 More portability fixes for problems summarized by Nelson H. F. Beebe.
2385
2386 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2387 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2388 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2389 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2390 messes up because C++ code is compiled in 32-bit mode but linked
2391 in 64-bit mode.
2392
2393 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2394
2395 More portability fixes for problems summarized by Nelson H. F. Beebe.
2396
2397 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2398 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2399
2400 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2401 nodist_PROGRAMS, since we don't need to actually compile the
2402 example if we're just doing a plain 'make'. This avoids bothering
2403 the installer unnecessarily about problems due to weird C++
2404 compilers.
2405
2406 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2407
2408 More portability fixes for problems summarized by Nelson H. F. Beebe.
2409
2410 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2411 than #include "...", and compile with -I'.'. The old method was
2412 not portable, according to Posix and the C standard, and it does
2413 not work with Sun C 5.7, where previous #line directives affect
2414 the working directory used in later #include "..." directives.
2415
2416 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2417
2418 Various DJGGP specific issues in /djgpp
2419
2420 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2421
2422 More portability fixes for problems summarized by Nelson H. F. Beebe.
2423
2424 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2425 '#include <map>' works and that you can apply ++ to iterators.
2426
2427 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2428
2429 Work around portability problems summarized by Nelson H. F. Beebe in
2430 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2431
2432 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2433 that '#include <string>' works.
2434
2435 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2436 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2437 "warning: sorry: semantics of inline function static data `const
2438 unsigned char translate_table[262]' are wrong (you'll wind up with
2439 multiple copies)".
2440
2441 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2442 or, xor to not_, and_, or_, and xor_, respectively. This works
2443 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2444 random system header somewhere that includes the equivalent of
2445 <iso646.h>.
2446
2447 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2448 -E" works; it apparently doesn't work with PathScale EKO Compiler
2449 Suite Version 2.0.
2450
2451 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2452
2453 During deterministic GLR operation, user actions should be able to
2454 influence the parse by changing yychar. To make this easier to fix and
2455 to make glr.c easier to evolve in general, don't maintain yytoken in
2456 parallel with yychar; just compute yytoken when needed.
2457 * tests/glr-regression.at (Incorrect lookahead during deterministic
2458 GLR): Check that setting yychar in a user action has the intended
2459 effect.
2460 * data/glr.c (yyGLRStack): Remove yytokenp member.
2461 (yyclearin): Don't set *yytokenp.
2462 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2463 yychar rather than *yytokenp to determine the current lookahead.
2464 Compute yytoken locally when needed.
2465 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2466 point to.
2467
2468 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2469 after `--report' documentation.
2470
2471 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2472
2473 * src/parse-gram.y (grammar_declaration): Location of printer
2474 symbol is @1, not list->location. Bug reported by twlevo.
2475 * tests/input.at (Incompatible Aliases): Adjust to above change.
2476
2477 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2478
2479 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2480 all the test at once. This makes the output easier to read in the
2481 normal case.
2482
2483 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2484 got from <http://bro-ids.org/download.html>. The bug is that
2485 when two actions appeared in succession, the second one was
2486 scanned before the first one was added to the grammar rule
2487 as a midrule action. Bison then output the incorrect warning
2488 "parse.y:905.17-906.36: warning: unused value: $3".
2489 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2490 associated with a value.
2491 (rhs): Don't invoke grammar_current_rule_action_append.
2492 (action): Invoke it here instead.
2493 * src/reader.c (grammar_midrule_action): Now extern.
2494 (grammar_current_rule_action_append): Don't invoke
2495 grammar_midrule_action; that is now the scanner's job.
2496 * src/reader.h (last_string, last_braced_code_loc):
2497 (grammar_midrule_action): New decls.
2498 * src/scan-gram.l (last_string): Now extern, sigh.
2499 (last_braced_code_loc): New extern variable.
2500 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2501 rule already has an action.
2502 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2503 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2504 Add some tests to check that the above changes fixed the bug.
2505
2506 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2507
2508 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2509 All used changed. Check whether the symbol has a destructor,
2510 not whether it is typed.
2511 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2512 that the values are still reported as unused. All line numbers
2513 adjusted.
2514
2515 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2516
2517 Work around a bug in bro 0.8, which underparenthesizes its
2518 definition of YYLLOC_DEFAULT.
2519 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2520 their arguments.
2521 * data/lalr1.cc: Likewise.
2522 * data/yacc.cc: Likewise.
2523
2524 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 Work around a bug in Pike 7.0, and give the Pike folks a
2527 better way to override the usual int widths.
2528 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2529 user can override the types.
2530 (short): #undef, to work around a bug in Pike 7.0.
2531 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2532 (union yyalloc.yyss): Use yytype_int16 rather than short.
2533 All uses changed.
2534 (yysigned_char): Remove.
2535 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2536 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2537 * tests/regression.at (Web2c Actions): Adjust to above changes.
2538
2539 * src/reader.c (check_and_convert_grammar): New function.
2540 (reader): Close the input file even if something went wrong during
2541 parsing. Minor file descriptor leak reported by twlevo.
2542
2543 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2544 to pacify gcc -Wswitch-default.
2545 * src/scan-gram.l (adjust_location): Use a default: break; case
2546 to pacify gcc -Wswitch-default.
2547 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2548 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2549 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2550 Move these decls to scan-skel.l, since they don't need to be
2551 visible elsewhere.
2552 * src/scan-skel.l: Accept the above decls.
2553 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2554 is used.
2555
2556 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2557
2558 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2559 since we don't want to insist on a version number at the start
2560 of the changelog every time.
2561 * Makefile.maint: Sync from coreutils a bit better.
2562 (sc_trailing_blank): Renamed from sc_trailing_space.
2563 All uses changed.
2564 (sc_no_if_have_config_h, sc_require_config_h):
2565 (sc_prohibit_assert_without_use): New rules.
2566 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2567 (sc_dd_max_sym_length): Fix leading spaces in rule.
2568 (sc_system_h_headers): Prefix with @.
2569 (sc_useless_cpp_parens, m4-check): Output line numbers.
2570 (changelog-check): Allow version only in head.
2571 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2572 satisfy new Makefile.maint rule.
2573 * data/glr.c: Likewise.
2574 * data/glr.cc: Likewise.
2575 * data/lalr1.cc: Likewise.
2576 * data/yacc.c: Likewise.
2577 * lib/ebitsetv.c: Likewise.
2578 * lib/lbitset.c: Likewise.
2579 * lib/subpipe.c: Likewise.
2580 * lib/timevar.c: Likewise.
2581 * src/system.h: Likewise.
2582 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2583 * djgpp/Makefile.maint: Add copyright notice.
2584 * djgpp/README.in: Likewise.
2585 * djgpp/config.bat: Likewise.
2586 * djgpp/config.site: Likewise.
2587 * djgpp/config_h.sed: Likewise.
2588 * djgpp/djunpack.bat: Likewise.
2589 * djgpp/config.sed: Fix copyright notice to match standard format.
2590 * djgpp/subpipe.h: Likewise.
2591 * lib/bitsetv-print.c: Likewise.
2592 * lib/bitsetv.c: Likewise.
2593 * lib/subpipe.h: Likewise.
2594 * lib/timevar.c: Likewise.
2595 * lib/timevar.h: Likewise.
2596 * djgpp/subpipe.c: Use standard recipe for config.h.
2597 * lib/abitset.c: Likewise.
2598 * lib/bitset.c: Likewise.
2599 * lib/bitset_stats.c: Likewise.
2600 * lib/bitsetv-print.c: Likewise.
2601 * lib/bitsetv.c: Likewise.
2602 * lib/ebitsetv.c: Likewise.
2603 * lib/get-errno.c: Likewise.
2604 * lib/lbitset.c: Likewise.
2605 * lib/subpipe.c: Likewise.
2606 * lib/timevar.c: Likewise.
2607 * lib/vbitset.c: Likewise.
2608 * tests/local.at: Likewise.
2609 * src/scan-gram.l: Don't include verify.h, since system.h does
2610 that for us.
2611 * .x-sc_require_config_h: New file.
2612 * .x-sc_unmarked_diagnostics: New file.
2613
2614 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2615
2616 Be a bit more systematic about using 'abort'.
2617 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
2618 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
2619 Put 'default: abort ();' before some other case, to satisfy older
2620 pedantic compilers.
2621 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2622 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
2623 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
2624 * src/conflicts.c (resolve_sr_conflict): Likewise.
2625 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
2626 (get_decision_str, get_orientation_str, get_node_alignment_str):
2627 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
2628 (get_linestyle_str, get_arrowstyle_str): Likewise.
2629 * src/conflicts.c (resolve_sr_conflict):
2630 Use a default case rather than one for the one remaining enum
2631 value, to catch invalid enum values as well.
2632 * src/lalr.c (set_goto_map, map_goto):
2633 Prefer "assert (FOO);" to "if (!FOO) abort ();".
2634 * src/nullable.c (nullable_compute, token_definitions_output):
2635 Likewise.
2636 * src/reader.c (packgram, reader): Likewise.
2637 * src/state.c (transitions_to, state_new, state_reduction_find):
2638 Likewise.
2639 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
2640 (symbol_pack): Likewise.
2641 * src/tables.c (conflict_row, pack_vector): Likewise.
2642 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
2643 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
2644 * src/system.h: Don't include <assert.h>.
2645 (assert): New macro.
2646
2647 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
2648 (Destructor Decl, Parser Function, Pure Calling):
2649 Describe rules for braces inside C code more carefully.
2650
2651 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2652
2653 Fix some porting glitches found by Nelson H. F. Beebe.
2654 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
2655 compilers that don't understand that abort () does not return.
2656 * src/state.c (transitions_to): Likewise.
2657 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2658 that '#include <cstdlib>' works.
2659 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
2660 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
2661 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
2662 for the benefit of some pre-C99 compilers.
2663
2664 * bootstrap: Undo changes to gnulib files that autoreconf made.
2665
2666 Minor fixups to get 'make maintainer-check' to work.
2667 * configure.ac: Don't use -Wnested-externs, as it's incompatible
2668 with the new verify.h implementation.
2669 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
2670 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
2671 * data/yacc.c (YYUSE): Likewise.
2672 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
2673 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
2674 * src/parse-gram.y (declaration): Don't pass a string constant
2675 to a function that expects char *, since GCC might complain
2676 about the constant value.
2677 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
2678 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
2679 before #defining them.
2680 * tests/glr-regression.at
2681 (Incorrectly initialized location for empty right-hand side in GLR):
2682 In yyerror, use the msg arg.
2683 (Corrupted semantic options if user action cuts parse):
2684 (Incorrect lookahead during deterministic GLR):
2685 (Incorrect lookahead during nondeterministic GLR):
2686 Don't name a local var 'index'; it shadows string.h's 'index'.
2687
2688 2006-01-19 Akim Demaille <akim@epita.fr>
2689
2690 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2691 location, not just parts of it.
2692
2693 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2694
2695 * NEWS: Document the fact that multiple %unions are now allowed.
2696 * doc/bison.texinfo (Union Decl): Likewise.
2697 * TODO: This feature is now implemented, so remove it from
2698 the wishlist.
2699
2700 * Makefile.maint: Merge with coreutils Makefile.maint.
2701 (CVS_LIST): Use build-aux version if available.
2702 (VERSION_REGEXP): New macro.
2703 (syntax-check-rules): Add sc_no_if_have_config_h,
2704 sc_prohibit_assert_without_use, sc_require_config_h,
2705 sc_useless_cpp_parens.
2706 (sc_obsolete_symbols): Check for O_NDELAY.
2707 (sc_dd_max_sym_length): Track coreutils.
2708 (sc_unmarked_diagnostics): Look in all files, not just *.c.
2709 (sc_useless_cpp_parens): New rule.
2710 (news-date-check): Look for version or today's date.
2711 (changelog-check): Don't require version number near head.
2712 (copyright-check): Use current year instead of hardwiring 2005.
2713 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
2714 (announcement): Add --gpg-key-ID.
2715
2716 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2717 with "file system".
2718
2719 Avoid undefined behavior that addressed just before the start of an
2720 array. Problem reported by twlevo.
2721 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2722 * src/lalr.c (build_relations): Rely on new sentinel.
2723 * src/gram.c (gram_free): Adjust to new sentinel.
2724
2725 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2726
2727 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2728 yylookaheadNeeds. All uses updated.
2729 (yysplitStack): Rename local yynewLookaheadStatuses to
2730 yynewLookaheadNeeds.
2731 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2732 GLR): In comments, change `lookahead status' to `lookahead need'.
2733
2734 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2735
2736 * data/glr.c (yysplitStack): A little stylistic rewrite.
2737
2738 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2739
2740 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2741
2742 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2743
2744 * doc/bison.texinfo: Fix some typos.
2745 (GLR Semantic Actions): New subsection discussing special
2746 considerations because GLR semantic actions might be deferred.
2747 (Actions): Mention look-ahead usage of yylval.
2748 (Actions and Locations): Mention look-ahead usage of yylloc.
2749 (Special Features for Use in Actions): Add YYEOF entry and mention it
2750 in the yychar entry.
2751 In the yychar entry, remove mention of the local yychar case (pure
2752 parser) since this is irrelevant information when writing semantic
2753 actions and since it's already discussed in `Bison Symbols' where
2754 yychar is otherwise described as an external variable.
2755 In the yychar entry, don't call it the `current' look-ahead since it
2756 isn't when semantic actions are deferred.
2757 In the yychar and yyclearin entries, add note about deferred semantic
2758 actions.
2759 Add yylloc and yylval entries discussing look-ahead usage.
2760 (Look-Ahead Tokens): When discussing yychar, don't call it the
2761 `current' look-ahead, and do mention yylval and yylloc.
2762 (Error Recovery): Cross-reference `Action Features' when mentioning
2763 yyclearin.
2764 (Bison Symbols): In the yychar entry, don't call it the `current'
2765 look-ahead.
2766 In the yylloc and yylval entries, mention look-ahead usage.
2767
2768 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2769
2770 * tests/glr-regression.at: Update copyright year to 2006.
2771
2772 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2773
2774 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2775 use during nondeterministic operation to track which stacks have
2776 actually needed the current lookahead.
2777 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2778 Allocate, deallocate, resize, and otherwise shuffle space for
2779 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2780 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2781 appropriately during nondeterministic operation.
2782 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2783 members to store the current lookahead to be used by the deferred
2784 user action.
2785 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2786 from which the RHS is taken. Set the lookahead members of the new
2787 yySemanticOption according to the lookahead status for stack yyk.
2788 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2789 yyaddDeferredAction.
2790 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2791 members of yySemanticOption before invoking yyuserAction, and then set
2792 them back to their current values afterward.
2793 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2794 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2795 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2796 titles for consistency.
2797 (Leaked merged semantic value if user action cuts parse): In order to
2798 suppress lint warnings, use arguments in merge function, and assign
2799 char value < 128 in main.
2800 (Incorrect lookahead during deterministic GLR): New test case.
2801 (Incorrect lookahead during nondeterministic GLR): New test case.
2802
2803 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2804
2805 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
2806 !yyvaluep as signal that no semantic value is available to print.
2807 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2808 to print a semantic value.
2809
2810 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2811
2812 * tests/glr-regression.at: For consistency with my newer test cases,
2813 don't thank myself.
2814
2815 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2816
2817 * data/glr.c (yyresolveValue): When merging semantic options, if at
2818 least one user action succeeds but a later one cuts the parse, then
2819 destroy the semantic value before returning rather than leaking it.
2820 (yyresolveStates): If a user action cuts the parse and thus
2821 yyresolveValue fails, ignore the (unset) semantic value rather than
2822 corrupting the yyGLRState, and empty the semantic options list since
2823 the user actions should have called all necessary destructors.
2824 Simplify code with YYCHK.
2825 * tests/glr-regression.at (Corrupted semantic options if user action
2826 cuts parse): New test case.
2827 (Undesirable destructors if user action cuts parse): New test case.
2828 Before applying any of this patch, this test case never actually failed
2829 for me... but only because the corrupted semantic options usually
2830 masked this bug.
2831 (Leaked merged semantic value if user action cuts parse): New test
2832 case.
2833
2834 2006-01-05 Akim Demaille <akim@epita.fr>
2835
2836 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2837
2838 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2839
2840 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2841 _MSC_VER. Problem reported by Cenzato Marco.
2842 (b4_c_function_def): Use it.
2843 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2844 b4_c_modern.
2845 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2846 than rolling our own.
2847
2848 2006-01-04 Akim Demaille <akim@epita.fr>
2849
2850 Also warn about non-used mid-rule values.
2851 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2852 member.
2853 (symbol_list_new): Adjust.
2854 * src/reader.c (symbol_typed_p): New.
2855 (grammar_rule_check): Use it.
2856 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2857 Check its rule.
2858 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2859 Use it.
2860 * tests/actions.at (Exotic Dollars): Adjust.
2861
2862 2006-01-04 Akim Demaille <akim@epita.fr>
2863
2864 * src/reader.c (grammar_midrule_action): If $$ is set in a
2865 mid-rule, move the `used' bit to its lhs.
2866 * tests/input.at (Unused values): New.
2867 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2868
2869 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2870
2871 * doc/bison.texinfo (Bison Options): Say more accurately what
2872 --yacc does.
2873 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2874 about declarations in the grammar when in Yacc mode, as POSIX does
2875 not require a diagnostic when the grammar uses extensions.
2876
2877 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2878
2879 Warn about dubious constructions like "%token T T".
2880 Reported by twlevo.
2881 * src/symtab.h (struct symbol.declared): New member.
2882 * src/symtab.c (symbol_new): Initialize it to false.
2883 (symbol_class_set): New arg DECLARING, specifying whether
2884 this is a declaration that we want to warn about, if there
2885 is more than one of them. All uses changed.
2886
2887 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
2888 Allow multiple %union directives, whose contents concatenate.
2889 * src/parse-gram.y (grammar_declaration): Likewise.
2890 Use muscle_code_grow, so that we don't need stype_line any more.
2891 All uses changed.
2892
2893 * src/muscle_tab.c (muscle_grow): Fix comment.
2894
2895 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
2896 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
2897 Update copyright year to 2006.
2898
2899 2006-01-03 Akim Demaille <akim@epita.fr>
2900
2901 Have glr.cc pass (some of) the calc.at tests.
2902 * data/glr.cc (b4_parse_param_orig): New.
2903 (b4_parse_param): Improve its definition, and bound it more
2904 clearly in the skeleton.
2905 (b4_epilogue): Append, instead of prepending, in order to keep
2906 #line consistency.
2907 Simplify the generation of auxiliary functions: locations and
2908 purity are mandated.
2909 (b4_global_tokens_and_yystype): Honor it.
2910 * data/location.cc (c++.m4): Don't include it.
2911 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
2912 and AT_SKEL_CC_IF.
2913 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2914 AT_LALR1_CC_IF.
2915 Be sure to initialize the first position's filename.
2916 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2917 mandated anyway.
2918 (AT_CHECK_CALC_GLR_CC): New.
2919 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2920
2921 2006-01-02 Akim Demaille <akim@epita.fr>
2922
2923 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2924 c.m4.
2925 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
2926 * data/glr.cc: Do not include stack.hh.
2927
2928 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2929
2930 * data/glr.c: Reformat whitespace with tabs.
2931 (b4_lpure_formals): Remove this unused m4 macro.
2932 * tests/cxx-type.at: Reformat whitespace with tabs.
2933 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
2934 since it's a member. Rename type to isNterm for clarity.
2935
2936 2005-12-29 Akim <akim@sulaco.local>
2937
2938 Let glr.cc catch up with symbol_value_print.
2939 * data/glr.cc (b4_yysymprint_generate): Replace by...
2940 (b4_yy_symbol_print_generate): this.
2941 (yy_symbol_print, yy_symbol_value_print): Declare them.
2942
2943 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2944
2945 * src/location.h (boundary): Note that a line or column equal
2946 to INT_MAX indicates an overflow.
2947 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
2948 (rule_length_overflow, increment_rule_length, add_column_width):
2949 New functions.
2950 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
2951 (<SC_BRACED_CODE>"}"):
2952 Use increment_rule_length rather than incrementing it by hand.
2953 (adjust_location, handle_syncline): Diagnose overflow.
2954 (handle_action_dollar, handle_action_at):
2955 Fix bug with monstrosities like $-2147483648.
2956 Remove now-unnecessary checks.
2957 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2958 (convert_ucn_to_byte): Verify assumptions.
2959 (handle_syncline): New arg LOC. All callers changed.
2960 Don't store through a value derived from char const * pointer.
2961
2962 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2963 GCC warnings.
2964
2965 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2966
2967 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2968 Remove unnecessary forward static decls.
2969
2970 2005-12-27 Akim Demaille <akim@epita.fr>
2971
2972 * src/reader.c (grammar_current_rule_check): Also check that $$
2973 is used.
2974 Take the rule to check as argument, hence rename as...
2975 (grammar_rule_check): this.
2976 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2977 Rename as...
2978 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2979 (grammar_midrule_action, grammar_symbol_append): Now static.
2980 * tests/torture.at (input): Don't rely on the default action
2981 being always performed.
2982 * tests/calc.at: "Set" $$ even when the action is "cut" with
2983 YYERROR or other.
2984 * tests/actions.at (Exotic Dollars): Instead of using unused
2985 values, check that the warning is issued.
2986
2987 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2988
2989 * NEWS: Improve wording for unused-value warnings.
2990
2991 2005-12-22 Akim Demaille <akim@epita.fr>
2992
2993 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2994 (b4_yysymprint_generate): Rename as...
2995 (b4_yy_symbol_print_generate): this.
2996 Generate yy_symbol_print instead of yysymprint.
2997 Generate also yy_symbol_value_print, and use it.
2998
2999 2005-12-22 Akim Demaille <akim@epita.fr>
3000
3001 * NEWS: Warn about unused values.
3002 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
3003 a `used' member.
3004 (symbol_list_n_get, symbol_list_n_used_set): New.
3005 (symbol_list_n_type_name_get): Use symbol_list_n_get.
3006 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
3007 * src/reader.c (grammar_current_rule_check): Check that values are
3008 used.
3009 * src/symtab.c (symbol_print): Accept 0.
3010 * tests/existing.at: Remove the type information.
3011 Empty the actions.
3012 Remove useless actions (beware of mid-rule actions: perl -000
3013 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3014 * tests/actions.at (Exotic Dollars): Use unused values.
3015 * tests/calc.at: Likewise.
3016 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3017 Likewise.
3018
3019 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3020 rule_useful_p.
3021
3022 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3023
3024 Undo 2005-12-01 tentative license wording change. The wording is
3025 still being reviewed by the lawyers, and we don't want to wait for
3026 them before publishing a test release. For now, revert to the
3027 previous wording.
3028 * NEWS: Undo 2005-12-01 change.
3029 * data/glr.c: Revert to previous license wording.
3030 * data/glr.cc: Likewise.
3031 * data/lalr1.cc: Likewise.
3032 * data/location.cc: Likewise.
3033 * data/yacc.c: Likewise.
3034
3035 * NEWS: Reword %destructor vs YYABORT etc.
3036 * data/glr.c: Use American spacing, for consistency.
3037 * data/glr.cc: Likewise.
3038 * data/lalr1.cc: Likewise.
3039 * data/yacc.c: Likewise.
3040 * data/yacc.c: Reformat comments slightly.
3041 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3042 for consistency. Fix some spelling errors and reword recently-included
3043 text slightly.
3044 * tests/cxx-type.at: Cast results of malloc, for C++.
3045
3046 2005-12-21 Joel E. Denny <address@hidden>
3047
3048 * tests/cxx-type.at: Construct a tree, count the parents of shared
3049 nodes, and free each node once and only once. Previously, the memory
3050 for semantic values was leaked instead.
3051
3052 2005-12-21 Joel E. Denny <address@hidden>
3053
3054 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3055 (yylval, yylloc): If pure, #define to yystackp->yyval and
3056 yystackp->yyloc similar to yychar and yynerrs.
3057 (yyparse): If pure, remove local yylval and yylloc. Add local
3058 yystackp to accommodate pure definitions of yylval and yylloc.
3059 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3060 yylvalp and yyllocp to &yylval and &yylloc.
3061 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3062 namespace. Previously, nerrs and char were missing, but lval and lloc
3063 weren't necessary.
3064 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3065 yylvalp and yyllocp parameters since, if pure, these are now always
3066 accessible through yystackp. If not pure, they are still accessible
3067 globally.
3068 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3069 `if (YYID (N))' to pacify lint.
3070
3071 2005-12-21 Akim Demaille <akim@epita.fr>
3072
3073 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3074 destroy the RHS symbols of a rule.
3075 * data/yacc.c (yylen): Initialize to 0.
3076 Keep its value to the number of items to possibly shift.
3077 In particular, a regular successful parse that ends on YYFINAL by
3078 a (internal) YYACCEPT must not have yylen != 0.
3079 (yyerrorlab, yyreturn): Pop the RHS.
3080 Reorder a bit to emphasize the `shifting' bits of code.
3081 (YYPOPSTACK): Now accept a number of items to pop.
3082 * data/lalr1.cc: Likewise.
3083 * data/glr.c: Formatting changes.
3084 Use goto instead of fall through.
3085 * doc/bison.texinfo (Destructor Decl): Complete.
3086
3087 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3088
3089 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3090 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3091 * djgpp/config.bat: Replace every occurence of the file name
3092 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3093 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3094 * djgpp/config.sed: Replace every occurence of the file name
3095 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3096 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3097 * djgpp/djunpack.bat: DJGPP specific file.
3098 * djgpp/fnchange.lst: DJGPP specific file.
3099 * djgpp/README.in: Add new information about how to unpack the bison
3100 source on MSDOS and other systems which have 8.3 file name restrictions
3101 using djunpack.bat and fnchange.lst.
3102
3103 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3104
3105 * bootstrap (build_cvs_prefix): Remove; unused.
3106 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3107 when getting gnulib.
3108
3109 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3110
3111 * data/glr.c: Reorder typedef declarations for structs to match order
3112 of struct declarations.
3113 Rename yystack everywhere to yystackp except in yyparse where it's not
3114 a pointer.
3115 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3116 consistency.
3117 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3118 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3119 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3120 lint.
3121
3122 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3123
3124 * tests/sets.at (Accept): Fix typos in regular expression used to
3125 sed out the final state number.
3126
3127 Work around portability problem on Solaris 10: flex-generated
3128 files include <stdio.h> before <config.h>, which messes up
3129 because the latter defines __EXTENSIONS__. Address the problem
3130 by creating two new little files that include <config.h> first,
3131 then include the flex-generated files. Rewrite everyone else
3132 to include <config.h> first, as well.
3133 * lib/timevar.c: Always include "config.h".
3134 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3135 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3136 (EXTRA_bison_SOURCES): New macro.
3137 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3138 * src/system.h: Don't include config.h.
3139 * src/LR0.c: Include <config.h> first.
3140 * src/assoc.c: Likewise.
3141 * src/closure.c: Likewise.
3142 * src/complain.c: Likewise.
3143 * src/conflicts.c: Likewise.
3144 * src/derives.c: Likewise.
3145 * src/files.c: Likewise.
3146 * src/getargs.c: Likewise.
3147 * src/gram.c: Likewise.
3148 * src/lalr.c: Likewise.
3149 * src/location.c: Likewise.
3150 * src/main.c: Likewise.
3151 * src/muscle_tab.c: Likewise.
3152 * src/nullable.c: Likewise.
3153 * src/output.c: Likewise.
3154 * src/parse-gram.y: Likewise.
3155 * src/print.c: Likewise.
3156 * src/print_graph.c: Likewise.
3157 * src/reader.c: Likewise.
3158 * src/reduce.c: Likewise.
3159 * src/relation.c: Likewise.
3160 * src/state.c: Likewise.
3161 * src/symlist.c: Likewise.
3162 * src/symtab.c: Likewise.
3163 * src/tables.c: Likewise.
3164 * src/uniqstr.c: Likewise.
3165 * src/vcg.c: Likewise.
3166
3167 * src/parse-gram.y: Fix minor problems uncovered by lint.
3168 (current_lhs, current_lhs_location): Now static.
3169 (current_assoc): Remove unused variable.
3170
3171 Cleanups so that Bison-generated parsers have less lint.
3172 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3173 Prepend /*ARGSUSED*/, for lint's sake.
3174 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3175 definition if 'lint' is defined.
3176 (YYID): New macro (or function, if lint).
3177 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3178 * data/yacc.c: Likewise.
3179 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3180 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3181 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3182 is C++ only.
3183 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3184 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3185 Use YYID(0) rather than 0, for lint.
3186 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3187 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3188
3189 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3190
3191 * tests/glr-regression.at
3192 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3193 Close memory leak reported by twlevo.
3194
3195 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3196
3197 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3198 all stacks.
3199 (yyparse): Iterate another stack in order to call user destructors.
3200 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3201 New test case.
3202 (Duplicated user destructor for lookahead): This test now is expected
3203 to succeed.
3204
3205 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3206
3207 * NEWS: Document the following change.
3208 * data/yacc.c: Say "parser skeleton" rather than "file", since
3209 it's no longer just a file.
3210 * data/glr.c: Grant a special exception for C GLR parsers, that
3211 reads like the already-existing exception for C LALR(1) parsers.
3212 * data/glr.cc: Likewise.
3213 * data/lalr1.cc: Likewise.
3214 * data/location.cc: Likewise.
3215 * data/yacc.c: Reword the "written by" statement to clarify that
3216 it was the parser skeleton, not the entire output file.
3217 * data/glr.c: Written by Paul Hilfinger.
3218 * data/glr.cc: Written by Akim Demaille.
3219 * data/lalr1.cc: Likewise.
3220
3221 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3222
3223 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3224 Fix typos in previous change that broke 'make check'.
3225 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3226 supported in C.
3227 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3228 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3229 We can revert this once things settle down.
3230
3231 * src/conflicts.c (conflicts_print): Don't print file name twice
3232 when %expect fails because there were no conflicts.
3233 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3234 change.
3235 * tests/conflicts.at (%expect not enough, %expect too much):
3236 (%expect with reduce conflicts): Adjust to new behavior.
3237
3238 2005-11-18 Akim Demaille <akim@epita.fr>
3239
3240 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3241 errors.
3242 * NEWS: Document this.
3243 * doc/bison.texinfo (Expect Decl): Likewise.
3244
3245 2005-11-16 Akim Demaille <akim@epita.fr>
3246
3247 Generalize the display of semantic values and locations in traces.
3248 * data/glr.c (yy_reduce_print): Fix indices (again).
3249 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3250 literal integers.
3251 * data/lalr1.cc (yyreduce_print): Rename as...
3252 (yy_reduce_print): this.
3253 Display values and locations.
3254 * data/yacc.c (yy_reduce_print): Likewise.
3255 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3256 (yysymprint): Move higher to be visible from yy_reduce_print).
3257 (yyparse): Adjust.
3258 * tests/calc.at: Adjust the expected length of the traces.
3259
3260 2005-11-14 Akim Demaille <akim@epita.fr>
3261
3262 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3263 from 1 to N, while values and location start at 0.
3264 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3265
3266 2005-11-14 Akim Demaille <akim@epita.fr>
3267
3268 * data/glr.c (yy_reduce_print): Fix the $ number.
3269
3270 2005-11-14 Akim Demaille <akim@epita.fr>
3271
3272 "Use" parse parameters.
3273 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3274 * data/glr.c, data/glr.cc: Use them.
3275 * data/glr.c (YYUSE): Have a C++ definition that supports
3276 non-pointer types.
3277
3278 2005-11-14 Akim Demaille <akim@epita.fr>
3279
3280 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3281
3282 2005-11-14 Akim Demaille <akim@epita.fr>
3283
3284 * data/glr.cc: New.
3285 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
3286
3287 2005-11-12 Akim Demaille <akim@epita.fr>
3288
3289 Let position and location be PODs.
3290 * data/location.cc (position::initialize, location::initialize): New.
3291 (position::position, location::location): Define only if
3292 b4_location_constructors is defined.
3293 * data/lalr1.cc (b4_location_constructors): Define it for backward
3294 compatibility.
3295 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3296
3297 2005-11-12 Akim Demaille <akim@epita.fr>
3298
3299 * data/lalr1.cc: Move the body of the ctor and dtor into the
3300 parser file (instead of the header).
3301 Wrap the implementations in a "namespace yy".
3302
3303 2005-11-12 Akim Demaille <akim@epita.fr>
3304
3305 Have glr.c include its header file when created.
3306 * data/glr.c (b4_shared_declarations): New.
3307 Output them verbatim in the parser if !%defines, otherwise
3308 output then in the header file, and include it instead.
3309
3310 2005-11-11 Akim Demaille <akim@epita.fr>
3311
3312 * data/glr.c: Comment changes.
3313
3314 2005-11-11 Akim Demaille <akim@epita.fr>
3315
3316 When yydebug, report semantic and location values for reductions.
3317 * data/glr.c (yy_reduce_print): Report the semantic values and the
3318 locations.
3319 (YY_REDUCE_PRINT): Adjust.
3320 (yyglrReduce): Use them.
3321 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3322 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3323 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3324 traces.
3325
3326 2005-11-10 Akim Demaille <akim@epita.fr>
3327
3328 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3329 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3330 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3331
3332 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3333
3334 * m4/cxx.m4, examples/Makefile.am: Don't build
3335 examples/calc++ if no C++ compiler is available. (trivial change)
3336
3337 2005-11-09 Akim Demaille <akim@epita.fr>
3338
3339 * src/scan-skel.l: Use a couple of asserts.
3340
3341 2005-11-03 Akim Demaille <akim@epita.fr>
3342
3343 In some (weird) cases, the final state number is incorrect.
3344 Reported by Alexandre Duret-Lutz.
3345 * src/LR0.c (state_list_append): Remove the computation of
3346 final_state.
3347 (save_reductions): Do it here.
3348 (get_state): Alpha conversion.
3349 (generate_states): Use a for loop.
3350 * src/gram.h (item_number_is_rule_number)
3351 (item_number_is_symbol_number): New.
3352 * src/state.c: Use assert.
3353 * src/system.h: Include assert.h.
3354 * tests/sets.at (Accept): New.
3355
3356 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3357
3358 * data/glr.c (yyfill): Adjust comment.
3359 (yyresolveAction): Initialize default location properly
3360 for empty right-hand sides.
3361 (yydoAction): Ditto.
3362 Add comment explaining apparently dead code.
3363 * tests/glr-regression.at
3364 (Incorrectly initialized location for empty right-hand side in GLR):
3365 New test.
3366
3367 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3368
3369 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3370 gnulib when interrupted. This fixes some race conditions and
3371 works around some portability problems (one noted by Paul
3372 Hilfinger).
3373
3374 2005-10-22 Akim <akim@epita.fr>
3375
3376 * Makefile.cfg: Adjust to config -> build-aux.
3377 Reported by twledo.
3378
3379 2005-10-21 Akim Demaille <akim@epita.fr>
3380
3381 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3382 the %parse-params.
3383 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3384 * data/yacc.c (b4_Pure_if): Rename as...
3385 (b4_yacc_pure_if): this.
3386 (YY_SYMBOL_PRINT, yyparse): Adjust.
3387 * doc/bison.texinfo: Formatting changes.
3388
3389 2005-10-21 Akim Demaille <akim@epita.fr>
3390
3391 Finish the transition config -> build-aux.
3392 * configure.ac, Makefile.am: Use build-aux.
3393 * config/prev-version, config/announce-gen, config/Makefile.am:
3394 Move to...
3395 * build-aux/prev-version, build-aux/announce-gen,
3396 * build-aux/Makefile.am: here.
3397
3398 2005-10-14 Akim Demaille <akim@epita.fr>
3399
3400 * examples/calc++/test: Use set -x only when VERBOSE.
3401
3402 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3403
3404 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3405 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3406
3407 2005-10-13 Akim Demaille <akim@epita.fr>
3408
3409 * src/scan-skel.l: Output the base name parts of the parser and
3410 header file names.
3411 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
3412 additional checks.
3413 Use this to exercise C++ outputs in subdirs.
3414 Reported by Oleg Smolsky.
3415
3416 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3417
3418 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3419 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3420 Problem reported by John P. Hartmann.
3421 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3422 already defined it.
3423
3424 2005-10-12 Akim Demaille <akim@epita.fr>
3425
3426 * src/parse-gram.y (version_check): Exit 63 to please missing
3427 (stands for "version mismatch).
3428 * tests/input.at, doc/bison.texinfo: Adjust.
3429
3430 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3431
3432 Work around portability problems with Visual Age C compiler
3433 (xlc and xlC_r) reported by John P. Hartmann.
3434 * data/location.cc (initial_column, initial_line): Remove.
3435 All uses replaced by 0 and 1.
3436 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3437 that xlc complains about.
3438 * src/scan-skel.l (skel_wrap): Likewise.
3439 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
3440 as __STDC__.
3441 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3442 __STDC_VERSION__. Use it everywhere instead of looking at
3443 __STDC__ and __cplusplus.
3444
3445 2005-10-10 Akim Demaille <akim@epita.fr>
3446
3447 * examples/calc++/test: Be quiet unless VERBOSE.
3448
3449 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3450
3451 * data/c.m4 (yydestruct, yysymprint):
3452 Use YYUSE instead of casting to void.
3453 * data/glr.c (YYUSE): New macro.
3454 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3455 Use it instead of rolling our own.
3456 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3457 (YYCHK1):
3458 Use /*CONSTCOND*/ to suppress lint warnings.
3459 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3460 (YY_STACK_PRINT): Use 'false' not '0'.
3461 (YYUSE): New macro.
3462 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3463 * data/yacc.c (YYUSE): New macro.
3464 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3465 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3466 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3467
3468
3469 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3470 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3471
3472 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3473
3474 Undo the parts of the unlocked-I/O change that substituted
3475 putc or puts for printf. This might hurt performance a bit,
3476 but some people prefer the printf style.
3477 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3478 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3479 All uses replaced by YYFPRINTF and YYDPRINTF.
3480 * data/yacc.c: Likewise.
3481 * lib/bitset.c (bitset_print): Likewise.
3482 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3483 putc and puts.
3484 * lib/lbitset.c (debug_lbitset): Likewise.
3485 * src/closure.c (print_firsts, print_fderives): Likewise.
3486 * src/gram.c (grammar_dump): Likewise.
3487 * src/lalr.c (look_ahead_tokens_print): Likewise.
3488 * src/output.c (escaped_output): Likewise.
3489 (user_actions_output): Break apart two printfs.
3490 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3491 * src/reduce.c (reduce_print): Likewise.
3492 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3493 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3494
3495 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3496 Use assignments rather than casts-to-void to suppress
3497 unused-variable warnings. This pacifies 'lint'.
3498 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3499 unused-variable warnings.
3500
3501 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3502
3503 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3504
3505 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3506
3507 Use unlocked I/O for a minor performance improvement on hosts like
3508 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3509 is to use the gnlib unlocked-io module, and to prefer putc and
3510 puts to printf when either will work (since the latter doesn't
3511 come in an unlocked flavor).
3512 * bootstrap (gnulib_modules): Add unlocked-io.
3513 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3514 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3515 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3516 and similarly for puts and putc and printf.
3517 * data/yacc.c: Likewise.
3518 * lib/bitset.c (bitset_print): Likewise.
3519 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3520 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3521 to printf.
3522 * lib/lbitset.c (debug_lbitset): Likewise.
3523 * src/closure.c (print_firsts, print_fderives): Likewise.
3524 * src/gram.c (grammar_dump): Likewise.
3525 * src/lalr.c (look_ahead_tokens_print): Likewise.
3526 * src/output.c (escaped_output): Likewise.
3527 (user_actions_output): Coalesce two printfs.
3528 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
3529 * src/reduce.c (reduce_print): Likewise.
3530 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3531 * src/system.h: Include unlocked-io.h rather than stdio.h.
3532
3533 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3534 this confuses xgettext.
3535
3536 2005-10-02 Akim Demaille <akim@epita.fr>
3537
3538 * bootstrap (gnulib_modules): Add strverscmp.
3539 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3540 * m4/.cvsignore: Add strverscmp.m4.
3541 * src/parse-gram.y (%require): New token, new rule.
3542 (version_check): New.
3543 * src/scan-gram.l (%require): Adjust.
3544 * tests/input.at (AT_REQUIRE): New.
3545 Use it.
3546 * doc/bison.texinfo (Require Decl): New.
3547 (Calc++ Parser): Use %require.
3548
3549 2005-10-02 Akim Demaille <akim@epita.fr>
3550
3551 * data/location.cc: New.
3552
3553 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3554 Akim Demaille <akim@epita.fr>
3555
3556 Make sure -odir/foo.cc creates dir/location.hh etc.
3557 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3558 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3559 (spec_defines_file): Now const.
3560 (dir_prefix): New.
3561 (short_base_name): Remove.
3562 * src/files.c: Adjust.
3563 (dirname.h): Include.
3564 (base_name): Don't prototype it.
3565 (finput): Remove, duplicates gram_in.
3566 (full_base_name, short_base_name): Replace by...
3567 (all_but_ext, all_but_tab_ext): these.
3568 (compute_base_names): Rename as...
3569 (compute_file_name_parts): this.
3570 Update to compute the new variables, including dir_prefix.
3571 Adjust dependencies.
3572 * src/output.c (prepare): Output them.
3573 * src/reader.c: Adjust to use gram_in, not finput.
3574 * src/scan-skel.l (@dir_prefix@): New.
3575
3576 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3577
3578 * lib/subpipe.c: New function end_of_output_subpipe() added
3579 to allow support for non-posix systems. This is a no-op function
3580 for posix systems.
3581
3582 * lib/subpipe.h: New function end_of_output_subpipe() added
3583 to allow support for non-posix systems. This is a no-op function
3584 for posix systems.
3585
3586 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3587 handle the lack of pipe/fork functionality on non-posix systems.
3588
3589 * djgpp/Makefile.maint: DJGPP specific file.
3590
3591 * djgpp/README.in: DJGPP specific file.
3592
3593 * djgpp/config.bat: DJGPP specific configuration file.
3594
3595 * djgpp/config.sed: DJGPP specific configuration file.
3596
3597 * djgpp/config.site: DJGPP specific configuration file.
3598
3599 * djgpp/config_h.sed: DJGPP specific configuration file.
3600
3601 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3602
3603 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3604
3605 2005-10-02 Akim Demaille <akim@epita.fr>
3606
3607 * data/location.cc: New, extract from...
3608 * data/lalr1.cc: here.
3609 (location.hh): Include it after the user prologue, in case the
3610 filename type is defined by the user.
3611 Forward declation location and position before the pre-prologue.
3612 (yyresult_): Rename as...
3613 (yyresult): this, it's a local variable, not an attribute.
3614 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
3615
3616 2005-10-01 Akim Demaille <akim@epita.fr>
3617
3618 * examples/extexi: Restore the #line generation.
3619
3620 2005-09-30 Akim Demaille <akim@epita.fr>,
3621 Alexandre Duret-Lutz <adl@gnu.org>
3622
3623 Move the token type and YYSTYPE in the parser class.
3624 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
3625 (parser::token): New, from the moved free definition of tokens.
3626 (parser::semantic_value): Now a full definition instead of an
3627 indirection to YYSTYPE.
3628 (b4_post_prologue): No longer included in the header file, but
3629 in the implementation file.
3630 * doc/bison.texi (C+ Language Interface): Update.
3631 * src/parse-gram.y: Support unary %define.
3632 * tests/actions.at: Define global_tokens_and_yystype for backward
3633 compatibility until we update the tests.
3634 * tests/calc.at: Idem.
3635 (first_line, first_column, last_line, last_column): Define for lalr1.cc
3636 to simplify the code.
3637
3638 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3639
3640 Port to SunOS 4.1.4, which lacks strtoul and strerror.
3641 Ah, the good old days! Problem reported by Peter Klein.
3642 * bootstrap (gnulib_modules): Add strerror, strtoul.
3643 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
3644 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
3645
3646 2005-09-29 Akim Demaille <akim@epita.fr>
3647
3648 * data/c.m4 (b4_error_verbose_if): New.
3649 * data/lalr1.cc: Use it.
3650 (YYERROR_VERBOSE_IF): Remove.
3651 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
3652 parser members, replaced by...
3653 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
3654 local variables.
3655 (yysyntax_error_): Takes the state number as argument.
3656 (yyreduce_print_): Use the argument yyrule, not the former
3657 attribute yyn_.
3658
3659 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3660
3661 * bootstrap (gnulib_modules): Add verify.
3662 * lib/.cvsignore: Add verify.h.
3663 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
3664 * src/system.h (verify): Remove.
3665 Include verify.h instead.
3666 * src/tables.c (tables_generate): Use new API for 'verify'.
3667
3668 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3669
3670 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
3671 local variables whose names begin with 'yy'.
3672 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
3673 Trivial changes from Joel E. Denny.
3674
3675 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3676 it itself.
3677 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3678 don't use alloca any more.
3679
3680 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
3681 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
3682 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
3683 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
3684 to match yacc.c, to test more hosts.
3685
3686 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3687
3688 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
3689 doesn't affect behavior.
3690 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
3691 Solaris, AIX, MSC.
3692 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
3693 This works a bit better with glibc, if user code has already included
3694 stdlib.h.
3695 * doc/bison.texinfo (Bison Parser): Document that users can't
3696 arbitrarily use malloc and free for other purposes. Document
3697 that <alloca.h> and <malloc.h> might be included.
3698 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
3699 user must declare alloca.
3700
3701 * HACKING (release): Forwarn the Translation Project about
3702 stable releses.
3703
3704 2005-09-20 Akim Demaille <akim@epita.fr>
3705
3706 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3707
3708 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3709
3710 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
3711 (YYSTACK_ALLOC_MAXIMUM): Use it.
3712 (yysyntax_error): New function.
3713 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
3714 multiple syntax errors are reported, and alloca is being used.
3715 Instead, reallocate buffers twice as big each time, so that
3716 we waste at most half the allocated memory. Start with a small
3717 (128-byte) buffer that will suffice in most cases anyway.
3718 Use yysyntax_error to do most of the work.
3719
3720 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3721 yynerrs is the number of errors reported, not the number of
3722 errors encountered.
3723
3724 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3725 Mark it as expected to fail.
3726 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3727 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3728 Don't start user-code symbols with "yy", to avoid name space problems.
3729
3730 2005-09-19 Akim Demaille <akim@epita.fr>
3731
3732 Remove the traits, failed experiment.
3733 It never proved useful, and anyway because of the current
3734 definition, it was not possible to have several specialization of
3735 this traits, making it useless.
3736 * data/lalr1.cc (yy:traits): Remove.
3737 Inline its definitions in the parser class.
3738
3739 2005-09-19 Akim Demaille <akim@epita.fr>
3740
3741 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3742 least Mac OSX with a /usr/local install of gettext.
3743
3744 2005-09-19 Akim Demaille <akim@epita.fr>
3745
3746 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3747 and yytoken for similarity with the other skeletons.
3748
3749 2005-09-19 Akim Demaille <akim@epita.fr>
3750
3751 * NEWS, configure.ac: update version number to 2.1a.
3752
3753 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3754
3755 * NEWS: Version 2.1.
3756
3757 * NEWS: Remove notice of yytname change, since it was never in an
3758 official release.
3759 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3760 diagnostic.
3761 * src/output.c (prepare): Likewise.
3762 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3763 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3764 is not defined. This is an awful hack, but it's enough for now.
3765 All callers changed.
3766 * tests/glr-regression-at (make_value): Args are const pointers now,
3767 to avoid GCC warning.
3768 (Duplicated user destructor for lookahead): New test. Currently
3769 skipped. It fails on my host but I'm not sure it'll always fail.
3770
3771 2005-09-16 Akim Demaille <akim@epita.fr>
3772
3773 * src/symtab.h (struct symbol): Declare the printer and destructor
3774 as const, to avoid accidental calls to free.
3775 (symbol_destructor_set, symbol_printer_set): Adjust.
3776 * src/symtab.c: Adjust.
3777
3778 2005-09-16 Akim Demaille <akim@epita.fr>
3779
3780 * data/c.m4 (b4_token_enums): New.
3781 (b4_token_defines): Rename as...
3782 (b4_token_enums_defines): this.
3783 (b4_token_defines): New, output only the #defines.
3784 * data/yacc.c, data/glr.c: Adjust.
3785 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3786 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3787 as default values.
3788
3789 2005-09-16 Akim Demaille <akim@epita.fr>
3790
3791 * data/lalr1.cc (yylex_): Remove, inline its code.
3792 (yyreport_syntax_error_): Remove, replaced by...
3793 (yysyntax_error_): this which returns a string and leaves to the
3794 caller the call to the users' error function.
3795 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3796 Move from members of the parser object...
3797 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3798 to local variables of the parse function.
3799
3800 2005-09-16 Akim Demaille <akim@epita.fr>
3801
3802 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3803 since it's in Bison's name space.
3804
3805 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3806
3807 * data/glr.c (yyresolveValue): Add default case to pacify
3808 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3809
3810 * NEWS: Document when yyparse started to return 2.
3811 * doc/bison.texinfo (Parser Function): Document when yyparse
3812 returns 2.
3813
3814 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3815 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3816 changed.
3817 (class position): file_name -> filename (reverting). All uses changed.
3818
3819 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3820
3821 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3822 do anything if $@ exists. This reverts part of the 2005-07-07
3823 patch.
3824
3825 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3826
3827 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3828 contains obsolete information and isn't worth distributing as a
3829 separate file anyway.
3830 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3831 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3832 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3833 (yyparse): Abort if user code uses longjmp to throw an unexpected
3834 value.
3835
3836 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3837
3838 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3839 Suggested by twlevo@xs4all.nl.
3840
3841 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3842 This avoids a diagnostic from gcc -Wswitch-enum.
3843 Problem reported by twlevo@xs4all.nl.
3844
3845 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3846 standards. Use "file name" or "file" or "name", depending on
3847 the context.
3848 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3849 not to hack/foo.tab.c.
3850 (Calc++ Top Level): 2nd arg of main is not const.
3851 * data/glr.c: b4_filename -> b4_file_name.
3852 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3853 All uses changed.
3854 (class position): filename -> file_name. All uses changed.
3855 * data/yacc.c: b4_filename -> b4_file_name.
3856 * lib/bitset.h: filename -> file_name in local vars.
3857 * lib/bitset_stats.c: Likewise.
3858 * src/files.c: Likewise.
3859 * src/scan-skel.l ("@output ".*\n): Likewise.
3860 * src/files.c (file_name_split): Renamed from filename_split.
3861 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
3862
3863 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3864
3865 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3866 to accommodate latest gnulib.
3867
3868 * tests/glr-regression.at (Duplicate representation of merged trees):
3869 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3870
3871 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3872 needed.
3873
3874 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3875
3876 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3877 All uses changed. Invoke user destructor after an error during a
3878 split parse (trivial change from Joel E. Denny).
3879
3880 * tests/glr-regression.at
3881 (User destructor after an error during a split parse): New test case.
3882 Problem reported by Joel E. Denny in:
3883 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3884
3885 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3886
3887 * README-cvs: Give URLs for recommended tools.
3888 Mention Gzip version problem, and bootstrapping issues.
3889 Remove troubleshooting section, as it's somewhat obsolete.
3890
3891 * bootstrap (no_cache): New var, to accommodate different wget
3892 variants. Use it instead of '-C off'. Problem reported by
3893 twlevo@xs4all.nl.
3894
3895 * data/glr.c (yydestroyStackItem): New function.
3896 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
3897 debugging information. Problem reported by Joel E. Denny.
3898
3899 2005-08-25 Akim Demaille <akim@epita.fr>
3900
3901 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3902
3903 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3904
3905 * data/glr.c (yyrecoverSyntaxError, yyreturn):
3906 Don't invoke destructor on unresolved entries.
3907 * tests/glr-regression.at
3908 (User destructor for unresolved GLR semantic value): New test case.
3909 Problem reported by Joel E. Denny in:
3910 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
3911
3912 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3913
3914 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3915 Add strnlen.c.
3916 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3917 lib-prefix.m4, po.m4.
3918
3919 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
3920 in yydestruct diagnostic, since it might not be an error.
3921 Problem reported by Joel Denny near end of
3922 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3923 * data/lalr1.cc (yyerturn): Likewise.
3924 * data/yacc.c (yyreturn): Likewise.
3925 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
3926
3927 * src/files.c: Remove obsolete FIXME comment.
3928
3929 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
3930 with the other templates, and to fix bogus run-on messages such
3931 as the one reported at the end of
3932 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3933 All callers changed to avoid the newline.
3934 (yyprocessOneStack): Output two lines rather than one, to accommodate
3935 the above change. This changes the debug output format slightly.
3936
3937 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
3938 reported by Joel E. Denny in
3939 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
3940 (trivial change).
3941 * tests/glr-regression.at (Duplicate representation of merged trees):
3942 New test, from Joel E. Denny in:
3943 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
3944 * THANKS: Add Joel E. Denny.
3945
3946 * configure.ac (AC_INIT): Bump to 2.0c.
3947
3948 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3949
3950 * NEWS: Version 2.0b.
3951
3952 * Makefile.am (SUBDIRS): Put examples before tests, so that
3953 "make check" doesn't finish with "All 1 tests passed".
3954
3955 * tests/regression.at (Token definitions): Don't rely on
3956 AT_PARSER_CHECK for data that contains backslashes. It currently
3957 uses 'echo', and 'echo' isn't portable if its argument contains
3958 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3959 that the byte '\0xff' is not printable in the C locale; it is,
3960 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3961 not printable, so use '\0x81' to test.
3962
3963 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3964 version of GCC, since the macro is used with non-GCC compilers.
3965
3966 Fix core dump reported by Pablo De Napoli in
3967 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3968 * tests/regression.at (Invalid inputs with {}): New test.
3969 * src/parse-gram.y (token_name): Translate type before using
3970 it as an index.
3971
3972 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3973 the user's name space. All uses changed to __attribute__
3974 ((__unused__)).
3975 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3976 Add __attribute__ ((__noreturn__)).
3977
3978 * etc/clcommit: Remove. We weren't using it, and it failed
3979 "make maintainer-distcheck".
3980 * Makefile.maint: Merge from coreutils.
3981 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3982 (syntax-check-rules): Change list of rules as described below.
3983 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3984 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3985 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3986 (sc_trailing_space): New rules.
3987 (sc_xalloc_h_in_src): Remove.
3988 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3989 (sc_space_tab, sc_error_exit_success, sc_changelog):
3990 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3991 (makefile-check, po-check, author_mark_check):
3992 (makefile_path_separator_check, copyright-check):
3993 Use grep -n, to make it easier to find violations.
3994 Use CVS_LIST and CVS_LIST_EXCEPT.
3995 (header_regexp, h_re): Remove.
3996 (dd_c): New macro.
3997 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3998 (my-distcheck): Use more-modern GCC flags.
3999 (signatures, %.asc): Remove.
4000 (rel-files, announcement): Remove signatures.
4001 Restore old updating code, even though we don't use it, so
4002 that we're the same as coreutils.
4003 (alpha, beta, major): Depend on news-date-check.
4004 Make the upload commands.
4005
4006 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
4007 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
4008 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
4009 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
4010 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
4011 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4012 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4013 * tests/sets.at: Likewise.
4014
4015 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4016 we comment out the Autoconf version number.
4017 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4018 it's error-prone and "make maintainer-distcheck" rejects it.
4019
4020 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4021 Indent calls to "error" to pacify "make maintainer-distcheck",
4022 when the calls are not intended to be translated.
4023 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4024
4025 * src/Makefile.am (DEFS): Use +=, to pacify
4026 "make maintainer-distcheck".
4027 (bison_SOURCES): Add scan-skel.h.
4028 (sc_tight_scope): New rule, from coreutils.
4029
4030 * src/files.c (src_extension, header_extension):
4031 Now static, not extern.
4032 * src/getargs.c (short_options): Likewise.
4033 * src/muscle_tab.c (muscle_table): Likewise.
4034 * src/parse-gram.y (current_class, current_type, current_prec):
4035 Likewise.
4036 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4037 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4038 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4039 void, to avoid warning when NLS is disabled.
4040 * src/output.c: Include scan-skel.h.
4041 (scan_skel): Remove decl, since scan-skel.h does this.
4042 (output_skeleton):
4043 Indent calls to "error" to pacify "make maintainer-distcheck".
4044 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4045 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4046 "make maintainer-distcheck".
4047 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4048 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4049 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4050 (skel_lex_destroy, scan_skel): Move these decls to...
4051 * src/scan-skel.h: New file.
4052 * src/uniqstr.c (uniqstr_assert):
4053 Indent calls to "error" to pacify "make maintainer-distcheck".
4054
4055 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4056 not @VAR@.
4057
4058 * tests/torture.at: Revamp to avoid misuse of atoi that
4059 "make maintainer-distcheck" complained about.
4060
4061 * examples/extexi (message): Don't print a message more than once,
4062 and omit line-number decoration that makes Emacs compile think
4063 that informative messages are worth worrying about.
4064
4065 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4066
4067 * configure.ac: Update version number.
4068
4069 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4070 accidentally.
4071 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4072 autogenerated by the maintainer.
4073 * examples/calc++/.cvsignore: Add *.yy.
4074
4075 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4076 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4077 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4078
4079 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4080
4081 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4082 from maintainer-distcheck about casting the argument of 'free'.
4083
4084 * NEWS: Mention recent yytname changes.
4085 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4086
4087 * bootstrap: For translations that have not yet been upgraded to
4088 the new runtime-po domain, prime the pump by extracting the
4089 relevant strings from the obsolete translations. This code can be
4090 removed once the bison-runtime domain has been translated by each
4091 team.
4092
4093 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4094 now that token names are already quoted.
4095
4096 Fix problem reported by Anthony Heading.
4097 * data/glr.c (YYTOKEN_TABLE): New macro.
4098 (yytname): Define if YYTOKEN_TABLE.
4099 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4100 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4101 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4102 * src/output.c (prepare_symbols): Output token_table_flag.
4103
4104 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4105
4106 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4107 again if the first call fails.
4108
4109 * data/glr.c (yytnamerr): New function.
4110 (yyreportSyntaxError): Use it to dequote most string literals.
4111 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4112 with other skeletons. All uses changed.
4113 (yytnameerr_): New function.
4114 (yyreport_syntax_error): Use it to dequote most string literals.
4115 * data/yacc.c (yytnamerr): New function.
4116 (yyerrlab): Use it to decode most string literals.
4117 * doc/bison.texinfo (Decl Summary, Calling Convention):
4118 Clarify quoting convention of yytname.
4119 * src/output.c (prepare_symbols): Quote all names. This undoes
4120 the 2005-04-17 change, which is now accomplished (mostly) via
4121 changes in the parsers as described above.
4122 * tests/regression.at (Token definitions, Web2c Actions):
4123 Undo most 2005-04-17 change here, too.
4124
4125 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4126
4127 Fix more problems reported by twlevo@xs4all.nl.
4128 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4129 remove trailing spaces. This loses the exit status of ./types,
4130 and isn't needed since ./types shouldn't be emitting trailing
4131 spaces.
4132 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4133 as the stack isn't valid in that case.
4134
4135 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4136 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4137 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4138 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4139 is used.
4140 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4141 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4142 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4143 Likewise.
4144
4145 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4146 overly-picky compilers that reject 'char *foo = "bar";'.
4147
4148 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4149 to FILE * parameter, not to stderr. This fixes a typo introduced
4150 in the 2005-07-12 change.
4151
4152 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4153 warnings from GCC 4.
4154
4155 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4156 (yyglrShiftDefer, yysplitStack):
4157 Remove unused parameters b4_pure_formals. All uses changed.
4158 (yyglrShift): Remove unused parameters b4_user_formals.
4159 All uses changed.
4160 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4161
4162 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4163
4164 Destructor cleanups and regularization among the three skeletons.
4165 * NEWS: Document the behavior changes.
4166 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4167 stack before failing, as the cleanup code will do it for us now.
4168 * data/lalr1.cc (yyerrlab): Likewise.
4169 * data/glr.c (yyparse): Pop everything off the stack before
4170 freeing it, so that destructors get called properly.
4171 * data/lalr1.cc (yyreturn): Likewise.
4172 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4173 This is more consistent.
4174 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4175 why destructors might be called. 1.875 -> 2.1.
4176 (Destructor Decl, Decl Summary, Table of Symbols):
4177 Some English-language cleanups for %destructor.
4178 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4179 Add output line for destructor of start symbol.
4180 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4181 because of that same extra output line.
4182
4183 * NEWS: Document minor wording changes in diagnostics of
4184 Bison-generated parsers.
4185 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4186 Remove unused formals. All uses changed.
4187 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4188 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4189 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4190 Rename yyoverflowab to yyexhaustedlab.
4191 When memory exhaustion occurs during syntax-error reporting,
4192 report it separately rather than in a single diagnostic; this
4193 eases translation.
4194 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4195 (Memory Exhausted): Renamed from Parser Stack Overflow.
4196 Revamp wording slightly to prefer "memory exhaustion".
4197 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4198
4199 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4200
4201 Add i18n support to the GLR skeleton. Partially fix the C++
4202 skeleton; a C++ expert needs to finish this. Remove debugging
4203 msgids; there's little point to having them translated, since they
4204 can be understood only by someone who can read the
4205 (English-language) source code.
4206
4207 Generate runtime-po/bison-runtime.pot automatically, so that we
4208 don't have to worry about garbage getting in that file. We'll
4209 make sure after the next official release that old msgids don't
4210 get lost. See
4211 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4212
4213 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4214 Now auto-generated.
4215 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4216 Fix typos in explanations of the runtime file.
4217 * bootstrap: Change gettext keyword from YYI18N to YY_.
4218 Use standard Makefile.in.in in runtime-po, since we'll arrange
4219 for backward-compatible bison-runtime.po files in a different way.
4220 * data/glr.c (YY_): New macro, from yacc.c.
4221 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4222 Translate messages intended for users.
4223 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4224 the wording in the other skeletons. We don't know that the memory
4225 is virtual.
4226 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4227 Use same method that yacc.c uses.
4228 Don't translate debugging messages.
4229 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4230 it doesn't work (yet), and requires C++ expertise to fix.
4231 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4232 Move defn to a more logical place, to be consistent with other
4233 skeletons.
4234 Don't translate debugging messages.
4235 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4236 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4237 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4238 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4239
4240 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4241 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4242 void, not int.
4243 * tests/glr-regression.at (Badly Collapsed GLR States):
4244 Likewise.
4245 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4246 yylex should return 0 at EOF rather than aborting.
4247
4248 Improve tests for stack overflow in GLR parser.
4249 Problem reported by twlevo@xs4all.nl.
4250 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4251 All uses removed.
4252 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4253 can handle the problem.
4254 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4255 (yyparse): New local variable yyresult to record the result.
4256 Use result of setjmp to set it, rather than storing itinto
4257 struct.
4258 (yyDone): Remove label.
4259 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4260 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4261 if YYABORT is used).
4262 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4263 yyparse status; put status > 1 into diagnostic.
4264 Check that status==2 works.
4265 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4266 Use exit status 3 for failure to open (which shouldn't happen).
4267
4268 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4269
4270 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4271 1 on syntax error; just let yyparse do its thing.
4272 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4273 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4274 (Exploding the Stack Size with Alloca):
4275 (Exploding the Stack Size with Malloc):
4276 Expect exit status 2, not 1, since the parser is supposed to blow
4277 its stack. Problem reported by twlevo@xs4all.nl.
4278
4279 * data/glr.c (yyparse): Don't assume that the initial calls
4280 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4281 Print a stack-overflow message and fail instead.
4282 Initialize the line-number information before creating the stack,
4283 so that the stack-overflow message can report line zero safely.
4284
4285 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4286
4287 Fix problems reported by twlevo@xs4all.nl.
4288 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4289 (yyuserMerge): Provide a default case if b4_mergers is empty.
4290 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4291 * tests/glr-regression.at
4292 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4293 Add casts to pacify C++ compilers.
4294 * tests/glr-regression.at (Improper merging of GLR delayed action
4295 sets): Declare yylex before using it.
4296 * tests/Makefile.am (maintainer-check-g++): Fix a stray
4297 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4298 test for valgrind; valgrind is independent of g++.
4299 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4300 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4301 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4302 Use a destructor, so that we can expand the stack. Change
4303 YYSTYPE to char * so that we can free it. Cast result of malloc.
4304
4305 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4306
4307 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4308 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4309
4310 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4311
4312 * PACKAGING: New file, suggested by Bruno Haible and taken from
4313 similar wording in gettext's PACKAGING file.
4314 * NEWS: Mention PACKAGING.
4315 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4316
4317 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4318
4319 * NEWS: Document recent i18n improvements.
4320 * bootstrap: Get runtime translations into runtime-po.
4321 Create runtime-po files automatically, if possible.
4322 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4323 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4324 does not infringe on the user's name space.
4325 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4326 * doc/bison.texinfo (Internationalization): Revamp the English
4327 and Texinfo syntax a bit, to try to make it clearer.
4328 (Bison Options, Option Cross Key): Mention --print-localedir.
4329 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4330 YYENABLE_NLS. Quote a bit more.
4331 * runtime-po/.cvsignore: New file.
4332 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4333 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4334 * runtime-po/quot.sed: Likewise.
4335 * runtime-po/boldquot.sed: Likewise.
4336 * runtime-po/en@quot.header: Likewise.
4337 * runtime-po/en@boldquot.header: Likewise.
4338 * runtime-po/insert-header.sin: Likewise.
4339 * runtime-po/remove-potcdate.sin: Likewise.
4340 * runtime-po/Makevars: Likewise.
4341 * runtime-po/LINGUAS: Likewise.
4342 * runtime-po/de.po: Likewise; we will rely on the translation project
4343 to maintain this, so "bootstrap" should get it.
4344 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
4345 its value.
4346 * src/main.c (main): Bind the bison-runtime domain, too.
4347
4348 2005-07-12 Bruno Haible <bruno@clisp.org>
4349
4350 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4351 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4352 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4353 * runtime-po: New directory.
4354 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4355 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4356 * runtime-po/Rules-quot: New file, copied from po/.
4357 * runtime-po/quot.sed: Likewise.
4358 * runtime-po/boldquot.sed: Likewise.
4359 * runtime-po/en@quot.header: Likewise.
4360 * runtime-po/en@boldquot.header: Likewise.
4361 * runtime-po/insert-header.sin: Likewise.
4362 * runtime-po/remove-potcdate.sin: Likewise.
4363 * runtime-po/Makevars: New file.
4364 * runtime-po/POTFILES.in: New file.
4365 * runtime-po/LINGUAS: New file.
4366 * runtime-po/bison-runtime.pot: New file.
4367 * runtime-po/de.po: New file.
4368 * m4/bison.m4: New file.
4369 * Makefile.am (SUBDIRS): Add runtime-po.
4370 (aclocaldir, aclocal_DATA): New variables.
4371 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4372 Define aclocaldir.
4373 * src/getargs.c (usage): Document --print-localedir option.
4374 (PRINT_LOCALEDIR_OPTION): New enum item.
4375 (long_options): Add --print-localedir option.
4376 (getargs): Handle --print-localedir option.
4377 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4378 (Internationalization): New section.
4379
4380 2005-07-12 Akim Demaille <akim@epita.fr>
4381
4382 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4383 for consistency with the rest of the code.
4384 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4385 Add separators.
4386
4387 2005-07-12 Akim Demaille <akim@epita.fr>
4388
4389 * src/parse-gram.y: Use %printer instead of YYPRINT.
4390
4391 2005-07-12 Akim Demaille <akim@epita.fr>
4392
4393 * src/symtab.h, src/symtab.c (symbol_print): New.
4394 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4395 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4396
4397 2005-07-12 Akim Demaille <akim@epita.fr>
4398
4399 * data/glr.c (b4_syncline): Fix (swap) the definitions of
4400 b4_at_dollar and b4_dollar_dollar.
4401
4402 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4403
4404 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4405 and Pennello's paper.
4406
4407 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4408
4409 * data/yacc.c (yyparse): Undo previous patch. Instead,
4410 set yylsp[0] and yyvsp[0] only if the initial action
4411 sets yylloc and yylval, respectively.
4412
4413 * data/yacc.c (yyparse): In the initial action, set
4414 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4415 This avoids the use of undefined variables if the initial
4416 action does not set yylloc and/or yylval.
4417
4418 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4419
4420 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4421 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4422 Remove from CVS. These files are automatically generated.
4423 * examples/extexi: Clarify that this file is now part of Bison,
4424 not GNU M4, and that it works with any POSIX-compatible Awk.
4425 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4426 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4427 so that we also get calc++-parser.yy. Geneate it.
4428 Use $(AWK), not gawk, since any conforming Awk will do.
4429 Put comment before action, since older 'make' can't handle comment
4430 in action.
4431 $(BUILT_SOURCES): List all built sources, not just some of them.
4432 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4433 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4434 $($(calc_sources_generated)): Remove unnecessary test for existence
4435 of target. (This had a shell syntax error anyway; a stray "x".)
4436 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4437 calc++-parser.yy.
4438 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4439
4440 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4441 implied by the other modules.
4442
4443 2005-07-06 Akim Demaille <akim@epita.fr>
4444
4445 Bind examples/calc++ to the package.
4446 * examples/calc++/Makefile: Remove, replaced by...
4447 * examples/calc++/Makefile.am: ... this new file.
4448 * examples/calc++/test: Remove input.
4449 * examples/calc++/compile: Remove.
4450 * examples/Makefile.am: New.
4451 * configure.ac, Makefile.am: Adjust.
4452 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4453
4454 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4455
4456 * data/glr.c (yyFail): Drastically simplify; since the format argument
4457 never had any % directives, we can simply pass it to yyerror.
4458 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4459 be modified later, as that is the usual style in glr.c.
4460 Problems reported by Paul Hilfinger.
4461
4462 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4463 and size overflow errors.
4464 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4465 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4466 (YYSIZEMAX): New macro.
4467 (yystpcpy): New function, taken from yacc.c.
4468 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4469 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4470 so that we don't have to maintain their signatures.
4471 (yyFail): Check for buffer overflow, by using vsnprintf rather
4472 than vsprintf. Allocate a bigger buffer if possible.
4473 Report an error if buffer allocation fails.
4474 (yyStackOverflow): New function.
4475 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4476 the initialization was successful. It might fail if storage was
4477 exhausted.
4478 (yyexpandGLRStack): Add more checks for storage allocation failure.
4479 Use yyStackOverflow to report failures.
4480 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4481 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4482 Don't assume stack number fits in int.
4483 (yysplitStack): Check for storage allocation failure.
4484 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4485 can print diagnostics on storage allocation failure. All callers
4486 changed.
4487 (yyresolveValue): Use yybool for boolean.
4488 (yyreportSyntaxError): Check for size-calculation overflow.
4489 This code is taken from yacc.c.
4490 (yyparse): Check for storage allocation errors when allocating
4491 the initial stack.
4492
4493 2005-07-05 Akim Demaille <akim@epita.fr>
4494
4495 Extract calc++ from the documentation.
4496 * doc/bison.texinfo (Calc++): Add the extraction marks.
4497 * examples/extexi: New, from the aborted GNU Programming 2E.
4498 Separate the different paragraph of a file with empty lines.
4499 * examples/Makefile: Use it to extract the whole calc++ example.
4500
4501 2005-06-24 Akim Demaille <akim@epita.fr>
4502
4503 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4504 class typedefs.
4505
4506 2005-06-22 Akim Demaille <akim@epita.fr>
4507
4508 * doc/bison.texinfo (C++ Language Interface): First stab.
4509 (C++ Parsers): Remove.
4510
4511 2005-06-22 Akim Demaille <akim@epita.fr>
4512
4513 * data/lalr1.cc (yylex_): Honor %lex-param.
4514
4515 2005-06-22 Akim Demaille <akim@epita.fr>
4516
4517 Start a set of simple examples.
4518 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4519 * examples/calc++/calc++-driver.hh,
4520 * examples/calc++/calc++-parser.yy,
4521 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4522 * examples/calc++/compile, examples/calc++/test: New.
4523
4524 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4525
4526 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4527 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4528 which stems from the 2005-05-27 patch.
4529
4530 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4531
4532 * data/glr.c: Modify treatment of unused parameters to permit use
4533 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4534
4535 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4536
4537 Fix infringement on user name space reported by Janos Zoltan Szabo.
4538 * data/yacc.c (yyparse): strlen -> yystrlen.
4539
4540 2005-05-30 Akim Demaille <akim@epita.fr>
4541
4542 * data/lalr1.cc (_): New.
4543 Translate the various messages.
4544
4545 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4546
4547 Fix infringement on user name space reported by Bruno Haible.
4548 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4549 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4550 the user's name space.
4551 (alloca): Include <stdlib.h> to get it, if it's not built in.
4552 (YYMALLOC, YYFREE): Define only if needed.
4553 (malloc, free): Declare, but only if needed, as this infringes on
4554 the user name space.
4555
4556 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4557
4558 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4559 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4560 with %d format.
4561 * lib/ebitset.c (min, max): Undef before defining.
4562 * lib/vbitset.c (min, max): Likewise.
4563 * lib/subpipe.c (create_subpipe): Save local variables in case
4564 vfork clobbers them.
4565
4566 2005-05-24 Bruno Haible <bruno@clisp.org>
4567
4568 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4569 error message syntax used by gcc-4.0.
4570
4571 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4572
4573 * README: Mention m4 1.4.3. Remove obsolete advice about
4574 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4575
4576 * bootstrap: Remove workaround for problem I encountered with
4577 gettext 0.14.1; it seems to be fixed now.
4578
4579 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4580
4581 * NEWS: Version 2.0a.
4582
4583 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4584 the previous change.
4585
4586 Various maintainer cleanups.
4587 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4588 conftest*, for benefit of CVS commands run at the same time as
4589 "configure". Add build-aux, since "bootstrap" now creates it and
4590 its subfiles.
4591 * Makefile.cfg (move_if_change): Remove.
4592 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
4593 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
4594 (po_repo, do-po-update, po-update, wget_files, get-targets):
4595 (config.guess-url_prefix, config.sub-url_prefix):
4596 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
4597 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
4598 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
4599 Remove.
4600 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
4601 this is now the recommended name.
4602 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
4603 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
4604 ylwrap. These files now go into build-aux.
4605 * config/move-if-change: Remove.
4606 * config/prev-version.txt: Bump from 1.75 to 2.0.
4607
4608 * bootstrap: Add stdio-safer, unistd-safer modules.
4609 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4610 we don't need it).
4611 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
4612 fopen-safer.c, stdio-safer.h, unistd-safer.h.
4613 * lib/subpipe.c: Include "unistd-safer.h".
4614 (create_subpipe): Make sure all the newly-created
4615 file descriptors are > 2, so that diagnostics don't
4616 get sent down them (which might cause Bison to hang, in theory).
4617 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
4618 * src/files.c (xfopen): Use fopen_safer, not fopen.
4619
4620 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4621 yesterday's yacc.c fix.
4622
4623 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4624
4625 * data/glr.c, data/lalr1.cc: Update copyright date.
4626
4627 Fix a destructor bug reported by Wolfgang Spraul in
4628 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
4629 * data/yacc.c (yyabortlab): Don't call destructor, and
4630 don't set yychar to EMPTY.
4631 (yyoverflowlab): Don't call destructor.
4632 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
4633 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
4634 since we no longer output the message "discarding lookahead token
4635 end of input ()".
4636
4637 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4638
4639 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
4640 fix a small glitch in debugging output.
4641 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
4642 after YY_SYMBOL_PRINT where needed.
4643
4644 (struct yyGLRState): Add some comments.
4645 (struct yySemanticOption): Add some comments.
4646 (union yyGLRStackItem): Add comment.
4647
4648 (yymergeOptionSets): Correct this to properly perform the union,
4649 avoiding infinite reported by Michael Rosien.
4650 Update comment.
4651
4652 * tests/glr-regression.at: Add test for GLR merging error reported
4653 by M. Rosien.
4654
4655 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4656
4657 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
4658 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
4659 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
4660 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
4661 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
4662 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
4663 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
4664 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
4665 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
4666 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
4667 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
4668 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
4669 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
4670 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
4671 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
4672 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
4673 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
4674 src/derives.h, src/files.c, src/files.h, src/getargs.c,
4675 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
4676 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
4677 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
4678 src/output.h, src/parse-gram.c, src/parse-gram.h,
4679 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
4680 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
4681 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
4682 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
4683 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
4684 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
4685 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
4686 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
4687 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
4688 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
4689 tests/reduce.at, tests/regression.at, tests/sets.at,
4690 tests/synclines.at, tests/testsuite.at, tests/torture.at:
4691 Update FSF postal mail address.
4692
4693 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4694
4695 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4696 Problem reported by Ralf Menzel.
4697
4698 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4699
4700 * tests/actions.at: Test that stack overflow invokes destructors.
4701 From Marcus Holland-Moritz.
4702 * data/yacc.c (yyerrlab): Move the code that destroys the stack
4703 from here....
4704 (yyreturn): to here. That way, destructors are called properly
4705 even if the stack overflows, or the user calls YYACCEPT or
4706 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
4707 (yyoverflowlab): Destroy the lookahead.
4708
4709 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4710
4711 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4712
4713 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4714
4715 * NEWS: Bison-generated C parsers no longer quote literal strings
4716 associated with tokens.
4717 * src/output.c (prepare_symbols): Don't escape strings,
4718 since users don't want to see C escapes.
4719 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4720 in diagnostics.
4721 * tests/input.at (Torturing the Scanner): Likewise.
4722 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4723
4724 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4725
4726 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4727 the data size is known to be too small and we can't increase it.
4728 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4729
4730 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4731
4732 * src/parse-gram.y: Include quotearg.h.
4733 (string_as_id): Quote $1 before using it as a key, since the
4734 lexer no longer quotes it for us.
4735 (string_content): Don't strip quotes, since lexer no longer
4736 quotes it for us.
4737 * src/scan-gram.l: Include quotearg.h.
4738 ("\""): Omit quote.
4739 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4740 a key, since the rest of the lexer doesn't quote it.
4741 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4742 * tests/regression.at (Token definitions): Check for backslashes
4743 in token strings.
4744
4745 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4746 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4747 (yyparse): Revamp code to generate long syntax error message, to
4748 make it easier to translate, and to avoid problems with arithmetic
4749 overflow. Change "virtual memory" to "memory" in diagnostic, since
4750 we don't know whether the memory is virtual.
4751
4752 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4753
4754 * NEWS: Bison-generated C parsers now use the _ macro to
4755 translate strings.
4756 * data/yacc.c (_) [!defined _]: New macro.
4757 All English strings wrapped inside this macro.
4758 * doc/bison.texinfo (Bison Parser): Document _.
4759 * po/POTFILES.in: Include src/parse-gram.c, since it now
4760 includes translateable strings that parse-gram.y doesn't.
4761
4762 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4763
4764 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4765 reverting the 2004-10-11 change to this function.
4766 (symbol_check_alias_consistency): Don't call symbol_type_set
4767 if the type name is already correct.
4768 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4769
4770 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4771
4772 * tests/regression.at (Token definitions): Don't use a token named
4773 c, as that generates a "#define c ..." that runs afoul of buggy
4774 stdlib.h that uses the identifier c as a member of struct
4775 drand48_data. Problem reported by Horst Wente.
4776
4777 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4778
4779 * bootstrap: Change translation URL from
4780 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4781 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4782 redirection glitches. Problem reported by twlevo@xs4all.nl.
4783
4784 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4785
4786 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4787 after operands; POSIX says this isn't portable for the c99 command.
4788
4789 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4790
4791 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4792 immediately if a data overrun has occurred; this may help us track
4793 down what may be a spurious failure on MacOS.
4794
4795 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4796
4797 Respond to problems reported by twlevo@xs4all.nl.
4798
4799 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4800
4801 * src/vcg.h: Comment fix.
4802 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4803 (G_CMAX): Change to -1 instead of INT_MAX.
4804
4805 * data/yacc.c (yyparse): Omit spaces before #line.
4806
4807 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4808
4809 * src/tables.c (state_number_to_vector_number): Put it inside an
4810 "#if 0", since it's not currently used. Problem reported by
4811 Roland McGrath.
4812
4813 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4814
4815 * src/output.c (escaped_output): Renamed from
4816 escaped_file_name_output, since we now use it for symbol tags as
4817 well. All uses changed.
4818 (symbol_destructors_output, symbol_printers_output):
4819 Escape symbol tags too.
4820 Problem reported by Matyas Forstner in
4821 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4822
4823 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4824 not needed.
4825 * src/output.c (user_actions_output, token_definitions_output,
4826 symbol_destructors_output, symbol_printers_output): Likewise.
4827 * src/reader.c (prologue_augment): Likewise.
4828 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4829
4830 * src/vcg.c (output_edge): Don't quote linestyle arg.
4831 Problem reported by twlevo@xs4all.nl.
4832
4833 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4834
4835 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4836 example, reported by Derek M Jones. Also, make the example even
4837 more outrageous, to better illustrate how bad the problem is.
4838
4839 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4840
4841 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4842 putsym. Typo reported by Sebastian Piping.
4843
4844 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4845
4846 * doc/bison.texinfo (Language and Grammar): some -> same
4847 (Epilogue): int he -> in the
4848 Typos reported by Sebastian Piping via Justin Pence.
4849
4850 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4851
4852 * tests/glr-regression.at (Improper handling of embedded actions
4853 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4854 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4855 with dollar signs in test names.
4856 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4857 for a similar reason.
4858
4859 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4860
4861 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4862 wants to redefine G_VIEW.
4863
4864 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4865
4866 * src/vcg.c (get_view_str): Remove case for normal_view.
4867 Problem reported by twlevo@xs4all.nl.
4868
4869 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4870
4871 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4872 Problem reported by twlevo@xs4all.nl.
4873
4874 * doc/bison.texinfo: Change @dircategory from "GNU programming
4875 tools" to "Software development". Requested by Richard Stallman
4876 via Karl Berry.
4877
4878 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4879
4880 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4881 Problem reported by twlevo@xs4all.nl.
4882
4883 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4884
4885 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
4886 keyword; it's not needed with modern compilers, and it doesn't
4887 affect correctness with older compilers. Suggested by
4888 twlevo@xs4all.nl.
4889
4890 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4891
4892 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
4893 gcc -Wswitch-default.
4894 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4895 * data/yacc.c (yyparse): Likewise.
4896
4897 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4898
4899 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4900 already. Let config.h define any nonstandard values.
4901
4902 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4903
4904 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4905 for the benefit of slower hosts. Problem reported by
4906 Nelson H. F. Beebe.
4907
4908 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4909
4910 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
4911 being defined and not used.
4912 * data/lalr1.cc (yyparse): Likewise.
4913 Use "if (false)" rather than "if (0)".
4914
4915 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4916
4917 * TODO: Mention that we should allow NUL bytes in tokens.
4918
4919 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4920
4921 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4922 Problem reported by Hans Aberg.
4923
4924 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4925
4926 * src/getargs.c (version): Happy new year; update overall
4927 program copyright date from 2004 to 2005.
4928
4929 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
4930 Problem reported by Hans Aberg.
4931 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
4932 (Output file names.): Add a test for the case when standard output
4933 is closed.
4934
4935 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4936
4937 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4938 to fix an oversight in the Bison 2.0 manual.
4939
4940 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4941
4942 * NEWS: Version 2.0. Reformat the existing news items since
4943 1.875, so that related items are grouped together.
4944 * configure.ac (AC_INIT): Bump version to 2.0.
4945 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
4946
4947 * tests/torture.at (Exploding the Stack Size with Alloca): Set
4948 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
4949 otherwise, we're not testing alloca. Unfortunately there's no
4950 simple way to consult HAVE_ALLOCA here.
4951
4952 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4953 for yymsg, too.
4954
4955 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
4956 hand. This avoids a warning about comparing int to size_t when
4957 GCC warnings are enabled.
4958
4959 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4960
4961 * NEWS: Bison-generated parsers no longer default to using the
4962 alloca function (when available) to extend the parser stack, due
4963 to widespread problems in unchecked stack-overflow detection.
4964 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4965 responsibility to set it to a positive value. This lets the user
4966 specify a value that is not a preprocessor constant.
4967 * data/yacc.c (YYMAXDEPTH): Likewise.
4968 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4969 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4970 to be a compile-time constant. However, explain the constraints on it.
4971 Also, explain the constraints on YYINITDEPTH.
4972 (Table of Symbols): Explain that alloca is no longer the default.
4973 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4974 to 1.
4975
4976 * doc/bison.texinfo (Location Default Action): Mention that n must
4977 be zero when k is zero. Suggested by Frank Heckenbach.
4978
4979 2004-12-22 Akim Demaille <akim@epita.fr>
4980
4981 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4982 (parser::state_type, parser::semantic_type, parser::location_type):
4983 Private, not public.
4984 (parser::parse): Return ints, not bool.
4985 Returning a bool introduces a problem: 0 corresponds to false, and
4986 it seems weird to return false on success. Returning true changes
4987 the conventions for yyparse.
4988 Alternatively we could return void and send an exception.
4989 There is no clear consensus (yet?).
4990 (state_stack, semantic_stack, location_stack): Rename as...
4991 (state_stack_type, semantic_stack_type, location_stack_type): these.
4992 Private, not public.
4993 * tests/c++.at: New.
4994 * tests/testsuite.at, tests/Makefile.am: Adjust.
4995
4996 2004-12-21 Akim Demaille <akim@epita.fr>
4997
4998 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4999
5000 2004-12-21 Akim Demaille <akim@epita.fr>
5001
5002 Don't impose std::string for filenames.
5003
5004 * data/lalr1.cc (b4_filename_type): New.
5005 (position::filename): Use it.
5006 (parser.hh): Move the inclusion of stack.hh and location.hh below
5007 the user code, so that needed headers for the filename type can be
5008 included first.
5009 Forward declare them before the user code.
5010 * tests/Makefile.am (check-local, installcheck-local): Pass
5011 TESTSUITEFLAGS to the TESTSUITE.
5012
5013 2004-12-20 Akim Demaille <akim@epita.fr>
5014
5015 Use more STL like names: my_class instead of MyClass.
5016
5017 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5018 (SemanticStack, SemanticType, StateStack, StateType)
5019 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5020 (Parser::value): Rename as...
5021 (location_stack, location_type, rhs_number_type, semantic_stack)
5022 (semantic_type, state_stack, state_type, token_number_type, stack)
5023 (slice, traits, parser::yylloc, parser::yylval): these.
5024
5025 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5026
5027 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5028
5029 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5030 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5031
5032 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5033
5034 Remove uses of 'short int' and 'unsigned short int'. This raises
5035 some arbitrary limits. It uses more memory but nowadays that's
5036 not much of an issue.
5037
5038 This change does not affect the generated parsers; that's a different
5039 task, as some users will want to conserve memory there.
5040
5041 Ideally we should use size_t to represent all object counts, and
5042 something like ptrdiff_t to represent signed differences of object
5043 counts; but that will require more code-cleanup than I have the
5044 time to do right now.
5045
5046 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5047 Use size_t, not int or short int, to count objects.
5048 * src/closure.c (nritemset, closure): Likewise.
5049 * src/closure.h (nritemset, closure): Likewise.
5050 * src/nullable.c (nullable_compute): Likewise.
5051 * src/print.c (print_core): Likewise.
5052 * src/print_graph.c (print_core): Likewise.
5053 * src/state.c (state_compare, state_hash): Likewise.
5054 * src/state.h (struct state): Likewise.
5055 * src/tables.c (default_goto, goto_actions): Likewise.
5056
5057 * src/gram.h (rule_number, rule): Use int, not short int.
5058 * src/output.c (prepare_rules): Likewise.
5059 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5060 errs, reductions): Likewise.
5061 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5062 Likewise.
5063 * src/tables.c (vector_number, tally, action_number,
5064 ACTION_NUMBER_MINIMUM): Likewise.
5065 * src/output.c (muscle_insert_short_int_table): Remove.
5066
5067 2004-12-17 Akim Demaille <akim@epita.fr>
5068
5069 * data/lalr1.cc: Extensive Doxygenation.
5070 (error_): Rename as...
5071 (error): this, since it is visible to the user.
5072 Adjust callers.
5073 (Parser::message): Now an automatic variable from...
5074 (Parser::yyreport_syntax_error_): here.
5075 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5076 Parser::error.
5077 * tests/input.at: Escape $.
5078
5079 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5080
5081 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5082 Parenthesize rhs to avoid obscure problems with mistakes like
5083 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5084 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5085 b4_rhs_location): Likewise.
5086 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5087 b4_rhs_location): Likewise.
5088
5089 2004-12-16 Akim Demaille <akim@epita.fr>
5090
5091 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5092 yacc.c: be sure to stay within yycheck_.
5093 * tests/actions.at: Re-enable C++ tests.
5094
5095 2004-12-16 Akim Demaille <akim@epita.fr>
5096
5097 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5098 real.
5099
5100 2004-12-16 Akim Demaille <akim@epita.fr>
5101
5102 Use #define to handle the %name-prefix.
5103
5104 * data/glr.c, data/yacc.c: Comment changes.
5105 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5106 so that one can refer to yylex in the parser file, and have it
5107 renamed, as is the case with other skeletons.
5108
5109 2004-12-16 Akim Demaille <akim@epita.fr>
5110
5111 Move lalr1.cc internals into yy*.
5112
5113 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5114 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5115 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5116 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5117 (empty_, final_, terror_, errcode_, ntokens_)
5118 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5119 (looka_, ilooka_, error_range_, nerrs_):
5120 Rename as...
5121 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5122 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5123 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5124 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5125 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5126 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5127 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5128 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5129 these.
5130
5131 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5132
5133 Fix some problems reported by twlevo at xs4all.
5134 * src/symtab.c (symbol_new): Report an error if the input grammar
5135 contains too many symbols. This is better than calling abort() later.
5136 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5137 (struct node, struct graph):
5138 Rename member expand to stretch. All uses changed.
5139 (struct graph): Remove member layoutalgorithm. All uses removed.
5140 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5141 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5142 All uses changed.
5143 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5144
5145 2004-12-15 Akim Demaille <akim@epita.fr>
5146
5147 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5148 Add more Doxygen comments.
5149 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5150 (report_syntax_error_, translate_): Rename as...
5151 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5152 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5153
5154 2004-12-15 Akim Demaille <akim@epita.fr>
5155
5156 * data/lalr1.cc (lex_): Rename as...
5157 (yylex_): this.
5158 Move the trace here.
5159 Take the %name-prefix into account.
5160 Reported by Alexandre Duret-Lutz.
5161
5162 2004-12-15 Akim Demaille <akim@epita.fr>
5163
5164 Simplify the C++ parser constructor.
5165
5166 * data/lalr1.cc (debug_): Rename as...
5167 (yydebug_): so that the parser's internals are always in the yy*
5168 pseudo namespace.
5169 Adjust uses.
5170 (b4_parse_param_decl): Remove the leading comma as it is now only
5171 called as unique argument list.
5172 (Parser::Parser): Remove the constructor accepting a location and
5173 an initial debugging level.
5174 Remove from the other ctor the argument for the debugging level.
5175 (debug_level_type, debug_level, set_debug_level): New.
5176
5177 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5178 constructor calls.
5179
5180 2004-12-15 Akim Demaille <akim@epita.fr>
5181
5182 Remove b4_root related material: failure experiment
5183 (which goal was to allow to derive from a class).
5184
5185 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5186 definitions and uses.
5187
5188 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5189
5190 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5191 not 2, since it's not portable to subtract 1 from the start of an
5192 array. The new item 0 is never set or used. All uses changed.
5193
5194 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5195 the default definition of YYLLOC_DEFAULT. Problem reported
5196 by Frank Heckenbach.
5197
5198 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5199
5200 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5201 the normal case and one for the error case. Just use the
5202 first one uniformly. Problem reported by Frank Heckenbach.
5203 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5204 use exactly the same macro in both places.
5205 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5206 so that the normal-case YYRHSLOC works for the error case too.
5207 All uses changed.
5208 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5209 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5210 * doc/bison.texinfo (Location Default Action): Don't claim that
5211 we have an array of locations. Use the same macro for both glr
5212 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5213 the index is 0.
5214
5215 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5216
5217 * HACKING: Update email addresses to send announcements to.
5218
5219 * configure.ac (AC_INIT): Bump version to 1.875f.
5220
5221 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5222
5223 * NEWS: Version 1.875e.
5224 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5225
5226 * src/scan-skel.l: Include "complain.h", for "fatal".
5227
5228 * src/relation.h (relation_print, relation_digraph):
5229 Relation sizes are of type relation_node, not size_t (this is
5230 merely a doc fix, since the two types are equivalent).
5231 (relation_transpose): Relation sizes are of type relation_node,
5232 not int.
5233 * src/relation.c: Likewise.
5234 (top, infinity): Now of type relation_node, not int.
5235 (traverse, relation_transpose): Use relation_node, not int.
5236
5237 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5238 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5239 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5240
5241 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
5242 specifying whether the test should be skipped. Use it tp
5243 specify that the [%defines %skeleton "lalr1.cc"] tests currently
5244 fail on some hosts, and should be skipped.
5245
5246 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5247
5248 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5249 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5250 unless otherwise specified below.
5251
5252 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5253 to allocate kernel_base, kernel_items, kernel_size, since
5254 they needn't be initialized to 0.
5255 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5256 * src/closure.c (new_closure): Likewise, for itemset.
5257 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5258 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5259 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5260 (build_relations): Likewise for edge, states1, includes.
5261 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5262 * src/reader.c (packgram): Likewise, for ritem, rules.
5263 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5264 * src/relation.c (relation_digraph): Likewise for VERTICES.
5265 (relation_transpose): Likewise for new_R, end_R.
5266 * src/symtab.c (symbols_token_translations_init): Likewise for
5267 token_translations.
5268 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5269 (token_actions): Likewise for yydefact, actrow, conflrow,
5270 conflict_list.
5271 (save_column): Likewise for froms[symno], tos[symno].
5272 (goto_actions): Likewise for state_count.
5273 (pack_table): Likewise for base, pos, check.
5274 (tables_generate): Likewise for width.
5275
5276 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5277 for initial core. Just have a separate core, so we needn't worry
5278 about whether kernel_size and kernel_base are initialized.
5279
5280 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5281 kernel_size, kernel_items): Remove unnecessary initialization.
5282 * src/conflicts.c (conflicts): Likewise.
5283 * src/derives.c (derives): Likewise.
5284 * src/muscle_tablc (muscle_insert): Likewise.
5285 * src/relation.c (relation_digraph): Likewise.
5286 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5287 conflrow, conflict_table, conflict_list, table, check):
5288 Likewise.
5289
5290 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5291 This is because all callers pass unsigned int.
5292 * src/closure.h (new_closure): Likewise.
5293
5294 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5295 (build_relations): Initialize includes[i] in all cases.
5296 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5297 and rules[ruleno].precsym. Initialize members in order.
5298 * src/relation.c (relation_transpose): Always initialize new_R[i]
5299 and end_R[i].
5300 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5301
5302 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5303 conflict_list[0] was always 0, but now it isn't initialized.
5304
5305 * src/table.c (table_grow): When conflict_table grew, the grown
5306 area wasn't cleared. Fix this.
5307
5308 * lib/.cvsignore: Add strdup.c, strdup.h.
5309 * m4/.cvsignore: Add strdup.m4.
5310
5311 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5312
5313 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5314 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5315 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5316 ngotos + 1 without checking for overflow.
5317 (build_relations): Use END_NODE, not -1, to denote end of edges.
5318 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5319 build_relations): Use goto_number, not int, for goto numbers.
5320 * src/tables.c (save_column, default_goto): Likewise.
5321
5322 2004-11-23 Akim Demaille <akim@epita.fr>
5323
5324 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5325 of #defining from yystype.
5326 Don't typedef yystype, C++ does not need it.
5327 This lets it possible to forward declare it as union.
5328
5329 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5330
5331 * bootstrap (gnulib_modules): Add extensions.
5332 Problem reported by Jim Meyering.
5333
5334 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5335
5336 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5337 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5338 src/system.h, src/tables.c: XFREE -> free, to accommodate
5339 recent change to gnulib xalloc.h.
5340 Problem reported by Jim Meyering.
5341
5342 2004-11-17 Akim Demaille <akim@epita.fr>
5343
5344 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5345
5346 2004-11-17 Akim Demaille <akim@epita.fr>,
5347 Alexandre Duret-Lutz <adl@gnu.org>
5348
5349 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5350 changes.
5351 (YYCDEBUG): Adjust.
5352 Use it instead of cdebug_.
5353 (Parser::debug_stream, Parser::set_debug_stream): New.
5354 (Parser::symprint_): Define cdebug_ for temporary backward
5355 compatibility.
5356 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5357 debug_stream ().
5358
5359 2004-11-17 Akim Demaille <akim@epita.fr>
5360
5361 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5362 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5363 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5364 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5365
5366 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5367
5368 * data/glr.c (yyloc_default): Remove; not used.
5369 Problem reported by Frank Heckenbach.
5370
5371 2004-10-25 Akim Demaille <akim@epita.fr>
5372
5373 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5374 Introduce another definition to address simple location arrays.
5375 (yyGLRStack): New member: yyerror_range.
5376 (yyrecoverSyntaxError, yyparse): Update it.
5377 (yyrecoverSyntaxError): Use it when shifting the error token to
5378 have an accurate range, equivalent to the one computed by both
5379 yacc.c and lalr1.cc.
5380 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5381 that column numbers start at column 0, as per GNU Coding
5382 Standards, the others tests, and the doc.
5383 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5384 Adjust to the above change (first column is 0).
5385 And adjust the location of the "<error>", now covering the whole
5386 line.
5387
5388 2004-10-22 Akim Demaille <akim@epita.fr>
5389 and Paul Eggert <eggert@cs.ucla.edu>
5390
5391 Remove some arbitrary limits on goto numbers and relations.
5392 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5393 initial values, since they're never used.
5394 (set_goto_map): ngotos is now unsigned, so test for overflow
5395 by seeing whether it wraps around to zero.
5396 * src/lalr.h (goto_number): Now size_t, not short int.
5397 (GOTO_NUMBER_MAXIMUM): Remove.
5398 * src/relation.c (relation_print, traverse, relation_transpose):
5399 Check for END_NODE rather than looking at sign.
5400 * src/relation.h (END_NODE): New macro.
5401 (relation_node): Now size_t, not short int.
5402
5403 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5404
5405 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5406 keyword, not an identifier. Problem reported by Baron Schwartz in
5407 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5408
5409 2004-10-11 Akim Demaille <akim@epita.fr>
5410
5411 * src/symtab.c (symbol_check_alias_consistency): Also check
5412 type names, destructors, and printers.
5413 Reported by Alexandre Duret-Lutz.
5414 Recode the handling of associativity and precedence in terms
5415 of symbol_precedence_set.
5416 Accept no redeclaration at all, not even equal to the previous
5417 value.
5418 (redeclaration): New.
5419 Use it to factor redeclaration complaints.
5420 (symbol_make_alias): Don't set the type of the alias, let
5421 symbol_check_alias_consistency do it as for other features.
5422 * src/symtab.h (symbol): Add new member prec_location, and
5423 type_location.
5424 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5425 * tests/input.at (Incompatible Aliases): New.
5426
5427 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5428
5429 .cvsignore fixes to accommodate gnulib changes,
5430 and the practice of naming build directories "_build".
5431 * .cvsignore: Add "_*". Sort.
5432 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5433 * m4/.cvsignore: Add "*_gl.m4".
5434
5435 2004-10-06 Akim Demaille <akim@epita.fr>
5436
5437 * src/parse-gram.y (add_param): Fix the truncation of trailing
5438 spaces.
5439
5440 2004-10-05 Akim Demaille <akim@epita.fr>
5441
5442 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5443 whether the reducion was empty or not. This leaves room to
5444 improve the use of YYLLOC_DEFAULT in such a case.
5445 lalr1.cc is still experimental, so changing this is acceptable.
5446 And finally, there are probably not many users who changed the
5447 handling of locations in GLR, so changing is admissible too.
5448
5449 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5450 empty reduction, set @$ to an empty location ending the previously
5451 stacked symbol.
5452 Adjust uses to make sure the code is triggered on empty
5453 reductions.
5454 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5455 expected output: empty reductions have empty locations.
5456
5457 2004-09-29 Akim Demaille <akim@epita.fr>
5458
5459 * data/lalr1.cc: Move towards a more standard C++ coding style
5460 for templates: Class < T > -> Class<T>.
5461
5462 2004-09-29 Akim Demaille <akim@epita.fr>
5463
5464 * data/lalr1.cc: Reinstall the former ctor, for sake of
5465 compatibility, but warn it will be removed.
5466 Move towards a more standard C++ coding style (i.e., type *var ->
5467 type* var).
5468
5469 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5470
5471 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5472 since it's less likely to work if NULs are involved in the future.
5473
5474 2004-09-27 Akim Demaille <akim@epita.fr>
5475
5476 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5477
5478 2004-09-27 Akim Demaille <akim@epita.fr>
5479
5480 * data/lalr1.cc (b4_parse_param_decl_1): New.
5481 (b4_parse_param_decl): Use it to have different names between attribute
5482 and argument names.
5483 (b4_cc_constructor_call): Likewise.
5484
5485 2004-09-24 Akim Demaille <akim@epita.fr>
5486
5487 * src/parse-gram.y (add_param): Strip the leading and trailing
5488 blanks from a formal argument declaration.
5489 (YY_LOCATION_PRINT): New.
5490
5491 2004-09-24 Akim Demaille <akim@epita.fr>
5492
5493 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5494 after the location.
5495
5496 2004-09-24 Akim Demaille <akim@epita.fr>
5497
5498 * doc/bison.texinfo (Table of Symbols): Sort.
5499
5500 2004-09-21 Akim Demaille <akim@epita.fr>
5501
5502 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5503 the useless parentheses.
5504 Suggested by Paul Eggert.
5505
5506 2004-09-20 Akim Demaille <akim@epita.fr>
5507
5508 Let the initial-action act on the look-ahead, and use it for the
5509 "initial push" (corresponding to an hypothetical beginning-of-file).
5510 And let lalr1.cc honor %initial-action.
5511
5512 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5513 example.
5514 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5515 (Parser::Parser): Remove the ctor that used to initialize it.
5516 (Parser::parse): Like in the other skeletons, issue the "starting
5517 parse" message before any action.
5518 Honor %initial-action.
5519 Initialize the stacks with the lookahead.
5520 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5521 look-ahead.
5522 Push them in the stacks.
5523 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5524
5525 2004-09-20 Akim Demaille <akim@epita.fr>
5526
5527 * doc/bison.texinfo (Initial Action Decl): New.
5528
5529 2004-09-20 Akim Demaille <akim@epita.fr>
5530
5531 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5532 clearer criterion to define it.
5533 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5534 When reducing on an empty RHS, use the latest stacked location as
5535 location.
5536 yylloc is not always available.
5537 * data/glr.c: Likewise.
5538 Also, honor initial-actions.
5539
5540 2004-09-20 Akim Demaille <akim@epita.fr>
5541
5542 * data/yacc.c (YY_LOCATION_PRINT): New.
5543 Define when we know YYLTYPE's structure, i.e., when the default
5544 YYLLOC_DEFAULT is used.
5545 * data/c.m4 (b4_yysymprint_generate): Use it.
5546 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5547 value of the result.
5548 (error_start_): Replace with...
5549 (error_range_): this location array.
5550 This allows to replace code relying on the implementation of
5551 locations by portable code.
5552 * data/yacc.c (yylerrsp): Replace with...
5553 (yyerror_range): this.
5554 Every time a token is popped, update yyerror_range[0], to have an
5555 accurate location for the error token.
5556 * data/glr.c (YY_LOCATION_PRINT): New.
5557 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5558 deference a pointer.
5559 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5560 report the location in %printers.
5561
5562 * src/scan-skel.l: Instead of abort, report error messages to ease
5563 understanding skeleton scanning failures.
5564
5565 2004-09-16 Akim Demaille <akim@epita.fr>
5566
5567 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5568 (iterator, const_iterator): these, to be more in the C++ spirit.
5569 Also, return reverse iterators so that when displaying the stack
5570 we display its bottom first.
5571 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5572 from yacc.c.
5573 We should probably use vector here though.
5574
5575 2004-09-16 Akim Demaille <akim@epita.fr>
5576
5577 Have more complete shift traces.
5578
5579 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5580 to report Shifts instead of ad hoc YYDPRINTF invocations,
5581 including for the error token.
5582 * data/lalr1.cc (symprint_): Output the location.
5583 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5584 output the location within the %printer.
5585 Activate GLR tests, at least to make sure they compile properly.
5586 They still don't pass though.
5587 * tests/calc.at: Adjust expect verbose output, since now "Entering
5588 state..." is on a different line than the "Shifting" message.
5589
5590 2004-09-08 Akim Demaille <akim@epita.fr>
5591
5592 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
5593 Bison directive from the Bison file to the invocation of this
5594 macro, so that these directives are passed to
5595 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
5596 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
5597 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
5598 the extra Bison directives instead of the whole series.
5599 Change the grammar so that there are recoverable errors, and
5600 unrecoverable errors. Now we can have the parser give up before
5601 consuming the whole input. As a result we now can observe that
5602 the lookahead is freed when needed.
5603 Change the parser source to parse argv[1] instead of a hard coded
5604 string.
5605 Simplify yylex, and give a value and location to EOF.
5606 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
5607 passed directives already coded in the file.
5608 Add some tests to check the location of "error".
5609 For some tests, the C++ parser is correct, and not yacc.c.
5610 For other tests, they provide different, but unsatisfying, values,
5611 so keep the C++ value so that at least one parser is "correct"
5612 according to the test suite.
5613 (Actions after errors): Remove, this is subsumed by the
5614 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
5615
5616 2004-09-06 Akim Demaille <akim@epita.fr>
5617
5618 * data/lalr1.cc: Adjust the indentation of the labels.
5619 (Parser::pop): New.
5620 Use it.
5621
5622 2004-09-06 Akim Demaille <akim@epita.fr>
5623
5624 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
5625 argument, an informative message.
5626 Call YY_SYMBOL_PRINT.
5627 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
5628 * data/lalr1.cc (destruct_): Likewise.
5629 In addition, no longer depend on b4_yysymprint_generate and
5630 b4_yydestruct_generate to generate these functions, do it "by
5631 hand".
5632
5633 2004-09-03 Akim Demaille <akim@epita.fr>
5634
5635 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
5636 invoked, yydestruct the lookahead.
5637 * tests/calc.at (Calculator $1): Update the expected lengths of
5638 traces: there is an added line for the discarded lookahead.
5639 * doc/bison.texinfo (Destructor Decl): Some rewording.
5640 Define "discarded" symbols.
5641
5642 2004-09-02 Akim Demaille <akim@epita.fr>
5643
5644 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5645
5646 2004-09-02 Akim Demaille <akim@epita.fr>
5647
5648 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
5649 (YYDSYMPRINTF): Rename as...
5650 (YY_SYMBOL_PRINT): this.
5651 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
5652 two.
5653 Use it instead of direct symprint_ calls.
5654 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5655 one.
5656
5657 2004-09-02 Akim Demaille <akim@epita.fr>
5658
5659 * data/lalr1.cc (b4_yysymprint_generate): New.
5660 (symprint_): New member function, defined when YYDEBUG.
5661 Use it consistently instead of token/nterm debugging output by
5662 hand.
5663 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5664 %printer calls to use cdebug_ when using lalr1.cc.
5665
5666 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5667
5668 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5669 with #ifdef YYDEBUG.
5670
5671 2004-08-26 Akim Demaille <akim@epita.fr>
5672
5673 * doc/bison.texinfo (Implementing Loops): Rename as...
5674 (Implementing Gotos/Loops): this.
5675
5676 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5677
5678 Adjust to latest gnulib.
5679 * bootstrap (gnulib_modules): Add xalloc-die.
5680 Set LC_ALL=C so that file names sort consistently.
5681 Prefer the gnulib copies of gettext.m4, glibc21.m4,
5682 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
5683 uintmax_t.m4, ulonglong.m4.
5684 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
5685 po.m4 since we are now using _gl.m4 instead.
5686
5687 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5688
5689 * src/scan-action.l: Remove. Scanning of semantic actions is
5690 handled in scan-gram.l.
5691
5692 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5693
5694 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5695
5696 * src/location.h (struct): The file member is a uniqstr.
5697 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5698
5699 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5700
5701 Fix bug with non-%union parsers that have printers or destructors,
5702 which led to a Bison core dump. Reported by Peter Fales in
5703 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
5704
5705 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
5706 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
5707 not to our own type.
5708 * src/output.c (symbol_destructors_output, symbol_printers_output):
5709 Don't assume %union.
5710 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
5711 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
5712 UNION-FLAG. All callers changed.
5713 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
5714 Use type char, not unsigned int, when declaring an array of char;
5715 this lets us remove a cast.
5716 (Printers and Destructors): Add non-%union test cases.
5717
5718 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5719
5720 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5721 GLR writeups. E.g., avoid frenchspacing and the future tense,
5722 change "lookahead" to "look-ahead", and change "wrt" to "with
5723 respect to".
5724
5725 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5726
5727 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5728 New sections, split off from the GLR Parsers section. Put the new
5729 Simple GLR Parser near the start of the GLR section, for clarity.
5730 Rewrite connective text.
5731
5732 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
5733
5734 * doc/bison.texinfo (Simple GLR Parsers): New section.
5735
5736 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5737
5738 * NEWS, TODO, doc/bison.texinfo:
5739 Use "look-ahead" instead of "lookahead", to be consistent.
5740 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5741 while we're fixing "look-ahead".
5742 * src/conflicts.c (shift_set): Renamed from shiftset.
5743 (look_ahead_set): Renamed from lookaheadset.
5744 * src/print.c: Likewise.
5745 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5746 name for "lookahead".
5747 (report_types, usage): Likewise.
5748 * src/getargs.h (report_look_ahead_tokens): Renamed from
5749 report_lookaheads.
5750 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5751 compute_lookaheads.
5752 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5753 (look_ahead_tokens_print): Renamed from lookaheads_print.
5754 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5755 state_rule_lookaheads_print.
5756 * src/state.h: Likewise.
5757 (reductions.look_ahead_tokens): Renamed from lookaheads.
5758 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5759 AT_DATA_LOOKAHEADS_GRAMMAR.
5760
5761 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5762
5763 * README: Update location of patched M4 distribution.
5764
5765 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5766
5767 Don't assume the C++ compiler takes the same arguments as the C compiler
5768 (trivial change).
5769 * configure.ac (O0CXXFLAGS): New var.
5770 * tests/atlocal.in (CXXFLAGS): Use it.
5771
5772 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5773
5774 Fix some "make check" problems with C++ reported by
5775 Albert Chin-A-Young for Tru64 C++ in this thread:
5776 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5777
5778 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5779 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5780 Output to a .cc file for C++, not to a .c file.
5781 * tests/calc.at (AT_CHECK_CALC): Likewise.
5782 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5783 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5784
5785 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5786
5787 * tests/calc.at, tests/actions.at: Workaround for SGI
5788 C++ compiler. (trivial change)
5789
5790 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5791
5792 Spent a few hours checking out which prerequisite versions the
5793 current sources actually require. I went all the way back to
5794 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5795 a seemingly endless set of combinations of versions more recent
5796 than that. The bottom line is that the current sources require
5797 fairly recent versions of the build tools, and it'll be some work
5798 to change this.
5799 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5800 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5801 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5802 Add comments explaining why those particular versions are
5803 currently needed.
5804
5805 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5806 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
5807 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
5808
5809 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5810 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5811
5812 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5813
5814 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5815 0.11.5. Suggested by Bruno Haible.
5816 * bootstrap: Remove gettext version checking.
5817
5818 * doc/bison.texinfo (Decl Summary): Also mention that %union
5819 can depend on prerequisite types. Problem reported by Tim
5820 Van Holder.
5821
5822 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5823
5824 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5825 * README-alpha: Don't tell people not to package this.
5826
5827 * bootstrap: Don't assume $(...) works; use `...` instead.
5828 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5829 gettext better.
5830
5831 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5832 put into the -d output file, and mention what to do if YYSTYPE is
5833 defined as a macro.
5834
5835 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5836
5837 Undo change made earlier today: it caused autopoint to not bring
5838 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5839 autopoint's.
5840
5841 * bootstrap: Check that gettext version matches what's in
5842 configure.ac. Warn users to ignore robots.txt ERROR 404.
5843 * bootstrap: Undo today's earlier change (logged below).
5844 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
5845
5846 The gettext version checking is causing more trouble than it's
5847 curing; remove it. Problem reported by Paul Hilfinger.
5848
5849 * bootstrap: Issue a warning that one can expect a message
5850 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5851 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5852
5853 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5854
5855 Ensure that the C++ compiler used for testing actually works on a
5856 simple test program; if not, skip the C++-related tests. Problem
5857 reported by Vin Shelton in:
5858 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
5859
5860 * m4/cxx.m4: New file.
5861 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5862 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5863 * tests/local.at (AT_COMPILE_CXX): Use it.
5864
5865 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5866
5867 * data/glr.c (yylloc): Output this macro even if locations are not
5868 being generated, as the GLR parser needs it even in that case.
5869 Problem reported by Troy A. Johnson
5870 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5871
5872 * configure.ac (AC_INIT): Update to 1.875e.
5873
5874 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5875
5876 * NEWS: Version 1.875d.
5877 * configure.ac (AC_INIT): Likewise.
5878 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5879
5880 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5881 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5882 lalr1.cc runs afoul of the first, and the last two are no longer
5883 supported by GCC 3.4.0.
5884 * README: Mention GNU m4 1.4 or later; mention m4 patches.
5885 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
5886
5887 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5888
5889 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
5890 unsigned int, for compatibility with latest gnulib hash module.
5891 * src/state.c (state_hash, state_hasher): Likewise.
5892 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
5893 * src/uniqstr.c (hash_uniqstr): Likewise.
5894
5895 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5896
5897 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5898
5899 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
5900 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
5901 character and string literals.
5902 (unexpected_end): New function.
5903 (unexpected_eof): Use it.
5904 (unexpected_newline): New function.
5905 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
5906 actions.
5907
5908 * NEWS: Document %expect-rr.
5909
5910 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
5911 Fix typo by replacing $1 with $option.
5912 Remove more 'intl'-related files.
5913 Don't DEFUN AM_INTL_SUBDIR twice.
5914
5915 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5916 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5917 strtoul.c.
5918 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
5919 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
5920 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
5921 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
5922 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
5923 * src/.cvsignore: Add *.output.
5924
5925 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5926 gets copied to the output file.
5927
5928 2004-04-28 Paul Eggert <eggert@twinsun.com>
5929
5930 Get files from the gnulib and po repositories, instead of relying
5931 on them being in our CVS. Upgrade to latest versions of gnulib
5932 and Automake.
5933
5934 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
5935 * bootstrap: Bootstrap from gnulib and po repositories.
5936 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
5937 * README-cvs: Document these changes. Remove version numbers from
5938 mentions of build tools, since they change so often. Mention Flex.
5939
5940 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
5941 (gl_USE_SYSTEM_EXTENSIONS): Add.
5942 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
5943 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
5944 does this for us.
5945 (AC_ISC_POSIX): Remove; we no longer support this
5946 ancient OS, as it gets in the way of latest Autoconf & gnulib.
5947 (AC_HEADER_STDC): Remove: we now assume C89 or better.
5948 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
5949 Do not check for C89 headers, except for locale.h which is used
5950 by the Yacc library and must port to K&R hosts.
5951 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
5952 Do not check for C89 functions, except for setlocale which is
5953 used by the Yacc library.
5954 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
5955 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
5956 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
5957 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5958 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5959 AM_GNU_GETTEXT): Remove; now done by:
5960 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5961 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5962 for us.
5963
5964 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5965 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5966 Define to empty, as gnulib.mk will do the rest for us.
5967 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5968 for us.
5969 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5970 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5971
5972 * src/files.c: Include gnulib's xstrndup.h.
5973
5974 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5975 (REALLOC): Use xnrealloc, for likewise.
5976 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5977 (strnlen, memrchr): Remove decls; functions no longer used.
5978 Include <stpcpy.h>.
5979
5980 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5981 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5982 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5983 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5984 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5985 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5986 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5987 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5988 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5989 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5990 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5991 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5992 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5993 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5994 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5995 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5996 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5997 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5998 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5999 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
6000 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
6001 Remove, as these files are now generated automatically
6002 by bootstrap or automake.
6003
6004 * po/ChangeLog: Remove: all but one entry was a duplicate
6005 of this file, and I moved that 2000-11-02 entry here.
6006
6007 * config/.cvsignore: Add Makefile, depcomp, install-sh.
6008 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
6009 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
6010 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
6011 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6012 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6013 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6014 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6015 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6016 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6017 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6018 xstrndup.h.
6019 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6020 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6021 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6022 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6023 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6024 * src/.cvsignore: Remove *_.c.
6025
6026
6027 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6028 support it. (The latest stable gzip doesn't.)
6029
6030 2004-04-27 Paul Eggert <eggert@twinsun.com>
6031
6032 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6033 case, as stos_ is now used by destructors due to the 2004-02-09
6034 change.
6035
6036 Remove more K&R C support.
6037 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6038 * lib/subpipe.c (errno): Remove decl.
6039 Include <stdlib.h> unconditionally.
6040 (EXIT_FAILURE): Remove macro.
6041 * src/complain.c (vfprintf, strerror): Remove.
6042 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6043 unconditionally.
6044 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6045 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6046 (strchr, strspn, memchr): Remove decls.
6047 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6048 unconditionally. Do not declare perror.
6049 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6050 unconditionally.
6051
6052 * src/complain.c (_): Remove useless defn, as system.h defines this.
6053
6054 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6055 with latest obstack.h.
6056 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6057 to procedure types, as obstack.h now does that for us.
6058 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6059
6060 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6061 so that this include file can stand alone.
6062 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6063 does this now. Include subpipe.h first after config.h, to
6064 test whether it can stand alone.
6065
6066 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6067 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6068 unused declaration.
6069
6070 * tests/synclines.at (%union synch line): Put a dummy member in
6071 the union, because empty unions aren't allowed in C. Caught
6072 by GCC 3.4.0.
6073
6074 2004-04-13 Jim Meyering <jim@meyering.net>
6075
6076 * src/conflicts.c (conflicts_print): Correct format string typo:
6077 use `%%' to produce literal `%'. (trivial change)
6078
6079 2004-03-30 Paul Eggert <eggert@twinsun.com>
6080
6081 * src/getargs.c (version): Update copyright year to 2004.
6082
6083 * data/c.m4 (b4_int_type): Use 'short int' rather than
6084 'short', and similarly for 'long', 'unsigned', etc.
6085 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6086 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6087 yy_yypstack, yydumpstack): Likewise.
6088 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6089 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6090 Likewise.
6091 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6092 yy_stack_print, yyparse): Likewise.
6093 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6094 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6095 * lib/bitset.c (bitset_print): Likewise.
6096 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6097 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6098 * lib/bitsetv.c (bitsetv_dump): Likewise.
6099 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6100 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6101 Likewise.
6102 * src/LR0.c (allocate_itemsets): Likewise.
6103 * src/gram.h (rule_number, rule): Likewise.
6104 * src/lalr.h (goto_number): Likewise.
6105 * src/nullable.c (nullable_compute): Likewise.
6106 * src/output.c (prepare_rules): Likewise.
6107 * src/relation.c (relation_print, relation_digraph): Likewise.
6108 * src/relation.h (relation_node): Likewise.
6109 * src/state.h (state_number, transitions, errs, reductions,
6110 struct state): Likewise.
6111 * src/symtab.h (symbol_number, struct symbol): Likewise.
6112 * src/tables.c (vector_number, tally, action_number,
6113 default_goto, goto_actions): Likewise.
6114 * tests/existing.at (GNU Cim Grammar): Likewise.
6115 * tests/regression.at (Web2c Actions): Likewise.
6116
6117 * src/output.c (muscle_insert_short_int_table): Renamed from
6118 muscle_insert_short_table. All uses changed.
6119
6120 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6121
6122 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6123 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6124 Add %expect-rr rule.
6125
6126 * src/scan-gram.l: Recognize %expect-rr.
6127
6128 * src/conflicts.h (expected_sr_conflicts): Rename from
6129 expected_conflicts.
6130 (expected_rr_conflicts): Declare.
6131
6132 * src/conflicts.c (expected_sr_conflicts): Rename from
6133 expected_conflicts.
6134 (expected_rr_conflicts): Define.
6135 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6136 for GLR parsers.
6137 Use expected_sr_conflicts in place of expected_conflicts.
6138 Warn if expected_rr_conflicts used in non-GLR parser.
6139
6140 * doc/bison.texinfo: Add documentation for %expect-rr.
6141
6142 2004-03-08 Paul Eggert <eggert@gnu.org>
6143
6144 Add support for hex token numbers. Suggested by Odd Arild Olsen in
6145 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
6146
6147 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6148 in lalr1.cc.
6149 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6150 * src/scan-gram.l (scan_integer): New function.
6151 ({int}): Use it.
6152 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6153 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6154 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6155 Say "long int", not "long", for uniformity with GNU style.
6156
6157 2004-02-25 Paul Eggert <eggert@twinsun.com>
6158
6159 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6160 compilers. This fixes a problem with Intel's C++ compiler being
6161 chatty, reported by Guido Trentalancia in
6162 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
6163
6164 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6165
6166 Support %destructor and merge error locations in lalr1.cc.
6167
6168 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6169 (Parser::stos_): Define unconditionally.
6170 (Parser::destruct_): New method. Generate its body with
6171 b4_yydestruct_generate.
6172 (Parser::error_start_): New attribute.
6173 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6174 token which are discarded.
6175 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6176 error_start_ when erroneous token are discarded.
6177 (Parser::parse) <yyerrlab1>: Compute the location of the error
6178 token so that it covers all the discarded tokens.
6179 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6180 it can be called with `%skeleton "lalr1.cc"', and do that.
6181
6182 2004-02-02 Paul Eggert <eggert@twinsun.com>
6183
6184 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6185 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6186 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6187 There's no need to mention top_builddir since Automake does that
6188 for us.
6189 (INCLUDES): Remove, as Automake says it's obsolescent.
6190 Contents migrated into AM_CPPFLAGS as described above.
6191 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6192
6193 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6194
6195 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6196 (yyreportSyntaxError): Handle case where lookahead token is
6197 YYEMPTY.
6198
6199 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6200
6201 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6202 resulting parsers are compilable with C++.
6203
6204 2003-12-23 Paul Eggert <eggert@twinsun.com>
6205
6206 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6207 * src/output.c (output_skeleton): Rename local var.
6208 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6209 Bison tokens, as this runs afoul of the 2003-10-07 change that
6210 disallowed NUL bytes in character constants or string literals.
6211
6212 * tests/local.at: Require Autoconf 2.59's Autotest.
6213 * tests/testsuite.at: Don't include local.at, since we now assume
6214 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6215 including it.
6216 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6217 multiple inclusion warnings.
6218
6219 2003-12-02 Akim Demaille <akim@epita.fr>
6220
6221 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6222 conditions.
6223 From Bruno Haible.
6224
6225 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6226
6227 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6228
6229 2003-10-07 Paul Eggert <eggert@twinsun.com>
6230
6231 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6232 if testsuite doesn't exist.
6233
6234 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6235 literals, unfortunately.
6236 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6237 Complain about NUL bytes in character constants or string literals.
6238
6239 2003-10-05 Paul Eggert <eggert@twinsun.com>
6240
6241 * NEWS: Don't document %no-default-prec, as it's still
6242 too experimental.
6243 * doc/bison.texinfo: Document %no-default-prec only if
6244 the defaultprec flag is set. Normally it's not.
6245
6246 2003-10-04 Paul Eggert <eggert@twinsun.com>
6247
6248 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6249 non-modifiable lvalue, instead of a modifiable one.
6250 * doc/bison.texinfo (Actions): Document that $$ can
6251 be assigned to. Do not claim that $$ and $N are
6252 array element references: user code should not rely on this.
6253
6254 2003-10-01 Paul Eggert <eggert@twinsun.com>
6255
6256 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6257 (grammar_declaration): Use it.
6258 * src/scan-gram.l: New token %no-default-prec.
6259 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6260 * NEWS, doc/bison.texinfo: Document the above.
6261
6262 2003-10-01 Akim Demaille <akim@epita.fr>
6263
6264 VCG no longer supports long_straight_phase.
6265
6266 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6267 * src/print_graph.c (print_graph): Adjust.
6268
6269 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
6270 and Paul Eggert <eggert@twinsun.com>
6271
6272 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6273 Table of Symbols): Document %default-prec.
6274 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6275 (grammar_declaration): Set default_prec on %default-prec.
6276 * src/scan-gram.l (%default-prec): New token.
6277 * src/reader.h (default_prec): New flag.
6278 * src/reader.c: Likewise.
6279 (packgram): Handle it.
6280 * tests/conflicts.at (%default-prec without %prec,
6281 %default-prec with %prec, %default-prec 1): New tests.
6282
6283 2003-09-30 Paul Eggert <eggert@twinsun.com>
6284
6285 * tests/testsuite.at: Include local.at, not input.at, fixing
6286 a typo in the 2003-08-25 patch.
6287
6288 2003-08-27 Akim Demaille <akim@epita.fr>
6289
6290 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6291 GCC warnings.
6292
6293 2003-08-26 Akim Demaille <akim@epita.fr>
6294
6295 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6296 "<\#" to avoid magic from Gnus when posting parts of this script.
6297
6298 2003-08-26 Akim Demaille <akim@epita.fr>
6299
6300 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6301 (Parser::parse): here.
6302 Adjust: nerrs and errstatus is now replaced by...
6303 (Parser::nerrs_, Parser::errstatus_): New.
6304
6305 2003-08-25 Akim Demaille <akim@epita.fr>
6306
6307 * config/announce-gen, Makefile.cfg: New.
6308 * Makefile.am: Adjust.
6309 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6310 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6311
6312 2003-08-25 Akim Demaille <akim@epita.fr>
6313
6314 When reducing initial empty rules, Bison parser read an initial
6315 location that is not defined. This results in garbage, and that
6316 affects Bison's own parser. Therefore we need (i) to extend Bison
6317 to support a means to initialize this location, and (ii) to use
6318 this CVS Bison to fix CVS Bison's parser.
6319
6320 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6321 with...
6322 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6323 * src/parse-gram.y: Adjust.
6324 (%initial-action): New.
6325 (%error-verbose): Since we require CVS Bison, there is no reason
6326 not to use it.
6327 * src/scan-gram.l: Adjust.
6328 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6329 * data/yacc.c (yyparse): Use b4_initial_action.
6330
6331 2003-08-25 Akim Demaille <akim@epita.fr>
6332
6333 * doc/bison.texinfo: Don't promote stdout for error messages.
6334
6335 2003-08-25 Akim Demaille <akim@epita.fr>
6336
6337 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6338 From Alexandre Duret-Lutz.
6339
6340 2003-08-25 Akim Demaille <akim@epita.fr>
6341
6342 Version 1.875c.
6343
6344 2003-08-25 Akim Demaille <akim@epita.fr>
6345
6346 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6347 Use them.
6348
6349 2003-08-25 Akim Demaille <akim@epita.fr>
6350
6351 * data/lalr1.cc (Parser::reduce_print_): New.
6352 Use it.
6353
6354 2003-08-25 Akim Demaille <akim@epita.fr>
6355
6356 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6357 error recovery loops. This patch is based on
6358 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
6359 Also, augment the similarity between lalr1.cc and yacc.c.
6360 Note: the locations of error recovery rules are not correct yet.
6361
6362 * data/lalr1.cc: Comment changes to augment the similarity between
6363 lalr1.cc and yacc.c.
6364 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6365 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6366 yyerrlab), when hitting EOF, pop the whole stack here instead of
6367 merely falling thru the default error handling mechanism.
6368 (yyerrorlab): New label, with the old contents of YYERROR,
6369 plus the following change: pop the stack of rhs corresponding
6370 to the production that invoked YYERROR. That is how Yacc
6371 behaves (required by POSIX).
6372 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6373 fail.
6374
6375 2003-08-25 Akim Demaille <akim@epita.fr>
6376
6377 Tune local.at so that people can "autom4te -l autotest calc.at -o
6378 calc" for instance, to extract a sub test suite.
6379
6380 * tests/testsuite.at: Move the initialization, Autotest version
6381 requirement, and AT_TESTED invocation into...
6382 * tests/local.at: here.
6383 * tests/testsuite.at: Include it for compatibility with Autoconf
6384 2.57.
6385 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6386 be ignore.
6387
6388 2003-08-04 Paul Eggert <eggert@twinsun.com>
6389
6390 Rework code slightly to avoid gcc -Wtraditional warnings.
6391 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6392 The returned value is now stored in *YY0. All callers changed.
6393 * src/output.c (merge_output): Adjust to the above change.
6394
6395 2003-07-26 Paul Eggert <eggert@twinsun.com>
6396
6397 * data/glr.c (YYASSERT): New macro.
6398 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6399 yyresolveStates, yyprocessOneStack):
6400 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6401 Derived from a suggestion by Frank Heckenbach.
6402
6403 2003-07-25 Paul Eggert <eggert@twinsun.com>
6404
6405 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6406 for portability to K&R C (after ansi2knr, presumably). See
6407 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
6408 by Frank Heckenbach, though I have omitted the structure-initialization
6409 part of his glr-knr.diff patch since I recall that the Portable
6410 C Compiler didn't require that change.
6411
6412 Let the user specify how to allocate and free memory.
6413 Derived from a suggestion by Frank Heckenbach in
6414 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
6415 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6416 All uses of free, malloc, realloc changed to use these macros,
6417 and unnecessary casts removed.
6418 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6419
6420 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6421
6422 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6423 use s.empty() rather than s == "" to test for empty string; see
6424 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
6425 (trivial change)
6426
6427 2003-06-25 Akim Demaille <akim@epita.fr>
6428
6429 * config/depcomp, config/install-sh: Update from masters.
6430
6431 2003-06-20 Paul Eggert <eggert@twinsun.com>
6432
6433 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6434 and return properly parenthesized result.
6435 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6436 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6437 Remove unnecessary parentheses from uses.
6438 * doc/bison.texinfo (Location Default Action): Describe the
6439 conventions for parentheses.
6440
6441 2003-06-19 Paul Eggert <eggert@twinsun.com>
6442
6443 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6444 yyreportTree): Do not assume that size_t is the same width as int,
6445 when printing sizes. Print sizes using an unsigned format.
6446 Problem reported by Frank Heckenbach in
6447 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
6448
6449 Port to Forte Developer 7 C compiler.
6450 * data/glr.c (struct YYLTYPE): If locations are not being used,
6451 declare a single dummy member, as empty structs do not conform
6452 to the C standard.
6453 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6454 the Forte Developer 7 C compiler complains that end-of-loop
6455 code is not reached.
6456
6457 2003-06-17 Paul Eggert <eggert@twinsun.com>
6458
6459 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6460 avoid warnings from picky compilers about redefinition of PARAMS.
6461
6462 2003-06-17 Paul Eggert <eggert@twinsun.com>
6463
6464 Version 1.875b.
6465
6466 * NEWS: Document 1.875b.
6467
6468 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6469 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6470 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6471 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6472 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6473 per recent gettext manual's suggestion.
6474 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6475 Use prototypes, not old-style definitions.
6476 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6477 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6478 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6479 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6480 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6481 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6482 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6483 vbitset_or_and_cmp, vbitset_copy): Likewise.
6484
6485 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6486 Do not include <stdlib.h>.
6487 (PARAMS): Define unconditionally for C89.
6488 (ATTRIBUTE_NORETURN): Remove.
6489 (ATTRIBUTE_UNUSED): Define unconditionally.
6490
6491 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
6492 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
6493 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6494 * lib/vbitset.c, lib/vbitset.h: New files.
6495 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6496 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6497 from libbitset.
6498
6499 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6500 `How Can I Reset @code{yyparse}', since texinfo does not allow
6501 arbitrary @ in node names.
6502
6503 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6504 shouldn't be needed according to the gettext 0.12.1 documentation
6505 but which seem to be needed anyway: codeset.m4 glibc21.m4
6506 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
6507 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
6508 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
6509
6510 * lib/.cvsignore: Add stdbool.h.
6511 * m4/.cvsignore: Add nls.m4, po.m4.
6512
6513 Upgrade to CVS gnulib.
6514 * stdbool_.h: File renamed from stdbool.h.in.
6515 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6516 AC_HEADER_STDBOOL.
6517 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6518 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6519 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6520 (MOSTLYCLEANFILES): New var.
6521 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6522 (stdbool.h): New rule.
6523 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6524 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6525 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6526 m4/quote.m4: Upgrade to today's gnulib.
6527
6528 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6529 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6530 the tests right now.
6531 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6532 yyerror are declared before use; C99 requires this.
6533
6534 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6535
6536 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6537 first.
6538 (yyrecoverSyntaxError): Correct the logic for setting and testing
6539 yyerrState.
6540 Correct comment on handling EOF.
6541 Allow states with only a default reduction, rather than failing
6542 (I can't quite reconstruct why these were not allowed before).
6543
6544 Fixes to avoid problem that $-N rules in GLR parsers can cause
6545 buffer overruns, corrupting state.
6546
6547 * src/output.c (prepare_rules): Output max_left_semantic_context
6548 definition.
6549 * src/reader.h (max_left_semantic_context): New variable declaration.
6550 * src/scan-gram.l (max_left_semantic_context): Define.
6551 (handle_action_dollar): Update max_left_semantic_context.
6552 * data/glr.c (YYMAXLEFT): New definition.
6553 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6554 (yyresolveAction): Ditto.
6555
6556 Fixes to problems with location handling in GLR parsers reported by
6557 Frank Heckenbach (2003/06/05).
6558
6559 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6560 (YYRHSLOC): Add parentheses, and define only if locations used.
6561 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6562 locations not used.
6563 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6564 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
6565
6566 * tests/cxx-type.at: Exercise location information; update tests
6567 to differentiate output with and without locations.
6568 Remove forward declarations of yylex and yyerror---caused errors
6569 because default YYLTYPE not yet defined.
6570 Change semantic actions to compute strings, rather than printing
6571 them directly (to test proper passing of semantics values). Change
6572 output to prefix notation and update test data and expected results.
6573 (yylex): Track locations.
6574 (stmtMerge): Return value rather than printing, and include arguments
6575 in value.
6576
6577 2003-06-03 Paul Eggert <eggert@twinsun.com>
6578
6579 Avoid warnings generated by GCC 2.95.4 when Bison is
6580 configured with --enable-gcc-warnings.
6581 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6582 yy::]b4_parser_class_name[::translate_,
6583 yy::Stack::operator[] (unsigned),
6584 yy::Stack::operator[] (unsigned) const,
6585 yy::Slice::operator[] (unsigned),
6586 yy::Slice::operator[] (unsigned) const):
6587 Rename local vars to avoid warnings.
6588 * tests/glr-regression.at (Improper handling of embedded actions
6589 and $-N in GLR parsers): Remove unused local variable from yylex.
6590 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6591 (void) as arg when not pure, since we now assume C89 when building
6592 Bison. Pacify GCC by using parameter.
6593
6594 2003-06-02 Paul Eggert <eggert@twinsun.com>
6595
6596 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
6597 yy::Location::lines, yy::Location::columns): Rename arguments
6598 to avoid shadowing; this removes a warning generated by GCC 3.3.
6599
6600 2003-06-01 Paul Eggert <eggert@twinsun.com>
6601
6602 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
6603 to g++, as GCC 3.3 complains if you do it.
6604 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
6605 everything that WARNING_CFLAGS has, except omit warnings
6606 not suitable for C++.
6607 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
6608 * tests/atlocal.in (CXXFLAGS): New var.
6609 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
6610
6611 Fix a GLR parser bug I reported in February; see
6612 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
6613 The problem was that GLR parsers did not conform to the C standard,
6614 because actions like { $1 = $2 + $3; } expanded to expressions
6615 that invoked YYFILL in separate subexpressions, and YYFILL assigned
6616 to a local variable. The C standard says that expressions
6617 like (var = f ()) + (var = f ()) have undefined behavior.
6618 Another problem was that GCC sometimes issues warnings that
6619 yyfill and its parameters are unused.
6620
6621 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6622 as possibly unused.
6623 (yyfill): New function.
6624 (YYFILL): Use it.
6625 (yyuserAction): Change type of yynormal to bool, so that it matches
6626 the new yyfill signature. Mark it as possibly unused.
6627
6628
6629 Follow up on a bug I reported in February, where a Bison-generated
6630 parser can loop. Provide a test case and a fix for yacc.c. I
6631 don't have a fix for lalr1.cc or for glr.c, unfortunately.
6632 The original bug report is in:
6633 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
6634
6635 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
6636 macro's size was becoming unwieldy.
6637 (yyerrlab): Do not discard an empty lookahead symbol, as this
6638 might destroy garbage.
6639 (yyerrorlab): New label, with the old contents of YYERROR,
6640 plus the following change: pop the stack of rhs corresponding
6641 to the production that invoked YYERROR. That is how Yacc
6642 behaves, and POSIX requires this behavior.
6643 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
6644 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
6645 Define 'alarm' to do nothing if unistd.h is not available.
6646 Add a new rule "exp: '-' error;" to test the above change to
6647 data/yacc.c. Use 'alarm' to abort any test taking longer than
6648 10 seconds, as it's probably looping.
6649 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
6650 Also, the new yacc.c generates two fewer diagnostics for an
6651 existing test.
6652
6653 2003-05-24 Paul Eggert <eggert@twinsun.com>
6654
6655 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
6656 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
6657 This fixes a problem reported by John Bowman when the Compaq/HP
6658 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
6659 -ansi -Wall -gall).
6660 * data/yacc.c (union yyalloc): Likewise.
6661 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
6662
6663 Switch from 'int' to 'bool' where that makes sense.
6664
6665 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
6666 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
6667 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
6668 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
6669 Return or accept bool, not int. All callers changed.
6670 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
6671 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
6672 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
6673 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
6674 bitset_or_and_cmp_): Likewise.
6675 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
6676 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
6677 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
6678 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
6679 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
6680 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
6681 bitset_stats_or_and_cmp): Likewise.
6682 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
6683 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
6684 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
6685 ebitset_xor_cmp): Likewise.
6686 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
6687 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
6688 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
6689 lbitset_xor_cmp): Likewise.
6690 * lib/bbitset.h: Include <stdbool.h>.
6691 (struct bitset_vtable): The following members now return bool, not
6692 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
6693 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
6694 or_and_cmp).
6695 * src/conflicts.c (count_rr_conflicts): Likewise.
6696 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6697 All uses changed.
6698 * lib/ebitset.c (ebitset_obstack_init): Likewise.
6699 * lib/lbitset.c (lbitset_obstack_init): Likewise.
6700 * src/getargs.c (debug_flag, defines_flag, locations_flag,
6701 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6702 graph_flag): Likewise.
6703 * src/getargs.h (debug_flag, defines_flag, locations_flag,
6704 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6705 graph_flag): Likewise.
6706 * src/output.c (error_verbose): Likewise.
6707 * src/output.h (error_verbose): Likewise.
6708 * src/reader.c (start_flag, typed): Likewise.
6709 * src/reader.h (typed): Likewise.
6710 * src/getargs.c (LOCATIONS_OPTION): New constant.
6711 (long_options, getargs): Use it.
6712 * src/lalr.c (build_relations): Use bool, not int.
6713 * src/nullable.c (nullable_compute): Likewise.
6714 * src/print.c (print_reductions): Likewise.
6715 * src/tables.c (action_row, pack_vector): Likewise.
6716 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6717 * src/output.c (prepare): Use it.
6718 * src/output.c (token_definitions_output,
6719 symbol_destructors_output, symbol_destructors_output): Use string,
6720 not boolean integer, to keep track of whether to output separator.
6721 * src/print_graph.c (print_core): Likewise.
6722 * src/state.c (state_rule_lookaheads_print): Likewise.
6723
6724 * config/install-sh: Sync from automake 1.7.5.
6725
6726 2003-05-14 Paul Eggert <eggert@twinsun.com>
6727
6728 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6729 semicolon after a grammar declaration, in the interest of possible
6730 future changes to the Bison input language.
6731 Do not allow a stray semicolon at the start of the grammar.
6732 (rhses.1): Allow one or more semicolons after any rule, including
6733 just before "|" as required by POSIX.
6734 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6735 grammar.
6736
6737 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6738
6739 %parse-param support for lalr1.cc.
6740
6741 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6742 b4_cc_constructor_calls, b4_cc_constructor_call,
6743 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6744 definitions.
6745 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6746 parse-param arguments.
6747 (yy::b4_parser_class_name): Declare instance variables to
6748 hold parse-param arguments.
6749 * tests/calc.at: s/value/semantic_value/ because value clashes
6750 with a member of yy::b4_parser_class_name. Adjust C++ code
6751 to handle %parse-param. Enable %parse-param test in C++.
6752
6753 2003-05-12 Paul Eggert <eggert@twinsun.com>
6754
6755 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6756 English a bit. Fix fclose typo. Change "const char" to "char
6757 const", and use ANSI C rather than K&R for "main". Suggest
6758 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6759 and suggest yy_switch_to_buffer.
6760
6761 2003-05-05 Paul Eggert <eggert@twinsun.com>
6762
6763 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6764 C89. This avoids a diagnostic on compilers that define __STDC__
6765 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
6766 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
6767
6768 2003-05-03 Paul Eggert <eggert@twinsun.com>
6769
6770 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6771 Do not overrun array bounds.
6772 This should fix a bug reported today by Olatunji Oluwabukunmi in
6773 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
6774
6775 2003-04-29 Akim Demaille <akim@epita.fr>
6776
6777 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6778 * src/getargs.c, src/getargs.h: here, as bool, not int.
6779 (nondeterministic_parser): New.
6780 * src/parse-gram.y, src/scan-gram.l: Support
6781 %nondeterministic-parser.
6782 * src/output.c (prepare): Use nondeterministic_parser instead
6783 of glr_parser where appropriate.
6784 * src/tables.c (conflict_row, action_row, save_row)
6785 (token_actions, token_actions, pack_vector): Ditto.
6786
6787 2003-04-29 Akim Demaille <akim@epita.fr>
6788
6789 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6790
6791 2003-04-29 Akim Demaille <akim@epita.fr>
6792
6793 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6794 with %pure-parser and %locations to exercise the patch from Yakov
6795 Markovitch below.
6796
6797 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6798
6799 * data/yacc.c: (b4_lex_param): Corrected for the case where
6800 %lex-param is provided and %pure-parser isn't.
6801
6802 2003-04-27 Paul Eggert <eggert@twinsun.com>
6803
6804 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
6805 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
6806 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6807 if it is not defined.
6808 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6809
6810 2003-04-26 Paul Eggert <eggert@twinsun.com>
6811
6812 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6813 Declare to be of type suitable for the ninf value itself, not of
6814 type suitable for the corresponding table, since the latter might
6815 be unsigned but the ninf value might be negative. This fixes a
6816 bug reported by Alexandre Duret-Lutz in
6817 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
6818
6819 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6820 invokes it. We shouldn't invoke it twice because it will attempt
6821 to put error.o in the archive twice. This fixes a glitch reported
6822 by Martin Mokrejs in
6823 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
6824
6825 2003-04-21 Paul Eggert <eggert@twinsun.com>
6826
6827 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6828 to gnulib.
6829
6830 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6831
6832 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6833 Fix obvious typo that results in uncompilable GLR parsers
6834 when both %pure-parser and %locations are used. (trivial change)
6835
6836 2003-04-17 Paul Eggert <eggert@twinsun.com>
6837
6838 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6839 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6840 Do not insert the expected token via unput, as this runs afoul
6841 of a POSIX-compatibility bug in flex 2.5.31.
6842 All uses changed to BEGIN the parent state,
6843 since we no longer insert the expected token via unput.
6844 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6845 that is no longer emitted after the above change.
6846
6847 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6848 the first one. This change is from Paul Hilfinger, and it fixes
6849 regression reported by Werner Lemberg in
6850 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
6851
6852 (resolve_sr_conflict): Don't invoke state_errs_set
6853 unless one or more tokens have been explicitly made errors.
6854 Otherwise, the above change causes Bison to abort.
6855
6856 * tests/existing.at (GNU pic Grammar): New test case, taken from
6857 Lemberg's email.
6858
6859 2003-03-31 Akim Demaille <akim@epita.fr>
6860
6861 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6862
6863 2003-03-31 Akim Demaille <akim@epita.fr>
6864
6865 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6866 output.
6867
6868 2003-03-31 Akim Demaille <akim@epita.fr>
6869
6870 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6871 From Paul Hilfinger.
6872
6873 2003-03-29 Akim Demaille <akim@epita.fr>
6874
6875 * m4/error.m4: Do not put under dynamic conditions some code which
6876 expansion is under static control.
6877
6878 2003-03-29 Akim Demaille <akim@epita.fr>
6879
6880 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6881
6882 2003-03-29 Akim Demaille <akim@epita.fr>
6883
6884 * doc/bison.texinfo (Strings are Destroyed): New.
6885
6886 2003-03-13 Paul Eggert <eggert@twinsun.com>
6887
6888 * .cvsignore: Add configure.lineno.
6889 * src/.cvsignore: Add yacc.
6890 * tests/.cvsignore: Add testsuite.log.
6891 * doc/fdl.texi: Sync with latest FSF version.
6892
6893 2003-03-12 Paul Eggert <eggert@twinsun.com>
6894
6895 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
6896 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
6897 cursor, instead of leaving it undefined. This fixes a bug
6898 reported by Tim Van Holder in
6899 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
6900 * tests/input.at (Torturing the Scanner): Test the scanner on
6901 an empty input file, which was Tim Van Holder's test case.
6902
6903 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
6904 <sys/resource.h> can be included, include sys/time.h and
6905 sys/times.h first, if available. This works around the SunOS
6906 4.1.4 porting bug reported by Bruce Becker in
6907 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
6908
6909 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6910 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6911 AC_HEADER_SYS_WAIT.
6912
6913 Merge changes from gnulib. This was prompted because the CVS
6914 snapshot didn't build on Solaris 7 due to strnlen problems.
6915
6916 These changes need to be merged back into gnulib:
6917 * lib/hash.c: Include <stdbool.h> unconditionally.
6918 * m4/onceonly.m4 (m4_quote): New macro.
6919 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
6920 Quote AC_FOREACH variable-expansions properly.
6921 The 2003-01-03 obstack.h change also needs merging.
6922 {end of changes requiring merging}
6923
6924 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6925 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
6926 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
6927 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
6928 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
6929 New files, imported from gnulib.
6930 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
6931 above.
6932
6933 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
6934 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
6935 gnulib sources.
6936
6937 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6938 Add.
6939 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
6940 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
6941 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
6942 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
6943 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
6944 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
6945 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
6946 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
6947 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
6948 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
6949 (jm_PREREQ_ARGMATCH): Remove.
6950 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
6951 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
6952
6953 * src/system.h: Include <stdbool.h> unconditionally.
6954
6955 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6956 assuming at least C89 in the bitset code for some time now.
6957
6958 2003-03-03 Akim Demaille <akim@epita.fr>
6959
6960 * ro.po: New.
6961
6962 2003-03-02 Akim Demaille <akim@epita.fr>
6963
6964 * doc/bison.texinfo (Table of Symbols): Reactivate the
6965 documentation for %lex-param, and %parse-param.
6966
6967 2003-03-02 Akim Demaille <akim@epita.fr>
6968
6969 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6970 generate verbose error messages.
6971 Use the number of tokens as an upper bound in yytname, as it
6972 cannot be a non terminal.
6973
6974 2003-03-02 Akim Demaille <akim@epita.fr>
6975
6976 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6977 message.
6978
6979 2003-03-02 Akim Demaille <akim@epita.fr>
6980
6981 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6982 Use them to exercise yycheck overrun.
6983 Based on Andrew Suffield's grammar.
6984
6985 2003-03-02 Akim Demaille <akim@epita.fr>
6986
6987 Create tests/local.at for Bison generic testing macros.
6988
6989 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6990 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6991 This new file.
6992 * tests/calc.at (AT_CHECK_CALC): Adjust.
6993 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6994 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6995 * tests/local.at: here.
6996 (AT_COMPILE_CXX): Tags the tests using it as c++.
6997 Ignore the test if CXX is not functional.
6998
6999 2003-03-01 Paul Eggert <eggert@twinsun.com>
7000
7001 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
7002 not loc->end, since loc->end might contain garbage and this leads
7003 to undefined behavior on some platforms.
7004 (id_loc, token_start): Use (IF_LINTed) initial values that do not
7005 depend on *loc, so that the reader doesn't give the the false
7006 impression that *loc is initialized.
7007 (<INITIAL>"%%"): Do not bother setting code_start, since its value
7008 does not survive the return.
7009
7010 2003-03-01 Akim Demaille <akim@epita.fr>
7011
7012 * src/scan-gram.l (code_start): Always initialize it when entering
7013 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7014 yylex invocation. An alternative would be making it static, but
7015 then it starts with the second %%'s beginning, instead of its end.
7016
7017 2003-02-28 Paul Eggert <eggert@twinsun.com>
7018
7019 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7020 around a UnixWare 7.1.1 porting bug reported by John Hughes in
7021 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
7022
7023 2003-02-26 Paul Eggert <eggert@twinsun.com>
7024
7025 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7026 Remove Sequent/Pyramid discussion (nobody uses them any more).
7027 Merge VMS and MS-DOS discussion; these ports may well be dead
7028 but let's keep mentioning them for now. Put <> around email
7029 addresses. Add copyright notice.
7030
7031 2003-02-24 Paul Eggert <eggert@twinsun.com>
7032
7033 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7034 to avoid collision with flex use of yylineno.
7035 Problem reported by Bruce Lilly in
7036 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
7037 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7038 * data/yacc.c (yy_reduce_print): Likewise.
7039
7040 * config/depcomp: Sync with Automake 1.7.3.
7041
7042 2003-02-21 Akim Demaille <akim@epita.fr>
7043
7044 * data/lalr1.cc: Use temporary variables instead of casts to
7045 change integer types.
7046 Suggested by Paul Eggert.
7047
7048 2003-02-21 Akim Demaille <akim@epita.fr>
7049
7050 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7051 to avoid confusions with lalr1.cc's notion of Position.
7052 Suggested by Paul Eggert.
7053
7054 2003-02-20 Akim Demaille <akim@epita.fr>
7055
7056 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7057 before initial_columns.
7058 (location.hh): Use consistent variable names when defining the
7059 operator<<.
7060 Use "last" so that we subtract from Positions, not from unsigned.
7061
7062 2003-02-20 Akim Demaille <akim@epita.fr>
7063
7064 * data/lalr1.cc (position.hh): New subfile, including the extended
7065 and Doxygen'ed documentation of class Position.
7066 (location.hh): Use it.
7067 Document a` la Doxygen.
7068 With the help of Benoit Perrot.
7069
7070 2003-02-20 Akim Demaille <akim@epita.fr>
7071
7072 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7073 AT_YACC_IF.
7074 Redefine AT_YYERROR_SEES_LOC_IF using it.
7075 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7076 not defined.
7077 Don't use the location in yy::Parser::error_ and
7078 yy::Parser::print_ when not %locations.
7079 Activate more lalr1.cc tests.
7080
7081 2003-02-19 Akim Demaille <akim@epita.fr>
7082
7083 * data/lalr1.cc: When displaying a line number, be sure to make it
7084 an int.
7085
7086 2003-02-19 Akim Demaille <akim@epita.fr>
7087
7088 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7089 Remove, useless.
7090 (YYABORT, YYACCEPT, YYERROR): New.
7091 * tests/calc.at: Renable the lalr1.cc test.
7092
7093 2003-02-19 Akim Demaille <akim@epita.fr>
7094
7095 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7096 error recovery, mixing with/without pops and discarding of the
7097 lookahead.
7098 Exercise YYERROR.
7099 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7100
7101 2003-02-17 Paul Eggert <eggert@twinsun.com>
7102
7103 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7104 * tests/testsuite.at (AT_COMPILE): Use them.
7105 This fixes the testsuite problem reported by Robert Lentz in
7106 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
7107
7108 2003-02-12 Paul Eggert <eggert@twinsun.com>
7109
7110 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7111 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
7112 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
7113 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7114 Check for malloc failure, for consistency with yacc.c.
7115 (yytname_size): Remove, for consistency with yacc.c.
7116
7117 The bug still remains in data/lalr1.cc, as I didn't have time
7118 to fix it there.
7119
7120 2003-02-06 Akim Demaille <akim@epita.fr>
7121
7122 * configure.ac (GXX): Rename as...
7123 (CXX): this, to keep the original Autoconf semantics.
7124 Require 2.57.
7125 * data/lalr1.cc: Fix b4_copyright invocations.
7126 If YYDEBUG is not defined, don't depend upon name_ being defined.
7127 (location.hh): Include string and iostream.
7128 (Position::filename): New member.
7129 (Position::Position ()): New.
7130 (operator<< (Position)): New.
7131 (operator- (Position, int)): New.
7132 (Location::first, Location::last): Rename as...
7133 (Location::begin, Location::end): these, to mock the conventional
7134 iterator names.
7135 (operator<< (Location)): New.
7136 * tests/atlocal.in (CXX): New.
7137 * tests/testsuite.at (AT_COMPILE_CXX): New.
7138 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7139 locations in a more synthetic way.
7140 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7141 lalr1.cc is used.
7142 Adjust the C locations to match those from Emacs: first column is
7143 column 0.
7144 Change all the expected results.
7145 Conform to the GCS: simplify the locations when applicable.
7146 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7147 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7148 these CPP macros with the m4 macros new defined by...
7149 (AT_CHECK_PUSHDEFS): this, i.e.:
7150 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
7151 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7152 New macros.
7153 (AT_CHECK_POPDEFS): Undefine them.
7154 (AT_CHECK_CALC_LALR1_CC): New.
7155 Use it for the first lalr1.cc test.
7156
7157 2003-02-04 Akim Demaille <akim@epita.fr>
7158
7159 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7160 Location as is defined.
7161
7162 2003-02-04 Akim Demaille <akim@epita.fr>
7163
7164 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7165 name_ being defined.
7166
7167 2003-02-03 Paul Eggert <eggert@twinsun.com>
7168
7169 * src/gram.h (start_symbol): Remove unused decl.
7170
7171 Use more-consistent naming conventions for local vars.
7172
7173 * src/derives.c (derives_compute): Change type of local var from
7174 int to rule_number.
7175 * src/gram.c (grammar_rules_partial_print): Likewise.
7176 * src/print.c (print_core): Likewise.
7177 * src/reduce.c (reduce_grammar_tables): Likewise.
7178
7179 * src/gram.c (grammar_dump): Change name of item_number *
7180 local var from r to rp.
7181 * src/nullable.c (nullable_compute): Likewise.
7182
7183 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7184
7185 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7186 for symbol or symbol_number var.
7187 * src/reader.c (grammar_start_symbol_set): Likewise.
7188 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7189 Likewise.
7190 * src/state.c (transitions_to): Likewise.
7191 * src/state.h: Likewise.
7192 * src/tables.c (symbol_number_to_vector_number): Likewise.
7193
7194 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7195 char * var.
7196
7197 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7198 var.
7199
7200 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7201 var.
7202
7203 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7204 Use str, not s, for char * var. Use ch, not c, for character var.
7205 Use size for size var.
7206
7207 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7208 char * var.
7209 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7210 uniqstr var.
7211 * src/uniqstr.h: Likewise.
7212
7213 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7214 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7215 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7216 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7217 param to have same name as that of enum, so that we don't use
7218 "s" to stand for a non-state.
7219
7220 2003-02-02 Akim Demaille <akim@epita.fr>
7221
7222 * src/scan-skel.l: Scan more than one inert character per yylex
7223 invocation.
7224
7225 2003-02-01 Paul Eggert <eggert@twinsun.com>
7226
7227 Version 1.875a.
7228
7229 * po/LINGUAS: Add ms.
7230
7231 2003-01-30 Akim Demaille <akim@epita.fr>
7232
7233 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7234
7235 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7236
7237 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7238 of $1.
7239
7240 Changes in response to error report by S. Eken: GLR mode does not
7241 handle negative $ indices or $ indices in embedded rules correctly.
7242 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
7243
7244 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7245 (b4_rhs_location): Ditto.
7246 (yyfill): New function to copy from stack tree into array
7247 incrementally.
7248 (yyuserAction): Modify to allow incremental move of semantic values
7249 to rhs array when in GLR mode.
7250 Define YYFILL to use in user-defined actions to fill semantic array
7251 as needed.
7252 Remove dummy use of yystack, as there is now a guaranteed use.
7253 (yydoAction): Modify to allow incremental move of semantic values
7254 to rhs array when in GLR mode.
7255 (yyresolveAction): Ditto.
7256 (yyglrShiftDefer): Update comment.
7257 (yyresolveStates): Use X == NULL for pointers, not !X.
7258 (yyglrReduce): Ditto.
7259 (yydoAction): Ditto
7260
7261 * tests/glr-regr1.at: Rename to ...
7262 * tests/glr-regression.at: Add new regression test for the problems
7263 described above (adapted from S. Eken).
7264 Update copyright notice.
7265 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7266 * tests/Makefile.am: Ditto.
7267
7268 2003-01-28 Paul Eggert <eggert@twinsun.com>
7269
7270 * data/lalr1.cc: Do not use @output_header_name@ unless
7271 b4_defines_flag is set. This fixes two bugs reported by
7272 Tim Van Holder in
7273 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7274 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
7275
7276 2003-01-21 Paul Eggert <eggert@twinsun.com>
7277
7278 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7279 we don't need to worry about yyerrlab1 being reported as an
7280 "unused label" by non-GCC C compilers. The downside is that if
7281 locations are used then a couple of statements are duplicated each
7282 time YYERROR is invoked, but the upside is that the warnings
7283 should vanish.
7284 (yyerrlab1): Move code to YERROR.
7285 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7286 This reverts some of the 2002-12-27 change.
7287
7288 2003-01-17 Paul Eggert <eggert@twinsun.com>
7289
7290 * src/output.c (symbol_printers_output): Fix typo that led
7291 to core dump. Problem reported by Antonio Rus in
7292 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
7293
7294 2003-01-13 Akim Demaille <akim@epita.fr>,
7295 Quoc Peyrot <chojin@lrde.epita.fr>,
7296 Robert Anisko <anisko_r@lrde.epita.fr>
7297
7298 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7299 when the stacks contain one element, as the loop would otherwise
7300 free the last state, and then use the top state (the one we just
7301 popped). This means that the initial elements will not be freed
7302 explicitly, as is the case in yacc.c; it is not a problem, as
7303 these elements have fake values.
7304
7305 2003-01-11 Paul Eggert <eggert@twinsun.com>
7306
7307 * NEWS: %expect-violations are now just warnings, reverting
7308 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7309 bootstrapping problem reported by Matthias Klose; see
7310 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
7311 * src/conflicts.c (conflicts_print): Likewise.
7312 * tests/conflicts.at (%expect not enough, %expect too much,
7313 %expect with reduce conflicts): Likewise.
7314 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7315 that the warning is enabled if the number of conflicts changes
7316 (not necessarily increases).
7317
7318 * src/getargs.c (version): Update copyright year.
7319
7320 2003-01-09 Akim Demaille <akim@epita.fr>
7321
7322 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7323
7324 2003-01-08 Paul Eggert <eggert@twinsun.com>
7325
7326 * Makefile.maint (WGETFLAGS):
7327 New macro, containing "-C off" to disable proxy caches.
7328 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7329 (rel-check): Use $(WGET) instead of wget.
7330
7331 2003-01-06 Paul Eggert <eggert@twinsun.com>
7332
7333 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7334 the GLR paper of Scott, Johnstone and Hussain.
7335
7336 2003-01-04 Paul Eggert <eggert@twinsun.com>
7337
7338 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7339 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7340 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7341 (EXTRA_LIBRARIES): New var, for liby.a.
7342 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7343 (EXTRA_SCRIPTS): New var, for yacc.
7344
7345 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7346 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7347 Problem reported by Nelson H. F. Beebe.
7348
7349 2003-01-03 Paul Eggert <eggert@twinsun.com>
7350
7351 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7352 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7353 when compiling Bison 1.875's `bitset bset = obstack_alloc
7354 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7355
7356 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7357 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7358 grow to a huge size with typical invocation.
7359
7360 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7361 Use the pattern recommended by Autoconf 2.57, except also protect
7362 against double-definition.
7363 * src/system.h: Likewise.
7364 Portability issues reported by Nelson H. F. Beebe.
7365
7366 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7367 All uses changed. Provide a definition in both C and C++.
7368 (yytrue, yyfalse): Define even if defined (__cplusplus).
7369
7370 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7371 Reported by Nelson H. F. Beebe.
7372
7373 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7374
7375 2003-01-02 Paul Eggert <eggert@twinsun.com>
7376
7377 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7378 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7379 Bug reported by Nelson H. F. Beebe.
7380
7381 2003-01-01 Paul Eggert <eggert@twinsun.com>
7382
7383 * Version 1.875.
7384
7385 2002-12-30 Paul Eggert <eggert@twinsun.com>
7386
7387 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7388 Moved here from...
7389 (<INITIAL>","): Here. This causes stray "," to be treated
7390 more uniformly.
7391
7392 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
7393 last brace in braced code when not in Yacc mode, for compatibility
7394 with Bison 1.35. This resurrects the 2001-12-15 patch to
7395 src/reader.c.
7396
7397 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7398 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7399
7400 2002-12-28 Paul Eggert <eggert@twinsun.com>
7401
7402 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7403 that of SYM's type. This fixes Debian bug 168069, reported by
7404 Thomas Olsson.
7405
7406 2002-12-28 Paul Eggert <eggert@twinsun.com>
7407
7408 Version 1.75f.
7409
7410 Switch back to the Yacc style of conflict reports, undoing some
7411 of the 2002-07-30 change.
7412 * doc/bison.texinfo (Understanding): Use Yacc style for
7413 conflict reports. Also, use new way of locating rules.
7414 * src/conflicts.c (conflict_report):
7415 Renamed from conflict_report_yacc, removing the old
7416 'conflict_report'. Translate the entire conflict report at once,
7417 so that we don't assume that "," has the same interpretation in
7418 all languages.
7419 (conflicts_output): Use Yacc-style conflict report for each state,
7420 instead of our more-complicated style.
7421 (conflicts_print): Use Yacc-style conflict report, except print
7422 the input file name when not emulating Yacc.
7423 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7424 Conflicted Reduction, %expect not enough, %expect too much,
7425 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7426 * tests/existing.at (GNU Cim Grammar): Likewise.
7427 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7428
7429 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7430 fatal): Don't invoke fflush; it's not needed and it might even be
7431 harmful for stdout, as stdout might not be open.
7432 * src/reduce.c (reduce_print): Likewise.
7433
7434 2002-12-27 Paul Eggert <eggert@twinsun.com>
7435
7436 Fix a bug where error locations were not being recorded correctly.
7437 This problem was originally reported by Paul Hilfinger in
7438 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
7439
7440 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7441 top of the location stack's error locations.
7442 (yyerrlab): Set it. When discarding a token, push its location
7443 onto yylerrsp so that we don't lose track of the error's end.
7444 (yyerrlab1): Now is only the target of YYERROR, so that we can
7445 properly record the location of the action that failed. For GCC
7446 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7447 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7448 (yyerrlab2): New label, which yyerrlab now falls through to.
7449 Compute the error's location by applying YYLLOC_DEFAULT to
7450 the locations of all the symbols that went into the error.
7451 * doc/bison.texinfo (Location Default Action): Mention that
7452 YYLLOC_DEFAULT is also invoked for syntax errors.
7453 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7454 Error locations include the locations of all the tokens that were
7455 discarded, not just the last token.
7456
7457 2002-12-26 Paul Eggert <eggert@twinsun.com>
7458
7459 * src/files.c: Include quote.h.
7460 (compute_output_file_names): Warn if we detect conflicting
7461 outputs to the same file. This should catch the misunderstanding
7462 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7463
7464 * src/conflicts.c (conflicts_print): If the user specifies
7465 "%expect N", report an error if there are any reduce/reduce
7466 conflicts. This is what the manual says should happen.
7467 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7468 * tests/conflicts.at (%expect with reduce conflicts): New test.
7469
7470 Don't use m4_include on relative file names, as it doesn't work as
7471 desired if there happens to be a file with that name under ".".
7472
7473 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7474 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7475 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7476 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7477 * src/output.c (output_skeleton): Use full path names when
7478 specifying a file to include; don't rely on include path, as
7479 it's unreliable when the working file contains a file with
7480 that name.
7481
7482 2002-12-25 Paul Eggert <eggert@twinsun.com>
7483
7484 Remove obsolete references to bison.simple and bison.hairy.
7485 Problem mentioned by Aubin Mahe in
7486 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
7487 * data/glr.c: Comment fix.
7488 * doc/bison.1: Remove references. Also, mention "yacc".
7489
7490 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7491 with -g option.
7492
7493 * src/parse-gram.y (declaration): Use enum "report_states" rather
7494 than its numeric value 1.
7495
7496 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7497 opening a new one. This fixes Debian bug 165349, reported by
7498 Bruce Stephens.
7499
7500 2002-12-24 Paul Eggert <eggert@twinsun.com>
7501
7502 Version 1.75e.
7503
7504 * Makefile.maint (cvs-update): Don't assume that the shell
7505 supports $(...), as Solaris sh doesn't.
7506
7507 * src/parse-gram.y (lloc_default): Remove test for empty
7508 nonterminals at the end, since it didn't change the result.
7509
7510 2002-12-24 Paul Eggert <eggert@twinsun.com>
7511
7512 If the user does not define YYSTYPE as a macro, Bison now declares it
7513 using typedef instead of defining it as a macro. POSIX requires this.
7514 For consistency, YYLTYPE is also declared instead of defined.
7515
7516 %union directives can now have a tag before the `{', e.g., the
7517 directive `%union foo {...}' now generates the C code
7518 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7519 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7520 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7521 instead of `yyltype'.
7522
7523 `yystype' and `yyltype' are now obsolescent macros instead of being
7524 typedefs or tags; they are no longer documented and will be
7525 withdrawn in a future release.
7526
7527 * data/glr.c (b4_location_type): Remove.
7528 (YYSTYPE): Renamed from yystype.
7529 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7530 (struct YYLTYPE): Renamed from struct yyltype.
7531 (YYLTYPE): Renamed from yyltype.
7532 (yyltype, yystype): New (and obsolescent) macros,
7533 for backward compatibility.
7534 * data/yacc.c: Likewise.
7535
7536 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7537 does not specify a union tag. This is for compatibility with
7538 Solaris 9 yacc.
7539
7540 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7541 const *, since it is now modified by stripping surrounding { }.
7542 (current_braced_code): Remove.
7543 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7544 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7545 trailing " {...}". Now of type <chars>.
7546 (grammar_declaration): Adjust to bundled tokens.
7547 (code_content): Remove; stripping is now done by add_param.
7548 (print_token_value): Print contents of bundled tokens.
7549 (token_name): New function.
7550
7551 * src/reader.h (braced_code, current_braced_code): Remove.
7552 (token_name): New decl.
7553
7554 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7555 token_type, not braced_code code_kind. All uses changed.
7556 (SC_PRE_CODE): New state, for scanning after a keyword that
7557 has (or usually has) an immediately-following braced code.
7558 (token_type): New local var, to keep track of which token type
7559 to return when scanning braced code.
7560 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
7561 <INITIAL>"%parse-param", <INITIAL>"%printer",
7562 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7563 instead of returning a token type immediately.
7564 (<INITIAL>"{"): Set token type.
7565 (<SC_BRACED_CODE>"}"): Use it.
7566 (handle_action_dollar, handle_action_at): Now returns bool
7567 indicating success. Fail if ! current_rule; this prevents a core dump.
7568 (handle_symbol_code_dollar, handle_symbol_code_at):
7569 Remove; merge body into caller.
7570 (handle_dollar, handle_at): Complain in invalid contexts.
7571
7572 * NEWS, doc/bison.texinfo: Document the above.
7573 * NEWS: Fix years and program names in copyright notice.
7574
7575 2002-12-17 Paul Eggert <eggert@twinsun.com>
7576
7577 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7578 Reporting, Table of Symbols): Omit mentions of %lex-param and
7579 %parse-param from the documentation for now.
7580
7581 2002-12-15 Paul Eggert <eggert@twinsun.com>
7582
7583 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7584 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7585 lookahead symbol, and which sets yychar in parser actions) and it
7586 disagreed with the Bison documentation. Bug
7587 reported by Andrew Walrond.
7588
7589 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7590 as the caller now does that.
7591 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7592 (YYEMPTY): Parenthesize right hand side, since others use it.
7593 (yyparse): Don't assume that our generated code is the only code
7594 that sets yychar.
7595
7596 2002-12-13 Paul Eggert <eggert@twinsun.com>
7597
7598 Version 1.75d.
7599
7600 POSIX requires a "yacc" command.
7601 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7602 (MOSTLYCLEANFILES): Add yacc.
7603 (yacc): New rule.
7604 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
7605 as an alias for bison y.
7606
7607 * po/LINGUAS: Add da.
7608
7609 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
7610 problem with latest <getopt.h>.
7611 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
7612
7613 * doc/fdl.texi: Upgrade to 1.2.
7614 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
7615 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
7616 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
7617 gnulib.
7618 * config/install-sh: Sync with autotools.
7619
7620 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
7621 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
7622 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
7623 locations are requested.
7624 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
7625 locations are requested.
7626
7627 2002-12-12 Paul Eggert <eggert@twinsun.com>
7628
7629 Remove unportable casts and storage allocation tricks.
7630 While we're at it, remove almost all casts, since they
7631 usually aren't needed and are a sign of trouble.
7632
7633 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7634
7635 * src/derives.c (derives_compute): Do not subtract NTOKENS from
7636 the pointer DSET returned by malloc; this isn't portable.
7637 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
7638 Similarly for DERIVES.
7639 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
7640 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
7641 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
7642
7643 * src/derives.c (derives_compute): Do not bother invoking
7644 int_of_rule_number, since rule numbers are integers.
7645
7646 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7647 rather than XMALLOC (char, N).
7648
7649 * src/files.c (filename_split): Rewrite to avoid cast.
7650
7651 * src/gram.h (symbol_number_as_item_number,
7652 item_number_as_symbol_number, rule_number_as_item_number,
7653 item_number_as_rule_number):
7654 Now inline functions rather than macros, to avoid casts.
7655 * src/state.h (state_number_as_int): Likewise.
7656 * src/tables.c (state_number_to_vector_number,
7657 symbol_number_to_vector_number): Likewise.
7658
7659 * src/gram.h (int_of_rule_number): Remove; no longer used.
7660
7661 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7662 since the resulting storage is always stored into.
7663
7664 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7665 where it's needed.
7666
7667 * src/muscle_tab.c (muscle_m4_output):
7668 Now inline. Return bool, not int.
7669 * src/state.c (state_compare): Likewise.
7670 * src/symtab.c (symbol_check_defined,
7671 symbol_check_alias_consistency, symbol_pack, symbol_translation,
7672 hash_compare_symbol, hash_symbol):
7673 Likewise.
7674 * src/uniqstr.c (uniqstr_print): Likewise.
7675 * src/muscle_tab.c (muscle_m4_output_processor):
7676 New function, to avoid casts.
7677 * src/state.c (state_comparator, stage_hasher): Likewise.
7678 * src/symtab.c (symbol_check_defined_processor,
7679 symbol_check_alias_consistency_processor, symbol_pack_processor,
7680 symbol_translation_processor, hash_symbol_comparator,
7681 hash_symbol_hasher): Likewise.
7682 * src/uniqstr.c (uniqstr_print_processor): Likewise.
7683 * src/muscle_tab.c (muscles_m4_output):
7684 Use new functions instead of casting old functions unportably.
7685 * src/state.c (state_hash_new): Likewise.
7686 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
7687 symbols_token_translations_init):
7688 Likewise.
7689 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7690
7691 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
7692 var instead of casting to long, to avoid casts.
7693 (prepare_states): Use MALLOC rather than alloca, so that we don't
7694 have to worry about alloca.
7695 * src/state.c (state_hash_lookup): Likewise.
7696
7697 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7698 local var instead of casting to unsigned char, to avoid casts.
7699
7700 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
7701 STATE_ALLOC): Remove.
7702 (transitions_new, errs_new, reductions_new, state_new): Use malloc
7703 rather than calloc, and use offsetof to avoid allocating slightly
7704 too much storage.
7705 (state_new): Initialize all members.
7706
7707 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7708
7709 * src/symtab.c (symbol_free): Remove; unused.
7710 (symbol_get): Remove cast in lhs of assignment.
7711 (symbols_do): Now static. Accept generic arguments, not
7712 hashing-related ones.
7713
7714 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7715 (symbol_processor): Remove.
7716 (symbols_do): Remove decl; now static.
7717
7718 * src/system.h (alloca): Remove; decl no longer needed.
7719 (<stddef.h>): Include, for offsetof.
7720 (<inttypes.>, <stdint.h>): Include if available.
7721 (uintptr_t): New type, if system lacks it.
7722 (CALLOC, MALLOC, REALLOC): New macros.
7723 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7724 new macros.
7725
7726 * src/tables.c (table_size): Now int, to pacify GCC.
7727 (table_grow, table_ninf_remap): Use signed table size.
7728 (save_row): Don't bother initializing locals when not needed.
7729 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7730 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7731
7732 * src/vcg.h: Correct misspellings.
7733
7734 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7735
7736
7737 * src/getargs.c (getargs): Don't assume EOF == -1.
7738
7739 2002-12-09 Paul Eggert <eggert@twinsun.com>
7740
7741 Change identifier spellings to avoid collisions with names
7742 that are reserved by POSIX.
7743
7744 Don't use names ending in _t, since POSIX reserves them.
7745 For consistency, remove _e and _s endings -- they're weren't
7746 needed to remove ambiguity. All uses changed.
7747 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7748 turn was just renamed from struniq_t.
7749 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7750 which in turn was just renamed from struniq_processor_t.
7751 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7752 in turn was renamed from hash_compare_struniq_t.
7753 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7754 (state_list): Renamed from state_list_t.
7755 * src/assoc.h (assoc): Renamed from assoc_t.
7756 * src/conflicts.c (enum conflict_resolution): Renamed from
7757 enum conflict_resolution_e.
7758 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7759 (rule_list): Renamed from rule_list_t.
7760 * src/getargs.h (enum trace): Renamed from enum trace_e.
7761 (enum report): Renamed from enum report_e.
7762 * src/gram.h (item_number): Renamed from item_number_t.
7763 (rule_number): Renamed from rule_number_t.
7764 (struct rule_s): Remove the "rule_s" part; not used.
7765 (rule): Renamed from rule_t.
7766 (rule_filter): Renamed from rule_filter_t.
7767 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7768 (goto_list): Renamed from goto_list_t.
7769 * src/lalr.h (goto_number): Renamed from goto_number_t.
7770 * src/location.h (location): Renamed from location_t.
7771 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7772 and moved here from:
7773 * src/muscle_tab.h (muscle_entry_t): here.
7774 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7775 (rule_list): Renamed from rule_list_t.
7776 * src/print_graph.c (static_graph): Renamed from graph.
7777 * src/reader.h (braced_code): Renamed from braced_code_t.
7778 Remove brace_code_e tag.
7779 * src/relation.h (relation_node): Renamed from relation_node_t.
7780 (relation_nodes): Renamed from relation_nodes_t.
7781 (relation): Renamed from relation_t.
7782 * src/state.h (state_number): Renamed from state_number_t.
7783 (struct state): Renamed from struct state_s.
7784 (state): Renamed from state_t.
7785 (transitions): Renamed from transitions_t. Unused (and
7786 misspelled) transtion_s tag removed.
7787 (errs): Renamed from errs_t. Unused errs_s tag removed.
7788 (reductions): Renamed from reductions_t. Unused tag
7789 reductions_s removed.
7790 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7791 (struct symbol_list): Renamed from struct symbol_list_s.
7792 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7793 (struct symbol): Renamed from struct symbol_s.
7794 (symbol): Renamed from symbol_t.
7795 * src/tables.c (vector_number): Renamed from vector_number_t.
7796 (action_number): Renamed from action_t.
7797 * src/tables.h (base_number): Renamed from base_t.
7798 * src/vcg.h (enum color): Renamed from enum color_e.
7799 (enum textmode): Renamed from enum textmode_e.
7800 (enum shape): Renamed from enum shape_e.
7801 (struct colorentry): Renamed from struct colorentry_s.
7802 (struct classname): Renamed from struct classname_s.
7803 (struct infoname): Renamed from struct infoname_s.
7804 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7805 (enum decision): Renamed from enum decision_e.
7806 (enum orientation): Renamed from enum orientation_e.
7807 (enum alignment): Renamed from enum alignment_e.
7808 (enum arrow_mode): Renamed from enum arrow_mode_e.
7809 (enum crossing_type): Renamed from enum crossing_type_e.
7810 (enum view): Renamed from enum view_e.
7811 (struct node): Renamed from struct node_s.
7812 (node): Renamed from node_t.
7813 (enum linestyle): Renamed from enum linestyle_e.
7814 (enum arrowstyle): Renamed from enum arrowstyle_e.
7815 (struct edge): Renamed from struct edge.
7816 (edge): Renamed from edge_t.
7817 (struct graph): Renamed from struct graph_s.
7818 (graph): Renamed from graph_t.
7819 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7820 Rename value_t -> value.
7821 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7822 value_t_as_yystype -> value_as_yystype.
7823
7824 Don't include <errno.h> in the mainstream code, since it
7825 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7826 * lib/get-errno.c, lib/get-errno.h: New files.
7827 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7828 get-errno.c.
7829 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7830 * src/output.c (output_skeleton): Likewise.
7831 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7832 instead of errno.
7833 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7834 Likewise.
7835 (handle_action_dollar, handle_action_at): Likewise.
7836 * src/system.h: Do not include <errno.h>.
7837 (TAB_EXT): Renamed from EXT_TAB.
7838 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7839
7840 Avoid str[a-z]*, since <string.h> reserves that name space.
7841 Change all instances of "struniq" in names to "uniqstr", and
7842 likewise for "STRUNIQ" and "UNIQSTR".
7843 * src/uniqstr.c: Renamed from src/struniq.c.
7844 * src/uniqstr.h: Renamed from src/struniq.h.
7845 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7846 * src/files.c (strsuffix): Remove; unused.
7847 (concat2): Renamed from stringappend. Now static.
7848 * src/files.h (strsuffix, stringappend): Remove; unused.
7849 * src/parse-gram.y (<chars>): Renamed from <string>.
7850 (<uniqstr>): Renamed from <struniq>.
7851 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7852 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7853 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7854 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7855 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7856 (N_EXPAND): Renamed from N_STRETCH.
7857
7858 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7859 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7860 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7861 Remove; unused.
7862 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7863 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7864 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7865 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7866 (BASE_MAXIMUM): Renamed from BASE_MAX.
7867 (BASE_MINIMUM): Renamed from BASE_MIN.
7868 (ACTION_MAX): Remove; unused.
7869 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7870 Unnecessary casts removed from above defines.
7871
7872
7873 Fix misspelling in names.
7874 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7875 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7876 G_NODE_ALIGNEMENT.
7877
7878
7879 * lib/timevar.c (timevar_report): Renamed from time_report,
7880 for consistency with other names.
7881 * lib/timevar.h (timevar_report): New decl.
7882 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7883
7884
7885 Sort include-file uses.
7886
7887 Reorder all include files under src to be in the order "system.h".
7888 then the ../lib include files in angle brackets (alphabetized),
7889 then the . include files in double-quotes (alphabetized). Fix
7890 dependency breakages encountered in this process, as follows:
7891 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
7892 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
7893 * src/state.h: Include "symtab.h".
7894
7895 2002-12-08 Paul Eggert <eggert@twinsun.com>
7896
7897 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
7898 since this causes problems when __file__ contains character
7899 sequences like "@" that are treated specially by src/scan-skel.l.
7900 Instead, just use the file's basename. This fixes the bug
7901 reported by Martin Mokrejs in
7902 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
7903
7904 2002-12-06 Paul Eggert <eggert@twinsun.com>
7905
7906 Add support for rules that do not have trailing semicolons, as
7907 POSIX requires. Improve the quality of locations in Bison
7908 diagnostics.
7909
7910 * src/location.c: Include <quotearg.h>.
7911 (empty_location): Now const.
7912 (location_print): New function. Follow the recommendation of the
7913 GNU Coding Standards for locations that span file boundaries.
7914 * src/location.h: Do not include <quotearg.h>; no longer needed.
7915 (boundary): New type.
7916 (location_t): Use it. This allows locations to span file boundaries.
7917 All member uses changed: file -> start.file or end.file (as needed),
7918 first_line -> start.line, first_column -> start.column,
7919 last_line -> end.line, last_column -> end.column.
7920 (equal_boundaries): New function.
7921 (LOCATION_RESET, LOCATION_STEP): Remove.
7922 (LOCATION_PRINT): Remove. All callers changed to use location_print.
7923 (empty_location): Now const.
7924 (location_print): New decl.
7925 * src/parse-gram.y (lloc_default): New function, which handles
7926 empty locations more accurately.
7927 (YYLLOC_DEFAULT): Use it.
7928 (%token COLON): Remove.
7929 (%token ID_COLON): New token.
7930 (rules): Use it.
7931 (declarations, rules): Remove trailing semicolon.
7932 (declaration, rules_or_grammar_declaration):
7933 Allow empty (";") declaration.
7934 (symbol_def): Remove empty actions; no longer needed.
7935 (rules_or_grammar_declaration): Remove trailing semicolon.
7936 (semi_colon.opt): Remove.
7937 * src/reader.h: Include location.h.
7938 (scanner_cursor): New decl.
7939 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
7940 rolling our own.
7941 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7942 of *loc.
7943 (STEP): Remove. No longer needed, now that adjust_location does
7944 the work. All uses removed.
7945 (scanner_cursor): New var.
7946 (adjust_location): Renamed from extend_location. It now sets
7947 *loc and adjusts the scanner cursor. All uses changed.
7948 Don't bother testing for CR.
7949 (handle_syncline): Remove location arg; now updates scanner cursor.
7950 All callers changed.
7951 (unexpected_end_of_file): Now accepts start boundary of token or
7952 comment, not location. All callers changed. Update scanner cursor,
7953 not the location.
7954 (SC_AFTER_IDENTIFIER): New state.
7955 (context_state): Renamed from c_context. All uses changed.
7956 (id_loc, code_start, token_start): New local vars.
7957 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7958 processing of Yacc white space and equivalents here.
7959 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7960 instead of returning ID immediately, since we need to search for
7961 a subsequent colon.
7962 (<INITIAL>"'", "\""): Save token_start.
7963 (<INITIAL>"%{", "{", "%%"): Save code_start.
7964 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7965 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7966 BEGIN context_state at end, not INITIAL.
7967 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7968 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7969 Return correct token start.
7970 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7971 the start of a character, string or multiline comment is found.
7972 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7973 Reduction): Adjust reported locations to match the more-precise
7974 results now expected.
7975 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7976 * tests/reduce.at (Useless Rules, Reduced Automaton,
7977 Underivable Rules): Likewise.
7978 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7979 or "|"' now that so many other tokens are allowed by the new grammar.
7980
7981 * src/complain.h (current_file): Remove duplicate decl;
7982 current_file is now owned by files.h.
7983 * src/complain.c, src/scan-gram.l: Include files.h.
7984
7985 2002-12-06 Paul Eggert <eggert@twinsun.com>
7986
7987 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7988 promotes to int; it might be unsigned int.
7989 * data/yacc.c (yy_reduce_print): Likewise.
7990
7991 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7992 be #defined in the prologue, not in the Bison declarations.
7993 This fixes Debian Bug 102878, reported by Shaul Karl.
7994
7995 2002-12-02 Paul Eggert <eggert@twinsun.com>
7996
7997 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7998 * lib/strtoul.c: New file, from gnulib.
7999 This fixes a porting bug reported by Peter Klein in
8000 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
8001
8002 2002-11-30 Paul Eggert <eggert@twinsun.com>
8003
8004 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
8005 and put only a forward declaration in the prologue. This is for
8006 consistency with the other scanner helper functions.
8007
8008 Type clashes now generate warnings, not errors, since it
8009 appears that POSIX may allow some grammars with type clashes.
8010 * src/reader.c (grammar_current_rule_check): Warn about
8011 type clashes instead of complaining.
8012 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8013
8014 Add Yacc library, since POSIX requires it.
8015 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8016 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8017 * lib/main.c, lib/yyerror.c: New files.
8018
8019 gram_error can be static; it need not be extern.
8020 * src/reader.h (gram_error): Remove decl.
8021 * src/parse-gram.y (gram_error): Now static. Add static decl.
8022 (print_token_value): Omit parameter names from forward decl,
8023 for consistency.
8024
8025 2002-11-29 Paul Eggert <eggert@twinsun.com>
8026
8027 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8028 be declared before being used. E.g., one should typically
8029 declare them in the prologue. Use GNU coding style in examples.
8030 Put "const" consistently after the type it modifies. Mention
8031 that C99 supports "inline". Mention that yyerror traditionally
8032 returns "int".
8033
8034 %parse-param and %lex-param now take just one argument, the
8035 declaration; the argument name is deduced from the declaration.
8036
8037 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8038 Reporting, Table of Symbols): Document this.
8039 * src/parse-gram.y (add_param): New function.
8040 (COMMA): Remove.
8041 (declaration): Implement new rule for %parse-param and %lex-param.
8042 * src/scan-gram.l: "," now elicits a warning, rather than being
8043 a token; this is more compatible with byacc.
8044 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8045
8046 2002-11-27 Paul Eggert <eggert@twinsun.com>
8047
8048 Rename identifiers to avoid real and potential collisions.
8049
8050 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8051 to avoid collision with lex macro described by Bruce Lilly in
8052 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8053 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8054 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8055 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8056 All uses changed.
8057 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8058 The name "yycontrol" violates the name space rules, and this stuff
8059 wasn't being used anyway.
8060 (input): Remove action; this stuff wasn't being used.
8061 (gram_error): Rename local variable yylloc -> loc.
8062 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8063 (YY_DECL): Don't use "yy" at start of local variables.
8064 All uses changed, e.g., yylloc -> loc.
8065 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8066 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8067 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8068 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8069
8070 * src/parse-gram.y (gram_error): loc is now const *.
8071 * src/reader.h (gram_error): Likewise.
8072
8073 2002-11-24 Paul Eggert <eggert@twinsun.com>
8074
8075 Version 1.75c.
8076
8077 * tests/actions.at (Actions after errors): Use an output format
8078 more similar to that of the Printers and Destructors test.
8079 Test the position of the ';' token too.
8080 (Printers and Destructors): Likewise.
8081 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8082 unnecessarily alarming people when the test fails.
8083
8084 * data/yacc.c (yyerrlab1): Move this label down, so that the
8085 parser does not discard the lookahead token if the user code
8086 invokes YYERROR. This change is required for POSIX conformance.
8087
8088 * lib/error.c: Sync with gnulib.
8089
8090 2002-11-22 Paul Eggert <eggert@twinsun.com>
8091
8092 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8093 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8094 * lib/xmalloc.c: Likewise.
8095
8096 2002-11-20 Paul Eggert <eggert@twinsun.com>
8097
8098 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8099
8100 2002-11-20 Paul Eggert <eggert@twinsun.com>
8101
8102 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8103 should use `if (! x) abort ();' rather than `assert (x);', and
8104 anyway it's one less thing to worry about configuring.
8105
8106 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8107 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8108 and replace all instances of assert with abort.
8109 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8110 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8111
8112 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8113 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8114 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8115 hash_find_entry, hash_rehash, hash_insert): Likewise.
8116 * src/conflicts.c (resolve_sr_conflict): Likewise.
8117 * src/lalr.c (set_goto_map, map_goto): Likewise.
8118 * src/nullable.c (nullable_compute): Likewise.
8119 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8120 * src/reader.c (packgram, reader): Likewise.
8121 * src/state.c (state_new, state_free, state_transitions_set,
8122 state_reduction_find): Likewise.
8123 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8124 symbol_pack): Likewise.
8125 * src/tables.c (conflict_row, pack_vector): Likewise.
8126 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8127 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8128 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8129 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8130
8131 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8132 (ARGMATCH_CONSTRAINT): New macro.
8133 (ARGMATCH_ASSERT): Use it.
8134
8135 * src/system.h (verify): New macro.
8136 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8137 rather than assert.
8138 * src/tables.c (tables_generate): Likewise.
8139
8140 * src/struniq.c (struniq_assert): Now returns void, and aborts
8141 if the assertion is false.
8142 (struniq_assert_p): Remove.
8143 * src/struniq.h: Likewise.
8144
8145 2002-11-18 Paul Eggert <eggert@twinsun.com>
8146
8147 * data/glr.c (yygetLRActions): Replace `yyindex' with
8148 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8149 This fixes the regression with Sun ONE Studio 7 cc that I reported in
8150 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
8151
8152 2002-11-18 Akim Demaille <akim@epita.fr>
8153
8154 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8155 space.
8156 From Tim Van Holder.
8157
8158 2002-11-17 Paul Eggert <eggert@twinsun.com>
8159
8160 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8161 to "SyntaxError" for consistency with my 2002-11-15 change.
8162
8163 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8164 not define to {}, since this breaks the common use of `YYDPRINTF
8165 ((...));' if a single statement is desired (e.g. before `else').
8166 Work around GCC warnings by surrounding corresponding calls with
8167 {} if needed.
8168 (yyhasResolvedValue): Remove unused function.
8169 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8170 loop body.
8171 (yyreportSyntaxError): Renamed from yyreportParseError.
8172 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8173 All uses changed.
8174 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8175 extern when possible. Remove unused initializations.
8176
8177 2002-11-16 Akim Demaille <akim@epita.fr>
8178
8179 Augment the similarity between GLR and LALR traces.
8180
8181 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8182 (YY_REDUCE_PRINT): New.
8183 (yyparse): Use them.
8184 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8185 YYDPRINT here.
8186 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8187 state reached after the reduction/recovery, since...
8188 (yyparse, yyprocessOneStack): Report the state we are entering in.
8189
8190 2002-11-16 Akim Demaille <akim@epita.fr>
8191
8192 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8193 Add support for --trace=skeleton.
8194 * src/scan-skel.l: %option debug.
8195 Scan strings of non-@ or \n instead of character by character.
8196 (scan_skel): Handle trace_skeleton.
8197 (QPUTS): New.
8198 (@output_parser_name@, @output_header_name@): ``Restore'' their
8199 support (used to be M4 macros).
8200 * data/yacc.c: Quote larger chunks, a la glr.c.
8201 * data/lalr1.cc: Likewise.
8202 The header guards are no longer available, so use some other
8203 string than `YYLSP_NEEDED'.
8204
8205 2002-11-16 Akim Demaille <akim@epita.fr>
8206
8207 Make the ``Printers and Destructors'' test more verbose, taking
8208 `yacc.c''s behavior as (possibly wrong) reference.
8209
8210 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8211 instead of fprint on stdout.
8212 Set and report the last_line of the symbols.
8213 Consistently display values and locations.
8214
8215 2002-11-16 Paul Eggert <eggert@twinsun.com>
8216
8217 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8218
8219 2002-11-15 Paul Eggert <eggert@twinsun.com>
8220
8221 * tests/actions.at (Actions after errors): New test case.
8222
8223 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8224 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8225 tests/action.at, tests/calc.at, tests/conflicts.at,
8226 tests/cxx-type.at, tests/regression.at:
8227 "parse error" -> "syntax error" for POSIX compatibility.
8228 "parsing stack overflow..." -> "parser stack overflow" so
8229 that code matches Bison documentation.
8230
8231 2002-11-15 Akim Demaille <akim@epita.fr>
8232
8233 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8234 take two BRACED_CODE, not two string_content.
8235 Free the scanner's obstack when we are done.
8236 (code_content): New.
8237 * tests/calc.at: Adjust.
8238 * doc/bison.texinfo: Adjust.
8239 Also, make sure to include the `,' for these declarations.
8240
8241 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8242
8243 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8244 definition; avoids potential autoreconf problems.
8245
8246 2002-11-15 Akim Demaille <akim@epita.fr>
8247
8248 Always check the value returned by yyparse.
8249
8250 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8251 returned by yyparse.
8252 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8253 Adjust calls.
8254 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8255 returned by yyparse.
8256
8257 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8258
8259 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8260 on input.at test.
8261
8262 2002-11-14 Paul Eggert <eggert@twinsun.com>
8263
8264 * src/output.c (output_skeleton): Call xfopen instead of
8265 duplicating xfopen's body.
8266
8267 Fix bugs reported by Nelson H. F. Beebe in
8268 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
8269
8270 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8271 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8272 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8273 file twice in the grammar, as an extra check.
8274
8275 * tests/input.at (Torturing the Scanner): Surround the
8276 backslash-newline tests with "#if 0", to make it less likely that
8277 we'll run into compiler bugs. Bring back solitary \ inside
8278 comment, but add a closing comment to work around HP C bug. Don't
8279 test backslash-newline in C character constant.
8280
8281 2002-11-14 Akim Demaille <akim@epita.fr>
8282
8283 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8284 status of the compiler.
8285 Calling `exit 1' is no longer needed.
8286 Reported by Nelson H. F. Beebe.
8287
8288 2002-11-14 Akim Demaille <akim@epita.fr>
8289
8290 * tests/atlocal.in (CPPFLAGS): We have config.h.
8291 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8292 New.
8293 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8294 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8295 * tests/regression.at, tests/torture.at: Use them for all the
8296 grammars that are to be compiled.
8297 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8298 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8299 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8300
8301 2002-11-14 Akim Demaille <akim@epita.fr>
8302
8303 * doc/bison.texinfo: Various formatting changes (alignments in
8304 samples, additional @group/@end group, GCS in samples.
8305 Use @deffn instead of simple @table to define the directives,
8306 macros, variables etc.
8307
8308 2002-11-13 Paul Eggert <eggert@twinsun.com>
8309
8310 Fix some bugs reported by Albert Chin-A-Young in
8311 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
8312
8313 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8314 -o c"; the HP C compiler chatters during compilation.
8315 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8316 * tests/headers.at (export YYLTYPE): Likewise.
8317
8318 * tests/input.at (Torturing the Scanner): Remove lines containing
8319 solitary backslashes, as they tickle a bug in the HP C compiler.
8320
8321 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8322 comments, since they're not portable. Use GNU coding style.
8323
8324 2002-11-13 Akim Demaille <akim@epita.fr>
8325
8326 * data/yacc.c: Leave bigger chunks of quoted text.
8327 (YYDSYMPRINTF): New.
8328 Use it to report symbol activities.
8329 * data/glr.c (YYDSYMPRINTF): New.
8330 Use it.
8331
8332 2002-11-12 Paul Eggert <eggert@twinsun.com>
8333
8334 Version 1.75b.
8335
8336 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8337 (yyglrReduce): Return yyok, not 0.
8338 This should avoid the enumerated-type warnings reported
8339 by Nelson H. F. Beebe in
8340 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
8341
8342 * lib/bbitset.h (BITSET_INLINE): Remove.
8343 * lib/bitset.h [! BITSET_INLINE]: Remove.
8344 (bitset_set, bitset_reset, bitset_test): Rename local vars
8345 to avoid shadowing warnings by GCC.
8346
8347 * data/glr.c (inline): Remove #define. It's the user's
8348 responsibility to #define it away, just like 'const'.
8349 This fixes one of the bugs reported by Nelson H. F. Beebe in
8350 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
8351
8352 * Makefile.maint (po-check): Scan .l and .y files instead of the
8353 .c and the .h files that they generate. This fixes the bug
8354 reported by Tim Van Holder in:
8355 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
8356 Look for N_ as well as for _. Try to avoid matching #define for
8357 N_ and _.
8358 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8359 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8360 * src/scan-gram.l: Revamp regular expressions so that " and '
8361 do not confuse xgettext.
8362
8363 * src/struniq.h (struniq_new): Do not declare the return type
8364 to be 'const'; this violates the C standard.
8365 * src/struniq.c (struniq_new): Likewise.
8366
8367 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8368
8369 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8370 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8371 linker.
8372
8373 2002-11-12 Akim Demaille <akim@epita.fr>
8374
8375 * Makefile.maint: Sync with Autoconf:
8376 (local_updates): New.
8377
8378 2002-11-12 Akim Demaille <akim@epita.fr>
8379
8380 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8381
8382 2002-11-12 Akim Demaille <akim@epita.fr>
8383
8384 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8385 locations.
8386
8387 2002-11-12 Akim Demaille <akim@epita.fr>
8388
8389 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8390 not yyvalue.
8391
8392 2002-11-12 Akim Demaille <akim@epita.fr>
8393
8394 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8395 Use it to test the GLR parser.
8396
8397 2002-11-12 Akim Demaille <akim@epita.fr>
8398
8399 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8400 defines it.
8401 * data/glr.c (yystos): New.
8402 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8403 (YYDSYMPRINT): New.
8404 (yyval): Don't define it, it is handled via M4.
8405 (yyrecoverParseError): Free verbosely the discarded symbols.
8406 * data/yacc.c (yysymprint): Remove, rather...
8407 (b4_yysymprint_generate): invoke.
8408 * data/c.m4 (b4_yysymprint_generate): New.
8409 Accept pointers as arguments, as opposed to the version from
8410 yacc.c.
8411 (b4_yydestruct_generate): Likewise.
8412 * tests/cations.at (Printers and Destructors): Use Bison directives
8413 instead of CPP macros.
8414 Don't rely on internal details.
8415
8416 2002-11-12 Akim Demaille <akim@epita.fr>
8417
8418 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8419 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8420 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8421 it against YYEMPTY and so forth), work on yytoken (i.e., set
8422 it to YYEMPTY etc.).
8423 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8424 (b4_symbol_actions): Remove.
8425 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8426 for 0, end-of-input.
8427
8428 2002-11-12 Akim Demaille <akim@epita.fr>
8429
8430 * doc/bison.texinfo (Destructor Decl): New.
8431
8432 2002-11-12 Akim Demaille <akim@epita.fr>
8433
8434 * src/tables.c (tables_generate): Use free for pointers that
8435 cannot be NULL, not XFREE.
8436 (pack_vector): Use assert, not fatal, for bound violations.
8437 * src/state.c (state_new): Likewise.
8438 * src/reader.c (reader): Likewise.
8439 * src/lalr.c (set_goto_map): Likewise.
8440 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
8441 the file name.
8442
8443 2002-11-12 Akim Demaille <akim@epita.fr>
8444
8445 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8446 Restore.
8447 * src/scan-gram.l (last_string): Is global to the file, not to
8448 yylex.
8449 * src/parse-gram.y (input): Don't append the epilogue here,
8450 (epilogue.opt): do it here, and free the scanner's obstack.
8451 * src/reader.c (epilogue_set): Rename as...
8452 (epilogue_augment): this.
8453 * data/c.m4 (b4_epilogue): Defaults to empty.
8454
8455 2002-11-12 Akim Demaille <akim@epita.fr>
8456
8457 * src/getargs.c (long_options): Remove duplicates.
8458 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8459 Remove.
8460 * doc/bison.rnh: Remove.
8461 * doc/bison.texinfo (VMS Invocation): Remove.
8462
8463 2002-11-12 Akim Demaille <akim@epita.fr>
8464
8465 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8466 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8467
8468 Use struniq for symbols.
8469
8470 * src/symtab.h (symbol_t): The tag member is a struniq.
8471 (symbol_type_set): Adjust.
8472 * src/symtab.c (symbol_new): Takes a struniq.
8473 (symbol_free): Don't free the tag member.
8474 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8475 (hash_compare_symbol, hash_symbol): these.
8476 Use the fact that tags as struniqs.
8477 (symbol_get): Use struniq_new.
8478 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8479 Returns a strniq.
8480 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8481 and type members are struniqs.
8482 * src/reader.c (get_merge_function)
8483 (grammar_current_rule_merge_set): Adjust.
8484 (TYPE, current_type): Are struniq.
8485
8486 Use struniq for file names.
8487
8488 * src/files.h, src/files.c (infile): Split into...
8489 (grammar_file, current_file): these.
8490 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8491 * src/reduce.c (reduce_print): Likewise.
8492 * src/getargs.c (getargs): Likewise.
8493 * src/complain.h, src/complain.c: Likewise.
8494 * src/main.c (main): Call struniqs_new early enough to use it for
8495 file names.
8496 Don't free the input file name.
8497
8498 2002-11-12 Akim Demaille <akim@epita.fr>
8499
8500 * src/symtab.c (symbol_free): Remove dead deactivated code:
8501 type_name are properly removed.
8502 Don't use XFREE to free items that cannot be NULL.
8503 * src/struniq.h, src/struniq.c: New.
8504 * src/main.c (main): Initialize/free struniqs.
8505 * src/parse-gram.y (%union): Add astruniq member.
8506 (yyprint): Adjust.
8507 * src/scan-gram.l (<{tag}>): Return a struniq.
8508 Free the obstack bit that used to store it.
8509 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8510
8511 2002-11-11 Paul Eggert <eggert@twinsun.com>
8512
8513 Revamp to fix many (but not all) of the C- and M4-related quoting
8514 problems. Among other things, this fixes the Bison bug reported
8515 by Jan Hubicka when processing the Bash grammar; see:
8516 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
8517
8518 Use new @ escapes consistently. Represent brackets with @{ and @}
8519 rather than @<:@ and @:>@, since this works a bit better with dumb
8520 editors like vi. Represent @ with @@, since @ is now consistently
8521 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8522 __ofile__, to avoid unexpected expansions. Similarly, use @output
8523 rather than #output.
8524
8525 * data/c.m4 (b4_copyright): Omit file name from comment, since
8526 the file name could contain "*/".
8527 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8528 be quoted. All uses changed.
8529
8530 * data/glr.c: Use new @ escapes consistently.
8531 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8532 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8533 Remove, since they couldn't handle arbitrary characters in file
8534 names.
8535 * data/lalr1.cc: Likewise.
8536 * data/yacc.c: Likewise.
8537
8538 * src/files.c (output_infix): Remove; all uses removed.
8539 * src/files.h: Likewise.
8540
8541 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8542 mishandled funny characters in file names, and anyway it isn't
8543 needed any more.
8544 * data/yacc.c: Likewise.
8545 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8546
8547 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8548 * data/yacc.c: Likewise.
8549
8550 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8551 strings now.
8552 (muscle_init): Quote filename as a C string.
8553 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8554 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8555 * src/output.c (escaped_file_name_output): New function.
8556 (prepare_symbols): Quote tokens for M4.
8557 (prepare): Don't insert output_infix, output_prefix,
8558 output_parser_name, output_header_name; this is now down by scan-skel.
8559 Insert skeleton as a C string.
8560
8561 * src/output.c (user_actions_output, symbol_destructors_output,
8562 symbol_printers_output): Quote filenames for C and M4.
8563 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8564
8565 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8566 escapes other than \\ and \'; this simplifies the code.
8567 (<SC_STRING>): Likewise, for \\ and \".
8568 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8569 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8570 Use new escapes @{ and @} for [ and ].
8571
8572 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8573 them with auto vars.
8574 Switch to new escape scheme, where @ is the escape character uniformly.
8575 Abort if a stray escape character is found. Avoid unbounded input
8576 buffer when parsing non-escaped text.
8577
8578 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8579 __oline__, #output, $@, and @{ do not have unintended meanings.
8580
8581 2002-11-09 Paul Eggert <eggert@twinsun.com>
8582
8583 Fix the test failure due to GCC warnings described in
8584 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
8585 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8586 evaluate to 0 if it's impossible for NINF to be in the respective
8587 table.
8588 (yygetLRActions, yyrecoverParseError): Use them.
8589
8590 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8591 counted in the token inserted at end of file. Now takes
8592 location_t *, not location_t, so that the location can be
8593 adjusted. All uses changed.
8594
8595 * tests/regression.at (Invalid inputs): Adjust wording in
8596 diagnostic to match the new behavior.
8597
8598 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
8599 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
8600 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
8601 abort ();'. This reduces the runtime of the "Many lookaheads"
8602 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
8603 GCC 3.2.
8604
8605 2002-11-07 Paul Eggert <eggert@twinsun.com>
8606
8607 * src/parse-gram.y (CHARACTER): Remove unused token.
8608 All uses removed.
8609
8610 * src/scan-gram.l: Remove stack option. We no longer use the
8611 stack, since the stack was never deeper than 1; instead, use the
8612 new auto var c_context to record the stacked value.
8613
8614 Remove nounput option. At an unexpected end of file, we now unput
8615 the minimal input necessary to end cleanly; this simplifies the
8616 code.
8617
8618 Avoid unbounded token sizes where this is easy.
8619
8620 (unexpected_end_of_file): New function.
8621 Use it to systematize the error message on unexpected EOF.
8622 (last-string): Now auto, not static.
8623 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
8624 (scanner_last_string_free): Remove; not used.
8625 (percent_percent_count): Move decl to just before use.
8626 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
8627 not the (never otherwised-used) CHARACTER.
8628
8629 2002-11-07 Akim Demaille <akim@epita.fr>
8630
8631 Let yyerror always receive the msg as last argument, so that
8632 yyerror can be variadic.
8633
8634 * data/yacc.c (b4_yyerror_args): New.
8635 Use it when calling yyerror.
8636 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
8637 Use it when calling yyerror.
8638 * doc/bison.texinfo (Error Reporting): Adjust.
8639 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
8640 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
8641
8642 2002-11-06 Akim Demaille <akim@epita.fr>
8643
8644 #line should have quoted strings.
8645 Ideally, this should be done by m4_quotearg.
8646
8647 * src/scan-skel.l: Include quotearg.h.
8648 Quote __ofile__.
8649 * src/output.c (symbol_printers_output)
8650 (symbol_destructors_output): Quote the file name.
8651
8652 2002-11-06 Akim Demaille <akim@epita.fr>
8653
8654 * tests/regression.at (Invalid inputs): Adjust to the recent
8655 messages.
8656
8657 2002-11-06 Akim Demaille <akim@epita.fr>
8658
8659 Restore --no-lines.
8660 Reported by Jim Kent.
8661
8662 * data/c.m4 (b4_syncline): New.
8663 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
8664 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
8665 * src/output.c (user_actions_output): Likewise.
8666 (prepare): Define 'b4_synclines_flag'.
8667 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
8668
8669 2002-11-06 Akim Demaille <akim@epita.fr>
8670
8671 * src/main.c (main): Free `infile'.
8672 * src/scan-gram.l (handle_syncline): New.
8673 Recognize `#line'.
8674 * src/output.c (user_actions_output, symbol_destructors_output)
8675 (symbol_printers_output): Use the location's file name, not
8676 infile.
8677 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8678
8679 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8680
8681 * src/tables.c (matching_state): Don't allow states to match if
8682 either has GLR conflict entries.
8683
8684 2002-11-05 Paul Eggert <eggert@twinsun.com>
8685
8686 * src/scan-gram.l: Use more accurate diagnostics, e.g.
8687 "integer out of range" rather than "invalid value".
8688 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
8689 accordingly.
8690
8691 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8692 Also, remove one static variable in the scanner.
8693
8694 * src/scan-gram.l (braces_level): Now auto, not static.
8695 Initialize to zero if the compiler is being picky.
8696 (INITIAL): Clear braces_level instead of incrementing it.
8697 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
8698 as POSIX 1003.1-2001 requires.
8699 * src/system.h (IF_LINT): New macro, taken from coreutils.
8700 * configure.ac: Define "lint" if --enable-gcc-warnings.
8701
8702 2002-11-05 Akim Demaille <akim@epita.fr>
8703
8704 * src/scan-gram.l: When it starts with `%', complain about the
8705 whole directive, not just that `invalid character: %'.
8706
8707 2002-11-04 Akim Demaille <akim@epita.fr>
8708
8709 * Makefile.maint: Update from Autoconf.
8710 (update, cvs-update, po-update, do-po-update): New.
8711
8712 2002-11-04 Akim Demaille <akim@epita.fr>
8713
8714 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8715 and yyerror.
8716 Have yyerror `use' its arguments.
8717 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8718 returns true when location & yacc & pure & parse-param.
8719 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8720
8721 2002-11-04 Akim Demaille <akim@epita.fr>
8722
8723 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8724 clashes.
8725 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8726 font-lock-mode.
8727 Use complain_at.
8728 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8729 slot 0.
8730
8731 2002-11-03 Paul Eggert <eggert@twinsun.com>
8732
8733 * src/reader.c (get_merge_function, grammar_current_rule_check):
8734 Use consistent diagnostics for reporting type name clashes.
8735 Quote the types with <>, for consistency with Yacc.
8736 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8737
8738 2002-11-03 Akim Demaille <akim@epita.fr>
8739
8740 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8741 New.
8742 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8743 (b4_parse_param): Remove.
8744 Use b4_identification.
8745 Propagate b4_pure_args where needed to pass them to yyerror.
8746 * data/glr.m4 (b4_parse_param): Remove.
8747 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8748 (b4_lpure_formals): New.
8749 Use b4_identification.
8750 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8751 b4_user_formals and b4_user_args.
8752 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8753 (yyreportAmbiguity): When using a pure parser, also need
8754 the location, and the parse-params.
8755 Adjust callers.
8756 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8757 When using a pure parser, also need the parse-params.
8758 Adjust callers.
8759 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8760 (%pure-parser + %parse-param) LALR and GLR parsers.
8761 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8762 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8763 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8764 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8765 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8766 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8767 * doc/bison.texinfo: Untabify the whole file.
8768 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8769 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8770 (Error Reporting): Adjust to these new directives.
8771 Document %error-verbose, deprecate YYERROR_VERBOSE.
8772
8773 2002-11-03 Akim Demaille <akim@epita.fr>
8774
8775 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8776 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8777 command line options.
8778 * tests/cxx-type.at: Formatting changes.
8779
8780 2002-11-03 Paul Eggert <eggert@twinsun.com>
8781
8782 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8783 to count columns correctly, and to check for invalid inputs.
8784
8785 Use mbsnwidth to count columns correctly. Account for tabs, too.
8786 Include mbswidth.h.
8787 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8788 (extend_location): New function.
8789 (YY_LINES): Remove.
8790
8791 Handle CRLF in C code rather than in Lex code.
8792 (YY_INPUT): New macro.
8793 (no_cr_read): New function.
8794
8795 Scan UCNs, even though we don't fully handle them yet.
8796 (convert_ucn_to_byte): New function.
8797
8798 Handle backslash-newline correctly in C code.
8799 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8800 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8801 all uses changed.
8802 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8803 Use {splice} wherever C allows backslash-newline.
8804 YY_STEP after space, newline, vertical-tab.
8805 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
8806
8807 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8808
8809 ({int}, handle_action_dollar, handle_action_at): Check for integer
8810 overflow.
8811
8812 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8813
8814 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8815 as well as \000. Check for UCHAR_MAX, not 255.
8816 Allow \x with an arbitrary positive number of digits, as in C.
8817 Check for overflow here.
8818 Allow \? and UCNs, for compatibility with C.
8819
8820 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8821 with quote slot used by complain_at.
8822
8823 * tests/input.at: Add tests for backslash-newline, m4 quotes
8824 in symbols, long literals, and funny escapes in strings.
8825
8826 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8827 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8828 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8829 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8830 * m4/mbswidth.m4: New file, from GNU coreutils.
8831
8832 * doc/bison.texinfo (Grammar Outline): Document // comments.
8833 (Symbols): Document that trigraphs have no special meaning in Bison,
8834 nor is backslash-newline allowed.
8835 (Actions): Document that trigraphs have no special meaning.
8836
8837 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8838 no longer used.
8839
8840 2002-11-02 Paul Eggert <eggert@twinsun.com>
8841
8842 * src/reader.c: Don't include quote.h; not needed.
8843 (get_merge_function): Reword warning to be consistent with
8844 type clash diagnostic in grammar_current_rule_check.
8845
8846 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8847 bug in trigraph handling.
8848
8849 * src/output.c (prepare_symbols): When printing token names,
8850 escape "[" as "@<:@" and likewise for "]".
8851
8852 * src/system.h (errno): Remove declaration, as we are now
8853 assuming C89 or better, and C89 guarantees errno.
8854
8855 2002-10-30 Paul Eggert <eggert@twinsun.com>
8856
8857 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8858 Check for close failures.
8859 * src/files.h (xfclose): Return void, not int, since it always
8860 returned zero.
8861 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8862 indicates one.
8863 * src/output.c (output_skeleton): Use xfclose rather than fclose
8864 and ferror. xfclose now checks ferror.
8865
8866 * data/glr.c (YYLEFTMOST_STATE): Remove.
8867 (yyreportTree): Use a stack-based leftmost state. This avoids
8868 our continuing battles with bogus warnings about initializers.
8869
8870 2002-10-30 Akim Demaille <akim@epita.fr>
8871
8872 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8873 #if.
8874
8875 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8876
8877 * tests/glr-regr1.at: New test for reported regressions.
8878 * tests/testsuite.at: Add glr-regr1.at test.
8879 * tests/Makefile.am: Add glr-regr1.at test.
8880
8881 2002-10-24 Paul Eggert <eggert@twinsun.com>
8882
8883 Version 1.75a.
8884
8885 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
8886 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
8887 we use malloc. Don't assume 'A' through 'Z' are contiguous.
8888 Don't assume strdup exists; POSIX says its an XSI extension.
8889 Check for buffer overflow on input.
8890
8891 2002-10-24 Akim Demaille <akim@epita.fr>
8892
8893 * src/output.c (output_skeleton): Don't disable M4sugar comments
8894 too soon: it results in comments being expanded.
8895 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
8896 first output.
8897
8898 2002-10-24 Akim Demaille <akim@epita.fr>
8899
8900 * data/yacc.c (m4_int_type): New.
8901 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
8902 char' as only yacc.c wants K&R portability.
8903 * data/glr.c (yysigned_char): Remove.
8904 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8905 Reported by Quoc Peyrot.
8906
8907 2002-10-23 Paul Eggert <eggert@twinsun.com>
8908
8909 * src/main.c (main): With --trace=time, report times even if a
8910 non-fatal error occurs. Formerly, the times were reported in some
8911 such cases but not in others.
8912 * src/reader.c (reader): Just return if a complaint has been issued,
8913 instead of exiting, so that 'main' can report times.
8914
8915 2002-10-22 Akim Demaille <akim@epita.fr>
8916
8917 * src/system.h: Include sys/types.
8918 Reported by Bert Deknuydt.
8919
8920 2002-10-23 Paul Eggert <eggert@twinsun.com>
8921
8922 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8923 Suggested by Art Haas.
8924
8925 2002-10-22 Paul Eggert <eggert@twinsun.com>
8926
8927 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
8928 decl; not needed any more.
8929 * src/main.c (main): Use return to exit, undoing yesterday's change.
8930 The last OS that we could find where this wouldn't work is
8931 SunOS 3.5, and that's too old to worry about now.
8932
8933 * data/glr.c (struct yyltype): Define members even when not
8934 doing locations. This is more consistent with yacc.c, and it
8935 works around the following bug reports:
8936 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
8937 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
8938
8939 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
8940 @acronym consistently. Standardize on "Yacc" instead of "YACC",
8941 "Algol" instead of "ALGOL". Give a bit more history about BNF.
8942
8943 2002-10-22 Akim Demaille <akim@epita.fr>
8944
8945 * data/README: New.
8946
8947 2002-10-21 Paul Eggert <eggert@twinsun.com>
8948
8949 Be consistent about 'bool'; the old code used an enum in one
8950 module and an int in another, and this violates the C standard.
8951 * m4/stdbool.m4: New file, from coreutils 4.5.3.
8952 * configure.ac (AC_HEADER_STDBOOL): Add.
8953 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
8954 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
8955 * src/symtab.c (hash_compare_symbol_t): Likewise.
8956 * src/system.h (bool, false, true): Use a definition consistent
8957 with ../lib/hash.c. All uses changed.
8958
8959 * src/complain.c (warning_issued): Renamed from warn_message_count,
8960 so that we needn't worry about integer overflow (!).
8961 Now of type bool. All uses changed.
8962 (complaint_issued): Renamed from complain_message_count; likewise.
8963
8964 * src/main.c (main): Use exit to exit with failure.
8965
8966 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8967 rather than 1 and 0.
8968 * src/main.c (main): Likewise.
8969 * src/getargs.c (getargs): Likewise.
8970 * src/reader.c (reader): Likewise.
8971
8972 * src/getarg.c (getargs): Remove duplicate code for
8973 "Try `bison --help'".
8974
8975 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8976 What was that "2" for?
8977
8978 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8979 * src/getargs.c (usage): Likewise.
8980
8981 * src/getargs.c (getargs): When there are too few operands, report
8982 the last one. When there are too many, report the first extra
8983 one. This is how diffutils does it.
8984
8985 2002-10-20 Paul Eggert <eggert@twinsun.com>
8986
8987 Remove K&R vestiges.
8988 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8989 * src/complain.c (VA_START): Remove. Assume prototypes.
8990 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8991 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8992 fatal): Assume prototypes.
8993 * src/complain.h: Assume prototypes.
8994 * src/system.h (PARAMS): Remove.
8995 Include <limits.h> unconditionally, since it's guaranteeed even
8996 for a freestanding C89 compiler.
8997 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8998 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8999
9000 2002-10-20 Akim Demaille <akim@epita.fr>
9001
9002 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
9003 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
9004 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
9005 (yyresolveStates, yyresolveAction, yyresolveStack)
9006 (yyprocessOneStack): Use them.
9007 (yy_reduce_print): New.
9008 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
9009
9010 2002-10-20 Akim Demaille <akim@epita.fr>
9011
9012 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9013 arguments and output `void'.
9014 (b4_c_function): Rename as...
9015 (b4_c_function_def): this.
9016 (b4_c_function_decl, b4_c_ansi_function_def)
9017 (b4_c_ansi_function_decl): New.
9018 Change the interpretation of the arguments: before `int, foo', now
9019 `int foo, foo'.
9020 * data/yacc.c (yyparse): Prototype and define thanks to these.
9021 Adjust b4_c_function_def uses.
9022 * data/glr.c (yyparse): Likewise, but ANSI only.
9023
9024 2002-10-20 Akim Demaille <akim@epita.fr>
9025
9026 * src/output.c (prepare): Move the definition of `tokens_number',
9027 `nterms_number', `undef_token_number', `user_token_number_max'
9028 to...
9029 (prepare_tokens): Here.
9030 (prepare_tokens): Rename as...
9031 (prepare_symbols): this.
9032 (prepare): Move the definition of `rules_number' to...
9033 (prepare_rules): here.
9034 (prepare): Move the definition of `last', `final_state_number',
9035 `states_number' to...
9036 (prepare_states): here.
9037 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9038
9039 2002-10-20 Akim Demaille <akim@epita.fr>
9040
9041 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9042
9043 2002-10-20 Akim Demaille <akim@epita.fr>
9044
9045 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9046 * data/c.m4: here.
9047
9048 2002-10-20 Akim Demaille <akim@epita.fr>
9049
9050 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9051 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9052 `pair'.
9053 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9054 `name' to...
9055 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9056 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9057 These.
9058
9059 2002-10-19 Paul Eggert <eggert@twinsun.com>
9060
9061 Do not create a temporary file, as that involves security and
9062 cleanup headaches. Instead, use a pair of pipes.
9063 Derived from a suggestion by Florian Krohm.
9064 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9065 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9066 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9067 (BISON_PREREQ_SUBPIPE): Add.
9068 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9069 Add subpipe.h, subpipe.c.
9070 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9071 * po/POTFILES.in: Add lib/subpipe.c.
9072 * src/output.c: Include "subpipe.h".
9073 (m4_invoke): Remove decl.
9074 (scan_skel): New decl.
9075 (output_skeleton): Use pipe rather than temporary file for m4 input.
9076 Check that m4sugar.m4 is readable, to avoid deadlock.
9077 Check for pipe I/O error.
9078 * src/scan-skel.l (readpipe): Remove decl.
9079 (scan_skel): New function, to be used in place of m4_invoke.
9080 Read from stream rather than file.
9081
9082 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9083 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9084 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9085 this generates a more-accurate value anyway.
9086
9087 * lib/timevar.c (timervar_accumulate): Rename locals to
9088 avoid confusion with similarly-named more-global.
9089 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9090
9091 * src/output.c (prepare): Use xstrdup to convert char const *
9092 to char *, to avoid GCC warning.
9093
9094 2002-10-19 Akim Demaille <akim@epita.fr>
9095
9096 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9097 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9098 Use them to have `calc.y' ready for %pure-parser.
9099 * data/yacc.c (YYLEX): Pass a yylex return type to
9100 b4_c_function_call.
9101
9102 2002-10-19 Akim Demaille <akim@epita.fr>
9103
9104 Prototype support of %lex-param and %parse-param.
9105
9106 * src/parse-gram.y: Add the definition of the %lex-param and
9107 %parse-param tokens, plus their rules.
9108 Drop the `_' version of %glr-parser.
9109 Add the "," token.
9110 * src/scan-gram.l (INITIAL): Scan them.
9111 * src/muscle_tab.c: Comment changes.
9112 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9113 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9114 (muscle_entry_s): The `value' member is no longer const.
9115 Adjust all dependencies.
9116 * src/muscle_tab.c (muscle_init): Adjust: use
9117 MUSCLE_INSERT_STRING.
9118 Initialize the obstack earlier.
9119 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9120 (muscle_pair_list_grow): New.
9121 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9122 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9123 * tests/calc.at: Use %locations, not --locations.
9124 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9125
9126 2002-10-19 Akim Demaille <akim@epita.fr>
9127
9128 * src/getargs.c (usage): Take status as argument and exit
9129 accordingly.
9130 Report the traditional `Try ... --help' message when status != 0.
9131 (usage, version): Don't take a FILE * as arg, it is pointless.
9132 (getargs): When there is an incorrect number of arguments, make it
9133 an error, and report it GNUlically thanks to `usage ()'.
9134
9135 2002-10-18 Paul Eggert <eggert@twinsun.com>
9136
9137 * data/glr.c (yyreportParseError): Don't assume that sprintf
9138 yields the length of the printed string, as this is not true
9139 on SunOS 4.1.4. Reported by Peter Klein.
9140
9141 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9142 * tests/conflicts.at (%nonassoc and eof): Likewise.
9143 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9144
9145 2002-10-17 Akim Demaille <akim@epita.fr>
9146
9147 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9148 * src/getargs.c (trace_types, trace_args): Adjust.
9149 * src/reader.c (grammar_current_rule_prec_set)
9150 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9151 Standardize error messages.
9152 And s/@prec/%prec/!
9153 (reader): Use trace_flag to enable scanner/parser debugging,
9154 instead of an adhoc scheme.
9155 * src/scan-gram.l: Remove trailing debugging code.
9156
9157 2002-10-16 Paul Eggert <eggert@twinsun.com>
9158
9159 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9160 MUSCLE_TAB_H.
9161
9162 * NEWS: Officially drop support for building Bison with K&R C,
9163 since it didn't work anyway and it's not worth worrying about.
9164 * Makefile.maint (wget_files): Remove ansi2knr.c.
9165 (ansi2knr.c-url_prefix): Remove.
9166 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9167 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9168 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9169
9170 2002-10-15 Paul Eggert <eggert@twinsun.com>
9171
9172 Stop using the "enum_" trick for K&R-style function definitions;
9173 it confused me, and I was the author! Instead, assume that people
9174 who want to use K&R C compilers (when using these modules in GCC,
9175 perhaps?) will run ansi2knr.
9176
9177 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9178 All uses of "enum_" changed to "enum ".
9179 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9180 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9181
9182 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9183 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9184 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9185 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9186 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9187 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9188 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9189 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9190 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9191 Use function prototypes; this removes the need for declaring
9192 static functions simply to provide their prototypes.
9193 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9194 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9195 bitset_count_, bitset_create, bitset_dump, bitset_first,
9196 bitset_free, bitset_init, bitset_last, bitset_next,
9197 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9198 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9199 bitset_print, bitset_release_memory, bitset_toggle_,
9200 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9201 debug_bitset): Likewise.
9202 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9203 * lib/bitset_stats.c (bitset_log_histogram_print,
9204 bitset_percent_histogram_print, bitset_stats_and,
9205 bitset_stats_and_cmp, bitset_stats_and_or,
9206 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9207 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9208 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9209 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9210 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9211 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9212 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9213 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9214 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9215 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9216 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9217 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9218 bitset_stats_zero): Likewise.
9219 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9220 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9221 bitsetv_dump, debug_bitsetv): Likewise.
9222 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9223 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9224 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9225 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9226 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9227 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9228 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9229 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9230 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9231 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9232 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9233 Likewise.
9234 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9235 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9236 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9237 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9238 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9239 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9240 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9241 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9242 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9243 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9244 lbitset_xor_cmp, lbitset_zero): Likewise.
9245
9246 2002-10-14 Akim Demaille <akim@epita.fr>
9247
9248 Version 1.75.
9249
9250 2002-10-14 Akim Demaille <akim@epita.fr>
9251
9252 * tests/Makefile.am (maintainer-check-posix): New.
9253
9254 2002-10-14 Akim Demaille <akim@epita.fr>
9255
9256 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9257 member.
9258
9259 2002-10-14 Akim Demaille <akim@epita.fr>
9260
9261 * src/tables.c (table_ninf_remap): base -> tab.
9262 Reported by Matt Rosing.
9263
9264 2002-10-14 Paul Eggert <eggert@twinsun.com>
9265
9266 * tests/action.at, tests/calc.at, tests/conflicts.at,
9267 tests/cxx-type.at, tests/headers.at, tests/input.at,
9268 tests/regression.at, tests/synclines.at, tests/torture.at:
9269 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9270 so that the tests still work even if POSIXLY_CORRECT is set.
9271 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
9272
9273 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9274 for portability to K&R hosts. Fix typo: signed char is guaranteed
9275 only to 127, not to 128.
9276 * data/glr.c (yysigned_char): New type.
9277 * data/yacc.c (yysigned_char): Likewise.
9278 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9279
9280 2002-10-13 Paul Eggert <eggert@twinsun.com>
9281
9282 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9283 true due to limited range of data type" warning from GCC.
9284
9285 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9286 by wrapping enum yytokentype's definition inside #ifndef
9287 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9288
9289 2002-10-13 Akim Demaille <akim@epita.fr>
9290
9291 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9292 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9293
9294 2002-10-13 Akim Demaille <akim@epita.fr>
9295
9296 * Makefile.maint: Update from Autoconf 2.54.
9297 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9298
9299 2002-10-13 Akim Demaille <akim@epita.fr>
9300
9301 * src/print.c (print_state): Separate the list of solved conflicts
9302 from the other items.
9303 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9304
9305 2002-10-13 Akim Demaille <akim@epita.fr>
9306
9307 Let nondeterministic skeletons be usable with deterministic
9308 tables.
9309
9310 With the patch, GAWK compiled by GCC without -O2 passes its test
9311 suite using a GLR parser driven by LALR tables. It fails with -O2
9312 because `struct stat' gives two different answers on my machine:
9313 88 (definition of an auto var) and later 96 (memset on this var).
9314 Hence the stack is badly corrumpted. The headers inclusion is to
9315 blame: if I move the awk.h inclusion before GLR's system header
9316 inclusion, the two struct stat have the same size.
9317
9318 * src/tables.c (pack_table): Always create conflict_table.
9319 (token_actions): Always create conflict_list.
9320 * data/glr.c (YYFLAG): Remove, unused.
9321
9322 2002-10-13 Akim Demaille <akim@epita.fr>
9323
9324 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9325 (O0FLAGS): New.
9326 (VALGRIND, GXX): New.
9327 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9328 * tests/bison.in: Run $PREBISON a pre-command.
9329 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9330 (maintainer-check-g++): New.
9331 * Makefile.am (maintainer-check): New.
9332
9333 2002-10-13 Akim Demaille <akim@epita.fr>
9334
9335 * data/glr.c: Formatting changes.
9336 Tweak some trace messages to match yacc.c's.
9337
9338 2002-10-13 Akim Demaille <akim@epita.fr>
9339
9340 GLR parsers sometimes raise parse errors instead of performing the
9341 default reduction.
9342 Reported by Charles-Henry de Boysson.
9343
9344 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
9345 check the length of the traces when %glr.
9346 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9347 GLR's traces.
9348 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9349 Test GLR parsers.
9350 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9351 (yyltype): Remove the yy prefix from the member names.
9352 (yytable): Complete its comment.
9353 (yygetLRActions): Map error action number from YYTABLE from
9354 YYTABLE_NINF to 0.
9355 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9356 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9357 not satisfying as we could compare an YYACTION computed from
9358 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9359 only value for error actions.
9360 (yyreportParseError): In verbose parse error messages, don't issue
9361 `error' in the list of expected tokens.
9362 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9363 next action to perform to match glr.c's decoding.
9364 (yytable): Complete its comment.
9365
9366 2002-10-13 Paul Eggert <eggert@twinsun.com>
9367
9368 Fix problem reported by Henrik Grubbstroem in
9369 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
9370 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9371 because the Bison parser reads the second action before reducing
9372 the first one.
9373 * src/scan-gram.l (rule_length): New static var.
9374 Use it to keep track of the rule length in the scanner, since
9375 we can't expect the parser to be in lock-step sync with the scanner.
9376 (handle_action_dollar, handle_action_at): Use this var.
9377 * tests/actions.at (Exotic Dollars): Test for the problem.
9378
9379 2002-10-12 Paul Eggert <eggert@twinsun.com>
9380
9381 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9382 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9383 Include <sys/time.h> when checking for clock_t and struct tms.
9384 Use same include order as source.
9385 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
9386 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
9387
9388 * lib/timevar.c: Update copyright date and clarify comments.
9389 (get_time) [IN_GCC]: Keep the GCC version for reference.
9390
9391 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9392 GCC version as of today, then merge Bison's changes.
9393 Change "GCC" to "Bison" in copyright notice. timevar.def's
9394 author is Akim, so change that too.
9395
9396 * src/reader.c (grammar_current_rule_check):
9397 Don't worry about the default action if $$ is untyped.
9398 Prevents bogus warnings reported by Jim Gifford in
9399 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
9400
9401 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9402 * data/glr.c, data/lalr1.cc, data/yacc.c:
9403 Output token definitions before the first part of user declarations.
9404 Fixes compatibility problem reported by Jim Gifford for kbd in
9405 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
9406
9407 2002-10-11 Paul Eggert <eggert@twinsun.com>
9408
9409 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9410 (yyparse): here. This undoes some of the 2002-07-25 change.
9411 Compatibility problem reported by Ralf S. Engelschall with
9412 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9413
9414 2002-10-11 Akim Demaille <akim@epita.fr>
9415
9416 * tests/regression.at Characters Escapes): New.
9417 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9418 characters.
9419 Reported by Jan Nieuwenhuizen.
9420
9421 2002-10-11 Akim Demaille <akim@epita.fr>
9422
9423 * po/id.po: New.
9424
9425 2002-10-10 Paul Eggert <eggert@twinsun.com>
9426
9427 Portability fixes for bitsets; this also avoids several GCC
9428 warnings.
9429
9430 * lib/abitset.c: Include <stddef.h>, for offsetof.
9431 * lib/lbitset.c: Likewise.
9432
9433 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9434 properly for vectors of objects. Do not assume that adding a
9435 header size to a multiple of a word size yields a value that is
9436 properly aligned for the whole union.
9437 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9438
9439 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9440 unique names for structures.
9441 * lib/ebitset.c (ebitset_bytes): Likewise.
9442 * lib/lbitset.c (lbitset_bytes): Likewise.
9443
9444 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9445 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9446 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9447 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9448 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9449 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9450 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9451 to improve the type-checking that GCC can do.
9452 * lib/bitset.c (bitset_op4_cmp): Likewise.
9453 * lib/bitset_stats.c (bitset_stats_count,
9454 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9455 bitset_stats_copy, bitset_stats_disjoint_p,
9456 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9457 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9458 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9459 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9460 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9461 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9462 bitset_stats_or_and_cmp): Likewise.
9463 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9464 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9465 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9466 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9467
9468 * lib/abitset.h: Include bitset.h, not bbitset.h.
9469 * lib/ebitset.h: Likewise.
9470 * lib/lbitset.h: Likewise.
9471
9472 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9473 All instances of parameters of type enum bitset_opts are now of
9474 type enum_bitset_opts, to conform to the C Standard, and similarly
9475 for enum_bitset_type.
9476 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9477 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9478
9479 Do not use "struct bitset_struct" to mean different things in
9480 different modules. Not only is this confusing, it violates
9481 the C Standard, which requires that structure types in different
9482 modules must be compatible if one is to be passed to the other.
9483 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9484 All instances of "struct bitset_struct *" replaced with "bitset".
9485 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9486 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9487 struct lbitset_struct, struct bitset_stats_struct): New types.
9488 All uses of struct bitset_struct changed to union bitset_union,
9489 etc.
9490 * lib/abitset.c (struct abitset_struct, abitset,
9491 struct bitset_struct): Remove.
9492 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9493 struct bitset_struct): Remove.
9494 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9495 bitset_struct): Remove.
9496 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9497 Likewise.
9498
9499 Do not call a function of type T using a call that assumes the
9500 function is of a different type U. Standard C requires that a
9501 function must be called with a type that is compatible with its
9502 definition.
9503 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9504 New decls.
9505 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9506 New functions.
9507 * lib/ebitset.c (PFV): Remove.
9508 * lib/lbitset.c (PFV): Likewise.
9509 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9510 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9511 decls.
9512 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9513 (ebitset_vtable): Use them.
9514 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9515 lbitset_xor): New functions.
9516 (lbitset_vtable): Use them.
9517
9518 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9519 Declare.
9520
9521 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9522 GCC warning.
9523 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9524 Use offsetof, for simplicity.
9525
9526 2002-10-06 Paul Eggert <eggert@twinsun.com>
9527
9528 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9529 the same width as int. This reapplies a hunk of the 2002-08-12 patch
9530 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
9531 which was inadvertently undone by the 2002-09-30 patch.
9532 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9533 the same width as int.
9534
9535 2002-10-04 Paul Eggert <eggert@twinsun.com>
9536
9537 Version 1.50.
9538
9539 * configure.ac (AC_INIT), NEWS: Increment version number.
9540
9541 * doc/bison.texinfo: Minor spelling, grammar, and white space
9542 fixes.
9543 (Symbols): Mention that any negative value returned from yylex
9544 signifies end-of-input. Warn about negative chars. Mention
9545 the portable Standard C character set.
9546
9547 The GNU coding standard says CFLAGS and YFLAGS are reserved
9548 for the installer to set.
9549 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9550 * src/Makefile.am (AM_CFLAGS): Likewise.
9551 (AM_YFLAGS): Renamed from YFLAGS.
9552
9553 Fix some MAX and MIN problems.
9554 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9555 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9556 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9557 * src/reader.c (reader): Use it.
9558
9559 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9560 POSIX 1003.1-2001 has removed fgrep.
9561
9562 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9563
9564 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9565 interpreted as signed.
9566 * lib/ebitset.c (ebitset_list): Fix bug.
9567
9568 2002-10-01 Paul Eggert <eggert@twinsun.com>
9569
9570 More fixes for 64-bit hosts and large bitsets.
9571
9572 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9573 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9574 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9575 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9576 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9577 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9578 bitset_count_): Likewise.
9579 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9580 bitset_first, bitset_last): Likewise.
9581 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9582 bitset_stats_list_reverse, bitset_stats_size,
9583 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9584 Likewise.
9585 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9586 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9587 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9588 bitsetv_reflexive_transitive_closure): Likewise.
9589 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9590 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9591 Likewise.
9592 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9593 Likewise.
9594
9595 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
9596 Use size_t, not unsigned int, to count bytes.
9597 * lib/abitset.h (abitset_bytes): Likewise.
9598 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
9599 Likewise.
9600 * lib/bitset.h (bitset_bytes): Likewise.
9601 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
9602 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
9603 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9604 * lib/ebitset.c (ebitset_bytes): Likewise.
9605 * lib/ebitset.h (ebitset_bytes): Likewise.
9606 * lib/lbitset.c (lbitset_bytes): Likewise.
9607 * lib/lbitset.h (lbitset_bytes): Likewise.
9608
9609 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
9610 abitset_subset_p, abitset_disjoint_p, abitset_and,
9611 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
9612 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
9613 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
9614 abitset_or_and, abitset_or_and_cmp):
9615 Use bitset_windex instead of unsigned int.
9616 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9617 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
9618 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
9619 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
9620 Likewise.
9621 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
9622
9623 * lib/bitset.c (bitset_print):
9624 Use proper printf formats for widths of integer types.
9625 * lib/bitset_stats.c (bitset_percent_histogram_print,
9626 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
9627 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9628 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9629 * lib/lbitset.c (lbitset_bytes): Likewise.
9630
9631 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
9632 BITSET_SIZE_MAX): New macros.
9633 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
9634 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
9635 to BITSET_WINDEX_MAX.
9636
9637 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
9638 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
9639 since we now return the bitset_bindex type (not int).
9640
9641 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9642 when computing sizes.
9643 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9644
9645 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9646 and avoid cast to unsigned.
9647
9648 2002-09-30 Akim Demaille <akim@epita.fr>
9649
9650 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9651 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
9652 Updates from Michael Hayes.
9653
9654 2002-09-30 Art Haas <ahaas@neosoft.com>
9655
9656 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9657 invocations.
9658 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9659 defined.
9660
9661 2002-09-27 Akim Demaille <akim@epita.fr>
9662
9663 Version 1.49c.
9664
9665 2002-09-27 Akim Demaille <akim@epita.fr>
9666
9667 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9668 (Because of AC_LIBSOURCE).
9669
9670 2002-09-27 Akim Demaille <akim@epita.fr>
9671
9672 Playing with Autoscan.
9673
9674 * configure.ac: Remove the old LIBOBJ tweaks.
9675 (AC_REPLACE_FUNCS): Add strrchr and strtol.
9676 * lib/strrchr.c: New.
9677 * lib/strtol.c: New, from the Coreutils 4.5.1.
9678
9679 2002-09-27 Akim Demaille <akim@epita.fr>
9680
9681 Playing with Autoscan.
9682
9683 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
9684 * lib/Makefile.am (libbison_a_SOURCES): No longer include
9685 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
9686 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
9687 Coreutils 4.5.1.
9688
9689 2002-09-24 Akim Demaille <akim@epita.fr>
9690
9691 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9692 (Frequently Asked Questions, Parser Stack Overflow): New.
9693
9694 2002-09-13 Akim Demaille <akim@epita.fr>
9695
9696 Playing with autoscan.
9697
9698 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
9699 * src/files.c (skeleton_find): Remove, unused.
9700 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
9701 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
9702
9703 2002-09-13 Akim Demaille <akim@epita.fr>
9704
9705 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9706 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9707
9708 2002-09-13 Akim Demaille <akim@epita.fr>
9709
9710 * configure.ac: Require 2.54.
9711 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
9712 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
9713 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
9714 Remove, provided by Autoconf macros.
9715
9716 2002-09-12 Akim Demaille <akim@epita.fr>
9717
9718 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9719
9720 2002-09-12 Akim Demaille <akim@epita.fr>
9721
9722 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9723 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9724 Reported by Martin Mokrejs.
9725
9726 2002-09-10 Akim Demaille <akim@epita.fr>
9727
9728 * src/parse-gram.y: Associate a human readable string to each
9729 token type.
9730 * tests/regression.at (Invalid inputs): Adjust.
9731
9732 2002-09-10 Gary V. Vaughan <gary@gnu.org>
9733
9734 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9735 with an Autoconf-2.5x style configure.ac.
9736
9737 2002-09-06 Paul Eggert <eggert@twinsun.com>
9738
9739 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9740 exception applies only to yacc.c. This is a modification of a
9741 patch originally suggested by Akim Demaille.
9742
9743 2002-09-06 Akim Demaille <akim@epita.fr>
9744
9745 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9746 here to...
9747 * data/yacc.c: here.
9748
9749 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9750 LocationType.
9751 (b4_ltype): Default to yy::Location from location.hh.
9752
9753 2002-09-04 Jim Meyering <jim@meyering.net>
9754
9755 * data/yacc.c: Guard the declaration of yytoknum also with
9756 `#ifdef YYPRINT', so it is declared only when used.
9757
9758 2002-09-04 Akim Demaille <akim@epita.fr>
9759
9760 * configure.in: Rename as...
9761 * configure.ac: this.
9762 Bump to 1.49c.
9763
9764 2002-09-04 Akim Demaille <akim@epita.fr>
9765
9766 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9767 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9768 translate maintainer only messages.
9769
9770 2002-08-12 Paul Eggert <eggert@twinsun.com>
9771
9772 Version 1.49b.
9773
9774 * Makefile.am (SUBDIRS): Remove intl.
9775 (DISTCLEANFILES): Remove.
9776 * NEWS: Mention that GNU M4 is now required. Clarify what is
9777 meant by "larger grammars". Mention the pt_BR translation.
9778 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9779 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9780 Bump version from 0.11.2 to 0.11.5.
9781 (BISON_PREREQ_STAGE): Remove.
9782 (AM_GNU_GETTEXT): Use external gettext.
9783 (AC_OUTPUT): Remove intl/Makefile.
9784
9785 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9786
9787 * data/glr.c: Include string.h, for strlen.
9788 (yyreportParseError): Use size_t for yysize.
9789 (yy_yypstack): No longer nested inside yypstates, as nested
9790 functions are not portable. Do not assume size_t is the
9791 same width as int.
9792 (yypstates): Do not assume that ptrdiff_t is the same width
9793 as int, and similarly for yyposn and YYINDEX.
9794
9795 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9796
9797 * lib/Makefile.am (INCLUDES): Do not include from the intl
9798 directory, which has been removed.
9799 * src/Makefile.am (INCLUDES): Likewise.
9800
9801 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9802 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9803 New vars.
9804
9805 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9806 * tests/Makefile.am (EXTRA_DIST): Likewise.
9807
9808 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9809 Do not assume that bitset_windex is the same width as unsigned.
9810
9811 * lib/abitset.c (abitset_unused_clear): Do not assume that
9812 bitset_word is the same width as int.
9813 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9814 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9815 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9816 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9817 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9818
9819 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9820 portability to one's complement hosts!).
9821 * lib/ebitset.c (ebitset_op1): Likewise.
9822 * lib/lbitset.c (lbitset_op1): Likewise.
9823
9824 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9825 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9826 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9827 Sync with fileutils.
9828 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9829 lib/gettext.h: Sync with diffutils.
9830
9831 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9832 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9833
9834 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9835 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9836 check for void *.
9837
9838 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9839 size_t; the old version tried to do this but casted improperly.
9840 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9841 (bitset_test): Now returns int, not unsigned long.
9842
9843 * lib/bitset_stats.c: Include "gettext.h".
9844 (_): New macro.
9845 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9846 name locals "index", as it generates unnecessary warnings on some
9847 hosts that have an "index" function.
9848
9849 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9850 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9851 they need translation.
9852 * src/LR0.c (state_list_append, new_itemsets, get_state,
9853 append_states, generate_states): Likewise.
9854 * src/assoc.c (assoc_to_string): Likewise.
9855 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9856 * src/gram.c (grammar_dump): Likewise.
9857 * src/injections.c (injections_compute): Likewise.
9858 * src/lalr.c (lookaheads_print): Likewise.
9859 * src/relation.c (relation_transpose): Likewise.
9860 * src/scan-gram.l: Likewise.
9861 * src/tables.c (table_grow, pack_vector): Likewise.
9862
9863 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9864 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9865 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9866 * m4/mbstate_t.m4: Sync with fileutils.
9867 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9868
9869 * po/LINGUAS: Add pt_BR.
9870 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9871 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9872 lib/timevar.c.
9873 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9874 manual recommends.
9875 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9876
9877 * src/complain.c (strerror_r): Remove decl; not needed.
9878 (strerror): Use same pattern as ../lib/error.c.
9879
9880 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9881
9882 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9883
9884 * src/main.c (main): Cast result of bindtextdomain and textdomain
9885 to void, to avoid a GCC warning when --disable-nls is in effect.
9886
9887 * src/scan-gram.l: Use strings rather than escapes when possible,
9888 to minimize the number of warnings from xgettext.
9889 (handle_action_dollar, handle_action_at): Don't use isdigit,
9890 as it mishandles negative chars and it may not work as expected
9891 outside the C locale.
9892
9893 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
9894 this is a GCC extension and is not portable to other compilers.
9895
9896 * src/system.h (alloca): Use same pattern as ../lib/error.c.
9897 Do not include <ctype.h>; no longer needed.
9898 Do not include <malloc.h>; no longer needed (and generates
9899 warnings on OpenBSD 3.0).
9900
9901 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9902 it's not portable.
9903
9904 * tests/regression.at: Do not use 'cc -c input.c -o input';
9905 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
9906
9907 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
9908 exit status as failure, not just exit status 1. Sun C exits
9909 with status 2 sometimes.
9910
9911 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9912 Use it for the two large tests.
9913
9914 2002-08-02 Akim Demaille <akim@epita.fr>
9915
9916 * src/conflicts.c (conflicts_output): Don't output rules never
9917 reduced here, since anyway that computation doesn't work.
9918 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
9919 (rule_useless_p, rule_never_reduced_p): New.
9920 (grammar_rules_partial_print): Use a filter instead of a range.
9921 Display the title only if needed.
9922 (grammar_rules_print): Adjust.
9923 (grammar_rules_never_reduced_report): New.
9924 * src/tables.c (action_row): Move the computation of rules never
9925 reduced to...
9926 (token_actions): here.
9927 * src/main.c (main): Make the parser before making the report, so
9928 that rules never reduced are computed.
9929 Call grammar_rules_never_reduced_report.
9930 * src/print.c (print_results): Report rules never reduced.
9931 * tests/conflicts.at, tests/reduce.at: Adjust.
9932
9933 2002-08-01 Akim Demaille <akim@epita.fr>
9934
9935 Instead of attaching lookaheads and duplicating the rules being
9936 reduced by a state, attach the lookaheads to the reductions.
9937
9938 * src/state.h (state_t): Remove the `lookaheads',
9939 `lookaheads_rule' member.
9940 (reductions_t): Add a `lookaheads' member.
9941 Use a regular array for the `rules'.
9942 * src/state.c (reductions_new): Initialize the lookaheads member
9943 to 0.
9944 (state_rule_lookaheads_print): Adjust.
9945 * src/state.h, src/state.c (state_reductions_find): New.
9946 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
9947 (count_rr_conflicts): Adjust.
9948 * src/lalr.c (LArule): Remove.
9949 (add_lookback_edge): Adjust.
9950 (state_lookaheads_count): New.
9951 (states_lookaheads_initialize): Merge into...
9952 (initialize_LA): this.
9953 (lalr_free): Adjust.
9954 * src/main.c (main): Don't free nullable and derives too early: it
9955 is used by --verbose.
9956 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
9957
9958 2002-08-01 Akim Demaille <akim@epita.fr>
9959
9960 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9961 `rule_number_t**'.
9962 (set_derives, free_derives): Rename as...
9963 (derives_compute, derives_free): this.
9964 Adjust all dependencies.
9965 * src/nullable.c (set_nullable, free_nullable): Rename as...
9966 (nullable_compute, nullable_free): these.
9967 (rule_list_t): Store rule_t *, not rule_number_t.
9968 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9969 pointers, instead of their numbers.
9970 * src/main.c (main): Call nullable_free, and derives_free earlier,
9971 as they were lo longer used.
9972
9973 2002-08-01 Akim Demaille <akim@epita.fr>
9974
9975 * lib/timevar.c (get_time): Include children time.
9976 * src/lalr.h (LA, LArule): Don't export them: used with the
9977 state_t.
9978 * src/lalr.c (LA, LArule): Static.
9979 * src/lalr.h, src/lalr.c (lalr_free): New.
9980 * src/main.c (main): Call it.
9981 * src/tables.c (pack_vector): Check whether loc is >= to the
9982 table_size, not >.
9983 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9984 (tables_generate): do it, since that's also it which allocates
9985 them.
9986 Don't free LA and LArule, main does.
9987
9988 2002-07-31 Akim Demaille <akim@epita.fr>
9989
9990 Separate parser tables computation and output.
9991
9992 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9993 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9994 (yydefgoto, yydefact, high): Move to...
9995 * src/tables.h, src/tables.c: here.
9996 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9997 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9998 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9999 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
10000 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
10001 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
10002 (action_row, save_row, token_actions, save_column, default_goto)
10003 (goto_actions, sort_actions, matching_state, pack_vector)
10004 (table_ninf_remap, pack_table, prepare_actions): Move to...
10005 * src/tables.c: here.
10006 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
10007 * src/output.c (token_actions, output_base, output_conflicts)
10008 (output_check): Merge into...
10009 (prepare_actions): this.
10010 (actions_output): Rename as...
10011 (user_actions_output): this.
10012 * src/main.c (main): Call tables_generate and tables_free.
10013
10014 2002-07-31 Akim Demaille <akim@epita.fr>
10015
10016 Steal GCC's --time-report support.
10017
10018 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10019 stolen/adjusted from GCC.
10020 * m4/stage.m4: Remove time related checks.
10021 * m4/timevar.m4: New.
10022 * configure.in: Adjust.
10023 * src/system.h: Adjust to using timevar.h.
10024 * src/getargs.h, src/getargs.c: Support trace_time for
10025 --trace=time.
10026 * src/main.c (stage): Remove.
10027 (main): Replace `stage' invocations with timevar calls.
10028 * src/output.c: Insert pertinent timevar calls.
10029
10030 2002-07-31 Akim Demaille <akim@epita.fr>
10031
10032 Let --trace have arguments.
10033
10034 * src/getargs.h (enum trace_e): New.
10035 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10036 (long_options, short_options): --trace/-T takes an optional
10037 argument.
10038 Change all the uses of trace_flag to reflect the new flags.
10039 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10040
10041 Strengthen `stage' portability.
10042
10043 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10044 * configure.in: Use it.
10045 Don't check for malloc.h and sys/times.h.
10046 * src/system.h: Include them when appropriate.
10047 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10048 times and struct tms are available.
10049
10050 2002-07-30 Akim Demaille <akim@epita.fr>
10051
10052 In verbose parse error message, don't report `error' as an
10053 expected token.
10054 * tests/actions.at (Printers and Destructors): Adjust.
10055 * tests/calc.at (Calculator $1): Adjust.
10056 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10057 error message, do not report the parser accepts the error token in
10058 that state.
10059
10060 2002-07-30 Akim Demaille <akim@epita.fr>
10061
10062 Normalize conflict related messages.
10063
10064 * src/complain.h, src/complain.c (warn, complain): New.
10065 * src/conflicts.c (conflicts_print): Use them.
10066 (conflict_report_yacc): New, extracted from...
10067 (conflicts_print): here.
10068 * tests/conflicts.at, tests/existing.at: Adjust.
10069
10070 2002-07-30 Akim Demaille <akim@epita.fr>
10071
10072 Report rules which are never reduced by the parser: those hidden
10073 by conflicts.
10074
10075 * src/LR0.c (save_reductions): Don't make the final state too
10076 different: save its reduction (accept) instead of having a state
10077 without any action (no shift or goto, no reduce).
10078 Note: the final state is now a ``regular'' state, i.e., the
10079 parsers now contain `reduce 0' as default reduction.
10080 Nevertheless, since they decide to `accept' when yystate =
10081 final_state, they still will not reduce rule 0.
10082 * src/print.c (print_actions, print_reduction): Adjust.
10083 * src/output.c (action_row): Track reduced rules.
10084 (token_actions): Report rules never reduced.
10085 * tests/conflicts.at, tests/regression.at: Adjust.
10086
10087 2002-07-30 Akim Demaille <akim@epita.fr>
10088
10089 `stage' was accidently included in a previous patch.
10090 Initiate its autoconfiscation.
10091
10092 * configure.in: Look for malloc.h and sys/times.h.
10093 * src/main.c (stage): Adjust.
10094 Report only when trace_flag.
10095
10096 2002-07-29 Akim Demaille <akim@epita.fr>
10097
10098 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10099 state_number_t.
10100 (errs_t): symbol_t*, not symbol_number_t.
10101 (reductions_t): rule_t*, not rule_number_t.
10102 (FOR_EACH_SHIFT): New.
10103 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10104 * src/print.c, src/print_graph.c: Adjust.
10105
10106 2002-07-29 Akim Demaille <akim@epita.fr>
10107
10108 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10109
10110 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10111 (endtoken, accept): these.
10112 * src/reader.c (reader): Set endtoken's default tag to "$end".
10113 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10114 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10115 Adjust.
10116
10117 2002-07-29 Akim Demaille <akim@epita.fr>
10118
10119 * src/reduce.c (reduce_grammar): When the language is empty,
10120 complain about the start symbol, not the axiom.
10121 Use its location.
10122 * tests/reduce.at (Empty Language): New.
10123
10124 2002-07-26 Akim Demaille <akim@epita.fr>
10125
10126 * src/reader.h, src/reader.c (gram_error): ... can't get
10127 yycontrol without making too strong assumptions on the parser
10128 itself.
10129 * src/output.c (prepare_tokens): Use the real 0th value of
10130 token_translations instead of `0'.
10131 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10132 visible here.
10133 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10134 for the time being: %locations ought to provide it to yyerror.
10135
10136 2002-07-25 Akim Demaille <akim@epita.fr>
10137
10138 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10139 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10140 * tests/regression.at (Web2c Actions): Adjust.
10141
10142 2002-07-25 Akim Demaille <akim@epita.fr>
10143
10144 Stop storing rules from 1 to nrules + 1.
10145
10146 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10147 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10148 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10149 Iterate from 0 to nrules.
10150 Use rule_number_as_item_number and item_number_as_rule_number.
10151 Adjust to `derive' now containing possibly 0.
10152 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10153 Handle the `- 1' part in rule numbers from/to item numbers.
10154 * src/conflicts.c (log_resolution): Fix the message which reversed
10155 shift and reduce.
10156 * src/output.c (action_row): Initialize default_rule to -1.
10157 (token_actions): Adjust.
10158 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10159 expected output.
10160 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10161
10162 2002-07-25 Akim Demaille <akim@epita.fr>
10163
10164 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10165 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10166 (b4_c_knr_arg_decl): New.
10167 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10168 yyreport_parse_error.
10169
10170 2002-07-25 Akim Demaille <akim@epita.fr>
10171
10172 * data/yacc.c (yyreport_parse_error): New, extracted from...
10173 (yyparse): here.
10174 (yydestruct, yysymprint): Move above yyparse.
10175 Be K&R compliant.
10176
10177 2002-07-25 Akim Demaille <akim@epita.fr>
10178
10179 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10180 replace...
10181 (b4_sint_type, b4_uint_type): these.
10182 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10183 * tests/regression.at (Web2c Actions): Adjust.
10184
10185 2002-07-25 Akim Demaille <akim@epita.fr>
10186
10187 * src/gram.h (TIEM_NUMBER_MAX): New.
10188 (item_number_of_rule_number, rule_number_of_item_number): Rename
10189 as...
10190 (rule_number_as_item_number, item_number_as_rule_number): these.
10191 Adjust dependencies.
10192 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10193 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10194 (symbol_number_to_vector_number): New.
10195 (order): Of vector_number_t* type.
10196 (base_t, BASE_MAX, BASE_MIN): New.
10197 (froms, tos, width, pos, check): Of base_t type.
10198 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10199 (actrow): Of action_number_t type.
10200 (conflrow): Of unsigned int type.
10201 (table_ninf, base_ninf): New.
10202 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10203 (muscle_insert_int_table, muscle_insert_base_table)
10204 (muscle_insert_rule_number_table): New.
10205 (prepare_tokens): Output `toknum' as int_table.
10206 (action_row): Returns a rule_number_t.
10207 Use ACTION_MIN, not SHRT_MIN.
10208 (token_actions): yydefact is rule_number_t*.
10209 (table_ninf_remap): New.
10210 (pack_table): Use it for `base' and `table'.
10211 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10212 replaced with...
10213 (YYPACT_NINF, YYTABLE_NINF): these.
10214 (yypact, yytable): Compute their types instead of hard-coded
10215 `short'.
10216 * tests/regression.at (Web2c Actions): Adjust.
10217
10218 2002-07-19 Akim Demaille <akim@epita.fr>
10219
10220 * src/scan-gram.l (id): Can start with an underscore.
10221
10222 2002-07-16 Akim Demaille <akim@epita.fr>
10223
10224 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10225 Adjust all former `associativity' dependencies.
10226 * src/symtab.c (symbol_new): Default associativity is `undef', not
10227 `right'.
10228 (symbol_check_alias_consistence): Adjust.
10229
10230 2002-07-09 Akim Demaille <akim@epita.fr>
10231
10232 * doc/bison.texinfo: Properly set the ``header'' part.
10233 Use @dircategory ``GNU programming tools'' as per Texinfo's
10234 documentation.
10235 Use @copying.
10236
10237 2002-07-09 Akim Demaille <akim@epita.fr>
10238
10239 * lib/quotearg.h: Protect against multiple inclusions.
10240 * src/location.h (location_t): Add a `file' member.
10241 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10242 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10243 `error_one_per_line' support.
10244
10245 2002-07-09 Akim Demaille <akim@epita.fr>
10246
10247 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10248 * src/reader.c (lineno): Remove.
10249 Adjust all dependencies.
10250 (get_merge_function): Take a location and use complain_at.
10251 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10252 * tests/regression.at (Invalid inputs, Mixing %token styles):
10253 Adjust.
10254
10255 2002-07-09 Akim Demaille <akim@epita.fr>
10256
10257 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10258 recovery rule, and forbid extensions when --yacc.
10259 (gram_error): Use complain_at.
10260 * src/reader.c (reader): Exit if there were parse errors.
10261
10262 2002-07-09 Akim Demaille <akim@epita.fr>
10263
10264 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10265 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10266 Reported by R Blake <blakers@mac.com>.
10267
10268 2002-07-09 Akim Demaille <akim@epita.fr>
10269
10270 * data/yacc.c: Output the copyright notive in the header.
10271
10272 2002-07-03 Akim Demaille <akim@epita.fr>
10273
10274 * src/output.c (froms, tos): Are state_number_t.
10275 (save_column): sp, sp1, and sp2 are state_number_t.
10276 (prepare): Rename `final' as `final_state_number', `nnts' as
10277 `nterms_number', `nrules' as `rules_number', `nstates' as
10278 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10279 unused.
10280 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10281 * data/lalr1.cc (nsym_): Remove, unused.
10282
10283 2002-07-03 Akim Demaille <akim@epita.fr>
10284
10285 * src/lalr.h, src/lalr.c (goto_number_t): New.
10286 * src/lalr.c (goto_list_t): New.
10287 Propagate them.
10288 * src/nullable.c (rule_list_t): New.
10289 Propagate.
10290 * src/types.h: Remove.
10291
10292 2002-07-03 Akim Demaille <akim@epita.fr>
10293
10294 * src/closure.c (print_fderives): Use rule_rhs_print.
10295 * src/derives.c (print_derives): Use rule_rhs_print.
10296 (rule_list_t): New, replaces `shorts'.
10297 (set_derives): Add comments.
10298 * tests/sets.at (Nullable, Firsts): Adjust.
10299
10300 2002-07-03 Akim Demaille <akim@epita.fr>
10301
10302 * src/output.c (prepare_actions): Free `tally' and `width'.
10303 (prepare_actions): Allocate and free `order'.
10304 * src/symtab.c (symbols_free): Free `symbols'.
10305 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10306 * src/output.c (m4_invoke): Move to...
10307 * src/scan-skel.l: here.
10308 (<<EOF>>): Close yyout, and free its name.
10309
10310 2002-07-03 Akim Demaille <akim@epita.fr>
10311
10312 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10313
10314 * src/LR0.c (new_state): Merge into...
10315 (state_list_append): this.
10316 (new_states): Merge into...
10317 (generate_states): here.
10318 (set_states): Don't ensure a proper `errs' state member here, do it...
10319 * src/conflicts.c (conflicts_solve): here.
10320 * src/state.h, src/state.c: Comment changes.
10321 (state_t): Rename member `shifts' as `transitions'.
10322 Adjust all dependencies.
10323 (errs_new): For consistency, also take the values as argument.
10324 (errs_dup): Remove.
10325 (state_errs_set): New.
10326 (state_reductions_set, state_transitions_set): Assert that no
10327 previous value was assigned.
10328 (state_free): New.
10329 (states_free): Use it.
10330 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10331 temporary storage: use `errs' and `nerrs' as elsewhere.
10332 (set_conflicts): Allocate and free this `errs'.
10333
10334 2002-07-02 Akim Demaille <akim@epita.fr>
10335
10336 * lib/libiberty.h: New.
10337 * lib: Update the bitset implementation from upstream.
10338 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10339 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10340 * src/main.c: Adjust bitset stats calls.
10341
10342 2002-07-01 Paul Eggert <eggert@twinsun.com>
10343
10344 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10345 char, so that negative chars don't collide with $.
10346
10347 2002-06-30 Akim Demaille <akim@epita.fr>
10348
10349 Have the GLR tests be `warning' checked, and fix the warnings.
10350
10351 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10352 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10353 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10354 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10355 (yyaddDeferredAction): static.
10356 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10357 (yyreportParseError): yyprefix is const.
10358 yytokenp is used only when verbose.
10359 (yy__GNUC__): Replace with __GNUC__.
10360 (yypdumpstack): yyi is size_t.
10361 (yypreference): Un-yy local variables and arguments, to avoid
10362 clashes with `yyr1'. Anyway, we are not in the user name space.
10363 (yytname_size): be an int, as is compared with ints.
10364 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10365 Use them.
10366 * tests/cxx-gram.at: Use quotation to protect $1.
10367 Use AT_COMPILE to enable warnings hunts.
10368 Prototype yylex and yyerror.
10369 `Use' argc.
10370 Include `string.h', not `strings.h'.
10371 Produce and prototype stmtMerge only when used.
10372 yylex takes a location.
10373
10374 2002-06-30 Akim Demaille <akim@epita.fr>
10375
10376 We spend a lot of time in quotearg, in particular when --verbose.
10377
10378 * src/symtab.c (symbol_get): Store a quoted version of the key.
10379 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10380 Adjust all callers.
10381
10382 2002-06-30 Akim Demaille <akim@epita.fr>
10383
10384 * src/state.h (reductions_t): Rename member `nreds' as num.
10385 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10386 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10387
10388 2002-06-30 Akim Demaille <akim@epita.fr>
10389
10390 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10391 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10392 (shifts_to): Rename as...
10393 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10394 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10395 (TRANSITION_IS_DISABLED, transitions_to): these.
10396
10397 2002-06-30 Akim Demaille <akim@epita.fr>
10398
10399 * src/print.c (print_shifts, print_gotos): Merge into...
10400 (print_transitions): this.
10401 (print_transitions, print_errs, print_reductions): Align the
10402 lookaheads columns.
10403 (print_core, print_transitions, print_errs, print_state,
10404 print_grammar): Output empty lines separator before, not after.
10405 (state_default_rule_compute): Rename as...
10406 (state_default_rule): this.
10407 * tests/conflicts.at (Defaulted Conflicted Reduction),
10408 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10409 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10410
10411 2002-06-30 Akim Demaille <akim@epita.fr>
10412
10413 Display items as we display rules.
10414
10415 * src/gram.h, src/gram.c (rule_lhs_print): New.
10416 * src/gram.c (grammar_rules_partial_print): Use it.
10417 * src/print.c (print_core): Likewise.
10418 * tests/conflicts.at (Defaulted Conflicted Reduction),
10419 (Unresolved SR Conflicts): Adjust.
10420 (Unresolved SR Conflicts): Adjust and rename as...
10421 (Resolved SR Conflicts): this, as was meant.
10422 * tests/regression.at (Web2c Report): Adjust.
10423
10424 2002-06-30 Akim Demaille <akim@epita.fr>
10425
10426 * src/print.c (state_default_rule_compute): New, extracted from...
10427 (print_reductions): here.
10428 Pessimize, but clarify the code.
10429 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10430
10431 2002-06-30 Akim Demaille <akim@epita.fr>
10432
10433 * src/output.c (action_row): Let default_rule be always a rule
10434 number.
10435
10436 2002-06-30 Akim Demaille <akim@epita.fr>
10437
10438 * src/closure.c (print_firsts, print_fderives, closure):
10439 Use BITSET_EXECUTE.
10440 * src/lalr.c (lookaheads_print): Likewise.
10441 * src/state.c (state_rule_lookaheads_print): Likewise.
10442 * src/print_graph.c (print_core): Likewise.
10443 * src/print.c (print_reductions): Likewise.
10444 * src/output.c (action_row): Likewise.
10445 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10446
10447 2002-06-30 Akim Demaille <akim@epita.fr>
10448
10449 * src/print_graph.c: Use report_flag.
10450
10451 2002-06-30 Akim Demaille <akim@epita.fr>
10452
10453 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10454 to...
10455 * src/relation.h, src/relation.c (traverse, relation_digraph)
10456 (relation_print, relation_transpose): New.
10457
10458 2002-06-30 Akim Demaille <akim@epita.fr>
10459
10460 * src/state.h, src/state.c (shifts_to): New.
10461 * src/lalr.c (build_relations): Use it.
10462
10463 2002-06-30 Akim Demaille <akim@epita.fr>
10464
10465 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10466 (item_number_of_rule_number, rule_number_of_item_number): New.
10467 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10468 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10469 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10470 Propagate their use.
10471 Much remains to be done, in particular wrt `shorts' from types.h.
10472
10473 2002-06-30 Akim Demaille <akim@epita.fr>
10474
10475 * src/symtab.c (symbol_new): Initialize the `printer' member.
10476
10477 2002-06-30 Akim Demaille <akim@epita.fr>
10478
10479 * src/LR0.c (save_reductions): Remove, replaced by...
10480 * src/state.h, src/state.c (state_reductions_set): New.
10481 (reductions, errs): Rename as...
10482 (reductions_t, errs_t): these.
10483 Adjust all dependencies.
10484
10485 2002-06-30 Akim Demaille <akim@epita.fr>
10486
10487 * src/LR0.c (state_list_t, state_list_append): New.
10488 (first_state, last_state): Now symbol_list_t.
10489 (this_state): Remove.
10490 (new_itemsets, append_states, save_reductions): Take a state_t as
10491 argument.
10492 (set_states, generate_states): Adjust.
10493 (save_shifts): Remove, replaced by...
10494 * src/state.h, src/state.c (state_shifts_set): New.
10495 (shifts): Rename as...
10496 (shifts_t): this.
10497 Adjust all dependencies.
10498 * src/state.h (state_t): Remove the `next' member.
10499
10500 2002-06-30 Akim Demaille <akim@epita.fr>
10501
10502 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10503 escaped in slot 0.
10504
10505 2002-06-30 Akim Demaille <akim@epita.fr>
10506
10507 Use hash.h for the state hash table.
10508
10509 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10510 (allocate_storage): Use state_hash_new.
10511 (free_storage): Use state_hash_free.
10512 (new_state, get_state): Adjust.
10513 * src/lalr.h, src/lalr.c (states): Move to...
10514 * src/states.h (state_t): Remove the `link' member, no longer
10515 used.
10516 * src/states.h, src/states.c: here.
10517 (state_hash_new, state_hash_free, state_hash_lookup)
10518 (state_hash_insert, states_free): New.
10519 * src/states.c (state_table, state_compare, state_hash): New.
10520 * src/output.c (output_actions): Do not free states now, since we
10521 still need to know the final_state number in `prepare', called
10522 afterwards. Do it...
10523 * src/main.c (main): here: call states_free after `output'.
10524
10525 2002-06-30 Akim Demaille <akim@epita.fr>
10526
10527 * src/state.h, src/state.c (state_new): New, extracted from...
10528 * src/LR0.c (new_state): here.
10529 * src/state.h (STATE_ALLOC): Move to...
10530 * src/state.c: here.
10531 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10532 * src/state.h, src/state.c: here.
10533
10534 2002-06-30 Akim Demaille <akim@epita.fr>
10535
10536 * src/reader.c (gensym): Rename as...
10537 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10538 (getsym): Rename as...
10539 (symbol_get): this.
10540
10541 2002-06-30 Akim Demaille <akim@epita.fr>
10542
10543 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10544 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10545 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10546 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10547
10548 2002-06-30 Akim Demaille <akim@epita.fr>
10549
10550 Make the test suite pass with warnings checked.
10551
10552 * tests/actions.at (Printers and Destructors): Improve.
10553 Avoid unsigned vs. signed issues.
10554 * tests/calc.at: Don't exercise the scanner here, do it...
10555 * tests/input.at (Torturing the Scanner): here.
10556
10557 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10558
10559 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
10560 reorganize first lines parallel to yacc.c.
10561
10562 2002-06-28 Akim Demaille <akim@epita.fr>
10563
10564 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10565 (b4_token_enum, b4_token_defines): New, factored from...
10566 * data/lalr1.cc, data/yacc.c, glr.c: here.
10567
10568 2002-06-28 Akim Demaille <akim@epita.fr>
10569
10570 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10571 unused variables.
10572 * src/output.c (merger_output): static.
10573
10574 2002-06-28 Akim Demaille <akim@epita.fr>
10575
10576 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
10577 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10578 pacify GCC.
10579 * src/output.c (save_row): Initialize all the variables to pacify GCC.
10580
10581 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10582
10583 Accumulated changelog for new GLR parsing features.
10584
10585 * src/conflicts.c (count_total_conflicts): Change name to
10586 conflicts_total_count.
10587 * src/conflicts.h: Ditto.
10588 * src/output.c (token_actions): Use the new name.
10589 (output_conflicts): Change conflp => conflict_list_heads, and
10590 confl => conflict_list for better readability.
10591 * data/glr.c: Use the new names.
10592 * NEWS: Add self to GLR announcement.
10593
10594 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10595
10596 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10597 Akim Demaille.
10598
10599 * data/bison.glr: Change name to glr.c
10600 * data/glr.c: Renamed from bison.glr.
10601 * data/Makefile.am: Add glr.c
10602
10603 * src/getargs.c:
10604
10605 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
10606 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
10607
10608 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10609
10610 * data/bison.glr: Be sure to restore the
10611 current #line when returning to the skeleton contents after having
10612 exposed the input file's #line.
10613
10614 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10615
10616 * data/bison.glr: Bring up to date with changes to bison.simple.
10617
10618 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10619
10620 * data/bison.glr: Correct definitions that use b4_prefix.
10621 Various reformatting.
10622 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
10623 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
10624 yytokenp argument; now part of stack.
10625 (yychar): Define to behave as documented.
10626 (yyclearin): Ditto.
10627
10628 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10629
10630 * src/reader.h: Add declaration for free_merger_functions.
10631
10632 * src/reader.c (merge_functions): New variable.
10633 (get_merge_function): New function.
10634 (free_merger_functions): New function.
10635 (readgram): Check for %prec that is not followed by a symbol.
10636 Handle %dprec and %merge declarations.
10637 (packgram): Initialize dprec and merger fields in rules array.
10638
10639 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
10640 conflict_list_cnt, conflict_list_free): New variables.
10641 (table_grow): Also grow conflict_table.
10642 (prepare_rules): Output dprec and merger tables.
10643 (conflict_row): New function.
10644 (action_row): Output conflict lists for GLR parser. Don't use
10645 default reduction in conflicted states for GLR parser so that there
10646 are spaces for the conflict lists.
10647 (save_row): Also save conflict information.
10648 (token_actions): Allocate conflict list.
10649 (merger_output): New function.
10650 (pack_vector): Pack conflict table, too.
10651 (output_conflicts): New function to output yyconflp and yyconfl.
10652 (output_check): Allocate conflict_tos.
10653 (output_actions): Output conflict tables, also.
10654 (output_skeleton): Output b4_mergers definition.
10655 (prepare): Output b4_max_rhs_length definition.
10656 Use 'bison.glr' as default skeleton for GLR parsers.
10657
10658 * src/gram.c (glr_parser): New flag.
10659 (grammar_free): Call free_merger_functions.
10660
10661 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
10662 all pairs of conflicting reductions, rather than just all tokens
10663 causing conflicts. Needed to size conflict tables.
10664 (conflicts_output): Modify call to count_rr_conflicts for new
10665 interface.
10666 (conflicts_print): Ditto.
10667 (count_total_conflicts): New function.
10668
10669 * src/reader.h (merger_list): New type.
10670 (merge_functions): New variable.
10671
10672 * src/lex.h (tok_dprec, tok_merge): New token types.
10673
10674 * src/gram.h (rule_s): Add dprec and merger fields.
10675 (glr_parser): New flag.
10676
10677 * src/conflicts.h (count_total_conflicts): New function.
10678
10679 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10680
10681 * doc/bison.texinfo (Generalized LR Parsing): New section.
10682 (GLR Parsers): New section.
10683 (Language and Grammar): Mention GLR parsing.
10684 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
10685 Correct typo ("tge" -> "the").
10686
10687 * data/bison.glr: New skeleton for GLR parsing.
10688
10689 * tests/cxx-gram.at: New tests for GLR parsing.
10690
10691 * tests/testsuite.at: Include cxx-gram.at.
10692
10693 * tests/Makefile.am: Add cxx-gram.at.
10694
10695 * src/parse-gram.y:
10696
10697 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10698
10699 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
10700
10701 2002-06-27 Akim Demaille <akim@epita.fr>
10702
10703 * src/options.h, src/options.c: Remove.
10704 * src/getargs.c (short_options, long_options): New.
10705
10706 2002-06-27 Akim Demaille <akim@epita.fr>
10707
10708 * data/bison.simple, data/bison.c++: Rename as...
10709 * data/yacc.c, data/lalr1.cc: these.
10710 * doc/bison.texinfo (Environment Variables): Remove.
10711
10712 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10713
10714 * src/getargs.c (report_argmatch): Initialize strtok().
10715
10716 2002-06-20 Akim Demaille <akim@epita.fr>
10717
10718 * data/bison.simple (b4_symbol_actions): New, replaces...
10719 (b4_symbol_destructor, b4_symbol_printer): these.
10720 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10721 user token numbers.
10722
10723 2002-06-20 Akim Demaille <akim@epita.fr>
10724
10725 * data/bison.simple (yydestructor): Rename as...
10726 (yydestruct): this.
10727
10728 2002-06-20 Akim Demaille <akim@epita.fr>
10729
10730 * src/symtab.h, src/symtab.c (symbol_type_set)
10731 (symbol_destructor_set, symbol_precedence_set): The location is
10732 the last argument.
10733 Adjust all callers.
10734
10735 2002-06-20 Akim Demaille <akim@epita.fr>
10736
10737 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10738 internals.
10739 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10740 Takes a location.
10741 * src/symtab.h, src/symtab.c (symbol_class_set)
10742 (symbol_user_token_number_set): Likewise.
10743 Adjust all callers.
10744 Promote complain_at.
10745 * tests/input.at (Type Clashes): Adjust.
10746
10747 2002-06-20 Akim Demaille <akim@epita.fr>
10748
10749 * data/bison.simple (YYLEX): Fix the declaration when
10750 %pure-parser.
10751
10752 2002-06-20 Akim Demaille <akim@epita.fr>
10753
10754 * data/bison.simple (yysymprint): Don't print the token number,
10755 just its name.
10756 * tests/actions.at (Destructors): Rename as...
10757 (Printers and Destructors): this.
10758 Also exercise %printer.
10759
10760 2002-06-20 Akim Demaille <akim@epita.fr>
10761
10762 * data/bison.simple (YYDSYMPRINT): New.
10763 Use it to remove many of the #if YYDEBUG/if (yydebug).
10764
10765 2002-06-20 Akim Demaille <akim@epita.fr>
10766
10767 * src/symtab.h, src/symtab.c (symbol_t): printer and
10768 printer_location are new members.
10769 (symbol_printer_set): New.
10770 * src/parse-gram.y (PERCENT_PRINTER): New token.
10771 Handle its associated rule.
10772 * src/scan-gram.l: Adjust.
10773 (handle_destructor_at, handle_destructor_dollar): Rename as...
10774 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10775 * src/output.c (symbol_printers_output): New.
10776 (output_skeleton): Call it.
10777 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10778 since there are already many grammar files with a user `yyprint'.
10779 Replace the calls to YYPRINT to calls to yysymprint.
10780 * tests/calc.at: Adjust.
10781 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10782 taking advantage of parser very internal details (stack size!).
10783
10784 2002-06-20 Akim Demaille <akim@epita.fr>
10785
10786 * src/scan-gram.l: Complete the scanner with the missing patterns
10787 to pacify Flex.
10788 Use `quote' and `symbol_tag_get' where appropriate.
10789
10790 2002-06-19 Akim Demaille <akim@epita.fr>
10791
10792 * tests/actions.at (Destructors): Augment to test locations.
10793 * data/bison.simple (yydestructor): Pass it the current location
10794 if locations are enabled.
10795 Prototype only when __STDC__ or C++.
10796 Change the argument names to move into the yy name space: there is
10797 user code here.
10798
10799 2002-06-19 Akim Demaille <akim@epita.fr>
10800
10801 * data/bison.simple (b4_pure_if): New.
10802 Use it instead of #ifdef YYPURE.
10803
10804 2002-06-19 Akim Demaille <akim@epita.fr>
10805
10806 * data/bison.simple (b4_location_if): New.
10807 Use it instead of #ifdef YYLSP_NEEDED.
10808
10809 2002-06-19 Akim Demaille <akim@epita.fr>
10810
10811 Prepare @$ in %destructor, but currently don't bind it in the
10812 skeleton, as %location use is not cleaned up yet.
10813
10814 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10815 (handle_action_at): New.
10816 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10817 a braced_code_t and a location as additional arguments.
10818 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10819 unquote one when outputting `b4_dollar_dollar'.
10820 Adjust callers.
10821 * data/bison.simple (b4_eval): Remove.
10822 (b4_symbol_destructor): Adjust.
10823 * tests/input.at (Invalid @n): Adjust.
10824
10825 2002-06-19 Zack Weinberg <zack@codesourcery.com>
10826
10827 * doc/bison.texinfo: Document ability to have multiple
10828 prologue sections.
10829
10830 2002-06-18 Akim Demaille <akim@epita.fr>
10831
10832 * src/files.c (compute_base_names): When computing the output file
10833 names from the input file name, strip the directory part.
10834
10835 2002-06-18 Akim Demaille <akim@epita.fr>
10836
10837 * data/bison.simple.new: Comment changes.
10838 Reported by Andreas Schwab.
10839
10840 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10841
10842 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10843 there are no `label `yyoverflowlab' defined but not used' warnings
10844 when yyoverflow is defined.
10845
10846 2002-06-18 Akim Demaille <akim@epita.fr>
10847
10848 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10849 new member.
10850 (symbol_destructor_set): Adjust.
10851 * src/output.c (symbol_destructors_output): Output the destructor
10852 locations.
10853 Output the symbol name.
10854 * data/bison.simple (b4_symbol_destructor): Adjust.
10855
10856 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10857 and Akim Demaille <akim@epita.fr>
10858
10859 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10860 what's left on the stack when the error recovery hits EOF.
10861 * tests/actions.at (Destructors): Complete to exercise this case.
10862
10863 2002-06-17 Akim Demaille <akim@epita.fr>
10864
10865 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10866 arguments is really empty, not only equal to `[]'.
10867 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10868 member.
10869 (symbol_destructor_set): New.
10870 * src/output.c (symbol_destructors_output): New.
10871 * src/reader.h (brace_code_t, current_braced_code): New.
10872 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10873 (handle_dollar): Rename as...
10874 (handle_action_dollar): this.
10875 (handle_destructor_dollar): New.
10876 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10877 (grammar_declaration): Use it.
10878 * data/bison.simple (yystos): Is always defined.
10879 (yydestructor): New.
10880 * tests/actions.at (Destructors): New.
10881 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10882
10883 2002-06-17 Akim Demaille <akim@epita.fr>
10884
10885 * src/symlist.h, src/symlist.c (symbol_list_length): New.
10886 * src/scan-gram.l (handle_dollar, handle_at): Compute the
10887 rule_length only when needed.
10888 * src/output.c (actions_output, token_definitions_output): Output
10889 the full M4 block.
10890 * src/symtab.c: Don't access directly to the symbol tag, use
10891 symbol_tag_get.
10892 * src/parse-gram.y: Use symbol_list_free.
10893
10894 2002-06-17 Akim Demaille <akim@epita.fr>
10895
10896 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
10897 (symbol_list_prepend, get_type_name): Move to...
10898 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
10899 (symbol_list_prepend, symbol_list_n_type_name_get): here.
10900 Adjust all callers.
10901 (symbol_list_free): New.
10902 * src/scan-gram.l (handle_dollar): Takes a location.
10903 * tests/input.at (Invalid $n): Adjust.
10904
10905 2002-06-17 Akim Demaille <akim@epita.fr>
10906
10907 * src/reader.h, src/reader.c (symbol_list_new): Export it.
10908 (symbol_list_prepend): New.
10909 * src/parse-gram.y (%union): `list' is a new member.
10910 (symbols.1): New, replaces...
10911 (terms_to_prec.1, nterms_to_type.1): these.
10912 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
10913 Take a location as additional argument.
10914 Adjust all callers.
10915
10916 2002-06-15 Akim Demaille <akim@epita.fr>
10917
10918 * src/parse-gram.y: Move %token in the declaration section so that
10919 we don't depend upon CVS Bison.
10920
10921 2002-06-15 Akim Demaille <akim@epita.fr>
10922
10923 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10924 * src/print.c (print_core): Use it.
10925
10926 2002-06-15 Akim Demaille <akim@epita.fr>
10927
10928 * src/conflicts.c (log_resolution): Accept the rule involved in
10929 the sr conflicts instead of the lookahead number that points to
10930 that rule.
10931 (flush_reduce): Accept the current lookahead vector as argument,
10932 instead of the index in LA.
10933 (resolve_sr_conflict): Accept the current number of lookahead
10934 bitset to consider for the STATE, instead of the index in LA.
10935 (set_conflicts): Adjust.
10936 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
10937
10938 2002-06-15 Akim Demaille <akim@epita.fr>
10939
10940 * src/state.h (state_t): Replace the `lookaheadsp' member, a
10941 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
10942 Adjust all dependencies.
10943 * src/lalr.c (initialize_lookaheads): Split into...
10944 (states_lookaheads_count, states_lookaheads_initialize): these.
10945 (lalr): Adjust.
10946
10947 2002-06-15 Akim Demaille <akim@epita.fr>
10948
10949 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10950 out of...
10951 (grammar_rules_print): here.
10952 * src/reduce.c (reduce_output): Use it.
10953 * tests/reduce.at (Useless Rules, Reduced Automaton)
10954 (Underivable Rules): Adjust.
10955
10956 2002-06-15 Akim Demaille <akim@epita.fr>
10957
10958 Copy BYacc's nice way to report the grammar.
10959
10960 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10961 New.
10962 Don't print the rules' location, it is confusing and useless.
10963 (rule_print): Use grammar_rhs_print.
10964 * src/print.c (print_grammar): Use grammar_rules_print.
10965
10966 2002-06-15 Akim Demaille <akim@epita.fr>
10967
10968 Complete and rationalize `useless thing' warnings.
10969
10970 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10971 (symbol_tag_print): New.
10972 Use them everywhere in place of accessing directly the tag member.
10973 * src/gram.h, src/gram.c (rule_print): New.
10974 Use it where a rule used to be printed `by hand'.
10975 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10976 (reduce_grammar_tables): Report the useless rules.
10977 (reduce_print): Useless things are a warning, not an error.
10978 Report it as such.
10979 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10980 (Reduced Automaton, Underivable Rules): Adjust.
10981 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10982 * tests/conflicts.at (Unresolved SR Conflicts)
10983 (Solved SR Conflicts): Adjust.
10984
10985 2002-06-15 Akim Demaille <akim@epita.fr>
10986
10987 Let symbols have a location.
10988
10989 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10990 (getsym): Adjust.
10991 Adjust all callers.
10992 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10993 Use location_t, not int.
10994 * src/symtab.c (symbol_check_defined): Take advantage of the
10995 location.
10996 * tests/regression.at (Invalid inputs): Adjust.
10997
10998 2002-06-15 Akim Demaille <akim@epita.fr>
10999
11000 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
11001 (input): Don't try to initialize yylloc here, do it in the
11002 scanner.
11003 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
11004 * src/gram.h (rule_t): Change line and action_line into location
11005 and action_location, of location_t type.
11006 Adjust all dependencies.
11007 * src/location.h, src/location.c (empty_location): New.
11008 * src/reader.h, src/reader.c (grammar_start_symbol_set)
11009 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
11010 (grammar_current_rule_symbol_append)
11011 (grammar_current_rule_action_append): Expect a location as argument.
11012 * src/reader.c (grammar_midrule_action): Adjust to attach an
11013 action's location as dummy symbol location.
11014 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11015 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11016 the line numbers.
11017
11018 2002-06-14 Akim Demaille <akim@epita.fr>
11019
11020 Grammar declarations may be found in the grammar section.
11021
11022 * src/parse-gram.y (rules_or_grammar_declaration): New.
11023 (declarations): Each declaration may end with a semicolon, not
11024 just...
11025 (grammar_declaration): `"%union"'.
11026 (grammar): Branch to rules_or_grammar_declaration.
11027
11028 2002-06-14 Akim Demaille <akim@epita.fr>
11029
11030 * src/main.c (main): Invoke scanner_free.
11031
11032 2002-06-14 Akim Demaille <akim@epita.fr>
11033
11034 * src/output.c (m4_invoke): Extracted from...
11035 (output_skeleton): here.
11036 Free tempfile.
11037
11038 2002-06-14 Akim Demaille <akim@epita.fr>
11039
11040 * src/parse-gram.y (directives, directive, gram)
11041 (grammar_directives, precedence_directives, precedence_directive):
11042 Rename as...
11043 (declarations, declaration, grammar, grammar_declaration)
11044 (precedence_declaration, precedence_declarator): these.
11045 (symbol_declaration): New.
11046
11047 2002-06-14 Akim Demaille <akim@epita.fr>
11048
11049 * src/files.c (action_obstack): Remove, unused.
11050 (output_obstack): Remove it, and all its dependencies, as it is no
11051 longer needed.
11052 * src/reader.c (epilogue_set): Build the epilogue in the
11053 muscle_obstack.
11054 * src/output.h, src/output.c (muscle_obstack): Move to...
11055 * src/muscle_tab.h, src/muscle_tab.h: here.
11056 (muscle_init): Initialize muscle_obstack.
11057 (muscle_free): New.
11058 * src/main.c (main): Call it.
11059
11060 2002-06-14 Akim Demaille <akim@epita.fr>
11061
11062 * src/location.h: New, extracted from...
11063 * src/reader.h: here.
11064 * src/Makefile.am (noinst_HEADERS): Merge into
11065 (bison_SOURCES): this.
11066 Add location.h.
11067 * src/parse-gram.y: Use location_t instead of Bison's.
11068 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11069 Use location_t instead of ints.
11070
11071 2002-06-14 Akim Demaille <akim@epita.fr>
11072
11073 * data/bison.simple, data/bison.c++: Be sure to restore the
11074 current #line when returning to the skeleton contents after having
11075 exposed the input file's #line.
11076
11077 2002-06-12 Akim Demaille <akim@epita.fr>
11078
11079 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11080 eager.
11081 * tests/actions.at (Exotic Dollars): New.
11082
11083 2002-06-12 Akim Demaille <akim@epita.fr>
11084
11085 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11086 ['"/] too eagerly.
11087 * tests/input.at (Torturing the Scanner): New.
11088
11089 2002-06-11 Akim Demaille <akim@epita.fr>
11090
11091 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11092 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11093 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11094 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11095 * src/reader.c (reader): Use it.
11096
11097 2002-06-11 Akim Demaille <akim@epita.fr>
11098
11099 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11100 Adjust all callers.
11101 (scanner_last_string_free): New.
11102
11103 2002-06-11 Akim Demaille <akim@epita.fr>
11104
11105 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11106 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11107 (last_string, YY_OBS_FREE): New.
11108 Use them when returning an ID.
11109
11110 2002-06-11 Akim Demaille <akim@epita.fr>
11111
11112 Have Bison grammars parsed by a Bison grammar.
11113
11114 * src/reader.c, src/reader.h (prologue_augment): New.
11115 * src/reader.c (copy_definition): Remove.
11116
11117 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11118 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11119 (grammar_current_rule_prec_set, grammar_current_rule_check)
11120 (grammar_current_rule_symbol_append)
11121 (grammar_current_rule_action_append): Export.
11122 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11123 (symbol_list_action_append): Remove.
11124 Hook the routines from reader.
11125 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11126 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11127
11128 * src/reader.c (read_declarations): Remove, unused.
11129
11130 * src/parse-gram.y: Handle the epilogue.
11131 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11132 (grammar_start_symbol_set): this.
11133 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11134 * src/reader.c (readgram): Remove, unused.
11135 (reader): Adjust to insert eoftoken and axiom where appropriate.
11136
11137 * src/reader.c (copy_dollar): Replace with...
11138 * src/scan-gram.h (handle_dollar): this.
11139 * src/parse-gram.y: Remove `%thong'.
11140
11141 * src/reader.c (copy_at): Replace with...
11142 * src/scan-gram.h (handle_at): this.
11143
11144 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11145 New.
11146
11147 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11148 time being.
11149
11150 * src/reader.h, src/reader.c (grammar_rule_end): New.
11151
11152 * src/parse.y (current_type, current_class): New.
11153 Implement `%nterm', `%token' support.
11154 Merge `%term' into `%token'.
11155 (string_as_id): New.
11156 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11157 type name.
11158
11159 * src/parse-gram.y: Be sure to handle properly the beginning of
11160 rules.
11161
11162 * src/parse-gram.y: Handle %type.
11163 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11164
11165 * src/parse-gram.y: More directives support.
11166 * src/options.c: No longer handle source directives.
11167
11168 * src/parse-gram.y: Fix %output.
11169
11170 * src/parse-gram.y: Handle %union.
11171 Use the prologue locations.
11172 * src/reader.c (parse_union_decl): Remove.
11173
11174 * src/reader.h, src/reader.c (epilogue_set): New.
11175 * src/parse-gram.y: Use it.
11176
11177 * data/bison.simple, data/bison.c++: b4_stype is now either not
11178 defined, then default to int, or to the contents of %union,
11179 without `union' itself.
11180 Adjust.
11181 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11182
11183 * src/output.c (actions_output): Don't output braces, as they are
11184 already handled by the scanner.
11185
11186 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11187 characters to themselves.
11188
11189 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11190 that the epilogue has a proper #line.
11191
11192 * src/parse-gram.y: Handle precedence/associativity.
11193
11194 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11195 a terminal.
11196 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11197 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11198 at all to define terminals that cannot be emitted.
11199
11200 * src/scan-gram.l: Escape M4 characters.
11201
11202 * src/scan-gram.l: Working properly with escapes in user
11203 strings/characters.
11204
11205 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11206 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11207 grammar.
11208 Use more modest sizes, as for the time being the parser does not
11209 release memory, and therefore the process swallows a huge amount
11210 of memory.
11211
11212 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11213 stricter %token grammar.
11214
11215 * src/symtab.h (associativity): Add `undef_assoc'.
11216 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11217 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11218
11219 * tests/regression.at (Invalid %directive): Remove, as it is now
11220 meaningless.
11221 (Invalid inputs): Adjust to the new error messages.
11222 (Token definitions): The new grammar doesn't allow too many
11223 eccentricities.
11224
11225 * src/lex.h, src/lex.c: Remove.
11226 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11227 (copy_character, copy_string2, copy_string, copy_identifier)
11228 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11229 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11230 (parse_action): Remove.
11231 * po/POTFILES.in: Adjust.
11232
11233 2002-06-11 Akim Demaille <akim@epita.fr>
11234
11235 * src/reader.c (parse_action): Don't store directly into the
11236 rule's action member: return the action as a string.
11237 Don't require `rule_length' as an argument: compute it.
11238 (grammar_current_rule_symbol_append)
11239 (grammar_current_rule_action_append): New, eved out from
11240 (readgram): here.
11241 Remove `action_flag', `rulelength', unused now.
11242
11243 2002-06-11 Akim Demaille <akim@epita.fr>
11244
11245 * src/reader.c (grammar_current_rule_prec_set).
11246 (grammar_current_rule_check): New, eved out from...
11247 (readgram): here.
11248 Remove `xaction', `first_rhs': useless.
11249 * tests/input.at (Type clashes): New.
11250 * tests/existing.at (GNU Cim Grammar): Adjust.
11251
11252 2002-06-11 Akim Demaille <akim@epita.fr>
11253
11254 * src/reader.c (grammar_midrule_action): New, Eved out from
11255 (readgram): here.
11256
11257 2002-06-11 Akim Demaille <akim@epita.fr>
11258
11259 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11260 New.
11261 (readgram): Use them as replacement of inlined code, crule and
11262 crule1.
11263
11264 2002-06-11 Akim Demaille <akim@epita.fr>
11265
11266 * src/reader.c (grammar_end, grammar_symbol_append): New.
11267 (readgram): Use them.
11268 Make the use of `p' as local as possible.
11269
11270 2002-06-10 Akim Demaille <akim@epita.fr>
11271
11272 GCJ's parser requires the tokens to be defined before the prologue.
11273
11274 * data/bison.simple: Output the token definition before the user's
11275 prologue.
11276 * tests/regression.at (Braces parsing, Duplicate string)
11277 (Mixing %token styles): Check the output from bison.
11278 (Early token definitions): New.
11279
11280 2002-06-10 Akim Demaille <akim@epita.fr>
11281
11282 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11283 assigning twice the same user number to a token, so that we can
11284 use it in...
11285 * src/lex.c (lex): here.
11286 Also use `symbol_class_set' instead of hand written code.
11287 * src/reader.c (parse_assoc_decl): Likewise.
11288
11289 2002-06-10 Akim Demaille <akim@epita.fr>
11290
11291 * src/symtab.c, src/symtab.c (symbol_class_set)
11292 (symbol_user_token_number_set): New.
11293 * src/reader.c (parse_token_decl): Use them.
11294 Use a switch instead of ifs.
11295 Use a single argument.
11296
11297 2002-06-10 Akim Demaille <akim@epita.fr>
11298
11299 Remove `%thong' support as it is undocumented, unused, duplicates
11300 `%token's job, and creates useless e-mail traffic with people who
11301 want to know what it is, why it is undocumented, unused, and
11302 duplicates `%token's job.
11303
11304 * src/reader.c (parse_thong_decl): Remove.
11305 * src/options.c (option_table): Remove "thong".
11306 * src/lex.h (tok_thong): Remove.
11307
11308 2002-06-10 Akim Demaille <akim@epita.fr>
11309
11310 * src/symtab.c, src/symtab.c (symbol_type_set)
11311 (symbol_precedence_set): New.
11312 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11313 (value_components_used): Remove, unused.
11314
11315 2002-06-09 Akim Demaille <akim@epita.fr>
11316
11317 Move symbols handling code out of the reader.
11318
11319 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11320 (axiom): Move to...
11321 * src/symtab.h, src/symtab.c: here.
11322
11323 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11324 * src/reader.c (startval): Rename as...
11325 * src/symtab.h, src/symtab.c (startsymbol): this.
11326 * src/reader.c: Adjust.
11327
11328 * src/reader.c (symbol_check_defined, symbol_make_alias)
11329 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11330 (token_translations_init)
11331 Move to...
11332 * src/symtab.c: here.
11333 * src/reader.c (packsymbols): Move to...
11334 * src/symtab.h, src/symtab.c (symbols_pack): here.
11335 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11336 argument.
11337
11338 2002-06-03 Akim Demaille <akim@epita.fr>
11339
11340 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11341 then statements.
11342
11343 2002-06-03 Akim Demaille <akim@epita.fr>
11344
11345 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11346 structs with non literals.
11347 * src/scan-skel.l: never-interactive.
11348 * src/conflicts.c (enum conflict_resolution_e): No trailing
11349 comma.
11350 * src/getargs.c (usage): Split long literal strings.
11351 Reported by Hans Aberg.
11352
11353 2002-05-28 Akim Demaille <akim@epita.fr>
11354
11355 * data/bison.c++: Use C++ ostreams.
11356 (cdebug_): New member.
11357
11358 2002-05-28 Akim Demaille <akim@epita.fr>
11359
11360 * src/output.c (output_skeleton): Be sure to allocate enough room
11361 for `/' _and_ for `\0' in full_skeleton.
11362
11363 2002-05-28 Akim Demaille <akim@epita.fr>
11364
11365 * data/bison.c++: Catch up with bison.simple:
11366 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11367 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11368 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11369 and popping traces.
11370
11371 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11372
11373 * src/output.c (output_skeleton): Put an explicit path in front of
11374 the skeleton file name, rather than relying on the -I directory,
11375 to partially alleviate effects of having a skeleton file lying around
11376 in the current directory.
11377
11378 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11379
11380 * src/conflicts.c (log_resolution): Correct typo:
11381 obstack_printf should be obstack_fgrow1.
11382
11383 2002-05-26 Akim Demaille <akim@epita.fr>
11384
11385 * src/state.h (state_t): `solved_conflicts' is a new member.
11386 * src/LR0.c (new_state): Set it to 0.
11387 * src/conflicts.h, src/conflicts.c (print_conflicts)
11388 (free_conflicts, solve_conflicts): Rename as...
11389 (conflicts_print, conflicts_free, conflicts_solve): these.
11390 Adjust callers.
11391 * src/conflicts.c (enum conflict_resolution_e)
11392 (solved_conflicts_obstack): New, used by...
11393 (log_resolution): this.
11394 Adjust to attach the conflict resolution to each state.
11395 Complete the description with the precedence/associativity
11396 information.
11397 (resolve_sr_conflict): Adjust.
11398 * src/print.c (print_state): Output its solved_conflicts.
11399 * tests/conflicts.at (Unresolved SR Conflicts)
11400 (Solved SR Conflicts): Exercise --report=all.
11401
11402 2002-05-26 Akim Demaille <akim@epita.fr>
11403
11404 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11405 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11406 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11407 (token_number_t, item_number_as_token_number)
11408 (token_number_as_item_number, muscle_insert_token_number_table):
11409 Rename as...
11410 (symbol_number_t, item_number_as_symbol_number)
11411 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11412 these, since it is more appropriate.
11413
11414 2002-05-26 Akim Demaille <akim@epita.fr>
11415
11416 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11417 `Error:' lines.
11418 * data/bison.simple (yystos) [YYDEBUG]: New.
11419 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11420 error recovery.
11421 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11422
11423 2002-05-25 Akim Demaille <akim@epita.fr>
11424
11425 * doc/bison.texinfo (Debugging): Split into...
11426 (Tracing): this new section, its former contents, and...
11427 (Understanding): this new section.
11428 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11429 by...
11430 (report_flag): this.
11431 Adjust all dependencies.
11432 (report_args, report_types, report_argmatch): New.
11433 (usage, getargs): Report/support -r, --report.
11434 * src/options.h
11435 (struct option_table_struct): Rename as..,
11436 (struct option_table_s): this.
11437 Rename the `set_flag' member to `flag' to match with getopt_long's
11438 struct.
11439 * src/options.c (option_table): Split verbose into an entry for
11440 %verbose, and another for --verbose.
11441 Support --report/-r, so remove -r from the obsolete --raw.
11442 * src/print.c: Attach full item sets and lookaheads reports to
11443 report_flag instead of trace_flag.
11444 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11445
11446 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11447 and Paul Eggert <eggert@twinsun.com>
11448
11449 * data/bison.simple (yyparse): Correct error handling to conform to
11450 POSIX and yacc. Specifically, after syntax error is discovered,
11451 do not reduce further before shifting the error token.
11452 Clean up the code a bit by removing the labels yyerrdefault,
11453 yyerrhandle, yyerrpop.
11454 * NEWS: Document the above.
11455
11456 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11457
11458 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11459 type; it isn't always big enough, since it doesn't necessarily
11460 include non-terminals.
11461 (yytranslate): Expand definition of yy_token_number_type, so that
11462 the latter can be removed.
11463 (yy_token_number_type): Remove, only one use.
11464 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11465 don't use TokenNumberType as element type.
11466
11467 * tests/regression.at: Modify expected output to agree with change
11468 to yyr1 and yytranslate.
11469
11470 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11471
11472 * src/reader.c (parse_action): Use copy_character instead of
11473 obstack_1grow.
11474
11475 2002-05-13 Akim Demaille <akim@epita.fr>
11476
11477 * tests/regression.at (Token definitions): Prototype yylex and
11478 yyerror.
11479
11480 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11481
11482 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
11483 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11484 32-bit arithmetic.
11485 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11486
11487 2002-05-07 Akim Demaille <akim@epita.fr>
11488
11489 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11490 avoid GCC warnings.
11491
11492 2002-05-07 Akim Demaille <akim@epita.fr>
11493
11494 Kill GCC warnings.
11495
11496 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11497 over the RHS of each rule.
11498 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11499 * src/state.h (state_t): Member `nitems' is unsigned short.
11500 * src/LR0.c (get_state): Adjust.
11501 * src/reader.c (packgram): Likewise.
11502 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11503 `Type'.
11504 (muscle_insert_int_table): Remove, unused.
11505 (prepare_rules): Remove `max'.
11506
11507 2002-05-06 Akim Demaille <akim@epita.fr>
11508
11509 * src/closure.c (print_firsts): Display of the symbol tags.
11510 (bitmatrix_print): Move to...
11511 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11512 here.
11513 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11514
11515 2002-05-06 Akim Demaille <akim@epita.fr>
11516
11517 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11518 hash_do_for_each.
11519
11520 2002-05-06 Akim Demaille <akim@epita.fr>
11521
11522 * src/LR0.c (new_state, get_state): Instead of using the global
11523 `kernel_size' and `kernel_base', have two new arguments:
11524 `core_size' and `core'.
11525 Adjust callers.
11526
11527 2002-05-06 Akim Demaille <akim@epita.fr>
11528
11529 * src/reader.c (packgram): No longer end `ritem' with a 0
11530 sentinel: it is not used.
11531
11532 2002-05-05 Akim Demaille <akim@epita.fr>
11533
11534 New experimental feature: display the lookaheads in the report and
11535 graph.
11536
11537 * src/print (print_core): When --trace-flag, display the rules
11538 lookaheads.
11539 * src/print_graph.c (print_core): Likewise.
11540 Swap the arguments.
11541 Adjust caller.
11542
11543 2002-05-05 Akim Demaille <akim@epita.fr>
11544
11545 * tests/torture.at (Many lookaheads): New test.
11546
11547 2002-05-05 Akim Demaille <akim@epita.fr>
11548
11549 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11550 (GENERATE_MUSCLE_INSERT_TABLE): this.
11551 (output_int_table, output_unsigned_int_table, output_short_table)
11552 (output_token_number_table, output_item_number_table): Replace with...
11553 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11554 (muscle_insert_short_table, muscle_insert_token_number_table)
11555 (muscle_insert_item_number_table): these.
11556 Adjust all callers.
11557 (prepare_tokens): Don't free `translations', since...
11558 * src/reader.h, src/reader.c (grammar_free): do it.
11559 Move to...
11560 * src/gram.h, src/gram.c (grammar_free): here.
11561 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11562 b4_translate_max.
11563
11564 2002-05-05 Akim Demaille <akim@epita.fr>
11565
11566 * src/output.c (output_unsigned_int_table): New.
11567 (prepare_rules): `i' is unsigned.
11568 `prhs', `rline', `r2' are unsigned int.
11569 Rename muscle `rhs_number_max' as `rhs_max'.
11570 Output muscles `prhs_max', `rline_max', and `r2_max'.
11571 Free rline and r1.
11572 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11573 to compute types instead of constant types.
11574 * tests/regression.at (Web2c Actions): Adjust.
11575
11576 2002-05-04 Akim Demaille <akim@epita.fr>
11577
11578 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11579 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11580 Adjust dependencies.
11581 * src/output.c (token_definitions_output): Be sure not to output a
11582 `#define 'a'' when fed with `%token 'a' "a"'.
11583 * tests/regression.at (Token definitions): New.
11584
11585 2002-05-03 Paul Eggert <eggert@twinsun.com>
11586
11587 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11588 for K&R C.
11589
11590 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11591
11592 * Makefile.am (SUBDIRS): Remove intl.
11593 (EXTRA_DIST): Add config/config.rpath.
11594
11595 2002-05-03 Akim Demaille <akim@epita.fr>
11596
11597 * data/bison.simple (m4_if): Don't output empty enums.
11598 And actually, output valid enum definitions :(.
11599
11600 2002-05-03 Akim Demaille <akim@epita.fr>
11601
11602 * configure.bat: Remove, completely obsolete.
11603 * Makefile.am (EXTRA_DIST): Adjust.
11604 Don't distribute config.rpath...
11605 * config/Makefile.am (EXTRA_DIST): Do it.
11606
11607 2002-05-03 Akim Demaille <akim@epita.fr>
11608
11609 * configure.in (GETTEXT_VERSION): New.
11610 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11611
11612 2002-05-03 Akim Demaille <akim@epita.fr>
11613
11614 * data/bison.simple (b4_token_enum): New.
11615 (b4_token_defines): Use it to output tokens both as #define and
11616 enums.
11617 Suggested by Paul Eggert.
11618 * src/output.c (token_definitions_output): Don't output spurious
11619 white spaces.
11620
11621 2002-05-03 Akim Demaille <akim@epita.fr>
11622
11623 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11624
11625 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
11626
11627 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
11628 Update the stack class, give a try to deque as the default container.
11629
11630 2002-05-02 Akim Demaille <akim@epita.fr>
11631
11632 * data/bison.simple (yyparse): Do not implement @$ = @1.
11633 (YYLLOC_DEFAULT): Adjust to do it.
11634 * doc/bison.texinfo (Location Default Action): Fix.
11635
11636 2002-05-02 Akim Demaille <akim@epita.fr>
11637
11638 * src/reader.c (parse_braces): Merge into...
11639 (parse_action): this.
11640
11641 2002-05-02 Akim Demaille <akim@epita.fr>
11642
11643 * configure.in (ALL_LINGUAS): Remove.
11644 * po/LINGUAS, hr.po: New.
11645
11646 2002-05-02 Akim Demaille <akim@epita.fr>
11647
11648 Remove the so called hairy (semantic) parsers.
11649
11650 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
11651 * src/gram.h, src/gram.c (semantic_parser): Remove.
11652 (rule_t): Remove the guard and guard_line members.
11653 * src/lex.h (token_t): remove tok_guard.
11654 * src/options.c (option_table): Remove %guard and %semantic_parser
11655 support.
11656 * src/output.c, src/output.h (guards_output): Remove.
11657 (prepare): Adjust.
11658 (token_definitions_output): Don't output the `T'
11659 tokens (???).
11660 (output_skeleton): Don't output the guards.
11661 * src/files.c, src/files.c (attrsfile): Remove.
11662 * src/reader.c (symbol_list): Remove the guard and guard_line
11663 members.
11664 Adjust dependencies.
11665 (parse_guard): Remove.
11666 * data/bison.hairy: Remove.
11667 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11668 BISON_HAIRY.
11669
11670 2002-05-02 Akim Demaille <akim@epita.fr>
11671
11672 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
11673 (parse_guard): Rename the formal argument `stack_offset' as
11674 `rule_length', which is more readable.
11675 Adjust callers.
11676 (copy_at, copy_dollar): Instead of outputting the hard coded
11677 values of $$, $n and so forth, output invocation to b4_lhs_value,
11678 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
11679 Note: this patch partially drops `semantic-parser' support: it
11680 always does `rule_length - n', where semantic parsers ought to
11681 always use `-n'.
11682 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11683 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11684
11685 2002-05-02 Akim Demaille <akim@epita.fr>
11686
11687 * configure.in (AC_INIT): Bump to 1.49b.
11688 (AM_INIT_AUTOMAKE): Short invocation.
11689
11690 2002-05-02 Akim Demaille <akim@epita.fr>
11691
11692 Version 1.49a.
11693
11694 2002-05-01 Akim Demaille <akim@epita.fr>
11695
11696 * src/skeleton.h: Remove.
11697
11698 2002-05-01 Akim Demaille <akim@epita.fr>
11699
11700 * src/skeleton.h: Fix the #endif.
11701 Reported by Magnus Fromreide.
11702
11703 2002-04-26 Paul Eggert <eggert@twinsun.com>
11704
11705 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
11706 Define if we define YYSTYPE and YYLTYPE, respectively.
11707 (YYCOPY): Fix [] quoting problem in the non-GCC case.
11708
11709 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
11710
11711 * src/scan-skel.l: Postprocess quadrigraphs.
11712
11713 * src/reader.c (copy_character): New function, used to output
11714 single characters while replacing `[' and `]' with quadrigraphs, to
11715 avoid troubles with M4 quotes.
11716 (copy_comment): Output characters with copy_character.
11717 (read_additionnal_code): Likewise.
11718 (copy_string2): Likewise.
11719 (copy_definition): Likewise.
11720
11721 * tests/calc.at: Exercise M4 quoting.
11722
11723 2002-04-25 Akim Demaille <akim@epita.fr>
11724
11725 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11726 between `!' and the command.
11727 Reported by Paul Eggert.
11728
11729 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
11730
11731 * tests/calc.at: Exercise prologue splitting.
11732
11733 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11734 `b4_post_prologue' instead of `b4_prologue'.
11735
11736 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11737 muscles.
11738 (output): Free pre_prologue_obstack and post_prologue_obstack.
11739 * src/files.h, src/files.c (attrs_obstack): Remove.
11740 (pre_prologue_obstack, post_prologue_obstack): New.
11741 * src/reader.c (copy_definition): Add a parameter to specify the
11742 obstack to fill, instead of using attrs_obstack unconditionally.
11743 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11744 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11745
11746 2002-04-23 Paul Eggert <eggert@twinsun.com>
11747
11748 * data/bison.simple: Remove unnecessary commentary and white
11749 space differences from 1_29-branch.
11750 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11751
11752 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11753 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11754 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11755 constructors or destructors.
11756
11757 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11758
11759 2002-04-23 Akim Demaille <akim@epita.fr>
11760
11761 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11762 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11763 location with columns.
11764 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11765 All reported by Paul Eggert.
11766
11767 2002-04-22 Akim Demaille <akim@epita.fr>
11768
11769 * src/reduce.c (dump_grammar): Move to...
11770 * src/gram.h, src/gram.c (grammar_dump): here.
11771 Be sure to separate long item numbers.
11772 Don't read the members of a rule's prec if its nil.
11773
11774 2002-04-22 Akim Demaille <akim@epita.fr>
11775
11776 * src/output.c (table_size, table_grow): New.
11777 (MAXTABLE): Remove, replace uses with table_size.
11778 (pack_vector): Instead of dying when the table is too big, grow it.
11779
11780 2002-04-22 Akim Demaille <akim@epita.fr>
11781
11782 * data/bison.simple (yyr1): Its type is that of a token number.
11783 * data/bison.c++ (r1_): Likewise.
11784 * tests/regression.at (Web2c Actions): Adjust.
11785
11786 2002-04-22 Akim Demaille <akim@epita.fr>
11787
11788 * src/reader.c (token_translations_init): 256 is now the default
11789 value for the error token, i.e., it will be assigned another
11790 number if the user assigned 256 to one of her tokens.
11791 (reader): Don't force 256 to error.
11792 * doc/bison.texinfo (Symbols): Adjust.
11793 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11794 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11795 etc. instead of 10, 20, 30 (which was used to `jump' over error
11796 (256) and undefined (2)).
11797
11798 2002-04-22 Akim Demaille <akim@epita.fr>
11799
11800 Propagate more token_number_t.
11801
11802 * src/gram.h (token_number_as_item_number)
11803 (item_number_as_token_number): New.
11804 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11805 Use it to create output_item_number_table and
11806 output_token_number_table.
11807 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11808 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11809 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11810 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11811
11812 2002-04-22 Akim Demaille <akim@epita.fr>
11813
11814 * src/output.h, src/output.c (get_lines_number): Remove.
11815
11816 2002-04-19 Akim Demaille <akim@epita.fr>
11817
11818 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11819 as Lex/Flex'.
11820 (Debugging): More details about enabling the debugging features.
11821 (Table of Symbols): Describe $$, $n, @$, and @n.
11822 Suggested by Tim Josling.
11823
11824 2002-04-19 Akim Demaille <akim@epita.fr>
11825
11826 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11827
11828 2002-04-10 Akim Demaille <akim@epita.fr>
11829
11830 * src/system.h: Rely on HAVE_LIMITS_H.
11831 Suggested by Paul Eggert.
11832
11833 2002-04-09 Akim Demaille <akim@epita.fr>
11834
11835 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11836 full stderr, and strip it according to the bison options, instead
11837 of composing the error message from different bits.
11838 This makes it easier to check for several error messages.
11839 Adjust all the invocations.
11840 Add an invocation exercising the error token.
11841 Add an invocation demonstrating a stupid error message.
11842 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11843 Adjust the tests.
11844 Error message are for stderr, not stdout.
11845
11846 2002-04-09 Akim Demaille <akim@epita.fr>
11847
11848 * src/gram.h, src/gram.c (error_token_number): Remove, use
11849 errtoken->number.
11850 * src/reader.c (reader): Don't specify the user token number (2)
11851 for $undefined, as it uselessly prevents using it.
11852 * src/gram.h (token_number_t): Move to...
11853 * src/symtab.h: here.
11854 (state_t.number): Is a token_number_t.
11855 * src/print.c, src/reader.c: Use undeftoken->number instead of
11856 hard coded 2.
11857 (Even though this 2 is not the same as above: the number of the
11858 undeftoken remains being 2, it is its user token number which
11859 might not be 2).
11860 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11861 `user_token_number_max'.
11862 Output `undef_token_number'.
11863 * data/bison.simple, data/bison.c++: Use them.
11864 Be sure to map invalid yylex return values to
11865 `undef_token_number'. This saves us from gratuitous SEGV.
11866
11867 * tests/conflicts.at (Solved SR Conflicts)
11868 (Unresolved SR Conflicts): Adjust.
11869 * tests/regression.at (Web2c Actions): Adjust.
11870
11871 2002-04-08 Akim Demaille <akim@epita.fr>
11872
11873 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11874 Adding #line.
11875 Remove the duplicate `typedefs'.
11876 (RhsNumberType): Fix the declaration and various other typos.
11877 Use __ofile__.
11878 * data/bison.simple: Use __ofile__.
11879 * src/scan-skel.l: Handle __ofile__.
11880
11881 2002-04-08 Akim Demaille <akim@epita.fr>
11882
11883 * src/gram.h (item_number_t): New, the type of item numbers in
11884 RITEM. Note that it must be able to code symbol numbers as
11885 positive number, and the negation of rule numbers as negative
11886 numbers.
11887 Adjust all dependencies (pretty many).
11888 * src/reduce.c (rule): Remove this `short *' pointer: use
11889 item_number_t.
11890 * src/system.h (MINSHORT, MAXSHORT): Remove.
11891 Include `limits.h'.
11892 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
11893 (shortcpy): Remove.
11894 (MAXTABLE): Move to...
11895 * src/output.c (MAXTABLE): here.
11896 (prepare_rules): Use output_int_table to output rhs.
11897 * data/bison.simple, data/bison.c++: Adjust.
11898 * tests/torture.at (Big triangle): Move the limit from 254 to
11899 500.
11900 * tests/regression.at (Web2c Actions): Ajust.
11901
11902 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
11903 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
11904 passes, but produces negative #line number, once fixed, GCC is
11905 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
11906 C), it passes.
11907 * src/state.h (state_h): Code input lines on ints, not shorts.
11908
11909 2002-04-08 Akim Demaille <akim@epita.fr>
11910
11911 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11912 and then the grammar.
11913
11914 2002-04-08 Akim Demaille <akim@epita.fr>
11915
11916 * src/system.h: No longer using strndup.
11917
11918 2002-04-07 Akim Demaille <akim@epita.fr>
11919
11920 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
11921 * src/output.c (output_table_data): Return the longest number.
11922 (prepare_tokens): Output `token_number_max').
11923 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
11924 New.
11925 Use them to define yy_token_number_type/TokenNumberType.
11926 Use this type for yytranslate.
11927 * tests/torture.at (Big triangle): Push the limit from 124 to
11928 253.
11929 * tests/regression.at (Web2c Actions): Adjust.
11930
11931 2002-04-07 Akim Demaille <akim@epita.fr>
11932
11933 * tests/torture.at (Big triangle): New.
11934 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11935 * tests/existing.at: here.
11936
11937 2002-04-07 Akim Demaille <akim@epita.fr>
11938
11939 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11940 nritems.
11941 Adjust dependencies.
11942
11943 2002-04-07 Akim Demaille <akim@epita.fr>
11944
11945 * src/reader.c: Normalize increments to prefix form.
11946
11947 2002-04-07 Akim Demaille <akim@epita.fr>
11948
11949 * src/reader.c, symtab.c: Remove debugging code.
11950
11951 2002-04-07 Akim Demaille <akim@epita.fr>
11952
11953 Rename all the `bucket's as `symbol_t'.
11954
11955 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
11956 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
11957 * src/symtab.c, src/symtab.h (bucket): Rename as...
11958 (symbol_t): this.
11959 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11960 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11961 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11962 (buckets_new, buckets_free, buckets_do): Rename as...
11963 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11964 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11965 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11966 (symbols_new, symbols_free, symbols_do): these.
11967
11968 2002-04-07 Akim Demaille <akim@epita.fr>
11969
11970 Use lib/hash for the symbol table.
11971
11972 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11973 EOF.
11974 * src/lex.c (lex): Set the `number' member of new terminals.
11975 * src/reader.c (bucket_check_defined, bucket_make_alias)
11976 (bucket_check_alias_consistence, bucket_translation): New.
11977 (reader, grammar_free, readgram, token_translations_init)
11978 (packsymbols): Adjust.
11979 (reader): Number the predefined tokens.
11980 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11981 for predefined tokens.
11982 * src/symtab.h (bucket): Remove all the hash table related
11983 members.
11984 * src/symtab.c (symtab): Replace by...
11985 (bucket_table): this.
11986 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11987 (buckets_new, buckets_do): New.
11988
11989 2002-04-07 Akim Demaille <akim@epita.fr>
11990
11991 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11992 (start_symbol, max_user_token_number, semantic_parser)
11993 (error_token_number): Initialize.
11994 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11995 Initialize.
11996 (reader): Don't.
11997 (errtoken, eoftoken, undeftoken, axiom): Extern.
11998
11999 2002-04-07 Akim Demaille <akim@epita.fr>
12000
12001 * src/gram.h (rule_s): prec and precsym are now pointers
12002 to the bucket giving the priority/associativity.
12003 Member `associativity' removed: useless.
12004 * src/reduce.c, src/conflicts.c: Adjust.
12005
12006 2002-04-07 Akim Demaille <akim@epita.fr>
12007
12008 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
12009 Properly escape the symbols' TAG when outputting them.
12010
12011 2002-04-07 Akim Demaille <akim@epita.fr>
12012
12013 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12014
12015 2002-04-07 Akim Demaille <akim@epita.fr>
12016
12017 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12018 (LArule): this, which is an array to rule_t*.
12019 * src/print.c, src/conflicts.c: Adjust.
12020
12021 2002-04-07 Akim Demaille <akim@epita.fr>
12022
12023 * src/gram.h (rule_t): Rename `number' as `user_number'.
12024 `number' is a new member.
12025 Adjust dependencies.
12026 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12027
12028 2002-04-07 Akim Demaille <akim@epita.fr>
12029
12030 As a result of the previous patch, it is no longer needed
12031 to reorder ritem itself.
12032
12033 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12034
12035 2002-04-07 Akim Demaille <akim@epita.fr>
12036
12037 Be sure never to walk through RITEMS, but use only data related to
12038 the rules themselves. RITEMS should be banished.
12039
12040 * src/output.c (output_token_translations): Rename as...
12041 (prepare_tokens): this.
12042 In addition to `translate', prepare the muscles `tname' and
12043 `toknum', which were handled by...
12044 (output_rule_data): this.
12045 Remove, and move the remainder of its outputs into...
12046 (prepare_rules): this new routines, which also merges content from
12047 (output_gram): this.
12048 (prepare_rules): Be sure never to walk through RITEMS.
12049 (output_stos): Rename as...
12050 (prepare_stos): this.
12051 (output): Always invoke prepare_states, after all, just don't use it
12052 in the output if you don't need it.
12053
12054 2002-04-07 Akim Demaille <akim@epita.fr>
12055
12056 * src/LR0.c (new_state): Display `nstates' as the name of the
12057 newly created state.
12058 Adjust to initialize first_state and last_state if needed.
12059 Be sure to distinguish the initial from the final state.
12060 (new_states): Create the itemset of the initial state, and use
12061 new_state.
12062 * src/closure.c (closure): Now that the initial state has its
12063 items properly set, there is no need for a special case when
12064 creating `ruleset'.
12065
12066 As a result, now the rule 0, reducing to $axiom, is visible in the
12067 outputs. Adjust the test suite.
12068
12069 * tests/conflicts.at (Solved SR Conflicts)
12070 (Unresolved SR Conflicts): Adjust.
12071 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12072 * tests/conflicts.at (S/R in initial): New.
12073
12074 2002-04-07 Akim Demaille <akim@epita.fr>
12075
12076 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12077 the RHS of the rules.
12078 * src/output.c (output_gram): Likewise.
12079
12080 2002-04-07 Akim Demaille <akim@epita.fr>
12081
12082 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12083 bucket.
12084 Adjust all dependencies.
12085 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12086 `number' of the buckets too.
12087 * src/gram.h: Include `symtab.h'.
12088 (associativity): Move to...
12089 * src/symtab.h: here.
12090 No longer include `gram.h'.
12091
12092 2002-04-07 Akim Demaille <akim@epita.fr>
12093
12094 * src/gram.h, src/gram.c (rules_rhs_length): New.
12095 (ritem_longest_rhs): Use it.
12096 * src/gram.h (rule_t): `number' is a new member.
12097 * src/reader.c (packgram): Set it.
12098 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12099 the end of `rules', and count them out of `nrules'.
12100 (reduce_output, dump_grammar): Adjust.
12101 * src/print.c (print_grammar): It is no longer needed to check for
12102 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12103 * tests/reduce.at (Reduced Automaton): New test.
12104
12105 2002-04-07 Akim Demaille <akim@epita.fr>
12106
12107 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12108 lacking `+ 1' to nrules, Bison reported as useless a token if it
12109 was used solely to set the precedence of the last rule...
12110
12111 2002-04-07 Akim Demaille <akim@epita.fr>
12112
12113 * data/bison.c++, data/bison.simple: Don't output the current file
12114 name in #line, to avoid useless diffs between two identical
12115 outputs under different names.
12116
12117 2002-04-07 Akim Demaille <akim@epita.fr>
12118
12119 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12120 Normalize loops to using `< nrules + 1', not `<= nrules'.
12121
12122 2002-04-07 Akim Demaille <akim@epita.fr>
12123
12124 * TODO: Update.
12125
12126 2002-04-07 Akim Demaille <akim@epita.fr>
12127
12128 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12129 bucket.value as bucket.number.
12130
12131 2002-04-07 Akim Demaille <akim@epita.fr>
12132
12133 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12134 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12135 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12136 RHS, instead of being an index in RITEMS.
12137
12138 2002-04-04 Paul Eggert <eggert@twinsun.com>
12139
12140 * doc/bison.texinfo: Update copyright date.
12141 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12142 (Symbols): Warn about running Bison in one character set,
12143 but compiling and/or running in an incompatible one.
12144 Warn about character code 256, too.
12145
12146 2002-04-03 Paul Eggert <eggert@twinsun.com>
12147
12148 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12149 YYERROR_VERBOSE is nonzero, not whether it is defined.
12150
12151 Merge changes from bison-1_29-branch.
12152
12153 2002-03-20 Paul Eggert <eggert@twinsun.com>
12154
12155 Merge fixes from Debian bison_1.34-1.diff.
12156
12157 * configure.in (AC_PREREQ): 2.53.
12158
12159 2002-03-20 Akim Demaille <akim@epita.fr>
12160
12161 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12162
12163 2002-03-19 Paul Eggert <eggert@twinsun.com>
12164
12165 * src/bison.simple (YYCOPY): New macro.
12166 (YYSTACK_RELOCATE): Use it.
12167 Remove Type arg; no longer needed. All callers changed.
12168 (yymemcpy): Remove; no longer needed.
12169
12170 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12171 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12172
12173 2002-03-19 Akim Demaille <akim@epita.fr>
12174
12175 Test and fix the #line outputs.
12176
12177 * tests/atlocal.at (GCC): New.
12178 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
12179 (Prologue synch line, %union synch line, Postprologue synch line)
12180 (Action synch line, Epilogue synch line): New tests.
12181 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12182 * data/bison.simple, data/bison.c++: Use it.
12183
12184 2002-03-19 Akim Demaille <akim@epita.fr>
12185
12186 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12187 (Solved SR Conflicts, %expect not enough, %expect right)
12188 (%expect too much): Move to...
12189 * tests/conflicts.at: this new file.
12190
12191 2002-03-19 Akim Demaille <akim@epita.fr>
12192
12193 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12194 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12195 that we can move to enums for instance.
12196 * src/output.c (token_definitions_output): Output a list of
12197 `token-name, token-number' instead of the #define.
12198 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12199
12200 2002-03-14 Akim Demaille <akim@epita.fr>
12201
12202 Use Gettext 0.11.1.
12203
12204 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
12205
12206 * data/bison.c++: Make the user able to add members to the generated
12207 parser by subclassing.
12208
12209 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
12210
12211 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12212 a character.
12213 Reported by Nicolas Tisserand and Nicolas Burrus.
12214
12215 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12216
12217 * src/reader.c: Warn about lacking semi-colons, do not complain.
12218
12219 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12220
12221 * data/bison.c++: Remove a debug line.
12222
12223 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12224
12225 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12226 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12227 provide a default implementation.
12228
12229 2002-03-04 Akim Demaille <akim@epita.fr>
12230
12231 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12232 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12233 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12234 * tests/semantic.at (Parsing Guards): Similarly.
12235 * src/reader.at (readgram): Complain if the last rule is not ended
12236 with a semi-colon.
12237
12238 2002-03-04 Akim Demaille <akim@epita.fr>
12239
12240 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12241 * src/closure.c: here.
12242 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12243 RTC.
12244 * src/warshall.h, src/warshall.c: Remove.
12245 * tests/sets.at (Broken Closure): Adjust.
12246
12247 2002-03-04 Akim Demaille <akim@epita.fr>
12248
12249 * src/output.c (output_skeleton): tempdir is const.
12250 bytes_read is unused.
12251
12252 2002-03-04 Akim Demaille <akim@epita.fr>
12253
12254 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12255 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12256 Update.
12257 From Michael Hayes.
12258
12259 2002-03-04 Akim Demaille <akim@epita.fr>
12260
12261 * src/closure.c (closure): `r' is unused.
12262
12263 2002-03-04 Akim Demaille <akim@epita.fr>
12264
12265 * tests/sets.at (Broken Closure): Add the ending `;'.
12266 * src/reader.at (readgram): Complain if a rule is not ended with a
12267 semi-colon.
12268
12269 2002-03-04 Akim Demaille <akim@epita.fr>
12270
12271 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12272 (count_sr_conflicts): Use bitset_count.
12273 * src/reduce.c (inaccessable_symbols): Ditto.
12274 (bits_size): Remove.
12275 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12276
12277 2002-03-04 Akim Demaille <akim@epita.fr>
12278
12279 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12280 * src/reduce.c: Remove the `bitset_zero's following the
12281 `bitset_create's, as now it is performed by the latter.
12282
12283 2002-03-04 Akim Demaille <akim@epita.fr>
12284
12285 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12286 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12287 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12288 latest sources from Michael.
12289
12290 2002-03-04 Akim Demaille <akim@epita.fr>
12291
12292 * src/output.c (output): Don't free the grammar.
12293 * src/reader.c (grammar_free): New.
12294 * src/main.c (main): Call it and don't free symtab here.
12295
12296 2002-03-04 Akim Demaille <akim@epita.fr>
12297
12298 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12299 before returning.
12300 Reported by Benoit Perrot.
12301
12302 2002-03-04 Akim Demaille <akim@epita.fr>
12303
12304 Use bitset operations when possible, not loops over bits.
12305
12306 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12307 bitset_or.
12308 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12309 * src/reduce.c (useless_nonterminals): Formatting changes.
12310 * src/warshall.c (TC): Use bitset_or.
12311
12312 2002-03-04 Akim Demaille <akim@epita.fr>
12313
12314 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12315 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12316 Ditto.
12317
12318 2002-03-04 Akim Demaille <akim@epita.fr>
12319
12320 * src/lalr.c (F): Now a bitset*.
12321 Adjust all dependencies.
12322
12323 2002-03-04 Akim Demaille <akim@epita.fr>
12324
12325 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12326 Adjust all dependencies.
12327
12328 2002-03-04 Akim Demaille <akim@epita.fr>
12329
12330 * src/L0.c, src/LR0.h (nstates): Be size_t.
12331 Adjust comparisons (signed vs unsigned).
12332 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12333 bitset*.
12334 Adjust all dependencies.
12335
12336 2002-03-04 Akim Demaille <akim@epita.fr>
12337
12338 * src/closure.c (firsts): Now, also a bitset.
12339 Adjust all dependencies.
12340 (varsetsize): Remove, now unused.
12341 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12342
12343 2002-03-04 Akim Demaille <akim@epita.fr>
12344
12345 * src/print.c: Convert to use bitset.h, not hand coded iterations
12346 over ints.
12347
12348 2002-03-04 Akim Demaille <akim@epita.fr>
12349
12350 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12351
12352 2002-03-04 Akim Demaille <akim@epita.fr>
12353
12354 * src/closure.c (ruleset): Be a bitset.
12355 (rulesetsize): Remove.
12356
12357 2002-03-04 Akim Demaille <akim@epita.fr>
12358
12359 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12360 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12361 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12362 * src/closure.c (fderives): Be an array of bitsets.
12363
12364 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
12365
12366 * data/bison.c++: Merge the two generated headers. Insert a copyright
12367 notice in each output file.
12368
12369 2002-02-28 Akim Demaille <akim@epita.fr>
12370
12371 * data/bison.c++: Copy the prologue of bison.simple to fetch
12372 useful M4 definitions, such as b4_header_guard.
12373
12374 2002-02-25 Akim Demaille <akim@epita.fr>
12375
12376 * src/getargs.c (version): Give the name of the authors, and use a
12377 translator friendly scheme for the bgr
12378 copyright notice.
12379
12380 2002-02-25 Akim Demaille <akim@epita.fr>
12381
12382 * src/output.c (header_output): Remove, now handled completely via
12383 M4.
12384
12385 2002-02-25 Akim Demaille <akim@epita.fr>
12386
12387 * m4/m4.m4: New, from CVS Autoconf.
12388 * configure.in: Invoke it.
12389 * src/output.c (output_skeleton): Use its result instead of the
12390 hard coded name.
12391
12392 2002-02-25 Akim Demaille <akim@epita.fr>
12393
12394 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12395 Fileutils 4.1.5.
12396 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12397 * src/output.c (output_skeleton): Use mkstemp to create a real
12398 temporary file.
12399 Move the filling of `skeleton' and its muscle to...
12400 (prepare): here.
12401 (output): Move the definition of the prologue muscle to...
12402 (prepare): here.
12403 * src/system.h (DEFAULT_TMPDIR): New.
12404
12405 2002-02-14 Paul Eggert <eggert@twinsun.com>
12406
12407 Remove the support for C++ namespace cleanliness; it was
12408 causing more problems than it was curing, since it didn't work
12409 properly on some nonstandard C++ compilers. This can wait
12410 for a proper C++ parser.
12411
12412 * NEWS: Document this.
12413 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12414 of C++, as it's treated like C now.
12415 * src/bison.simple (YYSTD): Remove.
12416 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12417 Treat C++ just like Standard C instead of trying to support
12418 namespace cleanliness.
12419
12420 2002-02-14 Akim Demaille <akim@epita.fr>
12421
12422 * tests/regression.at (else): Adjust to Andreas' change.
12423
12424 2002-02-14 Akim Demaille <akim@epita.fr>
12425
12426 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12427
12428 2002-02-13 Andreas Schwab <schwab@suse.de>
12429
12430 * src/output.c (output_rule_data): Don't output NULL, it might
12431 not be defined yet.
12432
12433 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
12434
12435 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12436 (Copyright notice): Update.
12437
12438 2002-02-11 Akim Demaille <akim@epita.fr>
12439
12440 * tests/regression.at (%nonassoc and eof): Don't include
12441 nonportable headers.
12442
12443 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
12444
12445 * data/bison.c++: Correct error recovery. Make the user able to
12446 initialize the starting location.
12447
12448 2002-02-07 Akim Demaille <akim@epita.fr>
12449
12450 * tests/input.at: New.
12451
12452 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12453
12454 * data/bison.c++: Replace some direct m4 expansions by constants. Be
12455 more consistent when naming methods and variables. Put preprocessor
12456 directives around tables only needed for debugging.
12457
12458 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12459
12460 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12461 C++ parsers.
12462 (yy::b4_name::parse): Use print_.
12463
12464 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12465
12466 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12467
12468 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12469
12470 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12471 C++ parsers.
12472 (yy::b4_name::parse): Build verbose error messages, and use error_.
12473
12474 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12475
12476 * data/bison.c++: Fix m4 quoting in comments.
12477
12478 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12479
12480 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12481 not expanded by m4.
12482
12483 2002-02-05 Akim Demaille <akim@epita.fr>
12484
12485 * data/bison.c++: Adjust to the M4 back end.
12486 More is certainly needed.
12487
12488 2002-02-05 Akim Demaille <akim@epita.fr>
12489
12490 Give a try to M4 as a back end.
12491
12492 * lib/readpipe.c: New, from wdiff.
12493 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12494 BISON_HAIRY.
12495 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12496 specific values. Now it is m4 that performs the lookup.
12497 * src/parse-skel.y: Remove.
12498 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12499 * src/output.c (actions_output, guards_output)
12500 (token_definitions_output): No longer keeps track of the output
12501 line number, hence remove the second argument.
12502 (guards_output): Check against the guard member of a rule, not the
12503 action member.
12504 Adjust callers.
12505 (output_skeleton): Don't look for the skeleton location, let m4 do
12506 that.
12507 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12508 file will be used.
12509 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12510 (prepare): Given that for the time being changesyntax is not
12511 usable in M4, rename the muscles using `-' to `_'.
12512 Define `defines_flag', `output_parser_name' and `output_header_name'.
12513 * src/output.h (actions_output, guards_output)
12514 (token_definitions_output): Adjust prototypes.
12515 * src/scan-skel.l: Instead of scanning the skeletons, it now
12516 processes the output of m4: `__oline__' and `#output'.
12517 * data/bison.simple: Adjust to be used by M4(sugar).
12518 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12519 to date.
12520 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12521 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12522 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12523 shamelessly stolen from CVS Autoconf.
12524
12525 2002-02-05 Akim Demaille <akim@epita.fr>
12526
12527 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12528 * configure.in: Check for the declarations of free and malloc.
12529 * src/muscle_tab.c: Adjust.
12530
12531 2002-02-05 Akim Demaille <akim@epita.fr>
12532
12533 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12534 which have no values.
12535
12536 2002-02-05 Akim Demaille <akim@epita.fr>
12537
12538 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12539 * data/: here.
12540
12541 2002-01-29 Paul Eggert <eggert@twinsun.com>
12542
12543 * src/bison.simple (YYSIZE_T): Do not define merely because
12544 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12545 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12546
12547 2002-01-27 Akim Demaille <akim@epita.fr>
12548
12549 Fix `%nonassoc and eof'.
12550
12551 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12552 which were not properly copied! Replace
12553 memcpy (res->errs, src->errs, src->nerrs);
12554 with
12555 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12556 !!!
12557 * tests/regression.at (%nonassoc and eof): Adjust to newest
12558 Autotest: `.' is not in the PATH.
12559
12560 2002-01-27 Akim Demaille <akim@epita.fr>
12561
12562 * tests/sets.at (AT_EXTRACT_SETS): New.
12563 (Nullable): Use it.
12564 (Firsts): New.
12565
12566 2002-01-26 Akim Demaille <akim@epita.fr>
12567
12568 * tests/actions.at, tests/calc.at, tests/headers.at,
12569 * tests/torture.at: Adjust to the newest Autotest which no longer
12570 forces `.' in the PATH.
12571
12572 2002-01-25 Akim Demaille <akim@epita.fr>
12573
12574 * tests/regression.at (%nonassoc and eof): New.
12575 Suggested by Robert Anisko.
12576
12577 2002-01-24 Akim Demaille <akim@epita.fr>
12578
12579 Bison dumps core when trying to complain about broken input files.
12580 Reported by Cris van Pelt.
12581
12582 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12583 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12584 into...
12585 (Invalid inputs): Strengthen: exercise parse_percent_token.
12586
12587 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
12588
12589 * src/Makefile.am: Add bison.c++.
12590 * src/bison.c++: New skeleton.
12591
12592 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
12593
12594 * po/it.po: New.
12595
12596 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12597
12598 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12599
12600 2002-01-20 Marc Autret <marc@gnu.org>
12601
12602 * src/files.c (compute_output_file_names): Fix
12603
12604 2002-01-20 Marc Autret <marc@gnu.org>
12605
12606 * tests/output.at: New test.
12607 * src/files.c (compute_base_names): Don't map extensions when
12608 the YACC flag is set, use defaults.
12609 Reported by Evgeny Stambulchik.
12610
12611 2002-01-20 Marc Autret <marc@gnu.org>
12612
12613 * src/system.h: Need to define __attribute__ away for non-GCC
12614 compilers as well (i.e., the vendor C compiler).
12615 Suggested by Albert Chin-A-Young.
12616
12617 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12618
12619 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
12620 canonical definition.
12621 * src/system.h: Use the canonical definition for PARAMS (avoids
12622 a conflict with the macro from lib/hash.h).
12623
12624 2002-01-11 Akim Demaille <akim@epita.fr>
12625
12626 * configure.in: Use AC_FUNC_STRNLEN.
12627 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
12628
12629 2002-01-09 Akim Demaille <akim@epita.fr>
12630
12631 * src/files.c, src/files.h (output_infix): New.
12632 (tab_extension): Remove.
12633 (compute_base_names): Compute the former, drop the latter.
12634 * src/output.c (prepare): Insert the muscles `output-infix', and
12635 `output-suffix'.
12636 * src/parse-skel.y (string, string.1): New.
12637 (section.header): Use it.
12638 (section.yacc): Remove.
12639 (prefix): Remove too.
12640 * src/scan-skel.l: Adjust.
12641 * src/bison.simple, src/bison.hairy: Adjust.
12642
12643 2002-01-09 Akim Demaille <akim@epita.fr>
12644
12645 * configure.in (WERROR_CFLAGS): Compute it.
12646 * src/Makefile.am (CFLAGS): Pass it.
12647 * tests/atlocal.in (CFLAGS): Idem.
12648 * src/files.c: Fix a few warnings.
12649 (get_extension_index): Remove, unused.
12650
12651 2002-01-08 Akim Demaille <akim@epita.fr>
12652
12653 * src/getargs.c (AS_FILE_NAME): New.
12654 (getargs): Use it to convert DOSish file names.
12655 * src/files.c (base_name): Rename as full_base_name to avoid
12656 clashes with `base_name ()'.
12657 (filename_split): New.
12658 (compute_base_names): N-th rewrite, using filename_split.
12659
12660 2002-01-08 Akim Demaille <akim@epita.fr>
12661
12662 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
12663 New, stolen from the Fileutils 4.1.
12664 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12665 * configure.in: Check for the presence of memrchr, and of its
12666 prototype.
12667
12668 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12669
12670 * lib/hash.h (__P): Added definition for this macro.
12671 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
12672 BUILT_SOURCES, to ensure they are generated first.
12673 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
12674 %error-verbose to allow bootstrapping with bison 1.30x.
12675
12676 2002-01-06 Akim Demaille <akim@epita.fr>
12677
12678 * src/reader.c (parse_braces): Don't fetch the next char, the
12679 convention is to fetch on entry.
12680 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
12681 'switch' without a following semicolon.
12682 * tests/regression.at (braces parsing): New.
12683
12684 2002-01-06 Akim Demaille <akim@epita.fr>
12685
12686 Bison is dead wrong in its RR conflict reports.
12687
12688 * tests/torture.at (GNU Cim Grammar): New.
12689 * src/conflicts.c (count_rr_conflicts): Fix.
12690
12691 2002-01-06 Akim Demaille <akim@epita.fr>
12692
12693 Creating package.m4 from configure.ac causes too many problems.
12694
12695 * tests/Makefile.am (package.m4): Create it by hand,
12696 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12697
12698 2002-01-06 Akim Demaille <akim@epita.fr>
12699
12700 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12701 skeleton.h.
12702
12703 2002-01-04 Paul Eggert <eggert@twinsun.com>
12704
12705 * doc/bison.texinfo (Debugging):
12706 Remove YYSTDERR; it's no longer defined or used.
12707 Also, s/cstdio.h/cstdio/.
12708
12709 2002-01-03 Akim Demaille <akim@epita.fr>
12710
12711 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12712
12713 2002-01-03 Akim Demaille <akim@epita.fr>
12714
12715 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12716 tracing code to --trace, wait for a better --trace option, with
12717 args.
12718
12719 2002-01-03 Akim Demaille <akim@epita.fr>
12720
12721 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12722 The ISO C++ standard is extremely clear about it: stderr is
12723 considered a macro, not a regular symbol (see table 94 `Header
12724 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12725 Therefore std:: does not apply to it. It still does with fprintf.
12726 Also, s/cstdio.h/cstdio/.
12727
12728 2002-01-03 Akim Demaille <akim@epita.fr>
12729
12730 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12731 for non system headers.
12732
12733 2002-01-02 Akim Demaille <akim@epita.fr>
12734
12735 Equip the skeleton chain with location tracking, runtime trace,
12736 pure parser and scanner.
12737
12738 * src/parse-skel.y: Request a pure parser, locations, and prefix
12739 renaming.
12740 (%union): Having several members with the same type does not help
12741 type mismatches, simplify.
12742 (YYPRINT, yyprint): New.
12743 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12744 (skel_error): this.
12745 Handle locations.
12746 * src/scan-skel.l: Adjust to these changes.
12747 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12748 (LOCATION_PRINT, skel_control_t): New.
12749
12750 2001-12-30 Akim Demaille <akim@epita.fr>
12751
12752 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12753 replace `gb' with BLANKS.
12754 * src/scan-skel.l: Adjust.
12755
12756 2001-12-30 Akim Demaille <akim@epita.fr>
12757
12758 * src/system.h: We don't need nor want bcopy.
12759 Throw away MS-DOS crap: we don't need getpid.
12760 * configure.in: We don't need strndup. It was even causing
12761 problems: because Flex includes the headers *before* us,
12762 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12763 not visible.
12764 * lib/xstrndup.c: New.
12765 * src/scan-skel.l: Use it.
12766 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12767 * src/parse-skel.y: Use %directives instead of #defines.
12768
12769 2001-12-30 Akim Demaille <akim@epita.fr>
12770
12771 * src/skeleton.h: New.
12772 * src/output.c (output_parser, output_master_parser): Remove, dead
12773 code.
12774 * src/output.h (get_lines_number, actions_output, guards_output)
12775 (token_definitions_output): Prototype them.
12776 * src/parse-skel.y: Add the license notice.
12777 Include output.h and skeleton.h.
12778 (process_skeleton): Returns void, and takes a single parameter.
12779 * src/scan-skel.l: Add the license notice.
12780 Include skeleton.h.
12781 Don't use %option yylineno: it seems that then Flex imagines
12782 REJECT has been used, and therefore it won't reallocate its
12783 buffers (which makes no other sense to me than a bug). It results
12784 in warnings for `unused: yy_flex_realloc'.
12785
12786 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
12787
12788 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12789 (MUSCLE_INSERT_PREFIX): ...to there.
12790 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12791 (MUSCLE_INSERT_PREFIX): Move from here...
12792
12793 * src/bison.hairy: Add a section directive. Put braces around muscle
12794 names. This parser skeleton is still broken, but Bison should not
12795 choke on a bad muscle 'syntax'.
12796 * src/bison.simple: Add a section directive. Put braces around muscle
12797 names.
12798
12799 * src/files.h (strsuffix, stringappend): Add declarations.
12800 (tab_extension): Add declaration.
12801 (short_base_name): Add declaration.
12802
12803 * src/files.c (strsuffix, stringappend): No longer static. These
12804 functions are used in the skeleton parser.
12805 (tab_extension): New.
12806 (compute_base_names): Use the computations done in this function
12807 to guess if the generated parsers should have '.tab' in their
12808 names.
12809 (short_base_name): No longer static.
12810
12811 * src/output.c (output_skeleton): New.
12812 (output): Disable call to output_master_parser, and give a try to
12813 a new skeleton handling system.
12814 (guards_output, actions_output): No longer static.
12815 (token_definitions_output, get_lines_number): No longer static.
12816
12817 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12818
12819 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
12820 parse-skel.y.
12821
12822 * src/parse-skel.y: New file.
12823 * src/scan-skel.l: New file.
12824
12825 2001-12-29 Akim Demaille <akim@epita.fr>
12826
12827 %name-prefix is broken.
12828
12829 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12830 Adjust all dependencies.
12831 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12832 %name-prefix.
12833
12834 Renaming yylval but not yylloc is not consistent. Now we do.
12835
12836 * src/bison.simple: Prefix yylloc if used.
12837 * doc/bison.texinfo (Decl Summary): Document that.
12838
12839 2001-12-29 Akim Demaille <akim@epita.fr>
12840
12841 * doc/bison.texinfo: Promote `%long-directive' over
12842 `%long_directive'.
12843 Remove all references to fixed-output-files, yacc is enough.
12844
12845 2001-12-29 Akim Demaille <akim@epita.fr>
12846
12847 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12848 user prologue. These are defaults.
12849 * tests/actions.at (Mid-rule actions): Make sure the user can
12850 define YYDEBUG and YYERROR_VERBOSE.
12851
12852 2001-12-29 Akim Demaille <akim@epita.fr>
12853
12854 * src/output.c (header_output): Don't forget to export YYLTYPE and
12855 yylloc.
12856 * tests/headers.at (export YYLTYPE): New, make sure it does.
12857 * tests/regression.at (%union and --defines, Invalid CPP headers):
12858 Move to...
12859 * tests/headers.at: here.
12860
12861 2001-12-29 Akim Demaille <akim@epita.fr>
12862
12863 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12864
12865 2001-12-29 Akim Demaille <akim@epita.fr>
12866
12867 * tests/actions.at (Mid-rule actions): Output on a single line
12868 instead of several.
12869
12870 2001-12-29 Akim Demaille <akim@epita.fr>
12871
12872 * doc/bison.texinfo: Formatting changes.
12873
12874 2001-12-29 Akim Demaille <akim@epita.fr>
12875
12876 Don't store the token defs in a muscle, just be ready to output it
12877 on command. Now possible via `symbols'. Fixes a memory leak.
12878
12879 * src/output.c (token_definitions_output): New.
12880 (output_parser, header_output): Use it.
12881 * src/reader.c (symbols_save): Remove.
12882
12883 2001-12-29 Akim Demaille <akim@epita.fr>
12884
12885 * src/bison.simple: Do not provide a default for YYSTYPE and
12886 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12887 default.
12888
12889 2001-12-29 Akim Demaille <akim@epita.fr>
12890
12891 Mid-rule actions are simply... ignored!
12892
12893 * src/reader.c (readgram): Be sure to attach mid-rule actions to
12894 the empty-rule associated to the dummy symbol, not to the host
12895 rule.
12896 * tests/actions.at (Mid-rule actions): New.
12897
12898 2001-12-29 Akim Demaille <akim@epita.fr>
12899
12900 Memory leak.
12901
12902 * src/reader.c (reader): Free grammar.
12903
12904 2001-12-29 Akim Demaille <akim@epita.fr>
12905
12906 Memory leak.
12907
12908 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12909 since it allocates it for each state, although only one is needed.
12910 (allocate_storage): Do it here.
12911
12912 2001-12-29 Akim Demaille <akim@epita.fr>
12913
12914 * src/options.h, src/options.c (create_long_option_table): Rename
12915 as...
12916 (long_option_table_new): this, with a clearer prototype.
12917 (percent_table): Remove, unused,
12918 * src/getargs.c (getargs): Adjust.
12919
12920 2001-12-29 Akim Demaille <akim@epita.fr>
12921
12922 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
12923 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
12924 as states.
12925
12926 2001-12-29 Akim Demaille <akim@epita.fr>
12927
12928 * src/lalr.c (build_relations): Rename `states' as `states1'.
12929 Sorry, I don't understand exactly what it is, no better name...
12930
12931 2001-12-29 Akim Demaille <akim@epita.fr>
12932
12933 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
12934 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
12935 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12936 as rules.
12937
12938 2001-12-29 Akim Demaille <akim@epita.fr>
12939
12940 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12941 ago.
12942
12943 2001-12-29 Akim Demaille <akim@epita.fr>
12944
12945 * src/reader.c, src/reader.h (user_toknums): Remove.
12946 Adjust all users to use symbols[i]->user_token_number.
12947
12948 2001-12-29 Akim Demaille <akim@epita.fr>
12949
12950 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12951 Adjust all users to use symbols[i]->prec or ->assoc.
12952
12953 2001-12-29 Akim Demaille <akim@epita.fr>
12954
12955 * src/reader.c, src/reader.h (tags): Remove.
12956 Adjust all users to use symbols[i]->tag.
12957
12958 2001-12-29 Akim Demaille <akim@epita.fr>
12959
12960 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12961 and rule_table.
12962 * src/reader.c (packsymbols): Fill this table.
12963 Drop sprec.
12964 * src/conflicts.c (resolve_sr_conflict): Adjust.
12965 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12966 single table.
12967 Use symbols[i]->tag instead of tags[i].
12968
12969 2001-12-29 Akim Demaille <akim@epita.fr>
12970
12971 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12972 In addition, put a comment in there, to replace...
12973 * tests/regression.at (%union and C comments): Remove.
12974
12975 2001-12-29 Akim Demaille <akim@epita.fr>
12976
12977 * tests/regression.at (Web2c Actions): Blindly move the actual
12978 output as expected output. The contents *seem* right to me, but I
12979 can't pretend reading perfectly parser tables... Nonetheless, all
12980 the other tests pass correctly, the table look OK, even though the
12981 presence of `$axiom' is to be noted: AFAICS it is useless (but
12982 harmless).
12983
12984 2001-12-29 Akim Demaille <akim@epita.fr>
12985
12986 * src/reader.c (readgram): Don't add the rule 0 if there were no
12987 rules read. In other words, add it _after_ having performed
12988 grammar sanity checks.
12989 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12990
12991 2001-12-29 Akim Demaille <akim@epita.fr>
12992
12993 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12994 visible, and some states have now a different number.
12995
12996 2001-12-29 Akim Demaille <akim@epita.fr>
12997
12998 * src/reader.c (readgram): Bind the initial rule's lineno to that
12999 of the first rule.
13000 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
13001 (Solved SR Conflicts): Adjust rule 0's line number.
13002
13003 2001-12-29 Akim Demaille <akim@epita.fr>
13004
13005 Fix the `GAWK Grammar' failure.
13006
13007 * src/LR0.c (final_state): Initialize to -1 so that we do compute
13008 the reductions of the first state which was mistakenly confused
13009 with the final state because precisely final_state was initialized
13010 to 0.
13011 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13012 now noticed by Bison.
13013 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13014 have a reduction on $default.
13015
13016 2001-12-29 Akim Demaille <akim@epita.fr>
13017
13018 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13019 rule line numbers.
13020 * src/closure.c (print_closure): Likewise.
13021 * src/derives.c (print_derives): Likewise.
13022 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13023 now.
13024
13025 2001-12-29 Akim Demaille <akim@epita.fr>
13026
13027 * src/lalr.c (lookaheads_print): New.
13028 (lalr): Call it when --trace-flag.
13029 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13030 are dumped.
13031
13032 2001-12-29 Akim Demaille <akim@epita.fr>
13033
13034 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13035 when walking through ritem, even via rule->rhs.
13036 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13037 (useful_production, useless_nonterminals): Likewise.
13038 (reduce_grammar_tables): Likewise, plus update nritems.
13039 * src/nullable.c (set_nullable): Likewise.
13040 * src/lalr.c (build_relations): Likewise.
13041 * tests/sets.at (Nullable): Adjust.
13042 Fortunately, now, the $axiom is no longer nullable.
13043
13044 2001-12-29 Akim Demaille <akim@epita.fr>
13045
13046 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13047 the 0-sentinel.
13048 * src/gram.c (ritem_longest_rhs): Likewise.
13049 * src/reduce.c (nonterminals_reduce): Likewise.
13050 * src/print_graph.c (print_graph): Likewise.
13051 * src/output.c (output_rule_data): Likewise.
13052 * src/nullable.c (set_nullable): Likewise.
13053
13054 2001-12-29 Akim Demaille <akim@epita.fr>
13055
13056 * src/output.c: Comment changes.
13057
13058 2001-12-27 Paul Eggert <eggert@twinsun.com>
13059
13060 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13061 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13062 Sparc, as they were causing more porting problems than the
13063 (minor) performance improvement was worth.
13064
13065 Also, catch up with 1.31's YYSTD.
13066
13067 2001-12-27 Akim Demaille <akim@epita.fr>
13068
13069 * src/output.c (output_gram): Rely on nritems, not the
13070 0-sentinel. See below.
13071 Use -1 as separator, not 0.
13072 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13073 Rely on -1 as separator in yyrhs, instead of 0.
13074 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13075 twice `Now at end of input', therefore there are two lines less to
13076 expect.
13077
13078 2001-12-27 Akim Demaille <akim@epita.fr>
13079
13080 * tests/regression.at (Unresolved SR Conflicts):
13081 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13082 below.
13083
13084 2001-12-27 Akim Demaille <akim@epita.fr>
13085
13086 * src/LR0.c (new_state): Recognize the final state by the fact it
13087 is reached by eoftoken.
13088 (insert_start_shifting_state, insert_eof_shifting_state)
13089 (insert_accepting_state, augment_automaton): Remove, since now
13090 these states are automatically computed from the initial state.
13091 (generate_states): Adjust.
13092 * src/print.c: When reporting a rule number to the user, substract
13093 1, so that the axiom rule is rule 0, and the first user rule is 1.
13094 * src/reduce.c: Likewise.
13095 * src/print_graph.c (print_core): For the time being, just as for
13096 the report, depend upon --trace-flags to dump the full set of
13097 items.
13098 * src/reader.c (readgram): Once the grammar read, insert the rule
13099 0: `$axiom: START-SYMBOL $'.
13100 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13101 number of the states has changed (the final state is no longer
13102 necessarily the last), catch up.
13103
13104 2001-12-27 Akim Demaille <akim@epita.fr>
13105
13106 Try to make the use of the eoftoken valid. Given that its value
13107 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13108 is used instead of > 0 where appropriate, (ii), depend upon nritems
13109 instead of the 0-sentinel.
13110
13111 * src/gram.h, src/gram.c (nritems): New.
13112 Expected to be duplication of nitems, but for the time being...
13113 * src/reader.c (packgram): Assert nritems and nitems are equal.
13114 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13115 * src/closure.c (print_closure, print_fderives): Likewise.
13116 * src/gram.c (ritem_print): Likewise.
13117 * src/print.c (print_core, print_grammar): Likewise.
13118 * src/print_graph.c: Likewise.
13119
13120 2001-12-27 Akim Demaille <akim@epita.fr>
13121
13122 * src/main.c (main): If there are complains after grammar
13123 reductions, then output the report anyway if requested, then die.
13124 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13125 * src/reader.c (eoftoken): New.
13126 (parse_token_decl): If the token being defined has value `0', it
13127 is the eoftoken.
13128 (packsymbols): No longer hack `tags' to insert `$' by hand.
13129 Be sure to preserve the value of the eoftoken.
13130 (reader): Make sure eoftoken is defined.
13131 Initialize nsyms to 0: now eoftoken is created just like the others.
13132 * src/print.c (print_grammar): Don't special case the eof token.
13133 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13134 lie anyway, albeit pleasant.
13135 * tests/calc.at: Exercise error messages with eoftoken.
13136 Change the grammar so that empty input is invalid.
13137 Adjust expectations.
13138 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13139
13140 2001-12-27 Akim Demaille <akim@epita.fr>
13141
13142 * configure.in: Check the protos of strchr ans strspn.
13143 Replace strchr if needed.
13144 * src/system.h: Provide the protos of strchr, strspn and memchr if
13145 missing.
13146 * lib/strchr.c: New.
13147 * src/reader.c (symbols_save): Use strchr.
13148
13149 2001-12-27 Akim Demaille <akim@epita.fr>
13150
13151 * src/print.c, src/print_graph.c (escape): New.
13152 Use it to quote the TAGS outputs.
13153 * src/print_graph.c (print_state): Now errors are in red, and
13154 reductions in green.
13155 Prefer high to wide: output the state number on a line of its own.
13156
13157 2001-12-27 Akim Demaille <akim@epita.fr>
13158
13159 * src/state.h, src/state.c (reductions_new): New.
13160 * src/LR0.c (set_state_table): Let all the states have a
13161 `reductions', even if reduced to 0.
13162 (save_reductions): Adjust.
13163 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13164 * src/print.c (print_reductions, print_actions): Adjust.
13165 * src/output.c (action_row): Adjust.
13166
13167 2001-12-27 Akim Demaille <akim@epita.fr>
13168
13169 * src/state.h, src/state.c (errs_new, errs_dup): New.
13170 * src/LR0.c (set_state_table): Let all the states have an errs,
13171 even if reduced to 0.
13172 * src/print.c (print_errs, print_reductions): Adjust.
13173 * src/output.c (output_actions, action_row): Adjust.
13174 * src/conflicts.c (resolve_sr_conflict): Adjust.
13175
13176 2001-12-27 Akim Demaille <akim@epita.fr>
13177
13178 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13179
13180 2001-12-27 Akim Demaille <akim@epita.fr>
13181
13182 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13183 * src/print.c: here.
13184 (lookaheadset, shiftset): New, used as additional storage by
13185 print_reductions.
13186 (print_results): Adjust.
13187 (print_shifts, print_gotos, print_errs): New, extracted from...
13188 (print_actions): here.
13189 * src/print_graph.c (print_actions): Remove dead code.
13190
13191 2001-12-27 Akim Demaille <akim@epita.fr>
13192
13193 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13194 `$n' and `@n'.
13195
13196 2001-12-27 Akim Demaille <akim@epita.fr>
13197
13198 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13199 (build_relations): Adjust.
13200
13201 2001-12-27 Akim Demaille <akim@epita.fr>
13202
13203 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13204 duplication.
13205
13206 2001-12-27 Akim Demaille <akim@epita.fr>
13207
13208 * src/reader.c (packgram): Catch nitems overflows.
13209
13210 2001-12-27 Akim Demaille <akim@epita.fr>
13211
13212 * src/files.c, src/files.h (guard_obstack): Remove.
13213 * src/output.c (output): Adjust.
13214 * src/reader.c (parse_braces): New, factoring...
13215 (copy_action, copy_guard): these two which are renamed as...
13216 (parse_action, parse_guard): these.
13217 As a voluntary consequence, using braces around guards is now
13218 mandatory.
13219
13220 2001-12-27 Akim Demaille <akim@epita.fr>
13221
13222 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13223 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13224 members.
13225 (symbol_list_new): Adjust.
13226 (copy_action): action_line is the first line, not the last.
13227 (copy_guard): Just as for actions, store the `action' only, not
13228 the switch/case/break flesh.
13229 Don't parse the user action that might follow the guard, let...
13230 (readgram): do it, i.e., now, there can be an action after a
13231 guard.
13232 In other words the guard is just explicitly optional.
13233 (packgram): Adjust.
13234 * src/output.c (guards_output): New.
13235 (output_parser): Call it when needed.
13236 (output): Also free the guard and attrs obstacks.
13237 * src/files.c, src/files.h (obstack_save): Remove.
13238 (output_files): Remove.
13239 As a result, if one needs the former `.act' file, using an
13240 appropriate skeleton which requires actions and guards is now
13241 required.
13242 * src/main.c (main): Adjust.
13243 * tests/semantic.at: New.
13244 * tests/regression.at: Use `input.y' as input file name.
13245 Avoid 8+3 problems by requiring input.c when the test needs the
13246 parser.
13247
13248 2001-12-27 Akim Demaille <akim@epita.fr>
13249
13250 * src/reader.c (symbol_list_new): Be sure to initialize all the
13251 fields.
13252
13253 2001-12-27 Akim Demaille <akim@epita.fr>
13254
13255 All the hacks using a final pseudo state are now useless.
13256
13257 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13258 * src/lalr.c (nLA): New.
13259 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13260 instead of lookaheadsp from the pseudo state (nstate + 1).
13261
13262 2001-12-27 Akim Demaille <akim@epita.fr>
13263
13264 * src/output.c (action_row, token_actions): Use a state_t instead
13265 of a integer, and nlookaheads instead of the following state's
13266 lookaheadsp.
13267
13268 2001-12-27 Akim Demaille <akim@epita.fr>
13269
13270 * src/conflicts.c (log_resolution, flush_shift)
13271 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13272 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13273 (conflicts_print, print_reductions): Use a state_t instead of an
13274 integer when referring to a state.
13275 As much as possible, depend upon nlookaheads, instead of the
13276 `lookaheadsp' member of the following state (since lookaheads of
13277 successive states are successive, the difference between state n + 1
13278 and n served as the number of lookaheads for state n).
13279 * src/lalr.c (add_lookback_edge): Likewise.
13280 * src/print.c (print_core, print_actions, print_state)
13281 (print_results): Likewise.
13282 * src/print_graph.c (print_core, print_actions, print_state)
13283 (print_graph): Likewise.
13284 * src/conflicts.h: Adjust.
13285
13286 2001-12-27 Akim Demaille <akim@epita.fr>
13287
13288 * src/bison.hairy: Formatting/comment changes.
13289 ANSIfy.
13290 Remove `register' indications.
13291 Add plenty of `static'.
13292
13293 2001-12-27 Akim Demaille <akim@epita.fr>
13294
13295 * src/output.c (prepare): Drop the muscle `ntbase' which
13296 duplicates ntokens.
13297 * src/bison.simple: Formatting/comment changes.
13298 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13299 is an undocumented synonym.
13300
13301 2001-12-22 Akim Demaille <akim@epita.fr>
13302
13303 * src/output.c (output_table_data): Change the prototype to use
13304 `int' for array ranges: some invocations do pass an int, not a
13305 short.
13306 Reported by Wayne Green.
13307
13308 2001-12-22 Akim Demaille <akim@epita.fr>
13309
13310 Some actions of web2c.y are improperly triggered.
13311 Reported by Mike Castle.
13312
13313 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13314 * tests/regression.at (Web2c): Rename as...
13315 (Web2c Report): this.
13316 (Web2c Actions): New.
13317
13318 2001-12-22 Akim Demaille <akim@epita.fr>
13319
13320 Reductions in web2c.y are improperly reported.
13321 Reported by Mike Castle.
13322
13323 * src/conflicts.c (print_reductions): Fix.
13324 * tests/regression.at (Web2c): New.
13325
13326 2001-12-18 Akim Demaille <akim@epita.fr>
13327
13328 Some host fail on `assert (!"foo")', which expands to
13329 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13330 Reported by Nelson Beebee.
13331
13332 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13333 `#define it_succeeded 0' and `assert (it_succeeded)'.
13334
13335 2001-12-17 Marc Autret <autret_m@epita.fr>
13336
13337 * src/bison.simple: Don't hard code the skeleton line and filename.
13338 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13339 New line counter 'skeleton_line' (skeleton-line muscle).
13340
13341 2001-12-17 Paul Eggert <eggert@twinsun.com>
13342
13343 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13344 YYDEBUG must be defined to a nonzero value.
13345
13346 * src/bison.simple (yytname): Do not assume that the user defines
13347 YYDEBUG to a properly parenthesized expression.
13348
13349 2001-12-17 Akim Demaille <akim@epita.fr>
13350
13351 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13352 nlookaheads is a new member.
13353 Adjust all users.
13354 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13355 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13356 state.
13357
13358 2001-12-17 Akim Demaille <akim@epita.fr>
13359
13360 * src/files.h, src/files.c (open_files, close_files): Remove.
13361 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13362 let...
13363 * src/reader.c (reader): Do it.
13364
13365 2001-12-17 Akim Demaille <akim@epita.fr>
13366
13367 * src/conflicts.c (print_reductions): Formatting changes.
13368
13369 2001-12-17 Akim Demaille <akim@epita.fr>
13370
13371 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13372 (flush_reduce): New.
13373 (resolve_sr_conflict): Adjust.
13374
13375 2001-12-17 Akim Demaille <akim@epita.fr>
13376
13377 * src/output.c (output_obstack): Be static and rename as...
13378 (format_obstack): this, to avoid any confusion with files.c's
13379 output_obstack.
13380 * src/reader.h (muscle_obstack): Move to...
13381 * src/output.h: here, since it's defined in output.c.
13382
13383 2001-12-17 Akim Demaille <akim@epita.fr>
13384
13385 * src/output.c (action_row, save_column, default_goto)
13386 (sort_actions, matching_state, pack_vector): Better variable
13387 locality.
13388
13389 2001-12-17 Akim Demaille <akim@epita.fr>
13390
13391 * src/output.c: Various formatting changes.
13392
13393 2001-12-17 Akim Demaille <akim@epita.fr>
13394
13395 * src/files.c (output_files): Free the output_obstack.
13396 * src/main.c (main): Call print and print_graph conditionally.
13397 * src/print.c (print): Work unconditionally.
13398 * src/print_graph.c (print_graph): Work unconditionally.
13399 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13400
13401 2001-12-16 Marc Autret <autret_m@epita.fr>
13402
13403 * src/output.c (actions_output): Fix. When we use %no-lines,
13404 there is one less line per action.
13405
13406 2001-12-16 Marc Autret <autret_m@epita.fr>
13407
13408 * src/bison.simple: Remove a useless #line directive.
13409 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13410 * src/output.c (get_lines_number): New.
13411 (output_parser): Adjust, now takes care about the lines of a
13412 output muscles.
13413 Fix line numbering.
13414 (actions_output): Computes the number of lines taken by actions.
13415 (output_master_parser): Insert new skeleton which is the name of
13416 the output parser file name.
13417
13418 2001-12-15 Marc Autret <autret_m@epita.fr>
13419
13420 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13421
13422 2001-12-15 Marc Autret <autret_m@epita.fr>
13423
13424 * src/output.c (output_gram): Keep track of the hairy one.
13425
13426 2001-12-15 Akim Demaille <akim@epita.fr>
13427
13428 Make `make distcheck' work.
13429
13430 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13431 system.h which uses libgettext.h.
13432
13433 2001-12-15 Akim Demaille <akim@epita.fr>
13434
13435 * src/nullable.c (set_nullable): Useless rules must be skipped,
13436 otherwise, since we range over their symbols, we might look at a
13437 nonterminal which no longer ``exists'', i.e., it is not counted in
13438 `nvars', hence we overflow our arrays.
13439
13440 2001-12-15 Akim Demaille <akim@epita.fr>
13441
13442 The header can also be produced directly, without any obstack!
13443 Yahoo!
13444
13445 * src/files.c, src/files.h (defines_obstack): Remove.
13446 (compute_header_macro): Global.
13447 (defines_obstack_save): Remove.
13448 * src/reader.c (parse_union_decl): No longer output to
13449 defines_obstack: its content can be found in the `stype' muscle
13450 anyway.
13451 (output_token_translations): Merge into...
13452 (symbols_output): this.
13453 Rename as...
13454 (symbols_save): this.
13455 (reader): Adjust.
13456 * src/output.c (header_output): New.
13457 (output): Call it.
13458
13459 2001-12-15 Akim Demaille <akim@epita.fr>
13460
13461 * src/reader.c (parse_union_decl): Instead of handling two obstack
13462 simultaneously, use one to define the `stype' muscle, and use the
13463 value of the latter to fill defines_obstack.
13464 (copy_comment): Remove.
13465 (copy_comment2): Work for a single obstack.
13466 Rename as...
13467 (copy_comment): this.
13468
13469 2001-12-15 Akim Demaille <akim@epita.fr>
13470
13471 * src/lex.c, src/lex.h (xgetc): No longer static.
13472 * src/reader.c (parse_union_decl): Revamp.
13473
13474 2001-12-15 Akim Demaille <akim@epita.fr>
13475
13476 Still making progress in separating Bison into (i) input, (ii)
13477 process, (iii) output: now we can directly output the parser file
13478 without using table_obstack at all.
13479
13480 * src/files.c, src/files.h (table_obstack): Bye bye.
13481 (parser_file_name): New.
13482 * src/files.c (compute_output_file_names): Compute it.
13483 * src/output.c (actions_output, output_parser)
13484 (output_master_parser): To a file instead of an obstack.
13485
13486 2001-12-15 Akim Demaille <akim@epita.fr>
13487
13488 Attach actions to rules, instead of pre-outputting them to
13489 actions_obstack.
13490
13491 * src/gram.h (rule_t): action and action_line are new members.
13492 * src/reader.c (symbol_list): Likewise.
13493 (copy_action): Save the actions within the rule.
13494 (packgram): Save them in rule_table.
13495 * src/output.c (actions_output): New.
13496 (output_parser): Use it on `%%actions'.
13497 (output_rule_data): Don't free rule_table.
13498 (output): Do it.
13499 (prepare): Don't save the `action' muscle.
13500 * src/bison.simple: s/%%action/%%actions/.
13501
13502 2001-12-15 Akim Demaille <akim@epita.fr>
13503
13504 * src/reader.c (copy_action): When --yacc, don't append a `;'
13505 to the user action: let it fail if lacking.
13506 Suggested by Arnold Robbins and Tom Tromey.
13507
13508 2001-12-14 Akim Demaille <akim@epita.fr>
13509
13510 * src/lex.c (literalchar): Simply return the char you decoded, non
13511 longer mess around with obstacks and int pointers.
13512 Adjust all callers.
13513
13514 2001-12-14 Akim Demaille <akim@epita.fr>
13515
13516 * src/lex.c (literalchar): Don't escape the special characters,
13517 just decode them, and keep them as char (before, eol was output as
13518 the 2 char string `\n' etc.).
13519 * src/output.c (output_rule_data): Use quotearg to output the
13520 token strings.
13521
13522 2001-12-13 Paul Eggert <eggert@twinsun.com>
13523
13524 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13525 Do not infringe on the global user namespace when using C++.
13526 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13527 All uses of `fprintf' and `stderr' changed.
13528
13529 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13530
13531 2001-12-13 Akim Demaille <akim@epita.fr>
13532
13533 The computation of nullable is broken: it doesn't handle empty
13534 RHS's properly.
13535
13536 * tests/torture.at (GNU AWK Grammar): New.
13537 * tests/sets.at (Nullable): New.
13538 * src/nullable.c (set_nullable): Instead of blindly looping over
13539 `ritems', loop over the rules, and then over their rhs's.
13540
13541 Work around Autotest bugs.
13542
13543 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13544 frame, because Autotest understand lines starting with a `+' as
13545 traces from the shell. Then, they are not processed properly.
13546 Admittedly an Autotest bug, but we don't have time to wait for
13547 Autotest to catch up.
13548 * tests/regression.at (Broken Closure): Adjust to the new table
13549 frames.
13550 Move to...
13551 * tests/sets.at: here.
13552
13553 2001-12-13 Akim Demaille <akim@epita.fr>
13554
13555 * src/closure.c (closure): Use nrules instead of playing tricks
13556 with BITS_PER_WORD.
13557
13558 2001-12-13 Akim Demaille <akim@epita.fr>
13559
13560 * src/print.c (print_actions): Output the handling of `$' as the
13561 traces do: shifting the token EOF. Before EOF was treated as a
13562 nonterminal.
13563 * tests/regression.at: Adjust some tests.
13564 * src/print_graph.c (print_core): Complete the set of items via
13565 closure. The next-to-final and final states are still unsatisfying,
13566 but that's to be addressed elsewhere.
13567 No longer output the rule numbers, but do output the state number.
13568 A single loop for the shifts + gotos is enough, but picked a
13569 distinct color for each.
13570 (print_graph): Initialize and finalize closure.
13571
13572 2001-12-13 Akim Demaille <akim@epita.fr>
13573
13574 * src/reader.c (readgram): Remove dead code, an strip useless
13575 braces.
13576 (get_type): Remove, unused.
13577
13578 2001-12-12 Akim Demaille <akim@epita.fr>
13579
13580 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13581 on that of lib/error.c.
13582
13583 2001-12-12 Akim Demaille <akim@epita.fr>
13584
13585 Some hosts don't like `/' in includes.
13586
13587 * src/system.h: Include libgettext.h without qualifying the path.
13588 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13589 $(top_srcdir).
13590
13591 2001-12-11 Marc Autret <autret_m@epita.fr>
13592
13593 * src/output.c (output_parser): Remove useless muscle.
13594
13595 2001-12-11 Marc Autret <autret_m@epita.fr>
13596
13597 * src/bison.simple: Remove #line just before %%epilogue. It
13598 is now handled in ...
13599 * src/reader.c (read_additionnal_code): Add the output of a
13600 #line for the epilogue.
13601
13602 2001-12-10 Marc Autret <autret_m@epita.fr>
13603
13604 * src/reader.c (copy_definition): Re-use CPP-outed code which
13605 replace precedent remove.
13606 * src/bison.simple: Remove #line before %%prologue because
13607 %%input-line is wrong at this time.
13608
13609 2001-12-10 Marc Autret <autret_m@epita.fr>
13610
13611 * src/reader.c (symbols_output): Clean up.
13612 * src/output.c (output_gram, output): Clean up.
13613
13614 2001-12-10 Akim Demaille <akim@epita.fr>
13615
13616 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13617 * src/LR0.c (set_state_table): here.
13618 * src/lalr.c (lalr): Call it.
13619
13620 2001-12-10 Akim Demaille <akim@epita.fr>
13621
13622 * src/state.h (shifts): Remove the `number' member: shifts are
13623 attached to state, hence no longer need to be labelled with a
13624 state number.
13625
13626 2001-12-10 Akim Demaille <akim@epita.fr>
13627
13628 Now that states have a complete set of members, the linked list of
13629 shifts is useless: just fill directly the state's shifts member.
13630
13631 * src/state.h (shifts): Remove the `next' member.
13632 * src/LR0.c (first_state, last_state): Remove.
13633 Adjust the callers.
13634 (augment_automaton): Don't look for the shifts that must be added
13635 a shift on EOF: it is those of the state we looked for! But now,
13636 since shifts are attached, it is no longer needed to looking
13637 merely by its id: its number.
13638
13639 2001-12-10 Akim Demaille <akim@epita.fr>
13640
13641 * src/LR0.c (augment_automaton): Better variable locality.
13642 Remove an impossible branch: if there is a state corresponding to
13643 the start symbol being shifted, then there is shift for the start
13644 symbol from the initial state.
13645
13646 2001-12-10 Akim Demaille <akim@epita.fr>
13647
13648 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13649 only when appropriate: when insert_start_shifting_state' is not
13650 invoked.
13651 * tests/regression.at (Rule Line Numbers): Adjust.
13652
13653 2001-12-10 Akim Demaille <akim@epita.fr>
13654
13655 * src/LR0.c (augment_automaton): Now that all states have shifts,
13656 merge the two cases addition shifts to the initial state.
13657
13658 2001-12-10 Akim Demaille <akim@epita.fr>
13659
13660 * src/lalr.c (set_state_table): Move to...
13661 * src/LR0.c: here.
13662 * src/lalr.c (lalr): Don't call it...
13663 * src/LR0.c (generate_states): do it.
13664 * src/LR0.h (first_state): Remove, only the table is used.
13665
13666 2001-12-10 Akim Demaille <akim@epita.fr>
13667
13668 * src/LR0.h (first_shift, first_reduction): Remove.
13669 * src/lalr.c: Don't use first_shift: find shifts through the
13670 states.
13671
13672 2001-12-10 Akim Demaille <akim@epita.fr>
13673
13674 * src/LR0.c: Attach shifts to states as soon as they are
13675 computed.
13676 * src/lalr.c (set_state_table): Instead of assigning shifts to
13677 state, just assert that the mapping was properly done.
13678
13679 2001-12-10 Akim Demaille <akim@epita.fr>
13680
13681 * src/LR0.c (insert_start_shift): Rename as...
13682 (insert_start_shifting_state): this.
13683 (insert_eof_shifting_state, insert_accepting_state): New.
13684 (augment_automaton): Adjust.
13685 Better locality of the variables.
13686 When looking if the start_symbol is shifted from the initial
13687 state, using `while (... symbol != start_symbol ...)' sounds
13688 better than `while (... symbol < start_symbol ...)': If fail
13689 to see how the order between symbols could be relevant!
13690
13691 2001-12-10 Akim Demaille <akim@epita.fr>
13692
13693 * src/getargs.h: Don't declare `spec_name_prefix' and
13694 `spec_file_prefix', declared by src/files.h.
13695 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
13696 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
13697 * src/output.c (prepare): Adjust.
13698 * src/reader.c (symbols_output): Likewise.
13699 * src/vmsgetargs.c: Vaguely adjust, but who cares?
13700
13701 2001-12-10 Akim Demaille <akim@epita.fr>
13702
13703 * src/muscle_tab.c (muscle_init): NULL is a better default than
13704 `"0"'.
13705
13706 2001-12-10 Akim Demaille <akim@epita.fr>
13707
13708 * src/reader.c (reader): Calling symbols_output once is enough.
13709
13710 2001-12-10 Akim Demaille <akim@epita.fr>
13711
13712 Now that states have a complete set of members, the linked list of
13713 reductions is useless: just fill directly the state's reductions
13714 member.
13715
13716 * src/state.h (struct reductions): Remove member `number' and
13717 `next'.
13718 * src/LR0.c (first_reduction, last_reduction): Remove.
13719 (save_reductions): Don't link the new reductions, store them in
13720 this_state.
13721 * src/lalr.c (set_state_table): No need to attach reductions to
13722 states, it's already done.
13723 * src/output.c (output_actions): No longer free the shifts, then
13724 the reductions, then the states: free all the states and their
13725 members.
13726
13727 2001-12-10 Akim Demaille <akim@epita.fr>
13728
13729 * src/options.c (OPTN, DRTV, BOTH): New.
13730 (option_table): Use them.
13731
13732 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13733 the job of system.h.
13734 * src/options.c: Don't include stdio.h and xalloc.h for the same
13735 reasons.
13736
13737 2001-12-10 Akim Demaille <akim@epita.fr>
13738
13739 * src/output.c (output, prepare): Make sure the values of the
13740 muscles `action' and `prologue' are 0-terminated.
13741
13742 2001-12-10 Akim Demaille <akim@epita.fr>
13743
13744 Clean up GCC warnings.
13745
13746 * src/reader.c (copy_action): `buf' is not used.
13747 (parse_skel_decl): Be static.
13748 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13749 * src/options.h (create_long_option_table): Have a real prototype.
13750 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13751 (hash_delete_at): Return const void *.
13752 Adjust casts to preserve the const.
13753
13754 2001-12-10 Akim Demaille <akim@epita.fr>
13755
13756 * configure.in: Require 2.52g.
13757 M4 is not needed, but AUTOM4TE is.
13758 * m4/m4.m4: Remove.
13759 * tests/Makefile.am: Adjust.
13760
13761 2001-12-10 Akim Demaille <akim@epita.fr>
13762
13763 One structure for states is enough, even though theoretically
13764 there are LR(0) states and LALR(1) states.
13765
13766 * src/lalr.h (state_t): Remove.
13767 (state_table): Be state_t **, not state_t *.
13768 * src/state.h (core, CORE_ALLOC): Rename as...
13769 (state_t, STATE_ALLOC): this.
13770 Add the LALR(1) members: shifts, reductions, errs.
13771 * src/LR0.c (state_table): Rename as...
13772 (state_hash): this, to avoid name clashes with the global
13773 `state_table'.
13774 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13775 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13776
13777 2001-12-10 Akim Demaille <akim@epita.fr>
13778
13779 Bison dumps core on bash.y.
13780 Reported by Pascal Bart.
13781
13782 * src/warshall.c (bitmatrix_print): New.
13783 (TC): Use it.
13784 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
13785 j must be the outer loop.
13786 * tests/regression.at (Broken Closure): New.
13787
13788 2001-12-05 Akim Demaille <akim@epita.fr>
13789
13790 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13791 its argument.
13792 Reported by Peter Hamorsky.
13793
13794 2001-12-05 Akim Demaille <akim@epita.fr>
13795
13796 * src/conflicts.c (err_table): Remove.
13797 (resolve_sr_conflict): Adjust.
13798 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13799 Rename as...
13800 (state_t.reductions, state_t.shifts): this.
13801
13802 2001-12-05 Akim Demaille <akim@epita.fr>
13803
13804 * src/reduce.c (reduce_grammar_tables): No longer disable the
13805 removal of useless rules via CPP but via `if (0)', so that the
13806 compiler still check the code is valid.
13807 For instance, it should have noticed `rline' no longer exists: use
13808 the `line' member of rule_t.
13809 * src/gram.c (dummy, rline): Remove, unused.
13810
13811 2001-12-05 Akim Demaille <akim@epita.fr>
13812
13813 * src/output.c (pack_vector): Use assert, not berror.
13814 * src/main.c (berror): Remove, unused.
13815
13816 2001-12-05 Akim Demaille <akim@epita.fr>
13817
13818 New experimental feature: if --verbose --trace output all the
13819 items of a state, not only its kernel.
13820
13821 * src/print.c (print_core): If `trace_flag', then invoke closure
13822 before outputting the items of the state (print_core is no longer
13823 a correct name them).
13824 (print_results): Invoke new_closure/free_closure if needed.
13825
13826 2001-12-05 Akim Demaille <akim@epita.fr>
13827
13828 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13829 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13830 (nitemset): for consistency with the rest of the project.
13831
13832 2001-12-05 Akim Demaille <akim@epita.fr>
13833
13834 * src/closure.c (print_closure): Improve.
13835 (closure): Use it for printing input and output.
13836
13837 2001-12-05 Akim Demaille <akim@epita.fr>
13838
13839 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13840 indexed by nonterminals.
13841
13842 2001-12-05 Akim Demaille <akim@epita.fr>
13843
13844 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13845 what it was!).
13846 * src/warshall.h: Remove accidental duplication of the content.
13847
13848 2001-12-05 Akim Demaille <akim@epita.fr>
13849
13850 * src/closure.c (set_fderives): De-obfuscate.
13851
13852 2001-12-05 Akim Demaille <akim@epita.fr>
13853
13854 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13855
13856 2001-12-05 Akim Demaille <akim@epita.fr>
13857
13858 * src/closure.c (set_firsts): De-obfuscate.
13859
13860 2001-12-05 Akim Demaille <akim@epita.fr>
13861
13862 * src/output.c (action_row): De-obfuscate
13863 using the good o' techniques: arrays not pointers, variable
13864 locality, BITISSET, RESETBIT etc.
13865
13866 2001-12-05 Akim Demaille <akim@epita.fr>
13867
13868 Pessimize the code to simplify it: from now on, all the states
13869 have a valid SHIFTS, which NSHIFTS is possibly 0.
13870
13871 * src/LR0.c (shifts_new): Be global and move to..
13872 * src/state.c, src/state.h: here.
13873 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13874 * src/print_graph: Adjust.
13875
13876 2001-12-05 Akim Demaille <akim@epita.fr>
13877
13878 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13879 * src/conflicts.c: Use it.
13880 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13881 incorrectly ``simplified''.
13882
13883 2001-12-05 Akim Demaille <akim@epita.fr>
13884
13885 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
13886 using the good o' techniques: arrays not pointers, variable
13887 locality, BITISSET, RESETBIT etc.
13888
13889 2001-12-05 Akim Demaille <akim@epita.fr>
13890
13891 * src/state.h (SHIFT_SYMBOL): New.
13892 * src/conflicts.c: Use it to deobfuscate.
13893
13894 2001-12-05 Akim Demaille <akim@epita.fr>
13895
13896 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
13897 (print_reductions): De-obfuscate using the good o' techniques:
13898 arrays not pointers, variable locality, BITISSET.
13899
13900 2001-12-05 Akim Demaille <akim@epita.fr>
13901
13902 * src/conflicts.c (print_reductions): Arrays, not pointers.
13903 Use BITISSET.
13904
13905 2001-12-05 Akim Demaille <akim@epita.fr>
13906
13907 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13908
13909 2001-12-05 Akim Demaille <akim@epita.fr>
13910
13911 * src/conflicts.c (print_reductions): Improve variable locality.
13912
13913 2001-12-05 Akim Demaille <akim@epita.fr>
13914
13915 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13916
13917 2001-12-05 Akim Demaille <akim@epita.fr>
13918
13919 * src/conflicts.c (print_reductions): Improve variable locality.
13920
13921 2001-12-05 Akim Demaille <akim@epita.fr>
13922
13923 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13924 * src/lalr.c: Use them.
13925
13926 2001-12-05 Akim Demaille <akim@epita.fr>
13927
13928 * src/LR0.c (augment_automaton): Formatting changes.
13929 Better variable locality.
13930
13931 2001-12-05 Akim Demaille <akim@epita.fr>
13932
13933 * src/lalr.c (matrix_print): New.
13934 (transpose): Use it.
13935 Use arrays instead of pointers.
13936
13937 2001-12-05 Akim Demaille <akim@epita.fr>
13938
13939 * src/lalr.c (maxrhs): Move to...
13940 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
13941 * src/lalr.c (build_relations): Adjust.
13942
13943 2001-12-05 Akim Demaille <akim@epita.fr>
13944
13945 * src/lalr.c (transpose): Free the memory allocated to the
13946 argument, as it is replaced by the results by the unique caller.
13947 (build_relations): Merely invoke transpose: it handles the memory
13948 deallocation.
13949 Improve variable locality.
13950 Avoid variables used as mere abbreviations.
13951 (compute_lookaheads): Use arrays instead of pointers.
13952
13953 2001-12-05 Akim Demaille <akim@epita.fr>
13954
13955 * src/lalr.c (initialize_F): Improve variable locality.
13956 Avoid variables used as mere abbreviations.
13957
13958 2001-12-05 Akim Demaille <akim@epita.fr>
13959
13960 * src/derives.c (print_derives): Display the ruleno.
13961 * src/lalr.c (initialize_F, transpose): Better variable locality
13962 to improve readability.
13963 Avoid variables used as mere abbreviations.
13964
13965 2001-12-05 Akim Demaille <akim@epita.fr>
13966
13967 * src/lalr.c (traverse): Use arrays instead of pointers.
13968
13969 2001-12-05 Akim Demaille <akim@epita.fr>
13970
13971 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13972 the handling of squeue.
13973 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13974
13975 2001-12-05 Akim Demaille <akim@epita.fr>
13976
13977 Because useless nonterminals are now kept alive (instead of being
13978 `destroyed'), we now sometimes examine them, and store information
13979 related to them. Hence we need to know their number, and adjust
13980 memory allocations.
13981
13982 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13983 static.
13984 * src/LR0.c (allocate_itemsets): The memory allocated to
13985 `symbol_count' was used for two different purpose: once to count
13986 the number of occurrences of each symbol, and later reassigned to
13987 `shift_symbol', containing the symbol that can be shifted from a
13988 given state.
13989 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13990 only, and...
13991 (new_itemsets): Allocate `shift_symbol' here.
13992 (allocate_itemsets): symbol_count includes useless nonterminals.
13993 Make room for them.
13994 (free_storage): Use `free', not `XFREE', for pointers that cannot
13995 be null.
13996
13997 2001-12-05 Akim Demaille <akim@epita.fr>
13998
13999 * src/nullable.c (set_nullable): Deobfuscate the handling of
14000 ritem.
14001 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14002
14003 2001-12-05 Akim Demaille <akim@epita.fr>
14004
14005 * src/gram.c, src/gram.h (ritem_print): New.
14006 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
14007 (This useless function was defined only to work around VMS linkers
14008 that can't handle compilation units with variables only).
14009 * src/reduce.c (dump_grammar): Use it to trace the construction of
14010 ritem.
14011
14012 2001-12-04 Paul Eggert <eggert@twinsun.com>
14013
14014 * src/bison.simple (union yyalloc): Change member names
14015 to be the same as the stack names.
14016 (yyparse): yyptr is now union yyalloc *, not char *.
14017 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14018 and may generate better code on some machines.
14019 (yystpcpy): Use prototype if __STDC__ is defined, not just
14020 if __cplusplus is defined.
14021
14022 2001-11-30 Akim Demaille <akim@epita.fr>
14023
14024 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14025 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14026 Gettext doesn't compile cleanly, and dies with -Werror.
14027 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14028 Include WARNING_CFLAGS here.
14029 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14030 before being defined.
14031
14032 2001-11-27 Paul Eggert <eggert@twinsun.com>
14033
14034 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14035 First arg is int, not unsigned.
14036 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14037 (SIZE_MAX, UINT_MAX): New macros.
14038 (quotearg_n_options): Abort if N is negative.
14039 Avoid overflow check on hosts where size_t is 64 bits and int
14040 is 32 bits, as overflow is impossible there.
14041 Fix off-by-one typo that caused unnecessary reallocation.
14042
14043 2001-11-29 Paul Eggert <eggert@twinsun.com>
14044
14045 Name space cleanup in generated parser.
14046
14047 * doc/bison.texinfo (Bison Parser): Discuss system headers
14048 and their effect on the user name space.
14049
14050 * src/bison.simple:
14051 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14052 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14053 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14054
14055 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14056 on user names when possible.
14057
14058 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14059 Simplify test for whather <alloca.h> exists.
14060
14061 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14062
14063 (<stdio.h>): Include if YYDEBUG.
14064
14065 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14066 ! defined (yyoverflow) && ! defined (yymemcpy).
14067
14068 (yymemcpy, yyparse): Rename local variables as needed so that
14069 they all begin with 'yy'.
14070
14071 (yystrlen, yystpcpy): New functions.
14072
14073 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14074 All uses changed.
14075
14076 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14077 instead of relying on string.h functions. Use YYSTACK_ALLOC
14078 and YYSTACK_FREE instead of malloc and free.
14079
14080 2001-11-30 Akim Demaille <akim@epita.fr>
14081
14082 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14083 before their first uses.
14084 (YYBISON, YYPURE): Move to the top of the output.
14085
14086 2001-11-30 Akim Demaille <akim@epita.fr>
14087
14088 * tests/reduce.at (Useless Nonterminals): Fix.
14089
14090 2001-11-30 Akim Demaille <akim@epita.fr>
14091
14092 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14093 if body instead of `;' to pacify GCC's warnings.
14094
14095 2001-11-30 Akim Demaille <akim@epita.fr>
14096
14097 Instead of mapping the LHS of unused rules to -1, keep the LHS
14098 valid, but flag the rules as invalid.
14099
14100 * src/gram.h (rule_t): `useful' is a new member.
14101 * src/print.c (print_grammar): Adjust.
14102 * src/derives.c (set_derives): Likewise.
14103 * src/reader.c (packgram, reduce_output): Likewise.
14104 * src/reduce.c (reduce_grammar_tables): Likewise.
14105 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14106
14107 2001-11-30 Akim Demaille <akim@epita.fr>
14108
14109 * src/reduce.c (reduce_output): Formatting changes.
14110 * src/print.c (print_results, print_grammar): Likewise.
14111 * tests/regression.at (Rule Line Numbers)
14112 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14113
14114 2001-11-30 Akim Demaille <akim@epita.fr>
14115
14116 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14117 useless nonterminals, move them at the end of the symbol arrays.
14118 (reduce_output): Adjust.
14119 * tests/reduce.at (Useless Nonterminals): Adjust.
14120
14121 2001-11-30 Akim Demaille <akim@epita.fr>
14122
14123 * src/reduce.c: Various comment/formatting changes.
14124 (nonterminals_reduce): New, extracted from...
14125 (reduce_grammar_tables): here.
14126 (reduce_grammar): Call nonterminals_reduce.
14127
14128 2001-11-29 Paul Eggert <eggert@twinsun.com>
14129
14130 * src/bison.simple (YYSTACK_REALLOC): Remove.
14131 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14132 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14133 New macros.
14134 (union yyalloc): New type.
14135 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14136 an arbitrary restriction on hosts where size_t is wider than int.
14137
14138 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14139 a parser stack overflow. Allocate just one block of memory for all
14140 three stacks, instead of allocating three blocks; this typically is
14141 faster and reduces fragmentation.
14142
14143 Do not limit the number of items in the stack to a value that fits
14144 in 'int', as this is an arbitrary limit on hosts with 64-bit
14145 size_t and 32-bit int.
14146
14147 2001-11-29 Marc Autret <autret_m@epita.fr>
14148
14149 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14150 of defining YYERROR_VERBOSE.
14151 [AT_DATA]: $4 is now out of C declarations in the prologue.
14152
14153 2001-11-28 Marc Autret <autret_m@epita.fr>
14154
14155 * src/reader.c (parse_dquoted_param): New.
14156 (parse_skel_decl): Use it.
14157 * src/lex.h: Add its prototype.
14158 * src/lex.c (literalchar): Become not static.
14159
14160 2001-11-28 Marc Autret <autret_m@epita.fr>
14161
14162 * src/output.h: And put its extern declaration here.
14163 * src/output.c (error_verbose): Define here.
14164 (prepare): Echo name modification.
14165 * src/getargs.h: Clean its extern declaration.
14166 * src/getargs.c (error_verbose_flag): Remove.
14167 (getargs): Remove case 'e'.
14168 * src/options.c (option_table): 'error-verbose' is now seen as simple
14169 percent option.
14170 Include output.h.
14171
14172 * src/reader.c (read_declarations): Remove case tok_include.
14173 (parse_include_decl): Remove.
14174 * src/lex.h (token_t): Remove tok_include.
14175 * src/options.c (option_table): 'include' is now a simple command line
14176 option.
14177
14178 2001-11-28 Marc Autret <autret_m@epita.fr>
14179
14180 * src/bison.simple: Adjust muscle names.
14181 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14182 * src/output.c (prepare): s/_/-/ for the muscles names.
14183 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14184
14185 2001-11-28 Marc Autret <autret_m@epita.fr>
14186
14187 * src/bison.simple: Fix debug.
14188 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14189
14190 2001-11-28 Akim Demaille <akim@epita.fr>
14191
14192 * src/LR0.c (shifts_new): New.
14193 (save_shifts, insert_start_shift, augment_automaton): Use it.
14194
14195 2001-11-28 Akim Demaille <akim@epita.fr>
14196
14197 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14198 keep ruleno only.
14199
14200 2001-11-28 Akim Demaille <akim@epita.fr>
14201
14202 * src/closure.c (closure): Instead of looping over word in array
14203 then bits in words, loop over bits in array.
14204
14205 2001-11-28 Akim Demaille <akim@epita.fr>
14206
14207 * src/closure.c (closure): No longer optimize the special case
14208 where all the bits of `ruleset[r]' are set to 0, to make the code
14209 clearer.
14210
14211 2001-11-28 Akim Demaille <akim@epita.fr>
14212
14213 * src/closure.c (closure): `r' and `c' are new variables, used to
14214 de-obfuscate accesses to RULESET and CORE.
14215
14216 2001-11-28 Akim Demaille <akim@epita.fr>
14217
14218 * src/reduce.c (reduce_print): Use ngettext.
14219 (dump_grammar): Improve the trace accuracy.
14220
14221 2001-11-28 Akim Demaille <akim@epita.fr>
14222
14223 * src/reduce.c (dump_grammar): Don't translate trace messages.
14224
14225 2001-11-28 Akim Demaille <akim@epita.fr>
14226
14227 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14228 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14229 as all tags are free'ed afterwards.
14230 From Enrico Scholz.
14231
14232 2001-11-27 Paul Eggert <eggert@twinsun.com>
14233
14234 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14235 use alloca when we didn't want to, and vice versa.
14236
14237 2001-11-27 Marc Autret <autret_m@epita.fr>
14238
14239 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14240 initialization.
14241 * src/output.c (prepare): Remove its update.
14242
14243 2001-11-27 Marc Autret <autret_m@epita.fr>
14244
14245 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14246 Use %error-verbose.
14247
14248 2001-11-27 Marc Autret <autret_m@epita.fr>
14249
14250 * src/bison.simple: Remove YYERROR_VERBOSE using.
14251 Use %%error_verbose.
14252 (yyparse): Likewise.
14253 * src/output.c (prepare): Give its final value.
14254 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14255 * src/getargs.h: Add its extern declaration.
14256 * src/getargs.c (error_verbose_flag): New int.
14257 (getargs): Update to catch new case.
14258 * src/options.c (option_table): 'error-verbose' is a new option.
14259 (shortopts): Update.
14260
14261 2001-11-27 Akim Demaille <akim@epita.fr>
14262
14263 * src/system.h: Use intl/libgettext.h.
14264 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14265
14266 2001-11-27 Akim Demaille <akim@epita.fr>
14267
14268 * tests/torture.at (Exploding the Stack Size with Malloc):
14269 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14270
14271 2001-11-27 Akim Demaille <akim@epita.fr>
14272
14273 * src/files.c: Include error.h.
14274 Reported by Hans Aberg.
14275
14276 2001-11-26 Marc Autret <autret_m@epita.fr>
14277
14278 * src/reader.c (parse_include_decl): New, not yet implemented.
14279 (read_declarations): Add case tok_include.
14280 * src/getargs.h (include): Add its extern definition.
14281 * src/getargs.c (include): New const char *.
14282 (getargs): Add case '-I'.
14283 * src/options.c (option_table): Add include as command line and
14284 percent option.
14285 * src/lex.h (token_t): Add tok_include.
14286
14287 2001-11-26 Akim Demaille <akim@epita.fr>
14288
14289 * src/reader.c (readgram): Make sure rules for mid-rule actions
14290 have a lineno equal to that of their host rule.
14291 Reported by Hans Aberg.
14292 * tests/regression.at (Rule Line Numbers): New.
14293
14294 2001-11-26 Akim Demaille <akim@epita.fr>
14295
14296 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14297 size_ts.
14298
14299 2001-11-26 Akim Demaille <akim@epita.fr>
14300
14301 * src/complain.c, src/complain.h (error): Remove, provided by
14302 lib/error.[ch].
14303
14304 2001-11-26 Akim Demaille <akim@epita.fr>
14305
14306 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14307 issue an error message.
14308 * tests/regression.at (Invalid %directive): New.
14309 Reported by Hans Aberg.
14310
14311 2001-11-26 Akim Demaille <akim@epita.fr>
14312
14313 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14314 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14315
14316 2001-11-26 Akim Demaille <akim@epita.fr>
14317
14318 * src/conflicts.c (conflicts_print): Don't complain at all when
14319 there are no reduce/reduce conflicts, and as many shift/reduce
14320 conflicts as expected.
14321 * tests/regression.at (%expect right): Adjust.
14322
14323 2001-11-23 Akim Demaille <akim@epita.fr>
14324
14325 * lib/alloca.c: Update, from fileutils.
14326
14327 2001-11-23 Akim Demaille <akim@epita.fr>
14328
14329 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14330
14331 2001-11-23 Akim Demaille <akim@epita.fr>
14332
14333 * src/system.h: Include alloca.h.
14334 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14335
14336 2001-11-23 Akim Demaille <akim@epita.fr>
14337
14338 * src/print_graph.c (print_actions): Remove `rule', unused.
14339 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14340 pacify GCC's signed < unsigned warnings.
14341 * src/closure.c (itemsetsize): Likewise.
14342 * src/reader.c (symbol_list_new): Static.
14343
14344 2001-11-23 Akim Demaille <akim@epita.fr>
14345
14346 Attaching lineno to buckets is stupid, since only one copy of each
14347 symbol is kept, only the line of the first occurrence is kept too.
14348
14349 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14350 * src/reader.c (rline_allocated): Remove, unused.
14351 (symbol_list): Have a `line' member.
14352 (symbol_list_new): New.
14353 (readgram): Use it.
14354 * src/print.c (print_grammar): Output the rule line numbers.
14355 * tests/regression.at (Solved SR Conflicts)
14356 (Unresolved SR Conflicts): Adjust.
14357 Reported by Hans Aberg.
14358
14359 2001-11-22 Marc Autret <autret_m@epita.fr>
14360
14361 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14362
14363 2001-11-22 Marc Autret <autret_m@epita.fr>
14364
14365 * src/muscle_tab.c (muscle_init): Remove initialization of
14366 skeleton muscle.
14367 * src/output.c (output_master_parser): Do it here.
14368
14369 2001-11-20 Akim Demaille <akim@epita.fr>
14370
14371 * po/sv.po: New.
14372 * configure.in (ALL_LINGUAS): Adjust.
14373 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14374 longer contains strings to translate.
14375
14376 2001-11-19 Akim Demaille <akim@epita.fr>
14377
14378 * src/conflicts.c (conflicts_print): Add a missing \n.
14379
14380 2001-11-19 Akim Demaille <akim@epita.fr>
14381
14382 * src/nullable.c (nullable_print): New.
14383 (set_nullable): Call it when tracing.
14384 Better locality of variables.
14385
14386 2001-11-19 Akim Demaille <akim@epita.fr>
14387
14388 * src/print.c (print_actions): Better locality of variables.
14389
14390 2001-11-19 Akim Demaille <akim@epita.fr>
14391
14392 * src/derives.c (print_derives): Fix and enrich.
14393 * src/closure.c (print_fderives): Likewise.
14394
14395 2001-11-19 Akim Demaille <akim@epita.fr>
14396
14397 * src/closure.c (itemsetend): Remove, replaced with...
14398 (itemsetsize): new.
14399
14400 2001-11-19 Akim Demaille <akim@epita.fr>
14401
14402 * src/LR0.c (kernel_end): Remove, replaced with...
14403 (kernel_size): new.
14404
14405 2001-11-19 Akim Demaille <akim@epita.fr>
14406
14407 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14408 to clarify.
14409
14410 2001-11-19 Akim Demaille <akim@epita.fr>
14411
14412 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14413
14414 2001-11-19 Akim Demaille <akim@epita.fr>
14415
14416 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14417 trace messages.
14418 * src/LR0.c: Likewise.
14419 (allocate_itemsets): Use arrays instead of pointers to clarify.
14420
14421 2001-11-19 Akim Demaille <akim@epita.fr>
14422
14423 * src/getargs.c (statistics_flag): Replace with...
14424 (trace_flag): New.
14425 (longopts): Accept --trace instead of --statistics.
14426 * src/getargs.h, src/options.c: Adjust.
14427 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14428 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14429
14430 2001-11-19 Akim Demaille <akim@epita.fr>
14431
14432 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
14433 pointers to clarify the code.
14434 (save_reductions, save_shifts): Factor common parts of alternatives.
14435
14436 2001-11-19 Akim Demaille <akim@epita.fr>
14437
14438 * src/LR0.c (new_state, get_state): Complete TRACE code.
14439 * src/closure.c: Include `reader.h' to get `tags', needed by the
14440 trace code.
14441 Rename the conditional DEBUG as TRACE.
14442 Output consistently TRACEs to stderr, not stdout.
14443 * src/derives.c: Likewise.
14444 * src/reduce.c: (inaccessable_symbols): Using if is better style
14445 than goto.
14446 Use `#if TRACE' instead of `#if 0' for tracing code.
14447
14448 2001-11-19 Akim Demaille <akim@epita.fr>
14449
14450 * src/system.h (LIST_FREE, shortcpy): New.
14451 * src/LR0.c: Use them.
14452 * src/output.c (free_itemsets, free_reductions, free_shifts):
14453 Remove, replaced by LIST_FREE.
14454
14455 2001-11-19 Akim Demaille <akim@epita.fr>
14456
14457 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14458 (REDUCTIONS_ALLOC): New.
14459 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14460 allocation.
14461
14462 2001-11-19 Akim Demaille <akim@epita.fr>
14463
14464 * src/LR0.c (new_state): Complete trace code.
14465 * src/nullable.c (set_nullable): Don't translate traces.
14466
14467 2001-11-19 Akim Demaille <akim@epita.fr>
14468
14469 * src/print_graph.c (print_core): Better locality of variables.
14470 * src/print.c (print_core): Likewise.
14471
14472 2001-11-19 Akim Demaille <akim@epita.fr>
14473
14474 * src/vcg.c: You do the output, so you are responsible of the
14475 handling of VCG syntax, in particular: use quotearg.
14476 * src/print_graph.c: Don't.
14477 (print_actions): Don't output the actions as part of the nodes,
14478 since that's the job of the edges.
14479 (print_state): Don't output by hand: fill the node description,
14480 and ask for its output.
14481
14482 2001-11-19 Akim Demaille <akim@epita.fr>
14483
14484 * src/bison.simple (yyparse): When verbosely reporting an error,
14485 no longer put additional quotes around token names.
14486 * tests/calc.at: Adjust.
14487
14488 2001-11-19 Akim Demaille <akim@epita.fr>
14489
14490 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14491 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14492 * src/output.c: Adjust.
14493
14494 2001-11-19 Akim Demaille <akim@epita.fr>
14495
14496 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14497 (rule_t): this.
14498 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14499
14500 2001-11-19 Akim Demaille <akim@epita.fr>
14501
14502 * src/gram.h (rule_t): New.
14503 (rule_table): New.
14504 (rrhs, rlhs): Remove, part of state_t.
14505 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14506 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14507 * src/reader.c, src/reduce.c: Adjust.
14508
14509 2001-11-19 Akim Demaille <akim@epita.fr>
14510
14511 * src/reader.c (symbols_output): New, extracted from...
14512 (packsymbols): Here.
14513 (reader): Call it.
14514
14515 2001-11-19 Akim Demaille <akim@epita.fr>
14516
14517 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14518 (maxrhs): this new function.
14519
14520 2001-11-19 Akim Demaille <akim@epita.fr>
14521
14522 * src/lalr.c (F): New macro to access the variable F.
14523 Adjust.
14524
14525 2001-11-19 Akim Demaille <akim@epita.fr>
14526
14527 * src/lalr.h (LA): New macro to access the variable LA.
14528 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14529 * src/lalr.c: Adjust.
14530
14531 2001-11-19 Akim Demaille <akim@epita.fr>
14532
14533 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14534 (set_state_table): handle the `lookaheads' members.
14535
14536 2001-11-19 Akim Demaille <akim@epita.fr>
14537
14538 * src/lalr.h (lookaheads): Removed array, whose contents is now
14539 a member of...
14540 (state_t): this structure.
14541 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14542 Adjust.
14543
14544 2001-11-19 Akim Demaille <akim@epita.fr>
14545
14546 * src/lalr.h (consistent): Removed array, whose contents is now
14547 a member of...
14548 (state_t): this structure.
14549 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14550 Adjust.
14551
14552 2001-11-19 Akim Demaille <akim@epita.fr>
14553
14554 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14555 contents are now members of...
14556 (state_t): this structure.
14557 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14558 Adjust.
14559
14560 2001-11-19 Akim Demaille <akim@epita.fr>
14561
14562 * src/lalr.h (state_t): New.
14563 (state_table): Be a state_t * instead of a core **.
14564 (accessing_symbol): Remove, part of state_t.
14565 * src/lalr.c: Adjust.
14566 (set_accessing_symbol): Merge into...
14567 (set_state_table): this.
14568 * src/print_graph.c, src/conflicts.c: Adjust.
14569
14570 2001-11-14 Akim Demaille <akim@epita.fr>
14571
14572 * tests/calc.at, tests/output.at, tests/regression.at,
14573 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14574 now the tests are run in private dirs, therefore AC_CLEANUP and
14575 family can be simplified to 0-ary.
14576 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14577 use abs. path to find config.h.
14578 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14579 stderr, there can be way too much random noise.
14580 Instead pass -Werror to GCC and rely on the exit status.
14581 Reported by Wolfram Wagner.
14582
14583 2001-11-14 Akim Demaille <akim@epita.fr>
14584
14585 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14586 defined only if yyoverflow is defined, to avoid `warning: unused
14587 variable `yyvs1''.
14588 Reported by The Test Suite.
14589
14590 2001-11-14 Akim Demaille <akim@epita.fr>
14591
14592 * src/print.c: Include reduce.h.
14593 Reported by Hans Aberg.
14594
14595 2001-11-14 Akim Demaille <akim@epita.fr>
14596
14597 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
14598 Revert a previous patch: these are really const.
14599 * src/conflicts.c (conflict_report): Additional useless pair of
14600 braces to pacify GCC's warnings for `if () if () {} else {}'.
14601 * src/lex.c (parse_percent_token): Replace equal_offset with
14602 arg_offset.
14603 arg is const.
14604 Be sure to strdup `arg' when used, since there is no reason for
14605 token_buffer not to change.
14606
14607 2001-11-14 Akim Demaille <akim@epita.fr>
14608
14609 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14610 definition.
14611 * src/main.c (main): Use them.
14612 Suggested by Hans Aberg.
14613
14614 2001-11-12 Akim Demaille <akim@epita.fr>
14615
14616 * src/system.h (ngettext): Now that we use ngettext, be sure to
14617 provide a default definition when NLS are not used.
14618
14619 2001-11-12 Akim Demaille <akim@epita.fr>
14620
14621 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
14622 Use @kbd to denote user input.
14623 (Language and Grammar): ANSIfy the example.
14624 Adjust its layout for info/notinfo.
14625 (Location Tracking Calc): Output error messages to stderr.
14626 Output locations in a more GNUtically correct way.
14627 Fix a couple of Englishos.
14628 Adjust @group/@end group pairs.
14629
14630 2001-11-12 Akim Demaille <akim@epita.fr>
14631
14632 %expect was not functioning at all.
14633
14634 * src/conflicts.c (expected_conflicts): Set to -1.
14635 (conflict_report): Use ngettext.
14636 (conflicts_print): Check %expect and make its violation an error.
14637 * doc/bison.texinfo (Expect Decl): Adjust.
14638 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
14639 * tests/regression.at (%expect not enough, %expect right)
14640 (%expect too much): New.
14641
14642 2001-11-12 Akim Demaille <akim@epita.fr>
14643
14644 * tests/regression.at (Conflicts): Rename as...
14645 (Unresolved SR Conflicts): this.
14646 (Solved SR Conflicts): New.
14647
14648 2001-11-12 Akim Demaille <akim@epita.fr>
14649
14650 * src/reduce.c (print_results): Rename as...
14651 (reduce_output): This.
14652 Output to OUT, passed as argument, instead of output_obstack.
14653 (dump_grammar): Likewise.
14654 (reduce_free): New.
14655 Also free V1.
14656 (reduce_grammar): No longer call reduce_output, since...
14657 * src/print.c (print_results): do it.
14658 * src/main.c (main): Call reduce_free;
14659
14660 2001-11-12 Akim Demaille <akim@epita.fr>
14661
14662 * src/conflicts.c (print_reductions): Accept OUT as argument.
14663 Output to it, not to output_obstack.
14664 * src/print.c (print_actions): Adjust.
14665
14666 2001-11-12 Akim Demaille <akim@epita.fr>
14667
14668 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
14669 the result instead of using...
14670 (src_total, rrc_total, src_count, rrc_count): Remove.
14671 (any_conflicts): Remove.
14672 (print_conflicts): Split into...
14673 (conflicts_print, conflicts_output): New.
14674 * src/conflicts.h: Adjust.
14675 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
14676 * src/print.c (print_grammar): Issue `\n' between two rules.
14677 * tests/regression.at (Conflicts): New.
14678 Reported by Tom Lane.
14679
14680 2001-11-12 Akim Demaille <akim@epita.fr>
14681
14682 * tests/regression.at (Invalid input): Remove, duplicate with
14683 ``Invalid input: 1''.
14684
14685 2001-11-12 Akim Demaille <akim@epita.fr>
14686
14687 * tests/torture.at (AT_DATA_STACK_TORTURE)
14688 (Exploding the Stack Size with Alloca)
14689 (Exploding the Stack Size with Malloc): New.
14690
14691 2001-11-12 Akim Demaille <akim@epita.fr>
14692
14693 * src/bison.simple (YYSTACK_REALLOC): New.
14694 (yyparse) [!yyoverflow]: Use it and free the old stack.
14695 Reported by Per Allansson.
14696
14697 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
14698
14699 * src/bison.simple: Define type yystype instead of YYSTYPE, and
14700 define CPP macro, which substitute YYSTYPE by yystype.
14701 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
14702 with yyltype/YYLTYPE. This allows inclusion of the generated
14703 header within the parser if the compiler, such as GGC, accepts
14704 multiple equivalent #defines.
14705 From Akim.
14706
14707 2001-11-05 Akim Demaille <akim@epita.fr>
14708
14709 * src/reader.c (symbols_output): New, extracted from...
14710 (packsymbols): here.
14711 (reader): Adjust.
14712
14713 2001-11-05 Akim Demaille <akim@epita.fr>
14714
14715 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14716
14717 2001-11-05 Akim Demaille <akim@epita.fr>
14718
14719 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14720 pattern.
14721
14722 2001-11-05 Akim Demaille <akim@epita.fr>
14723
14724 * src/options.h (struct option_table_struct): set_flags is void*.
14725 * src/options.c (longopts): Support `--output' and `%output'.
14726 (usage): Adjust.
14727 * src/lex.h (tok_setopt): Remove, replaced with...
14728 (tok_intopt, tok_stropt): these new guys.
14729 * src/lex.c (getopt.h): Not needed.
14730 (token_buffer, unlexed_token_buffer): Not const.
14731 (percent_table): Promote `-' over `_' in directive names.
14732 Active `%name-prefix', `file-prefix', and `output'.
14733 (parse_percent_token): Accept possible arguments to directives.
14734 Promote `-' over `_' in directive names.
14735
14736 2001-11-04 Akim Demaille <akim@epita.fr>
14737
14738 * doc/bison.texinfo (Decl Summary): Split the list into
14739 `directives for grammars' and `directives for bison'.
14740 Sort'em.
14741 Add description of `%name-prefix', `file-prefix', and `output'.
14742 Promote `-' over `_' in directive names.
14743 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14744 Simplify the description of `--name-prefix'.
14745 Promote `-' over `_' in directive names.
14746 Promote `--output' over `--output-file'.
14747 Fix the description of `--defines'.
14748 * tests/output.at: Exercise %file-prefix and %output.
14749
14750 2001-11-02 Akim Demaille <akim@epita.fr>
14751
14752 * doc/refcard.tex: Update.
14753
14754 2001-11-02 Akim Demaille <akim@epita.fr>
14755
14756 * src/symtab.h (SUNDEF): New.
14757 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14758 stand for `uninitialized', instead of 0.
14759 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14760 * src/lex.c (lex): Adjust.
14761
14762 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14763 Number it 0.
14764 Let yylex return it instead of a plain 0.
14765 Reported by Dick Streefland.
14766
14767 2001-11-02 Akim Demaille <akim@epita.fr>
14768
14769 * tests/regression.at (Mixing %token styles): New test.
14770
14771 2001-11-02 Akim Demaille <akim@epita.fr>
14772
14773 * src/reader.c (parse_thong_decl): Formatting changes.
14774 (token_translations_init): New, extracted from...
14775 (packsymbols): Here.
14776 Adjust.
14777
14778 2001-11-01 Akim Demaille <akim@epita.fr>
14779
14780 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14781 Check that `9foo.y' produces correct cpp guards.
14782 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14783 guards.
14784 Reported by Wwp.
14785
14786 2001-11-01 Akim Demaille <akim@epita.fr>
14787
14788 * tests/regression.at (Invalid input: 2): New.
14789 * src/lex.c (unlexed_token_buffer): New.
14790 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14791 too.
14792 Reported by Wwp.
14793
14794 2001-11-01 Akim Demaille <akim@epita.fr>
14795
14796 * tests/calc.at: Catch up with 1.30.
14797 * configure.in: Bump to 1.49a.
14798 Adjust to newer Autotest.
14799
14800 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
14801
14802 * src/conflicts.c: Move global variables rrc_total and src_total ...
14803 (print_conflicts): here.
14804 * src/output.c (output): Free global variable user_toknums.
14805 * src/lex.c (token_obstack): Become static.
14806
14807 2001-10-18 Akim Demaille <akim@epita.fr>
14808
14809 * tests/atlocal.in (GCC): Add.
14810 * tests/calc.at: s/m4_match/m4_bmatch/.
14811 s/m4_patsubst/m4_bpatsubst/.
14812 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14813 * configure.in: AC_SUBST(GCC).
14814
14815 2001-10-14 Marc Autret <autret_m@epita.fr>
14816
14817 * src/options.c (create_long_option_table): Fix.
14818
14819 2001-10-10 Akim Demaille <akim@epita.fr>
14820
14821 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14822
14823 2001-10-04 Akim Demaille <akim@epita.fr>
14824
14825 * src/reader.c (parse_union_decl): Push the caracters in
14826 union_obstack, not attrs_obstack.
14827
14828 2001-10-04 Akim Demaille <akim@epita.fr>
14829
14830 Merge in the branch 1.29.
14831
14832 * src/reader.c (packsymbols): Use a temporary obstack for
14833 `%%tokendef', since output_stack is already used elsewhere.
14834
14835 2001-10-02 Akim Demaille <akim@epita.fr>
14836
14837 Bump 1.29d.
14838
14839 2001-10-02 Akim Demaille <akim@epita.fr>
14840
14841 Version 1.29c.
14842
14843 2001-10-02 Akim Demaille <akim@epita.fr>
14844
14845 * tests/regression.at (Invalid CPP headers): New.
14846 From Alexander Belopolsky.
14847 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14848
14849 2001-10-02 Akim Demaille <akim@epita.fr>
14850
14851 * tests/regression.at (Invalid input): New.
14852 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14853 Reported by Shura.
14854
14855 2001-10-02 Akim Demaille <akim@epita.fr>
14856
14857 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14858
14859 2001-10-02 Akim Demaille <akim@epita.fr>
14860
14861 * src/output.c (output_parser): Assert `skeleton'.
14862 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14863 systems.
14864 From Shura.
14865
14866 2001-10-01 Marc Autret <autret_m@epita.fr>
14867
14868 * src/lex.h: Echo modifications.
14869 * src/lex.c (unlex): Parameter is now token_t.
14870 From Hans Aberg.
14871
14872 2001-10-01 Marc Autret <autret_m@epita.fr>
14873
14874 * src/main.c: Include lex.h.
14875 From Hans Aberg.
14876
14877 2001-09-29 Akim Demaille <akim@epita.fr>
14878
14879 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14880
14881 2001-09-28 Akim Demaille <akim@epita.fr>
14882
14883 * tests/testsuite.at: Update to newer Autotest.
14884 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14885
14886 2001-09-27 Akim Demaille <akim@epita.fr>
14887
14888 Position independent wrapper.
14889
14890 * tests/bison: Remove.
14891 * tests/bison.in: New.
14892 * configure.in: Adjust.
14893
14894 2001-09-27 Paul Eggert <eggert@twinsun.com>
14895
14896 Port quotearg fixes from tar 1.13.24.
14897
14898 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14899 tm to be declared.
14900 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14901 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14902
14903 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
14904 * m4/mbrtowc.m4: New file.
14905 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
14906 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
14907
14908 2001-09-27 Akim Demaille <akim@epita.fr>
14909
14910 Bump to 1.29c.
14911
14912 2001-09-27 Akim Demaille <akim@epita.fr>
14913
14914 Version 1.29b.
14915
14916 2001-09-25 Akim Demaille <akim@epita.fr>
14917
14918 * src/system.h: Include `xalloc.h'.
14919 Remove it from the C files.
14920 * src/files.c (output_files): Free the obstacks.
14921 * src/lex.c (init_lex): Rename as...
14922 (lex_init): this.
14923 (lex_free): New.
14924 * src/main.c (main): Use it.
14925
14926 2001-09-24 Marc Autret <autret_m@epita.fr>
14927
14928 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
14929 to output informations in fout (FILE*).
14930 (open_graph, close_graph): Likewise.
14931 (output_graph, output_edge, output_node): Likewise.
14932 * src/vcg.h: Update function prototypes.
14933 * src/print_graph.c (print_graph): Open output graph file.
14934 (print_actions): Adjust.
14935 * src/files.h: Remove extern declaration.
14936 * src/files.c: Remove graph_obstack declaration.
14937 (open_files): Remove graph_obstack initialization.
14938 (output_files): Remove graph_obstack saving.
14939
14940 2001-09-24 Marc Autret <autret_m@epita.fr>
14941
14942 * src/files.c (compute_output_file_names): Fix.
14943
14944 2001-09-24 Marc Autret <autret_m@epita.fr>,
14945 Akim Demaille <akim@epita.fr>
14946
14947 * src/reader.c (reader): Remove call to free_symtab ().
14948 * src/main.c (main): Call it here.
14949 Include symtab.h.
14950 * src/conflicts.c (initialize_conflicts): Rename as...
14951 (solve_conflicts): this.
14952 * src/print.c (print_core, print_actions, print_state)
14953 (print_grammar): Dump to a file instead a `output_obstack'.
14954 (print_results): Dump `output_obstack', and then proceed with the
14955 FILE *.
14956 * src/files.c (compute_output_file_names, close_files): New.
14957 (output_files): Adjust.
14958 * src/main.c (main): Adjust.
14959
14960 2001-09-23 Marc Autret <autret_m@epita.fr>
14961
14962 * src/files.c (compute_header_macro): Computes header macro name
14963 from spec_defines_file when given.
14964
14965 2001-09-23 Marc Autret <autret_m@epita.fr>
14966
14967 * src/files.c (output_files): Add default extensions.
14968
14969 2001-09-22 Akim Demaille <akim@epita.fr>
14970
14971 * src/conflicts.c (finalize_conflicts): Rename as...
14972 (free_conflicts): this.
14973
14974 2001-09-22 Akim Demaille <akim@epita.fr>
14975
14976 * src/gram.c (gram_free): Rename back as...
14977 (dummy): this.
14978 (output_token_translations): Free `token_translations'.
14979 * src/symtab.c (free_symtab): Free the tag field.
14980
14981 2001-09-22 Akim Demaille <akim@epita.fr>
14982
14983 Remove `translations' as it is always set to true.
14984
14985 * src/gram.h: Adjust.
14986 * src/reader.c (packsymbols, parse_token_decl): Adjust
14987 * src/print.c (print_grammar): Adjust.
14988 * src/output.c (output_token_translations): Adjust.
14989 * src/lex.c (lex): Adjust.
14990 * src/gram.c: Be sure the set pointers to NULL.
14991 (dummy): Rename as...
14992 (gram_free): this.
14993
14994 2001-09-22 Akim Demaille <akim@epita.fr>
14995
14996 * configure.in: Invoke AM_LIB_DMALLOC.
14997 * src/system.h: Use dmalloc.
14998 * src/LR0.c: Be sure to have pointers initialized to NULL.
14999 (allocate_itemsets): Allocate kernel_items only if needed.
15000
15001 2001-09-22 Akim Demaille <akim@epita.fr>
15002
15003 * configure.in: Bump to 1.29b.
15004 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
15005 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
15006 need xmalloc.c in calc.y.
15007 From Pascal Bart.
15008
15009 2001-09-21 Akim Demaille <akim@epita.fr>
15010
15011 Version 1.29a.
15012 * Makefile.maint, config/config.guess, config/config.sub,
15013 * config/missing: Update from masters.
15014 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15015 upon package.m4.
15016 * configure.in (ALL_LINGUAS): Add `tr'.
15017
15018 2001-09-21 Akim Demaille <akim@epita.fr>
15019
15020 * tests/Makefile.am (package.m4): Move to...
15021 ($(srcdir)/$(TESTSUITE)): here.
15022
15023 2001-09-20 Akim Demaille <akim@epita.fr>
15024
15025 * src/complain.c: No longer try to be standalone: use system.h.
15026 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15027 * src/complain.h: Likewise.
15028 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15029 Remove the unused variable `n'.
15030 From Albert Chin-A-Young.
15031
15032 2001-09-18 Marc Autret <autret_m@epita.fr>
15033
15034 * doc/bison.1: Update.
15035 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15036 descriptions.
15037 (Option Cross Key): Update.
15038 Add --graph.
15039
15040 2001-09-18 Marc Autret <autret_m@epita.fr>
15041
15042 * tests/regression.at: New test (comment in %union).
15043
15044 2001-09-18 Marc Autret <autret_m@epita.fr>
15045
15046 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15047 do that.
15048 Reported by Keith Browne.
15049
15050 2001-09-18 Marc Autret <autret_m@epita.fr>
15051
15052 * tests/output.at: Add tests for --defines and --graph.
15053
15054 2001-09-18 Marc Autret <autret_m@epita.fr>
15055
15056 * tests/output.at: Removes tests of %{header,src}_extension features.
15057
15058 2001-09-18 Akim Demaille <akim@epita.fr>
15059
15060 * tests/Makefile.am (package.m4): New.
15061 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15062 (_AT_CHECK_CALC_ERROR): Likewise.
15063 Factor the `, ' part of verbose error messages.
15064
15065 2001-09-18 Marc Autret <autret_m@epita.fr>
15066
15067 * src/getargs.c (longopts): Declare --defines and --graph as options
15068 with optional arguments.
15069 * src/files.h: Add extern declarations.
15070 * src/files.c (spec_graph_file, spec_defines_file): New.
15071 (output_files): Update.
15072 Remove CPP-outed code.
15073
15074 2001-09-18 Marc Autret <autret_m@epita.fr>
15075
15076 Turn off %{source,header}_extension feature.
15077
15078 * src/files.c (compute_exts_from_gf): Update.
15079 (compute_exts_from_src): Update.
15080 (output_files): CPP-out useless code.
15081 * src/files.h: Remove {header,source}_extension extern declarations.
15082 * src/reader.c (parse_dquoted_param): CPP-out.
15083 (parse_header_extension_decl): Remove.
15084 (parse_source_extension_decl): Remove.
15085 (read_declarations): Remove cases tok_{hdrext,srcext}.
15086 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15087 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15088
15089 2001-09-10 Akim Demaille <akim@epita.fr>
15090
15091 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15092 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15093 (AT_CHECK_OUTPUT): this.
15094 Merely check ls' exit status, its output is useless.
15095
15096 2001-09-10 Akim Demaille <akim@epita.fr>
15097
15098 * tests/calc.at: Use m4_match.
15099 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15100
15101 2001-09-10 Marc Autret <autret_m@epita.fr>,
15102 Akim Demaille <akim@epita.fr>
15103
15104 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15105 enum color_e.
15106 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15107 to `normal'.
15108 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15109 * src/lex.h: Adjust prototype.
15110 (token_t): Add `tok_undef'.
15111 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15112 (parse_percent_token): Now returns token_t.
15113 Add default statement in switch.
15114 (lex): Separate `c' as an input variable, from the token_t result
15115 part.
15116 (unlexed): Is a token_t.
15117
15118 2001-09-10 Akim Demaille <akim@epita.fr>
15119
15120 * configure.in: Bump to 1.29a.
15121
15122 2001-09-07 Akim Demaille <akim@epita.fr>
15123
15124 Version 1.29.
15125
15126 2001-08-30 Akim Demaille <akim@epita.fr>
15127
15128 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15129 * m4/atconfig.m4: Remove.
15130 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15131 * tests/bison: New.
15132 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15133 m4_if, m4_patsubst, and m4_regexp.
15134 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15135 `input' file instead of echo.
15136
15137 2001-08-29 Akim Demaille <akim@epita.fr>
15138
15139 Bump to 1.28e.
15140
15141 2001-08-29 Akim Demaille <akim@epita.fr>
15142
15143 Version 1.28d.
15144
15145 2001-08-29 Paul Eggert <eggert@twinsun.com>
15146
15147 * src/bison.simple (yyparse): Don't take the address of an
15148 item before the start of an array, as that doesn't conform to
15149 the C Standard.
15150
15151 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15152
15153 * doc/bison.texinfo (Location Tracking Calc): New node.
15154
15155 2001-08-29 Paul Eggert <eggert@twinsun.com>
15156
15157 * src/output.c (output): Do not define const, as this now
15158 causes more problems than it cures.
15159
15160 2001-08-29 Akim Demaille <akim@epita.fr>
15161
15162 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15163 the nodes.
15164 Be sure to tag the `detailmenu'.
15165
15166 2001-08-29 Akim Demaille <akim@epita.fr>
15167
15168 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15169 download in a tmp dir.
15170
15171 2001-08-28 Marc Autret <autret_m@epita.fr>
15172
15173 * config/depcomp: New file.
15174
15175 2001-08-28 Marc Autret <autret_m@epita.fr>
15176
15177 * doc/bison.1 (mandoc): Adjust.
15178 From Juan Manuel Guerrero.
15179
15180 2001-08-28 Marc Autret <autret_m@epita.fr>
15181
15182 * src/print_graph.c (print_state): Fix.
15183
15184 2001-08-27 Marc Autret <autret_m@epita.fr>
15185
15186 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15187 char * members.
15188 Echo modifications to the functions prototypes.
15189 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15190
15191 2001-08-27 Marc Autret <autret_m@epita.fr>
15192
15193 * src/vcg.c: Include `xalloc.h'.
15194 (add_colorentry): New.
15195 (add_classname): New.
15196 (add_infoname): New.
15197 * src/vcg.h: Add new prototypes.
15198
15199 2001-08-27 Akim Demaille <akim@epita.fr>
15200
15201 * Makefile.maint: Sync. again with CVS Autoconf.
15202
15203 2001-08-27 Akim Demaille <akim@epita.fr>
15204
15205 * Makefile.maint: Formatting changes.
15206 (po-update, cvs-update, update): New targets.
15207 (AMTAR): Remove.
15208
15209 2001-08-27 Akim Demaille <akim@epita.fr>
15210
15211 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15212 * Makefile.maint: Sync. with CVS Autoconf.
15213
15214 2001-08-27 Marc Autret <autret_m@epita.fr>
15215
15216 * src/vcg.h (struct infoname_s): New.
15217 (struct colorentry_s): New.
15218 (graph_s): New fields {vertical,horizontal}_order in structure.
15219 Add `infoname' field.
15220 Add `colorentry' field;
15221 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15222 (G_HORIZONTAL_ORDER): New.
15223 (G_INFONAME): New.
15224 (G_COLORENTRY): New.
15225 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15226 Add output of `infoname'.
15227 Add output of `colorentry'.
15228
15229 2001-08-27 Marc Autret <autret_m@epita.fr>
15230
15231 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15232 This one shadowed a global parameter.
15233
15234 2001-08-24 Marc Autret <autret_m@epita.fr>
15235
15236 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15237 instead of `unsigned'.
15238 (print_state): Do not call obstack_object_size () in obstack_grow ()
15239 to avoid macro variables shadowing.
15240
15241 2001-08-23 Marc Autret <autret_m@epita.fr>
15242
15243 * src/lex.c (percent_table): Typo: s/naem/name/.
15244 Add graph option.
15245 Normalize new options declarations.
15246
15247 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15248
15249 * tests/suite.at: Exercise %header_extension and %source_extension.
15250
15251 2001-08-16 Marc Autret <autret_m@epita.fr>
15252
15253 * src/reader.c (parse_dquoted_param): New.
15254 (parse_header_extension_decl): Use it.
15255 (parse_source_extension_decl): Likewise.
15256
15257 2001-08-16 Marc Autret <autret_m@epita.fr>
15258
15259 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15260 (get_xxxx_str): Use assert () instead of complain ().
15261 Remove return invokations in default cases.
15262 (get_decision_str): Modify default behaviour. Remove second argument.
15263 Echo modifications on calls.
15264 (output_graph): Fix.
15265
15266 2001-08-16 Marc Autret <autret_m@epita.fr>
15267
15268 * src/getargs.c (usage): Update with ``-g, --graph''.
15269
15270 2001-08-16 Marc Autret <autret_m@epita.fr>
15271
15272 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15273 (Option Cross Key): Likewise.
15274 * doc/bison.1: Update.
15275
15276 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
15277
15278 * src/output.c (output_master_parser): Don't finish action_obstack.
15279 (output_parser): Don't care about the muscle action, here.
15280 (prepare): Copy the action_obstack in the action muscle.
15281 (output): Free action_obstack.
15282
15283 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15284
15285 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15286 will contain `%union' declaration.
15287 (parse_union_decl): Delete #line directive output.
15288 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15289 informations about %union.
15290 (parse_union_decl): Copy the union_obstack in the muscle stype.
15291 * src/bison.simple: Add new #line directive.
15292 Add typdef %%stype YYSTYPE.
15293
15294 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15295
15296 * src/bison.simple: Add new `#line' directive.
15297
15298 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
15299
15300 * src/bison.simple: New `#line' directive.
15301 * src/output.c (output_parser): Support new dynamic muscle input_line.
15302
15303 2001-09-22 Marc Autret <autret_m@epita.fr>
15304
15305 * src/output.c (output_master_parser): New.
15306 (output_parser): Be more re-entrant.
15307
15308 2001-09-21 Marc Autret <autret_m@epita.fr>
15309
15310 * src/reader.c (copy_definition, parse_union_decl): Update and use
15311 `linef' muscle.
15312 (copy_action): Likewise.
15313 Use obstack_1grow ().
15314 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15315
15316 2001-09-21 Marc Autret <autret_m@epita.fr>
15317
15318 * src/options.c (option_table): Adjust.
15319 * src/lex.c (parse_percent_token): Fix.
15320
15321 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15322
15323 * src/options.c (symtab.h): Include it, need by lex.h.
15324
15325 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15326
15327 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15328 is now an option_table_struct*.
15329 (option_strcmp): New function option_strcmp.
15330 (parse_percent_token): Call option_strcmp.
15331 * src/getargs.c (xalloc.h, options.h): Include it.
15332 (getargs): Call create_long_option_table.
15333 (getargs): Free longopts at the end of the function.
15334 (shortopts): Move in options.c.
15335 * src/options.c (create_long_option_table): New function. Convert
15336 information from option_table to option structure.
15337 * src/reader.c (options.h): Include it.
15338
15339 * src/Makefile.am: Adjust.
15340 * src/options.c (option_table): Create from longopts and percent_table.
15341 * src/getargs.c (longopts): Delete.
15342 * src/lex.c (struct percent_table_struct): Delete.
15343 (percent_table): Delete.
15344 (options.h): Include it.
15345 * src/options.c: Create.
15346 * src/options.h: Create.
15347 Declare enum opt_access_e.
15348 Define struct option_table_struct.
15349
15350 2001-09-20 Marc Autret <autret_m@epita.fr>
15351
15352 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15353 sections of Bison.
15354
15355 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
15356
15357 * src/bison.simple: s/%%filename/%%skeleton.
15358 * src/muscle_tab.c (getargs.h): Include it.
15359 (muscle_init): Insert new muscle skeleton.
15360
15361 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
15362
15363 * src/output.c (output_parser): Delete unused variable actions_dumped.
15364
15365 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
15366
15367 * src/output.c (output): Delete call to reader_output_yylsp.
15368 * src/reader.c (reader): Likewise.
15369 * src/reader.h: Delete declaration of reader_output_yylsp.
15370
15371 2001-09-02 Marc Autret <autret_m@epita.fr>
15372
15373 * src/reader.c: Include muscle_tab.h.
15374 (parse_union_decl): Update.
15375 (parse_macro_decl): Rename parse_muscle_decl.
15376 Update to use renamed functions and variable.
15377 (read_declarations, copy_action, read_additionnal_code, : Updated
15378 with correct variables and functions names.
15379 (packsymbols, reader): Likewise.
15380
15381 * src/reader.h (muscle_obstack): Extern declaration update.
15382
15383 * src/output.c: Include muscle_tab.h
15384 In all functions using macro_insert, change by using muscle_insert ().
15385 (macro_obstack): Rename muscle_obstack.
15386 Echo modifications in the whole file.
15387 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15388 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15389 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15390
15391 * src/muscle_tab.h: Update double inclusion macros.
15392 (macro_entry_s): Rename muscle_entry_s.
15393 Update prototypes.
15394
15395 * src/muscle_tab.c: Include muscle_tab.h.
15396 Rename macro_tabble to muscle_table.
15397 (mhash1, mhash2, mcmp): Use muscle_entry.
15398 (macro_init): Rename muscle_init. Update.
15399 (macro_insert): Rename muscle_insert. Update.
15400 (macro_find): Rename muscle_find. Update.
15401
15402 * src/main.c: Include muscle_tab.h.
15403 (main): Call muscle_init ().
15404 * src/Makefile.am (bison_SOURCES): Echo modifications.
15405
15406 2001-09-02 Marc Autret <autret_m@epita.fr>
15407
15408 Now the files macro_tab.[ch] are named muscle_tab.[ch].
15409
15410 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15411
15412 2001-09-02 Marc Autret <autret_m@epita.fr>
15413
15414 * src/macrotab.c, src/macrotab.h: Remove.
15415
15416 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
15417
15418 * src/reader.c (copy_guard): Use muscle to specify the `#line'
15419 filename.
15420
15421 2001-09-01 Marc Autret <autret_m@epita.fr>
15422
15423 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15424 to an explicit value to activate the feature. We do it here.
15425
15426 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15427
15428 * src/output.c (prepare): Delete the `filename' muscule insertion.
15429 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15430 (parse_union_decl): Likewise.
15431 * src/macrotab.c (macro_init): Initialize filename by infile.
15432
15433 2001-08-31 Marc Autret <autret_m@epita.fr>
15434
15435 * src/bison.simple (YYLSP_NEEDED): New definition.
15436 * src/output.c (prepare): Add macro insertion of `locations_flag'
15437
15438 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15439
15440 * src/output.c (prepare): Delete insertion of previous muscles,
15441 and insert the `prefix' muscles.
15442 * src/macrotab.c (macro_init): Likewise.
15443 (macro_init): Initialization prefix directive by `yy'.
15444 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
15445 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15446 yylval, yydebug, yyerror, yynerrs and yyparse.
15447 New directive `#define' to substitute yydebug, ... with option
15448 name_prefix.
15449
15450 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15451
15452 * src/main.c (main): Standardize.
15453 * src/output.c (output_table_data, output_parser): Likewise.
15454 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15455
15456 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15457
15458 * src/reader.c (read_additionnal_code): Rename %%user_code to
15459 %%epilogue.
15460 * src/output.c (output): Rename %%declarations to %%prologue.
15461 * src/bison.simple: Echo modifications.
15462
15463 2001-08-31 Marc Autret <autret_m@epita.fr>
15464
15465 * src/reader.c (readgram): CleanUp.
15466 (output_token_defines): Likewise.
15467 (packsymbols): Likewise.
15468 (reader): Likewise.
15469 * src/output.c (output): CPP-out useless code.
15470
15471 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15472
15473 * src/reader.c (reader): Delete obsolete call to function
15474 output_trailers and output_headers.
15475 * src/output.h: Remove obsolete functions prototypes of output_headers
15476 and output_trailers.
15477
15478 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
15479
15480 * src/main.c: Include macrotab.h.
15481 * src/macrotab.h (macro_entry_s): Constify fields.
15482 Adjust functions prototypes.
15483 * src/macrotab.c (macro_insert): Constify key and value.
15484 (macro_find): Constify key.
15485 (macro_insert): Include 'xalloc.h'
15486 (macro_insert): Use XMALLOC.
15487 (macro_find): Constify return value.
15488 * src/output.c (output_table_data): Rename table to table_data.
15489 (output_parser): Constify macro_key, macro_value.
15490
15491 2001-08-30 Marc Autret <autret_m@epita.fr>
15492
15493 * src/reader.c (parse_skel_decl): New.
15494 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
15495 * src/lex.h (token_t): New token `tok_skel'.
15496 * src/lex.c (percent_table): Add skeleton option entry.
15497 Standardize.
15498
15499 2001-08-29 Marc Autret <autret_m@epita.fr>
15500
15501 * src/bison.simple: Add %%user_code directive at the end.
15502 * src/reader.c (read_additionnal_code): New.
15503 (reader): Use it.
15504 * src/output.c (output_program): Remove.
15505 (output): Update.
15506
15507 2001-08-28 Marc Autret <autret_m@epita.fr>
15508
15509 * src/output.c (output_actions): Clean up.
15510 (output_gram): CPP-out useless code.
15511 * src/reader.c (reader): Clean up, CPP-out useless code.
15512
15513 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
15514
15515 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
15516 directive.
15517 * src/bison.simple: Add `%%definitions'.
15518
15519 2001-08-28 Marc Autret <autret_m@epita.fr>
15520
15521 * config/depcomp: New file.
15522
15523 2001-08-27 Paul Eggert <eggert@twinsun.com>
15524
15525 * src/bison.simple (yyparse): Don't take the address of an
15526 item before the start of an array, as that doesn't conform to
15527 the C Standard.
15528
15529 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15530
15531 * src/output.c (output): Remove the initialization of the macro
15532 obstack. It was done too late here.
15533
15534 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15535 completely wrong.
15536 (reader): Initialize the macro obstack here, since we need it to grow
15537 '%define' directives.
15538
15539 * src/reader.h: Declare the macro obstack as extern.
15540
15541 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15542
15543 * src/output.c (output_parser): Fix. Store single '%' characters in
15544 the output obstack instead of throwing them away.
15545
15546 2001-08-27 Akim Demaille <akim@epita.fr>
15547
15548 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15549
15550 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15551
15552 * lib/Makefile.am: Adjust.
15553
15554 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15555
15556 * src/bison.simple: Update and add '%%' directives.
15557
15558 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15559
15560 * src/reader.c (reader): Remove calls to 'output_headers' and
15561 'output_trailers'. Remove some C output.
15562 (readgram): Disable a piece of code that was writing a default
15563 definition for 'YYSTYPE'.
15564 (reader_output_yylsp): Remove.
15565 (packsymbols): Output token defintions to a macro.
15566 (copy_definition): Disable C output.
15567
15568 * src/reader.c (parse_macro_decl): New function used to parse macro
15569 declarations.
15570 (copy_string2): Put the body of copy_string into this new function.
15571 Add a parameter to let the caller choose whether he wants to copy the
15572 string delimiters or not.
15573 (copy_string): Be a simple call to copy_string2 with the last argument
15574 bound to true.
15575 (read_declarations): Add case for macro definition.
15576 (copy_identifier): New.
15577 (parse_macro_decl): Read macro identifiers using copy_identifier
15578 rather than lex.
15579
15580 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15581
15582 * src/output.c (prepare): Add prefixed names.
15583 (output_parser): Output semantic actions.
15584 (output_parser): Fix bug on '%%line' directives.
15585
15586 * src/output.c (output_headers): Remove. The C code printed by this
15587 function should now be in the skeletons.
15588 (output_trailers): Remove.
15589 (output): Disable call to 'reader_output_yylsp'.
15590 (output_rule_data): Do not output tables to the table obstack.
15591
15592 * src/output.c: Remove some C dedicated output.
15593 Improve the use of macro and output obstacks.
15594 (output_defines): Remove.
15595
15596 * src/output.c (output_token_translations): Associate 'translate'
15597 table with a macro. No output to the table obstack.
15598 (output_gram): Same for 'rhs' and 'prhs'.
15599 (output_stos): Same for 'stos'.
15600 (output_rule_data): Same for 'r1' and 'r2'.
15601 (token_actions): Same for 'defact'.
15602 (goto_actions): Same for 'defgoto'.
15603 (output_base): Same for 'pact' and 'pgoto'.
15604 (output_table): Same for 'table'.
15605 (output_check): Same for 'check'.
15606
15607 * src/output.c (output_table_data): New function.
15608 (output_short_table): Remove.
15609 (output_short_or_char_table): Remove.
15610
15611 * src/output.c (output_parser): Replace most of the skeleton copy code
15612 with something new. Skeletons are now processed character by character
15613 rather than line by line, and Bison looks for '%%' macros. This is the
15614 first step in making Bison's output process (a lot) more flexible.
15615 (output_parser): Use the macro table.
15616
15617 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15618
15619 * src/main.c (main): Initialize the macro table.
15620
15621 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15622
15623 * src/lex.c (percent_table): Add tok_define.
15624 * src/lex.h: Add tok_define.
15625
15626 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15627
15628 * src/macrotab.c: New file.
15629 * src/macrotab.h: New file.
15630 * src/Makefile.am: Update.
15631
15632 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15633
15634 * lib/hash.c: New file.
15635 * lib/hash.h: New file.
15636 * lib/Makefile.am: Update.
15637
15638 2001-08-15 Akim Demaille <akim@epita.fr>
15639
15640 Version 1.28c.
15641
15642 2001-08-15 Marc Autret <autret_m@epita.fr>
15643
15644 * src/reader.c (readgram): Indent output macro YYSTYPE.
15645 (packsymbols): Likewise.
15646 (output_token_defines): Likewise.
15647 * src/files.c: Standardize.
15648 (compute_header_macro): New.
15649 (defines_obstack_save): New. Use compute_header_macro.
15650 (output_files): Update. Use defines_obstack_save.
15651
15652 2001-08-15 Akim Demaille <akim@epita.fr>
15653
15654 * doc/bison.texinfo (Table of Symbols): Document
15655 YYSTACK_USE_ALLOCA.
15656
15657 2001-08-15 Akim Demaille <akim@epita.fr>
15658
15659 * missing: Update from CVS Automake.
15660 * config/config.guess, config/config.sub, config/texinfo.tex:
15661 Update from gnu.org.
15662
15663 2001-08-15 Akim Demaille <akim@epita.fr>
15664
15665 * Makefile.maint: Sync with CVS Autoconf.
15666
15667 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
15668
15669 * doc/bison.texinfo: Include GNU Free Documentation License from
15670 `fdl.texi'.
15671 * doc/fdl.texi: Add to package.
15672
15673 2001-08-14 Marc Autret <autret_m@epita.fr>
15674
15675 Turn on %{source,header}_extension features.
15676
15677 * src/lex.c (percent_table): Un-CPP out header_extension and
15678 source_extension.
15679 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
15680 (compute_exts_from_src): Remove conditions. It restores priorities
15681 between options.
15682
15683 2001-08-14 Marc Autret <autret_m@epita.fr>
15684
15685 * src/files.c (compute_base_names): Add extensions computing when
15686 `--file-prefix' used.
15687 Standardize function calls.
15688
15689 2001-08-13 Marc Autret <autret_m@epita.fr>
15690
15691 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
15692 defining it (defined but null disables alloca).
15693
15694 2001-08-13 Marc Autret <autret_m@epita.fr>
15695
15696 * src/bison.simple (_yy_memcpy): CPP reformat.
15697
15698 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
15699
15700 * tests/atconfig.in (CPPFLAGS): Fix.
15701
15702 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
15703
15704 * doc/bison.texinfo: Include GNU General Public License from
15705 `gpl.texi'.
15706 * doc/gpl.texi: Add to package.
15707
15708 2001-08-10 Marc Autret <autret_m@epita.fr>
15709
15710 * src/print_graph.h: Fix.
15711 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15712
15713 2001-08-10 Akim Demaille <akim@epita.fr>
15714
15715 * src/system.h: Provide default declarations for stpcpy, strndup,
15716 and strnlen.
15717
15718 2001-08-10 Robert Anisko <anisko_r@epita.fr>
15719
15720 * doc/bison.texinfo (Locations): Update @$ stuff.
15721
15722 2001-08-09 Robert Anisko <anisko_r@epita.fr>
15723
15724 * src/bison.simple (YYLLOC_DEFAULT): Update.
15725 (yyparse): Adjust.
15726
15727 2001-08-08 Marc Autret <autret_m@epita.fr>
15728
15729 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
15730 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15731 Reported by Fabrice Bauzac.
15732
15733 2001-08-08 Marc Autret <autret_m@epita.fr>
15734
15735 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15736 * src/vcg.c (output_node): Fix.
15737 * src/vcg.h: Cleanup.
15738 * src/print_graph.c: Add comments.
15739 (node_output_size): New global variable. Simplify the formatting of
15740 the VCG graph output.
15741 (print_actions): Unused code is now used. It notifies the final state
15742 and no action states in the VCG graph. It also give the reduce actions.
15743 The `shift and goto' edges are red and the `go to state' edges are
15744 blue.
15745 Get the current node name and node_obstack by argument.
15746 (node_obstack): New variable.
15747 (print_state): Manage node_obstack.
15748 (print_core): Use node_obstack given by argument.
15749 A node is not only computed here but in print_actions also.
15750 (print_graph): CPP out useless code instead of commenting it.
15751
15752 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
15753
15754 * tests/atconfig.in (CPPFLAGS): Fix.
15755
15756 2001-08-07 Akim Demaille <akim@epita.fr>
15757
15758 * src/print_graph.c (quote): New.
15759 (print_core): Use it.
15760
15761 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
15762
15763 * src/vcg.c (complain.h): Include it.
15764 Unepitaize `return' invocations.
15765 [NDEBUG] (main): Remove.
15766 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
15767 * src/files.c (open_files): Initialize graph_obstack.
15768 * src/print_graph.c (print_actions): CPP out useless code.
15769 (print_core): Don't output the last `\n' in labels.
15770 Use `quote'.
15771 * src/files.c (output_files): Output the VCG file.
15772 * src/main.c (main): Invoke print_graph ();
15773
15774 2001-08-06 Marc Autret <autret_m@epita.fr>
15775
15776 Automaton VCG graph output.
15777 Using option ``-g'' or long option ``--graph'', you can generate
15778 a gram_filename.vcg file containing a VCG description of the LALR (1)
15779 automaton of your grammar.
15780
15781 * src/main.c: Call to print_graph() function.
15782 * src/getargs.h: Update.
15783 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15784 (graph_flag): New flag.
15785 (longopts): Update.
15786 (getargs): Add case `g'.
15787 * src/files.c (graph_obstack): New obstack struct.
15788 (open_files): Initialize new obstack.
15789 (output_files): Saves graph_obstack if required.
15790 * src/files.h (graph_obstack): New extern declaration.
15791 * src/Makefile.am: Add new source files.
15792
15793 2001-08-06 Marc Autret <autret_m@epita.fr>
15794
15795 * src/print_graph.c, src/print_graph.h (graph): New.
15796 * src/vcg.h: New file.
15797 * src/vcg.c: New file, VCG graph handling.
15798
15799 2001-08-06 Marc Autret <autret_m@epita.fr>
15800
15801 Add of %source_extension and %header_extension which specify
15802 the source or/and the header output file extension.
15803
15804 * src/files.c (compute_base_names): Remove initialisation of
15805 src_extension and header_extension.
15806 (compute_exts_from_gf): Update.
15807 (compute_exts_from_src): Update.
15808 (output_files): Update.
15809 * src/reader.c (parse_header_extension_decl): New.
15810 (parse_source_extension_decl): New.
15811 (read_declarations): New case statements for the new tokens.
15812 * src/lex.c (percent_table): Add entries for %source_extension
15813 and %header_extension.
15814 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15815
15816 2001-08-06 Marc Autret <autret_m@epita.fr>
15817
15818 * configure.in: Bump to 1.28c.
15819 * doc/bison.texinfo: Texinfo thingies.
15820
15821 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
15822
15823 * tests/atconfig.in (CPPFLAGS): Add.
15824 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15825
15826 2001-08-03 Akim Demaille <akim@epita.fr>
15827
15828 Version 1.28b.
15829
15830 2001-08-03 Akim Demaille <akim@epita.fr>
15831
15832 * tests/Makefile.am (check-local): Ship testsuite.
15833 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15834 Include `string.h'.
15835
15836 2001-08-03 Akim Demaille <akim@epita.fr>
15837
15838 * configure.in: Try using -Wformat when compiling.
15839
15840 2001-08-03 Akim Demaille <akim@epita.fr>
15841
15842 * configure.in: Bump to 1.28b.
15843
15844 2001-08-03 Akim Demaille <akim@epita.fr>
15845
15846 * src/complain.c: Adjust strerror_r portability issues.
15847
15848 2001-08-03 Akim Demaille <akim@epita.fr>
15849
15850 Version 1.28a.
15851
15852 2001-08-03 Akim Demaille <akim@epita.fr>
15853
15854 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15855 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15856 * src/getargs.c: Include complain.h.
15857 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15858 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15859
15860 2001-08-03 Akim Demaille <akim@epita.fr>
15861
15862 * src/reader.c (readgram): Display hidden chars in error messages.
15863
15864 2001-08-03 Akim Demaille <akim@epita.fr>
15865
15866 Update to gettext 0.10.39.
15867
15868 2001-08-03 Akim Demaille <akim@epita.fr>
15869
15870 * lib/strspn.c: New.
15871
15872 2001-08-01 Marc Autret <autret_m@epita.fr>
15873
15874 * doc/bison.texinfo: Update.
15875 * doc/bison.1 (mandoc): Update.
15876 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15877 * src/files.c: Support output files extensions computing.
15878 (src_extension): New static variable.
15879 (header_extension): New static variable.
15880 (tr): New function.
15881 (get_extension_index): New function, gets the index of an extension
15882 filename in a string.
15883 (compute_exts_from_gf): New function, computes extensions from the
15884 grammar file extension.
15885 (compute_exts_from_src): New functions, computes extensions from the
15886 C source file extension, file given by ``-o'' option.
15887 (compute_base_names): Update.
15888 (output_files): Update.
15889
15890 2001-08-01 Robert Anisko <anisko_r@epita.fr>
15891
15892 * doc/bison.texi: Document @$.
15893 (Locations): New section.
15894
15895 2001-07-18 Akim Demaille <akim@epita.fr>
15896
15897 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15898 * config/prev-version.txt, config/move-if-change: New.
15899 * Makefile.am: Adjust.
15900
15901 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
15902
15903 * src/bison.simple (yyparse): Suppress warning `comparaison
15904 between signed and unsigned'.
15905
15906 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
15907
15908 * src/getargs.h (raw_flag): Remove.
15909 * src/getargs.c: Die on `-r'/`--raw'.
15910 * src/lex.c (parse_percent_token): Die on `%raw'.
15911 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
15912 * tests/calc.at: Suppress test with option `--raw'.
15913
15914 2001-07-14 Akim Demaille <akim@epita.fr>
15915
15916 * config/: New.
15917 * configure.in: Require Autoconf 2.50.
15918 Update to gettext 0.10.38.
15919
15920 2001-03-16 Akim Demaille <akim@epita.fr>
15921
15922 * doc/bison.texinfo: ANSIfy the examples.
15923
15924 2001-03-16 Akim Demaille <akim@epita.fr>
15925
15926 * getargs.c (skeleton): New variable.
15927 (longopts): --skeleton is a new option.
15928 (shortopts, getargs): -S is a new option.
15929 * getargs.h: Declare skeleton.
15930 * output.c (output_parser): Use it.
15931
15932 2001-03-16 Akim Demaille <akim@epita.fr>
15933
15934 * m4/strerror_r.m4: New.
15935 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15936 * lib/error.h, lib/error.c: Update.
15937
15938 2001-03-16 Akim Demaille <akim@epita.fr>
15939
15940 * src/getargs.c (longopts): Clean up.
15941
15942 2001-02-21 Akim Demaille <akim@epita.fr>
15943
15944 * src/reader.c (gensym): `gensym_count' is your own.
15945 Use a static buf to create the symbol name, as token_buffer is no
15946 longer a buffer.
15947
15948 2001-02-08 Akim Demaille <akim@epita.fr>
15949
15950 * src/conflicts.c (conflict_report): Be sure not to append to res
15951 between two calls, which could happen if both first sprintf were
15952 skipped, but not the first cp += strlen.
15953
15954 2001-02-08 Akim Demaille <akim@epita.fr>
15955
15956 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
15957 New, from fileutils 4.0.37.
15958 * configure.in: Require Autoconf 2.49c. I took some time before
15959 making this decision. This is the only way out for portability
15960 issues in Bison, it would mean way too much duplicate effort to
15961 import in Bison features implemented in 2.49c since 2.13.
15962 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15963
15964 2001-02-02 Akim Demaille <akim@epita.fr>
15965
15966 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
15967 * lib/xalloc.h, lib/xmalloc.c: Update.
15968
15969 2001-01-19 Akim Demaille <akim@epita.fr>
15970
15971 Get rid of the ad hoc handling of token_buffer in the scanner: use
15972 the obstacks.
15973
15974 * src/lex.c (token_obstack): New.
15975 (init_lex): Initialize it. No longer call...
15976 (grow_token_buffer): this. Remove it.
15977 Adjust all the places which used it to use the obstack.
15978
15979 2001-01-19 Akim Demaille <akim@epita.fr>
15980
15981 * src/lex.h: Rename all the tokens:
15982 s/\bENDFILE\b/tok_eof/g;
15983 s/\bIDENTIFIER\b/tok_identifier/g;
15984 etc.
15985 Let them be enums, not #define, to ease debugging.
15986 Adjust all the code.
15987
15988 2001-01-18 Akim Demaille <akim@epita.fr>
15989
15990 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15991 * src/lex.c (maxtoken, grow_token_buffer): Static.
15992
15993 2001-01-18 Akim Demaille <akim@epita.fr>
15994
15995 Since we now use obstacks, more % directives can be enabled.
15996
15997 * src/lex.c (percent_table): Also accept `%yacc',
15998 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15999 `%debug'.
16000 Handle the actions for `%semantic_parser' and `%pure_parser' here,
16001 instead of returning a token.
16002 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
16003 * src/reader.c (read_declarations): Adjust.
16004 * src/files.c (open_files): Don't call `compute_base_names', don't
16005 compute `attrsfile' since they depend upon data which might be
16006 *in* the input file now.
16007 (output_files): Do it here.
16008 * src/output.c (output_headers): Document the fact that this patch
16009 introduces a guaranteed SEGV for semantic parsers.
16010 * doc/bison.texinfo: Document them.
16011 * tests/suite.at: Exercise these %options.
16012
16013 2000-12-20 Akim Demaille <akim@epita.fr>
16014
16015 Also handle the output file (--verbose) with obstacks.
16016
16017 * files.c (foutput): Remove.
16018 (output_obstack): New.
16019 Adjust all dependencies.
16020 * src/conflicts.c: Return a string.
16021 * src/system.h (obstack_grow_string): Rename as...
16022 (obstack_sgrow): this. Be ready to work with non literals.
16023 (obstack_fgrow4): New.
16024
16025 2000-12-20 Akim Demaille <akim@epita.fr>
16026
16027 * src/files.c (open_files): Fix the computation of short_base_name
16028 in the case of `-o foo.tab.c'.
16029
16030 2000-12-20 Akim Demaille <akim@epita.fr>
16031
16032 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16033 (copy_dollar): Now that everything uses obstacks, get rid of the
16034 FILE * parameters.
16035
16036 2000-12-20 Akim Demaille <akim@epita.fr>
16037
16038 * src/files.c (open_files): Actually the `.output' file is based
16039 on the short_base_name, not base_name.
16040 * tests/suite.at (Checking output file names): Adjust.
16041
16042 2000-12-20 Akim Demaille <akim@epita.fr>
16043
16044 * src/bison.s1: Remove, we now use directly...
16045 * src/bison.simple: this.
16046 * src/Makefile.am: Use pkgdata instead of data.
16047
16048 2000-12-20 Akim Demaille <akim@epita.fr>
16049
16050 * src/files.c (guard_obstack): New.
16051 (open_files): Initialize it.
16052 (output_files): Dump it...
16053 * src/files.h: Export it.
16054 * src/reader.c (copy_guard): Use it.
16055
16056 2000-12-19 Akim Demaille <akim@epita.fr>
16057
16058 * src/files.c (outfile, defsfile, actfile): Removed as global
16059 vars.
16060 (open_files): Don't compute them.
16061 (output_files): Adjust.
16062 (base_name, short_base_name): Be global.
16063 Adjust dependencies.
16064
16065 2000-12-19 Akim Demaille <akim@epita.fr>
16066
16067 * src/files.c (strsuffix): New.
16068 (stringappend): Be just like strcat but allocate.
16069 (base_names): Eve out from open_files.
16070 Try to simplify the rather hairy computation of base_name and
16071 short_base_name.
16072 (open_files): Use it.
16073 * tests/suite.at (Checking output file names): New test.
16074
16075 2000-12-19 Akim Demaille <akim@epita.fr>
16076
16077 * src/system.h (obstack_grow_literal_string): Rename as...
16078 (obstack_grow_string): this.
16079 * src/output.c (output_parser): Recognize `%% actions' instead of
16080 `$'.
16081 * src/bison.s1: s/$/%% actions/.
16082 * src/bison.hairy: Likewise.
16083
16084 2000-12-19 Akim Demaille <akim@epita.fr>
16085
16086 * src/output.c (output_parser): Compute the `#line' lines when
16087 there are.
16088 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16089 Suggested by Hans Aberg.
16090
16091 2000-12-19 Akim Demaille <akim@epita.fr>
16092
16093 Let the handling of the skeleton files be local to the procedures
16094 that use it.
16095
16096 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16097 longer static.
16098 (fparser, open_extra_files): Remove.
16099 (open_files, output_files): Don't take care of fparser.
16100 * src/files.h: Adjust.
16101 * src/output.c (output_parser): Open and close the file to the
16102 skeleton.
16103 * src/reader.c (read_declarations): When %semantic_parser, open
16104 fguard.
16105
16106 2000-12-19 Akim Demaille <akim@epita.fr>
16107
16108 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16109 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16110
16111 2000-12-19 Akim Demaille <akim@epita.fr>
16112
16113 * src/files.c (open_files): Yipee! We no longer need all the code
16114 looking for `/tmp' since we have no tmp file.
16115
16116 2000-12-19 Akim Demaille <akim@epita.fr>
16117
16118 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16119 New macros.
16120 * src/files.c (open_files): Less dependency on MSDOS etc.
16121
16122 2000-12-14 Akim Demaille <akim@epita.fr>
16123
16124 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16125 Provide a default definition.
16126 Use it when executing the default @ action.
16127 * src/reader.c (reader_output_yylsp): No longer include
16128 `timestamp' and `text' in the default YYLTYPE.
16129
16130 2000-12-12 Akim Demaille <akim@epita.fr>
16131
16132 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16133 (copy_guard): Quote the file names.
16134 Reported by Laurent Mascherpa.
16135
16136 2000-12-12 Akim Demaille <akim@epita.fr>
16137
16138 * src/output.c (output_headers, output_program, output): Be sure
16139 to escape special characters when outputting filenames.
16140 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16141 (output_headers): Don't depend on them, Use ACTSTR.
16142
16143 2000-11-17 Akim Demaille <akim@epita.fr>
16144
16145 * lib/obstack.h: Formatting changes.
16146 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16147 prevents type checking.
16148 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16149 cast the value to (void *): assigning a `foo *' to a `void *'
16150 variable is valid.
16151 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16152 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16153 append characters.
16154
16155 2000-11-17 Akim Demaille <akim@epita.fr>
16156
16157 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16158 as...
16159 (suite.m4, regression.m4, calc.m4): these.
16160 * tests/atgeneral.m4: Update from CVS Autoconf.
16161
16162 2000-11-17 Akim Demaille <akim@epita.fr>
16163
16164 * tests/regression.m4 (%union and --defines): New test,
16165 demonstrating a current bug in the obstack implementation.
16166
16167 2000-11-17 Akim Demaille <akim@epita.fr>
16168
16169 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16170 macros.
16171 Use them to declare the variables which are global or local to
16172 `yyparse'.
16173
16174 2000-11-17 Akim Demaille <akim@epita.fr>
16175
16176 * acconfig.h: Remove, no longer used.
16177
16178 2000-11-07 Akim Demaille <akim@epita.fr>
16179
16180 * src: s/Copyright (C)/Copyright/g.
16181
16182 2000-11-07 Akim Demaille <akim@epita.fr>
16183
16184 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16185 defining.
16186 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16187
16188 2000-11-07 Akim Demaille <akim@epita.fr>
16189
16190 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16191 Merge in a single CPP if/else.
16192
16193 2000-11-07 Akim Demaille <akim@epita.fr>
16194
16195 * src/output.c (output): Remove useless variables.
16196 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16197 argument `data' for consistency with the prototypes.
16198 Qualify it `const'.
16199 (obstack_copy, obstack_copy0): Rename the second argument as
16200 `address' for consistency. Qualify it `const'.
16201 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16202 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16203 `const' their input argument (`data' or `address').
16204 Adjust the corresponding macros to include `const' in casts.
16205
16206 2000-11-03 Akim Demaille <akim@epita.fr>
16207
16208 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16209 s/PFILE1/BISON_HAIRY/.
16210 Adjust dependencies.
16211
16212 2000-11-03 Akim Demaille <akim@epita.fr>
16213
16214 For some reason, this was not applied.
16215
16216 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16217 `unlink': it's no longer used.
16218
16219 2000-11-03 Akim Demaille <akim@epita.fr>
16220
16221 * src/files.c (skeleton_find): New function, eved out of...
16222 (open_files, open_extra_files): here.
16223
16224 2000-11-03 Akim Demaille <akim@epita.fr>
16225
16226 Don't use `atexit'.
16227
16228 * src/files.c (obstack_save): New function.
16229 (done): Rename as...
16230 (output_files): this.
16231 Use `obstack_save'.
16232 * src/main.c (main): Don't use `atexit' to register `done', since
16233 it no longer has to remove tmp files, just call `output_files'
16234 when there are no errors.
16235
16236 2000-11-02 Akim Demaille <akim@epita.fr>
16237
16238 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16239 `unlink': it's no longer used.
16240 * src/files.h: Formatting changes.
16241
16242 2000-11-02 Akim Demaille <akim@epita.fr>
16243
16244 Remove the last uses of mktemp and unlink/delete.
16245
16246 * src/files.c (fdefines, ftable): Removed.
16247 (defines_ostack, table_obstack): New.
16248 Adjust dependencies of the former into uses of the latter.
16249 * src/output.c (output_short_or_char_table, output_short_table):
16250 Convert to using obstacks.
16251 * src/reader.c (copy_comment2): Accept one FILE * and two
16252 obstacks.
16253 (output_token_defines, reader_output_yylsp): Use obstacks.
16254 * src/system.h (obstack_fgrow3): New.
16255 * po/POTFILES.in: Adjust.
16256
16257 2000-11-01 Akim Demaille <akim@epita.fr>
16258
16259 Change each use of `fattrs' into a use of `attrs_obstack'.
16260
16261 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16262 * src/files.c (fattrs): Remove.
16263 (attrs_obstack): New.
16264 Adjust all dependencies.
16265 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16266
16267 2000-11-01 Akim Demaille <akim@epita.fr>
16268
16269 Introduce obstacks.
16270 Change each use of `faction' into a use of `action_obstack'.
16271
16272 * lib/obstack.h, lib/obstack.c: New files.
16273 * src/files.c (faction): Remove.
16274 (action_obstack): New.
16275 Adjust all dependencies.
16276
16277 2000-10-20 Akim Demaille <akim@epita.fr>
16278
16279 * lib/quote.h (PARAMS): New macro. Use it.
16280
16281 2000-10-16 Akim Demaille <akim@epita.fr>
16282
16283 * src/output.c (output_short_or_char_table): New function.
16284 (output_short_table, output_token_translations): Use it.
16285 (goto_actions): Use output_short_table.
16286
16287 2000-10-16 Akim Demaille <akim@epita.fr>
16288
16289 * src/symtab.c (bucket_new): New function.
16290 (getsym): Use it.
16291
16292 * src/output.c (output_short_table): New argument to display the
16293 comment associated with the table.
16294 Adjust dependencies.
16295 (output_gram): Use it.
16296 (output_rule_data): Nicer output layout for YYTNAME.
16297
16298 2000-10-16 Akim Demaille <akim@epita.fr>
16299
16300 * src/lex.c (read_typename): New function.
16301 (lex): Use it.
16302 * src/reader.c (copy_dollar): Likewise.
16303
16304 2000-10-16 Akim Demaille <akim@epita.fr>
16305
16306 * src/reader.c (copy_comment2): Expect the input stream to be on
16307 the `/' which is suspected to open a comment, instead of being
16308 called after `//' or `/*' was read.
16309 (copy_comment, copy_definition, parse_union_decl, copy_action)
16310 (copy_guard): Adjust.
16311
16312 2000-10-16 Akim Demaille <akim@epita.fr>
16313
16314 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16315 `read_signed_integer'.
16316
16317 2000-10-16 Akim Demaille <akim@epita.fr>
16318
16319 * src/reader.c (copy_dollar): New function.
16320 (copy_guard, copy_action): Use it.
16321
16322 2000-10-16 Akim Demaille <akim@epita.fr>
16323
16324 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16325 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16326 New files, from Fileutils 4.0.27.
16327 * src/main.c (printable_version): Remove.
16328 * src/lex.c, src/reader.c: Use `quote'.
16329
16330 2000-10-04 Akim Demaille <akim@epita.fr>
16331
16332 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16333
16334 2000-10-04 Akim Demaille <akim@epita.fr>
16335
16336 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16337
16338 2000-10-04 Akim Demaille <akim@epita.fr>
16339
16340 When a literal string is used to define two different tokens,
16341 `bison -v' segfaults.
16342 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16343
16344 * tests/regression.m4: New file.
16345 Include the core of the sample provided by Piotr Gackiewicz.
16346 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16347 properly.
16348
16349 2000-10-04 Akim Demaille <akim@epita.fr>
16350
16351 * src/reader.c (parse_expect_decl): Keep `count' within the size
16352 of `buffer'.
16353 From Neil Booth.
16354
16355 2000-10-02 Paul Eggert <eggert@twinsun.com>
16356
16357 * bison.s1 (yyparse): Assign the default value
16358 unconditionally, to avoid a GCC warning and make the parser a
16359 tad smaller.
16360
16361 2000-10-02 Akim Demaille <akim@epita.fr>
16362
16363 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16364 options.
16365
16366 2000-10-02 Akim Demaille <akim@epita.fr>
16367
16368 * src/derives.c, src/print.c, src/reduce.c: To ease the
16369 translation, move some `\n' out of the translated strings.
16370
16371 2000-10-02 Akim Demaille <akim@epita.fr>
16372
16373 The location tracking mechanism is precious for parse error
16374 messages. Nevertheless, it is enabled only when `@n' is used in
16375 the grammar, which is a different issue (you can use it in error
16376 message, but not in the grammar per se). Therefore, there should
16377 be another means to enable it.
16378
16379 * src/getargs.c (getargs): Support `--locations'.
16380 (usage): Report it.
16381 * src/getargs.h (locationsflag): Export it.
16382 * src/lex.c (percent_table): Support `%locations'.
16383 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16384 with `locationsflag'.
16385 * doc/bison.texinfo: Document `--locations' and `%locations'.
16386 Sort the options.
16387 * tests/calc.m4: Test it.
16388
16389 For regularity of the names, replace each
16390 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16391 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16392 In addition replace each `flag' with `_flag'.
16393
16394 2000-10-02 Akim Demaille <akim@epita.fr>
16395
16396 Also test parse error messages, including with YYERROR_VERBOSE.
16397
16398 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16399 associative).
16400 Use it to check the computations.
16401 Use it to check `nonassoc' is honored.
16402 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16403 `--yyerror-verbose'.
16404 (_AT_CHECK_CALC): Adjust to this option.
16405 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16406
16407 2000-10-02 Akim Demaille <akim@epita.fr>
16408
16409 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16410 the latter demonstrates a flaw in the handling of non debugging
16411 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16412 was used in order to simplify:
16413
16414 #if YYDEBUG
16415 if (yydebug)
16416 {
16417 ...
16418 }
16419 #endif
16420
16421 into
16422
16423 if (yydebug)
16424 {
16425 ...
16426 }
16427
16428 unfortunately this leads to a CPP conflict when
16429 `--name-prefix=foo' is used since it produces `#define yydebug
16430 foodebug'.
16431
16432 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16433 (YYDPRINTF): New macro.
16434 Spread its use.
16435 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16436 the bison options.
16437 Also test `--verbose', `--defines' and `--name-prefix'.
16438
16439 2000-10-02 Akim Demaille <akim@epita.fr>
16440
16441 Improve the readability of the produced parsers.
16442
16443 * src/bison.s1: Formatting changes.
16444 Improve the comment related to the `$' mark.
16445 (yydefault): Don't fall through to `yyresume': `goto' there.
16446 * src/output.c (output_parser): When the `$' is met, skip the end
16447 of its line.
16448 New variable, `number_of_dollar_signs', to check there's exactly
16449 one `$' in the parser skeleton.
16450
16451 2000-10-02 Akim Demaille <akim@epita.fr>
16452
16453 * lib/xstrdup.c: New file, from the fileutils.
16454 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16455 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16456 instead of strlen + xmalloc + strcpy.
16457 * src/symtab.c (copys): Remove, use xstrdup instead.
16458
16459 2000-10-02 Akim Demaille <akim@epita.fr>
16460
16461 * src/gram.h (associativity): New enum type which replaces the
16462 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16463 `right_assoc', `left_assoc' and `non_assoc'.
16464 Adjust all dependencies.
16465 * src/reader.c: Formatting changes.
16466 (LTYPESTR): Don't define it, use it as a literal in
16467 `reader_output_yylsp'.
16468 * src/symtab.h (symbol_class): New enum type which replaces the
16469 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16470 `sunknown', `stoken and `snterm'.
16471
16472 2000-10-02 Akim Demaille <akim@epita.fr>
16473
16474 * src/getargs.c (fixed_outfiles): Rename as...
16475 (yaccflag): for consistency and accuracy.
16476 Adjust dependencies.
16477
16478 2000-10-02 Akim Demaille <akim@epita.fr>
16479
16480 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16481 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16482 difficult and introduced a lot of core dump. It turns out that
16483 Bison used an implementation of `xmalloc' based on `calloc', and
16484 at various places it does depend upon the initialization to 0. I
16485 have not tried to isolate the pertinent places, and all the former
16486 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16487 someone should address this issue.
16488
16489 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16490 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16491 files.
16492 Adjust dependencies.
16493 * src/warshall.h: New file.
16494 Propagate.
16495
16496 2000-10-02 Akim Demaille <akim@epita.fr>
16497
16498 Various anti-`extern in *.c' changes.
16499
16500 * src/system.h: Include `assert.h'.
16501
16502 2000-10-02 Akim Demaille <akim@epita.fr>
16503
16504 * src/state.h (nstates, final_state, first_state, first_shift)
16505 (first_reduction): Move their exportation from here...
16506 * src/LR0.h: to here.
16507 Adjust dependencies.
16508 * src/getargs.c (statisticsflag): New variable.
16509 Add support for `--statistics'.
16510 Adjust dependencies.
16511
16512 Remove a lot of now useless `extern' statements in most files.
16513
16514 2000-10-02 Akim Demaille <akim@epita.fr>
16515
16516 * src/LR0.h: New file.
16517 Propagate its use.
16518
16519 2000-10-02 Akim Demaille <akim@epita.fr>
16520
16521 * src/print.h: New file.
16522 Propagate its use.
16523 * src/print.c: Formatting and ordering changes.
16524 (verbose, terse): Replace with...
16525 (print_results): this new function.
16526 Adjust dependencies.
16527
16528 2000-10-02 Akim Demaille <akim@epita.fr>
16529
16530 * src/conflicts.c (conflict_report): New function.
16531 (conflict_log, verbose_conflict_log): Replace with...
16532 (print_conflicts): this function.
16533 Adjust dependencies.
16534 * src/conflicts.h: New file.
16535 Propagate its inclusion.
16536
16537 2000-10-02 Akim Demaille <akim@epita.fr>
16538
16539 * src/nullable.h: New file.
16540 Propagate its inclusion.
16541 * src/nullable.c: Formatting changes.
16542
16543 2000-10-02 Akim Demaille <akim@epita.fr>
16544
16545 * src/reduce.h: New file.
16546 Propagate its inclusion.
16547 * src/reduce.c: Topological sort and other formatting changes.
16548 (bool, TRUE, FALSE): Move their definition to...
16549 * src/system.h: here.
16550
16551 2000-10-02 Akim Demaille <akim@epita.fr>
16552
16553 * src/files.c: Formatting changes.
16554 (tryopen, tryclose, openfiles): Rename as...
16555 (xfopen, xfclose, open_files): this.
16556 (stringappend): static.
16557 * src/files.h: Complete the list of exported symbols.
16558 Propagate its use.
16559
16560 2000-10-02 Akim Demaille <akim@epita.fr>
16561
16562 * src/reader.h: New file.
16563 Propagate its use instead of tedious list of `extern' and
16564 prototypes.
16565 * src/reader.c: Formatting changes, topological sort,
16566 s/register//.
16567
16568 2000-10-02 Akim Demaille <akim@epita.fr>
16569
16570 * src/lex.h: Prototype `lex.c' exported functions.
16571 * src/reader.c: Adjust.
16572 * src/lex.c: Formatting changes.
16573 (safegetc): Rename as...
16574 (xgetc): this.
16575
16576 2000-10-02 Akim Demaille <akim@epita.fr>
16577
16578 * src/lalr.h: New file.
16579 Propagate its inclusion instead of prototypes and `extern'.
16580 * src/lalr.c: Formatting changes, topological sorting etc.
16581
16582 2000-10-02 Akim Demaille <akim@epita.fr>
16583
16584 * src/output.c (token_actions): Introduce a temporary array,
16585 YYDEFACT, that makes it possible for this function to use
16586 output_short_table.
16587
16588 2000-10-02 Akim Demaille <akim@epita.fr>
16589
16590 `user_toknums' is output as a `short[]' in `output.c', while it is
16591 defined as a `int[]' in `reader.c'. For consistency with the
16592 other output tables, `user_toknums' is now defined as a table of
16593 shorts.
16594
16595 * src/reader.c (user_toknums): Be a short table instead of an int
16596 table.
16597 Adjust dependencies.
16598
16599 Factor the short table outputs.
16600
16601 * src/output.c (output_short_table): New function.
16602 * src/output.c (output_gram, output_stos, output_rule_data)
16603 (output_base, output_table, output_check): Use it.
16604
16605 2000-10-02 Akim Demaille <akim@epita.fr>
16606
16607 * src/output.c (output): Topological sort of the functions, in
16608 order to get rid of the `static' prototypes.
16609 No longer use `register'.
16610 * src/output.h: New file.
16611 Propagate its inclusion in files explicitly prototyping functions
16612 from output.c.
16613
16614 2000-09-21 Akim Demaille <akim@epita.fr>
16615
16616 * src/atgeneral.m4: Update from Autoconf.
16617
16618 2000-09-21 Akim Demaille <akim@epita.fr>
16619
16620 * src/closure.h: New file.
16621 * src/closure.c: Formatting changes, topological sort over the
16622 functions, use of closure.h.
16623 (initialize_closure, finalize_closure): Rename as...
16624 (new_closure, free_closure): these. Adjust dependencies.
16625 * src/LR0.c: Formatting changes, topological sort, use of
16626 cloture.h.
16627 (initialize_states): Rename as...
16628 (new_states): this.
16629 * src/Makefile.am (noinst_HEADERS): Adjust.
16630
16631 2000-09-20 Akim Demaille <akim@epita.fr>
16632
16633 * src/acconfig.h: Don't protect config.h against multiple
16634 inclusion.
16635 Don't define PARAMS.
16636 * src/system.h: Define PARAMS.
16637 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
16638 purpose of config.h. system.h must not try to fix wrong
16639 definitions in config.h.
16640
16641 2000-09-20 Akim Demaille <akim@epita.fr>
16642
16643 * src/derives.h: New file.
16644 * src/main.c, src/derives.h: Use it.
16645 Formatting changes.
16646 * src/Makefile.am (noinst_HEADERS): Adjust.
16647
16648 2000-09-20 Akim Demaille <akim@epita.fr>
16649
16650 * tests/atgeneral.m4: Update from Autoconf.
16651 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
16652 (AT_CHECK_CALC): New macros.
16653 Use these macros to test bison with options `', `--raw',
16654 `--debug', `--yacc', `--yacc --debug'.
16655
16656 2000-09-19 Akim Demaille <akim@epita.fr>
16657
16658 * src/output.c: Formatting changes.
16659 * src/machine.h: Remove, leaving its contents in...
16660 * src/system.h: here.
16661 Include stdio.h.
16662 Adjust all dependencies on stdio.h and machine.h.
16663 * src/getargs.h: New file.
16664 Let all `extern' declarations about getargs.c be replaced with
16665 inclusion of `getargs.h'.
16666 * src/Makefile.am (noinst_HEADERS): Adjust.
16667
16668 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16669 scope.
16670 (yyerror): Returns void, not int.
16671 * doc/bison.texinfo: Formatting changes.
16672
16673 2000-09-19 Akim Demaille <akim@epita.fr>
16674
16675 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16676 portable.
16677
16678 2000-09-18 Akim Demaille <akim@epita.fr>
16679
16680 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16681 * src/Makefile.am (INCLUDES): Don't.
16682 Be ready to fetch headers in lib/.
16683
16684 2000-09-18 Akim Demaille <akim@epita.fr>
16685
16686 * doc/bison.texinfo: Update the copyright.
16687 ANSIfy and GNUify the examples.
16688 Remove the old menu.
16689
16690 2000-09-18 Akim Demaille <akim@epita.fr>
16691
16692 First set of tests: use the `calc' example from the documentation.
16693
16694 * src/bison.s1 (yyparse): Condition the code using `yytname' which
16695 is defined only when YYDEBUG is.
16696 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
16697 * src/files.c (tryopen, tryclose): Formatting changes.
16698 Move to the top and be static.
16699 * src/reader.c (read_signed_integer): Likewise.
16700 * tests/calc.m4: New file.
16701 * Makefile.am, suite.m4: Adjust.
16702 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
16703
16704 2000-09-18 Akim Demaille <akim@epita.fr>
16705
16706 Add support for an Autotest test suite for Bison.
16707
16708 * m4/m4.m4, m4/atconfig.m4: New files.
16709 * m4/Makefile.am (EXTRA_DIST): Adjust.
16710 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
16711 files.
16712 * src/getargs.c: Display a more standard --version message.
16713 * src/reader.c (reader): Formatting changes.
16714 No longer depend upon VERSION_STRING.
16715 * configure.in: No longer use `dnl'.
16716 Set up the test suite and the new directory `tests/.
16717 (VERSION_STRING): Remove.
16718
16719 2000-04-14 Akim Demaille <akim@epita.fr>
16720
16721 * src/reader.c (copy_comment2): New function, same as former
16722 `copy_comment', but outputs into two FILE *.
16723 (copy_comment): Use it.
16724 (parse_union_decl): Use it.
16725 (get_type, parse_start_decl): Use the same `invalid' message.
16726 (parse_start_decl, parse_union_decl): Use the same `multiple'
16727 message.
16728 (parse_union_decl, copy_guard, copy_action): Use the same
16729 `unmatched' message.
16730 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16731
16732 2000-03-31 Akim Demaille <akim@epita.fr>
16733
16734 * src/files.c (tryopen, tryclose): Move to the top.
16735 Be static.
16736
16737 2000-03-31 Akim Demaille <akim@epita.fr>
16738
16739 * src/main.c (main): Don't call `done', exit does it.
16740
16741 2000-03-31 Akim Demaille <akim@epita.fr>
16742
16743 * allocate.c: s/return (foo)/return foo/.
16744 * lalr.c: Likewise.
16745 * LR0.c: Likewise.
16746 * output.c: Likewise.
16747 * reader.c: Likewise.
16748 * symtab.c: Likewise.
16749 * vmsgetargs.c: Likewise.
16750
16751 2000-03-31 Akim Demaille <akim@epita.fr>
16752
16753 Clean up the error reporting functions.
16754
16755 * src/report.c: New file.
16756 * src/report.h: Likewise.
16757 * src/Makefile.am: Adjust.
16758 * m4/error.m4: New file.
16759 * m4/Makefile.am: Adjust.
16760 * configure.in (jm_PREREQ_ERROR): Call it.
16761 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16762 Remove.
16763 (fatal, fatals): Remove. All callers use complain.c::fatal.
16764 (warn, warni, warns, warnss, warnss): Remove. All callers use
16765 complain.c::complain.
16766 (toomany): Remove, use fatal instead.
16767 * src/files.c (done): No argument, use complain_message_count.
16768 * src/main.c (main): Register `done' to `atexit'.
16769
16770 * src/getargs.c (usage): More `fputs', less `fprintf'.
16771
16772 2000-03-28 Akim Demaille <akim@epita.fr>
16773
16774 * lib/: New directory.
16775 * Makefile.am (SUBDIRS): Adjust.
16776 * configure.in: Adjust.
16777 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16778 useless.
16779 * src/alloca.c: Moved to lib/.
16780 * src/getopt.c: Likewise.
16781 * src/getopt1.c: Likewise.
16782 * src/getopt.h: Likewise.
16783 * src/ansi2knr.c: Likewise.
16784 * src/ansi2knr.1: Likewise.
16785 * src/Makefile.am: Adjust.
16786 * lib/Makefile.am: New file.
16787
16788 2000-03-28 Akim Demaille <akim@epita.fr>
16789
16790 * src/getargs.c (usage): Refresh the help message.
16791
16792 2000-03-17 Akim Demaille <akim@epita.fr>
16793
16794 * src/getopt1.c: Updated from textutils 2.0e
16795 * src/getopt.c: Likewise.
16796 * src/getopt.h: Likewise.
16797
16798 2000-03-17 Akim Demaille <akim@epita.fr>
16799
16800 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16801 the file name, not the whole `#line LINE FILE'.
16802
16803 2000-03-17 Akim Demaille <akim@epita.fr>
16804
16805 On syntax errors, report the token on which we choked.
16806
16807 * src/bison.s1 (yyparse): In the label yyerrlab, when
16808 YYERROR_VERBOSE, add yychar in msg.
16809
16810 2000-03-17 Akim Demaille <akim@epita.fr>
16811
16812 * src/reader.c (copy_at): New function.
16813 (copy_guard): Use it.
16814 (copy_action): Use it.
16815
16816 2000-03-17 Akim Demaille <akim@epita.fr>
16817
16818 Be kind to translators, save some useless translations.
16819
16820 * src/main.c (banner): New function.
16821 (fatal_banner): Use it.
16822 (warn_banner): Use it.
16823
16824 2000-03-17 Akim Demaille <akim@epita.fr>
16825
16826 * src/reader.c (copy_definition): Use copy_string and
16827 copy_comment. Removed now unused `match', `ended',
16828 `cplus_comment'.
16829 (copy_comment, copy_string): Moved, to be visible from
16830 copy_definition.
16831
16832 2000-03-17 Akim Demaille <akim@epita.fr>
16833
16834 * src/reader.c (copy_string): Declare `static inline'. No
16835 problems with inline, since it is checked by configure.
16836 (copy_comment): Likewise.
16837
16838 2000-03-17 Akim Demaille <akim@epita.fr>
16839
16840 * src/reader.c (packsymbols): Formatting changes.
16841
16842 2000-03-17 Akim Demaille <akim@epita.fr>
16843
16844 * src/reader.c (copy_comment): New function, factored out from:
16845 (copy_action): Use it. Removed now unused `match', `ended',
16846 `cplus_comment'.
16847 (copy_guard): Likewise.
16848
16849 2000-03-17 Akim Demaille <akim@epita.fr>
16850
16851 * src/reader.c (copy_string): New function, factored out from:
16852 (copy_action): Use it.
16853 (copy_guard): Likewise.
16854
16855 2000-03-17 Akim Demaille <akim@epita.fr>
16856
16857 Change the handling of @s so that they behave exactly like $s.
16858 There is now a pseudo variable @$ (readble and writable), location
16859 of the lhs of the rule (by default ranging from the location of
16860 the first symbol of the rhs, to the location of the last symbol,
16861 or, if the rhs is empty, YYLLOC).
16862
16863 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16864 yyval.
16865 (yyparse): When providing a default semantic action, provide a
16866 default location action.
16867 (after the $): No longer change `*YYLSP', just stack YYLOC the
16868 same way you stack YYVAL.
16869 * src/reader.c (read_declarations): Use warns.
16870 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16871 (copy_action, case '@'): Likewise.
16872 Use a standard error message, to save useless work from
16873 translators.
16874
16875 2000-03-17 Akim Demaille <akim@epita.fr>
16876
16877 * src/bison.s1: Formatting and cosmetics changes.
16878 * src/reader.c: Likewise.
16879 Update the Copyright notice.
16880
16881 2000-03-17 Akim Demaille <akim@epita.fr>
16882
16883 * src/bison.s1 (#line): All set to `#line' only, since the
16884 Makefile now handles them.
16885
16886 2000-03-16 Akim Demaille <akim@epita.fr>
16887
16888 * src/output.c (output_rule_data): Output the documentation of
16889 some of the tables.
16890 (Copyright notice): Update.
16891 Formatting changes.
16892
16893 2000-03-16 Akim Demaille <akim@epita.fr>
16894
16895 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
16896 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
16897 One `#if YYDEBUG' remains, since it uses variables which are
16898 defined only if `YYDEBUG != 0'.
16899
16900 2000-03-16 Akim Demaille <akim@epita.fr>
16901
16902 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16903 and related variables so that the similarities are highlighted.
16904
16905 2000-03-16 Akim Demaille <akim@epita.fr>
16906
16907 * src/bison.s1: Properly indent CPP directives.
16908
16909 2000-03-16 Akim Demaille <akim@epita.fr>
16910
16911 * src/bison.s1: Properly indent the `alloca' CPP section.
16912
16913 2000-03-16 Akim Demaille <akim@epita.fr>
16914
16915 Do not hard code values of directories in `configure.in'.
16916 Update the `configure' tool chain.
16917
16918 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16919 src/makefile.am.
16920 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
16921 (AC_OUTPUT): Add m4/Makefile.
16922 Bump to bison 1.28a, 1.29 has never been released.
16923 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
16924 handled via src/Makefile.am.
16925 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
16926 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
16927 autoheader.
16928 * Makefile.am (SUBDIRS): Add m4.
16929 (ACLOCAL_AM_FLAGS): New variable.
16930 (AUTOMAKE_OPTIONS): Add check-news.
16931 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
16932 the proper line number and file name.
16933 (DEFS): Propagate the location of bison library files and of the
16934 locale files.
16935 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16936 builddir.
16937 * acinclude.m4: Remove, replaced by the directory m4.
16938 * m4/Makefile.am (EXTRA_DIST): New variable.
16939 * m4/gettext.m4: New file, from the fileutils.
16940 * m4/lcmessage.m4: Likewise
16941 * m4/progtest.m4: Likewise.
16942 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
16943
16944 2000-03-10 Akim Demaille <akim@epita.fr>
16945
16946 * src/closure.c:
16947 Formatting changes of various comments.
16948 Respect the GNU coding standards at various places.
16949 Don't use `_()' when no translation is needed.
16950
16951 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16952
16953 * src/files.c:
16954 OS/2 honors TMPDIR environment variable.
16955
16956 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16957
16958 * doc/bison.texinfo: Tweaked spelling and grammar.
16959 Updated ISBN.
16960 Removed reference to price of printed copy.
16961 Mention BISON_SIMPLE and BISON_HAIRY.
16962
16963 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16964
16965 * configure.in, NEWS:
16966 Bison 1.29 released.
16967
16968 1999-10-27 Jesse Thilo <jthilo@gnu.org>
16969
16970 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16971 Added reference card.
16972
16973 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16974
16975 * po/ru.po: Added Russian translation.
16976
16977 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16978
16979 * configure.in: Added Russian translation.
16980
16981 1999-07-06 Jesse Thilo <jthilo@gnu.org>
16982
16983 * configure.in, NEWS, README:
16984 Released version 1.28.
16985
16986 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16987
16988 * src/system.h:
16989 Squashed redefinition warning on some systems.
16990
16991 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16992 Have configure build version string instead of relying on ANSI string
16993 concatentation.
16994
16995 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16996
16997 * po/POTFILES.in: Got rid of version.c.
16998
16999 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17000
17001 * acconfig.h, configure.in:
17002 Have configure build version string instead of relying on ANSI string
17003 concatentation.
17004
17005 1999-06-08 Jesse Thilo <jthilo@gnu.org>
17006
17007 * doc/bison.1:
17008 Dropped mention of `+' for long-named options.
17009
17010 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17011
17012 * src/files.c: Added <unistd.h> for unlink().
17013
17014 * src/Makefile.am, src/system.h:
17015 I18n fixes.
17016
17017 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17018
17019 * README: Added a FAQ list.
17020
17021 * configure.in, acconfig.h:
17022 I18n fixes.
17023
17024 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17025
17026 * doc/FAQ, doc/Makefile.am:
17027 Added a FAQ list.
17028
17029 1999-05-19 Jesse Thilo <jthilo@gnu.org>
17030
17031 * src/alloc.h, src/symtab.h, src/version.c:
17032 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17033
17034 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17035
17036 * src/.cvsignore, src/Makefile.am:
17037 Reorganized: sources in `src', documentation in `doc'.
17038
17039 * src/lex.c (literalchar):
17040 fixed the code for escaping double quotes (thanks
17041 Jonathan Czisny.)
17042
17043 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17044
17045 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17046 Adjusted paths to reflect directory reorganization.
17047
17048 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17049
17050 * doc/.cvsignore, doc/Makefile.am:
17051 Reorganized: sources in `src', documentation in `doc'.
17052
17053 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17054
17055 * configure.in:
17056 Updated AC_INIT file to reflect directory reorganization.
17057
17058 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17059 Reorganized: sources in `src', documentation in `doc'.
17060
17061 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17062
17063 * src/allocate.c:
17064 Don't declare calloc() and realloc() if not necessary.
17065
17066 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17067
17068 * configure.in, acconfig.h, acinclude.m4:
17069 Don't declare calloc() and realloc() if not necessary.
17070
17071 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17072
17073 * po/.cvsignore: Added i18n support.
17074
17075 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17076
17077 * acconfig.h, configure.in, Makefile.am:
17078 Added i18n support.
17079
17080 1999-03-22 Jesse Thilo <jthilo@gnu.org>
17081
17082 * src/bison.s1: Fixed #line numbers.
17083
17084 1999-03-15 Jesse Thilo <jthilo@gnu.org>
17085
17086 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17087 Added PO files from Translation Project.
17088
17089 1999-03-03 Jesse Thilo <jthilo@gnu.org>
17090
17091 * Makefile.am:
17092 Added support for non-ANSI compilers (ansi2knr).
17093
17094 1999-02-16 Jesse Thilo <jthilo@gnu.org>
17095
17096 * configure.in: Bumped version number to 1.27.
17097
17098 * Makefile.am:
17099 Added `bison.simple' to list of files removed by `make distclean'.
17100
17101 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17102
17103 * src/files.c, src/files.h:
17104 Defined locations of parser files in config.h instead of Makefile.
17105
17106 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17107
17108 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17109 Defined locations of parser files in config.h instead of Makefile.
17110
17111 1999-02-09 Jesse Thilo <jthilo@gnu.org>
17112
17113 * Makefile.am:
17114 Removed inappropriate use of $< macro.
17115
17116 1999-02-05 Jesse Thilo <jthilo@gnu.org>
17117
17118 * po/Makefile.in.in, po/POTFILES.in:
17119 Add `po' directory skeleton.
17120
17121 1999-01-27 Jesse Thilo <jthilo@gnu.org>
17122
17123 * README: Document help-bison list.
17124
17125 * configure.in: Add check for mkstemp().
17126
17127 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17128
17129 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17130 Hush a few compiler warnings.
17131
17132 * src/files.c:
17133 Add tryclose(), which verifies that fclose was successful.
17134 Hush a couple of compiler warnings.
17135
17136 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17137
17138 * Makefile.am, OChangeLog:
17139 ChangeLog is now automatically generated. Include the old version as
17140 OChangeLog.
17141
17142 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17143
17144 * 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:
17145 Update FSF address.
17146
17147 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17148
17149 * doc/bison.texinfo: Fix formatting glitch.
17150
17151 * doc/bison.texinfo: Update FSF address.
17152
17153 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17154
17155 * acconfig.h: Update FSF address.
17156
17157 1999-01-08 Jesse Thilo <jthilo@gnu.org>
17158
17159 * src/system.h:
17160 Don't define PACKAGE here, since config.h defines it.
17161
17162 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17163
17164 * src/reader.c: Update copyright date.
17165
17166 * src/main.c:
17167 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17168 favor of output directly to stderr (avoids buffer overruns).
17169
17170 * src/reader.c: Some checks for premature EOF.
17171
17172 * 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:
17173 Use prototypes if the compiler understands them.
17174
17175 * src/files.c: Honor TMPDIR on Unix hosts.
17176 Use prototypes if the compiler understands them.
17177
17178 * src/reader.c:
17179 Fix a couple of buffer overrun bugs.
17180 Use prototypes if the compiler understands them.
17181
17182 * src/system.h: Include unistd.h and ctype.h.
17183 Use #ifdef instead of #if for NLS symbols.
17184
17185 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17186
17187 * doc/bison.texinfo:
17188 Delete comment "consider using @set for edition number, etc..." since
17189 we now are doing so.
17190
17191 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17192
17193 * configure.in:
17194 Use prototypes if the compiler understands them.
17195
17196 * NEWS: Document 1.26 highlights.
17197
17198 * Makefile.am: Require Automake 1.3 or later.
17199
17200 * acconfig.h:
17201 Use prototypes if the compiler understands them.
17202
17203 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17204
17205 * src/version.c:
17206 Use VERSION symbol from automake for version number.
17207
17208 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17209
17210 * acconfig.h, configure.in, version.cin:
17211 Use VERSION symbol from automake for version number.
17212
17213 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17214
17215 * Makefile.am:
17216 Distribute original version of simple parser (bison.s1), not built
17217 version (bison.simple).
17218
17219 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17220
17221 * doc/bison.texinfo: Add info dir entry.
17222
17223 * doc/bison.texinfo:
17224 Let automake put version number into documentation.
17225
17226 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17227
17228 * src/bison.cld, src/build.com, src/vmshlp.mar:
17229 Add non-RCS files from /gd/gnu/bison.
17230
17231 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17232
17233 * doc/bison.1:
17234 Document the BISON_HAIRY and BISON_SIMPLE variables.
17235
17236 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17237
17238 * src/version.c: Build version.c automatically.
17239
17240 * src/reader.c:
17241 Fix token numbering (used to start at 258, not 257).
17242
17243 * src/system.h: Include config.h.
17244
17245 * src/getargs.c: Update bug report address.
17246
17247 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17248 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17249
17250 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17251
17252 * Makefile.am:
17253 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17254
17255 * configure.in, version.cin:
17256 Build version.c automatically.
17257
17258 * AUTHORS: Add AUTHORS file.
17259
17260 * README: Update bug report address.
17261
17262 * bison.simple:
17263 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17264
17265 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17266 Add automake stuff.
17267
17268 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17269
17270 * doc/bison.texinfo: Clean up some formatting.
17271
17272 1998-05-05 Richard Stallman <rms@gnu.org>
17273
17274 * doc/bison.texinfo:
17275 Explain better why to make a pure parser.
17276
17277 1998-01-05 Richard Stallman <rms@gnu.org>
17278
17279 * src/files.c (openfiles):
17280 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17281 find a temporary directory, if possible. Do not unlink files while
17282 they are open.
17283
17284 1997-08-25 Richard Stallman <rms@gnu.org>
17285
17286 * src/reader.c (stack_offset;):
17287 Change some warni to warns.
17288
17289 * src/lex.c (literalchar): Use warns, not warni.
17290
17291 1997-06-28 Richard Stallman <rms@gnu.org>
17292
17293 * src/bison.s1: Add a Bison version comment.
17294
17295 * src/main.c (fatal, warn, berror):
17296 Use program_name.
17297
17298 1997-06-28 Richard Stallman <rms@gnu.org>
17299
17300 * Makefile.in (bison_version): New variable.
17301 (dist): Use that variable.
17302 (bison.s1): Substitute the Bison version into bison.simple.
17303
17304 * bison.simple: Add a Bison version comment.
17305
17306 1997-06-18 Richard Stallman <rms@gnu.org>
17307
17308 * src/main.c (fatal, warn, berror):
17309 Make error messages standard.
17310 (toomany): Improve error message text.
17311
17312 * 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:
17313 new.h renamed to alloc.h.
17314
17315 1997-06-18 Richard Stallman <rms@gnu.org>
17316
17317 * Makefile.in: new.h renamed to alloc.h.
17318
17319 1997-05-24 Richard Stallman <rms@gnu.org>
17320
17321 * src/lex.c (literalchar):
17322 Fix the code for escaping \, " and '.
17323
17324 (lex): Avoid trouble when there are many chars
17325 to discard in a char literal with just several chars in it.
17326
17327 1997-05-17 Richard Stallman <rms@gnu.org>
17328
17329 * src/bison.s1:
17330 Use malloc, if using alloca is troublesome.
17331 (YYSTACK_USE_ALLOCA): New flag macro.
17332 Define it for some systems and compilers.
17333 (YYSTACK_ALLOC): New macro.
17334 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17335 If it was malloc'd, free it.
17336
17337 1997-05-17 Richard Stallman <rms@gnu.org>
17338
17339 * bison.simple:
17340 Use malloc, if using alloca is troublesome.
17341 (YYSTACK_USE_ALLOCA): New flag macro.
17342 Define it for some systems and compilers.
17343 (YYSTACK_ALLOC): New macro.
17344 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17345 If it was malloc'd, free it.
17346
17347 1997-04-23 Richard Stallman <rms@gnu.org>
17348
17349 * src/bison.s1:
17350 (alloca) [__hpux]: Always define as __builtin_alloca.
17351
17352 1997-04-23 Richard Stallman <rms@gnu.org>
17353
17354 * bison.simple:
17355 (alloca) [__hpux]: Always define as __builtin_alloca.
17356
17357 1997-04-22 Richard Stallman <rms@gnu.org>
17358
17359 * src/bison.s1:
17360 [__hpux]: Include alloca.h (right for HPUX 10)
17361 instead of declaring alloca (right for HPUX 9).
17362
17363 * src/bison.s1 (__yy_memcpy):
17364 Declare arg `count' as unsigned int.
17365 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17366
17367 1997-04-22 Richard Stallman <rms@gnu.org>
17368
17369 * bison.simple:
17370 [__hpux]: Include alloca.h (right for HPUX 10)
17371 instead of declaring alloca (right for HPUX 9).
17372
17373 * bison.simple (__yy_memcpy):
17374 Declare arg `count' as unsigned int.
17375 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17376
17377 1997-01-03 Richard Stallman <rms@gnu.org>
17378
17379 * src/allocate.c: [__STDC__ or _MSC_VER]:
17380 Declare calloc and realloc to return void *.
17381
17382 1997-01-02 Richard Stallman <rms@gnu.org>
17383
17384 * src/system.h:
17385 [_MSC_VER]: Include stdlib.h and process.h.
17386 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17387
17388 * src/main.c (main): Return FAILURE as a value.
17389 (printable_version): Declare arg as int, not char.
17390
17391 1997-01-02 Richard Stallman <rms@gnu.org>
17392
17393 * Makefile.in (dist):
17394 Explicitly check for symlinks, and copy them.
17395
17396 1996-12-19 Richard Stallman <rms@gnu.org>
17397
17398 * src/files.c:
17399 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17400
17401 1996-12-18 Paul Eggert <eggert@gnu.org>
17402
17403 * src/bison.s1 (yyparse):
17404 If __GNUC__ and YYPARSE_PARAM are both defined,
17405 declare yyparse to have a void * argument.
17406
17407 1996-12-18 Paul Eggert <eggert@gnu.org>
17408
17409 * bison.simple (yyparse):
17410 If __GNUC__ and YYPARSE_PARAM are both defined,
17411 declare yyparse to have a void * argument.
17412
17413 1996-12-17 Richard Stallman <rms@gnu.org>
17414
17415 * src/reduce.c (nbits): Add some casts.
17416
17417 1996-08-12 Richard Stallman <rms@gnu.org>
17418
17419 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17420
17421 1996-08-12 Richard Stallman <rms@gnu.org>
17422
17423 * bison.simple: Test _MSDOS as well as _MSDOS_.
17424
17425 1996-07-31 Richard Stallman <rms@gnu.org>
17426
17427 * src/bison.s1:
17428 [__sun && __i386]: Include alloca.h.
17429
17430 1996-07-31 Richard Stallman <rms@gnu.org>
17431
17432 * bison.simple:
17433 [__sun && __i386]: Include alloca.h.
17434
17435 1996-07-30 Richard Stallman <rms@gnu.org>
17436
17437 * src/bison.s1: Comment change.
17438
17439 * src/bison.s1: Test _MSDOS_, not MSDOS.
17440
17441 1996-07-30 Richard Stallman <rms@gnu.org>
17442
17443 * bison.simple: Comment change.
17444
17445 * bison.simple: Test _MSDOS_, not MSDOS.
17446
17447 1996-06-01 Richard Stallman <rms@gnu.org>
17448
17449 * 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:
17450 Insert `_' macro around many string constants.
17451
17452 * src/main.c:
17453 Insert `_' macro around many string constants.
17454
17455 (main): Call setlocale, bindtextdomain and textdomain.
17456
17457 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17458 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17459 [ENABLE_NLS]: Include libintl.h.
17460 [ENABLE_NLS] (gettext): Define.
17461 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17462 (N_, PACKAGE, LOCALEDIR): New macros.
17463
17464 1996-06-01 Richard Stallman <rms@gnu.org>
17465
17466 * POTFILES.in: New file.
17467
17468 * Makefile.in (allocate.o):
17469 Define target explicitly.
17470
17471 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17472 (LDFLAGS): Set to @LDFLAGS@.
17473 (configure): Run autoconf only if preceding `cd' succeeds.
17474 (bison.s1): Redirect output to temporary file then move the
17475 temporary to the target, rather than redirecting directly to bison.s1.
17476 (clean): Remove config.status and config.log.
17477 (distclean): Don't remove config.status here.
17478
17479 1996-05-12 Richard Stallman <rms@gnu.org>
17480
17481 * src/bison.s1:
17482 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17483
17484 1996-05-12 Richard Stallman <rms@gnu.org>
17485
17486 * bison.simple:
17487 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17488
17489 1996-05-11 Richard Stallman <rms@gnu.org>
17490
17491 * src/bison.s1 (__yy_memcpy):
17492 Really reorder the args, as was supposedly done on Feb 14 1995.
17493 (yyparse): Calls changed accordingly.
17494
17495 1996-05-11 Richard Stallman <rms@gnu.org>
17496
17497 * Makefile.in (dist): Don't use $(srcdir).
17498
17499 * bison.simple (__yy_memcpy):
17500 Really reorder the args, as was supposedly done on Feb 14 1995.
17501 (yyparse): Calls changed accordingly.
17502
17503 1996-01-27 Richard Stallman <rms@gnu.org>
17504
17505 * src/output.c (output_rule_data):
17506 Test YYERROR_VERBOSE in the conditional
17507 around the definition of ttyname.
17508
17509 1995-12-29 Richard Stallman <rms@gnu.org>
17510
17511 * src/bison.s1:
17512 Fix line numbers in #line commands.
17513
17514 1995-12-29 Richard Stallman <rms@gnu.org>
17515
17516 * bison.simple:
17517 Fix line numbers in #line commands.
17518
17519 1995-12-27 Richard Stallman <rms@gnu.org>
17520
17521 * src/bison.s1 (YYPARSE_PARAM_DECL):
17522 In C++, make it always null.
17523 (YYPARSE_PARAM_ARG): New macro.
17524 (yyparse): Use YYPARSE_PARAM_ARG.
17525
17526 1995-12-27 Richard Stallman <rms@gnu.org>
17527
17528 * bison.simple (YYPARSE_PARAM_DECL):
17529 In C++, make it always null.
17530 (YYPARSE_PARAM_ARG): New macro.
17531 (yyparse): Use YYPARSE_PARAM_ARG.
17532
17533 1995-11-29 Richard Stallman <rms@gnu.org>
17534
17535 * doc/bison.texinfo:
17536 Describe literal string tokens, %raw, %no_lines, %token_table.
17537
17538 1995-11-29 Daniel Hagerty <hag@gnu.org>
17539
17540 * doc/bison.texinfo: Fixed update date
17541
17542 1995-10-16 Richard Stallman <rms@gnu.org>
17543
17544 * src/version.c: Version 1.25.
17545
17546 1995-10-16 Richard Stallman <rms@gnu.org>
17547
17548 * NEWS: *** empty log message ***
17549
17550 1995-10-16 Richard Stallman <rms@gnu.org>
17551
17552 * doc/bison.1, doc/bison.rnh:
17553 Add new options.
17554
17555 1995-10-15 Richard Stallman <rms@gnu.org>
17556
17557 * src/vmsgetargs.c, src/getargs.c:
17558 Added -n, -k, and -raw switches.
17559 (noparserflag, toknumflag, rawtoknumflag): New variables.
17560
17561 * src/symtab.h (SALIAS):
17562 New #define for adding aliases to %token.
17563 (struct bucket): Added `alias' field.
17564
17565 * src/reduce.c (reduce_grammar):
17566 Revise error message.
17567 (print_notices): Remove final `.' from error message.
17568
17569 * src/reader.c (reader_output_yylsp):
17570 New function.
17571 (readgram): Use `#if 0' around code that accepted %command
17572 inside grammar rules: The documentation doesn't allow it,
17573 and it will fail since the %command processors scan for the next %.
17574 (parse_token_decl): Extended the %token
17575 declaration to allow a multi-character symbol as an alias.
17576 (parse_thong_decl): New function.
17577 (read_declarations): Added %thong declarations.
17578 (read_declarations): Handle NOOP to deal with allowing
17579 % declarations as another means to specify the flags.
17580 (readgram): Allow %prec prior to semantics embedded in a rule.
17581 (skip_to_char, read_declarations, copy_definition)
17582 (parse_token_decl, parse_start_decl, parse_type_decl)
17583 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17584 (get_type_name, copy_guard, copy_action, readgram)
17585 (get_type, packsymbols): Revised most error messages.
17586 Changed `fatal' to `warnxxx' to avoid aborting for error.
17587 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17588 (read_declarations): Improve the error message for
17589 an invalid character. Do not abort.
17590 (read_declarations, copy_guard, copy_action): Use
17591 printable_version to avoid unprintable characters in printed output.
17592 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
17593 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
17594 Allow the type of a non-terminal can be given
17595 more than once, as long as all specifications give the same type.
17596
17597 * src/output.c:
17598 (output_headers, output_trailers, output, output_gram)
17599 (output_rule_data): Implement noparserflag variable.
17600 Implement toknumflag variable.
17601 (output): Call reader_output_yylsp to output LTYPESTR.
17602
17603 * src/main.c (main):
17604 If reader sees an error, don't process the grammar.
17605 (fatals): Updated to not use VARARGS1.
17606 (printable_version, int_to_string, warn, warni, warns, warnss)
17607 (warnsss): New error reporting functions. Avoid abort for error.
17608
17609 * src/lex.h:
17610 Added THONG and NOOP for alias processing.
17611 Added SETOPT for the new code that allows setting options with %flags.
17612
17613 * src/lex.c:
17614 Include getopt.h. Add some extern decls.
17615 (safegetc): New function to deal with EOF gracefully.
17616 (literalchar); new function to deal with reading \ escapes.
17617 (lex): Use literalchar.
17618 (lex): Implemented "..." tokens.
17619 (literalchar, lex, parse_percent_token): Made tokenbuffer
17620 always contain the token. This includes growing the token
17621 buffer while reading an integer.
17622 (parse_percent_token): Replaced if-else statement with percent_table.
17623 (parse_percent_token): Added % declarations as another
17624 way to specify the flags -n, -l, and -r. Also added hooks for
17625 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
17626 major changes to files.c.
17627 (lex) Retain in the incoming stream a character following
17628 an incorrect '/'.
17629 (skip_white_space, lex): Revised most error messages
17630 and changed fatal to warn to avoid aborting.
17631 (percent_table): Added %thong declarations.
17632
17633 * src/gram.h: Comment changes.
17634
17635 * src/files.c (openfiles, open_extra_files, done):
17636 Add faction flag
17637 and actfile file. Handle noparserflag. Both for -n switch.
17638
17639 * src/conflicts.c (resolve_sr_conflict):
17640 Remove use of alloca.
17641
17642 1995-06-01 Jim Meyering <meyering@gnu.org>
17643
17644 * doc/bison.texinfo: *** empty log message ***
17645
17646 1995-05-06 Richard Stallman <rms@gnu.org>
17647
17648 * src/bison.s1: Comment change.
17649
17650 1995-05-06 Richard Stallman <rms@gnu.org>
17651
17652 * bison.simple: Comment change.
17653
17654 1995-05-03 Richard Stallman <rms@gnu.org>
17655
17656 * src/version.c: Version now 1.24.
17657
17658 * src/bison.s1: Change distribution terms.
17659
17660 * src/version.c: Version now 1.23.
17661
17662 1995-05-03 Richard Stallman <rms@gnu.org>
17663
17664 * doc/bison.texinfo:
17665 Rewrite "Conditions for Using Bison".
17666 Update version to 1.24.
17667
17668 1995-05-03 Richard Stallman <rms@gnu.org>
17669
17670 * bison.simple: Change distribution terms.
17671
17672 1995-02-23 Richard Stallman <rms@gnu.org>
17673
17674 * src/files.c: Test __VMS_POSIX as well as VMS.
17675
17676 1995-02-14 Jim Meyering <meyering@gnu.org>
17677
17678 * src/bison.s1 (__yy_memcpy):
17679 Renamed from __yy_bcopy to avoid
17680 confusion. Reverse FROM and TO arguments to be consistent with
17681 those of memcpy.
17682
17683 1995-02-14 Jim Meyering <meyering@gnu.org>
17684
17685 * bison.simple (__yy_memcpy):
17686 Renamed from __yy_bcopy to avoid
17687 confusion. Reverse FROM and TO arguments to be consistent with
17688 those of memcpy.
17689
17690 1994-11-10 David J. MacKenzie <djm@gnu.org>
17691
17692 * NEWS: reformat
17693
17694 * NEWS: New file.
17695
17696 * Makefile.in (DISTFILES): Include NEWS.
17697
17698 * Makefile.in (DISTFILES):
17699 Include install-sh, not install.sh.
17700
17701 * configure.in: Update to Autoconf v2 macro names.
17702
17703 1994-10-05 David J. MacKenzie <djm@gnu.org>
17704
17705 * Makefile.in: fix typo
17706
17707 * Makefile.in (prefix, exec_prefix):
17708 Let configure set them.
17709
17710 1994-09-28 David J. MacKenzie <djm@gnu.org>
17711
17712 * Makefile.in: Set datadir to $(prefix)/share.
17713
17714 1994-09-15 Richard Stallman <rms@gnu.org>
17715
17716 * src/bison.s1:
17717 Update copyright notice and GPL version.
17718
17719 1994-09-15 Richard Stallman <rms@gnu.org>
17720
17721 * bison.simple:
17722 Update copyright notice and GPL version.
17723
17724 1994-07-12 Richard Stallman <rms@gnu.org>
17725
17726 * src/reduce.c, src/reader.c:
17727 entered into RCS
17728
17729 1994-05-05 David J. MacKenzie <djm@gnu.org>
17730
17731 * Makefile.in: entered into RCS
17732
17733 1994-03-26 Richard Stallman <rms@gnu.org>
17734
17735 * src/bison.s1: entered into RCS
17736
17737 1994-03-26 Richard Stallman <rms@gnu.org>
17738
17739 * bison.simple: entered into RCS
17740
17741 1994-03-25 Richard Stallman <rms@gnu.org>
17742
17743 * src/main.c: entered into RCS
17744
17745 1994-03-24 Richard Stallman <rms@gnu.org>
17746
17747 * src/conflicts.c: entered into RCS
17748
17749 1994-01-02 Richard Stallman <rms@gnu.org>
17750
17751 * Makefile.in: *** empty log message ***
17752
17753 1993-11-21 Richard Stallman <rms@gnu.org>
17754
17755 * src/bison.s1: *** empty log message ***
17756
17757 1993-11-21 Richard Stallman <rms@gnu.org>
17758
17759 * doc/bison.texinfo: entered into RCS
17760
17761 * doc/bison.texinfo: *** empty log message ***
17762
17763 1993-11-21 Richard Stallman <rms@gnu.org>
17764
17765 * bison.simple: *** empty log message ***
17766
17767 1993-10-25 David J. MacKenzie <djm@gnu.org>
17768
17769 * doc/bison.texinfo: *** empty log message ***
17770
17771 1993-10-19 Richard Stallman <rms@gnu.org>
17772
17773 * src/bison.s1: *** empty log message ***
17774
17775 1993-10-19 Richard Stallman <rms@gnu.org>
17776
17777 * bison.simple: *** empty log message ***
17778
17779 1993-10-14 Richard Stallman <rms@gnu.org>
17780
17781 * src/bison.s1: *** empty log message ***
17782
17783 1993-10-14 Richard Stallman <rms@gnu.org>
17784
17785 * bison.simple: *** empty log message ***
17786
17787 1993-09-14 David J. MacKenzie <djm@gnu.org>
17788
17789 * doc/bison.texinfo: *** empty log message ***
17790
17791 1993-09-13 Noah Friedman <friedman@gnu.org>
17792
17793 * Makefile.in: *** empty log message ***
17794
17795 1993-09-10 Richard Stallman <rms@gnu.org>
17796
17797 * src/conflicts.c: *** empty log message ***
17798
17799 * src/system.h: entered into RCS
17800
17801 1993-09-10 Richard Stallman <rms@gnu.org>
17802
17803 * doc/bison.1: entered into RCS
17804
17805 1993-09-06 Noah Friedman <friedman@gnu.org>
17806
17807 * src/version.c: entered into RCS
17808
17809 1993-09-06 Noah Friedman <friedman@gnu.org>
17810
17811 * Makefile.in: *** empty log message ***
17812
17813 1993-07-30 David J. MacKenzie <djm@gnu.org>
17814
17815 * Makefile.in: *** empty log message ***
17816
17817 1993-07-24 Richard Stallman <rms@gnu.org>
17818
17819 * src/bison.s1: *** empty log message ***
17820
17821 1993-07-24 Richard Stallman <rms@gnu.org>
17822
17823 * bison.simple: *** empty log message ***
17824
17825 1993-07-08 David J. MacKenzie <djm@gnu.org>
17826
17827 * Makefile.in: *** empty log message ***
17828
17829 1993-07-04 Richard Stallman <rms@gnu.org>
17830
17831 * src/bison.s1: *** empty log message ***
17832
17833 1993-07-04 Richard Stallman <rms@gnu.org>
17834
17835 * bison.simple: *** empty log message ***
17836
17837 1993-06-26 David J. MacKenzie <djm@gnu.org>
17838
17839 * src/getargs.c: entered into RCS
17840
17841 1993-06-26 David J. MacKenzie <djm@gnu.org>
17842
17843 * doc/bison.texinfo: *** empty log message ***
17844
17845 * doc/bison.1: New file.
17846
17847 1993-06-25 Richard Stallman <rms@gnu.org>
17848
17849 * src/getargs.c: New file.
17850
17851 1993-06-16 Richard Stallman <rms@gnu.org>
17852
17853 * src/bison.s1: *** empty log message ***
17854
17855 1993-06-16 Richard Stallman <rms@gnu.org>
17856
17857 * bison.simple: *** empty log message ***
17858
17859 1993-06-03 Richard Stallman <rms@gnu.org>
17860
17861 * src/bison.s1: New file.
17862
17863 1993-06-03 Richard Stallman <rms@gnu.org>
17864
17865 * doc/bison.texinfo: *** empty log message ***
17866
17867 1993-06-03 Richard Stallman <rms@gnu.org>
17868
17869 * bison.simple: New file.
17870
17871 1993-05-19 Richard Stallman <rms@gnu.org>
17872
17873 * doc/bison.texinfo: New file.
17874
17875 1993-05-07 Noah Friedman <friedman@gnu.org>
17876
17877 * Makefile.in: *** empty log message ***
17878
17879 1993-04-28 Noah Friedman <friedman@gnu.org>
17880
17881 * src/reader.c: *** empty log message ***
17882
17883 1993-04-23 Noah Friedman <friedman@gnu.org>
17884
17885 * src/alloc.h: entered into RCS
17886
17887 1993-04-20 David J. MacKenzie <djm@gnu.org>
17888
17889 * src/version.c: *** empty log message ***
17890
17891 * src/files.c, src/allocate.c:
17892 entered into RCS
17893
17894 * src/reader.c: *** empty log message ***
17895
17896 * src/lex.c: entered into RCS
17897
17898 * src/conflicts.c: New file.
17899
17900 * src/symtab.c: entered into RCS
17901
17902 * src/alloc.h: New file.
17903
17904 * src/LR0.c: entered into RCS
17905
17906 1993-04-18 Noah Friedman <friedman@gnu.org>
17907
17908 * src/reader.c: New file.
17909
17910 * src/version.c: *** empty log message ***
17911
17912 1993-04-18 Noah Friedman <friedman@gnu.org>
17913
17914 * Makefile.in: *** empty log message ***
17915
17916 1993-04-17 Noah Friedman <friedman@gnu.org>
17917
17918 * Makefile.in: *** empty log message ***
17919
17920 1993-04-15 Richard Stallman <rms@gnu.org>
17921
17922 * src/main.c, src/files.c:
17923 New file.
17924
17925 1993-04-15 Noah Friedman <friedman@gnu.org>
17926
17927 * configure.in: entered into RCS
17928
17929 * configure.in: *** empty log message ***
17930
17931 * configure.in: New file.
17932
17933 1993-04-14 Richard Stallman <rms@gnu.org>
17934
17935 * Makefile.in: New file.
17936
17937 1993-04-13 Richard Stallman <rms@gnu.org>
17938
17939 * src/version.c: New file.
17940
17941 1993-03-25 Richard Stallman <rms@gnu.org>
17942
17943 * src/output.c: entered into RCS
17944
17945 1992-09-25 Richard Stallman <rms@gnu.org>
17946
17947 * configure.bat: entered into RCS
17948
17949 1992-06-22 Richard Stallman <rms@gnu.org>
17950
17951 * src/vmsgetargs.c: entered into RCS
17952
17953 1992-06-22 Richard Stallman <rms@gnu.org>
17954
17955 * doc/bison.rnh: entered into RCS
17956
17957 1992-04-20 David J. MacKenzie <djm@gnu.org>
17958
17959 * README: entered into RCS
17960
17961 1992-01-22 Richard Stallman <rms@gnu.org>
17962
17963 * src/machine.h: entered into RCS
17964
17965 1991-12-21 Richard Stallman <rms@gnu.org>
17966
17967 * src/lalr.c, src/closure.c:
17968 entered into RCS
17969
17970 1991-12-20 Richard Stallman <rms@gnu.org>
17971
17972 * src/state.h: entered into RCS
17973
17974 1991-12-18 Richard Stallman <rms@gnu.org>
17975
17976 * src/print.c, src/nullable.c, src/derives.c:
17977 entered into RCS
17978
17979 1991-11-03 David J. MacKenzie <djm@gnu.org>
17980
17981 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17982 entered into RCS
17983
17984 1988-09-09 Richard Stallman <rms@gnu.org>
17985
17986 * src/bison.hairy: entered into RCS
17987
17988 1987-12-16 Richard Stallman <rms@gnu.org>
17989
17990 * REFERENCES: entered into RCS
17991
17992
17993 -----
17994
17995 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
17996 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17997 Software Foundation, Inc.
17998
17999 Copying and distribution of this file, with or without
18000 modification, are permitted provided the copyright notice and this
18001 notice are preserved.
18002
18003 $Id$