]> git.saurik.com Git - bison.git/blob - ChangeLog
Make %push-parser imply %pure-parser. This fixes several bugs; see
[bison.git] / ChangeLog
1 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Make %push-parser imply %pure-parser. This fixes several bugs; see
4 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6 pure_parser = true.
7 * data/push.c: Don't bother testing b4_push_if when deciding whether
8 to expand b4_declare_parser_variables globally.
9 (yypush_parse): Likewise in here.
10
11 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
12 (yy_reduce_print): Reformat M4 for readability.
13
14 2006-12-15 Bob Rossi <bob@brasko.net>
15 and Joel Denny <jdenny@ces.clemson.edu>
16
17 * data/push.c (yypstate): Add typedef, and update all uses of
18 struct yypstate to just yypstate.
19 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
20
21 2006-12-14 Bob Rossi <bob@brasko.net>
22
23 * data/push.c (yypush_parse): Declare prototype regardless of
24 %locations option.
25
26 2006-12-14 Bob Rossi <bob@brasko.net>
27
28 * data/push.c (yyparse): Remove the prototype and the #define when in
29 push-parser mode.
30
31 2006-12-13 Bob Rossi <bob@brasko.net>
32
33 * data/push.c (yypstate_init): Rename to...
34 (yypstate_new): ... this and use b4_c_function_def.
35 (yypstate_delete): New.
36 (yypush_parse): Change parameters yynval and yynlloc to be const.
37 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
38 yypstate_delete functions.
39
40 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
41
42 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
43 strange test case titles. Reported by Bob Rossi.
44
45 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
46
47 * TODO: Add pointer to Sylvain Schmitz's work on static detection
48 of potential ambiguities in GLR grammers.
49
50 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
51
52 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
53 `bison ', use m4_index instead of m4_substr since chopping up a string
54 containing M4-special characters causes problems here.
55
56 Fix a couple of bugs related to special characters in user-specified
57 file names, and make it easier for skeletons to compute output file
58 names with the same file name prefix as Bison-computed output file
59 names.
60 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
61 b4_parser_file_name and b4_spec_defines_file instead of
62 @output_parser_name@ and @output_header_name@, which are now redundant.
63 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
64 b4_parser_file_name, b4_spec_defines_file, and the new
65 @basename(FILENAME@) instead of @output_parser_name@ and
66 @output_header_name@, which inappropriately escaped the file names as
67 C string literals.
68 * src/files.c (all_but_ext): Remove static qualifier.
69 (compute_output_file_names): Move `free (all_but_ext)' to...
70 (output_file_names_free): ... here since all_but_ext is needed later.
71 * src/files.h (all_but_ext): Extern.
72 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
73 exactly what MUSCLE_INSERT_STRING used to do.
74 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
75 characters are escaped properly.
76 * src/output.c (prepare): Define muscle file_name_all_but_ext as
77 all_but_ext.
78 For pkgdatadir muscle, maintain previous functionality by using
79 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
80 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
81 digraphs would never be expanded. Hopefully no one has M4-special
82 characters in his Bison installation path.
83 * src/scan-skel.l: Don't parse @output_header_name@ and
84 @output_parser_name@ anymore since they're now redundant.
85 In @output, use decode_at_digraphs.
86 Parse a new @basename command that invokes last_component.
87 (decode_at_digraphs): New.
88 (BASE_QPUTS): Remove unused.
89 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
90 (Output file name): New tests.
91
92 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
93
94 Warn about output files that are generated by the skeletons and that
95 conflict with other output files.
96 * data/glr.c: Don't generate the header file here when glr.cc does.
97 * src/files.c (file_names, file_names_count): New static globals.
98 (compute_output_file_names): Invoke output_file_name_check for files
99 not generated by the skeletons and remove existing checks.
100 (output_file_name_check): New function that warns about conflicting
101 output file names.
102 (output_file_names_free): Free file_names.
103 * src/files.h (output_file_name_check): Declare.
104 * src/scan-skel.l: Invoke output_file_name_check for files generated by
105 the skeletons.
106 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
107 (Conflicting output files): New tests.
108
109 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
110
111 * doc/bison.texinfo: Fix a couple of typos.
112
113 2006-12-08 Bob Rossi <bob@brasko.net>
114
115 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
116 Rename to...
117 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
118 update all uses.
119 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
120 (yypush_parse): Rename yypvars argument to yyps and remove redundant
121 local pv.
122 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
123 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
124
125 2006-12-07 Bob Rossi <bob@brasko.net>
126 and Joel Denny <jdenny@ces.clemson.edu>
127
128 * data/push.c (yypvarsinit): Change return type from void* to struct
129 yypvars*. No longer cast to void* on return.
130 (struct yypvars): Remove yylen since it need not be remembered between
131 yypushparse invocations.
132 (yypushparse): Don't copy between yylen and pv->yylen.
133
134 2006-12-05 Bob Rossi <bob@brasko.net>
135
136 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
137 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
138 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
139 (struct yypvars): Remove b4_declare_parser_variables.
140 (yypvarsinit): Remove init code for removed variables.
141 (global scope): Do not declare b4_declare_parser_variables if
142 push or pure mode.
143 (yypushparse): Add b4_declare_parser_variables.
144 Init new local variables, and remove init code for removed
145 yypvars variables.
146 (yyparse): Delete.
147 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
148 and yyparse for other modes.
149 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
150 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
151 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
152 (AT_PURE_LEX_IF): True if pure or push parser.
153
154 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
155
156 Document Yacc prologue alternatives and default %destructor's and
157 %printer's as experimental. Don't mention Java yet. Discussed at
158 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
159 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
160 (2.3a): Annotate this entry to say the old forms of these features were
161 also experimental.
162 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
163 Bison Symbols): Say they're experimental. Comment out any mention
164 of Java (we'll want this back eventually).
165
166 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
167
168 Support a file name argument to %defines. Deprecate `=' in
169 %file-prefix, %name-prefix, and %output. Discussed at
170 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
171 * NEWS (2.3a+): Mention.
172 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
173 form of %defines, and remove `=' from entries for %file-prefix,
174 %name-prefix, and %output.
175 * src/parse-gram.y (prologue_declaration): Implement.
176 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
177 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
178 all but one occurrence of %name-prefix.
179 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
180 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
181 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
182 occurrence of each of %file-prefix and %output. Add check for %defines
183 with argument.
184 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
185 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
186 Remove the `=' from %output.
187
188 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
189
190 Don't escape $ in test case titles since Autoconf 2.61 now does that
191 correctly.
192 * tests/actions.at (Default %printer and %destructor are not for error
193 or $undefined): Here.
194 (Default %printer and %destructor are not for $accept): Here.
195 * tests/input.at (Invalid $n and @n): Here.
196
197 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
198
199 Rename <!> to <>. Discussed starting at
200 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
201 * NEWS (2.3a+): Update.
202 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
203 Update.
204 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
205 * src/scan-gram.l (INITIAL): Implement.
206 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
207 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
208 comment.
209 * tests/actions.at (Default tagless %printer and %destructor,
210 Default tagged and per-type %printer and %destructor,
211 Default %printer and %destructor are not for error or $undefined,
212 Default %printer and %destructor are not for $accept,
213 Default %printer and %destructor for mid-rule values): Update.
214 * tests/input.at (Default %printer and %destructor redeclared,
215 Unused values with default %destructor): Update.
216
217 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
218
219 Don't let %prec take a nonterminal.
220 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
221 token.
222 * tests/input.at (%prec takes a token): New test checking that %prec
223 won't take a nonterminal.
224
225 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
226
227 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
228 it was double-quoted.
229 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
230 grammar is maintained with Bison's highest standards.
231 * src/getargs.c: Fix some typos in Doxygen comments.
232
233 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
234
235 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
236 later. Reported by Paul Eggert in
237 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
238 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
239 * src/scan-code.l (translate_action): Don't bother invoking
240 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
241 (code_scanner_free): Instead of invoking
242 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
243 which frees more.
244 * src/scan-gram.l (gram_scanner_free): Likewise.
245 * src/scan-skel.l (scan_skel): Likewise.
246
247 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
248
249 * src/files.c (tr): Change return type to void.
250 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
251 has been called previously for the same key.
252 (muscle_find): Return storage instead of value so that
253 --enable-gcc-warnings doesn't produce warnings that the return discards
254 const. aver that the value and storage are the same since storage
255 could potentially be NULL when value is not.
256 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
257 same as 0.
258
259 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
260
261 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
262 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
263 us a slightly cleaner distribution, and also works.
264 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
265 gnulib changes.
266
267 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
268 and Paul Eggert <eggert@cs.ucla.edu>
269
270 Don't let Bison leak memory except when it complains.
271 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
272 (spec_defines_file, dir_prefix): Now char *, not const char *,
273 since they are freed.
274 * src/files.c: Likewise.
275 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
276 Likewise.
277 (tr): Now operates in-place. All uses changed.
278 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
279 values.
280 (compute_file_name_parts, compute_output_file_names): Don't store
281 read-only data in variables that will be freed.
282 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
283 src_extension, and header_extension.
284 (output_file_names_free): New public function to free
285 spec_verbose_file, spec_graph_file, spec_defines_file,
286 parser_file_name, and dir_prefix.
287 * src/getargs.c (getargs): Don't store read-only data in variables that
288 will be freed.
289 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
290 (which previously existed but was unused), and quotearg_free.
291 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
292 * src/muscle_tab.c: Likewise.
293 (muscle_entry): Make the value char const *,
294 and add a new storage member that is char * and can be freed.
295 (muscle_entry_free): New private function.
296 (muscle_init): Use it instead of free.
297 (muscle_insert, muscle_grow): Update and use new storage member.
298 (muscle_code_grow): Free the string passed to muscle_grow
299 since it's not needed anymore.
300 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
301 add a new `char *code' member.
302 ("{...}"): Declare semantic type as code.
303 * src/scan-code.h (translate_rule_action):
304 (translate_symbol_action, translate_code, translate_action): Return
305 `char const *' rather than `char *' since external code should not free
306 these strings.
307 * src/scan-code.l: Likewise.
308 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
309 which is "{...}" in the parser.
310 * tests/Makefile.am (maintainer-check-valgrind): Set
311 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
312 Valgrind.
313 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
314 complain.
315 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
316 expecting a non-zero exit status sets --leak-check=summary and
317 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
318 this case, and we don't want to hear about it.
319
320 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
321
322 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
323 instead of from the template, to simplify configuration a bit.
324 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
325 and m4/wint_t.m4, as they are needed with the latest gnulib.
326
327 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
328
329 Disable unset/unused mid-rule value warnings by default, and recognize
330 --warnings=midrule-values to enable them. Discussed starting at
331 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
332 * NEWS (2.3a+): Mention.
333 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
334 warnings): Add entry for midrule-values subargument.
335 * src/reader.c (symbol_should_be_used): Don't return true just because
336 the value is a set/used mid-rule value unless
337 --warnings=midrule-values was specified.
338 * tests/input.at (Unused values, Unused values before symbol
339 declarations): Run tests with and without --warnings=midrule-values.
340
341 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
342 than LIST_FREE directly.
343
344 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
345
346 Finish implementing --warnings=error, which should not be implied by
347 --warnings=all (or by its synonyms -W and --warnings without
348 subarguments).
349 * src/complain.c (set_warning_issued): New function to report that
350 warnings are being treated as errors and to record an error if so.
351 Invoke...
352 (warn_at, warn): ... here.
353 * src/getargs.c (warnings_args, warnings_types): Reorder so that
354 "error - warnings are errors" does not appear above "all - all of the
355 above".
356 (getargs): For -W and --warnings without subarguments, don't let
357 FLAGS_ARGMATCH set warnings_error in warnings_flag.
358 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
359
360 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
361
362 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
363 empty subargument list. For example: `bison --warnings= parser.y'.
364
365 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
366
367 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
368 the parser header file so that gcc doesn't warn.
369
370 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
371
372 Split the default %destructor/%printer into two kinds: <*> and <!>.
373 Discussed starting at
374 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
375 * NEWS (2.3a+): Mention.
376 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
377 previous change today related to mid-rules.
378 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
379 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
380 (TYPE_TAG_ANY): Add as <*>.
381 (TYPE_TAG_NONE): Add as <!>.
382 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
383 for <*> and <!>.
384 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
385 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
386 * src/symlist.c (symbol_list_default_new): Split into tagged and
387 tagless versions.
388 (symbol_list_destructor_set, symbol_list_printer_set): Split
389 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
390 SYMLIST_DEFAULT_TAGLESS.
391 * src/symlist.h: Update symbol_list_default*_new prototypes.
392 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
393 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
394 * src/symtab.c (default_destructor, default_destructor_location,
395 default_printer, default_printer_location): Split each into tagged and
396 tagless versions.
397 (symbol_destructor_get, symbol_destructor_location_get,
398 symbol_printer_get, symbol_printer_location_get): Implement tagged
399 default and tagless default cases.
400 (default_destructor_set, default_printer_set): Split each into tagged
401 and tagless versions.
402 * src/symtab.h: Update prototypes.
403 * tests/actions.at (Default %printer and %destructor): Rename to...
404 (Default tagless %printer and %destructor): ... this, and extend.
405 (Per-type %printer and %destructor): Rename to...
406 (Default tagged and per-type %printer and %destructor): ... this, and
407 extend.
408 (Default %printer and %destructor for user-defined end token): Extend.
409 (Default %printer and %destructor are not for error or $undefined):
410 Update.
411 (Default %printer and %destructor are not for $accept): Update.
412 (Default %printer and %destructor for mid-rule values): Extend.
413 * tests/input.at (Default %printer and %destructor redeclared): Extend.
414 (Unused values with default %destructor): Extend.
415
416 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
417
418 Don't apply the default %destructor/%printer to an unreferenced midrule
419 value. Mentioned at
420 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
421 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
422 like $@n instead of just @n so that the default %destructor/%printer
423 logic doesn't see them as user-defined symbols.
424 (symbol_is_dummy): Check for both forms of the name.
425 * src/reader.c (packgram): Remove the `$' from each midrule symbol
426 name for which the midrule value is referenced in any action.
427 * tests/actions.at (Default %printer and %destructor for mid-rule
428 values): New test.
429 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
430 for change to dummy symbol names.
431
432 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
433
434 Warn about unset midrule $$ if the corresponding $n is used.
435 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
436 $n usage.
437 (packgram): Before invoking grammar_rule_check on any rule, make sure
438 all actions have already been scanned in order to set `used' flags.
439 Otherwise, checking that a midrule's $$ is set will not always work
440 properly because the midrule check must forward-reference the midrule's
441 parent rule.
442 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
443 warning.
444
445 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
446
447 More improvements to the documentation of the prologue alternatives:
448 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
449 Bison manual.
450 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
451 some text to clarify the relative importance of the new directives and
452 to show how these directives may be viewed as code labels.
453
454 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
455
456 Similar to the recently removed %before-header, add %code-top as the
457 alternative to the pre-prologue. Mentioned at
458 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
459 Also, let the prologue alternatives appear in the grammar section.
460 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
461 (prologue_declaration): Move the existing prologue alternatives to...
462 (grammar_declaration): ... here and add %code-top.
463 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
464
465 Clean up and extend documentation for the prologue alternatives.
466 * NEWS (2.3a+): Describe prologue alternatives.
467 * doc/bison.texinfo (Prologue): Move discussion of prologue
468 alternatives to...
469 (Prologue Alternatives): ... this new section, and extend it to discuss
470 all 4 directives in detail.
471 (Bison Symbols): Clean up discussion of prologue alternatives and add
472 %code-top.
473
474 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
475
476 DJGPP specific issues.
477
478 * djgpp/config.bat: config.hin has been moved to lib. Adjust
479 config.bat accordingly.
480 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
481 * djgpp/config.site: Likewise.
482
483 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
484
485 Replace %*-header with %provides, %requires, %code. See discussion at
486 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
487
488 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
489 (b4_user_start_header): Remove.
490 * data/glr.c: Use new macros instead of b4_*start_header
491 and b4_*end_header.
492 * data/glr.cc: Likewise.
493 * data/lalr1.cc: Likewise.
494 * data/push.c: Likewise.
495 * data/yacc.c: Likewise.
496
497 * doc/bison.texinfo: Remove %before-header, rename
498 %{start,end,after}-header to %requires, %provides, %code.
499
500 * src/parse-gram.y: Likewise (also rename token names accordingly).
501 * src/scan-gram.l: Likewise.
502 * tests/actions.at: Likewise.
503
504 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
505
506 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
507 Problem reported by Joel E. Denny.
508
509 2006-10-14 Jim Meyering <jim@meyering.net>
510
511 (Sync from coreutils.)
512 Work also when the working directory (with e.g. coreutils sources)
513 is version controlled with git, rather than CVS.
514 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
515 rather than CVS.
516 In messages and comments, say e.g., "checked-out sources",
517 rather than "CVS sources".
518 (version_controlled_file): New function. Work for git as well as
519 for CVS. Don't use grep's -q option.
520 (slurp): Call it here, in place of CVS-specific code.
521
522 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
523
524 Fix testsuite for ./configure --enable-gcc-warnings:
525 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
526 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
527 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
528 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
529 * test/regression.at (Diagnostic that expects two alternatives):
530 Likewise.
531
532 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
533
534 * bootstrap.conf (gnulib_modules): Add config-h.
535 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
536 worry about HAVE_CONFIG_H.
537 * lib/abitset.c: Likewise.
538 * lib/bitset.c: Likewise.
539 * lib/bitset_stats.c: Likewise.
540 * lib/bitsetv-print.c: Likewise.
541 * lib/bitsetv.c: Likewise.
542 * lib/ebitset.c: Likewise.
543 * lib/get-errno.c: Likewise.
544 * lib/lbitset.c: Likewise.
545 * lib/subpipe.c: Likewise.
546 * lib/timevar.c: Likewise.
547 * lib/vbitset.c: Likewise.
548 * lib/bitset.c: Include "bitset.h" first, to test interface.
549 * lib/bitset_stats.c: Include "bitset_stats.h" first.
550 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
551 * lib/bitsetv.c: Include "bitsetv.h" first.
552 * lib/get-errno.c: Include "get-errno.h" first.
553 * m4/.cvsignore: Add config-h.m4.
554 * tests/actions.at (Default %printer and %destructor for ...):
555 Adjust expected line numbers in output to reflect removal of #if
556 HAVE_CONFIG_H lines.
557 * tests/glr-regression.at (Missed %merge type warnings when ...):
558 Likewise.
559 * tests/regression.at (Braced code in declaration in rules section):
560 Likewise.
561 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
562 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
563 Include <config.h> unconditionally.
564
565 * bootstrap: Sync from coreutils, as follows:
566
567 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
568
569 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
570 variable was sometimes used without being initialized. This
571 messed up the installation of the INSTALL file in some cases.
572
573 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
574
575 * bootstrap (usage, main program, symlink_to_gnulib): Add option
576 --copy. Inspired by a suggestion from Bruno Haible.
577
578 2006-10-03 Jim Meyering <jim@meyering.net>
579
580 * bootstrap: Undo last change to this file, since now gnulib-tool
581 sticks with the automake default in generating dependencies.
582
583 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
584
585 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
586 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
587
588 * doc/bison.1: Add copyright notice.
589
590 * data/glr.c: Don't include <stdarg.h>; not used.
591
592 * NEWS: The -g and --graph options now output graphs in Graphviz
593 DOT format, not VCG format.
594 * doc/bison.1: Likewise.
595 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
596 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
597 of this change in
598 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
599 * TODO: Remove Graphviz entry.
600 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
601 remove vcg.c, vcg.h, vcg_defaults.h.
602 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
603 * src/graphviz.c, src/graphviz.h: New files.
604 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
605 * src/files.h: Make comment more generic.
606 * src/main.c (main): Likewise.
607 * src/print_graph.h: Likewise.
608 * src/getargs.c (usage): Make usage description more generic.
609 * src/print_graph.c: Include graphviz.h rather than vcg.h.
610 (static_graph, fgraph): Remove. All uses changed to pass
611 arguments instead of sharing a static var.
612 (print_core, print_actions, print_state, print_graph):
613 Output graphviz format rather than VCG format.
614 * tests/.cvsignore: Remove *.vcg; add *.dot.
615 * tests/output.at: Expect *.dot files, not *.vcg files.
616
617 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
618 accommodates the 2006-10-08 change.
619
620 2006-10-11 Bob Rossi <bob@brasko.net>
621
622 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
623 (b4_yyssa, b4_yyerror_range): New macros.
624 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
625 (yypvarsinit): Remove init of removed fields.
626 (yypushparse): Remove use of removed fields; use new macros instead.
627
628 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
629
630 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
631 in a push parser. Reindent slightly to match yacc.c better.
632
633 2006-10-11 Bob Rossi <bob@brasko.net>
634
635 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
636 yymsg_alloc fields.
637 (yypvarsinit, yypushparse): Remove init of removed fields.
638 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
639
640 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
641
642 * THANKS: Add Paolo Bonzini and Bob Rossi.
643
644 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
645
646 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
647 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
648 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
649 b4_define_user_cde and uses): Remove.
650 (b4_comment, b4_prefix, b4_sync_start): New.
651 * data/bison.m4: New file, with most of the content removed from c.m4.
652 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
653 * src/output.c (output_skeleton): Pass bison.m4.
654 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
655 only if specified.
656
657 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
658
659 Fix test failure reported by Tom Lane in
660 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
661 and try to make such failures easier to catch in the future.
662 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
663 that's now the caller's responsibility.
664 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
665 Set yychar = YYEOF if it's negative.
666 * tests/actions.at (yylex): Abort if asked to read past EOF.
667 * tests/conflicts.at (yylex): Likewise.
668 * tests/cxx-type.at (yylex): Likewise.
669 * tests/glr-regression.at (yylex): Likewise.
670 * tests/input.at (yylex): Likewise.
671 * tests/regression.at (yylex): Likewise.
672 * tests/torture.at (yylex): Likewise.
673
674 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
675
676 Fix problems with translating English-language diagnostics.
677 * bootstrap: Fix bug introduced in recent bootstrap changes, with
678 respect to bison-runtime pot generation. The YY_ stuff
679 wasn't being captured.
680 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
681 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
682 * runtime-po/POTFILES.in: Add data/push.c.
683
684 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
685
686 Merge bootstrap changes from coreutils.
687
688 2006-09-28 Jim Meyering <jim@meyering.net>
689
690 Automatically generated dependencies are important even
691 when all of the sources in a directory come from gnulib.
692 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
693 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
694
695 2006-09-23 Jim Meyering <jim@meyering.net>
696
697 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
698
699 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
700
701 * bootstrap: Add support for --force.
702 (usage): New function. Describe usage less tersely.
703 (CVS_only_file): New var.
704
705 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
706
707 * data/push.c (YYPUSH_MORE): Make it an enum instead.
708 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
709 Adjust white space and comments to match GNU style better.
710
711 2006-09-20 Bob Rossi <bob@brasko.net>
712
713 * data/push.c (yyresult_get): Remove function.
714 (YYPUSH_MORE): Add #define.
715 (yypushparse): Modify return value.
716
717 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
718
719 * stamp-h.in: Remove; no longer needed.
720 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
721 Remove config.h, config.hin, intl (no longer created).
722 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
723 stamp-h1.
724
725 Sync bootstrap from coreutils, as follows:
726
727 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
728
729 * bootstrap (symlink_to_gnulib): New function.
730 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
731 to copies-of-gnulib.
732 (cp_mark_as_generated, slurp, gnulib_files):
733 Avoid making a copy if it's the same as the old version.
734 (gnulib_files): Add support for this variable (used by Bison).
735
736 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
737
738 * src/getargs.c (usage): Rework to use conventions similar to
739 coreutils, to make translation a bit easier and the code a bit
740 smaller. Problem reported by Tim Van Holder.
741
742 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
743
744 Use some of gnulib's new modules, taken from coreutils.
745
746 * bootstrap: Sync from coreutils, except add support for gnulib_files.
747 * bootstrap.conf: New file.
748 (gnulib_modules): Add configmake, inttypes, unistd.
749 (XGETTEXT_OPTIONS): Add complain, complain_at,
750 fatal, fatal_at, warn, warn_at, unexpected_end.
751 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
752 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
753 (gl_EARLY): Add.
754 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
755 (gl_INIT): Add
756 (GNULIB_AUTOCONF_SNIPPET): Remove.
757 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
758 the pickiest.
759 * lib/.cvsignore: Add inttypes_.h.
760 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
761 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
762 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
763 no-longer-necessary initializations.
764 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
765 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
766 use the unistd module.
767 * src/system.h: Likewise.
768 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
769 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
770 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
771 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
772 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
773 * src/system.h: Include inttypes.h unconditionally, now that we
774 use the inttypes module. Don't bother to include stdint.h, since
775 inttypes.h now does that for us.
776 (LOCALEDIR): Remove, now that we use the configmake module.
777 * src/getargs.c: Include configmake.h.
778 * src/main.c: Likewise.
779 * src/output.c: Likewise.
780 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
781 not from $abs_top_builddir, since config.h moved.
782
783
784 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
785 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
786
787 * src/parse-gram.y (symbol_declaration): Don't put statements
788 before declarations; it's not portable to C89.
789 * src/scan-code.l (handle_action_at): Likewise.
790
791 * src/scan-code.l: Always initialize braces_level; the old code
792 left it uninitialized and therefore had undefined behavior.
793
794 Don't attempt to redefine 'assert', since it runs afoul of
795 systems where standard headers (mistakenly) include <assert.h>.
796 Instead, define and use our own alternative, called 'aver'.
797 * src/reader.c: Don't include assert.h, since we no longer
798 use assert.
799 * src/scan-code.l: Likewise.
800 * src/system.h (assert): Remove, replacing with....
801 (aver): New function, taking a bool arg. All uses changed.
802 * src/tables.c (pack_vector): Ensure that aver arg is bool,
803 not merely an integer.
804
805 2006-09-15 Bob Rossi <bob@brasko.net>
806
807 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
808 * data/c.m4 (YYPUSH): New.
809 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
810 * src/getargs.c (push_parser): New var.
811 * src/getargs.h (push_parser): New declaration.
812 * src/output.c (prepare): Add macro insertion of `push_flag'.
813 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
814 (prologue_declaration): Parse %push-parser.
815 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
816 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
817 list of removed lines from the traces observed.
818 (AT_CHECK_CALC_LALR): Added push parser tests.
819
820 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
821
822 * NEWS: Version 2.3a.
823 * configure.ac (AC_INIT): Likewise.
824
825 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
826 "#define YYSTYPE int" that caused "make maintainer-check" to fail
827 due to header ordering dependencies. I don't know why the #define
828 was there.
829
830 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
831 runtime cost when YYDEBUG is not defined, and so that some tests
832 that used to fail now work. Problem and initial suggestion by
833 Paolo Bonzini.
834 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
835 * data/glr.cc (b4_parser_class_name):
836 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
837 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
838 (yydebug_) [YYDEBUG]: New member.
839 (yycdebug_): Now defined only if YYDEBUG.
840 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
841 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
842 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
843 if YYYDEBUG.
844 (debug_stream, set_debug_stream, debug_level, set_debug_level):
845 Define only if YYDEBUG.
846 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
847 set_debug_level.
848 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
849 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
850 AT_CHECK_CALC_GLR_CC that are working now.
851
852 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
853
854 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
855 We don't need them in glr.cc, and glr.c defines them.
856 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
857 assumes that defining it to anything is the same as defining
858 it to 1. Problem reported by Paolo Bonzini.
859
860 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
861
862 * data/c.m4 (b4_null, b4_case): Define.
863 * src/output.c (prepare_symbols): Use b4_null.
864 (user_actions_output): Use b4_case.
865
866 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
867
868 * data/glr.c (b4_shared_declarations): Put start-header first,
869 before any #includes that we generate, so that feature-test
870 macros work. Problem reported by Michael Deutschmann in
871 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
872 * data/lalr1.cc: Likewise.
873 * doc/bison.texinfo (Prologue): Document that feature-test macros
874 should be defined before any Bison declarations.
875 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
876 that depend on location.hh after, not before, Bison decls, since
877 we now include location.hh after the first user prologue.
878
879 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
880 Sander Brandenburg in
881 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
882 Also, fix minor white space and comment issues.
883 (Prologue): Mention that it's better to define feature-test macros
884 before Bison declarations. Problem reported by Michael Deutschmann.
885
886 * README-cvs: Fix typo: "&" should be "&&". Problem reported
887 by Jim Meyering.
888 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
889 This adjusts to recent gnulib changes.
890
891 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
892
893 Finish implementation of per-type %destructor/%printer. Discussed
894 starting at
895 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
896 and
897 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
898 * NEWS (2.3+): Add a description of this feature to the default
899 %destructor/%printer description.
900 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
901 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
902 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
903 list node contains a semantic type.
904 * src/symtab.c, src/symtab.h: Extend with a table that associates
905 semantic types with their %destructor's and %printer's.
906 (semantic_type_from_uniqstr, semantic_type_get,
907 semantic_type_destructor_set, semantic_type_printer_set): New functions
908 composing the public interface of that table.
909 (symbol_destructor_get, symbol_destructor_location_get,
910 symbol_printer_get, symbol_printer_location_get): If there's no
911 per-symbol %destructor/%printer, look up the per-type before trying
912 the default.
913 * tests/actions.at (Per-type %printer and %destructor): New test case.
914 * tests/input.at (Default %printer and %destructor redeclared):
915 Extend to check that multiple occurrences of %symbol-default in a
916 single %destructor/%printer declaration is an error.
917 (Per-type %printer and %destructor redeclared, Unused values with
918 per-type %destructor): New test cases.
919
920 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
921
922 Require default %destructor/%printer to be declared using
923 %symbol-default instead of an empty symbol list, and start working on
924 new per-type %destructor/%printer. Discussed at
925 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
926 * NEWS (2.3+): Add %symbol-default to example.
927 * bison.texinfo (Freeing Discarded Symbols): Likewise.
928 (Bison Symbols): Add entry for %symbol-default.
929 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
930 (generic_symlist, generic_symlist_item): New nonterminals for creating
931 a list in which each item is a symbol, semantic type, or
932 %symbol-default.
933 (grammar_declaration): Use generic_symlist in %destructor and %printer
934 declarations instead of symbols.1 or an empty list.
935 (symbol_declaration, precedence_declaration, symbols.1): Update actions
936 for changes to symbol_list.
937 * src/reader.c: Update for changes to symbol_list.
938 * src/scan-code.l: Likewise.
939 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
940 * src/symlist.c, src/symlist.h: Extend such that a list node may
941 represent a semantic type or a %symbol-default in addition to just an
942 ordinary symbol. Add switched functions for setting %destructor's and
943 %printer's.
944 * tests/actions.at, tests/input.at: Add %symbol-default to all default
945 %destructor/%printer declarations.
946
947 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
948
949 Whether the default %destructor/%printer applies to a particular symbol
950 isn't a question of whether the user *declares* that symbol (in %token,
951 for example). It's a question of whether the user by any means
952 *defines* the symbol at all (by simply using a char token, for
953 example). $end is defined by Bison whereas any other token with token
954 number 0 is defined by the user. The error token is always defined by
955 Bison regardless of whether the user declares it with %token, but we
956 may one day let the user define error as a nonterminal instead.
957 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
958 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
959 the meaning of "user-defined".
960 * tests/actions.at (Default %printer and %destructor for user-declared
961 end token): Rename to...
962 (Default %printer and %destructor for user-defined end token): ...
963 this.
964
965 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
966 computation of whether to apply the default, don't maintain a list of
967 every Bison-defined symbol. Instead, just check for a first character
968 of '$', which a user symbol cannot have, and check for the error token.
969
970 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
971
972 Don't apply the default %destructor or %printer to the error token,
973 $undefined, or $accept. This change fits the general rule that the
974 default %destructor and %printer are only for user-declared symbols,
975 and it solves several difficulties that are described in the new test
976 cases listed below.
977 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
978 * tests/actions.at (Default %printer and %destructor are not for error
979 or $undefined, Default %printer and %destructor are not for $accept):
980 New test cases.
981
982 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
983
984 Allow %start after the first rule.
985 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
986 when parsing the first rule.
987 (check_and_convert_grammar): Search for it here after all grammar
988 declarations have been parsed. Skip midrules, which have dummy LHS
989 nonterminals.
990 * src/symtab.c (symbol_is_dummy): New function.
991 * src/symtab.h (symbol_is_dummy): Declare it.
992 * tests/input.at (%start after first rule): New test.
993
994 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
995
996 Redo some of the previous commit: add back the ability to use
997 non-aliased/undeclared string literals since it might be useful to
998 those declaring %token-table.
999 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1000 commit: don't worry about complaints from symbols_pack.
1001 * src/symtab.c (symbol_new, symbol_class_set,
1002 symbol_check_alias_consistency): Undo changes in previous commit: count
1003 each string literal as a new symbol and token, assign it a symbol
1004 number, and don't complain about non-aliased string literals.
1005 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1006 and token counts but does still set aliased tokens to the same number,
1007 symbol_pack_processor now leaves empty slots in the symbols array.
1008 Remove those slots.
1009 * tests/regression.at (Undeclared string literal): Remove test case
1010 added in previous commit since non-aliased string literals are allowed
1011 again.
1012 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1013 remove unnecessary string literal declarations.
1014 * tests/sets.at (Firsts): Likewise.
1015
1016 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1017
1018 Don't allow an undeclared string literal, but allow a string literal to
1019 be used before its declaration.
1020 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1021 symbols_pack complained.
1022 * src/symtab.c (symbol_new): Don't count a string literal as a new
1023 symbol.
1024 (symbol_class_set): Don't count a string literal as a new token, and
1025 don't assign it a symbol number since symbol_make_alias does that.
1026 (symbol_make_alias): It's not necessary to decrement the symbol and
1027 token counts anymore. Don't assume that an alias declaration occurs
1028 before any uses of the identifier or string, and thus don't assert that
1029 one of them has the highest symbol number so far.
1030 (symbol_check_alias_consistency): Complain if there's a string literal
1031 that wasn't declared as an alias.
1032 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1033 symbol_pack asserts that every token has been assigned a symbol number
1034 although undeclared string literals have not.
1035 * tests/regression.at (String alias declared after use, Undeclared
1036 string literal): New test cases.
1037 (Characters Escapes, Web2c Actions): Declare string literals as
1038 aliases.
1039 * tests/sets.at (Firsts): Likewise.
1040
1041 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1042
1043 In the grammar scanner, STRING_FINISH unclosed constructs and return
1044 them to the parser in order to improve error messages.
1045 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1046 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1047 * tests/input.at (Unclosed constructs): New test case.
1048 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1049 seen.
1050
1051 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1052 unused global.
1053
1054 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1055
1056 Handle string aliases for character tokens correctly.
1057 * src/symtab.c (symbol_user_token_number_set): If the token has an
1058 alias, check and set its alias's user token number instead of its own,
1059 which is set to indicate the alias. Previously, every occurrence of
1060 the character token in the grammar overwrote that alias indicator with
1061 the character code.
1062 * tests/input.at (String aliases for character tokens): New test.
1063
1064 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1065
1066 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1067
1068 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1069
1070 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1071 to prevent failures when building on older platforms.
1072 Check for autopoint failure.
1073 Set XGETTEXT_OPTIONS to values that check for C format strings,
1074 so that translators are warned about them (this also helps
1075 prevent core dumps).
1076
1077 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1078 function, since it simplifies our code a bit.
1079
1080 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1081 rather than -W, so we don't get bogus warnings about sign comparisons.
1082 Add -Wpointer-arith, since that warning is useful (it reports code
1083 that does not conform to C89 and that some compilers reject).
1084 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1085 since it's no longer needed.
1086
1087 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1088
1089 Clean up scanners a bit.
1090 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1091 definitions so gcc won't warn when obstack_for_string is unused.
1092 * src/scan-code.l: config.h and system.h are already #include'd by
1093 scan-code-c.c, so get rid of them here.
1094 * src/scan-gram.l: Likewise.
1095 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1096 definitions rather than duplicating the rest of it.
1097 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1098
1099 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1100
1101 Suppress signed/unsigned comparison warnings for yycheck.
1102 * data/c.m4 (b4_safest_int_type): New macro.
1103 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1104 a signed int type, cast it to b4_safest_int_type first.
1105 * data/yacc.c: Likewise.
1106 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1107 also overwritten.
1108
1109 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1110
1111 * doc/bison.texinfo: Fix some typos.
1112
1113 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1114
1115 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1116 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1117
1118 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1119 the latest gnulib does this a different way.
1120 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1121 translation was patched, so stop omitting it.
1122
1123 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1124
1125 Enable declaration of default %printer/%destructor. Make the parser
1126 use these for all user-declared grammar symbols for which the user does
1127 not declare a specific %printer/%destructor. Thus, the parser uses it
1128 for token 0 if the user declares it but not if Bison generates it as
1129 $end. Discussed starting at
1130 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1131 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1132 and
1133 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1134 * NEWS (2.3+): Mention.
1135 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1136 declare a %destructor for a mid-rule's semantic value. It's just
1137 impossible to declare one specific to it.
1138 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1139 code. Describe default %destructor form.
1140 * src/parse-gram.y (grammar_declaration): Parse default
1141 %printer/%destructor declarations.
1142 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1143 and symbol_destructor_location_get rather than accessing the destructor
1144 and destructor_location members of struct symbol.
1145 (symbol_printers_output): Likewise but for %printer's.
1146 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1147 again.
1148 * src/symtab.c (default_destructor, default_destructor_location,
1149 default_printer, default_printer_location): New static global
1150 variables to record the default %destructor and %printer.
1151 (symbol_destructor_get, symbol_destructor_location_get,
1152 symbol_printer_get, symbol_printer_location_get): New functions to
1153 compute the appropriate %destructor and %printer for a symbol.
1154 (default_destructor_set, default_printer_set): New functions to set the
1155 default %destructor and %printer.
1156 * src/symtab.h: Prototype all those new functions.
1157 * tests/actions.at (Default %printer and %destructor): New test to
1158 check that the right %printer and %destructor are called, that they're
1159 not called for $end, and that $$ and @$ work correctly.
1160 (Default %printer and %destructor for user-declared end token): New
1161 test to check that the default %printer and %destructor are called for
1162 a user-declared end token.
1163 * tests/input.at (Default %printer and %destructor redeclared, Unused
1164 values with default %destructor): New tests to check related grammar
1165 warnings and errors.
1166
1167 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1168
1169 Clean up handling of %destructor for the end token (token 0).
1170 Discussed starting at
1171 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1172 and
1173 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1174
1175 Make the skeletons consistent in how they pop the end token and invoke
1176 its %destructor.
1177 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1178 state, which has token number 0, since this would invoke the
1179 %destructor for the end token.
1180 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1181 until after shifting the end token, or else it won't be popped.
1182 * data/yacc.c (yyparse): Likewise.
1183
1184 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1185 it's the end token. Upon termination, destroy an unshifted lookahead
1186 even when it's the end token.
1187 * data/lalr1.cc (yy::parser::parse): Likewise.
1188 * data/yacc.c (yyparse): Likewise.
1189
1190 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1191 value warnings for the end token when the user gives the end token a
1192 %destructor.
1193
1194 * tests/actions.at (Printers and Destructors): Test all the above.
1195
1196 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1197
1198 Update to latest gnulib and gettext versions.
1199 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1200 Add fopen-safer.
1201 (gnulib_files): Add m4/warning.m4. Don't worry about files
1202 overwritten by autopoint.
1203 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1204 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1205 rejects them.
1206 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1207 so that we can remove the intl files at a better time.
1208 (intl_files_to_remove): Remove aclocal.m4, since it gets
1209 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1210 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1211 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1212 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1213 Remove datarootdir hack; no longer needed.
1214 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1215 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1216 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1217 strdup.h.
1218 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1219 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1220
1221 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1222
1223 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1224 it with --assume-autoconf='latest-stable'.
1225
1226 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1227
1228 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1229 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1230 YYSTYPE' and `{'.
1231 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1232 those from muscle_tab.c since the old ones are misleading.
1233
1234 2006-07-13 Akim Demaille <akim@epita.fr>
1235
1236 Support %define "KEY" {VALUE}.
1237 * src/scan-code.h, src/scan-code.l (translate_action)
1238 (translate_rule_action, translate_symbol_action, translate_code):
1239 Return char *, not const char *.
1240 * src/parse-gram.y (declaration): Rename as...
1241 (prologue_declaration): this.
1242 (string_content): Remove this nonterminal, use STRING.
1243 (braceless, content, content.opt): New nonterminal.
1244 Use them.
1245 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1246 as value.
1247 * src/scan-gram.l (getargs.h): Don't include it.
1248
1249 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1250
1251 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1252 rather than a for-loop that declares a local bool variable. This
1253 should work around a compatibility problem with a Cray x1e C++
1254 compiler reported by Hung Nguyen in
1255 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1256 The for-loop was introduced in the 2004-11-17 change but I don't
1257 know why it was needed.
1258
1259 2006-07-12 Akim Demaille <akim@epita.fr>
1260
1261 * data/c.m4: Comment changes.
1262
1263 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
1264
1265 * src/complain.c (error_message, ERROR_MESSAGE): New.
1266 To factor...
1267 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1268 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1269
1270 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1271
1272 * NEWS: Instead of %union, you can define and use your own union type
1273 YYSTYPE if your grammar contains at least one <type> tag.
1274 Your YYSTYPE need not be a macro; it can be a typedef.
1275 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1276 (Union Decl, Decl Summary): Document this.
1277 * data/glr.c (YYSTYPE): Implement this.
1278 * data/glr.cc (YYSTYPE): Likewise.
1279 * data/lalr1.cc (YYSTYPE): Likewise.
1280 * data/yacc.c (YYSTYPE): Likewise.
1281 * src/output.c (prepare): Output tag_seen_flag.
1282 * src/parse-gram.y (declaration, grammar_declaration):
1283 Use 'union_seen' rather than 'typed' to determine whether
1284 %union has been seen, since grammars can now be typed without
1285 %union.
1286 (symbol_declaration, type.opt, symbol_def):
1287 Keep track of whether a tag has been seen.
1288 * src/reader.c (union_seen, tag_seen): New vars.
1289 (typed): remove.
1290 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1291 * src/scan-code.l (untyped_var_seen): New variable.
1292 (handle_action_dollar): Adjust to above changes.
1293 (handle_action_dollar, handle_action_at):
1294 Improve overflow checking for outlandish numbers.
1295 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1296 avoid new diagnostics generated by above changes.
1297 * tests/regression.at (YYSTYPE typedef): Add test to check
1298 for type tags without %union.
1299
1300 * src/symlist.c (symbol_list_length): Return int, not unsigned
1301 int, since callers expect int. This may need to get revisited
1302 once we have proper integer overflow checking.
1303
1304 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1305 object is now static.
1306
1307 * src/getargs.c (flags_argmatch): Return void, not int,
1308 to pacify ./configure --enable-gcc-warnings.
1309
1310 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1311 since last_string is already defined to FLEX_PREFIX (last_string).
1312
1313 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1314
1315 Implement --warnings/-W.
1316 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1317 replaced by...
1318 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1319 Adjust callers.
1320 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1321 (warnings_args, warnings_types): New.
1322 (getargs, short_options, long_options): Accept -W/--warnings.
1323 Sort the options by alphabetical order, upper case letter right
1324 before its lower case.
1325
1326 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1327
1328 Change %merge result type clash warnings to errors. Discussed at
1329 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1330 * src/reader.c (record_merge_function_type): Use complain_at.
1331 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1332 declared later): Update test case results.
1333
1334 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1335
1336 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1337 to be in alphabetical order.
1338 (trace_args): Spelling fixes.
1339
1340 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1341
1342 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1343 so they don't collide with user-defined macros.
1344 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1345 this was never guaranteed, and now that we're using gnulib stdint,
1346 which defines int_fast16_t to long int, the problem is exposed.
1347
1348 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1349
1350 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1351 need the full POSIX semantics (and weren't implementing them
1352 anyway).
1353
1354 Adjust to Autoconf 2.60 and today's gnulib.
1355 * bootstrap (gnulib_modules): Add stdint.
1356 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1357 no longer copies it.
1358 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1359 since stdint needs the former and wcwidth (which is now required
1360 by mbswidth) needs the latter.
1361 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1362 work around a compatibility glitch between gettext 0.14.6 and
1363 Autoconf 2.60.
1364 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1365 Do not check for uintptr_t, since new stdint module does the right
1366 thing.
1367 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1368 Add stdint.h, stdint_.h, wcwidth.h.
1369 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1370 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1371 stdint.m4, wchar_t.m4, wcwidth.m4.
1372 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1373 usual order for ../lib/*.h files.
1374 (file_name_split): Use last_component, not base_name, to adjust
1375 to gnulib changes.
1376 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1377 for ../lib/*.h files.
1378 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1379 Define unconditionally, since we now assume the stdint module.
1380 * src/scan-skel.l: Include <dirname.h>.
1381 (BASE_QPUTS): Use last_component, not base_name.
1382 * src/system.h: Include <unlocked-io.h> in the usual order
1383 for ../lib/*.h files. Include <stdint.h> unconditionally,
1384 since we now use the stdint module.
1385 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1386 HAVE_UINTPTR_T, since we now use the stdint module.
1387 (base_name): Remove decl, since files now include <dirname.h>
1388 to get the decl.
1389
1390 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1391
1392 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1393 New, default to 1.
1394 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1395 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1396 default.
1397 * tests/calc.at: Adjust.
1398
1399 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1400
1401 * data/c.m4 (b4_basename): New.
1402 (b4_syncline): Also output the location of its invocation (from
1403 the skeleton).
1404 (b4_user_action, b4_define_user_action, b4_user_actions)
1405 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1406 (b4_user_stype): New.
1407 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1408
1409 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1410
1411 In the grammar file, the first column is 1 not 0 on the first line as
1412 on every other line.
1413 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1414 * tests/input.at (Torturing the Scanner): Update output.
1415
1416 * src/scan-gram.l (scanner_cursor): Declare it static.
1417
1418 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1419
1420 In warnings, say "previous declaration" rather than "first
1421 declaration".
1422 * src/symtab.c (redeclaration): Do that here.
1423 * src/reader.c (record_merge_function_type): In the case of a result
1424 type clash, report the previous declaration rather than the very first
1425 one in the grammar file.
1426 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1427 declared later): Add a third declaration to check this behavior.
1428 * tests/input.at (Incompatible Aliases): Update output.
1429
1430 2006-06-27 Akim Demaille <akim@epita.fr>
1431
1432 * doc/Doxyfile.in: New.
1433 * doc/Makefile.am: Use it.
1434 * src/lalr.h, src/symtab.h: Initial doxygenation.
1435
1436 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1437
1438 Don't miss %merge result type warnings just because the LHS types are
1439 declared after the %merge. This continues the effort of the previous
1440 patch.
1441 * src/reader.c (get_merge_function): Don't set the merger type yet.
1442 (record_merge_function_type): New function for setting the merger type
1443 and checking for clashes.
1444 (grammar_current_rule_merge_set): Set the location of the %merge for
1445 the current rule.
1446 (packgram): Invoke record_merge_function_type for each rule now that
1447 all symbol type declarations have been parsed.
1448 * src/reader.h (merger_list.type_declaration_location): New member
1449 storing the location of the first %merge from which the type for this
1450 merging function was derived.
1451 * src/symlist.h (symbol_list.merger_declaration_location): New member
1452 storing the location of a rule's %merge, if any.
1453 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1454 declared later): New test to catch the error fixed by the above patch.
1455
1456 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1457
1458 Get action warnings (grammar_rule_check) right even when symbol
1459 declarations appear after the rules. Discussed at
1460 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1461 and
1462 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1463 Don't mistake the type of $$ in a midrule to be that of its parent
1464 rule's $$.
1465 * src/reader.c (grammar_current_rule_end): Don't invoke
1466 grammar_rule_check yet since not all symbol declarations may have been
1467 parsed yet.
1468 (grammar_midrule_action): Likewise.
1469 Don't record whether the midrule's $$ has been used yet since actions
1470 haven't been translated yet.
1471 Record the midrule's parent rule and its RHS index within the parent
1472 rule.
1473 (grammar_current_rule_action_append): Don't translate the action yet
1474 since not all symbol declarations may have been parsed yet and, thus,
1475 warnings about types for $$, $n, @$, and @n can't be reported yet.
1476 (packgram): Translate the action and invoke grammar_rule_check now that
1477 all symbol declarations have been parsed.
1478 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1479 after parsing the entire grammar file, the symbol list here in the case
1480 of a midrule is actually the midrule's empty RHS, so reference its
1481 parent rule's RHS where necessary.
1482 On the other hand, now that you can already know it's a midrule, you
1483 aren't forced to think $$ has the same type as its parent rule's $$.
1484 (handle_action_at): In the case of a midrule, reference the parent rule
1485 where necessary.
1486 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1487 members.
1488 (symbol_list_length): Now that this is invoked after all rules have
1489 been parsed, a NULL symbol (rather than a NULL symbol list node)
1490 terminates a rule. symbol_list_print already does this correctly.
1491 * src/symlist.h (symbol_list.midrule_parent_rule,
1492 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1493 remember their relationships with their parents.
1494 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1495 fixed by the above patch.
1496 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1497 implementing...
1498 (Unused values): ... this old test case and...
1499 (Unused values before symbol declarations): ... this new test case.
1500 This one is the same as `Unused values' except that all symbol
1501 declarations appear after the rules in order to catch the rest of the
1502 errors fixed by the above patch.
1503
1504 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1505
1506 More cleanup.
1507 * src/reader.c (current_rule): Declare it static since it's no longer
1508 used outside this file.
1509 (grammar_current_rule_action_append): Remove redundant arguments from
1510 translate_rule_action invocation.
1511 * src/reader.h (current_rule): Remove this unused extern.
1512 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1513 * src/scan-code.l (translate_rule_action): Likewise.
1514
1515 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1516
1517 Clean up yesterday's patch.
1518 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1519 to...
1520 * src/reader.c (grammar_current_rule_action_append): ... here for
1521 consistency with grammar_current_rule_symbol_append.
1522 * tests/regression.at (Braced code in declaration in rules section):
1523 Make yyerror and yylex static as usual.
1524
1525 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1526
1527 Fix bug that mistakes braced code in a declaration in the rules section
1528 to be a rule action. Mentioned at
1529 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1530 * src/scan-gram.l: Move midrule action detection from the start of the
1531 scanning of any braced code to...
1532 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1533 action. For readability, use $2 and @2 rather than the equivalent
1534 global variables.
1535 * tests/regression.at (Braced code in declaration in rules section):
1536 New test to catch the error fixed by the above patch.
1537
1538 Work on code readability some.
1539 * src/scan-code.l (current_rule): Get rid of this misleading and
1540 redundant declaration: it's actually extern'ed in reader.h.
1541 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1542 translate_action): Add a rule argument and use it instead of the global
1543 current_rule.
1544 (translate_rule_action): This already receives current_rule through an
1545 argument, so pass it on to translate_action instead of assigning
1546 current_rule to current_rule.
1547 (translate_symbol_action, translate_code): Pass rule = NULL to
1548 translate_action.
1549
1550 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1551
1552 Rename %before-definitions to %start-header and %after-definitions to
1553 %end-header. Don't use these declarations to separate pre-prologue
1554 blocks from post-prologue blocks. Add new order-independent
1555 declarations %before-header and %after-header as alternatives to the
1556 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1557 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1558 * NEWS (2.3+): Update for these changes.
1559 * data/glr.c (b4_before_definitions): Update to...
1560 (b4_start_header): ... this.
1561 (b4_after_definitions): Update to...
1562 (b4_end_header): ... this.
1563 * data/glr.cc: Likewise.
1564 * data/lalr1.cc: Likewise.
1565 * data/yacc.c: Likewise.
1566 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1567 prologue blocks with %*-header declarations.
1568 (Calc++ Parser): Likewise.
1569 (Bison Declaration Summary): Update names.
1570 (Bison Symbols): Update description.
1571 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1572 (PERCENT_END_HEADER): ... this.
1573 (PERCENT_BEFORE_DEFINITIONS): Update to...
1574 (PERCENT_START_HEADER): ... this.
1575 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1576 (declaration): Update token names and m4 macro names.
1577 When parsing %end-header and %start-header, invoke translate_code
1578 before muscle_code_grow, and no longer set global booleans to remember
1579 whether these declarations have been seen.
1580 Parse new %after-header and %before-header.
1581 * src/reader.c (before_definitions, after_definitions): Remove.
1582 (prologue_augment): Accept a new bool argument to specify whether to
1583 augment the pre-prologue or post-prologue.
1584 * src/reader.h (before_definitions, after_definitions): Remove these
1585 extern's.
1586 (prologue_augment): Add new bool argument.
1587 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
1588 (PERCENT_END_HEADER): ... this.
1589 (PERCENT_BEFORE_DEFINITIONS): Update to...
1590 (PERCENT_START_HEADER): ... this.
1591 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1592 * tests/actions.at (Printers and Destructors): Update names.
1593
1594 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1595
1596 Add comparison operators for C++ location classes. Discussed at
1597 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
1598 * data/c++.m4 (b4_define_location_comparison): New boolean %define
1599 declaration indicating whether filename_type has an operator==. If
1600 filename_type is `std::string', it defaults to `1', `0' otherwise.
1601 * data/location.cc: Iff b4_define_location_comparison is `1', add
1602 operator== and operator!= for class position and for class location.
1603
1604 Some minor fixes.
1605 * src/scan-action.l: Remove unused file.
1606 * src/symtab.c (symbol_printer_set): Use printer_location not
1607 destructor_location.
1608 * src/symtab.h (struct symbol): Replace incorrect source comment for
1609 printer members.
1610 * tests/input.at (Incompatible Aliases): Update output with correct
1611 printer location.
1612
1613 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1614
1615 Don't put the pre-prologue in the header file. For the yacc.c code
1616 file and the glr.c header and code files, move the pre-prologue before
1617 the token definitions. Add new %before-definitions and
1618 %after-definitions to declare code that will go in both the header file
1619 and code file. Discussed at
1620 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
1621 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
1622 and
1623 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
1624 * NEWS (2.3+): Describe these changes.
1625 * data/glr.c (b4_pre_prologue): Move from within to before...
1626 (b4_shared_declarations): ... this.
1627 Add new b4_before_definitions before b4_token_enums.
1628 Add new b4_after_definitions at the end.
1629 * data/glr.cc (b4_pre_prologue): Replace with...
1630 (b4_before_definitions): ... this in the header file.
1631 (b4_after_definitions): New near the end of the header file.
1632 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
1633 code file right before including the header file.
1634 (b4_before_definitions): New in the previous position of
1635 b4_pre_prologue in the header file.
1636 (b4_after_definitions): New near the end of the header file.
1637 * data/yacc.c: Clean up some m4 quoting especially in the header file.
1638 (b4_token_enums_defines): In the code file, move to right before
1639 YYSTYPE for consistency with the header file.
1640 (b4_before_definitions): New right before b4_token_enums_defines in
1641 both the header and code file.
1642 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
1643 header and code file.
1644 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
1645 of prologues for %union dependencies.
1646 (Bison Declaration Summary): In %defines description, mention the
1647 effect of %before-definitions and %after-definitions on the header
1648 file.
1649 (Calc++ Parser): Forward declare driver in a %before-definitions rather
1650 than in the pre-prologue so that make check succeeds.
1651 (Bison Symbols): Add entries for %before-definitions and
1652 %after-definitions.
1653 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
1654 %before-definitions.
1655 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
1656 (declaration): Parse those declarations and append to
1657 b4_before_definitions and b4_after_definitions, respectively.
1658 * src/reader.c (before_definitions, after_definitions): New bools to
1659 track whether those declarations have been seen.
1660 (prologue_augment): Add to the post-prologue if %union,
1661 %before-definitions, or %after-definitions has been seen.
1662 * src/reader.h (before_definitions, after_definitions): New extern's.
1663 * src/scan-gram.l: Scan the new declarations.
1664 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
1665 prologue block in a %before-definitions or a %after-definitions based
1666 on whether the %union is declared.
1667 * tests/regression.at (Early token definitions with --yacc, Early token
1668 definitions without --yacc): Move tests for token definitions into the
1669 post-prologue since token names are no longer defined in the
1670 pre-prologue.
1671
1672 2006-06-20 Akim Demaille <akim@epita.fr>
1673
1674 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1675 (symbol_get): Use it.
1676 * src/parse-gram.y: Use it.
1677
1678 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1679
1680 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1681 build succeeds when configured with --enable-gcc-warnings.
1682
1683 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1684
1685 * src/parse-gram.y (char_name): New function.
1686 (CHAR, STRING, string_content): For %printer, properly escape.
1687 (ID): Prefer fputs to fprintf.
1688 (id): Reindent to be consistent with other rules.
1689 Properly quote char.
1690
1691 The Translation Project changed its way of publishing translations
1692 to maintainers. I haven't received any responses to my request
1693 for supporting the old way, or for documenting the new way. I
1694 have modified 'bootstrap' to use screen scraping
1695 (in this case, HTML scraping). This is unreliable and inelegant,
1696 but I don't see any better way. Yuck.
1697 * bootstrap (TP_URL, WGET_COMMAND): New vars.
1698 (get_translations): New function, which uses HTML scraping to
1699 deduce locations of latest translations.
1700 Use this function to grab both bison and bison-runtime .po files.
1701 Don't bother priming the pump for the runtime-po domain any more,
1702 as it's now translated better than bison is.
1703
1704 2006-06-19 Akim Demaille <akim@epita.fr>
1705
1706 * src/scan-gram.l: No longer "parse" things after `%union' until
1707 `{'. Rather, return a single "%union" token.
1708 No longer make symbols: return strings, and leave the conversion
1709 to symbols to the parser.
1710 (SC_PRE_CODE, token_type): Remove.
1711 * src/parse-gram.y (%union): New field `character'.
1712 Sort tokens.
1713 (CHAR): New token.
1714 (ID, ID_COLON): Now that the scanner no longer makes them
1715 identifiers, adjust all uses to invoke symbol_get.
1716 (id_colon): New, wraps the conversion from string to symbol.
1717 (%union): Accept a possible union_name.
1718 (symbol): Now can be a char.
1719 * data/c.m4 (b4_union_name): Leave a default value.
1720 * data/glr.c, data/yacc.c: Use it.
1721
1722 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1723
1724 For associating token numbers with token names for "yacc.c", don't use
1725 #define statements unless `--yacc' is specified; always use enum
1726 yytokentype. Most important discussions start at:
1727 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1728 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1729 and
1730 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1731 * NEWS (2.3+): Mention.
1732 * data/c.m4 (b4_yacc_if): New.
1733 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1734 token #define's.
1735 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1736 on token name definitions.
1737 * src/getargs.c (usage): Capitalize `Yacc' in English.
1738 * src/output.c (prepare): Define b4_yacc_flag.
1739 * tests/regression.at (Early token definitions): Test that tokens names
1740 are defined before the pre-prologue not just before the post-prologue.
1741 Remove this test case and copy to...
1742 (Early token definitions with --yacc): ... this to test #define's.
1743 (Early token definitions without --yacc): ... and this to test enums.
1744
1745 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1746
1747 * NEWS: Reword the post-2.3 change to not be so optimistic about
1748 removing the old "look-ahead" spelling.
1749 Update previous look-ahead/lookahead change reports.
1750 * REFERENCES: look-ahead -> lookahead (since that's
1751 what he actually wrote).
1752 * doc/refcard.tex: look ahead -> lookahead,
1753 look-ahead -> lookahead
1754
1755 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1756
1757 For consistency, use `lookahead' instead of `look-ahead' or
1758 `look_ahead'. Discussed starting at
1759 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1760 and then at
1761 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1762 * NEWS: For the next release, note the change to `--report'.
1763 * TODO, doc/bison.1: Update English.
1764 * doc/bison.texinfo: Update English.
1765 (Understanding Your Parser, Bison Options): Document as
1766 `--report=lookahead' rather than `--report=look-ahead'.
1767 * src/conflicts.c: Update English in comments.
1768 (lookahead_set): Rename from look_ahead_set.
1769 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1770 (resolve_sr_conflict): Rename local look_ahead_tokens to
1771 lookahead_tokens, and update other uses.
1772 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1773 count_rr_conflicts, conflicts_free): Update uses.
1774 * src/getargs.c (report_args): Move "lookahead" before alternate
1775 spellings.
1776 (report_types): Update uses.
1777 (usage): For `--report' usage description, state `lookahead' spelling
1778 rather than `look-ahead'.
1779 * src/getargs.h (report.report_lookahead_tokens): Rename from
1780 report_look_ahead_tokens.
1781 * src/lalr.c: Update English in comments.
1782 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1783 (state_lookahead_tokens_count): Rename from
1784 state_look_ahead_tokens_count.
1785 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1786 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1787 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1788 Update other uses.
1789 Update English in output.
1790 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1791 * src/print.c: Update English in comments.
1792 (lookahead_set): Rename from look_ahead_set.
1793 (print_reduction): Rename argument lookahead_token from
1794 look_ahead_token.
1795 (print_core, state_default_rule, print_reductions, print_results):
1796 Update uses.
1797 * src/print_graph.c: Update English in comments.
1798 (print_core): Update uses.
1799 * src/state.c: Update English in comments.
1800 (reductions_new): Update uses.
1801 (state_rule_lookahead_tokens_print): Rename from
1802 state_rule_look_ahead_tokens_print, and update other uses.
1803 * src/state.h: Update English in comments.
1804 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1805 (state_rule_lookahead_tokens_print): Rename from
1806 state_rule_look_ahead_tokens_print.
1807 * src/tables.c: Update English in comments.
1808 (conflict_row, action_row): Update uses.
1809 * tests/glr-regression.at
1810 (Incorrect lookahead during deterministic GLR,
1811 Incorrect lookahead during nondeterministic GLR): Rename
1812 print_look_ahead to print_lookahead.
1813 * tests/torture.at: Update English in comments.
1814 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1815 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1816 (Many lookahead tokens): Update uses.
1817 * data/glr.c: Update English in comments.
1818 * lalr1.cc: Likewise.
1819 * yacc.c: Likewise.
1820 * src/conflicts.h: Likewise.
1821 * src/lalr.h: Likewise.
1822 * src/main.c: Likewise.
1823 * src/output.c: Likewise.
1824 * src/parse-gram.c: Likewise.
1825 * src/tables.h: Likewise.
1826 * tests/calc.at: Likewise.
1827
1828 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1829
1830 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1831
1832 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1833
1834 * TODO: Add request from Nelson H. F. Beebe to be able to install
1835 Bison without installing the yacc script.
1836
1837 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1838
1839 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1840 and yytext if they're already #define'd.
1841 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1842 * src/scan-code-c.c: ... here.
1843 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1844 <config.h>.
1845
1846 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1847
1848 Get Bison to build again when configured with --enable-gcc-warnings.
1849 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1850 missing #include's.
1851 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1852 loc argument as it shadows a global.
1853 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1854 invocation.
1855
1856 * src/.cvsignore: Add scan-code.c.
1857
1858 2006-06-07 Akim Demaille <akim@epita.fr>
1859
1860 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1861 to...
1862 * src/scan-code.l: here.
1863 * tests/input.at (Torturing the Scanner): Fix another location
1864 error.
1865
1866 2006-06-07 Akim Demaille <akim@epita.fr>
1867
1868 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1869
1870 2006-06-06 Akim Demaille <akim@epita.fr>
1871
1872 Extract the parsing of user actions from the grammar scanner.
1873 As a consequence, the relation between the grammar scanner and
1874 parser is much simpler. We can also split "composite tokens" back
1875 into simple tokens.
1876 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1877 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1878 rename as...
1879 * src/location.h, src/location.c (add_column_width)
1880 (location_compute): these.
1881 Fix the column count: the initial column is 0.
1882 (location_print): Be robust to ending column being 0.
1883 * src/location.h (boundary_set): New.
1884 * src/main.c: Adjust to scanner_free being renamed as
1885 gram_scanner_free.
1886 * src/output.c: Include scan-code.h.
1887 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1888 Use boundary_set.
1889 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
1890 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
1891 which is now, again, a separate token.
1892 Adjust all dependencies.
1893 Whereever actions with $ and @ are used, use translate_code.
1894 (action): Remove this nonterminal which is now useless.
1895 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
1896 (grammar_current_rule_action_append): Use translate_code.
1897 (packgram): Bound check ruleno, itemno, and rule_length.
1898 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
1899 (last_string, last_braced_code_loc, max_left_semantic_context)
1900 (scanner_initialize, scanner_free, scanner_last_string_free)
1901 (gram_out, gram_lineno, YY_DECL_): Move to...
1902 * src/scan-gram.h: this new file.
1903 (YY_DECL): Rename as...
1904 (GRAM_DECL): this.
1905 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
1906 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1907 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1908 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1909 Move these declarations, and...
1910 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
1911 these to...
1912 * src/flex-scanner.h: this new file.
1913 * src/scan-gram.l (rule_length, rule_length_overflow)
1914 (increment_rule_length): Remove.
1915 (last_braced_code_loc): Rename as...
1916 (gram_last_braced_code_loc): this.
1917 Adjust to the changes of the parser.
1918 Move all the handling of $ and @ into...
1919 * src/scan-code.l: here.
1920 * src/scan-gram.l (handle_dollar, handle_at): Remove.
1921 (handle_action_dollar, handle_action_at): Move to...
1922 * src/scan-code.l: here.
1923 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
1924 scan-code.h, scan-code-c.c, scan-gram.h.
1925 (EXTRA_bison_SOURCES): Add scan-code.l.
1926 (BUILT_SOURCES): Add scan-code.c.
1927 (yacc): Be robust to white spaces.
1928
1929 * tests/conflicts.at, tests/input.at, tests/reduce.at,
1930 * tests/regression.at: Adjust the column numbers.
1931 * tests/regression.at: Adjust the error message.
1932
1933 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1934
1935 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1936 Use Akim's wording from
1937 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
1938
1939 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1940
1941 Between Bison releases, manually append `+' to the previous Bison
1942 release number, and use that as a signal to automatically print the
1943 ChangeLog's CVS Id keyword from --version. Discussed starting at
1944 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
1945 * ChangeLog: Add Id header.
1946 * configure.ac (AC_INIT): Append `+' to `2.3'.
1947 * src/.cvsignore: Add revision.c.
1948 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1949 (BUILT_SOURCES): Add revision.c.
1950 (revision.c): New target rule. This file defines a new global variable
1951 named revision. It initializes it with either the Id from ChangeLog
1952 or, if VERSION doesn't contain `+', with the empty string.
1953 * src/getargs.c (version): Print the value of revision.
1954 * src/revision.h: Extern revision.
1955
1956 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1957
1958 * NEWS: Version 2.3.
1959 * configure.ac (AC_INIT): Likewise.
1960
1961 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1962
1963 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1964 with no arguments, not as an object-like macro. This is for
1965 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1966 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1967 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1968 Document this.
1969
1970 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1971
1972 * src/getargs.c (usage): Back out yesterday's modification of the
1973 --help output so that we don't have to wait for translation before
1974 releasing 2.3.
1975
1976 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1977
1978 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1979 Problem reported by Akim Demaille.
1980
1981 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1982
1983 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1984
1985 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1986
1987 * data/yacc.c (yy_reduce_print): Omit trailing white space in
1988 generated source code. Problem reported by Frans Englich in
1989 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
1990
1991 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1992
1993 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
1994 shell, not within 'make', so that 'make' by an ordinary builder
1995 (using GNU make) does not worry about configuring gzip. This also
1996 works around a bug reported independently by Keith Thompson and by
1997 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
1998 stderr rather than stdout, messing up the build logs.
1999
2000 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2001
2002 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2003 to make sure that YYID will never be unused. This fixes a 'make
2004 maintainer-check' failure caused by the recent changes to the 'Trivial
2005 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2006 not used.
2007 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2008
2009 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2010
2011 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2012 state before an empty RHS is always resolved here. Only the location
2013 of that state is guaranteed to be resolved, and that's enough. This
2014 fixes the remaining bug reported by Derek M. Jones in
2015 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2016 * tests/glr-regression.at (Uninitialized location when reporting
2017 ambiguity): Test the above case.
2018 Also, the embedded comments in this test case claim it checks the case
2019 of an empty RHS that has inherited the initial location. However, the
2020 corresponding LHS was already resolved, so yyresolveLocations didn't
2021 actually have reason to modify it. Fix this by forcing
2022 nondeterministic operation at the beginning of the parse.
2023
2024 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2025
2026 * data/c.m4 (b4_yy_symbol_print_generate):
2027 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2028 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2029 of the bugs reported today by Derek M Jones in
2030 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2031 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2032 defined to be a type name without parens or brackets.
2033 (Location Type): Similarly for YYLTYPE.
2034 * tests/regression.at (Trivial grammars): Put in a test for this
2035 bug that will be caught by 'make maintainer-check' (though not,
2036 alas, by 'make check' unless your compiler is picky).
2037
2038 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2039
2040 * NEWS: Version 2.2.
2041 * configure.ac (AC_INIT): Likewise.
2042
2043 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2044
2045 * data/glr.c (yyreportTree): Make room in yystates for the state
2046 preceding the RHS. This fixes the segmentation fault reported by Derek
2047 M. Jones in
2048 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2049 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2050 to the user. Reported for yyreportTree by Derek M. Jones later in the
2051 same thread.
2052 * THANKS: Add Derek M. Jones.
2053 Update my email address.
2054 Fix typo in Steve Murphy's name.
2055
2056 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2057
2058 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2059 checking against YYLAST that caused the parser to miss a potential
2060 alternative in its diagnostic.
2061 Problem reported by Maria Jose Moron Fernandez in
2062 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2063 * data/lalr1.cc (yysyntax_error_): Likewise.
2064 * data/yacc.c (yysyntax_error): Likewise.
2065 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2066 tokens, in case we run into an older C compiler.
2067 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2068 Use them to check for the off-by-one error fixed above.
2069
2070 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2071 YYSIZE_T, not size_t.
2072 * tests/regression.at (Trivial grammars): New test, to catch
2073 the error fixed by the above patch.
2074
2075 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2076
2077 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2078 scheme.
2079 Reported by Steve Murphy.
2080
2081 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2082
2083 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2084 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2085
2086 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2087
2088 Implement --trace=m4.
2089 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2090 * src/output.c (output_skeleton): When set, pass -dV to m4.
2091
2092 Factor the handling of flags in m4.
2093 * src/output.c (prepare): Rename the muscle names debug, defines,
2094 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2095 * data/c.m4: Adjust.
2096 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2097 Use b4_define_flag_if to define other b4_FLAG_if macros.
2098 (b4_location_if): As a consequence, rename as...
2099 (b4_locations_if): this, for consistency.
2100 Adjust all the skeletons.
2101
2102 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2103
2104 * etc/bench.pm: Shorten bench names.
2105
2106 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2107
2108 * src/output.h, src/output.c (error_verbose): Move to...
2109 * src/getargs.h, src/getargs.c: here.
2110 Sort the flags.
2111 Adjust dependencies.
2112
2113 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2114
2115 * data/c.m4 (b4_copyright): Put the special exception for Bison
2116 skeletons here, so we don't have to put it in each skeleton. All
2117 uses changed. Suggested by Akim Demaille. Also, wrap the
2118 copyright notice, in case it is longer than 80 columns. Replace
2119 comma by newline after title.
2120
2121 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2122
2123 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2124 incompatibility, not a bug. Mention that it wasn't fixed as of
2125 flex 2.5.33.
2126
2127 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2128
2129 * examples/extexi: Enforce the precedence of concatenation over
2130 >>.
2131 Reported by Tommy Nordgren.
2132
2133 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2134
2135 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2136 with the member "token".
2137 Reported by Martin Nylin.
2138
2139 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2140
2141 * data/glr.c: Switch to Bison 2.2 special-exception language in
2142 the copyright notice. Use more-regular format for titles and
2143 copyright notices.
2144 * data/glr.cc: Likewise.
2145 * data/location.cc: Likewise.
2146 * data/yacc.cc: Likewise.
2147 * doc/bison.texinfo (Conditions): Document this.
2148 * NEWS: likewise. Upgrade version to 2.2.
2149
2150 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
2151
2152 * data/glr.cc: Remove dead code.
2153
2154 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2155
2156 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2157 that variable and the line breaks the bootstrap. Problem reported
2158 by Juan M. Guerrero.
2159
2160 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2161
2162 * doc/bison.texinfo (Multiple start-symbols): New.
2163
2164 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2165
2166 * etc/README, etc/bench.pl: New.
2167
2168 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
2169
2170 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2171 rule.
2172 Reported by Mickael Labau.
2173 * tests/input.at (Torturing the Scanner): Test it.
2174
2175 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2176
2177 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2178 Problem reported by Bob Rossi.
2179
2180 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2181
2182 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2183 and didn't really work.
2184 For the index, use @ifnotinfo, not @iftex.
2185 Minor cleanups of spacing and terminology.
2186
2187 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2188
2189 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2190 of AT_NAME_PREFIX when %name-prefix is not used.
2191
2192 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2193
2194 Apply --prefix to C++ skeletons too: they change the namespace.
2195 The test suite already exercize these cases.
2196 * data/c++.m4 (b4_namespace): New.
2197 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2198 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2199 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2200 * doc/bison.texinfo: Document it.
2201 (Option Cross Key): Use @multitable in all formats. It looks
2202 nicer, even in TeX outputs.
2203 (Rules): Use the same code whatever the output type is.
2204 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2205 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2206 * tests/calc.at: Use it, instead of hard coding `yy'.
2207
2208 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2209
2210 * TODO: Remove dead items.
2211
2212 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2213
2214 * doc/FAQ: Remove, merged into...
2215 * doc/bison.texinfo (FAQ): this.
2216 * doc/Makefile.am (EXTRA_DIST): Adjust.
2217
2218 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2219
2220 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2221 even if empty.
2222 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2223 * doc/bison.texinfo (Calc++ Scanner): Use it.
2224
2225 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2226
2227 Fix two nits reported by twlevo, plus one more that I discovered.
2228
2229 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2230 this is the usual Bison style.
2231 * src/location.h (location_print): Likewise.
2232
2233 * src/reader.h (token_name): Likewise.
2234
2235 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2236
2237 Fix some nits reported by twlevo.
2238 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2239 and "POSIX". Use more-modern syntax for URLs. Mention C++
2240 and ask for Java. Don't hardwire OS version numbers. Add
2241 copyright notice.
2242 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2243 * src/conflicts.c (solved_conflicts_obstack): Now static.
2244
2245 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2246
2247 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2248 page. Say "you can use it" not "you may use it" as on the web page;
2249 we're describing capabilities not granting permission.
2250
2251 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2252
2253 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2254 shadowing warnings. Use usual patter for iterating through RHS.
2255 * tests/glr-regression.at
2256 (Uninitialized location when reporting ambiguity):
2257 Modify yylex so that it uses its argument, rather than trying
2258 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2259 const char -> char const.
2260
2261 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2262 Don't use tabs inside commands; it messes up 'ps'.
2263 Problem reported by twlevo.
2264
2265 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2266
2267 * tests/glr-regression.at (Uninitialized location when reporting
2268 ambiguity): New test case.
2269 * data/glr.c (yyresolveLocations): New function, which uses
2270 YYLLOC_DEFAULT.
2271 (yyresolveValue): Invoke yyresolveLocations before reporting an
2272 ambiguity.
2273 * doc/bison.texinfo (Default Action for Locations): Note
2274 YYLLOC_DEFAULT's usage for ambiguity locations.
2275 (GLR Semantic Actions): Cross-reference those notes.
2276
2277 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2278
2279 * tests/glr-regression.at (Leaked semantic values when reporting
2280 ambiguity): Remove unnecessary union and type declarations.
2281 (Leaked lookahead after nondeterministic parse syntax error): New test
2282 case.
2283 * data/glr.c (yyparse): Check for zero stacks remaining before
2284 attempting to shift the lookahead so that you don't lose it.
2285
2286 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2287
2288 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2289 * tests/glr-regression.at (Leaked semantic values when reporting
2290 ambiguity): New test case.
2291 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2292 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2293 now unnecessary yystackp parameter.
2294 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2295 destructors can be called.
2296
2297 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2298 in existing testcases.
2299
2300 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2301
2302 Don't leak semantic values for parent RHS when a user action cuts the
2303 parser, and clean up related code a bit.
2304 * tests/glr-regression.at (Leaked merged semantic value if user action
2305 cuts parse): Rename to...
2306 (Leaked semantic values if user action cuts parse): ... this. Add check
2307 for leaked parent RHS values.
2308 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2309 between an unresolved state (non-empty chain of semantic options) and
2310 an incomplete one (signaled by an empty chain).
2311 (yyresolveStates): Document the interface. Move all manipulation of a
2312 successfully or unsuccessfully resolved yyGLRState to...
2313 (yyresolveValue): ... here so that yyresolveValue always leaves a
2314 yyGLRState with consistent data and thus is easier to understand.
2315 Remove the yyvalp and yylocp parameters since they are always just
2316 taken from the yys parameter. When reporting a discarded merged value
2317 in debugging output, note that it is incompletely merged. Document the
2318 interface.
2319 (yyresolveAction): If resolving any of the RHS states fails, destroy
2320 them all rather than leaking them. Thus, as long as user actions are
2321 written to clean up the RHS correctly, yyresolveAction always cleans up
2322 the RHS of a semantic option. Document the interface.
2323
2324 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2325
2326 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2327 led to a segmentation fault in GNU Pascal. Problem reported
2328 by Waldek Hebisch.
2329
2330 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2331
2332 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2333 mid-rule action inside a nonterminal symbol in order to declare a
2334 destructor for its semantic value.
2335
2336 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2337
2338 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2339 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2340 __cplusplus && ! defined _STDLIB_H && !
2341 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2342 defined free))]: Include <stdlib.h> rather than rolling our own
2343 declarations of malloc and free, to avoid problems with
2344 incompatible declarations (using 'throw') C++'s stdlib.h. This
2345 should fix Debian bug 340012
2346 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2347 reported by Guillaume Melquiond.
2348
2349 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2350
2351 * NEWS: Clarify symbols versus types in unused-value warnings.
2352
2353 * configure.ac (AC_INIT): Bump version number.
2354
2355 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2356
2357 * NEWS: Version 2.1a.
2358 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2359 since C99 requires this.
2360
2361 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2362
2363 * m4/c-working.m4: New file.
2364 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2365
2366 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2367
2368 * Makefile.maint: Merge from coreutils.
2369
2370 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2371
2372 More portability fixes for problems summarized by Nelson H. F. Beebe.
2373
2374 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2375 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2376 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2377 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2378 messes up because C++ code is compiled in 32-bit mode but linked
2379 in 64-bit mode.
2380
2381 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2382
2383 More portability fixes for problems summarized by Nelson H. F. Beebe.
2384
2385 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2386 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2387
2388 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2389 nodist_PROGRAMS, since we don't need to actually compile the
2390 example if we're just doing a plain 'make'. This avoids bothering
2391 the installer unnecessarily about problems due to weird C++
2392 compilers.
2393
2394 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2395
2396 More portability fixes for problems summarized by Nelson H. F. Beebe.
2397
2398 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2399 than #include "...", and compile with -I'.'. The old method was
2400 not portable, according to Posix and the C standard, and it does
2401 not work with Sun C 5.7, where previous #line directives affect
2402 the working directory used in later #include "..." directives.
2403
2404 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2405
2406 Various DJGGP specific issues in /djgpp
2407
2408 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2409
2410 More portability fixes for problems summarized by Nelson H. F. Beebe.
2411
2412 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2413 '#include <map>' works and that you can apply ++ to iterators.
2414
2415 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2416
2417 Work around portability problems summarized by Nelson H. F. Beebe in
2418 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2419
2420 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2421 that '#include <string>' works.
2422
2423 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2424 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2425 "warning: sorry: semantics of inline function static data `const
2426 unsigned char translate_table[262]' are wrong (you'll wind up with
2427 multiple copies)".
2428
2429 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2430 or, xor to not_, and_, or_, and xor_, respectively. This works
2431 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2432 random system header somewhere that includes the equivalent of
2433 <iso646.h>.
2434
2435 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2436 -E" works; it apparently doesn't work with PathScale EKO Compiler
2437 Suite Version 2.0.
2438
2439 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2440
2441 During deterministic GLR operation, user actions should be able to
2442 influence the parse by changing yychar. To make this easier to fix and
2443 to make glr.c easier to evolve in general, don't maintain yytoken in
2444 parallel with yychar; just compute yytoken when needed.
2445 * tests/glr-regression.at (Incorrect lookahead during deterministic
2446 GLR): Check that setting yychar in a user action has the intended
2447 effect.
2448 * data/glr.c (yyGLRStack): Remove yytokenp member.
2449 (yyclearin): Don't set *yytokenp.
2450 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2451 yychar rather than *yytokenp to determine the current lookahead.
2452 Compute yytoken locally when needed.
2453 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2454 point to.
2455
2456 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2457 after `--report' documentation.
2458
2459 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2460
2461 * src/parse-gram.y (grammar_declaration): Location of printer
2462 symbol is @1, not list->location. Bug reported by twlevo.
2463 * tests/input.at (Incompatible Aliases): Adjust to above change.
2464
2465 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2466
2467 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2468 all the test at once. This makes the output easier to read in the
2469 normal case.
2470
2471 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2472 got from <http://bro-ids.org/download.html>. The bug is that
2473 when two actions appeared in succession, the second one was
2474 scanned before the first one was added to the grammar rule
2475 as a midrule action. Bison then output the incorrect warning
2476 "parse.y:905.17-906.36: warning: unused value: $3".
2477 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2478 associated with a value.
2479 (rhs): Don't invoke grammar_current_rule_action_append.
2480 (action): Invoke it here instead.
2481 * src/reader.c (grammar_midrule_action): Now extern.
2482 (grammar_current_rule_action_append): Don't invoke
2483 grammar_midrule_action; that is now the scanner's job.
2484 * src/reader.h (last_string, last_braced_code_loc):
2485 (grammar_midrule_action): New decls.
2486 * src/scan-gram.l (last_string): Now extern, sigh.
2487 (last_braced_code_loc): New extern variable.
2488 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2489 rule already has an action.
2490 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2491 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2492 Add some tests to check that the above changes fixed the bug.
2493
2494 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2495
2496 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2497 All used changed. Check whether the symbol has a destructor,
2498 not whether it is typed.
2499 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2500 that the values are still reported as unused. All line numbers
2501 adjusted.
2502
2503 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2504
2505 Work around a bug in bro 0.8, which underparenthesizes its
2506 definition of YYLLOC_DEFAULT.
2507 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2508 their arguments.
2509 * data/lalr1.cc: Likewise.
2510 * data/yacc.cc: Likewise.
2511
2512 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2513
2514 Work around a bug in Pike 7.0, and give the Pike folks a
2515 better way to override the usual int widths.
2516 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2517 user can override the types.
2518 (short): #undef, to work around a bug in Pike 7.0.
2519 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2520 (union yyalloc.yyss): Use yytype_int16 rather than short.
2521 All uses changed.
2522 (yysigned_char): Remove.
2523 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2524 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2525 * tests/regression.at (Web2c Actions): Adjust to above changes.
2526
2527 * src/reader.c (check_and_convert_grammar): New function.
2528 (reader): Close the input file even if something went wrong during
2529 parsing. Minor file descriptor leak reported by twlevo.
2530
2531 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2532 to pacify gcc -Wswitch-default.
2533 * src/scan-gram.l (adjust_location): Use a default: break; case
2534 to pacify gcc -Wswitch-default.
2535 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2536 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2537 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2538 Move these decls to scan-skel.l, since they don't need to be
2539 visible elsewhere.
2540 * src/scan-skel.l: Accept the above decls.
2541 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2542 is used.
2543
2544 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2545
2546 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2547 since we don't want to insist on a version number at the start
2548 of the changelog every time.
2549 * Makefile.maint: Sync from coreutils a bit better.
2550 (sc_trailing_blank): Renamed from sc_trailing_space.
2551 All uses changed.
2552 (sc_no_if_have_config_h, sc_require_config_h):
2553 (sc_prohibit_assert_without_use): New rules.
2554 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2555 (sc_dd_max_sym_length): Fix leading spaces in rule.
2556 (sc_system_h_headers): Prefix with @.
2557 (sc_useless_cpp_parens, m4-check): Output line numbers.
2558 (changelog-check): Allow version only in head.
2559 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2560 satisfy new Makefile.maint rule.
2561 * data/glr.c: Likewise.
2562 * data/glr.cc: Likewise.
2563 * data/lalr1.cc: Likewise.
2564 * data/yacc.c: Likewise.
2565 * lib/ebitsetv.c: Likewise.
2566 * lib/lbitset.c: Likewise.
2567 * lib/subpipe.c: Likewise.
2568 * lib/timevar.c: Likewise.
2569 * src/system.h: Likewise.
2570 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2571 * djgpp/Makefile.maint: Add copyright notice.
2572 * djgpp/README.in: Likewise.
2573 * djgpp/config.bat: Likewise.
2574 * djgpp/config.site: Likewise.
2575 * djgpp/config_h.sed: Likewise.
2576 * djgpp/djunpack.bat: Likewise.
2577 * djgpp/config.sed: Fix copyright notice to match standard format.
2578 * djgpp/subpipe.h: Likewise.
2579 * lib/bitsetv-print.c: Likewise.
2580 * lib/bitsetv.c: Likewise.
2581 * lib/subpipe.h: Likewise.
2582 * lib/timevar.c: Likewise.
2583 * lib/timevar.h: Likewise.
2584 * djgpp/subpipe.c: Use standard recipe for config.h.
2585 * lib/abitset.c: Likewise.
2586 * lib/bitset.c: Likewise.
2587 * lib/bitset_stats.c: Likewise.
2588 * lib/bitsetv-print.c: Likewise.
2589 * lib/bitsetv.c: Likewise.
2590 * lib/ebitsetv.c: Likewise.
2591 * lib/get-errno.c: Likewise.
2592 * lib/lbitset.c: Likewise.
2593 * lib/subpipe.c: Likewise.
2594 * lib/timevar.c: Likewise.
2595 * lib/vbitset.c: Likewise.
2596 * tests/local.at: Likewise.
2597 * src/scan-gram.l: Don't include verify.h, since system.h does
2598 that for us.
2599 * .x-sc_require_config_h: New file.
2600 * .x-sc_unmarked_diagnostics: New file.
2601
2602 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2603
2604 Be a bit more systematic about using 'abort'.
2605 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
2606 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
2607 Put 'default: abort ();' before some other case, to satisfy older
2608 pedantic compilers.
2609 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2610 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
2611 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
2612 * src/conflicts.c (resolve_sr_conflict): Likewise.
2613 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
2614 (get_decision_str, get_orientation_str, get_node_alignment_str):
2615 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
2616 (get_linestyle_str, get_arrowstyle_str): Likewise.
2617 * src/conflicts.c (resolve_sr_conflict):
2618 Use a default case rather than one for the one remaining enum
2619 value, to catch invalid enum values as well.
2620 * src/lalr.c (set_goto_map, map_goto):
2621 Prefer "assert (FOO);" to "if (!FOO) abort ();".
2622 * src/nullable.c (nullable_compute, token_definitions_output):
2623 Likewise.
2624 * src/reader.c (packgram, reader): Likewise.
2625 * src/state.c (transitions_to, state_new, state_reduction_find):
2626 Likewise.
2627 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
2628 (symbol_pack): Likewise.
2629 * src/tables.c (conflict_row, pack_vector): Likewise.
2630 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
2631 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
2632 * src/system.h: Don't include <assert.h>.
2633 (assert): New macro.
2634
2635 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
2636 (Destructor Decl, Parser Function, Pure Calling):
2637 Describe rules for braces inside C code more carefully.
2638
2639 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2640
2641 Fix some porting glitches found by Nelson H. F. Beebe.
2642 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
2643 compilers that don't understand that abort () does not return.
2644 * src/state.c (transitions_to): Likewise.
2645 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2646 that '#include <cstdlib>' works.
2647 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
2648 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
2649 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
2650 for the benefit of some pre-C99 compilers.
2651
2652 * bootstrap: Undo changes to gnulib files that autoreconf made.
2653
2654 Minor fixups to get 'make maintainer-check' to work.
2655 * configure.ac: Don't use -Wnested-externs, as it's incompatible
2656 with the new verify.h implementation.
2657 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
2658 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
2659 * data/yacc.c (YYUSE): Likewise.
2660 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
2661 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
2662 * src/parse-gram.y (declaration): Don't pass a string constant
2663 to a function that expects char *, since GCC might complain
2664 about the constant value.
2665 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
2666 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
2667 before #defining them.
2668 * tests/glr-regression.at
2669 (Incorrectly initialized location for empty right-hand side in GLR):
2670 In yyerror, use the msg arg.
2671 (Corrupted semantic options if user action cuts parse):
2672 (Incorrect lookahead during deterministic GLR):
2673 (Incorrect lookahead during nondeterministic GLR):
2674 Don't name a local var 'index'; it shadows string.h's 'index'.
2675
2676 2006-01-19 Akim Demaille <akim@epita.fr>
2677
2678 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2679 location, not just parts of it.
2680
2681 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2682
2683 * NEWS: Document the fact that multiple %unions are now allowed.
2684 * doc/bison.texinfo (Union Decl): Likewise.
2685 * TODO: This feature is now implemented, so remove it from
2686 the wishlist.
2687
2688 * Makefile.maint: Merge with coreutils Makefile.maint.
2689 (CVS_LIST): Use build-aux version if available.
2690 (VERSION_REGEXP): New macro.
2691 (syntax-check-rules): Add sc_no_if_have_config_h,
2692 sc_prohibit_assert_without_use, sc_require_config_h,
2693 sc_useless_cpp_parens.
2694 (sc_obsolete_symbols): Check for O_NDELAY.
2695 (sc_dd_max_sym_length): Track coreutils.
2696 (sc_unmarked_diagnostics): Look in all files, not just *.c.
2697 (sc_useless_cpp_parens): New rule.
2698 (news-date-check): Look for version or today's date.
2699 (changelog-check): Don't require version number near head.
2700 (copyright-check): Use current year instead of hardwiring 2005.
2701 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
2702 (announcement): Add --gpg-key-ID.
2703
2704 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2705 with "file system".
2706
2707 Avoid undefined behavior that addressed just before the start of an
2708 array. Problem reported by twlevo.
2709 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2710 * src/lalr.c (build_relations): Rely on new sentinel.
2711 * src/gram.c (gram_free): Adjust to new sentinel.
2712
2713 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2714
2715 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2716 yylookaheadNeeds. All uses updated.
2717 (yysplitStack): Rename local yynewLookaheadStatuses to
2718 yynewLookaheadNeeds.
2719 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2720 GLR): In comments, change `lookahead status' to `lookahead need'.
2721
2722 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2723
2724 * data/glr.c (yysplitStack): A little stylistic rewrite.
2725
2726 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2727
2728 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2729
2730 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2731
2732 * doc/bison.texinfo: Fix some typos.
2733 (GLR Semantic Actions): New subsection discussing special
2734 considerations because GLR semantic actions might be deferred.
2735 (Actions): Mention look-ahead usage of yylval.
2736 (Actions and Locations): Mention look-ahead usage of yylloc.
2737 (Special Features for Use in Actions): Add YYEOF entry and mention it
2738 in the yychar entry.
2739 In the yychar entry, remove mention of the local yychar case (pure
2740 parser) since this is irrelevant information when writing semantic
2741 actions and since it's already discussed in `Bison Symbols' where
2742 yychar is otherwise described as an external variable.
2743 In the yychar entry, don't call it the `current' look-ahead since it
2744 isn't when semantic actions are deferred.
2745 In the yychar and yyclearin entries, add note about deferred semantic
2746 actions.
2747 Add yylloc and yylval entries discussing look-ahead usage.
2748 (Look-Ahead Tokens): When discussing yychar, don't call it the
2749 `current' look-ahead, and do mention yylval and yylloc.
2750 (Error Recovery): Cross-reference `Action Features' when mentioning
2751 yyclearin.
2752 (Bison Symbols): In the yychar entry, don't call it the `current'
2753 look-ahead.
2754 In the yylloc and yylval entries, mention look-ahead usage.
2755
2756 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2757
2758 * tests/glr-regression.at: Update copyright year to 2006.
2759
2760 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2761
2762 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2763 use during nondeterministic operation to track which stacks have
2764 actually needed the current lookahead.
2765 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2766 Allocate, deallocate, resize, and otherwise shuffle space for
2767 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2768 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2769 appropriately during nondeterministic operation.
2770 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2771 members to store the current lookahead to be used by the deferred
2772 user action.
2773 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2774 from which the RHS is taken. Set the lookahead members of the new
2775 yySemanticOption according to the lookahead status for stack yyk.
2776 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2777 yyaddDeferredAction.
2778 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2779 members of yySemanticOption before invoking yyuserAction, and then set
2780 them back to their current values afterward.
2781 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2782 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2783 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2784 titles for consistency.
2785 (Leaked merged semantic value if user action cuts parse): In order to
2786 suppress lint warnings, use arguments in merge function, and assign
2787 char value < 128 in main.
2788 (Incorrect lookahead during deterministic GLR): New test case.
2789 (Incorrect lookahead during nondeterministic GLR): New test case.
2790
2791 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2792
2793 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
2794 !yyvaluep as signal that no semantic value is available to print.
2795 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2796 to print a semantic value.
2797
2798 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2799
2800 * tests/glr-regression.at: For consistency with my newer test cases,
2801 don't thank myself.
2802
2803 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2804
2805 * data/glr.c (yyresolveValue): When merging semantic options, if at
2806 least one user action succeeds but a later one cuts the parse, then
2807 destroy the semantic value before returning rather than leaking it.
2808 (yyresolveStates): If a user action cuts the parse and thus
2809 yyresolveValue fails, ignore the (unset) semantic value rather than
2810 corrupting the yyGLRState, and empty the semantic options list since
2811 the user actions should have called all necessary destructors.
2812 Simplify code with YYCHK.
2813 * tests/glr-regression.at (Corrupted semantic options if user action
2814 cuts parse): New test case.
2815 (Undesirable destructors if user action cuts parse): New test case.
2816 Before applying any of this patch, this test case never actually failed
2817 for me... but only because the corrupted semantic options usually
2818 masked this bug.
2819 (Leaked merged semantic value if user action cuts parse): New test
2820 case.
2821
2822 2006-01-05 Akim Demaille <akim@epita.fr>
2823
2824 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2825
2826 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2827
2828 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2829 _MSC_VER. Problem reported by Cenzato Marco.
2830 (b4_c_function_def): Use it.
2831 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2832 b4_c_modern.
2833 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2834 than rolling our own.
2835
2836 2006-01-04 Akim Demaille <akim@epita.fr>
2837
2838 Also warn about non-used mid-rule values.
2839 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2840 member.
2841 (symbol_list_new): Adjust.
2842 * src/reader.c (symbol_typed_p): New.
2843 (grammar_rule_check): Use it.
2844 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2845 Check its rule.
2846 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2847 Use it.
2848 * tests/actions.at (Exotic Dollars): Adjust.
2849
2850 2006-01-04 Akim Demaille <akim@epita.fr>
2851
2852 * src/reader.c (grammar_midrule_action): If $$ is set in a
2853 mid-rule, move the `used' bit to its lhs.
2854 * tests/input.at (Unused values): New.
2855 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2856
2857 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2858
2859 * doc/bison.texinfo (Bison Options): Say more accurately what
2860 --yacc does.
2861 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2862 about declarations in the grammar when in Yacc mode, as POSIX does
2863 not require a diagnostic when the grammar uses extensions.
2864
2865 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2866
2867 Warn about dubious constructions like "%token T T".
2868 Reported by twlevo.
2869 * src/symtab.h (struct symbol.declared): New member.
2870 * src/symtab.c (symbol_new): Initialize it to false.
2871 (symbol_class_set): New arg DECLARING, specifying whether
2872 this is a declaration that we want to warn about, if there
2873 is more than one of them. All uses changed.
2874
2875 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
2876 Allow multiple %union directives, whose contents concatenate.
2877 * src/parse-gram.y (grammar_declaration): Likewise.
2878 Use muscle_code_grow, so that we don't need stype_line any more.
2879 All uses changed.
2880
2881 * src/muscle_tab.c (muscle_grow): Fix comment.
2882
2883 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
2884 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
2885 Update copyright year to 2006.
2886
2887 2006-01-03 Akim Demaille <akim@epita.fr>
2888
2889 Have glr.cc pass (some of) the calc.at tests.
2890 * data/glr.cc (b4_parse_param_orig): New.
2891 (b4_parse_param): Improve its definition, and bound it more
2892 clearly in the skeleton.
2893 (b4_epilogue): Append, instead of prepending, in order to keep
2894 #line consistency.
2895 Simplify the generation of auxiliary functions: locations and
2896 purity are mandated.
2897 (b4_global_tokens_and_yystype): Honor it.
2898 * data/location.cc (c++.m4): Don't include it.
2899 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
2900 and AT_SKEL_CC_IF.
2901 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2902 AT_LALR1_CC_IF.
2903 Be sure to initialize the first position's filename.
2904 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2905 mandated anyway.
2906 (AT_CHECK_CALC_GLR_CC): New.
2907 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2908
2909 2006-01-02 Akim Demaille <akim@epita.fr>
2910
2911 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2912 c.m4.
2913 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
2914 * data/glr.cc: Do not include stack.hh.
2915
2916 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2917
2918 * data/glr.c: Reformat whitespace with tabs.
2919 (b4_lpure_formals): Remove this unused m4 macro.
2920 * tests/cxx-type.at: Reformat whitespace with tabs.
2921 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
2922 since it's a member. Rename type to isNterm for clarity.
2923
2924 2005-12-29 Akim <akim@sulaco.local>
2925
2926 Let glr.cc catch up with symbol_value_print.
2927 * data/glr.cc (b4_yysymprint_generate): Replace by...
2928 (b4_yy_symbol_print_generate): this.
2929 (yy_symbol_print, yy_symbol_value_print): Declare them.
2930
2931 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2932
2933 * src/location.h (boundary): Note that a line or column equal
2934 to INT_MAX indicates an overflow.
2935 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
2936 (rule_length_overflow, increment_rule_length, add_column_width):
2937 New functions.
2938 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
2939 (<SC_BRACED_CODE>"}"):
2940 Use increment_rule_length rather than incrementing it by hand.
2941 (adjust_location, handle_syncline): Diagnose overflow.
2942 (handle_action_dollar, handle_action_at):
2943 Fix bug with monstrosities like $-2147483648.
2944 Remove now-unnecessary checks.
2945 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2946 (convert_ucn_to_byte): Verify assumptions.
2947 (handle_syncline): New arg LOC. All callers changed.
2948 Don't store through a value derived from char const * pointer.
2949
2950 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2951 GCC warnings.
2952
2953 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2954
2955 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2956 Remove unnecessary forward static decls.
2957
2958 2005-12-27 Akim Demaille <akim@epita.fr>
2959
2960 * src/reader.c (grammar_current_rule_check): Also check that $$
2961 is used.
2962 Take the rule to check as argument, hence rename as...
2963 (grammar_rule_check): this.
2964 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2965 Rename as...
2966 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2967 (grammar_midrule_action, grammar_symbol_append): Now static.
2968 * tests/torture.at (input): Don't rely on the default action
2969 being always performed.
2970 * tests/calc.at: "Set" $$ even when the action is "cut" with
2971 YYERROR or other.
2972 * tests/actions.at (Exotic Dollars): Instead of using unused
2973 values, check that the warning is issued.
2974
2975 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2976
2977 * NEWS: Improve wording for unused-value warnings.
2978
2979 2005-12-22 Akim Demaille <akim@epita.fr>
2980
2981 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2982 (b4_yysymprint_generate): Rename as...
2983 (b4_yy_symbol_print_generate): this.
2984 Generate yy_symbol_print instead of yysymprint.
2985 Generate also yy_symbol_value_print, and use it.
2986
2987 2005-12-22 Akim Demaille <akim@epita.fr>
2988
2989 * NEWS: Warn about unused values.
2990 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2991 a `used' member.
2992 (symbol_list_n_get, symbol_list_n_used_set): New.
2993 (symbol_list_n_type_name_get): Use symbol_list_n_get.
2994 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
2995 * src/reader.c (grammar_current_rule_check): Check that values are
2996 used.
2997 * src/symtab.c (symbol_print): Accept 0.
2998 * tests/existing.at: Remove the type information.
2999 Empty the actions.
3000 Remove useless actions (beware of mid-rule actions: perl -000
3001 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3002 * tests/actions.at (Exotic Dollars): Use unused values.
3003 * tests/calc.at: Likewise.
3004 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3005 Likewise.
3006
3007 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3008 rule_useful_p.
3009
3010 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3011
3012 Undo 2005-12-01 tentative license wording change. The wording is
3013 still being reviewed by the lawyers, and we don't want to wait for
3014 them before publishing a test release. For now, revert to the
3015 previous wording.
3016 * NEWS: Undo 2005-12-01 change.
3017 * data/glr.c: Revert to previous license wording.
3018 * data/glr.cc: Likewise.
3019 * data/lalr1.cc: Likewise.
3020 * data/location.cc: Likewise.
3021 * data/yacc.c: Likewise.
3022
3023 * NEWS: Reword %destructor vs YYABORT etc.
3024 * data/glr.c: Use American spacing, for consistency.
3025 * data/glr.cc: Likewise.
3026 * data/lalr1.cc: Likewise.
3027 * data/yacc.c: Likewise.
3028 * data/yacc.c: Reformat comments slightly.
3029 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3030 for consistency. Fix some spelling errors and reword recently-included
3031 text slightly.
3032 * tests/cxx-type.at: Cast results of malloc, for C++.
3033
3034 2005-12-21 Joel E. Denny <address@hidden>
3035
3036 * tests/cxx-type.at: Construct a tree, count the parents of shared
3037 nodes, and free each node once and only once. Previously, the memory
3038 for semantic values was leaked instead.
3039
3040 2005-12-21 Joel E. Denny <address@hidden>
3041
3042 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3043 (yylval, yylloc): If pure, #define to yystackp->yyval and
3044 yystackp->yyloc similar to yychar and yynerrs.
3045 (yyparse): If pure, remove local yylval and yylloc. Add local
3046 yystackp to accommodate pure definitions of yylval and yylloc.
3047 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3048 yylvalp and yyllocp to &yylval and &yylloc.
3049 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3050 namespace. Previously, nerrs and char were missing, but lval and lloc
3051 weren't necessary.
3052 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3053 yylvalp and yyllocp parameters since, if pure, these are now always
3054 accessible through yystackp. If not pure, they are still accessible
3055 globally.
3056 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3057 `if (YYID (N))' to pacify lint.
3058
3059 2005-12-21 Akim Demaille <akim@epita.fr>
3060
3061 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3062 destroy the RHS symbols of a rule.
3063 * data/yacc.c (yylen): Initialize to 0.
3064 Keep its value to the number of items to possibly shift.
3065 In particular, a regular successful parse that ends on YYFINAL by
3066 a (internal) YYACCEPT must not have yylen != 0.
3067 (yyerrorlab, yyreturn): Pop the RHS.
3068 Reorder a bit to emphasize the `shifting' bits of code.
3069 (YYPOPSTACK): Now accept a number of items to pop.
3070 * data/lalr1.cc: Likewise.
3071 * data/glr.c: Formatting changes.
3072 Use goto instead of fall through.
3073 * doc/bison.texinfo (Destructor Decl): Complete.
3074
3075 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3076
3077 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3078 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3079 * djgpp/config.bat: Replace every occurence of the file name
3080 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3081 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3082 * djgpp/config.sed: Replace every occurence of the file name
3083 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3084 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3085 * djgpp/djunpack.bat: DJGPP specific file.
3086 * djgpp/fnchange.lst: DJGPP specific file.
3087 * djgpp/README.in: Add new information about how to unpack the bison
3088 source on MSDOS and other systems which have 8.3 file name restrictions
3089 using djunpack.bat and fnchange.lst.
3090
3091 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3092
3093 * bootstrap (build_cvs_prefix): Remove; unused.
3094 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3095 when getting gnulib.
3096
3097 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3098
3099 * data/glr.c: Reorder typedef declarations for structs to match order
3100 of struct declarations.
3101 Rename yystack everywhere to yystackp except in yyparse where it's not
3102 a pointer.
3103 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3104 consistency.
3105 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3106 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3107 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3108 lint.
3109
3110 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3111
3112 * tests/sets.at (Accept): Fix typos in regular expression used to
3113 sed out the final state number.
3114
3115 Work around portability problem on Solaris 10: flex-generated
3116 files include <stdio.h> before <config.h>, which messes up
3117 because the latter defines __EXTENSIONS__. Address the problem
3118 by creating two new little files that include <config.h> first,
3119 then include the flex-generated files. Rewrite everyone else
3120 to include <config.h> first, as well.
3121 * lib/timevar.c: Always include "config.h".
3122 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3123 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3124 (EXTRA_bison_SOURCES): New macro.
3125 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3126 * src/system.h: Don't include config.h.
3127 * src/LR0.c: Include <config.h> first.
3128 * src/assoc.c: Likewise.
3129 * src/closure.c: Likewise.
3130 * src/complain.c: Likewise.
3131 * src/conflicts.c: Likewise.
3132 * src/derives.c: Likewise.
3133 * src/files.c: Likewise.
3134 * src/getargs.c: Likewise.
3135 * src/gram.c: Likewise.
3136 * src/lalr.c: Likewise.
3137 * src/location.c: Likewise.
3138 * src/main.c: Likewise.
3139 * src/muscle_tab.c: Likewise.
3140 * src/nullable.c: Likewise.
3141 * src/output.c: Likewise.
3142 * src/parse-gram.y: Likewise.
3143 * src/print.c: Likewise.
3144 * src/print_graph.c: Likewise.
3145 * src/reader.c: Likewise.
3146 * src/reduce.c: Likewise.
3147 * src/relation.c: Likewise.
3148 * src/state.c: Likewise.
3149 * src/symlist.c: Likewise.
3150 * src/symtab.c: Likewise.
3151 * src/tables.c: Likewise.
3152 * src/uniqstr.c: Likewise.
3153 * src/vcg.c: Likewise.
3154
3155 * src/parse-gram.y: Fix minor problems uncovered by lint.
3156 (current_lhs, current_lhs_location): Now static.
3157 (current_assoc): Remove unused variable.
3158
3159 Cleanups so that Bison-generated parsers have less lint.
3160 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3161 Prepend /*ARGSUSED*/, for lint's sake.
3162 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3163 definition if 'lint' is defined.
3164 (YYID): New macro (or function, if lint).
3165 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3166 * data/yacc.c: Likewise.
3167 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3168 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3169 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3170 is C++ only.
3171 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3172 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3173 Use YYID(0) rather than 0, for lint.
3174 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3175 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3176
3177 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3178
3179 * tests/glr-regression.at
3180 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3181 Close memory leak reported by twlevo.
3182
3183 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3184
3185 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3186 all stacks.
3187 (yyparse): Iterate another stack in order to call user destructors.
3188 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3189 New test case.
3190 (Duplicated user destructor for lookahead): This test now is expected
3191 to succeed.
3192
3193 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3194
3195 * NEWS: Document the following change.
3196 * data/yacc.c: Say "parser skeleton" rather than "file", since
3197 it's no longer just a file.
3198 * data/glr.c: Grant a special exception for C GLR parsers, that
3199 reads like the already-existing exception for C LALR(1) parsers.
3200 * data/glr.cc: Likewise.
3201 * data/lalr1.cc: Likewise.
3202 * data/location.cc: Likewise.
3203 * data/yacc.c: Reword the "written by" statement to clarify that
3204 it was the parser skeleton, not the entire output file.
3205 * data/glr.c: Written by Paul Hilfinger.
3206 * data/glr.cc: Written by Akim Demaille.
3207 * data/lalr1.cc: Likewise.
3208
3209 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3210
3211 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3212 Fix typos in previous change that broke 'make check'.
3213 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3214 supported in C.
3215 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3216 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3217 We can revert this once things settle down.
3218
3219 * src/conflicts.c (conflicts_print): Don't print file name twice
3220 when %expect fails because there were no conflicts.
3221 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3222 change.
3223 * tests/conflicts.at (%expect not enough, %expect too much):
3224 (%expect with reduce conflicts): Adjust to new behavior.
3225
3226 2005-11-18 Akim Demaille <akim@epita.fr>
3227
3228 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3229 errors.
3230 * NEWS: Document this.
3231 * doc/bison.texinfo (Expect Decl): Likewise.
3232
3233 2005-11-16 Akim Demaille <akim@epita.fr>
3234
3235 Generalize the display of semantic values and locations in traces.
3236 * data/glr.c (yy_reduce_print): Fix indices (again).
3237 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3238 literal integers.
3239 * data/lalr1.cc (yyreduce_print): Rename as...
3240 (yy_reduce_print): this.
3241 Display values and locations.
3242 * data/yacc.c (yy_reduce_print): Likewise.
3243 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3244 (yysymprint): Move higher to be visible from yy_reduce_print).
3245 (yyparse): Adjust.
3246 * tests/calc.at: Adjust the expected length of the traces.
3247
3248 2005-11-14 Akim Demaille <akim@epita.fr>
3249
3250 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3251 from 1 to N, while values and location start at 0.
3252 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3253
3254 2005-11-14 Akim Demaille <akim@epita.fr>
3255
3256 * data/glr.c (yy_reduce_print): Fix the $ number.
3257
3258 2005-11-14 Akim Demaille <akim@epita.fr>
3259
3260 "Use" parse parameters.
3261 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3262 * data/glr.c, data/glr.cc: Use them.
3263 * data/glr.c (YYUSE): Have a C++ definition that supports
3264 non-pointer types.
3265
3266 2005-11-14 Akim Demaille <akim@epita.fr>
3267
3268 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3269
3270 2005-11-14 Akim Demaille <akim@epita.fr>
3271
3272 * data/glr.cc: New.
3273 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
3274
3275 2005-11-12 Akim Demaille <akim@epita.fr>
3276
3277 Let position and location be PODs.
3278 * data/location.cc (position::initialize, location::initialize): New.
3279 (position::position, location::location): Define only if
3280 b4_location_constructors is defined.
3281 * data/lalr1.cc (b4_location_constructors): Define it for backward
3282 compatibility.
3283 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3284
3285 2005-11-12 Akim Demaille <akim@epita.fr>
3286
3287 * data/lalr1.cc: Move the body of the ctor and dtor into the
3288 parser file (instead of the header).
3289 Wrap the implementations in a "namespace yy".
3290
3291 2005-11-12 Akim Demaille <akim@epita.fr>
3292
3293 Have glr.c include its header file when created.
3294 * data/glr.c (b4_shared_declarations): New.
3295 Output them verbatim in the parser if !%defines, otherwise
3296 output then in the header file, and include it instead.
3297
3298 2005-11-11 Akim Demaille <akim@epita.fr>
3299
3300 * data/glr.c: Comment changes.
3301
3302 2005-11-11 Akim Demaille <akim@epita.fr>
3303
3304 When yydebug, report semantic and location values for reductions.
3305 * data/glr.c (yy_reduce_print): Report the semantic values and the
3306 locations.
3307 (YY_REDUCE_PRINT): Adjust.
3308 (yyglrReduce): Use them.
3309 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3310 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3311 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3312 traces.
3313
3314 2005-11-10 Akim Demaille <akim@epita.fr>
3315
3316 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3317 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3318 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3319
3320 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3321
3322 * m4/cxx.m4, examples/Makefile.am: Don't build
3323 examples/calc++ if no C++ compiler is available. (trivial change)
3324
3325 2005-11-09 Akim Demaille <akim@epita.fr>
3326
3327 * src/scan-skel.l: Use a couple of asserts.
3328
3329 2005-11-03 Akim Demaille <akim@epita.fr>
3330
3331 In some (weird) cases, the final state number is incorrect.
3332 Reported by Alexandre Duret-Lutz.
3333 * src/LR0.c (state_list_append): Remove the computation of
3334 final_state.
3335 (save_reductions): Do it here.
3336 (get_state): Alpha conversion.
3337 (generate_states): Use a for loop.
3338 * src/gram.h (item_number_is_rule_number)
3339 (item_number_is_symbol_number): New.
3340 * src/state.c: Use assert.
3341 * src/system.h: Include assert.h.
3342 * tests/sets.at (Accept): New.
3343
3344 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3345
3346 * data/glr.c (yyfill): Adjust comment.
3347 (yyresolveAction): Initialize default location properly
3348 for empty right-hand sides.
3349 (yydoAction): Ditto.
3350 Add comment explaining apparently dead code.
3351 * tests/glr-regression.at
3352 (Incorrectly initialized location for empty right-hand side in GLR):
3353 New test.
3354
3355 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3356
3357 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3358 gnulib when interrupted. This fixes some race conditions and
3359 works around some portability problems (one noted by Paul
3360 Hilfinger).
3361
3362 2005-10-22 Akim <akim@epita.fr>
3363
3364 * Makefile.cfg: Adjust to config -> build-aux.
3365 Reported by twledo.
3366
3367 2005-10-21 Akim Demaille <akim@epita.fr>
3368
3369 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3370 the %parse-params.
3371 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3372 * data/yacc.c (b4_Pure_if): Rename as...
3373 (b4_yacc_pure_if): this.
3374 (YY_SYMBOL_PRINT, yyparse): Adjust.
3375 * doc/bison.texinfo: Formatting changes.
3376
3377 2005-10-21 Akim Demaille <akim@epita.fr>
3378
3379 Finish the transition config -> build-aux.
3380 * configure.ac, Makefile.am: Use build-aux.
3381 * config/prev-version, config/announce-gen, config/Makefile.am:
3382 Move to...
3383 * build-aux/prev-version, build-aux/announce-gen,
3384 * build-aux/Makefile.am: here.
3385
3386 2005-10-14 Akim Demaille <akim@epita.fr>
3387
3388 * examples/calc++/test: Use set -x only when VERBOSE.
3389
3390 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3391
3392 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3393 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3394
3395 2005-10-13 Akim Demaille <akim@epita.fr>
3396
3397 * src/scan-skel.l: Output the base name parts of the parser and
3398 header file names.
3399 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
3400 additional checks.
3401 Use this to exercise C++ outputs in subdirs.
3402 Reported by Oleg Smolsky.
3403
3404 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3405
3406 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3407 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3408 Problem reported by John P. Hartmann.
3409 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3410 already defined it.
3411
3412 2005-10-12 Akim Demaille <akim@epita.fr>
3413
3414 * src/parse-gram.y (version_check): Exit 63 to please missing
3415 (stands for "version mismatch).
3416 * tests/input.at, doc/bison.texinfo: Adjust.
3417
3418 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3419
3420 Work around portability problems with Visual Age C compiler
3421 (xlc and xlC_r) reported by John P. Hartmann.
3422 * data/location.cc (initial_column, initial_line): Remove.
3423 All uses replaced by 0 and 1.
3424 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3425 that xlc complains about.
3426 * src/scan-skel.l (skel_wrap): Likewise.
3427 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
3428 as __STDC__.
3429 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3430 __STDC_VERSION__. Use it everywhere instead of looking at
3431 __STDC__ and __cplusplus.
3432
3433 2005-10-10 Akim Demaille <akim@epita.fr>
3434
3435 * examples/calc++/test: Be quiet unless VERBOSE.
3436
3437 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3438
3439 * data/c.m4 (yydestruct, yysymprint):
3440 Use YYUSE instead of casting to void.
3441 * data/glr.c (YYUSE): New macro.
3442 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3443 Use it instead of rolling our own.
3444 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3445 (YYCHK1):
3446 Use /*CONSTCOND*/ to suppress lint warnings.
3447 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3448 (YY_STACK_PRINT): Use 'false' not '0'.
3449 (YYUSE): New macro.
3450 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3451 * data/yacc.c (YYUSE): New macro.
3452 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3453 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3454 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3455
3456
3457 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3458 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3459
3460 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3461
3462 Undo the parts of the unlocked-I/O change that substituted
3463 putc or puts for printf. This might hurt performance a bit,
3464 but some people prefer the printf style.
3465 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3466 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3467 All uses replaced by YYFPRINTF and YYDPRINTF.
3468 * data/yacc.c: Likewise.
3469 * lib/bitset.c (bitset_print): Likewise.
3470 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3471 putc and puts.
3472 * lib/lbitset.c (debug_lbitset): Likewise.
3473 * src/closure.c (print_firsts, print_fderives): Likewise.
3474 * src/gram.c (grammar_dump): Likewise.
3475 * src/lalr.c (look_ahead_tokens_print): Likewise.
3476 * src/output.c (escaped_output): Likewise.
3477 (user_actions_output): Break apart two printfs.
3478 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3479 * src/reduce.c (reduce_print): Likewise.
3480 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3481 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3482
3483 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3484 Use assignments rather than casts-to-void to suppress
3485 unused-variable warnings. This pacifies 'lint'.
3486 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3487 unused-variable warnings.
3488
3489 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3490
3491 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3492
3493 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3494
3495 Use unlocked I/O for a minor performance improvement on hosts like
3496 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3497 is to use the gnlib unlocked-io module, and to prefer putc and
3498 puts to printf when either will work (since the latter doesn't
3499 come in an unlocked flavor).
3500 * bootstrap (gnulib_modules): Add unlocked-io.
3501 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3502 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3503 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3504 and similarly for puts and putc and printf.
3505 * data/yacc.c: Likewise.
3506 * lib/bitset.c (bitset_print): Likewise.
3507 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3508 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3509 to printf.
3510 * lib/lbitset.c (debug_lbitset): Likewise.
3511 * src/closure.c (print_firsts, print_fderives): Likewise.
3512 * src/gram.c (grammar_dump): Likewise.
3513 * src/lalr.c (look_ahead_tokens_print): Likewise.
3514 * src/output.c (escaped_output): Likewise.
3515 (user_actions_output): Coalesce two printfs.
3516 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
3517 * src/reduce.c (reduce_print): Likewise.
3518 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3519 * src/system.h: Include unlocked-io.h rather than stdio.h.
3520
3521 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3522 this confuses xgettext.
3523
3524 2005-10-02 Akim Demaille <akim@epita.fr>
3525
3526 * bootstrap (gnulib_modules): Add strverscmp.
3527 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3528 * m4/.cvsignore: Add strverscmp.m4.
3529 * src/parse-gram.y (%require): New token, new rule.
3530 (version_check): New.
3531 * src/scan-gram.l (%require): Adjust.
3532 * tests/input.at (AT_REQUIRE): New.
3533 Use it.
3534 * doc/bison.texinfo (Require Decl): New.
3535 (Calc++ Parser): Use %require.
3536
3537 2005-10-02 Akim Demaille <akim@epita.fr>
3538
3539 * data/location.cc: New.
3540
3541 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3542 Akim Demaille <akim@epita.fr>
3543
3544 Make sure -odir/foo.cc creates dir/location.hh etc.
3545 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3546 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3547 (spec_defines_file): Now const.
3548 (dir_prefix): New.
3549 (short_base_name): Remove.
3550 * src/files.c: Adjust.
3551 (dirname.h): Include.
3552 (base_name): Don't prototype it.
3553 (finput): Remove, duplicates gram_in.
3554 (full_base_name, short_base_name): Replace by...
3555 (all_but_ext, all_but_tab_ext): these.
3556 (compute_base_names): Rename as...
3557 (compute_file_name_parts): this.
3558 Update to compute the new variables, including dir_prefix.
3559 Adjust dependencies.
3560 * src/output.c (prepare): Output them.
3561 * src/reader.c: Adjust to use gram_in, not finput.
3562 * src/scan-skel.l (@dir_prefix@): New.
3563
3564 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3565
3566 * lib/subpipe.c: New function end_of_output_subpipe() added
3567 to allow support for non-posix systems. This is a no-op function
3568 for posix systems.
3569
3570 * lib/subpipe.h: New function end_of_output_subpipe() added
3571 to allow support for non-posix systems. This is a no-op function
3572 for posix systems.
3573
3574 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3575 handle the lack of pipe/fork functionality on non-posix systems.
3576
3577 * djgpp/Makefile.maint: DJGPP specific file.
3578
3579 * djgpp/README.in: DJGPP specific file.
3580
3581 * djgpp/config.bat: DJGPP specific configuration file.
3582
3583 * djgpp/config.sed: DJGPP specific configuration file.
3584
3585 * djgpp/config.site: DJGPP specific configuration file.
3586
3587 * djgpp/config_h.sed: DJGPP specific configuration file.
3588
3589 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3590
3591 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3592
3593 2005-10-02 Akim Demaille <akim@epita.fr>
3594
3595 * data/location.cc: New, extract from...
3596 * data/lalr1.cc: here.
3597 (location.hh): Include it after the user prologue, in case the
3598 filename type is defined by the user.
3599 Forward declation location and position before the pre-prologue.
3600 (yyresult_): Rename as...
3601 (yyresult): this, it's a local variable, not an attribute.
3602 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
3603
3604 2005-10-01 Akim Demaille <akim@epita.fr>
3605
3606 * examples/extexi: Restore the #line generation.
3607
3608 2005-09-30 Akim Demaille <akim@epita.fr>,
3609 Alexandre Duret-Lutz <adl@gnu.org>
3610
3611 Move the token type and YYSTYPE in the parser class.
3612 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
3613 (parser::token): New, from the moved free definition of tokens.
3614 (parser::semantic_value): Now a full definition instead of an
3615 indirection to YYSTYPE.
3616 (b4_post_prologue): No longer included in the header file, but
3617 in the implementation file.
3618 * doc/bison.texi (C+ Language Interface): Update.
3619 * src/parse-gram.y: Support unary %define.
3620 * tests/actions.at: Define global_tokens_and_yystype for backward
3621 compatibility until we update the tests.
3622 * tests/calc.at: Idem.
3623 (first_line, first_column, last_line, last_column): Define for lalr1.cc
3624 to simplify the code.
3625
3626 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3627
3628 Port to SunOS 4.1.4, which lacks strtoul and strerror.
3629 Ah, the good old days! Problem reported by Peter Klein.
3630 * bootstrap (gnulib_modules): Add strerror, strtoul.
3631 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
3632 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
3633
3634 2005-09-29 Akim Demaille <akim@epita.fr>
3635
3636 * data/c.m4 (b4_error_verbose_if): New.
3637 * data/lalr1.cc: Use it.
3638 (YYERROR_VERBOSE_IF): Remove.
3639 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
3640 parser members, replaced by...
3641 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
3642 local variables.
3643 (yysyntax_error_): Takes the state number as argument.
3644 (yyreduce_print_): Use the argument yyrule, not the former
3645 attribute yyn_.
3646
3647 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3648
3649 * bootstrap (gnulib_modules): Add verify.
3650 * lib/.cvsignore: Add verify.h.
3651 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
3652 * src/system.h (verify): Remove.
3653 Include verify.h instead.
3654 * src/tables.c (tables_generate): Use new API for 'verify'.
3655
3656 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3657
3658 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
3659 local variables whose names begin with 'yy'.
3660 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
3661 Trivial changes from Joel E. Denny.
3662
3663 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3664 it itself.
3665 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3666 don't use alloca any more.
3667
3668 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
3669 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
3670 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
3671 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
3672 to match yacc.c, to test more hosts.
3673
3674 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3675
3676 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
3677 doesn't affect behavior.
3678 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
3679 Solaris, AIX, MSC.
3680 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
3681 This works a bit better with glibc, if user code has already included
3682 stdlib.h.
3683 * doc/bison.texinfo (Bison Parser): Document that users can't
3684 arbitrarily use malloc and free for other purposes. Document
3685 that <alloca.h> and <malloc.h> might be included.
3686 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
3687 user must declare alloca.
3688
3689 * HACKING (release): Forwarn the Translation Project about
3690 stable releses.
3691
3692 2005-09-20 Akim Demaille <akim@epita.fr>
3693
3694 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3695
3696 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3697
3698 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
3699 (YYSTACK_ALLOC_MAXIMUM): Use it.
3700 (yysyntax_error): New function.
3701 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
3702 multiple syntax errors are reported, and alloca is being used.
3703 Instead, reallocate buffers twice as big each time, so that
3704 we waste at most half the allocated memory. Start with a small
3705 (128-byte) buffer that will suffice in most cases anyway.
3706 Use yysyntax_error to do most of the work.
3707
3708 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3709 yynerrs is the number of errors reported, not the number of
3710 errors encountered.
3711
3712 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3713 Mark it as expected to fail.
3714 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3715 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3716 Don't start user-code symbols with "yy", to avoid name space problems.
3717
3718 2005-09-19 Akim Demaille <akim@epita.fr>
3719
3720 Remove the traits, failed experiment.
3721 It never proved useful, and anyway because of the current
3722 definition, it was not possible to have several specialization of
3723 this traits, making it useless.
3724 * data/lalr1.cc (yy:traits): Remove.
3725 Inline its definitions in the parser class.
3726
3727 2005-09-19 Akim Demaille <akim@epita.fr>
3728
3729 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3730 least Mac OSX with a /usr/local install of gettext.
3731
3732 2005-09-19 Akim Demaille <akim@epita.fr>
3733
3734 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3735 and yytoken for similarity with the other skeletons.
3736
3737 2005-09-19 Akim Demaille <akim@epita.fr>
3738
3739 * NEWS, configure.ac: update version number to 2.1a.
3740
3741 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3742
3743 * NEWS: Version 2.1.
3744
3745 * NEWS: Remove notice of yytname change, since it was never in an
3746 official release.
3747 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3748 diagnostic.
3749 * src/output.c (prepare): Likewise.
3750 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3751 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3752 is not defined. This is an awful hack, but it's enough for now.
3753 All callers changed.
3754 * tests/glr-regression-at (make_value): Args are const pointers now,
3755 to avoid GCC warning.
3756 (Duplicated user destructor for lookahead): New test. Currently
3757 skipped. It fails on my host but I'm not sure it'll always fail.
3758
3759 2005-09-16 Akim Demaille <akim@epita.fr>
3760
3761 * src/symtab.h (struct symbol): Declare the printer and destructor
3762 as const, to avoid accidental calls to free.
3763 (symbol_destructor_set, symbol_printer_set): Adjust.
3764 * src/symtab.c: Adjust.
3765
3766 2005-09-16 Akim Demaille <akim@epita.fr>
3767
3768 * data/c.m4 (b4_token_enums): New.
3769 (b4_token_defines): Rename as...
3770 (b4_token_enums_defines): this.
3771 (b4_token_defines): New, output only the #defines.
3772 * data/yacc.c, data/glr.c: Adjust.
3773 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3774 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3775 as default values.
3776
3777 2005-09-16 Akim Demaille <akim@epita.fr>
3778
3779 * data/lalr1.cc (yylex_): Remove, inline its code.
3780 (yyreport_syntax_error_): Remove, replaced by...
3781 (yysyntax_error_): this which returns a string and leaves to the
3782 caller the call to the users' error function.
3783 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3784 Move from members of the parser object...
3785 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3786 to local variables of the parse function.
3787
3788 2005-09-16 Akim Demaille <akim@epita.fr>
3789
3790 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3791 since it's in Bison's name space.
3792
3793 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3794
3795 * data/glr.c (yyresolveValue): Add default case to pacify
3796 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3797
3798 * NEWS: Document when yyparse started to return 2.
3799 * doc/bison.texinfo (Parser Function): Document when yyparse
3800 returns 2.
3801
3802 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3803 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3804 changed.
3805 (class position): file_name -> filename (reverting). All uses changed.
3806
3807 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3808
3809 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3810 do anything if $@ exists. This reverts part of the 2005-07-07
3811 patch.
3812
3813 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3814
3815 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3816 contains obsolete information and isn't worth distributing as a
3817 separate file anyway.
3818 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3819 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3820 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3821 (yyparse): Abort if user code uses longjmp to throw an unexpected
3822 value.
3823
3824 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3825
3826 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3827 Suggested by twlevo@xs4all.nl.
3828
3829 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3830 This avoids a diagnostic from gcc -Wswitch-enum.
3831 Problem reported by twlevo@xs4all.nl.
3832
3833 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3834 standards. Use "file name" or "file" or "name", depending on
3835 the context.
3836 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3837 not to hack/foo.tab.c.
3838 (Calc++ Top Level): 2nd arg of main is not const.
3839 * data/glr.c: b4_filename -> b4_file_name.
3840 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3841 All uses changed.
3842 (class position): filename -> file_name. All uses changed.
3843 * data/yacc.c: b4_filename -> b4_file_name.
3844 * lib/bitset.h: filename -> file_name in local vars.
3845 * lib/bitset_stats.c: Likewise.
3846 * src/files.c: Likewise.
3847 * src/scan-skel.l ("@output ".*\n): Likewise.
3848 * src/files.c (file_name_split): Renamed from filename_split.
3849 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
3850
3851 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3852
3853 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3854 to accommodate latest gnulib.
3855
3856 * tests/glr-regression.at (Duplicate representation of merged trees):
3857 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3858
3859 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3860 needed.
3861
3862 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3863
3864 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3865 All uses changed. Invoke user destructor after an error during a
3866 split parse (trivial change from Joel E. Denny).
3867
3868 * tests/glr-regression.at
3869 (User destructor after an error during a split parse): New test case.
3870 Problem reported by Joel E. Denny in:
3871 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3872
3873 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3874
3875 * README-cvs: Give URLs for recommended tools.
3876 Mention Gzip version problem, and bootstrapping issues.
3877 Remove troubleshooting section, as it's somewhat obsolete.
3878
3879 * bootstrap (no_cache): New var, to accommodate different wget
3880 variants. Use it instead of '-C off'. Problem reported by
3881 twlevo@xs4all.nl.
3882
3883 * data/glr.c (yydestroyStackItem): New function.
3884 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
3885 debugging information. Problem reported by Joel E. Denny.
3886
3887 2005-08-25 Akim Demaille <akim@epita.fr>
3888
3889 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3890
3891 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3892
3893 * data/glr.c (yyrecoverSyntaxError, yyreturn):
3894 Don't invoke destructor on unresolved entries.
3895 * tests/glr-regression.at
3896 (User destructor for unresolved GLR semantic value): New test case.
3897 Problem reported by Joel E. Denny in:
3898 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
3899
3900 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3901
3902 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3903 Add strnlen.c.
3904 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3905 lib-prefix.m4, po.m4.
3906
3907 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
3908 in yydestruct diagnostic, since it might not be an error.
3909 Problem reported by Joel Denny near end of
3910 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3911 * data/lalr1.cc (yyerturn): Likewise.
3912 * data/yacc.c (yyreturn): Likewise.
3913 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
3914
3915 * src/files.c: Remove obsolete FIXME comment.
3916
3917 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
3918 with the other templates, and to fix bogus run-on messages such
3919 as the one reported at the end of
3920 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3921 All callers changed to avoid the newline.
3922 (yyprocessOneStack): Output two lines rather than one, to accommodate
3923 the above change. This changes the debug output format slightly.
3924
3925 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
3926 reported by Joel E. Denny in
3927 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
3928 (trivial change).
3929 * tests/glr-regression.at (Duplicate representation of merged trees):
3930 New test, from Joel E. Denny in:
3931 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
3932 * THANKS: Add Joel E. Denny.
3933
3934 * configure.ac (AC_INIT): Bump to 2.0c.
3935
3936 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3937
3938 * NEWS: Version 2.0b.
3939
3940 * Makefile.am (SUBDIRS): Put examples before tests, so that
3941 "make check" doesn't finish with "All 1 tests passed".
3942
3943 * tests/regression.at (Token definitions): Don't rely on
3944 AT_PARSER_CHECK for data that contains backslashes. It currently
3945 uses 'echo', and 'echo' isn't portable if its argument contains
3946 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3947 that the byte '\0xff' is not printable in the C locale; it is,
3948 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3949 not printable, so use '\0x81' to test.
3950
3951 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3952 version of GCC, since the macro is used with non-GCC compilers.
3953
3954 Fix core dump reported by Pablo De Napoli in
3955 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3956 * tests/regression.at (Invalid inputs with {}): New test.
3957 * src/parse-gram.y (token_name): Translate type before using
3958 it as an index.
3959
3960 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3961 the user's name space. All uses changed to __attribute__
3962 ((__unused__)).
3963 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3964 Add __attribute__ ((__noreturn__)).
3965
3966 * etc/clcommit: Remove. We weren't using it, and it failed
3967 "make maintainer-distcheck".
3968 * Makefile.maint: Merge from coreutils.
3969 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3970 (syntax-check-rules): Change list of rules as described below.
3971 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3972 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3973 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3974 (sc_trailing_space): New rules.
3975 (sc_xalloc_h_in_src): Remove.
3976 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3977 (sc_space_tab, sc_error_exit_success, sc_changelog):
3978 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3979 (makefile-check, po-check, author_mark_check):
3980 (makefile_path_separator_check, copyright-check):
3981 Use grep -n, to make it easier to find violations.
3982 Use CVS_LIST and CVS_LIST_EXCEPT.
3983 (header_regexp, h_re): Remove.
3984 (dd_c): New macro.
3985 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3986 (my-distcheck): Use more-modern GCC flags.
3987 (signatures, %.asc): Remove.
3988 (rel-files, announcement): Remove signatures.
3989 Restore old updating code, even though we don't use it, so
3990 that we're the same as coreutils.
3991 (alpha, beta, major): Depend on news-date-check.
3992 Make the upload commands.
3993
3994 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
3995 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
3996 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
3997 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
3998 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
3999 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4000 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4001 * tests/sets.at: Likewise.
4002
4003 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4004 we comment out the Autoconf version number.
4005 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4006 it's error-prone and "make maintainer-distcheck" rejects it.
4007
4008 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4009 Indent calls to "error" to pacify "make maintainer-distcheck",
4010 when the calls are not intended to be translated.
4011 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4012
4013 * src/Makefile.am (DEFS): Use +=, to pacify
4014 "make maintainer-distcheck".
4015 (bison_SOURCES): Add scan-skel.h.
4016 (sc_tight_scope): New rule, from coreutils.
4017
4018 * src/files.c (src_extension, header_extension):
4019 Now static, not extern.
4020 * src/getargs.c (short_options): Likewise.
4021 * src/muscle_tab.c (muscle_table): Likewise.
4022 * src/parse-gram.y (current_class, current_type, current_prec):
4023 Likewise.
4024 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4025 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4026 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4027 void, to avoid warning when NLS is disabled.
4028 * src/output.c: Include scan-skel.h.
4029 (scan_skel): Remove decl, since scan-skel.h does this.
4030 (output_skeleton):
4031 Indent calls to "error" to pacify "make maintainer-distcheck".
4032 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4033 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4034 "make maintainer-distcheck".
4035 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4036 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4037 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4038 (skel_lex_destroy, scan_skel): Move these decls to...
4039 * src/scan-skel.h: New file.
4040 * src/uniqstr.c (uniqstr_assert):
4041 Indent calls to "error" to pacify "make maintainer-distcheck".
4042
4043 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4044 not @VAR@.
4045
4046 * tests/torture.at: Revamp to avoid misuse of atoi that
4047 "make maintainer-distcheck" complained about.
4048
4049 * examples/extexi (message): Don't print a message more than once,
4050 and omit line-number decoration that makes Emacs compile think
4051 that informative messages are worth worrying about.
4052
4053 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4054
4055 * configure.ac: Update version number.
4056
4057 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4058 accidentally.
4059 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4060 autogenerated by the maintainer.
4061 * examples/calc++/.cvsignore: Add *.yy.
4062
4063 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4064 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4065 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4066
4067 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4068
4069 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4070 from maintainer-distcheck about casting the argument of 'free'.
4071
4072 * NEWS: Mention recent yytname changes.
4073 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4074
4075 * bootstrap: For translations that have not yet been upgraded to
4076 the new runtime-po domain, prime the pump by extracting the
4077 relevant strings from the obsolete translations. This code can be
4078 removed once the bison-runtime domain has been translated by each
4079 team.
4080
4081 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4082 now that token names are already quoted.
4083
4084 Fix problem reported by Anthony Heading.
4085 * data/glr.c (YYTOKEN_TABLE): New macro.
4086 (yytname): Define if YYTOKEN_TABLE.
4087 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4088 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4089 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4090 * src/output.c (prepare_symbols): Output token_table_flag.
4091
4092 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4093
4094 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4095 again if the first call fails.
4096
4097 * data/glr.c (yytnamerr): New function.
4098 (yyreportSyntaxError): Use it to dequote most string literals.
4099 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4100 with other skeletons. All uses changed.
4101 (yytnameerr_): New function.
4102 (yyreport_syntax_error): Use it to dequote most string literals.
4103 * data/yacc.c (yytnamerr): New function.
4104 (yyerrlab): Use it to decode most string literals.
4105 * doc/bison.texinfo (Decl Summary, Calling Convention):
4106 Clarify quoting convention of yytname.
4107 * src/output.c (prepare_symbols): Quote all names. This undoes
4108 the 2005-04-17 change, which is now accomplished (mostly) via
4109 changes in the parsers as described above.
4110 * tests/regression.at (Token definitions, Web2c Actions):
4111 Undo most 2005-04-17 change here, too.
4112
4113 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4114
4115 Fix more problems reported by twlevo@xs4all.nl.
4116 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4117 remove trailing spaces. This loses the exit status of ./types,
4118 and isn't needed since ./types shouldn't be emitting trailing
4119 spaces.
4120 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4121 as the stack isn't valid in that case.
4122
4123 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4124 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4125 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4126 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4127 is used.
4128 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4129 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4130 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4131 Likewise.
4132
4133 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4134 overly-picky compilers that reject 'char *foo = "bar";'.
4135
4136 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4137 to FILE * parameter, not to stderr. This fixes a typo introduced
4138 in the 2005-07-12 change.
4139
4140 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4141 warnings from GCC 4.
4142
4143 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4144 (yyglrShiftDefer, yysplitStack):
4145 Remove unused parameters b4_pure_formals. All uses changed.
4146 (yyglrShift): Remove unused parameters b4_user_formals.
4147 All uses changed.
4148 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4149
4150 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4151
4152 Destructor cleanups and regularization among the three skeletons.
4153 * NEWS: Document the behavior changes.
4154 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4155 stack before failing, as the cleanup code will do it for us now.
4156 * data/lalr1.cc (yyerrlab): Likewise.
4157 * data/glr.c (yyparse): Pop everything off the stack before
4158 freeing it, so that destructors get called properly.
4159 * data/lalr1.cc (yyreturn): Likewise.
4160 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4161 This is more consistent.
4162 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4163 why destructors might be called. 1.875 -> 2.1.
4164 (Destructor Decl, Decl Summary, Table of Symbols):
4165 Some English-language cleanups for %destructor.
4166 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4167 Add output line for destructor of start symbol.
4168 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4169 because of that same extra output line.
4170
4171 * NEWS: Document minor wording changes in diagnostics of
4172 Bison-generated parsers.
4173 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4174 Remove unused formals. All uses changed.
4175 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4176 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4177 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4178 Rename yyoverflowab to yyexhaustedlab.
4179 When memory exhaustion occurs during syntax-error reporting,
4180 report it separately rather than in a single diagnostic; this
4181 eases translation.
4182 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4183 (Memory Exhausted): Renamed from Parser Stack Overflow.
4184 Revamp wording slightly to prefer "memory exhaustion".
4185 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4186
4187 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4188
4189 Add i18n support to the GLR skeleton. Partially fix the C++
4190 skeleton; a C++ expert needs to finish this. Remove debugging
4191 msgids; there's little point to having them translated, since they
4192 can be understood only by someone who can read the
4193 (English-language) source code.
4194
4195 Generate runtime-po/bison-runtime.pot automatically, so that we
4196 don't have to worry about garbage getting in that file. We'll
4197 make sure after the next official release that old msgids don't
4198 get lost. See
4199 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4200
4201 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4202 Now auto-generated.
4203 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4204 Fix typos in explanations of the runtime file.
4205 * bootstrap: Change gettext keyword from YYI18N to YY_.
4206 Use standard Makefile.in.in in runtime-po, since we'll arrange
4207 for backward-compatible bison-runtime.po files in a different way.
4208 * data/glr.c (YY_): New macro, from yacc.c.
4209 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4210 Translate messages intended for users.
4211 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4212 the wording in the other skeletons. We don't know that the memory
4213 is virtual.
4214 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4215 Use same method that yacc.c uses.
4216 Don't translate debugging messages.
4217 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4218 it doesn't work (yet), and requires C++ expertise to fix.
4219 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4220 Move defn to a more logical place, to be consistent with other
4221 skeletons.
4222 Don't translate debugging messages.
4223 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4224 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4225 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4226 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4227
4228 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4229 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4230 void, not int.
4231 * tests/glr-regression.at (Badly Collapsed GLR States):
4232 Likewise.
4233 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4234 yylex should return 0 at EOF rather than aborting.
4235
4236 Improve tests for stack overflow in GLR parser.
4237 Problem reported by twlevo@xs4all.nl.
4238 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4239 All uses removed.
4240 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4241 can handle the problem.
4242 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4243 (yyparse): New local variable yyresult to record the result.
4244 Use result of setjmp to set it, rather than storing itinto
4245 struct.
4246 (yyDone): Remove label.
4247 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4248 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4249 if YYABORT is used).
4250 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4251 yyparse status; put status > 1 into diagnostic.
4252 Check that status==2 works.
4253 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4254 Use exit status 3 for failure to open (which shouldn't happen).
4255
4256 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4257
4258 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4259 1 on syntax error; just let yyparse do its thing.
4260 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4261 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4262 (Exploding the Stack Size with Alloca):
4263 (Exploding the Stack Size with Malloc):
4264 Expect exit status 2, not 1, since the parser is supposed to blow
4265 its stack. Problem reported by twlevo@xs4all.nl.
4266
4267 * data/glr.c (yyparse): Don't assume that the initial calls
4268 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4269 Print a stack-overflow message and fail instead.
4270 Initialize the line-number information before creating the stack,
4271 so that the stack-overflow message can report line zero safely.
4272
4273 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4274
4275 Fix problems reported by twlevo@xs4all.nl.
4276 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4277 (yyuserMerge): Provide a default case if b4_mergers is empty.
4278 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4279 * tests/glr-regression.at
4280 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4281 Add casts to pacify C++ compilers.
4282 * tests/glr-regression.at (Improper merging of GLR delayed action
4283 sets): Declare yylex before using it.
4284 * tests/Makefile.am (maintainer-check-g++): Fix a stray
4285 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4286 test for valgrind; valgrind is independent of g++.
4287 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4288 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4289 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4290 Use a destructor, so that we can expand the stack. Change
4291 YYSTYPE to char * so that we can free it. Cast result of malloc.
4292
4293 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4294
4295 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4296 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4297
4298 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4299
4300 * PACKAGING: New file, suggested by Bruno Haible and taken from
4301 similar wording in gettext's PACKAGING file.
4302 * NEWS: Mention PACKAGING.
4303 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4304
4305 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4306
4307 * NEWS: Document recent i18n improvements.
4308 * bootstrap: Get runtime translations into runtime-po.
4309 Create runtime-po files automatically, if possible.
4310 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4311 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4312 does not infringe on the user's name space.
4313 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4314 * doc/bison.texinfo (Internationalization): Revamp the English
4315 and Texinfo syntax a bit, to try to make it clearer.
4316 (Bison Options, Option Cross Key): Mention --print-localedir.
4317 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4318 YYENABLE_NLS. Quote a bit more.
4319 * runtime-po/.cvsignore: New file.
4320 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4321 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4322 * runtime-po/quot.sed: Likewise.
4323 * runtime-po/boldquot.sed: Likewise.
4324 * runtime-po/en@quot.header: Likewise.
4325 * runtime-po/en@boldquot.header: Likewise.
4326 * runtime-po/insert-header.sin: Likewise.
4327 * runtime-po/remove-potcdate.sin: Likewise.
4328 * runtime-po/Makevars: Likewise.
4329 * runtime-po/LINGUAS: Likewise.
4330 * runtime-po/de.po: Likewise; we will rely on the translation project
4331 to maintain this, so "bootstrap" should get it.
4332 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
4333 its value.
4334 * src/main.c (main): Bind the bison-runtime domain, too.
4335
4336 2005-07-12 Bruno Haible <bruno@clisp.org>
4337
4338 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4339 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4340 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4341 * runtime-po: New directory.
4342 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4343 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4344 * runtime-po/Rules-quot: New file, copied from po/.
4345 * runtime-po/quot.sed: Likewise.
4346 * runtime-po/boldquot.sed: Likewise.
4347 * runtime-po/en@quot.header: Likewise.
4348 * runtime-po/en@boldquot.header: Likewise.
4349 * runtime-po/insert-header.sin: Likewise.
4350 * runtime-po/remove-potcdate.sin: Likewise.
4351 * runtime-po/Makevars: New file.
4352 * runtime-po/POTFILES.in: New file.
4353 * runtime-po/LINGUAS: New file.
4354 * runtime-po/bison-runtime.pot: New file.
4355 * runtime-po/de.po: New file.
4356 * m4/bison.m4: New file.
4357 * Makefile.am (SUBDIRS): Add runtime-po.
4358 (aclocaldir, aclocal_DATA): New variables.
4359 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4360 Define aclocaldir.
4361 * src/getargs.c (usage): Document --print-localedir option.
4362 (PRINT_LOCALEDIR_OPTION): New enum item.
4363 (long_options): Add --print-localedir option.
4364 (getargs): Handle --print-localedir option.
4365 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4366 (Internationalization): New section.
4367
4368 2005-07-12 Akim Demaille <akim@epita.fr>
4369
4370 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4371 for consistency with the rest of the code.
4372 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4373 Add separators.
4374
4375 2005-07-12 Akim Demaille <akim@epita.fr>
4376
4377 * src/parse-gram.y: Use %printer instead of YYPRINT.
4378
4379 2005-07-12 Akim Demaille <akim@epita.fr>
4380
4381 * src/symtab.h, src/symtab.c (symbol_print): New.
4382 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4383 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4384
4385 2005-07-12 Akim Demaille <akim@epita.fr>
4386
4387 * data/glr.c (b4_syncline): Fix (swap) the definitions of
4388 b4_at_dollar and b4_dollar_dollar.
4389
4390 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4391
4392 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4393 and Pennello's paper.
4394
4395 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4396
4397 * data/yacc.c (yyparse): Undo previous patch. Instead,
4398 set yylsp[0] and yyvsp[0] only if the initial action
4399 sets yylloc and yylval, respectively.
4400
4401 * data/yacc.c (yyparse): In the initial action, set
4402 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4403 This avoids the use of undefined variables if the initial
4404 action does not set yylloc and/or yylval.
4405
4406 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4407
4408 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4409 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4410 Remove from CVS. These files are automatically generated.
4411 * examples/extexi: Clarify that this file is now part of Bison,
4412 not GNU M4, and that it works with any POSIX-compatible Awk.
4413 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4414 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4415 so that we also get calc++-parser.yy. Geneate it.
4416 Use $(AWK), not gawk, since any conforming Awk will do.
4417 Put comment before action, since older 'make' can't handle comment
4418 in action.
4419 $(BUILT_SOURCES): List all built sources, not just some of them.
4420 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4421 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4422 $($(calc_sources_generated)): Remove unnecessary test for existence
4423 of target. (This had a shell syntax error anyway; a stray "x".)
4424 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4425 calc++-parser.yy.
4426 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4427
4428 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4429 implied by the other modules.
4430
4431 2005-07-06 Akim Demaille <akim@epita.fr>
4432
4433 Bind examples/calc++ to the package.
4434 * examples/calc++/Makefile: Remove, replaced by...
4435 * examples/calc++/Makefile.am: ... this new file.
4436 * examples/calc++/test: Remove input.
4437 * examples/calc++/compile: Remove.
4438 * examples/Makefile.am: New.
4439 * configure.ac, Makefile.am: Adjust.
4440 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4441
4442 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4443
4444 * data/glr.c (yyFail): Drastically simplify; since the format argument
4445 never had any % directives, we can simply pass it to yyerror.
4446 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4447 be modified later, as that is the usual style in glr.c.
4448 Problems reported by Paul Hilfinger.
4449
4450 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4451 and size overflow errors.
4452 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4453 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4454 (YYSIZEMAX): New macro.
4455 (yystpcpy): New function, taken from yacc.c.
4456 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4457 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4458 so that we don't have to maintain their signatures.
4459 (yyFail): Check for buffer overflow, by using vsnprintf rather
4460 than vsprintf. Allocate a bigger buffer if possible.
4461 Report an error if buffer allocation fails.
4462 (yyStackOverflow): New function.
4463 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4464 the initialization was successful. It might fail if storage was
4465 exhausted.
4466 (yyexpandGLRStack): Add more checks for storage allocation failure.
4467 Use yyStackOverflow to report failures.
4468 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4469 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4470 Don't assume stack number fits in int.
4471 (yysplitStack): Check for storage allocation failure.
4472 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4473 can print diagnostics on storage allocation failure. All callers
4474 changed.
4475 (yyresolveValue): Use yybool for boolean.
4476 (yyreportSyntaxError): Check for size-calculation overflow.
4477 This code is taken from yacc.c.
4478 (yyparse): Check for storage allocation errors when allocating
4479 the initial stack.
4480
4481 2005-07-05 Akim Demaille <akim@epita.fr>
4482
4483 Extract calc++ from the documentation.
4484 * doc/bison.texinfo (Calc++): Add the extraction marks.
4485 * examples/extexi: New, from the aborted GNU Programming 2E.
4486 Separate the different paragraph of a file with empty lines.
4487 * examples/Makefile: Use it to extract the whole calc++ example.
4488
4489 2005-06-24 Akim Demaille <akim@epita.fr>
4490
4491 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4492 class typedefs.
4493
4494 2005-06-22 Akim Demaille <akim@epita.fr>
4495
4496 * doc/bison.texinfo (C++ Language Interface): First stab.
4497 (C++ Parsers): Remove.
4498
4499 2005-06-22 Akim Demaille <akim@epita.fr>
4500
4501 * data/lalr1.cc (yylex_): Honor %lex-param.
4502
4503 2005-06-22 Akim Demaille <akim@epita.fr>
4504
4505 Start a set of simple examples.
4506 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4507 * examples/calc++/calc++-driver.hh,
4508 * examples/calc++/calc++-parser.yy,
4509 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4510 * examples/calc++/compile, examples/calc++/test: New.
4511
4512 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4513
4514 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4515 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4516 which stems from the 2005-05-27 patch.
4517
4518 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4519
4520 * data/glr.c: Modify treatment of unused parameters to permit use
4521 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4522
4523 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4524
4525 Fix infringement on user name space reported by Janos Zoltan Szabo.
4526 * data/yacc.c (yyparse): strlen -> yystrlen.
4527
4528 2005-05-30 Akim Demaille <akim@epita.fr>
4529
4530 * data/lalr1.cc (_): New.
4531 Translate the various messages.
4532
4533 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4534
4535 Fix infringement on user name space reported by Bruno Haible.
4536 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4537 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4538 the user's name space.
4539 (alloca): Include <stdlib.h> to get it, if it's not built in.
4540 (YYMALLOC, YYFREE): Define only if needed.
4541 (malloc, free): Declare, but only if needed, as this infringes on
4542 the user name space.
4543
4544 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4545
4546 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4547 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4548 with %d format.
4549 * lib/ebitset.c (min, max): Undef before defining.
4550 * lib/vbitset.c (min, max): Likewise.
4551 * lib/subpipe.c (create_subpipe): Save local variables in case
4552 vfork clobbers them.
4553
4554 2005-05-24 Bruno Haible <bruno@clisp.org>
4555
4556 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4557 error message syntax used by gcc-4.0.
4558
4559 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4560
4561 * README: Mention m4 1.4.3. Remove obsolete advice about
4562 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4563
4564 * bootstrap: Remove workaround for problem I encountered with
4565 gettext 0.14.1; it seems to be fixed now.
4566
4567 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4568
4569 * NEWS: Version 2.0a.
4570
4571 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4572 the previous change.
4573
4574 Various maintainer cleanups.
4575 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4576 conftest*, for benefit of CVS commands run at the same time as
4577 "configure". Add build-aux, since "bootstrap" now creates it and
4578 its subfiles.
4579 * Makefile.cfg (move_if_change): Remove.
4580 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
4581 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
4582 (po_repo, do-po-update, po-update, wget_files, get-targets):
4583 (config.guess-url_prefix, config.sub-url_prefix):
4584 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
4585 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
4586 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
4587 Remove.
4588 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
4589 this is now the recommended name.
4590 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
4591 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
4592 ylwrap. These files now go into build-aux.
4593 * config/move-if-change: Remove.
4594 * config/prev-version.txt: Bump from 1.75 to 2.0.
4595
4596 * bootstrap: Add stdio-safer, unistd-safer modules.
4597 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4598 we don't need it).
4599 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
4600 fopen-safer.c, stdio-safer.h, unistd-safer.h.
4601 * lib/subpipe.c: Include "unistd-safer.h".
4602 (create_subpipe): Make sure all the newly-created
4603 file descriptors are > 2, so that diagnostics don't
4604 get sent down them (which might cause Bison to hang, in theory).
4605 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
4606 * src/files.c (xfopen): Use fopen_safer, not fopen.
4607
4608 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4609 yesterday's yacc.c fix.
4610
4611 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4612
4613 * data/glr.c, data/lalr1.cc: Update copyright date.
4614
4615 Fix a destructor bug reported by Wolfgang Spraul in
4616 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
4617 * data/yacc.c (yyabortlab): Don't call destructor, and
4618 don't set yychar to EMPTY.
4619 (yyoverflowlab): Don't call destructor.
4620 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
4621 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
4622 since we no longer output the message "discarding lookahead token
4623 end of input ()".
4624
4625 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4626
4627 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
4628 fix a small glitch in debugging output.
4629 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
4630 after YY_SYMBOL_PRINT where needed.
4631
4632 (struct yyGLRState): Add some comments.
4633 (struct yySemanticOption): Add some comments.
4634 (union yyGLRStackItem): Add comment.
4635
4636 (yymergeOptionSets): Correct this to properly perform the union,
4637 avoiding infinite reported by Michael Rosien.
4638 Update comment.
4639
4640 * tests/glr-regression.at: Add test for GLR merging error reported
4641 by M. Rosien.
4642
4643 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4644
4645 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
4646 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
4647 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
4648 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
4649 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
4650 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
4651 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
4652 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
4653 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
4654 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
4655 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
4656 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
4657 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
4658 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
4659 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
4660 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
4661 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
4662 src/derives.h, src/files.c, src/files.h, src/getargs.c,
4663 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
4664 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
4665 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
4666 src/output.h, src/parse-gram.c, src/parse-gram.h,
4667 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
4668 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
4669 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
4670 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
4671 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
4672 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
4673 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
4674 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
4675 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
4676 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
4677 tests/reduce.at, tests/regression.at, tests/sets.at,
4678 tests/synclines.at, tests/testsuite.at, tests/torture.at:
4679 Update FSF postal mail address.
4680
4681 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4682
4683 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4684 Problem reported by Ralf Menzel.
4685
4686 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4687
4688 * tests/actions.at: Test that stack overflow invokes destructors.
4689 From Marcus Holland-Moritz.
4690 * data/yacc.c (yyerrlab): Move the code that destroys the stack
4691 from here....
4692 (yyreturn): to here. That way, destructors are called properly
4693 even if the stack overflows, or the user calls YYACCEPT or
4694 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
4695 (yyoverflowlab): Destroy the lookahead.
4696
4697 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4698
4699 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4700
4701 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4702
4703 * NEWS: Bison-generated C parsers no longer quote literal strings
4704 associated with tokens.
4705 * src/output.c (prepare_symbols): Don't escape strings,
4706 since users don't want to see C escapes.
4707 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4708 in diagnostics.
4709 * tests/input.at (Torturing the Scanner): Likewise.
4710 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4711
4712 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4713
4714 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4715 the data size is known to be too small and we can't increase it.
4716 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4717
4718 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4719
4720 * src/parse-gram.y: Include quotearg.h.
4721 (string_as_id): Quote $1 before using it as a key, since the
4722 lexer no longer quotes it for us.
4723 (string_content): Don't strip quotes, since lexer no longer
4724 quotes it for us.
4725 * src/scan-gram.l: Include quotearg.h.
4726 ("\""): Omit quote.
4727 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4728 a key, since the rest of the lexer doesn't quote it.
4729 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4730 * tests/regression.at (Token definitions): Check for backslashes
4731 in token strings.
4732
4733 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4734 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4735 (yyparse): Revamp code to generate long syntax error message, to
4736 make it easier to translate, and to avoid problems with arithmetic
4737 overflow. Change "virtual memory" to "memory" in diagnostic, since
4738 we don't know whether the memory is virtual.
4739
4740 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4741
4742 * NEWS: Bison-generated C parsers now use the _ macro to
4743 translate strings.
4744 * data/yacc.c (_) [!defined _]: New macro.
4745 All English strings wrapped inside this macro.
4746 * doc/bison.texinfo (Bison Parser): Document _.
4747 * po/POTFILES.in: Include src/parse-gram.c, since it now
4748 includes translateable strings that parse-gram.y doesn't.
4749
4750 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4751
4752 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4753 reverting the 2004-10-11 change to this function.
4754 (symbol_check_alias_consistency): Don't call symbol_type_set
4755 if the type name is already correct.
4756 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4757
4758 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4759
4760 * tests/regression.at (Token definitions): Don't use a token named
4761 c, as that generates a "#define c ..." that runs afoul of buggy
4762 stdlib.h that uses the identifier c as a member of struct
4763 drand48_data. Problem reported by Horst Wente.
4764
4765 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4766
4767 * bootstrap: Change translation URL from
4768 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4769 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4770 redirection glitches. Problem reported by twlevo@xs4all.nl.
4771
4772 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4773
4774 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4775 after operands; POSIX says this isn't portable for the c99 command.
4776
4777 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4778
4779 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4780 immediately if a data overrun has occurred; this may help us track
4781 down what may be a spurious failure on MacOS.
4782
4783 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4784
4785 Respond to problems reported by twlevo@xs4all.nl.
4786
4787 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4788
4789 * src/vcg.h: Comment fix.
4790 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4791 (G_CMAX): Change to -1 instead of INT_MAX.
4792
4793 * data/yacc.c (yyparse): Omit spaces before #line.
4794
4795 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4796
4797 * src/tables.c (state_number_to_vector_number): Put it inside an
4798 "#if 0", since it's not currently used. Problem reported by
4799 Roland McGrath.
4800
4801 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4802
4803 * src/output.c (escaped_output): Renamed from
4804 escaped_file_name_output, since we now use it for symbol tags as
4805 well. All uses changed.
4806 (symbol_destructors_output, symbol_printers_output):
4807 Escape symbol tags too.
4808 Problem reported by Matyas Forstner in
4809 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4810
4811 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4812 not needed.
4813 * src/output.c (user_actions_output, token_definitions_output,
4814 symbol_destructors_output, symbol_printers_output): Likewise.
4815 * src/reader.c (prologue_augment): Likewise.
4816 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4817
4818 * src/vcg.c (output_edge): Don't quote linestyle arg.
4819 Problem reported by twlevo@xs4all.nl.
4820
4821 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4822
4823 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4824 example, reported by Derek M Jones. Also, make the example even
4825 more outrageous, to better illustrate how bad the problem is.
4826
4827 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4828
4829 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4830 putsym. Typo reported by Sebastian Piping.
4831
4832 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4833
4834 * doc/bison.texinfo (Language and Grammar): some -> same
4835 (Epilogue): int he -> in the
4836 Typos reported by Sebastian Piping via Justin Pence.
4837
4838 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4839
4840 * tests/glr-regression.at (Improper handling of embedded actions
4841 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4842 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4843 with dollar signs in test names.
4844 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4845 for a similar reason.
4846
4847 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4848
4849 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4850 wants to redefine G_VIEW.
4851
4852 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4853
4854 * src/vcg.c (get_view_str): Remove case for normal_view.
4855 Problem reported by twlevo@xs4all.nl.
4856
4857 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4858
4859 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4860 Problem reported by twlevo@xs4all.nl.
4861
4862 * doc/bison.texinfo: Change @dircategory from "GNU programming
4863 tools" to "Software development". Requested by Richard Stallman
4864 via Karl Berry.
4865
4866 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4867
4868 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4869 Problem reported by twlevo@xs4all.nl.
4870
4871 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4872
4873 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
4874 keyword; it's not needed with modern compilers, and it doesn't
4875 affect correctness with older compilers. Suggested by
4876 twlevo@xs4all.nl.
4877
4878 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4879
4880 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
4881 gcc -Wswitch-default.
4882 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4883 * data/yacc.c (yyparse): Likewise.
4884
4885 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4886
4887 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4888 already. Let config.h define any nonstandard values.
4889
4890 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4891
4892 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4893 for the benefit of slower hosts. Problem reported by
4894 Nelson H. F. Beebe.
4895
4896 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4897
4898 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
4899 being defined and not used.
4900 * data/lalr1.cc (yyparse): Likewise.
4901 Use "if (false)" rather than "if (0)".
4902
4903 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4904
4905 * TODO: Mention that we should allow NUL bytes in tokens.
4906
4907 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4908
4909 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4910 Problem reported by Hans Aberg.
4911
4912 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 * src/getargs.c (version): Happy new year; update overall
4915 program copyright date from 2004 to 2005.
4916
4917 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
4918 Problem reported by Hans Aberg.
4919 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
4920 (Output file names.): Add a test for the case when standard output
4921 is closed.
4922
4923 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4924
4925 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4926 to fix an oversight in the Bison 2.0 manual.
4927
4928 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4929
4930 * NEWS: Version 2.0. Reformat the existing news items since
4931 1.875, so that related items are grouped together.
4932 * configure.ac (AC_INIT): Bump version to 2.0.
4933 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
4934
4935 * tests/torture.at (Exploding the Stack Size with Alloca): Set
4936 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
4937 otherwise, we're not testing alloca. Unfortunately there's no
4938 simple way to consult HAVE_ALLOCA here.
4939
4940 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4941 for yymsg, too.
4942
4943 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
4944 hand. This avoids a warning about comparing int to size_t when
4945 GCC warnings are enabled.
4946
4947 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4948
4949 * NEWS: Bison-generated parsers no longer default to using the
4950 alloca function (when available) to extend the parser stack, due
4951 to widespread problems in unchecked stack-overflow detection.
4952 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4953 responsibility to set it to a positive value. This lets the user
4954 specify a value that is not a preprocessor constant.
4955 * data/yacc.c (YYMAXDEPTH): Likewise.
4956 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4957 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4958 to be a compile-time constant. However, explain the constraints on it.
4959 Also, explain the constraints on YYINITDEPTH.
4960 (Table of Symbols): Explain that alloca is no longer the default.
4961 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4962 to 1.
4963
4964 * doc/bison.texinfo (Location Default Action): Mention that n must
4965 be zero when k is zero. Suggested by Frank Heckenbach.
4966
4967 2004-12-22 Akim Demaille <akim@epita.fr>
4968
4969 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4970 (parser::state_type, parser::semantic_type, parser::location_type):
4971 Private, not public.
4972 (parser::parse): Return ints, not bool.
4973 Returning a bool introduces a problem: 0 corresponds to false, and
4974 it seems weird to return false on success. Returning true changes
4975 the conventions for yyparse.
4976 Alternatively we could return void and send an exception.
4977 There is no clear consensus (yet?).
4978 (state_stack, semantic_stack, location_stack): Rename as...
4979 (state_stack_type, semantic_stack_type, location_stack_type): these.
4980 Private, not public.
4981 * tests/c++.at: New.
4982 * tests/testsuite.at, tests/Makefile.am: Adjust.
4983
4984 2004-12-21 Akim Demaille <akim@epita.fr>
4985
4986 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4987
4988 2004-12-21 Akim Demaille <akim@epita.fr>
4989
4990 Don't impose std::string for filenames.
4991
4992 * data/lalr1.cc (b4_filename_type): New.
4993 (position::filename): Use it.
4994 (parser.hh): Move the inclusion of stack.hh and location.hh below
4995 the user code, so that needed headers for the filename type can be
4996 included first.
4997 Forward declare them before the user code.
4998 * tests/Makefile.am (check-local, installcheck-local): Pass
4999 TESTSUITEFLAGS to the TESTSUITE.
5000
5001 2004-12-20 Akim Demaille <akim@epita.fr>
5002
5003 Use more STL like names: my_class instead of MyClass.
5004
5005 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5006 (SemanticStack, SemanticType, StateStack, StateType)
5007 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5008 (Parser::value): Rename as...
5009 (location_stack, location_type, rhs_number_type, semantic_stack)
5010 (semantic_type, state_stack, state_type, token_number_type, stack)
5011 (slice, traits, parser::yylloc, parser::yylval): these.
5012
5013 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5014
5015 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5016
5017 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5018 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5019
5020 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5021
5022 Remove uses of 'short int' and 'unsigned short int'. This raises
5023 some arbitrary limits. It uses more memory but nowadays that's
5024 not much of an issue.
5025
5026 This change does not affect the generated parsers; that's a different
5027 task, as some users will want to conserve memory there.
5028
5029 Ideally we should use size_t to represent all object counts, and
5030 something like ptrdiff_t to represent signed differences of object
5031 counts; but that will require more code-cleanup than I have the
5032 time to do right now.
5033
5034 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5035 Use size_t, not int or short int, to count objects.
5036 * src/closure.c (nritemset, closure): Likewise.
5037 * src/closure.h (nritemset, closure): Likewise.
5038 * src/nullable.c (nullable_compute): Likewise.
5039 * src/print.c (print_core): Likewise.
5040 * src/print_graph.c (print_core): Likewise.
5041 * src/state.c (state_compare, state_hash): Likewise.
5042 * src/state.h (struct state): Likewise.
5043 * src/tables.c (default_goto, goto_actions): Likewise.
5044
5045 * src/gram.h (rule_number, rule): Use int, not short int.
5046 * src/output.c (prepare_rules): Likewise.
5047 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5048 errs, reductions): Likewise.
5049 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5050 Likewise.
5051 * src/tables.c (vector_number, tally, action_number,
5052 ACTION_NUMBER_MINIMUM): Likewise.
5053 * src/output.c (muscle_insert_short_int_table): Remove.
5054
5055 2004-12-17 Akim Demaille <akim@epita.fr>
5056
5057 * data/lalr1.cc: Extensive Doxygenation.
5058 (error_): Rename as...
5059 (error): this, since it is visible to the user.
5060 Adjust callers.
5061 (Parser::message): Now an automatic variable from...
5062 (Parser::yyreport_syntax_error_): here.
5063 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5064 Parser::error.
5065 * tests/input.at: Escape $.
5066
5067 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5068
5069 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5070 Parenthesize rhs to avoid obscure problems with mistakes like
5071 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5072 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5073 b4_rhs_location): Likewise.
5074 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5075 b4_rhs_location): Likewise.
5076
5077 2004-12-16 Akim Demaille <akim@epita.fr>
5078
5079 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5080 yacc.c: be sure to stay within yycheck_.
5081 * tests/actions.at: Re-enable C++ tests.
5082
5083 2004-12-16 Akim Demaille <akim@epita.fr>
5084
5085 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5086 real.
5087
5088 2004-12-16 Akim Demaille <akim@epita.fr>
5089
5090 Use #define to handle the %name-prefix.
5091
5092 * data/glr.c, data/yacc.c: Comment changes.
5093 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5094 so that one can refer to yylex in the parser file, and have it
5095 renamed, as is the case with other skeletons.
5096
5097 2004-12-16 Akim Demaille <akim@epita.fr>
5098
5099 Move lalr1.cc internals into yy*.
5100
5101 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5102 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5103 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5104 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5105 (empty_, final_, terror_, errcode_, ntokens_)
5106 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5107 (looka_, ilooka_, error_range_, nerrs_):
5108 Rename as...
5109 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5110 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5111 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5112 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5113 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5114 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5115 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5116 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5117 these.
5118
5119 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5120
5121 Fix some problems reported by twlevo at xs4all.
5122 * src/symtab.c (symbol_new): Report an error if the input grammar
5123 contains too many symbols. This is better than calling abort() later.
5124 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5125 (struct node, struct graph):
5126 Rename member expand to stretch. All uses changed.
5127 (struct graph): Remove member layoutalgorithm. All uses removed.
5128 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5129 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5130 All uses changed.
5131 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5132
5133 2004-12-15 Akim Demaille <akim@epita.fr>
5134
5135 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5136 Add more Doxygen comments.
5137 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5138 (report_syntax_error_, translate_): Rename as...
5139 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5140 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5141
5142 2004-12-15 Akim Demaille <akim@epita.fr>
5143
5144 * data/lalr1.cc (lex_): Rename as...
5145 (yylex_): this.
5146 Move the trace here.
5147 Take the %name-prefix into account.
5148 Reported by Alexandre Duret-Lutz.
5149
5150 2004-12-15 Akim Demaille <akim@epita.fr>
5151
5152 Simplify the C++ parser constructor.
5153
5154 * data/lalr1.cc (debug_): Rename as...
5155 (yydebug_): so that the parser's internals are always in the yy*
5156 pseudo namespace.
5157 Adjust uses.
5158 (b4_parse_param_decl): Remove the leading comma as it is now only
5159 called as unique argument list.
5160 (Parser::Parser): Remove the constructor accepting a location and
5161 an initial debugging level.
5162 Remove from the other ctor the argument for the debugging level.
5163 (debug_level_type, debug_level, set_debug_level): New.
5164
5165 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5166 constructor calls.
5167
5168 2004-12-15 Akim Demaille <akim@epita.fr>
5169
5170 Remove b4_root related material: failure experiment
5171 (which goal was to allow to derive from a class).
5172
5173 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5174 definitions and uses.
5175
5176 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5177
5178 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5179 not 2, since it's not portable to subtract 1 from the start of an
5180 array. The new item 0 is never set or used. All uses changed.
5181
5182 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5183 the default definition of YYLLOC_DEFAULT. Problem reported
5184 by Frank Heckenbach.
5185
5186 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5187
5188 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5189 the normal case and one for the error case. Just use the
5190 first one uniformly. Problem reported by Frank Heckenbach.
5191 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5192 use exactly the same macro in both places.
5193 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5194 so that the normal-case YYRHSLOC works for the error case too.
5195 All uses changed.
5196 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5197 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5198 * doc/bison.texinfo (Location Default Action): Don't claim that
5199 we have an array of locations. Use the same macro for both glr
5200 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5201 the index is 0.
5202
5203 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5204
5205 * HACKING: Update email addresses to send announcements to.
5206
5207 * configure.ac (AC_INIT): Bump version to 1.875f.
5208
5209 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5210
5211 * NEWS: Version 1.875e.
5212 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5213
5214 * src/scan-skel.l: Include "complain.h", for "fatal".
5215
5216 * src/relation.h (relation_print, relation_digraph):
5217 Relation sizes are of type relation_node, not size_t (this is
5218 merely a doc fix, since the two types are equivalent).
5219 (relation_transpose): Relation sizes are of type relation_node,
5220 not int.
5221 * src/relation.c: Likewise.
5222 (top, infinity): Now of type relation_node, not int.
5223 (traverse, relation_transpose): Use relation_node, not int.
5224
5225 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5226 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5227 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5228
5229 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
5230 specifying whether the test should be skipped. Use it tp
5231 specify that the [%defines %skeleton "lalr1.cc"] tests currently
5232 fail on some hosts, and should be skipped.
5233
5234 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5235
5236 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5237 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5238 unless otherwise specified below.
5239
5240 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5241 to allocate kernel_base, kernel_items, kernel_size, since
5242 they needn't be initialized to 0.
5243 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5244 * src/closure.c (new_closure): Likewise, for itemset.
5245 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5246 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5247 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5248 (build_relations): Likewise for edge, states1, includes.
5249 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5250 * src/reader.c (packgram): Likewise, for ritem, rules.
5251 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5252 * src/relation.c (relation_digraph): Likewise for VERTICES.
5253 (relation_transpose): Likewise for new_R, end_R.
5254 * src/symtab.c (symbols_token_translations_init): Likewise for
5255 token_translations.
5256 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5257 (token_actions): Likewise for yydefact, actrow, conflrow,
5258 conflict_list.
5259 (save_column): Likewise for froms[symno], tos[symno].
5260 (goto_actions): Likewise for state_count.
5261 (pack_table): Likewise for base, pos, check.
5262 (tables_generate): Likewise for width.
5263
5264 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5265 for initial core. Just have a separate core, so we needn't worry
5266 about whether kernel_size and kernel_base are initialized.
5267
5268 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5269 kernel_size, kernel_items): Remove unnecessary initialization.
5270 * src/conflicts.c (conflicts): Likewise.
5271 * src/derives.c (derives): Likewise.
5272 * src/muscle_tablc (muscle_insert): Likewise.
5273 * src/relation.c (relation_digraph): Likewise.
5274 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5275 conflrow, conflict_table, conflict_list, table, check):
5276 Likewise.
5277
5278 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5279 This is because all callers pass unsigned int.
5280 * src/closure.h (new_closure): Likewise.
5281
5282 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5283 (build_relations): Initialize includes[i] in all cases.
5284 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5285 and rules[ruleno].precsym. Initialize members in order.
5286 * src/relation.c (relation_transpose): Always initialize new_R[i]
5287 and end_R[i].
5288 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5289
5290 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5291 conflict_list[0] was always 0, but now it isn't initialized.
5292
5293 * src/table.c (table_grow): When conflict_table grew, the grown
5294 area wasn't cleared. Fix this.
5295
5296 * lib/.cvsignore: Add strdup.c, strdup.h.
5297 * m4/.cvsignore: Add strdup.m4.
5298
5299 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5300
5301 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5302 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5303 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5304 ngotos + 1 without checking for overflow.
5305 (build_relations): Use END_NODE, not -1, to denote end of edges.
5306 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5307 build_relations): Use goto_number, not int, for goto numbers.
5308 * src/tables.c (save_column, default_goto): Likewise.
5309
5310 2004-11-23 Akim Demaille <akim@epita.fr>
5311
5312 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5313 of #defining from yystype.
5314 Don't typedef yystype, C++ does not need it.
5315 This lets it possible to forward declare it as union.
5316
5317 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5318
5319 * bootstrap (gnulib_modules): Add extensions.
5320 Problem reported by Jim Meyering.
5321
5322 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5323
5324 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5325 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5326 src/system.h, src/tables.c: XFREE -> free, to accommodate
5327 recent change to gnulib xalloc.h.
5328 Problem reported by Jim Meyering.
5329
5330 2004-11-17 Akim Demaille <akim@epita.fr>
5331
5332 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5333
5334 2004-11-17 Akim Demaille <akim@epita.fr>,
5335 Alexandre Duret-Lutz <adl@gnu.org>
5336
5337 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5338 changes.
5339 (YYCDEBUG): Adjust.
5340 Use it instead of cdebug_.
5341 (Parser::debug_stream, Parser::set_debug_stream): New.
5342 (Parser::symprint_): Define cdebug_ for temporary backward
5343 compatibility.
5344 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5345 debug_stream ().
5346
5347 2004-11-17 Akim Demaille <akim@epita.fr>
5348
5349 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5350 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5351 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5352 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5353
5354 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5355
5356 * data/glr.c (yyloc_default): Remove; not used.
5357 Problem reported by Frank Heckenbach.
5358
5359 2004-10-25 Akim Demaille <akim@epita.fr>
5360
5361 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5362 Introduce another definition to address simple location arrays.
5363 (yyGLRStack): New member: yyerror_range.
5364 (yyrecoverSyntaxError, yyparse): Update it.
5365 (yyrecoverSyntaxError): Use it when shifting the error token to
5366 have an accurate range, equivalent to the one computed by both
5367 yacc.c and lalr1.cc.
5368 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5369 that column numbers start at column 0, as per GNU Coding
5370 Standards, the others tests, and the doc.
5371 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5372 Adjust to the above change (first column is 0).
5373 And adjust the location of the "<error>", now covering the whole
5374 line.
5375
5376 2004-10-22 Akim Demaille <akim@epita.fr>
5377 and Paul Eggert <eggert@cs.ucla.edu>
5378
5379 Remove some arbitrary limits on goto numbers and relations.
5380 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5381 initial values, since they're never used.
5382 (set_goto_map): ngotos is now unsigned, so test for overflow
5383 by seeing whether it wraps around to zero.
5384 * src/lalr.h (goto_number): Now size_t, not short int.
5385 (GOTO_NUMBER_MAXIMUM): Remove.
5386 * src/relation.c (relation_print, traverse, relation_transpose):
5387 Check for END_NODE rather than looking at sign.
5388 * src/relation.h (END_NODE): New macro.
5389 (relation_node): Now size_t, not short int.
5390
5391 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5392
5393 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5394 keyword, not an identifier. Problem reported by Baron Schwartz in
5395 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5396
5397 2004-10-11 Akim Demaille <akim@epita.fr>
5398
5399 * src/symtab.c (symbol_check_alias_consistency): Also check
5400 type names, destructors, and printers.
5401 Reported by Alexandre Duret-Lutz.
5402 Recode the handling of associativity and precedence in terms
5403 of symbol_precedence_set.
5404 Accept no redeclaration at all, not even equal to the previous
5405 value.
5406 (redeclaration): New.
5407 Use it to factor redeclaration complaints.
5408 (symbol_make_alias): Don't set the type of the alias, let
5409 symbol_check_alias_consistency do it as for other features.
5410 * src/symtab.h (symbol): Add new member prec_location, and
5411 type_location.
5412 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5413 * tests/input.at (Incompatible Aliases): New.
5414
5415 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5416
5417 .cvsignore fixes to accommodate gnulib changes,
5418 and the practice of naming build directories "_build".
5419 * .cvsignore: Add "_*". Sort.
5420 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5421 * m4/.cvsignore: Add "*_gl.m4".
5422
5423 2004-10-06 Akim Demaille <akim@epita.fr>
5424
5425 * src/parse-gram.y (add_param): Fix the truncation of trailing
5426 spaces.
5427
5428 2004-10-05 Akim Demaille <akim@epita.fr>
5429
5430 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5431 whether the reducion was empty or not. This leaves room to
5432 improve the use of YYLLOC_DEFAULT in such a case.
5433 lalr1.cc is still experimental, so changing this is acceptable.
5434 And finally, there are probably not many users who changed the
5435 handling of locations in GLR, so changing is admissible too.
5436
5437 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5438 empty reduction, set @$ to an empty location ending the previously
5439 stacked symbol.
5440 Adjust uses to make sure the code is triggered on empty
5441 reductions.
5442 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5443 expected output: empty reductions have empty locations.
5444
5445 2004-09-29 Akim Demaille <akim@epita.fr>
5446
5447 * data/lalr1.cc: Move towards a more standard C++ coding style
5448 for templates: Class < T > -> Class<T>.
5449
5450 2004-09-29 Akim Demaille <akim@epita.fr>
5451
5452 * data/lalr1.cc: Reinstall the former ctor, for sake of
5453 compatibility, but warn it will be removed.
5454 Move towards a more standard C++ coding style (i.e., type *var ->
5455 type* var).
5456
5457 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5458
5459 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5460 since it's less likely to work if NULs are involved in the future.
5461
5462 2004-09-27 Akim Demaille <akim@epita.fr>
5463
5464 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5465
5466 2004-09-27 Akim Demaille <akim@epita.fr>
5467
5468 * data/lalr1.cc (b4_parse_param_decl_1): New.
5469 (b4_parse_param_decl): Use it to have different names between attribute
5470 and argument names.
5471 (b4_cc_constructor_call): Likewise.
5472
5473 2004-09-24 Akim Demaille <akim@epita.fr>
5474
5475 * src/parse-gram.y (add_param): Strip the leading and trailing
5476 blanks from a formal argument declaration.
5477 (YY_LOCATION_PRINT): New.
5478
5479 2004-09-24 Akim Demaille <akim@epita.fr>
5480
5481 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5482 after the location.
5483
5484 2004-09-24 Akim Demaille <akim@epita.fr>
5485
5486 * doc/bison.texinfo (Table of Symbols): Sort.
5487
5488 2004-09-21 Akim Demaille <akim@epita.fr>
5489
5490 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5491 the useless parentheses.
5492 Suggested by Paul Eggert.
5493
5494 2004-09-20 Akim Demaille <akim@epita.fr>
5495
5496 Let the initial-action act on the look-ahead, and use it for the
5497 "initial push" (corresponding to an hypothetical beginning-of-file).
5498 And let lalr1.cc honor %initial-action.
5499
5500 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5501 example.
5502 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5503 (Parser::Parser): Remove the ctor that used to initialize it.
5504 (Parser::parse): Like in the other skeletons, issue the "starting
5505 parse" message before any action.
5506 Honor %initial-action.
5507 Initialize the stacks with the lookahead.
5508 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5509 look-ahead.
5510 Push them in the stacks.
5511 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5512
5513 2004-09-20 Akim Demaille <akim@epita.fr>
5514
5515 * doc/bison.texinfo (Initial Action Decl): New.
5516
5517 2004-09-20 Akim Demaille <akim@epita.fr>
5518
5519 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5520 clearer criterion to define it.
5521 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5522 When reducing on an empty RHS, use the latest stacked location as
5523 location.
5524 yylloc is not always available.
5525 * data/glr.c: Likewise.
5526 Also, honor initial-actions.
5527
5528 2004-09-20 Akim Demaille <akim@epita.fr>
5529
5530 * data/yacc.c (YY_LOCATION_PRINT): New.
5531 Define when we know YYLTYPE's structure, i.e., when the default
5532 YYLLOC_DEFAULT is used.
5533 * data/c.m4 (b4_yysymprint_generate): Use it.
5534 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5535 value of the result.
5536 (error_start_): Replace with...
5537 (error_range_): this location array.
5538 This allows to replace code relying on the implementation of
5539 locations by portable code.
5540 * data/yacc.c (yylerrsp): Replace with...
5541 (yyerror_range): this.
5542 Every time a token is popped, update yyerror_range[0], to have an
5543 accurate location for the error token.
5544 * data/glr.c (YY_LOCATION_PRINT): New.
5545 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5546 deference a pointer.
5547 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5548 report the location in %printers.
5549
5550 * src/scan-skel.l: Instead of abort, report error messages to ease
5551 understanding skeleton scanning failures.
5552
5553 2004-09-16 Akim Demaille <akim@epita.fr>
5554
5555 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5556 (iterator, const_iterator): these, to be more in the C++ spirit.
5557 Also, return reverse iterators so that when displaying the stack
5558 we display its bottom first.
5559 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5560 from yacc.c.
5561 We should probably use vector here though.
5562
5563 2004-09-16 Akim Demaille <akim@epita.fr>
5564
5565 Have more complete shift traces.
5566
5567 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5568 to report Shifts instead of ad hoc YYDPRINTF invocations,
5569 including for the error token.
5570 * data/lalr1.cc (symprint_): Output the location.
5571 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5572 output the location within the %printer.
5573 Activate GLR tests, at least to make sure they compile properly.
5574 They still don't pass though.
5575 * tests/calc.at: Adjust expect verbose output, since now "Entering
5576 state..." is on a different line than the "Shifting" message.
5577
5578 2004-09-08 Akim Demaille <akim@epita.fr>
5579
5580 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
5581 Bison directive from the Bison file to the invocation of this
5582 macro, so that these directives are passed to
5583 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
5584 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
5585 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
5586 the extra Bison directives instead of the whole series.
5587 Change the grammar so that there are recoverable errors, and
5588 unrecoverable errors. Now we can have the parser give up before
5589 consuming the whole input. As a result we now can observe that
5590 the lookahead is freed when needed.
5591 Change the parser source to parse argv[1] instead of a hard coded
5592 string.
5593 Simplify yylex, and give a value and location to EOF.
5594 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
5595 passed directives already coded in the file.
5596 Add some tests to check the location of "error".
5597 For some tests, the C++ parser is correct, and not yacc.c.
5598 For other tests, they provide different, but unsatisfying, values,
5599 so keep the C++ value so that at least one parser is "correct"
5600 according to the test suite.
5601 (Actions after errors): Remove, this is subsumed by the
5602 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
5603
5604 2004-09-06 Akim Demaille <akim@epita.fr>
5605
5606 * data/lalr1.cc: Adjust the indentation of the labels.
5607 (Parser::pop): New.
5608 Use it.
5609
5610 2004-09-06 Akim Demaille <akim@epita.fr>
5611
5612 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
5613 argument, an informative message.
5614 Call YY_SYMBOL_PRINT.
5615 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
5616 * data/lalr1.cc (destruct_): Likewise.
5617 In addition, no longer depend on b4_yysymprint_generate and
5618 b4_yydestruct_generate to generate these functions, do it "by
5619 hand".
5620
5621 2004-09-03 Akim Demaille <akim@epita.fr>
5622
5623 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
5624 invoked, yydestruct the lookahead.
5625 * tests/calc.at (Calculator $1): Update the expected lengths of
5626 traces: there is an added line for the discarded lookahead.
5627 * doc/bison.texinfo (Destructor Decl): Some rewording.
5628 Define "discarded" symbols.
5629
5630 2004-09-02 Akim Demaille <akim@epita.fr>
5631
5632 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5633
5634 2004-09-02 Akim Demaille <akim@epita.fr>
5635
5636 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
5637 (YYDSYMPRINTF): Rename as...
5638 (YY_SYMBOL_PRINT): this.
5639 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
5640 two.
5641 Use it instead of direct symprint_ calls.
5642 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5643 one.
5644
5645 2004-09-02 Akim Demaille <akim@epita.fr>
5646
5647 * data/lalr1.cc (b4_yysymprint_generate): New.
5648 (symprint_): New member function, defined when YYDEBUG.
5649 Use it consistently instead of token/nterm debugging output by
5650 hand.
5651 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5652 %printer calls to use cdebug_ when using lalr1.cc.
5653
5654 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5655
5656 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5657 with #ifdef YYDEBUG.
5658
5659 2004-08-26 Akim Demaille <akim@epita.fr>
5660
5661 * doc/bison.texinfo (Implementing Loops): Rename as...
5662 (Implementing Gotos/Loops): this.
5663
5664 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5665
5666 Adjust to latest gnulib.
5667 * bootstrap (gnulib_modules): Add xalloc-die.
5668 Set LC_ALL=C so that file names sort consistently.
5669 Prefer the gnulib copies of gettext.m4, glibc21.m4,
5670 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
5671 uintmax_t.m4, ulonglong.m4.
5672 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
5673 po.m4 since we are now using _gl.m4 instead.
5674
5675 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5676
5677 * src/scan-action.l: Remove. Scanning of semantic actions is
5678 handled in scan-gram.l.
5679
5680 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5681
5682 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5683
5684 * src/location.h (struct): The file member is a uniqstr.
5685 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5686
5687 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5688
5689 Fix bug with non-%union parsers that have printers or destructors,
5690 which led to a Bison core dump. Reported by Peter Fales in
5691 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
5692
5693 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
5694 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
5695 not to our own type.
5696 * src/output.c (symbol_destructors_output, symbol_printers_output):
5697 Don't assume %union.
5698 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
5699 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
5700 UNION-FLAG. All callers changed.
5701 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
5702 Use type char, not unsigned int, when declaring an array of char;
5703 this lets us remove a cast.
5704 (Printers and Destructors): Add non-%union test cases.
5705
5706 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5707
5708 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5709 GLR writeups. E.g., avoid frenchspacing and the future tense,
5710 change "lookahead" to "look-ahead", and change "wrt" to "with
5711 respect to".
5712
5713 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5714
5715 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5716 New sections, split off from the GLR Parsers section. Put the new
5717 Simple GLR Parser near the start of the GLR section, for clarity.
5718 Rewrite connective text.
5719
5720 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
5721
5722 * doc/bison.texinfo (Simple GLR Parsers): New section.
5723
5724 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5725
5726 * NEWS, TODO, doc/bison.texinfo:
5727 Use "look-ahead" instead of "lookahead", to be consistent.
5728 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5729 while we're fixing "look-ahead".
5730 * src/conflicts.c (shift_set): Renamed from shiftset.
5731 (look_ahead_set): Renamed from lookaheadset.
5732 * src/print.c: Likewise.
5733 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5734 name for "lookahead".
5735 (report_types, usage): Likewise.
5736 * src/getargs.h (report_look_ahead_tokens): Renamed from
5737 report_lookaheads.
5738 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5739 compute_lookaheads.
5740 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5741 (look_ahead_tokens_print): Renamed from lookaheads_print.
5742 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5743 state_rule_lookaheads_print.
5744 * src/state.h: Likewise.
5745 (reductions.look_ahead_tokens): Renamed from lookaheads.
5746 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5747 AT_DATA_LOOKAHEADS_GRAMMAR.
5748
5749 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5750
5751 * README: Update location of patched M4 distribution.
5752
5753 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5754
5755 Don't assume the C++ compiler takes the same arguments as the C compiler
5756 (trivial change).
5757 * configure.ac (O0CXXFLAGS): New var.
5758 * tests/atlocal.in (CXXFLAGS): Use it.
5759
5760 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5761
5762 Fix some "make check" problems with C++ reported by
5763 Albert Chin-A-Young for Tru64 C++ in this thread:
5764 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5765
5766 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5767 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5768 Output to a .cc file for C++, not to a .c file.
5769 * tests/calc.at (AT_CHECK_CALC): Likewise.
5770 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5771 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5772
5773 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5774
5775 * tests/calc.at, tests/actions.at: Workaround for SGI
5776 C++ compiler. (trivial change)
5777
5778 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5779
5780 Spent a few hours checking out which prerequisite versions the
5781 current sources actually require. I went all the way back to
5782 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5783 a seemingly endless set of combinations of versions more recent
5784 than that. The bottom line is that the current sources require
5785 fairly recent versions of the build tools, and it'll be some work
5786 to change this.
5787 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5788 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5789 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5790 Add comments explaining why those particular versions are
5791 currently needed.
5792
5793 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5794 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
5795 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
5796
5797 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5798 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5799
5800 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5801
5802 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5803 0.11.5. Suggested by Bruno Haible.
5804 * bootstrap: Remove gettext version checking.
5805
5806 * doc/bison.texinfo (Decl Summary): Also mention that %union
5807 can depend on prerequisite types. Problem reported by Tim
5808 Van Holder.
5809
5810 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5811
5812 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5813 * README-alpha: Don't tell people not to package this.
5814
5815 * bootstrap: Don't assume $(...) works; use `...` instead.
5816 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5817 gettext better.
5818
5819 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5820 put into the -d output file, and mention what to do if YYSTYPE is
5821 defined as a macro.
5822
5823 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5824
5825 Undo change made earlier today: it caused autopoint to not bring
5826 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5827 autopoint's.
5828
5829 * bootstrap: Check that gettext version matches what's in
5830 configure.ac. Warn users to ignore robots.txt ERROR 404.
5831 * bootstrap: Undo today's earlier change (logged below).
5832 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
5833
5834 The gettext version checking is causing more trouble than it's
5835 curing; remove it. Problem reported by Paul Hilfinger.
5836
5837 * bootstrap: Issue a warning that one can expect a message
5838 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5839 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5840
5841 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5842
5843 Ensure that the C++ compiler used for testing actually works on a
5844 simple test program; if not, skip the C++-related tests. Problem
5845 reported by Vin Shelton in:
5846 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
5847
5848 * m4/cxx.m4: New file.
5849 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5850 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5851 * tests/local.at (AT_COMPILE_CXX): Use it.
5852
5853 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5854
5855 * data/glr.c (yylloc): Output this macro even if locations are not
5856 being generated, as the GLR parser needs it even in that case.
5857 Problem reported by Troy A. Johnson
5858 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5859
5860 * configure.ac (AC_INIT): Update to 1.875e.
5861
5862 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5863
5864 * NEWS: Version 1.875d.
5865 * configure.ac (AC_INIT): Likewise.
5866 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5867
5868 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5869 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5870 lalr1.cc runs afoul of the first, and the last two are no longer
5871 supported by GCC 3.4.0.
5872 * README: Mention GNU m4 1.4 or later; mention m4 patches.
5873 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
5874
5875 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5876
5877 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
5878 unsigned int, for compatibility with latest gnulib hash module.
5879 * src/state.c (state_hash, state_hasher): Likewise.
5880 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
5881 * src/uniqstr.c (hash_uniqstr): Likewise.
5882
5883 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5884
5885 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5886
5887 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
5888 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
5889 character and string literals.
5890 (unexpected_end): New function.
5891 (unexpected_eof): Use it.
5892 (unexpected_newline): New function.
5893 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
5894 actions.
5895
5896 * NEWS: Document %expect-rr.
5897
5898 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
5899 Fix typo by replacing $1 with $option.
5900 Remove more 'intl'-related files.
5901 Don't DEFUN AM_INTL_SUBDIR twice.
5902
5903 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5904 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5905 strtoul.c.
5906 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
5907 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
5908 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
5909 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
5910 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
5911 * src/.cvsignore: Add *.output.
5912
5913 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5914 gets copied to the output file.
5915
5916 2004-04-28 Paul Eggert <eggert@twinsun.com>
5917
5918 Get files from the gnulib and po repositories, instead of relying
5919 on them being in our CVS. Upgrade to latest versions of gnulib
5920 and Automake.
5921
5922 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
5923 * bootstrap: Bootstrap from gnulib and po repositories.
5924 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
5925 * README-cvs: Document these changes. Remove version numbers from
5926 mentions of build tools, since they change so often. Mention Flex.
5927
5928 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
5929 (gl_USE_SYSTEM_EXTENSIONS): Add.
5930 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
5931 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
5932 does this for us.
5933 (AC_ISC_POSIX): Remove; we no longer support this
5934 ancient OS, as it gets in the way of latest Autoconf & gnulib.
5935 (AC_HEADER_STDC): Remove: we now assume C89 or better.
5936 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
5937 Do not check for C89 headers, except for locale.h which is used
5938 by the Yacc library and must port to K&R hosts.
5939 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
5940 Do not check for C89 functions, except for setlocale which is
5941 used by the Yacc library.
5942 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
5943 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
5944 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
5945 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5946 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5947 AM_GNU_GETTEXT): Remove; now done by:
5948 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5949 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5950 for us.
5951
5952 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5953 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5954 Define to empty, as gnulib.mk will do the rest for us.
5955 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5956 for us.
5957 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5958 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5959
5960 * src/files.c: Include gnulib's xstrndup.h.
5961
5962 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5963 (REALLOC): Use xnrealloc, for likewise.
5964 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5965 (strnlen, memrchr): Remove decls; functions no longer used.
5966 Include <stpcpy.h>.
5967
5968 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5969 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5970 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5971 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5972 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5973 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5974 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5975 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5976 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5977 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5978 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5979 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5980 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5981 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5982 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5983 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5984 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5985 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5986 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5987 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
5988 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
5989 Remove, as these files are now generated automatically
5990 by bootstrap or automake.
5991
5992 * po/ChangeLog: Remove: all but one entry was a duplicate
5993 of this file, and I moved that 2000-11-02 entry here.
5994
5995 * config/.cvsignore: Add Makefile, depcomp, install-sh.
5996 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
5997 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
5998 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
5999 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6000 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6001 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6002 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6003 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6004 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6005 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6006 xstrndup.h.
6007 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6008 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6009 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6010 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6011 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6012 * src/.cvsignore: Remove *_.c.
6013
6014
6015 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6016 support it. (The latest stable gzip doesn't.)
6017
6018 2004-04-27 Paul Eggert <eggert@twinsun.com>
6019
6020 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6021 case, as stos_ is now used by destructors due to the 2004-02-09
6022 change.
6023
6024 Remove more K&R C support.
6025 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6026 * lib/subpipe.c (errno): Remove decl.
6027 Include <stdlib.h> unconditionally.
6028 (EXIT_FAILURE): Remove macro.
6029 * src/complain.c (vfprintf, strerror): Remove.
6030 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6031 unconditionally.
6032 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6033 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6034 (strchr, strspn, memchr): Remove decls.
6035 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6036 unconditionally. Do not declare perror.
6037 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6038 unconditionally.
6039
6040 * src/complain.c (_): Remove useless defn, as system.h defines this.
6041
6042 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6043 with latest obstack.h.
6044 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6045 to procedure types, as obstack.h now does that for us.
6046 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6047
6048 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6049 so that this include file can stand alone.
6050 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6051 does this now. Include subpipe.h first after config.h, to
6052 test whether it can stand alone.
6053
6054 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6055 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6056 unused declaration.
6057
6058 * tests/synclines.at (%union synch line): Put a dummy member in
6059 the union, because empty unions aren't allowed in C. Caught
6060 by GCC 3.4.0.
6061
6062 2004-04-13 Jim Meyering <jim@meyering.net>
6063
6064 * src/conflicts.c (conflicts_print): Correct format string typo:
6065 use `%%' to produce literal `%'. (trivial change)
6066
6067 2004-03-30 Paul Eggert <eggert@twinsun.com>
6068
6069 * src/getargs.c (version): Update copyright year to 2004.
6070
6071 * data/c.m4 (b4_int_type): Use 'short int' rather than
6072 'short', and similarly for 'long', 'unsigned', etc.
6073 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6074 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6075 yy_yypstack, yydumpstack): Likewise.
6076 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6077 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6078 Likewise.
6079 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6080 yy_stack_print, yyparse): Likewise.
6081 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6082 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6083 * lib/bitset.c (bitset_print): Likewise.
6084 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6085 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6086 * lib/bitsetv.c (bitsetv_dump): Likewise.
6087 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6088 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6089 Likewise.
6090 * src/LR0.c (allocate_itemsets): Likewise.
6091 * src/gram.h (rule_number, rule): Likewise.
6092 * src/lalr.h (goto_number): Likewise.
6093 * src/nullable.c (nullable_compute): Likewise.
6094 * src/output.c (prepare_rules): Likewise.
6095 * src/relation.c (relation_print, relation_digraph): Likewise.
6096 * src/relation.h (relation_node): Likewise.
6097 * src/state.h (state_number, transitions, errs, reductions,
6098 struct state): Likewise.
6099 * src/symtab.h (symbol_number, struct symbol): Likewise.
6100 * src/tables.c (vector_number, tally, action_number,
6101 default_goto, goto_actions): Likewise.
6102 * tests/existing.at (GNU Cim Grammar): Likewise.
6103 * tests/regression.at (Web2c Actions): Likewise.
6104
6105 * src/output.c (muscle_insert_short_int_table): Renamed from
6106 muscle_insert_short_table. All uses changed.
6107
6108 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6109
6110 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6111 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6112 Add %expect-rr rule.
6113
6114 * src/scan-gram.l: Recognize %expect-rr.
6115
6116 * src/conflicts.h (expected_sr_conflicts): Rename from
6117 expected_conflicts.
6118 (expected_rr_conflicts): Declare.
6119
6120 * src/conflicts.c (expected_sr_conflicts): Rename from
6121 expected_conflicts.
6122 (expected_rr_conflicts): Define.
6123 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6124 for GLR parsers.
6125 Use expected_sr_conflicts in place of expected_conflicts.
6126 Warn if expected_rr_conflicts used in non-GLR parser.
6127
6128 * doc/bison.texinfo: Add documentation for %expect-rr.
6129
6130 2004-03-08 Paul Eggert <eggert@gnu.org>
6131
6132 Add support for hex token numbers. Suggested by Odd Arild Olsen in
6133 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
6134
6135 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6136 in lalr1.cc.
6137 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6138 * src/scan-gram.l (scan_integer): New function.
6139 ({int}): Use it.
6140 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6141 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6142 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6143 Say "long int", not "long", for uniformity with GNU style.
6144
6145 2004-02-25 Paul Eggert <eggert@twinsun.com>
6146
6147 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6148 compilers. This fixes a problem with Intel's C++ compiler being
6149 chatty, reported by Guido Trentalancia in
6150 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
6151
6152 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6153
6154 Support %destructor and merge error locations in lalr1.cc.
6155
6156 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6157 (Parser::stos_): Define unconditionally.
6158 (Parser::destruct_): New method. Generate its body with
6159 b4_yydestruct_generate.
6160 (Parser::error_start_): New attribute.
6161 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6162 token which are discarded.
6163 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6164 error_start_ when erroneous token are discarded.
6165 (Parser::parse) <yyerrlab1>: Compute the location of the error
6166 token so that it covers all the discarded tokens.
6167 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6168 it can be called with `%skeleton "lalr1.cc"', and do that.
6169
6170 2004-02-02 Paul Eggert <eggert@twinsun.com>
6171
6172 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6173 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6174 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6175 There's no need to mention top_builddir since Automake does that
6176 for us.
6177 (INCLUDES): Remove, as Automake says it's obsolescent.
6178 Contents migrated into AM_CPPFLAGS as described above.
6179 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6180
6181 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6182
6183 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6184 (yyreportSyntaxError): Handle case where lookahead token is
6185 YYEMPTY.
6186
6187 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6188
6189 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6190 resulting parsers are compilable with C++.
6191
6192 2003-12-23 Paul Eggert <eggert@twinsun.com>
6193
6194 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6195 * src/output.c (output_skeleton): Rename local var.
6196 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6197 Bison tokens, as this runs afoul of the 2003-10-07 change that
6198 disallowed NUL bytes in character constants or string literals.
6199
6200 * tests/local.at: Require Autoconf 2.59's Autotest.
6201 * tests/testsuite.at: Don't include local.at, since we now assume
6202 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6203 including it.
6204 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6205 multiple inclusion warnings.
6206
6207 2003-12-02 Akim Demaille <akim@epita.fr>
6208
6209 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6210 conditions.
6211 From Bruno Haible.
6212
6213 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6214
6215 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6216
6217 2003-10-07 Paul Eggert <eggert@twinsun.com>
6218
6219 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6220 if testsuite doesn't exist.
6221
6222 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6223 literals, unfortunately.
6224 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6225 Complain about NUL bytes in character constants or string literals.
6226
6227 2003-10-05 Paul Eggert <eggert@twinsun.com>
6228
6229 * NEWS: Don't document %no-default-prec, as it's still
6230 too experimental.
6231 * doc/bison.texinfo: Document %no-default-prec only if
6232 the defaultprec flag is set. Normally it's not.
6233
6234 2003-10-04 Paul Eggert <eggert@twinsun.com>
6235
6236 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6237 non-modifiable lvalue, instead of a modifiable one.
6238 * doc/bison.texinfo (Actions): Document that $$ can
6239 be assigned to. Do not claim that $$ and $N are
6240 array element references: user code should not rely on this.
6241
6242 2003-10-01 Paul Eggert <eggert@twinsun.com>
6243
6244 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6245 (grammar_declaration): Use it.
6246 * src/scan-gram.l: New token %no-default-prec.
6247 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6248 * NEWS, doc/bison.texinfo: Document the above.
6249
6250 2003-10-01 Akim Demaille <akim@epita.fr>
6251
6252 VCG no longer supports long_straight_phase.
6253
6254 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6255 * src/print_graph.c (print_graph): Adjust.
6256
6257 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
6258 and Paul Eggert <eggert@twinsun.com>
6259
6260 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6261 Table of Symbols): Document %default-prec.
6262 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6263 (grammar_declaration): Set default_prec on %default-prec.
6264 * src/scan-gram.l (%default-prec): New token.
6265 * src/reader.h (default_prec): New flag.
6266 * src/reader.c: Likewise.
6267 (packgram): Handle it.
6268 * tests/conflicts.at (%default-prec without %prec,
6269 %default-prec with %prec, %default-prec 1): New tests.
6270
6271 2003-09-30 Paul Eggert <eggert@twinsun.com>
6272
6273 * tests/testsuite.at: Include local.at, not input.at, fixing
6274 a typo in the 2003-08-25 patch.
6275
6276 2003-08-27 Akim Demaille <akim@epita.fr>
6277
6278 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6279 GCC warnings.
6280
6281 2003-08-26 Akim Demaille <akim@epita.fr>
6282
6283 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6284 "<\#" to avoid magic from Gnus when posting parts of this script.
6285
6286 2003-08-26 Akim Demaille <akim@epita.fr>
6287
6288 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6289 (Parser::parse): here.
6290 Adjust: nerrs and errstatus is now replaced by...
6291 (Parser::nerrs_, Parser::errstatus_): New.
6292
6293 2003-08-25 Akim Demaille <akim@epita.fr>
6294
6295 * config/announce-gen, Makefile.cfg: New.
6296 * Makefile.am: Adjust.
6297 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6298 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6299
6300 2003-08-25 Akim Demaille <akim@epita.fr>
6301
6302 When reducing initial empty rules, Bison parser read an initial
6303 location that is not defined. This results in garbage, and that
6304 affects Bison's own parser. Therefore we need (i) to extend Bison
6305 to support a means to initialize this location, and (ii) to use
6306 this CVS Bison to fix CVS Bison's parser.
6307
6308 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6309 with...
6310 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6311 * src/parse-gram.y: Adjust.
6312 (%initial-action): New.
6313 (%error-verbose): Since we require CVS Bison, there is no reason
6314 not to use it.
6315 * src/scan-gram.l: Adjust.
6316 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6317 * data/yacc.c (yyparse): Use b4_initial_action.
6318
6319 2003-08-25 Akim Demaille <akim@epita.fr>
6320
6321 * doc/bison.texinfo: Don't promote stdout for error messages.
6322
6323 2003-08-25 Akim Demaille <akim@epita.fr>
6324
6325 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6326 From Alexandre Duret-Lutz.
6327
6328 2003-08-25 Akim Demaille <akim@epita.fr>
6329
6330 Version 1.875c.
6331
6332 2003-08-25 Akim Demaille <akim@epita.fr>
6333
6334 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6335 Use them.
6336
6337 2003-08-25 Akim Demaille <akim@epita.fr>
6338
6339 * data/lalr1.cc (Parser::reduce_print_): New.
6340 Use it.
6341
6342 2003-08-25 Akim Demaille <akim@epita.fr>
6343
6344 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6345 error recovery loops. This patch is based on
6346 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
6347 Also, augment the similarity between lalr1.cc and yacc.c.
6348 Note: the locations of error recovery rules are not correct yet.
6349
6350 * data/lalr1.cc: Comment changes to augment the similarity between
6351 lalr1.cc and yacc.c.
6352 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6353 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6354 yyerrlab), when hitting EOF, pop the whole stack here instead of
6355 merely falling thru the default error handling mechanism.
6356 (yyerrorlab): New label, with the old contents of YYERROR,
6357 plus the following change: pop the stack of rhs corresponding
6358 to the production that invoked YYERROR. That is how Yacc
6359 behaves (required by POSIX).
6360 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6361 fail.
6362
6363 2003-08-25 Akim Demaille <akim@epita.fr>
6364
6365 Tune local.at so that people can "autom4te -l autotest calc.at -o
6366 calc" for instance, to extract a sub test suite.
6367
6368 * tests/testsuite.at: Move the initialization, Autotest version
6369 requirement, and AT_TESTED invocation into...
6370 * tests/local.at: here.
6371 * tests/testsuite.at: Include it for compatibility with Autoconf
6372 2.57.
6373 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6374 be ignore.
6375
6376 2003-08-04 Paul Eggert <eggert@twinsun.com>
6377
6378 Rework code slightly to avoid gcc -Wtraditional warnings.
6379 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6380 The returned value is now stored in *YY0. All callers changed.
6381 * src/output.c (merge_output): Adjust to the above change.
6382
6383 2003-07-26 Paul Eggert <eggert@twinsun.com>
6384
6385 * data/glr.c (YYASSERT): New macro.
6386 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6387 yyresolveStates, yyprocessOneStack):
6388 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6389 Derived from a suggestion by Frank Heckenbach.
6390
6391 2003-07-25 Paul Eggert <eggert@twinsun.com>
6392
6393 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6394 for portability to K&R C (after ansi2knr, presumably). See
6395 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
6396 by Frank Heckenbach, though I have omitted the structure-initialization
6397 part of his glr-knr.diff patch since I recall that the Portable
6398 C Compiler didn't require that change.
6399
6400 Let the user specify how to allocate and free memory.
6401 Derived from a suggestion by Frank Heckenbach in
6402 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
6403 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6404 All uses of free, malloc, realloc changed to use these macros,
6405 and unnecessary casts removed.
6406 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6407
6408 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6409
6410 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6411 use s.empty() rather than s == "" to test for empty string; see
6412 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
6413 (trivial change)
6414
6415 2003-06-25 Akim Demaille <akim@epita.fr>
6416
6417 * config/depcomp, config/install-sh: Update from masters.
6418
6419 2003-06-20 Paul Eggert <eggert@twinsun.com>
6420
6421 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6422 and return properly parenthesized result.
6423 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6424 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6425 Remove unnecessary parentheses from uses.
6426 * doc/bison.texinfo (Location Default Action): Describe the
6427 conventions for parentheses.
6428
6429 2003-06-19 Paul Eggert <eggert@twinsun.com>
6430
6431 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6432 yyreportTree): Do not assume that size_t is the same width as int,
6433 when printing sizes. Print sizes using an unsigned format.
6434 Problem reported by Frank Heckenbach in
6435 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
6436
6437 Port to Forte Developer 7 C compiler.
6438 * data/glr.c (struct YYLTYPE): If locations are not being used,
6439 declare a single dummy member, as empty structs do not conform
6440 to the C standard.
6441 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6442 the Forte Developer 7 C compiler complains that end-of-loop
6443 code is not reached.
6444
6445 2003-06-17 Paul Eggert <eggert@twinsun.com>
6446
6447 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6448 avoid warnings from picky compilers about redefinition of PARAMS.
6449
6450 2003-06-17 Paul Eggert <eggert@twinsun.com>
6451
6452 Version 1.875b.
6453
6454 * NEWS: Document 1.875b.
6455
6456 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6457 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6458 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6459 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6460 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6461 per recent gettext manual's suggestion.
6462 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6463 Use prototypes, not old-style definitions.
6464 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6465 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6466 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6467 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6468 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6469 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6470 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6471 vbitset_or_and_cmp, vbitset_copy): Likewise.
6472
6473 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6474 Do not include <stdlib.h>.
6475 (PARAMS): Define unconditionally for C89.
6476 (ATTRIBUTE_NORETURN): Remove.
6477 (ATTRIBUTE_UNUSED): Define unconditionally.
6478
6479 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
6480 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
6481 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6482 * lib/vbitset.c, lib/vbitset.h: New files.
6483 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6484 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6485 from libbitset.
6486
6487 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6488 `How Can I Reset @code{yyparse}', since texinfo does not allow
6489 arbitrary @ in node names.
6490
6491 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6492 shouldn't be needed according to the gettext 0.12.1 documentation
6493 but which seem to be needed anyway: codeset.m4 glibc21.m4
6494 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
6495 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
6496 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
6497
6498 * lib/.cvsignore: Add stdbool.h.
6499 * m4/.cvsignore: Add nls.m4, po.m4.
6500
6501 Upgrade to CVS gnulib.
6502 * stdbool_.h: File renamed from stdbool.h.in.
6503 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6504 AC_HEADER_STDBOOL.
6505 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6506 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6507 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6508 (MOSTLYCLEANFILES): New var.
6509 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6510 (stdbool.h): New rule.
6511 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6512 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6513 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6514 m4/quote.m4: Upgrade to today's gnulib.
6515
6516 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6517 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6518 the tests right now.
6519 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6520 yyerror are declared before use; C99 requires this.
6521
6522 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6523
6524 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6525 first.
6526 (yyrecoverSyntaxError): Correct the logic for setting and testing
6527 yyerrState.
6528 Correct comment on handling EOF.
6529 Allow states with only a default reduction, rather than failing
6530 (I can't quite reconstruct why these were not allowed before).
6531
6532 Fixes to avoid problem that $-N rules in GLR parsers can cause
6533 buffer overruns, corrupting state.
6534
6535 * src/output.c (prepare_rules): Output max_left_semantic_context
6536 definition.
6537 * src/reader.h (max_left_semantic_context): New variable declaration.
6538 * src/scan-gram.l (max_left_semantic_context): Define.
6539 (handle_action_dollar): Update max_left_semantic_context.
6540 * data/glr.c (YYMAXLEFT): New definition.
6541 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6542 (yyresolveAction): Ditto.
6543
6544 Fixes to problems with location handling in GLR parsers reported by
6545 Frank Heckenbach (2003/06/05).
6546
6547 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6548 (YYRHSLOC): Add parentheses, and define only if locations used.
6549 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6550 locations not used.
6551 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6552 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
6553
6554 * tests/cxx-type.at: Exercise location information; update tests
6555 to differentiate output with and without locations.
6556 Remove forward declarations of yylex and yyerror---caused errors
6557 because default YYLTYPE not yet defined.
6558 Change semantic actions to compute strings, rather than printing
6559 them directly (to test proper passing of semantics values). Change
6560 output to prefix notation and update test data and expected results.
6561 (yylex): Track locations.
6562 (stmtMerge): Return value rather than printing, and include arguments
6563 in value.
6564
6565 2003-06-03 Paul Eggert <eggert@twinsun.com>
6566
6567 Avoid warnings generated by GCC 2.95.4 when Bison is
6568 configured with --enable-gcc-warnings.
6569 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6570 yy::]b4_parser_class_name[::translate_,
6571 yy::Stack::operator[] (unsigned),
6572 yy::Stack::operator[] (unsigned) const,
6573 yy::Slice::operator[] (unsigned),
6574 yy::Slice::operator[] (unsigned) const):
6575 Rename local vars to avoid warnings.
6576 * tests/glr-regression.at (Improper handling of embedded actions
6577 and $-N in GLR parsers): Remove unused local variable from yylex.
6578 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6579 (void) as arg when not pure, since we now assume C89 when building
6580 Bison. Pacify GCC by using parameter.
6581
6582 2003-06-02 Paul Eggert <eggert@twinsun.com>
6583
6584 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
6585 yy::Location::lines, yy::Location::columns): Rename arguments
6586 to avoid shadowing; this removes a warning generated by GCC 3.3.
6587
6588 2003-06-01 Paul Eggert <eggert@twinsun.com>
6589
6590 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
6591 to g++, as GCC 3.3 complains if you do it.
6592 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
6593 everything that WARNING_CFLAGS has, except omit warnings
6594 not suitable for C++.
6595 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
6596 * tests/atlocal.in (CXXFLAGS): New var.
6597 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
6598
6599 Fix a GLR parser bug I reported in February; see
6600 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
6601 The problem was that GLR parsers did not conform to the C standard,
6602 because actions like { $1 = $2 + $3; } expanded to expressions
6603 that invoked YYFILL in separate subexpressions, and YYFILL assigned
6604 to a local variable. The C standard says that expressions
6605 like (var = f ()) + (var = f ()) have undefined behavior.
6606 Another problem was that GCC sometimes issues warnings that
6607 yyfill and its parameters are unused.
6608
6609 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6610 as possibly unused.
6611 (yyfill): New function.
6612 (YYFILL): Use it.
6613 (yyuserAction): Change type of yynormal to bool, so that it matches
6614 the new yyfill signature. Mark it as possibly unused.
6615
6616
6617 Follow up on a bug I reported in February, where a Bison-generated
6618 parser can loop. Provide a test case and a fix for yacc.c. I
6619 don't have a fix for lalr1.cc or for glr.c, unfortunately.
6620 The original bug report is in:
6621 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
6622
6623 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
6624 macro's size was becoming unwieldy.
6625 (yyerrlab): Do not discard an empty lookahead symbol, as this
6626 might destroy garbage.
6627 (yyerrorlab): New label, with the old contents of YYERROR,
6628 plus the following change: pop the stack of rhs corresponding
6629 to the production that invoked YYERROR. That is how Yacc
6630 behaves, and POSIX requires this behavior.
6631 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
6632 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
6633 Define 'alarm' to do nothing if unistd.h is not available.
6634 Add a new rule "exp: '-' error;" to test the above change to
6635 data/yacc.c. Use 'alarm' to abort any test taking longer than
6636 10 seconds, as it's probably looping.
6637 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
6638 Also, the new yacc.c generates two fewer diagnostics for an
6639 existing test.
6640
6641 2003-05-24 Paul Eggert <eggert@twinsun.com>
6642
6643 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
6644 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
6645 This fixes a problem reported by John Bowman when the Compaq/HP
6646 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
6647 -ansi -Wall -gall).
6648 * data/yacc.c (union yyalloc): Likewise.
6649 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
6650
6651 Switch from 'int' to 'bool' where that makes sense.
6652
6653 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
6654 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
6655 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
6656 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
6657 Return or accept bool, not int. All callers changed.
6658 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
6659 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
6660 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
6661 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
6662 bitset_or_and_cmp_): Likewise.
6663 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
6664 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
6665 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
6666 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
6667 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
6668 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
6669 bitset_stats_or_and_cmp): Likewise.
6670 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
6671 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
6672 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
6673 ebitset_xor_cmp): Likewise.
6674 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
6675 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
6676 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
6677 lbitset_xor_cmp): Likewise.
6678 * lib/bbitset.h: Include <stdbool.h>.
6679 (struct bitset_vtable): The following members now return bool, not
6680 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
6681 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
6682 or_and_cmp).
6683 * src/conflicts.c (count_rr_conflicts): Likewise.
6684 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6685 All uses changed.
6686 * lib/ebitset.c (ebitset_obstack_init): Likewise.
6687 * lib/lbitset.c (lbitset_obstack_init): Likewise.
6688 * src/getargs.c (debug_flag, defines_flag, locations_flag,
6689 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6690 graph_flag): Likewise.
6691 * src/getargs.h (debug_flag, defines_flag, locations_flag,
6692 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6693 graph_flag): Likewise.
6694 * src/output.c (error_verbose): Likewise.
6695 * src/output.h (error_verbose): Likewise.
6696 * src/reader.c (start_flag, typed): Likewise.
6697 * src/reader.h (typed): Likewise.
6698 * src/getargs.c (LOCATIONS_OPTION): New constant.
6699 (long_options, getargs): Use it.
6700 * src/lalr.c (build_relations): Use bool, not int.
6701 * src/nullable.c (nullable_compute): Likewise.
6702 * src/print.c (print_reductions): Likewise.
6703 * src/tables.c (action_row, pack_vector): Likewise.
6704 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6705 * src/output.c (prepare): Use it.
6706 * src/output.c (token_definitions_output,
6707 symbol_destructors_output, symbol_destructors_output): Use string,
6708 not boolean integer, to keep track of whether to output separator.
6709 * src/print_graph.c (print_core): Likewise.
6710 * src/state.c (state_rule_lookaheads_print): Likewise.
6711
6712 * config/install-sh: Sync from automake 1.7.5.
6713
6714 2003-05-14 Paul Eggert <eggert@twinsun.com>
6715
6716 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6717 semicolon after a grammar declaration, in the interest of possible
6718 future changes to the Bison input language.
6719 Do not allow a stray semicolon at the start of the grammar.
6720 (rhses.1): Allow one or more semicolons after any rule, including
6721 just before "|" as required by POSIX.
6722 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6723 grammar.
6724
6725 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6726
6727 %parse-param support for lalr1.cc.
6728
6729 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6730 b4_cc_constructor_calls, b4_cc_constructor_call,
6731 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6732 definitions.
6733 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6734 parse-param arguments.
6735 (yy::b4_parser_class_name): Declare instance variables to
6736 hold parse-param arguments.
6737 * tests/calc.at: s/value/semantic_value/ because value clashes
6738 with a member of yy::b4_parser_class_name. Adjust C++ code
6739 to handle %parse-param. Enable %parse-param test in C++.
6740
6741 2003-05-12 Paul Eggert <eggert@twinsun.com>
6742
6743 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6744 English a bit. Fix fclose typo. Change "const char" to "char
6745 const", and use ANSI C rather than K&R for "main". Suggest
6746 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6747 and suggest yy_switch_to_buffer.
6748
6749 2003-05-05 Paul Eggert <eggert@twinsun.com>
6750
6751 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6752 C89. This avoids a diagnostic on compilers that define __STDC__
6753 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
6754 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
6755
6756 2003-05-03 Paul Eggert <eggert@twinsun.com>
6757
6758 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6759 Do not overrun array bounds.
6760 This should fix a bug reported today by Olatunji Oluwabukunmi in
6761 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
6762
6763 2003-04-29 Akim Demaille <akim@epita.fr>
6764
6765 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6766 * src/getargs.c, src/getargs.h: here, as bool, not int.
6767 (nondeterministic_parser): New.
6768 * src/parse-gram.y, src/scan-gram.l: Support
6769 %nondeterministic-parser.
6770 * src/output.c (prepare): Use nondeterministic_parser instead
6771 of glr_parser where appropriate.
6772 * src/tables.c (conflict_row, action_row, save_row)
6773 (token_actions, token_actions, pack_vector): Ditto.
6774
6775 2003-04-29 Akim Demaille <akim@epita.fr>
6776
6777 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6778
6779 2003-04-29 Akim Demaille <akim@epita.fr>
6780
6781 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6782 with %pure-parser and %locations to exercise the patch from Yakov
6783 Markovitch below.
6784
6785 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6786
6787 * data/yacc.c: (b4_lex_param): Corrected for the case where
6788 %lex-param is provided and %pure-parser isn't.
6789
6790 2003-04-27 Paul Eggert <eggert@twinsun.com>
6791
6792 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
6793 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
6794 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6795 if it is not defined.
6796 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6797
6798 2003-04-26 Paul Eggert <eggert@twinsun.com>
6799
6800 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6801 Declare to be of type suitable for the ninf value itself, not of
6802 type suitable for the corresponding table, since the latter might
6803 be unsigned but the ninf value might be negative. This fixes a
6804 bug reported by Alexandre Duret-Lutz in
6805 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
6806
6807 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6808 invokes it. We shouldn't invoke it twice because it will attempt
6809 to put error.o in the archive twice. This fixes a glitch reported
6810 by Martin Mokrejs in
6811 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
6812
6813 2003-04-21 Paul Eggert <eggert@twinsun.com>
6814
6815 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6816 to gnulib.
6817
6818 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6819
6820 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6821 Fix obvious typo that results in uncompilable GLR parsers
6822 when both %pure-parser and %locations are used. (trivial change)
6823
6824 2003-04-17 Paul Eggert <eggert@twinsun.com>
6825
6826 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6827 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6828 Do not insert the expected token via unput, as this runs afoul
6829 of a POSIX-compatibility bug in flex 2.5.31.
6830 All uses changed to BEGIN the parent state,
6831 since we no longer insert the expected token via unput.
6832 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6833 that is no longer emitted after the above change.
6834
6835 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6836 the first one. This change is from Paul Hilfinger, and it fixes
6837 regression reported by Werner Lemberg in
6838 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
6839
6840 (resolve_sr_conflict): Don't invoke state_errs_set
6841 unless one or more tokens have been explicitly made errors.
6842 Otherwise, the above change causes Bison to abort.
6843
6844 * tests/existing.at (GNU pic Grammar): New test case, taken from
6845 Lemberg's email.
6846
6847 2003-03-31 Akim Demaille <akim@epita.fr>
6848
6849 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6850
6851 2003-03-31 Akim Demaille <akim@epita.fr>
6852
6853 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6854 output.
6855
6856 2003-03-31 Akim Demaille <akim@epita.fr>
6857
6858 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6859 From Paul Hilfinger.
6860
6861 2003-03-29 Akim Demaille <akim@epita.fr>
6862
6863 * m4/error.m4: Do not put under dynamic conditions some code which
6864 expansion is under static control.
6865
6866 2003-03-29 Akim Demaille <akim@epita.fr>
6867
6868 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6869
6870 2003-03-29 Akim Demaille <akim@epita.fr>
6871
6872 * doc/bison.texinfo (Strings are Destroyed): New.
6873
6874 2003-03-13 Paul Eggert <eggert@twinsun.com>
6875
6876 * .cvsignore: Add configure.lineno.
6877 * src/.cvsignore: Add yacc.
6878 * tests/.cvsignore: Add testsuite.log.
6879 * doc/fdl.texi: Sync with latest FSF version.
6880
6881 2003-03-12 Paul Eggert <eggert@twinsun.com>
6882
6883 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
6884 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
6885 cursor, instead of leaving it undefined. This fixes a bug
6886 reported by Tim Van Holder in
6887 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
6888 * tests/input.at (Torturing the Scanner): Test the scanner on
6889 an empty input file, which was Tim Van Holder's test case.
6890
6891 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
6892 <sys/resource.h> can be included, include sys/time.h and
6893 sys/times.h first, if available. This works around the SunOS
6894 4.1.4 porting bug reported by Bruce Becker in
6895 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
6896
6897 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6898 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6899 AC_HEADER_SYS_WAIT.
6900
6901 Merge changes from gnulib. This was prompted because the CVS
6902 snapshot didn't build on Solaris 7 due to strnlen problems.
6903
6904 These changes need to be merged back into gnulib:
6905 * lib/hash.c: Include <stdbool.h> unconditionally.
6906 * m4/onceonly.m4 (m4_quote): New macro.
6907 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
6908 Quote AC_FOREACH variable-expansions properly.
6909 The 2003-01-03 obstack.h change also needs merging.
6910 {end of changes requiring merging}
6911
6912 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6913 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
6914 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
6915 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
6916 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
6917 New files, imported from gnulib.
6918 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
6919 above.
6920
6921 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
6922 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
6923 gnulib sources.
6924
6925 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6926 Add.
6927 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
6928 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
6929 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
6930 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
6931 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
6932 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
6933 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
6934 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
6935 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
6936 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
6937 (jm_PREREQ_ARGMATCH): Remove.
6938 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
6939 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
6940
6941 * src/system.h: Include <stdbool.h> unconditionally.
6942
6943 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6944 assuming at least C89 in the bitset code for some time now.
6945
6946 2003-03-03 Akim Demaille <akim@epita.fr>
6947
6948 * ro.po: New.
6949
6950 2003-03-02 Akim Demaille <akim@epita.fr>
6951
6952 * doc/bison.texinfo (Table of Symbols): Reactivate the
6953 documentation for %lex-param, and %parse-param.
6954
6955 2003-03-02 Akim Demaille <akim@epita.fr>
6956
6957 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6958 generate verbose error messages.
6959 Use the number of tokens as an upper bound in yytname, as it
6960 cannot be a non terminal.
6961
6962 2003-03-02 Akim Demaille <akim@epita.fr>
6963
6964 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6965 message.
6966
6967 2003-03-02 Akim Demaille <akim@epita.fr>
6968
6969 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6970 Use them to exercise yycheck overrun.
6971 Based on Andrew Suffield's grammar.
6972
6973 2003-03-02 Akim Demaille <akim@epita.fr>
6974
6975 Create tests/local.at for Bison generic testing macros.
6976
6977 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6978 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6979 This new file.
6980 * tests/calc.at (AT_CHECK_CALC): Adjust.
6981 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6982 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6983 * tests/local.at: here.
6984 (AT_COMPILE_CXX): Tags the tests using it as c++.
6985 Ignore the test if CXX is not functional.
6986
6987 2003-03-01 Paul Eggert <eggert@twinsun.com>
6988
6989 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
6990 not loc->end, since loc->end might contain garbage and this leads
6991 to undefined behavior on some platforms.
6992 (id_loc, token_start): Use (IF_LINTed) initial values that do not
6993 depend on *loc, so that the reader doesn't give the the false
6994 impression that *loc is initialized.
6995 (<INITIAL>"%%"): Do not bother setting code_start, since its value
6996 does not survive the return.
6997
6998 2003-03-01 Akim Demaille <akim@epita.fr>
6999
7000 * src/scan-gram.l (code_start): Always initialize it when entering
7001 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7002 yylex invocation. An alternative would be making it static, but
7003 then it starts with the second %%'s beginning, instead of its end.
7004
7005 2003-02-28 Paul Eggert <eggert@twinsun.com>
7006
7007 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7008 around a UnixWare 7.1.1 porting bug reported by John Hughes in
7009 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
7010
7011 2003-02-26 Paul Eggert <eggert@twinsun.com>
7012
7013 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7014 Remove Sequent/Pyramid discussion (nobody uses them any more).
7015 Merge VMS and MS-DOS discussion; these ports may well be dead
7016 but let's keep mentioning them for now. Put <> around email
7017 addresses. Add copyright notice.
7018
7019 2003-02-24 Paul Eggert <eggert@twinsun.com>
7020
7021 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7022 to avoid collision with flex use of yylineno.
7023 Problem reported by Bruce Lilly in
7024 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
7025 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7026 * data/yacc.c (yy_reduce_print): Likewise.
7027
7028 * config/depcomp: Sync with Automake 1.7.3.
7029
7030 2003-02-21 Akim Demaille <akim@epita.fr>
7031
7032 * data/lalr1.cc: Use temporary variables instead of casts to
7033 change integer types.
7034 Suggested by Paul Eggert.
7035
7036 2003-02-21 Akim Demaille <akim@epita.fr>
7037
7038 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7039 to avoid confusions with lalr1.cc's notion of Position.
7040 Suggested by Paul Eggert.
7041
7042 2003-02-20 Akim Demaille <akim@epita.fr>
7043
7044 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7045 before initial_columns.
7046 (location.hh): Use consistent variable names when defining the
7047 operator<<.
7048 Use "last" so that we subtract from Positions, not from unsigned.
7049
7050 2003-02-20 Akim Demaille <akim@epita.fr>
7051
7052 * data/lalr1.cc (position.hh): New subfile, including the extended
7053 and Doxygen'ed documentation of class Position.
7054 (location.hh): Use it.
7055 Document a` la Doxygen.
7056 With the help of Benoit Perrot.
7057
7058 2003-02-20 Akim Demaille <akim@epita.fr>
7059
7060 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7061 AT_YACC_IF.
7062 Redefine AT_YYERROR_SEES_LOC_IF using it.
7063 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7064 not defined.
7065 Don't use the location in yy::Parser::error_ and
7066 yy::Parser::print_ when not %locations.
7067 Activate more lalr1.cc tests.
7068
7069 2003-02-19 Akim Demaille <akim@epita.fr>
7070
7071 * data/lalr1.cc: When displaying a line number, be sure to make it
7072 an int.
7073
7074 2003-02-19 Akim Demaille <akim@epita.fr>
7075
7076 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7077 Remove, useless.
7078 (YYABORT, YYACCEPT, YYERROR): New.
7079 * tests/calc.at: Renable the lalr1.cc test.
7080
7081 2003-02-19 Akim Demaille <akim@epita.fr>
7082
7083 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7084 error recovery, mixing with/without pops and discarding of the
7085 lookahead.
7086 Exercise YYERROR.
7087 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7088
7089 2003-02-17 Paul Eggert <eggert@twinsun.com>
7090
7091 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7092 * tests/testsuite.at (AT_COMPILE): Use them.
7093 This fixes the testsuite problem reported by Robert Lentz in
7094 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
7095
7096 2003-02-12 Paul Eggert <eggert@twinsun.com>
7097
7098 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7099 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
7100 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
7101 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7102 Check for malloc failure, for consistency with yacc.c.
7103 (yytname_size): Remove, for consistency with yacc.c.
7104
7105 The bug still remains in data/lalr1.cc, as I didn't have time
7106 to fix it there.
7107
7108 2003-02-06 Akim Demaille <akim@epita.fr>
7109
7110 * configure.ac (GXX): Rename as...
7111 (CXX): this, to keep the original Autoconf semantics.
7112 Require 2.57.
7113 * data/lalr1.cc: Fix b4_copyright invocations.
7114 If YYDEBUG is not defined, don't depend upon name_ being defined.
7115 (location.hh): Include string and iostream.
7116 (Position::filename): New member.
7117 (Position::Position ()): New.
7118 (operator<< (Position)): New.
7119 (operator- (Position, int)): New.
7120 (Location::first, Location::last): Rename as...
7121 (Location::begin, Location::end): these, to mock the conventional
7122 iterator names.
7123 (operator<< (Location)): New.
7124 * tests/atlocal.in (CXX): New.
7125 * tests/testsuite.at (AT_COMPILE_CXX): New.
7126 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7127 locations in a more synthetic way.
7128 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7129 lalr1.cc is used.
7130 Adjust the C locations to match those from Emacs: first column is
7131 column 0.
7132 Change all the expected results.
7133 Conform to the GCS: simplify the locations when applicable.
7134 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7135 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7136 these CPP macros with the m4 macros new defined by...
7137 (AT_CHECK_PUSHDEFS): this, i.e.:
7138 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
7139 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7140 New macros.
7141 (AT_CHECK_POPDEFS): Undefine them.
7142 (AT_CHECK_CALC_LALR1_CC): New.
7143 Use it for the first lalr1.cc test.
7144
7145 2003-02-04 Akim Demaille <akim@epita.fr>
7146
7147 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7148 Location as is defined.
7149
7150 2003-02-04 Akim Demaille <akim@epita.fr>
7151
7152 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7153 name_ being defined.
7154
7155 2003-02-03 Paul Eggert <eggert@twinsun.com>
7156
7157 * src/gram.h (start_symbol): Remove unused decl.
7158
7159 Use more-consistent naming conventions for local vars.
7160
7161 * src/derives.c (derives_compute): Change type of local var from
7162 int to rule_number.
7163 * src/gram.c (grammar_rules_partial_print): Likewise.
7164 * src/print.c (print_core): Likewise.
7165 * src/reduce.c (reduce_grammar_tables): Likewise.
7166
7167 * src/gram.c (grammar_dump): Change name of item_number *
7168 local var from r to rp.
7169 * src/nullable.c (nullable_compute): Likewise.
7170
7171 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7172
7173 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7174 for symbol or symbol_number var.
7175 * src/reader.c (grammar_start_symbol_set): Likewise.
7176 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7177 Likewise.
7178 * src/state.c (transitions_to): Likewise.
7179 * src/state.h: Likewise.
7180 * src/tables.c (symbol_number_to_vector_number): Likewise.
7181
7182 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7183 char * var.
7184
7185 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7186 var.
7187
7188 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7189 var.
7190
7191 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7192 Use str, not s, for char * var. Use ch, not c, for character var.
7193 Use size for size var.
7194
7195 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7196 char * var.
7197 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7198 uniqstr var.
7199 * src/uniqstr.h: Likewise.
7200
7201 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7202 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7203 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7204 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7205 param to have same name as that of enum, so that we don't use
7206 "s" to stand for a non-state.
7207
7208 2003-02-02 Akim Demaille <akim@epita.fr>
7209
7210 * src/scan-skel.l: Scan more than one inert character per yylex
7211 invocation.
7212
7213 2003-02-01 Paul Eggert <eggert@twinsun.com>
7214
7215 Version 1.875a.
7216
7217 * po/LINGUAS: Add ms.
7218
7219 2003-01-30 Akim Demaille <akim@epita.fr>
7220
7221 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7222
7223 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7224
7225 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7226 of $1.
7227
7228 Changes in response to error report by S. Eken: GLR mode does not
7229 handle negative $ indices or $ indices in embedded rules correctly.
7230 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
7231
7232 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7233 (b4_rhs_location): Ditto.
7234 (yyfill): New function to copy from stack tree into array
7235 incrementally.
7236 (yyuserAction): Modify to allow incremental move of semantic values
7237 to rhs array when in GLR mode.
7238 Define YYFILL to use in user-defined actions to fill semantic array
7239 as needed.
7240 Remove dummy use of yystack, as there is now a guaranteed use.
7241 (yydoAction): Modify to allow incremental move of semantic values
7242 to rhs array when in GLR mode.
7243 (yyresolveAction): Ditto.
7244 (yyglrShiftDefer): Update comment.
7245 (yyresolveStates): Use X == NULL for pointers, not !X.
7246 (yyglrReduce): Ditto.
7247 (yydoAction): Ditto
7248
7249 * tests/glr-regr1.at: Rename to ...
7250 * tests/glr-regression.at: Add new regression test for the problems
7251 described above (adapted from S. Eken).
7252 Update copyright notice.
7253 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7254 * tests/Makefile.am: Ditto.
7255
7256 2003-01-28 Paul Eggert <eggert@twinsun.com>
7257
7258 * data/lalr1.cc: Do not use @output_header_name@ unless
7259 b4_defines_flag is set. This fixes two bugs reported by
7260 Tim Van Holder in
7261 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7262 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
7263
7264 2003-01-21 Paul Eggert <eggert@twinsun.com>
7265
7266 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7267 we don't need to worry about yyerrlab1 being reported as an
7268 "unused label" by non-GCC C compilers. The downside is that if
7269 locations are used then a couple of statements are duplicated each
7270 time YYERROR is invoked, but the upside is that the warnings
7271 should vanish.
7272 (yyerrlab1): Move code to YERROR.
7273 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7274 This reverts some of the 2002-12-27 change.
7275
7276 2003-01-17 Paul Eggert <eggert@twinsun.com>
7277
7278 * src/output.c (symbol_printers_output): Fix typo that led
7279 to core dump. Problem reported by Antonio Rus in
7280 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
7281
7282 2003-01-13 Akim Demaille <akim@epita.fr>,
7283 Quoc Peyrot <chojin@lrde.epita.fr>,
7284 Robert Anisko <anisko_r@lrde.epita.fr>
7285
7286 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7287 when the stacks contain one element, as the loop would otherwise
7288 free the last state, and then use the top state (the one we just
7289 popped). This means that the initial elements will not be freed
7290 explicitly, as is the case in yacc.c; it is not a problem, as
7291 these elements have fake values.
7292
7293 2003-01-11 Paul Eggert <eggert@twinsun.com>
7294
7295 * NEWS: %expect-violations are now just warnings, reverting
7296 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7297 bootstrapping problem reported by Matthias Klose; see
7298 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
7299 * src/conflicts.c (conflicts_print): Likewise.
7300 * tests/conflicts.at (%expect not enough, %expect too much,
7301 %expect with reduce conflicts): Likewise.
7302 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7303 that the warning is enabled if the number of conflicts changes
7304 (not necessarily increases).
7305
7306 * src/getargs.c (version): Update copyright year.
7307
7308 2003-01-09 Akim Demaille <akim@epita.fr>
7309
7310 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7311
7312 2003-01-08 Paul Eggert <eggert@twinsun.com>
7313
7314 * Makefile.maint (WGETFLAGS):
7315 New macro, containing "-C off" to disable proxy caches.
7316 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7317 (rel-check): Use $(WGET) instead of wget.
7318
7319 2003-01-06 Paul Eggert <eggert@twinsun.com>
7320
7321 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7322 the GLR paper of Scott, Johnstone and Hussain.
7323
7324 2003-01-04 Paul Eggert <eggert@twinsun.com>
7325
7326 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7327 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7328 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7329 (EXTRA_LIBRARIES): New var, for liby.a.
7330 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7331 (EXTRA_SCRIPTS): New var, for yacc.
7332
7333 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7334 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7335 Problem reported by Nelson H. F. Beebe.
7336
7337 2003-01-03 Paul Eggert <eggert@twinsun.com>
7338
7339 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7340 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7341 when compiling Bison 1.875's `bitset bset = obstack_alloc
7342 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7343
7344 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7345 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7346 grow to a huge size with typical invocation.
7347
7348 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7349 Use the pattern recommended by Autoconf 2.57, except also protect
7350 against double-definition.
7351 * src/system.h: Likewise.
7352 Portability issues reported by Nelson H. F. Beebe.
7353
7354 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7355 All uses changed. Provide a definition in both C and C++.
7356 (yytrue, yyfalse): Define even if defined (__cplusplus).
7357
7358 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7359 Reported by Nelson H. F. Beebe.
7360
7361 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7362
7363 2003-01-02 Paul Eggert <eggert@twinsun.com>
7364
7365 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7366 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7367 Bug reported by Nelson H. F. Beebe.
7368
7369 2003-01-01 Paul Eggert <eggert@twinsun.com>
7370
7371 * Version 1.875.
7372
7373 2002-12-30 Paul Eggert <eggert@twinsun.com>
7374
7375 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7376 Moved here from...
7377 (<INITIAL>","): Here. This causes stray "," to be treated
7378 more uniformly.
7379
7380 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
7381 last brace in braced code when not in Yacc mode, for compatibility
7382 with Bison 1.35. This resurrects the 2001-12-15 patch to
7383 src/reader.c.
7384
7385 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7386 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7387
7388 2002-12-28 Paul Eggert <eggert@twinsun.com>
7389
7390 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7391 that of SYM's type. This fixes Debian bug 168069, reported by
7392 Thomas Olsson.
7393
7394 2002-12-28 Paul Eggert <eggert@twinsun.com>
7395
7396 Version 1.75f.
7397
7398 Switch back to the Yacc style of conflict reports, undoing some
7399 of the 2002-07-30 change.
7400 * doc/bison.texinfo (Understanding): Use Yacc style for
7401 conflict reports. Also, use new way of locating rules.
7402 * src/conflicts.c (conflict_report):
7403 Renamed from conflict_report_yacc, removing the old
7404 'conflict_report'. Translate the entire conflict report at once,
7405 so that we don't assume that "," has the same interpretation in
7406 all languages.
7407 (conflicts_output): Use Yacc-style conflict report for each state,
7408 instead of our more-complicated style.
7409 (conflicts_print): Use Yacc-style conflict report, except print
7410 the input file name when not emulating Yacc.
7411 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7412 Conflicted Reduction, %expect not enough, %expect too much,
7413 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7414 * tests/existing.at (GNU Cim Grammar): Likewise.
7415 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7416
7417 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7418 fatal): Don't invoke fflush; it's not needed and it might even be
7419 harmful for stdout, as stdout might not be open.
7420 * src/reduce.c (reduce_print): Likewise.
7421
7422 2002-12-27 Paul Eggert <eggert@twinsun.com>
7423
7424 Fix a bug where error locations were not being recorded correctly.
7425 This problem was originally reported by Paul Hilfinger in
7426 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
7427
7428 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7429 top of the location stack's error locations.
7430 (yyerrlab): Set it. When discarding a token, push its location
7431 onto yylerrsp so that we don't lose track of the error's end.
7432 (yyerrlab1): Now is only the target of YYERROR, so that we can
7433 properly record the location of the action that failed. For GCC
7434 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7435 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7436 (yyerrlab2): New label, which yyerrlab now falls through to.
7437 Compute the error's location by applying YYLLOC_DEFAULT to
7438 the locations of all the symbols that went into the error.
7439 * doc/bison.texinfo (Location Default Action): Mention that
7440 YYLLOC_DEFAULT is also invoked for syntax errors.
7441 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7442 Error locations include the locations of all the tokens that were
7443 discarded, not just the last token.
7444
7445 2002-12-26 Paul Eggert <eggert@twinsun.com>
7446
7447 * src/files.c: Include quote.h.
7448 (compute_output_file_names): Warn if we detect conflicting
7449 outputs to the same file. This should catch the misunderstanding
7450 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7451
7452 * src/conflicts.c (conflicts_print): If the user specifies
7453 "%expect N", report an error if there are any reduce/reduce
7454 conflicts. This is what the manual says should happen.
7455 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7456 * tests/conflicts.at (%expect with reduce conflicts): New test.
7457
7458 Don't use m4_include on relative file names, as it doesn't work as
7459 desired if there happens to be a file with that name under ".".
7460
7461 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7462 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7463 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7464 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7465 * src/output.c (output_skeleton): Use full path names when
7466 specifying a file to include; don't rely on include path, as
7467 it's unreliable when the working file contains a file with
7468 that name.
7469
7470 2002-12-25 Paul Eggert <eggert@twinsun.com>
7471
7472 Remove obsolete references to bison.simple and bison.hairy.
7473 Problem mentioned by Aubin Mahe in
7474 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
7475 * data/glr.c: Comment fix.
7476 * doc/bison.1: Remove references. Also, mention "yacc".
7477
7478 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7479 with -g option.
7480
7481 * src/parse-gram.y (declaration): Use enum "report_states" rather
7482 than its numeric value 1.
7483
7484 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7485 opening a new one. This fixes Debian bug 165349, reported by
7486 Bruce Stephens.
7487
7488 2002-12-24 Paul Eggert <eggert@twinsun.com>
7489
7490 Version 1.75e.
7491
7492 * Makefile.maint (cvs-update): Don't assume that the shell
7493 supports $(...), as Solaris sh doesn't.
7494
7495 * src/parse-gram.y (lloc_default): Remove test for empty
7496 nonterminals at the end, since it didn't change the result.
7497
7498 2002-12-24 Paul Eggert <eggert@twinsun.com>
7499
7500 If the user does not define YYSTYPE as a macro, Bison now declares it
7501 using typedef instead of defining it as a macro. POSIX requires this.
7502 For consistency, YYLTYPE is also declared instead of defined.
7503
7504 %union directives can now have a tag before the `{', e.g., the
7505 directive `%union foo {...}' now generates the C code
7506 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7507 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7508 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7509 instead of `yyltype'.
7510
7511 `yystype' and `yyltype' are now obsolescent macros instead of being
7512 typedefs or tags; they are no longer documented and will be
7513 withdrawn in a future release.
7514
7515 * data/glr.c (b4_location_type): Remove.
7516 (YYSTYPE): Renamed from yystype.
7517 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7518 (struct YYLTYPE): Renamed from struct yyltype.
7519 (YYLTYPE): Renamed from yyltype.
7520 (yyltype, yystype): New (and obsolescent) macros,
7521 for backward compatibility.
7522 * data/yacc.c: Likewise.
7523
7524 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7525 does not specify a union tag. This is for compatibility with
7526 Solaris 9 yacc.
7527
7528 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7529 const *, since it is now modified by stripping surrounding { }.
7530 (current_braced_code): Remove.
7531 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7532 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7533 trailing " {...}". Now of type <chars>.
7534 (grammar_declaration): Adjust to bundled tokens.
7535 (code_content): Remove; stripping is now done by add_param.
7536 (print_token_value): Print contents of bundled tokens.
7537 (token_name): New function.
7538
7539 * src/reader.h (braced_code, current_braced_code): Remove.
7540 (token_name): New decl.
7541
7542 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7543 token_type, not braced_code code_kind. All uses changed.
7544 (SC_PRE_CODE): New state, for scanning after a keyword that
7545 has (or usually has) an immediately-following braced code.
7546 (token_type): New local var, to keep track of which token type
7547 to return when scanning braced code.
7548 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
7549 <INITIAL>"%parse-param", <INITIAL>"%printer",
7550 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7551 instead of returning a token type immediately.
7552 (<INITIAL>"{"): Set token type.
7553 (<SC_BRACED_CODE>"}"): Use it.
7554 (handle_action_dollar, handle_action_at): Now returns bool
7555 indicating success. Fail if ! current_rule; this prevents a core dump.
7556 (handle_symbol_code_dollar, handle_symbol_code_at):
7557 Remove; merge body into caller.
7558 (handle_dollar, handle_at): Complain in invalid contexts.
7559
7560 * NEWS, doc/bison.texinfo: Document the above.
7561 * NEWS: Fix years and program names in copyright notice.
7562
7563 2002-12-17 Paul Eggert <eggert@twinsun.com>
7564
7565 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7566 Reporting, Table of Symbols): Omit mentions of %lex-param and
7567 %parse-param from the documentation for now.
7568
7569 2002-12-15 Paul Eggert <eggert@twinsun.com>
7570
7571 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7572 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7573 lookahead symbol, and which sets yychar in parser actions) and it
7574 disagreed with the Bison documentation. Bug
7575 reported by Andrew Walrond.
7576
7577 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7578 as the caller now does that.
7579 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7580 (YYEMPTY): Parenthesize right hand side, since others use it.
7581 (yyparse): Don't assume that our generated code is the only code
7582 that sets yychar.
7583
7584 2002-12-13 Paul Eggert <eggert@twinsun.com>
7585
7586 Version 1.75d.
7587
7588 POSIX requires a "yacc" command.
7589 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7590 (MOSTLYCLEANFILES): Add yacc.
7591 (yacc): New rule.
7592 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
7593 as an alias for bison y.
7594
7595 * po/LINGUAS: Add da.
7596
7597 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
7598 problem with latest <getopt.h>.
7599 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
7600
7601 * doc/fdl.texi: Upgrade to 1.2.
7602 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
7603 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
7604 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
7605 gnulib.
7606 * config/install-sh: Sync with autotools.
7607
7608 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
7609 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
7610 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
7611 locations are requested.
7612 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
7613 locations are requested.
7614
7615 2002-12-12 Paul Eggert <eggert@twinsun.com>
7616
7617 Remove unportable casts and storage allocation tricks.
7618 While we're at it, remove almost all casts, since they
7619 usually aren't needed and are a sign of trouble.
7620
7621 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7622
7623 * src/derives.c (derives_compute): Do not subtract NTOKENS from
7624 the pointer DSET returned by malloc; this isn't portable.
7625 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
7626 Similarly for DERIVES.
7627 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
7628 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
7629 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
7630
7631 * src/derives.c (derives_compute): Do not bother invoking
7632 int_of_rule_number, since rule numbers are integers.
7633
7634 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7635 rather than XMALLOC (char, N).
7636
7637 * src/files.c (filename_split): Rewrite to avoid cast.
7638
7639 * src/gram.h (symbol_number_as_item_number,
7640 item_number_as_symbol_number, rule_number_as_item_number,
7641 item_number_as_rule_number):
7642 Now inline functions rather than macros, to avoid casts.
7643 * src/state.h (state_number_as_int): Likewise.
7644 * src/tables.c (state_number_to_vector_number,
7645 symbol_number_to_vector_number): Likewise.
7646
7647 * src/gram.h (int_of_rule_number): Remove; no longer used.
7648
7649 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7650 since the resulting storage is always stored into.
7651
7652 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7653 where it's needed.
7654
7655 * src/muscle_tab.c (muscle_m4_output):
7656 Now inline. Return bool, not int.
7657 * src/state.c (state_compare): Likewise.
7658 * src/symtab.c (symbol_check_defined,
7659 symbol_check_alias_consistency, symbol_pack, symbol_translation,
7660 hash_compare_symbol, hash_symbol):
7661 Likewise.
7662 * src/uniqstr.c (uniqstr_print): Likewise.
7663 * src/muscle_tab.c (muscle_m4_output_processor):
7664 New function, to avoid casts.
7665 * src/state.c (state_comparator, stage_hasher): Likewise.
7666 * src/symtab.c (symbol_check_defined_processor,
7667 symbol_check_alias_consistency_processor, symbol_pack_processor,
7668 symbol_translation_processor, hash_symbol_comparator,
7669 hash_symbol_hasher): Likewise.
7670 * src/uniqstr.c (uniqstr_print_processor): Likewise.
7671 * src/muscle_tab.c (muscles_m4_output):
7672 Use new functions instead of casting old functions unportably.
7673 * src/state.c (state_hash_new): Likewise.
7674 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
7675 symbols_token_translations_init):
7676 Likewise.
7677 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7678
7679 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
7680 var instead of casting to long, to avoid casts.
7681 (prepare_states): Use MALLOC rather than alloca, so that we don't
7682 have to worry about alloca.
7683 * src/state.c (state_hash_lookup): Likewise.
7684
7685 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7686 local var instead of casting to unsigned char, to avoid casts.
7687
7688 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
7689 STATE_ALLOC): Remove.
7690 (transitions_new, errs_new, reductions_new, state_new): Use malloc
7691 rather than calloc, and use offsetof to avoid allocating slightly
7692 too much storage.
7693 (state_new): Initialize all members.
7694
7695 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7696
7697 * src/symtab.c (symbol_free): Remove; unused.
7698 (symbol_get): Remove cast in lhs of assignment.
7699 (symbols_do): Now static. Accept generic arguments, not
7700 hashing-related ones.
7701
7702 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7703 (symbol_processor): Remove.
7704 (symbols_do): Remove decl; now static.
7705
7706 * src/system.h (alloca): Remove; decl no longer needed.
7707 (<stddef.h>): Include, for offsetof.
7708 (<inttypes.>, <stdint.h>): Include if available.
7709 (uintptr_t): New type, if system lacks it.
7710 (CALLOC, MALLOC, REALLOC): New macros.
7711 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7712 new macros.
7713
7714 * src/tables.c (table_size): Now int, to pacify GCC.
7715 (table_grow, table_ninf_remap): Use signed table size.
7716 (save_row): Don't bother initializing locals when not needed.
7717 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7718 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7719
7720 * src/vcg.h: Correct misspellings.
7721
7722 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7723
7724
7725 * src/getargs.c (getargs): Don't assume EOF == -1.
7726
7727 2002-12-09 Paul Eggert <eggert@twinsun.com>
7728
7729 Change identifier spellings to avoid collisions with names
7730 that are reserved by POSIX.
7731
7732 Don't use names ending in _t, since POSIX reserves them.
7733 For consistency, remove _e and _s endings -- they're weren't
7734 needed to remove ambiguity. All uses changed.
7735 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7736 turn was just renamed from struniq_t.
7737 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7738 which in turn was just renamed from struniq_processor_t.
7739 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7740 in turn was renamed from hash_compare_struniq_t.
7741 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7742 (state_list): Renamed from state_list_t.
7743 * src/assoc.h (assoc): Renamed from assoc_t.
7744 * src/conflicts.c (enum conflict_resolution): Renamed from
7745 enum conflict_resolution_e.
7746 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7747 (rule_list): Renamed from rule_list_t.
7748 * src/getargs.h (enum trace): Renamed from enum trace_e.
7749 (enum report): Renamed from enum report_e.
7750 * src/gram.h (item_number): Renamed from item_number_t.
7751 (rule_number): Renamed from rule_number_t.
7752 (struct rule_s): Remove the "rule_s" part; not used.
7753 (rule): Renamed from rule_t.
7754 (rule_filter): Renamed from rule_filter_t.
7755 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7756 (goto_list): Renamed from goto_list_t.
7757 * src/lalr.h (goto_number): Renamed from goto_number_t.
7758 * src/location.h (location): Renamed from location_t.
7759 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7760 and moved here from:
7761 * src/muscle_tab.h (muscle_entry_t): here.
7762 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7763 (rule_list): Renamed from rule_list_t.
7764 * src/print_graph.c (static_graph): Renamed from graph.
7765 * src/reader.h (braced_code): Renamed from braced_code_t.
7766 Remove brace_code_e tag.
7767 * src/relation.h (relation_node): Renamed from relation_node_t.
7768 (relation_nodes): Renamed from relation_nodes_t.
7769 (relation): Renamed from relation_t.
7770 * src/state.h (state_number): Renamed from state_number_t.
7771 (struct state): Renamed from struct state_s.
7772 (state): Renamed from state_t.
7773 (transitions): Renamed from transitions_t. Unused (and
7774 misspelled) transtion_s tag removed.
7775 (errs): Renamed from errs_t. Unused errs_s tag removed.
7776 (reductions): Renamed from reductions_t. Unused tag
7777 reductions_s removed.
7778 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7779 (struct symbol_list): Renamed from struct symbol_list_s.
7780 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7781 (struct symbol): Renamed from struct symbol_s.
7782 (symbol): Renamed from symbol_t.
7783 * src/tables.c (vector_number): Renamed from vector_number_t.
7784 (action_number): Renamed from action_t.
7785 * src/tables.h (base_number): Renamed from base_t.
7786 * src/vcg.h (enum color): Renamed from enum color_e.
7787 (enum textmode): Renamed from enum textmode_e.
7788 (enum shape): Renamed from enum shape_e.
7789 (struct colorentry): Renamed from struct colorentry_s.
7790 (struct classname): Renamed from struct classname_s.
7791 (struct infoname): Renamed from struct infoname_s.
7792 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7793 (enum decision): Renamed from enum decision_e.
7794 (enum orientation): Renamed from enum orientation_e.
7795 (enum alignment): Renamed from enum alignment_e.
7796 (enum arrow_mode): Renamed from enum arrow_mode_e.
7797 (enum crossing_type): Renamed from enum crossing_type_e.
7798 (enum view): Renamed from enum view_e.
7799 (struct node): Renamed from struct node_s.
7800 (node): Renamed from node_t.
7801 (enum linestyle): Renamed from enum linestyle_e.
7802 (enum arrowstyle): Renamed from enum arrowstyle_e.
7803 (struct edge): Renamed from struct edge.
7804 (edge): Renamed from edge_t.
7805 (struct graph): Renamed from struct graph_s.
7806 (graph): Renamed from graph_t.
7807 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7808 Rename value_t -> value.
7809 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7810 value_t_as_yystype -> value_as_yystype.
7811
7812 Don't include <errno.h> in the mainstream code, since it
7813 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7814 * lib/get-errno.c, lib/get-errno.h: New files.
7815 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7816 get-errno.c.
7817 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7818 * src/output.c (output_skeleton): Likewise.
7819 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7820 instead of errno.
7821 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7822 Likewise.
7823 (handle_action_dollar, handle_action_at): Likewise.
7824 * src/system.h: Do not include <errno.h>.
7825 (TAB_EXT): Renamed from EXT_TAB.
7826 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7827
7828 Avoid str[a-z]*, since <string.h> reserves that name space.
7829 Change all instances of "struniq" in names to "uniqstr", and
7830 likewise for "STRUNIQ" and "UNIQSTR".
7831 * src/uniqstr.c: Renamed from src/struniq.c.
7832 * src/uniqstr.h: Renamed from src/struniq.h.
7833 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7834 * src/files.c (strsuffix): Remove; unused.
7835 (concat2): Renamed from stringappend. Now static.
7836 * src/files.h (strsuffix, stringappend): Remove; unused.
7837 * src/parse-gram.y (<chars>): Renamed from <string>.
7838 (<uniqstr>): Renamed from <struniq>.
7839 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7840 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7841 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7842 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7843 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7844 (N_EXPAND): Renamed from N_STRETCH.
7845
7846 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7847 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7848 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7849 Remove; unused.
7850 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7851 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7852 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7853 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7854 (BASE_MAXIMUM): Renamed from BASE_MAX.
7855 (BASE_MINIMUM): Renamed from BASE_MIN.
7856 (ACTION_MAX): Remove; unused.
7857 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7858 Unnecessary casts removed from above defines.
7859
7860
7861 Fix misspelling in names.
7862 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7863 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7864 G_NODE_ALIGNEMENT.
7865
7866
7867 * lib/timevar.c (timevar_report): Renamed from time_report,
7868 for consistency with other names.
7869 * lib/timevar.h (timevar_report): New decl.
7870 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7871
7872
7873 Sort include-file uses.
7874
7875 Reorder all include files under src to be in the order "system.h".
7876 then the ../lib include files in angle brackets (alphabetized),
7877 then the . include files in double-quotes (alphabetized). Fix
7878 dependency breakages encountered in this process, as follows:
7879 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
7880 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
7881 * src/state.h: Include "symtab.h".
7882
7883 2002-12-08 Paul Eggert <eggert@twinsun.com>
7884
7885 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
7886 since this causes problems when __file__ contains character
7887 sequences like "@" that are treated specially by src/scan-skel.l.
7888 Instead, just use the file's basename. This fixes the bug
7889 reported by Martin Mokrejs in
7890 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
7891
7892 2002-12-06 Paul Eggert <eggert@twinsun.com>
7893
7894 Add support for rules that do not have trailing semicolons, as
7895 POSIX requires. Improve the quality of locations in Bison
7896 diagnostics.
7897
7898 * src/location.c: Include <quotearg.h>.
7899 (empty_location): Now const.
7900 (location_print): New function. Follow the recommendation of the
7901 GNU Coding Standards for locations that span file boundaries.
7902 * src/location.h: Do not include <quotearg.h>; no longer needed.
7903 (boundary): New type.
7904 (location_t): Use it. This allows locations to span file boundaries.
7905 All member uses changed: file -> start.file or end.file (as needed),
7906 first_line -> start.line, first_column -> start.column,
7907 last_line -> end.line, last_column -> end.column.
7908 (equal_boundaries): New function.
7909 (LOCATION_RESET, LOCATION_STEP): Remove.
7910 (LOCATION_PRINT): Remove. All callers changed to use location_print.
7911 (empty_location): Now const.
7912 (location_print): New decl.
7913 * src/parse-gram.y (lloc_default): New function, which handles
7914 empty locations more accurately.
7915 (YYLLOC_DEFAULT): Use it.
7916 (%token COLON): Remove.
7917 (%token ID_COLON): New token.
7918 (rules): Use it.
7919 (declarations, rules): Remove trailing semicolon.
7920 (declaration, rules_or_grammar_declaration):
7921 Allow empty (";") declaration.
7922 (symbol_def): Remove empty actions; no longer needed.
7923 (rules_or_grammar_declaration): Remove trailing semicolon.
7924 (semi_colon.opt): Remove.
7925 * src/reader.h: Include location.h.
7926 (scanner_cursor): New decl.
7927 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
7928 rolling our own.
7929 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7930 of *loc.
7931 (STEP): Remove. No longer needed, now that adjust_location does
7932 the work. All uses removed.
7933 (scanner_cursor): New var.
7934 (adjust_location): Renamed from extend_location. It now sets
7935 *loc and adjusts the scanner cursor. All uses changed.
7936 Don't bother testing for CR.
7937 (handle_syncline): Remove location arg; now updates scanner cursor.
7938 All callers changed.
7939 (unexpected_end_of_file): Now accepts start boundary of token or
7940 comment, not location. All callers changed. Update scanner cursor,
7941 not the location.
7942 (SC_AFTER_IDENTIFIER): New state.
7943 (context_state): Renamed from c_context. All uses changed.
7944 (id_loc, code_start, token_start): New local vars.
7945 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7946 processing of Yacc white space and equivalents here.
7947 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7948 instead of returning ID immediately, since we need to search for
7949 a subsequent colon.
7950 (<INITIAL>"'", "\""): Save token_start.
7951 (<INITIAL>"%{", "{", "%%"): Save code_start.
7952 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7953 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7954 BEGIN context_state at end, not INITIAL.
7955 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7956 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7957 Return correct token start.
7958 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7959 the start of a character, string or multiline comment is found.
7960 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7961 Reduction): Adjust reported locations to match the more-precise
7962 results now expected.
7963 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7964 * tests/reduce.at (Useless Rules, Reduced Automaton,
7965 Underivable Rules): Likewise.
7966 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7967 or "|"' now that so many other tokens are allowed by the new grammar.
7968
7969 * src/complain.h (current_file): Remove duplicate decl;
7970 current_file is now owned by files.h.
7971 * src/complain.c, src/scan-gram.l: Include files.h.
7972
7973 2002-12-06 Paul Eggert <eggert@twinsun.com>
7974
7975 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7976 promotes to int; it might be unsigned int.
7977 * data/yacc.c (yy_reduce_print): Likewise.
7978
7979 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7980 be #defined in the prologue, not in the Bison declarations.
7981 This fixes Debian Bug 102878, reported by Shaul Karl.
7982
7983 2002-12-02 Paul Eggert <eggert@twinsun.com>
7984
7985 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7986 * lib/strtoul.c: New file, from gnulib.
7987 This fixes a porting bug reported by Peter Klein in
7988 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
7989
7990 2002-11-30 Paul Eggert <eggert@twinsun.com>
7991
7992 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
7993 and put only a forward declaration in the prologue. This is for
7994 consistency with the other scanner helper functions.
7995
7996 Type clashes now generate warnings, not errors, since it
7997 appears that POSIX may allow some grammars with type clashes.
7998 * src/reader.c (grammar_current_rule_check): Warn about
7999 type clashes instead of complaining.
8000 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8001
8002 Add Yacc library, since POSIX requires it.
8003 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8004 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8005 * lib/main.c, lib/yyerror.c: New files.
8006
8007 gram_error can be static; it need not be extern.
8008 * src/reader.h (gram_error): Remove decl.
8009 * src/parse-gram.y (gram_error): Now static. Add static decl.
8010 (print_token_value): Omit parameter names from forward decl,
8011 for consistency.
8012
8013 2002-11-29 Paul Eggert <eggert@twinsun.com>
8014
8015 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8016 be declared before being used. E.g., one should typically
8017 declare them in the prologue. Use GNU coding style in examples.
8018 Put "const" consistently after the type it modifies. Mention
8019 that C99 supports "inline". Mention that yyerror traditionally
8020 returns "int".
8021
8022 %parse-param and %lex-param now take just one argument, the
8023 declaration; the argument name is deduced from the declaration.
8024
8025 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8026 Reporting, Table of Symbols): Document this.
8027 * src/parse-gram.y (add_param): New function.
8028 (COMMA): Remove.
8029 (declaration): Implement new rule for %parse-param and %lex-param.
8030 * src/scan-gram.l: "," now elicits a warning, rather than being
8031 a token; this is more compatible with byacc.
8032 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8033
8034 2002-11-27 Paul Eggert <eggert@twinsun.com>
8035
8036 Rename identifiers to avoid real and potential collisions.
8037
8038 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8039 to avoid collision with lex macro described by Bruce Lilly in
8040 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8041 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8042 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8043 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8044 All uses changed.
8045 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8046 The name "yycontrol" violates the name space rules, and this stuff
8047 wasn't being used anyway.
8048 (input): Remove action; this stuff wasn't being used.
8049 (gram_error): Rename local variable yylloc -> loc.
8050 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8051 (YY_DECL): Don't use "yy" at start of local variables.
8052 All uses changed, e.g., yylloc -> loc.
8053 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8054 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8055 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8056 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8057
8058 * src/parse-gram.y (gram_error): loc is now const *.
8059 * src/reader.h (gram_error): Likewise.
8060
8061 2002-11-24 Paul Eggert <eggert@twinsun.com>
8062
8063 Version 1.75c.
8064
8065 * tests/actions.at (Actions after errors): Use an output format
8066 more similar to that of the Printers and Destructors test.
8067 Test the position of the ';' token too.
8068 (Printers and Destructors): Likewise.
8069 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8070 unnecessarily alarming people when the test fails.
8071
8072 * data/yacc.c (yyerrlab1): Move this label down, so that the
8073 parser does not discard the lookahead token if the user code
8074 invokes YYERROR. This change is required for POSIX conformance.
8075
8076 * lib/error.c: Sync with gnulib.
8077
8078 2002-11-22 Paul Eggert <eggert@twinsun.com>
8079
8080 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8081 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8082 * lib/xmalloc.c: Likewise.
8083
8084 2002-11-20 Paul Eggert <eggert@twinsun.com>
8085
8086 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8087
8088 2002-11-20 Paul Eggert <eggert@twinsun.com>
8089
8090 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8091 should use `if (! x) abort ();' rather than `assert (x);', and
8092 anyway it's one less thing to worry about configuring.
8093
8094 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8095 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8096 and replace all instances of assert with abort.
8097 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8098 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8099
8100 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8101 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8102 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8103 hash_find_entry, hash_rehash, hash_insert): Likewise.
8104 * src/conflicts.c (resolve_sr_conflict): Likewise.
8105 * src/lalr.c (set_goto_map, map_goto): Likewise.
8106 * src/nullable.c (nullable_compute): Likewise.
8107 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8108 * src/reader.c (packgram, reader): Likewise.
8109 * src/state.c (state_new, state_free, state_transitions_set,
8110 state_reduction_find): Likewise.
8111 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8112 symbol_pack): Likewise.
8113 * src/tables.c (conflict_row, pack_vector): Likewise.
8114 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8115 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8116 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8117 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8118
8119 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8120 (ARGMATCH_CONSTRAINT): New macro.
8121 (ARGMATCH_ASSERT): Use it.
8122
8123 * src/system.h (verify): New macro.
8124 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8125 rather than assert.
8126 * src/tables.c (tables_generate): Likewise.
8127
8128 * src/struniq.c (struniq_assert): Now returns void, and aborts
8129 if the assertion is false.
8130 (struniq_assert_p): Remove.
8131 * src/struniq.h: Likewise.
8132
8133 2002-11-18 Paul Eggert <eggert@twinsun.com>
8134
8135 * data/glr.c (yygetLRActions): Replace `yyindex' with
8136 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8137 This fixes the regression with Sun ONE Studio 7 cc that I reported in
8138 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
8139
8140 2002-11-18 Akim Demaille <akim@epita.fr>
8141
8142 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8143 space.
8144 From Tim Van Holder.
8145
8146 2002-11-17 Paul Eggert <eggert@twinsun.com>
8147
8148 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8149 to "SyntaxError" for consistency with my 2002-11-15 change.
8150
8151 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8152 not define to {}, since this breaks the common use of `YYDPRINTF
8153 ((...));' if a single statement is desired (e.g. before `else').
8154 Work around GCC warnings by surrounding corresponding calls with
8155 {} if needed.
8156 (yyhasResolvedValue): Remove unused function.
8157 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8158 loop body.
8159 (yyreportSyntaxError): Renamed from yyreportParseError.
8160 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8161 All uses changed.
8162 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8163 extern when possible. Remove unused initializations.
8164
8165 2002-11-16 Akim Demaille <akim@epita.fr>
8166
8167 Augment the similarity between GLR and LALR traces.
8168
8169 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8170 (YY_REDUCE_PRINT): New.
8171 (yyparse): Use them.
8172 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8173 YYDPRINT here.
8174 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8175 state reached after the reduction/recovery, since...
8176 (yyparse, yyprocessOneStack): Report the state we are entering in.
8177
8178 2002-11-16 Akim Demaille <akim@epita.fr>
8179
8180 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8181 Add support for --trace=skeleton.
8182 * src/scan-skel.l: %option debug.
8183 Scan strings of non-@ or \n instead of character by character.
8184 (scan_skel): Handle trace_skeleton.
8185 (QPUTS): New.
8186 (@output_parser_name@, @output_header_name@): ``Restore'' their
8187 support (used to be M4 macros).
8188 * data/yacc.c: Quote larger chunks, a la glr.c.
8189 * data/lalr1.cc: Likewise.
8190 The header guards are no longer available, so use some other
8191 string than `YYLSP_NEEDED'.
8192
8193 2002-11-16 Akim Demaille <akim@epita.fr>
8194
8195 Make the ``Printers and Destructors'' test more verbose, taking
8196 `yacc.c''s behavior as (possibly wrong) reference.
8197
8198 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8199 instead of fprint on stdout.
8200 Set and report the last_line of the symbols.
8201 Consistently display values and locations.
8202
8203 2002-11-16 Paul Eggert <eggert@twinsun.com>
8204
8205 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8206
8207 2002-11-15 Paul Eggert <eggert@twinsun.com>
8208
8209 * tests/actions.at (Actions after errors): New test case.
8210
8211 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8212 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8213 tests/action.at, tests/calc.at, tests/conflicts.at,
8214 tests/cxx-type.at, tests/regression.at:
8215 "parse error" -> "syntax error" for POSIX compatibility.
8216 "parsing stack overflow..." -> "parser stack overflow" so
8217 that code matches Bison documentation.
8218
8219 2002-11-15 Akim Demaille <akim@epita.fr>
8220
8221 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8222 take two BRACED_CODE, not two string_content.
8223 Free the scanner's obstack when we are done.
8224 (code_content): New.
8225 * tests/calc.at: Adjust.
8226 * doc/bison.texinfo: Adjust.
8227 Also, make sure to include the `,' for these declarations.
8228
8229 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8230
8231 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8232 definition; avoids potential autoreconf problems.
8233
8234 2002-11-15 Akim Demaille <akim@epita.fr>
8235
8236 Always check the value returned by yyparse.
8237
8238 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8239 returned by yyparse.
8240 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8241 Adjust calls.
8242 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8243 returned by yyparse.
8244
8245 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8246
8247 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8248 on input.at test.
8249
8250 2002-11-14 Paul Eggert <eggert@twinsun.com>
8251
8252 * src/output.c (output_skeleton): Call xfopen instead of
8253 duplicating xfopen's body.
8254
8255 Fix bugs reported by Nelson H. F. Beebe in
8256 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
8257
8258 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8259 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8260 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8261 file twice in the grammar, as an extra check.
8262
8263 * tests/input.at (Torturing the Scanner): Surround the
8264 backslash-newline tests with "#if 0", to make it less likely that
8265 we'll run into compiler bugs. Bring back solitary \ inside
8266 comment, but add a closing comment to work around HP C bug. Don't
8267 test backslash-newline in C character constant.
8268
8269 2002-11-14 Akim Demaille <akim@epita.fr>
8270
8271 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8272 status of the compiler.
8273 Calling `exit 1' is no longer needed.
8274 Reported by Nelson H. F. Beebe.
8275
8276 2002-11-14 Akim Demaille <akim@epita.fr>
8277
8278 * tests/atlocal.in (CPPFLAGS): We have config.h.
8279 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8280 New.
8281 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8282 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8283 * tests/regression.at, tests/torture.at: Use them for all the
8284 grammars that are to be compiled.
8285 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8286 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8287 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8288
8289 2002-11-14 Akim Demaille <akim@epita.fr>
8290
8291 * doc/bison.texinfo: Various formatting changes (alignments in
8292 samples, additional @group/@end group, GCS in samples.
8293 Use @deffn instead of simple @table to define the directives,
8294 macros, variables etc.
8295
8296 2002-11-13 Paul Eggert <eggert@twinsun.com>
8297
8298 Fix some bugs reported by Albert Chin-A-Young in
8299 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
8300
8301 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8302 -o c"; the HP C compiler chatters during compilation.
8303 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8304 * tests/headers.at (export YYLTYPE): Likewise.
8305
8306 * tests/input.at (Torturing the Scanner): Remove lines containing
8307 solitary backslashes, as they tickle a bug in the HP C compiler.
8308
8309 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8310 comments, since they're not portable. Use GNU coding style.
8311
8312 2002-11-13 Akim Demaille <akim@epita.fr>
8313
8314 * data/yacc.c: Leave bigger chunks of quoted text.
8315 (YYDSYMPRINTF): New.
8316 Use it to report symbol activities.
8317 * data/glr.c (YYDSYMPRINTF): New.
8318 Use it.
8319
8320 2002-11-12 Paul Eggert <eggert@twinsun.com>
8321
8322 Version 1.75b.
8323
8324 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8325 (yyglrReduce): Return yyok, not 0.
8326 This should avoid the enumerated-type warnings reported
8327 by Nelson H. F. Beebe in
8328 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
8329
8330 * lib/bbitset.h (BITSET_INLINE): Remove.
8331 * lib/bitset.h [! BITSET_INLINE]: Remove.
8332 (bitset_set, bitset_reset, bitset_test): Rename local vars
8333 to avoid shadowing warnings by GCC.
8334
8335 * data/glr.c (inline): Remove #define. It's the user's
8336 responsibility to #define it away, just like 'const'.
8337 This fixes one of the bugs reported by Nelson H. F. Beebe in
8338 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
8339
8340 * Makefile.maint (po-check): Scan .l and .y files instead of the
8341 .c and the .h files that they generate. This fixes the bug
8342 reported by Tim Van Holder in:
8343 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
8344 Look for N_ as well as for _. Try to avoid matching #define for
8345 N_ and _.
8346 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8347 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8348 * src/scan-gram.l: Revamp regular expressions so that " and '
8349 do not confuse xgettext.
8350
8351 * src/struniq.h (struniq_new): Do not declare the return type
8352 to be 'const'; this violates the C standard.
8353 * src/struniq.c (struniq_new): Likewise.
8354
8355 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8356
8357 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8358 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8359 linker.
8360
8361 2002-11-12 Akim Demaille <akim@epita.fr>
8362
8363 * Makefile.maint: Sync with Autoconf:
8364 (local_updates): New.
8365
8366 2002-11-12 Akim Demaille <akim@epita.fr>
8367
8368 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8369
8370 2002-11-12 Akim Demaille <akim@epita.fr>
8371
8372 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8373 locations.
8374
8375 2002-11-12 Akim Demaille <akim@epita.fr>
8376
8377 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8378 not yyvalue.
8379
8380 2002-11-12 Akim Demaille <akim@epita.fr>
8381
8382 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8383 Use it to test the GLR parser.
8384
8385 2002-11-12 Akim Demaille <akim@epita.fr>
8386
8387 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8388 defines it.
8389 * data/glr.c (yystos): New.
8390 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8391 (YYDSYMPRINT): New.
8392 (yyval): Don't define it, it is handled via M4.
8393 (yyrecoverParseError): Free verbosely the discarded symbols.
8394 * data/yacc.c (yysymprint): Remove, rather...
8395 (b4_yysymprint_generate): invoke.
8396 * data/c.m4 (b4_yysymprint_generate): New.
8397 Accept pointers as arguments, as opposed to the version from
8398 yacc.c.
8399 (b4_yydestruct_generate): Likewise.
8400 * tests/cations.at (Printers and Destructors): Use Bison directives
8401 instead of CPP macros.
8402 Don't rely on internal details.
8403
8404 2002-11-12 Akim Demaille <akim@epita.fr>
8405
8406 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8407 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8408 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8409 it against YYEMPTY and so forth), work on yytoken (i.e., set
8410 it to YYEMPTY etc.).
8411 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8412 (b4_symbol_actions): Remove.
8413 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8414 for 0, end-of-input.
8415
8416 2002-11-12 Akim Demaille <akim@epita.fr>
8417
8418 * doc/bison.texinfo (Destructor Decl): New.
8419
8420 2002-11-12 Akim Demaille <akim@epita.fr>
8421
8422 * src/tables.c (tables_generate): Use free for pointers that
8423 cannot be NULL, not XFREE.
8424 (pack_vector): Use assert, not fatal, for bound violations.
8425 * src/state.c (state_new): Likewise.
8426 * src/reader.c (reader): Likewise.
8427 * src/lalr.c (set_goto_map): Likewise.
8428 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
8429 the file name.
8430
8431 2002-11-12 Akim Demaille <akim@epita.fr>
8432
8433 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8434 Restore.
8435 * src/scan-gram.l (last_string): Is global to the file, not to
8436 yylex.
8437 * src/parse-gram.y (input): Don't append the epilogue here,
8438 (epilogue.opt): do it here, and free the scanner's obstack.
8439 * src/reader.c (epilogue_set): Rename as...
8440 (epilogue_augment): this.
8441 * data/c.m4 (b4_epilogue): Defaults to empty.
8442
8443 2002-11-12 Akim Demaille <akim@epita.fr>
8444
8445 * src/getargs.c (long_options): Remove duplicates.
8446 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8447 Remove.
8448 * doc/bison.rnh: Remove.
8449 * doc/bison.texinfo (VMS Invocation): Remove.
8450
8451 2002-11-12 Akim Demaille <akim@epita.fr>
8452
8453 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8454 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8455
8456 Use struniq for symbols.
8457
8458 * src/symtab.h (symbol_t): The tag member is a struniq.
8459 (symbol_type_set): Adjust.
8460 * src/symtab.c (symbol_new): Takes a struniq.
8461 (symbol_free): Don't free the tag member.
8462 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8463 (hash_compare_symbol, hash_symbol): these.
8464 Use the fact that tags as struniqs.
8465 (symbol_get): Use struniq_new.
8466 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8467 Returns a strniq.
8468 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8469 and type members are struniqs.
8470 * src/reader.c (get_merge_function)
8471 (grammar_current_rule_merge_set): Adjust.
8472 (TYPE, current_type): Are struniq.
8473
8474 Use struniq for file names.
8475
8476 * src/files.h, src/files.c (infile): Split into...
8477 (grammar_file, current_file): these.
8478 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8479 * src/reduce.c (reduce_print): Likewise.
8480 * src/getargs.c (getargs): Likewise.
8481 * src/complain.h, src/complain.c: Likewise.
8482 * src/main.c (main): Call struniqs_new early enough to use it for
8483 file names.
8484 Don't free the input file name.
8485
8486 2002-11-12 Akim Demaille <akim@epita.fr>
8487
8488 * src/symtab.c (symbol_free): Remove dead deactivated code:
8489 type_name are properly removed.
8490 Don't use XFREE to free items that cannot be NULL.
8491 * src/struniq.h, src/struniq.c: New.
8492 * src/main.c (main): Initialize/free struniqs.
8493 * src/parse-gram.y (%union): Add astruniq member.
8494 (yyprint): Adjust.
8495 * src/scan-gram.l (<{tag}>): Return a struniq.
8496 Free the obstack bit that used to store it.
8497 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8498
8499 2002-11-11 Paul Eggert <eggert@twinsun.com>
8500
8501 Revamp to fix many (but not all) of the C- and M4-related quoting
8502 problems. Among other things, this fixes the Bison bug reported
8503 by Jan Hubicka when processing the Bash grammar; see:
8504 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
8505
8506 Use new @ escapes consistently. Represent brackets with @{ and @}
8507 rather than @<:@ and @:>@, since this works a bit better with dumb
8508 editors like vi. Represent @ with @@, since @ is now consistently
8509 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8510 __ofile__, to avoid unexpected expansions. Similarly, use @output
8511 rather than #output.
8512
8513 * data/c.m4 (b4_copyright): Omit file name from comment, since
8514 the file name could contain "*/".
8515 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8516 be quoted. All uses changed.
8517
8518 * data/glr.c: Use new @ escapes consistently.
8519 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8520 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8521 Remove, since they couldn't handle arbitrary characters in file
8522 names.
8523 * data/lalr1.cc: Likewise.
8524 * data/yacc.c: Likewise.
8525
8526 * src/files.c (output_infix): Remove; all uses removed.
8527 * src/files.h: Likewise.
8528
8529 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8530 mishandled funny characters in file names, and anyway it isn't
8531 needed any more.
8532 * data/yacc.c: Likewise.
8533 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8534
8535 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8536 * data/yacc.c: Likewise.
8537
8538 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8539 strings now.
8540 (muscle_init): Quote filename as a C string.
8541 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8542 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8543 * src/output.c (escaped_file_name_output): New function.
8544 (prepare_symbols): Quote tokens for M4.
8545 (prepare): Don't insert output_infix, output_prefix,
8546 output_parser_name, output_header_name; this is now down by scan-skel.
8547 Insert skeleton as a C string.
8548
8549 * src/output.c (user_actions_output, symbol_destructors_output,
8550 symbol_printers_output): Quote filenames for C and M4.
8551 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8552
8553 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8554 escapes other than \\ and \'; this simplifies the code.
8555 (<SC_STRING>): Likewise, for \\ and \".
8556 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8557 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8558 Use new escapes @{ and @} for [ and ].
8559
8560 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8561 them with auto vars.
8562 Switch to new escape scheme, where @ is the escape character uniformly.
8563 Abort if a stray escape character is found. Avoid unbounded input
8564 buffer when parsing non-escaped text.
8565
8566 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8567 __oline__, #output, $@, and @{ do not have unintended meanings.
8568
8569 2002-11-09 Paul Eggert <eggert@twinsun.com>
8570
8571 Fix the test failure due to GCC warnings described in
8572 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
8573 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8574 evaluate to 0 if it's impossible for NINF to be in the respective
8575 table.
8576 (yygetLRActions, yyrecoverParseError): Use them.
8577
8578 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8579 counted in the token inserted at end of file. Now takes
8580 location_t *, not location_t, so that the location can be
8581 adjusted. All uses changed.
8582
8583 * tests/regression.at (Invalid inputs): Adjust wording in
8584 diagnostic to match the new behavior.
8585
8586 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
8587 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
8588 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
8589 abort ();'. This reduces the runtime of the "Many lookaheads"
8590 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
8591 GCC 3.2.
8592
8593 2002-11-07 Paul Eggert <eggert@twinsun.com>
8594
8595 * src/parse-gram.y (CHARACTER): Remove unused token.
8596 All uses removed.
8597
8598 * src/scan-gram.l: Remove stack option. We no longer use the
8599 stack, since the stack was never deeper than 1; instead, use the
8600 new auto var c_context to record the stacked value.
8601
8602 Remove nounput option. At an unexpected end of file, we now unput
8603 the minimal input necessary to end cleanly; this simplifies the
8604 code.
8605
8606 Avoid unbounded token sizes where this is easy.
8607
8608 (unexpected_end_of_file): New function.
8609 Use it to systematize the error message on unexpected EOF.
8610 (last-string): Now auto, not static.
8611 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
8612 (scanner_last_string_free): Remove; not used.
8613 (percent_percent_count): Move decl to just before use.
8614 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
8615 not the (never otherwised-used) CHARACTER.
8616
8617 2002-11-07 Akim Demaille <akim@epita.fr>
8618
8619 Let yyerror always receive the msg as last argument, so that
8620 yyerror can be variadic.
8621
8622 * data/yacc.c (b4_yyerror_args): New.
8623 Use it when calling yyerror.
8624 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
8625 Use it when calling yyerror.
8626 * doc/bison.texinfo (Error Reporting): Adjust.
8627 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
8628 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
8629
8630 2002-11-06 Akim Demaille <akim@epita.fr>
8631
8632 #line should have quoted strings.
8633 Ideally, this should be done by m4_quotearg.
8634
8635 * src/scan-skel.l: Include quotearg.h.
8636 Quote __ofile__.
8637 * src/output.c (symbol_printers_output)
8638 (symbol_destructors_output): Quote the file name.
8639
8640 2002-11-06 Akim Demaille <akim@epita.fr>
8641
8642 * tests/regression.at (Invalid inputs): Adjust to the recent
8643 messages.
8644
8645 2002-11-06 Akim Demaille <akim@epita.fr>
8646
8647 Restore --no-lines.
8648 Reported by Jim Kent.
8649
8650 * data/c.m4 (b4_syncline): New.
8651 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
8652 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
8653 * src/output.c (user_actions_output): Likewise.
8654 (prepare): Define 'b4_synclines_flag'.
8655 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
8656
8657 2002-11-06 Akim Demaille <akim@epita.fr>
8658
8659 * src/main.c (main): Free `infile'.
8660 * src/scan-gram.l (handle_syncline): New.
8661 Recognize `#line'.
8662 * src/output.c (user_actions_output, symbol_destructors_output)
8663 (symbol_printers_output): Use the location's file name, not
8664 infile.
8665 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8666
8667 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8668
8669 * src/tables.c (matching_state): Don't allow states to match if
8670 either has GLR conflict entries.
8671
8672 2002-11-05 Paul Eggert <eggert@twinsun.com>
8673
8674 * src/scan-gram.l: Use more accurate diagnostics, e.g.
8675 "integer out of range" rather than "invalid value".
8676 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
8677 accordingly.
8678
8679 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8680 Also, remove one static variable in the scanner.
8681
8682 * src/scan-gram.l (braces_level): Now auto, not static.
8683 Initialize to zero if the compiler is being picky.
8684 (INITIAL): Clear braces_level instead of incrementing it.
8685 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
8686 as POSIX 1003.1-2001 requires.
8687 * src/system.h (IF_LINT): New macro, taken from coreutils.
8688 * configure.ac: Define "lint" if --enable-gcc-warnings.
8689
8690 2002-11-05 Akim Demaille <akim@epita.fr>
8691
8692 * src/scan-gram.l: When it starts with `%', complain about the
8693 whole directive, not just that `invalid character: %'.
8694
8695 2002-11-04 Akim Demaille <akim@epita.fr>
8696
8697 * Makefile.maint: Update from Autoconf.
8698 (update, cvs-update, po-update, do-po-update): New.
8699
8700 2002-11-04 Akim Demaille <akim@epita.fr>
8701
8702 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8703 and yyerror.
8704 Have yyerror `use' its arguments.
8705 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8706 returns true when location & yacc & pure & parse-param.
8707 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8708
8709 2002-11-04 Akim Demaille <akim@epita.fr>
8710
8711 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8712 clashes.
8713 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8714 font-lock-mode.
8715 Use complain_at.
8716 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8717 slot 0.
8718
8719 2002-11-03 Paul Eggert <eggert@twinsun.com>
8720
8721 * src/reader.c (get_merge_function, grammar_current_rule_check):
8722 Use consistent diagnostics for reporting type name clashes.
8723 Quote the types with <>, for consistency with Yacc.
8724 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8725
8726 2002-11-03 Akim Demaille <akim@epita.fr>
8727
8728 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8729 New.
8730 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8731 (b4_parse_param): Remove.
8732 Use b4_identification.
8733 Propagate b4_pure_args where needed to pass them to yyerror.
8734 * data/glr.m4 (b4_parse_param): Remove.
8735 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8736 (b4_lpure_formals): New.
8737 Use b4_identification.
8738 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8739 b4_user_formals and b4_user_args.
8740 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8741 (yyreportAmbiguity): When using a pure parser, also need
8742 the location, and the parse-params.
8743 Adjust callers.
8744 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8745 When using a pure parser, also need the parse-params.
8746 Adjust callers.
8747 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8748 (%pure-parser + %parse-param) LALR and GLR parsers.
8749 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8750 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8751 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8752 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8753 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8754 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8755 * doc/bison.texinfo: Untabify the whole file.
8756 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8757 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8758 (Error Reporting): Adjust to these new directives.
8759 Document %error-verbose, deprecate YYERROR_VERBOSE.
8760
8761 2002-11-03 Akim Demaille <akim@epita.fr>
8762
8763 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8764 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8765 command line options.
8766 * tests/cxx-type.at: Formatting changes.
8767
8768 2002-11-03 Paul Eggert <eggert@twinsun.com>
8769
8770 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8771 to count columns correctly, and to check for invalid inputs.
8772
8773 Use mbsnwidth to count columns correctly. Account for tabs, too.
8774 Include mbswidth.h.
8775 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8776 (extend_location): New function.
8777 (YY_LINES): Remove.
8778
8779 Handle CRLF in C code rather than in Lex code.
8780 (YY_INPUT): New macro.
8781 (no_cr_read): New function.
8782
8783 Scan UCNs, even though we don't fully handle them yet.
8784 (convert_ucn_to_byte): New function.
8785
8786 Handle backslash-newline correctly in C code.
8787 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8788 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8789 all uses changed.
8790 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8791 Use {splice} wherever C allows backslash-newline.
8792 YY_STEP after space, newline, vertical-tab.
8793 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
8794
8795 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8796
8797 ({int}, handle_action_dollar, handle_action_at): Check for integer
8798 overflow.
8799
8800 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8801
8802 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8803 as well as \000. Check for UCHAR_MAX, not 255.
8804 Allow \x with an arbitrary positive number of digits, as in C.
8805 Check for overflow here.
8806 Allow \? and UCNs, for compatibility with C.
8807
8808 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8809 with quote slot used by complain_at.
8810
8811 * tests/input.at: Add tests for backslash-newline, m4 quotes
8812 in symbols, long literals, and funny escapes in strings.
8813
8814 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8815 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8816 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8817 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8818 * m4/mbswidth.m4: New file, from GNU coreutils.
8819
8820 * doc/bison.texinfo (Grammar Outline): Document // comments.
8821 (Symbols): Document that trigraphs have no special meaning in Bison,
8822 nor is backslash-newline allowed.
8823 (Actions): Document that trigraphs have no special meaning.
8824
8825 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8826 no longer used.
8827
8828 2002-11-02 Paul Eggert <eggert@twinsun.com>
8829
8830 * src/reader.c: Don't include quote.h; not needed.
8831 (get_merge_function): Reword warning to be consistent with
8832 type clash diagnostic in grammar_current_rule_check.
8833
8834 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8835 bug in trigraph handling.
8836
8837 * src/output.c (prepare_symbols): When printing token names,
8838 escape "[" as "@<:@" and likewise for "]".
8839
8840 * src/system.h (errno): Remove declaration, as we are now
8841 assuming C89 or better, and C89 guarantees errno.
8842
8843 2002-10-30 Paul Eggert <eggert@twinsun.com>
8844
8845 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8846 Check for close failures.
8847 * src/files.h (xfclose): Return void, not int, since it always
8848 returned zero.
8849 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8850 indicates one.
8851 * src/output.c (output_skeleton): Use xfclose rather than fclose
8852 and ferror. xfclose now checks ferror.
8853
8854 * data/glr.c (YYLEFTMOST_STATE): Remove.
8855 (yyreportTree): Use a stack-based leftmost state. This avoids
8856 our continuing battles with bogus warnings about initializers.
8857
8858 2002-10-30 Akim Demaille <akim@epita.fr>
8859
8860 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8861 #if.
8862
8863 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8864
8865 * tests/glr-regr1.at: New test for reported regressions.
8866 * tests/testsuite.at: Add glr-regr1.at test.
8867 * tests/Makefile.am: Add glr-regr1.at test.
8868
8869 2002-10-24 Paul Eggert <eggert@twinsun.com>
8870
8871 Version 1.75a.
8872
8873 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
8874 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
8875 we use malloc. Don't assume 'A' through 'Z' are contiguous.
8876 Don't assume strdup exists; POSIX says its an XSI extension.
8877 Check for buffer overflow on input.
8878
8879 2002-10-24 Akim Demaille <akim@epita.fr>
8880
8881 * src/output.c (output_skeleton): Don't disable M4sugar comments
8882 too soon: it results in comments being expanded.
8883 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
8884 first output.
8885
8886 2002-10-24 Akim Demaille <akim@epita.fr>
8887
8888 * data/yacc.c (m4_int_type): New.
8889 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
8890 char' as only yacc.c wants K&R portability.
8891 * data/glr.c (yysigned_char): Remove.
8892 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8893 Reported by Quoc Peyrot.
8894
8895 2002-10-23 Paul Eggert <eggert@twinsun.com>
8896
8897 * src/main.c (main): With --trace=time, report times even if a
8898 non-fatal error occurs. Formerly, the times were reported in some
8899 such cases but not in others.
8900 * src/reader.c (reader): Just return if a complaint has been issued,
8901 instead of exiting, so that 'main' can report times.
8902
8903 2002-10-22 Akim Demaille <akim@epita.fr>
8904
8905 * src/system.h: Include sys/types.
8906 Reported by Bert Deknuydt.
8907
8908 2002-10-23 Paul Eggert <eggert@twinsun.com>
8909
8910 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8911 Suggested by Art Haas.
8912
8913 2002-10-22 Paul Eggert <eggert@twinsun.com>
8914
8915 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
8916 decl; not needed any more.
8917 * src/main.c (main): Use return to exit, undoing yesterday's change.
8918 The last OS that we could find where this wouldn't work is
8919 SunOS 3.5, and that's too old to worry about now.
8920
8921 * data/glr.c (struct yyltype): Define members even when not
8922 doing locations. This is more consistent with yacc.c, and it
8923 works around the following bug reports:
8924 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
8925 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
8926
8927 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
8928 @acronym consistently. Standardize on "Yacc" instead of "YACC",
8929 "Algol" instead of "ALGOL". Give a bit more history about BNF.
8930
8931 2002-10-22 Akim Demaille <akim@epita.fr>
8932
8933 * data/README: New.
8934
8935 2002-10-21 Paul Eggert <eggert@twinsun.com>
8936
8937 Be consistent about 'bool'; the old code used an enum in one
8938 module and an int in another, and this violates the C standard.
8939 * m4/stdbool.m4: New file, from coreutils 4.5.3.
8940 * configure.ac (AC_HEADER_STDBOOL): Add.
8941 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
8942 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
8943 * src/symtab.c (hash_compare_symbol_t): Likewise.
8944 * src/system.h (bool, false, true): Use a definition consistent
8945 with ../lib/hash.c. All uses changed.
8946
8947 * src/complain.c (warning_issued): Renamed from warn_message_count,
8948 so that we needn't worry about integer overflow (!).
8949 Now of type bool. All uses changed.
8950 (complaint_issued): Renamed from complain_message_count; likewise.
8951
8952 * src/main.c (main): Use exit to exit with failure.
8953
8954 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8955 rather than 1 and 0.
8956 * src/main.c (main): Likewise.
8957 * src/getargs.c (getargs): Likewise.
8958 * src/reader.c (reader): Likewise.
8959
8960 * src/getarg.c (getargs): Remove duplicate code for
8961 "Try `bison --help'".
8962
8963 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8964 What was that "2" for?
8965
8966 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8967 * src/getargs.c (usage): Likewise.
8968
8969 * src/getargs.c (getargs): When there are too few operands, report
8970 the last one. When there are too many, report the first extra
8971 one. This is how diffutils does it.
8972
8973 2002-10-20 Paul Eggert <eggert@twinsun.com>
8974
8975 Remove K&R vestiges.
8976 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8977 * src/complain.c (VA_START): Remove. Assume prototypes.
8978 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8979 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8980 fatal): Assume prototypes.
8981 * src/complain.h: Assume prototypes.
8982 * src/system.h (PARAMS): Remove.
8983 Include <limits.h> unconditionally, since it's guaranteeed even
8984 for a freestanding C89 compiler.
8985 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8986 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8987
8988 2002-10-20 Akim Demaille <akim@epita.fr>
8989
8990 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
8991 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
8992 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
8993 (yyresolveStates, yyresolveAction, yyresolveStack)
8994 (yyprocessOneStack): Use them.
8995 (yy_reduce_print): New.
8996 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
8997
8998 2002-10-20 Akim Demaille <akim@epita.fr>
8999
9000 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9001 arguments and output `void'.
9002 (b4_c_function): Rename as...
9003 (b4_c_function_def): this.
9004 (b4_c_function_decl, b4_c_ansi_function_def)
9005 (b4_c_ansi_function_decl): New.
9006 Change the interpretation of the arguments: before `int, foo', now
9007 `int foo, foo'.
9008 * data/yacc.c (yyparse): Prototype and define thanks to these.
9009 Adjust b4_c_function_def uses.
9010 * data/glr.c (yyparse): Likewise, but ANSI only.
9011
9012 2002-10-20 Akim Demaille <akim@epita.fr>
9013
9014 * src/output.c (prepare): Move the definition of `tokens_number',
9015 `nterms_number', `undef_token_number', `user_token_number_max'
9016 to...
9017 (prepare_tokens): Here.
9018 (prepare_tokens): Rename as...
9019 (prepare_symbols): this.
9020 (prepare): Move the definition of `rules_number' to...
9021 (prepare_rules): here.
9022 (prepare): Move the definition of `last', `final_state_number',
9023 `states_number' to...
9024 (prepare_states): here.
9025 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9026
9027 2002-10-20 Akim Demaille <akim@epita.fr>
9028
9029 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9030
9031 2002-10-20 Akim Demaille <akim@epita.fr>
9032
9033 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9034 * data/c.m4: here.
9035
9036 2002-10-20 Akim Demaille <akim@epita.fr>
9037
9038 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9039 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9040 `pair'.
9041 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9042 `name' to...
9043 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9044 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9045 These.
9046
9047 2002-10-19 Paul Eggert <eggert@twinsun.com>
9048
9049 Do not create a temporary file, as that involves security and
9050 cleanup headaches. Instead, use a pair of pipes.
9051 Derived from a suggestion by Florian Krohm.
9052 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9053 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9054 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9055 (BISON_PREREQ_SUBPIPE): Add.
9056 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9057 Add subpipe.h, subpipe.c.
9058 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9059 * po/POTFILES.in: Add lib/subpipe.c.
9060 * src/output.c: Include "subpipe.h".
9061 (m4_invoke): Remove decl.
9062 (scan_skel): New decl.
9063 (output_skeleton): Use pipe rather than temporary file for m4 input.
9064 Check that m4sugar.m4 is readable, to avoid deadlock.
9065 Check for pipe I/O error.
9066 * src/scan-skel.l (readpipe): Remove decl.
9067 (scan_skel): New function, to be used in place of m4_invoke.
9068 Read from stream rather than file.
9069
9070 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9071 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9072 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9073 this generates a more-accurate value anyway.
9074
9075 * lib/timevar.c (timervar_accumulate): Rename locals to
9076 avoid confusion with similarly-named more-global.
9077 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9078
9079 * src/output.c (prepare): Use xstrdup to convert char const *
9080 to char *, to avoid GCC warning.
9081
9082 2002-10-19 Akim Demaille <akim@epita.fr>
9083
9084 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9085 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9086 Use them to have `calc.y' ready for %pure-parser.
9087 * data/yacc.c (YYLEX): Pass a yylex return type to
9088 b4_c_function_call.
9089
9090 2002-10-19 Akim Demaille <akim@epita.fr>
9091
9092 Prototype support of %lex-param and %parse-param.
9093
9094 * src/parse-gram.y: Add the definition of the %lex-param and
9095 %parse-param tokens, plus their rules.
9096 Drop the `_' version of %glr-parser.
9097 Add the "," token.
9098 * src/scan-gram.l (INITIAL): Scan them.
9099 * src/muscle_tab.c: Comment changes.
9100 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9101 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9102 (muscle_entry_s): The `value' member is no longer const.
9103 Adjust all dependencies.
9104 * src/muscle_tab.c (muscle_init): Adjust: use
9105 MUSCLE_INSERT_STRING.
9106 Initialize the obstack earlier.
9107 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9108 (muscle_pair_list_grow): New.
9109 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9110 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9111 * tests/calc.at: Use %locations, not --locations.
9112 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9113
9114 2002-10-19 Akim Demaille <akim@epita.fr>
9115
9116 * src/getargs.c (usage): Take status as argument and exit
9117 accordingly.
9118 Report the traditional `Try ... --help' message when status != 0.
9119 (usage, version): Don't take a FILE * as arg, it is pointless.
9120 (getargs): When there is an incorrect number of arguments, make it
9121 an error, and report it GNUlically thanks to `usage ()'.
9122
9123 2002-10-18 Paul Eggert <eggert@twinsun.com>
9124
9125 * data/glr.c (yyreportParseError): Don't assume that sprintf
9126 yields the length of the printed string, as this is not true
9127 on SunOS 4.1.4. Reported by Peter Klein.
9128
9129 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9130 * tests/conflicts.at (%nonassoc and eof): Likewise.
9131 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9132
9133 2002-10-17 Akim Demaille <akim@epita.fr>
9134
9135 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9136 * src/getargs.c (trace_types, trace_args): Adjust.
9137 * src/reader.c (grammar_current_rule_prec_set)
9138 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9139 Standardize error messages.
9140 And s/@prec/%prec/!
9141 (reader): Use trace_flag to enable scanner/parser debugging,
9142 instead of an adhoc scheme.
9143 * src/scan-gram.l: Remove trailing debugging code.
9144
9145 2002-10-16 Paul Eggert <eggert@twinsun.com>
9146
9147 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9148 MUSCLE_TAB_H.
9149
9150 * NEWS: Officially drop support for building Bison with K&R C,
9151 since it didn't work anyway and it's not worth worrying about.
9152 * Makefile.maint (wget_files): Remove ansi2knr.c.
9153 (ansi2knr.c-url_prefix): Remove.
9154 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9155 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9156 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9157
9158 2002-10-15 Paul Eggert <eggert@twinsun.com>
9159
9160 Stop using the "enum_" trick for K&R-style function definitions;
9161 it confused me, and I was the author! Instead, assume that people
9162 who want to use K&R C compilers (when using these modules in GCC,
9163 perhaps?) will run ansi2knr.
9164
9165 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9166 All uses of "enum_" changed to "enum ".
9167 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9168 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9169
9170 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9171 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9172 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9173 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9174 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9175 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9176 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9177 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9178 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9179 Use function prototypes; this removes the need for declaring
9180 static functions simply to provide their prototypes.
9181 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9182 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9183 bitset_count_, bitset_create, bitset_dump, bitset_first,
9184 bitset_free, bitset_init, bitset_last, bitset_next,
9185 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9186 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9187 bitset_print, bitset_release_memory, bitset_toggle_,
9188 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9189 debug_bitset): Likewise.
9190 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9191 * lib/bitset_stats.c (bitset_log_histogram_print,
9192 bitset_percent_histogram_print, bitset_stats_and,
9193 bitset_stats_and_cmp, bitset_stats_and_or,
9194 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9195 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9196 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9197 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9198 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9199 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9200 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9201 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9202 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9203 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9204 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9205 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9206 bitset_stats_zero): Likewise.
9207 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9208 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9209 bitsetv_dump, debug_bitsetv): Likewise.
9210 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9211 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9212 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9213 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9214 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9215 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9216 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9217 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9218 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9219 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9220 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9221 Likewise.
9222 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9223 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9224 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9225 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9226 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9227 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9228 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9229 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9230 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9231 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9232 lbitset_xor_cmp, lbitset_zero): Likewise.
9233
9234 2002-10-14 Akim Demaille <akim@epita.fr>
9235
9236 Version 1.75.
9237
9238 2002-10-14 Akim Demaille <akim@epita.fr>
9239
9240 * tests/Makefile.am (maintainer-check-posix): New.
9241
9242 2002-10-14 Akim Demaille <akim@epita.fr>
9243
9244 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9245 member.
9246
9247 2002-10-14 Akim Demaille <akim@epita.fr>
9248
9249 * src/tables.c (table_ninf_remap): base -> tab.
9250 Reported by Matt Rosing.
9251
9252 2002-10-14 Paul Eggert <eggert@twinsun.com>
9253
9254 * tests/action.at, tests/calc.at, tests/conflicts.at,
9255 tests/cxx-type.at, tests/headers.at, tests/input.at,
9256 tests/regression.at, tests/synclines.at, tests/torture.at:
9257 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9258 so that the tests still work even if POSIXLY_CORRECT is set.
9259 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
9260
9261 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9262 for portability to K&R hosts. Fix typo: signed char is guaranteed
9263 only to 127, not to 128.
9264 * data/glr.c (yysigned_char): New type.
9265 * data/yacc.c (yysigned_char): Likewise.
9266 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9267
9268 2002-10-13 Paul Eggert <eggert@twinsun.com>
9269
9270 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9271 true due to limited range of data type" warning from GCC.
9272
9273 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9274 by wrapping enum yytokentype's definition inside #ifndef
9275 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9276
9277 2002-10-13 Akim Demaille <akim@epita.fr>
9278
9279 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9280 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9281
9282 2002-10-13 Akim Demaille <akim@epita.fr>
9283
9284 * Makefile.maint: Update from Autoconf 2.54.
9285 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9286
9287 2002-10-13 Akim Demaille <akim@epita.fr>
9288
9289 * src/print.c (print_state): Separate the list of solved conflicts
9290 from the other items.
9291 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9292
9293 2002-10-13 Akim Demaille <akim@epita.fr>
9294
9295 Let nondeterministic skeletons be usable with deterministic
9296 tables.
9297
9298 With the patch, GAWK compiled by GCC without -O2 passes its test
9299 suite using a GLR parser driven by LALR tables. It fails with -O2
9300 because `struct stat' gives two different answers on my machine:
9301 88 (definition of an auto var) and later 96 (memset on this var).
9302 Hence the stack is badly corrumpted. The headers inclusion is to
9303 blame: if I move the awk.h inclusion before GLR's system header
9304 inclusion, the two struct stat have the same size.
9305
9306 * src/tables.c (pack_table): Always create conflict_table.
9307 (token_actions): Always create conflict_list.
9308 * data/glr.c (YYFLAG): Remove, unused.
9309
9310 2002-10-13 Akim Demaille <akim@epita.fr>
9311
9312 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9313 (O0FLAGS): New.
9314 (VALGRIND, GXX): New.
9315 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9316 * tests/bison.in: Run $PREBISON a pre-command.
9317 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9318 (maintainer-check-g++): New.
9319 * Makefile.am (maintainer-check): New.
9320
9321 2002-10-13 Akim Demaille <akim@epita.fr>
9322
9323 * data/glr.c: Formatting changes.
9324 Tweak some trace messages to match yacc.c's.
9325
9326 2002-10-13 Akim Demaille <akim@epita.fr>
9327
9328 GLR parsers sometimes raise parse errors instead of performing the
9329 default reduction.
9330 Reported by Charles-Henry de Boysson.
9331
9332 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
9333 check the length of the traces when %glr.
9334 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9335 GLR's traces.
9336 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9337 Test GLR parsers.
9338 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9339 (yyltype): Remove the yy prefix from the member names.
9340 (yytable): Complete its comment.
9341 (yygetLRActions): Map error action number from YYTABLE from
9342 YYTABLE_NINF to 0.
9343 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9344 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9345 not satisfying as we could compare an YYACTION computed from
9346 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9347 only value for error actions.
9348 (yyreportParseError): In verbose parse error messages, don't issue
9349 `error' in the list of expected tokens.
9350 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9351 next action to perform to match glr.c's decoding.
9352 (yytable): Complete its comment.
9353
9354 2002-10-13 Paul Eggert <eggert@twinsun.com>
9355
9356 Fix problem reported by Henrik Grubbstroem in
9357 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
9358 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9359 because the Bison parser reads the second action before reducing
9360 the first one.
9361 * src/scan-gram.l (rule_length): New static var.
9362 Use it to keep track of the rule length in the scanner, since
9363 we can't expect the parser to be in lock-step sync with the scanner.
9364 (handle_action_dollar, handle_action_at): Use this var.
9365 * tests/actions.at (Exotic Dollars): Test for the problem.
9366
9367 2002-10-12 Paul Eggert <eggert@twinsun.com>
9368
9369 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9370 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9371 Include <sys/time.h> when checking for clock_t and struct tms.
9372 Use same include order as source.
9373 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
9374 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
9375
9376 * lib/timevar.c: Update copyright date and clarify comments.
9377 (get_time) [IN_GCC]: Keep the GCC version for reference.
9378
9379 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9380 GCC version as of today, then merge Bison's changes.
9381 Change "GCC" to "Bison" in copyright notice. timevar.def's
9382 author is Akim, so change that too.
9383
9384 * src/reader.c (grammar_current_rule_check):
9385 Don't worry about the default action if $$ is untyped.
9386 Prevents bogus warnings reported by Jim Gifford in
9387 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
9388
9389 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9390 * data/glr.c, data/lalr1.cc, data/yacc.c:
9391 Output token definitions before the first part of user declarations.
9392 Fixes compatibility problem reported by Jim Gifford for kbd in
9393 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
9394
9395 2002-10-11 Paul Eggert <eggert@twinsun.com>
9396
9397 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9398 (yyparse): here. This undoes some of the 2002-07-25 change.
9399 Compatibility problem reported by Ralf S. Engelschall with
9400 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9401
9402 2002-10-11 Akim Demaille <akim@epita.fr>
9403
9404 * tests/regression.at Characters Escapes): New.
9405 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9406 characters.
9407 Reported by Jan Nieuwenhuizen.
9408
9409 2002-10-11 Akim Demaille <akim@epita.fr>
9410
9411 * po/id.po: New.
9412
9413 2002-10-10 Paul Eggert <eggert@twinsun.com>
9414
9415 Portability fixes for bitsets; this also avoids several GCC
9416 warnings.
9417
9418 * lib/abitset.c: Include <stddef.h>, for offsetof.
9419 * lib/lbitset.c: Likewise.
9420
9421 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9422 properly for vectors of objects. Do not assume that adding a
9423 header size to a multiple of a word size yields a value that is
9424 properly aligned for the whole union.
9425 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9426
9427 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9428 unique names for structures.
9429 * lib/ebitset.c (ebitset_bytes): Likewise.
9430 * lib/lbitset.c (lbitset_bytes): Likewise.
9431
9432 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9433 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9434 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9435 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9436 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9437 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9438 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9439 to improve the type-checking that GCC can do.
9440 * lib/bitset.c (bitset_op4_cmp): Likewise.
9441 * lib/bitset_stats.c (bitset_stats_count,
9442 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9443 bitset_stats_copy, bitset_stats_disjoint_p,
9444 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9445 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9446 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9447 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9448 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9449 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9450 bitset_stats_or_and_cmp): Likewise.
9451 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9452 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9453 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9454 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9455
9456 * lib/abitset.h: Include bitset.h, not bbitset.h.
9457 * lib/ebitset.h: Likewise.
9458 * lib/lbitset.h: Likewise.
9459
9460 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9461 All instances of parameters of type enum bitset_opts are now of
9462 type enum_bitset_opts, to conform to the C Standard, and similarly
9463 for enum_bitset_type.
9464 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9465 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9466
9467 Do not use "struct bitset_struct" to mean different things in
9468 different modules. Not only is this confusing, it violates
9469 the C Standard, which requires that structure types in different
9470 modules must be compatible if one is to be passed to the other.
9471 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9472 All instances of "struct bitset_struct *" replaced with "bitset".
9473 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9474 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9475 struct lbitset_struct, struct bitset_stats_struct): New types.
9476 All uses of struct bitset_struct changed to union bitset_union,
9477 etc.
9478 * lib/abitset.c (struct abitset_struct, abitset,
9479 struct bitset_struct): Remove.
9480 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9481 struct bitset_struct): Remove.
9482 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9483 bitset_struct): Remove.
9484 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9485 Likewise.
9486
9487 Do not call a function of type T using a call that assumes the
9488 function is of a different type U. Standard C requires that a
9489 function must be called with a type that is compatible with its
9490 definition.
9491 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9492 New decls.
9493 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9494 New functions.
9495 * lib/ebitset.c (PFV): Remove.
9496 * lib/lbitset.c (PFV): Likewise.
9497 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9498 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9499 decls.
9500 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9501 (ebitset_vtable): Use them.
9502 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9503 lbitset_xor): New functions.
9504 (lbitset_vtable): Use them.
9505
9506 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9507 Declare.
9508
9509 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9510 GCC warning.
9511 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9512 Use offsetof, for simplicity.
9513
9514 2002-10-06 Paul Eggert <eggert@twinsun.com>
9515
9516 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9517 the same width as int. This reapplies a hunk of the 2002-08-12 patch
9518 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
9519 which was inadvertently undone by the 2002-09-30 patch.
9520 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9521 the same width as int.
9522
9523 2002-10-04 Paul Eggert <eggert@twinsun.com>
9524
9525 Version 1.50.
9526
9527 * configure.ac (AC_INIT), NEWS: Increment version number.
9528
9529 * doc/bison.texinfo: Minor spelling, grammar, and white space
9530 fixes.
9531 (Symbols): Mention that any negative value returned from yylex
9532 signifies end-of-input. Warn about negative chars. Mention
9533 the portable Standard C character set.
9534
9535 The GNU coding standard says CFLAGS and YFLAGS are reserved
9536 for the installer to set.
9537 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9538 * src/Makefile.am (AM_CFLAGS): Likewise.
9539 (AM_YFLAGS): Renamed from YFLAGS.
9540
9541 Fix some MAX and MIN problems.
9542 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9543 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9544 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9545 * src/reader.c (reader): Use it.
9546
9547 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9548 POSIX 1003.1-2001 has removed fgrep.
9549
9550 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9551
9552 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9553 interpreted as signed.
9554 * lib/ebitset.c (ebitset_list): Fix bug.
9555
9556 2002-10-01 Paul Eggert <eggert@twinsun.com>
9557
9558 More fixes for 64-bit hosts and large bitsets.
9559
9560 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9561 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9562 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9563 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9564 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9565 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9566 bitset_count_): Likewise.
9567 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9568 bitset_first, bitset_last): Likewise.
9569 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9570 bitset_stats_list_reverse, bitset_stats_size,
9571 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9572 Likewise.
9573 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9574 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9575 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9576 bitsetv_reflexive_transitive_closure): Likewise.
9577 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9578 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9579 Likewise.
9580 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9581 Likewise.
9582
9583 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
9584 Use size_t, not unsigned int, to count bytes.
9585 * lib/abitset.h (abitset_bytes): Likewise.
9586 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
9587 Likewise.
9588 * lib/bitset.h (bitset_bytes): Likewise.
9589 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
9590 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
9591 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9592 * lib/ebitset.c (ebitset_bytes): Likewise.
9593 * lib/ebitset.h (ebitset_bytes): Likewise.
9594 * lib/lbitset.c (lbitset_bytes): Likewise.
9595 * lib/lbitset.h (lbitset_bytes): Likewise.
9596
9597 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
9598 abitset_subset_p, abitset_disjoint_p, abitset_and,
9599 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
9600 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
9601 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
9602 abitset_or_and, abitset_or_and_cmp):
9603 Use bitset_windex instead of unsigned int.
9604 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9605 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
9606 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
9607 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
9608 Likewise.
9609 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
9610
9611 * lib/bitset.c (bitset_print):
9612 Use proper printf formats for widths of integer types.
9613 * lib/bitset_stats.c (bitset_percent_histogram_print,
9614 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
9615 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9616 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9617 * lib/lbitset.c (lbitset_bytes): Likewise.
9618
9619 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
9620 BITSET_SIZE_MAX): New macros.
9621 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
9622 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
9623 to BITSET_WINDEX_MAX.
9624
9625 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
9626 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
9627 since we now return the bitset_bindex type (not int).
9628
9629 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9630 when computing sizes.
9631 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9632
9633 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9634 and avoid cast to unsigned.
9635
9636 2002-09-30 Akim Demaille <akim@epita.fr>
9637
9638 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9639 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
9640 Updates from Michael Hayes.
9641
9642 2002-09-30 Art Haas <ahaas@neosoft.com>
9643
9644 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9645 invocations.
9646 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9647 defined.
9648
9649 2002-09-27 Akim Demaille <akim@epita.fr>
9650
9651 Version 1.49c.
9652
9653 2002-09-27 Akim Demaille <akim@epita.fr>
9654
9655 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9656 (Because of AC_LIBSOURCE).
9657
9658 2002-09-27 Akim Demaille <akim@epita.fr>
9659
9660 Playing with Autoscan.
9661
9662 * configure.ac: Remove the old LIBOBJ tweaks.
9663 (AC_REPLACE_FUNCS): Add strrchr and strtol.
9664 * lib/strrchr.c: New.
9665 * lib/strtol.c: New, from the Coreutils 4.5.1.
9666
9667 2002-09-27 Akim Demaille <akim@epita.fr>
9668
9669 Playing with Autoscan.
9670
9671 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
9672 * lib/Makefile.am (libbison_a_SOURCES): No longer include
9673 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
9674 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
9675 Coreutils 4.5.1.
9676
9677 2002-09-24 Akim Demaille <akim@epita.fr>
9678
9679 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9680 (Frequently Asked Questions, Parser Stack Overflow): New.
9681
9682 2002-09-13 Akim Demaille <akim@epita.fr>
9683
9684 Playing with autoscan.
9685
9686 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
9687 * src/files.c (skeleton_find): Remove, unused.
9688 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
9689 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
9690
9691 2002-09-13 Akim Demaille <akim@epita.fr>
9692
9693 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9694 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9695
9696 2002-09-13 Akim Demaille <akim@epita.fr>
9697
9698 * configure.ac: Require 2.54.
9699 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
9700 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
9701 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
9702 Remove, provided by Autoconf macros.
9703
9704 2002-09-12 Akim Demaille <akim@epita.fr>
9705
9706 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9707
9708 2002-09-12 Akim Demaille <akim@epita.fr>
9709
9710 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9711 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9712 Reported by Martin Mokrejs.
9713
9714 2002-09-10 Akim Demaille <akim@epita.fr>
9715
9716 * src/parse-gram.y: Associate a human readable string to each
9717 token type.
9718 * tests/regression.at (Invalid inputs): Adjust.
9719
9720 2002-09-10 Gary V. Vaughan <gary@gnu.org>
9721
9722 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9723 with an Autoconf-2.5x style configure.ac.
9724
9725 2002-09-06 Paul Eggert <eggert@twinsun.com>
9726
9727 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9728 exception applies only to yacc.c. This is a modification of a
9729 patch originally suggested by Akim Demaille.
9730
9731 2002-09-06 Akim Demaille <akim@epita.fr>
9732
9733 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9734 here to...
9735 * data/yacc.c: here.
9736
9737 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9738 LocationType.
9739 (b4_ltype): Default to yy::Location from location.hh.
9740
9741 2002-09-04 Jim Meyering <jim@meyering.net>
9742
9743 * data/yacc.c: Guard the declaration of yytoknum also with
9744 `#ifdef YYPRINT', so it is declared only when used.
9745
9746 2002-09-04 Akim Demaille <akim@epita.fr>
9747
9748 * configure.in: Rename as...
9749 * configure.ac: this.
9750 Bump to 1.49c.
9751
9752 2002-09-04 Akim Demaille <akim@epita.fr>
9753
9754 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9755 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9756 translate maintainer only messages.
9757
9758 2002-08-12 Paul Eggert <eggert@twinsun.com>
9759
9760 Version 1.49b.
9761
9762 * Makefile.am (SUBDIRS): Remove intl.
9763 (DISTCLEANFILES): Remove.
9764 * NEWS: Mention that GNU M4 is now required. Clarify what is
9765 meant by "larger grammars". Mention the pt_BR translation.
9766 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9767 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9768 Bump version from 0.11.2 to 0.11.5.
9769 (BISON_PREREQ_STAGE): Remove.
9770 (AM_GNU_GETTEXT): Use external gettext.
9771 (AC_OUTPUT): Remove intl/Makefile.
9772
9773 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9774
9775 * data/glr.c: Include string.h, for strlen.
9776 (yyreportParseError): Use size_t for yysize.
9777 (yy_yypstack): No longer nested inside yypstates, as nested
9778 functions are not portable. Do not assume size_t is the
9779 same width as int.
9780 (yypstates): Do not assume that ptrdiff_t is the same width
9781 as int, and similarly for yyposn and YYINDEX.
9782
9783 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9784
9785 * lib/Makefile.am (INCLUDES): Do not include from the intl
9786 directory, which has been removed.
9787 * src/Makefile.am (INCLUDES): Likewise.
9788
9789 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9790 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9791 New vars.
9792
9793 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9794 * tests/Makefile.am (EXTRA_DIST): Likewise.
9795
9796 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9797 Do not assume that bitset_windex is the same width as unsigned.
9798
9799 * lib/abitset.c (abitset_unused_clear): Do not assume that
9800 bitset_word is the same width as int.
9801 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9802 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9803 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9804 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9805 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9806
9807 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9808 portability to one's complement hosts!).
9809 * lib/ebitset.c (ebitset_op1): Likewise.
9810 * lib/lbitset.c (lbitset_op1): Likewise.
9811
9812 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9813 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9814 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9815 Sync with fileutils.
9816 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9817 lib/gettext.h: Sync with diffutils.
9818
9819 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9820 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9821
9822 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9823 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9824 check for void *.
9825
9826 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9827 size_t; the old version tried to do this but casted improperly.
9828 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9829 (bitset_test): Now returns int, not unsigned long.
9830
9831 * lib/bitset_stats.c: Include "gettext.h".
9832 (_): New macro.
9833 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9834 name locals "index", as it generates unnecessary warnings on some
9835 hosts that have an "index" function.
9836
9837 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9838 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9839 they need translation.
9840 * src/LR0.c (state_list_append, new_itemsets, get_state,
9841 append_states, generate_states): Likewise.
9842 * src/assoc.c (assoc_to_string): Likewise.
9843 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9844 * src/gram.c (grammar_dump): Likewise.
9845 * src/injections.c (injections_compute): Likewise.
9846 * src/lalr.c (lookaheads_print): Likewise.
9847 * src/relation.c (relation_transpose): Likewise.
9848 * src/scan-gram.l: Likewise.
9849 * src/tables.c (table_grow, pack_vector): Likewise.
9850
9851 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9852 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9853 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9854 * m4/mbstate_t.m4: Sync with fileutils.
9855 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9856
9857 * po/LINGUAS: Add pt_BR.
9858 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9859 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9860 lib/timevar.c.
9861 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9862 manual recommends.
9863 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9864
9865 * src/complain.c (strerror_r): Remove decl; not needed.
9866 (strerror): Use same pattern as ../lib/error.c.
9867
9868 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9869
9870 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9871
9872 * src/main.c (main): Cast result of bindtextdomain and textdomain
9873 to void, to avoid a GCC warning when --disable-nls is in effect.
9874
9875 * src/scan-gram.l: Use strings rather than escapes when possible,
9876 to minimize the number of warnings from xgettext.
9877 (handle_action_dollar, handle_action_at): Don't use isdigit,
9878 as it mishandles negative chars and it may not work as expected
9879 outside the C locale.
9880
9881 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
9882 this is a GCC extension and is not portable to other compilers.
9883
9884 * src/system.h (alloca): Use same pattern as ../lib/error.c.
9885 Do not include <ctype.h>; no longer needed.
9886 Do not include <malloc.h>; no longer needed (and generates
9887 warnings on OpenBSD 3.0).
9888
9889 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9890 it's not portable.
9891
9892 * tests/regression.at: Do not use 'cc -c input.c -o input';
9893 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
9894
9895 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
9896 exit status as failure, not just exit status 1. Sun C exits
9897 with status 2 sometimes.
9898
9899 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9900 Use it for the two large tests.
9901
9902 2002-08-02 Akim Demaille <akim@epita.fr>
9903
9904 * src/conflicts.c (conflicts_output): Don't output rules never
9905 reduced here, since anyway that computation doesn't work.
9906 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
9907 (rule_useless_p, rule_never_reduced_p): New.
9908 (grammar_rules_partial_print): Use a filter instead of a range.
9909 Display the title only if needed.
9910 (grammar_rules_print): Adjust.
9911 (grammar_rules_never_reduced_report): New.
9912 * src/tables.c (action_row): Move the computation of rules never
9913 reduced to...
9914 (token_actions): here.
9915 * src/main.c (main): Make the parser before making the report, so
9916 that rules never reduced are computed.
9917 Call grammar_rules_never_reduced_report.
9918 * src/print.c (print_results): Report rules never reduced.
9919 * tests/conflicts.at, tests/reduce.at: Adjust.
9920
9921 2002-08-01 Akim Demaille <akim@epita.fr>
9922
9923 Instead of attaching lookaheads and duplicating the rules being
9924 reduced by a state, attach the lookaheads to the reductions.
9925
9926 * src/state.h (state_t): Remove the `lookaheads',
9927 `lookaheads_rule' member.
9928 (reductions_t): Add a `lookaheads' member.
9929 Use a regular array for the `rules'.
9930 * src/state.c (reductions_new): Initialize the lookaheads member
9931 to 0.
9932 (state_rule_lookaheads_print): Adjust.
9933 * src/state.h, src/state.c (state_reductions_find): New.
9934 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
9935 (count_rr_conflicts): Adjust.
9936 * src/lalr.c (LArule): Remove.
9937 (add_lookback_edge): Adjust.
9938 (state_lookaheads_count): New.
9939 (states_lookaheads_initialize): Merge into...
9940 (initialize_LA): this.
9941 (lalr_free): Adjust.
9942 * src/main.c (main): Don't free nullable and derives too early: it
9943 is used by --verbose.
9944 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
9945
9946 2002-08-01 Akim Demaille <akim@epita.fr>
9947
9948 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9949 `rule_number_t**'.
9950 (set_derives, free_derives): Rename as...
9951 (derives_compute, derives_free): this.
9952 Adjust all dependencies.
9953 * src/nullable.c (set_nullable, free_nullable): Rename as...
9954 (nullable_compute, nullable_free): these.
9955 (rule_list_t): Store rule_t *, not rule_number_t.
9956 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9957 pointers, instead of their numbers.
9958 * src/main.c (main): Call nullable_free, and derives_free earlier,
9959 as they were lo longer used.
9960
9961 2002-08-01 Akim Demaille <akim@epita.fr>
9962
9963 * lib/timevar.c (get_time): Include children time.
9964 * src/lalr.h (LA, LArule): Don't export them: used with the
9965 state_t.
9966 * src/lalr.c (LA, LArule): Static.
9967 * src/lalr.h, src/lalr.c (lalr_free): New.
9968 * src/main.c (main): Call it.
9969 * src/tables.c (pack_vector): Check whether loc is >= to the
9970 table_size, not >.
9971 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9972 (tables_generate): do it, since that's also it which allocates
9973 them.
9974 Don't free LA and LArule, main does.
9975
9976 2002-07-31 Akim Demaille <akim@epita.fr>
9977
9978 Separate parser tables computation and output.
9979
9980 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9981 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9982 (yydefgoto, yydefact, high): Move to...
9983 * src/tables.h, src/tables.c: here.
9984 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9985 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9986 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9987 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
9988 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
9989 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
9990 (action_row, save_row, token_actions, save_column, default_goto)
9991 (goto_actions, sort_actions, matching_state, pack_vector)
9992 (table_ninf_remap, pack_table, prepare_actions): Move to...
9993 * src/tables.c: here.
9994 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
9995 * src/output.c (token_actions, output_base, output_conflicts)
9996 (output_check): Merge into...
9997 (prepare_actions): this.
9998 (actions_output): Rename as...
9999 (user_actions_output): this.
10000 * src/main.c (main): Call tables_generate and tables_free.
10001
10002 2002-07-31 Akim Demaille <akim@epita.fr>
10003
10004 Steal GCC's --time-report support.
10005
10006 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10007 stolen/adjusted from GCC.
10008 * m4/stage.m4: Remove time related checks.
10009 * m4/timevar.m4: New.
10010 * configure.in: Adjust.
10011 * src/system.h: Adjust to using timevar.h.
10012 * src/getargs.h, src/getargs.c: Support trace_time for
10013 --trace=time.
10014 * src/main.c (stage): Remove.
10015 (main): Replace `stage' invocations with timevar calls.
10016 * src/output.c: Insert pertinent timevar calls.
10017
10018 2002-07-31 Akim Demaille <akim@epita.fr>
10019
10020 Let --trace have arguments.
10021
10022 * src/getargs.h (enum trace_e): New.
10023 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10024 (long_options, short_options): --trace/-T takes an optional
10025 argument.
10026 Change all the uses of trace_flag to reflect the new flags.
10027 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10028
10029 Strengthen `stage' portability.
10030
10031 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10032 * configure.in: Use it.
10033 Don't check for malloc.h and sys/times.h.
10034 * src/system.h: Include them when appropriate.
10035 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10036 times and struct tms are available.
10037
10038 2002-07-30 Akim Demaille <akim@epita.fr>
10039
10040 In verbose parse error message, don't report `error' as an
10041 expected token.
10042 * tests/actions.at (Printers and Destructors): Adjust.
10043 * tests/calc.at (Calculator $1): Adjust.
10044 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10045 error message, do not report the parser accepts the error token in
10046 that state.
10047
10048 2002-07-30 Akim Demaille <akim@epita.fr>
10049
10050 Normalize conflict related messages.
10051
10052 * src/complain.h, src/complain.c (warn, complain): New.
10053 * src/conflicts.c (conflicts_print): Use them.
10054 (conflict_report_yacc): New, extracted from...
10055 (conflicts_print): here.
10056 * tests/conflicts.at, tests/existing.at: Adjust.
10057
10058 2002-07-30 Akim Demaille <akim@epita.fr>
10059
10060 Report rules which are never reduced by the parser: those hidden
10061 by conflicts.
10062
10063 * src/LR0.c (save_reductions): Don't make the final state too
10064 different: save its reduction (accept) instead of having a state
10065 without any action (no shift or goto, no reduce).
10066 Note: the final state is now a ``regular'' state, i.e., the
10067 parsers now contain `reduce 0' as default reduction.
10068 Nevertheless, since they decide to `accept' when yystate =
10069 final_state, they still will not reduce rule 0.
10070 * src/print.c (print_actions, print_reduction): Adjust.
10071 * src/output.c (action_row): Track reduced rules.
10072 (token_actions): Report rules never reduced.
10073 * tests/conflicts.at, tests/regression.at: Adjust.
10074
10075 2002-07-30 Akim Demaille <akim@epita.fr>
10076
10077 `stage' was accidently included in a previous patch.
10078 Initiate its autoconfiscation.
10079
10080 * configure.in: Look for malloc.h and sys/times.h.
10081 * src/main.c (stage): Adjust.
10082 Report only when trace_flag.
10083
10084 2002-07-29 Akim Demaille <akim@epita.fr>
10085
10086 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10087 state_number_t.
10088 (errs_t): symbol_t*, not symbol_number_t.
10089 (reductions_t): rule_t*, not rule_number_t.
10090 (FOR_EACH_SHIFT): New.
10091 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10092 * src/print.c, src/print_graph.c: Adjust.
10093
10094 2002-07-29 Akim Demaille <akim@epita.fr>
10095
10096 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10097
10098 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10099 (endtoken, accept): these.
10100 * src/reader.c (reader): Set endtoken's default tag to "$end".
10101 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10102 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10103 Adjust.
10104
10105 2002-07-29 Akim Demaille <akim@epita.fr>
10106
10107 * src/reduce.c (reduce_grammar): When the language is empty,
10108 complain about the start symbol, not the axiom.
10109 Use its location.
10110 * tests/reduce.at (Empty Language): New.
10111
10112 2002-07-26 Akim Demaille <akim@epita.fr>
10113
10114 * src/reader.h, src/reader.c (gram_error): ... can't get
10115 yycontrol without making too strong assumptions on the parser
10116 itself.
10117 * src/output.c (prepare_tokens): Use the real 0th value of
10118 token_translations instead of `0'.
10119 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10120 visible here.
10121 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10122 for the time being: %locations ought to provide it to yyerror.
10123
10124 2002-07-25 Akim Demaille <akim@epita.fr>
10125
10126 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10127 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10128 * tests/regression.at (Web2c Actions): Adjust.
10129
10130 2002-07-25 Akim Demaille <akim@epita.fr>
10131
10132 Stop storing rules from 1 to nrules + 1.
10133
10134 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10135 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10136 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10137 Iterate from 0 to nrules.
10138 Use rule_number_as_item_number and item_number_as_rule_number.
10139 Adjust to `derive' now containing possibly 0.
10140 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10141 Handle the `- 1' part in rule numbers from/to item numbers.
10142 * src/conflicts.c (log_resolution): Fix the message which reversed
10143 shift and reduce.
10144 * src/output.c (action_row): Initialize default_rule to -1.
10145 (token_actions): Adjust.
10146 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10147 expected output.
10148 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10149
10150 2002-07-25 Akim Demaille <akim@epita.fr>
10151
10152 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10153 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10154 (b4_c_knr_arg_decl): New.
10155 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10156 yyreport_parse_error.
10157
10158 2002-07-25 Akim Demaille <akim@epita.fr>
10159
10160 * data/yacc.c (yyreport_parse_error): New, extracted from...
10161 (yyparse): here.
10162 (yydestruct, yysymprint): Move above yyparse.
10163 Be K&R compliant.
10164
10165 2002-07-25 Akim Demaille <akim@epita.fr>
10166
10167 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10168 replace...
10169 (b4_sint_type, b4_uint_type): these.
10170 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10171 * tests/regression.at (Web2c Actions): Adjust.
10172
10173 2002-07-25 Akim Demaille <akim@epita.fr>
10174
10175 * src/gram.h (TIEM_NUMBER_MAX): New.
10176 (item_number_of_rule_number, rule_number_of_item_number): Rename
10177 as...
10178 (rule_number_as_item_number, item_number_as_rule_number): these.
10179 Adjust dependencies.
10180 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10181 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10182 (symbol_number_to_vector_number): New.
10183 (order): Of vector_number_t* type.
10184 (base_t, BASE_MAX, BASE_MIN): New.
10185 (froms, tos, width, pos, check): Of base_t type.
10186 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10187 (actrow): Of action_number_t type.
10188 (conflrow): Of unsigned int type.
10189 (table_ninf, base_ninf): New.
10190 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10191 (muscle_insert_int_table, muscle_insert_base_table)
10192 (muscle_insert_rule_number_table): New.
10193 (prepare_tokens): Output `toknum' as int_table.
10194 (action_row): Returns a rule_number_t.
10195 Use ACTION_MIN, not SHRT_MIN.
10196 (token_actions): yydefact is rule_number_t*.
10197 (table_ninf_remap): New.
10198 (pack_table): Use it for `base' and `table'.
10199 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10200 replaced with...
10201 (YYPACT_NINF, YYTABLE_NINF): these.
10202 (yypact, yytable): Compute their types instead of hard-coded
10203 `short'.
10204 * tests/regression.at (Web2c Actions): Adjust.
10205
10206 2002-07-19 Akim Demaille <akim@epita.fr>
10207
10208 * src/scan-gram.l (id): Can start with an underscore.
10209
10210 2002-07-16 Akim Demaille <akim@epita.fr>
10211
10212 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10213 Adjust all former `associativity' dependencies.
10214 * src/symtab.c (symbol_new): Default associativity is `undef', not
10215 `right'.
10216 (symbol_check_alias_consistence): Adjust.
10217
10218 2002-07-09 Akim Demaille <akim@epita.fr>
10219
10220 * doc/bison.texinfo: Properly set the ``header'' part.
10221 Use @dircategory ``GNU programming tools'' as per Texinfo's
10222 documentation.
10223 Use @copying.
10224
10225 2002-07-09 Akim Demaille <akim@epita.fr>
10226
10227 * lib/quotearg.h: Protect against multiple inclusions.
10228 * src/location.h (location_t): Add a `file' member.
10229 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10230 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10231 `error_one_per_line' support.
10232
10233 2002-07-09 Akim Demaille <akim@epita.fr>
10234
10235 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10236 * src/reader.c (lineno): Remove.
10237 Adjust all dependencies.
10238 (get_merge_function): Take a location and use complain_at.
10239 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10240 * tests/regression.at (Invalid inputs, Mixing %token styles):
10241 Adjust.
10242
10243 2002-07-09 Akim Demaille <akim@epita.fr>
10244
10245 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10246 recovery rule, and forbid extensions when --yacc.
10247 (gram_error): Use complain_at.
10248 * src/reader.c (reader): Exit if there were parse errors.
10249
10250 2002-07-09 Akim Demaille <akim@epita.fr>
10251
10252 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10253 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10254 Reported by R Blake <blakers@mac.com>.
10255
10256 2002-07-09 Akim Demaille <akim@epita.fr>
10257
10258 * data/yacc.c: Output the copyright notive in the header.
10259
10260 2002-07-03 Akim Demaille <akim@epita.fr>
10261
10262 * src/output.c (froms, tos): Are state_number_t.
10263 (save_column): sp, sp1, and sp2 are state_number_t.
10264 (prepare): Rename `final' as `final_state_number', `nnts' as
10265 `nterms_number', `nrules' as `rules_number', `nstates' as
10266 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10267 unused.
10268 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10269 * data/lalr1.cc (nsym_): Remove, unused.
10270
10271 2002-07-03 Akim Demaille <akim@epita.fr>
10272
10273 * src/lalr.h, src/lalr.c (goto_number_t): New.
10274 * src/lalr.c (goto_list_t): New.
10275 Propagate them.
10276 * src/nullable.c (rule_list_t): New.
10277 Propagate.
10278 * src/types.h: Remove.
10279
10280 2002-07-03 Akim Demaille <akim@epita.fr>
10281
10282 * src/closure.c (print_fderives): Use rule_rhs_print.
10283 * src/derives.c (print_derives): Use rule_rhs_print.
10284 (rule_list_t): New, replaces `shorts'.
10285 (set_derives): Add comments.
10286 * tests/sets.at (Nullable, Firsts): Adjust.
10287
10288 2002-07-03 Akim Demaille <akim@epita.fr>
10289
10290 * src/output.c (prepare_actions): Free `tally' and `width'.
10291 (prepare_actions): Allocate and free `order'.
10292 * src/symtab.c (symbols_free): Free `symbols'.
10293 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10294 * src/output.c (m4_invoke): Move to...
10295 * src/scan-skel.l: here.
10296 (<<EOF>>): Close yyout, and free its name.
10297
10298 2002-07-03 Akim Demaille <akim@epita.fr>
10299
10300 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10301
10302 * src/LR0.c (new_state): Merge into...
10303 (state_list_append): this.
10304 (new_states): Merge into...
10305 (generate_states): here.
10306 (set_states): Don't ensure a proper `errs' state member here, do it...
10307 * src/conflicts.c (conflicts_solve): here.
10308 * src/state.h, src/state.c: Comment changes.
10309 (state_t): Rename member `shifts' as `transitions'.
10310 Adjust all dependencies.
10311 (errs_new): For consistency, also take the values as argument.
10312 (errs_dup): Remove.
10313 (state_errs_set): New.
10314 (state_reductions_set, state_transitions_set): Assert that no
10315 previous value was assigned.
10316 (state_free): New.
10317 (states_free): Use it.
10318 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10319 temporary storage: use `errs' and `nerrs' as elsewhere.
10320 (set_conflicts): Allocate and free this `errs'.
10321
10322 2002-07-02 Akim Demaille <akim@epita.fr>
10323
10324 * lib/libiberty.h: New.
10325 * lib: Update the bitset implementation from upstream.
10326 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10327 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10328 * src/main.c: Adjust bitset stats calls.
10329
10330 2002-07-01 Paul Eggert <eggert@twinsun.com>
10331
10332 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10333 char, so that negative chars don't collide with $.
10334
10335 2002-06-30 Akim Demaille <akim@epita.fr>
10336
10337 Have the GLR tests be `warning' checked, and fix the warnings.
10338
10339 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10340 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10341 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10342 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10343 (yyaddDeferredAction): static.
10344 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10345 (yyreportParseError): yyprefix is const.
10346 yytokenp is used only when verbose.
10347 (yy__GNUC__): Replace with __GNUC__.
10348 (yypdumpstack): yyi is size_t.
10349 (yypreference): Un-yy local variables and arguments, to avoid
10350 clashes with `yyr1'. Anyway, we are not in the user name space.
10351 (yytname_size): be an int, as is compared with ints.
10352 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10353 Use them.
10354 * tests/cxx-gram.at: Use quotation to protect $1.
10355 Use AT_COMPILE to enable warnings hunts.
10356 Prototype yylex and yyerror.
10357 `Use' argc.
10358 Include `string.h', not `strings.h'.
10359 Produce and prototype stmtMerge only when used.
10360 yylex takes a location.
10361
10362 2002-06-30 Akim Demaille <akim@epita.fr>
10363
10364 We spend a lot of time in quotearg, in particular when --verbose.
10365
10366 * src/symtab.c (symbol_get): Store a quoted version of the key.
10367 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10368 Adjust all callers.
10369
10370 2002-06-30 Akim Demaille <akim@epita.fr>
10371
10372 * src/state.h (reductions_t): Rename member `nreds' as num.
10373 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10374 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10375
10376 2002-06-30 Akim Demaille <akim@epita.fr>
10377
10378 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10379 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10380 (shifts_to): Rename as...
10381 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10382 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10383 (TRANSITION_IS_DISABLED, transitions_to): these.
10384
10385 2002-06-30 Akim Demaille <akim@epita.fr>
10386
10387 * src/print.c (print_shifts, print_gotos): Merge into...
10388 (print_transitions): this.
10389 (print_transitions, print_errs, print_reductions): Align the
10390 lookaheads columns.
10391 (print_core, print_transitions, print_errs, print_state,
10392 print_grammar): Output empty lines separator before, not after.
10393 (state_default_rule_compute): Rename as...
10394 (state_default_rule): this.
10395 * tests/conflicts.at (Defaulted Conflicted Reduction),
10396 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10397 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10398
10399 2002-06-30 Akim Demaille <akim@epita.fr>
10400
10401 Display items as we display rules.
10402
10403 * src/gram.h, src/gram.c (rule_lhs_print): New.
10404 * src/gram.c (grammar_rules_partial_print): Use it.
10405 * src/print.c (print_core): Likewise.
10406 * tests/conflicts.at (Defaulted Conflicted Reduction),
10407 (Unresolved SR Conflicts): Adjust.
10408 (Unresolved SR Conflicts): Adjust and rename as...
10409 (Resolved SR Conflicts): this, as was meant.
10410 * tests/regression.at (Web2c Report): Adjust.
10411
10412 2002-06-30 Akim Demaille <akim@epita.fr>
10413
10414 * src/print.c (state_default_rule_compute): New, extracted from...
10415 (print_reductions): here.
10416 Pessimize, but clarify the code.
10417 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10418
10419 2002-06-30 Akim Demaille <akim@epita.fr>
10420
10421 * src/output.c (action_row): Let default_rule be always a rule
10422 number.
10423
10424 2002-06-30 Akim Demaille <akim@epita.fr>
10425
10426 * src/closure.c (print_firsts, print_fderives, closure):
10427 Use BITSET_EXECUTE.
10428 * src/lalr.c (lookaheads_print): Likewise.
10429 * src/state.c (state_rule_lookaheads_print): Likewise.
10430 * src/print_graph.c (print_core): Likewise.
10431 * src/print.c (print_reductions): Likewise.
10432 * src/output.c (action_row): Likewise.
10433 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10434
10435 2002-06-30 Akim Demaille <akim@epita.fr>
10436
10437 * src/print_graph.c: Use report_flag.
10438
10439 2002-06-30 Akim Demaille <akim@epita.fr>
10440
10441 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10442 to...
10443 * src/relation.h, src/relation.c (traverse, relation_digraph)
10444 (relation_print, relation_transpose): New.
10445
10446 2002-06-30 Akim Demaille <akim@epita.fr>
10447
10448 * src/state.h, src/state.c (shifts_to): New.
10449 * src/lalr.c (build_relations): Use it.
10450
10451 2002-06-30 Akim Demaille <akim@epita.fr>
10452
10453 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10454 (item_number_of_rule_number, rule_number_of_item_number): New.
10455 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10456 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10457 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10458 Propagate their use.
10459 Much remains to be done, in particular wrt `shorts' from types.h.
10460
10461 2002-06-30 Akim Demaille <akim@epita.fr>
10462
10463 * src/symtab.c (symbol_new): Initialize the `printer' member.
10464
10465 2002-06-30 Akim Demaille <akim@epita.fr>
10466
10467 * src/LR0.c (save_reductions): Remove, replaced by...
10468 * src/state.h, src/state.c (state_reductions_set): New.
10469 (reductions, errs): Rename as...
10470 (reductions_t, errs_t): these.
10471 Adjust all dependencies.
10472
10473 2002-06-30 Akim Demaille <akim@epita.fr>
10474
10475 * src/LR0.c (state_list_t, state_list_append): New.
10476 (first_state, last_state): Now symbol_list_t.
10477 (this_state): Remove.
10478 (new_itemsets, append_states, save_reductions): Take a state_t as
10479 argument.
10480 (set_states, generate_states): Adjust.
10481 (save_shifts): Remove, replaced by...
10482 * src/state.h, src/state.c (state_shifts_set): New.
10483 (shifts): Rename as...
10484 (shifts_t): this.
10485 Adjust all dependencies.
10486 * src/state.h (state_t): Remove the `next' member.
10487
10488 2002-06-30 Akim Demaille <akim@epita.fr>
10489
10490 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10491 escaped in slot 0.
10492
10493 2002-06-30 Akim Demaille <akim@epita.fr>
10494
10495 Use hash.h for the state hash table.
10496
10497 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10498 (allocate_storage): Use state_hash_new.
10499 (free_storage): Use state_hash_free.
10500 (new_state, get_state): Adjust.
10501 * src/lalr.h, src/lalr.c (states): Move to...
10502 * src/states.h (state_t): Remove the `link' member, no longer
10503 used.
10504 * src/states.h, src/states.c: here.
10505 (state_hash_new, state_hash_free, state_hash_lookup)
10506 (state_hash_insert, states_free): New.
10507 * src/states.c (state_table, state_compare, state_hash): New.
10508 * src/output.c (output_actions): Do not free states now, since we
10509 still need to know the final_state number in `prepare', called
10510 afterwards. Do it...
10511 * src/main.c (main): here: call states_free after `output'.
10512
10513 2002-06-30 Akim Demaille <akim@epita.fr>
10514
10515 * src/state.h, src/state.c (state_new): New, extracted from...
10516 * src/LR0.c (new_state): here.
10517 * src/state.h (STATE_ALLOC): Move to...
10518 * src/state.c: here.
10519 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10520 * src/state.h, src/state.c: here.
10521
10522 2002-06-30 Akim Demaille <akim@epita.fr>
10523
10524 * src/reader.c (gensym): Rename as...
10525 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10526 (getsym): Rename as...
10527 (symbol_get): this.
10528
10529 2002-06-30 Akim Demaille <akim@epita.fr>
10530
10531 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10532 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10533 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10534 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10535
10536 2002-06-30 Akim Demaille <akim@epita.fr>
10537
10538 Make the test suite pass with warnings checked.
10539
10540 * tests/actions.at (Printers and Destructors): Improve.
10541 Avoid unsigned vs. signed issues.
10542 * tests/calc.at: Don't exercise the scanner here, do it...
10543 * tests/input.at (Torturing the Scanner): here.
10544
10545 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10546
10547 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
10548 reorganize first lines parallel to yacc.c.
10549
10550 2002-06-28 Akim Demaille <akim@epita.fr>
10551
10552 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10553 (b4_token_enum, b4_token_defines): New, factored from...
10554 * data/lalr1.cc, data/yacc.c, glr.c: here.
10555
10556 2002-06-28 Akim Demaille <akim@epita.fr>
10557
10558 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10559 unused variables.
10560 * src/output.c (merger_output): static.
10561
10562 2002-06-28 Akim Demaille <akim@epita.fr>
10563
10564 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
10565 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10566 pacify GCC.
10567 * src/output.c (save_row): Initialize all the variables to pacify GCC.
10568
10569 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10570
10571 Accumulated changelog for new GLR parsing features.
10572
10573 * src/conflicts.c (count_total_conflicts): Change name to
10574 conflicts_total_count.
10575 * src/conflicts.h: Ditto.
10576 * src/output.c (token_actions): Use the new name.
10577 (output_conflicts): Change conflp => conflict_list_heads, and
10578 confl => conflict_list for better readability.
10579 * data/glr.c: Use the new names.
10580 * NEWS: Add self to GLR announcement.
10581
10582 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10583
10584 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10585 Akim Demaille.
10586
10587 * data/bison.glr: Change name to glr.c
10588 * data/glr.c: Renamed from bison.glr.
10589 * data/Makefile.am: Add glr.c
10590
10591 * src/getargs.c:
10592
10593 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
10594 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
10595
10596 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10597
10598 * data/bison.glr: Be sure to restore the
10599 current #line when returning to the skeleton contents after having
10600 exposed the input file's #line.
10601
10602 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10603
10604 * data/bison.glr: Bring up to date with changes to bison.simple.
10605
10606 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10607
10608 * data/bison.glr: Correct definitions that use b4_prefix.
10609 Various reformatting.
10610 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
10611 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
10612 yytokenp argument; now part of stack.
10613 (yychar): Define to behave as documented.
10614 (yyclearin): Ditto.
10615
10616 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10617
10618 * src/reader.h: Add declaration for free_merger_functions.
10619
10620 * src/reader.c (merge_functions): New variable.
10621 (get_merge_function): New function.
10622 (free_merger_functions): New function.
10623 (readgram): Check for %prec that is not followed by a symbol.
10624 Handle %dprec and %merge declarations.
10625 (packgram): Initialize dprec and merger fields in rules array.
10626
10627 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
10628 conflict_list_cnt, conflict_list_free): New variables.
10629 (table_grow): Also grow conflict_table.
10630 (prepare_rules): Output dprec and merger tables.
10631 (conflict_row): New function.
10632 (action_row): Output conflict lists for GLR parser. Don't use
10633 default reduction in conflicted states for GLR parser so that there
10634 are spaces for the conflict lists.
10635 (save_row): Also save conflict information.
10636 (token_actions): Allocate conflict list.
10637 (merger_output): New function.
10638 (pack_vector): Pack conflict table, too.
10639 (output_conflicts): New function to output yyconflp and yyconfl.
10640 (output_check): Allocate conflict_tos.
10641 (output_actions): Output conflict tables, also.
10642 (output_skeleton): Output b4_mergers definition.
10643 (prepare): Output b4_max_rhs_length definition.
10644 Use 'bison.glr' as default skeleton for GLR parsers.
10645
10646 * src/gram.c (glr_parser): New flag.
10647 (grammar_free): Call free_merger_functions.
10648
10649 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
10650 all pairs of conflicting reductions, rather than just all tokens
10651 causing conflicts. Needed to size conflict tables.
10652 (conflicts_output): Modify call to count_rr_conflicts for new
10653 interface.
10654 (conflicts_print): Ditto.
10655 (count_total_conflicts): New function.
10656
10657 * src/reader.h (merger_list): New type.
10658 (merge_functions): New variable.
10659
10660 * src/lex.h (tok_dprec, tok_merge): New token types.
10661
10662 * src/gram.h (rule_s): Add dprec and merger fields.
10663 (glr_parser): New flag.
10664
10665 * src/conflicts.h (count_total_conflicts): New function.
10666
10667 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10668
10669 * doc/bison.texinfo (Generalized LR Parsing): New section.
10670 (GLR Parsers): New section.
10671 (Language and Grammar): Mention GLR parsing.
10672 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
10673 Correct typo ("tge" -> "the").
10674
10675 * data/bison.glr: New skeleton for GLR parsing.
10676
10677 * tests/cxx-gram.at: New tests for GLR parsing.
10678
10679 * tests/testsuite.at: Include cxx-gram.at.
10680
10681 * tests/Makefile.am: Add cxx-gram.at.
10682
10683 * src/parse-gram.y:
10684
10685 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10686
10687 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
10688
10689 2002-06-27 Akim Demaille <akim@epita.fr>
10690
10691 * src/options.h, src/options.c: Remove.
10692 * src/getargs.c (short_options, long_options): New.
10693
10694 2002-06-27 Akim Demaille <akim@epita.fr>
10695
10696 * data/bison.simple, data/bison.c++: Rename as...
10697 * data/yacc.c, data/lalr1.cc: these.
10698 * doc/bison.texinfo (Environment Variables): Remove.
10699
10700 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10701
10702 * src/getargs.c (report_argmatch): Initialize strtok().
10703
10704 2002-06-20 Akim Demaille <akim@epita.fr>
10705
10706 * data/bison.simple (b4_symbol_actions): New, replaces...
10707 (b4_symbol_destructor, b4_symbol_printer): these.
10708 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10709 user token numbers.
10710
10711 2002-06-20 Akim Demaille <akim@epita.fr>
10712
10713 * data/bison.simple (yydestructor): Rename as...
10714 (yydestruct): this.
10715
10716 2002-06-20 Akim Demaille <akim@epita.fr>
10717
10718 * src/symtab.h, src/symtab.c (symbol_type_set)
10719 (symbol_destructor_set, symbol_precedence_set): The location is
10720 the last argument.
10721 Adjust all callers.
10722
10723 2002-06-20 Akim Demaille <akim@epita.fr>
10724
10725 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10726 internals.
10727 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10728 Takes a location.
10729 * src/symtab.h, src/symtab.c (symbol_class_set)
10730 (symbol_user_token_number_set): Likewise.
10731 Adjust all callers.
10732 Promote complain_at.
10733 * tests/input.at (Type Clashes): Adjust.
10734
10735 2002-06-20 Akim Demaille <akim@epita.fr>
10736
10737 * data/bison.simple (YYLEX): Fix the declaration when
10738 %pure-parser.
10739
10740 2002-06-20 Akim Demaille <akim@epita.fr>
10741
10742 * data/bison.simple (yysymprint): Don't print the token number,
10743 just its name.
10744 * tests/actions.at (Destructors): Rename as...
10745 (Printers and Destructors): this.
10746 Also exercise %printer.
10747
10748 2002-06-20 Akim Demaille <akim@epita.fr>
10749
10750 * data/bison.simple (YYDSYMPRINT): New.
10751 Use it to remove many of the #if YYDEBUG/if (yydebug).
10752
10753 2002-06-20 Akim Demaille <akim@epita.fr>
10754
10755 * src/symtab.h, src/symtab.c (symbol_t): printer and
10756 printer_location are new members.
10757 (symbol_printer_set): New.
10758 * src/parse-gram.y (PERCENT_PRINTER): New token.
10759 Handle its associated rule.
10760 * src/scan-gram.l: Adjust.
10761 (handle_destructor_at, handle_destructor_dollar): Rename as...
10762 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10763 * src/output.c (symbol_printers_output): New.
10764 (output_skeleton): Call it.
10765 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10766 since there are already many grammar files with a user `yyprint'.
10767 Replace the calls to YYPRINT to calls to yysymprint.
10768 * tests/calc.at: Adjust.
10769 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10770 taking advantage of parser very internal details (stack size!).
10771
10772 2002-06-20 Akim Demaille <akim@epita.fr>
10773
10774 * src/scan-gram.l: Complete the scanner with the missing patterns
10775 to pacify Flex.
10776 Use `quote' and `symbol_tag_get' where appropriate.
10777
10778 2002-06-19 Akim Demaille <akim@epita.fr>
10779
10780 * tests/actions.at (Destructors): Augment to test locations.
10781 * data/bison.simple (yydestructor): Pass it the current location
10782 if locations are enabled.
10783 Prototype only when __STDC__ or C++.
10784 Change the argument names to move into the yy name space: there is
10785 user code here.
10786
10787 2002-06-19 Akim Demaille <akim@epita.fr>
10788
10789 * data/bison.simple (b4_pure_if): New.
10790 Use it instead of #ifdef YYPURE.
10791
10792 2002-06-19 Akim Demaille <akim@epita.fr>
10793
10794 * data/bison.simple (b4_location_if): New.
10795 Use it instead of #ifdef YYLSP_NEEDED.
10796
10797 2002-06-19 Akim Demaille <akim@epita.fr>
10798
10799 Prepare @$ in %destructor, but currently don't bind it in the
10800 skeleton, as %location use is not cleaned up yet.
10801
10802 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10803 (handle_action_at): New.
10804 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10805 a braced_code_t and a location as additional arguments.
10806 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10807 unquote one when outputting `b4_dollar_dollar'.
10808 Adjust callers.
10809 * data/bison.simple (b4_eval): Remove.
10810 (b4_symbol_destructor): Adjust.
10811 * tests/input.at (Invalid @n): Adjust.
10812
10813 2002-06-19 Zack Weinberg <zack@codesourcery.com>
10814
10815 * doc/bison.texinfo: Document ability to have multiple
10816 prologue sections.
10817
10818 2002-06-18 Akim Demaille <akim@epita.fr>
10819
10820 * src/files.c (compute_base_names): When computing the output file
10821 names from the input file name, strip the directory part.
10822
10823 2002-06-18 Akim Demaille <akim@epita.fr>
10824
10825 * data/bison.simple.new: Comment changes.
10826 Reported by Andreas Schwab.
10827
10828 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10829
10830 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10831 there are no `label `yyoverflowlab' defined but not used' warnings
10832 when yyoverflow is defined.
10833
10834 2002-06-18 Akim Demaille <akim@epita.fr>
10835
10836 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10837 new member.
10838 (symbol_destructor_set): Adjust.
10839 * src/output.c (symbol_destructors_output): Output the destructor
10840 locations.
10841 Output the symbol name.
10842 * data/bison.simple (b4_symbol_destructor): Adjust.
10843
10844 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10845 and Akim Demaille <akim@epita.fr>
10846
10847 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10848 what's left on the stack when the error recovery hits EOF.
10849 * tests/actions.at (Destructors): Complete to exercise this case.
10850
10851 2002-06-17 Akim Demaille <akim@epita.fr>
10852
10853 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10854 arguments is really empty, not only equal to `[]'.
10855 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10856 member.
10857 (symbol_destructor_set): New.
10858 * src/output.c (symbol_destructors_output): New.
10859 * src/reader.h (brace_code_t, current_braced_code): New.
10860 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10861 (handle_dollar): Rename as...
10862 (handle_action_dollar): this.
10863 (handle_destructor_dollar): New.
10864 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10865 (grammar_declaration): Use it.
10866 * data/bison.simple (yystos): Is always defined.
10867 (yydestructor): New.
10868 * tests/actions.at (Destructors): New.
10869 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10870
10871 2002-06-17 Akim Demaille <akim@epita.fr>
10872
10873 * src/symlist.h, src/symlist.c (symbol_list_length): New.
10874 * src/scan-gram.l (handle_dollar, handle_at): Compute the
10875 rule_length only when needed.
10876 * src/output.c (actions_output, token_definitions_output): Output
10877 the full M4 block.
10878 * src/symtab.c: Don't access directly to the symbol tag, use
10879 symbol_tag_get.
10880 * src/parse-gram.y: Use symbol_list_free.
10881
10882 2002-06-17 Akim Demaille <akim@epita.fr>
10883
10884 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
10885 (symbol_list_prepend, get_type_name): Move to...
10886 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
10887 (symbol_list_prepend, symbol_list_n_type_name_get): here.
10888 Adjust all callers.
10889 (symbol_list_free): New.
10890 * src/scan-gram.l (handle_dollar): Takes a location.
10891 * tests/input.at (Invalid $n): Adjust.
10892
10893 2002-06-17 Akim Demaille <akim@epita.fr>
10894
10895 * src/reader.h, src/reader.c (symbol_list_new): Export it.
10896 (symbol_list_prepend): New.
10897 * src/parse-gram.y (%union): `list' is a new member.
10898 (symbols.1): New, replaces...
10899 (terms_to_prec.1, nterms_to_type.1): these.
10900 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
10901 Take a location as additional argument.
10902 Adjust all callers.
10903
10904 2002-06-15 Akim Demaille <akim@epita.fr>
10905
10906 * src/parse-gram.y: Move %token in the declaration section so that
10907 we don't depend upon CVS Bison.
10908
10909 2002-06-15 Akim Demaille <akim@epita.fr>
10910
10911 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10912 * src/print.c (print_core): Use it.
10913
10914 2002-06-15 Akim Demaille <akim@epita.fr>
10915
10916 * src/conflicts.c (log_resolution): Accept the rule involved in
10917 the sr conflicts instead of the lookahead number that points to
10918 that rule.
10919 (flush_reduce): Accept the current lookahead vector as argument,
10920 instead of the index in LA.
10921 (resolve_sr_conflict): Accept the current number of lookahead
10922 bitset to consider for the STATE, instead of the index in LA.
10923 (set_conflicts): Adjust.
10924 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
10925
10926 2002-06-15 Akim Demaille <akim@epita.fr>
10927
10928 * src/state.h (state_t): Replace the `lookaheadsp' member, a
10929 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
10930 Adjust all dependencies.
10931 * src/lalr.c (initialize_lookaheads): Split into...
10932 (states_lookaheads_count, states_lookaheads_initialize): these.
10933 (lalr): Adjust.
10934
10935 2002-06-15 Akim Demaille <akim@epita.fr>
10936
10937 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10938 out of...
10939 (grammar_rules_print): here.
10940 * src/reduce.c (reduce_output): Use it.
10941 * tests/reduce.at (Useless Rules, Reduced Automaton)
10942 (Underivable Rules): Adjust.
10943
10944 2002-06-15 Akim Demaille <akim@epita.fr>
10945
10946 Copy BYacc's nice way to report the grammar.
10947
10948 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10949 New.
10950 Don't print the rules' location, it is confusing and useless.
10951 (rule_print): Use grammar_rhs_print.
10952 * src/print.c (print_grammar): Use grammar_rules_print.
10953
10954 2002-06-15 Akim Demaille <akim@epita.fr>
10955
10956 Complete and rationalize `useless thing' warnings.
10957
10958 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10959 (symbol_tag_print): New.
10960 Use them everywhere in place of accessing directly the tag member.
10961 * src/gram.h, src/gram.c (rule_print): New.
10962 Use it where a rule used to be printed `by hand'.
10963 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10964 (reduce_grammar_tables): Report the useless rules.
10965 (reduce_print): Useless things are a warning, not an error.
10966 Report it as such.
10967 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10968 (Reduced Automaton, Underivable Rules): Adjust.
10969 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10970 * tests/conflicts.at (Unresolved SR Conflicts)
10971 (Solved SR Conflicts): Adjust.
10972
10973 2002-06-15 Akim Demaille <akim@epita.fr>
10974
10975 Let symbols have a location.
10976
10977 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10978 (getsym): Adjust.
10979 Adjust all callers.
10980 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10981 Use location_t, not int.
10982 * src/symtab.c (symbol_check_defined): Take advantage of the
10983 location.
10984 * tests/regression.at (Invalid inputs): Adjust.
10985
10986 2002-06-15 Akim Demaille <akim@epita.fr>
10987
10988 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10989 (input): Don't try to initialize yylloc here, do it in the
10990 scanner.
10991 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
10992 * src/gram.h (rule_t): Change line and action_line into location
10993 and action_location, of location_t type.
10994 Adjust all dependencies.
10995 * src/location.h, src/location.c (empty_location): New.
10996 * src/reader.h, src/reader.c (grammar_start_symbol_set)
10997 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
10998 (grammar_current_rule_symbol_append)
10999 (grammar_current_rule_action_append): Expect a location as argument.
11000 * src/reader.c (grammar_midrule_action): Adjust to attach an
11001 action's location as dummy symbol location.
11002 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11003 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11004 the line numbers.
11005
11006 2002-06-14 Akim Demaille <akim@epita.fr>
11007
11008 Grammar declarations may be found in the grammar section.
11009
11010 * src/parse-gram.y (rules_or_grammar_declaration): New.
11011 (declarations): Each declaration may end with a semicolon, not
11012 just...
11013 (grammar_declaration): `"%union"'.
11014 (grammar): Branch to rules_or_grammar_declaration.
11015
11016 2002-06-14 Akim Demaille <akim@epita.fr>
11017
11018 * src/main.c (main): Invoke scanner_free.
11019
11020 2002-06-14 Akim Demaille <akim@epita.fr>
11021
11022 * src/output.c (m4_invoke): Extracted from...
11023 (output_skeleton): here.
11024 Free tempfile.
11025
11026 2002-06-14 Akim Demaille <akim@epita.fr>
11027
11028 * src/parse-gram.y (directives, directive, gram)
11029 (grammar_directives, precedence_directives, precedence_directive):
11030 Rename as...
11031 (declarations, declaration, grammar, grammar_declaration)
11032 (precedence_declaration, precedence_declarator): these.
11033 (symbol_declaration): New.
11034
11035 2002-06-14 Akim Demaille <akim@epita.fr>
11036
11037 * src/files.c (action_obstack): Remove, unused.
11038 (output_obstack): Remove it, and all its dependencies, as it is no
11039 longer needed.
11040 * src/reader.c (epilogue_set): Build the epilogue in the
11041 muscle_obstack.
11042 * src/output.h, src/output.c (muscle_obstack): Move to...
11043 * src/muscle_tab.h, src/muscle_tab.h: here.
11044 (muscle_init): Initialize muscle_obstack.
11045 (muscle_free): New.
11046 * src/main.c (main): Call it.
11047
11048 2002-06-14 Akim Demaille <akim@epita.fr>
11049
11050 * src/location.h: New, extracted from...
11051 * src/reader.h: here.
11052 * src/Makefile.am (noinst_HEADERS): Merge into
11053 (bison_SOURCES): this.
11054 Add location.h.
11055 * src/parse-gram.y: Use location_t instead of Bison's.
11056 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11057 Use location_t instead of ints.
11058
11059 2002-06-14 Akim Demaille <akim@epita.fr>
11060
11061 * data/bison.simple, data/bison.c++: Be sure to restore the
11062 current #line when returning to the skeleton contents after having
11063 exposed the input file's #line.
11064
11065 2002-06-12 Akim Demaille <akim@epita.fr>
11066
11067 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11068 eager.
11069 * tests/actions.at (Exotic Dollars): New.
11070
11071 2002-06-12 Akim Demaille <akim@epita.fr>
11072
11073 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11074 ['"/] too eagerly.
11075 * tests/input.at (Torturing the Scanner): New.
11076
11077 2002-06-11 Akim Demaille <akim@epita.fr>
11078
11079 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11080 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11081 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11082 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11083 * src/reader.c (reader): Use it.
11084
11085 2002-06-11 Akim Demaille <akim@epita.fr>
11086
11087 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11088 Adjust all callers.
11089 (scanner_last_string_free): New.
11090
11091 2002-06-11 Akim Demaille <akim@epita.fr>
11092
11093 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11094 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11095 (last_string, YY_OBS_FREE): New.
11096 Use them when returning an ID.
11097
11098 2002-06-11 Akim Demaille <akim@epita.fr>
11099
11100 Have Bison grammars parsed by a Bison grammar.
11101
11102 * src/reader.c, src/reader.h (prologue_augment): New.
11103 * src/reader.c (copy_definition): Remove.
11104
11105 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11106 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11107 (grammar_current_rule_prec_set, grammar_current_rule_check)
11108 (grammar_current_rule_symbol_append)
11109 (grammar_current_rule_action_append): Export.
11110 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11111 (symbol_list_action_append): Remove.
11112 Hook the routines from reader.
11113 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11114 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11115
11116 * src/reader.c (read_declarations): Remove, unused.
11117
11118 * src/parse-gram.y: Handle the epilogue.
11119 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11120 (grammar_start_symbol_set): this.
11121 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11122 * src/reader.c (readgram): Remove, unused.
11123 (reader): Adjust to insert eoftoken and axiom where appropriate.
11124
11125 * src/reader.c (copy_dollar): Replace with...
11126 * src/scan-gram.h (handle_dollar): this.
11127 * src/parse-gram.y: Remove `%thong'.
11128
11129 * src/reader.c (copy_at): Replace with...
11130 * src/scan-gram.h (handle_at): this.
11131
11132 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11133 New.
11134
11135 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11136 time being.
11137
11138 * src/reader.h, src/reader.c (grammar_rule_end): New.
11139
11140 * src/parse.y (current_type, current_class): New.
11141 Implement `%nterm', `%token' support.
11142 Merge `%term' into `%token'.
11143 (string_as_id): New.
11144 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11145 type name.
11146
11147 * src/parse-gram.y: Be sure to handle properly the beginning of
11148 rules.
11149
11150 * src/parse-gram.y: Handle %type.
11151 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11152
11153 * src/parse-gram.y: More directives support.
11154 * src/options.c: No longer handle source directives.
11155
11156 * src/parse-gram.y: Fix %output.
11157
11158 * src/parse-gram.y: Handle %union.
11159 Use the prologue locations.
11160 * src/reader.c (parse_union_decl): Remove.
11161
11162 * src/reader.h, src/reader.c (epilogue_set): New.
11163 * src/parse-gram.y: Use it.
11164
11165 * data/bison.simple, data/bison.c++: b4_stype is now either not
11166 defined, then default to int, or to the contents of %union,
11167 without `union' itself.
11168 Adjust.
11169 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11170
11171 * src/output.c (actions_output): Don't output braces, as they are
11172 already handled by the scanner.
11173
11174 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11175 characters to themselves.
11176
11177 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11178 that the epilogue has a proper #line.
11179
11180 * src/parse-gram.y: Handle precedence/associativity.
11181
11182 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11183 a terminal.
11184 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11185 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11186 at all to define terminals that cannot be emitted.
11187
11188 * src/scan-gram.l: Escape M4 characters.
11189
11190 * src/scan-gram.l: Working properly with escapes in user
11191 strings/characters.
11192
11193 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11194 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11195 grammar.
11196 Use more modest sizes, as for the time being the parser does not
11197 release memory, and therefore the process swallows a huge amount
11198 of memory.
11199
11200 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11201 stricter %token grammar.
11202
11203 * src/symtab.h (associativity): Add `undef_assoc'.
11204 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11205 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11206
11207 * tests/regression.at (Invalid %directive): Remove, as it is now
11208 meaningless.
11209 (Invalid inputs): Adjust to the new error messages.
11210 (Token definitions): The new grammar doesn't allow too many
11211 eccentricities.
11212
11213 * src/lex.h, src/lex.c: Remove.
11214 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11215 (copy_character, copy_string2, copy_string, copy_identifier)
11216 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11217 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11218 (parse_action): Remove.
11219 * po/POTFILES.in: Adjust.
11220
11221 2002-06-11 Akim Demaille <akim@epita.fr>
11222
11223 * src/reader.c (parse_action): Don't store directly into the
11224 rule's action member: return the action as a string.
11225 Don't require `rule_length' as an argument: compute it.
11226 (grammar_current_rule_symbol_append)
11227 (grammar_current_rule_action_append): New, eved out from
11228 (readgram): here.
11229 Remove `action_flag', `rulelength', unused now.
11230
11231 2002-06-11 Akim Demaille <akim@epita.fr>
11232
11233 * src/reader.c (grammar_current_rule_prec_set).
11234 (grammar_current_rule_check): New, eved out from...
11235 (readgram): here.
11236 Remove `xaction', `first_rhs': useless.
11237 * tests/input.at (Type clashes): New.
11238 * tests/existing.at (GNU Cim Grammar): Adjust.
11239
11240 2002-06-11 Akim Demaille <akim@epita.fr>
11241
11242 * src/reader.c (grammar_midrule_action): New, Eved out from
11243 (readgram): here.
11244
11245 2002-06-11 Akim Demaille <akim@epita.fr>
11246
11247 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11248 New.
11249 (readgram): Use them as replacement of inlined code, crule and
11250 crule1.
11251
11252 2002-06-11 Akim Demaille <akim@epita.fr>
11253
11254 * src/reader.c (grammar_end, grammar_symbol_append): New.
11255 (readgram): Use them.
11256 Make the use of `p' as local as possible.
11257
11258 2002-06-10 Akim Demaille <akim@epita.fr>
11259
11260 GCJ's parser requires the tokens to be defined before the prologue.
11261
11262 * data/bison.simple: Output the token definition before the user's
11263 prologue.
11264 * tests/regression.at (Braces parsing, Duplicate string)
11265 (Mixing %token styles): Check the output from bison.
11266 (Early token definitions): New.
11267
11268 2002-06-10 Akim Demaille <akim@epita.fr>
11269
11270 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11271 assigning twice the same user number to a token, so that we can
11272 use it in...
11273 * src/lex.c (lex): here.
11274 Also use `symbol_class_set' instead of hand written code.
11275 * src/reader.c (parse_assoc_decl): Likewise.
11276
11277 2002-06-10 Akim Demaille <akim@epita.fr>
11278
11279 * src/symtab.c, src/symtab.c (symbol_class_set)
11280 (symbol_user_token_number_set): New.
11281 * src/reader.c (parse_token_decl): Use them.
11282 Use a switch instead of ifs.
11283 Use a single argument.
11284
11285 2002-06-10 Akim Demaille <akim@epita.fr>
11286
11287 Remove `%thong' support as it is undocumented, unused, duplicates
11288 `%token's job, and creates useless e-mail traffic with people who
11289 want to know what it is, why it is undocumented, unused, and
11290 duplicates `%token's job.
11291
11292 * src/reader.c (parse_thong_decl): Remove.
11293 * src/options.c (option_table): Remove "thong".
11294 * src/lex.h (tok_thong): Remove.
11295
11296 2002-06-10 Akim Demaille <akim@epita.fr>
11297
11298 * src/symtab.c, src/symtab.c (symbol_type_set)
11299 (symbol_precedence_set): New.
11300 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11301 (value_components_used): Remove, unused.
11302
11303 2002-06-09 Akim Demaille <akim@epita.fr>
11304
11305 Move symbols handling code out of the reader.
11306
11307 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11308 (axiom): Move to...
11309 * src/symtab.h, src/symtab.c: here.
11310
11311 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11312 * src/reader.c (startval): Rename as...
11313 * src/symtab.h, src/symtab.c (startsymbol): this.
11314 * src/reader.c: Adjust.
11315
11316 * src/reader.c (symbol_check_defined, symbol_make_alias)
11317 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11318 (token_translations_init)
11319 Move to...
11320 * src/symtab.c: here.
11321 * src/reader.c (packsymbols): Move to...
11322 * src/symtab.h, src/symtab.c (symbols_pack): here.
11323 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11324 argument.
11325
11326 2002-06-03 Akim Demaille <akim@epita.fr>
11327
11328 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11329 then statements.
11330
11331 2002-06-03 Akim Demaille <akim@epita.fr>
11332
11333 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11334 structs with non literals.
11335 * src/scan-skel.l: never-interactive.
11336 * src/conflicts.c (enum conflict_resolution_e): No trailing
11337 comma.
11338 * src/getargs.c (usage): Split long literal strings.
11339 Reported by Hans Aberg.
11340
11341 2002-05-28 Akim Demaille <akim@epita.fr>
11342
11343 * data/bison.c++: Use C++ ostreams.
11344 (cdebug_): New member.
11345
11346 2002-05-28 Akim Demaille <akim@epita.fr>
11347
11348 * src/output.c (output_skeleton): Be sure to allocate enough room
11349 for `/' _and_ for `\0' in full_skeleton.
11350
11351 2002-05-28 Akim Demaille <akim@epita.fr>
11352
11353 * data/bison.c++: Catch up with bison.simple:
11354 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11355 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11356 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11357 and popping traces.
11358
11359 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11360
11361 * src/output.c (output_skeleton): Put an explicit path in front of
11362 the skeleton file name, rather than relying on the -I directory,
11363 to partially alleviate effects of having a skeleton file lying around
11364 in the current directory.
11365
11366 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11367
11368 * src/conflicts.c (log_resolution): Correct typo:
11369 obstack_printf should be obstack_fgrow1.
11370
11371 2002-05-26 Akim Demaille <akim@epita.fr>
11372
11373 * src/state.h (state_t): `solved_conflicts' is a new member.
11374 * src/LR0.c (new_state): Set it to 0.
11375 * src/conflicts.h, src/conflicts.c (print_conflicts)
11376 (free_conflicts, solve_conflicts): Rename as...
11377 (conflicts_print, conflicts_free, conflicts_solve): these.
11378 Adjust callers.
11379 * src/conflicts.c (enum conflict_resolution_e)
11380 (solved_conflicts_obstack): New, used by...
11381 (log_resolution): this.
11382 Adjust to attach the conflict resolution to each state.
11383 Complete the description with the precedence/associativity
11384 information.
11385 (resolve_sr_conflict): Adjust.
11386 * src/print.c (print_state): Output its solved_conflicts.
11387 * tests/conflicts.at (Unresolved SR Conflicts)
11388 (Solved SR Conflicts): Exercise --report=all.
11389
11390 2002-05-26 Akim Demaille <akim@epita.fr>
11391
11392 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11393 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11394 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11395 (token_number_t, item_number_as_token_number)
11396 (token_number_as_item_number, muscle_insert_token_number_table):
11397 Rename as...
11398 (symbol_number_t, item_number_as_symbol_number)
11399 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11400 these, since it is more appropriate.
11401
11402 2002-05-26 Akim Demaille <akim@epita.fr>
11403
11404 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11405 `Error:' lines.
11406 * data/bison.simple (yystos) [YYDEBUG]: New.
11407 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11408 error recovery.
11409 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11410
11411 2002-05-25 Akim Demaille <akim@epita.fr>
11412
11413 * doc/bison.texinfo (Debugging): Split into...
11414 (Tracing): this new section, its former contents, and...
11415 (Understanding): this new section.
11416 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11417 by...
11418 (report_flag): this.
11419 Adjust all dependencies.
11420 (report_args, report_types, report_argmatch): New.
11421 (usage, getargs): Report/support -r, --report.
11422 * src/options.h
11423 (struct option_table_struct): Rename as..,
11424 (struct option_table_s): this.
11425 Rename the `set_flag' member to `flag' to match with getopt_long's
11426 struct.
11427 * src/options.c (option_table): Split verbose into an entry for
11428 %verbose, and another for --verbose.
11429 Support --report/-r, so remove -r from the obsolete --raw.
11430 * src/print.c: Attach full item sets and lookaheads reports to
11431 report_flag instead of trace_flag.
11432 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11433
11434 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11435 and Paul Eggert <eggert@twinsun.com>
11436
11437 * data/bison.simple (yyparse): Correct error handling to conform to
11438 POSIX and yacc. Specifically, after syntax error is discovered,
11439 do not reduce further before shifting the error token.
11440 Clean up the code a bit by removing the labels yyerrdefault,
11441 yyerrhandle, yyerrpop.
11442 * NEWS: Document the above.
11443
11444 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11445
11446 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11447 type; it isn't always big enough, since it doesn't necessarily
11448 include non-terminals.
11449 (yytranslate): Expand definition of yy_token_number_type, so that
11450 the latter can be removed.
11451 (yy_token_number_type): Remove, only one use.
11452 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11453 don't use TokenNumberType as element type.
11454
11455 * tests/regression.at: Modify expected output to agree with change
11456 to yyr1 and yytranslate.
11457
11458 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11459
11460 * src/reader.c (parse_action): Use copy_character instead of
11461 obstack_1grow.
11462
11463 2002-05-13 Akim Demaille <akim@epita.fr>
11464
11465 * tests/regression.at (Token definitions): Prototype yylex and
11466 yyerror.
11467
11468 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11469
11470 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
11471 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11472 32-bit arithmetic.
11473 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11474
11475 2002-05-07 Akim Demaille <akim@epita.fr>
11476
11477 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11478 avoid GCC warnings.
11479
11480 2002-05-07 Akim Demaille <akim@epita.fr>
11481
11482 Kill GCC warnings.
11483
11484 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11485 over the RHS of each rule.
11486 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11487 * src/state.h (state_t): Member `nitems' is unsigned short.
11488 * src/LR0.c (get_state): Adjust.
11489 * src/reader.c (packgram): Likewise.
11490 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11491 `Type'.
11492 (muscle_insert_int_table): Remove, unused.
11493 (prepare_rules): Remove `max'.
11494
11495 2002-05-06 Akim Demaille <akim@epita.fr>
11496
11497 * src/closure.c (print_firsts): Display of the symbol tags.
11498 (bitmatrix_print): Move to...
11499 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11500 here.
11501 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11502
11503 2002-05-06 Akim Demaille <akim@epita.fr>
11504
11505 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11506 hash_do_for_each.
11507
11508 2002-05-06 Akim Demaille <akim@epita.fr>
11509
11510 * src/LR0.c (new_state, get_state): Instead of using the global
11511 `kernel_size' and `kernel_base', have two new arguments:
11512 `core_size' and `core'.
11513 Adjust callers.
11514
11515 2002-05-06 Akim Demaille <akim@epita.fr>
11516
11517 * src/reader.c (packgram): No longer end `ritem' with a 0
11518 sentinel: it is not used.
11519
11520 2002-05-05 Akim Demaille <akim@epita.fr>
11521
11522 New experimental feature: display the lookaheads in the report and
11523 graph.
11524
11525 * src/print (print_core): When --trace-flag, display the rules
11526 lookaheads.
11527 * src/print_graph.c (print_core): Likewise.
11528 Swap the arguments.
11529 Adjust caller.
11530
11531 2002-05-05 Akim Demaille <akim@epita.fr>
11532
11533 * tests/torture.at (Many lookaheads): New test.
11534
11535 2002-05-05 Akim Demaille <akim@epita.fr>
11536
11537 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11538 (GENERATE_MUSCLE_INSERT_TABLE): this.
11539 (output_int_table, output_unsigned_int_table, output_short_table)
11540 (output_token_number_table, output_item_number_table): Replace with...
11541 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11542 (muscle_insert_short_table, muscle_insert_token_number_table)
11543 (muscle_insert_item_number_table): these.
11544 Adjust all callers.
11545 (prepare_tokens): Don't free `translations', since...
11546 * src/reader.h, src/reader.c (grammar_free): do it.
11547 Move to...
11548 * src/gram.h, src/gram.c (grammar_free): here.
11549 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11550 b4_translate_max.
11551
11552 2002-05-05 Akim Demaille <akim@epita.fr>
11553
11554 * src/output.c (output_unsigned_int_table): New.
11555 (prepare_rules): `i' is unsigned.
11556 `prhs', `rline', `r2' are unsigned int.
11557 Rename muscle `rhs_number_max' as `rhs_max'.
11558 Output muscles `prhs_max', `rline_max', and `r2_max'.
11559 Free rline and r1.
11560 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11561 to compute types instead of constant types.
11562 * tests/regression.at (Web2c Actions): Adjust.
11563
11564 2002-05-04 Akim Demaille <akim@epita.fr>
11565
11566 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11567 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11568 Adjust dependencies.
11569 * src/output.c (token_definitions_output): Be sure not to output a
11570 `#define 'a'' when fed with `%token 'a' "a"'.
11571 * tests/regression.at (Token definitions): New.
11572
11573 2002-05-03 Paul Eggert <eggert@twinsun.com>
11574
11575 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11576 for K&R C.
11577
11578 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11579
11580 * Makefile.am (SUBDIRS): Remove intl.
11581 (EXTRA_DIST): Add config/config.rpath.
11582
11583 2002-05-03 Akim Demaille <akim@epita.fr>
11584
11585 * data/bison.simple (m4_if): Don't output empty enums.
11586 And actually, output valid enum definitions :(.
11587
11588 2002-05-03 Akim Demaille <akim@epita.fr>
11589
11590 * configure.bat: Remove, completely obsolete.
11591 * Makefile.am (EXTRA_DIST): Adjust.
11592 Don't distribute config.rpath...
11593 * config/Makefile.am (EXTRA_DIST): Do it.
11594
11595 2002-05-03 Akim Demaille <akim@epita.fr>
11596
11597 * configure.in (GETTEXT_VERSION): New.
11598 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11599
11600 2002-05-03 Akim Demaille <akim@epita.fr>
11601
11602 * data/bison.simple (b4_token_enum): New.
11603 (b4_token_defines): Use it to output tokens both as #define and
11604 enums.
11605 Suggested by Paul Eggert.
11606 * src/output.c (token_definitions_output): Don't output spurious
11607 white spaces.
11608
11609 2002-05-03 Akim Demaille <akim@epita.fr>
11610
11611 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11612
11613 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
11614
11615 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
11616 Update the stack class, give a try to deque as the default container.
11617
11618 2002-05-02 Akim Demaille <akim@epita.fr>
11619
11620 * data/bison.simple (yyparse): Do not implement @$ = @1.
11621 (YYLLOC_DEFAULT): Adjust to do it.
11622 * doc/bison.texinfo (Location Default Action): Fix.
11623
11624 2002-05-02 Akim Demaille <akim@epita.fr>
11625
11626 * src/reader.c (parse_braces): Merge into...
11627 (parse_action): this.
11628
11629 2002-05-02 Akim Demaille <akim@epita.fr>
11630
11631 * configure.in (ALL_LINGUAS): Remove.
11632 * po/LINGUAS, hr.po: New.
11633
11634 2002-05-02 Akim Demaille <akim@epita.fr>
11635
11636 Remove the so called hairy (semantic) parsers.
11637
11638 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
11639 * src/gram.h, src/gram.c (semantic_parser): Remove.
11640 (rule_t): Remove the guard and guard_line members.
11641 * src/lex.h (token_t): remove tok_guard.
11642 * src/options.c (option_table): Remove %guard and %semantic_parser
11643 support.
11644 * src/output.c, src/output.h (guards_output): Remove.
11645 (prepare): Adjust.
11646 (token_definitions_output): Don't output the `T'
11647 tokens (???).
11648 (output_skeleton): Don't output the guards.
11649 * src/files.c, src/files.c (attrsfile): Remove.
11650 * src/reader.c (symbol_list): Remove the guard and guard_line
11651 members.
11652 Adjust dependencies.
11653 (parse_guard): Remove.
11654 * data/bison.hairy: Remove.
11655 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11656 BISON_HAIRY.
11657
11658 2002-05-02 Akim Demaille <akim@epita.fr>
11659
11660 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
11661 (parse_guard): Rename the formal argument `stack_offset' as
11662 `rule_length', which is more readable.
11663 Adjust callers.
11664 (copy_at, copy_dollar): Instead of outputting the hard coded
11665 values of $$, $n and so forth, output invocation to b4_lhs_value,
11666 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
11667 Note: this patch partially drops `semantic-parser' support: it
11668 always does `rule_length - n', where semantic parsers ought to
11669 always use `-n'.
11670 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11671 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11672
11673 2002-05-02 Akim Demaille <akim@epita.fr>
11674
11675 * configure.in (AC_INIT): Bump to 1.49b.
11676 (AM_INIT_AUTOMAKE): Short invocation.
11677
11678 2002-05-02 Akim Demaille <akim@epita.fr>
11679
11680 Version 1.49a.
11681
11682 2002-05-01 Akim Demaille <akim@epita.fr>
11683
11684 * src/skeleton.h: Remove.
11685
11686 2002-05-01 Akim Demaille <akim@epita.fr>
11687
11688 * src/skeleton.h: Fix the #endif.
11689 Reported by Magnus Fromreide.
11690
11691 2002-04-26 Paul Eggert <eggert@twinsun.com>
11692
11693 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
11694 Define if we define YYSTYPE and YYLTYPE, respectively.
11695 (YYCOPY): Fix [] quoting problem in the non-GCC case.
11696
11697 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
11698
11699 * src/scan-skel.l: Postprocess quadrigraphs.
11700
11701 * src/reader.c (copy_character): New function, used to output
11702 single characters while replacing `[' and `]' with quadrigraphs, to
11703 avoid troubles with M4 quotes.
11704 (copy_comment): Output characters with copy_character.
11705 (read_additionnal_code): Likewise.
11706 (copy_string2): Likewise.
11707 (copy_definition): Likewise.
11708
11709 * tests/calc.at: Exercise M4 quoting.
11710
11711 2002-04-25 Akim Demaille <akim@epita.fr>
11712
11713 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11714 between `!' and the command.
11715 Reported by Paul Eggert.
11716
11717 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
11718
11719 * tests/calc.at: Exercise prologue splitting.
11720
11721 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11722 `b4_post_prologue' instead of `b4_prologue'.
11723
11724 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11725 muscles.
11726 (output): Free pre_prologue_obstack and post_prologue_obstack.
11727 * src/files.h, src/files.c (attrs_obstack): Remove.
11728 (pre_prologue_obstack, post_prologue_obstack): New.
11729 * src/reader.c (copy_definition): Add a parameter to specify the
11730 obstack to fill, instead of using attrs_obstack unconditionally.
11731 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11732 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11733
11734 2002-04-23 Paul Eggert <eggert@twinsun.com>
11735
11736 * data/bison.simple: Remove unnecessary commentary and white
11737 space differences from 1_29-branch.
11738 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11739
11740 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11741 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11742 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11743 constructors or destructors.
11744
11745 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11746
11747 2002-04-23 Akim Demaille <akim@epita.fr>
11748
11749 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11750 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11751 location with columns.
11752 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11753 All reported by Paul Eggert.
11754
11755 2002-04-22 Akim Demaille <akim@epita.fr>
11756
11757 * src/reduce.c (dump_grammar): Move to...
11758 * src/gram.h, src/gram.c (grammar_dump): here.
11759 Be sure to separate long item numbers.
11760 Don't read the members of a rule's prec if its nil.
11761
11762 2002-04-22 Akim Demaille <akim@epita.fr>
11763
11764 * src/output.c (table_size, table_grow): New.
11765 (MAXTABLE): Remove, replace uses with table_size.
11766 (pack_vector): Instead of dying when the table is too big, grow it.
11767
11768 2002-04-22 Akim Demaille <akim@epita.fr>
11769
11770 * data/bison.simple (yyr1): Its type is that of a token number.
11771 * data/bison.c++ (r1_): Likewise.
11772 * tests/regression.at (Web2c Actions): Adjust.
11773
11774 2002-04-22 Akim Demaille <akim@epita.fr>
11775
11776 * src/reader.c (token_translations_init): 256 is now the default
11777 value for the error token, i.e., it will be assigned another
11778 number if the user assigned 256 to one of her tokens.
11779 (reader): Don't force 256 to error.
11780 * doc/bison.texinfo (Symbols): Adjust.
11781 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11782 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11783 etc. instead of 10, 20, 30 (which was used to `jump' over error
11784 (256) and undefined (2)).
11785
11786 2002-04-22 Akim Demaille <akim@epita.fr>
11787
11788 Propagate more token_number_t.
11789
11790 * src/gram.h (token_number_as_item_number)
11791 (item_number_as_token_number): New.
11792 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11793 Use it to create output_item_number_table and
11794 output_token_number_table.
11795 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11796 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11797 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11798 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11799
11800 2002-04-22 Akim Demaille <akim@epita.fr>
11801
11802 * src/output.h, src/output.c (get_lines_number): Remove.
11803
11804 2002-04-19 Akim Demaille <akim@epita.fr>
11805
11806 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11807 as Lex/Flex'.
11808 (Debugging): More details about enabling the debugging features.
11809 (Table of Symbols): Describe $$, $n, @$, and @n.
11810 Suggested by Tim Josling.
11811
11812 2002-04-19 Akim Demaille <akim@epita.fr>
11813
11814 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11815
11816 2002-04-10 Akim Demaille <akim@epita.fr>
11817
11818 * src/system.h: Rely on HAVE_LIMITS_H.
11819 Suggested by Paul Eggert.
11820
11821 2002-04-09 Akim Demaille <akim@epita.fr>
11822
11823 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11824 full stderr, and strip it according to the bison options, instead
11825 of composing the error message from different bits.
11826 This makes it easier to check for several error messages.
11827 Adjust all the invocations.
11828 Add an invocation exercising the error token.
11829 Add an invocation demonstrating a stupid error message.
11830 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11831 Adjust the tests.
11832 Error message are for stderr, not stdout.
11833
11834 2002-04-09 Akim Demaille <akim@epita.fr>
11835
11836 * src/gram.h, src/gram.c (error_token_number): Remove, use
11837 errtoken->number.
11838 * src/reader.c (reader): Don't specify the user token number (2)
11839 for $undefined, as it uselessly prevents using it.
11840 * src/gram.h (token_number_t): Move to...
11841 * src/symtab.h: here.
11842 (state_t.number): Is a token_number_t.
11843 * src/print.c, src/reader.c: Use undeftoken->number instead of
11844 hard coded 2.
11845 (Even though this 2 is not the same as above: the number of the
11846 undeftoken remains being 2, it is its user token number which
11847 might not be 2).
11848 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11849 `user_token_number_max'.
11850 Output `undef_token_number'.
11851 * data/bison.simple, data/bison.c++: Use them.
11852 Be sure to map invalid yylex return values to
11853 `undef_token_number'. This saves us from gratuitous SEGV.
11854
11855 * tests/conflicts.at (Solved SR Conflicts)
11856 (Unresolved SR Conflicts): Adjust.
11857 * tests/regression.at (Web2c Actions): Adjust.
11858
11859 2002-04-08 Akim Demaille <akim@epita.fr>
11860
11861 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11862 Adding #line.
11863 Remove the duplicate `typedefs'.
11864 (RhsNumberType): Fix the declaration and various other typos.
11865 Use __ofile__.
11866 * data/bison.simple: Use __ofile__.
11867 * src/scan-skel.l: Handle __ofile__.
11868
11869 2002-04-08 Akim Demaille <akim@epita.fr>
11870
11871 * src/gram.h (item_number_t): New, the type of item numbers in
11872 RITEM. Note that it must be able to code symbol numbers as
11873 positive number, and the negation of rule numbers as negative
11874 numbers.
11875 Adjust all dependencies (pretty many).
11876 * src/reduce.c (rule): Remove this `short *' pointer: use
11877 item_number_t.
11878 * src/system.h (MINSHORT, MAXSHORT): Remove.
11879 Include `limits.h'.
11880 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
11881 (shortcpy): Remove.
11882 (MAXTABLE): Move to...
11883 * src/output.c (MAXTABLE): here.
11884 (prepare_rules): Use output_int_table to output rhs.
11885 * data/bison.simple, data/bison.c++: Adjust.
11886 * tests/torture.at (Big triangle): Move the limit from 254 to
11887 500.
11888 * tests/regression.at (Web2c Actions): Ajust.
11889
11890 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
11891 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
11892 passes, but produces negative #line number, once fixed, GCC is
11893 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
11894 C), it passes.
11895 * src/state.h (state_h): Code input lines on ints, not shorts.
11896
11897 2002-04-08 Akim Demaille <akim@epita.fr>
11898
11899 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11900 and then the grammar.
11901
11902 2002-04-08 Akim Demaille <akim@epita.fr>
11903
11904 * src/system.h: No longer using strndup.
11905
11906 2002-04-07 Akim Demaille <akim@epita.fr>
11907
11908 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
11909 * src/output.c (output_table_data): Return the longest number.
11910 (prepare_tokens): Output `token_number_max').
11911 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
11912 New.
11913 Use them to define yy_token_number_type/TokenNumberType.
11914 Use this type for yytranslate.
11915 * tests/torture.at (Big triangle): Push the limit from 124 to
11916 253.
11917 * tests/regression.at (Web2c Actions): Adjust.
11918
11919 2002-04-07 Akim Demaille <akim@epita.fr>
11920
11921 * tests/torture.at (Big triangle): New.
11922 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11923 * tests/existing.at: here.
11924
11925 2002-04-07 Akim Demaille <akim@epita.fr>
11926
11927 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11928 nritems.
11929 Adjust dependencies.
11930
11931 2002-04-07 Akim Demaille <akim@epita.fr>
11932
11933 * src/reader.c: Normalize increments to prefix form.
11934
11935 2002-04-07 Akim Demaille <akim@epita.fr>
11936
11937 * src/reader.c, symtab.c: Remove debugging code.
11938
11939 2002-04-07 Akim Demaille <akim@epita.fr>
11940
11941 Rename all the `bucket's as `symbol_t'.
11942
11943 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
11944 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
11945 * src/symtab.c, src/symtab.h (bucket): Rename as...
11946 (symbol_t): this.
11947 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11948 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11949 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11950 (buckets_new, buckets_free, buckets_do): Rename as...
11951 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11952 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11953 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11954 (symbols_new, symbols_free, symbols_do): these.
11955
11956 2002-04-07 Akim Demaille <akim@epita.fr>
11957
11958 Use lib/hash for the symbol table.
11959
11960 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11961 EOF.
11962 * src/lex.c (lex): Set the `number' member of new terminals.
11963 * src/reader.c (bucket_check_defined, bucket_make_alias)
11964 (bucket_check_alias_consistence, bucket_translation): New.
11965 (reader, grammar_free, readgram, token_translations_init)
11966 (packsymbols): Adjust.
11967 (reader): Number the predefined tokens.
11968 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11969 for predefined tokens.
11970 * src/symtab.h (bucket): Remove all the hash table related
11971 members.
11972 * src/symtab.c (symtab): Replace by...
11973 (bucket_table): this.
11974 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11975 (buckets_new, buckets_do): New.
11976
11977 2002-04-07 Akim Demaille <akim@epita.fr>
11978
11979 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11980 (start_symbol, max_user_token_number, semantic_parser)
11981 (error_token_number): Initialize.
11982 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11983 Initialize.
11984 (reader): Don't.
11985 (errtoken, eoftoken, undeftoken, axiom): Extern.
11986
11987 2002-04-07 Akim Demaille <akim@epita.fr>
11988
11989 * src/gram.h (rule_s): prec and precsym are now pointers
11990 to the bucket giving the priority/associativity.
11991 Member `associativity' removed: useless.
11992 * src/reduce.c, src/conflicts.c: Adjust.
11993
11994 2002-04-07 Akim Demaille <akim@epita.fr>
11995
11996 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
11997 Properly escape the symbols' TAG when outputting them.
11998
11999 2002-04-07 Akim Demaille <akim@epita.fr>
12000
12001 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12002
12003 2002-04-07 Akim Demaille <akim@epita.fr>
12004
12005 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12006 (LArule): this, which is an array to rule_t*.
12007 * src/print.c, src/conflicts.c: Adjust.
12008
12009 2002-04-07 Akim Demaille <akim@epita.fr>
12010
12011 * src/gram.h (rule_t): Rename `number' as `user_number'.
12012 `number' is a new member.
12013 Adjust dependencies.
12014 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12015
12016 2002-04-07 Akim Demaille <akim@epita.fr>
12017
12018 As a result of the previous patch, it is no longer needed
12019 to reorder ritem itself.
12020
12021 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12022
12023 2002-04-07 Akim Demaille <akim@epita.fr>
12024
12025 Be sure never to walk through RITEMS, but use only data related to
12026 the rules themselves. RITEMS should be banished.
12027
12028 * src/output.c (output_token_translations): Rename as...
12029 (prepare_tokens): this.
12030 In addition to `translate', prepare the muscles `tname' and
12031 `toknum', which were handled by...
12032 (output_rule_data): this.
12033 Remove, and move the remainder of its outputs into...
12034 (prepare_rules): this new routines, which also merges content from
12035 (output_gram): this.
12036 (prepare_rules): Be sure never to walk through RITEMS.
12037 (output_stos): Rename as...
12038 (prepare_stos): this.
12039 (output): Always invoke prepare_states, after all, just don't use it
12040 in the output if you don't need it.
12041
12042 2002-04-07 Akim Demaille <akim@epita.fr>
12043
12044 * src/LR0.c (new_state): Display `nstates' as the name of the
12045 newly created state.
12046 Adjust to initialize first_state and last_state if needed.
12047 Be sure to distinguish the initial from the final state.
12048 (new_states): Create the itemset of the initial state, and use
12049 new_state.
12050 * src/closure.c (closure): Now that the initial state has its
12051 items properly set, there is no need for a special case when
12052 creating `ruleset'.
12053
12054 As a result, now the rule 0, reducing to $axiom, is visible in the
12055 outputs. Adjust the test suite.
12056
12057 * tests/conflicts.at (Solved SR Conflicts)
12058 (Unresolved SR Conflicts): Adjust.
12059 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12060 * tests/conflicts.at (S/R in initial): New.
12061
12062 2002-04-07 Akim Demaille <akim@epita.fr>
12063
12064 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12065 the RHS of the rules.
12066 * src/output.c (output_gram): Likewise.
12067
12068 2002-04-07 Akim Demaille <akim@epita.fr>
12069
12070 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12071 bucket.
12072 Adjust all dependencies.
12073 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12074 `number' of the buckets too.
12075 * src/gram.h: Include `symtab.h'.
12076 (associativity): Move to...
12077 * src/symtab.h: here.
12078 No longer include `gram.h'.
12079
12080 2002-04-07 Akim Demaille <akim@epita.fr>
12081
12082 * src/gram.h, src/gram.c (rules_rhs_length): New.
12083 (ritem_longest_rhs): Use it.
12084 * src/gram.h (rule_t): `number' is a new member.
12085 * src/reader.c (packgram): Set it.
12086 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12087 the end of `rules', and count them out of `nrules'.
12088 (reduce_output, dump_grammar): Adjust.
12089 * src/print.c (print_grammar): It is no longer needed to check for
12090 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12091 * tests/reduce.at (Reduced Automaton): New test.
12092
12093 2002-04-07 Akim Demaille <akim@epita.fr>
12094
12095 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12096 lacking `+ 1' to nrules, Bison reported as useless a token if it
12097 was used solely to set the precedence of the last rule...
12098
12099 2002-04-07 Akim Demaille <akim@epita.fr>
12100
12101 * data/bison.c++, data/bison.simple: Don't output the current file
12102 name in #line, to avoid useless diffs between two identical
12103 outputs under different names.
12104
12105 2002-04-07 Akim Demaille <akim@epita.fr>
12106
12107 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12108 Normalize loops to using `< nrules + 1', not `<= nrules'.
12109
12110 2002-04-07 Akim Demaille <akim@epita.fr>
12111
12112 * TODO: Update.
12113
12114 2002-04-07 Akim Demaille <akim@epita.fr>
12115
12116 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12117 bucket.value as bucket.number.
12118
12119 2002-04-07 Akim Demaille <akim@epita.fr>
12120
12121 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12122 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12123 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12124 RHS, instead of being an index in RITEMS.
12125
12126 2002-04-04 Paul Eggert <eggert@twinsun.com>
12127
12128 * doc/bison.texinfo: Update copyright date.
12129 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12130 (Symbols): Warn about running Bison in one character set,
12131 but compiling and/or running in an incompatible one.
12132 Warn about character code 256, too.
12133
12134 2002-04-03 Paul Eggert <eggert@twinsun.com>
12135
12136 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12137 YYERROR_VERBOSE is nonzero, not whether it is defined.
12138
12139 Merge changes from bison-1_29-branch.
12140
12141 2002-03-20 Paul Eggert <eggert@twinsun.com>
12142
12143 Merge fixes from Debian bison_1.34-1.diff.
12144
12145 * configure.in (AC_PREREQ): 2.53.
12146
12147 2002-03-20 Akim Demaille <akim@epita.fr>
12148
12149 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12150
12151 2002-03-19 Paul Eggert <eggert@twinsun.com>
12152
12153 * src/bison.simple (YYCOPY): New macro.
12154 (YYSTACK_RELOCATE): Use it.
12155 Remove Type arg; no longer needed. All callers changed.
12156 (yymemcpy): Remove; no longer needed.
12157
12158 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12159 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12160
12161 2002-03-19 Akim Demaille <akim@epita.fr>
12162
12163 Test and fix the #line outputs.
12164
12165 * tests/atlocal.at (GCC): New.
12166 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
12167 (Prologue synch line, %union synch line, Postprologue synch line)
12168 (Action synch line, Epilogue synch line): New tests.
12169 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12170 * data/bison.simple, data/bison.c++: Use it.
12171
12172 2002-03-19 Akim Demaille <akim@epita.fr>
12173
12174 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12175 (Solved SR Conflicts, %expect not enough, %expect right)
12176 (%expect too much): Move to...
12177 * tests/conflicts.at: this new file.
12178
12179 2002-03-19 Akim Demaille <akim@epita.fr>
12180
12181 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12182 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12183 that we can move to enums for instance.
12184 * src/output.c (token_definitions_output): Output a list of
12185 `token-name, token-number' instead of the #define.
12186 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12187
12188 2002-03-14 Akim Demaille <akim@epita.fr>
12189
12190 Use Gettext 0.11.1.
12191
12192 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
12193
12194 * data/bison.c++: Make the user able to add members to the generated
12195 parser by subclassing.
12196
12197 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
12198
12199 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12200 a character.
12201 Reported by Nicolas Tisserand and Nicolas Burrus.
12202
12203 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12204
12205 * src/reader.c: Warn about lacking semi-colons, do not complain.
12206
12207 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12208
12209 * data/bison.c++: Remove a debug line.
12210
12211 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12212
12213 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12214 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12215 provide a default implementation.
12216
12217 2002-03-04 Akim Demaille <akim@epita.fr>
12218
12219 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12220 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12221 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12222 * tests/semantic.at (Parsing Guards): Similarly.
12223 * src/reader.at (readgram): Complain if the last rule is not ended
12224 with a semi-colon.
12225
12226 2002-03-04 Akim Demaille <akim@epita.fr>
12227
12228 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12229 * src/closure.c: here.
12230 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12231 RTC.
12232 * src/warshall.h, src/warshall.c: Remove.
12233 * tests/sets.at (Broken Closure): Adjust.
12234
12235 2002-03-04 Akim Demaille <akim@epita.fr>
12236
12237 * src/output.c (output_skeleton): tempdir is const.
12238 bytes_read is unused.
12239
12240 2002-03-04 Akim Demaille <akim@epita.fr>
12241
12242 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12243 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12244 Update.
12245 From Michael Hayes.
12246
12247 2002-03-04 Akim Demaille <akim@epita.fr>
12248
12249 * src/closure.c (closure): `r' is unused.
12250
12251 2002-03-04 Akim Demaille <akim@epita.fr>
12252
12253 * tests/sets.at (Broken Closure): Add the ending `;'.
12254 * src/reader.at (readgram): Complain if a rule is not ended with a
12255 semi-colon.
12256
12257 2002-03-04 Akim Demaille <akim@epita.fr>
12258
12259 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12260 (count_sr_conflicts): Use bitset_count.
12261 * src/reduce.c (inaccessable_symbols): Ditto.
12262 (bits_size): Remove.
12263 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12264
12265 2002-03-04 Akim Demaille <akim@epita.fr>
12266
12267 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12268 * src/reduce.c: Remove the `bitset_zero's following the
12269 `bitset_create's, as now it is performed by the latter.
12270
12271 2002-03-04 Akim Demaille <akim@epita.fr>
12272
12273 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12274 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12275 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12276 latest sources from Michael.
12277
12278 2002-03-04 Akim Demaille <akim@epita.fr>
12279
12280 * src/output.c (output): Don't free the grammar.
12281 * src/reader.c (grammar_free): New.
12282 * src/main.c (main): Call it and don't free symtab here.
12283
12284 2002-03-04 Akim Demaille <akim@epita.fr>
12285
12286 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12287 before returning.
12288 Reported by Benoit Perrot.
12289
12290 2002-03-04 Akim Demaille <akim@epita.fr>
12291
12292 Use bitset operations when possible, not loops over bits.
12293
12294 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12295 bitset_or.
12296 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12297 * src/reduce.c (useless_nonterminals): Formatting changes.
12298 * src/warshall.c (TC): Use bitset_or.
12299
12300 2002-03-04 Akim Demaille <akim@epita.fr>
12301
12302 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12303 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12304 Ditto.
12305
12306 2002-03-04 Akim Demaille <akim@epita.fr>
12307
12308 * src/lalr.c (F): Now a bitset*.
12309 Adjust all dependencies.
12310
12311 2002-03-04 Akim Demaille <akim@epita.fr>
12312
12313 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12314 Adjust all dependencies.
12315
12316 2002-03-04 Akim Demaille <akim@epita.fr>
12317
12318 * src/L0.c, src/LR0.h (nstates): Be size_t.
12319 Adjust comparisons (signed vs unsigned).
12320 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12321 bitset*.
12322 Adjust all dependencies.
12323
12324 2002-03-04 Akim Demaille <akim@epita.fr>
12325
12326 * src/closure.c (firsts): Now, also a bitset.
12327 Adjust all dependencies.
12328 (varsetsize): Remove, now unused.
12329 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12330
12331 2002-03-04 Akim Demaille <akim@epita.fr>
12332
12333 * src/print.c: Convert to use bitset.h, not hand coded iterations
12334 over ints.
12335
12336 2002-03-04 Akim Demaille <akim@epita.fr>
12337
12338 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12339
12340 2002-03-04 Akim Demaille <akim@epita.fr>
12341
12342 * src/closure.c (ruleset): Be a bitset.
12343 (rulesetsize): Remove.
12344
12345 2002-03-04 Akim Demaille <akim@epita.fr>
12346
12347 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12348 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12349 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12350 * src/closure.c (fderives): Be an array of bitsets.
12351
12352 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
12353
12354 * data/bison.c++: Merge the two generated headers. Insert a copyright
12355 notice in each output file.
12356
12357 2002-02-28 Akim Demaille <akim@epita.fr>
12358
12359 * data/bison.c++: Copy the prologue of bison.simple to fetch
12360 useful M4 definitions, such as b4_header_guard.
12361
12362 2002-02-25 Akim Demaille <akim@epita.fr>
12363
12364 * src/getargs.c (version): Give the name of the authors, and use a
12365 translator friendly scheme for the bgr
12366 copyright notice.
12367
12368 2002-02-25 Akim Demaille <akim@epita.fr>
12369
12370 * src/output.c (header_output): Remove, now handled completely via
12371 M4.
12372
12373 2002-02-25 Akim Demaille <akim@epita.fr>
12374
12375 * m4/m4.m4: New, from CVS Autoconf.
12376 * configure.in: Invoke it.
12377 * src/output.c (output_skeleton): Use its result instead of the
12378 hard coded name.
12379
12380 2002-02-25 Akim Demaille <akim@epita.fr>
12381
12382 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12383 Fileutils 4.1.5.
12384 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12385 * src/output.c (output_skeleton): Use mkstemp to create a real
12386 temporary file.
12387 Move the filling of `skeleton' and its muscle to...
12388 (prepare): here.
12389 (output): Move the definition of the prologue muscle to...
12390 (prepare): here.
12391 * src/system.h (DEFAULT_TMPDIR): New.
12392
12393 2002-02-14 Paul Eggert <eggert@twinsun.com>
12394
12395 Remove the support for C++ namespace cleanliness; it was
12396 causing more problems than it was curing, since it didn't work
12397 properly on some nonstandard C++ compilers. This can wait
12398 for a proper C++ parser.
12399
12400 * NEWS: Document this.
12401 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12402 of C++, as it's treated like C now.
12403 * src/bison.simple (YYSTD): Remove.
12404 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12405 Treat C++ just like Standard C instead of trying to support
12406 namespace cleanliness.
12407
12408 2002-02-14 Akim Demaille <akim@epita.fr>
12409
12410 * tests/regression.at (else): Adjust to Andreas' change.
12411
12412 2002-02-14 Akim Demaille <akim@epita.fr>
12413
12414 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12415
12416 2002-02-13 Andreas Schwab <schwab@suse.de>
12417
12418 * src/output.c (output_rule_data): Don't output NULL, it might
12419 not be defined yet.
12420
12421 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
12422
12423 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12424 (Copyright notice): Update.
12425
12426 2002-02-11 Akim Demaille <akim@epita.fr>
12427
12428 * tests/regression.at (%nonassoc and eof): Don't include
12429 nonportable headers.
12430
12431 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
12432
12433 * data/bison.c++: Correct error recovery. Make the user able to
12434 initialize the starting location.
12435
12436 2002-02-07 Akim Demaille <akim@epita.fr>
12437
12438 * tests/input.at: New.
12439
12440 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12441
12442 * data/bison.c++: Replace some direct m4 expansions by constants. Be
12443 more consistent when naming methods and variables. Put preprocessor
12444 directives around tables only needed for debugging.
12445
12446 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12447
12448 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12449 C++ parsers.
12450 (yy::b4_name::parse): Use print_.
12451
12452 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12453
12454 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12455
12456 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12457
12458 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12459 C++ parsers.
12460 (yy::b4_name::parse): Build verbose error messages, and use error_.
12461
12462 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12463
12464 * data/bison.c++: Fix m4 quoting in comments.
12465
12466 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12467
12468 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12469 not expanded by m4.
12470
12471 2002-02-05 Akim Demaille <akim@epita.fr>
12472
12473 * data/bison.c++: Adjust to the M4 back end.
12474 More is certainly needed.
12475
12476 2002-02-05 Akim Demaille <akim@epita.fr>
12477
12478 Give a try to M4 as a back end.
12479
12480 * lib/readpipe.c: New, from wdiff.
12481 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12482 BISON_HAIRY.
12483 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12484 specific values. Now it is m4 that performs the lookup.
12485 * src/parse-skel.y: Remove.
12486 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12487 * src/output.c (actions_output, guards_output)
12488 (token_definitions_output): No longer keeps track of the output
12489 line number, hence remove the second argument.
12490 (guards_output): Check against the guard member of a rule, not the
12491 action member.
12492 Adjust callers.
12493 (output_skeleton): Don't look for the skeleton location, let m4 do
12494 that.
12495 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12496 file will be used.
12497 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12498 (prepare): Given that for the time being changesyntax is not
12499 usable in M4, rename the muscles using `-' to `_'.
12500 Define `defines_flag', `output_parser_name' and `output_header_name'.
12501 * src/output.h (actions_output, guards_output)
12502 (token_definitions_output): Adjust prototypes.
12503 * src/scan-skel.l: Instead of scanning the skeletons, it now
12504 processes the output of m4: `__oline__' and `#output'.
12505 * data/bison.simple: Adjust to be used by M4(sugar).
12506 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12507 to date.
12508 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12509 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12510 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12511 shamelessly stolen from CVS Autoconf.
12512
12513 2002-02-05 Akim Demaille <akim@epita.fr>
12514
12515 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12516 * configure.in: Check for the declarations of free and malloc.
12517 * src/muscle_tab.c: Adjust.
12518
12519 2002-02-05 Akim Demaille <akim@epita.fr>
12520
12521 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12522 which have no values.
12523
12524 2002-02-05 Akim Demaille <akim@epita.fr>
12525
12526 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12527 * data/: here.
12528
12529 2002-01-29 Paul Eggert <eggert@twinsun.com>
12530
12531 * src/bison.simple (YYSIZE_T): Do not define merely because
12532 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12533 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12534
12535 2002-01-27 Akim Demaille <akim@epita.fr>
12536
12537 Fix `%nonassoc and eof'.
12538
12539 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12540 which were not properly copied! Replace
12541 memcpy (res->errs, src->errs, src->nerrs);
12542 with
12543 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12544 !!!
12545 * tests/regression.at (%nonassoc and eof): Adjust to newest
12546 Autotest: `.' is not in the PATH.
12547
12548 2002-01-27 Akim Demaille <akim@epita.fr>
12549
12550 * tests/sets.at (AT_EXTRACT_SETS): New.
12551 (Nullable): Use it.
12552 (Firsts): New.
12553
12554 2002-01-26 Akim Demaille <akim@epita.fr>
12555
12556 * tests/actions.at, tests/calc.at, tests/headers.at,
12557 * tests/torture.at: Adjust to the newest Autotest which no longer
12558 forces `.' in the PATH.
12559
12560 2002-01-25 Akim Demaille <akim@epita.fr>
12561
12562 * tests/regression.at (%nonassoc and eof): New.
12563 Suggested by Robert Anisko.
12564
12565 2002-01-24 Akim Demaille <akim@epita.fr>
12566
12567 Bison dumps core when trying to complain about broken input files.
12568 Reported by Cris van Pelt.
12569
12570 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12571 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12572 into...
12573 (Invalid inputs): Strengthen: exercise parse_percent_token.
12574
12575 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
12576
12577 * src/Makefile.am: Add bison.c++.
12578 * src/bison.c++: New skeleton.
12579
12580 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
12581
12582 * po/it.po: New.
12583
12584 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12585
12586 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12587
12588 2002-01-20 Marc Autret <marc@gnu.org>
12589
12590 * src/files.c (compute_output_file_names): Fix
12591
12592 2002-01-20 Marc Autret <marc@gnu.org>
12593
12594 * tests/output.at: New test.
12595 * src/files.c (compute_base_names): Don't map extensions when
12596 the YACC flag is set, use defaults.
12597 Reported by Evgeny Stambulchik.
12598
12599 2002-01-20 Marc Autret <marc@gnu.org>
12600
12601 * src/system.h: Need to define __attribute__ away for non-GCC
12602 compilers as well (i.e., the vendor C compiler).
12603 Suggested by Albert Chin-A-Young.
12604
12605 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12606
12607 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
12608 canonical definition.
12609 * src/system.h: Use the canonical definition for PARAMS (avoids
12610 a conflict with the macro from lib/hash.h).
12611
12612 2002-01-11 Akim Demaille <akim@epita.fr>
12613
12614 * configure.in: Use AC_FUNC_STRNLEN.
12615 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
12616
12617 2002-01-09 Akim Demaille <akim@epita.fr>
12618
12619 * src/files.c, src/files.h (output_infix): New.
12620 (tab_extension): Remove.
12621 (compute_base_names): Compute the former, drop the latter.
12622 * src/output.c (prepare): Insert the muscles `output-infix', and
12623 `output-suffix'.
12624 * src/parse-skel.y (string, string.1): New.
12625 (section.header): Use it.
12626 (section.yacc): Remove.
12627 (prefix): Remove too.
12628 * src/scan-skel.l: Adjust.
12629 * src/bison.simple, src/bison.hairy: Adjust.
12630
12631 2002-01-09 Akim Demaille <akim@epita.fr>
12632
12633 * configure.in (WERROR_CFLAGS): Compute it.
12634 * src/Makefile.am (CFLAGS): Pass it.
12635 * tests/atlocal.in (CFLAGS): Idem.
12636 * src/files.c: Fix a few warnings.
12637 (get_extension_index): Remove, unused.
12638
12639 2002-01-08 Akim Demaille <akim@epita.fr>
12640
12641 * src/getargs.c (AS_FILE_NAME): New.
12642 (getargs): Use it to convert DOSish file names.
12643 * src/files.c (base_name): Rename as full_base_name to avoid
12644 clashes with `base_name ()'.
12645 (filename_split): New.
12646 (compute_base_names): N-th rewrite, using filename_split.
12647
12648 2002-01-08 Akim Demaille <akim@epita.fr>
12649
12650 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
12651 New, stolen from the Fileutils 4.1.
12652 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12653 * configure.in: Check for the presence of memrchr, and of its
12654 prototype.
12655
12656 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12657
12658 * lib/hash.h (__P): Added definition for this macro.
12659 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
12660 BUILT_SOURCES, to ensure they are generated first.
12661 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
12662 %error-verbose to allow bootstrapping with bison 1.30x.
12663
12664 2002-01-06 Akim Demaille <akim@epita.fr>
12665
12666 * src/reader.c (parse_braces): Don't fetch the next char, the
12667 convention is to fetch on entry.
12668 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
12669 'switch' without a following semicolon.
12670 * tests/regression.at (braces parsing): New.
12671
12672 2002-01-06 Akim Demaille <akim@epita.fr>
12673
12674 Bison is dead wrong in its RR conflict reports.
12675
12676 * tests/torture.at (GNU Cim Grammar): New.
12677 * src/conflicts.c (count_rr_conflicts): Fix.
12678
12679 2002-01-06 Akim Demaille <akim@epita.fr>
12680
12681 Creating package.m4 from configure.ac causes too many problems.
12682
12683 * tests/Makefile.am (package.m4): Create it by hand,
12684 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12685
12686 2002-01-06 Akim Demaille <akim@epita.fr>
12687
12688 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12689 skeleton.h.
12690
12691 2002-01-04 Paul Eggert <eggert@twinsun.com>
12692
12693 * doc/bison.texinfo (Debugging):
12694 Remove YYSTDERR; it's no longer defined or used.
12695 Also, s/cstdio.h/cstdio/.
12696
12697 2002-01-03 Akim Demaille <akim@epita.fr>
12698
12699 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12700
12701 2002-01-03 Akim Demaille <akim@epita.fr>
12702
12703 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12704 tracing code to --trace, wait for a better --trace option, with
12705 args.
12706
12707 2002-01-03 Akim Demaille <akim@epita.fr>
12708
12709 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12710 The ISO C++ standard is extremely clear about it: stderr is
12711 considered a macro, not a regular symbol (see table 94 `Header
12712 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12713 Therefore std:: does not apply to it. It still does with fprintf.
12714 Also, s/cstdio.h/cstdio/.
12715
12716 2002-01-03 Akim Demaille <akim@epita.fr>
12717
12718 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12719 for non system headers.
12720
12721 2002-01-02 Akim Demaille <akim@epita.fr>
12722
12723 Equip the skeleton chain with location tracking, runtime trace,
12724 pure parser and scanner.
12725
12726 * src/parse-skel.y: Request a pure parser, locations, and prefix
12727 renaming.
12728 (%union): Having several members with the same type does not help
12729 type mismatches, simplify.
12730 (YYPRINT, yyprint): New.
12731 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12732 (skel_error): this.
12733 Handle locations.
12734 * src/scan-skel.l: Adjust to these changes.
12735 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12736 (LOCATION_PRINT, skel_control_t): New.
12737
12738 2001-12-30 Akim Demaille <akim@epita.fr>
12739
12740 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12741 replace `gb' with BLANKS.
12742 * src/scan-skel.l: Adjust.
12743
12744 2001-12-30 Akim Demaille <akim@epita.fr>
12745
12746 * src/system.h: We don't need nor want bcopy.
12747 Throw away MS-DOS crap: we don't need getpid.
12748 * configure.in: We don't need strndup. It was even causing
12749 problems: because Flex includes the headers *before* us,
12750 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12751 not visible.
12752 * lib/xstrndup.c: New.
12753 * src/scan-skel.l: Use it.
12754 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12755 * src/parse-skel.y: Use %directives instead of #defines.
12756
12757 2001-12-30 Akim Demaille <akim@epita.fr>
12758
12759 * src/skeleton.h: New.
12760 * src/output.c (output_parser, output_master_parser): Remove, dead
12761 code.
12762 * src/output.h (get_lines_number, actions_output, guards_output)
12763 (token_definitions_output): Prototype them.
12764 * src/parse-skel.y: Add the license notice.
12765 Include output.h and skeleton.h.
12766 (process_skeleton): Returns void, and takes a single parameter.
12767 * src/scan-skel.l: Add the license notice.
12768 Include skeleton.h.
12769 Don't use %option yylineno: it seems that then Flex imagines
12770 REJECT has been used, and therefore it won't reallocate its
12771 buffers (which makes no other sense to me than a bug). It results
12772 in warnings for `unused: yy_flex_realloc'.
12773
12774 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
12775
12776 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12777 (MUSCLE_INSERT_PREFIX): ...to there.
12778 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12779 (MUSCLE_INSERT_PREFIX): Move from here...
12780
12781 * src/bison.hairy: Add a section directive. Put braces around muscle
12782 names. This parser skeleton is still broken, but Bison should not
12783 choke on a bad muscle 'syntax'.
12784 * src/bison.simple: Add a section directive. Put braces around muscle
12785 names.
12786
12787 * src/files.h (strsuffix, stringappend): Add declarations.
12788 (tab_extension): Add declaration.
12789 (short_base_name): Add declaration.
12790
12791 * src/files.c (strsuffix, stringappend): No longer static. These
12792 functions are used in the skeleton parser.
12793 (tab_extension): New.
12794 (compute_base_names): Use the computations done in this function
12795 to guess if the generated parsers should have '.tab' in their
12796 names.
12797 (short_base_name): No longer static.
12798
12799 * src/output.c (output_skeleton): New.
12800 (output): Disable call to output_master_parser, and give a try to
12801 a new skeleton handling system.
12802 (guards_output, actions_output): No longer static.
12803 (token_definitions_output, get_lines_number): No longer static.
12804
12805 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12806
12807 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
12808 parse-skel.y.
12809
12810 * src/parse-skel.y: New file.
12811 * src/scan-skel.l: New file.
12812
12813 2001-12-29 Akim Demaille <akim@epita.fr>
12814
12815 %name-prefix is broken.
12816
12817 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12818 Adjust all dependencies.
12819 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12820 %name-prefix.
12821
12822 Renaming yylval but not yylloc is not consistent. Now we do.
12823
12824 * src/bison.simple: Prefix yylloc if used.
12825 * doc/bison.texinfo (Decl Summary): Document that.
12826
12827 2001-12-29 Akim Demaille <akim@epita.fr>
12828
12829 * doc/bison.texinfo: Promote `%long-directive' over
12830 `%long_directive'.
12831 Remove all references to fixed-output-files, yacc is enough.
12832
12833 2001-12-29 Akim Demaille <akim@epita.fr>
12834
12835 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12836 user prologue. These are defaults.
12837 * tests/actions.at (Mid-rule actions): Make sure the user can
12838 define YYDEBUG and YYERROR_VERBOSE.
12839
12840 2001-12-29 Akim Demaille <akim@epita.fr>
12841
12842 * src/output.c (header_output): Don't forget to export YYLTYPE and
12843 yylloc.
12844 * tests/headers.at (export YYLTYPE): New, make sure it does.
12845 * tests/regression.at (%union and --defines, Invalid CPP headers):
12846 Move to...
12847 * tests/headers.at: here.
12848
12849 2001-12-29 Akim Demaille <akim@epita.fr>
12850
12851 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12852
12853 2001-12-29 Akim Demaille <akim@epita.fr>
12854
12855 * tests/actions.at (Mid-rule actions): Output on a single line
12856 instead of several.
12857
12858 2001-12-29 Akim Demaille <akim@epita.fr>
12859
12860 * doc/bison.texinfo: Formatting changes.
12861
12862 2001-12-29 Akim Demaille <akim@epita.fr>
12863
12864 Don't store the token defs in a muscle, just be ready to output it
12865 on command. Now possible via `symbols'. Fixes a memory leak.
12866
12867 * src/output.c (token_definitions_output): New.
12868 (output_parser, header_output): Use it.
12869 * src/reader.c (symbols_save): Remove.
12870
12871 2001-12-29 Akim Demaille <akim@epita.fr>
12872
12873 * src/bison.simple: Do not provide a default for YYSTYPE and
12874 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12875 default.
12876
12877 2001-12-29 Akim Demaille <akim@epita.fr>
12878
12879 Mid-rule actions are simply... ignored!
12880
12881 * src/reader.c (readgram): Be sure to attach mid-rule actions to
12882 the empty-rule associated to the dummy symbol, not to the host
12883 rule.
12884 * tests/actions.at (Mid-rule actions): New.
12885
12886 2001-12-29 Akim Demaille <akim@epita.fr>
12887
12888 Memory leak.
12889
12890 * src/reader.c (reader): Free grammar.
12891
12892 2001-12-29 Akim Demaille <akim@epita.fr>
12893
12894 Memory leak.
12895
12896 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12897 since it allocates it for each state, although only one is needed.
12898 (allocate_storage): Do it here.
12899
12900 2001-12-29 Akim Demaille <akim@epita.fr>
12901
12902 * src/options.h, src/options.c (create_long_option_table): Rename
12903 as...
12904 (long_option_table_new): this, with a clearer prototype.
12905 (percent_table): Remove, unused,
12906 * src/getargs.c (getargs): Adjust.
12907
12908 2001-12-29 Akim Demaille <akim@epita.fr>
12909
12910 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
12911 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
12912 as states.
12913
12914 2001-12-29 Akim Demaille <akim@epita.fr>
12915
12916 * src/lalr.c (build_relations): Rename `states' as `states1'.
12917 Sorry, I don't understand exactly what it is, no better name...
12918
12919 2001-12-29 Akim Demaille <akim@epita.fr>
12920
12921 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
12922 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
12923 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12924 as rules.
12925
12926 2001-12-29 Akim Demaille <akim@epita.fr>
12927
12928 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12929 ago.
12930
12931 2001-12-29 Akim Demaille <akim@epita.fr>
12932
12933 * src/reader.c, src/reader.h (user_toknums): Remove.
12934 Adjust all users to use symbols[i]->user_token_number.
12935
12936 2001-12-29 Akim Demaille <akim@epita.fr>
12937
12938 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12939 Adjust all users to use symbols[i]->prec or ->assoc.
12940
12941 2001-12-29 Akim Demaille <akim@epita.fr>
12942
12943 * src/reader.c, src/reader.h (tags): Remove.
12944 Adjust all users to use symbols[i]->tag.
12945
12946 2001-12-29 Akim Demaille <akim@epita.fr>
12947
12948 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12949 and rule_table.
12950 * src/reader.c (packsymbols): Fill this table.
12951 Drop sprec.
12952 * src/conflicts.c (resolve_sr_conflict): Adjust.
12953 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12954 single table.
12955 Use symbols[i]->tag instead of tags[i].
12956
12957 2001-12-29 Akim Demaille <akim@epita.fr>
12958
12959 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12960 In addition, put a comment in there, to replace...
12961 * tests/regression.at (%union and C comments): Remove.
12962
12963 2001-12-29 Akim Demaille <akim@epita.fr>
12964
12965 * tests/regression.at (Web2c Actions): Blindly move the actual
12966 output as expected output. The contents *seem* right to me, but I
12967 can't pretend reading perfectly parser tables... Nonetheless, all
12968 the other tests pass correctly, the table look OK, even though the
12969 presence of `$axiom' is to be noted: AFAICS it is useless (but
12970 harmless).
12971
12972 2001-12-29 Akim Demaille <akim@epita.fr>
12973
12974 * src/reader.c (readgram): Don't add the rule 0 if there were no
12975 rules read. In other words, add it _after_ having performed
12976 grammar sanity checks.
12977 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12978
12979 2001-12-29 Akim Demaille <akim@epita.fr>
12980
12981 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12982 visible, and some states have now a different number.
12983
12984 2001-12-29 Akim Demaille <akim@epita.fr>
12985
12986 * src/reader.c (readgram): Bind the initial rule's lineno to that
12987 of the first rule.
12988 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12989 (Solved SR Conflicts): Adjust rule 0's line number.
12990
12991 2001-12-29 Akim Demaille <akim@epita.fr>
12992
12993 Fix the `GAWK Grammar' failure.
12994
12995 * src/LR0.c (final_state): Initialize to -1 so that we do compute
12996 the reductions of the first state which was mistakenly confused
12997 with the final state because precisely final_state was initialized
12998 to 0.
12999 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13000 now noticed by Bison.
13001 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13002 have a reduction on $default.
13003
13004 2001-12-29 Akim Demaille <akim@epita.fr>
13005
13006 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13007 rule line numbers.
13008 * src/closure.c (print_closure): Likewise.
13009 * src/derives.c (print_derives): Likewise.
13010 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13011 now.
13012
13013 2001-12-29 Akim Demaille <akim@epita.fr>
13014
13015 * src/lalr.c (lookaheads_print): New.
13016 (lalr): Call it when --trace-flag.
13017 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13018 are dumped.
13019
13020 2001-12-29 Akim Demaille <akim@epita.fr>
13021
13022 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13023 when walking through ritem, even via rule->rhs.
13024 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13025 (useful_production, useless_nonterminals): Likewise.
13026 (reduce_grammar_tables): Likewise, plus update nritems.
13027 * src/nullable.c (set_nullable): Likewise.
13028 * src/lalr.c (build_relations): Likewise.
13029 * tests/sets.at (Nullable): Adjust.
13030 Fortunately, now, the $axiom is no longer nullable.
13031
13032 2001-12-29 Akim Demaille <akim@epita.fr>
13033
13034 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13035 the 0-sentinel.
13036 * src/gram.c (ritem_longest_rhs): Likewise.
13037 * src/reduce.c (nonterminals_reduce): Likewise.
13038 * src/print_graph.c (print_graph): Likewise.
13039 * src/output.c (output_rule_data): Likewise.
13040 * src/nullable.c (set_nullable): Likewise.
13041
13042 2001-12-29 Akim Demaille <akim@epita.fr>
13043
13044 * src/output.c: Comment changes.
13045
13046 2001-12-27 Paul Eggert <eggert@twinsun.com>
13047
13048 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13049 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13050 Sparc, as they were causing more porting problems than the
13051 (minor) performance improvement was worth.
13052
13053 Also, catch up with 1.31's YYSTD.
13054
13055 2001-12-27 Akim Demaille <akim@epita.fr>
13056
13057 * src/output.c (output_gram): Rely on nritems, not the
13058 0-sentinel. See below.
13059 Use -1 as separator, not 0.
13060 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13061 Rely on -1 as separator in yyrhs, instead of 0.
13062 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13063 twice `Now at end of input', therefore there are two lines less to
13064 expect.
13065
13066 2001-12-27 Akim Demaille <akim@epita.fr>
13067
13068 * tests/regression.at (Unresolved SR Conflicts):
13069 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13070 below.
13071
13072 2001-12-27 Akim Demaille <akim@epita.fr>
13073
13074 * src/LR0.c (new_state): Recognize the final state by the fact it
13075 is reached by eoftoken.
13076 (insert_start_shifting_state, insert_eof_shifting_state)
13077 (insert_accepting_state, augment_automaton): Remove, since now
13078 these states are automatically computed from the initial state.
13079 (generate_states): Adjust.
13080 * src/print.c: When reporting a rule number to the user, substract
13081 1, so that the axiom rule is rule 0, and the first user rule is 1.
13082 * src/reduce.c: Likewise.
13083 * src/print_graph.c (print_core): For the time being, just as for
13084 the report, depend upon --trace-flags to dump the full set of
13085 items.
13086 * src/reader.c (readgram): Once the grammar read, insert the rule
13087 0: `$axiom: START-SYMBOL $'.
13088 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13089 number of the states has changed (the final state is no longer
13090 necessarily the last), catch up.
13091
13092 2001-12-27 Akim Demaille <akim@epita.fr>
13093
13094 Try to make the use of the eoftoken valid. Given that its value
13095 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13096 is used instead of > 0 where appropriate, (ii), depend upon nritems
13097 instead of the 0-sentinel.
13098
13099 * src/gram.h, src/gram.c (nritems): New.
13100 Expected to be duplication of nitems, but for the time being...
13101 * src/reader.c (packgram): Assert nritems and nitems are equal.
13102 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13103 * src/closure.c (print_closure, print_fderives): Likewise.
13104 * src/gram.c (ritem_print): Likewise.
13105 * src/print.c (print_core, print_grammar): Likewise.
13106 * src/print_graph.c: Likewise.
13107
13108 2001-12-27 Akim Demaille <akim@epita.fr>
13109
13110 * src/main.c (main): If there are complains after grammar
13111 reductions, then output the report anyway if requested, then die.
13112 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13113 * src/reader.c (eoftoken): New.
13114 (parse_token_decl): If the token being defined has value `0', it
13115 is the eoftoken.
13116 (packsymbols): No longer hack `tags' to insert `$' by hand.
13117 Be sure to preserve the value of the eoftoken.
13118 (reader): Make sure eoftoken is defined.
13119 Initialize nsyms to 0: now eoftoken is created just like the others.
13120 * src/print.c (print_grammar): Don't special case the eof token.
13121 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13122 lie anyway, albeit pleasant.
13123 * tests/calc.at: Exercise error messages with eoftoken.
13124 Change the grammar so that empty input is invalid.
13125 Adjust expectations.
13126 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13127
13128 2001-12-27 Akim Demaille <akim@epita.fr>
13129
13130 * configure.in: Check the protos of strchr ans strspn.
13131 Replace strchr if needed.
13132 * src/system.h: Provide the protos of strchr, strspn and memchr if
13133 missing.
13134 * lib/strchr.c: New.
13135 * src/reader.c (symbols_save): Use strchr.
13136
13137 2001-12-27 Akim Demaille <akim@epita.fr>
13138
13139 * src/print.c, src/print_graph.c (escape): New.
13140 Use it to quote the TAGS outputs.
13141 * src/print_graph.c (print_state): Now errors are in red, and
13142 reductions in green.
13143 Prefer high to wide: output the state number on a line of its own.
13144
13145 2001-12-27 Akim Demaille <akim@epita.fr>
13146
13147 * src/state.h, src/state.c (reductions_new): New.
13148 * src/LR0.c (set_state_table): Let all the states have a
13149 `reductions', even if reduced to 0.
13150 (save_reductions): Adjust.
13151 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13152 * src/print.c (print_reductions, print_actions): Adjust.
13153 * src/output.c (action_row): Adjust.
13154
13155 2001-12-27 Akim Demaille <akim@epita.fr>
13156
13157 * src/state.h, src/state.c (errs_new, errs_dup): New.
13158 * src/LR0.c (set_state_table): Let all the states have an errs,
13159 even if reduced to 0.
13160 * src/print.c (print_errs, print_reductions): Adjust.
13161 * src/output.c (output_actions, action_row): Adjust.
13162 * src/conflicts.c (resolve_sr_conflict): Adjust.
13163
13164 2001-12-27 Akim Demaille <akim@epita.fr>
13165
13166 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13167
13168 2001-12-27 Akim Demaille <akim@epita.fr>
13169
13170 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13171 * src/print.c: here.
13172 (lookaheadset, shiftset): New, used as additional storage by
13173 print_reductions.
13174 (print_results): Adjust.
13175 (print_shifts, print_gotos, print_errs): New, extracted from...
13176 (print_actions): here.
13177 * src/print_graph.c (print_actions): Remove dead code.
13178
13179 2001-12-27 Akim Demaille <akim@epita.fr>
13180
13181 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13182 `$n' and `@n'.
13183
13184 2001-12-27 Akim Demaille <akim@epita.fr>
13185
13186 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13187 (build_relations): Adjust.
13188
13189 2001-12-27 Akim Demaille <akim@epita.fr>
13190
13191 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13192 duplication.
13193
13194 2001-12-27 Akim Demaille <akim@epita.fr>
13195
13196 * src/reader.c (packgram): Catch nitems overflows.
13197
13198 2001-12-27 Akim Demaille <akim@epita.fr>
13199
13200 * src/files.c, src/files.h (guard_obstack): Remove.
13201 * src/output.c (output): Adjust.
13202 * src/reader.c (parse_braces): New, factoring...
13203 (copy_action, copy_guard): these two which are renamed as...
13204 (parse_action, parse_guard): these.
13205 As a voluntary consequence, using braces around guards is now
13206 mandatory.
13207
13208 2001-12-27 Akim Demaille <akim@epita.fr>
13209
13210 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13211 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13212 members.
13213 (symbol_list_new): Adjust.
13214 (copy_action): action_line is the first line, not the last.
13215 (copy_guard): Just as for actions, store the `action' only, not
13216 the switch/case/break flesh.
13217 Don't parse the user action that might follow the guard, let...
13218 (readgram): do it, i.e., now, there can be an action after a
13219 guard.
13220 In other words the guard is just explicitly optional.
13221 (packgram): Adjust.
13222 * src/output.c (guards_output): New.
13223 (output_parser): Call it when needed.
13224 (output): Also free the guard and attrs obstacks.
13225 * src/files.c, src/files.h (obstack_save): Remove.
13226 (output_files): Remove.
13227 As a result, if one needs the former `.act' file, using an
13228 appropriate skeleton which requires actions and guards is now
13229 required.
13230 * src/main.c (main): Adjust.
13231 * tests/semantic.at: New.
13232 * tests/regression.at: Use `input.y' as input file name.
13233 Avoid 8+3 problems by requiring input.c when the test needs the
13234 parser.
13235
13236 2001-12-27 Akim Demaille <akim@epita.fr>
13237
13238 * src/reader.c (symbol_list_new): Be sure to initialize all the
13239 fields.
13240
13241 2001-12-27 Akim Demaille <akim@epita.fr>
13242
13243 All the hacks using a final pseudo state are now useless.
13244
13245 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13246 * src/lalr.c (nLA): New.
13247 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13248 instead of lookaheadsp from the pseudo state (nstate + 1).
13249
13250 2001-12-27 Akim Demaille <akim@epita.fr>
13251
13252 * src/output.c (action_row, token_actions): Use a state_t instead
13253 of a integer, and nlookaheads instead of the following state's
13254 lookaheadsp.
13255
13256 2001-12-27 Akim Demaille <akim@epita.fr>
13257
13258 * src/conflicts.c (log_resolution, flush_shift)
13259 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13260 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13261 (conflicts_print, print_reductions): Use a state_t instead of an
13262 integer when referring to a state.
13263 As much as possible, depend upon nlookaheads, instead of the
13264 `lookaheadsp' member of the following state (since lookaheads of
13265 successive states are successive, the difference between state n + 1
13266 and n served as the number of lookaheads for state n).
13267 * src/lalr.c (add_lookback_edge): Likewise.
13268 * src/print.c (print_core, print_actions, print_state)
13269 (print_results): Likewise.
13270 * src/print_graph.c (print_core, print_actions, print_state)
13271 (print_graph): Likewise.
13272 * src/conflicts.h: Adjust.
13273
13274 2001-12-27 Akim Demaille <akim@epita.fr>
13275
13276 * src/bison.hairy: Formatting/comment changes.
13277 ANSIfy.
13278 Remove `register' indications.
13279 Add plenty of `static'.
13280
13281 2001-12-27 Akim Demaille <akim@epita.fr>
13282
13283 * src/output.c (prepare): Drop the muscle `ntbase' which
13284 duplicates ntokens.
13285 * src/bison.simple: Formatting/comment changes.
13286 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13287 is an undocumented synonym.
13288
13289 2001-12-22 Akim Demaille <akim@epita.fr>
13290
13291 * src/output.c (output_table_data): Change the prototype to use
13292 `int' for array ranges: some invocations do pass an int, not a
13293 short.
13294 Reported by Wayne Green.
13295
13296 2001-12-22 Akim Demaille <akim@epita.fr>
13297
13298 Some actions of web2c.y are improperly triggered.
13299 Reported by Mike Castle.
13300
13301 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13302 * tests/regression.at (Web2c): Rename as...
13303 (Web2c Report): this.
13304 (Web2c Actions): New.
13305
13306 2001-12-22 Akim Demaille <akim@epita.fr>
13307
13308 Reductions in web2c.y are improperly reported.
13309 Reported by Mike Castle.
13310
13311 * src/conflicts.c (print_reductions): Fix.
13312 * tests/regression.at (Web2c): New.
13313
13314 2001-12-18 Akim Demaille <akim@epita.fr>
13315
13316 Some host fail on `assert (!"foo")', which expands to
13317 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13318 Reported by Nelson Beebee.
13319
13320 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13321 `#define it_succeeded 0' and `assert (it_succeeded)'.
13322
13323 2001-12-17 Marc Autret <autret_m@epita.fr>
13324
13325 * src/bison.simple: Don't hard code the skeleton line and filename.
13326 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13327 New line counter 'skeleton_line' (skeleton-line muscle).
13328
13329 2001-12-17 Paul Eggert <eggert@twinsun.com>
13330
13331 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13332 YYDEBUG must be defined to a nonzero value.
13333
13334 * src/bison.simple (yytname): Do not assume that the user defines
13335 YYDEBUG to a properly parenthesized expression.
13336
13337 2001-12-17 Akim Demaille <akim@epita.fr>
13338
13339 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13340 nlookaheads is a new member.
13341 Adjust all users.
13342 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13343 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13344 state.
13345
13346 2001-12-17 Akim Demaille <akim@epita.fr>
13347
13348 * src/files.h, src/files.c (open_files, close_files): Remove.
13349 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13350 let...
13351 * src/reader.c (reader): Do it.
13352
13353 2001-12-17 Akim Demaille <akim@epita.fr>
13354
13355 * src/conflicts.c (print_reductions): Formatting changes.
13356
13357 2001-12-17 Akim Demaille <akim@epita.fr>
13358
13359 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13360 (flush_reduce): New.
13361 (resolve_sr_conflict): Adjust.
13362
13363 2001-12-17 Akim Demaille <akim@epita.fr>
13364
13365 * src/output.c (output_obstack): Be static and rename as...
13366 (format_obstack): this, to avoid any confusion with files.c's
13367 output_obstack.
13368 * src/reader.h (muscle_obstack): Move to...
13369 * src/output.h: here, since it's defined in output.c.
13370
13371 2001-12-17 Akim Demaille <akim@epita.fr>
13372
13373 * src/output.c (action_row, save_column, default_goto)
13374 (sort_actions, matching_state, pack_vector): Better variable
13375 locality.
13376
13377 2001-12-17 Akim Demaille <akim@epita.fr>
13378
13379 * src/output.c: Various formatting changes.
13380
13381 2001-12-17 Akim Demaille <akim@epita.fr>
13382
13383 * src/files.c (output_files): Free the output_obstack.
13384 * src/main.c (main): Call print and print_graph conditionally.
13385 * src/print.c (print): Work unconditionally.
13386 * src/print_graph.c (print_graph): Work unconditionally.
13387 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13388
13389 2001-12-16 Marc Autret <autret_m@epita.fr>
13390
13391 * src/output.c (actions_output): Fix. When we use %no-lines,
13392 there is one less line per action.
13393
13394 2001-12-16 Marc Autret <autret_m@epita.fr>
13395
13396 * src/bison.simple: Remove a useless #line directive.
13397 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13398 * src/output.c (get_lines_number): New.
13399 (output_parser): Adjust, now takes care about the lines of a
13400 output muscles.
13401 Fix line numbering.
13402 (actions_output): Computes the number of lines taken by actions.
13403 (output_master_parser): Insert new skeleton which is the name of
13404 the output parser file name.
13405
13406 2001-12-15 Marc Autret <autret_m@epita.fr>
13407
13408 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13409
13410 2001-12-15 Marc Autret <autret_m@epita.fr>
13411
13412 * src/output.c (output_gram): Keep track of the hairy one.
13413
13414 2001-12-15 Akim Demaille <akim@epita.fr>
13415
13416 Make `make distcheck' work.
13417
13418 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13419 system.h which uses libgettext.h.
13420
13421 2001-12-15 Akim Demaille <akim@epita.fr>
13422
13423 * src/nullable.c (set_nullable): Useless rules must be skipped,
13424 otherwise, since we range over their symbols, we might look at a
13425 nonterminal which no longer ``exists'', i.e., it is not counted in
13426 `nvars', hence we overflow our arrays.
13427
13428 2001-12-15 Akim Demaille <akim@epita.fr>
13429
13430 The header can also be produced directly, without any obstack!
13431 Yahoo!
13432
13433 * src/files.c, src/files.h (defines_obstack): Remove.
13434 (compute_header_macro): Global.
13435 (defines_obstack_save): Remove.
13436 * src/reader.c (parse_union_decl): No longer output to
13437 defines_obstack: its content can be found in the `stype' muscle
13438 anyway.
13439 (output_token_translations): Merge into...
13440 (symbols_output): this.
13441 Rename as...
13442 (symbols_save): this.
13443 (reader): Adjust.
13444 * src/output.c (header_output): New.
13445 (output): Call it.
13446
13447 2001-12-15 Akim Demaille <akim@epita.fr>
13448
13449 * src/reader.c (parse_union_decl): Instead of handling two obstack
13450 simultaneously, use one to define the `stype' muscle, and use the
13451 value of the latter to fill defines_obstack.
13452 (copy_comment): Remove.
13453 (copy_comment2): Work for a single obstack.
13454 Rename as...
13455 (copy_comment): this.
13456
13457 2001-12-15 Akim Demaille <akim@epita.fr>
13458
13459 * src/lex.c, src/lex.h (xgetc): No longer static.
13460 * src/reader.c (parse_union_decl): Revamp.
13461
13462 2001-12-15 Akim Demaille <akim@epita.fr>
13463
13464 Still making progress in separating Bison into (i) input, (ii)
13465 process, (iii) output: now we can directly output the parser file
13466 without using table_obstack at all.
13467
13468 * src/files.c, src/files.h (table_obstack): Bye bye.
13469 (parser_file_name): New.
13470 * src/files.c (compute_output_file_names): Compute it.
13471 * src/output.c (actions_output, output_parser)
13472 (output_master_parser): To a file instead of an obstack.
13473
13474 2001-12-15 Akim Demaille <akim@epita.fr>
13475
13476 Attach actions to rules, instead of pre-outputting them to
13477 actions_obstack.
13478
13479 * src/gram.h (rule_t): action and action_line are new members.
13480 * src/reader.c (symbol_list): Likewise.
13481 (copy_action): Save the actions within the rule.
13482 (packgram): Save them in rule_table.
13483 * src/output.c (actions_output): New.
13484 (output_parser): Use it on `%%actions'.
13485 (output_rule_data): Don't free rule_table.
13486 (output): Do it.
13487 (prepare): Don't save the `action' muscle.
13488 * src/bison.simple: s/%%action/%%actions/.
13489
13490 2001-12-15 Akim Demaille <akim@epita.fr>
13491
13492 * src/reader.c (copy_action): When --yacc, don't append a `;'
13493 to the user action: let it fail if lacking.
13494 Suggested by Arnold Robbins and Tom Tromey.
13495
13496 2001-12-14 Akim Demaille <akim@epita.fr>
13497
13498 * src/lex.c (literalchar): Simply return the char you decoded, non
13499 longer mess around with obstacks and int pointers.
13500 Adjust all callers.
13501
13502 2001-12-14 Akim Demaille <akim@epita.fr>
13503
13504 * src/lex.c (literalchar): Don't escape the special characters,
13505 just decode them, and keep them as char (before, eol was output as
13506 the 2 char string `\n' etc.).
13507 * src/output.c (output_rule_data): Use quotearg to output the
13508 token strings.
13509
13510 2001-12-13 Paul Eggert <eggert@twinsun.com>
13511
13512 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13513 Do not infringe on the global user namespace when using C++.
13514 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13515 All uses of `fprintf' and `stderr' changed.
13516
13517 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13518
13519 2001-12-13 Akim Demaille <akim@epita.fr>
13520
13521 The computation of nullable is broken: it doesn't handle empty
13522 RHS's properly.
13523
13524 * tests/torture.at (GNU AWK Grammar): New.
13525 * tests/sets.at (Nullable): New.
13526 * src/nullable.c (set_nullable): Instead of blindly looping over
13527 `ritems', loop over the rules, and then over their rhs's.
13528
13529 Work around Autotest bugs.
13530
13531 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13532 frame, because Autotest understand lines starting with a `+' as
13533 traces from the shell. Then, they are not processed properly.
13534 Admittedly an Autotest bug, but we don't have time to wait for
13535 Autotest to catch up.
13536 * tests/regression.at (Broken Closure): Adjust to the new table
13537 frames.
13538 Move to...
13539 * tests/sets.at: here.
13540
13541 2001-12-13 Akim Demaille <akim@epita.fr>
13542
13543 * src/closure.c (closure): Use nrules instead of playing tricks
13544 with BITS_PER_WORD.
13545
13546 2001-12-13 Akim Demaille <akim@epita.fr>
13547
13548 * src/print.c (print_actions): Output the handling of `$' as the
13549 traces do: shifting the token EOF. Before EOF was treated as a
13550 nonterminal.
13551 * tests/regression.at: Adjust some tests.
13552 * src/print_graph.c (print_core): Complete the set of items via
13553 closure. The next-to-final and final states are still unsatisfying,
13554 but that's to be addressed elsewhere.
13555 No longer output the rule numbers, but do output the state number.
13556 A single loop for the shifts + gotos is enough, but picked a
13557 distinct color for each.
13558 (print_graph): Initialize and finalize closure.
13559
13560 2001-12-13 Akim Demaille <akim@epita.fr>
13561
13562 * src/reader.c (readgram): Remove dead code, an strip useless
13563 braces.
13564 (get_type): Remove, unused.
13565
13566 2001-12-12 Akim Demaille <akim@epita.fr>
13567
13568 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13569 on that of lib/error.c.
13570
13571 2001-12-12 Akim Demaille <akim@epita.fr>
13572
13573 Some hosts don't like `/' in includes.
13574
13575 * src/system.h: Include libgettext.h without qualifying the path.
13576 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13577 $(top_srcdir).
13578
13579 2001-12-11 Marc Autret <autret_m@epita.fr>
13580
13581 * src/output.c (output_parser): Remove useless muscle.
13582
13583 2001-12-11 Marc Autret <autret_m@epita.fr>
13584
13585 * src/bison.simple: Remove #line just before %%epilogue. It
13586 is now handled in ...
13587 * src/reader.c (read_additionnal_code): Add the output of a
13588 #line for the epilogue.
13589
13590 2001-12-10 Marc Autret <autret_m@epita.fr>
13591
13592 * src/reader.c (copy_definition): Re-use CPP-outed code which
13593 replace precedent remove.
13594 * src/bison.simple: Remove #line before %%prologue because
13595 %%input-line is wrong at this time.
13596
13597 2001-12-10 Marc Autret <autret_m@epita.fr>
13598
13599 * src/reader.c (symbols_output): Clean up.
13600 * src/output.c (output_gram, output): Clean up.
13601
13602 2001-12-10 Akim Demaille <akim@epita.fr>
13603
13604 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13605 * src/LR0.c (set_state_table): here.
13606 * src/lalr.c (lalr): Call it.
13607
13608 2001-12-10 Akim Demaille <akim@epita.fr>
13609
13610 * src/state.h (shifts): Remove the `number' member: shifts are
13611 attached to state, hence no longer need to be labelled with a
13612 state number.
13613
13614 2001-12-10 Akim Demaille <akim@epita.fr>
13615
13616 Now that states have a complete set of members, the linked list of
13617 shifts is useless: just fill directly the state's shifts member.
13618
13619 * src/state.h (shifts): Remove the `next' member.
13620 * src/LR0.c (first_state, last_state): Remove.
13621 Adjust the callers.
13622 (augment_automaton): Don't look for the shifts that must be added
13623 a shift on EOF: it is those of the state we looked for! But now,
13624 since shifts are attached, it is no longer needed to looking
13625 merely by its id: its number.
13626
13627 2001-12-10 Akim Demaille <akim@epita.fr>
13628
13629 * src/LR0.c (augment_automaton): Better variable locality.
13630 Remove an impossible branch: if there is a state corresponding to
13631 the start symbol being shifted, then there is shift for the start
13632 symbol from the initial state.
13633
13634 2001-12-10 Akim Demaille <akim@epita.fr>
13635
13636 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13637 only when appropriate: when insert_start_shifting_state' is not
13638 invoked.
13639 * tests/regression.at (Rule Line Numbers): Adjust.
13640
13641 2001-12-10 Akim Demaille <akim@epita.fr>
13642
13643 * src/LR0.c (augment_automaton): Now that all states have shifts,
13644 merge the two cases addition shifts to the initial state.
13645
13646 2001-12-10 Akim Demaille <akim@epita.fr>
13647
13648 * src/lalr.c (set_state_table): Move to...
13649 * src/LR0.c: here.
13650 * src/lalr.c (lalr): Don't call it...
13651 * src/LR0.c (generate_states): do it.
13652 * src/LR0.h (first_state): Remove, only the table is used.
13653
13654 2001-12-10 Akim Demaille <akim@epita.fr>
13655
13656 * src/LR0.h (first_shift, first_reduction): Remove.
13657 * src/lalr.c: Don't use first_shift: find shifts through the
13658 states.
13659
13660 2001-12-10 Akim Demaille <akim@epita.fr>
13661
13662 * src/LR0.c: Attach shifts to states as soon as they are
13663 computed.
13664 * src/lalr.c (set_state_table): Instead of assigning shifts to
13665 state, just assert that the mapping was properly done.
13666
13667 2001-12-10 Akim Demaille <akim@epita.fr>
13668
13669 * src/LR0.c (insert_start_shift): Rename as...
13670 (insert_start_shifting_state): this.
13671 (insert_eof_shifting_state, insert_accepting_state): New.
13672 (augment_automaton): Adjust.
13673 Better locality of the variables.
13674 When looking if the start_symbol is shifted from the initial
13675 state, using `while (... symbol != start_symbol ...)' sounds
13676 better than `while (... symbol < start_symbol ...)': If fail
13677 to see how the order between symbols could be relevant!
13678
13679 2001-12-10 Akim Demaille <akim@epita.fr>
13680
13681 * src/getargs.h: Don't declare `spec_name_prefix' and
13682 `spec_file_prefix', declared by src/files.h.
13683 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
13684 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
13685 * src/output.c (prepare): Adjust.
13686 * src/reader.c (symbols_output): Likewise.
13687 * src/vmsgetargs.c: Vaguely adjust, but who cares?
13688
13689 2001-12-10 Akim Demaille <akim@epita.fr>
13690
13691 * src/muscle_tab.c (muscle_init): NULL is a better default than
13692 `"0"'.
13693
13694 2001-12-10 Akim Demaille <akim@epita.fr>
13695
13696 * src/reader.c (reader): Calling symbols_output once is enough.
13697
13698 2001-12-10 Akim Demaille <akim@epita.fr>
13699
13700 Now that states have a complete set of members, the linked list of
13701 reductions is useless: just fill directly the state's reductions
13702 member.
13703
13704 * src/state.h (struct reductions): Remove member `number' and
13705 `next'.
13706 * src/LR0.c (first_reduction, last_reduction): Remove.
13707 (save_reductions): Don't link the new reductions, store them in
13708 this_state.
13709 * src/lalr.c (set_state_table): No need to attach reductions to
13710 states, it's already done.
13711 * src/output.c (output_actions): No longer free the shifts, then
13712 the reductions, then the states: free all the states and their
13713 members.
13714
13715 2001-12-10 Akim Demaille <akim@epita.fr>
13716
13717 * src/options.c (OPTN, DRTV, BOTH): New.
13718 (option_table): Use them.
13719
13720 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13721 the job of system.h.
13722 * src/options.c: Don't include stdio.h and xalloc.h for the same
13723 reasons.
13724
13725 2001-12-10 Akim Demaille <akim@epita.fr>
13726
13727 * src/output.c (output, prepare): Make sure the values of the
13728 muscles `action' and `prologue' are 0-terminated.
13729
13730 2001-12-10 Akim Demaille <akim@epita.fr>
13731
13732 Clean up GCC warnings.
13733
13734 * src/reader.c (copy_action): `buf' is not used.
13735 (parse_skel_decl): Be static.
13736 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13737 * src/options.h (create_long_option_table): Have a real prototype.
13738 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13739 (hash_delete_at): Return const void *.
13740 Adjust casts to preserve the const.
13741
13742 2001-12-10 Akim Demaille <akim@epita.fr>
13743
13744 * configure.in: Require 2.52g.
13745 M4 is not needed, but AUTOM4TE is.
13746 * m4/m4.m4: Remove.
13747 * tests/Makefile.am: Adjust.
13748
13749 2001-12-10 Akim Demaille <akim@epita.fr>
13750
13751 One structure for states is enough, even though theoretically
13752 there are LR(0) states and LALR(1) states.
13753
13754 * src/lalr.h (state_t): Remove.
13755 (state_table): Be state_t **, not state_t *.
13756 * src/state.h (core, CORE_ALLOC): Rename as...
13757 (state_t, STATE_ALLOC): this.
13758 Add the LALR(1) members: shifts, reductions, errs.
13759 * src/LR0.c (state_table): Rename as...
13760 (state_hash): this, to avoid name clashes with the global
13761 `state_table'.
13762 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13763 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13764
13765 2001-12-10 Akim Demaille <akim@epita.fr>
13766
13767 Bison dumps core on bash.y.
13768 Reported by Pascal Bart.
13769
13770 * src/warshall.c (bitmatrix_print): New.
13771 (TC): Use it.
13772 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
13773 j must be the outer loop.
13774 * tests/regression.at (Broken Closure): New.
13775
13776 2001-12-05 Akim Demaille <akim@epita.fr>
13777
13778 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13779 its argument.
13780 Reported by Peter Hamorsky.
13781
13782 2001-12-05 Akim Demaille <akim@epita.fr>
13783
13784 * src/conflicts.c (err_table): Remove.
13785 (resolve_sr_conflict): Adjust.
13786 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13787 Rename as...
13788 (state_t.reductions, state_t.shifts): this.
13789
13790 2001-12-05 Akim Demaille <akim@epita.fr>
13791
13792 * src/reduce.c (reduce_grammar_tables): No longer disable the
13793 removal of useless rules via CPP but via `if (0)', so that the
13794 compiler still check the code is valid.
13795 For instance, it should have noticed `rline' no longer exists: use
13796 the `line' member of rule_t.
13797 * src/gram.c (dummy, rline): Remove, unused.
13798
13799 2001-12-05 Akim Demaille <akim@epita.fr>
13800
13801 * src/output.c (pack_vector): Use assert, not berror.
13802 * src/main.c (berror): Remove, unused.
13803
13804 2001-12-05 Akim Demaille <akim@epita.fr>
13805
13806 New experimental feature: if --verbose --trace output all the
13807 items of a state, not only its kernel.
13808
13809 * src/print.c (print_core): If `trace_flag', then invoke closure
13810 before outputting the items of the state (print_core is no longer
13811 a correct name them).
13812 (print_results): Invoke new_closure/free_closure if needed.
13813
13814 2001-12-05 Akim Demaille <akim@epita.fr>
13815
13816 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13817 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13818 (nitemset): for consistency with the rest of the project.
13819
13820 2001-12-05 Akim Demaille <akim@epita.fr>
13821
13822 * src/closure.c (print_closure): Improve.
13823 (closure): Use it for printing input and output.
13824
13825 2001-12-05 Akim Demaille <akim@epita.fr>
13826
13827 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13828 indexed by nonterminals.
13829
13830 2001-12-05 Akim Demaille <akim@epita.fr>
13831
13832 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13833 what it was!).
13834 * src/warshall.h: Remove accidental duplication of the content.
13835
13836 2001-12-05 Akim Demaille <akim@epita.fr>
13837
13838 * src/closure.c (set_fderives): De-obfuscate.
13839
13840 2001-12-05 Akim Demaille <akim@epita.fr>
13841
13842 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13843
13844 2001-12-05 Akim Demaille <akim@epita.fr>
13845
13846 * src/closure.c (set_firsts): De-obfuscate.
13847
13848 2001-12-05 Akim Demaille <akim@epita.fr>
13849
13850 * src/output.c (action_row): De-obfuscate
13851 using the good o' techniques: arrays not pointers, variable
13852 locality, BITISSET, RESETBIT etc.
13853
13854 2001-12-05 Akim Demaille <akim@epita.fr>
13855
13856 Pessimize the code to simplify it: from now on, all the states
13857 have a valid SHIFTS, which NSHIFTS is possibly 0.
13858
13859 * src/LR0.c (shifts_new): Be global and move to..
13860 * src/state.c, src/state.h: here.
13861 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13862 * src/print_graph: Adjust.
13863
13864 2001-12-05 Akim Demaille <akim@epita.fr>
13865
13866 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13867 * src/conflicts.c: Use it.
13868 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13869 incorrectly ``simplified''.
13870
13871 2001-12-05 Akim Demaille <akim@epita.fr>
13872
13873 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
13874 using the good o' techniques: arrays not pointers, variable
13875 locality, BITISSET, RESETBIT etc.
13876
13877 2001-12-05 Akim Demaille <akim@epita.fr>
13878
13879 * src/state.h (SHIFT_SYMBOL): New.
13880 * src/conflicts.c: Use it to deobfuscate.
13881
13882 2001-12-05 Akim Demaille <akim@epita.fr>
13883
13884 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
13885 (print_reductions): De-obfuscate using the good o' techniques:
13886 arrays not pointers, variable locality, BITISSET.
13887
13888 2001-12-05 Akim Demaille <akim@epita.fr>
13889
13890 * src/conflicts.c (print_reductions): Arrays, not pointers.
13891 Use BITISSET.
13892
13893 2001-12-05 Akim Demaille <akim@epita.fr>
13894
13895 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13896
13897 2001-12-05 Akim Demaille <akim@epita.fr>
13898
13899 * src/conflicts.c (print_reductions): Improve variable locality.
13900
13901 2001-12-05 Akim Demaille <akim@epita.fr>
13902
13903 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13904
13905 2001-12-05 Akim Demaille <akim@epita.fr>
13906
13907 * src/conflicts.c (print_reductions): Improve variable locality.
13908
13909 2001-12-05 Akim Demaille <akim@epita.fr>
13910
13911 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13912 * src/lalr.c: Use them.
13913
13914 2001-12-05 Akim Demaille <akim@epita.fr>
13915
13916 * src/LR0.c (augment_automaton): Formatting changes.
13917 Better variable locality.
13918
13919 2001-12-05 Akim Demaille <akim@epita.fr>
13920
13921 * src/lalr.c (matrix_print): New.
13922 (transpose): Use it.
13923 Use arrays instead of pointers.
13924
13925 2001-12-05 Akim Demaille <akim@epita.fr>
13926
13927 * src/lalr.c (maxrhs): Move to...
13928 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
13929 * src/lalr.c (build_relations): Adjust.
13930
13931 2001-12-05 Akim Demaille <akim@epita.fr>
13932
13933 * src/lalr.c (transpose): Free the memory allocated to the
13934 argument, as it is replaced by the results by the unique caller.
13935 (build_relations): Merely invoke transpose: it handles the memory
13936 deallocation.
13937 Improve variable locality.
13938 Avoid variables used as mere abbreviations.
13939 (compute_lookaheads): Use arrays instead of pointers.
13940
13941 2001-12-05 Akim Demaille <akim@epita.fr>
13942
13943 * src/lalr.c (initialize_F): Improve variable locality.
13944 Avoid variables used as mere abbreviations.
13945
13946 2001-12-05 Akim Demaille <akim@epita.fr>
13947
13948 * src/derives.c (print_derives): Display the ruleno.
13949 * src/lalr.c (initialize_F, transpose): Better variable locality
13950 to improve readability.
13951 Avoid variables used as mere abbreviations.
13952
13953 2001-12-05 Akim Demaille <akim@epita.fr>
13954
13955 * src/lalr.c (traverse): Use arrays instead of pointers.
13956
13957 2001-12-05 Akim Demaille <akim@epita.fr>
13958
13959 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13960 the handling of squeue.
13961 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13962
13963 2001-12-05 Akim Demaille <akim@epita.fr>
13964
13965 Because useless nonterminals are now kept alive (instead of being
13966 `destroyed'), we now sometimes examine them, and store information
13967 related to them. Hence we need to know their number, and adjust
13968 memory allocations.
13969
13970 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13971 static.
13972 * src/LR0.c (allocate_itemsets): The memory allocated to
13973 `symbol_count' was used for two different purpose: once to count
13974 the number of occurrences of each symbol, and later reassigned to
13975 `shift_symbol', containing the symbol that can be shifted from a
13976 given state.
13977 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13978 only, and...
13979 (new_itemsets): Allocate `shift_symbol' here.
13980 (allocate_itemsets): symbol_count includes useless nonterminals.
13981 Make room for them.
13982 (free_storage): Use `free', not `XFREE', for pointers that cannot
13983 be null.
13984
13985 2001-12-05 Akim Demaille <akim@epita.fr>
13986
13987 * src/nullable.c (set_nullable): Deobfuscate the handling of
13988 ritem.
13989 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13990
13991 2001-12-05 Akim Demaille <akim@epita.fr>
13992
13993 * src/gram.c, src/gram.h (ritem_print): New.
13994 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
13995 (This useless function was defined only to work around VMS linkers
13996 that can't handle compilation units with variables only).
13997 * src/reduce.c (dump_grammar): Use it to trace the construction of
13998 ritem.
13999
14000 2001-12-04 Paul Eggert <eggert@twinsun.com>
14001
14002 * src/bison.simple (union yyalloc): Change member names
14003 to be the same as the stack names.
14004 (yyparse): yyptr is now union yyalloc *, not char *.
14005 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14006 and may generate better code on some machines.
14007 (yystpcpy): Use prototype if __STDC__ is defined, not just
14008 if __cplusplus is defined.
14009
14010 2001-11-30 Akim Demaille <akim@epita.fr>
14011
14012 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14013 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14014 Gettext doesn't compile cleanly, and dies with -Werror.
14015 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14016 Include WARNING_CFLAGS here.
14017 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14018 before being defined.
14019
14020 2001-11-27 Paul Eggert <eggert@twinsun.com>
14021
14022 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14023 First arg is int, not unsigned.
14024 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14025 (SIZE_MAX, UINT_MAX): New macros.
14026 (quotearg_n_options): Abort if N is negative.
14027 Avoid overflow check on hosts where size_t is 64 bits and int
14028 is 32 bits, as overflow is impossible there.
14029 Fix off-by-one typo that caused unnecessary reallocation.
14030
14031 2001-11-29 Paul Eggert <eggert@twinsun.com>
14032
14033 Name space cleanup in generated parser.
14034
14035 * doc/bison.texinfo (Bison Parser): Discuss system headers
14036 and their effect on the user name space.
14037
14038 * src/bison.simple:
14039 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14040 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14041 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14042
14043 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14044 on user names when possible.
14045
14046 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14047 Simplify test for whather <alloca.h> exists.
14048
14049 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14050
14051 (<stdio.h>): Include if YYDEBUG.
14052
14053 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14054 ! defined (yyoverflow) && ! defined (yymemcpy).
14055
14056 (yymemcpy, yyparse): Rename local variables as needed so that
14057 they all begin with 'yy'.
14058
14059 (yystrlen, yystpcpy): New functions.
14060
14061 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14062 All uses changed.
14063
14064 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14065 instead of relying on string.h functions. Use YYSTACK_ALLOC
14066 and YYSTACK_FREE instead of malloc and free.
14067
14068 2001-11-30 Akim Demaille <akim@epita.fr>
14069
14070 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14071 before their first uses.
14072 (YYBISON, YYPURE): Move to the top of the output.
14073
14074 2001-11-30 Akim Demaille <akim@epita.fr>
14075
14076 * tests/reduce.at (Useless Nonterminals): Fix.
14077
14078 2001-11-30 Akim Demaille <akim@epita.fr>
14079
14080 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14081 if body instead of `;' to pacify GCC's warnings.
14082
14083 2001-11-30 Akim Demaille <akim@epita.fr>
14084
14085 Instead of mapping the LHS of unused rules to -1, keep the LHS
14086 valid, but flag the rules as invalid.
14087
14088 * src/gram.h (rule_t): `useful' is a new member.
14089 * src/print.c (print_grammar): Adjust.
14090 * src/derives.c (set_derives): Likewise.
14091 * src/reader.c (packgram, reduce_output): Likewise.
14092 * src/reduce.c (reduce_grammar_tables): Likewise.
14093 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14094
14095 2001-11-30 Akim Demaille <akim@epita.fr>
14096
14097 * src/reduce.c (reduce_output): Formatting changes.
14098 * src/print.c (print_results, print_grammar): Likewise.
14099 * tests/regression.at (Rule Line Numbers)
14100 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14101
14102 2001-11-30 Akim Demaille <akim@epita.fr>
14103
14104 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14105 useless nonterminals, move them at the end of the symbol arrays.
14106 (reduce_output): Adjust.
14107 * tests/reduce.at (Useless Nonterminals): Adjust.
14108
14109 2001-11-30 Akim Demaille <akim@epita.fr>
14110
14111 * src/reduce.c: Various comment/formatting changes.
14112 (nonterminals_reduce): New, extracted from...
14113 (reduce_grammar_tables): here.
14114 (reduce_grammar): Call nonterminals_reduce.
14115
14116 2001-11-29 Paul Eggert <eggert@twinsun.com>
14117
14118 * src/bison.simple (YYSTACK_REALLOC): Remove.
14119 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14120 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14121 New macros.
14122 (union yyalloc): New type.
14123 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14124 an arbitrary restriction on hosts where size_t is wider than int.
14125
14126 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14127 a parser stack overflow. Allocate just one block of memory for all
14128 three stacks, instead of allocating three blocks; this typically is
14129 faster and reduces fragmentation.
14130
14131 Do not limit the number of items in the stack to a value that fits
14132 in 'int', as this is an arbitrary limit on hosts with 64-bit
14133 size_t and 32-bit int.
14134
14135 2001-11-29 Marc Autret <autret_m@epita.fr>
14136
14137 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14138 of defining YYERROR_VERBOSE.
14139 [AT_DATA]: $4 is now out of C declarations in the prologue.
14140
14141 2001-11-28 Marc Autret <autret_m@epita.fr>
14142
14143 * src/reader.c (parse_dquoted_param): New.
14144 (parse_skel_decl): Use it.
14145 * src/lex.h: Add its prototype.
14146 * src/lex.c (literalchar): Become not static.
14147
14148 2001-11-28 Marc Autret <autret_m@epita.fr>
14149
14150 * src/output.h: And put its extern declaration here.
14151 * src/output.c (error_verbose): Define here.
14152 (prepare): Echo name modification.
14153 * src/getargs.h: Clean its extern declaration.
14154 * src/getargs.c (error_verbose_flag): Remove.
14155 (getargs): Remove case 'e'.
14156 * src/options.c (option_table): 'error-verbose' is now seen as simple
14157 percent option.
14158 Include output.h.
14159
14160 * src/reader.c (read_declarations): Remove case tok_include.
14161 (parse_include_decl): Remove.
14162 * src/lex.h (token_t): Remove tok_include.
14163 * src/options.c (option_table): 'include' is now a simple command line
14164 option.
14165
14166 2001-11-28 Marc Autret <autret_m@epita.fr>
14167
14168 * src/bison.simple: Adjust muscle names.
14169 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14170 * src/output.c (prepare): s/_/-/ for the muscles names.
14171 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14172
14173 2001-11-28 Marc Autret <autret_m@epita.fr>
14174
14175 * src/bison.simple: Fix debug.
14176 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14177
14178 2001-11-28 Akim Demaille <akim@epita.fr>
14179
14180 * src/LR0.c (shifts_new): New.
14181 (save_shifts, insert_start_shift, augment_automaton): Use it.
14182
14183 2001-11-28 Akim Demaille <akim@epita.fr>
14184
14185 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14186 keep ruleno only.
14187
14188 2001-11-28 Akim Demaille <akim@epita.fr>
14189
14190 * src/closure.c (closure): Instead of looping over word in array
14191 then bits in words, loop over bits in array.
14192
14193 2001-11-28 Akim Demaille <akim@epita.fr>
14194
14195 * src/closure.c (closure): No longer optimize the special case
14196 where all the bits of `ruleset[r]' are set to 0, to make the code
14197 clearer.
14198
14199 2001-11-28 Akim Demaille <akim@epita.fr>
14200
14201 * src/closure.c (closure): `r' and `c' are new variables, used to
14202 de-obfuscate accesses to RULESET and CORE.
14203
14204 2001-11-28 Akim Demaille <akim@epita.fr>
14205
14206 * src/reduce.c (reduce_print): Use ngettext.
14207 (dump_grammar): Improve the trace accuracy.
14208
14209 2001-11-28 Akim Demaille <akim@epita.fr>
14210
14211 * src/reduce.c (dump_grammar): Don't translate trace messages.
14212
14213 2001-11-28 Akim Demaille <akim@epita.fr>
14214
14215 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14216 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14217 as all tags are free'ed afterwards.
14218 From Enrico Scholz.
14219
14220 2001-11-27 Paul Eggert <eggert@twinsun.com>
14221
14222 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14223 use alloca when we didn't want to, and vice versa.
14224
14225 2001-11-27 Marc Autret <autret_m@epita.fr>
14226
14227 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14228 initialization.
14229 * src/output.c (prepare): Remove its update.
14230
14231 2001-11-27 Marc Autret <autret_m@epita.fr>
14232
14233 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14234 Use %error-verbose.
14235
14236 2001-11-27 Marc Autret <autret_m@epita.fr>
14237
14238 * src/bison.simple: Remove YYERROR_VERBOSE using.
14239 Use %%error_verbose.
14240 (yyparse): Likewise.
14241 * src/output.c (prepare): Give its final value.
14242 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14243 * src/getargs.h: Add its extern declaration.
14244 * src/getargs.c (error_verbose_flag): New int.
14245 (getargs): Update to catch new case.
14246 * src/options.c (option_table): 'error-verbose' is a new option.
14247 (shortopts): Update.
14248
14249 2001-11-27 Akim Demaille <akim@epita.fr>
14250
14251 * src/system.h: Use intl/libgettext.h.
14252 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14253
14254 2001-11-27 Akim Demaille <akim@epita.fr>
14255
14256 * tests/torture.at (Exploding the Stack Size with Malloc):
14257 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14258
14259 2001-11-27 Akim Demaille <akim@epita.fr>
14260
14261 * src/files.c: Include error.h.
14262 Reported by Hans Aberg.
14263
14264 2001-11-26 Marc Autret <autret_m@epita.fr>
14265
14266 * src/reader.c (parse_include_decl): New, not yet implemented.
14267 (read_declarations): Add case tok_include.
14268 * src/getargs.h (include): Add its extern definition.
14269 * src/getargs.c (include): New const char *.
14270 (getargs): Add case '-I'.
14271 * src/options.c (option_table): Add include as command line and
14272 percent option.
14273 * src/lex.h (token_t): Add tok_include.
14274
14275 2001-11-26 Akim Demaille <akim@epita.fr>
14276
14277 * src/reader.c (readgram): Make sure rules for mid-rule actions
14278 have a lineno equal to that of their host rule.
14279 Reported by Hans Aberg.
14280 * tests/regression.at (Rule Line Numbers): New.
14281
14282 2001-11-26 Akim Demaille <akim@epita.fr>
14283
14284 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14285 size_ts.
14286
14287 2001-11-26 Akim Demaille <akim@epita.fr>
14288
14289 * src/complain.c, src/complain.h (error): Remove, provided by
14290 lib/error.[ch].
14291
14292 2001-11-26 Akim Demaille <akim@epita.fr>
14293
14294 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14295 issue an error message.
14296 * tests/regression.at (Invalid %directive): New.
14297 Reported by Hans Aberg.
14298
14299 2001-11-26 Akim Demaille <akim@epita.fr>
14300
14301 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14302 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14303
14304 2001-11-26 Akim Demaille <akim@epita.fr>
14305
14306 * src/conflicts.c (conflicts_print): Don't complain at all when
14307 there are no reduce/reduce conflicts, and as many shift/reduce
14308 conflicts as expected.
14309 * tests/regression.at (%expect right): Adjust.
14310
14311 2001-11-23 Akim Demaille <akim@epita.fr>
14312
14313 * lib/alloca.c: Update, from fileutils.
14314
14315 2001-11-23 Akim Demaille <akim@epita.fr>
14316
14317 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14318
14319 2001-11-23 Akim Demaille <akim@epita.fr>
14320
14321 * src/system.h: Include alloca.h.
14322 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14323
14324 2001-11-23 Akim Demaille <akim@epita.fr>
14325
14326 * src/print_graph.c (print_actions): Remove `rule', unused.
14327 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14328 pacify GCC's signed < unsigned warnings.
14329 * src/closure.c (itemsetsize): Likewise.
14330 * src/reader.c (symbol_list_new): Static.
14331
14332 2001-11-23 Akim Demaille <akim@epita.fr>
14333
14334 Attaching lineno to buckets is stupid, since only one copy of each
14335 symbol is kept, only the line of the first occurrence is kept too.
14336
14337 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14338 * src/reader.c (rline_allocated): Remove, unused.
14339 (symbol_list): Have a `line' member.
14340 (symbol_list_new): New.
14341 (readgram): Use it.
14342 * src/print.c (print_grammar): Output the rule line numbers.
14343 * tests/regression.at (Solved SR Conflicts)
14344 (Unresolved SR Conflicts): Adjust.
14345 Reported by Hans Aberg.
14346
14347 2001-11-22 Marc Autret <autret_m@epita.fr>
14348
14349 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14350
14351 2001-11-22 Marc Autret <autret_m@epita.fr>
14352
14353 * src/muscle_tab.c (muscle_init): Remove initialization of
14354 skeleton muscle.
14355 * src/output.c (output_master_parser): Do it here.
14356
14357 2001-11-20 Akim Demaille <akim@epita.fr>
14358
14359 * po/sv.po: New.
14360 * configure.in (ALL_LINGUAS): Adjust.
14361 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14362 longer contains strings to translate.
14363
14364 2001-11-19 Akim Demaille <akim@epita.fr>
14365
14366 * src/conflicts.c (conflicts_print): Add a missing \n.
14367
14368 2001-11-19 Akim Demaille <akim@epita.fr>
14369
14370 * src/nullable.c (nullable_print): New.
14371 (set_nullable): Call it when tracing.
14372 Better locality of variables.
14373
14374 2001-11-19 Akim Demaille <akim@epita.fr>
14375
14376 * src/print.c (print_actions): Better locality of variables.
14377
14378 2001-11-19 Akim Demaille <akim@epita.fr>
14379
14380 * src/derives.c (print_derives): Fix and enrich.
14381 * src/closure.c (print_fderives): Likewise.
14382
14383 2001-11-19 Akim Demaille <akim@epita.fr>
14384
14385 * src/closure.c (itemsetend): Remove, replaced with...
14386 (itemsetsize): new.
14387
14388 2001-11-19 Akim Demaille <akim@epita.fr>
14389
14390 * src/LR0.c (kernel_end): Remove, replaced with...
14391 (kernel_size): new.
14392
14393 2001-11-19 Akim Demaille <akim@epita.fr>
14394
14395 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14396 to clarify.
14397
14398 2001-11-19 Akim Demaille <akim@epita.fr>
14399
14400 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14401
14402 2001-11-19 Akim Demaille <akim@epita.fr>
14403
14404 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14405 trace messages.
14406 * src/LR0.c: Likewise.
14407 (allocate_itemsets): Use arrays instead of pointers to clarify.
14408
14409 2001-11-19 Akim Demaille <akim@epita.fr>
14410
14411 * src/getargs.c (statistics_flag): Replace with...
14412 (trace_flag): New.
14413 (longopts): Accept --trace instead of --statistics.
14414 * src/getargs.h, src/options.c: Adjust.
14415 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14416 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14417
14418 2001-11-19 Akim Demaille <akim@epita.fr>
14419
14420 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
14421 pointers to clarify the code.
14422 (save_reductions, save_shifts): Factor common parts of alternatives.
14423
14424 2001-11-19 Akim Demaille <akim@epita.fr>
14425
14426 * src/LR0.c (new_state, get_state): Complete TRACE code.
14427 * src/closure.c: Include `reader.h' to get `tags', needed by the
14428 trace code.
14429 Rename the conditional DEBUG as TRACE.
14430 Output consistently TRACEs to stderr, not stdout.
14431 * src/derives.c: Likewise.
14432 * src/reduce.c: (inaccessable_symbols): Using if is better style
14433 than goto.
14434 Use `#if TRACE' instead of `#if 0' for tracing code.
14435
14436 2001-11-19 Akim Demaille <akim@epita.fr>
14437
14438 * src/system.h (LIST_FREE, shortcpy): New.
14439 * src/LR0.c: Use them.
14440 * src/output.c (free_itemsets, free_reductions, free_shifts):
14441 Remove, replaced by LIST_FREE.
14442
14443 2001-11-19 Akim Demaille <akim@epita.fr>
14444
14445 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14446 (REDUCTIONS_ALLOC): New.
14447 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14448 allocation.
14449
14450 2001-11-19 Akim Demaille <akim@epita.fr>
14451
14452 * src/LR0.c (new_state): Complete trace code.
14453 * src/nullable.c (set_nullable): Don't translate traces.
14454
14455 2001-11-19 Akim Demaille <akim@epita.fr>
14456
14457 * src/print_graph.c (print_core): Better locality of variables.
14458 * src/print.c (print_core): Likewise.
14459
14460 2001-11-19 Akim Demaille <akim@epita.fr>
14461
14462 * src/vcg.c: You do the output, so you are responsible of the
14463 handling of VCG syntax, in particular: use quotearg.
14464 * src/print_graph.c: Don't.
14465 (print_actions): Don't output the actions as part of the nodes,
14466 since that's the job of the edges.
14467 (print_state): Don't output by hand: fill the node description,
14468 and ask for its output.
14469
14470 2001-11-19 Akim Demaille <akim@epita.fr>
14471
14472 * src/bison.simple (yyparse): When verbosely reporting an error,
14473 no longer put additional quotes around token names.
14474 * tests/calc.at: Adjust.
14475
14476 2001-11-19 Akim Demaille <akim@epita.fr>
14477
14478 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14479 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14480 * src/output.c: Adjust.
14481
14482 2001-11-19 Akim Demaille <akim@epita.fr>
14483
14484 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14485 (rule_t): this.
14486 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14487
14488 2001-11-19 Akim Demaille <akim@epita.fr>
14489
14490 * src/gram.h (rule_t): New.
14491 (rule_table): New.
14492 (rrhs, rlhs): Remove, part of state_t.
14493 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14494 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14495 * src/reader.c, src/reduce.c: Adjust.
14496
14497 2001-11-19 Akim Demaille <akim@epita.fr>
14498
14499 * src/reader.c (symbols_output): New, extracted from...
14500 (packsymbols): Here.
14501 (reader): Call it.
14502
14503 2001-11-19 Akim Demaille <akim@epita.fr>
14504
14505 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14506 (maxrhs): this new function.
14507
14508 2001-11-19 Akim Demaille <akim@epita.fr>
14509
14510 * src/lalr.c (F): New macro to access the variable F.
14511 Adjust.
14512
14513 2001-11-19 Akim Demaille <akim@epita.fr>
14514
14515 * src/lalr.h (LA): New macro to access the variable LA.
14516 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14517 * src/lalr.c: Adjust.
14518
14519 2001-11-19 Akim Demaille <akim@epita.fr>
14520
14521 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14522 (set_state_table): handle the `lookaheads' members.
14523
14524 2001-11-19 Akim Demaille <akim@epita.fr>
14525
14526 * src/lalr.h (lookaheads): Removed array, whose contents is now
14527 a member of...
14528 (state_t): this structure.
14529 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14530 Adjust.
14531
14532 2001-11-19 Akim Demaille <akim@epita.fr>
14533
14534 * src/lalr.h (consistent): Removed array, whose contents is now
14535 a member of...
14536 (state_t): this structure.
14537 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14538 Adjust.
14539
14540 2001-11-19 Akim Demaille <akim@epita.fr>
14541
14542 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14543 contents are now members of...
14544 (state_t): this structure.
14545 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14546 Adjust.
14547
14548 2001-11-19 Akim Demaille <akim@epita.fr>
14549
14550 * src/lalr.h (state_t): New.
14551 (state_table): Be a state_t * instead of a core **.
14552 (accessing_symbol): Remove, part of state_t.
14553 * src/lalr.c: Adjust.
14554 (set_accessing_symbol): Merge into...
14555 (set_state_table): this.
14556 * src/print_graph.c, src/conflicts.c: Adjust.
14557
14558 2001-11-14 Akim Demaille <akim@epita.fr>
14559
14560 * tests/calc.at, tests/output.at, tests/regression.at,
14561 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14562 now the tests are run in private dirs, therefore AC_CLEANUP and
14563 family can be simplified to 0-ary.
14564 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14565 use abs. path to find config.h.
14566 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14567 stderr, there can be way too much random noise.
14568 Instead pass -Werror to GCC and rely on the exit status.
14569 Reported by Wolfram Wagner.
14570
14571 2001-11-14 Akim Demaille <akim@epita.fr>
14572
14573 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14574 defined only if yyoverflow is defined, to avoid `warning: unused
14575 variable `yyvs1''.
14576 Reported by The Test Suite.
14577
14578 2001-11-14 Akim Demaille <akim@epita.fr>
14579
14580 * src/print.c: Include reduce.h.
14581 Reported by Hans Aberg.
14582
14583 2001-11-14 Akim Demaille <akim@epita.fr>
14584
14585 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
14586 Revert a previous patch: these are really const.
14587 * src/conflicts.c (conflict_report): Additional useless pair of
14588 braces to pacify GCC's warnings for `if () if () {} else {}'.
14589 * src/lex.c (parse_percent_token): Replace equal_offset with
14590 arg_offset.
14591 arg is const.
14592 Be sure to strdup `arg' when used, since there is no reason for
14593 token_buffer not to change.
14594
14595 2001-11-14 Akim Demaille <akim@epita.fr>
14596
14597 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14598 definition.
14599 * src/main.c (main): Use them.
14600 Suggested by Hans Aberg.
14601
14602 2001-11-12 Akim Demaille <akim@epita.fr>
14603
14604 * src/system.h (ngettext): Now that we use ngettext, be sure to
14605 provide a default definition when NLS are not used.
14606
14607 2001-11-12 Akim Demaille <akim@epita.fr>
14608
14609 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
14610 Use @kbd to denote user input.
14611 (Language and Grammar): ANSIfy the example.
14612 Adjust its layout for info/notinfo.
14613 (Location Tracking Calc): Output error messages to stderr.
14614 Output locations in a more GNUtically correct way.
14615 Fix a couple of Englishos.
14616 Adjust @group/@end group pairs.
14617
14618 2001-11-12 Akim Demaille <akim@epita.fr>
14619
14620 %expect was not functioning at all.
14621
14622 * src/conflicts.c (expected_conflicts): Set to -1.
14623 (conflict_report): Use ngettext.
14624 (conflicts_print): Check %expect and make its violation an error.
14625 * doc/bison.texinfo (Expect Decl): Adjust.
14626 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
14627 * tests/regression.at (%expect not enough, %expect right)
14628 (%expect too much): New.
14629
14630 2001-11-12 Akim Demaille <akim@epita.fr>
14631
14632 * tests/regression.at (Conflicts): Rename as...
14633 (Unresolved SR Conflicts): this.
14634 (Solved SR Conflicts): New.
14635
14636 2001-11-12 Akim Demaille <akim@epita.fr>
14637
14638 * src/reduce.c (print_results): Rename as...
14639 (reduce_output): This.
14640 Output to OUT, passed as argument, instead of output_obstack.
14641 (dump_grammar): Likewise.
14642 (reduce_free): New.
14643 Also free V1.
14644 (reduce_grammar): No longer call reduce_output, since...
14645 * src/print.c (print_results): do it.
14646 * src/main.c (main): Call reduce_free;
14647
14648 2001-11-12 Akim Demaille <akim@epita.fr>
14649
14650 * src/conflicts.c (print_reductions): Accept OUT as argument.
14651 Output to it, not to output_obstack.
14652 * src/print.c (print_actions): Adjust.
14653
14654 2001-11-12 Akim Demaille <akim@epita.fr>
14655
14656 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
14657 the result instead of using...
14658 (src_total, rrc_total, src_count, rrc_count): Remove.
14659 (any_conflicts): Remove.
14660 (print_conflicts): Split into...
14661 (conflicts_print, conflicts_output): New.
14662 * src/conflicts.h: Adjust.
14663 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
14664 * src/print.c (print_grammar): Issue `\n' between two rules.
14665 * tests/regression.at (Conflicts): New.
14666 Reported by Tom Lane.
14667
14668 2001-11-12 Akim Demaille <akim@epita.fr>
14669
14670 * tests/regression.at (Invalid input): Remove, duplicate with
14671 ``Invalid input: 1''.
14672
14673 2001-11-12 Akim Demaille <akim@epita.fr>
14674
14675 * tests/torture.at (AT_DATA_STACK_TORTURE)
14676 (Exploding the Stack Size with Alloca)
14677 (Exploding the Stack Size with Malloc): New.
14678
14679 2001-11-12 Akim Demaille <akim@epita.fr>
14680
14681 * src/bison.simple (YYSTACK_REALLOC): New.
14682 (yyparse) [!yyoverflow]: Use it and free the old stack.
14683 Reported by Per Allansson.
14684
14685 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
14686
14687 * src/bison.simple: Define type yystype instead of YYSTYPE, and
14688 define CPP macro, which substitute YYSTYPE by yystype.
14689 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
14690 with yyltype/YYLTYPE. This allows inclusion of the generated
14691 header within the parser if the compiler, such as GGC, accepts
14692 multiple equivalent #defines.
14693 From Akim.
14694
14695 2001-11-05 Akim Demaille <akim@epita.fr>
14696
14697 * src/reader.c (symbols_output): New, extracted from...
14698 (packsymbols): here.
14699 (reader): Adjust.
14700
14701 2001-11-05 Akim Demaille <akim@epita.fr>
14702
14703 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14704
14705 2001-11-05 Akim Demaille <akim@epita.fr>
14706
14707 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14708 pattern.
14709
14710 2001-11-05 Akim Demaille <akim@epita.fr>
14711
14712 * src/options.h (struct option_table_struct): set_flags is void*.
14713 * src/options.c (longopts): Support `--output' and `%output'.
14714 (usage): Adjust.
14715 * src/lex.h (tok_setopt): Remove, replaced with...
14716 (tok_intopt, tok_stropt): these new guys.
14717 * src/lex.c (getopt.h): Not needed.
14718 (token_buffer, unlexed_token_buffer): Not const.
14719 (percent_table): Promote `-' over `_' in directive names.
14720 Active `%name-prefix', `file-prefix', and `output'.
14721 (parse_percent_token): Accept possible arguments to directives.
14722 Promote `-' over `_' in directive names.
14723
14724 2001-11-04 Akim Demaille <akim@epita.fr>
14725
14726 * doc/bison.texinfo (Decl Summary): Split the list into
14727 `directives for grammars' and `directives for bison'.
14728 Sort'em.
14729 Add description of `%name-prefix', `file-prefix', and `output'.
14730 Promote `-' over `_' in directive names.
14731 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14732 Simplify the description of `--name-prefix'.
14733 Promote `-' over `_' in directive names.
14734 Promote `--output' over `--output-file'.
14735 Fix the description of `--defines'.
14736 * tests/output.at: Exercise %file-prefix and %output.
14737
14738 2001-11-02 Akim Demaille <akim@epita.fr>
14739
14740 * doc/refcard.tex: Update.
14741
14742 2001-11-02 Akim Demaille <akim@epita.fr>
14743
14744 * src/symtab.h (SUNDEF): New.
14745 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14746 stand for `uninitialized', instead of 0.
14747 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14748 * src/lex.c (lex): Adjust.
14749
14750 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14751 Number it 0.
14752 Let yylex return it instead of a plain 0.
14753 Reported by Dick Streefland.
14754
14755 2001-11-02 Akim Demaille <akim@epita.fr>
14756
14757 * tests/regression.at (Mixing %token styles): New test.
14758
14759 2001-11-02 Akim Demaille <akim@epita.fr>
14760
14761 * src/reader.c (parse_thong_decl): Formatting changes.
14762 (token_translations_init): New, extracted from...
14763 (packsymbols): Here.
14764 Adjust.
14765
14766 2001-11-01 Akim Demaille <akim@epita.fr>
14767
14768 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14769 Check that `9foo.y' produces correct cpp guards.
14770 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14771 guards.
14772 Reported by Wwp.
14773
14774 2001-11-01 Akim Demaille <akim@epita.fr>
14775
14776 * tests/regression.at (Invalid input: 2): New.
14777 * src/lex.c (unlexed_token_buffer): New.
14778 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14779 too.
14780 Reported by Wwp.
14781
14782 2001-11-01 Akim Demaille <akim@epita.fr>
14783
14784 * tests/calc.at: Catch up with 1.30.
14785 * configure.in: Bump to 1.49a.
14786 Adjust to newer Autotest.
14787
14788 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
14789
14790 * src/conflicts.c: Move global variables rrc_total and src_total ...
14791 (print_conflicts): here.
14792 * src/output.c (output): Free global variable user_toknums.
14793 * src/lex.c (token_obstack): Become static.
14794
14795 2001-10-18 Akim Demaille <akim@epita.fr>
14796
14797 * tests/atlocal.in (GCC): Add.
14798 * tests/calc.at: s/m4_match/m4_bmatch/.
14799 s/m4_patsubst/m4_bpatsubst/.
14800 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14801 * configure.in: AC_SUBST(GCC).
14802
14803 2001-10-14 Marc Autret <autret_m@epita.fr>
14804
14805 * src/options.c (create_long_option_table): Fix.
14806
14807 2001-10-10 Akim Demaille <akim@epita.fr>
14808
14809 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14810
14811 2001-10-04 Akim Demaille <akim@epita.fr>
14812
14813 * src/reader.c (parse_union_decl): Push the caracters in
14814 union_obstack, not attrs_obstack.
14815
14816 2001-10-04 Akim Demaille <akim@epita.fr>
14817
14818 Merge in the branch 1.29.
14819
14820 * src/reader.c (packsymbols): Use a temporary obstack for
14821 `%%tokendef', since output_stack is already used elsewhere.
14822
14823 2001-10-02 Akim Demaille <akim@epita.fr>
14824
14825 Bump 1.29d.
14826
14827 2001-10-02 Akim Demaille <akim@epita.fr>
14828
14829 Version 1.29c.
14830
14831 2001-10-02 Akim Demaille <akim@epita.fr>
14832
14833 * tests/regression.at (Invalid CPP headers): New.
14834 From Alexander Belopolsky.
14835 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14836
14837 2001-10-02 Akim Demaille <akim@epita.fr>
14838
14839 * tests/regression.at (Invalid input): New.
14840 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14841 Reported by Shura.
14842
14843 2001-10-02 Akim Demaille <akim@epita.fr>
14844
14845 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14846
14847 2001-10-02 Akim Demaille <akim@epita.fr>
14848
14849 * src/output.c (output_parser): Assert `skeleton'.
14850 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14851 systems.
14852 From Shura.
14853
14854 2001-10-01 Marc Autret <autret_m@epita.fr>
14855
14856 * src/lex.h: Echo modifications.
14857 * src/lex.c (unlex): Parameter is now token_t.
14858 From Hans Aberg.
14859
14860 2001-10-01 Marc Autret <autret_m@epita.fr>
14861
14862 * src/main.c: Include lex.h.
14863 From Hans Aberg.
14864
14865 2001-09-29 Akim Demaille <akim@epita.fr>
14866
14867 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14868
14869 2001-09-28 Akim Demaille <akim@epita.fr>
14870
14871 * tests/testsuite.at: Update to newer Autotest.
14872 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14873
14874 2001-09-27 Akim Demaille <akim@epita.fr>
14875
14876 Position independent wrapper.
14877
14878 * tests/bison: Remove.
14879 * tests/bison.in: New.
14880 * configure.in: Adjust.
14881
14882 2001-09-27 Paul Eggert <eggert@twinsun.com>
14883
14884 Port quotearg fixes from tar 1.13.24.
14885
14886 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14887 tm to be declared.
14888 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14889 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14890
14891 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
14892 * m4/mbrtowc.m4: New file.
14893 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
14894 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
14895
14896 2001-09-27 Akim Demaille <akim@epita.fr>
14897
14898 Bump to 1.29c.
14899
14900 2001-09-27 Akim Demaille <akim@epita.fr>
14901
14902 Version 1.29b.
14903
14904 2001-09-25 Akim Demaille <akim@epita.fr>
14905
14906 * src/system.h: Include `xalloc.h'.
14907 Remove it from the C files.
14908 * src/files.c (output_files): Free the obstacks.
14909 * src/lex.c (init_lex): Rename as...
14910 (lex_init): this.
14911 (lex_free): New.
14912 * src/main.c (main): Use it.
14913
14914 2001-09-24 Marc Autret <autret_m@epita.fr>
14915
14916 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
14917 to output informations in fout (FILE*).
14918 (open_graph, close_graph): Likewise.
14919 (output_graph, output_edge, output_node): Likewise.
14920 * src/vcg.h: Update function prototypes.
14921 * src/print_graph.c (print_graph): Open output graph file.
14922 (print_actions): Adjust.
14923 * src/files.h: Remove extern declaration.
14924 * src/files.c: Remove graph_obstack declaration.
14925 (open_files): Remove graph_obstack initialization.
14926 (output_files): Remove graph_obstack saving.
14927
14928 2001-09-24 Marc Autret <autret_m@epita.fr>
14929
14930 * src/files.c (compute_output_file_names): Fix.
14931
14932 2001-09-24 Marc Autret <autret_m@epita.fr>,
14933 Akim Demaille <akim@epita.fr>
14934
14935 * src/reader.c (reader): Remove call to free_symtab ().
14936 * src/main.c (main): Call it here.
14937 Include symtab.h.
14938 * src/conflicts.c (initialize_conflicts): Rename as...
14939 (solve_conflicts): this.
14940 * src/print.c (print_core, print_actions, print_state)
14941 (print_grammar): Dump to a file instead a `output_obstack'.
14942 (print_results): Dump `output_obstack', and then proceed with the
14943 FILE *.
14944 * src/files.c (compute_output_file_names, close_files): New.
14945 (output_files): Adjust.
14946 * src/main.c (main): Adjust.
14947
14948 2001-09-23 Marc Autret <autret_m@epita.fr>
14949
14950 * src/files.c (compute_header_macro): Computes header macro name
14951 from spec_defines_file when given.
14952
14953 2001-09-23 Marc Autret <autret_m@epita.fr>
14954
14955 * src/files.c (output_files): Add default extensions.
14956
14957 2001-09-22 Akim Demaille <akim@epita.fr>
14958
14959 * src/conflicts.c (finalize_conflicts): Rename as...
14960 (free_conflicts): this.
14961
14962 2001-09-22 Akim Demaille <akim@epita.fr>
14963
14964 * src/gram.c (gram_free): Rename back as...
14965 (dummy): this.
14966 (output_token_translations): Free `token_translations'.
14967 * src/symtab.c (free_symtab): Free the tag field.
14968
14969 2001-09-22 Akim Demaille <akim@epita.fr>
14970
14971 Remove `translations' as it is always set to true.
14972
14973 * src/gram.h: Adjust.
14974 * src/reader.c (packsymbols, parse_token_decl): Adjust
14975 * src/print.c (print_grammar): Adjust.
14976 * src/output.c (output_token_translations): Adjust.
14977 * src/lex.c (lex): Adjust.
14978 * src/gram.c: Be sure the set pointers to NULL.
14979 (dummy): Rename as...
14980 (gram_free): this.
14981
14982 2001-09-22 Akim Demaille <akim@epita.fr>
14983
14984 * configure.in: Invoke AM_LIB_DMALLOC.
14985 * src/system.h: Use dmalloc.
14986 * src/LR0.c: Be sure to have pointers initialized to NULL.
14987 (allocate_itemsets): Allocate kernel_items only if needed.
14988
14989 2001-09-22 Akim Demaille <akim@epita.fr>
14990
14991 * configure.in: Bump to 1.29b.
14992 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
14993 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
14994 need xmalloc.c in calc.y.
14995 From Pascal Bart.
14996
14997 2001-09-21 Akim Demaille <akim@epita.fr>
14998
14999 Version 1.29a.
15000 * Makefile.maint, config/config.guess, config/config.sub,
15001 * config/missing: Update from masters.
15002 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15003 upon package.m4.
15004 * configure.in (ALL_LINGUAS): Add `tr'.
15005
15006 2001-09-21 Akim Demaille <akim@epita.fr>
15007
15008 * tests/Makefile.am (package.m4): Move to...
15009 ($(srcdir)/$(TESTSUITE)): here.
15010
15011 2001-09-20 Akim Demaille <akim@epita.fr>
15012
15013 * src/complain.c: No longer try to be standalone: use system.h.
15014 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15015 * src/complain.h: Likewise.
15016 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15017 Remove the unused variable `n'.
15018 From Albert Chin-A-Young.
15019
15020 2001-09-18 Marc Autret <autret_m@epita.fr>
15021
15022 * doc/bison.1: Update.
15023 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15024 descriptions.
15025 (Option Cross Key): Update.
15026 Add --graph.
15027
15028 2001-09-18 Marc Autret <autret_m@epita.fr>
15029
15030 * tests/regression.at: New test (comment in %union).
15031
15032 2001-09-18 Marc Autret <autret_m@epita.fr>
15033
15034 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15035 do that.
15036 Reported by Keith Browne.
15037
15038 2001-09-18 Marc Autret <autret_m@epita.fr>
15039
15040 * tests/output.at: Add tests for --defines and --graph.
15041
15042 2001-09-18 Marc Autret <autret_m@epita.fr>
15043
15044 * tests/output.at: Removes tests of %{header,src}_extension features.
15045
15046 2001-09-18 Akim Demaille <akim@epita.fr>
15047
15048 * tests/Makefile.am (package.m4): New.
15049 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15050 (_AT_CHECK_CALC_ERROR): Likewise.
15051 Factor the `, ' part of verbose error messages.
15052
15053 2001-09-18 Marc Autret <autret_m@epita.fr>
15054
15055 * src/getargs.c (longopts): Declare --defines and --graph as options
15056 with optional arguments.
15057 * src/files.h: Add extern declarations.
15058 * src/files.c (spec_graph_file, spec_defines_file): New.
15059 (output_files): Update.
15060 Remove CPP-outed code.
15061
15062 2001-09-18 Marc Autret <autret_m@epita.fr>
15063
15064 Turn off %{source,header}_extension feature.
15065
15066 * src/files.c (compute_exts_from_gf): Update.
15067 (compute_exts_from_src): Update.
15068 (output_files): CPP-out useless code.
15069 * src/files.h: Remove {header,source}_extension extern declarations.
15070 * src/reader.c (parse_dquoted_param): CPP-out.
15071 (parse_header_extension_decl): Remove.
15072 (parse_source_extension_decl): Remove.
15073 (read_declarations): Remove cases tok_{hdrext,srcext}.
15074 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15075 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15076
15077 2001-09-10 Akim Demaille <akim@epita.fr>
15078
15079 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15080 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15081 (AT_CHECK_OUTPUT): this.
15082 Merely check ls' exit status, its output is useless.
15083
15084 2001-09-10 Akim Demaille <akim@epita.fr>
15085
15086 * tests/calc.at: Use m4_match.
15087 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15088
15089 2001-09-10 Marc Autret <autret_m@epita.fr>,
15090 Akim Demaille <akim@epita.fr>
15091
15092 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15093 enum color_e.
15094 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15095 to `normal'.
15096 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15097 * src/lex.h: Adjust prototype.
15098 (token_t): Add `tok_undef'.
15099 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15100 (parse_percent_token): Now returns token_t.
15101 Add default statement in switch.
15102 (lex): Separate `c' as an input variable, from the token_t result
15103 part.
15104 (unlexed): Is a token_t.
15105
15106 2001-09-10 Akim Demaille <akim@epita.fr>
15107
15108 * configure.in: Bump to 1.29a.
15109
15110 2001-09-07 Akim Demaille <akim@epita.fr>
15111
15112 Version 1.29.
15113
15114 2001-08-30 Akim Demaille <akim@epita.fr>
15115
15116 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15117 * m4/atconfig.m4: Remove.
15118 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15119 * tests/bison: New.
15120 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15121 m4_if, m4_patsubst, and m4_regexp.
15122 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15123 `input' file instead of echo.
15124
15125 2001-08-29 Akim Demaille <akim@epita.fr>
15126
15127 Bump to 1.28e.
15128
15129 2001-08-29 Akim Demaille <akim@epita.fr>
15130
15131 Version 1.28d.
15132
15133 2001-08-29 Paul Eggert <eggert@twinsun.com>
15134
15135 * src/bison.simple (yyparse): Don't take the address of an
15136 item before the start of an array, as that doesn't conform to
15137 the C Standard.
15138
15139 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15140
15141 * doc/bison.texinfo (Location Tracking Calc): New node.
15142
15143 2001-08-29 Paul Eggert <eggert@twinsun.com>
15144
15145 * src/output.c (output): Do not define const, as this now
15146 causes more problems than it cures.
15147
15148 2001-08-29 Akim Demaille <akim@epita.fr>
15149
15150 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15151 the nodes.
15152 Be sure to tag the `detailmenu'.
15153
15154 2001-08-29 Akim Demaille <akim@epita.fr>
15155
15156 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15157 download in a tmp dir.
15158
15159 2001-08-28 Marc Autret <autret_m@epita.fr>
15160
15161 * config/depcomp: New file.
15162
15163 2001-08-28 Marc Autret <autret_m@epita.fr>
15164
15165 * doc/bison.1 (mandoc): Adjust.
15166 From Juan Manuel Guerrero.
15167
15168 2001-08-28 Marc Autret <autret_m@epita.fr>
15169
15170 * src/print_graph.c (print_state): Fix.
15171
15172 2001-08-27 Marc Autret <autret_m@epita.fr>
15173
15174 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15175 char * members.
15176 Echo modifications to the functions prototypes.
15177 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15178
15179 2001-08-27 Marc Autret <autret_m@epita.fr>
15180
15181 * src/vcg.c: Include `xalloc.h'.
15182 (add_colorentry): New.
15183 (add_classname): New.
15184 (add_infoname): New.
15185 * src/vcg.h: Add new prototypes.
15186
15187 2001-08-27 Akim Demaille <akim@epita.fr>
15188
15189 * Makefile.maint: Sync. again with CVS Autoconf.
15190
15191 2001-08-27 Akim Demaille <akim@epita.fr>
15192
15193 * Makefile.maint: Formatting changes.
15194 (po-update, cvs-update, update): New targets.
15195 (AMTAR): Remove.
15196
15197 2001-08-27 Akim Demaille <akim@epita.fr>
15198
15199 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15200 * Makefile.maint: Sync. with CVS Autoconf.
15201
15202 2001-08-27 Marc Autret <autret_m@epita.fr>
15203
15204 * src/vcg.h (struct infoname_s): New.
15205 (struct colorentry_s): New.
15206 (graph_s): New fields {vertical,horizontal}_order in structure.
15207 Add `infoname' field.
15208 Add `colorentry' field;
15209 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15210 (G_HORIZONTAL_ORDER): New.
15211 (G_INFONAME): New.
15212 (G_COLORENTRY): New.
15213 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15214 Add output of `infoname'.
15215 Add output of `colorentry'.
15216
15217 2001-08-27 Marc Autret <autret_m@epita.fr>
15218
15219 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15220 This one shadowed a global parameter.
15221
15222 2001-08-24 Marc Autret <autret_m@epita.fr>
15223
15224 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15225 instead of `unsigned'.
15226 (print_state): Do not call obstack_object_size () in obstack_grow ()
15227 to avoid macro variables shadowing.
15228
15229 2001-08-23 Marc Autret <autret_m@epita.fr>
15230
15231 * src/lex.c (percent_table): Typo: s/naem/name/.
15232 Add graph option.
15233 Normalize new options declarations.
15234
15235 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15236
15237 * tests/suite.at: Exercise %header_extension and %source_extension.
15238
15239 2001-08-16 Marc Autret <autret_m@epita.fr>
15240
15241 * src/reader.c (parse_dquoted_param): New.
15242 (parse_header_extension_decl): Use it.
15243 (parse_source_extension_decl): Likewise.
15244
15245 2001-08-16 Marc Autret <autret_m@epita.fr>
15246
15247 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15248 (get_xxxx_str): Use assert () instead of complain ().
15249 Remove return invokations in default cases.
15250 (get_decision_str): Modify default behaviour. Remove second argument.
15251 Echo modifications on calls.
15252 (output_graph): Fix.
15253
15254 2001-08-16 Marc Autret <autret_m@epita.fr>
15255
15256 * src/getargs.c (usage): Update with ``-g, --graph''.
15257
15258 2001-08-16 Marc Autret <autret_m@epita.fr>
15259
15260 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15261 (Option Cross Key): Likewise.
15262 * doc/bison.1: Update.
15263
15264 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
15265
15266 * src/output.c (output_master_parser): Don't finish action_obstack.
15267 (output_parser): Don't care about the muscle action, here.
15268 (prepare): Copy the action_obstack in the action muscle.
15269 (output): Free action_obstack.
15270
15271 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15272
15273 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15274 will contain `%union' declaration.
15275 (parse_union_decl): Delete #line directive output.
15276 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15277 informations about %union.
15278 (parse_union_decl): Copy the union_obstack in the muscle stype.
15279 * src/bison.simple: Add new #line directive.
15280 Add typdef %%stype YYSTYPE.
15281
15282 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15283
15284 * src/bison.simple: Add new `#line' directive.
15285
15286 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
15287
15288 * src/bison.simple: New `#line' directive.
15289 * src/output.c (output_parser): Support new dynamic muscle input_line.
15290
15291 2001-09-22 Marc Autret <autret_m@epita.fr>
15292
15293 * src/output.c (output_master_parser): New.
15294 (output_parser): Be more re-entrant.
15295
15296 2001-09-21 Marc Autret <autret_m@epita.fr>
15297
15298 * src/reader.c (copy_definition, parse_union_decl): Update and use
15299 `linef' muscle.
15300 (copy_action): Likewise.
15301 Use obstack_1grow ().
15302 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15303
15304 2001-09-21 Marc Autret <autret_m@epita.fr>
15305
15306 * src/options.c (option_table): Adjust.
15307 * src/lex.c (parse_percent_token): Fix.
15308
15309 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15310
15311 * src/options.c (symtab.h): Include it, need by lex.h.
15312
15313 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15314
15315 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15316 is now an option_table_struct*.
15317 (option_strcmp): New function option_strcmp.
15318 (parse_percent_token): Call option_strcmp.
15319 * src/getargs.c (xalloc.h, options.h): Include it.
15320 (getargs): Call create_long_option_table.
15321 (getargs): Free longopts at the end of the function.
15322 (shortopts): Move in options.c.
15323 * src/options.c (create_long_option_table): New function. Convert
15324 information from option_table to option structure.
15325 * src/reader.c (options.h): Include it.
15326
15327 * src/Makefile.am: Adjust.
15328 * src/options.c (option_table): Create from longopts and percent_table.
15329 * src/getargs.c (longopts): Delete.
15330 * src/lex.c (struct percent_table_struct): Delete.
15331 (percent_table): Delete.
15332 (options.h): Include it.
15333 * src/options.c: Create.
15334 * src/options.h: Create.
15335 Declare enum opt_access_e.
15336 Define struct option_table_struct.
15337
15338 2001-09-20 Marc Autret <autret_m@epita.fr>
15339
15340 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15341 sections of Bison.
15342
15343 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
15344
15345 * src/bison.simple: s/%%filename/%%skeleton.
15346 * src/muscle_tab.c (getargs.h): Include it.
15347 (muscle_init): Insert new muscle skeleton.
15348
15349 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
15350
15351 * src/output.c (output_parser): Delete unused variable actions_dumped.
15352
15353 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
15354
15355 * src/output.c (output): Delete call to reader_output_yylsp.
15356 * src/reader.c (reader): Likewise.
15357 * src/reader.h: Delete declaration of reader_output_yylsp.
15358
15359 2001-09-02 Marc Autret <autret_m@epita.fr>
15360
15361 * src/reader.c: Include muscle_tab.h.
15362 (parse_union_decl): Update.
15363 (parse_macro_decl): Rename parse_muscle_decl.
15364 Update to use renamed functions and variable.
15365 (read_declarations, copy_action, read_additionnal_code, : Updated
15366 with correct variables and functions names.
15367 (packsymbols, reader): Likewise.
15368
15369 * src/reader.h (muscle_obstack): Extern declaration update.
15370
15371 * src/output.c: Include muscle_tab.h
15372 In all functions using macro_insert, change by using muscle_insert ().
15373 (macro_obstack): Rename muscle_obstack.
15374 Echo modifications in the whole file.
15375 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15376 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15377 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15378
15379 * src/muscle_tab.h: Update double inclusion macros.
15380 (macro_entry_s): Rename muscle_entry_s.
15381 Update prototypes.
15382
15383 * src/muscle_tab.c: Include muscle_tab.h.
15384 Rename macro_tabble to muscle_table.
15385 (mhash1, mhash2, mcmp): Use muscle_entry.
15386 (macro_init): Rename muscle_init. Update.
15387 (macro_insert): Rename muscle_insert. Update.
15388 (macro_find): Rename muscle_find. Update.
15389
15390 * src/main.c: Include muscle_tab.h.
15391 (main): Call muscle_init ().
15392 * src/Makefile.am (bison_SOURCES): Echo modifications.
15393
15394 2001-09-02 Marc Autret <autret_m@epita.fr>
15395
15396 Now the files macro_tab.[ch] are named muscle_tab.[ch].
15397
15398 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15399
15400 2001-09-02 Marc Autret <autret_m@epita.fr>
15401
15402 * src/macrotab.c, src/macrotab.h: Remove.
15403
15404 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
15405
15406 * src/reader.c (copy_guard): Use muscle to specify the `#line'
15407 filename.
15408
15409 2001-09-01 Marc Autret <autret_m@epita.fr>
15410
15411 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15412 to an explicit value to activate the feature. We do it here.
15413
15414 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15415
15416 * src/output.c (prepare): Delete the `filename' muscule insertion.
15417 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15418 (parse_union_decl): Likewise.
15419 * src/macrotab.c (macro_init): Initialize filename by infile.
15420
15421 2001-08-31 Marc Autret <autret_m@epita.fr>
15422
15423 * src/bison.simple (YYLSP_NEEDED): New definition.
15424 * src/output.c (prepare): Add macro insertion of `locations_flag'
15425
15426 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15427
15428 * src/output.c (prepare): Delete insertion of previous muscles,
15429 and insert the `prefix' muscles.
15430 * src/macrotab.c (macro_init): Likewise.
15431 (macro_init): Initialization prefix directive by `yy'.
15432 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
15433 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15434 yylval, yydebug, yyerror, yynerrs and yyparse.
15435 New directive `#define' to substitute yydebug, ... with option
15436 name_prefix.
15437
15438 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15439
15440 * src/main.c (main): Standardize.
15441 * src/output.c (output_table_data, output_parser): Likewise.
15442 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15443
15444 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15445
15446 * src/reader.c (read_additionnal_code): Rename %%user_code to
15447 %%epilogue.
15448 * src/output.c (output): Rename %%declarations to %%prologue.
15449 * src/bison.simple: Echo modifications.
15450
15451 2001-08-31 Marc Autret <autret_m@epita.fr>
15452
15453 * src/reader.c (readgram): CleanUp.
15454 (output_token_defines): Likewise.
15455 (packsymbols): Likewise.
15456 (reader): Likewise.
15457 * src/output.c (output): CPP-out useless code.
15458
15459 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15460
15461 * src/reader.c (reader): Delete obsolete call to function
15462 output_trailers and output_headers.
15463 * src/output.h: Remove obsolete functions prototypes of output_headers
15464 and output_trailers.
15465
15466 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
15467
15468 * src/main.c: Include macrotab.h.
15469 * src/macrotab.h (macro_entry_s): Constify fields.
15470 Adjust functions prototypes.
15471 * src/macrotab.c (macro_insert): Constify key and value.
15472 (macro_find): Constify key.
15473 (macro_insert): Include 'xalloc.h'
15474 (macro_insert): Use XMALLOC.
15475 (macro_find): Constify return value.
15476 * src/output.c (output_table_data): Rename table to table_data.
15477 (output_parser): Constify macro_key, macro_value.
15478
15479 2001-08-30 Marc Autret <autret_m@epita.fr>
15480
15481 * src/reader.c (parse_skel_decl): New.
15482 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
15483 * src/lex.h (token_t): New token `tok_skel'.
15484 * src/lex.c (percent_table): Add skeleton option entry.
15485 Standardize.
15486
15487 2001-08-29 Marc Autret <autret_m@epita.fr>
15488
15489 * src/bison.simple: Add %%user_code directive at the end.
15490 * src/reader.c (read_additionnal_code): New.
15491 (reader): Use it.
15492 * src/output.c (output_program): Remove.
15493 (output): Update.
15494
15495 2001-08-28 Marc Autret <autret_m@epita.fr>
15496
15497 * src/output.c (output_actions): Clean up.
15498 (output_gram): CPP-out useless code.
15499 * src/reader.c (reader): Clean up, CPP-out useless code.
15500
15501 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
15502
15503 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
15504 directive.
15505 * src/bison.simple: Add `%%definitions'.
15506
15507 2001-08-28 Marc Autret <autret_m@epita.fr>
15508
15509 * config/depcomp: New file.
15510
15511 2001-08-27 Paul Eggert <eggert@twinsun.com>
15512
15513 * src/bison.simple (yyparse): Don't take the address of an
15514 item before the start of an array, as that doesn't conform to
15515 the C Standard.
15516
15517 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15518
15519 * src/output.c (output): Remove the initialization of the macro
15520 obstack. It was done too late here.
15521
15522 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15523 completely wrong.
15524 (reader): Initialize the macro obstack here, since we need it to grow
15525 '%define' directives.
15526
15527 * src/reader.h: Declare the macro obstack as extern.
15528
15529 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15530
15531 * src/output.c (output_parser): Fix. Store single '%' characters in
15532 the output obstack instead of throwing them away.
15533
15534 2001-08-27 Akim Demaille <akim@epita.fr>
15535
15536 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15537
15538 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15539
15540 * lib/Makefile.am: Adjust.
15541
15542 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15543
15544 * src/bison.simple: Update and add '%%' directives.
15545
15546 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15547
15548 * src/reader.c (reader): Remove calls to 'output_headers' and
15549 'output_trailers'. Remove some C output.
15550 (readgram): Disable a piece of code that was writing a default
15551 definition for 'YYSTYPE'.
15552 (reader_output_yylsp): Remove.
15553 (packsymbols): Output token defintions to a macro.
15554 (copy_definition): Disable C output.
15555
15556 * src/reader.c (parse_macro_decl): New function used to parse macro
15557 declarations.
15558 (copy_string2): Put the body of copy_string into this new function.
15559 Add a parameter to let the caller choose whether he wants to copy the
15560 string delimiters or not.
15561 (copy_string): Be a simple call to copy_string2 with the last argument
15562 bound to true.
15563 (read_declarations): Add case for macro definition.
15564 (copy_identifier): New.
15565 (parse_macro_decl): Read macro identifiers using copy_identifier
15566 rather than lex.
15567
15568 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15569
15570 * src/output.c (prepare): Add prefixed names.
15571 (output_parser): Output semantic actions.
15572 (output_parser): Fix bug on '%%line' directives.
15573
15574 * src/output.c (output_headers): Remove. The C code printed by this
15575 function should now be in the skeletons.
15576 (output_trailers): Remove.
15577 (output): Disable call to 'reader_output_yylsp'.
15578 (output_rule_data): Do not output tables to the table obstack.
15579
15580 * src/output.c: Remove some C dedicated output.
15581 Improve the use of macro and output obstacks.
15582 (output_defines): Remove.
15583
15584 * src/output.c (output_token_translations): Associate 'translate'
15585 table with a macro. No output to the table obstack.
15586 (output_gram): Same for 'rhs' and 'prhs'.
15587 (output_stos): Same for 'stos'.
15588 (output_rule_data): Same for 'r1' and 'r2'.
15589 (token_actions): Same for 'defact'.
15590 (goto_actions): Same for 'defgoto'.
15591 (output_base): Same for 'pact' and 'pgoto'.
15592 (output_table): Same for 'table'.
15593 (output_check): Same for 'check'.
15594
15595 * src/output.c (output_table_data): New function.
15596 (output_short_table): Remove.
15597 (output_short_or_char_table): Remove.
15598
15599 * src/output.c (output_parser): Replace most of the skeleton copy code
15600 with something new. Skeletons are now processed character by character
15601 rather than line by line, and Bison looks for '%%' macros. This is the
15602 first step in making Bison's output process (a lot) more flexible.
15603 (output_parser): Use the macro table.
15604
15605 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15606
15607 * src/main.c (main): Initialize the macro table.
15608
15609 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15610
15611 * src/lex.c (percent_table): Add tok_define.
15612 * src/lex.h: Add tok_define.
15613
15614 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15615
15616 * src/macrotab.c: New file.
15617 * src/macrotab.h: New file.
15618 * src/Makefile.am: Update.
15619
15620 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15621
15622 * lib/hash.c: New file.
15623 * lib/hash.h: New file.
15624 * lib/Makefile.am: Update.
15625
15626 2001-08-15 Akim Demaille <akim@epita.fr>
15627
15628 Version 1.28c.
15629
15630 2001-08-15 Marc Autret <autret_m@epita.fr>
15631
15632 * src/reader.c (readgram): Indent output macro YYSTYPE.
15633 (packsymbols): Likewise.
15634 (output_token_defines): Likewise.
15635 * src/files.c: Standardize.
15636 (compute_header_macro): New.
15637 (defines_obstack_save): New. Use compute_header_macro.
15638 (output_files): Update. Use defines_obstack_save.
15639
15640 2001-08-15 Akim Demaille <akim@epita.fr>
15641
15642 * doc/bison.texinfo (Table of Symbols): Document
15643 YYSTACK_USE_ALLOCA.
15644
15645 2001-08-15 Akim Demaille <akim@epita.fr>
15646
15647 * missing: Update from CVS Automake.
15648 * config/config.guess, config/config.sub, config/texinfo.tex:
15649 Update from gnu.org.
15650
15651 2001-08-15 Akim Demaille <akim@epita.fr>
15652
15653 * Makefile.maint: Sync with CVS Autoconf.
15654
15655 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
15656
15657 * doc/bison.texinfo: Include GNU Free Documentation License from
15658 `fdl.texi'.
15659 * doc/fdl.texi: Add to package.
15660
15661 2001-08-14 Marc Autret <autret_m@epita.fr>
15662
15663 Turn on %{source,header}_extension features.
15664
15665 * src/lex.c (percent_table): Un-CPP out header_extension and
15666 source_extension.
15667 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
15668 (compute_exts_from_src): Remove conditions. It restores priorities
15669 between options.
15670
15671 2001-08-14 Marc Autret <autret_m@epita.fr>
15672
15673 * src/files.c (compute_base_names): Add extensions computing when
15674 `--file-prefix' used.
15675 Standardize function calls.
15676
15677 2001-08-13 Marc Autret <autret_m@epita.fr>
15678
15679 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
15680 defining it (defined but null disables alloca).
15681
15682 2001-08-13 Marc Autret <autret_m@epita.fr>
15683
15684 * src/bison.simple (_yy_memcpy): CPP reformat.
15685
15686 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
15687
15688 * tests/atconfig.in (CPPFLAGS): Fix.
15689
15690 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
15691
15692 * doc/bison.texinfo: Include GNU General Public License from
15693 `gpl.texi'.
15694 * doc/gpl.texi: Add to package.
15695
15696 2001-08-10 Marc Autret <autret_m@epita.fr>
15697
15698 * src/print_graph.h: Fix.
15699 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15700
15701 2001-08-10 Akim Demaille <akim@epita.fr>
15702
15703 * src/system.h: Provide default declarations for stpcpy, strndup,
15704 and strnlen.
15705
15706 2001-08-10 Robert Anisko <anisko_r@epita.fr>
15707
15708 * doc/bison.texinfo (Locations): Update @$ stuff.
15709
15710 2001-08-09 Robert Anisko <anisko_r@epita.fr>
15711
15712 * src/bison.simple (YYLLOC_DEFAULT): Update.
15713 (yyparse): Adjust.
15714
15715 2001-08-08 Marc Autret <autret_m@epita.fr>
15716
15717 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
15718 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15719 Reported by Fabrice Bauzac.
15720
15721 2001-08-08 Marc Autret <autret_m@epita.fr>
15722
15723 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15724 * src/vcg.c (output_node): Fix.
15725 * src/vcg.h: Cleanup.
15726 * src/print_graph.c: Add comments.
15727 (node_output_size): New global variable. Simplify the formatting of
15728 the VCG graph output.
15729 (print_actions): Unused code is now used. It notifies the final state
15730 and no action states in the VCG graph. It also give the reduce actions.
15731 The `shift and goto' edges are red and the `go to state' edges are
15732 blue.
15733 Get the current node name and node_obstack by argument.
15734 (node_obstack): New variable.
15735 (print_state): Manage node_obstack.
15736 (print_core): Use node_obstack given by argument.
15737 A node is not only computed here but in print_actions also.
15738 (print_graph): CPP out useless code instead of commenting it.
15739
15740 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
15741
15742 * tests/atconfig.in (CPPFLAGS): Fix.
15743
15744 2001-08-07 Akim Demaille <akim@epita.fr>
15745
15746 * src/print_graph.c (quote): New.
15747 (print_core): Use it.
15748
15749 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
15750
15751 * src/vcg.c (complain.h): Include it.
15752 Unepitaize `return' invocations.
15753 [NDEBUG] (main): Remove.
15754 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
15755 * src/files.c (open_files): Initialize graph_obstack.
15756 * src/print_graph.c (print_actions): CPP out useless code.
15757 (print_core): Don't output the last `\n' in labels.
15758 Use `quote'.
15759 * src/files.c (output_files): Output the VCG file.
15760 * src/main.c (main): Invoke print_graph ();
15761
15762 2001-08-06 Marc Autret <autret_m@epita.fr>
15763
15764 Automaton VCG graph output.
15765 Using option ``-g'' or long option ``--graph'', you can generate
15766 a gram_filename.vcg file containing a VCG description of the LALR (1)
15767 automaton of your grammar.
15768
15769 * src/main.c: Call to print_graph() function.
15770 * src/getargs.h: Update.
15771 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15772 (graph_flag): New flag.
15773 (longopts): Update.
15774 (getargs): Add case `g'.
15775 * src/files.c (graph_obstack): New obstack struct.
15776 (open_files): Initialize new obstack.
15777 (output_files): Saves graph_obstack if required.
15778 * src/files.h (graph_obstack): New extern declaration.
15779 * src/Makefile.am: Add new source files.
15780
15781 2001-08-06 Marc Autret <autret_m@epita.fr>
15782
15783 * src/print_graph.c, src/print_graph.h (graph): New.
15784 * src/vcg.h: New file.
15785 * src/vcg.c: New file, VCG graph handling.
15786
15787 2001-08-06 Marc Autret <autret_m@epita.fr>
15788
15789 Add of %source_extension and %header_extension which specify
15790 the source or/and the header output file extension.
15791
15792 * src/files.c (compute_base_names): Remove initialisation of
15793 src_extension and header_extension.
15794 (compute_exts_from_gf): Update.
15795 (compute_exts_from_src): Update.
15796 (output_files): Update.
15797 * src/reader.c (parse_header_extension_decl): New.
15798 (parse_source_extension_decl): New.
15799 (read_declarations): New case statements for the new tokens.
15800 * src/lex.c (percent_table): Add entries for %source_extension
15801 and %header_extension.
15802 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15803
15804 2001-08-06 Marc Autret <autret_m@epita.fr>
15805
15806 * configure.in: Bump to 1.28c.
15807 * doc/bison.texinfo: Texinfo thingies.
15808
15809 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
15810
15811 * tests/atconfig.in (CPPFLAGS): Add.
15812 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15813
15814 2001-08-03 Akim Demaille <akim@epita.fr>
15815
15816 Version 1.28b.
15817
15818 2001-08-03 Akim Demaille <akim@epita.fr>
15819
15820 * tests/Makefile.am (check-local): Ship testsuite.
15821 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15822 Include `string.h'.
15823
15824 2001-08-03 Akim Demaille <akim@epita.fr>
15825
15826 * configure.in: Try using -Wformat when compiling.
15827
15828 2001-08-03 Akim Demaille <akim@epita.fr>
15829
15830 * configure.in: Bump to 1.28b.
15831
15832 2001-08-03 Akim Demaille <akim@epita.fr>
15833
15834 * src/complain.c: Adjust strerror_r portability issues.
15835
15836 2001-08-03 Akim Demaille <akim@epita.fr>
15837
15838 Version 1.28a.
15839
15840 2001-08-03 Akim Demaille <akim@epita.fr>
15841
15842 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15843 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15844 * src/getargs.c: Include complain.h.
15845 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15846 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15847
15848 2001-08-03 Akim Demaille <akim@epita.fr>
15849
15850 * src/reader.c (readgram): Display hidden chars in error messages.
15851
15852 2001-08-03 Akim Demaille <akim@epita.fr>
15853
15854 Update to gettext 0.10.39.
15855
15856 2001-08-03 Akim Demaille <akim@epita.fr>
15857
15858 * lib/strspn.c: New.
15859
15860 2001-08-01 Marc Autret <autret_m@epita.fr>
15861
15862 * doc/bison.texinfo: Update.
15863 * doc/bison.1 (mandoc): Update.
15864 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15865 * src/files.c: Support output files extensions computing.
15866 (src_extension): New static variable.
15867 (header_extension): New static variable.
15868 (tr): New function.
15869 (get_extension_index): New function, gets the index of an extension
15870 filename in a string.
15871 (compute_exts_from_gf): New function, computes extensions from the
15872 grammar file extension.
15873 (compute_exts_from_src): New functions, computes extensions from the
15874 C source file extension, file given by ``-o'' option.
15875 (compute_base_names): Update.
15876 (output_files): Update.
15877
15878 2001-08-01 Robert Anisko <anisko_r@epita.fr>
15879
15880 * doc/bison.texi: Document @$.
15881 (Locations): New section.
15882
15883 2001-07-18 Akim Demaille <akim@epita.fr>
15884
15885 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15886 * config/prev-version.txt, config/move-if-change: New.
15887 * Makefile.am: Adjust.
15888
15889 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
15890
15891 * src/bison.simple (yyparse): Suppress warning `comparaison
15892 between signed and unsigned'.
15893
15894 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
15895
15896 * src/getargs.h (raw_flag): Remove.
15897 * src/getargs.c: Die on `-r'/`--raw'.
15898 * src/lex.c (parse_percent_token): Die on `%raw'.
15899 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
15900 * tests/calc.at: Suppress test with option `--raw'.
15901
15902 2001-07-14 Akim Demaille <akim@epita.fr>
15903
15904 * config/: New.
15905 * configure.in: Require Autoconf 2.50.
15906 Update to gettext 0.10.38.
15907
15908 2001-03-16 Akim Demaille <akim@epita.fr>
15909
15910 * doc/bison.texinfo: ANSIfy the examples.
15911
15912 2001-03-16 Akim Demaille <akim@epita.fr>
15913
15914 * getargs.c (skeleton): New variable.
15915 (longopts): --skeleton is a new option.
15916 (shortopts, getargs): -S is a new option.
15917 * getargs.h: Declare skeleton.
15918 * output.c (output_parser): Use it.
15919
15920 2001-03-16 Akim Demaille <akim@epita.fr>
15921
15922 * m4/strerror_r.m4: New.
15923 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15924 * lib/error.h, lib/error.c: Update.
15925
15926 2001-03-16 Akim Demaille <akim@epita.fr>
15927
15928 * src/getargs.c (longopts): Clean up.
15929
15930 2001-02-21 Akim Demaille <akim@epita.fr>
15931
15932 * src/reader.c (gensym): `gensym_count' is your own.
15933 Use a static buf to create the symbol name, as token_buffer is no
15934 longer a buffer.
15935
15936 2001-02-08 Akim Demaille <akim@epita.fr>
15937
15938 * src/conflicts.c (conflict_report): Be sure not to append to res
15939 between two calls, which could happen if both first sprintf were
15940 skipped, but not the first cp += strlen.
15941
15942 2001-02-08 Akim Demaille <akim@epita.fr>
15943
15944 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
15945 New, from fileutils 4.0.37.
15946 * configure.in: Require Autoconf 2.49c. I took some time before
15947 making this decision. This is the only way out for portability
15948 issues in Bison, it would mean way too much duplicate effort to
15949 import in Bison features implemented in 2.49c since 2.13.
15950 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15951
15952 2001-02-02 Akim Demaille <akim@epita.fr>
15953
15954 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
15955 * lib/xalloc.h, lib/xmalloc.c: Update.
15956
15957 2001-01-19 Akim Demaille <akim@epita.fr>
15958
15959 Get rid of the ad hoc handling of token_buffer in the scanner: use
15960 the obstacks.
15961
15962 * src/lex.c (token_obstack): New.
15963 (init_lex): Initialize it. No longer call...
15964 (grow_token_buffer): this. Remove it.
15965 Adjust all the places which used it to use the obstack.
15966
15967 2001-01-19 Akim Demaille <akim@epita.fr>
15968
15969 * src/lex.h: Rename all the tokens:
15970 s/\bENDFILE\b/tok_eof/g;
15971 s/\bIDENTIFIER\b/tok_identifier/g;
15972 etc.
15973 Let them be enums, not #define, to ease debugging.
15974 Adjust all the code.
15975
15976 2001-01-18 Akim Demaille <akim@epita.fr>
15977
15978 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15979 * src/lex.c (maxtoken, grow_token_buffer): Static.
15980
15981 2001-01-18 Akim Demaille <akim@epita.fr>
15982
15983 Since we now use obstacks, more % directives can be enabled.
15984
15985 * src/lex.c (percent_table): Also accept `%yacc',
15986 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15987 `%debug'.
15988 Handle the actions for `%semantic_parser' and `%pure_parser' here,
15989 instead of returning a token.
15990 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
15991 * src/reader.c (read_declarations): Adjust.
15992 * src/files.c (open_files): Don't call `compute_base_names', don't
15993 compute `attrsfile' since they depend upon data which might be
15994 *in* the input file now.
15995 (output_files): Do it here.
15996 * src/output.c (output_headers): Document the fact that this patch
15997 introduces a guaranteed SEGV for semantic parsers.
15998 * doc/bison.texinfo: Document them.
15999 * tests/suite.at: Exercise these %options.
16000
16001 2000-12-20 Akim Demaille <akim@epita.fr>
16002
16003 Also handle the output file (--verbose) with obstacks.
16004
16005 * files.c (foutput): Remove.
16006 (output_obstack): New.
16007 Adjust all dependencies.
16008 * src/conflicts.c: Return a string.
16009 * src/system.h (obstack_grow_string): Rename as...
16010 (obstack_sgrow): this. Be ready to work with non literals.
16011 (obstack_fgrow4): New.
16012
16013 2000-12-20 Akim Demaille <akim@epita.fr>
16014
16015 * src/files.c (open_files): Fix the computation of short_base_name
16016 in the case of `-o foo.tab.c'.
16017
16018 2000-12-20 Akim Demaille <akim@epita.fr>
16019
16020 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16021 (copy_dollar): Now that everything uses obstacks, get rid of the
16022 FILE * parameters.
16023
16024 2000-12-20 Akim Demaille <akim@epita.fr>
16025
16026 * src/files.c (open_files): Actually the `.output' file is based
16027 on the short_base_name, not base_name.
16028 * tests/suite.at (Checking output file names): Adjust.
16029
16030 2000-12-20 Akim Demaille <akim@epita.fr>
16031
16032 * src/bison.s1: Remove, we now use directly...
16033 * src/bison.simple: this.
16034 * src/Makefile.am: Use pkgdata instead of data.
16035
16036 2000-12-20 Akim Demaille <akim@epita.fr>
16037
16038 * src/files.c (guard_obstack): New.
16039 (open_files): Initialize it.
16040 (output_files): Dump it...
16041 * src/files.h: Export it.
16042 * src/reader.c (copy_guard): Use it.
16043
16044 2000-12-19 Akim Demaille <akim@epita.fr>
16045
16046 * src/files.c (outfile, defsfile, actfile): Removed as global
16047 vars.
16048 (open_files): Don't compute them.
16049 (output_files): Adjust.
16050 (base_name, short_base_name): Be global.
16051 Adjust dependencies.
16052
16053 2000-12-19 Akim Demaille <akim@epita.fr>
16054
16055 * src/files.c (strsuffix): New.
16056 (stringappend): Be just like strcat but allocate.
16057 (base_names): Eve out from open_files.
16058 Try to simplify the rather hairy computation of base_name and
16059 short_base_name.
16060 (open_files): Use it.
16061 * tests/suite.at (Checking output file names): New test.
16062
16063 2000-12-19 Akim Demaille <akim@epita.fr>
16064
16065 * src/system.h (obstack_grow_literal_string): Rename as...
16066 (obstack_grow_string): this.
16067 * src/output.c (output_parser): Recognize `%% actions' instead of
16068 `$'.
16069 * src/bison.s1: s/$/%% actions/.
16070 * src/bison.hairy: Likewise.
16071
16072 2000-12-19 Akim Demaille <akim@epita.fr>
16073
16074 * src/output.c (output_parser): Compute the `#line' lines when
16075 there are.
16076 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16077 Suggested by Hans Aberg.
16078
16079 2000-12-19 Akim Demaille <akim@epita.fr>
16080
16081 Let the handling of the skeleton files be local to the procedures
16082 that use it.
16083
16084 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16085 longer static.
16086 (fparser, open_extra_files): Remove.
16087 (open_files, output_files): Don't take care of fparser.
16088 * src/files.h: Adjust.
16089 * src/output.c (output_parser): Open and close the file to the
16090 skeleton.
16091 * src/reader.c (read_declarations): When %semantic_parser, open
16092 fguard.
16093
16094 2000-12-19 Akim Demaille <akim@epita.fr>
16095
16096 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16097 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16098
16099 2000-12-19 Akim Demaille <akim@epita.fr>
16100
16101 * src/files.c (open_files): Yipee! We no longer need all the code
16102 looking for `/tmp' since we have no tmp file.
16103
16104 2000-12-19 Akim Demaille <akim@epita.fr>
16105
16106 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16107 New macros.
16108 * src/files.c (open_files): Less dependency on MSDOS etc.
16109
16110 2000-12-14 Akim Demaille <akim@epita.fr>
16111
16112 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16113 Provide a default definition.
16114 Use it when executing the default @ action.
16115 * src/reader.c (reader_output_yylsp): No longer include
16116 `timestamp' and `text' in the default YYLTYPE.
16117
16118 2000-12-12 Akim Demaille <akim@epita.fr>
16119
16120 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16121 (copy_guard): Quote the file names.
16122 Reported by Laurent Mascherpa.
16123
16124 2000-12-12 Akim Demaille <akim@epita.fr>
16125
16126 * src/output.c (output_headers, output_program, output): Be sure
16127 to escape special characters when outputting filenames.
16128 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16129 (output_headers): Don't depend on them, Use ACTSTR.
16130
16131 2000-11-17 Akim Demaille <akim@epita.fr>
16132
16133 * lib/obstack.h: Formatting changes.
16134 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16135 prevents type checking.
16136 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16137 cast the value to (void *): assigning a `foo *' to a `void *'
16138 variable is valid.
16139 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16140 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16141 append characters.
16142
16143 2000-11-17 Akim Demaille <akim@epita.fr>
16144
16145 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16146 as...
16147 (suite.m4, regression.m4, calc.m4): these.
16148 * tests/atgeneral.m4: Update from CVS Autoconf.
16149
16150 2000-11-17 Akim Demaille <akim@epita.fr>
16151
16152 * tests/regression.m4 (%union and --defines): New test,
16153 demonstrating a current bug in the obstack implementation.
16154
16155 2000-11-17 Akim Demaille <akim@epita.fr>
16156
16157 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16158 macros.
16159 Use them to declare the variables which are global or local to
16160 `yyparse'.
16161
16162 2000-11-17 Akim Demaille <akim@epita.fr>
16163
16164 * acconfig.h: Remove, no longer used.
16165
16166 2000-11-07 Akim Demaille <akim@epita.fr>
16167
16168 * src: s/Copyright (C)/Copyright/g.
16169
16170 2000-11-07 Akim Demaille <akim@epita.fr>
16171
16172 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16173 defining.
16174 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16175
16176 2000-11-07 Akim Demaille <akim@epita.fr>
16177
16178 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16179 Merge in a single CPP if/else.
16180
16181 2000-11-07 Akim Demaille <akim@epita.fr>
16182
16183 * src/output.c (output): Remove useless variables.
16184 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16185 argument `data' for consistency with the prototypes.
16186 Qualify it `const'.
16187 (obstack_copy, obstack_copy0): Rename the second argument as
16188 `address' for consistency. Qualify it `const'.
16189 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16190 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16191 `const' their input argument (`data' or `address').
16192 Adjust the corresponding macros to include `const' in casts.
16193
16194 2000-11-03 Akim Demaille <akim@epita.fr>
16195
16196 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16197 s/PFILE1/BISON_HAIRY/.
16198 Adjust dependencies.
16199
16200 2000-11-03 Akim Demaille <akim@epita.fr>
16201
16202 For some reason, this was not applied.
16203
16204 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16205 `unlink': it's no longer used.
16206
16207 2000-11-03 Akim Demaille <akim@epita.fr>
16208
16209 * src/files.c (skeleton_find): New function, eved out of...
16210 (open_files, open_extra_files): here.
16211
16212 2000-11-03 Akim Demaille <akim@epita.fr>
16213
16214 Don't use `atexit'.
16215
16216 * src/files.c (obstack_save): New function.
16217 (done): Rename as...
16218 (output_files): this.
16219 Use `obstack_save'.
16220 * src/main.c (main): Don't use `atexit' to register `done', since
16221 it no longer has to remove tmp files, just call `output_files'
16222 when there are no errors.
16223
16224 2000-11-02 Akim Demaille <akim@epita.fr>
16225
16226 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16227 `unlink': it's no longer used.
16228 * src/files.h: Formatting changes.
16229
16230 2000-11-02 Akim Demaille <akim@epita.fr>
16231
16232 Remove the last uses of mktemp and unlink/delete.
16233
16234 * src/files.c (fdefines, ftable): Removed.
16235 (defines_ostack, table_obstack): New.
16236 Adjust dependencies of the former into uses of the latter.
16237 * src/output.c (output_short_or_char_table, output_short_table):
16238 Convert to using obstacks.
16239 * src/reader.c (copy_comment2): Accept one FILE * and two
16240 obstacks.
16241 (output_token_defines, reader_output_yylsp): Use obstacks.
16242 * src/system.h (obstack_fgrow3): New.
16243 * po/POTFILES.in: Adjust.
16244
16245 2000-11-01 Akim Demaille <akim@epita.fr>
16246
16247 Change each use of `fattrs' into a use of `attrs_obstack'.
16248
16249 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16250 * src/files.c (fattrs): Remove.
16251 (attrs_obstack): New.
16252 Adjust all dependencies.
16253 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16254
16255 2000-11-01 Akim Demaille <akim@epita.fr>
16256
16257 Introduce obstacks.
16258 Change each use of `faction' into a use of `action_obstack'.
16259
16260 * lib/obstack.h, lib/obstack.c: New files.
16261 * src/files.c (faction): Remove.
16262 (action_obstack): New.
16263 Adjust all dependencies.
16264
16265 2000-10-20 Akim Demaille <akim@epita.fr>
16266
16267 * lib/quote.h (PARAMS): New macro. Use it.
16268
16269 2000-10-16 Akim Demaille <akim@epita.fr>
16270
16271 * src/output.c (output_short_or_char_table): New function.
16272 (output_short_table, output_token_translations): Use it.
16273 (goto_actions): Use output_short_table.
16274
16275 2000-10-16 Akim Demaille <akim@epita.fr>
16276
16277 * src/symtab.c (bucket_new): New function.
16278 (getsym): Use it.
16279
16280 * src/output.c (output_short_table): New argument to display the
16281 comment associated with the table.
16282 Adjust dependencies.
16283 (output_gram): Use it.
16284 (output_rule_data): Nicer output layout for YYTNAME.
16285
16286 2000-10-16 Akim Demaille <akim@epita.fr>
16287
16288 * src/lex.c (read_typename): New function.
16289 (lex): Use it.
16290 * src/reader.c (copy_dollar): Likewise.
16291
16292 2000-10-16 Akim Demaille <akim@epita.fr>
16293
16294 * src/reader.c (copy_comment2): Expect the input stream to be on
16295 the `/' which is suspected to open a comment, instead of being
16296 called after `//' or `/*' was read.
16297 (copy_comment, copy_definition, parse_union_decl, copy_action)
16298 (copy_guard): Adjust.
16299
16300 2000-10-16 Akim Demaille <akim@epita.fr>
16301
16302 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16303 `read_signed_integer'.
16304
16305 2000-10-16 Akim Demaille <akim@epita.fr>
16306
16307 * src/reader.c (copy_dollar): New function.
16308 (copy_guard, copy_action): Use it.
16309
16310 2000-10-16 Akim Demaille <akim@epita.fr>
16311
16312 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16313 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16314 New files, from Fileutils 4.0.27.
16315 * src/main.c (printable_version): Remove.
16316 * src/lex.c, src/reader.c: Use `quote'.
16317
16318 2000-10-04 Akim Demaille <akim@epita.fr>
16319
16320 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16321
16322 2000-10-04 Akim Demaille <akim@epita.fr>
16323
16324 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16325
16326 2000-10-04 Akim Demaille <akim@epita.fr>
16327
16328 When a literal string is used to define two different tokens,
16329 `bison -v' segfaults.
16330 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16331
16332 * tests/regression.m4: New file.
16333 Include the core of the sample provided by Piotr Gackiewicz.
16334 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16335 properly.
16336
16337 2000-10-04 Akim Demaille <akim@epita.fr>
16338
16339 * src/reader.c (parse_expect_decl): Keep `count' within the size
16340 of `buffer'.
16341 From Neil Booth.
16342
16343 2000-10-02 Paul Eggert <eggert@twinsun.com>
16344
16345 * bison.s1 (yyparse): Assign the default value
16346 unconditionally, to avoid a GCC warning and make the parser a
16347 tad smaller.
16348
16349 2000-10-02 Akim Demaille <akim@epita.fr>
16350
16351 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16352 options.
16353
16354 2000-10-02 Akim Demaille <akim@epita.fr>
16355
16356 * src/derives.c, src/print.c, src/reduce.c: To ease the
16357 translation, move some `\n' out of the translated strings.
16358
16359 2000-10-02 Akim Demaille <akim@epita.fr>
16360
16361 The location tracking mechanism is precious for parse error
16362 messages. Nevertheless, it is enabled only when `@n' is used in
16363 the grammar, which is a different issue (you can use it in error
16364 message, but not in the grammar per se). Therefore, there should
16365 be another means to enable it.
16366
16367 * src/getargs.c (getargs): Support `--locations'.
16368 (usage): Report it.
16369 * src/getargs.h (locationsflag): Export it.
16370 * src/lex.c (percent_table): Support `%locations'.
16371 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16372 with `locationsflag'.
16373 * doc/bison.texinfo: Document `--locations' and `%locations'.
16374 Sort the options.
16375 * tests/calc.m4: Test it.
16376
16377 For regularity of the names, replace each
16378 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16379 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16380 In addition replace each `flag' with `_flag'.
16381
16382 2000-10-02 Akim Demaille <akim@epita.fr>
16383
16384 Also test parse error messages, including with YYERROR_VERBOSE.
16385
16386 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16387 associative).
16388 Use it to check the computations.
16389 Use it to check `nonassoc' is honored.
16390 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16391 `--yyerror-verbose'.
16392 (_AT_CHECK_CALC): Adjust to this option.
16393 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16394
16395 2000-10-02 Akim Demaille <akim@epita.fr>
16396
16397 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16398 the latter demonstrates a flaw in the handling of non debugging
16399 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16400 was used in order to simplify:
16401
16402 #if YYDEBUG
16403 if (yydebug)
16404 {
16405 ...
16406 }
16407 #endif
16408
16409 into
16410
16411 if (yydebug)
16412 {
16413 ...
16414 }
16415
16416 unfortunately this leads to a CPP conflict when
16417 `--name-prefix=foo' is used since it produces `#define yydebug
16418 foodebug'.
16419
16420 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16421 (YYDPRINTF): New macro.
16422 Spread its use.
16423 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16424 the bison options.
16425 Also test `--verbose', `--defines' and `--name-prefix'.
16426
16427 2000-10-02 Akim Demaille <akim@epita.fr>
16428
16429 Improve the readability of the produced parsers.
16430
16431 * src/bison.s1: Formatting changes.
16432 Improve the comment related to the `$' mark.
16433 (yydefault): Don't fall through to `yyresume': `goto' there.
16434 * src/output.c (output_parser): When the `$' is met, skip the end
16435 of its line.
16436 New variable, `number_of_dollar_signs', to check there's exactly
16437 one `$' in the parser skeleton.
16438
16439 2000-10-02 Akim Demaille <akim@epita.fr>
16440
16441 * lib/xstrdup.c: New file, from the fileutils.
16442 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16443 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16444 instead of strlen + xmalloc + strcpy.
16445 * src/symtab.c (copys): Remove, use xstrdup instead.
16446
16447 2000-10-02 Akim Demaille <akim@epita.fr>
16448
16449 * src/gram.h (associativity): New enum type which replaces the
16450 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16451 `right_assoc', `left_assoc' and `non_assoc'.
16452 Adjust all dependencies.
16453 * src/reader.c: Formatting changes.
16454 (LTYPESTR): Don't define it, use it as a literal in
16455 `reader_output_yylsp'.
16456 * src/symtab.h (symbol_class): New enum type which replaces the
16457 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16458 `sunknown', `stoken and `snterm'.
16459
16460 2000-10-02 Akim Demaille <akim@epita.fr>
16461
16462 * src/getargs.c (fixed_outfiles): Rename as...
16463 (yaccflag): for consistency and accuracy.
16464 Adjust dependencies.
16465
16466 2000-10-02 Akim Demaille <akim@epita.fr>
16467
16468 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16469 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16470 difficult and introduced a lot of core dump. It turns out that
16471 Bison used an implementation of `xmalloc' based on `calloc', and
16472 at various places it does depend upon the initialization to 0. I
16473 have not tried to isolate the pertinent places, and all the former
16474 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16475 someone should address this issue.
16476
16477 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16478 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16479 files.
16480 Adjust dependencies.
16481 * src/warshall.h: New file.
16482 Propagate.
16483
16484 2000-10-02 Akim Demaille <akim@epita.fr>
16485
16486 Various anti-`extern in *.c' changes.
16487
16488 * src/system.h: Include `assert.h'.
16489
16490 2000-10-02 Akim Demaille <akim@epita.fr>
16491
16492 * src/state.h (nstates, final_state, first_state, first_shift)
16493 (first_reduction): Move their exportation from here...
16494 * src/LR0.h: to here.
16495 Adjust dependencies.
16496 * src/getargs.c (statisticsflag): New variable.
16497 Add support for `--statistics'.
16498 Adjust dependencies.
16499
16500 Remove a lot of now useless `extern' statements in most files.
16501
16502 2000-10-02 Akim Demaille <akim@epita.fr>
16503
16504 * src/LR0.h: New file.
16505 Propagate its use.
16506
16507 2000-10-02 Akim Demaille <akim@epita.fr>
16508
16509 * src/print.h: New file.
16510 Propagate its use.
16511 * src/print.c: Formatting and ordering changes.
16512 (verbose, terse): Replace with...
16513 (print_results): this new function.
16514 Adjust dependencies.
16515
16516 2000-10-02 Akim Demaille <akim@epita.fr>
16517
16518 * src/conflicts.c (conflict_report): New function.
16519 (conflict_log, verbose_conflict_log): Replace with...
16520 (print_conflicts): this function.
16521 Adjust dependencies.
16522 * src/conflicts.h: New file.
16523 Propagate its inclusion.
16524
16525 2000-10-02 Akim Demaille <akim@epita.fr>
16526
16527 * src/nullable.h: New file.
16528 Propagate its inclusion.
16529 * src/nullable.c: Formatting changes.
16530
16531 2000-10-02 Akim Demaille <akim@epita.fr>
16532
16533 * src/reduce.h: New file.
16534 Propagate its inclusion.
16535 * src/reduce.c: Topological sort and other formatting changes.
16536 (bool, TRUE, FALSE): Move their definition to...
16537 * src/system.h: here.
16538
16539 2000-10-02 Akim Demaille <akim@epita.fr>
16540
16541 * src/files.c: Formatting changes.
16542 (tryopen, tryclose, openfiles): Rename as...
16543 (xfopen, xfclose, open_files): this.
16544 (stringappend): static.
16545 * src/files.h: Complete the list of exported symbols.
16546 Propagate its use.
16547
16548 2000-10-02 Akim Demaille <akim@epita.fr>
16549
16550 * src/reader.h: New file.
16551 Propagate its use instead of tedious list of `extern' and
16552 prototypes.
16553 * src/reader.c: Formatting changes, topological sort,
16554 s/register//.
16555
16556 2000-10-02 Akim Demaille <akim@epita.fr>
16557
16558 * src/lex.h: Prototype `lex.c' exported functions.
16559 * src/reader.c: Adjust.
16560 * src/lex.c: Formatting changes.
16561 (safegetc): Rename as...
16562 (xgetc): this.
16563
16564 2000-10-02 Akim Demaille <akim@epita.fr>
16565
16566 * src/lalr.h: New file.
16567 Propagate its inclusion instead of prototypes and `extern'.
16568 * src/lalr.c: Formatting changes, topological sorting etc.
16569
16570 2000-10-02 Akim Demaille <akim@epita.fr>
16571
16572 * src/output.c (token_actions): Introduce a temporary array,
16573 YYDEFACT, that makes it possible for this function to use
16574 output_short_table.
16575
16576 2000-10-02 Akim Demaille <akim@epita.fr>
16577
16578 `user_toknums' is output as a `short[]' in `output.c', while it is
16579 defined as a `int[]' in `reader.c'. For consistency with the
16580 other output tables, `user_toknums' is now defined as a table of
16581 shorts.
16582
16583 * src/reader.c (user_toknums): Be a short table instead of an int
16584 table.
16585 Adjust dependencies.
16586
16587 Factor the short table outputs.
16588
16589 * src/output.c (output_short_table): New function.
16590 * src/output.c (output_gram, output_stos, output_rule_data)
16591 (output_base, output_table, output_check): Use it.
16592
16593 2000-10-02 Akim Demaille <akim@epita.fr>
16594
16595 * src/output.c (output): Topological sort of the functions, in
16596 order to get rid of the `static' prototypes.
16597 No longer use `register'.
16598 * src/output.h: New file.
16599 Propagate its inclusion in files explicitly prototyping functions
16600 from output.c.
16601
16602 2000-09-21 Akim Demaille <akim@epita.fr>
16603
16604 * src/atgeneral.m4: Update from Autoconf.
16605
16606 2000-09-21 Akim Demaille <akim@epita.fr>
16607
16608 * src/closure.h: New file.
16609 * src/closure.c: Formatting changes, topological sort over the
16610 functions, use of closure.h.
16611 (initialize_closure, finalize_closure): Rename as...
16612 (new_closure, free_closure): these. Adjust dependencies.
16613 * src/LR0.c: Formatting changes, topological sort, use of
16614 cloture.h.
16615 (initialize_states): Rename as...
16616 (new_states): this.
16617 * src/Makefile.am (noinst_HEADERS): Adjust.
16618
16619 2000-09-20 Akim Demaille <akim@epita.fr>
16620
16621 * src/acconfig.h: Don't protect config.h against multiple
16622 inclusion.
16623 Don't define PARAMS.
16624 * src/system.h: Define PARAMS.
16625 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
16626 purpose of config.h. system.h must not try to fix wrong
16627 definitions in config.h.
16628
16629 2000-09-20 Akim Demaille <akim@epita.fr>
16630
16631 * src/derives.h: New file.
16632 * src/main.c, src/derives.h: Use it.
16633 Formatting changes.
16634 * src/Makefile.am (noinst_HEADERS): Adjust.
16635
16636 2000-09-20 Akim Demaille <akim@epita.fr>
16637
16638 * tests/atgeneral.m4: Update from Autoconf.
16639 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
16640 (AT_CHECK_CALC): New macros.
16641 Use these macros to test bison with options `', `--raw',
16642 `--debug', `--yacc', `--yacc --debug'.
16643
16644 2000-09-19 Akim Demaille <akim@epita.fr>
16645
16646 * src/output.c: Formatting changes.
16647 * src/machine.h: Remove, leaving its contents in...
16648 * src/system.h: here.
16649 Include stdio.h.
16650 Adjust all dependencies on stdio.h and machine.h.
16651 * src/getargs.h: New file.
16652 Let all `extern' declarations about getargs.c be replaced with
16653 inclusion of `getargs.h'.
16654 * src/Makefile.am (noinst_HEADERS): Adjust.
16655
16656 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16657 scope.
16658 (yyerror): Returns void, not int.
16659 * doc/bison.texinfo: Formatting changes.
16660
16661 2000-09-19 Akim Demaille <akim@epita.fr>
16662
16663 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16664 portable.
16665
16666 2000-09-18 Akim Demaille <akim@epita.fr>
16667
16668 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16669 * src/Makefile.am (INCLUDES): Don't.
16670 Be ready to fetch headers in lib/.
16671
16672 2000-09-18 Akim Demaille <akim@epita.fr>
16673
16674 * doc/bison.texinfo: Update the copyright.
16675 ANSIfy and GNUify the examples.
16676 Remove the old menu.
16677
16678 2000-09-18 Akim Demaille <akim@epita.fr>
16679
16680 First set of tests: use the `calc' example from the documentation.
16681
16682 * src/bison.s1 (yyparse): Condition the code using `yytname' which
16683 is defined only when YYDEBUG is.
16684 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
16685 * src/files.c (tryopen, tryclose): Formatting changes.
16686 Move to the top and be static.
16687 * src/reader.c (read_signed_integer): Likewise.
16688 * tests/calc.m4: New file.
16689 * Makefile.am, suite.m4: Adjust.
16690 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
16691
16692 2000-09-18 Akim Demaille <akim@epita.fr>
16693
16694 Add support for an Autotest test suite for Bison.
16695
16696 * m4/m4.m4, m4/atconfig.m4: New files.
16697 * m4/Makefile.am (EXTRA_DIST): Adjust.
16698 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
16699 files.
16700 * src/getargs.c: Display a more standard --version message.
16701 * src/reader.c (reader): Formatting changes.
16702 No longer depend upon VERSION_STRING.
16703 * configure.in: No longer use `dnl'.
16704 Set up the test suite and the new directory `tests/.
16705 (VERSION_STRING): Remove.
16706
16707 2000-04-14 Akim Demaille <akim@epita.fr>
16708
16709 * src/reader.c (copy_comment2): New function, same as former
16710 `copy_comment', but outputs into two FILE *.
16711 (copy_comment): Use it.
16712 (parse_union_decl): Use it.
16713 (get_type, parse_start_decl): Use the same `invalid' message.
16714 (parse_start_decl, parse_union_decl): Use the same `multiple'
16715 message.
16716 (parse_union_decl, copy_guard, copy_action): Use the same
16717 `unmatched' message.
16718 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16719
16720 2000-03-31 Akim Demaille <akim@epita.fr>
16721
16722 * src/files.c (tryopen, tryclose): Move to the top.
16723 Be static.
16724
16725 2000-03-31 Akim Demaille <akim@epita.fr>
16726
16727 * src/main.c (main): Don't call `done', exit does it.
16728
16729 2000-03-31 Akim Demaille <akim@epita.fr>
16730
16731 * allocate.c: s/return (foo)/return foo/.
16732 * lalr.c: Likewise.
16733 * LR0.c: Likewise.
16734 * output.c: Likewise.
16735 * reader.c: Likewise.
16736 * symtab.c: Likewise.
16737 * vmsgetargs.c: Likewise.
16738
16739 2000-03-31 Akim Demaille <akim@epita.fr>
16740
16741 Clean up the error reporting functions.
16742
16743 * src/report.c: New file.
16744 * src/report.h: Likewise.
16745 * src/Makefile.am: Adjust.
16746 * m4/error.m4: New file.
16747 * m4/Makefile.am: Adjust.
16748 * configure.in (jm_PREREQ_ERROR): Call it.
16749 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16750 Remove.
16751 (fatal, fatals): Remove. All callers use complain.c::fatal.
16752 (warn, warni, warns, warnss, warnss): Remove. All callers use
16753 complain.c::complain.
16754 (toomany): Remove, use fatal instead.
16755 * src/files.c (done): No argument, use complain_message_count.
16756 * src/main.c (main): Register `done' to `atexit'.
16757
16758 * src/getargs.c (usage): More `fputs', less `fprintf'.
16759
16760 2000-03-28 Akim Demaille <akim@epita.fr>
16761
16762 * lib/: New directory.
16763 * Makefile.am (SUBDIRS): Adjust.
16764 * configure.in: Adjust.
16765 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16766 useless.
16767 * src/alloca.c: Moved to lib/.
16768 * src/getopt.c: Likewise.
16769 * src/getopt1.c: Likewise.
16770 * src/getopt.h: Likewise.
16771 * src/ansi2knr.c: Likewise.
16772 * src/ansi2knr.1: Likewise.
16773 * src/Makefile.am: Adjust.
16774 * lib/Makefile.am: New file.
16775
16776 2000-03-28 Akim Demaille <akim@epita.fr>
16777
16778 * src/getargs.c (usage): Refresh the help message.
16779
16780 2000-03-17 Akim Demaille <akim@epita.fr>
16781
16782 * src/getopt1.c: Updated from textutils 2.0e
16783 * src/getopt.c: Likewise.
16784 * src/getopt.h: Likewise.
16785
16786 2000-03-17 Akim Demaille <akim@epita.fr>
16787
16788 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16789 the file name, not the whole `#line LINE FILE'.
16790
16791 2000-03-17 Akim Demaille <akim@epita.fr>
16792
16793 On syntax errors, report the token on which we choked.
16794
16795 * src/bison.s1 (yyparse): In the label yyerrlab, when
16796 YYERROR_VERBOSE, add yychar in msg.
16797
16798 2000-03-17 Akim Demaille <akim@epita.fr>
16799
16800 * src/reader.c (copy_at): New function.
16801 (copy_guard): Use it.
16802 (copy_action): Use it.
16803
16804 2000-03-17 Akim Demaille <akim@epita.fr>
16805
16806 Be kind to translators, save some useless translations.
16807
16808 * src/main.c (banner): New function.
16809 (fatal_banner): Use it.
16810 (warn_banner): Use it.
16811
16812 2000-03-17 Akim Demaille <akim@epita.fr>
16813
16814 * src/reader.c (copy_definition): Use copy_string and
16815 copy_comment. Removed now unused `match', `ended',
16816 `cplus_comment'.
16817 (copy_comment, copy_string): Moved, to be visible from
16818 copy_definition.
16819
16820 2000-03-17 Akim Demaille <akim@epita.fr>
16821
16822 * src/reader.c (copy_string): Declare `static inline'. No
16823 problems with inline, since it is checked by configure.
16824 (copy_comment): Likewise.
16825
16826 2000-03-17 Akim Demaille <akim@epita.fr>
16827
16828 * src/reader.c (packsymbols): Formatting changes.
16829
16830 2000-03-17 Akim Demaille <akim@epita.fr>
16831
16832 * src/reader.c (copy_comment): New function, factored out from:
16833 (copy_action): Use it. Removed now unused `match', `ended',
16834 `cplus_comment'.
16835 (copy_guard): Likewise.
16836
16837 2000-03-17 Akim Demaille <akim@epita.fr>
16838
16839 * src/reader.c (copy_string): New function, factored out from:
16840 (copy_action): Use it.
16841 (copy_guard): Likewise.
16842
16843 2000-03-17 Akim Demaille <akim@epita.fr>
16844
16845 Change the handling of @s so that they behave exactly like $s.
16846 There is now a pseudo variable @$ (readble and writable), location
16847 of the lhs of the rule (by default ranging from the location of
16848 the first symbol of the rhs, to the location of the last symbol,
16849 or, if the rhs is empty, YYLLOC).
16850
16851 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16852 yyval.
16853 (yyparse): When providing a default semantic action, provide a
16854 default location action.
16855 (after the $): No longer change `*YYLSP', just stack YYLOC the
16856 same way you stack YYVAL.
16857 * src/reader.c (read_declarations): Use warns.
16858 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16859 (copy_action, case '@'): Likewise.
16860 Use a standard error message, to save useless work from
16861 translators.
16862
16863 2000-03-17 Akim Demaille <akim@epita.fr>
16864
16865 * src/bison.s1: Formatting and cosmetics changes.
16866 * src/reader.c: Likewise.
16867 Update the Copyright notice.
16868
16869 2000-03-17 Akim Demaille <akim@epita.fr>
16870
16871 * src/bison.s1 (#line): All set to `#line' only, since the
16872 Makefile now handles them.
16873
16874 2000-03-16 Akim Demaille <akim@epita.fr>
16875
16876 * src/output.c (output_rule_data): Output the documentation of
16877 some of the tables.
16878 (Copyright notice): Update.
16879 Formatting changes.
16880
16881 2000-03-16 Akim Demaille <akim@epita.fr>
16882
16883 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
16884 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
16885 One `#if YYDEBUG' remains, since it uses variables which are
16886 defined only if `YYDEBUG != 0'.
16887
16888 2000-03-16 Akim Demaille <akim@epita.fr>
16889
16890 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16891 and related variables so that the similarities are highlighted.
16892
16893 2000-03-16 Akim Demaille <akim@epita.fr>
16894
16895 * src/bison.s1: Properly indent CPP directives.
16896
16897 2000-03-16 Akim Demaille <akim@epita.fr>
16898
16899 * src/bison.s1: Properly indent the `alloca' CPP section.
16900
16901 2000-03-16 Akim Demaille <akim@epita.fr>
16902
16903 Do not hard code values of directories in `configure.in'.
16904 Update the `configure' tool chain.
16905
16906 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16907 src/makefile.am.
16908 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
16909 (AC_OUTPUT): Add m4/Makefile.
16910 Bump to bison 1.28a, 1.29 has never been released.
16911 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
16912 handled via src/Makefile.am.
16913 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
16914 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
16915 autoheader.
16916 * Makefile.am (SUBDIRS): Add m4.
16917 (ACLOCAL_AM_FLAGS): New variable.
16918 (AUTOMAKE_OPTIONS): Add check-news.
16919 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
16920 the proper line number and file name.
16921 (DEFS): Propagate the location of bison library files and of the
16922 locale files.
16923 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16924 builddir.
16925 * acinclude.m4: Remove, replaced by the directory m4.
16926 * m4/Makefile.am (EXTRA_DIST): New variable.
16927 * m4/gettext.m4: New file, from the fileutils.
16928 * m4/lcmessage.m4: Likewise
16929 * m4/progtest.m4: Likewise.
16930 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
16931
16932 2000-03-10 Akim Demaille <akim@epita.fr>
16933
16934 * src/closure.c:
16935 Formatting changes of various comments.
16936 Respect the GNU coding standards at various places.
16937 Don't use `_()' when no translation is needed.
16938
16939 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16940
16941 * src/files.c:
16942 OS/2 honors TMPDIR environment variable.
16943
16944 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16945
16946 * doc/bison.texinfo: Tweaked spelling and grammar.
16947 Updated ISBN.
16948 Removed reference to price of printed copy.
16949 Mention BISON_SIMPLE and BISON_HAIRY.
16950
16951 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16952
16953 * configure.in, NEWS:
16954 Bison 1.29 released.
16955
16956 1999-10-27 Jesse Thilo <jthilo@gnu.org>
16957
16958 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16959 Added reference card.
16960
16961 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16962
16963 * po/ru.po: Added Russian translation.
16964
16965 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16966
16967 * configure.in: Added Russian translation.
16968
16969 1999-07-06 Jesse Thilo <jthilo@gnu.org>
16970
16971 * configure.in, NEWS, README:
16972 Released version 1.28.
16973
16974 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16975
16976 * src/system.h:
16977 Squashed redefinition warning on some systems.
16978
16979 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16980 Have configure build version string instead of relying on ANSI string
16981 concatentation.
16982
16983 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16984
16985 * po/POTFILES.in: Got rid of version.c.
16986
16987 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16988
16989 * acconfig.h, configure.in:
16990 Have configure build version string instead of relying on ANSI string
16991 concatentation.
16992
16993 1999-06-08 Jesse Thilo <jthilo@gnu.org>
16994
16995 * doc/bison.1:
16996 Dropped mention of `+' for long-named options.
16997
16998 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16999
17000 * src/files.c: Added <unistd.h> for unlink().
17001
17002 * src/Makefile.am, src/system.h:
17003 I18n fixes.
17004
17005 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17006
17007 * README: Added a FAQ list.
17008
17009 * configure.in, acconfig.h:
17010 I18n fixes.
17011
17012 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17013
17014 * doc/FAQ, doc/Makefile.am:
17015 Added a FAQ list.
17016
17017 1999-05-19 Jesse Thilo <jthilo@gnu.org>
17018
17019 * src/alloc.h, src/symtab.h, src/version.c:
17020 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17021
17022 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17023
17024 * src/.cvsignore, src/Makefile.am:
17025 Reorganized: sources in `src', documentation in `doc'.
17026
17027 * src/lex.c (literalchar):
17028 fixed the code for escaping double quotes (thanks
17029 Jonathan Czisny.)
17030
17031 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17032
17033 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17034 Adjusted paths to reflect directory reorganization.
17035
17036 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17037
17038 * doc/.cvsignore, doc/Makefile.am:
17039 Reorganized: sources in `src', documentation in `doc'.
17040
17041 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17042
17043 * configure.in:
17044 Updated AC_INIT file to reflect directory reorganization.
17045
17046 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17047 Reorganized: sources in `src', documentation in `doc'.
17048
17049 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17050
17051 * src/allocate.c:
17052 Don't declare calloc() and realloc() if not necessary.
17053
17054 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17055
17056 * configure.in, acconfig.h, acinclude.m4:
17057 Don't declare calloc() and realloc() if not necessary.
17058
17059 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17060
17061 * po/.cvsignore: Added i18n support.
17062
17063 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17064
17065 * acconfig.h, configure.in, Makefile.am:
17066 Added i18n support.
17067
17068 1999-03-22 Jesse Thilo <jthilo@gnu.org>
17069
17070 * src/bison.s1: Fixed #line numbers.
17071
17072 1999-03-15 Jesse Thilo <jthilo@gnu.org>
17073
17074 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17075 Added PO files from Translation Project.
17076
17077 1999-03-03 Jesse Thilo <jthilo@gnu.org>
17078
17079 * Makefile.am:
17080 Added support for non-ANSI compilers (ansi2knr).
17081
17082 1999-02-16 Jesse Thilo <jthilo@gnu.org>
17083
17084 * configure.in: Bumped version number to 1.27.
17085
17086 * Makefile.am:
17087 Added `bison.simple' to list of files removed by `make distclean'.
17088
17089 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17090
17091 * src/files.c, src/files.h:
17092 Defined locations of parser files in config.h instead of Makefile.
17093
17094 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17095
17096 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17097 Defined locations of parser files in config.h instead of Makefile.
17098
17099 1999-02-09 Jesse Thilo <jthilo@gnu.org>
17100
17101 * Makefile.am:
17102 Removed inappropriate use of $< macro.
17103
17104 1999-02-05 Jesse Thilo <jthilo@gnu.org>
17105
17106 * po/Makefile.in.in, po/POTFILES.in:
17107 Add `po' directory skeleton.
17108
17109 1999-01-27 Jesse Thilo <jthilo@gnu.org>
17110
17111 * README: Document help-bison list.
17112
17113 * configure.in: Add check for mkstemp().
17114
17115 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17116
17117 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17118 Hush a few compiler warnings.
17119
17120 * src/files.c:
17121 Add tryclose(), which verifies that fclose was successful.
17122 Hush a couple of compiler warnings.
17123
17124 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17125
17126 * Makefile.am, OChangeLog:
17127 ChangeLog is now automatically generated. Include the old version as
17128 OChangeLog.
17129
17130 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17131
17132 * 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:
17133 Update FSF address.
17134
17135 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17136
17137 * doc/bison.texinfo: Fix formatting glitch.
17138
17139 * doc/bison.texinfo: Update FSF address.
17140
17141 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17142
17143 * acconfig.h: Update FSF address.
17144
17145 1999-01-08 Jesse Thilo <jthilo@gnu.org>
17146
17147 * src/system.h:
17148 Don't define PACKAGE here, since config.h defines it.
17149
17150 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17151
17152 * src/reader.c: Update copyright date.
17153
17154 * src/main.c:
17155 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17156 favor of output directly to stderr (avoids buffer overruns).
17157
17158 * src/reader.c: Some checks for premature EOF.
17159
17160 * 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:
17161 Use prototypes if the compiler understands them.
17162
17163 * src/files.c: Honor TMPDIR on Unix hosts.
17164 Use prototypes if the compiler understands them.
17165
17166 * src/reader.c:
17167 Fix a couple of buffer overrun bugs.
17168 Use prototypes if the compiler understands them.
17169
17170 * src/system.h: Include unistd.h and ctype.h.
17171 Use #ifdef instead of #if for NLS symbols.
17172
17173 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17174
17175 * doc/bison.texinfo:
17176 Delete comment "consider using @set for edition number, etc..." since
17177 we now are doing so.
17178
17179 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17180
17181 * configure.in:
17182 Use prototypes if the compiler understands them.
17183
17184 * NEWS: Document 1.26 highlights.
17185
17186 * Makefile.am: Require Automake 1.3 or later.
17187
17188 * acconfig.h:
17189 Use prototypes if the compiler understands them.
17190
17191 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17192
17193 * src/version.c:
17194 Use VERSION symbol from automake for version number.
17195
17196 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17197
17198 * acconfig.h, configure.in, version.cin:
17199 Use VERSION symbol from automake for version number.
17200
17201 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17202
17203 * Makefile.am:
17204 Distribute original version of simple parser (bison.s1), not built
17205 version (bison.simple).
17206
17207 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17208
17209 * doc/bison.texinfo: Add info dir entry.
17210
17211 * doc/bison.texinfo:
17212 Let automake put version number into documentation.
17213
17214 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17215
17216 * src/bison.cld, src/build.com, src/vmshlp.mar:
17217 Add non-RCS files from /gd/gnu/bison.
17218
17219 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17220
17221 * doc/bison.1:
17222 Document the BISON_HAIRY and BISON_SIMPLE variables.
17223
17224 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17225
17226 * src/version.c: Build version.c automatically.
17227
17228 * src/reader.c:
17229 Fix token numbering (used to start at 258, not 257).
17230
17231 * src/system.h: Include config.h.
17232
17233 * src/getargs.c: Update bug report address.
17234
17235 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17236 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17237
17238 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17239
17240 * Makefile.am:
17241 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17242
17243 * configure.in, version.cin:
17244 Build version.c automatically.
17245
17246 * AUTHORS: Add AUTHORS file.
17247
17248 * README: Update bug report address.
17249
17250 * bison.simple:
17251 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17252
17253 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17254 Add automake stuff.
17255
17256 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17257
17258 * doc/bison.texinfo: Clean up some formatting.
17259
17260 1998-05-05 Richard Stallman <rms@gnu.org>
17261
17262 * doc/bison.texinfo:
17263 Explain better why to make a pure parser.
17264
17265 1998-01-05 Richard Stallman <rms@gnu.org>
17266
17267 * src/files.c (openfiles):
17268 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17269 find a temporary directory, if possible. Do not unlink files while
17270 they are open.
17271
17272 1997-08-25 Richard Stallman <rms@gnu.org>
17273
17274 * src/reader.c (stack_offset;):
17275 Change some warni to warns.
17276
17277 * src/lex.c (literalchar): Use warns, not warni.
17278
17279 1997-06-28 Richard Stallman <rms@gnu.org>
17280
17281 * src/bison.s1: Add a Bison version comment.
17282
17283 * src/main.c (fatal, warn, berror):
17284 Use program_name.
17285
17286 1997-06-28 Richard Stallman <rms@gnu.org>
17287
17288 * Makefile.in (bison_version): New variable.
17289 (dist): Use that variable.
17290 (bison.s1): Substitute the Bison version into bison.simple.
17291
17292 * bison.simple: Add a Bison version comment.
17293
17294 1997-06-18 Richard Stallman <rms@gnu.org>
17295
17296 * src/main.c (fatal, warn, berror):
17297 Make error messages standard.
17298 (toomany): Improve error message text.
17299
17300 * 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:
17301 new.h renamed to alloc.h.
17302
17303 1997-06-18 Richard Stallman <rms@gnu.org>
17304
17305 * Makefile.in: new.h renamed to alloc.h.
17306
17307 1997-05-24 Richard Stallman <rms@gnu.org>
17308
17309 * src/lex.c (literalchar):
17310 Fix the code for escaping \, " and '.
17311
17312 (lex): Avoid trouble when there are many chars
17313 to discard in a char literal with just several chars in it.
17314
17315 1997-05-17 Richard Stallman <rms@gnu.org>
17316
17317 * src/bison.s1:
17318 Use malloc, if using alloca is troublesome.
17319 (YYSTACK_USE_ALLOCA): New flag macro.
17320 Define it for some systems and compilers.
17321 (YYSTACK_ALLOC): New macro.
17322 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17323 If it was malloc'd, free it.
17324
17325 1997-05-17 Richard Stallman <rms@gnu.org>
17326
17327 * bison.simple:
17328 Use malloc, if using alloca is troublesome.
17329 (YYSTACK_USE_ALLOCA): New flag macro.
17330 Define it for some systems and compilers.
17331 (YYSTACK_ALLOC): New macro.
17332 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17333 If it was malloc'd, free it.
17334
17335 1997-04-23 Richard Stallman <rms@gnu.org>
17336
17337 * src/bison.s1:
17338 (alloca) [__hpux]: Always define as __builtin_alloca.
17339
17340 1997-04-23 Richard Stallman <rms@gnu.org>
17341
17342 * bison.simple:
17343 (alloca) [__hpux]: Always define as __builtin_alloca.
17344
17345 1997-04-22 Richard Stallman <rms@gnu.org>
17346
17347 * src/bison.s1:
17348 [__hpux]: Include alloca.h (right for HPUX 10)
17349 instead of declaring alloca (right for HPUX 9).
17350
17351 * src/bison.s1 (__yy_memcpy):
17352 Declare arg `count' as unsigned int.
17353 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17354
17355 1997-04-22 Richard Stallman <rms@gnu.org>
17356
17357 * bison.simple:
17358 [__hpux]: Include alloca.h (right for HPUX 10)
17359 instead of declaring alloca (right for HPUX 9).
17360
17361 * bison.simple (__yy_memcpy):
17362 Declare arg `count' as unsigned int.
17363 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17364
17365 1997-01-03 Richard Stallman <rms@gnu.org>
17366
17367 * src/allocate.c: [__STDC__ or _MSC_VER]:
17368 Declare calloc and realloc to return void *.
17369
17370 1997-01-02 Richard Stallman <rms@gnu.org>
17371
17372 * src/system.h:
17373 [_MSC_VER]: Include stdlib.h and process.h.
17374 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17375
17376 * src/main.c (main): Return FAILURE as a value.
17377 (printable_version): Declare arg as int, not char.
17378
17379 1997-01-02 Richard Stallman <rms@gnu.org>
17380
17381 * Makefile.in (dist):
17382 Explicitly check for symlinks, and copy them.
17383
17384 1996-12-19 Richard Stallman <rms@gnu.org>
17385
17386 * src/files.c:
17387 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17388
17389 1996-12-18 Paul Eggert <eggert@gnu.org>
17390
17391 * src/bison.s1 (yyparse):
17392 If __GNUC__ and YYPARSE_PARAM are both defined,
17393 declare yyparse to have a void * argument.
17394
17395 1996-12-18 Paul Eggert <eggert@gnu.org>
17396
17397 * bison.simple (yyparse):
17398 If __GNUC__ and YYPARSE_PARAM are both defined,
17399 declare yyparse to have a void * argument.
17400
17401 1996-12-17 Richard Stallman <rms@gnu.org>
17402
17403 * src/reduce.c (nbits): Add some casts.
17404
17405 1996-08-12 Richard Stallman <rms@gnu.org>
17406
17407 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17408
17409 1996-08-12 Richard Stallman <rms@gnu.org>
17410
17411 * bison.simple: Test _MSDOS as well as _MSDOS_.
17412
17413 1996-07-31 Richard Stallman <rms@gnu.org>
17414
17415 * src/bison.s1:
17416 [__sun && __i386]: Include alloca.h.
17417
17418 1996-07-31 Richard Stallman <rms@gnu.org>
17419
17420 * bison.simple:
17421 [__sun && __i386]: Include alloca.h.
17422
17423 1996-07-30 Richard Stallman <rms@gnu.org>
17424
17425 * src/bison.s1: Comment change.
17426
17427 * src/bison.s1: Test _MSDOS_, not MSDOS.
17428
17429 1996-07-30 Richard Stallman <rms@gnu.org>
17430
17431 * bison.simple: Comment change.
17432
17433 * bison.simple: Test _MSDOS_, not MSDOS.
17434
17435 1996-06-01 Richard Stallman <rms@gnu.org>
17436
17437 * 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:
17438 Insert `_' macro around many string constants.
17439
17440 * src/main.c:
17441 Insert `_' macro around many string constants.
17442
17443 (main): Call setlocale, bindtextdomain and textdomain.
17444
17445 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17446 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17447 [ENABLE_NLS]: Include libintl.h.
17448 [ENABLE_NLS] (gettext): Define.
17449 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17450 (N_, PACKAGE, LOCALEDIR): New macros.
17451
17452 1996-06-01 Richard Stallman <rms@gnu.org>
17453
17454 * POTFILES.in: New file.
17455
17456 * Makefile.in (allocate.o):
17457 Define target explicitly.
17458
17459 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17460 (LDFLAGS): Set to @LDFLAGS@.
17461 (configure): Run autoconf only if preceding `cd' succeeds.
17462 (bison.s1): Redirect output to temporary file then move the
17463 temporary to the target, rather than redirecting directly to bison.s1.
17464 (clean): Remove config.status and config.log.
17465 (distclean): Don't remove config.status here.
17466
17467 1996-05-12 Richard Stallman <rms@gnu.org>
17468
17469 * src/bison.s1:
17470 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17471
17472 1996-05-12 Richard Stallman <rms@gnu.org>
17473
17474 * bison.simple:
17475 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17476
17477 1996-05-11 Richard Stallman <rms@gnu.org>
17478
17479 * src/bison.s1 (__yy_memcpy):
17480 Really reorder the args, as was supposedly done on Feb 14 1995.
17481 (yyparse): Calls changed accordingly.
17482
17483 1996-05-11 Richard Stallman <rms@gnu.org>
17484
17485 * Makefile.in (dist): Don't use $(srcdir).
17486
17487 * bison.simple (__yy_memcpy):
17488 Really reorder the args, as was supposedly done on Feb 14 1995.
17489 (yyparse): Calls changed accordingly.
17490
17491 1996-01-27 Richard Stallman <rms@gnu.org>
17492
17493 * src/output.c (output_rule_data):
17494 Test YYERROR_VERBOSE in the conditional
17495 around the definition of ttyname.
17496
17497 1995-12-29 Richard Stallman <rms@gnu.org>
17498
17499 * src/bison.s1:
17500 Fix line numbers in #line commands.
17501
17502 1995-12-29 Richard Stallman <rms@gnu.org>
17503
17504 * bison.simple:
17505 Fix line numbers in #line commands.
17506
17507 1995-12-27 Richard Stallman <rms@gnu.org>
17508
17509 * src/bison.s1 (YYPARSE_PARAM_DECL):
17510 In C++, make it always null.
17511 (YYPARSE_PARAM_ARG): New macro.
17512 (yyparse): Use YYPARSE_PARAM_ARG.
17513
17514 1995-12-27 Richard Stallman <rms@gnu.org>
17515
17516 * bison.simple (YYPARSE_PARAM_DECL):
17517 In C++, make it always null.
17518 (YYPARSE_PARAM_ARG): New macro.
17519 (yyparse): Use YYPARSE_PARAM_ARG.
17520
17521 1995-11-29 Richard Stallman <rms@gnu.org>
17522
17523 * doc/bison.texinfo:
17524 Describe literal string tokens, %raw, %no_lines, %token_table.
17525
17526 1995-11-29 Daniel Hagerty <hag@gnu.org>
17527
17528 * doc/bison.texinfo: Fixed update date
17529
17530 1995-10-16 Richard Stallman <rms@gnu.org>
17531
17532 * src/version.c: Version 1.25.
17533
17534 1995-10-16 Richard Stallman <rms@gnu.org>
17535
17536 * NEWS: *** empty log message ***
17537
17538 1995-10-16 Richard Stallman <rms@gnu.org>
17539
17540 * doc/bison.1, doc/bison.rnh:
17541 Add new options.
17542
17543 1995-10-15 Richard Stallman <rms@gnu.org>
17544
17545 * src/vmsgetargs.c, src/getargs.c:
17546 Added -n, -k, and -raw switches.
17547 (noparserflag, toknumflag, rawtoknumflag): New variables.
17548
17549 * src/symtab.h (SALIAS):
17550 New #define for adding aliases to %token.
17551 (struct bucket): Added `alias' field.
17552
17553 * src/reduce.c (reduce_grammar):
17554 Revise error message.
17555 (print_notices): Remove final `.' from error message.
17556
17557 * src/reader.c (reader_output_yylsp):
17558 New function.
17559 (readgram): Use `#if 0' around code that accepted %command
17560 inside grammar rules: The documentation doesn't allow it,
17561 and it will fail since the %command processors scan for the next %.
17562 (parse_token_decl): Extended the %token
17563 declaration to allow a multi-character symbol as an alias.
17564 (parse_thong_decl): New function.
17565 (read_declarations): Added %thong declarations.
17566 (read_declarations): Handle NOOP to deal with allowing
17567 % declarations as another means to specify the flags.
17568 (readgram): Allow %prec prior to semantics embedded in a rule.
17569 (skip_to_char, read_declarations, copy_definition)
17570 (parse_token_decl, parse_start_decl, parse_type_decl)
17571 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17572 (get_type_name, copy_guard, copy_action, readgram)
17573 (get_type, packsymbols): Revised most error messages.
17574 Changed `fatal' to `warnxxx' to avoid aborting for error.
17575 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17576 (read_declarations): Improve the error message for
17577 an invalid character. Do not abort.
17578 (read_declarations, copy_guard, copy_action): Use
17579 printable_version to avoid unprintable characters in printed output.
17580 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
17581 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
17582 Allow the type of a non-terminal can be given
17583 more than once, as long as all specifications give the same type.
17584
17585 * src/output.c:
17586 (output_headers, output_trailers, output, output_gram)
17587 (output_rule_data): Implement noparserflag variable.
17588 Implement toknumflag variable.
17589 (output): Call reader_output_yylsp to output LTYPESTR.
17590
17591 * src/main.c (main):
17592 If reader sees an error, don't process the grammar.
17593 (fatals): Updated to not use VARARGS1.
17594 (printable_version, int_to_string, warn, warni, warns, warnss)
17595 (warnsss): New error reporting functions. Avoid abort for error.
17596
17597 * src/lex.h:
17598 Added THONG and NOOP for alias processing.
17599 Added SETOPT for the new code that allows setting options with %flags.
17600
17601 * src/lex.c:
17602 Include getopt.h. Add some extern decls.
17603 (safegetc): New function to deal with EOF gracefully.
17604 (literalchar); new function to deal with reading \ escapes.
17605 (lex): Use literalchar.
17606 (lex): Implemented "..." tokens.
17607 (literalchar, lex, parse_percent_token): Made tokenbuffer
17608 always contain the token. This includes growing the token
17609 buffer while reading an integer.
17610 (parse_percent_token): Replaced if-else statement with percent_table.
17611 (parse_percent_token): Added % declarations as another
17612 way to specify the flags -n, -l, and -r. Also added hooks for
17613 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
17614 major changes to files.c.
17615 (lex) Retain in the incoming stream a character following
17616 an incorrect '/'.
17617 (skip_white_space, lex): Revised most error messages
17618 and changed fatal to warn to avoid aborting.
17619 (percent_table): Added %thong declarations.
17620
17621 * src/gram.h: Comment changes.
17622
17623 * src/files.c (openfiles, open_extra_files, done):
17624 Add faction flag
17625 and actfile file. Handle noparserflag. Both for -n switch.
17626
17627 * src/conflicts.c (resolve_sr_conflict):
17628 Remove use of alloca.
17629
17630 1995-06-01 Jim Meyering <meyering@gnu.org>
17631
17632 * doc/bison.texinfo: *** empty log message ***
17633
17634 1995-05-06 Richard Stallman <rms@gnu.org>
17635
17636 * src/bison.s1: Comment change.
17637
17638 1995-05-06 Richard Stallman <rms@gnu.org>
17639
17640 * bison.simple: Comment change.
17641
17642 1995-05-03 Richard Stallman <rms@gnu.org>
17643
17644 * src/version.c: Version now 1.24.
17645
17646 * src/bison.s1: Change distribution terms.
17647
17648 * src/version.c: Version now 1.23.
17649
17650 1995-05-03 Richard Stallman <rms@gnu.org>
17651
17652 * doc/bison.texinfo:
17653 Rewrite "Conditions for Using Bison".
17654 Update version to 1.24.
17655
17656 1995-05-03 Richard Stallman <rms@gnu.org>
17657
17658 * bison.simple: Change distribution terms.
17659
17660 1995-02-23 Richard Stallman <rms@gnu.org>
17661
17662 * src/files.c: Test __VMS_POSIX as well as VMS.
17663
17664 1995-02-14 Jim Meyering <meyering@gnu.org>
17665
17666 * src/bison.s1 (__yy_memcpy):
17667 Renamed from __yy_bcopy to avoid
17668 confusion. Reverse FROM and TO arguments to be consistent with
17669 those of memcpy.
17670
17671 1995-02-14 Jim Meyering <meyering@gnu.org>
17672
17673 * bison.simple (__yy_memcpy):
17674 Renamed from __yy_bcopy to avoid
17675 confusion. Reverse FROM and TO arguments to be consistent with
17676 those of memcpy.
17677
17678 1994-11-10 David J. MacKenzie <djm@gnu.org>
17679
17680 * NEWS: reformat
17681
17682 * NEWS: New file.
17683
17684 * Makefile.in (DISTFILES): Include NEWS.
17685
17686 * Makefile.in (DISTFILES):
17687 Include install-sh, not install.sh.
17688
17689 * configure.in: Update to Autoconf v2 macro names.
17690
17691 1994-10-05 David J. MacKenzie <djm@gnu.org>
17692
17693 * Makefile.in: fix typo
17694
17695 * Makefile.in (prefix, exec_prefix):
17696 Let configure set them.
17697
17698 1994-09-28 David J. MacKenzie <djm@gnu.org>
17699
17700 * Makefile.in: Set datadir to $(prefix)/share.
17701
17702 1994-09-15 Richard Stallman <rms@gnu.org>
17703
17704 * src/bison.s1:
17705 Update copyright notice and GPL version.
17706
17707 1994-09-15 Richard Stallman <rms@gnu.org>
17708
17709 * bison.simple:
17710 Update copyright notice and GPL version.
17711
17712 1994-07-12 Richard Stallman <rms@gnu.org>
17713
17714 * src/reduce.c, src/reader.c:
17715 entered into RCS
17716
17717 1994-05-05 David J. MacKenzie <djm@gnu.org>
17718
17719 * Makefile.in: entered into RCS
17720
17721 1994-03-26 Richard Stallman <rms@gnu.org>
17722
17723 * src/bison.s1: entered into RCS
17724
17725 1994-03-26 Richard Stallman <rms@gnu.org>
17726
17727 * bison.simple: entered into RCS
17728
17729 1994-03-25 Richard Stallman <rms@gnu.org>
17730
17731 * src/main.c: entered into RCS
17732
17733 1994-03-24 Richard Stallman <rms@gnu.org>
17734
17735 * src/conflicts.c: entered into RCS
17736
17737 1994-01-02 Richard Stallman <rms@gnu.org>
17738
17739 * Makefile.in: *** empty log message ***
17740
17741 1993-11-21 Richard Stallman <rms@gnu.org>
17742
17743 * src/bison.s1: *** empty log message ***
17744
17745 1993-11-21 Richard Stallman <rms@gnu.org>
17746
17747 * doc/bison.texinfo: entered into RCS
17748
17749 * doc/bison.texinfo: *** empty log message ***
17750
17751 1993-11-21 Richard Stallman <rms@gnu.org>
17752
17753 * bison.simple: *** empty log message ***
17754
17755 1993-10-25 David J. MacKenzie <djm@gnu.org>
17756
17757 * doc/bison.texinfo: *** empty log message ***
17758
17759 1993-10-19 Richard Stallman <rms@gnu.org>
17760
17761 * src/bison.s1: *** empty log message ***
17762
17763 1993-10-19 Richard Stallman <rms@gnu.org>
17764
17765 * bison.simple: *** empty log message ***
17766
17767 1993-10-14 Richard Stallman <rms@gnu.org>
17768
17769 * src/bison.s1: *** empty log message ***
17770
17771 1993-10-14 Richard Stallman <rms@gnu.org>
17772
17773 * bison.simple: *** empty log message ***
17774
17775 1993-09-14 David J. MacKenzie <djm@gnu.org>
17776
17777 * doc/bison.texinfo: *** empty log message ***
17778
17779 1993-09-13 Noah Friedman <friedman@gnu.org>
17780
17781 * Makefile.in: *** empty log message ***
17782
17783 1993-09-10 Richard Stallman <rms@gnu.org>
17784
17785 * src/conflicts.c: *** empty log message ***
17786
17787 * src/system.h: entered into RCS
17788
17789 1993-09-10 Richard Stallman <rms@gnu.org>
17790
17791 * doc/bison.1: entered into RCS
17792
17793 1993-09-06 Noah Friedman <friedman@gnu.org>
17794
17795 * src/version.c: entered into RCS
17796
17797 1993-09-06 Noah Friedman <friedman@gnu.org>
17798
17799 * Makefile.in: *** empty log message ***
17800
17801 1993-07-30 David J. MacKenzie <djm@gnu.org>
17802
17803 * Makefile.in: *** empty log message ***
17804
17805 1993-07-24 Richard Stallman <rms@gnu.org>
17806
17807 * src/bison.s1: *** empty log message ***
17808
17809 1993-07-24 Richard Stallman <rms@gnu.org>
17810
17811 * bison.simple: *** empty log message ***
17812
17813 1993-07-08 David J. MacKenzie <djm@gnu.org>
17814
17815 * Makefile.in: *** empty log message ***
17816
17817 1993-07-04 Richard Stallman <rms@gnu.org>
17818
17819 * src/bison.s1: *** empty log message ***
17820
17821 1993-07-04 Richard Stallman <rms@gnu.org>
17822
17823 * bison.simple: *** empty log message ***
17824
17825 1993-06-26 David J. MacKenzie <djm@gnu.org>
17826
17827 * src/getargs.c: entered into RCS
17828
17829 1993-06-26 David J. MacKenzie <djm@gnu.org>
17830
17831 * doc/bison.texinfo: *** empty log message ***
17832
17833 * doc/bison.1: New file.
17834
17835 1993-06-25 Richard Stallman <rms@gnu.org>
17836
17837 * src/getargs.c: New file.
17838
17839 1993-06-16 Richard Stallman <rms@gnu.org>
17840
17841 * src/bison.s1: *** empty log message ***
17842
17843 1993-06-16 Richard Stallman <rms@gnu.org>
17844
17845 * bison.simple: *** empty log message ***
17846
17847 1993-06-03 Richard Stallman <rms@gnu.org>
17848
17849 * src/bison.s1: New file.
17850
17851 1993-06-03 Richard Stallman <rms@gnu.org>
17852
17853 * doc/bison.texinfo: *** empty log message ***
17854
17855 1993-06-03 Richard Stallman <rms@gnu.org>
17856
17857 * bison.simple: New file.
17858
17859 1993-05-19 Richard Stallman <rms@gnu.org>
17860
17861 * doc/bison.texinfo: New file.
17862
17863 1993-05-07 Noah Friedman <friedman@gnu.org>
17864
17865 * Makefile.in: *** empty log message ***
17866
17867 1993-04-28 Noah Friedman <friedman@gnu.org>
17868
17869 * src/reader.c: *** empty log message ***
17870
17871 1993-04-23 Noah Friedman <friedman@gnu.org>
17872
17873 * src/alloc.h: entered into RCS
17874
17875 1993-04-20 David J. MacKenzie <djm@gnu.org>
17876
17877 * src/version.c: *** empty log message ***
17878
17879 * src/files.c, src/allocate.c:
17880 entered into RCS
17881
17882 * src/reader.c: *** empty log message ***
17883
17884 * src/lex.c: entered into RCS
17885
17886 * src/conflicts.c: New file.
17887
17888 * src/symtab.c: entered into RCS
17889
17890 * src/alloc.h: New file.
17891
17892 * src/LR0.c: entered into RCS
17893
17894 1993-04-18 Noah Friedman <friedman@gnu.org>
17895
17896 * src/reader.c: New file.
17897
17898 * src/version.c: *** empty log message ***
17899
17900 1993-04-18 Noah Friedman <friedman@gnu.org>
17901
17902 * Makefile.in: *** empty log message ***
17903
17904 1993-04-17 Noah Friedman <friedman@gnu.org>
17905
17906 * Makefile.in: *** empty log message ***
17907
17908 1993-04-15 Richard Stallman <rms@gnu.org>
17909
17910 * src/main.c, src/files.c:
17911 New file.
17912
17913 1993-04-15 Noah Friedman <friedman@gnu.org>
17914
17915 * configure.in: entered into RCS
17916
17917 * configure.in: *** empty log message ***
17918
17919 * configure.in: New file.
17920
17921 1993-04-14 Richard Stallman <rms@gnu.org>
17922
17923 * Makefile.in: New file.
17924
17925 1993-04-13 Richard Stallman <rms@gnu.org>
17926
17927 * src/version.c: New file.
17928
17929 1993-03-25 Richard Stallman <rms@gnu.org>
17930
17931 * src/output.c: entered into RCS
17932
17933 1992-09-25 Richard Stallman <rms@gnu.org>
17934
17935 * configure.bat: entered into RCS
17936
17937 1992-06-22 Richard Stallman <rms@gnu.org>
17938
17939 * src/vmsgetargs.c: entered into RCS
17940
17941 1992-06-22 Richard Stallman <rms@gnu.org>
17942
17943 * doc/bison.rnh: entered into RCS
17944
17945 1992-04-20 David J. MacKenzie <djm@gnu.org>
17946
17947 * README: entered into RCS
17948
17949 1992-01-22 Richard Stallman <rms@gnu.org>
17950
17951 * src/machine.h: entered into RCS
17952
17953 1991-12-21 Richard Stallman <rms@gnu.org>
17954
17955 * src/lalr.c, src/closure.c:
17956 entered into RCS
17957
17958 1991-12-20 Richard Stallman <rms@gnu.org>
17959
17960 * src/state.h: entered into RCS
17961
17962 1991-12-18 Richard Stallman <rms@gnu.org>
17963
17964 * src/print.c, src/nullable.c, src/derives.c:
17965 entered into RCS
17966
17967 1991-11-03 David J. MacKenzie <djm@gnu.org>
17968
17969 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17970 entered into RCS
17971
17972 1988-09-09 Richard Stallman <rms@gnu.org>
17973
17974 * src/bison.hairy: entered into RCS
17975
17976 1987-12-16 Richard Stallman <rms@gnu.org>
17977
17978 * REFERENCES: entered into RCS
17979
17980
17981 -----
17982
17983 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
17984 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17985 Software Foundation, Inc.
17986
17987 Copying and distribution of this file, with or without
17988 modification, are permitted provided the copyright notice and this
17989 notice are preserved.
17990
17991 $Id$