]> git.saurik.com Git - bison.git/blame - ChangeLog
* data/push.c: Add CPP guards around push parser declarations in both
[bison.git] / ChangeLog
CommitLineData
23522164
JD
12006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 * data/push.c: Add CPP guards around push parser declarations in both
4 the header and the code file.
5 In the code file, move the push parser declarations to the same place
6 they appear in the header file.
7 Clean up the M4 some, especially the inconsistent underquoting in
8 some b4_c_function_def and b4_c_function_decl uses.
9
bb010fe5
JD
102006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
11
12 Encapsulate the push parser state variables into an M4 macro so the
13 push skeleton doesn't have to list them again for pull mode's yyparse.
14 For push mode, remove yypush_parse's local equivalents of these
15 variables to eliminate unnecessary copying between the two sets at
16 run-time. This patch also fixes at least a bug related to multiple
17 %initial-action invocations in push mode.
18 * data/push.c (b4_declare_parser_variables): Rename to...
19 (b4_declare_scanner_communication_variables): ... this for clarity and
20 update both uses.
21 (b4_declare_yyparse_variables): Remove and move its contents to the one
22 spot where it was invoked.
23 (b4_declare_parser_state_variables): New macro containing the parser
24 state variables required by push mode.
25 (struct yypstate): Replace all fields but yynew with
26 b4_declare_parser_state_variables.
27 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
28 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
29 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
30 (yyparse or yypush_parse): For yyparse in pull mode, replace local
31 parser state variable declarations with
32 b4_declare_parser_state_variables.
33 Don't initialize parser state variables when calling yypush_parse since
34 yypstate_new already does that.
35 Invoke the user's initial action only upon the first yypush_parse
36 invocation.
37 Remove all code that copies between the local parser state variables
38 and the yypstate.
39
2d212f8c
JD
402006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
41
42 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
43 prevent a name collision in a future patch where these names will
44 sometimes be #define'd.
45 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
46 since it no longer has the same name as the existing argument.
47 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
48
e6e704dc
JD
492006-12-19 Paolo Bonzini <bonzini@gnu.org>
50 and Joel E. Denny <jdenny@ces.clemson.edu>
51
52 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
53 that the argument is case-insensitive, and there's no `=' here.
54 For the %skeleton entry, mention that %language is better.
55 (Bison Options): Likewise for --language and --skeleton. Move the
56 --skeleton entry so that the `Tuning the parser' section is sorted
57 alphabetically on long options.
58 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
59 %language directive in detail here; cross-reference the %language
60 documentation instead.
61 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
62 `%require "2.3b"' so that the example is always up-to-date.
63 (Bison Symbols): Add entries for %language and %skeleton.
64 * examples/extexi (normalize): Instead of replacing every %require
65 argument with the current Bison version, just substitute for
66 `@value{VERSION}'. This guarantees that we're testing what actually
67 appears in the documentation.
68 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
69 rather than `@VERSION@'.
70
0e021770
PE
712006-12-18 Paul Eggert <eggert@cs.ucla.edu>
72
fd575f05
PE
73 * NEWS: Reword the %language news a bit, and put it earlier.
74
0e021770
PE
75 * src/getargs.c (skeleton_arg): Last arg is now location const *.
76 Rewrite to simplify the logic.
77 (language_argmatch): Likewise.
fd575f05
PE
78 (program_name): We now own this var.
79 * src/getargs.h (struct bison_language): Use char[] rather than
80 const char *.
0e021770
PE
81
82 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
83 Java is supported.
84 * src/complain.c (program_name): Remove decl; no longer needed.
85 * src/main.c (program_name): Remove; now belongs to getargs.
86
872006-12-18 Paolo Bonzini <bonzini@gnu.org>
88
89 * NEWS: Document %language.
90
91 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
92
93 * data/c-skel.m4, data/c++-skel.m4: New files.
94 * data/glr.c: Complain on push parsers.
95
96 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
97 over %skeleton.
98 (Directives): Document %language and %skeleton.
99 (Command line): Document -L.
100
101 * examples/extexi: Rewrite %require directive.
102 * examples/calc++/Makefile.am: Pass VERSION to extexi.
103
104 * src/files.c (compute_exts_from_gc): Look in language structure
105 for .y extension.
106 (compute_file_name_parts): Check whether .tab should be added.
107 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
108 (language, skeleton_arg, language_argmatch): New.
109 (long_options): Add --language.
110 (getargs): Use skeleton_arg, add -L/--language.
111 * src/getargs.h: Include location.h.
112 (struct bison_language, language, skeleton_arg, language_argmatch): New.
113 * src/output.c (prepare): Pick default skeleton from struct language.
114 Don't dispatch C skeletons here.
115 * src/parse-gram.y (PERCENT_LANGUAGE): New.
116 (prologue_declaration): Add "%language" rule, use skeleton_arg.
117 * src/scan-gram.l ("%language"): New rule.
118
119 * tests/calc.at: Test %skeleton and %language.
120 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
121 (AT_GLR_IF): Look for %skeleton "glr.cc".
122 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
123 (AT_YACC_IF): Reject %language.
124
5691bf57
PE
1252006-12-18 Paul Eggert <eggert@cs.ucla.edu>
126
db06f0ce
PE
127 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
128 since it wasn't used; only the typedef name 'semantic_type' is needed.
129 Also, omit trailing white space.
130
5691bf57
PE
131 * bootstrap: Sync from coreutils.
132 (gnulib_extra_files): Add build-aux/announce.gen.
133 (slurp): Adjust .gitignore files like .cvsignore files.
134 * build-aux/announce-gen: Remove from CVS, since bootstrap
135 now creates this.
136
791934e4
JD
1372006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
138
139 Make %push-parser imply %pure-parser. This fixes several bugs; see
140 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
141 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
142 pure_parser = true.
143 * data/push.c: Don't bother testing b4_push_if when deciding whether
144 to expand b4_declare_parser_variables globally.
145 (yypush_parse): Likewise in here.
146
147 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
148 (yy_reduce_print): Reformat M4 for readability.
149
ee5abb37
JD
1502006-12-15 Bob Rossi <bob@brasko.net>
151 and Joel Denny <jdenny@ces.clemson.edu>
152
153 * data/push.c (yypstate): Add typedef, and update all uses of
154 struct yypstate to just yypstate.
155 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
156
16ca01f9
JD
1572006-12-14 Bob Rossi <bob@brasko.net>
158
159 * data/push.c (yypush_parse): Declare prototype regardless of
160 %locations option.
161
ab8e7e1a
JD
1622006-12-14 Bob Rossi <bob@brasko.net>
163
164 * data/push.c (yyparse): Remove the prototype and the #define when in
165 push-parser mode.
166
9bf32be3
JD
1672006-12-13 Bob Rossi <bob@brasko.net>
168
169 * data/push.c (yypstate_init): Rename to...
170 (yypstate_new): ... this and use b4_c_function_def.
171 (yypstate_delete): New.
172 (yypush_parse): Change parameters yynval and yynlloc to be const.
173 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
174 yypstate_delete functions.
175
f02e2948
JD
1762006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
177
178 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
179 strange test case titles. Reported by Bob Rossi.
180
38eb7751
PE
1812006-12-13 Paul Eggert <eggert@cs.ucla.edu>
182
183 * TODO: Add pointer to Sylvain Schmitz's work on static detection
184 of potential ambiguities in GLR grammers.
185
bd9d212b
JD
1862006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
187
188 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
189 `bison ', use m4_index instead of m4_substr since chopping up a string
190 containing M4-special characters causes problems here.
191
192 Fix a couple of bugs related to special characters in user-specified
193 file names, and make it easier for skeletons to compute output file
194 names with the same file name prefix as Bison-computed output file
195 names.
196 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
197 b4_parser_file_name and b4_spec_defines_file instead of
198 @output_parser_name@ and @output_header_name@, which are now redundant.
199 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
200 b4_parser_file_name, b4_spec_defines_file, and the new
201 @basename(FILENAME@) instead of @output_parser_name@ and
202 @output_header_name@, which inappropriately escaped the file names as
203 C string literals.
204 * src/files.c (all_but_ext): Remove static qualifier.
205 (compute_output_file_names): Move `free (all_but_ext)' to...
206 (output_file_names_free): ... here since all_but_ext is needed later.
207 * src/files.h (all_but_ext): Extern.
208 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
209 exactly what MUSCLE_INSERT_STRING used to do.
210 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
211 characters are escaped properly.
212 * src/output.c (prepare): Define muscle file_name_all_but_ext as
213 all_but_ext.
214 For pkgdatadir muscle, maintain previous functionality by using
215 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
216 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
217 digraphs would never be expanded. Hopefully no one has M4-special
218 characters in his Bison installation path.
219 * src/scan-skel.l: Don't parse @output_header_name@ and
220 @output_parser_name@ anymore since they're now redundant.
221 In @output, use decode_at_digraphs.
222 Parse a new @basename command that invokes last_component.
223 (decode_at_digraphs): New.
224 (BASE_QPUTS): Remove unused.
225 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
226 (Output file name): New tests.
227
3f7ca628
JD
2282006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
229
230 Warn about output files that are generated by the skeletons and that
231 conflict with other output files.
232 * data/glr.c: Don't generate the header file here when glr.cc does.
233 * src/files.c (file_names, file_names_count): New static globals.
234 (compute_output_file_names): Invoke output_file_name_check for files
235 not generated by the skeletons and remove existing checks.
236 (output_file_name_check): New function that warns about conflicting
237 output file names.
238 (output_file_names_free): Free file_names.
239 * src/files.h (output_file_name_check): Declare.
240 * src/scan-skel.l: Invoke output_file_name_check for files generated by
241 the skeletons.
242 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
243 (Conflicting output files): New tests.
244
178e123e
PE
2452006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
246
247 * doc/bison.texinfo: Fix a couple of typos.
248
2492006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
250
251 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
252 Rename to...
253 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
254 update all uses.
255 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
256 (yypush_parse): Rename yypvars argument to yyps and remove redundant
257 local pv.
258 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
259 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
260
ea17f233
JD
2612006-12-07 Bob Rossi <bob@brasko.net>
262 and Joel Denny <jdenny@ces.clemson.edu>
263
264 * data/push.c (yypvarsinit): Change return type from void* to struct
265 yypvars*. No longer cast to void* on return.
266 (struct yypvars): Remove yylen since it need not be remembered between
267 yypushparse invocations.
268 (yypushparse): Don't copy between yylen and pv->yylen.
269
55a30bda
JD
2702006-12-05 Bob Rossi <bob@brasko.net>
271
272 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
273 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
274 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
275 (struct yypvars): Remove b4_declare_parser_variables.
276 (yypvarsinit): Remove init code for removed variables.
277 (global scope): Do not declare b4_declare_parser_variables if
278 push or pure mode.
279 (yypushparse): Add b4_declare_parser_variables.
280 Init new local variables, and remove init code for removed
281 yypvars variables.
282 (yyparse): Delete.
283 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
284 and yyparse for other modes.
285 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
286 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
287 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
288 (AT_PURE_LEX_IF): True if pure or push parser.
289
85894313
JD
2902006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
291
292 Document Yacc prologue alternatives and default %destructor's and
293 %printer's as experimental. Don't mention Java yet. Discussed at
294 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
295 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
296 (2.3a): Annotate this entry to say the old forms of these features were
297 also experimental.
298 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
299 Bison Symbols): Say they're experimental. Comment out any mention
300 of Java (we'll want this back eventually).
301
02975b9a
JD
3022006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
303
304 Support a file name argument to %defines. Deprecate `=' in
305 %file-prefix, %name-prefix, and %output. Discussed at
306 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
307 * NEWS (2.3a+): Mention.
308 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
309 form of %defines, and remove `=' from entries for %file-prefix,
310 %name-prefix, and %output.
311 * src/parse-gram.y (prologue_declaration): Implement.
312 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
313 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
314 all but one occurrence of %name-prefix.
315 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
316 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
317 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
318 occurrence of each of %file-prefix and %output. Add check for %defines
319 with argument.
320 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
321 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
322 Remove the `=' from %output.
323
287b314e
JD
3242006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
325
326 Don't escape $ in test case titles since Autoconf 2.61 now does that
327 correctly.
328 * tests/actions.at (Default %printer and %destructor are not for error
329 or $undefined): Here.
330 (Default %printer and %destructor are not for $accept): Here.
331 * tests/input.at (Invalid $n and @n): Here.
332
3ebecc24
JD
3332006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
334
335 Rename <!> to <>. Discussed starting at
336 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
337 * NEWS (2.3a+): Update.
338 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
339 Update.
340 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
341 * src/scan-gram.l (INITIAL): Implement.
342 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
343 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
344 comment.
345 * tests/actions.at (Default tagless %printer and %destructor,
346 Default tagged and per-type %printer and %destructor,
347 Default %printer and %destructor are not for error or $undefined,
348 Default %printer and %destructor are not for $accept,
349 Default %printer and %destructor for mid-rule values): Update.
350 * tests/input.at (Default %printer and %destructor redeclared,
351 Unused values with default %destructor): Update.
352
26b8a438
JD
3532006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
354
355 Don't let %prec take a nonterminal.
356 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
357 token.
358 * tests/input.at (%prec takes a token): New test checking that %prec
359 won't take a nonterminal.
360
07c39ae9
JD
3612006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
362
405d53b7
JD
363 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
364 it was double-quoted.
07c39ae9
JD
365 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
366 grammar is maintained with Bison's highest standards.
367 * src/getargs.c: Fix some typos in Doxygen comments.
368
580b8926
JD
3692006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
370
371 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
372 later. Reported by Paul Eggert in
373 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
374 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
375 * src/scan-code.l (translate_action): Don't bother invoking
376 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
377 (code_scanner_free): Instead of invoking
378 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
379 which frees more.
380 * src/scan-gram.l (gram_scanner_free): Likewise.
381 * src/scan-skel.l (scan_skel): Likewise.
382
4502eadc
JD
3832006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
384
385 * src/files.c (tr): Change return type to void.
386 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
387 has been called previously for the same key.
388 (muscle_find): Return storage instead of value so that
389 --enable-gcc-warnings doesn't produce warnings that the return discards
390 const. aver that the value and storage are the same since storage
391 could potentially be NULL when value is not.
392 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
393 same as 0.
394
7746c8f6
PE
3952006-11-08 Paul Eggert <eggert@cs.ucla.edu>
396
397 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
398 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
399 us a slightly cleaner distribution, and also works.
400 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
401 gnulib changes.
402
eb095650
PE
4032006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
404 and Paul Eggert <eggert@cs.ucla.edu>
405
406 Don't let Bison leak memory except when it complains.
407 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
408 (spec_defines_file, dir_prefix): Now char *, not const char *,
409 since they are freed.
410 * src/files.c: Likewise.
411 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
412 Likewise.
413 (tr): Now operates in-place. All uses changed.
414 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
415 values.
416 (compute_file_name_parts, compute_output_file_names): Don't store
417 read-only data in variables that will be freed.
418 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
419 src_extension, and header_extension.
420 (output_file_names_free): New public function to free
421 spec_verbose_file, spec_graph_file, spec_defines_file,
422 parser_file_name, and dir_prefix.
423 * src/getargs.c (getargs): Don't store read-only data in variables that
424 will be freed.
425 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
426 (which previously existed but was unused), and quotearg_free.
427 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
428 * src/muscle_tab.c: Likewise.
429 (muscle_entry): Make the value char const *,
430 and add a new storage member that is char * and can be freed.
431 (muscle_entry_free): New private function.
432 (muscle_init): Use it instead of free.
433 (muscle_insert, muscle_grow): Update and use new storage member.
434 (muscle_code_grow): Free the string passed to muscle_grow
435 since it's not needed anymore.
436 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
437 add a new `char *code' member.
438 ("{...}"): Declare semantic type as code.
439 * src/scan-code.h (translate_rule_action):
440 (translate_symbol_action, translate_code, translate_action): Return
441 `char const *' rather than `char *' since external code should not free
442 these strings.
443 * src/scan-code.l: Likewise.
444 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
445 which is "{...}" in the parser.
446 * tests/Makefile.am (maintainer-check-valgrind): Set
447 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
448 Valgrind.
449 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
450 complain.
451 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
452 expecting a non-zero exit status sets --leak-check=summary and
453 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
454 this case, and we don't want to hear about it.
455
ac564be4
PE
4562006-11-08 Paul Eggert <eggert@cs.ucla.edu>
457
458 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
459 instead of from the template, to simplify configuration a bit.
460 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
461 and m4/wint_t.m4, as they are needed with the latest gnulib.
462
17bd8a73
JD
4632006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
464
465 Disable unset/unused mid-rule value warnings by default, and recognize
466 --warnings=midrule-values to enable them. Discussed starting at
467 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
468 * NEWS (2.3a+): Mention.
469 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
470 warnings): Add entry for midrule-values subargument.
471 * src/reader.c (symbol_should_be_used): Don't return true just because
472 the value is a set/used mid-rule value unless
473 --warnings=midrule-values was specified.
474 * tests/input.at (Unused values, Unused values before symbol
475 declarations): Run tests with and without --warnings=midrule-values.
476
477 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
478 than LIST_FREE directly.
479
89eb3c76
JD
4802006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
481
482 Finish implementing --warnings=error, which should not be implied by
483 --warnings=all (or by its synonyms -W and --warnings without
484 subarguments).
485 * src/complain.c (set_warning_issued): New function to report that
486 warnings are being treated as errors and to record an error if so.
487 Invoke...
488 (warn_at, warn): ... here.
489 * src/getargs.c (warnings_args, warnings_types): Reorder so that
490 "error - warnings are errors" does not appear above "all - all of the
491 above".
492 (getargs): For -W and --warnings without subarguments, don't let
493 FLAGS_ARGMATCH set warnings_error in warnings_flag.
494 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
495
ba7560e2
JD
4962006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
497
498 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
499 empty subargument list. For example: `bison --warnings= parser.y'.
500
31283fc3
JD
5012006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
502
503 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
504 the parser header file so that gcc doesn't warn.
505
12e35840
JD
5062006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
507
508 Split the default %destructor/%printer into two kinds: <*> and <!>.
509 Discussed starting at
510 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
511 * NEWS (2.3a+): Mention.
512 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
513 previous change today related to mid-rules.
514 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 515 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
516 (TYPE_TAG_ANY): Add as <*>.
517 (TYPE_TAG_NONE): Add as <!>.
518 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
519 for <*> and <!>.
520 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
521 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
522 * src/symlist.c (symbol_list_default_new): Split into tagged and
523 tagless versions.
524 (symbol_list_destructor_set, symbol_list_printer_set): Split
525 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
526 SYMLIST_DEFAULT_TAGLESS.
527 * src/symlist.h: Update symbol_list_default*_new prototypes.
528 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
529 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
530 * src/symtab.c (default_destructor, default_destructor_location,
531 default_printer, default_printer_location): Split each into tagged and
532 tagless versions.
533 (symbol_destructor_get, symbol_destructor_location_get,
534 symbol_printer_get, symbol_printer_location_get): Implement tagged
535 default and tagless default cases.
536 (default_destructor_set, default_printer_set): Split each into tagged
537 and tagless versions.
538 * src/symtab.h: Update prototypes.
539 * tests/actions.at (Default %printer and %destructor): Rename to...
540 (Default tagless %printer and %destructor): ... this, and extend.
541 (Per-type %printer and %destructor): Rename to...
542 (Default tagged and per-type %printer and %destructor): ... this, and
543 extend.
544 (Default %printer and %destructor for user-defined end token): Extend.
545 (Default %printer and %destructor are not for error or $undefined):
546 Update.
547 (Default %printer and %destructor are not for $accept): Update.
548 (Default %printer and %destructor for mid-rule values): Extend.
549 * tests/input.at (Default %printer and %destructor redeclared): Extend.
550 (Unused values with default %destructor): Extend.
551
f91b1629
JD
5522006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
553
554 Don't apply the default %destructor/%printer to an unreferenced midrule
555 value. Mentioned at
556 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
557 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
558 like $@n instead of just @n so that the default %destructor/%printer
559 logic doesn't see them as user-defined symbols.
560 (symbol_is_dummy): Check for both forms of the name.
561 * src/reader.c (packgram): Remove the `$' from each midrule symbol
562 name for which the midrule value is referenced in any action.
563 * tests/actions.at (Default %printer and %destructor for mid-rule
564 values): New test.
565 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
566 for change to dummy symbol names.
567
519d0004
JD
5682006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
569
570 Warn about unset midrule $$ if the corresponding $n is used.
571 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
572 $n usage.
573 (packgram): Before invoking grammar_rule_check on any rule, make sure
574 all actions have already been scanned in order to set `used' flags.
575 Otherwise, checking that a midrule's $$ is set will not always work
576 properly because the midrule check must forward-reference the midrule's
577 parent rule.
578 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
579 warning.
580
a501eca9
JD
5812006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
582
583 More improvements to the documentation of the prologue alternatives:
584 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
585 Bison manual.
586 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
587 some text to clarify the relative importance of the new directives and
588 to show how these directives may be viewed as code labels.
589
2cbe6b7f
JD
5902006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
591
592 Similar to the recently removed %before-header, add %code-top as the
593 alternative to the pre-prologue. Mentioned at
594 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
595 Also, let the prologue alternatives appear in the grammar section.
596 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
597 (prologue_declaration): Move the existing prologue alternatives to...
598 (grammar_declaration): ... here and add %code-top.
599 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
600
601 Clean up and extend documentation for the prologue alternatives.
602 * NEWS (2.3a+): Describe prologue alternatives.
603 * doc/bison.texinfo (Prologue): Move discussion of prologue
604 alternatives to...
605 (Prologue Alternatives): ... this new section, and extend it to discuss
606 all 4 directives in detail.
607 (Bison Symbols): Clean up discussion of prologue alternatives and add
608 %code-top.
609
e557d3ea
JMG
6102006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
611
612 DJGPP specific issues.
613
614 * djgpp/config.bat: config.hin has been moved to lib. Adjust
615 config.bat accordingly.
616 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
617 * djgpp/config.site: Likewise.
618
136a0f76
PB
6192006-10-16 Paolo Bonzini <bonzini@gnu.org>
620
27bd5d67
PB
621 Replace %*-header with %provides, %requires, %code. See discussion at
622 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
623
136a0f76
PB
624 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
625 (b4_user_start_header): Remove.
626 * data/glr.c: Use new macros instead of b4_*start_header
627 and b4_*end_header.
628 * data/glr.cc: Likewise.
629 * data/lalr1.cc: Likewise.
630 * data/push.c: Likewise.
631 * data/yacc.c: Likewise.
632
633 * doc/bison.texinfo: Remove %before-header, rename
634 %{start,end,after}-header to %requires, %provides, %code.
635
636 * src/parse-gram.y: Likewise (also rename token names accordingly).
637 * src/scan-gram.l: Likewise.
638 * tests/actions.at: Likewise.
639
10f429ef
PE
6402006-10-14 Paul Eggert <eggert@cs.ucla.edu>
641
642 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
643 Problem reported by Joel E. Denny.
644
6452006-10-14 Jim Meyering <jim@meyering.net>
646
647 (Sync from coreutils.)
648 Work also when the working directory (with e.g. coreutils sources)
649 is version controlled with git, rather than CVS.
650 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
651 rather than CVS.
652 In messages and comments, say e.g., "checked-out sources",
653 rather than "CVS sources".
654 (version_controlled_file): New function. Work for git as well as
655 for CVS. Don't use grep's -q option.
656 (slurp): Call it here, in place of CVS-specific code.
657
c4bd5bf7
JD
6582006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
659
660 Fix testsuite for ./configure --enable-gcc-warnings:
661 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
662 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
663 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
664 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
665 * test/regression.at (Diagnostic that expects two alternatives):
666 Likewise.
667
46356ea4
PE
6682006-10-12 Paul Eggert <eggert@cs.ucla.edu>
669
231ed89a
PE
670 * bootstrap.conf (gnulib_modules): Add config-h.
671 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
672 worry about HAVE_CONFIG_H.
673 * lib/abitset.c: Likewise.
674 * lib/bitset.c: Likewise.
675 * lib/bitset_stats.c: Likewise.
676 * lib/bitsetv-print.c: Likewise.
677 * lib/bitsetv.c: Likewise.
678 * lib/ebitset.c: Likewise.
679 * lib/get-errno.c: Likewise.
680 * lib/lbitset.c: Likewise.
681 * lib/subpipe.c: Likewise.
682 * lib/timevar.c: Likewise.
683 * lib/vbitset.c: Likewise.
684 * lib/bitset.c: Include "bitset.h" first, to test interface.
685 * lib/bitset_stats.c: Include "bitset_stats.h" first.
686 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
687 * lib/bitsetv.c: Include "bitsetv.h" first.
688 * lib/get-errno.c: Include "get-errno.h" first.
689 * m4/.cvsignore: Add config-h.m4.
690 * tests/actions.at (Default %printer and %destructor for ...):
691 Adjust expected line numbers in output to reflect removal of #if
692 HAVE_CONFIG_H lines.
693 * tests/glr-regression.at (Missed %merge type warnings when ...):
694 Likewise.
695 * tests/regression.at (Braced code in declaration in rules section):
696 Likewise.
697 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
698 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
699 Include <config.h> unconditionally.
700
46356ea4
PE
701 * bootstrap: Sync from coreutils, as follows:
702
703 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
704
705 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
706 variable was sometimes used without being initialized. This
707 messed up the installation of the INSTALL file in some cases.
708
709 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
710
711 * bootstrap (usage, main program, symlink_to_gnulib): Add option
712 --copy. Inspired by a suggestion from Bruno Haible.
713
714 2006-10-03 Jim Meyering <jim@meyering.net>
715
716 * bootstrap: Undo last change to this file, since now gnulib-tool
717 sticks with the automake default in generating dependencies.
718
dd4bf078
PE
7192006-10-12 Paul Eggert <eggert@cs.ucla.edu>
720
cf2a5f7c
PE
721 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
722 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
723
724 * doc/bison.1: Add copyright notice.
725
726 * data/glr.c: Don't include <stdarg.h>; not used.
727
35fe0834
PE
728 * NEWS: The -g and --graph options now output graphs in Graphviz
729 DOT format, not VCG format.
730 * doc/bison.1: Likewise.
731 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
732 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
733 of this change in
734 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
735 * TODO: Remove Graphviz entry.
736 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
737 remove vcg.c, vcg.h, vcg_defaults.h.
738 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
739 * src/graphviz.c, src/graphviz.h: New files.
740 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
741 * src/files.h: Make comment more generic.
742 * src/main.c (main): Likewise.
743 * src/print_graph.h: Likewise.
744 * src/getargs.c (usage): Make usage description more generic.
745 * src/print_graph.c: Include graphviz.h rather than vcg.h.
746 (static_graph, fgraph): Remove. All uses changed to pass
747 arguments instead of sharing a static var.
748 (print_core, print_actions, print_state, print_graph):
749 Output graphviz format rather than VCG format.
750 * tests/.cvsignore: Remove *.vcg; add *.dot.
751 * tests/output.at: Expect *.dot files, not *.vcg files.
752
dd4bf078
PE
753 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
754 accommodates the 2006-10-08 change.
755
efdd7421
PE
7562006-10-11 Bob Rossi <bob@brasko.net>
757
758 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
759 (b4_yyssa, b4_yyerror_range): New macros.
760 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
761 (yypvarsinit): Remove init of removed fields.
762 (yypushparse): Remove use of removed fields; use new macros instead.
763
96a1981a
PE
7642006-10-11 Paul Eggert <eggert@cs.ucla.edu>
765
766 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
767 in a push parser. Reindent slightly to match yacc.c better.
768
7692006-10-11 Bob Rossi <bob@brasko.net>
770
46356ea4
PE
771 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
772 yymsg_alloc fields.
773 (yypvarsinit, yypushparse): Remove init of removed fields.
774 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 775
c1630a8b
PE
7762006-10-09 Paul Eggert <eggert@cs.ucla.edu>
777
778 * THANKS: Add Paolo Bonzini and Bob Rossi.
779
90b9908d
PB
7802006-10-08 Paolo Bonzini <bonzini@gnu.org>
781
782 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
783 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
784 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
785 b4_define_user_cde and uses): Remove.
786 (b4_comment, b4_prefix, b4_sync_start): New.
787 * data/bison.m4: New file, with most of the content removed from c.m4.
788 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
789 * src/output.c (output_skeleton): Pass bison.m4.
790 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
791 only if specified.
792
cf806753
PE
7932006-10-05 Paul Eggert <eggert@cs.ucla.edu>
794
795 Fix test failure reported by Tom Lane in
796 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
797 and try to make such failures easier to catch in the future.
798 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
799 that's now the caller's responsibility.
800 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
801 Set yychar = YYEOF if it's negative.
802 * tests/actions.at (yylex): Abort if asked to read past EOF.
803 * tests/conflicts.at (yylex): Likewise.
804 * tests/cxx-type.at (yylex): Likewise.
805 * tests/glr-regression.at (yylex): Likewise.
806 * tests/input.at (yylex): Likewise.
807 * tests/regression.at (yylex): Likewise.
808 * tests/torture.at (yylex): Likewise.
809
0e2f006a
PE
8102006-10-01 Paul Eggert <eggert@cs.ucla.edu>
811
812 Fix problems with translating English-language diagnostics.
813 * bootstrap: Fix bug introduced in recent bootstrap changes, with
814 respect to bison-runtime pot generation. The YY_ stuff
815 wasn't being captured.
816 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
817 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
818 * runtime-po/POTFILES.in: Add data/push.c.
819
e3ddc1e3
PE
8202006-09-29 Paul Eggert <eggert@cs.ucla.edu>
821
822 Merge bootstrap changes from coreutils.
823
824 2006-09-28 Jim Meyering <jim@meyering.net>
825
826 Automatically generated dependencies are important even
827 when all of the sources in a directory come from gnulib.
828 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
829 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
830
831 2006-09-23 Jim Meyering <jim@meyering.net>
832
833 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
834
835 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
836
837 * bootstrap: Add support for --force.
838 (usage): New function. Describe usage less tersely.
839 (CVS_only_file): New var.
840
01e972b3
PE
8412006-09-21 Paul Eggert <eggert@cs.ucla.edu>
842
843 * data/push.c (YYPUSH_MORE): Make it an enum instead.
844 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
845 Adjust white space and comments to match GNU style better.
846
c63d3e90
PE
8472006-09-20 Bob Rossi <bob@brasko.net>
848
849 * data/push.c (yyresult_get): Remove function.
850 (YYPUSH_MORE): Add #define.
851 (yypushparse): Modify return value.
852
e70f46d1
PE
8532006-09-20 Paul Eggert <eggert@cs.ucla.edu>
854
855 * stamp-h.in: Remove; no longer needed.
856 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
857 Remove config.h, config.hin, intl (no longer created).
858 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
859 stamp-h1.
860
861 Sync bootstrap from coreutils, as follows:
862
863 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
864
865 * bootstrap (symlink_to_gnulib): New function.
866 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
867 to copies-of-gnulib.
868 (cp_mark_as_generated, slurp, gnulib_files):
869 Avoid making a copy if it's the same as the old version.
870 (gnulib_files): Add support for this variable (used by Bison).
871
a92be413
PE
8722006-09-20 Paul Eggert <eggert@cs.ucla.edu>
873
874 * src/getargs.c (usage): Rework to use conventions similar to
875 coreutils, to make translation a bit easier and the code a bit
876 smaller. Problem reported by Tim Van Holder.
877
4f82b42a
PE
8782006-09-15 Paul Eggert <eggert@cs.ucla.edu>
879
3b2942e6
PE
880 Use some of gnulib's new modules, taken from coreutils.
881
882 * bootstrap: Sync from coreutils, except add support for gnulib_files.
883 * bootstrap.conf: New file.
884 (gnulib_modules): Add configmake, inttypes, unistd.
885 (XGETTEXT_OPTIONS): Add complain, complain_at,
886 fatal, fatal_at, warn, warn_at, unexpected_end.
887 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
888 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
889 (gl_EARLY): Add.
890 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
891 (gl_INIT): Add
892 (GNULIB_AUTOCONF_SNIPPET): Remove.
893 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
894 the pickiest.
895 * lib/.cvsignore: Add inttypes_.h.
896 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
897 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
898 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
899 no-longer-necessary initializations.
900 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
901 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
902 use the unistd module.
903 * src/system.h: Likewise.
904 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
905 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
906 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
907 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
908 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
909 * src/system.h: Include inttypes.h unconditionally, now that we
910 use the inttypes module. Don't bother to include stdint.h, since
911 inttypes.h now does that for us.
912 (LOCALEDIR): Remove, now that we use the configmake module.
913 * src/getargs.c: Include configmake.h.
914 * src/main.c: Likewise.
915 * src/output.c: Likewise.
916 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
917 not from $abs_top_builddir, since config.h moved.
918
919
4f82b42a
PE
920 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
921 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
922
923 * src/parse-gram.y (symbol_declaration): Don't put statements
924 before declarations; it's not portable to C89.
925 * src/scan-code.l (handle_action_at): Likewise.
926
927 * src/scan-code.l: Always initialize braces_level; the old code
928 left it uninitialized and therefore had undefined behavior.
929
930 Don't attempt to redefine 'assert', since it runs afoul of
931 systems where standard headers (mistakenly) include <assert.h>.
932 Instead, define and use our own alternative, called 'aver'.
933 * src/reader.c: Don't include assert.h, since we no longer
934 use assert.
935 * src/scan-code.l: Likewise.
936 * src/system.h (assert): Remove, replacing with....
937 (aver): New function, taking a bool arg. All uses changed.
938 * src/tables.c (pack_vector): Ensure that aver arg is bool,
939 not merely an integer.
940
31c10e38
PE
9412006-09-15 Bob Rossi <bob@brasko.net>
942
943 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
944 * data/c.m4 (YYPUSH): New.
945 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
946 * src/getargs.c (push_parser): New var.
947 * src/getargs.h (push_parser): New declaration.
948 * src/output.c (prepare): Add macro insertion of `push_flag'.
949 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
950 (prologue_declaration): Parse %push-parser.
951 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
952 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
953 list of removed lines from the traces observed.
954 (AT_CHECK_CALC_LALR): Added push parser tests.
955
fa7b79c0
PE
9562006-09-13 Paul Eggert <eggert@cs.ucla.edu>
957
21fe08ca
PE
958 * NEWS: Version 2.3a.
959 * configure.ac (AC_INIT): Likewise.
960
e8ec4d9b
PE
961 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
962 "#define YYSTYPE int" that caused "make maintainer-check" to fail
963 due to header ordering dependencies. I don't know why the #define
964 was there.
965
fa7b79c0
PE
966 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
967 runtime cost when YYDEBUG is not defined, and so that some tests
968 that used to fail now work. Problem and initial suggestion by
969 Paolo Bonzini.
970 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
971 * data/glr.cc (b4_parser_class_name):
972 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
973 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
974 (yydebug_) [YYDEBUG]: New member.
975 (yycdebug_): Now defined only if YYDEBUG.
976 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
977 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
978 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
979 if YYYDEBUG.
980 (debug_stream, set_debug_stream, debug_level, set_debug_level):
981 Define only if YYDEBUG.
982 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
983 set_debug_level.
984 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
985 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
986 AT_CHECK_CALC_GLR_CC that are working now.
987
4ec13d60
PE
9882006-09-12 Paul Eggert <eggert@cs.ucla.edu>
989
990 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
991 We don't need them in glr.cc, and glr.c defines them.
992 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
993 assumes that defining it to anything is the same as defining
994 it to 1. Problem reported by Paolo Bonzini.
995
8e1687ae
PE
9962006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
997
998 * data/c.m4 (b4_null, b4_case): Define.
999 * src/output.c (prepare_symbols): Use b4_null.
1000 (user_actions_output): Use b4_case.
1001
3dc5e96b
PE
10022006-09-11 Paul Eggert <eggert@cs.ucla.edu>
1003
aef3da86
PE
1004 * data/glr.c (b4_shared_declarations): Put start-header first,
1005 before any #includes that we generate, so that feature-test
1006 macros work. Problem reported by Michael Deutschmann in
1007 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
1008 * data/lalr1.cc: Likewise.
1009 * doc/bison.texinfo (Prologue): Document that feature-test macros
1010 should be defined before any Bison declarations.
1011 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
1012 that depend on location.hh after, not before, Bison decls, since
1013 we now include location.hh after the first user prologue.
1014
3dc5e96b
PE
1015 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
1016 Sander Brandenburg in
1017 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
1018 Also, fix minor white space and comment issues.
aef3da86
PE
1019 (Prologue): Mention that it's better to define feature-test macros
1020 before Bison declarations. Problem reported by Michael Deutschmann.
1021
1022 * README-cvs: Fix typo: "&" should be "&&". Problem reported
1023 by Jim Meyering.
1024 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
1025 This adjusts to recent gnulib changes.
3dc5e96b 1026
b2a0b7ca
JD
10272006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1028
1029 Finish implementation of per-type %destructor/%printer. Discussed
1030 starting at
1031 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
1032 and
1033 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
1034 * NEWS (2.3+): Add a description of this feature to the default
1035 %destructor/%printer description.
1036 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
1037 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1038 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
1039 list node contains a semantic type.
1040 * src/symtab.c, src/symtab.h: Extend with a table that associates
1041 semantic types with their %destructor's and %printer's.
1042 (semantic_type_from_uniqstr, semantic_type_get,
1043 semantic_type_destructor_set, semantic_type_printer_set): New functions
1044 composing the public interface of that table.
1045 (symbol_destructor_get, symbol_destructor_location_get,
1046 symbol_printer_get, symbol_printer_location_get): If there's no
1047 per-symbol %destructor/%printer, look up the per-type before trying
1048 the default.
1049 * tests/actions.at (Per-type %printer and %destructor): New test case.
1050 * tests/input.at (Default %printer and %destructor redeclared):
1051 Extend to check that multiple occurrences of %symbol-default in a
1052 single %destructor/%printer declaration is an error.
1053 (Per-type %printer and %destructor redeclared, Unused values with
1054 per-type %destructor): New test cases.
1055
3be03b13
JD
10562006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1057
1058 Require default %destructor/%printer to be declared using
1059 %symbol-default instead of an empty symbol list, and start working on
1060 new per-type %destructor/%printer. Discussed at
1061 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
1062 * NEWS (2.3+): Add %symbol-default to example.
1063 * bison.texinfo (Freeing Discarded Symbols): Likewise.
1064 (Bison Symbols): Add entry for %symbol-default.
1065 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
1066 (generic_symlist, generic_symlist_item): New nonterminals for creating
1067 a list in which each item is a symbol, semantic type, or
1068 %symbol-default.
1069 (grammar_declaration): Use generic_symlist in %destructor and %printer
1070 declarations instead of symbols.1 or an empty list.
1071 (symbol_declaration, precedence_declaration, symbols.1): Update actions
1072 for changes to symbol_list.
1073 * src/reader.c: Update for changes to symbol_list.
1074 * src/scan-code.l: Likewise.
1075 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
1076 * src/symlist.c, src/symlist.h: Extend such that a list node may
1077 represent a semantic type or a %symbol-default in addition to just an
1078 ordinary symbol. Add switched functions for setting %destructor's and
1079 %printer's.
1080 * tests/actions.at, tests/input.at: Add %symbol-default to all default
1081 %destructor/%printer declarations.
1082
3508ce36
JD
10832006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
1084
1085 Whether the default %destructor/%printer applies to a particular symbol
1086 isn't a question of whether the user *declares* that symbol (in %token,
1087 for example). It's a question of whether the user by any means
1088 *defines* the symbol at all (by simply using a char token, for
1089 example). $end is defined by Bison whereas any other token with token
1090 number 0 is defined by the user. The error token is always defined by
1091 Bison regardless of whether the user declares it with %token, but we
1092 may one day let the user define error as a nonterminal instead.
1093 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
1094 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
1095 the meaning of "user-defined".
1096 * tests/actions.at (Default %printer and %destructor for user-declared
1097 end token): Rename to...
1098 (Default %printer and %destructor for user-defined end token): ...
1099 this.
1100
1101 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
1102 computation of whether to apply the default, don't maintain a list of
1103 every Bison-defined symbol. Instead, just check for a first character
1104 of '$', which a user symbol cannot have, and check for the error token.
1105
9350499c
JD
11062006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
1107
1108 Don't apply the default %destructor or %printer to the error token,
1109 $undefined, or $accept. This change fits the general rule that the
1110 default %destructor and %printer are only for user-declared symbols,
1111 and it solves several difficulties that are described in the new test
1112 cases listed below.
1113 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
1114 * tests/actions.at (Default %printer and %destructor are not for error
1115 or $undefined, Default %printer and %destructor are not for $accept):
1116 New test cases.
1117
4d7370cb
JD
11182006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
1119
1120 Allow %start after the first rule.
1121 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
1122 when parsing the first rule.
1123 (check_and_convert_grammar): Search for it here after all grammar
1124 declarations have been parsed. Skip midrules, which have dummy LHS
1125 nonterminals.
1126 * src/symtab.c (symbol_is_dummy): New function.
1127 * src/symtab.h (symbol_is_dummy): Declare it.
1128 * tests/input.at (%start after first rule): New test.
1129
6d0ef4ec
JD
11302006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1131
1132 Redo some of the previous commit: add back the ability to use
1133 non-aliased/undeclared string literals since it might be useful to
1134 those declaring %token-table.
1135 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1136 commit: don't worry about complaints from symbols_pack.
1137 * src/symtab.c (symbol_new, symbol_class_set,
1138 symbol_check_alias_consistency): Undo changes in previous commit: count
1139 each string literal as a new symbol and token, assign it a symbol
1140 number, and don't complain about non-aliased string literals.
1141 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1142 and token counts but does still set aliased tokens to the same number,
1143 symbol_pack_processor now leaves empty slots in the symbols array.
1144 Remove those slots.
1145 * tests/regression.at (Undeclared string literal): Remove test case
1146 added in previous commit since non-aliased string literals are allowed
1147 again.
1148 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1149 remove unnecessary string literal declarations.
1150 * tests/sets.at (Firsts): Likewise.
1151
965537bc
JD
11522006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1153
1154 Don't allow an undeclared string literal, but allow a string literal to
1155 be used before its declaration.
1156 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1157 symbols_pack complained.
1158 * src/symtab.c (symbol_new): Don't count a string literal as a new
1159 symbol.
1160 (symbol_class_set): Don't count a string literal as a new token, and
1161 don't assign it a symbol number since symbol_make_alias does that.
1162 (symbol_make_alias): It's not necessary to decrement the symbol and
1163 token counts anymore. Don't assume that an alias declaration occurs
1164 before any uses of the identifier or string, and thus don't assert that
1165 one of them has the highest symbol number so far.
1166 (symbol_check_alias_consistency): Complain if there's a string literal
1167 that wasn't declared as an alias.
1168 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1169 symbol_pack asserts that every token has been assigned a symbol number
1170 although undeclared string literals have not.
1171 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 1172 string literal): New test cases.
965537bc
JD
1173 (Characters Escapes, Web2c Actions): Declare string literals as
1174 aliases.
1175 * tests/sets.at (Firsts): Likewise.
1176
47aee066
JD
11772006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1178
1179 In the grammar scanner, STRING_FINISH unclosed constructs and return
1180 them to the parser in order to improve error messages.
1181 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1182 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1183 * tests/input.at (Unclosed constructs): New test case.
1184 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1185 seen.
1186
1187 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1188 unused global.
1189
1f6b3679
JD
11902006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1191
1192 Handle string aliases for character tokens correctly.
1193 * src/symtab.c (symbol_user_token_number_set): If the token has an
1194 alias, check and set its alias's user token number instead of its own,
1195 which is set to indicate the alias. Previously, every occurrence of
1196 the character token in the grammar overwrote that alias indicator with
1197 the character code.
1198 * tests/input.at (String aliases for character tokens): New test.
1199
219741d8
JD
12002006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1201
1202 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1203
11daa4e7
PE
12042006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1205
1206 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1207 to prevent failures when building on older platforms.
1208 Check for autopoint failure.
1209 Set XGETTEXT_OPTIONS to values that check for C format strings,
1210 so that translators are warned about them (this also helps
1211 prevent core dumps).
1212
1213 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1214 function, since it simplifies our code a bit.
1215
1216 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1217 rather than -W, so we don't get bogus warnings about sign comparisons.
1218 Add -Wpointer-arith, since that warning is useful (it reports code
1219 that does not conform to C89 and that some compilers reject).
1220 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1221 since it's no longer needed.
1222
f9bfc42a
JD
12232006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1224
1225 Clean up scanners a bit.
1226 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1227 definitions so gcc won't warn when obstack_for_string is unused.
1228 * src/scan-code.l: config.h and system.h are already #include'd by
1229 scan-code-c.c, so get rid of them here.
1230 * src/scan-gram.l: Likewise.
1231 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1232 definitions rather than duplicating the rest of it.
1233 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1234
06e8700a
JD
12352006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1236
1237 Suppress signed/unsigned comparison warnings for yycheck.
1238 * data/c.m4 (b4_safest_int_type): New macro.
1239 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1240 a signed int type, cast it to b4_safest_int_type first.
1241 * data/yacc.c: Likewise.
1242 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1243 also overwritten.
1244
9c437126
PE
12452006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1246
1247 * doc/bison.texinfo: Fix some typos.
1248
284d8a13
PE
12492006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1250
1251 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1252 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1253
1254 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1255 the latest gnulib does this a different way.
1256 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1257 translation was patched, so stop omitting it.
1258
ec5479ce
JD
12592006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1260
1261 Enable declaration of default %printer/%destructor. Make the parser
1262 use these for all user-declared grammar symbols for which the user does
1263 not declare a specific %printer/%destructor. Thus, the parser uses it
1264 for token 0 if the user declares it but not if Bison generates it as
1265 $end. Discussed starting at
1266 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1267 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1268 and
1269 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1270 * NEWS (2.3+): Mention.
1271 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1272 declare a %destructor for a mid-rule's semantic value. It's just
1273 impossible to declare one specific to it.
1274 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1275 code. Describe default %destructor form.
1276 * src/parse-gram.y (grammar_declaration): Parse default
1277 %printer/%destructor declarations.
1278 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1279 and symbol_destructor_location_get rather than accessing the destructor
1280 and destructor_location members of struct symbol.
1281 (symbol_printers_output): Likewise but for %printer's.
1282 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1283 again.
1284 * src/symtab.c (default_destructor, default_destructor_location,
1285 default_printer, default_printer_location): New static global
1286 variables to record the default %destructor and %printer.
1287 (symbol_destructor_get, symbol_destructor_location_get,
1288 symbol_printer_get, symbol_printer_location_get): New functions to
1289 compute the appropriate %destructor and %printer for a symbol.
1290 (default_destructor_set, default_printer_set): New functions to set the
1291 default %destructor and %printer.
1292 * src/symtab.h: Prototype all those new functions.
1293 * tests/actions.at (Default %printer and %destructor): New test to
1294 check that the right %printer and %destructor are called, that they're
1295 not called for $end, and that $$ and @$ work correctly.
1296 (Default %printer and %destructor for user-declared end token): New
1297 test to check that the default %printer and %destructor are called for
1298 a user-declared end token.
1299 * tests/input.at (Default %printer and %destructor redeclared, Unused
1300 values with default %destructor): New tests to check related grammar
1301 warnings and errors.
1302
868d2d96
JD
13032006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1304
1305 Clean up handling of %destructor for the end token (token 0).
1306 Discussed starting at
1307 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1308 and
1309 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1310
1311 Make the skeletons consistent in how they pop the end token and invoke
1312 its %destructor.
1313 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1314 state, which has token number 0, since this would invoke the
1315 %destructor for the end token.
1316 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1317 until after shifting the end token, or else it won't be popped.
1318 * data/yacc.c (yyparse): Likewise.
1319
1320 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1321 it's the end token. Upon termination, destroy an unshifted lookahead
1322 even when it's the end token.
1323 * data/lalr1.cc (yy::parser::parse): Likewise.
1324 * data/yacc.c (yyparse): Likewise.
1325
1326 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1327 value warnings for the end token when the user gives the end token a
1328 %destructor.
1329
1330 * tests/actions.at (Printers and Destructors): Test all the above.
1331
62a9592d
PE
13322006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1333
1334 Update to latest gnulib and gettext versions.
1335 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1336 Add fopen-safer.
1337 (gnulib_files): Add m4/warning.m4. Don't worry about files
1338 overwritten by autopoint.
1339 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1340 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1341 rejects them.
1342 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1343 so that we can remove the intl files at a better time.
1344 (intl_files_to_remove): Remove aclocal.m4, since it gets
1345 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1346 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1347 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1348 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1349 Remove datarootdir hack; no longer needed.
1350 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1351 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1352 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1353 strdup.h.
1354 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1355 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1356
10d6970f
PE
13572006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1358
1359 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1360 it with --assume-autoconf='latest-stable'.
1361
50a33993
JD
13622006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1363
1364 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1365 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1366 YYSTYPE' and `{'.
1367 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1368 those from muscle_tab.c since the old ones are misleading.
1369
2ce4ed68
AD
13702006-07-13 Akim Demaille <akim@epita.fr>
1371
1372 Support %define "KEY" {VALUE}.
1373 * src/scan-code.h, src/scan-code.l (translate_action)
1374 (translate_rule_action, translate_symbol_action, translate_code):
1375 Return char *, not const char *.
1376 * src/parse-gram.y (declaration): Rename as...
1377 (prologue_declaration): this.
1378 (string_content): Remove this nonterminal, use STRING.
1379 (braceless, content, content.opt): New nonterminal.
1380 Use them.
1381 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1382 as value.
1383 * src/scan-gram.l (getargs.h): Don't include it.
1384
db7e5eb5
PE
13852006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1386
1387 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1388 rather than a for-loop that declares a local bool variable. This
1389 should work around a compatibility problem with a Cray x1e C++
1390 compiler reported by Hung Nguyen in
1391 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1392 The for-loop was introduced in the 2004-11-17 change but I don't
1393 know why it was needed.
1394
a5d80ba5
AD
13952006-07-12 Akim Demaille <akim@epita.fr>
1396
1397 * data/c.m4: Comment changes.
1398
23eb2a69
AD
13992006-07-10 Akim Demaille <akim@lrde.epita.fr>
1400
1401 * src/complain.c (error_message, ERROR_MESSAGE): New.
1402 To factor...
1403 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1404 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1405
ddc8ede1
PE
14062006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1407
1408 * NEWS: Instead of %union, you can define and use your own union type
1409 YYSTYPE if your grammar contains at least one <type> tag.
1410 Your YYSTYPE need not be a macro; it can be a typedef.
1411 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1412 (Union Decl, Decl Summary): Document this.
1413 * data/glr.c (YYSTYPE): Implement this.
1414 * data/glr.cc (YYSTYPE): Likewise.
1415 * data/lalr1.cc (YYSTYPE): Likewise.
1416 * data/yacc.c (YYSTYPE): Likewise.
1417 * src/output.c (prepare): Output tag_seen_flag.
1418 * src/parse-gram.y (declaration, grammar_declaration):
1419 Use 'union_seen' rather than 'typed' to determine whether
1420 %union has been seen, since grammars can now be typed without
1421 %union.
1422 (symbol_declaration, type.opt, symbol_def):
1423 Keep track of whether a tag has been seen.
1424 * src/reader.c (union_seen, tag_seen): New vars.
1425 (typed): remove.
1426 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1427 * src/scan-code.l (untyped_var_seen): New variable.
1428 (handle_action_dollar): Adjust to above changes.
1429 (handle_action_dollar, handle_action_at):
1430 Improve overflow checking for outlandish numbers.
1431 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1432 avoid new diagnostics generated by above changes.
1433 * tests/regression.at (YYSTYPE typedef): Add test to check
1434 for type tags without %union.
1435
1436 * src/symlist.c (symbol_list_length): Return int, not unsigned
1437 int, since callers expect int. This may need to get revisited
1438 once we have proper integer overflow checking.
1439
1440 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1441 object is now static.
1442
1443 * src/getargs.c (flags_argmatch): Return void, not int,
1444 to pacify ./configure --enable-gcc-warnings.
1445
1446 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1447 since last_string is already defined to FLEX_PREFIX (last_string).
1448
7b42569e
AD
14492006-07-09 Akim Demaille <akim@lrde.epita.fr>
1450
1451 Implement --warnings/-W.
1452 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1453 replaced by...
1454 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1455 Adjust callers.
1456 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1457 (warnings_args, warnings_types): New.
1458 (getargs, short_options, long_options): Accept -W/--warnings.
1459 Sort the options by alphabetical order, upper case letter right
1460 before its lower case.
1461
3b452f4e
JD
14622006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1463
1464 Change %merge result type clash warnings to errors. Discussed at
1465 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1466 * src/reader.c (record_merge_function_type): Use complain_at.
1467 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1468 declared later): Update test case results.
1469
b8a41559
AD
14702006-07-09 Akim Demaille <akim@lrde.epita.fr>
1471
1472 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1473 to be in alphabetical order.
1474 (trace_args): Spelling fixes.
1475
cd9e1ba2
PE
14762006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1477
1478 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1479 so they don't collide with user-defined macros.
1480 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1481 this was never guaranteed, and now that we're using gnulib stdint,
1482 which defines int_fast16_t to long int, the problem is exposed.
1483
cb48f191
PE
14842006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1485
b8445a15
PE
1486 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1487 need the full POSIX semantics (and weren't implementing them
1488 anyway).
1489
cb48f191
PE
1490 Adjust to Autoconf 2.60 and today's gnulib.
1491 * bootstrap (gnulib_modules): Add stdint.
1492 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1493 no longer copies it.
1494 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1495 since stdint needs the former and wcwidth (which is now required
1496 by mbswidth) needs the latter.
1497 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1498 work around a compatibility glitch between gettext 0.14.6 and
1499 Autoconf 2.60.
1500 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1501 Do not check for uintptr_t, since new stdint module does the right
1502 thing.
1503 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1504 Add stdint.h, stdint_.h, wcwidth.h.
1505 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1506 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1507 stdint.m4, wchar_t.m4, wcwidth.m4.
1508 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1509 usual order for ../lib/*.h files.
1510 (file_name_split): Use last_component, not base_name, to adjust
1511 to gnulib changes.
1512 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1513 for ../lib/*.h files.
1514 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1515 Define unconditionally, since we now assume the stdint module.
1516 * src/scan-skel.l: Include <dirname.h>.
1517 (BASE_QPUTS): Use last_component, not base_name.
1518 * src/system.h: Include <unlocked-io.h> in the usual order
1519 for ../lib/*.h files. Include <stdint.h> unconditionally,
1520 since we now use the stdint module.
1521 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1522 HAVE_UINTPTR_T, since we now use the stdint module.
1523 (base_name): Remove decl, since files now include <dirname.h>
1524 to get the decl.
1525
cd48d21d
AD
15262006-07-08 Akim Demaille <akim@lrde.epita.fr>
1527
1528 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1529 New, default to 1.
1530 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1531 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1532 default.
1533 * tests/calc.at: Adjust.
1534
8ec0a172
AD
15352006-07-08 Akim Demaille <akim@lrde.epita.fr>
1536
b8445a15 1537 * data/c.m4 (b4_basename): New.
8ec0a172
AD
1538 (b4_syncline): Also output the location of its invocation (from
1539 the skeleton).
1540 (b4_user_action, b4_define_user_action, b4_user_actions)
1541 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1542 (b4_user_stype): New.
1543 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1544
4a678af8
JD
15452006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1546
1547 In the grammar file, the first column is 1 not 0 on the first line as
1548 on every other line.
1549 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1550 * tests/input.at (Torturing the Scanner): Update output.
1551
1552 * src/scan-gram.l (scanner_cursor): Declare it static.
1553
dd60572a
JD
15542006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1555
1556 In warnings, say "previous declaration" rather than "first
1557 declaration".
1558 * src/symtab.c (redeclaration): Do that here.
1559 * src/reader.c (record_merge_function_type): In the case of a result
1560 type clash, report the previous declaration rather than the very first
1561 one in the grammar file.
1562 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1563 declared later): Add a third declaration to check this behavior.
1564 * tests/input.at (Incompatible Aliases): Update output.
1565
2073e1b6
AD
15662006-06-27 Akim Demaille <akim@epita.fr>
1567
1568 * doc/Doxyfile.in: New.
1569 * doc/Makefile.am: Use it.
1570 * src/lalr.h, src/symtab.h: Initial doxygenation.
1571
8ee5b538
JD
15722006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1573
1574 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
1575 declared after the %merge. This continues the effort of the previous
1576 patch.
8ee5b538
JD
1577 * src/reader.c (get_merge_function): Don't set the merger type yet.
1578 (record_merge_function_type): New function for setting the merger type
1579 and checking for clashes.
1580 (grammar_current_rule_merge_set): Set the location of the %merge for
1581 the current rule.
1582 (packgram): Invoke record_merge_function_type for each rule now that
1583 all symbol type declarations have been parsed.
1584 * src/reader.h (merger_list.type_declaration_location): New member
1585 storing the location of the first %merge from which the type for this
1586 merging function was derived.
1587 * src/symlist.h (symbol_list.merger_declaration_location): New member
1588 storing the location of a rule's %merge, if any.
1589 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1590 declared later): New test to catch the error fixed by the above patch.
1591
ffa4ba3a
JD
15922006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1593
1594 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
1595 declarations appear after the rules. Discussed at
1596 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1597 and
1598 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1599 Don't mistake the type of $$ in a midrule to be that of its parent
1600 rule's $$.
ffa4ba3a
JD
1601 * src/reader.c (grammar_current_rule_end): Don't invoke
1602 grammar_rule_check yet since not all symbol declarations may have been
1603 parsed yet.
1604 (grammar_midrule_action): Likewise.
1605 Don't record whether the midrule's $$ has been used yet since actions
1606 haven't been translated yet.
1607 Record the midrule's parent rule and its RHS index within the parent
1608 rule.
1609 (grammar_current_rule_action_append): Don't translate the action yet
1610 since not all symbol declarations may have been parsed yet and, thus,
1611 warnings about types for $$, $n, @$, and @n can't be reported yet.
1612 (packgram): Translate the action and invoke grammar_rule_check now that
1613 all symbol declarations have been parsed.
1614 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1615 after parsing the entire grammar file, the symbol list here in the case
1616 of a midrule is actually the midrule's empty RHS, so reference its
1617 parent rule's RHS where necessary.
1618 On the other hand, now that you can already know it's a midrule, you
1619 aren't forced to think $$ has the same type as its parent rule's $$.
1620 (handle_action_at): In the case of a midrule, reference the parent rule
1621 where necessary.
1622 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1623 members.
1624 (symbol_list_length): Now that this is invoked after all rules have
1625 been parsed, a NULL symbol (rather than a NULL symbol list node)
1626 terminates a rule. symbol_list_print already does this correctly.
1627 * src/symlist.h (symbol_list.midrule_parent_rule,
1628 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1629 remember their relationships with their parents.
1630 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1631 fixed by the above patch.
1632 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1633 implementing...
1634 (Unused values): ... this old test case and...
1635 (Unused values before symbol declarations): ... this new test case.
1636 This one is the same as `Unused values' except that all symbol
1637 declarations appear after the rules in order to catch the rest of the
1638 errors fixed by the above patch.
1639
e256e17f
JD
16402006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1641
300a1930
JD
1642 More cleanup.
1643 * src/reader.c (current_rule): Declare it static since it's no longer
1644 used outside this file.
1645 (grammar_current_rule_action_append): Remove redundant arguments from
1646 translate_rule_action invocation.
1647 * src/reader.h (current_rule): Remove this unused extern.
1648 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1649 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 1650
381ecb06
JD
16512006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1652
1653 Clean up yesterday's patch.
1654 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1655 to...
1656 * src/reader.c (grammar_current_rule_action_append): ... here for
1657 consistency with grammar_current_rule_symbol_append.
1658 * tests/regression.at (Braced code in declaration in rules section):
1659 Make yyerror and yylex static as usual.
1660
4210cd0b
JD
16612006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1662
1663 Fix bug that mistakes braced code in a declaration in the rules section
1664 to be a rule action. Mentioned at
1665 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1666 * src/scan-gram.l: Move midrule action detection from the start of the
1667 scanning of any braced code to...
1668 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1669 action. For readability, use $2 and @2 rather than the equivalent
1670 global variables.
1671 * tests/regression.at (Braced code in declaration in rules section):
1672 New test to catch the error fixed by the above patch.
1673
1674 Work on code readability some.
1675 * src/scan-code.l (current_rule): Get rid of this misleading and
1676 redundant declaration: it's actually extern'ed in reader.h.
1677 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1678 translate_action): Add a rule argument and use it instead of the global
1679 current_rule.
1680 (translate_rule_action): This already receives current_rule through an
1681 argument, so pass it on to translate_action instead of assigning
1682 current_rule to current_rule.
1683 (translate_symbol_action, translate_code): Pass rule = NULL to
1684 translate_action.
1685
34f98f46
JD
16862006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1687
1688 Rename %before-definitions to %start-header and %after-definitions to
1689 %end-header. Don't use these declarations to separate pre-prologue
1690 blocks from post-prologue blocks. Add new order-independent
1691 declarations %before-header and %after-header as alternatives to the
1692 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1693 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1694 * NEWS (2.3+): Update for these changes.
1695 * data/glr.c (b4_before_definitions): Update to...
1696 (b4_start_header): ... this.
1697 (b4_after_definitions): Update to...
1698 (b4_end_header): ... this.
1699 * data/glr.cc: Likewise.
1700 * data/lalr1.cc: Likewise.
1701 * data/yacc.c: Likewise.
1702 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1703 prologue blocks with %*-header declarations.
1704 (Calc++ Parser): Likewise.
1705 (Bison Declaration Summary): Update names.
1706 (Bison Symbols): Update description.
1707 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1708 (PERCENT_END_HEADER): ... this.
1709 (PERCENT_BEFORE_DEFINITIONS): Update to...
1710 (PERCENT_START_HEADER): ... this.
1711 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1712 (declaration): Update token names and m4 macro names.
1713 When parsing %end-header and %start-header, invoke translate_code
1714 before muscle_code_grow, and no longer set global booleans to remember
1715 whether these declarations have been seen.
1716 Parse new %after-header and %before-header.
1717 * src/reader.c (before_definitions, after_definitions): Remove.
1718 (prologue_augment): Accept a new bool argument to specify whether to
1719 augment the pre-prologue or post-prologue.
1720 * src/reader.h (before_definitions, after_definitions): Remove these
1721 extern's.
1722 (prologue_augment): Add new bool argument.
1723 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
1724 (PERCENT_END_HEADER): ... this.
1725 (PERCENT_BEFORE_DEFINITIONS): Update to...
1726 (PERCENT_START_HEADER): ... this.
1727 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1728 * tests/actions.at (Printers and Destructors): Update names.
1729
31b2b07e
JD
17302006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1731
1732 Add comparison operators for C++ location classes. Discussed at
1733 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
1734 * data/c++.m4 (b4_define_location_comparison): New boolean %define
1735 declaration indicating whether filename_type has an operator==. If
1736 filename_type is `std::string', it defaults to `1', `0' otherwise.
1737 * data/location.cc: Iff b4_define_location_comparison is `1', add
1738 operator== and operator!= for class position and for class location.
1739
1740 Some minor fixes.
1741 * src/scan-action.l: Remove unused file.
1742 * src/symtab.c (symbol_printer_set): Use printer_location not
1743 destructor_location.
1744 * src/symtab.h (struct symbol): Replace incorrect source comment for
1745 printer members.
1746 * tests/input.at (Incompatible Aliases): Update output with correct
1747 printer location.
1748
9bc0dd67
JD
17492006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1750
1751 Don't put the pre-prologue in the header file. For the yacc.c code
1752 file and the glr.c header and code files, move the pre-prologue before
1753 the token definitions. Add new %before-definitions and
1754 %after-definitions to declare code that will go in both the header file
1755 and code file. Discussed at
1756 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
1757 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
1758 and
1759 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
1760 * NEWS (2.3+): Describe these changes.
1761 * data/glr.c (b4_pre_prologue): Move from within to before...
1762 (b4_shared_declarations): ... this.
1763 Add new b4_before_definitions before b4_token_enums.
1764 Add new b4_after_definitions at the end.
1765 * data/glr.cc (b4_pre_prologue): Replace with...
1766 (b4_before_definitions): ... this in the header file.
1767 (b4_after_definitions): New near the end of the header file.
1768 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
1769 code file right before including the header file.
1770 (b4_before_definitions): New in the previous position of
1771 b4_pre_prologue in the header file.
1772 (b4_after_definitions): New near the end of the header file.
1773 * data/yacc.c: Clean up some m4 quoting especially in the header file.
1774 (b4_token_enums_defines): In the code file, move to right before
1775 YYSTYPE for consistency with the header file.
1776 (b4_before_definitions): New right before b4_token_enums_defines in
1777 both the header and code file.
1778 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
1779 header and code file.
1780 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
1781 of prologues for %union dependencies.
1782 (Bison Declaration Summary): In %defines description, mention the
1783 effect of %before-definitions and %after-definitions on the header
1784 file.
1785 (Calc++ Parser): Forward declare driver in a %before-definitions rather
1786 than in the pre-prologue so that make check succeeds.
1787 (Bison Symbols): Add entries for %before-definitions and
1788 %after-definitions.
1789 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
1790 %before-definitions.
1791 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
1792 (declaration): Parse those declarations and append to
1793 b4_before_definitions and b4_after_definitions, respectively.
1794 * src/reader.c (before_definitions, after_definitions): New bools to
1795 track whether those declarations have been seen.
1796 (prologue_augment): Add to the post-prologue if %union,
1797 %before-definitions, or %after-definitions has been seen.
1798 * src/reader.h (before_definitions, after_definitions): New extern's.
1799 * src/scan-gram.l: Scan the new declarations.
1800 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
1801 prologue block in a %before-definitions or a %after-definitions based
1802 on whether the %union is declared.
1803 * tests/regression.at (Early token definitions with --yacc, Early token
1804 definitions without --yacc): Move tests for token definitions into the
1805 post-prologue since token names are no longer defined in the
1806 pre-prologue.
1807
203b9274
AD
18082006-06-20 Akim Demaille <akim@epita.fr>
1809
1810 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1811 (symbol_get): Use it.
1812 * src/parse-gram.y: Use it.
1813
a7ee59cf
JD
18142006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1815
1816 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1817 build succeeds when configured with --enable-gcc-warnings.
1818
5a2baae7
PE
18192006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1820
33ad1a9c
PE
1821 * src/parse-gram.y (char_name): New function.
1822 (CHAR, STRING, string_content): For %printer, properly escape.
1823 (ID): Prefer fputs to fprintf.
1824 (id): Reindent to be consistent with other rules.
1825 Properly quote char.
1826
5a2baae7
PE
1827 The Translation Project changed its way of publishing translations
1828 to maintainers. I haven't received any responses to my request
1829 for supporting the old way, or for documenting the new way. I
1830 have modified 'bootstrap' to use screen scraping
1831 (in this case, HTML scraping). This is unreliable and inelegant,
1832 but I don't see any better way. Yuck.
1833 * bootstrap (TP_URL, WGET_COMMAND): New vars.
1834 (get_translations): New function, which uses HTML scraping to
1835 deduce locations of latest translations.
1836 Use this function to grab both bison and bison-runtime .po files.
1837 Don't bother priming the pump for the runtime-po domain any more,
1838 as it's now translated better than bison is.
1839
58d7a1a1
AD
18402006-06-19 Akim Demaille <akim@epita.fr>
1841
1842 * src/scan-gram.l: No longer "parse" things after `%union' until
1843 `{'. Rather, return a single "%union" token.
1844 No longer make symbols: return strings, and leave the conversion
1845 to symbols to the parser.
1846 (SC_PRE_CODE, token_type): Remove.
1847 * src/parse-gram.y (%union): New field `character'.
1848 Sort tokens.
1849 (CHAR): New token.
1850 (ID, ID_COLON): Now that the scanner no longer makes them
1851 identifiers, adjust all uses to invoke symbol_get.
1852 (id_colon): New, wraps the conversion from string to symbol.
1853 (%union): Accept a possible union_name.
1854 (symbol): Now can be a char.
1855 * data/c.m4 (b4_union_name): Leave a default value.
1856 * data/glr.c, data/yacc.c: Use it.
1857
b931235e
JD
18582006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1859
1860 For associating token numbers with token names for "yacc.c", don't use
1861 #define statements unless `--yacc' is specified; always use enum
1862 yytokentype. Most important discussions start at:
1863 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1864 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1865 and
1866 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1867 * NEWS (2.3+): Mention.
1868 * data/c.m4 (b4_yacc_if): New.
1869 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1870 token #define's.
1871 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1872 on token name definitions.
1873 * src/getargs.c (usage): Capitalize `Yacc' in English.
1874 * src/output.c (prepare): Define b4_yacc_flag.
1875 * tests/regression.at (Early token definitions): Test that tokens names
1876 are defined before the pre-prologue not just before the post-prologue.
1877 Remove this test case and copy to...
1878 (Early token definitions with --yacc): ... this to test #define's.
1879 (Early token definitions without --yacc): ... and this to test enums.
1880
9e6e7ed2
PE
18812006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1882
1883 * NEWS: Reword the post-2.3 change to not be so optimistic about
1884 removing the old "look-ahead" spelling.
1885 Update previous look-ahead/lookahead change reports.
1886 * REFERENCES: look-ahead -> lookahead (since that's
1887 what he actually wrote).
1888 * doc/refcard.tex: look ahead -> lookahead,
1889 look-ahead -> lookahead
1890
742e4900
JD
18912006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1892
1893 For consistency, use `lookahead' instead of `look-ahead' or
1894 `look_ahead'. Discussed starting at
1895 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1896 and then at
1897 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1898 * NEWS: For the next release, note the change to `--report'.
1899 * TODO, doc/bison.1: Update English.
1900 * doc/bison.texinfo: Update English.
1901 (Understanding Your Parser, Bison Options): Document as
1902 `--report=lookahead' rather than `--report=look-ahead'.
1903 * src/conflicts.c: Update English in comments.
1904 (lookahead_set): Rename from look_ahead_set.
1905 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1906 (resolve_sr_conflict): Rename local look_ahead_tokens to
1907 lookahead_tokens, and update other uses.
1908 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1909 count_rr_conflicts, conflicts_free): Update uses.
1910 * src/getargs.c (report_args): Move "lookahead" before alternate
1911 spellings.
1912 (report_types): Update uses.
1913 (usage): For `--report' usage description, state `lookahead' spelling
1914 rather than `look-ahead'.
1915 * src/getargs.h (report.report_lookahead_tokens): Rename from
1916 report_look_ahead_tokens.
1917 * src/lalr.c: Update English in comments.
1918 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1919 (state_lookahead_tokens_count): Rename from
1920 state_look_ahead_tokens_count.
1921 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1922 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1923 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1924 Update other uses.
1925 Update English in output.
1926 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1927 * src/print.c: Update English in comments.
1928 (lookahead_set): Rename from look_ahead_set.
1929 (print_reduction): Rename argument lookahead_token from
1930 look_ahead_token.
1931 (print_core, state_default_rule, print_reductions, print_results):
1932 Update uses.
1933 * src/print_graph.c: Update English in comments.
1934 (print_core): Update uses.
1935 * src/state.c: Update English in comments.
1936 (reductions_new): Update uses.
1937 (state_rule_lookahead_tokens_print): Rename from
1938 state_rule_look_ahead_tokens_print, and update other uses.
1939 * src/state.h: Update English in comments.
1940 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1941 (state_rule_lookahead_tokens_print): Rename from
1942 state_rule_look_ahead_tokens_print.
1943 * src/tables.c: Update English in comments.
1944 (conflict_row, action_row): Update uses.
1945 * tests/glr-regression.at
1946 (Incorrect lookahead during deterministic GLR,
1947 Incorrect lookahead during nondeterministic GLR): Rename
1948 print_look_ahead to print_lookahead.
1949 * tests/torture.at: Update English in comments.
1950 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1951 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1952 (Many lookahead tokens): Update uses.
1953 * data/glr.c: Update English in comments.
1954 * lalr1.cc: Likewise.
1955 * yacc.c: Likewise.
1956 * src/conflicts.h: Likewise.
1957 * src/lalr.h: Likewise.
1958 * src/main.c: Likewise.
1959 * src/output.c: Likewise.
1960 * src/parse-gram.c: Likewise.
1961 * src/tables.h: Likewise.
1962 * tests/calc.at: Likewise.
1963
3c40d0b5
JD
19642006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1965
1966 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1967
5d278082
PE
19682006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1969
1970 * TODO: Add request from Nelson H. F. Beebe to be able to install
1971 Bison without installing the yacc script.
1972
9e668899
JD
19732006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1974
1975 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1976 and yytext if they're already #define'd.
1977 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1978 * src/scan-code-c.c: ... here.
1979 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1980 <config.h>.
1981
0c8e079f
JD
19822006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1983
1984 Get Bison to build again when configured with --enable-gcc-warnings.
1985 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1986 missing #include's.
1987 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1988 loc argument as it shadows a global.
1989 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1990 invocation.
1991
1992 * src/.cvsignore: Add scan-code.c.
1993
2346344a
AD
19942006-06-07 Akim Demaille <akim@epita.fr>
1995
1996 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1997 to...
1998 * src/scan-code.l: here.
1999 * tests/input.at (Torturing the Scanner): Fix another location
2000 error.
2001
4862bdfd
AD
20022006-06-07 Akim Demaille <akim@epita.fr>
2003
2004 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
2005
e9071366
AD
20062006-06-06 Akim Demaille <akim@epita.fr>
2007
2008 Extract the parsing of user actions from the grammar scanner.
2009 As a consequence, the relation between the grammar scanner and
2010 parser is much simpler. We can also split "composite tokens" back
2011 into simple tokens.
2012 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
2013 * src/scan-gram.l (add_column_width, adjust_location): Move to and
2014 rename as...
2015 * src/location.h, src/location.c (add_column_width)
2016 (location_compute): these.
2017 Fix the column count: the initial column is 0.
2018 (location_print): Be robust to ending column being 0.
2019 * src/location.h (boundary_set): New.
2020 * src/main.c: Adjust to scanner_free being renamed as
2021 gram_scanner_free.
2022 * src/output.c: Include scan-code.h.
2023 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
2024 Use boundary_set.
2025 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
2026 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
2027 which is now, again, a separate token.
2028 Adjust all dependencies.
2029 Whereever actions with $ and @ are used, use translate_code.
2030 (action): Remove this nonterminal which is now useless.
2031 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
2032 (grammar_current_rule_action_append): Use translate_code.
2033 (packgram): Bound check ruleno, itemno, and rule_length.
2034 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
2035 (last_string, last_braced_code_loc, max_left_semantic_context)
2036 (scanner_initialize, scanner_free, scanner_last_string_free)
2037 (gram_out, gram_lineno, YY_DECL_): Move to...
2038 * src/scan-gram.h: this new file.
2039 (YY_DECL): Rename as...
2040 (GRAM_DECL): this.
2041 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
2042 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2043 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2044 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2045 Move these declarations, and...
2046 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
2047 these to...
2048 * src/flex-scanner.h: this new file.
2049 * src/scan-gram.l (rule_length, rule_length_overflow)
2050 (increment_rule_length): Remove.
2051 (last_braced_code_loc): Rename as...
2052 (gram_last_braced_code_loc): this.
2053 Adjust to the changes of the parser.
2054 Move all the handling of $ and @ into...
2055 * src/scan-code.l: here.
2056 * src/scan-gram.l (handle_dollar, handle_at): Remove.
2057 (handle_action_dollar, handle_action_at): Move to...
2058 * src/scan-code.l: here.
2059 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
2060 scan-code.h, scan-code-c.c, scan-gram.h.
2061 (EXTRA_bison_SOURCES): Add scan-code.l.
2062 (BUILT_SOURCES): Add scan-code.c.
2063 (yacc): Be robust to white spaces.
2064
2065 * tests/conflicts.at, tests/input.at, tests/reduce.at,
2066 * tests/regression.at: Adjust the column numbers.
2067 * tests/regression.at: Adjust the error message.
7891a7c4 2068
184e42f0
JD
20692006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2070
2071 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2072 Use Akim's wording from
2073 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
2074
7891a7c4
JD
20752006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2076
2077 Between Bison releases, manually append `+' to the previous Bison
2078 release number, and use that as a signal to automatically print the
2079 ChangeLog's CVS Id keyword from --version. Discussed starting at
2080 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
2081 * ChangeLog: Add Id header.
2082 * configure.ac (AC_INIT): Append `+' to `2.3'.
2083 * src/.cvsignore: Add revision.c.
2084 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
2085 (BUILT_SOURCES): Add revision.c.
2086 (revision.c): New target rule. This file defines a new global variable
2087 named revision. It initializes it with either the Id from ChangeLog
2088 or, if VERSION doesn't contain `+', with the empty string.
2089 * src/getargs.c (version): Print the value of revision.
2090 * src/revision.h: Extern revision.
2091
4ad3ed84
PE
20922006-06-05 Paul Eggert <eggert@cs.ucla.edu>
2093
2094 * NEWS: Version 2.3.
2095 * configure.ac (AC_INIT): Likewise.
2096
02103984
PE
20972006-05-30 Paul Eggert <eggert@cs.ucla.edu>
2098
2099 * data/glr.c (YYRECOVERING): Define to be a function-like macro
2100 with no arguments, not as an object-like macro. This is for
2101 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
2102 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
2103 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
2104 Document this.
2105
2c08afa5
JD
21062006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
2107
2108 * src/getargs.c (usage): Back out yesterday's modification of the
2109 --help output so that we don't have to wait for translation before
2110 releasing 2.3.
2111
6077da58
PE
21122006-05-29 Paul Eggert <eggert@cs.ucla.edu>
2113
2114 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
2115 Problem reported by Akim Demaille.
2116
2a26b6c2
JD
21172006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2118
2119 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2120
aefef0d6
PE
21212006-05-26 Paul Eggert <eggert@cs.ucla.edu>
2122
2123 * data/yacc.c (yy_reduce_print): Omit trailing white space in
2124 generated source code. Problem reported by Frans Englich in
2125 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
2126
fcd8e201
PE
21272006-05-22 Paul Eggert <eggert@cs.ucla.edu>
2128
2129 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
2130 shell, not within 'make', so that 'make' by an ordinary builder
2131 (using GNU make) does not worry about configuring gzip. This also
2132 works around a bug reported independently by Keith Thompson and by
2133 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
2134 stderr rather than stdout, messing up the build logs.
2135
7b5cdcbd
JD
21362006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2137
2138 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2139 to make sure that YYID will never be unused. This fixes a 'make
2140 maintainer-check' failure caused by the recent changes to the 'Trivial
2141 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2142 not used.
2143 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2144
5ad0a449
JD
21452006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2146
2147 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2148 state before an empty RHS is always resolved here. Only the location
2149 of that state is guaranteed to be resolved, and that's enough. This
2150 fixes the remaining bug reported by Derek M. Jones in
2151 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2152 * tests/glr-regression.at (Uninitialized location when reporting
2153 ambiguity): Test the above case.
2154 Also, the embedded comments in this test case claim it checks the case
2155 of an empty RHS that has inherited the initial location. However, the
2156 corresponding LHS was already resolved, so yyresolveLocations didn't
2157 actually have reason to modify it. Fix this by forcing
2158 nondeterministic operation at the beginning of the parse.
2159
50cce58e
PE
21602006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2161
2162 * data/c.m4 (b4_yy_symbol_print_generate):
2163 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2164 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2165 of the bugs reported today by Derek M Jones in
2166 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2167 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2168 defined to be a type name without parens or brackets.
2169 (Location Type): Similarly for YYLTYPE.
2170 * tests/regression.at (Trivial grammars): Put in a test for this
2171 bug that will be caught by 'make maintainer-check' (though not,
2172 alas, by 'make check' unless your compiler is picky).
2173
ab8d9dc5
PE
21742006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2175
0d2c8934 2176 * NEWS: Version 2.2.
ab8d9dc5
PE
2177 * configure.ac (AC_INIT): Likewise.
2178
9138c575
JD
21792006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2180
2181 * data/glr.c (yyreportTree): Make room in yystates for the state
2182 preceding the RHS. This fixes the segmentation fault reported by Derek
2183 M. Jones in
2184 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2185 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2186 to the user. Reported for yyreportTree by Derek M. Jones later in the
2187 same thread.
2188 * THANKS: Add Derek M. Jones.
2189 Update my email address.
2190 Fix typo in Steve Murphy's name.
2191
276f48df
PE
21922006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2193
d6645148
PE
2194 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2195 checking against YYLAST that caused the parser to miss a potential
2196 alternative in its diagnostic.
2197 Problem reported by Maria Jose Moron Fernandez in
2198 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2199 * data/lalr1.cc (yysyntax_error_): Likewise.
2200 * data/yacc.c (yysyntax_error): Likewise.
2201 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2202 tokens, in case we run into an older C compiler.
2203 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2204 Use them to check for the off-by-one error fixed above.
2205
276f48df
PE
2206 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2207 YYSIZE_T, not size_t.
2208 * tests/regression.at (Trivial grammars): New test, to catch
2209 the error fixed by the above patch.
2210
cd8b5791
AD
22112006-05-14 Akim Demaille <akim@lrde.epita.fr>
2212
2213 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2214 scheme.
2215 Reported by Steve Murphy.
2216
34376418
AD
22172006-05-14 Akim Demaille <akim@lrde.epita.fr>
2218
2219 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2220 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2221
327afc7c
AD
22222006-05-14 Akim Demaille <akim@lrde.epita.fr>
2223
2224 Implement --trace=m4.
2225 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2226 * src/output.c (output_skeleton): When set, pass -dV to m4.
2227
2228 Factor the handling of flags in m4.
2229 * src/output.c (prepare): Rename the muscle names debug, defines,
2230 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2231 * data/c.m4: Adjust.
2232 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2233 Use b4_define_flag_if to define other b4_FLAG_if macros.
2234 (b4_location_if): As a consequence, rename as...
2235 (b4_locations_if): this, for consistency.
2236 Adjust all the skeletons.
2237
ba9ecd19
AD
22382006-05-14 Akim Demaille <akim@lrde.epita.fr>
2239
2240 * etc/bench.pm: Shorten bench names.
2241
4e83ea15
AD
22422006-05-14 Akim Demaille <akim@lrde.epita.fr>
2243
2244 * src/output.h, src/output.c (error_verbose): Move to...
2245 * src/getargs.h, src/getargs.c: here.
2246 Sort the flags.
2247 Adjust dependencies.
2248
6e93d810
PE
22492006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2250
2251 * data/c.m4 (b4_copyright): Put the special exception for Bison
2252 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
2253 uses changed. Suggested by Akim Demaille. Also, wrap the
2254 copyright notice, in case it is longer than 80 columns. Replace
2255 comma by newline after title.
6e93d810 2256
eaea13f5
PE
22572006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2258
2259 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2260 incompatibility, not a bug. Mention that it wasn't fixed as of
2261 flex 2.5.33.
2262
3cf084ec
AD
22632006-05-11 Akim Demaille <akim@lrde.epita.fr>
2264
2265 * examples/extexi: Enforce the precedence of concatenation over
2266 >>.
0a9f1c7d 2267 Reported by Tommy Nordgren.
3cf084ec 2268
32c96bd7
AD
22692006-05-11 Akim Demaille <akim@lrde.epita.fr>
2270
2271 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2272 with the member "token".
f94705b2 2273 Reported by Martin Nylin.
32c96bd7 2274
eaea13f5
PE
22752006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2276
2277 * data/glr.c: Switch to Bison 2.2 special-exception language in
2278 the copyright notice. Use more-regular format for titles and
2279 copyright notices.
2280 * data/glr.cc: Likewise.
2281 * data/location.cc: Likewise.
2282 * data/yacc.cc: Likewise.
2283 * doc/bison.texinfo (Conditions): Document this.
2284 * NEWS: likewise. Upgrade version to 2.2.
2285
6e2d1146
AD
22862006-04-27 Akim Demaille <akim@lrde.epita.fr>
2287
2288 * data/glr.cc: Remove dead code.
2289
47671055
PE
22902006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2291
2292 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2293 that variable and the line breaks the bootstrap. Problem reported
2294 by Juan M. Guerrero.
2295
ed2e6384
AD
22962006-04-24 Akim Demaille <akim@lrde.epita.fr>
2297
2298 * doc/bison.texinfo (Multiple start-symbols): New.
2299
3cedc2dc
AD
23002006-04-24 Akim Demaille <akim@lrde.epita.fr>
2301
2302 * etc/README, etc/bench.pl: New.
2303
b2ddc3f3
AD
23042006-04-03 Akim Demaille <akim@lrde.epita.fr>
2305
2306 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2307 rule.
2308 Reported by Mickael Labau.
2309 * tests/input.at (Torturing the Scanner): Test it.
2310
91e3ac9a
PE
23112006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2312
2313 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2314 Problem reported by Bob Rossi.
2315
23162006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2317
2318 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2319 and didn't really work.
2320 For the index, use @ifnotinfo, not @iftex.
2321 Minor cleanups of spacing and terminology.
2322
5cf61e93
AD
23232006-03-12 Akim Demaille <akim@lrde.epita.fr>
2324
2325 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2326 of AT_NAME_PREFIX when %name-prefix is not used.
2327
aa08666d
AD
23282006-03-12 Akim Demaille <akim@lrde.epita.fr>
2329
2330 Apply --prefix to C++ skeletons too: they change the namespace.
2331 The test suite already exercize these cases.
2332 * data/c++.m4 (b4_namespace): New.
2333 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2334 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2335 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2336 * doc/bison.texinfo: Document it.
2337 (Option Cross Key): Use @multitable in all formats. It looks
2338 nicer, even in TeX outputs.
2339 (Rules): Use the same code whatever the output type is.
2340 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2341 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2342 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 2343
45567173
AD
23442006-03-10 Akim Demaille <akim@lrde.epita.fr>
2345
2346 * TODO: Remove dead items.
2347
e9d8f881 23482006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
2349
2350 * doc/FAQ: Remove, merged into...
2351 * doc/bison.texinfo (FAQ): this.
2352 * doc/Makefile.am (EXTRA_DIST): Adjust.
2353
c095d689
AD
23542006-03-10 Akim Demaille <akim@lrde.epita.fr>
2355
2356 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2357 even if empty.
2358 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2359 * doc/bison.texinfo (Calc++ Scanner): Use it.
2360
6e0f8287
PE
23612006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2362
2363 Fix two nits reported by twlevo, plus one more that I discovered.
2364
2365 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2366 this is the usual Bison style.
2367 * src/location.h (location_print): Likewise.
2368
2369 * src/reader.h (token_name): Likewise.
2370
d6b771c3
PE
23712006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2372
2373 Fix some nits reported by twlevo.
2374 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2375 and "POSIX". Use more-modern syntax for URLs. Mention C++
2376 and ask for Java. Don't hardwire OS version numbers. Add
2377 copyright notice.
2378 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2379 * src/conflicts.c (solved_conflicts_obstack): Now static.
2380
1e137b71
JD
23812006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2382
2383 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2384 page. Say "you can use it" not "you may use it" as on the web page;
2385 we're describing capabilities not granting permission.
2386
73f2e47e
PE
23872006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2388
6d05403d
PE
2389 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2390 shadowing warnings. Use usual patter for iterating through RHS.
2391 * tests/glr-regression.at
2392 (Uninitialized location when reporting ambiguity):
2393 Modify yylex so that it uses its argument, rather than trying
2394 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2395 const char -> char const.
2396
73f2e47e
PE
2397 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2398 Don't use tabs inside commands; it messes up 'ps'.
2399 Problem reported by twlevo.
2400
8710fc41
JD
24012006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2402
2403 * tests/glr-regression.at (Uninitialized location when reporting
2404 ambiguity): New test case.
2405 * data/glr.c (yyresolveLocations): New function, which uses
2406 YYLLOC_DEFAULT.
2407 (yyresolveValue): Invoke yyresolveLocations before reporting an
2408 ambiguity.
2409 * doc/bison.texinfo (Default Action for Locations): Note
2410 YYLLOC_DEFAULT's usage for ambiguity locations.
2411 (GLR Semantic Actions): Cross-reference those notes.
2412
ae952af2
JD
24132006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2414
2415 * tests/glr-regression.at (Leaked semantic values when reporting
2416 ambiguity): Remove unnecessary union and type declarations.
2417 (Leaked lookahead after nondeterministic parse syntax error): New test
2418 case.
2419 * data/glr.c (yyparse): Check for zero stacks remaining before
2420 attempting to shift the lookahead so that you don't lose it.
2421
35ee866a
JD
24222006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2423
2424 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2425 * tests/glr-regression.at (Leaked semantic values when reporting
2426 ambiguity): New test case.
2427 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2428 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2429 now unnecessary yystackp parameter.
2430 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2431 destructors can be called.
2432
2433 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2434 in existing testcases.
2435
520181ab
JD
24362006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2437
2438 Don't leak semantic values for parent RHS when a user action cuts the
2439 parser, and clean up related code a bit.
2440 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
2441 cuts parse): Rename to...
2442 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
2443 for leaked parent RHS values.
2444 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2445 between an unresolved state (non-empty chain of semantic options) and
2446 an incomplete one (signaled by an empty chain).
ae952af2 2447 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
2448 successfully or unsuccessfully resolved yyGLRState to...
2449 (yyresolveValue): ... here so that yyresolveValue always leaves a
2450 yyGLRState with consistent data and thus is easier to understand.
2451 Remove the yyvalp and yylocp parameters since they are always just
2452 taken from the yys parameter. When reporting a discarded merged value
2453 in debugging output, note that it is incompletely merged. Document the
2454 interface.
2455 (yyresolveAction): If resolving any of the RHS states fails, destroy
2456 them all rather than leaking them. Thus, as long as user actions are
2457 written to clean up the RHS correctly, yyresolveAction always cleans up
2458 the RHS of a semantic option. Document the interface.
2459
18d9185c
PE
24602006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2461
2462 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2463 led to a segmentation fault in GNU Pascal. Problem reported
2464 by Waldek Hebisch.
2465
841a7737
JD
24662006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2467
2468 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2469 mid-rule action inside a nonterminal symbol in order to declare a
2470 destructor for its semantic value.
2471
fc3f467f
PE
24722006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2473
2474 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2475 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2476 __cplusplus && ! defined _STDLIB_H && !
2477 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2478 defined free))]: Include <stdlib.h> rather than rolling our own
2479 declarations of malloc and free, to avoid problems with
2480 incompatible declarations (using 'throw') C++'s stdlib.h. This
2481 should fix Debian bug 340012
2482 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2483 reported by Guillaume Melquiond.
2484
a3af26dd
PE
24852006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2486
4d7bc38c
PE
2487 * NEWS: Clarify symbols versus types in unused-value warnings.
2488
a3af26dd
PE
2489 * configure.ac (AC_INIT): Bump version number.
2490
4e26c69e
PE
24912006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2492
2493 * NEWS: Version 2.1a.
2494 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2495 since C99 requires this.
2496
498e897c
PE
24972006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2498
2499 * m4/c-working.m4: New file.
2500 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2501
57bb17ca
PE
25022006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2503
2504 * Makefile.maint: Merge from coreutils.
2505
0be105dc
PE
25062006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2507
2508 More portability fixes for problems summarized by Nelson H. F. Beebe.
2509
2510 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2511 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2512 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2513 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2514 messes up because C++ code is compiled in 32-bit mode but linked
2515 in 64-bit mode.
2516
6fc0c024
PE
25172006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2518
2519 More portability fixes for problems summarized by Nelson H. F. Beebe.
2520
7870f699
PE
2521 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2522 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2523
6fc0c024
PE
2524 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2525 nodist_PROGRAMS, since we don't need to actually compile the
2526 example if we're just doing a plain 'make'. This avoids bothering
2527 the installer unnecessarily about problems due to weird C++
2528 compilers.
2529
fe6c2fde
PE
25302006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2531
2532 More portability fixes for problems summarized by Nelson H. F. Beebe.
2533
2534 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2535 than #include "...", and compile with -I'.'. The old method was
2536 not portable, according to Posix and the C standard, and it does
2537 not work with Sun C 5.7, where previous #line directives affect
2538 the working directory used in later #include "..." directives.
2539
927b425b
JMG
25402006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2541
2542 Various DJGGP specific issues in /djgpp
2543
d9735e9e
PE
25442006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2545
2546 More portability fixes for problems summarized by Nelson H. F. Beebe.
2547
2548 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2549 '#include <map>' works and that you can apply ++ to iterators.
2550
5a6755af
PE
25512006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2552
67a0dc4f
PE
2553 Work around portability problems summarized by Nelson H. F. Beebe in
2554 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2555
8c86f0ef
PE
2556 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2557 that '#include <string>' works.
2558
de35dd59
PE
2559 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2560 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2561 "warning: sorry: semantics of inline function static data `const
2562 unsigned char translate_table[262]' are wrong (you'll wind up with
2563 multiple copies)".
2564
67a0dc4f
PE
2565 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2566 or, xor to not_, and_, or_, and xor_, respectively. This works
2567 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2568 random system header somewhere that includes the equivalent of
2569 <iso646.h>.
2570
5a6755af
PE
2571 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2572 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 2573 Suite Version 2.0.
5a6755af 2574
3f001415
JD
25752006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2576
2577 During deterministic GLR operation, user actions should be able to
2578 influence the parse by changing yychar. To make this easier to fix and
2579 to make glr.c easier to evolve in general, don't maintain yytoken in
2580 parallel with yychar; just compute yytoken when needed.
2581 * tests/glr-regression.at (Incorrect lookahead during deterministic
2582 GLR): Check that setting yychar in a user action has the intended
2583 effect.
2584 * data/glr.c (yyGLRStack): Remove yytokenp member.
2585 (yyclearin): Don't set *yytokenp.
2586 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2587 yychar rather than *yytokenp to determine the current lookahead.
2588 Compute yytoken locally when needed.
2589 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2590 point to.
2591
2592 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2593 after `--report' documentation.
2594
e2a8c0f5
PE
25952006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2596
2597 * src/parse-gram.y (grammar_declaration): Location of printer
2598 symbol is @1, not list->location. Bug reported by twlevo.
2599 * tests/input.at (Incompatible Aliases): Adjust to above change.
2600
6b702268
PE
26012006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2602
27622431
PE
2603 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2604 all the test at once. This makes the output easier to read in the
2605 normal case.
2606
6b702268
PE
2607 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2608 got from <http://bro-ids.org/download.html>. The bug is that
2609 when two actions appeared in succession, the second one was
2610 scanned before the first one was added to the grammar rule
2611 as a midrule action. Bison then output the incorrect warning
2612 "parse.y:905.17-906.36: warning: unused value: $3".
2613 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2614 associated with a value.
2615 (rhs): Don't invoke grammar_current_rule_action_append.
2616 (action): Invoke it here instead.
2617 * src/reader.c (grammar_midrule_action): Now extern.
2618 (grammar_current_rule_action_append): Don't invoke
2619 grammar_midrule_action; that is now the scanner's job.
2620 * src/reader.h (last_string, last_braced_code_loc):
2621 (grammar_midrule_action): New decls.
2622 * src/scan-gram.l (last_string): Now extern, sigh.
2623 (last_braced_code_loc): New extern variable.
2624 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2625 rule already has an action.
2626 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2627 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2628 Add some tests to check that the above changes fixed the bug.
2629
d40ba6c2
PE
26302006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2631
2632 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2633 All used changed. Check whether the symbol has a destructor,
2634 not whether it is typed.
2635 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2636 that the values are still reported as unused. All line numbers
2637 adjusted.
2638
401aace6
PE
26392006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2640
2641 Work around a bug in bro 0.8, which underparenthesizes its
2642 definition of YYLLOC_DEFAULT.
2643 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2644 their arguments.
2645 * data/lalr1.cc: Likewise.
2646 * data/yacc.cc: Likewise.
2647
06f01bc4
PE
26482006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2649
401aace6
PE
2650 Work around a bug in Pike 7.0, and give the Pike folks a
2651 better way to override the usual int widths.
2652 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2653 user can override the types.
2654 (short): #undef, to work around a bug in Pike 7.0.
2655 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2656 (union yyalloc.yyss): Use yytype_int16 rather than short.
2657 All uses changed.
2658 (yysigned_char): Remove.
2659 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2660 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2661 * tests/regression.at (Web2c Actions): Adjust to above changes.
2662
2663 * src/reader.c (check_and_convert_grammar): New function.
2664 (reader): Close the input file even if something went wrong during
2665 parsing. Minor file descriptor leak reported by twlevo.
2666
06f01bc4
PE
2667 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2668 to pacify gcc -Wswitch-default.
2669 * src/scan-gram.l (adjust_location): Use a default: break; case
2670 to pacify gcc -Wswitch-default.
2671 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2672 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2673 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2674 Move these decls to scan-skel.l, since they don't need to be
2675 visible elsewhere.
2676 * src/scan-skel.l: Accept the above decls.
2677 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2678 is used.
2679
02650b7f
PE
26802006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2681
2682 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2683 since we don't want to insist on a version number at the start
2684 of the changelog every time.
2685 * Makefile.maint: Sync from coreutils a bit better.
2686 (sc_trailing_blank): Renamed from sc_trailing_space.
2687 All uses changed.
2688 (sc_no_if_have_config_h, sc_require_config_h):
2689 (sc_prohibit_assert_without_use): New rules.
2690 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2691 (sc_dd_max_sym_length): Fix leading spaces in rule.
2692 (sc_system_h_headers): Prefix with @.
2693 (sc_useless_cpp_parens, m4-check): Output line numbers.
2694 (changelog-check): Allow version only in head.
2695 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2696 satisfy new Makefile.maint rule.
2697 * data/glr.c: Likewise.
2698 * data/glr.cc: Likewise.
2699 * data/lalr1.cc: Likewise.
2700 * data/yacc.c: Likewise.
2701 * lib/ebitsetv.c: Likewise.
2702 * lib/lbitset.c: Likewise.
2703 * lib/subpipe.c: Likewise.
2704 * lib/timevar.c: Likewise.
2705 * src/system.h: Likewise.
2706 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2707 * djgpp/Makefile.maint: Add copyright notice.
2708 * djgpp/README.in: Likewise.
2709 * djgpp/config.bat: Likewise.
2710 * djgpp/config.site: Likewise.
2711 * djgpp/config_h.sed: Likewise.
2712 * djgpp/djunpack.bat: Likewise.
2713 * djgpp/config.sed: Fix copyright notice to match standard format.
2714 * djgpp/subpipe.h: Likewise.
2715 * lib/bitsetv-print.c: Likewise.
2716 * lib/bitsetv.c: Likewise.
2717 * lib/subpipe.h: Likewise.
2718 * lib/timevar.c: Likewise.
2719 * lib/timevar.h: Likewise.
2720 * djgpp/subpipe.c: Use standard recipe for config.h.
2721 * lib/abitset.c: Likewise.
2722 * lib/bitset.c: Likewise.
2723 * lib/bitset_stats.c: Likewise.
2724 * lib/bitsetv-print.c: Likewise.
2725 * lib/bitsetv.c: Likewise.
2726 * lib/ebitsetv.c: Likewise.
2727 * lib/get-errno.c: Likewise.
2728 * lib/lbitset.c: Likewise.
2729 * lib/subpipe.c: Likewise.
2730 * lib/timevar.c: Likewise.
2731 * lib/vbitset.c: Likewise.
2732 * tests/local.at: Likewise.
2733 * src/scan-gram.l: Don't include verify.h, since system.h does
2734 that for us.
2735 * .x-sc_require_config_h: New file.
2736 * .x-sc_unmarked_diagnostics: New file.
2737
287c78f6
PE
27382006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2739
287c78f6
PE
2740 Be a bit more systematic about using 'abort'.
2741 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
2742 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
2743 Put 'default: abort ();' before some other case, to satisfy older
2744 pedantic compilers.
2745 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2746 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
2747 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
2748 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
2749 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
2750 (get_decision_str, get_orientation_str, get_node_alignment_str):
2751 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
2752 (get_linestyle_str, get_arrowstyle_str): Likewise.
2753 * src/conflicts.c (resolve_sr_conflict):
2754 Use a default case rather than one for the one remaining enum
2755 value, to catch invalid enum values as well.
2756 * src/lalr.c (set_goto_map, map_goto):
2757 Prefer "assert (FOO);" to "if (!FOO) abort ();".
2758 * src/nullable.c (nullable_compute, token_definitions_output):
2759 Likewise.
2760 * src/reader.c (packgram, reader): Likewise.
2761 * src/state.c (transitions_to, state_new, state_reduction_find):
2762 Likewise.
2763 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
2764 (symbol_pack): Likewise.
2765 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
2766 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
2767 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
2768 * src/system.h: Don't include <assert.h>.
2769 (assert): New macro.
2770
2771 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
2772 (Destructor Decl, Parser Function, Pure Calling):
2773 Describe rules for braces inside C code more carefully.
287c78f6 2774
c66dfadd
PE
27752006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2776
c21493b8
PE
2777 Fix some porting glitches found by Nelson H. F. Beebe.
2778 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
2779 compilers that don't understand that abort () does not return.
2780 * src/state.c (transitions_to): Likewise.
2781 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2782 that '#include <cstdlib>' works.
2783 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
2784 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
2785 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
2786 for the benefit of some pre-C99 compilers.
2787
b6e3facf
PE
2788 * bootstrap: Undo changes to gnulib files that autoreconf made.
2789
c66dfadd
PE
2790 Minor fixups to get 'make maintainer-check' to work.
2791 * configure.ac: Don't use -Wnested-externs, as it's incompatible
2792 with the new verify.h implementation.
2793 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
2794 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
2795 * data/yacc.c (YYUSE): Likewise.
2796 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
2797 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
2798 * src/parse-gram.y (declaration): Don't pass a string constant
2799 to a function that expects char *, since GCC might complain
2800 about the constant value.
2801 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
2802 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
2803 before #defining them.
2804 * tests/glr-regression.at
2805 (Incorrectly initialized location for empty right-hand side in GLR):
2806 In yyerror, use the msg arg.
2807 (Corrupted semantic options if user action cuts parse):
2808 (Incorrect lookahead during deterministic GLR):
2809 (Incorrect lookahead during nondeterministic GLR):
2810 Don't name a local var 'index'; it shadows string.h's 'index'.
2811
ed94ef2a
AD
28122006-01-19 Akim Demaille <akim@epita.fr>
2813
2814 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2815 location, not just parts of it.
2816
e9ad4aec
PE
28172006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2818
d6ca7905
PE
2819 * NEWS: Document the fact that multiple %unions are now allowed.
2820 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
2821 * TODO: This feature is now implemented, so remove it from
2822 the wishlist.
d6ca7905 2823
ef1b70e0
PE
2824 * Makefile.maint: Merge with coreutils Makefile.maint.
2825 (CVS_LIST): Use build-aux version if available.
2826 (VERSION_REGEXP): New macro.
2827 (syntax-check-rules): Add sc_no_if_have_config_h,
2828 sc_prohibit_assert_without_use, sc_require_config_h,
2829 sc_useless_cpp_parens.
2830 (sc_obsolete_symbols): Check for O_NDELAY.
2831 (sc_dd_max_sym_length): Track coreutils.
2832 (sc_unmarked_diagnostics): Look in all files, not just *.c.
2833 (sc_useless_cpp_parens): New rule.
2834 (news-date-check): Look for version or today's date.
2835 (changelog-check): Don't require version number near head.
2836 (copyright-check): Use current year instead of hardwiring 2005.
2837 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
2838 (announcement): Add --gpg-key-ID.
2839
2840 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2841 with "file system".
2842
2073ce56 2843 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
2844 array. Problem reported by twlevo.
2845 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2846 * src/lalr.c (build_relations): Rely on new sentinel.
2847 * src/gram.c (gram_free): Adjust to new sentinel.
2848
b7691f15
JD
28492006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2850
2851 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2852 yylookaheadNeeds. All uses updated.
2853 (yysplitStack): Rename local yynewLookaheadStatuses to
2854 yynewLookaheadNeeds.
2855 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2856 GLR): In comments, change `lookahead status' to `lookahead need'.
2857
ddee1b06
PH
28582006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2859
2860 * data/glr.c (yysplitStack): A little stylistic rewrite.
2861
12f4614d
PH
28622006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2863
2864 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2865
32c29292
JD
28662006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2867
2868 * doc/bison.texinfo: Fix some typos.
2869 (GLR Semantic Actions): New subsection discussing special
2870 considerations because GLR semantic actions might be deferred.
2871 (Actions): Mention look-ahead usage of yylval.
2872 (Actions and Locations): Mention look-ahead usage of yylloc.
2873 (Special Features for Use in Actions): Add YYEOF entry and mention it
2874 in the yychar entry.
2875 In the yychar entry, remove mention of the local yychar case (pure
2876 parser) since this is irrelevant information when writing semantic
2877 actions and since it's already discussed in `Bison Symbols' where
2878 yychar is otherwise described as an external variable.
2879 In the yychar entry, don't call it the `current' look-ahead since it
2880 isn't when semantic actions are deferred.
2881 In the yychar and yyclearin entries, add note about deferred semantic
2882 actions.
2883 Add yylloc and yylval entries discussing look-ahead usage.
2884 (Look-Ahead Tokens): When discussing yychar, don't call it the
2885 `current' look-ahead, and do mention yylval and yylloc.
2886 (Error Recovery): Cross-reference `Action Features' when mentioning
2887 yyclearin.
2888 (Bison Symbols): In the yychar entry, don't call it the `current'
2889 look-ahead.
2890 In the yylloc and yylval entries, mention look-ahead usage.
2891
de366a2f 28922006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
2893
2894 * tests/glr-regression.at: Update copyright year to 2006.
2895
bf70fa87
JD
28962006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2897
2898 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2899 use during nondeterministic operation to track which stacks have
2900 actually needed the current lookahead.
2901 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2902 Allocate, deallocate, resize, and otherwise shuffle space for
2903 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2904 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2905 appropriately during nondeterministic operation.
2906 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2907 members to store the current lookahead to be used by the deferred
2908 user action.
2909 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2910 from which the RHS is taken. Set the lookahead members of the new
2911 yySemanticOption according to the lookahead status for stack yyk.
2912 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2913 yyaddDeferredAction.
2914 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2915 members of yySemanticOption before invoking yyuserAction, and then set
2916 them back to their current values afterward.
2917 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2918 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2919 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2920 titles for consistency.
2921 (Leaked merged semantic value if user action cuts parse): In order to
2922 suppress lint warnings, use arguments in merge function, and assign
2923 char value < 128 in main.
2924 (Incorrect lookahead during deterministic GLR): New test case.
2925 (Incorrect lookahead during nondeterministic GLR): New test case.
2926
05449a2c
JD
29272006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2928
de366a2f 2929 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
2930 !yyvaluep as signal that no semantic value is available to print.
2931 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2932 to print a semantic value.
2933
4158e0a1 29342006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 2935
4158e0a1
JD
2936 * tests/glr-regression.at: For consistency with my newer test cases,
2937 don't thank myself.
2938
d659304d
JD
29392006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2940
2941 * data/glr.c (yyresolveValue): When merging semantic options, if at
2942 least one user action succeeds but a later one cuts the parse, then
2943 destroy the semantic value before returning rather than leaking it.
2944 (yyresolveStates): If a user action cuts the parse and thus
2945 yyresolveValue fails, ignore the (unset) semantic value rather than
2946 corrupting the yyGLRState, and empty the semantic options list since
2947 the user actions should have called all necessary destructors.
2948 Simplify code with YYCHK.
2949 * tests/glr-regression.at (Corrupted semantic options if user action
2950 cuts parse): New test case.
2951 (Undesirable destructors if user action cuts parse): New test case.
2952 Before applying any of this patch, this test case never actually failed
2953 for me... but only because the corrupted semantic options usually
2954 masked this bug.
2955 (Leaked merged semantic value if user action cuts parse): New test
2956 case.
2957
6ec2c0f2
AD
29582006-01-05 Akim Demaille <akim@epita.fr>
2959
2960 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2961
1b9c21fb
PE
29622006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2963
2964 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2965 _MSC_VER. Problem reported by Cenzato Marco.
2966 (b4_c_function_def): Use it.
2967 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2968 b4_c_modern.
2969 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2970 than rolling our own.
2971
84866159
AD
29722006-01-04 Akim Demaille <akim@epita.fr>
2973
2974 Also warn about non-used mid-rule values.
2975 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2976 member.
2977 (symbol_list_new): Adjust.
2978 * src/reader.c (symbol_typed_p): New.
2979 (grammar_rule_check): Use it.
2980 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2981 Check its rule.
2982 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2983 Use it.
2984 * tests/actions.at (Exotic Dollars): Adjust.
2985
378f4bd8
AD
29862006-01-04 Akim Demaille <akim@epita.fr>
2987
2988 * src/reader.c (grammar_midrule_action): If $$ is set in a
2989 mid-rule, move the `used' bit to its lhs.
2990 * tests/input.at (Unused values): New.
2991 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2992
e2a21b6f
PE
29932006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2994
54662697
PE
2995 * doc/bison.texinfo (Bison Options): Say more accurately what
2996 --yacc does.
2997 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2998 about declarations in the grammar when in Yacc mode, as POSIX does
2999 not require a diagnostic when the grammar uses extensions.
3000
3001 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
3002
073f9288
PE
3003 Warn about dubious constructions like "%token T T".
3004 Reported by twlevo.
3005 * src/symtab.h (struct symbol.declared): New member.
3006 * src/symtab.c (symbol_new): Initialize it to false.
3007 (symbol_class_set): New arg DECLARING, specifying whether
3008 this is a declaration that we want to warn about, if there
3009 is more than one of them. All uses changed.
3010
1221b78a
PE
3011 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
3012 Allow multiple %union directives, whose contents concatenate.
3013 * src/parse-gram.y (grammar_declaration): Likewise.
3014 Use muscle_code_grow, so that we don't need stype_line any more.
3015 All uses changed.
3016
3017 * src/muscle_tab.c (muscle_grow): Fix comment.
3018
e2a21b6f
PE
3019 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
3020 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
3021 Update copyright year to 2006.
3022
8f7e3cf9
AD
30232006-01-03 Akim Demaille <akim@epita.fr>
3024
3025 Have glr.cc pass (some of) the calc.at tests.
3026 * data/glr.cc (b4_parse_param_orig): New.
3027 (b4_parse_param): Improve its definition, and bound it more
3028 clearly in the skeleton.
3029 (b4_epilogue): Append, instead of prepending, in order to keep
3030 #line consistency.
3031 Simplify the generation of auxiliary functions: locations and
3032 purity are mandated.
3033 (b4_global_tokens_and_yystype): Honor it.
3034 * data/location.cc (c++.m4): Don't include it.
3035 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
3036 and AT_SKEL_CC_IF.
3037 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
3038 AT_LALR1_CC_IF.
3039 Be sure to initialize the first position's filename.
3040 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
3041 mandated anyway.
3042 (AT_CHECK_CALC_GLR_CC): New.
3043 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
3044
3953ed88
AD
30452006-01-02 Akim Demaille <akim@epita.fr>
3046
3047 * src/output.c (output_skeleton): Don't hard wire the inclusion of
3048 c.m4.
0a96ba81 3049 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
3050 * data/glr.cc: Do not include stack.hh.
3051
9ecafbbf
AD
30522006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3053
3054 * data/glr.c: Reformat whitespace with tabs.
3055 (b4_lpure_formals): Remove this unused m4 macro.
3056 * tests/cxx-type.at: Reformat whitespace with tabs.
3057 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
3058 since it's a member. Rename type to isNterm for clarity.
3059
c4d497a0
AD
30602005-12-29 Akim <akim@sulaco.local>
3061
3062 Let glr.cc catch up with symbol_value_print.
3063 * data/glr.cc (b4_yysymprint_generate): Replace by...
3064 (b4_yy_symbol_print_generate): this.
3065 (yy_symbol_print, yy_symbol_value_print): Declare them.
3066
4517da37
PE
30672005-12-28 Paul Eggert <eggert@cs.ucla.edu>
3068
3069 * src/location.h (boundary): Note that a line or column equal
3070 to INT_MAX indicates an overflow.
3071 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
3072 (rule_length_overflow, increment_rule_length, add_column_width):
3073 New functions.
3074 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
3075 (<SC_BRACED_CODE>"}"):
3076 Use increment_rule_length rather than incrementing it by hand.
3077 (adjust_location, handle_syncline): Diagnose overflow.
3078 (handle_action_dollar, handle_action_at):
3079 Fix bug with monstrosities like $-2147483648.
3080 Remove now-unnecessary checks.
3081 (scan_integer): Verify assumptions and remove now-unnecessary checks.
3082 (convert_ucn_to_byte): Verify assumptions.
3083 (handle_syncline): New arg LOC. All callers changed.
3084 Don't store through a value derived from char const * pointer.
3085
3086 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
3087 GCC warnings.
3088
e3233bf6
PE
30892005-12-27 Paul Eggert <eggert@cs.ucla.edu>
3090
3091 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
3092 Remove unnecessary forward static decls.
3093
8f3596a6
AD
30942005-12-27 Akim Demaille <akim@epita.fr>
3095
3096 * src/reader.c (grammar_current_rule_check): Also check that $$
3097 is used.
3098 Take the rule to check as argument, hence rename as...
3099 (grammar_rule_check): this.
3100 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
3101 Rename as...
3102 (grammar_rule_begin, grammar_rule_end): these, for consistency.
3103 (grammar_midrule_action, grammar_symbol_append): Now static.
3104 * tests/torture.at (input): Don't rely on the default action
3105 being always performed.
3106 * tests/calc.at: "Set" $$ even when the action is "cut" with
3107 YYERROR or other.
3108 * tests/actions.at (Exotic Dollars): Instead of using unused
3109 values, check that the warning is issued.
3110
721be13c
PE
31112005-12-22 Paul Eggert <eggert@cs.ucla.edu>
3112
3113 * NEWS: Improve wording for unused-value warnings.
3114
a0af42fc
AD
31152005-12-22 Akim Demaille <akim@epita.fr>
3116
3117 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
3118 (b4_yysymprint_generate): Rename as...
3119 (b4_yy_symbol_print_generate): this.
3120 Generate yy_symbol_print instead of yysymprint.
3121 Generate also yy_symbol_value_print, and use it.
3122
affac613
AD
31232005-12-22 Akim Demaille <akim@epita.fr>
3124
721be13c 3125 * NEWS: Warn about unused values.
affac613
AD
3126 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
3127 a `used' member.
3128 (symbol_list_n_get, symbol_list_n_used_set): New.
3129 (symbol_list_n_type_name_get): Use symbol_list_n_get.
3130 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
3131 * src/reader.c (grammar_current_rule_check): Check that values are
3132 used.
3133 * src/symtab.c (symbol_print): Accept 0.
3134 * tests/existing.at: Remove the type information.
3135 Empty the actions.
3136 Remove useless actions (beware of mid-rule actions: perl -000
3137 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3138 * tests/actions.at (Exotic Dollars): Use unused values.
3139 * tests/calc.at: Likewise.
3140 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3141 Likewise.
3142
3143 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3144 rule_useful_p.
3145
9d9b8b70
PE
31462005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3147
8bb4c753
PE
3148 Undo 2005-12-01 tentative license wording change. The wording is
3149 still being reviewed by the lawyers, and we don't want to wait for
3150 them before publishing a test release. For now, revert to the
3151 previous wording.
3152 * NEWS: Undo 2005-12-01 change.
3153 * data/glr.c: Revert to previous license wording.
3154 * data/glr.cc: Likewise.
3155 * data/lalr1.cc: Likewise.
3156 * data/location.cc: Likewise.
3157 * data/yacc.c: Likewise.
3158
9d9b8b70
PE
3159 * NEWS: Reword %destructor vs YYABORT etc.
3160 * data/glr.c: Use American spacing, for consistency.
3161 * data/glr.cc: Likewise.
3162 * data/lalr1.cc: Likewise.
3163 * data/yacc.c: Likewise.
3164 * data/yacc.c: Reformat comments slightly.
3165 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3166 for consistency. Fix some spelling errors and reword recently-included
3167 text slightly.
3168 * tests/cxx-type.at: Cast results of malloc, for C++.
3169
2c3b392a
AD
31702005-12-21 Joel E. Denny <address@hidden>
3171
3172 * tests/cxx-type.at: Construct a tree, count the parents of shared
3173 nodes, and free each node once and only once. Previously, the memory
3174 for semantic values was leaked instead.
3175
d6cff4dc
AD
31762005-12-21 Joel E. Denny <address@hidden>
3177
3178 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3179 (yylval, yylloc): If pure, #define to yystackp->yyval and
3180 yystackp->yyloc similar to yychar and yynerrs.
3181 (yyparse): If pure, remove local yylval and yylloc. Add local
3182 yystackp to accommodate pure definitions of yylval and yylloc.
3183 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3184 yylvalp and yyllocp to &yylval and &yylloc.
3185 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3186 namespace. Previously, nerrs and char were missing, but lval and lloc
3187 weren't necessary.
3188 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3189 yylvalp and yyllocp parameters since, if pure, these are now always
3190 accessible through yystackp. If not pure, they are still accessible
3191 globally.
3192 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3193 `if (YYID (N))' to pacify lint.
3194
a85284cf
AD
31952005-12-21 Akim Demaille <akim@epita.fr>
3196
3197 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3198 destroy the RHS symbols of a rule.
3199 * data/yacc.c (yylen): Initialize to 0.
3200 Keep its value to the number of items to possibly shift.
3201 In particular, a regular successful parse that ends on YYFINAL by
3202 a (internal) YYACCEPT must not have yylen != 0.
3203 (yyerrorlab, yyreturn): Pop the RHS.
3204 Reorder a bit to emphasize the `shifting' bits of code.
3205 (YYPOPSTACK): Now accept a number of items to pop.
3206 * data/lalr1.cc: Likewise.
3207 * data/glr.c: Formatting changes.
3208 Use goto instead of fall through.
3209 * doc/bison.texinfo (Destructor Decl): Complete.
3210
d508c281
JMG
32112005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3212
3213 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3214 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3215 * djgpp/config.bat: Replace every occurence of the file name
3216 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3217 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3218 * djgpp/config.sed: Replace every occurence of the file name
3219 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3220 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3221 * djgpp/djunpack.bat: DJGPP specific file.
3222 * djgpp/fnchange.lst: DJGPP specific file.
3223 * djgpp/README.in: Add new information about how to unpack the bison
3224 source on MSDOS and other systems which have 8.3 file name restrictions
3225 using djunpack.bat and fnchange.lst.
3226
3e7a2cd9
PE
32272005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3228
3229 * bootstrap (build_cvs_prefix): Remove; unused.
3230 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3231 when getting gnulib.
3232
32332005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3234
3235 * data/glr.c: Reorder typedef declarations for structs to match order
3236 of struct declarations.
3237 Rename yystack everywhere to yystackp except in yyparse where it's not
3238 a pointer.
3239 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3240 consistency.
3241 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3242 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3243 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3244 lint.
3245
877519f8
PE
32462005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3247
0eca5a39
PE
3248 * tests/sets.at (Accept): Fix typos in regular expression used to
3249 sed out the final state number.
3250
2cec9080
PE
3251 Work around portability problem on Solaris 10: flex-generated
3252 files include <stdio.h> before <config.h>, which messes up
3253 because the latter defines __EXTENSIONS__. Address the problem
3254 by creating two new little files that include <config.h> first,
3255 then include the flex-generated files. Rewrite everyone else
3256 to include <config.h> first, as well.
3257 * lib/timevar.c: Always include "config.h".
3258 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3259 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3260 (EXTRA_bison_SOURCES): New macro.
3261 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3262 * src/system.h: Don't include config.h.
3263 * src/LR0.c: Include <config.h> first.
3264 * src/assoc.c: Likewise.
3265 * src/closure.c: Likewise.
3266 * src/complain.c: Likewise.
3267 * src/conflicts.c: Likewise.
3268 * src/derives.c: Likewise.
3269 * src/files.c: Likewise.
3270 * src/getargs.c: Likewise.
3271 * src/gram.c: Likewise.
3272 * src/lalr.c: Likewise.
3273 * src/location.c: Likewise.
3274 * src/main.c: Likewise.
3275 * src/muscle_tab.c: Likewise.
3276 * src/nullable.c: Likewise.
3277 * src/output.c: Likewise.
3278 * src/parse-gram.y: Likewise.
3279 * src/print.c: Likewise.
3280 * src/print_graph.c: Likewise.
3281 * src/reader.c: Likewise.
3282 * src/reduce.c: Likewise.
3283 * src/relation.c: Likewise.
3284 * src/state.c: Likewise.
3285 * src/symlist.c: Likewise.
3286 * src/symtab.c: Likewise.
3287 * src/tables.c: Likewise.
3288 * src/uniqstr.c: Likewise.
3289 * src/vcg.c: Likewise.
3290
877519f8
PE
3291 * src/parse-gram.y: Fix minor problems uncovered by lint.
3292 (current_lhs, current_lhs_location): Now static.
3293 (current_assoc): Remove unused variable.
3294
3295 Cleanups so that Bison-generated parsers have less lint.
3296 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3297 Prepend /*ARGSUSED*/, for lint's sake.
3298 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3299 definition if 'lint' is defined.
3300 (YYID): New macro (or function, if lint).
3301 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3302 * data/yacc.c: Likewise.
3303 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3304 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3305 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3306 is C++ only.
3307 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3308 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3309 Use YYID(0) rather than 0, for lint.
3310 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3311 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3312
f5228370
PE
33132005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3314
3315 * tests/glr-regression.at
3316 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3317 Close memory leak reported by twlevo.
3318
69ce078b
PE
33192005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3320
6ff99711
PE
3321 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3322 all stacks.
3323 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
3324 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3325 New test case.
3326 (Duplicated user destructor for lookahead): This test now is expected
3327 to succeed.
3328
af3412cd
PE
33292005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3330
32b5b719 3331 * NEWS: Document the following change.
af3412cd
PE
3332 * data/yacc.c: Say "parser skeleton" rather than "file", since
3333 it's no longer just a file.
3334 * data/glr.c: Grant a special exception for C GLR parsers, that
3335 reads like the already-existing exception for C LALR(1) parsers.
3336 * data/glr.cc: Likewise.
3337 * data/lalr1.cc: Likewise.
3338 * data/location.cc: Likewise.
3339 * data/yacc.c: Reword the "written by" statement to clarify that
3340 it was the parser skeleton, not the entire output file.
3341 * data/glr.c: Written by Paul Hilfinger.
3342 * data/glr.cc: Written by Akim Demaille.
3343 * data/lalr1.cc: Likewise.
3344
035aa4a0
PE
33452005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3346
d9963c85
PE
3347 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3348 Fix typos in previous change that broke 'make check'.
3349 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3350 supported in C.
3351 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3352 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3353 We can revert this once things settle down.
3354
035aa4a0
PE
3355 * src/conflicts.c (conflicts_print): Don't print file name twice
3356 when %expect fails because there were no conflicts.
3357 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3358 change.
3359 * tests/conflicts.at (%expect not enough, %expect too much):
3360 (%expect with reduce conflicts): Adjust to new behavior.
3361
33622005-11-18 Akim Demaille <akim@epita.fr>
3363
3364 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3365 errors.
3366 * NEWS: Document this.
3367 * doc/bison.texinfo (Expect Decl): Likewise.
3368
d1ff7a7c
AD
33692005-11-16 Akim Demaille <akim@epita.fr>
3370
3371 Generalize the display of semantic values and locations in traces.
3372 * data/glr.c (yy_reduce_print): Fix indices (again).
3373 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3374 literal integers.
3375 * data/lalr1.cc (yyreduce_print): Rename as...
3376 (yy_reduce_print): this.
3377 Display values and locations.
3378 * data/yacc.c (yy_reduce_print): Likewise.
3379 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3380 (yysymprint): Move higher to be visible from yy_reduce_print).
3381 (yyparse): Adjust.
3382 * tests/calc.at: Adjust the expected length of the traces.
3383
6de5398d
AD
33842005-11-14 Akim Demaille <akim@epita.fr>
3385
3386 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3387 from 1 to N, while values and location start at 0.
3388 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3389
a1373f55
AD
33902005-11-14 Akim Demaille <akim@epita.fr>
3391
3392 * data/glr.c (yy_reduce_print): Fix the $ number.
3393
613d8952
AD
33942005-11-14 Akim Demaille <akim@epita.fr>
3395
3396 "Use" parse parameters.
3397 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3398 * data/glr.c, data/glr.cc: Use them.
3399 * data/glr.c (YYUSE): Have a C++ definition that supports
3400 non-pointer types.
3401
b2741627
AD
34022005-11-14 Akim Demaille <akim@epita.fr>
3403
3404 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3405
5059b5c8
AD
34062005-11-14 Akim Demaille <akim@epita.fr>
3407
42249483
AD
3408 * data/glr.cc: New.
3409 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 3410
4626a15d
AD
34112005-11-12 Akim Demaille <akim@epita.fr>
3412
3413 Let position and location be PODs.
3414 * data/location.cc (position::initialize, location::initialize): New.
3415 (position::position, location::location): Define only if
3416 b4_location_constructors is defined.
3417 * data/lalr1.cc (b4_location_constructors): Define it for backward
3418 compatibility.
3419 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3420
34212005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
3422
3423 * data/lalr1.cc: Move the body of the ctor and dtor into the
3424 parser file (instead of the header).
3425 Wrap the implementations in a "namespace yy".
3426
34272005-11-12 Akim Demaille <akim@epita.fr>
3428
3429 Have glr.c include its header file when created.
3430 * data/glr.c (b4_shared_declarations): New.
3431 Output them verbatim in the parser if !%defines, otherwise
3432 output then in the header file, and include it instead.
3433
1989d947
AD
34342005-11-11 Akim Demaille <akim@epita.fr>
3435
3436 * data/glr.c: Comment changes.
3437
34382005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
3439
3440 When yydebug, report semantic and location values for reductions.
3441 * data/glr.c (yy_reduce_print): Report the semantic values and the
3442 locations.
3443 (YY_REDUCE_PRINT): Adjust.
3444 (yyglrReduce): Use them.
3445 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3446 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3447 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3448 traces.
3449
02998094
AD
34502005-11-10 Akim Demaille <akim@epita.fr>
3451
3452 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3453 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3454 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3455
5210672f
PE
34562005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3457
3458 * m4/cxx.m4, examples/Makefile.am: Don't build
3459 examples/calc++ if no C++ compiler is available. (trivial change)
3460
a8991a1d
AD
34612005-11-09 Akim Demaille <akim@epita.fr>
3462
3463 * src/scan-skel.l: Use a couple of asserts.
3464
36b5e963
AD
34652005-11-03 Akim Demaille <akim@epita.fr>
3466
3467 In some (weird) cases, the final state number is incorrect.
3468 Reported by Alexandre Duret-Lutz.
3469 * src/LR0.c (state_list_append): Remove the computation of
3470 final_state.
3471 (save_reductions): Do it here.
3472 (get_state): Alpha conversion.
3473 (generate_states): Use a for loop.
3474 * src/gram.h (item_number_is_rule_number)
3475 (item_number_is_symbol_number): New.
3476 * src/state.c: Use assert.
3477 * src/system.h: Include assert.h.
3478 * tests/sets.at (Accept): New.
3479
44e7ead1
PH
34802005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3481
3482 * data/glr.c (yyfill): Adjust comment.
36b5e963 3483 (yyresolveAction): Initialize default location properly
44e7ead1
PH
3484 for empty right-hand sides.
3485 (yydoAction): Ditto.
3486 Add comment explaining apparently dead code.
36b5e963
AD
3487 * tests/glr-regression.at
3488 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 3489 New test.
36b5e963 3490
e10a80ee
PE
34912005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3492
3493 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3494 gnulib when interrupted. This fixes some race conditions and
3495 works around some portability problems (one noted by Paul
3496 Hilfinger).
3497
067b32ee
AD
34982005-10-22 Akim <akim@epita.fr>
3499
3500 * Makefile.cfg: Adjust to config -> build-aux.
3501 Reported by twledo.
3502
4b367315
AD
35032005-10-21 Akim Demaille <akim@epita.fr>
3504
3505 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3506 the %parse-params.
3507 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3508 * data/yacc.c (b4_Pure_if): Rename as...
3509 (b4_yacc_pure_if): this.
3510 (YY_SYMBOL_PRINT, yyparse): Adjust.
3511 * doc/bison.texinfo: Formatting changes.
3512
24cc23d9
AD
35132005-10-21 Akim Demaille <akim@epita.fr>
3514
3515 Finish the transition config -> build-aux.
3516 * configure.ac, Makefile.am: Use build-aux.
3517 * config/prev-version, config/announce-gen, config/Makefile.am:
3518 Move to...
3519 * build-aux/prev-version, build-aux/announce-gen,
3520 * build-aux/Makefile.am: here.
3521
d4476375
AD
35222005-10-14 Akim Demaille <akim@epita.fr>
3523
3524 * examples/calc++/test: Use set -x only when VERBOSE.
3525
302c0aee
PE
35262005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3527
3528 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3529 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3530
7625ec2c
AD
35312005-10-13 Akim Demaille <akim@epita.fr>
3532
3533 * src/scan-skel.l: Output the base name parts of the parser and
3534 header file names.
302c0aee 3535 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
3536 additional checks.
3537 Use this to exercise C++ outputs in subdirs.
3538 Reported by Oleg Smolsky.
3539
ba0fe3c7
PE
35402005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3541
3542 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3543 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3544 Problem reported by John P. Hartmann.
3545 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3546 already defined it.
3547
9b8a5ce0
AD
35482005-10-12 Akim Demaille <akim@epita.fr>
3549
3550 * src/parse-gram.y (version_check): Exit 63 to please missing
3551 (stands for "version mismatch).
3552 * tests/input.at, doc/bison.texinfo: Adjust.
3553
4f6e011e
PE
35542005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3555
3556 Work around portability problems with Visual Age C compiler
3557 (xlc and xlC_r) reported by John P. Hartmann.
3558 * data/location.cc (initial_column, initial_line): Remove.
3559 All uses replaced by 0 and 1.
3560 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3561 that xlc complains about.
3562 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 3563 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 3564 as __STDC__.
4d7aa45e
PE
3565 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3566 __STDC_VERSION__. Use it everywhere instead of looking at
3567 __STDC__ and __cplusplus.
4f6e011e 3568
a1b3bf8c
AD
35692005-10-10 Akim Demaille <akim@epita.fr>
3570
3571 * examples/calc++/test: Be quiet unless VERBOSE.
3572
412e44aa
PE
35732005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3574
2a4647a3
PE
3575 * data/c.m4 (yydestruct, yysymprint):
3576 Use YYUSE instead of casting to void.
3577 * data/glr.c (YYUSE): New macro.
3578 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3579 Use it instead of rolling our own.
3580 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3581 (YYCHK1):
3582 Use /*CONSTCOND*/ to suppress lint warnings.
3583 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3584 (YY_STACK_PRINT): Use 'false' not '0'.
3585 (YYUSE): New macro.
3586 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3587 * data/yacc.c (YYUSE): New macro.
3588 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3589 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3590 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3591
3592
412e44aa
PE
3593 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3594 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3595
88c6637f
PE
35962005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3597
2f4f028d
PE
3598 Undo the parts of the unlocked-I/O change that substituted
3599 putc or puts for printf. This might hurt performance a bit,
3600 but some people prefer the printf style.
3601 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3602 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3603 All uses replaced by YYFPRINTF and YYDPRINTF.
3604 * data/yacc.c: Likewise.
3605 * lib/bitset.c (bitset_print): Likewise.
3606 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3607 putc and puts.
3608 * lib/lbitset.c (debug_lbitset): Likewise.
3609 * src/closure.c (print_firsts, print_fderives): Likewise.
3610 * src/gram.c (grammar_dump): Likewise.
3611 * src/lalr.c (look_ahead_tokens_print): Likewise.
3612 * src/output.c (escaped_output): Likewise.
3613 (user_actions_output): Break apart two printfs.
3614 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3615 * src/reduce.c (reduce_print): Likewise.
3616 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3617 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3618
88c6637f
PE
3619 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3620 Use assignments rather than casts-to-void to suppress
3621 unused-variable warnings. This pacifies 'lint'.
3622 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3623 unused-variable warnings.
3624
fb32e373
JMG
36252005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3626
3627 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3628
edb8f44f
PE
36292005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3630
fb9c0b33
PE
3631 Use unlocked I/O for a minor performance improvement on hosts like
3632 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3633 is to use the gnlib unlocked-io module, and to prefer putc and
3634 puts to printf when either will work (since the latter doesn't
3635 come in an unlocked flavor).
3636 * bootstrap (gnulib_modules): Add unlocked-io.
3637 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3638 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3639 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3640 and similarly for puts and putc and printf.
3641 * data/yacc.c: Likewise.
3642 * lib/bitset.c (bitset_print): Likewise.
3643 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3644 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3645 to printf.
3646 * lib/lbitset.c (debug_lbitset): Likewise.
3647 * src/closure.c (print_firsts, print_fderives): Likewise.
3648 * src/gram.c (grammar_dump): Likewise.
3649 * src/lalr.c (look_ahead_tokens_print): Likewise.
3650 * src/output.c (escaped_output): Likewise.
3651 (user_actions_output): Coalesce two printfs.
2f4f028d 3652 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
3653 * src/reduce.c (reduce_print): Likewise.
3654 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 3655 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 3656
edb8f44f
PE
3657 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3658 this confuses xgettext.
3659
b50d2359
AD
36602005-10-02 Akim Demaille <akim@epita.fr>
3661
3662 * bootstrap (gnulib_modules): Add strverscmp.
3663 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3664 * m4/.cvsignore: Add strverscmp.m4.
3665 * src/parse-gram.y (%require): New token, new rule.
3666 (version_check): New.
3667 * src/scan-gram.l (%require): Adjust.
3668 * tests/input.at (AT_REQUIRE): New.
3669 Use it.
3670 * doc/bison.texinfo (Require Decl): New.
3671 (Calc++ Parser): Use %require.
3672
21667f64
AD
36732005-10-02 Akim Demaille <akim@epita.fr>
3674
3675 * data/location.cc: New.
3676
2b81e969
AD
36772005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3678 Akim Demaille <akim@epita.fr>
3679
3680 Make sure -odir/foo.cc creates dir/location.hh etc.
3681 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3682 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3683 (spec_defines_file): Now const.
3684 (dir_prefix): New.
3685 (short_base_name): Remove.
3686 * src/files.c: Adjust.
3687 (dirname.h): Include.
3688 (base_name): Don't prototype it.
3689 (finput): Remove, duplicates gram_in.
3690 (full_base_name, short_base_name): Replace by...
3691 (all_but_ext, all_but_tab_ext): these.
3692 (compute_base_names): Rename as...
3693 (compute_file_name_parts): this.
3694 Update to compute the new variables, including dir_prefix.
3695 Adjust dependencies.
3696 * src/output.c (prepare): Output them.
3697 * src/reader.c: Adjust to use gram_in, not finput.
3698 * src/scan-skel.l (@dir_prefix@): New.
3699
ad6a9b97
JMG
37002005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3701
3702 * lib/subpipe.c: New function end_of_output_subpipe() added
3703 to allow support for non-posix systems. This is a no-op function
3704 for posix systems.
3705
3706 * lib/subpipe.h: New function end_of_output_subpipe() added
3707 to allow support for non-posix systems. This is a no-op function
3708 for posix systems.
3709
3710 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3711 handle the lack of pipe/fork functionality on non-posix systems.
3712
3713 * djgpp/Makefile.maint: DJGPP specific file.
3714
3715 * djgpp/README.in: DJGPP specific file.
3716
3717 * djgpp/config.bat: DJGPP specific configuration file.
3718
3719 * djgpp/config.sed: DJGPP specific configuration file.
3720
3721 * djgpp/config.site: DJGPP specific configuration file.
3722
3723 * djgpp/config_h.sed: DJGPP specific configuration file.
3724
3725 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3726
3727 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3728
fc695704
AD
37292005-10-02 Akim Demaille <akim@epita.fr>
3730
3731 * data/location.cc: New, extract from...
3732 * data/lalr1.cc: here.
3733 (location.hh): Include it after the user prologue, in case the
3734 filename type is defined by the user.
3735 Forward declation location and position before the pre-prologue.
3736 (yyresult_): Rename as...
3737 (yyresult): this, it's a local variable, not an attribute.
3738 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
3739
37402005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
3741
3742 * examples/extexi: Restore the #line generation.
3743
fb9712a9
AD
37442005-09-30 Akim Demaille <akim@epita.fr>,
3745 Alexandre Duret-Lutz <adl@gnu.org>
3746
3747 Move the token type and YYSTYPE in the parser class.
3748 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
3749 (parser::token): New, from the moved free definition of tokens.
3750 (parser::semantic_value): Now a full definition instead of an
3751 indirection to YYSTYPE.
3752 (b4_post_prologue): No longer included in the header file, but
3753 in the implementation file.
3754 * doc/bison.texi (C+ Language Interface): Update.
3755 * src/parse-gram.y: Support unary %define.
3756 * tests/actions.at: Define global_tokens_and_yystype for backward
3757 compatibility until we update the tests.
3758 * tests/calc.at: Idem.
3759 (first_line, first_column, last_line, last_column): Define for lalr1.cc
3760 to simplify the code.
3761
55f0c7b1
PE
37622005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3763
3764 Port to SunOS 4.1.4, which lacks strtoul and strerror.
3765 Ah, the good old days! Problem reported by Peter Klein.
3766 * bootstrap (gnulib_modules): Add strerror, strtoul.
3767 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
3768 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
3769
fb9712a9 37702005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
3771
3772 * data/c.m4 (b4_error_verbose_if): New.
3773 * data/lalr1.cc: Use it.
3774 (YYERROR_VERBOSE_IF): Remove.
3775 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
3776 parser members, replaced by...
3777 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
3778 local variables.
3779 (yysyntax_error_): Takes the state number as argument.
3780 (yyreduce_print_): Use the argument yyrule, not the former
3781 attribute yyn_.
3782
8a6f72f3
PE
37832005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3784
3785 * bootstrap (gnulib_modules): Add verify.
3786 * lib/.cvsignore: Add verify.h.
3787 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
3788 * src/system.h (verify): Remove.
3789 Include verify.h instead.
3790 * src/tables.c (tables_generate): Use new API for 'verify'.
3791
0d50976f
PE
37922005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3793
ebc3737e
PE
3794 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
3795 local variables whose names begin with 'yy'.
3796 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
3797 Trivial changes from Joel E. Denny.
3798
0d50976f
PE
3799 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3800 it itself.
3801 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3802 don't use alloca any more.
3803
3804 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
3805 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 3806 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
3807 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
3808 to match yacc.c, to test more hosts.
3809
a05b79df
PE
38102005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3811
55289366
PE
3812 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
3813 doesn't affect behavior.
3814 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
3815 Solaris, AIX, MSC.
3816 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
3817 This works a bit better with glibc, if user code has already included
3818 stdlib.h.
3819 * doc/bison.texinfo (Bison Parser): Document that users can't
3820 arbitrarily use malloc and free for other purposes. Document
3821 that <alloca.h> and <malloc.h> might be included.
3822 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
3823 user must declare alloca.
3824
a05b79df
PE
3825 * HACKING (release): Forwarn the Translation Project about
3826 stable releses.
3827
3ab2ca22
AD
38282005-09-20 Akim Demaille <akim@epita.fr>
3829
3830 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3831
a9739e7c
PE
38322005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3833
a702593e
PE
3834 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
3835 (YYSTACK_ALLOC_MAXIMUM): Use it.
3836 (yysyntax_error): New function.
3837 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
3838 multiple syntax errors are reported, and alloca is being used.
3839 Instead, reallocate buffers twice as big each time, so that
3840 we waste at most half the allocated memory. Start with a small
3841 (128-byte) buffer that will suffice in most cases anyway.
3842 Use yysyntax_error to do most of the work.
3843
3844 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3845 yynerrs is the number of errors reported, not the number of
3846 errors encountered.
3847
a9739e7c
PE
3848 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3849 Mark it as expected to fail.
3850 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3851 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3852 Don't start user-code symbols with "yy", to avoid name space problems.
3853
f479c6c6
AD
38542005-09-19 Akim Demaille <akim@epita.fr>
3855
3856 Remove the traits, failed experiment.
3857 It never proved useful, and anyway because of the current
3858 definition, it was not possible to have several specialization of
3859 this traits, making it useless.
3860 * data/lalr1.cc (yy:traits): Remove.
3861 Inline its definitions in the parser class.
3862
e2586f82
AD
38632005-09-19 Akim Demaille <akim@epita.fr>
3864
3865 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3866 least Mac OSX with a /usr/local install of gettext.
3867
2e8cf949
AD
38682005-09-19 Akim Demaille <akim@epita.fr>
3869
3870 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3871 and yytoken for similarity with the other skeletons.
3872
c7fb0b90
AD
38732005-09-19 Akim Demaille <akim@epita.fr>
3874
4e26c69e 3875 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 3876
1bd0deda
PE
38772005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3878
3879 * NEWS: Version 2.1.
3880
3881 * NEWS: Remove notice of yytname change, since it was never in an
3882 official release.
3883 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3884 diagnostic.
3885 * src/output.c (prepare): Likewise.
3886 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3887 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3888 is not defined. This is an awful hack, but it's enough for now.
3889 All callers changed.
3890 * tests/glr-regression-at (make_value): Args are const pointers now,
3891 to avoid GCC warning.
3892 (Duplicated user destructor for lookahead): New test. Currently
3893 skipped. It fails on my host but I'm not sure it'll always fail.
3894
38952005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
3896
3897 * src/symtab.h (struct symbol): Declare the printer and destructor
3898 as const, to avoid accidental calls to free.
3899 (symbol_destructor_set, symbol_printer_set): Adjust.
3900 * src/symtab.c: Adjust.
3901
1bd0deda 39022005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
3903
3904 * data/c.m4 (b4_token_enums): New.
3905 (b4_token_defines): Rename as...
3906 (b4_token_enums_defines): this.
3907 (b4_token_defines): New, output only the #defines.
3908 * data/yacc.c, data/glr.c: Adjust.
3909 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3910 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3911 as default values.
3912
dbcdae2d
AD
39132005-09-16 Akim Demaille <akim@epita.fr>
3914
3915 * data/lalr1.cc (yylex_): Remove, inline its code.
3916 (yyreport_syntax_error_): Remove, replaced by...
3917 (yysyntax_error_): this which returns a string and leaves to the
3918 caller the call to the users' error function.
3919 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3920 Move from members of the parser object...
3921 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3922 to local variables of the parse function.
3923
70d8f291
AD
39242005-09-16 Akim Demaille <akim@epita.fr>
3925
3926 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3927 since it's in Bison's name space.
3928
b47dbebe
PE
39292005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3930
ae199bf1
PE
3931 * data/glr.c (yyresolveValue): Add default case to pacify
3932 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3933
b47dbebe
PE
3934 * NEWS: Document when yyparse started to return 2.
3935 * doc/bison.texinfo (Parser Function): Document when yyparse
3936 returns 2.
3937
3938 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3939 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3940 changed.
3941 (class position): file_name -> filename (reverting). All uses changed.
3942
39432005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3944
3945 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3946 do anything if $@ exists. This reverts part of the 2005-07-07
3947 patch.
3948
00292f66
PE
39492005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3950
3951 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3952 contains obsolete information and isn't worth distributing as a
3953 separate file anyway.
3954 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3955 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3956 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3957 (yyparse): Abort if user code uses longjmp to throw an unexpected
3958 value.
3959
a420f962
PE
39602005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3961
00292f66
PE
3962 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3963 Suggested by twlevo@xs4all.nl.
3964
127287e9
PE
3965 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3966 This avoids a diagnostic from gcc -Wswitch-enum.
3967 Problem reported by twlevo@xs4all.nl.
3968
a420f962
PE
3969 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3970 standards. Use "file name" or "file" or "name", depending on
3971 the context.
3972 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3973 not to hack/foo.tab.c.
3974 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
3975 * data/glr.c: b4_filename -> b4_file_name.
3976 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3977 All uses changed.
3978 (class position): filename -> file_name. All uses changed.
3979 * data/yacc.c: b4_filename -> b4_file_name.
3980 * lib/bitset.h: filename -> file_name in local vars.
3981 * lib/bitset_stats.c: Likewise.
3982 * src/files.c: Likewise.
3983 * src/scan-skel.l ("@output ".*\n): Likewise.
3984 * src/files.c (file_name_split): Renamed from filename_split.
3985 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
3986
39872005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3988
3989 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3990 to accommodate latest gnulib.
3991
3992 * tests/glr-regression.at (Duplicate representation of merged trees):
3993 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3994
3995 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3996 needed.
3997
42a6501d
PE
39982005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3999
4000 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
4001 All uses changed. Invoke user destructor after an error during a
4002 split parse (trivial change from Joel E. Denny).
4003
4004 * tests/glr-regression.at
4005 (User destructor after an error during a split parse): New test case.
4006 Problem reported by Joel E. Denny in:
4007 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
4008
ef9a1faf
PE
40092005-08-25 Paul Eggert <eggert@cs.ucla.edu>
4010
5b4aaf78
PE
4011 * README-cvs: Give URLs for recommended tools.
4012 Mention Gzip version problem, and bootstrapping issues.
4013 Remove troubleshooting section, as it's somewhat obsolete.
4014
b5240ba5
PE
4015 * bootstrap (no_cache): New var, to accommodate different wget
4016 variants. Use it instead of '-C off'. Problem reported by
4017 twlevo@xs4all.nl.
4018
ef9a1faf
PE
4019 * data/glr.c (yydestroyStackItem): New function.
4020 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
4021 debugging information. Problem reported by Joel E. Denny.
4022
e6efa9da
AD
40232005-08-25 Akim Demaille <akim@epita.fr>
4024
4025 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
4026
adc90f13
PE
40272005-08-24 Paul Eggert <eggert@cs.ucla.edu>
4028
4029 * data/glr.c (yyrecoverSyntaxError, yyreturn):
4030 Don't invoke destructor on unresolved entries.
4031 * tests/glr-regression.at
4032 (User destructor for unresolved GLR semantic value): New test case.
4033 Problem reported by Joel E. Denny in:
4034 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
4035
f9315de5
PE
40362005-08-21 Paul Eggert <eggert@cs.ucla.edu>
4037
15d29c1f
PE
4038 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
4039 Add strnlen.c.
4040 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
4041 lib-prefix.m4, po.m4.
4042
dd5f2af2
PE
4043 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
4044 in yydestruct diagnostic, since it might not be an error.
4045 Problem reported by Joel Denny near end of
4046 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 4047 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
4048 * data/yacc.c (yyreturn): Likewise.
4049 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
4050
4051 * src/files.c: Remove obsolete FIXME comment.
4052
4053 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
4054 with the other templates, and to fix bogus run-on messages such
4055 as the one reported at the end of
4056 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4057 All callers changed to avoid the newline.
4058 (yyprocessOneStack): Output two lines rather than one, to accommodate
4059 the above change. This changes the debug output format slightly.
4060
f9315de5
PE
4061 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
4062 reported by Joel E. Denny in
4063 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
4064 (trivial change).
4065 * tests/glr-regression.at (Duplicate representation of merged trees):
4066 New test, from Joel E. Denny in:
4067 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
4068 * THANKS: Add Joel E. Denny.
4069
4070 * configure.ac (AC_INIT): Bump to 2.0c.
4071
04098407
PE
40722005-07-24 Paul Eggert <eggert@cs.ucla.edu>
4073
4074 * NEWS: Version 2.0b.
4075
ca5d2013
PE
4076 * Makefile.am (SUBDIRS): Put examples before tests, so that
4077 "make check" doesn't finish with "All 1 tests passed".
4078
3d54b576
PE
4079 * tests/regression.at (Token definitions): Don't rely on
4080 AT_PARSER_CHECK for data that contains backslashes. It currently
4081 uses 'echo', and 'echo' isn't portable if its argument contains
4082 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
4083 that the byte '\0xff' is not printable in the C locale; it is,
4084 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
4085 not printable, so use '\0x81' to test.
4086
d53ae497
PE
4087 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
4088 version of GCC, since the macro is used with non-GCC compilers.
4089
fc01665e
PE
4090 Fix core dump reported by Pablo De Napoli in
4091 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
4092 * tests/regression.at (Invalid inputs with {}): New test.
4093 * src/parse-gram.y (token_name): Translate type before using
4094 it as an index.
4095
04098407
PE
4096 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
4097 the user's name space. All uses changed to __attribute__
4098 ((__unused__)).
4099 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
4100 Add __attribute__ ((__noreturn__)).
4101
4102 * etc/clcommit: Remove. We weren't using it, and it failed
4103 "make maintainer-distcheck".
4104 * Makefile.maint: Merge from coreutils.
4105 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
4106 (syntax-check-rules): Change list of rules as described below.
4107 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
4108 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
4109 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
4110 (sc_trailing_space): New rules.
4111 (sc_xalloc_h_in_src): Remove.
4112 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
4113 (sc_space_tab, sc_error_exit_success, sc_changelog):
4114 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
4115 (makefile-check, po-check, author_mark_check):
4116 (makefile_path_separator_check, copyright-check):
4117 Use grep -n, to make it easier to find violations.
4118 Use CVS_LIST and CVS_LIST_EXCEPT.
4119 (header_regexp, h_re): Remove.
4120 (dd_c): New macro.
4121 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
4122 (my-distcheck): Use more-modern GCC flags.
4123 (signatures, %.asc): Remove.
4124 (rel-files, announcement): Remove signatures.
4125 Restore old updating code, even though we don't use it, so
4126 that we're the same as coreutils.
4127 (alpha, beta, major): Depend on news-date-check.
4128 Make the upload commands.
4129
4130 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
4131 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
4132 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
4133 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
4134 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
4135 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4136 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4137 * tests/sets.at: Likewise.
4138
4139 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4140 we comment out the Autoconf version number.
4141 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4142 it's error-prone and "make maintainer-distcheck" rejects it.
4143
4144 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4145 Indent calls to "error" to pacify "make maintainer-distcheck",
4146 when the calls are not intended to be translated.
4147 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4148
4149 * src/Makefile.am (DEFS): Use +=, to pacify
4150 "make maintainer-distcheck".
4151 (bison_SOURCES): Add scan-skel.h.
4152 (sc_tight_scope): New rule, from coreutils.
4153
4154 * src/files.c (src_extension, header_extension):
4155 Now static, not extern.
4156 * src/getargs.c (short_options): Likewise.
4157 * src/muscle_tab.c (muscle_table): Likewise.
4158 * src/parse-gram.y (current_class, current_type, current_prec):
4159 Likewise.
4160 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4161 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4162 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4163 void, to avoid warning when NLS is disabled.
4164 * src/output.c: Include scan-skel.h.
4165 (scan_skel): Remove decl, since scan-skel.h does this.
4166 (output_skeleton):
4167 Indent calls to "error" to pacify "make maintainer-distcheck".
4168 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4169 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4170 "make maintainer-distcheck".
4171 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4172 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4173 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4174 (skel_lex_destroy, scan_skel): Move these decls to...
4175 * src/scan-skel.h: New file.
4176 * src/uniqstr.c (uniqstr_assert):
4177 Indent calls to "error" to pacify "make maintainer-distcheck".
4178
4179 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4180 not @VAR@.
4181
4182 * tests/torture.at: Revamp to avoid misuse of atoi that
4183 "make maintainer-distcheck" complained about.
4184
4185 * examples/extexi (message): Don't print a message more than once,
4186 and omit line-number decoration that makes Emacs compile think
4187 that informative messages are worth worrying about.
4188
41892005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4190
4191 * configure.ac: Update version number.
4192
4193 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4194 accidentally.
4195 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4196 autogenerated by the maintainer.
4197 * examples/calc++/.cvsignore: Add *.yy.
4198
4199 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4200 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4201 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4202
4203 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4204
4205 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4206 from maintainer-distcheck about casting the argument of 'free'.
4207
4208 * NEWS: Mention recent yytname changes.
4209 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4210
4211 * bootstrap: For translations that have not yet been upgraded to
4212 the new runtime-po domain, prime the pump by extracting the
4213 relevant strings from the obsolete translations. This code can be
4214 removed once the bison-runtime domain has been translated by each
4215 team.
4216
4217 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4218 now that token names are already quoted.
4219
4220 Fix problem reported by Anthony Heading.
4221 * data/glr.c (YYTOKEN_TABLE): New macro.
4222 (yytname): Define if YYTOKEN_TABLE.
4223 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4224 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4225 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4226 * src/output.c (prepare_symbols): Output token_table_flag.
4227
0ffda363
PE
42282005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4229
4230 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4231 again if the first call fails.
4232
4233 * data/glr.c (yytnamerr): New function.
4234 (yyreportSyntaxError): Use it to dequote most string literals.
4235 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4236 with other skeletons. All uses changed.
4237 (yytnameerr_): New function.
4238 (yyreport_syntax_error): Use it to dequote most string literals.
4239 * data/yacc.c (yytnamerr): New function.
4240 (yyerrlab): Use it to decode most string literals.
4241 * doc/bison.texinfo (Decl Summary, Calling Convention):
4242 Clarify quoting convention of yytname.
4243 * src/output.c (prepare_symbols): Quote all names. This undoes
4244 the 2005-04-17 change, which is now accomplished (mostly) via
4245 changes in the parsers as described above.
4246 * tests/regression.at (Token definitions, Web2c Actions):
4247 Undo most 2005-04-17 change here, too.
4248
42492005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4250
4251 Fix more problems reported by twlevo@xs4all.nl.
4252 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4253 remove trailing spaces. This loses the exit status of ./types,
4254 and isn't needed since ./types shouldn't be emitting trailing
4255 spaces.
4256 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4257 as the stack isn't valid in that case.
4258
4259 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4260 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4261 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4262 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4263 is used.
4264 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4265 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4266 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4267 Likewise.
4268
4269 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4270 overly-picky compilers that reject 'char *foo = "bar";'.
4271
4272 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4273 to FILE * parameter, not to stderr. This fixes a typo introduced
4274 in the 2005-07-12 change.
4275
4276 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4277 warnings from GCC 4.
4278
4279 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4280 (yyglrShiftDefer, yysplitStack):
4281 Remove unused parameters b4_pure_formals. All uses changed.
4282 (yyglrShift): Remove unused parameters b4_user_formals.
4283 All uses changed.
4284 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4285
6100a9aa
PE
42862005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4287
258b75ca
PE
4288 Destructor cleanups and regularization among the three skeletons.
4289 * NEWS: Document the behavior changes.
4290 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4291 stack before failing, as the cleanup code will do it for us now.
4292 * data/lalr1.cc (yyerrlab): Likewise.
4293 * data/glr.c (yyparse): Pop everything off the stack before
4294 freeing it, so that destructors get called properly.
4295 * data/lalr1.cc (yyreturn): Likewise.
4296 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4297 This is more consistent.
4298 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4299 why destructors might be called. 1.875 -> 2.1.
4300 (Destructor Decl, Decl Summary, Table of Symbols):
4301 Some English-language cleanups for %destructor.
4302 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4303 Add output line for destructor of start symbol.
4304 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4305 because of that same extra output line.
4306
1a059451
PE
4307 * NEWS: Document minor wording changes in diagnostics of
4308 Bison-generated parsers.
4309 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4310 Remove unused formals. All uses changed.
4311 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4312 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4313 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4314 Rename yyoverflowab to yyexhaustedlab.
4315 When memory exhaustion occurs during syntax-error reporting,
4316 report it separately rather than in a single diagnostic; this
4317 eases translation.
4318 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4319 (Memory Exhausted): Renamed from Parser Stack Overflow.
4320 Revamp wording slightly to prefer "memory exhaustion".
4321 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4322
97460c78
PE
4323 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4324
30757c8c
PE
4325 Add i18n support to the GLR skeleton. Partially fix the C++
4326 skeleton; a C++ expert needs to finish this. Remove debugging
4327 msgids; there's little point to having them translated, since they
4328 can be understood only by someone who can read the
4329 (English-language) source code.
4330
4331 Generate runtime-po/bison-runtime.pot automatically, so that we
4332 don't have to worry about garbage getting in that file. We'll
4333 make sure after the next official release that old msgids don't
4334 get lost. See
4335 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4336
4337 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4338 Now auto-generated.
4339 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4340 Fix typos in explanations of the runtime file.
4341 * bootstrap: Change gettext keyword from YYI18N to YY_.
4342 Use standard Makefile.in.in in runtime-po, since we'll arrange
4343 for backward-compatible bison-runtime.po files in a different way.
4344 * data/glr.c (YY_): New macro, from yacc.c.
4345 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4346 Translate messages intended for users.
4347 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4348 the wording in the other skeletons. We don't know that the memory
4349 is virtual.
4350 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4351 Use same method that yacc.c uses.
4352 Don't translate debugging messages.
4353 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4354 it doesn't work (yet), and requires C++ expertise to fix.
4355 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4356 Move defn to a more logical place, to be consistent with other
4357 skeletons.
4358 Don't translate debugging messages.
4359 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4360 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4361 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4362 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4363
ac8c5689
PE
4364 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4365 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4366 void, not int.
4367 * tests/glr-regression.at (Badly Collapsed GLR States):
4368 Likewise.
4369 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4370 yylex should return 0 at EOF rather than aborting.
4371
6100a9aa
PE
4372 Improve tests for stack overflow in GLR parser.
4373 Problem reported by twlevo@xs4all.nl.
4374 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4375 All uses removed.
4376 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4377 can handle the problem.
4378 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4379 (yyparse): New local variable yyresult to record the result.
4380 Use result of setjmp to set it, rather than storing itinto
4381 struct.
4382 (yyDone): Remove label.
4383 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4384 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4385 if YYABORT is used).
4386 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4387 yyparse status; put status > 1 into diagnostic.
4388 Check that status==2 works.
4389 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4390 Use exit status 3 for failure to open (which shouldn't happen).
4391
15f40952
PE
43922005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4393
67fd79c4
PE
4394 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4395 1 on syntax error; just let yyparse do its thing.
4396 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4397 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4398 (Exploding the Stack Size with Alloca):
4399 (Exploding the Stack Size with Malloc):
4400 Expect exit status 2, not 1, since the parser is supposed to blow
4401 its stack. Problem reported by twlevo@xs4all.nl.
4402
15f40952
PE
4403 * data/glr.c (yyparse): Don't assume that the initial calls
4404 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4405 Print a stack-overflow message and fail instead.
4406 Initialize the line-number information before creating the stack,
4407 so that the stack-overflow message can report line zero safely.
4408
f32c66b5
PE
44092005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4410
a22ff96f 4411 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
4412 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4413 (yyuserMerge): Provide a default case if b4_mergers is empty.
4414 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4415 * tests/glr-regression.at
4416 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 4417 Add casts to pacify C++ compilers.
1beb0b24
PE
4418 * tests/glr-regression.at (Improper merging of GLR delayed action
4419 sets): Declare yylex before using it.
f32c66b5 4420 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
4421 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4422 test for valgrind; valgrind is independent of g++.
4423 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4424 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4425 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4426 Use a destructor, so that we can expand the stack. Change
4427 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 4428
d741bd1b
PE
44292005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4430
4431 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4432 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4433
0410a6e0
PE
44342005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4435
4436 * PACKAGING: New file, suggested by Bruno Haible and taken from
4437 similar wording in gettext's PACKAGING file.
4438 * NEWS: Mention PACKAGING.
4439 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4440
f7ab6a50
PE
44412005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4442
baf785db 4443 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
4444 * bootstrap: Get runtime translations into runtime-po.
4445 Create runtime-po files automatically, if possible.
4446 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4447 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4448 does not infringe on the user's name space.
4449 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4450 * doc/bison.texinfo (Internationalization): Revamp the English
4451 and Texinfo syntax a bit, to try to make it clearer.
4452 (Bison Options, Option Cross Key): Mention --print-localedir.
4453 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4454 YYENABLE_NLS. Quote a bit more.
4455 * runtime-po/.cvsignore: New file.
4456 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4457 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4458 * runtime-po/quot.sed: Likewise.
4459 * runtime-po/boldquot.sed: Likewise.
4460 * runtime-po/en@quot.header: Likewise.
4461 * runtime-po/en@boldquot.header: Likewise.
4462 * runtime-po/insert-header.sin: Likewise.
4463 * runtime-po/remove-potcdate.sin: Likewise.
4464 * runtime-po/Makevars: Likewise.
4465 * runtime-po/LINGUAS: Likewise.
4466 * runtime-po/de.po: Likewise; we will rely on the translation project
4467 to maintain this, so "bootstrap" should get it.
0410a6e0 4468 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
4469 its value.
4470 * src/main.c (main): Bind the bison-runtime domain, too.
4471
44722005-07-12 Bruno Haible <bruno@clisp.org>
4473
4474 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4475 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4476 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4477 * runtime-po: New directory.
4478 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4479 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4480 * runtime-po/Rules-quot: New file, copied from po/.
4481 * runtime-po/quot.sed: Likewise.
4482 * runtime-po/boldquot.sed: Likewise.
4483 * runtime-po/en@quot.header: Likewise.
4484 * runtime-po/en@boldquot.header: Likewise.
4485 * runtime-po/insert-header.sin: Likewise.
4486 * runtime-po/remove-potcdate.sin: Likewise.
4487 * runtime-po/Makevars: New file.
4488 * runtime-po/POTFILES.in: New file.
4489 * runtime-po/LINGUAS: New file.
4490 * runtime-po/bison-runtime.pot: New file.
4491 * runtime-po/de.po: New file.
4492 * m4/bison.m4: New file.
4493 * Makefile.am (SUBDIRS): Add runtime-po.
4494 (aclocaldir, aclocal_DATA): New variables.
4495 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4496 Define aclocaldir.
4497 * src/getargs.c (usage): Document --print-localedir option.
4498 (PRINT_LOCALEDIR_OPTION): New enum item.
4499 (long_options): Add --print-localedir option.
4500 (getargs): Handle --print-localedir option.
4501 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4502 (Internationalization): New section.
4503
22dda0f0
AD
45042005-07-12 Akim Demaille <akim@epita.fr>
4505
4506 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4507 for consistency with the rest of the code.
4508 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4509 Add separators.
4510
82b248ad
AD
45112005-07-12 Akim Demaille <akim@epita.fr>
4512
4513 * src/parse-gram.y: Use %printer instead of YYPRINT.
4514
fa0e9314
AD
45152005-07-12 Akim Demaille <akim@epita.fr>
4516
867a3e00
AD
4517 * src/symtab.h, src/symtab.c (symbol_print): New.
4518 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4519 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4520
45212005-07-12 Akim Demaille <akim@epita.fr>
4522
4523 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
4524 b4_at_dollar and b4_dollar_dollar.
4525
e054b190
PE
45262005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4527
4528 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4529 and Pennello's paper.
4530
34160ec4
PE
45312005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4532
407d4a75
PE
4533 * data/yacc.c (yyparse): Undo previous patch. Instead,
4534 set yylsp[0] and yyvsp[0] only if the initial action
4535 sets yylloc and yylval, respectively.
4536
34160ec4
PE
4537 * data/yacc.c (yyparse): In the initial action, set
4538 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4539 This avoids the use of undefined variables if the initial
4540 action does not set yylloc and/or yylval.
4541
c3d5a4a7
PE
45422005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4543
b34d96c1
PE
4544 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4545 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4546 Remove from CVS. These files are automatically generated.
4547 * examples/extexi: Clarify that this file is now part of Bison,
4548 not GNU M4, and that it works with any POSIX-compatible Awk.
4549 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4550 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4551 so that we also get calc++-parser.yy. Geneate it.
4552 Use $(AWK), not gawk, since any conforming Awk will do.
4553 Put comment before action, since older 'make' can't handle comment
4554 in action.
4555 $(BUILT_SOURCES): List all built sources, not just some of them.
4556 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4557 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4558 $($(calc_sources_generated)): Remove unnecessary test for existence
4559 of target. (This had a shell syntax error anyway; a stray "x".)
4560 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4561 calc++-parser.yy.
4562 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4563
c3d5a4a7
PE
4564 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4565 implied by the other modules.
4566
828c373b
AD
45672005-07-06 Akim Demaille <akim@epita.fr>
4568
4569 Bind examples/calc++ to the package.
4570 * examples/calc++/Makefile: Remove, replaced by...
4571 * examples/calc++/Makefile.am: ... this new file.
4572 * examples/calc++/test: Remove input.
4573 * examples/calc++/compile: Remove.
4574 * examples/Makefile.am: New.
4575 * configure.ac, Makefile.am: Adjust.
4576 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4577
63cb01d6
PE
45782005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4579
fd2df2ed
PE
4580 * data/glr.c (yyFail): Drastically simplify; since the format argument
4581 never had any % directives, we can simply pass it to yyerror.
4582 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4583 be modified later, as that is the usual style in glr.c.
4584 Problems reported by Paul Hilfinger.
4585
63cb01d6
PE
4586 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4587 and size overflow errors.
4588 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4589 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4590 (YYSIZEMAX): New macro.
4591 (yystpcpy): New function, taken from yacc.c.
4592 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4593 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4594 so that we don't have to maintain their signatures.
4595 (yyFail): Check for buffer overflow, by using vsnprintf rather
4596 than vsprintf. Allocate a bigger buffer if possible.
4597 Report an error if buffer allocation fails.
4598 (yyStackOverflow): New function.
4599 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4600 the initialization was successful. It might fail if storage was
4601 exhausted.
4602 (yyexpandGLRStack): Add more checks for storage allocation failure.
4603 Use yyStackOverflow to report failures.
4604 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4605 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4606 Don't assume stack number fits in int.
4607 (yysplitStack): Check for storage allocation failure.
4608 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4609 can print diagnostics on storage allocation failure. All callers
4610 changed.
4611 (yyresolveValue): Use yybool for boolean.
4612 (yyreportSyntaxError): Check for size-calculation overflow.
4613 This code is taken from yacc.c.
4614 (yyparse): Check for storage allocation errors when allocating
4615 the initial stack.
4616
1c59e0a1
AD
46172005-07-05 Akim Demaille <akim@epita.fr>
4618
4619 Extract calc++ from the documentation.
4620 * doc/bison.texinfo (Calc++): Add the extraction marks.
4621 * examples/extexi: New, from the aborted GNU Programming 2E.
4622 Separate the different paragraph of a file with empty lines.
4623 * examples/Makefile: Use it to extract the whole calc++ example.
4624
8a0adb01
AD
46252005-06-24 Akim Demaille <akim@epita.fr>
4626
4627 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4628 class typedefs.
4629
12545799
AD
46302005-06-22 Akim Demaille <akim@epita.fr>
4631
4632 * doc/bison.texinfo (C++ Language Interface): First stab.
4633 (C++ Parsers): Remove.
4634
99be0235
AD
46352005-06-22 Akim Demaille <akim@epita.fr>
4636
4637 * data/lalr1.cc (yylex_): Honor %lex-param.
4638
0ffd4fd1
AD
46392005-06-22 Akim Demaille <akim@epita.fr>
4640
4641 Start a set of simple examples.
4642 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4643 * examples/calc++/calc++-driver.hh,
4644 * examples/calc++/calc++-parser.yy,
4645 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4646 * examples/calc++/compile, examples/calc++/test: New.
4647
0925ebb4
PE
46482005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4649
4650 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4651 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4652 which stems from the 2005-05-27 patch.
4653
43d3b664
PH
46542005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4655
4656 * data/glr.c: Modify treatment of unused parameters to permit use
4657 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4658
3062864d
PE
46592005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4660
4661 Fix infringement on user name space reported by Janos Zoltan Szabo.
4662 * data/yacc.c (yyparse): strlen -> yystrlen.
4663
989b5b8e
AD
46642005-05-30 Akim Demaille <akim@epita.fr>
4665
4666 * data/lalr1.cc (_): New.
4667 Translate the various messages.
4668
bedf57f5
PE
46692005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4670
4671 Fix infringement on user name space reported by Bruno Haible.
4672 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4673 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4674 the user's name space.
4675 (alloca): Include <stdlib.h> to get it, if it's not built in.
4676 (YYMALLOC, YYFREE): Define only if needed.
4677 (malloc, free): Declare, but only if needed, as this infringes on
4678 the user name space.
4679
4d1801f1
PE
46802005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4681
4682 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4683 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4684 with %d format.
4685 * lib/ebitset.c (min, max): Undef before defining.
4686 * lib/vbitset.c (min, max): Likewise.
4687 * lib/subpipe.c (create_subpipe): Save local variables in case
4688 vfork clobbers them.
4689
46902005-05-24 Bruno Haible <bruno@clisp.org>
4691
4692 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4693 error message syntax used by gcc-4.0.
4694
b94a9e1e
PE
46952005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4696
85ac3861
PE
4697 * README: Mention m4 1.4.3. Remove obsolete advice about
4698 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4699
b94a9e1e
PE
4700 * bootstrap: Remove workaround for problem I encountered with
4701 gettext 0.14.1; it seems to be fixed now.
4702
51c30d21
PE
47032005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4704
009ce67d
PE
4705 * NEWS: Version 2.0a.
4706
f2a97c62
PE
4707 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4708 the previous change.
4709
c8775f93
PE
4710 Various maintainer cleanups.
4711 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4712 conftest*, for benefit of CVS commands run at the same time as
4713 "configure". Add build-aux, since "bootstrap" now creates it and
4714 its subfiles.
4715 * Makefile.cfg (move_if_change): Remove.
4716 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
4717 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
4718 (po_repo, do-po-update, po-update, wget_files, get-targets):
4719 (config.guess-url_prefix, config.sub-url_prefix):
4720 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
4721 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
4722 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
4723 Remove.
4724 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
4725 this is now the recommended name.
4726 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
4727 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
4728 ylwrap. These files now go into build-aux.
4729 * config/move-if-change: Remove.
4730 * config/prev-version.txt: Bump from 1.75 to 2.0.
4731
3ea5f0ec
PE
4732 * bootstrap: Add stdio-safer, unistd-safer modules.
4733 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4734 we don't need it).
4735 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
4736 fopen-safer.c, stdio-safer.h, unistd-safer.h.
4737 * lib/subpipe.c: Include "unistd-safer.h".
4738 (create_subpipe): Make sure all the newly-created
4739 file descriptors are > 2, so that diagnostics don't
4740 get sent down them (which might cause Bison to hang, in theory).
4741 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
4742 * src/files.c (xfopen): Use fopen_safer, not fopen.
4743
51c30d21
PE
4744 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4745 yesterday's yacc.c fix.
4746
cea1469d
PE
47472005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4748
3ea5f0ec
PE
4749 * data/glr.c, data/lalr1.cc: Update copyright date.
4750
cea1469d
PE
4751 Fix a destructor bug reported by Wolfgang Spraul in
4752 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
4753 * data/yacc.c (yyabortlab): Don't call destructor, and
4754 don't set yychar to EMPTY.
4755 (yyoverflowlab): Don't call destructor.
4756 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
4757 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
4758 since we no longer output the message "discarding lookahead token
4759 end of input ()".
4760
5e6f62f2
PH
47612005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4762
4763 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
4764 fix a small glitch in debugging output.
4765 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
4766 after YY_SYMBOL_PRINT where needed.
4767
4768 (struct yyGLRState): Add some comments.
4769 (struct yySemanticOption): Add some comments.
4770 (union yyGLRStackItem): Add comment.
4771
4772 (yymergeOptionSets): Correct this to properly perform the union,
4773 avoiding infinite reported by Michael Rosien.
4774 Update comment.
4775
4776 * tests/glr-regression.at: Add test for GLR merging error reported
4777 by M. Rosien.
cea1469d 4778
0fb669f9
PE
47792005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4780
4781 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
4782 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
4783 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
4784 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
4785 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
4786 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
4787 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
4788 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
4789 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
4790 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
4791 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
4792 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
4793 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
4794 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
4795 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
4796 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
4797 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
4798 src/derives.h, src/files.c, src/files.h, src/getargs.c,
4799 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
4800 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
4801 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
4802 src/output.h, src/parse-gram.c, src/parse-gram.h,
4803 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
4804 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
4805 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
4806 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
4807 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
4808 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
4809 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
4810 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
4811 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
4812 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
4813 tests/reduce.at, tests/regression.at, tests/sets.at,
4814 tests/synclines.at, tests/testsuite.at, tests/torture.at:
4815 Update FSF postal mail address.
4816
51f4735e
PE
48172005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4818
4819 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4820 Problem reported by Ralf Menzel.
4821
80ce3401
PE
48222005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4823
4824 * tests/actions.at: Test that stack overflow invokes destructors.
4825 From Marcus Holland-Moritz.
4826 * data/yacc.c (yyerrlab): Move the code that destroys the stack
4827 from here....
4828 (yyreturn): to here. That way, destructors are called properly
4829 even if the stack overflows, or the user calls YYACCEPT or
4830 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
4831 (yyoverflowlab): Destroy the lookahead.
4832
48332005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4834
4835 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4836
72f000b0
PE
48372005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4838
4839 * NEWS: Bison-generated C parsers no longer quote literal strings
4840 associated with tokens.
4841 * src/output.c (prepare_symbols): Don't escape strings,
4842 since users don't want to see C escapes.
4843 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4844 in diagnostics.
c19683bb 4845 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
4846 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4847
1094323f
PE
48482005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4849
4850 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4851 the data size is known to be too small and we can't increase it.
4852 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4853
ca407bdf
PE
48542005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4855
4856 * src/parse-gram.y: Include quotearg.h.
4857 (string_as_id): Quote $1 before using it as a key, since the
4858 lexer no longer quotes it for us.
4859 (string_content): Don't strip quotes, since lexer no longer
4860 quotes it for us.
4861 * src/scan-gram.l: Include quotearg.h.
4862 ("\""): Omit quote.
4863 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4864 a key, since the rest of the lexer doesn't quote it.
4865 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4866 * tests/regression.at (Token definitions): Check for backslashes
4867 in token strings.
4868
4869 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4870 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4871 (yyparse): Revamp code to generate long syntax error message, to
4872 make it easier to translate, and to avoid problems with arithmetic
4873 overflow. Change "virtual memory" to "memory" in diagnostic, since
4874 we don't know whether the memory is virtual.
4875
1ce59070
PE
48762005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4877
4878 * NEWS: Bison-generated C parsers now use the _ macro to
4879 translate strings.
4880 * data/yacc.c (_) [!defined _]: New macro.
4881 All English strings wrapped inside this macro.
4882 * doc/bison.texinfo (Bison Parser): Document _.
4883 * po/POTFILES.in: Include src/parse-gram.c, since it now
4884 includes translateable strings that parse-gram.y doesn't.
4885
a749a695
PE
48862005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4887
4888 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4889 reverting the 2004-10-11 change to this function.
4890 (symbol_check_alias_consistency): Don't call symbol_type_set
4891 if the type name is already correct.
4892 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4893
8fb1053b
PE
48942005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4895
4896 * tests/regression.at (Token definitions): Don't use a token named
4897 c, as that generates a "#define c ..." that runs afoul of buggy
4898 stdlib.h that uses the identifier c as a member of struct
4899 drand48_data. Problem reported by Horst Wente.
4900
ff498c4a
PE
49012005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4902
4903 * bootstrap: Change translation URL from
4904 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4905 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4906 redirection glitches. Problem reported by twlevo@xs4all.nl.
4907
65211d70
PE
49082005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4909
4910 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4911 after operands; POSIX says this isn't portable for the c99 command.
4912
9577fb1f
PE
49132005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4914
4915 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4916 immediately if a data overrun has occurred; this may help us track
4917 down what may be a spurious failure on MacOS.
4918
78b178f7
PE
49192005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4920
a2599d0f
PE
4921 Respond to problems reported by twlevo@xs4all.nl.
4922
4923 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4924
78b178f7
PE
4925 * src/vcg.h: Comment fix.
4926 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4927 (G_CMAX): Change to -1 instead of INT_MAX.
4928
4929 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 4930
7296e729
PE
49312005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4932
4933 * src/tables.c (state_number_to_vector_number): Put it inside an
4934 "#if 0", since it's not currently used. Problem reported by
4935 Roland McGrath.
4936
05ac60f3
PE
49372005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4938
4939 * src/output.c (escaped_output): Renamed from
4940 escaped_file_name_output, since we now use it for symbol tags as
4941 well. All uses changed.
4942 (symbol_destructors_output, symbol_printers_output):
4943 Escape symbol tags too.
4944 Problem reported by Matyas Forstner in
4945 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4946
4947 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4948 not needed.
4949 * src/output.c (user_actions_output, token_definitions_output,
4950 symbol_destructors_output, symbol_printers_output): Likewise.
4951 * src/reader.c (prologue_augment): Likewise.
4952 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4953
4954 * src/vcg.c (output_edge): Don't quote linestyle arg.
4955 Problem reported by twlevo@xs4all.nl.
4956
7eb453ac
PE
49572005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4958
4959 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4960 example, reported by Derek M Jones. Also, make the example even
4961 more outrageous, to better illustrate how bad the problem is.
4962
4c04c52a
PE
49632005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4964
4965 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4966 putsym. Typo reported by Sebastian Piping.
4967
a61e1620
PE
49682005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4969
4970 * doc/bison.texinfo (Language and Grammar): some -> same
4971 (Epilogue): int he -> in the
4972 Typos reported by Sebastian Piping via Justin Pence.
4973
9ec93868
PE
49742005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4975
4976 * tests/glr-regression.at (Improper handling of embedded actions
4977 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4978 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4979 with dollar signs in test names.
4980 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4981 for a similar reason.
4982
73ce7e7e
PE
49832005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4984
4985 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4986 wants to redefine G_VIEW.
4987
2e72b98e
PE
49882005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4989
4990 * src/vcg.c (get_view_str): Remove case for normal_view.
4991 Problem reported by twlevo@xs4all.nl.
4992
e0d634e5
PE
49932005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4994
ccf830a4
PE
4995 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4996 Problem reported by twlevo@xs4all.nl.
4997
e0d634e5
PE
4998 * doc/bison.texinfo: Change @dircategory from "GNU programming
4999 tools" to "Software development". Requested by Richard Stallman
5000 via Karl Berry.
5001
7bbc8cb0
PE
50022005-01-23 Paul Eggert <eggert@cs.ucla.edu>
5003
5004 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
5005 Problem reported by twlevo@xs4all.nl.
5006
08b770bc
PE
50072005-01-21 Paul Eggert <eggert@cs.ucla.edu>
5008
5009 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
5010 keyword; it's not needed with modern compilers, and it doesn't
5011 affect correctness with older compilers. Suggested by
5012 twlevo@xs4all.nl.
5013
95f22ad2
PE
50142005-01-17 Paul Eggert <eggert@cs.ucla.edu>
5015
5016 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
5017 gcc -Wswitch-default.
5018 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5019 * data/yacc.c (yyparse): Likewise.
5020
d229d15c
PE
50212005-01-12 Paul Eggert <eggert@cs.ucla.edu>
5022
5023 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
5024 already. Let config.h define any nonstandard values.
5025
ecadd90f
PE
50262005-01-10 Paul Eggert <eggert@cs.ucla.edu>
5027
5028 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
5029 for the benefit of slower hosts. Problem reported by
5030 Nelson H. F. Beebe.
5031
213744b5
PE
50322005-01-07 Paul Eggert <eggert@cs.ucla.edu>
5033
5034 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
5035 being defined and not used.
5036 * data/lalr1.cc (yyparse): Likewise.
5037 Use "if (false)" rather than "if (0)".
5038
249d3236
PE
50392005-01-05 Paul Eggert <eggert@cs.ucla.edu>
5040
5041 * TODO: Mention that we should allow NUL bytes in tokens.
5042
987cc1fb
PE
50432005-01-02 Paul Eggert <eggert@cs.ucla.edu>
5044
5045 * src/scan-skel.l (<<EOF>>): Don't close standard output.
5046 Problem reported by Hans Aberg.
5047
08fe02d9
PE
50482005-01-01 Paul Eggert <eggert@cs.ucla.edu>
5049
5050 * src/getargs.c (version): Happy new year; update overall
5051 program copyright date from 2004 to 2005.
5052
5053 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
5054 Problem reported by Hans Aberg.
5055 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
5056 (Output file names.): Add a test for the case when standard output
5057 is closed.
5058
010c0266
PE
50592004-12-26 Paul Eggert <eggert@cs.ucla.edu>
5060
5061 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
5062 to fix an oversight in the Bison 2.0 manual.
5063
da12206a
PE
50642004-12-25 Paul Eggert <eggert@cs.ucla.edu>
5065
5066 * NEWS: Version 2.0. Reformat the existing news items since
5067 1.875, so that related items are grouped together.
3a4734aa 5068 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
5069 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
5070
c935d934
PE
5071 * tests/torture.at (Exploding the Stack Size with Alloca): Set
5072 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
5073 otherwise, we're not testing alloca. Unfortunately there's no
5074 simple way to consult HAVE_ALLOCA here.
5075
da12206a
PE
5076 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
5077 for yymsg, too.
5078
5079 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
5080 hand. This avoids a warning about comparing int to size_t when
5081 GCC warnings are enabled.
5082
0a2c5137
PE
50832004-12-22 Paul Eggert <eggert@cs.ucla.edu>
5084
d7e14fc0
PE
5085 * NEWS: Bison-generated parsers no longer default to using the
5086 alloca function (when available) to extend the parser stack, due
5087 to widespread problems in unchecked stack-overflow detection.
5088 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
5089 responsibility to set it to a positive value. This lets the user
5090 specify a value that is not a preprocessor constant.
5091 * data/yacc.c (YYMAXDEPTH): Likewise.
5092 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
5093 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
5094 to be a compile-time constant. However, explain the constraints on it.
5095 Also, explain the constraints on YYINITDEPTH.
5096 (Table of Symbols): Explain that alloca is no longer the default.
5097 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
5098 to 1.
5099
0a2c5137
PE
5100 * doc/bison.texinfo (Location Default Action): Mention that n must
5101 be zero when k is zero. Suggested by Frank Heckenbach.
5102
e019c247
AD
51032004-12-22 Akim Demaille <akim@epita.fr>
5104
5105 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
5106 (parser::state_type, parser::semantic_type, parser::location_type):
5107 Private, not public.
5108 (parser::parse): Return ints, not bool.
5109 Returning a bool introduces a problem: 0 corresponds to false, and
5110 it seems weird to return false on success. Returning true changes
5111 the conventions for yyparse.
5112 Alternatively we could return void and send an exception.
5113 There is no clear consensus (yet?).
5114 (state_stack, semantic_stack, location_stack): Rename as...
5115 (state_stack_type, semantic_stack_type, location_stack_type): these.
5116 Private, not public.
5117 * tests/c++.at: New.
5118 * tests/testsuite.at, tests/Makefile.am: Adjust.
5119
72731bb7
AD
51202004-12-21 Akim Demaille <akim@epita.fr>
5121
5122 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
5123
9a0d8bec
AD
51242004-12-21 Akim Demaille <akim@epita.fr>
5125
5126 Don't impose std::string for filenames.
5127
5128 * data/lalr1.cc (b4_filename_type): New.
5129 (position::filename): Use it.
5130 (parser.hh): Move the inclusion of stack.hh and location.hh below
5131 the user code, so that needed headers for the filename type can be
5132 included first.
72731bb7
AD
5133 Forward declare them before the user code.
5134 * tests/Makefile.am (check-local, installcheck-local): Pass
5135 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 5136
99880de5
AD
51372004-12-20 Akim Demaille <akim@epita.fr>
5138
5139 Use more STL like names: my_class instead of MyClass.
5140
5141 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5142 (SemanticStack, SemanticType, StateStack, StateType)
5143 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5144 (Parser::value): Rename as...
5145 (location_stack, location_type, rhs_number_type, semantic_stack)
5146 (semantic_type, state_stack, state_type, token_number_type, stack)
5147 (slice, traits, parser::yylloc, parser::yylval): these.
5148
5149 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5150
9bec482e
PE
51512004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5152
5153 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5154 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5155
f6fbd3da
PE
51562004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5157
5158 Remove uses of 'short int' and 'unsigned short int'. This raises
5159 some arbitrary limits. It uses more memory but nowadays that's
5160 not much of an issue.
5161
5162 This change does not affect the generated parsers; that's a different
5163 task, as some users will want to conserve memory there.
5164
5165 Ideally we should use size_t to represent all object counts, and
5166 something like ptrdiff_t to represent signed differences of object
5167 counts; but that will require more code-cleanup than I have the
5168 time to do right now.
5169
5170 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5171 Use size_t, not int or short int, to count objects.
5172 * src/closure.c (nritemset, closure): Likewise.
5173 * src/closure.h (nritemset, closure): Likewise.
5174 * src/nullable.c (nullable_compute): Likewise.
5175 * src/print.c (print_core): Likewise.
5176 * src/print_graph.c (print_core): Likewise.
5177 * src/state.c (state_compare, state_hash): Likewise.
5178 * src/state.h (struct state): Likewise.
5179 * src/tables.c (default_goto, goto_actions): Likewise.
5180
5181 * src/gram.h (rule_number, rule): Use int, not short int.
5182 * src/output.c (prepare_rules): Likewise.
5183 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5184 errs, reductions): Likewise.
5185 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5186 Likewise.
5187 * src/tables.c (vector_number, tally, action_number,
5188 ACTION_NUMBER_MINIMUM): Likewise.
5189 * src/output.c (muscle_insert_short_int_table): Remove.
5190
efeed023
AD
51912004-12-17 Akim Demaille <akim@epita.fr>
5192
5193 * data/lalr1.cc: Extensive Doxygenation.
5194 (error_): Rename as...
5195 (error): this, since it is visible to the user.
5196 Adjust callers.
5197 (Parser::message): Now an automatic variable from...
5198 (Parser::yyreport_syntax_error_): here.
5199 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5200 Parser::error.
5201 * tests/input.at: Escape $.
5202
bc82c5a5
PE
52032004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5204
5205 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5206 Parenthesize rhs to avoid obscure problems with mistakes like
5207 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5208 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5209 b4_rhs_location): Likewise.
5210 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5211 b4_rhs_location): Likewise.
5212
fd19f271
AD
52132004-12-16 Akim Demaille <akim@epita.fr>
5214
5215 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5216 yacc.c: be sure to stay within yycheck_.
5217 * tests/actions.at: Re-enable C++ tests.
5218
10454ea4
AD
52192004-12-16 Akim Demaille <akim@epita.fr>
5220
5221 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5222 real.
5223
c5b95ccf
AD
52242004-12-16 Akim Demaille <akim@epita.fr>
5225
5226 Use #define to handle the %name-prefix.
5227
5228 * data/glr.c, data/yacc.c: Comment changes.
5229 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5230 so that one can refer to yylex in the parser file, and have it
5231 renamed, as is the case with other skeletons.
5232
617a8f12
AD
52332004-12-16 Akim Demaille <akim@epita.fr>
5234
5235 Move lalr1.cc internals into yy*.
5236
5237 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5238 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5239 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5240 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5241 (empty_, final_, terror_, errcode_, ntokens_)
5242 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5243 (looka_, ilooka_, error_range_, nerrs_):
5244 Rename as...
5245 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5246 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5247 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5248 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5249 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5250 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5251 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5252 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5253 these.
5254
1e547e6e
PE
52552004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5256
5257 Fix some problems reported by twlevo at xs4all.
5258 * src/symtab.c (symbol_new): Report an error if the input grammar
5259 contains too many symbols. This is better than calling abort() later.
5260 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5261 (struct node, struct graph):
5262 Rename member expand to stretch. All uses changed.
5263 (struct graph): Remove member layoutalgorithm. All uses removed.
5264 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5265 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5266 All uses changed.
5267 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5268
735d6bd4
AD
52692004-12-15 Akim Demaille <akim@epita.fr>
5270
5271 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5272 Add more Doxygen comments.
5273 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5274 (report_syntax_error_, translate_): Rename as...
5275 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5276 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5277
2e1f5829
AD
52782004-12-15 Akim Demaille <akim@epita.fr>
5279
5280 * data/lalr1.cc (lex_): Rename as...
5281 (yylex_): this.
5282 Move the trace here.
5283 Take the %name-prefix into account.
5284 Reported by Alexandre Duret-Lutz.
5285
a3cb6248
AD
52862004-12-15 Akim Demaille <akim@epita.fr>
5287
5288 Simplify the C++ parser constructor.
5289
5290 * data/lalr1.cc (debug_): Rename as...
5291 (yydebug_): so that the parser's internals are always in the yy*
5292 pseudo namespace.
5293 Adjust uses.
5294 (b4_parse_param_decl): Remove the leading comma as it is now only
5295 called as unique argument list.
5296 (Parser::Parser): Remove the constructor accepting a location and
5297 an initial debugging level.
5298 Remove from the other ctor the argument for the debugging level.
5299 (debug_level_type, debug_level, set_debug_level): New.
5300
5301 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5302 constructor calls.
5303
07fed891
AD
53042004-12-15 Akim Demaille <akim@epita.fr>
5305
5306 Remove b4_root related material: failure experiment
a3cb6248 5307 (which goal was to allow to derive from a class).
07fed891
AD
5308
5309 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5310 definitions and uses.
5311
e603eaa5
PE
53122004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5313
5314 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5315 not 2, since it's not portable to subtract 1 from the start of an
5316 array. The new item 0 is never set or used. All uses changed.
5317
5318 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5319 the default definition of YYLLOC_DEFAULT. Problem reported
5320 by Frank Heckenbach.
5321
fafb007d
PE
53222004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5323
5324 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5325 the normal case and one for the error case. Just use the
5326 first one uniformly. Problem reported by Frank Heckenbach.
5327 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5328 use exactly the same macro in both places.
5329 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5330 so that the normal-case YYRHSLOC works for the error case too.
5331 All uses changed.
5332 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5333 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5334 * doc/bison.texinfo (Location Default Action): Don't claim that
5335 we have an array of locations. Use the same macro for both glr
5336 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5337 the index is 0.
5338
48814dcd
PE
53392004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5340
a4e1a53b
PE
5341 * HACKING: Update email addresses to send announcements to.
5342
48814dcd
PE
5343 * configure.ac (AC_INIT): Bump version to 1.875f.
5344
337116ba
PE
53452004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5346
5347 * NEWS: Version 1.875e.
5348 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5349
5350 * src/scan-skel.l: Include "complain.h", for "fatal".
5351
5352 * src/relation.h (relation_print, relation_digraph):
5353 Relation sizes are of type relation_node, not size_t (this is
5354 merely a doc fix, since the two types are equivalent).
5355 (relation_transpose): Relation sizes are of type relation_node,
5356 not int.
5357 * src/relation.c: Likewise.
5358 (top, infinity): Now of type relation_node, not int.
5359 (traverse, relation_transpose): Use relation_node, not int.
5360
5361 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5362 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5363 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5364
5365 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 5366 specifying whether the test should be skipped. Use it tp
337116ba 5367 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 5368 fail on some hosts, and should be skipped.
337116ba 5369
da2a7671
PE
53702004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5371
5372 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5373 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5374 unless otherwise specified below.
5375
5376 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5377 to allocate kernel_base, kernel_items, kernel_size, since
5378 they needn't be initialized to 0.
5379 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5380 * src/closure.c (new_closure): Likewise, for itemset.
5381 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5382 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5383 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5384 (build_relations): Likewise for edge, states1, includes.
5385 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5386 * src/reader.c (packgram): Likewise, for ritem, rules.
5387 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5388 * src/relation.c (relation_digraph): Likewise for VERTICES.
5389 (relation_transpose): Likewise for new_R, end_R.
5390 * src/symtab.c (symbols_token_translations_init): Likewise for
5391 token_translations.
5392 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5393 (token_actions): Likewise for yydefact, actrow, conflrow,
5394 conflict_list.
5395 (save_column): Likewise for froms[symno], tos[symno].
5396 (goto_actions): Likewise for state_count.
5397 (pack_table): Likewise for base, pos, check.
5398 (tables_generate): Likewise for width.
5399
5400 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5401 for initial core. Just have a separate core, so we needn't worry
5402 about whether kernel_size and kernel_base are initialized.
5403
5404 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5405 kernel_size, kernel_items): Remove unnecessary initialization.
5406 * src/conflicts.c (conflicts): Likewise.
5407 * src/derives.c (derives): Likewise.
5408 * src/muscle_tablc (muscle_insert): Likewise.
5409 * src/relation.c (relation_digraph): Likewise.
5410 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5411 conflrow, conflict_table, conflict_list, table, check):
5412 Likewise.
5413
5414 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5415 This is because all callers pass unsigned int.
5416 * src/closure.h (new_closure): Likewise.
5417
5418 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5419 (build_relations): Initialize includes[i] in all cases.
5420 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5421 and rules[ruleno].precsym. Initialize members in order.
5422 * src/relation.c (relation_transpose): Always initialize new_R[i]
5423 and end_R[i].
5424 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5425
5426 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5427 conflict_list[0] was always 0, but now it isn't initialized.
5428
5429 * src/table.c (table_grow): When conflict_table grew, the grown
5430 area wasn't cleared. Fix this.
5431
5432 * lib/.cvsignore: Add strdup.c, strdup.h.
5433 * m4/.cvsignore: Add strdup.m4.
5434
00baeeac
PE
54352004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5436
5437 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5438 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5439 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5440 ngotos + 1 without checking for overflow.
5441 (build_relations): Use END_NODE, not -1, to denote end of edges.
5442 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5443 build_relations): Use goto_number, not int, for goto numbers.
5444 * src/tables.c (save_column, default_goto): Likewise.
5445
be3d9d42
AD
54462004-11-23 Akim Demaille <akim@epita.fr>
5447
5448 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5449 of #defining from yystype.
5450 Don't typedef yystype, C++ does not need it.
5451 This lets it possible to forward declare it as union.
5452
78e526d5
PE
54532004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5454
5455 * bootstrap (gnulib_modules): Add extensions.
5456 Problem reported by Jim Meyering.
5457
afbb696d
PE
54582004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5459
5460 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5461 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5462 src/system.h, src/tables.c: XFREE -> free, to accommodate
5463 recent change to gnulib xalloc.h.
78e526d5 5464 Problem reported by Jim Meyering.
afbb696d 5465
c1f8f16a
AD
54662004-11-17 Akim Demaille <akim@epita.fr>
5467
5468 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5469
db7e5eb5 54702004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
5471 Alexandre Duret-Lutz <adl@gnu.org>
5472
5473 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5474 changes.
5475 (YYCDEBUG): Adjust.
5476 Use it instead of cdebug_.
5477 (Parser::debug_stream, Parser::set_debug_stream): New.
5478 (Parser::symprint_): Define cdebug_ for temporary backward
5479 compatibility.
5480 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5481 debug_stream ().
5482
68e11668
AD
54832004-11-17 Akim Demaille <akim@epita.fr>
5484
5485 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5486 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5487 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5488 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5489
97cbc73e
PE
54902004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5491
5492 * data/glr.c (yyloc_default): Remove; not used.
5493 Problem reported by Frank Heckenbach.
5494
e342c3be
AD
54952004-10-25 Akim Demaille <akim@epita.fr>
5496
5497 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5498 Introduce another definition to address simple location arrays.
5499 (yyGLRStack): New member: yyerror_range.
5500 (yyrecoverSyntaxError, yyparse): Update it.
5501 (yyrecoverSyntaxError): Use it when shifting the error token to
5502 have an accurate range, equivalent to the one computed by both
5503 yacc.c and lalr1.cc.
5504 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5505 that column numbers start at column 0, as per GNU Coding
5506 Standards, the others tests, and the doc.
5507 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5508 Adjust to the above change (first column is 0).
5509 And adjust the location of the "<error>", now covering the whole
5510 line.
5511
93602feb 55122004-10-22 Akim Demaille <akim@epita.fr>
04098407 5513 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
5514
5515 Remove some arbitrary limits on goto numbers and relations.
5516 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5517 initial values, since they're never used.
5518 (set_goto_map): ngotos is now unsigned, so test for overflow
5519 by seeing whether it wraps around to zero.
5520 * src/lalr.h (goto_number): Now size_t, not short int.
5521 (GOTO_NUMBER_MAXIMUM): Remove.
5522 * src/relation.c (relation_print, traverse, relation_transpose):
5523 Check for END_NODE rather than looking at sign.
5524 * src/relation.h (END_NODE): New macro.
5525 (relation_node): Now size_t, not short int.
5526
dba08b04
PE
55272004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5528
5529 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5530 keyword, not an identifier. Problem reported by Baron Schwartz in
5531 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5532
df09ef2e
AD
55332004-10-11 Akim Demaille <akim@epita.fr>
5534
5535 * src/symtab.c (symbol_check_alias_consistency): Also check
5536 type names, destructors, and printers.
5537 Reported by Alexandre Duret-Lutz.
5538 Recode the handling of associativity and precedence in terms
5539 of symbol_precedence_set.
5540 Accept no redeclaration at all, not even equal to the previous
5541 value.
5542 (redeclaration): New.
5543 Use it to factor redeclaration complaints.
5544 (symbol_make_alias): Don't set the type of the alias, let
5545 symbol_check_alias_consistency do it as for other features.
5546 * src/symtab.h (symbol): Add new member prec_location, and
5547 type_location.
5548 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5549 * tests/input.at (Incompatible Aliases): New.
5550
146bc99d
PE
55512004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5552
5553 .cvsignore fixes to accommodate gnulib changes,
5554 and the practice of naming build directories "_build".
5555 * .cvsignore: Add "_*". Sort.
5556 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5557 * m4/.cvsignore: Add "*_gl.m4".
5558
e503aa60
AD
55592004-10-06 Akim Demaille <akim@epita.fr>
5560
5561 * src/parse-gram.y (add_param): Fix the truncation of trailing
5562 spaces.
5563
b4a20338
AD
55642004-10-05 Akim Demaille <akim@epita.fr>
5565
5566 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5567 whether the reducion was empty or not. This leaves room to
5568 improve the use of YYLLOC_DEFAULT in such a case.
5569 lalr1.cc is still experimental, so changing this is acceptable.
5570 And finally, there are probably not many users who changed the
5571 handling of locations in GLR, so changing is admissible too.
5572
5573 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5574 empty reduction, set @$ to an empty location ending the previously
5575 stacked symbol.
5576 Adjust uses to make sure the code is triggered on empty
5577 reductions.
5578 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5579 expected output: empty reductions have empty locations.
5580
f85a5e6f
AD
55812004-09-29 Akim Demaille <akim@epita.fr>
5582
5583 * data/lalr1.cc: Move towards a more standard C++ coding style
5584 for templates: Class < T > -> Class<T>.
5585
b203fc2c
AD
55862004-09-29 Akim Demaille <akim@epita.fr>
5587
5588 * data/lalr1.cc: Reinstall the former ctor, for sake of
5589 compatibility, but warn it will be removed.
5590 Move towards a more standard C++ coding style (i.e., type *var ->
5591 type* var).
5592
5b7e1e73
PE
55932004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5594
3fee967f
PE
5595 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5596 since it's less likely to work if NULs are involved in the future.
5b7e1e73 5597
0dcca5c2
AD
55982004-09-27 Akim Demaille <akim@epita.fr>
5599
5600 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5601
6dde1c82
AD
56022004-09-27 Akim Demaille <akim@epita.fr>
5603
5604 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 5605 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
5606 and argument names.
5607 (b4_cc_constructor_call): Likewise.
5608
b233d555
AD
56092004-09-24 Akim Demaille <akim@epita.fr>
5610
5611 * src/parse-gram.y (add_param): Strip the leading and trailing
5612 blanks from a formal argument declaration.
5613 (YY_LOCATION_PRINT): New.
5614
619404e3
AD
56152004-09-24 Akim Demaille <akim@epita.fr>
5616
5617 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5618 after the location.
5619
dd8d9022
AD
56202004-09-24 Akim Demaille <akim@epita.fr>
5621
5622 * doc/bison.texinfo (Table of Symbols): Sort.
5623
0092f063
AD
56242004-09-21 Akim Demaille <akim@epita.fr>
5625
5626 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5627 the useless parentheses.
5628 Suggested by Paul Eggert.
5629
451364ed
AD
56302004-09-20 Akim Demaille <akim@epita.fr>
5631
5632 Let the initial-action act on the look-ahead, and use it for the
5633 "initial push" (corresponding to an hypothetical beginning-of-file).
5634 And let lalr1.cc honor %initial-action.
5635
5636 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5637 example.
5638 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5639 (Parser::Parser): Remove the ctor that used to initialize it.
5640 (Parser::parse): Like in the other skeletons, issue the "starting
5641 parse" message before any action.
5642 Honor %initial-action.
5643 Initialize the stacks with the lookahead.
5644 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5645 look-ahead.
5646 Push them in the stacks.
5647 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5648
18d192f0
AD
56492004-09-20 Akim Demaille <akim@epita.fr>
5650
5651 * doc/bison.texinfo (Initial Action Decl): New.
5652
b8458aa5
AD
56532004-09-20 Akim Demaille <akim@epita.fr>
5654
5655 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5656 clearer criterion to define it.
5657 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5658 When reducing on an empty RHS, use the latest stacked location as
5659 location.
5660 yylloc is not always available.
5661 * data/glr.c: Likewise.
5662 Also, honor initial-actions.
5663
3fc16193
AD
56642004-09-20 Akim Demaille <akim@epita.fr>
5665
5666 * data/yacc.c (YY_LOCATION_PRINT): New.
5667 Define when we know YYLTYPE's structure, i.e., when the default
5668 YYLLOC_DEFAULT is used.
5669 * data/c.m4 (b4_yysymprint_generate): Use it.
5670 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5671 value of the result.
5672 (error_start_): Replace with...
5673 (error_range_): this location array.
5674 This allows to replace code relying on the implementation of
5675 locations by portable code.
5676 * data/yacc.c (yylerrsp): Replace with...
5677 (yyerror_range): this.
5678 Every time a token is popped, update yyerror_range[0], to have an
5679 accurate location for the error token.
5680 * data/glr.c (YY_LOCATION_PRINT): New.
5681 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5682 deference a pointer.
5683 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5684 report the location in %printers.
5685
5686 * src/scan-skel.l: Instead of abort, report error messages to ease
5687 understanding skeleton scanning failures.
5688
ecfe33e7
AD
56892004-09-16 Akim Demaille <akim@epita.fr>
5690
5691 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5692 (iterator, const_iterator): these, to be more in the C++ spirit.
5693 Also, return reverse iterators so that when displaying the stack
5694 we display its bottom first.
5695 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5696 from yacc.c.
5697 We should probably use vector here though.
5698
1576d44d
AD
56992004-09-16 Akim Demaille <akim@epita.fr>
5700
5701 Have more complete shift traces.
5702
5703 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5704 to report Shifts instead of ad hoc YYDPRINTF invocations,
5705 including for the error token.
5706 * data/lalr1.cc (symprint_): Output the location.
5707 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5708 output the location within the %printer.
5709 Activate GLR tests, at least to make sure they compile properly.
5710 They still don't pass though.
5711 * tests/calc.at: Adjust expect verbose output, since now "Entering
5712 state..." is on a different line than the "Shifting" message.
5713
9c66f418
AD
57142004-09-08 Akim Demaille <akim@epita.fr>
5715
5716 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
5717 Bison directive from the Bison file to the invocation of this
5718 macro, so that these directives are passed to
5719 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
5720 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
5721 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
5722 the extra Bison directives instead of the whole series.
5723 Change the grammar so that there are recoverable errors, and
5724 unrecoverable errors. Now we can have the parser give up before
5725 consuming the whole input. As a result we now can observe that
5726 the lookahead is freed when needed.
5727 Change the parser source to parse argv[1] instead of a hard coded
5728 string.
5729 Simplify yylex, and give a value and location to EOF.
5730 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
5731 passed directives already coded in the file.
5732 Add some tests to check the location of "error".
5733 For some tests, the C++ parser is correct, and not yacc.c.
5734 For other tests, they provide different, but unsatisfying, values,
5735 so keep the C++ value so that at least one parser is "correct"
5736 according to the test suite.
5737 (Actions after errors): Remove, this is subsumed by the
5738 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
5739
52d5733f
AD
57402004-09-06 Akim Demaille <akim@epita.fr>
5741
5742 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 5743 (Parser::pop): New.
52d5733f
AD
5744 Use it.
5745
a0e68930
AD
57462004-09-06 Akim Demaille <akim@epita.fr>
5747
5748 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
5749 argument, an informative message.
5750 Call YY_SYMBOL_PRINT.
5751 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
5752 * data/lalr1.cc (destruct_): Likewise.
5753 In addition, no longer depend on b4_yysymprint_generate and
5754 b4_yydestruct_generate to generate these functions, do it "by
5755 hand".
5756
e757bb10
AD
57572004-09-03 Akim Demaille <akim@epita.fr>
5758
5759 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
5760 invoked, yydestruct the lookahead.
5761 * tests/calc.at (Calculator $1): Update the expected lengths of
5762 traces: there is an added line for the discarded lookahead.
5763 * doc/bison.texinfo (Destructor Decl): Some rewording.
5764 Define "discarded" symbols.
5765
0fe1f06d
AD
57662004-09-02 Akim Demaille <akim@epita.fr>
5767
5768 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5769
284acc8b
AD
57702004-09-02 Akim Demaille <akim@epita.fr>
5771
5772 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
5773 (YYDSYMPRINTF): Rename as...
5774 (YY_SYMBOL_PRINT): this.
5775 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
5776 two.
5777 Use it instead of direct symprint_ calls.
5778 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5779 one.
5780
a5eb1ed2
AD
57812004-09-02 Akim Demaille <akim@epita.fr>
5782
b7c72fe1
AD
5783 * data/lalr1.cc (b4_yysymprint_generate): New.
5784 (symprint_): New member function, defined when YYDEBUG.
5785 Use it consistently instead of token/nterm debugging output by
5786 hand.
a5eb1ed2
AD
5787 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5788 %printer calls to use cdebug_ when using lalr1.cc.
5789
417141dd
AD
57902004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5791
5792 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5793 with #ifdef YYDEBUG.
5794
2fa09258
AD
57952004-08-26 Akim Demaille <akim@epita.fr>
5796
5797 * doc/bison.texinfo (Implementing Loops): Rename as...
5798 (Implementing Gotos/Loops): this.
5799
9378b508
PE
58002004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5801
5802 Adjust to latest gnulib.
5803 * bootstrap (gnulib_modules): Add xalloc-die.
5804 Set LC_ALL=C so that file names sort consistently.
5805 Prefer the gnulib copies of gettext.m4, glibc21.m4,
5806 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
5807 uintmax_t.m4, ulonglong.m4.
5808 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
5809 po.m4 since we are now using _gl.m4 instead.
5810
87a8ad5c
PE
58112004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5812
5813 * src/scan-action.l: Remove. Scanning of semantic actions is
5814 handled in scan-gram.l.
5815
dca81a78
PE
58162004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5817
5818 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5819
5820 * src/location.h (struct): The file member is a uniqstr.
5821 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5822
c9cbf7c5
PE
58232004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5824
5825 Fix bug with non-%union parsers that have printers or destructors,
5826 which led to a Bison core dump. Reported by Peter Fales in
5827 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 5828
c9cbf7c5
PE
5829 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
5830 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
5831 not to our own type.
5832 * src/output.c (symbol_destructors_output, symbol_printers_output):
5833 Don't assume %union.
5834 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
5835 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
5836 UNION-FLAG. All callers changed.
5837 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
5838 Use type char, not unsigned int, when declaring an array of char;
5839 this lets us remove a cast.
5840 (Printers and Destructors): Add non-%union test cases.
5841
fa7e68c3
PE
58422004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5843
5844 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5845 GLR writeups. E.g., avoid frenchspacing and the future tense,
5846 change "lookahead" to "look-ahead", and change "wrt" to "with
5847 respect to".
2fa09258 5848
fa7e68c3
PE
58492004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5850
5851 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5852 New sections, split off from the GLR Parsers section. Put the new
5853 Simple GLR Parser near the start of the GLR section, for clarity.
5854 Rewrite connective text.
5855
99a9344e
PE
58562004-06-21 Frank Heckenbach <frank@g-n-u.de>
5857
5858 * doc/bison.texinfo (Simple GLR Parsers): New section.
5859
8dd162d3
PE
58602004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5861
5862 * NEWS, TODO, doc/bison.texinfo:
5863 Use "look-ahead" instead of "lookahead", to be consistent.
5864 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5865 while we're fixing "look-ahead".
5866 * src/conflicts.c (shift_set): Renamed from shiftset.
5867 (look_ahead_set): Renamed from lookaheadset.
5868 * src/print.c: Likewise.
5869 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5870 name for "lookahead".
5871 (report_types, usage): Likewise.
5872 * src/getargs.h (report_look_ahead_tokens): Renamed from
5873 report_lookaheads.
5874 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5875 compute_lookaheads.
5876 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5877 (look_ahead_tokens_print): Renamed from lookaheads_print.
5878 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5879 state_rule_lookaheads_print.
5880 * src/state.h: Likewise.
5881 (reductions.look_ahead_tokens): Renamed from lookaheads.
5882 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5883 AT_DATA_LOOKAHEADS_GRAMMAR.
5884
57a90331
PE
58852004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5886
5887 * README: Update location of patched M4 distribution.
5888
8ed3234a
PE
58892004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5890
5891 Don't assume the C++ compiler takes the same arguments as the C compiler
5892 (trivial change).
5893 * configure.ac (O0CXXFLAGS): New var.
5894 * tests/atlocal.in (CXXFLAGS): Use it.
5895
07971983
PE
58962004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5897
5898 Fix some "make check" problems with C++ reported by
5899 Albert Chin-A-Young for Tru64 C++ in this thread:
5900 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5901
5902 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5903 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5904 Output to a .cc file for C++, not to a .c file.
5905 * tests/calc.at (AT_CHECK_CALC): Likewise.
5906 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5907 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5908
29058652
PE
59092004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5910
5911 * tests/calc.at, tests/actions.at: Workaround for SGI
5912 C++ compiler. (trivial change)
5913
62cb8a99
PE
59142004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5915
fd418816
PE
5916 Spent a few hours checking out which prerequisite versions the
5917 current sources actually require. I went all the way back to
5918 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5919 a seemingly endless set of combinations of versions more recent
5920 than that. The bottom line is that the current sources require
5921 fairly recent versions of the build tools, and it'll be some work
5922 to change this.
5923 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5924 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5925 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5926 Add comments explaining why those particular versions are
5927 currently needed.
2fa09258 5928
62cb8a99
PE
5929 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5930 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 5931 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
5932
5933 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5934 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5935
caa52c10
PE
59362004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5937
5938 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5939 0.11.5. Suggested by Bruno Haible.
5940 * bootstrap: Remove gettext version checking.
5941
5942 * doc/bison.texinfo (Decl Summary): Also mention that %union
5943 can depend on prerequisite types. Problem reported by Tim
5944 Van Holder.
5945
4bfd5e4e
PE
59462004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5947
2cef3017
PE
5948 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5949 * README-alpha: Don't tell people not to package this.
5950
b9c85d5c
PE
5951 * bootstrap: Don't assume $(...) works; use `...` instead.
5952 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5953 gettext better.
5954
4bfd5e4e
PE
5955 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5956 put into the -d output file, and mention what to do if YYSTYPE is
5957 defined as a macro.
5958
6a36ff94
PE
59592004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5960
6712933e
PE
5961 Undo change made earlier today: it caused autopoint to not bring
5962 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5963 autopoint's.
5964
5965 * bootstrap: Check that gettext version matches what's in
5966 configure.ac. Warn users to ignore robots.txt ERROR 404.
5967 * bootstrap: Undo today's earlier change (logged below).
5968 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 5969
6a36ff94
PE
5970 The gettext version checking is causing more trouble than it's
5971 curing; remove it. Problem reported by Paul Hilfinger.
5972
5973 * bootstrap: Issue a warning that one can expect a message
5974 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5975 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5976
209ea708
PE
59772004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5978
5979 Ensure that the C++ compiler used for testing actually works on a
5980 simple test program; if not, skip the C++-related tests. Problem
5981 reported by Vin Shelton in:
161a71f3 5982 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
5983
5984 * m4/cxx.m4: New file.
5985 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5986 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5987 * tests/local.at (AT_COMPILE_CXX): Use it.
5988
41ca2549
PE
59892004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5990
383e69dc
PE
5991 * data/glr.c (yylloc): Output this macro even if locations are not
5992 being generated, as the GLR parser needs it even in that case.
5993 Problem reported by Troy A. Johnson
5994 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5995
41ca2549
PE
5996 * configure.ac (AC_INIT): Update to 1.875e.
5997
e476c87d
PE
59982004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5999
6000 * NEWS: Version 1.875d.
6001 * configure.ac (AC_INIT): Likewise.
6002 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
6003
6004 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
6005 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
6006 lalr1.cc runs afoul of the first, and the last two are no longer
6007 supported by GCC 3.4.0.
6008 * README: Mention GNU m4 1.4 or later; mention m4 patches.
6009 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
6010
233a88ad
PE
60112004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6012
6013 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
6014 unsigned int, for compatibility with latest gnulib hash module.
6015 * src/state.c (state_hash, state_hasher): Likewise.
6016 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
6017 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 6018
12ffdd28
PE
60192004-05-03 Paul Eggert <eggert@cs.ucla.edu>
6020
6021 * NEWS: Unescaped newlines are no longer allowed in char & strings.
6022
6023 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
6024 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
6025 character and string literals.
6026 (unexpected_end): New function.
6027 (unexpected_eof): Use it.
6028 (unexpected_newline): New function.
6029 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
6030 actions.
e476c87d 6031
12ffdd28
PE
6032 * NEWS: Document %expect-rr.
6033
6034 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
6035 Fix typo by replacing $1 with $option.
6036 Remove more 'intl'-related files.
9668e2be 6037 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
6038
6039 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
6040 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
6041 strtoul.c.
6042 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
6043 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
6044 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
6045 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
6046 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
6047 * src/.cvsignore: Add *.output.
6048
6049 * src/parse-gram.y: Put copyright notice inside %{ %} so it
6050 gets copied to the output file.
e476c87d 6051
1f65350a
PE
60522004-04-28 Paul Eggert <eggert@twinsun.com>
6053
6054 Get files from the gnulib and po repositories, instead of relying
6055 on them being in our CVS. Upgrade to latest versions of gnulib
6056 and Automake.
6057
6058 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
6059 * bootstrap: Bootstrap from gnulib and po repositories.
6060 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
6061 * README-cvs: Document these changes. Remove version numbers from
6062 mentions of build tools, since they change so often. Mention Flex.
6063
6064 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
6065 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
6066 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
6067 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 6068 does this for us.
12ffdd28
PE
6069 (AC_ISC_POSIX): Remove; we no longer support this
6070 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
6071 (AC_HEADER_STDC): Remove: we now assume C89 or better.
6072 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
6073 Do not check for C89 headers, except for locale.h which is used
6074 by the Yacc library and must port to K&R hosts.
6075 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
6076 Do not check for C89 functions, except for setlocale which is
6077 used by the Yacc library.
6078 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
6079 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
6080 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
6081 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
6082 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
6083 AM_GNU_GETTEXT): Remove; now done by:
6084 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
6085 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
6086 for us.
6087
6088 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
6089 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
6090 Define to empty, as gnulib.mk will do the rest for us.
6091 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
6092 for us.
6093 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
6094 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
6095
6096 * src/files.c: Include gnulib's xstrndup.h.
6097
6098 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
6099 (REALLOC): Use xnrealloc, for likewise.
6100 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
6101 (strnlen, memrchr): Remove decls; functions no longer used.
6102 Include <stpcpy.h>.
6103
6104 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
6105 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6106 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
6107 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
6108 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
6109 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
6110 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
6111 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
6112 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
6113 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
6114 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
6115 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6116 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
6117 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
6118 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
6119 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
6120 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
6121 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
6122 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
6123 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
6124 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
6125 Remove, as these files are now generated automatically
6126 by bootstrap or automake.
6127
6128 * po/ChangeLog: Remove: all but one entry was a duplicate
6129 of this file, and I moved that 2000-11-02 entry here.
6130
6131 * config/.cvsignore: Add Makefile, depcomp, install-sh.
6132 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
6133 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
6134 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
6135 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6136 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6137 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6138 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6139 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6140 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6141 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6142 xstrndup.h.
6143 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6144 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6145 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6146 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6147 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6148 * src/.cvsignore: Remove *_.c.
6149
6150
6151 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6152 support it. (The latest stable gzip doesn't.)
6153
61542004-04-27 Paul Eggert <eggert@twinsun.com>
6155
6156 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6157 case, as stos_ is now used by destructors due to the 2004-02-09
6158 change.
6159
6160 Remove more K&R C support.
6161 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6162 * lib/subpipe.c (errno): Remove decl.
6163 Include <stdlib.h> unconditionally.
6164 (EXIT_FAILURE): Remove macro.
6165 * src/complain.c (vfprintf, strerror): Remove.
6166 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6167 unconditionally.
6168 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6169 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6170 (strchr, strspn, memchr): Remove decls.
6171 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6172 unconditionally. Do not declare perror.
6173 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6174 unconditionally.
6175
6176 * src/complain.c (_): Remove useless defn, as system.h defines this.
6177
6178 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6179 with latest obstack.h.
6180 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6181 to procedure types, as obstack.h now does that for us.
6182 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6183
6184 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6185 so that this include file can stand alone.
6186 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6187 does this now. Include subpipe.h first after config.h, to
6188 test whether it can stand alone.
6189
6190 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6191 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6192 unused declaration.
6193
6194 * tests/synclines.at (%union synch line): Put a dummy member in
6195 the union, because empty unions aren't allowed in C. Caught
6196 by GCC 3.4.0.
6197
4f16766c
PE
61982004-04-13 Jim Meyering <jim@meyering.net>
6199
6200 * src/conflicts.c (conflicts_print): Correct format string typo:
6201 use `%%' to produce literal `%'. (trivial change)
6202
779e7ceb
PE
62032004-03-30 Paul Eggert <eggert@twinsun.com>
6204
6205 * src/getargs.c (version): Update copyright year to 2004.
6206
6207 * data/c.m4 (b4_int_type): Use 'short int' rather than
6208 'short', and similarly for 'long', 'unsigned', etc.
6209 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6210 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6211 yy_yypstack, yydumpstack): Likewise.
6212 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6213 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6214 Likewise.
6215 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6216 yy_stack_print, yyparse): Likewise.
6217 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6218 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6219 * lib/bitset.c (bitset_print): Likewise.
6220 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6221 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6222 * lib/bitsetv.c (bitsetv_dump): Likewise.
6223 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6224 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6225 Likewise.
6226 * src/LR0.c (allocate_itemsets): Likewise.
6227 * src/gram.h (rule_number, rule): Likewise.
6228 * src/lalr.h (goto_number): Likewise.
6229 * src/nullable.c (nullable_compute): Likewise.
6230 * src/output.c (prepare_rules): Likewise.
6231 * src/relation.c (relation_print, relation_digraph): Likewise.
6232 * src/relation.h (relation_node): Likewise.
6233 * src/state.h (state_number, transitions, errs, reductions,
6234 struct state): Likewise.
6235 * src/symtab.h (symbol_number, struct symbol): Likewise.
6236 * src/tables.c (vector_number, tally, action_number,
6237 default_goto, goto_actions): Likewise.
6238 * tests/existing.at (GNU Cim Grammar): Likewise.
6239 * tests/regression.at (Web2c Actions): Likewise.
6240
6241 * src/output.c (muscle_insert_short_int_table): Renamed from
6242 muscle_insert_short_table. All uses changed.
6243
d6328241
PH
62442004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6245
6246 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6247 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6248 Add %expect-rr rule.
4f16766c 6249
d6328241
PH
6250 * src/scan-gram.l: Recognize %expect-rr.
6251
4f16766c 6252 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 6253 expected_conflicts.
4f16766c 6254 (expected_rr_conflicts): Declare.
d6328241
PH
6255
6256 * src/conflicts.c (expected_sr_conflicts): Rename from
6257 expected_conflicts.
6258 (expected_rr_conflicts): Define.
6259 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6260 for GLR parsers.
6261 Use expected_sr_conflicts in place of expected_conflicts.
6262 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 6263
d6328241 6264 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 6265
1452af69
PE
62662004-03-08 Paul Eggert <eggert@gnu.org>
6267
6268 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 6269 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
6270
6271 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6272 in lalr1.cc.
6273 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6274 * src/scan-gram.l (scan_integer): New function.
6275 ({int}): Use it.
6276 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6277 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6278 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6279 Say "long int", not "long", for uniformity with GNU style.
6280
006d217d
PE
62812004-02-25 Paul Eggert <eggert@twinsun.com>
6282
6283 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6284 compilers. This fixes a problem with Intel's C++ compiler being
6285 chatty, reported by Guido Trentalancia in
161a71f3 6286 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 6287
c2729758
ADL
62882004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6289
6290 Support %destructor and merge error locations in lalr1.cc.
6291
6292 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6293 (Parser::stos_): Define unconditionally.
6294 (Parser::destruct_): New method. Generate its body with
6295 b4_yydestruct_generate.
6296 (Parser::error_start_): New attribute.
6297 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6298 token which are discarded.
6299 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6300 error_start_ when erroneous token are discarded.
6301 (Parser::parse) <yyerrlab1>: Compute the location of the error
6302 token so that it covers all the discarded tokens.
6303 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6304 it can be called with `%skeleton "lalr1.cc"', and do that.
6305
dd0e0635
PE
63062004-02-02 Paul Eggert <eggert@twinsun.com>
6307
6308 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6309 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6310 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6311 There's no need to mention top_builddir since Automake does that
6312 for us.
6313 (INCLUDES): Remove, as Automake says it's obsolescent.
6314 Contents migrated into AM_CPPFLAGS as described above.
6315 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6316
63172004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6318
6319 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6320 (yyreportSyntaxError): Handle case where lookahead token is
6321 YYEMPTY.
6322
be16239b
PH
63232004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6324
6325 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6326 resulting parsers are compilable with C++.
6327
5fa90832
PE
63282003-12-23 Paul Eggert <eggert@twinsun.com>
6329
6330 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6331 * src/output.c (output_skeleton): Rename local var.
6332 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6333 Bison tokens, as this runs afoul of the 2003-10-07 change that
6334 disallowed NUL bytes in character constants or string literals.
6335
6336 * tests/local.at: Require Autoconf 2.59's Autotest.
6337 * tests/testsuite.at: Don't include local.at, since we now assume
6338 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6339 including it.
6340 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6341 multiple inclusion warnings.
dd0e0635 6342
b165c324
AD
63432003-12-02 Akim Demaille <akim@epita.fr>
6344
6345 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6346 conditions.
6347 From Bruno Haible.
6348
26e06a21
ADL
63492003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6350
6351 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6352
92ac3705
PE
63532003-10-07 Paul Eggert <eggert@twinsun.com>
6354
6a5ecb38
PE
6355 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6356 if testsuite doesn't exist.
6357
92ac3705
PE
6358 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6359 literals, unfortunately.
6360 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6361 Complain about NUL bytes in character constants or string literals.
6362
91d2c560
PE
63632003-10-05 Paul Eggert <eggert@twinsun.com>
6364
6365 * NEWS: Don't document %no-default-prec, as it's still
6366 too experimental.
6367 * doc/bison.texinfo: Document %no-default-prec only if
6368 the defaultprec flag is set. Normally it's not.
6369
0cc3da3a
PE
63702003-10-04 Paul Eggert <eggert@twinsun.com>
6371
6372 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6373 non-modifiable lvalue, instead of a modifiable one.
6374 * doc/bison.texinfo (Actions): Document that $$ can
6375 be assigned to. Do not claim that $$ and $N are
6376 array element references: user code should not rely on this.
6377
22fccf95
PE
63782003-10-01 Paul Eggert <eggert@twinsun.com>
6379
6380 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6381 (grammar_declaration): Use it.
6382 * src/scan-gram.l: New token %no-default-prec.
6383 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6384 * NEWS, doc/bison.texinfo: Document the above.
6385
fc8f2965
AD
63862003-10-01 Akim Demaille <akim@epita.fr>
6387
6388 VCG no longer supports long_straight_phase.
6389
6390 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6391 * src/print_graph.c (print_graph): Adjust.
6392
39a06c25
PE
63932003-09-30 Frank Heckenbach <frank@g-n-u.de>
6394 and Paul Eggert <eggert@twinsun.com>
6395
6396 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6397 Table of Symbols): Document %default-prec.
6398 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6399 (grammar_declaration): Set default_prec on %default-prec.
6400 * src/scan-gram.l (%default-prec): New token.
6401 * src/reader.h (default_prec): New flag.
6402 * src/reader.c: Likewise.
6403 (packgram): Handle it.
6404 * tests/conflicts.at (%default-prec without %prec,
6405 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 6406
39a06c25
PE
64072003-09-30 Paul Eggert <eggert@twinsun.com>
6408
6409 * tests/testsuite.at: Include local.at, not input.at, fixing
6410 a typo in the 2003-08-25 patch.
6411
62b6aef9
AD
64122003-08-27 Akim Demaille <akim@epita.fr>
6413
6414 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6415 GCC warnings.
6416
89e1cc61
AD
64172003-08-26 Akim Demaille <akim@epita.fr>
6418
6419 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6420 "<\#" to avoid magic from Gnus when posting parts of this script.
6421
a08460b0
AD
64222003-08-26 Akim Demaille <akim@epita.fr>
6423
6424 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6425 (Parser::parse): here.
6426 Adjust: nerrs and errstatus is now replaced by...
6427 (Parser::nerrs_, Parser::errstatus_): New.
6428
603f1cfd
AD
64292003-08-25 Akim Demaille <akim@epita.fr>
6430
6431 * config/announce-gen, Makefile.cfg: New.
6432 * Makefile.am: Adjust.
6433 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6434 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6435
cd3684cf
AD
64362003-08-25 Akim Demaille <akim@epita.fr>
6437
6438 When reducing initial empty rules, Bison parser read an initial
6439 location that is not defined. This results in garbage, and that
6440 affects Bison's own parser. Therefore we need (i) to extend Bison
6441 to support a means to initialize this location, and (ii) to use
6442 this CVS Bison to fix CVS Bison's parser.
6443
6444 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6445 with...
6446 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6447 * src/parse-gram.y: Adjust.
6448 (%initial-action): New.
6449 (%error-verbose): Since we require CVS Bison, there is no reason
6450 not to use it.
6451 * src/scan-gram.l: Adjust.
6452 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6453 * data/yacc.c (yyparse): Use b4_initial_action.
6454
4e03e201
AD
64552003-08-25 Akim Demaille <akim@epita.fr>
6456
6457 * doc/bison.texinfo: Don't promote stdout for error messages.
6458
8c182d05
AD
64592003-08-25 Akim Demaille <akim@epita.fr>
6460
6461 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6462 From Alexandre Duret-Lutz.
6463
6a60c4cf
PE
64642003-08-25 Akim Demaille <akim@epita.fr>
6465
6466 Version 1.875c.
6467
25f66e1a
AD
64682003-08-25 Akim Demaille <akim@epita.fr>
6469
6470 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6471 Use them.
6472
5348bfbe
AD
64732003-08-25 Akim Demaille <akim@epita.fr>
6474
6475 * data/lalr1.cc (Parser::reduce_print_): New.
6476 Use it.
6477
47301314
AD
64782003-08-25 Akim Demaille <akim@epita.fr>
6479
6480 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6481 error recovery loops. This patch is based on
161a71f3 6482 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
6483 Also, augment the similarity between lalr1.cc and yacc.c.
6484 Note: the locations of error recovery rules are not correct yet.
6485
6486 * data/lalr1.cc: Comment changes to augment the similarity between
6487 lalr1.cc and yacc.c.
6488 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6489 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6490 yyerrlab), when hitting EOF, pop the whole stack here instead of
6491 merely falling thru the default error handling mechanism.
6492 (yyerrorlab): New label, with the old contents of YYERROR,
6493 plus the following change: pop the stack of rhs corresponding
6494 to the production that invoked YYERROR. That is how Yacc
6495 behaves (required by POSIX).
6496 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6497 fail.
6498
1f7a61ff
AD
64992003-08-25 Akim Demaille <akim@epita.fr>
6500
6501 Tune local.at so that people can "autom4te -l autotest calc.at -o
6502 calc" for instance, to extract a sub test suite.
6503
6504 * tests/testsuite.at: Move the initialization, Autotest version
6505 requirement, and AT_TESTED invocation into...
6506 * tests/local.at: here.
6507 * tests/testsuite.at: Include it for compatibility with Autoconf
6508 2.57.
6509 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6510 be ignore.
6511
327b5b56
PE
65122003-08-04 Paul Eggert <eggert@twinsun.com>
6513
6514 Rework code slightly to avoid gcc -Wtraditional warnings.
6515 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6516 The returned value is now stored in *YY0. All callers changed.
6517 * src/output.c (merge_output): Adjust to the above change.
6518
0051e3ed
PE
65192003-07-26 Paul Eggert <eggert@twinsun.com>
6520
6521 * data/glr.c (YYASSERT): New macro.
6522 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6523 yyresolveStates, yyprocessOneStack):
6524 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6525 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 6526
137437c6
PE
65272003-07-25 Paul Eggert <eggert@twinsun.com>
6528
5b620e06
PE
6529 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6530 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 6531 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
6532 by Frank Heckenbach, though I have omitted the structure-initialization
6533 part of his glr-knr.diff patch since I recall that the Portable
6534 C Compiler didn't require that change.
6535
137437c6
PE
6536 Let the user specify how to allocate and free memory.
6537 Derived from a suggestion by Frank Heckenbach in
161a71f3 6538 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
6539 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6540 All uses of free, malloc, realloc changed to use these macros,
6541 and unnecessary casts removed.
6542 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6543
ddb85ca5
PE
65442003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6545
6546 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6547 use s.empty() rather than s == "" to test for empty string; see
161a71f3 6548 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
6549 (trivial change)
6550
39910e09
AD
65512003-06-25 Akim Demaille <akim@epita.fr>
6552
6553 * config/depcomp, config/install-sh: Update from masters.
6554
0ae99356
PE
65552003-06-20 Paul Eggert <eggert@twinsun.com>
6556
6557 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6558 and return properly parenthesized result.
6559 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6560 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6561 Remove unnecessary parentheses from uses.
6562 * doc/bison.texinfo (Location Default Action): Describe the
6563 conventions for parentheses.
6564
cd05d13c
PE
65652003-06-19 Paul Eggert <eggert@twinsun.com>
6566
81fd08ca
PE
6567 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6568 yyreportTree): Do not assume that size_t is the same width as int,
6569 when printing sizes. Print sizes using an unsigned format.
6570 Problem reported by Frank Heckenbach in
161a71f3 6571 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 6572
cd05d13c
PE
6573 Port to Forte Developer 7 C compiler.
6574 * data/glr.c (struct YYLTYPE): If locations are not being used,
6575 declare a single dummy member, as empty structs do not conform
6576 to the C standard.
6577 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6578 the Forte Developer 7 C compiler complains that end-of-loop
6579 code is not reached.
6580
4dcf140b
PE
65812003-06-17 Paul Eggert <eggert@twinsun.com>
6582
6583 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6584 avoid warnings from picky compilers about redefinition of PARAMS.
6585
8dd76bee
PE
65862003-06-17 Paul Eggert <eggert@twinsun.com>
6587
6588 Version 1.875b.
6589
6590 * NEWS: Document 1.875b.
6591
6592 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6593 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6594 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6595 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6596 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6597 per recent gettext manual's suggestion.
6598 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6599 Use prototypes, not old-style definitions.
6600 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6601 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6602 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6603 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6604 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6605 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6606 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6607 vbitset_or_and_cmp, vbitset_copy): Likewise.
6608
6609 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6610 Do not include <stdlib.h>.
6611 (PARAMS): Define unconditionally for C89.
6612 (ATTRIBUTE_NORETURN): Remove.
6613 (ATTRIBUTE_UNUSED): Define unconditionally.
6614
6615 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 6616 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
6617 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6618 * lib/vbitset.c, lib/vbitset.h: New files.
6619 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6620 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6621 from libbitset.
6622
6623 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6624 `How Can I Reset @code{yyparse}', since texinfo does not allow
6625 arbitrary @ in node names.
6626
6627 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6628 shouldn't be needed according to the gettext 0.12.1 documentation
6629 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 6630 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 6631 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 6632 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 6633
8dd76bee
PE
6634 * lib/.cvsignore: Add stdbool.h.
6635 * m4/.cvsignore: Add nls.m4, po.m4.
6636
6637 Upgrade to CVS gnulib.
6638 * stdbool_.h: File renamed from stdbool.h.in.
6639 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6640 AC_HEADER_STDBOOL.
6641 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6642 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6643 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6644 (MOSTLYCLEANFILES): New var.
6645 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6646 (stdbool.h): New rule.
6647 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6648 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6649 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6650 m4/quote.m4: Upgrade to today's gnulib.
6651
6652 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6653 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6654 the tests right now.
6655 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6656 yyerror are declared before use; C99 requires this.
6657
25005f6a
PH
66582003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6659
6660 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6661 first.
6662 (yyrecoverSyntaxError): Correct the logic for setting and testing
6663 yyerrState.
6664 Correct comment on handling EOF.
6665 Allow states with only a default reduction, rather than failing
8dd76bee 6666 (I can't quite reconstruct why these were not allowed before).
25005f6a 6667
137437c6 6668 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 6669 buffer overruns, corrupting state.
8dd76bee
PE
6670
6671 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
6672 definition.
6673 * src/reader.h (max_left_semantic_context): New variable declaration.
6674 * src/scan-gram.l (max_left_semantic_context): Define.
6675 (handle_action_dollar): Update max_left_semantic_context.
6676 * data/glr.c (YYMAXLEFT): New definition.
6677 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6678 (yyresolveAction): Ditto.
6679
6680 Fixes to problems with location handling in GLR parsers reported by
6681 Frank Heckenbach (2003/06/05).
6682
6683 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6684 (YYRHSLOC): Add parentheses, and define only if locations used.
6685 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6686 locations not used.
6687 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6688 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 6689
25005f6a
PH
6690 * tests/cxx-type.at: Exercise location information; update tests
6691 to differentiate output with and without locations.
8dd76bee 6692 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
6693 because default YYLTYPE not yet defined.
6694 Change semantic actions to compute strings, rather than printing
6695 them directly (to test proper passing of semantics values). Change
6696 output to prefix notation and update test data and expected results.
6697 (yylex): Track locations.
6698 (stmtMerge): Return value rather than printing, and include arguments
6699 in value.
8dd76bee 6700
711f40b7
PE
67012003-06-03 Paul Eggert <eggert@twinsun.com>
6702
6703 Avoid warnings generated by GCC 2.95.4 when Bison is
6704 configured with --enable-gcc-warnings.
6705 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6706 yy::]b4_parser_class_name[::translate_,
6707 yy::Stack::operator[] (unsigned),
6708 yy::Stack::operator[] (unsigned) const,
6709 yy::Slice::operator[] (unsigned),
6710 yy::Slice::operator[] (unsigned) const):
6711 Rename local vars to avoid warnings.
6712 * tests/glr-regression.at (Improper handling of embedded actions
6713 and $-N in GLR parsers): Remove unused local variable from yylex.
6714 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6715 (void) as arg when not pure, since we now assume C89 when building
6716 Bison. Pacify GCC by using parameter.
6717
ac695f7d
PE
67182003-06-02 Paul Eggert <eggert@twinsun.com>
6719
6720 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
6721 yy::Location::lines, yy::Location::columns): Rename arguments
6722 to avoid shadowing; this removes a warning generated by GCC 3.3.
6723
26ec81e0
PE
67242003-06-01 Paul Eggert <eggert@twinsun.com>
6725
6726 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
6727 to g++, as GCC 3.3 complains if you do it.
6728 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
6729 everything that WARNING_CFLAGS has, except omit warnings
6730 not suitable for C++.
6731 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
6732 * tests/atlocal.in (CXXFLAGS): New var.
6733 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
6734
6735 Fix a GLR parser bug I reported in February; see
161a71f3 6736 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
6737 The problem was that GLR parsers did not conform to the C standard,
6738 because actions like { $1 = $2 + $3; } expanded to expressions
6739 that invoked YYFILL in separate subexpressions, and YYFILL assigned
6740 to a local variable. The C standard says that expressions
6741 like (var = f ()) + (var = f ()) have undefined behavior.
6742 Another problem was that GCC sometimes issues warnings that
6743 yyfill and its parameters are unused.
6744
6745 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6746 as possibly unused.
6747 (yyfill): New function.
6748 (YYFILL): Use it.
6749 (yyuserAction): Change type of yynormal to bool, so that it matches
6750 the new yyfill signature. Mark it as possibly unused.
6751
6752
6753 Follow up on a bug I reported in February, where a Bison-generated
6754 parser can loop. Provide a test case and a fix for yacc.c. I
6755 don't have a fix for lalr1.cc or for glr.c, unfortunately.
6756 The original bug report is in:
161a71f3 6757 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
6758
6759 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
6760 macro's size was becoming unwieldy.
6761 (yyerrlab): Do not discard an empty lookahead symbol, as this
6762 might destroy garbage.
6763 (yyerrorlab): New label, with the old contents of YYERROR,
6764 plus the following change: pop the stack of rhs corresponding
6765 to the production that invoked YYERROR. That is how Yacc
6766 behaves, and POSIX requires this behavior.
6767 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
6768 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
6769 Define 'alarm' to do nothing if unistd.h is not available.
6770 Add a new rule "exp: '-' error;" to test the above change to
6771 data/yacc.c. Use 'alarm' to abort any test taking longer than
6772 10 seconds, as it's probably looping.
6773 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
6774 Also, the new yacc.c generates two fewer diagnostics for an
6775 existing test.
6776
d0829076
PE
67772003-05-24 Paul Eggert <eggert@twinsun.com>
6778
c6ae27df
PE
6779 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
6780 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
6781 This fixes a problem reported by John Bowman when the Compaq/HP
6782 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
6783 -ansi -Wall -gall).
6784 * data/yacc.c (union yyalloc): Likewise.
6785 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 6786
d0829076
PE
6787 Switch from 'int' to 'bool' where that makes sense.
6788
6789 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
6790 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
6791 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
6792 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
6793 Return or accept bool, not int. All callers changed.
6794 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
6795 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
6796 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
6797 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
6798 bitset_or_and_cmp_): Likewise.
6799 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
6800 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
6801 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
6802 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
6803 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
6804 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
6805 bitset_stats_or_and_cmp): Likewise.
6806 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
6807 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
6808 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
6809 ebitset_xor_cmp): Likewise.
6810 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
6811 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
6812 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
6813 lbitset_xor_cmp): Likewise.
6814 * lib/bbitset.h: Include <stdbool.h>.
6815 (struct bitset_vtable): The following members now return bool, not
6816 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
6817 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
6818 or_and_cmp).
6819 * src/conflicts.c (count_rr_conflicts): Likewise.
6820 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6821 All uses changed.
6822 * lib/ebitset.c (ebitset_obstack_init): Likewise.
6823 * lib/lbitset.c (lbitset_obstack_init): Likewise.
6824 * src/getargs.c (debug_flag, defines_flag, locations_flag,
6825 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6826 graph_flag): Likewise.
6827 * src/getargs.h (debug_flag, defines_flag, locations_flag,
6828 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6829 graph_flag): Likewise.
6830 * src/output.c (error_verbose): Likewise.
6831 * src/output.h (error_verbose): Likewise.
6832 * src/reader.c (start_flag, typed): Likewise.
6833 * src/reader.h (typed): Likewise.
6834 * src/getargs.c (LOCATIONS_OPTION): New constant.
6835 (long_options, getargs): Use it.
6836 * src/lalr.c (build_relations): Use bool, not int.
6837 * src/nullable.c (nullable_compute): Likewise.
6838 * src/print.c (print_reductions): Likewise.
6839 * src/tables.c (action_row, pack_vector): Likewise.
6840 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6841 * src/output.c (prepare): Use it.
6842 * src/output.c (token_definitions_output,
6843 symbol_destructors_output, symbol_destructors_output): Use string,
6844 not boolean integer, to keep track of whether to output separator.
6845 * src/print_graph.c (print_core): Likewise.
6846 * src/state.c (state_rule_lookaheads_print): Likewise.
6847
6848 * config/install-sh: Sync from automake 1.7.5.
6849
6b2584b7
PE
68502003-05-14 Paul Eggert <eggert@twinsun.com>
6851
6852 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6853 semicolon after a grammar declaration, in the interest of possible
6854 future changes to the Bison input language.
6855 Do not allow a stray semicolon at the start of the grammar.
6856 (rhses.1): Allow one or more semicolons after any rule, including
6857 just before "|" as required by POSIX.
6858 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6859 grammar.
6860
caf37a36
ADL
68612003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6862
6863 %parse-param support for lalr1.cc.
6864
6865 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6866 b4_cc_constructor_calls, b4_cc_constructor_call,
6867 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6868 definitions.
6869 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6870 parse-param arguments.
6871 (yy::b4_parser_class_name): Declare instance variables to
6872 hold parse-param arguments.
6873 * tests/calc.at: s/value/semantic_value/ because value clashes
6874 with a member of yy::b4_parser_class_name. Adjust C++ code
6875 to handle %parse-param. Enable %parse-param test in C++.
6876
3ab37077
PE
68772003-05-12 Paul Eggert <eggert@twinsun.com>
6878
6879 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6880 English a bit. Fix fclose typo. Change "const char" to "char
6881 const", and use ANSI C rather than K&R for "main". Suggest
6882 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6883 and suggest yy_switch_to_buffer.
6884
68852003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
6886
6887 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6888 C89. This avoids a diagnostic on compilers that define __STDC__
6889 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 6890 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 6891
e743727f
PE
68922003-05-03 Paul Eggert <eggert@twinsun.com>
6893
6894 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6895 Do not overrun array bounds.
6896 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 6897 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 6898
916708d5
AD
68992003-04-29 Akim Demaille <akim@epita.fr>
6900
6901 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6902 * src/getargs.c, src/getargs.h: here, as bool, not int.
6903 (nondeterministic_parser): New.
6904 * src/parse-gram.y, src/scan-gram.l: Support
6905 %nondeterministic-parser.
6906 * src/output.c (prepare): Use nondeterministic_parser instead
6907 of glr_parser where appropriate.
6908 * src/tables.c (conflict_row, action_row, save_row)
6909 (token_actions, token_actions, pack_vector): Ditto.
6910
a06ea4aa
AD
69112003-04-29 Akim Demaille <akim@epita.fr>
6912
6913 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6914
211074ca
AD
69152003-04-29 Akim Demaille <akim@epita.fr>
6916
6917 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6918 with %pure-parser and %locations to exercise the patch from Yakov
6919 Markovitch below.
6920
6175ffe3
PE
69212003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6922
6923 * data/yacc.c: (b4_lex_param): Corrected for the case where
6924 %lex-param is provided and %pure-parser isn't.
6925
b1e95857
PE
69262003-04-27 Paul Eggert <eggert@twinsun.com>
6927
6928 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 6929 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
6930 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6931 if it is not defined.
6932 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6933
acda9df6
PE
69342003-04-26 Paul Eggert <eggert@twinsun.com>
6935
3470c57b
PE
6936 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6937 Declare to be of type suitable for the ninf value itself, not of
6938 type suitable for the corresponding table, since the latter might
6939 be unsigned but the ninf value might be negative. This fixes a
6940 bug reported by Alexandre Duret-Lutz in
161a71f3 6941 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 6942
acda9df6
PE
6943 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6944 invokes it. We shouldn't invoke it twice because it will attempt
6945 to put error.o in the archive twice. This fixes a glitch reported
6946 by Martin Mokrejs in
161a71f3 6947 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 6948
b5250f26
PE
69492003-04-21 Paul Eggert <eggert@twinsun.com>
6950
6951 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6952 to gnulib.
6953
089ac0f1
PE
69542003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6955
6956 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6957 Fix obvious typo that results in uncompilable GLR parsers
6958 when both %pure-parser and %locations are used. (trivial change)
6959
5ededac6
PE
69602003-04-17 Paul Eggert <eggert@twinsun.com>
6961
1b8f2fff
PE
6962 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6963 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6964 Do not insert the expected token via unput, as this runs afoul
6965 of a POSIX-compatibility bug in flex 2.5.31.
6966 All uses changed to BEGIN the parent state,
6967 since we no longer insert the expected token via unput.
6968 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6969 that is no longer emitted after the above change.
6970
5ededac6
PE
6971 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6972 the first one. This change is from Paul Hilfinger, and it fixes
6973 regression reported by Werner Lemberg in
161a71f3 6974 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
6975
6976 (resolve_sr_conflict): Don't invoke state_errs_set
6977 unless one or more tokens have been explicitly made errors.
6978 Otherwise, the above change causes Bison to abort.
6979
6980 * tests/existing.at (GNU pic Grammar): New test case, taken from
6981 Lemberg's email.
6982
b8be9132
AD
69832003-03-31 Akim Demaille <akim@epita.fr>
6984
6985 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6986
d423d460
AD
69872003-03-31 Akim Demaille <akim@epita.fr>
6988
6989 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6990 output.
6991
c7e441b4
AD
69922003-03-31 Akim Demaille <akim@epita.fr>
6993
6994 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6995 From Paul Hilfinger.
6996
231897ad
AD
69972003-03-29 Akim Demaille <akim@epita.fr>
6998
6999 * m4/error.m4: Do not put under dynamic conditions some code which
7000 expansion is under static control.
7001
5b066063
AD
70022003-03-29 Akim Demaille <akim@epita.fr>
7003
7004 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
7005
22a74fec
AD
70062003-03-29 Akim Demaille <akim@epita.fr>
7007
7008 * doc/bison.texinfo (Strings are Destroyed): New.
7009
0eee27e7
PE
70102003-03-13 Paul Eggert <eggert@twinsun.com>
7011
7012 * .cvsignore: Add configure.lineno.
7013 * src/.cvsignore: Add yacc.
7014 * tests/.cvsignore: Add testsuite.log.
7015 * doc/fdl.texi: Sync with latest FSF version.
7016
f61aad93
PE
70172003-03-12 Paul Eggert <eggert@twinsun.com>
7018
537636c7
PE
7019 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
7020 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
7021 cursor, instead of leaving it undefined. This fixes a bug
7022 reported by Tim Van Holder in
161a71f3 7023 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
7024 * tests/input.at (Torturing the Scanner): Test the scanner on
7025 an empty input file, which was Tim Van Holder's test case.
7026
7027 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
7028 <sys/resource.h> can be included, include sys/time.h and
7029 sys/times.h first, if available. This works around the SunOS
7030 4.1.4 porting bug reported by Bruce Becker in
161a71f3 7031 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
7032
7033 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
7034 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
7035 AC_HEADER_SYS_WAIT.
7036
f61aad93
PE
7037 Merge changes from gnulib. This was prompted because the CVS
7038 snapshot didn't build on Solaris 7 due to strnlen problems.
7039
7040 These changes need to be merged back into gnulib:
7041 * lib/hash.c: Include <stdbool.h> unconditionally.
7042 * m4/onceonly.m4 (m4_quote): New macro.
7043 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
7044 Quote AC_FOREACH variable-expansions properly.
7045 The 2003-01-03 obstack.h change also needs merging.
7046 {end of changes requiring merging}
5b066063 7047
f61aad93
PE
7048 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7049 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
7050 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
7051 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
7052 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
7053 New files, imported from gnulib.
7054 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
7055 above.
7056
7057 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
7058 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
7059 gnulib sources.
7060
7061 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
7062 Add.
7063 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
7064 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
7065 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
7066 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
7067 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
7068 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
7069 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
7070 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
7071 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
7072 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
7073 (jm_PREREQ_ARGMATCH): Remove.
7074 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
7075 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
7076
7077 * src/system.h: Include <stdbool.h> unconditionally.
7078
7079 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
7080 assuming at least C89 in the bitset code for some time now.
7081
d2ffe116
AD
70822003-03-03 Akim Demaille <akim@epita.fr>
7083
7084 * ro.po: New.
7085
052826fd
AD
70862003-03-02 Akim Demaille <akim@epita.fr>
7087
7088 * doc/bison.texinfo (Table of Symbols): Reactivate the
7089 documentation for %lex-param, and %parse-param.
7090
c4749565
AD
70912003-03-02 Akim Demaille <akim@epita.fr>
7092
7093 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
7094 generate verbose error messages.
7095 Use the number of tokens as an upper bound in yytname, as it
7096 cannot be a non terminal.
7097
d5286af1
AD
70982003-03-02 Akim Demaille <akim@epita.fr>
7099
7100 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
7101 message.
7102
22e304a6
AD
71032003-03-02 Akim Demaille <akim@epita.fr>
7104
22e304a6
AD
7105 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
7106 Use them to exercise yycheck overrun.
7107 Based on Andrew Suffield's grammar.
7108
67a25fed
AD
71092003-03-02 Akim Demaille <akim@epita.fr>
7110
7111 Create tests/local.at for Bison generic testing macros.
7112
7113 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
7114 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
7115 This new file.
7116 * tests/calc.at (AT_CHECK_CALC): Adjust.
7117 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
7118 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
7119 * tests/local.at: here.
7120 (AT_COMPILE_CXX): Tags the tests using it as c++.
7121 Ignore the test if CXX is not functional.
7122
9c2b381f
PE
71232003-03-01 Paul Eggert <eggert@twinsun.com>
7124
7125 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
7126 not loc->end, since loc->end might contain garbage and this leads
7127 to undefined behavior on some platforms.
7128 (id_loc, token_start): Use (IF_LINTed) initial values that do not
7129 depend on *loc, so that the reader doesn't give the the false
7130 impression that *loc is initialized.
7131 (<INITIAL>"%%"): Do not bother setting code_start, since its value
7132 does not survive the return.
7133
0433ba88
AD
71342003-03-01 Akim Demaille <akim@epita.fr>
7135
7136 * src/scan-gram.l (code_start): Always initialize it when entering
7137 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7138 yylex invocation. An alternative would be making it static, but
7139 then it starts with the second %%'s beginning, instead of its end.
7140
b305ea69
PE
71412003-02-28 Paul Eggert <eggert@twinsun.com>
7142
7143 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7144 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 7145 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 7146
c3d25e01
PE
71472003-02-26 Paul Eggert <eggert@twinsun.com>
7148
7149 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7150 Remove Sequent/Pyramid discussion (nobody uses them any more).
7151 Merge VMS and MS-DOS discussion; these ports may well be dead
7152 but let's keep mentioning them for now. Put <> around email
7153 addresses. Add copyright notice.
7154
c267ffbc
PE
71552003-02-24 Paul Eggert <eggert@twinsun.com>
7156
7157 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7158 to avoid collision with flex use of yylineno.
7159 Problem reported by Bruce Lilly in
161a71f3 7160 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
7161 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7162 * data/yacc.c (yy_reduce_print): Likewise.
7163
7164 * config/depcomp: Sync with Automake 1.7.3.
7165
f939fc12
AD
71662003-02-21 Akim Demaille <akim@epita.fr>
7167
7168 * data/lalr1.cc: Use temporary variables instead of casts to
7169 change integer types.
7170 Suggested by Paul Eggert.
7171
95923bd6
AD
71722003-02-21 Akim Demaille <akim@epita.fr>
7173
7174 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7175 to avoid confusions with lalr1.cc's notion of Position.
7176 Suggested by Paul Eggert.
7177
2cdc240e
AD
71782003-02-20 Akim Demaille <akim@epita.fr>
7179
7180 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7181 before initial_columns.
7182 (location.hh): Use consistent variable names when defining the
7183 operator<<.
7184 Use "last" so that we subtract from Positions, not from unsigned.
7185
5d003116
AD
71862003-02-20 Akim Demaille <akim@epita.fr>
7187
7188 * data/lalr1.cc (position.hh): New subfile, including the extended
7189 and Doxygen'ed documentation of class Position.
7190 (location.hh): Use it.
7191 Document a` la Doxygen.
ba1ecc07 7192 With the help of Benoit Perrot.
5d003116 7193
d02b25f9
AD
71942003-02-20 Akim Demaille <akim@epita.fr>
7195
7196 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7197 AT_YACC_IF.
7198 Redefine AT_YYERROR_SEES_LOC_IF using it.
7199 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7200 not defined.
7201 Don't use the location in yy::Parser::error_ and
7202 yy::Parser::print_ when not %locations.
7203 Activate more lalr1.cc tests.
7204
0d1c3a04
AD
72052003-02-19 Akim Demaille <akim@epita.fr>
7206
7207 * data/lalr1.cc: When displaying a line number, be sure to make it
7208 an int.
7209
60a777aa
AD
72102003-02-19 Akim Demaille <akim@epita.fr>
7211
7212 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7213 Remove, useless.
7214 (YYABORT, YYACCEPT, YYERROR): New.
7215 * tests/calc.at: Renable the lalr1.cc test.
7216
0b86fc41
AD
72172003-02-19 Akim Demaille <akim@epita.fr>
7218
7219 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7220 error recovery, mixing with/without pops and discarding of the
7221 lookahead.
7222 Exercise YYERROR.
7223 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7224
da99a5dc
PE
72252003-02-17 Paul Eggert <eggert@twinsun.com>
7226
7227 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7228 * tests/testsuite.at (AT_COMPILE): Use them.
7229 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 7230 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 7231
93b8c255
PE
72322003-02-12 Paul Eggert <eggert@twinsun.com>
7233
7234 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7235 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 7236 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
7237 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7238 Check for malloc failure, for consistency with yacc.c.
7239 (yytname_size): Remove, for consistency with yacc.c.
7240
7241 The bug still remains in data/lalr1.cc, as I didn't have time
7242 to fix it there.
7243
7548fed2
AD
72442003-02-06 Akim Demaille <akim@epita.fr>
7245
7246 * configure.ac (GXX): Rename as...
7247 (CXX): this, to keep the original Autoconf semantics.
7248 Require 2.57.
7249 * data/lalr1.cc: Fix b4_copyright invocations.
7250 If YYDEBUG is not defined, don't depend upon name_ being defined.
7251 (location.hh): Include string and iostream.
7252 (Position::filename): New member.
7253 (Position::Position ()): New.
7254 (operator<< (Position)): New.
7255 (operator- (Position, int)): New.
7256 (Location::first, Location::last): Rename as...
7257 (Location::begin, Location::end): these, to mock the conventional
7258 iterator names.
7259 (operator<< (Location)): New.
7260 * tests/atlocal.in (CXX): New.
7261 * tests/testsuite.at (AT_COMPILE_CXX): New.
7262 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7263 locations in a more synthetic way.
7264 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7265 lalr1.cc is used.
7266 Adjust the C locations to match those from Emacs: first column is
7267 column 0.
7268 Change all the expected results.
7269 Conform to the GCS: simplify the locations when applicable.
7270 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7271 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7272 these CPP macros with the m4 macros new defined by...
7273 (AT_CHECK_PUSHDEFS): this, i.e.:
7274 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 7275 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
7276 New macros.
7277 (AT_CHECK_POPDEFS): Undefine them.
7278 (AT_CHECK_CALC_LALR1_CC): New.
7279 Use it for the first lalr1.cc test.
7280
43a176ef
AD
72812003-02-04 Akim Demaille <akim@epita.fr>
7282
7283 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7284 Location as is defined.
7285
fc049e9c
AD
72862003-02-04 Akim Demaille <akim@epita.fr>
7287
7288 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7289 name_ being defined.
7290
a737b216
PE
72912003-02-03 Paul Eggert <eggert@twinsun.com>
7292
7293 * src/gram.h (start_symbol): Remove unused decl.
7294
7295 Use more-consistent naming conventions for local vars.
7296
7297 * src/derives.c (derives_compute): Change type of local var from
7298 int to rule_number.
7299 * src/gram.c (grammar_rules_partial_print): Likewise.
7300 * src/print.c (print_core): Likewise.
7301 * src/reduce.c (reduce_grammar_tables): Likewise.
7302
7303 * src/gram.c (grammar_dump): Change name of item_number *
7304 local var from r to rp.
7305 * src/nullable.c (nullable_compute): Likewise.
7306
7307 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7308
7309 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7310 for symbol or symbol_number var.
7311 * src/reader.c (grammar_start_symbol_set): Likewise.
7312 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7313 Likewise.
7314 * src/state.c (transitions_to): Likewise.
7315 * src/state.h: Likewise.
7316 * src/tables.c (symbol_number_to_vector_number): Likewise.
7317
7318 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7319 char * var.
7320
7321 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7322 var.
7323
7324 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7325 var.
7326
7327 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7328 Use str, not s, for char * var. Use ch, not c, for character var.
7329 Use size for size var.
7330
7331 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7332 char * var.
7333 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7334 uniqstr var.
7335 * src/uniqstr.h: Likewise.
7336
7337 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7338 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7339 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7340 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7341 param to have same name as that of enum, so that we don't use
7342 "s" to stand for a non-state.
7343
68e93ad5
AD
73442003-02-02 Akim Demaille <akim@epita.fr>
7345
7346 * src/scan-skel.l: Scan more than one inert character per yylex
7347 invocation.
7348
92898986
PE
73492003-02-01 Paul Eggert <eggert@twinsun.com>
7350
7351 Version 1.875a.
7352
1d9d5d71
PE
7353 * po/LINGUAS: Add ms.
7354
0435d061
AD
73552003-01-30 Akim Demaille <akim@epita.fr>
7356
7357 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7358
6029a57f
PH
73592003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7360
7361 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7362 of $1.
0435d061
AD
7363
7364 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 7365 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 7366 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 7367
6029a57f
PH
7368 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7369 (b4_rhs_location): Ditto.
0435d061 7370 (yyfill): New function to copy from stack tree into array
6029a57f 7371 incrementally.
0435d061
AD
7372 (yyuserAction): Modify to allow incremental move of semantic values
7373 to rhs array when in GLR mode.
7374 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
7375 as needed.
7376 Remove dummy use of yystack, as there is now a guaranteed use.
7377 (yydoAction): Modify to allow incremental move of semantic values
7378 to rhs array when in GLR mode.
7379 (yyresolveAction): Ditto.
7380 (yyglrShiftDefer): Update comment.
0435d061 7381 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
7382 (yyglrReduce): Ditto.
7383 (yydoAction): Ditto
0435d061 7384
6029a57f
PH
7385 * tests/glr-regr1.at: Rename to ...
7386 * tests/glr-regression.at: Add new regression test for the problems
7387 described above (adapted from S. Eken).
7388 Update copyright notice.
7389 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7390 * tests/Makefile.am: Ditto.
7391
6cee6297
PE
73922003-01-28 Paul Eggert <eggert@twinsun.com>
7393
7394 * data/lalr1.cc: Do not use @output_header_name@ unless
7395 b4_defines_flag is set. This fixes two bugs reported by
7396 Tim Van Holder in
161a71f3
PE
7397 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7398 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 7399
b2a836b5
PE
74002003-01-21 Paul Eggert <eggert@twinsun.com>
7401
7402 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7403 we don't need to worry about yyerrlab1 being reported as an
7404 "unused label" by non-GCC C compilers. The downside is that if
7405 locations are used then a couple of statements are duplicated each
7406 time YYERROR is invoked, but the upside is that the warnings
7407 should vanish.
7408 (yyerrlab1): Move code to YERROR.
7409 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7410 This reverts some of the 2002-12-27 change.
7411
4196b931
PE
74122003-01-17 Paul Eggert <eggert@twinsun.com>
7413
7414 * src/output.c (symbol_printers_output): Fix typo that led
7415 to core dump. Problem reported by Antonio Rus in
161a71f3 7416 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 7417
3ae831b4
AD
74182003-01-13 Akim Demaille <akim@epita.fr>,
7419 Quoc Peyrot <chojin@lrde.epita.fr>,
7420 Robert Anisko <anisko_r@lrde.epita.fr>
7421
7422 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7423 when the stacks contain one element, as the loop would otherwise
7424 free the last state, and then use the top state (the one we just
7425 popped). This means that the initial elements will not be freed
7426 explicitly, as is the case in yacc.c; it is not a problem, as
7427 these elements have fake values.
7428
e3aa65c5
PE
74292003-01-11 Paul Eggert <eggert@twinsun.com>
7430
7431 * NEWS: %expect-violations are now just warnings, reverting
7432 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7433 bootstrapping problem reported by Matthias Klose; see
161a71f3 7434 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
7435 * src/conflicts.c (conflicts_print): Likewise.
7436 * tests/conflicts.at (%expect not enough, %expect too much,
7437 %expect with reduce conflicts): Likewise.
7438 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7439 that the warning is enabled if the number of conflicts changes
7440 (not necessarily increases).
7441
7442 * src/getargs.c (version): Update copyright year.
7443
f0057011
AD
74442003-01-09 Akim Demaille <akim@epita.fr>
7445
7446 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7447
1ee6d2a0
PE
74482003-01-08 Paul Eggert <eggert@twinsun.com>
7449
7450 * Makefile.maint (WGETFLAGS):
7451 New macro, containing "-C off" to disable proxy caches.
7452 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7453 (rel-check): Use $(WGET) instead of wget.
7454
d4fd77c4
PE
74552003-01-06 Paul Eggert <eggert@twinsun.com>
7456
7457 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7458 the GLR paper of Scott, Johnstone and Hussain.
7459
464c6927
PE
74602003-01-04 Paul Eggert <eggert@twinsun.com>
7461
d600ee67
PE
7462 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7463 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7464 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7465 (EXTRA_LIBRARIES): New var, for liby.a.
7466 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7467 (EXTRA_SCRIPTS): New var, for yacc.
7468
464c6927
PE
7469 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7470 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7471 Problem reported by Nelson H. F. Beebe.
7472
74732003-01-03 Paul Eggert <eggert@twinsun.com>
7474
7475 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7476 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7477 when compiling Bison 1.875's `bitset bset = obstack_alloc
7478 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7479
7480 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7481 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7482 grow to a huge size with typical invocation.
d600ee67 7483
464c6927
PE
7484 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7485 Use the pattern recommended by Autoconf 2.57, except also protect
7486 against double-definition.
7487 * src/system.h: Likewise.
7488 Portability issues reported by Nelson H. F. Beebe.
d600ee67 7489
464c6927
PE
7490 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7491 All uses changed. Provide a definition in both C and C++.
7492 (yytrue, yyfalse): Define even if defined (__cplusplus).
7493
7494 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7495 Reported by Nelson H. F. Beebe.
d600ee67 7496
464c6927
PE
7497 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7498
0f42c7d5
PE
74992003-01-02 Paul Eggert <eggert@twinsun.com>
7500
7501 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7502 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7503 Bug reported by Nelson H. F. Beebe.
7504
dc546b0f
PE
75052003-01-01 Paul Eggert <eggert@twinsun.com>
7506
7507 * Version 1.875.
7508
2c09b6a7
PE
75092002-12-30 Paul Eggert <eggert@twinsun.com>
7510
7511 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7512 Moved here from...
7513 (<INITIAL>","): Here. This causes stray "," to be treated
7514 more uniformly.
7515
dc546b0f 7516 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
7517 last brace in braced code when not in Yacc mode, for compatibility
7518 with Bison 1.35. This resurrects the 2001-12-15 patch to
7519 src/reader.c.
7520
7521 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7522 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7523
535c0f63
PE
75242002-12-28 Paul Eggert <eggert@twinsun.com>
7525
7526 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7527 that of SYM's type. This fixes Debian bug 168069, reported by
7528 Thomas Olsson.
d600ee67 7529
963fcc17
PE
75302002-12-28 Paul Eggert <eggert@twinsun.com>
7531
7532 Version 1.75f.
7533
7534 Switch back to the Yacc style of conflict reports, undoing some
7535 of the 2002-07-30 change.
7536 * doc/bison.texinfo (Understanding): Use Yacc style for
7537 conflict reports. Also, use new way of locating rules.
7538 * src/conflicts.c (conflict_report):
7539 Renamed from conflict_report_yacc, removing the old
7540 'conflict_report'. Translate the entire conflict report at once,
7541 so that we don't assume that "," has the same interpretation in
7542 all languages.
7543 (conflicts_output): Use Yacc-style conflict report for each state,
7544 instead of our more-complicated style.
7545 (conflicts_print): Use Yacc-style conflict report, except print
7546 the input file name when not emulating Yacc.
7547 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7548 Conflicted Reduction, %expect not enough, %expect too much,
7549 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7550 * tests/existing.at (GNU Cim Grammar): Likewise.
7551 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7552
7553 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7554 fatal): Don't invoke fflush; it's not needed and it might even be
7555 harmful for stdout, as stdout might not be open.
7556 * src/reduce.c (reduce_print): Likewise.
7557
b1efe548
PE
75582002-12-27 Paul Eggert <eggert@twinsun.com>
7559
7560 Fix a bug where error locations were not being recorded correctly.
7561 This problem was originally reported by Paul Hilfinger in
161a71f3 7562 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
7563
7564 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7565 top of the location stack's error locations.
7566 (yyerrlab): Set it. When discarding a token, push its location
7567 onto yylerrsp so that we don't lose track of the error's end.
7568 (yyerrlab1): Now is only the target of YYERROR, so that we can
7569 properly record the location of the action that failed. For GCC
7570 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7571 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7572 (yyerrlab2): New label, which yyerrlab now falls through to.
7573 Compute the error's location by applying YYLLOC_DEFAULT to
7574 the locations of all the symbols that went into the error.
7575 * doc/bison.texinfo (Location Default Action): Mention that
7576 YYLLOC_DEFAULT is also invoked for syntax errors.
7577 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7578 Error locations include the locations of all the tokens that were
7579 discarded, not just the last token.
d600ee67 7580
983c5c2c
PE
75812002-12-26 Paul Eggert <eggert@twinsun.com>
7582
b1efe548
PE
7583 * src/files.c: Include quote.h.
7584 (compute_output_file_names): Warn if we detect conflicting
7585 outputs to the same file. This should catch the misunderstanding
7586 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7587
7588 * src/conflicts.c (conflicts_print): If the user specifies
7589 "%expect N", report an error if there are any reduce/reduce
7590 conflicts. This is what the manual says should happen.
7591 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7592 * tests/conflicts.at (%expect with reduce conflicts): New test.
7593
983c5c2c
PE
7594 Don't use m4_include on relative file names, as it doesn't work as
7595 desired if there happens to be a file with that name under ".".
d600ee67 7596
983c5c2c
PE
7597 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7598 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7599 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7600 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7601 * src/output.c (output_skeleton): Use full path names when
7602 specifying a file to include; don't rely on include path, as
7603 it's unreliable when the working file contains a file with
7604 that name.
d600ee67 7605
983c5c2c
PE
76062002-12-25 Paul Eggert <eggert@twinsun.com>
7607
7608 Remove obsolete references to bison.simple and bison.hairy.
7609 Problem mentioned by Aubin Mahe in
161a71f3 7610 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
7611 * data/glr.c: Comment fix.
7612 * doc/bison.1: Remove references. Also, mention "yacc".
7613
7614 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7615 with -g option.
7616
7617 * src/parse-gram.y (declaration): Use enum "report_states" rather
7618 than its numeric value 1.
7619
7620 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7621 opening a new one. This fixes Debian bug 165349, reported by
7622 Bruce Stephens.
7623
23f2d9dc
PE
76242002-12-24 Paul Eggert <eggert@twinsun.com>
7625
7626 Version 1.75e.
7627
7628 * Makefile.maint (cvs-update): Don't assume that the shell
7629 supports $(...), as Solaris sh doesn't.
7630
7631 * src/parse-gram.y (lloc_default): Remove test for empty
7632 nonterminals at the end, since it didn't change the result.
7633
76342002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
7635
7636 If the user does not define YYSTYPE as a macro, Bison now declares it
7637 using typedef instead of defining it as a macro. POSIX requires this.
7638 For consistency, YYLTYPE is also declared instead of defined.
7639
7640 %union directives can now have a tag before the `{', e.g., the
7641 directive `%union foo {...}' now generates the C code
7642 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7643 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7644 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7645 instead of `yyltype'.
7646
7647 `yystype' and `yyltype' are now obsolescent macros instead of being
7648 typedefs or tags; they are no longer documented and will be
7649 withdrawn in a future release.
7650
7651 * data/glr.c (b4_location_type): Remove.
7652 (YYSTYPE): Renamed from yystype.
7653 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7654 (struct YYLTYPE): Renamed from struct yyltype.
7655 (YYLTYPE): Renamed from yyltype.
7656 (yyltype, yystype): New (and obsolescent) macros,
7657 for backward compatibility.
7658 * data/yacc.c: Likewise.
7659
7660 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7661 does not specify a union tag. This is for compatibility with
7662 Solaris 9 yacc.
7663
7664 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7665 const *, since it is now modified by stripping surrounding { }.
7666 (current_braced_code): Remove.
7667 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7668 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7669 trailing " {...}". Now of type <chars>.
7670 (grammar_declaration): Adjust to bundled tokens.
7671 (code_content): Remove; stripping is now done by add_param.
7672 (print_token_value): Print contents of bundled tokens.
7673 (token_name): New function.
7674
7675 * src/reader.h (braced_code, current_braced_code): Remove.
7676 (token_name): New decl.
7677
7678 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7679 token_type, not braced_code code_kind. All uses changed.
7680 (SC_PRE_CODE): New state, for scanning after a keyword that
7681 has (or usually has) an immediately-following braced code.
7682 (token_type): New local var, to keep track of which token type
7683 to return when scanning braced code.
7684 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 7685 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
7686 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7687 instead of returning a token type immediately.
7688 (<INITIAL>"{"): Set token type.
7689 (<SC_BRACED_CODE>"}"): Use it.
7690 (handle_action_dollar, handle_action_at): Now returns bool
7691 indicating success. Fail if ! current_rule; this prevents a core dump.
7692 (handle_symbol_code_dollar, handle_symbol_code_at):
7693 Remove; merge body into caller.
7694 (handle_dollar, handle_at): Complain in invalid contexts.
7695
7696 * NEWS, doc/bison.texinfo: Document the above.
7697 * NEWS: Fix years and program names in copyright notice.
7698
879ca4f8
PE
76992002-12-17 Paul Eggert <eggert@twinsun.com>
7700
7701 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7702 Reporting, Table of Symbols): Omit mentions of %lex-param and
7703 %parse-param from the documentation for now.
7704
1c5fe69d
PE
77052002-12-15 Paul Eggert <eggert@twinsun.com>
7706
7707 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7708 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7709 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
7710 disagreed with the Bison documentation. Bug
7711 reported by Andrew Walrond.
d600ee67 7712
1c5fe69d
PE
7713 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7714 as the caller now does that.
7715 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7716 (YYEMPTY): Parenthesize right hand side, since others use it.
7717 (yyparse): Don't assume that our generated code is the only code
7718 that sets yychar.
7719
d1de5372
PE
77202002-12-13 Paul Eggert <eggert@twinsun.com>
7721
7722 Version 1.75d.
7723
7724 POSIX requires a "yacc" command.
7725 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7726 (MOSTLYCLEANFILES): Add yacc.
7727 (yacc): New rule.
1c5fe69d 7728 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
7729 as an alias for bison y.
7730
7731 * po/LINGUAS: Add da.
d600ee67 7732
d1de5372
PE
7733 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
7734 problem with latest <getopt.h>.
7735 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
7736
7737 * doc/fdl.texi: Upgrade to 1.2.
7738 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
7739 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
7740 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
7741 gnulib.
7742 * config/install-sh: Sync with autotools.
7743
7744 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 7745 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
7746 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
7747 locations are requested.
7748 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
7749 locations are requested.
7750
d0f3fe23
PE
77512002-12-12 Paul Eggert <eggert@twinsun.com>
7752
7753 Remove unportable casts and storage allocation tricks.
7754 While we're at it, remove almost all casts, since they
7755 usually aren't needed and are a sign of trouble.
7756
7757 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7758
7759 * src/derives.c (derives_compute): Do not subtract NTOKENS from
7760 the pointer DSET returned by malloc; this isn't portable.
7761 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
7762 Similarly for DERIVES.
7763 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
7764 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
7765 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
7766
7767 * src/derives.c (derives_compute): Do not bother invoking
7768 int_of_rule_number, since rule numbers are integers.
7769
7770 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7771 rather than XMALLOC (char, N).
7772
7773 * src/files.c (filename_split): Rewrite to avoid cast.
7774
7775 * src/gram.h (symbol_number_as_item_number,
7776 item_number_as_symbol_number, rule_number_as_item_number,
7777 item_number_as_rule_number):
7778 Now inline functions rather than macros, to avoid casts.
7779 * src/state.h (state_number_as_int): Likewise.
7780 * src/tables.c (state_number_to_vector_number,
7781 symbol_number_to_vector_number): Likewise.
7782
7783 * src/gram.h (int_of_rule_number): Remove; no longer used.
7784
7785 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7786 since the resulting storage is always stored into.
7787
7788 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7789 where it's needed.
7790
7791 * src/muscle_tab.c (muscle_m4_output):
7792 Now inline. Return bool, not int.
7793 * src/state.c (state_compare): Likewise.
7794 * src/symtab.c (symbol_check_defined,
7795 symbol_check_alias_consistency, symbol_pack, symbol_translation,
7796 hash_compare_symbol, hash_symbol):
7797 Likewise.
7798 * src/uniqstr.c (uniqstr_print): Likewise.
7799 * src/muscle_tab.c (muscle_m4_output_processor):
7800 New function, to avoid casts.
7801 * src/state.c (state_comparator, stage_hasher): Likewise.
7802 * src/symtab.c (symbol_check_defined_processor,
7803 symbol_check_alias_consistency_processor, symbol_pack_processor,
7804 symbol_translation_processor, hash_symbol_comparator,
7805 hash_symbol_hasher): Likewise.
7806 * src/uniqstr.c (uniqstr_print_processor): Likewise.
7807 * src/muscle_tab.c (muscles_m4_output):
7808 Use new functions instead of casting old functions unportably.
7809 * src/state.c (state_hash_new): Likewise.
7810 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
7811 symbols_token_translations_init):
7812 Likewise.
7813 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7814
7815 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
7816 var instead of casting to long, to avoid casts.
7817 (prepare_states): Use MALLOC rather than alloca, so that we don't
7818 have to worry about alloca.
7819 * src/state.c (state_hash_lookup): Likewise.
7820
7821 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7822 local var instead of casting to unsigned char, to avoid casts.
7823
7824 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
7825 STATE_ALLOC): Remove.
7826 (transitions_new, errs_new, reductions_new, state_new): Use malloc
7827 rather than calloc, and use offsetof to avoid allocating slightly
7828 too much storage.
7829 (state_new): Initialize all members.
7830
7831 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7832
7833 * src/symtab.c (symbol_free): Remove; unused.
7834 (symbol_get): Remove cast in lhs of assignment.
7835 (symbols_do): Now static. Accept generic arguments, not
7836 hashing-related ones.
7837
7838 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7839 (symbol_processor): Remove.
7840 (symbols_do): Remove decl; now static.
7841
7842 * src/system.h (alloca): Remove; decl no longer needed.
7843 (<stddef.h>): Include, for offsetof.
7844 (<inttypes.>, <stdint.h>): Include if available.
7845 (uintptr_t): New type, if system lacks it.
7846 (CALLOC, MALLOC, REALLOC): New macros.
7847 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7848 new macros.
7849
7850 * src/tables.c (table_size): Now int, to pacify GCC.
7851 (table_grow, table_ninf_remap): Use signed table size.
7852 (save_row): Don't bother initializing locals when not needed.
7853 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7854 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7855
7856 * src/vcg.h: Correct misspellings.
7857
7858 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7859
7860
7861 * src/getargs.c (getargs): Don't assume EOF == -1.
7862
26b4a969
PE
78632002-12-09 Paul Eggert <eggert@twinsun.com>
7864
7865 Change identifier spellings to avoid collisions with names
7866 that are reserved by POSIX.
7867
7868 Don't use names ending in _t, since POSIX reserves them.
7869 For consistency, remove _e and _s endings -- they're weren't
7870 needed to remove ambiguity. All uses changed.
7871 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7872 turn was just renamed from struniq_t.
7873 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7874 which in turn was just renamed from struniq_processor_t.
7875 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7876 in turn was renamed from hash_compare_struniq_t.
7877 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7878 (state_list): Renamed from state_list_t.
7879 * src/assoc.h (assoc): Renamed from assoc_t.
7880 * src/conflicts.c (enum conflict_resolution): Renamed from
7881 enum conflict_resolution_e.
7882 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7883 (rule_list): Renamed from rule_list_t.
7884 * src/getargs.h (enum trace): Renamed from enum trace_e.
7885 (enum report): Renamed from enum report_e.
7886 * src/gram.h (item_number): Renamed from item_number_t.
7887 (rule_number): Renamed from rule_number_t.
7888 (struct rule_s): Remove the "rule_s" part; not used.
7889 (rule): Renamed from rule_t.
7890 (rule_filter): Renamed from rule_filter_t.
7891 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7892 (goto_list): Renamed from goto_list_t.
7893 * src/lalr.h (goto_number): Renamed from goto_number_t.
7894 * src/location.h (location): Renamed from location_t.
7895 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7896 and moved here from:
7897 * src/muscle_tab.h (muscle_entry_t): here.
7898 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7899 (rule_list): Renamed from rule_list_t.
7900 * src/print_graph.c (static_graph): Renamed from graph.
7901 * src/reader.h (braced_code): Renamed from braced_code_t.
7902 Remove brace_code_e tag.
7903 * src/relation.h (relation_node): Renamed from relation_node_t.
7904 (relation_nodes): Renamed from relation_nodes_t.
7905 (relation): Renamed from relation_t.
7906 * src/state.h (state_number): Renamed from state_number_t.
7907 (struct state): Renamed from struct state_s.
7908 (state): Renamed from state_t.
7909 (transitions): Renamed from transitions_t. Unused (and
7910 misspelled) transtion_s tag removed.
7911 (errs): Renamed from errs_t. Unused errs_s tag removed.
7912 (reductions): Renamed from reductions_t. Unused tag
7913 reductions_s removed.
7914 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7915 (struct symbol_list): Renamed from struct symbol_list_s.
7916 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7917 (struct symbol): Renamed from struct symbol_s.
7918 (symbol): Renamed from symbol_t.
7919 * src/tables.c (vector_number): Renamed from vector_number_t.
7920 (action_number): Renamed from action_t.
7921 * src/tables.h (base_number): Renamed from base_t.
7922 * src/vcg.h (enum color): Renamed from enum color_e.
7923 (enum textmode): Renamed from enum textmode_e.
7924 (enum shape): Renamed from enum shape_e.
7925 (struct colorentry): Renamed from struct colorentry_s.
7926 (struct classname): Renamed from struct classname_s.
7927 (struct infoname): Renamed from struct infoname_s.
7928 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7929 (enum decision): Renamed from enum decision_e.
7930 (enum orientation): Renamed from enum orientation_e.
7931 (enum alignment): Renamed from enum alignment_e.
7932 (enum arrow_mode): Renamed from enum arrow_mode_e.
7933 (enum crossing_type): Renamed from enum crossing_type_e.
7934 (enum view): Renamed from enum view_e.
7935 (struct node): Renamed from struct node_s.
7936 (node): Renamed from node_t.
7937 (enum linestyle): Renamed from enum linestyle_e.
7938 (enum arrowstyle): Renamed from enum arrowstyle_e.
7939 (struct edge): Renamed from struct edge.
7940 (edge): Renamed from edge_t.
7941 (struct graph): Renamed from struct graph_s.
7942 (graph): Renamed from graph_t.
7943 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7944 Rename value_t -> value.
7945 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7946 value_t_as_yystype -> value_as_yystype.
7947
7948 Don't include <errno.h> in the mainstream code, since it
7949 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7950 * lib/get-errno.c, lib/get-errno.h: New files.
7951 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7952 get-errno.c.
7953 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7954 * src/output.c (output_skeleton): Likewise.
7955 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7956 instead of errno.
7957 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7958 Likewise.
7959 (handle_action_dollar, handle_action_at): Likewise.
7960 * src/system.h: Do not include <errno.h>.
7961 (TAB_EXT): Renamed from EXT_TAB.
7962 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7963
7964 Avoid str[a-z]*, since <string.h> reserves that name space.
7965 Change all instances of "struniq" in names to "uniqstr", and
7966 likewise for "STRUNIQ" and "UNIQSTR".
7967 * src/uniqstr.c: Renamed from src/struniq.c.
7968 * src/uniqstr.h: Renamed from src/struniq.h.
7969 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7970 * src/files.c (strsuffix): Remove; unused.
7971 (concat2): Renamed from stringappend. Now static.
7972 * src/files.h (strsuffix, stringappend): Remove; unused.
7973 * src/parse-gram.y (<chars>): Renamed from <string>.
7974 (<uniqstr>): Renamed from <struniq>.
7975 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7976 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7977 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7978 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7979 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7980 (N_EXPAND): Renamed from N_STRETCH.
7981
7982 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7983 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7984 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7985 Remove; unused.
7986 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7987 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7988 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7989 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7990 (BASE_MAXIMUM): Renamed from BASE_MAX.
7991 (BASE_MINIMUM): Renamed from BASE_MIN.
7992 (ACTION_MAX): Remove; unused.
7993 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7994 Unnecessary casts removed from above defines.
7995
7996
7997 Fix misspelling in names.
7998 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7999 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
8000 G_NODE_ALIGNEMENT.
8001
8002
8003 * lib/timevar.c (timevar_report): Renamed from time_report,
8004 for consistency with other names.
8005 * lib/timevar.h (timevar_report): New decl.
8006 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
8007
8008
8009 Sort include-file uses.
8010
8011 Reorder all include files under src to be in the order "system.h".
8012 then the ../lib include files in angle brackets (alphabetized),
8013 then the . include files in double-quotes (alphabetized). Fix
8014 dependency breakages encountered in this process, as follows:
8015 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
8016 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
8017 * src/state.h: Include "symtab.h".
8018
996b1c7e
PE
80192002-12-08 Paul Eggert <eggert@twinsun.com>
8020
8021 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
8022 since this causes problems when __file__ contains character
8023 sequences like "@" that are treated specially by src/scan-skel.l.
8024 Instead, just use the file's basename. This fixes the bug
8025 reported by Martin Mokrejs in
161a71f3 8026 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 8027
e19c4e5d
PE
80282002-12-06 Paul Eggert <eggert@twinsun.com>
8029
8030 Add support for rules that do not have trailing semicolons, as
8031 POSIX requires. Improve the quality of locations in Bison
8032 diagnostics.
26b4a969 8033
e19c4e5d
PE
8034 * src/location.c: Include <quotearg.h>.
8035 (empty_location): Now const.
8036 (location_print): New function. Follow the recommendation of the
8037 GNU Coding Standards for locations that span file boundaries.
8038 * src/location.h: Do not include <quotearg.h>; no longer needed.
8039 (boundary): New type.
8040 (location_t): Use it. This allows locations to span file boundaries.
8041 All member uses changed: file -> start.file or end.file (as needed),
8042 first_line -> start.line, first_column -> start.column,
8043 last_line -> end.line, last_column -> end.column.
8044 (equal_boundaries): New function.
8045 (LOCATION_RESET, LOCATION_STEP): Remove.
8046 (LOCATION_PRINT): Remove. All callers changed to use location_print.
8047 (empty_location): Now const.
8048 (location_print): New decl.
8049 * src/parse-gram.y (lloc_default): New function, which handles
8050 empty locations more accurately.
8051 (YYLLOC_DEFAULT): Use it.
8052 (%token COLON): Remove.
8053 (%token ID_COLON): New token.
26b4a969 8054 (rules): Use it.
e19c4e5d
PE
8055 (declarations, rules): Remove trailing semicolon.
8056 (declaration, rules_or_grammar_declaration):
8057 Allow empty (";") declaration.
8058 (symbol_def): Remove empty actions; no longer needed.
8059 (rules_or_grammar_declaration): Remove trailing semicolon.
8060 (semi_colon.opt): Remove.
8061 * src/reader.h: Include location.h.
8062 (scanner_cursor): New decl.
8063 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
8064 rolling our own.
8065 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
8066 of *loc.
8067 (STEP): Remove. No longer needed, now that adjust_location does
8068 the work. All uses removed.
8069 (scanner_cursor): New var.
8070 (adjust_location): Renamed from extend_location. It now sets
8071 *loc and adjusts the scanner cursor. All uses changed.
8072 Don't bother testing for CR.
8073 (handle_syncline): Remove location arg; now updates scanner cursor.
8074 All callers changed.
8075 (unexpected_end_of_file): Now accepts start boundary of token or
8076 comment, not location. All callers changed. Update scanner cursor,
8077 not the location.
8078 (SC_AFTER_IDENTIFIER): New state.
8079 (context_state): Renamed from c_context. All uses changed.
8080 (id_loc, code_start, token_start): New local vars.
8081 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
8082 processing of Yacc white space and equivalents here.
8083 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
8084 instead of returning ID immediately, since we need to search for
8085 a subsequent colon.
8086 (<INITIAL>"'", "\""): Save token_start.
8087 (<INITIAL>"%{", "{", "%%"): Save code_start.
8088 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
8089 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
8090 BEGIN context_state at end, not INITIAL.
8091 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
8092 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
8093 Return correct token start.
8094 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
8095 the start of a character, string or multiline comment is found.
8096 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
8097 Reduction): Adjust reported locations to match the more-precise
8098 results now expected.
8099 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
8100 * tests/reduce.at (Useless Rules, Reduced Automaton,
8101 Underivable Rules): Likewise.
8102 * tests/regression.at (Invalid inputs): No longer `expecting ";"
8103 or "|"' now that so many other tokens are allowed by the new grammar.
8104
8105 * src/complain.h (current_file): Remove duplicate decl;
8106 current_file is now owned by files.h.
8107 * src/complain.c, src/scan-gram.l: Include files.h.
8108
81092002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 8110
e19c4e5d
PE
8111 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
8112 promotes to int; it might be unsigned int.
8113 * data/yacc.c (yy_reduce_print): Likewise.
8114
8115 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
8116 be #defined in the prologue, not in the Bison declarations.
8117 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 8118
b64755e3
PE
81192002-12-02 Paul Eggert <eggert@twinsun.com>
8120
8121 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
8122 * lib/strtoul.c: New file, from gnulib.
8123 This fixes a porting bug reported by Peter Klein in
161a71f3 8124 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 8125
6e746484
PE
81262002-11-30 Paul Eggert <eggert@twinsun.com>
8127
b64755e3
PE
8128 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
8129 and put only a forward declaration in the prologue. This is for
8130 consistency with the other scanner helper functions.
8131
6ba55592
PE
8132 Type clashes now generate warnings, not errors, since it
8133 appears that POSIX may allow some grammars with type clashes.
8134 * src/reader.c (grammar_current_rule_check): Warn about
8135 type clashes instead of complaining.
8136 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8137
6e746484
PE
8138 Add Yacc library, since POSIX requires it.
8139 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8140 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8141 * lib/main.c, lib/yyerror.c: New files.
8142
8143 gram_error can be static; it need not be extern.
8144 * src/reader.h (gram_error): Remove decl.
8145 * src/parse-gram.y (gram_error): Now static. Add static decl.
8146 (print_token_value): Omit parameter names from forward decl,
8147 for consistency.
8148
88510f9c
PE
81492002-11-29 Paul Eggert <eggert@twinsun.com>
8150
6e746484
PE
8151 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8152 be declared before being used. E.g., one should typically
8153 declare them in the prologue. Use GNU coding style in examples.
8154 Put "const" consistently after the type it modifies. Mention
8155 that C99 supports "inline". Mention that yyerror traditionally
8156 returns "int".
8157
88510f9c
PE
8158 %parse-param and %lex-param now take just one argument, the
8159 declaration; the argument name is deduced from the declaration.
8160
8161 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8162 Reporting, Table of Symbols): Document this.
8163 * src/parse-gram.y (add_param): New function.
8164 (COMMA): Remove.
8165 (declaration): Implement new rule for %parse-param and %lex-param.
8166 * src/scan-gram.l: "," now elicits a warning, rather than being
8167 a token; this is more compatible with byacc.
8168 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8169
bb92250c
PE
81702002-11-27 Paul Eggert <eggert@twinsun.com>
8171
8172 Rename identifiers to avoid real and potential collisions.
8173
8174 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8175 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 8176 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
8177 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8178 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8179 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8180 All uses changed.
8181 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8182 The name "yycontrol" violates the name space rules, and this stuff
8183 wasn't being used anyway.
8184 (input): Remove action; this stuff wasn't being used.
8185 (gram_error): Rename local variable yylloc -> loc.
8186 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8187 (YY_DECL): Don't use "yy" at start of local variables.
8188 All uses changed, e.g., yylloc -> loc.
8189 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8190 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8191 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8192 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8193
8194 * src/parse-gram.y (gram_error): loc is now const *.
8195 * src/reader.h (gram_error): Likewise.
8196
3af4feb2
PE
81972002-11-24 Paul Eggert <eggert@twinsun.com>
8198
8199 Version 1.75c.
8200
8201 * tests/actions.at (Actions after errors): Use an output format
8202 more similar to that of the Printers and Destructors test.
8203 Test the position of the ';' token too.
8204 (Printers and Destructors): Likewise.
8205 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8206 unnecessarily alarming people when the test fails.
8207
8208 * data/yacc.c (yyerrlab1): Move this label down, so that the
8209 parser does not discard the lookahead token if the user code
8210 invokes YYERROR. This change is required for POSIX conformance.
8211
8212 * lib/error.c: Sync with gnulib.
8213
82142002-11-22 Paul Eggert <eggert@twinsun.com>
8215
8216 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8217 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8218 * lib/xmalloc.c: Likewise.
26b4a969 8219
58004308
PE
82202002-11-20 Paul Eggert <eggert@twinsun.com>
8221
8222 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8223
82242002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 8225
58004308
PE
8226 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8227 should use `if (! x) abort ();' rather than `assert (x);', and
8228 anyway it's one less thing to worry about configuring.
8229
8230 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8231 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8232 and replace all instances of assert with abort.
8233 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8234 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8235
8236 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8237 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8238 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8239 hash_find_entry, hash_rehash, hash_insert): Likewise.
8240 * src/conflicts.c (resolve_sr_conflict): Likewise.
8241 * src/lalr.c (set_goto_map, map_goto): Likewise.
8242 * src/nullable.c (nullable_compute): Likewise.
8243 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8244 * src/reader.c (packgram, reader): Likewise.
8245 * src/state.c (state_new, state_free, state_transitions_set,
8246 state_reduction_find): Likewise.
8247 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8248 symbol_pack): Likewise.
8249 * src/tables.c (conflict_row, pack_vector): Likewise.
8250 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8251 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8252 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8253 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8254
8255 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8256 (ARGMATCH_CONSTRAINT): New macro.
8257 (ARGMATCH_ASSERT): Use it.
8258
8259 * src/system.h (verify): New macro.
8260 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8261 rather than assert.
8262 * src/tables.c (tables_generate): Likewise.
8263
8264 * src/struniq.c (struniq_assert): Now returns void, and aborts
8265 if the assertion is false.
8266 (struniq_assert_p): Remove.
8267 * src/struniq.h: Likewise.
8268
76ae8198
PE
82692002-11-18 Paul Eggert <eggert@twinsun.com>
8270
8271 * data/glr.c (yygetLRActions): Replace `yyindex' with
8272 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8273 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 8274 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 8275
d3c4e709
AD
82762002-11-18 Akim Demaille <akim@epita.fr>
8277
8278 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8279 space.
8280 From Tim Van Holder.
8281
8d8a7238
PE
82822002-11-17 Paul Eggert <eggert@twinsun.com>
8283
8284 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8285 to "SyntaxError" for consistency with my 2002-11-15 change.
8286
8287 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8288 not define to {}, since this breaks the common use of `YYDPRINTF
8289 ((...));' if a single statement is desired (e.g. before `else').
8290 Work around GCC warnings by surrounding corresponding calls with
8291 {} if needed.
8292 (yyhasResolvedValue): Remove unused function.
8293 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8294 loop body.
8295 (yyreportSyntaxError): Renamed from yyreportParseError.
8296 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8297 All uses changed.
8298 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8299 extern when possible. Remove unused initializations.
8300
b0937b22
AD
83012002-11-16 Akim Demaille <akim@epita.fr>
8302
8303 Augment the similarity between GLR and LALR traces.
8304
8305 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8306 (YY_REDUCE_PRINT): New.
8307 (yyparse): Use them.
8308 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8309 YYDPRINT here.
8310 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8311 state reached after the reduction/recovery, since...
8312 (yyparse, yyprocessOneStack): Report the state we are entering in.
8313
c5e3e510
AD
83142002-11-16 Akim Demaille <akim@epita.fr>
8315
8316 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8317 Add support for --trace=skeleton.
8318 * src/scan-skel.l: %option debug.
8319 Scan strings of non-@ or \n instead of character by character.
8320 (scan_skel): Handle trace_skeleton.
8321 (QPUTS): New.
8322 (@output_parser_name@, @output_header_name@): ``Restore'' their
8323 support (used to be M4 macros).
8324 * data/yacc.c: Quote larger chunks, a la glr.c.
8325 * data/lalr1.cc: Likewise.
8326 The header guards are no longer available, so use some other
8327 string than `YYLSP_NEEDED'.
8328
4c6cc1db
AD
83292002-11-16 Akim Demaille <akim@epita.fr>
8330
8331 Make the ``Printers and Destructors'' test more verbose, taking
8332 `yacc.c''s behavior as (possibly wrong) reference.
8333
8334 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8335 instead of fprint on stdout.
8336 Set and report the last_line of the symbols.
8337 Consistently display values and locations.
8338
6d9e8019
PE
83392002-11-16 Paul Eggert <eggert@twinsun.com>
8340
8341 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8342
6e649e65
PE
83432002-11-15 Paul Eggert <eggert@twinsun.com>
8344
b25d88f6
PE
8345 * tests/actions.at (Actions after errors): New test case.
8346
6e649e65
PE
8347 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8348 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8349 tests/action.at, tests/calc.at, tests/conflicts.at,
8350 tests/cxx-type.at, tests/regression.at:
8351 "parse error" -> "syntax error" for POSIX compatibility.
8352 "parsing stack overflow..." -> "parser stack overflow" so
8353 that code matches Bison documentation.
8354
0f39aab9
AD
83552002-11-15 Akim Demaille <akim@epita.fr>
8356
8357 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8358 take two BRACED_CODE, not two string_content.
8359 Free the scanner's obstack when we are done.
8360 (code_content): New.
8361 * tests/calc.at: Adjust.
8362 * doc/bison.texinfo: Adjust.
8363 Also, make sure to include the `,' for these declarations.
8364
761c1926
AD
83652002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8366
8367 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8368 definition; avoids potential autoreconf problems.
8369
b0f98b10
AD
83702002-11-15 Akim Demaille <akim@epita.fr>
8371
8372 Always check the value returned by yyparse.
8373
8374 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8375 returned by yyparse.
8376 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8377 Adjust calls.
8378 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8379 returned by yyparse.
8380
970785f1
PH
83812002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8382
8383 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8384 on input.at test.
8385
8fcc7db1
PE
83862002-11-14 Paul Eggert <eggert@twinsun.com>
8387
7ec1b48e
PE
8388 * src/output.c (output_skeleton): Call xfopen instead of
8389 duplicating xfopen's body.
8390
cfff7583 8391 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 8392 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 8393
8fcc7db1
PE
8394 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8395 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8396 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8397 file twice in the grammar, as an extra check.
8398
8399 * tests/input.at (Torturing the Scanner): Surround the
8400 backslash-newline tests with "#if 0", to make it less likely that
8401 we'll run into compiler bugs. Bring back solitary \ inside
8402 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 8403 test backslash-newline in C character constant.
8fcc7db1 8404
4e8d992c
AD
84052002-11-14 Akim Demaille <akim@epita.fr>
8406
8407 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8408 status of the compiler.
f32b346d 8409 Calling `exit 1' is no longer needed.
4e8d992c
AD
8410 Reported by Nelson H. F. Beebe.
8411
9501dc6e
AD
84122002-11-14 Akim Demaille <akim@epita.fr>
8413
8414 * tests/atlocal.in (CPPFLAGS): We have config.h.
8415 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8416 New.
8417 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8418 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8419 * tests/regression.at, tests/torture.at: Use them for all the
8420 grammars that are to be compiled.
8421 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8422 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8423 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8424
18b519c0
AD
84252002-11-14 Akim Demaille <akim@epita.fr>
8426
8427 * doc/bison.texinfo: Various formatting changes (alignments in
8428 samples, additional @group/@end group, GCS in samples.
8429 Use @deffn instead of simple @table to define the directives,
8430 macros, variables etc.
8431
9a86cdb9
PE
84322002-11-13 Paul Eggert <eggert@twinsun.com>
8433
daa33def 8434 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 8435 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 8436
daa33def 8437 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 8438 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
8439 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8440 * tests/headers.at (export YYLTYPE): Likewise.
8441
8442 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 8443 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 8444
9a86cdb9
PE
8445 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8446 comments, since they're not portable. Use GNU coding style.
8447
9c1e26bd
AD
84482002-11-13 Akim Demaille <akim@epita.fr>
8449
8450 * data/yacc.c: Leave bigger chunks of quoted text.
8451 (YYDSYMPRINTF): New.
8452 Use it to report symbol activities.
8453 * data/glr.c (YYDSYMPRINTF): New.
8454 Use it.
8455
87f721cc
PE
84562002-11-12 Paul Eggert <eggert@twinsun.com>
8457
8458 Version 1.75b.
8459
8460 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8461 (yyglrReduce): Return yyok, not 0.
8462 This should avoid the enumerated-type warnings reported
464c6927 8463 by Nelson H. F. Beebe in
161a71f3 8464 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
8465
8466 * lib/bbitset.h (BITSET_INLINE): Remove.
8467 * lib/bitset.h [! BITSET_INLINE]: Remove.
8468 (bitset_set, bitset_reset, bitset_test): Rename local vars
8469 to avoid shadowing warnings by GCC.
8470
8471 * data/glr.c (inline): Remove #define. It's the user's
8472 responsibility to #define it away, just like 'const'.
464c6927 8473 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 8474 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 8475
87f721cc
PE
8476 * Makefile.maint (po-check): Scan .l and .y files instead of the
8477 .c and the .h files that they generate. This fixes the bug
8478 reported by Tim Van Holder in:
161a71f3 8479 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
8480 Look for N_ as well as for _. Try to avoid matching #define for
8481 N_ and _.
8482 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8483 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8484 * src/scan-gram.l: Revamp regular expressions so that " and '
8485 do not confuse xgettext.
8486
8487 * src/struniq.h (struniq_new): Do not declare the return type
8488 to be 'const'; this violates the C standard.
8489 * src/struniq.c (struniq_new): Likewise.
8490
be14ade5
AD
84912002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8492
8493 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8494 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8495 linker.
8496
05291fbc
AD
84972002-11-12 Akim Demaille <akim@epita.fr>
8498
8499 * Makefile.maint: Sync with Autoconf:
8500 (local_updates): New.
8501
1f5fd52e
AD
85022002-11-12 Akim Demaille <akim@epita.fr>
8503
8504 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8505
283f1e64
AD
85062002-11-12 Akim Demaille <akim@epita.fr>
8507
8508 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8509 locations.
8510
886b69d1
AD
85112002-11-12 Akim Demaille <akim@epita.fr>
8512
8513 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8514 not yyvalue.
8515
3df37415
AD
85162002-11-12 Akim Demaille <akim@epita.fr>
8517
8518 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8519 Use it to test the GLR parser.
8520
7bd6c77e
AD
85212002-11-12 Akim Demaille <akim@epita.fr>
8522
8523 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8524 defines it.
8525 * data/glr.c (yystos): New.
8526 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8527 (YYDSYMPRINT): New.
8528 (yyval): Don't define it, it is handled via M4.
8529 (yyrecoverParseError): Free verbosely the discarded symbols.
8530 * data/yacc.c (yysymprint): Remove, rather...
8531 (b4_yysymprint_generate): invoke.
8532 * data/c.m4 (b4_yysymprint_generate): New.
8533 Accept pointers as arguments, as opposed to the version from
8534 yacc.c.
8535 (b4_yydestruct_generate): Likewise.
8536 * tests/cations.at (Printers and Destructors): Use Bison directives
8537 instead of CPP macros.
8538 Don't rely on internal details.
8539
b0400cc6
AD
85402002-11-12 Akim Demaille <akim@epita.fr>
8541
8542 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8543 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8544 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8545 it against YYEMPTY and so forth), work on yytoken (i.e., set
8546 it to YYEMPTY etc.).
8547 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8548 (b4_symbol_actions): Remove.
8549 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8550 for 0, end-of-input.
8551
72f889cc
AD
85522002-11-12 Akim Demaille <akim@epita.fr>
8553
8554 * doc/bison.texinfo (Destructor Decl): New.
8555
b1ae9233
AD
85562002-11-12 Akim Demaille <akim@epita.fr>
8557
8558 * src/tables.c (tables_generate): Use free for pointers that
8559 cannot be NULL, not XFREE.
8560 (pack_vector): Use assert, not fatal, for bound violations.
8561 * src/state.c (state_new): Likewise.
8562 * src/reader.c (reader): Likewise.
8563 * src/lalr.c (set_goto_map): Likewise.
72f889cc 8564 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
8565 the file name.
8566
7ec2d4cd
AD
85672002-11-12 Akim Demaille <akim@epita.fr>
8568
8569 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8570 Restore.
8571 * src/scan-gram.l (last_string): Is global to the file, not to
8572 yylex.
8573 * src/parse-gram.y (input): Don't append the epilogue here,
8574 (epilogue.opt): do it here, and free the scanner's obstack.
8575 * src/reader.c (epilogue_set): Rename as...
8576 (epilogue_augment): this.
8577 * data/c.m4 (b4_epilogue): Defaults to empty.
8578
573a6cd3
AD
85792002-11-12 Akim Demaille <akim@epita.fr>
8580
8581 * src/getargs.c (long_options): Remove duplicates.
8582 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8583 Remove.
8584 * doc/bison.rnh: Remove.
8585 * doc/bison.texinfo (VMS Invocation): Remove.
8586
95612cfa
AD
85872002-11-12 Akim Demaille <akim@epita.fr>
8588
8589 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8590 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8591
8592 Use struniq for symbols.
8593
8594 * src/symtab.h (symbol_t): The tag member is a struniq.
8595 (symbol_type_set): Adjust.
8596 * src/symtab.c (symbol_new): Takes a struniq.
8597 (symbol_free): Don't free the tag member.
8598 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8599 (hash_compare_symbol, hash_symbol): these.
8600 Use the fact that tags as struniqs.
8601 (symbol_get): Use struniq_new.
8602 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8603 Returns a strniq.
8604 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8605 and type members are struniqs.
8606 * src/reader.c (get_merge_function)
8607 (grammar_current_rule_merge_set): Adjust.
8608 (TYPE, current_type): Are struniq.
8609
8610 Use struniq for file names.
8611
8612 * src/files.h, src/files.c (infile): Split into...
8613 (grammar_file, current_file): these.
8614 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8615 * src/reduce.c (reduce_print): Likewise.
8616 * src/getargs.c (getargs): Likewise.
8617 * src/complain.h, src/complain.c: Likewise.
8618 * src/main.c (main): Call struniqs_new early enough to use it for
8619 file names.
8620 Don't free the input file name.
8621
3e6656f9
AD
86222002-11-12 Akim Demaille <akim@epita.fr>
8623
8624 * src/symtab.c (symbol_free): Remove dead deactivated code:
8625 type_name are properly removed.
8626 Don't use XFREE to free items that cannot be NULL.
8627 * src/struniq.h, src/struniq.c: New.
8628 * src/main.c (main): Initialize/free struniqs.
8629 * src/parse-gram.y (%union): Add astruniq member.
8630 (yyprint): Adjust.
8631 * src/scan-gram.l (<{tag}>): Return a struniq.
8632 Free the obstack bit that used to store it.
8633 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8634
7672019c
PE
86352002-11-11 Paul Eggert <eggert@twinsun.com>
8636
8637 Revamp to fix many (but not all) of the C- and M4-related quoting
8638 problems. Among other things, this fixes the Bison bug reported
8639 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 8640 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
8641
8642 Use new @ escapes consistently. Represent brackets with @{ and @}
8643 rather than @<:@ and @:>@, since this works a bit better with dumb
8644 editors like vi. Represent @ with @@, since @ is now consistently
8645 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8646 __ofile__, to avoid unexpected expansions. Similarly, use @output
8647 rather than #output.
8648
8649 * data/c.m4 (b4_copyright): Omit file name from comment, since
8650 the file name could contain "*/".
8651 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8652 be quoted. All uses changed.
8653
8654 * data/glr.c: Use new @ escapes consistently.
8655 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8656 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8657 Remove, since they couldn't handle arbitrary characters in file
8658 names.
8659 * data/lalr1.cc: Likewise.
8660 * data/yacc.c: Likewise.
8661
8662 * src/files.c (output_infix): Remove; all uses removed.
8663 * src/files.h: Likewise.
8664
8665 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8666 mishandled funny characters in file names, and anyway it isn't
8667 needed any more.
8668 * data/yacc.c: Likewise.
8669 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8670
8671 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8672 * data/yacc.c: Likewise.
8673
8674 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8675 strings now.
8676 (muscle_init): Quote filename as a C string.
8677 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8678 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8679 * src/output.c (escaped_file_name_output): New function.
8680 (prepare_symbols): Quote tokens for M4.
8681 (prepare): Don't insert output_infix, output_prefix,
8682 output_parser_name, output_header_name; this is now down by scan-skel.
8683 Insert skeleton as a C string.
8684
8685 * src/output.c (user_actions_output, symbol_destructors_output,
8686 symbol_printers_output): Quote filenames for C and M4.
8687 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8688
8689 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8690 escapes other than \\ and \'; this simplifies the code.
8691 (<SC_STRING>): Likewise, for \\ and \".
8692 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8693 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8694 Use new escapes @{ and @} for [ and ].
8695
8696 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8697 them with auto vars.
8698 Switch to new escape scheme, where @ is the escape character uniformly.
8699 Abort if a stray escape character is found. Avoid unbounded input
8700 buffer when parsing non-escaped text.
8701
8702 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8703 __oline__, #output, $@, and @{ do not have unintended meanings.
8704
acea4f3b
PE
87052002-11-09 Paul Eggert <eggert@twinsun.com>
8706
8707 Fix the test failure due to GCC warnings described in
161a71f3 8708 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
8709 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8710 evaluate to 0 if it's impossible for NINF to be in the respective
8711 table.
8712 (yygetLRActions, yyrecoverParseError): Use them.
8713
8714 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8715 counted in the token inserted at end of file. Now takes
8716 location_t *, not location_t, so that the location can be
8717 adjusted. All uses changed.
8718
8719 * tests/regression.at (Invalid inputs): Adjust wording in
8720 diagnostic to match the new behavior.
8721
8722 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
8723 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
8724 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
8725 abort ();'. This reduces the runtime of the "Many lookaheads"
8726 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
8727 GCC 3.2.
8728
20ef1ad5
PE
87292002-11-07 Paul Eggert <eggert@twinsun.com>
8730
8731 * src/parse-gram.y (CHARACTER): Remove unused token.
8732 All uses removed.
8733
8734 * src/scan-gram.l: Remove stack option. We no longer use the
8735 stack, since the stack was never deeper than 1; instead, use the
8736 new auto var c_context to record the stacked value.
8737
8738 Remove nounput option. At an unexpected end of file, we now unput
8739 the minimal input necessary to end cleanly; this simplifies the
8740 code.
8741
8742 Avoid unbounded token sizes where this is easy.
8743
8744 (unexpected_end_of_file): New function.
8745 Use it to systematize the error message on unexpected EOF.
8746 (last-string): Now auto, not static.
8747 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
8748 (scanner_last_string_free): Remove; not used.
8749 (percent_percent_count): Move decl to just before use.
8750 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
8751 not the (never otherwised-used) CHARACTER.
8752
93724f13
AD
87532002-11-07 Akim Demaille <akim@epita.fr>
8754
8755 Let yyerror always receive the msg as last argument, so that
8756 yyerror can be variadic.
8757
8758 * data/yacc.c (b4_yyerror_args): New.
8759 Use it when calling yyerror.
8760 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
8761 Use it when calling yyerror.
8762 * doc/bison.texinfo (Error Reporting): Adjust.
8763 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
8764 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
8765
6e40b4eb
AD
87662002-11-06 Akim Demaille <akim@epita.fr>
8767
8768 #line should have quoted strings.
8769 Ideally, this should be done by m4_quotearg.
8770
8771 * src/scan-skel.l: Include quotearg.h.
8772 Quote __ofile__.
8773 * src/output.c (symbol_printers_output)
8774 (symbol_destructors_output): Quote the file name.
8775
2dfbfc12
AD
87762002-11-06 Akim Demaille <akim@epita.fr>
8777
8778 * tests/regression.at (Invalid inputs): Adjust to the recent
8779 messages.
8780
437c2d80
AD
87812002-11-06 Akim Demaille <akim@epita.fr>
8782
8783 Restore --no-lines.
8784 Reported by Jim Kent.
8785
8786 * data/c.m4 (b4_syncline): New.
8787 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
8788 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
8789 * src/output.c (user_actions_output): Likewise.
8790 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 8791 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 8792
900c5db5
AD
87932002-11-06 Akim Demaille <akim@epita.fr>
8794
8795 * src/main.c (main): Free `infile'.
8796 * src/scan-gram.l (handle_syncline): New.
8797 Recognize `#line'.
8798 * src/output.c (user_actions_output, symbol_destructors_output)
8799 (symbol_printers_output): Use the location's file name, not
8800 infile.
8801 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8802
e183b123 88032002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 8804
e183b123 8805 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 8806 either has GLR conflict entries.
e183b123 8807
193eb6b7
PE
88082002-11-05 Paul Eggert <eggert@twinsun.com>
8809
e183b123
PE
8810 * src/scan-gram.l: Use more accurate diagnostics, e.g.
8811 "integer out of range" rather than "invalid value".
8812 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
8813 accordingly.
8814
193eb6b7
PE
8815 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8816 Also, remove one static variable in the scanner.
8817
8818 * src/scan-gram.l (braces_level): Now auto, not static.
8819 Initialize to zero if the compiler is being picky.
8820 (INITIAL): Clear braces_level instead of incrementing it.
8821 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
8822 as POSIX 1003.1-2001 requires.
8823 * src/system.h (IF_LINT): New macro, taken from coreutils.
8824 * configure.ac: Define "lint" if --enable-gcc-warnings.
8825
29c01725
AD
88262002-11-05 Akim Demaille <akim@epita.fr>
8827
8828 * src/scan-gram.l: When it starts with `%', complain about the
8829 whole directive, not just that `invalid character: %'.
8830
8aeac3ca
AD
88312002-11-04 Akim Demaille <akim@epita.fr>
8832
8833 * Makefile.maint: Update from Autoconf.
8834 (update, cvs-update, po-update, do-po-update): New.
8835
793a58bb
AD
88362002-11-04 Akim Demaille <akim@epita.fr>
8837
8838 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8839 and yyerror.
8840 Have yyerror `use' its arguments.
8841 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8842 returns true when location & yacc & pure & parse-param.
8843 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8844
c4d720cd
AD
88452002-11-04 Akim Demaille <akim@epita.fr>
8846
8847 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8848 clashes.
8849 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8850 font-lock-mode.
8851 Use complain_at.
8852 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8853 slot 0.
8854
613a0dc5
PE
88552002-11-03 Paul Eggert <eggert@twinsun.com>
8856
8857 * src/reader.c (get_merge_function, grammar_current_rule_check):
8858 Use consistent diagnostics for reporting type name clashes.
8859 Quote the types with <>, for consistency with Yacc.
8860 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8861
2a8d363a
AD
88622002-11-03 Akim Demaille <akim@epita.fr>
8863
8864 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8865 New.
8866 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8867 (b4_parse_param): Remove.
8868 Use b4_identification.
8869 Propagate b4_pure_args where needed to pass them to yyerror.
8870 * data/glr.m4 (b4_parse_param): Remove.
8871 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8872 (b4_lpure_formals): New.
8873 Use b4_identification.
8874 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8875 b4_user_formals and b4_user_args.
8876 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8877 (yyreportAmbiguity): When using a pure parser, also need
8878 the location, and the parse-params.
8879 Adjust callers.
8880 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8881 When using a pure parser, also need the parse-params.
8882 Adjust callers.
8883 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8884 (%pure-parser + %parse-param) LALR and GLR parsers.
8885 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8886 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8887 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8888 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8889 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8890 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8891 * doc/bison.texinfo: Untabify the whole file.
8892 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8893 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8894 (Error Reporting): Adjust to these new directives.
8895 Document %error-verbose, deprecate YYERROR_VERBOSE.
8896
9e32add8
AD
88972002-11-03 Akim Demaille <akim@epita.fr>
8898
8899 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8900 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8901 command line options.
8902 * tests/cxx-type.at: Formatting changes.
8903
b02d90a5
PE
89042002-11-03 Paul Eggert <eggert@twinsun.com>
8905
8906 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8907 to count columns correctly, and to check for invalid inputs.
9e32add8 8908
b02d90a5
PE
8909 Use mbsnwidth to count columns correctly. Account for tabs, too.
8910 Include mbswidth.h.
8911 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8912 (extend_location): New function.
8913 (YY_LINES): Remove.
8914
8915 Handle CRLF in C code rather than in Lex code.
8916 (YY_INPUT): New macro.
8917 (no_cr_read): New function.
8918
8919 Scan UCNs, even though we don't fully handle them yet.
8920 (convert_ucn_to_byte): New function.
8921
8922 Handle backslash-newline correctly in C code.
8923 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8924 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8925 all uses changed.
8926 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8927 Use {splice} wherever C allows backslash-newline.
8928 YY_STEP after space, newline, vertical-tab.
8929 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 8930
b02d90a5
PE
8931 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8932
8933 ({int}, handle_action_dollar, handle_action_at): Check for integer
8934 overflow.
9e32add8 8935
b02d90a5
PE
8936 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8937
8938 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8939 as well as \000. Check for UCHAR_MAX, not 255.
8940 Allow \x with an arbitrary positive number of digits, as in C.
8941 Check for overflow here.
8942 Allow \? and UCNs, for compatibility with C.
8943
8944 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8945 with quote slot used by complain_at.
8946
8947 * tests/input.at: Add tests for backslash-newline, m4 quotes
8948 in symbols, long literals, and funny escapes in strings.
8949
8950 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8951 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8952 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8953 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8954 * m4/mbswidth.m4: New file, from GNU coreutils.
8955
8956 * doc/bison.texinfo (Grammar Outline): Document // comments.
8957 (Symbols): Document that trigraphs have no special meaning in Bison,
8958 nor is backslash-newline allowed.
8959 (Actions): Document that trigraphs have no special meaning.
8960
8961 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8962 no longer used.
8963
89642002-11-02 Paul Eggert <eggert@twinsun.com>
8965
8966 * src/reader.c: Don't include quote.h; not needed.
8967 (get_merge_function): Reword warning to be consistent with
8968 type clash diagnostic in grammar_current_rule_check.
8969
8970 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8971 bug in trigraph handling.
8972
8973 * src/output.c (prepare_symbols): When printing token names,
8974 escape "[" as "@<:@" and likewise for "]".
8975
8976 * src/system.h (errno): Remove declaration, as we are now
8977 assuming C89 or better, and C89 guarantees errno.
8978
762b212b
PE
89792002-10-30 Paul Eggert <eggert@twinsun.com>
8980
8981 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8982 Check for close failures.
8983 * src/files.h (xfclose): Return void, not int, since it always
8984 returned zero.
8985 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8986 indicates one.
8987 * src/output.c (output_skeleton): Use xfclose rather than fclose
8988 and ferror. xfclose now checks ferror.
8989
8990 * data/glr.c (YYLEFTMOST_STATE): Remove.
8991 (yyreportTree): Use a stack-based leftmost state. This avoids
8992 our continuing battles with bogus warnings about initializers.
8993
56100c60
AD
89942002-10-30 Akim Demaille <akim@epita.fr>
8995
8996 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8997 #if.
8998
51b4a04c
PH
89992002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9000
9001 * tests/glr-regr1.at: New test for reported regressions.
9002 * tests/testsuite.at: Add glr-regr1.at test.
9003 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 9004
bf1ebda2
PE
90052002-10-24 Paul Eggert <eggert@twinsun.com>
9006
5c16c6b1
PE
9007 Version 1.75a.
9008
bf1ebda2
PE
9009 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
9010 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
9011 we use malloc. Don't assume 'A' through 'Z' are contiguous.
9012 Don't assume strdup exists; POSIX says its an XSI extension.
9013 Check for buffer overflow on input.
9014
b526ee61
AD
90152002-10-24 Akim Demaille <akim@epita.fr>
9016
9017 * src/output.c (output_skeleton): Don't disable M4sugar comments
9018 too soon: it results in comments being expanded.
9019 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
9020 first output.
9021
f1886bb2
AD
90222002-10-24 Akim Demaille <akim@epita.fr>
9023
9024 * data/yacc.c (m4_int_type): New.
9025 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
9026 char' as only yacc.c wants K&R portability.
9027 * data/glr.c (yysigned_char): Remove.
9028 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
9029 Reported by Quoc Peyrot.
9030
c5576256
PE
90312002-10-23 Paul Eggert <eggert@twinsun.com>
9032
9033 * src/main.c (main): With --trace=time, report times even if a
9034 non-fatal error occurs. Formerly, the times were reported in some
9035 such cases but not in others.
9036 * src/reader.c (reader): Just return if a complaint has been issued,
9037 instead of exiting, so that 'main' can report times.
9038
27b0ffea
AD
90392002-10-22 Akim Demaille <akim@epita.fr>
9040
9041 * src/system.h: Include sys/types.
9042 Reported by Bert Deknuydt.
9043
223a7883
PE
90442002-10-23 Paul Eggert <eggert@twinsun.com>
9045
9046 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
9047 Suggested by Art Haas.
9048
90492002-10-22 Paul Eggert <eggert@twinsun.com>
9050
9051 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
9052 decl; not needed any more.
9053 * src/main.c (main): Use return to exit, undoing yesterday's change.
9054 The last OS that we could find where this wouldn't work is
9055 SunOS 3.5, and that's too old to worry about now.
9056
9057 * data/glr.c (struct yyltype): Define members even when not
9058 doing locations. This is more consistent with yacc.c, and it
9059 works around the following bug reports:
161a71f3
PE
9060 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
9061 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 9062
223a7883
PE
9063 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
9064 @acronym consistently. Standardize on "Yacc" instead of "YACC",
9065 "Algol" instead of "ALGOL". Give a bit more history about BNF.
9066
8b76775a
AD
90672002-10-22 Akim Demaille <akim@epita.fr>
9068
9069 * data/README: New.
9070
6db10d14
PE
90712002-10-21 Paul Eggert <eggert@twinsun.com>
9072
9073 Be consistent about 'bool'; the old code used an enum in one
9074 module and an int in another, and this violates the C standard.
9075 * m4/stdbool.m4: New file, from coreutils 4.5.3.
9076 * configure.ac (AC_HEADER_STDBOOL): Add.
9077 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
9078 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
9079 * src/symtab.c (hash_compare_symbol_t): Likewise.
9080 * src/system.h (bool, false, true): Use a definition consistent
9081 with ../lib/hash.c. All uses changed.
9082
9083 * src/complain.c (warning_issued): Renamed from warn_message_count,
9084 so that we needn't worry about integer overflow (!).
9085 Now of type bool. All uses changed.
9086 (complaint_issued): Renamed from complain_message_count; likewise.
9087
9088 * src/main.c (main): Use exit to exit with failure.
27b0ffea 9089
6db10d14
PE
9090 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
9091 rather than 1 and 0.
9092 * src/main.c (main): Likewise.
9093 * src/getargs.c (getargs): Likewise.
9094 * src/reader.c (reader): Likewise.
9095
9096 * src/getarg.c (getargs): Remove duplicate code for
9097 "Try `bison --help'".
9098
9099 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
9100 What was that "2" for?
9101
9102 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
9103 * src/getargs.c (usage): Likewise.
9104
9105 * src/getargs.c (getargs): When there are too few operands, report
9106 the last one. When there are too many, report the first extra
9107 one. This is how diffutils does it.
9108
92a060fd
PE
91092002-10-20 Paul Eggert <eggert@twinsun.com>
9110
9111 Remove K&R vestiges.
9112 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
9113 * src/complain.c (VA_START): Remove. Assume prototypes.
9114 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
9115 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
9116 fatal): Assume prototypes.
9117 * src/complain.h: Assume prototypes.
9118 * src/system.h (PARAMS): Remove.
9119 Include <limits.h> unconditionally, since it's guaranteeed even
9120 for a freestanding C89 compiler.
9121 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
9122 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 9123
e7cb57c0
AD
91242002-10-20 Akim Demaille <akim@epita.fr>
9125
9126 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
9127 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
9128 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
9129 (yyresolveStates, yyresolveAction, yyresolveStack)
9130 (yyprocessOneStack): Use them.
9131 (yy_reduce_print): New.
9132 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
9133
0245f82d
AD
91342002-10-20 Akim Demaille <akim@epita.fr>
9135
9136 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9137 arguments and output `void'.
9138 (b4_c_function): Rename as...
9139 (b4_c_function_def): this.
9140 (b4_c_function_decl, b4_c_ansi_function_def)
9141 (b4_c_ansi_function_decl): New.
9142 Change the interpretation of the arguments: before `int, foo', now
9143 `int foo, foo'.
9144 * data/yacc.c (yyparse): Prototype and define thanks to these.
9145 Adjust b4_c_function_def uses.
9146 * data/glr.c (yyparse): Likewise, but ANSI only.
9147
39912f52
AD
91482002-10-20 Akim Demaille <akim@epita.fr>
9149
9150 * src/output.c (prepare): Move the definition of `tokens_number',
9151 `nterms_number', `undef_token_number', `user_token_number_max'
9152 to...
9153 (prepare_tokens): Here.
9154 (prepare_tokens): Rename as...
9155 (prepare_symbols): this.
9156 (prepare): Move the definition of `rules_number' to...
9157 (prepare_rules): here.
9158 (prepare): Move the definition of `last', `final_state_number',
9159 `states_number' to...
9160 (prepare_states): here.
9161 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9162
20c1e2ad
AD
91632002-10-20 Akim Demaille <akim@epita.fr>
9164
9165 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9166
21964f43
AD
91672002-10-20 Akim Demaille <akim@epita.fr>
9168
9169 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9170 * data/c.m4: here.
9171
66d30cd4
AD
91722002-10-20 Akim Demaille <akim@epita.fr>
9173
9174 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9175 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9176 `pair'.
9177 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9178 `name' to...
9179 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9180 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9181 These.
9182
95f2c9fe
PE
91832002-10-19 Paul Eggert <eggert@twinsun.com>
9184
9185 Do not create a temporary file, as that involves security and
9186 cleanup headaches. Instead, use a pair of pipes.
9187 Derived from a suggestion by Florian Krohm.
9188 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9189 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9190 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9191 (BISON_PREREQ_SUBPIPE): Add.
9192 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9193 Add subpipe.h, subpipe.c.
9194 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9195 * po/POTFILES.in: Add lib/subpipe.c.
9196 * src/output.c: Include "subpipe.h".
9197 (m4_invoke): Remove decl.
9198 (scan_skel): New decl.
9199 (output_skeleton): Use pipe rather than temporary file for m4 input.
9200 Check that m4sugar.m4 is readable, to avoid deadlock.
9201 Check for pipe I/O error.
9202 * src/scan-skel.l (readpipe): Remove decl.
9203 (scan_skel): New function, to be used in place of m4_invoke.
9204 Read from stream rather than file.
66d30cd4 9205
95f2c9fe
PE
9206 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9207 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9208 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9209 this generates a more-accurate value anyway.
9210
9211 * lib/timevar.c (timervar_accumulate): Rename locals to
9212 avoid confusion with similarly-named more-global.
9213 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9214
9215 * src/output.c (prepare): Use xstrdup to convert char const *
9216 to char *, to avoid GCC warning.
9217
c19988b7
AD
92182002-10-19 Akim Demaille <akim@epita.fr>
9219
9220 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9221 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9222 Use them to have `calc.y' ready for %pure-parser.
9223 * data/yacc.c (YYLEX): Pass a yylex return type to
9224 b4_c_function_call.
9225
ae7453f2
AD
92262002-10-19 Akim Demaille <akim@epita.fr>
9227
9228 Prototype support of %lex-param and %parse-param.
9229
9230 * src/parse-gram.y: Add the definition of the %lex-param and
9231 %parse-param tokens, plus their rules.
9232 Drop the `_' version of %glr-parser.
9233 Add the "," token.
9234 * src/scan-gram.l (INITIAL): Scan them.
9235 * src/muscle_tab.c: Comment changes.
9236 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9237 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9238 (muscle_entry_s): The `value' member is no longer const.
9239 Adjust all dependencies.
9240 * src/muscle_tab.c (muscle_init): Adjust: use
9241 MUSCLE_INSERT_STRING.
9242 Initialize the obstack earlier.
9243 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9244 (muscle_pair_list_grow): New.
9245 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9246 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9247 * tests/calc.at: Use %locations, not --locations.
9248 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9249
0e575721
AD
92502002-10-19 Akim Demaille <akim@epita.fr>
9251
9252 * src/getargs.c (usage): Take status as argument and exit
9253 accordingly.
9254 Report the traditional `Try ... --help' message when status != 0.
9255 (usage, version): Don't take a FILE * as arg, it is pointless.
9256 (getargs): When there is an incorrect number of arguments, make it
9257 an error, and report it GNUlically thanks to `usage ()'.
9258
724ce7f5
PE
92592002-10-18 Paul Eggert <eggert@twinsun.com>
9260
3a781eb2
PE
9261 * data/glr.c (yyreportParseError): Don't assume that sprintf
9262 yields the length of the printed string, as this is not true
9263 on SunOS 4.1.4. Reported by Peter Klein.
9264
724ce7f5
PE
9265 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9266 * tests/conflicts.at (%nonassoc and eof): Likewise.
9267 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9268
473d0a75
AD
92692002-10-17 Akim Demaille <akim@epita.fr>
9270
9271 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9272 * src/getargs.c (trace_types, trace_args): Adjust.
9273 * src/reader.c (grammar_current_rule_prec_set)
9274 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9275 Standardize error messages.
9276 And s/@prec/%prec/!
9277 (reader): Use trace_flag to enable scanner/parser debugging,
9278 instead of an adhoc scheme.
9279 * src/scan-gram.l: Remove trailing debugging code.
9280
e76d2469
PE
92812002-10-16 Paul Eggert <eggert@twinsun.com>
9282
93e2236a
PE
9283 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9284 MUSCLE_TAB_H.
9285
e76d2469
PE
9286 * NEWS: Officially drop support for building Bison with K&R C,
9287 since it didn't work anyway and it's not worth worrying about.
9288 * Makefile.maint (wget_files): Remove ansi2knr.c.
9289 (ansi2knr.c-url_prefix): Remove.
9290 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9291 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9292 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9293
5bd1c419
PE
92942002-10-15 Paul Eggert <eggert@twinsun.com>
9295
9296 Stop using the "enum_" trick for K&R-style function definitions;
9297 it confused me, and I was the author! Instead, assume that people
9298 who want to use K&R C compilers (when using these modules in GCC,
9299 perhaps?) will run ansi2knr.
9300
9301 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9302 All uses of "enum_" changed to "enum ".
9303 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9304 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 9305
5bd1c419
PE
9306 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9307 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9308 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9309 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9310 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9311 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9312 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9313 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9314 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9315 Use function prototypes; this removes the need for declaring
9316 static functions simply to provide their prototypes.
9317 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9318 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9319 bitset_count_, bitset_create, bitset_dump, bitset_first,
9320 bitset_free, bitset_init, bitset_last, bitset_next,
9321 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9322 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9323 bitset_print, bitset_release_memory, bitset_toggle_,
9324 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9325 debug_bitset): Likewise.
9326 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9327 * lib/bitset_stats.c (bitset_log_histogram_print,
9328 bitset_percent_histogram_print, bitset_stats_and,
9329 bitset_stats_and_cmp, bitset_stats_and_or,
9330 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9331 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9332 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9333 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9334 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9335 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9336 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9337 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9338 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9339 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9340 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9341 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9342 bitset_stats_zero): Likewise.
9343 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9344 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9345 bitsetv_dump, debug_bitsetv): Likewise.
9346 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9347 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9348 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9349 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9350 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9351 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9352 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9353 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9354 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9355 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9356 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9357 Likewise.
9358 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9359 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9360 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9361 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9362 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9363 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9364 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9365 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9366 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9367 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9368 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 9369
ae26e1f0
AD
93702002-10-14 Akim Demaille <akim@epita.fr>
9371
9372 Version 1.75.
9373
d43baf71
AD
93742002-10-14 Akim Demaille <akim@epita.fr>
9375
9376 * tests/Makefile.am (maintainer-check-posix): New.
9377
7ebc83e3
AD
93782002-10-14 Akim Demaille <akim@epita.fr>
9379
9380 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9381 member.
9382
05846dae
AD
93832002-10-14 Akim Demaille <akim@epita.fr>
9384
9385 * src/tables.c (table_ninf_remap): base -> tab.
9386 Reported by Matt Rosing.
9387
1318e37d
PE
93882002-10-14 Paul Eggert <eggert@twinsun.com>
9389
447fbb17
PE
9390 * tests/action.at, tests/calc.at, tests/conflicts.at,
9391 tests/cxx-type.at, tests/headers.at, tests/input.at,
9392 tests/regression.at, tests/synclines.at, tests/torture.at:
9393 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9394 so that the tests still work even if POSIXLY_CORRECT is set.
9395 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 9396
1318e37d
PE
9397 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9398 for portability to K&R hosts. Fix typo: signed char is guaranteed
9399 only to 127, not to 128.
9400 * data/glr.c (yysigned_char): New type.
9401 * data/yacc.c (yysigned_char): Likewise.
9402 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9403
cc0f0794
PE
94042002-10-13 Paul Eggert <eggert@twinsun.com>
9405
5038f418
PE
9406 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9407 true due to limited range of data type" warning from GCC.
9408
cc0f0794
PE
9409 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9410 by wrapping enum yytokentype's definition inside #ifndef
9411 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9412
6fed0802
AD
94132002-10-13 Akim Demaille <akim@epita.fr>
9414
9415 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9416 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9417
32f0598d
AD
94182002-10-13 Akim Demaille <akim@epita.fr>
9419
9420 * Makefile.maint: Update from Autoconf 2.54.
9421 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9422
7ea9a33f
AD
94232002-10-13 Akim Demaille <akim@epita.fr>
9424
9425 * src/print.c (print_state): Separate the list of solved conflicts
9426 from the other items.
9427 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9428
ea99527d
AD
94292002-10-13 Akim Demaille <akim@epita.fr>
9430
9431 Let nondeterministic skeletons be usable with deterministic
9432 tables.
9433
9434 With the patch, GAWK compiled by GCC without -O2 passes its test
9435 suite using a GLR parser driven by LALR tables. It fails with -O2
9436 because `struct stat' gives two different answers on my machine:
9437 88 (definition of an auto var) and later 96 (memset on this var).
9438 Hence the stack is badly corrumpted. The headers inclusion is to
9439 blame: if I move the awk.h inclusion before GLR's system header
9440 inclusion, the two struct stat have the same size.
9441
9442 * src/tables.c (pack_table): Always create conflict_table.
9443 (token_actions): Always create conflict_list.
9444 * data/glr.c (YYFLAG): Remove, unused.
9445
f377f69f
AD
94462002-10-13 Akim Demaille <akim@epita.fr>
9447
9448 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9449 (O0FLAGS): New.
9450 (VALGRIND, GXX): New.
9451 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9452 * tests/bison.in: Run $PREBISON a pre-command.
9453 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9454 (maintainer-check-g++): New.
9455 * Makefile.am (maintainer-check): New.
9456
2a1fe6ed
AD
94572002-10-13 Akim Demaille <akim@epita.fr>
9458
9459 * data/glr.c: Formatting changes.
9460 Tweak some trace messages to match yacc.c's.
9461
f50adbbd
AD
94622002-10-13 Akim Demaille <akim@epita.fr>
9463
9464 GLR parsers sometimes raise parse errors instead of performing the
9465 default reduction.
9466 Reported by Charles-Henry de Boysson.
9467
9468 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 9469 check the length of the traces when %glr.
f50adbbd
AD
9470 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9471 GLR's traces.
9472 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9473 Test GLR parsers.
9474 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9475 (yyltype): Remove the yy prefix from the member names.
9476 (yytable): Complete its comment.
9477 (yygetLRActions): Map error action number from YYTABLE from
9478 YYTABLE_NINF to 0.
9479 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9480 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9481 not satisfying as we could compare an YYACTION computed from
9482 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9483 only value for error actions.
9484 (yyreportParseError): In verbose parse error messages, don't issue
9485 `error' in the list of expected tokens.
9486 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9487 next action to perform to match glr.c's decoding.
9488 (yytable): Complete its comment.
9489
bcbad5b9
PE
94902002-10-13 Paul Eggert <eggert@twinsun.com>
9491
9492 Fix problem reported by Henrik Grubbstroem in
161a71f3 9493 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
9494 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9495 because the Bison parser reads the second action before reducing
9496 the first one.
9497 * src/scan-gram.l (rule_length): New static var.
9498 Use it to keep track of the rule length in the scanner, since
9499 we can't expect the parser to be in lock-step sync with the scanner.
9500 (handle_action_dollar, handle_action_at): Use this var.
9501 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 9502
14904b89
PE
95032002-10-12 Paul Eggert <eggert@twinsun.com>
9504
1fe611e5
PE
9505 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9506 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9507 Include <sys/time.h> when checking for clock_t and struct tms.
9508 Use same include order as source.
9509 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 9510 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 9511
1fe611e5
PE
9512 * lib/timevar.c: Update copyright date and clarify comments.
9513 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 9514
1fe611e5
PE
9515 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9516 GCC version as of today, then merge Bison's changes.
9517 Change "GCC" to "Bison" in copyright notice. timevar.def's
9518 author is Akim, so change that too.
9519
98194095
PE
9520 * src/reader.c (grammar_current_rule_check):
9521 Don't worry about the default action if $$ is untyped.
9522 Prevents bogus warnings reported by Jim Gifford in
161a71f3 9523 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 9524
14904b89
PE
9525 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9526 * data/glr.c, data/lalr1.cc, data/yacc.c:
9527 Output token definitions before the first part of user declarations.
9528 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 9529 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 9530
ff6dca18
PE
95312002-10-11 Paul Eggert <eggert@twinsun.com>
9532
9533 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9534 (yyparse): here. This undoes some of the 2002-07-25 change.
9535 Compatibility problem reported by Ralf S. Engelschall with
9536 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9537
eb714592
AD
95382002-10-11 Akim Demaille <akim@epita.fr>
9539
9540 * tests/regression.at Characters Escapes): New.
9541 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9542 characters.
9543 Reported by Jan Nieuwenhuizen.
9544
b7195100
AD
95452002-10-11 Akim Demaille <akim@epita.fr>
9546
9547 * po/id.po: New.
9548
f28a0f2d
PE
95492002-10-10 Paul Eggert <eggert@twinsun.com>
9550
9551 Portability fixes for bitsets; this also avoids several GCC
9552 warnings.
9553
9554 * lib/abitset.c: Include <stddef.h>, for offsetof.
9555 * lib/lbitset.c: Likewise.
9556
9557 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9558 properly for vectors of objects. Do not assume that adding a
9559 header size to a multiple of a word size yields a value that is
9560 properly aligned for the whole union.
9561 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9562
9563 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9564 unique names for structures.
9565 * lib/ebitset.c (ebitset_bytes): Likewise.
9566 * lib/lbitset.c (lbitset_bytes): Likewise.
9567
9568 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9569 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9570 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9571 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9572 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9573 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9574 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9575 to improve the type-checking that GCC can do.
9576 * lib/bitset.c (bitset_op4_cmp): Likewise.
9577 * lib/bitset_stats.c (bitset_stats_count,
9578 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9579 bitset_stats_copy, bitset_stats_disjoint_p,
9580 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9581 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9582 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9583 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9584 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9585 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9586 bitset_stats_or_and_cmp): Likewise.
9587 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9588 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9589 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9590 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9591
9592 * lib/abitset.h: Include bitset.h, not bbitset.h.
9593 * lib/ebitset.h: Likewise.
9594 * lib/lbitset.h: Likewise.
9595
9596 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9597 All instances of parameters of type enum bitset_opts are now of
9598 type enum_bitset_opts, to conform to the C Standard, and similarly
9599 for enum_bitset_type.
9600 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9601 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9602
9603 Do not use "struct bitset_struct" to mean different things in
9604 different modules. Not only is this confusing, it violates
9605 the C Standard, which requires that structure types in different
9606 modules must be compatible if one is to be passed to the other.
9607 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9608 All instances of "struct bitset_struct *" replaced with "bitset".
9609 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9610 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9611 struct lbitset_struct, struct bitset_stats_struct): New types.
9612 All uses of struct bitset_struct changed to union bitset_union,
9613 etc.
ba0fe3c7 9614 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
9615 struct bitset_struct): Remove.
9616 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9617 struct bitset_struct): Remove.
9618 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9619 bitset_struct): Remove.
9620 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9621 Likewise.
9622
9623 Do not call a function of type T using a call that assumes the
9624 function is of a different type U. Standard C requires that a
9625 function must be called with a type that is compatible with its
9626 definition.
9627 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9628 New decls.
9629 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9630 New functions.
9631 * lib/ebitset.c (PFV): Remove.
9632 * lib/lbitset.c (PFV): Likewise.
9633 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9634 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9635 decls.
9636 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9637 (ebitset_vtable): Use them.
9638 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9639 lbitset_xor): New functions.
9640 (lbitset_vtable): Use them.
9641
9642 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9643 Declare.
9644
9645 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9646 GCC warning.
9647 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9648 Use offsetof, for simplicity.
9649
6fbe4984
PE
96502002-10-06 Paul Eggert <eggert@twinsun.com>
9651
9652 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9653 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 9654 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
9655 which was inadvertently undone by the 2002-09-30 patch.
9656 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9657 the same width as int.
9658
420f93c8
PE
96592002-10-04 Paul Eggert <eggert@twinsun.com>
9660
9661 Version 1.50.
9662
9663 * configure.ac (AC_INIT), NEWS: Increment version number.
9664
9665 * doc/bison.texinfo: Minor spelling, grammar, and white space
9666 fixes.
9667 (Symbols): Mention that any negative value returned from yylex
9668 signifies end-of-input. Warn about negative chars. Mention
9669 the portable Standard C character set.
9670
9671 The GNU coding standard says CFLAGS and YFLAGS are reserved
9672 for the installer to set.
9673 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9674 * src/Makefile.am (AM_CFLAGS): Likewise.
9675 (AM_YFLAGS): Renamed from YFLAGS.
9676
9677 Fix some MAX and MIN problems.
9678 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9679 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9680 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9681 * src/reader.c (reader): Use it.
9682
9683 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9684 POSIX 1003.1-2001 has removed fgrep.
9685
96862002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9687
9688 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9689 interpreted as signed.
9690 * lib/ebitset.c (ebitset_list): Fix bug.
9691
ff68026d
PE
96922002-10-01 Paul Eggert <eggert@twinsun.com>
9693
9694 More fixes for 64-bit hosts and large bitsets.
9695
9696 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9697 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9698 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9699 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9700 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9701 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9702 bitset_count_): Likewise.
9703 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9704 bitset_first, bitset_last): Likewise.
9705 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9706 bitset_stats_list_reverse, bitset_stats_size,
9707 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9708 Likewise.
9709 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9710 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9711 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9712 bitsetv_reflexive_transitive_closure): Likewise.
9713 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9714 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9715 Likewise.
9716 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9717 Likewise.
420f93c8 9718
ff68026d
PE
9719 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
9720 Use size_t, not unsigned int, to count bytes.
9721 * lib/abitset.h (abitset_bytes): Likewise.
9722 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
9723 Likewise.
9724 * lib/bitset.h (bitset_bytes): Likewise.
9725 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
9726 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
9727 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9728 * lib/ebitset.c (ebitset_bytes): Likewise.
9729 * lib/ebitset.h (ebitset_bytes): Likewise.
9730 * lib/lbitset.c (lbitset_bytes): Likewise.
9731 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 9732
ff68026d
PE
9733 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
9734 abitset_subset_p, abitset_disjoint_p, abitset_and,
9735 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
9736 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
9737 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
9738 abitset_or_and, abitset_or_and_cmp):
9739 Use bitset_windex instead of unsigned int.
9740 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9741 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
9742 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
9743 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
9744 Likewise.
9745 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 9746
ff68026d
PE
9747 * lib/bitset.c (bitset_print):
9748 Use proper printf formats for widths of integer types.
9749 * lib/bitset_stats.c (bitset_percent_histogram_print,
9750 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
9751 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9752 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9753 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 9754
ff68026d
PE
9755 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
9756 BITSET_SIZE_MAX): New macros.
9757 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
9758 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
9759 to BITSET_WINDEX_MAX.
9760
9761 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
9762 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
9763 since we now return the bitset_bindex type (not int).
9764
9765 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9766 when computing sizes.
9767 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9768
9769 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9770 and avoid cast to unsigned.
9771
6aa452a6
AD
97722002-09-30 Akim Demaille <akim@epita.fr>
9773
9774 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9775 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
9776 Updates from Michael Hayes.
9777
927f7817
AD
97782002-09-30 Art Haas <ahaas@neosoft.com>
9779
9780 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9781 invocations.
9782 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9783 defined.
9784
9738f41e
AD
97852002-09-27 Akim Demaille <akim@epita.fr>
9786
9787 Version 1.49c.
9788
a5c75d7f
AD
97892002-09-27 Akim Demaille <akim@epita.fr>
9790
9791 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9792 (Because of AC_LIBSOURCE).
9793
8280e179
AD
97942002-09-27 Akim Demaille <akim@epita.fr>
9795
9796 Playing with Autoscan.
9797
9798 * configure.ac: Remove the old LIBOBJ tweaks.
9799 (AC_REPLACE_FUNCS): Add strrchr and strtol.
9800 * lib/strrchr.c: New.
9801 * lib/strtol.c: New, from the Coreutils 4.5.1.
9802
ae64af35
AD
98032002-09-27 Akim Demaille <akim@epita.fr>
9804
9805 Playing with Autoscan.
9806
9807 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
9808 * lib/Makefile.am (libbison_a_SOURCES): No longer include
9809 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
9810 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
9811 Coreutils 4.5.1.
9812
d1a1114f
AD
98132002-09-24 Akim Demaille <akim@epita.fr>
9814
9815 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9816 (Frequently Asked Questions, Parser Stack Overflow): New.
9817
b906441c
AD
98182002-09-13 Akim Demaille <akim@epita.fr>
9819
9820 Playing with autoscan.
9821
9822 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
9823 * src/files.c (skeleton_find): Remove, unused.
9824 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
9825 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
9826
bd701811
AD
98272002-09-13 Akim Demaille <akim@epita.fr>
9828
9829 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9830 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9831
e0a13e7b
AD
98322002-09-13 Akim Demaille <akim@epita.fr>
9833
9834 * configure.ac: Require 2.54.
9835 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
9836 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
9837 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
9838 Remove, provided by Autoconf macros.
9839
c97011bf
AD
98402002-09-12 Akim Demaille <akim@epita.fr>
9841
9842 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9843
d862b1be
AD
98442002-09-12 Akim Demaille <akim@epita.fr>
9845
9846 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9847 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9848 Reported by Martin Mokrejs.
9849
3d38c03a
AD
98502002-09-10 Akim Demaille <akim@epita.fr>
9851
9852 * src/parse-gram.y: Associate a human readable string to each
9853 token type.
9854 * tests/regression.at (Invalid inputs): Adjust.
9855
b6347355
AD
98562002-09-10 Gary V. Vaughan <gary@gnu.org>
9857
9858 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9859 with an Autoconf-2.5x style configure.ac.
9860
09ba4ab2
PE
98612002-09-06 Paul Eggert <eggert@twinsun.com>
9862
9863 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9864 exception applies only to yacc.c. This is a modification of a
9865 patch originally suggested by Akim Demaille.
9866
21846f69
AD
98672002-09-06 Akim Demaille <akim@epita.fr>
9868
09ba4ab2
PE
9869 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9870 here to...
9871 * data/yacc.c: here.
9872
21846f69
AD
9873 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9874 LocationType.
9875 (b4_ltype): Default to yy::Location from location.hh.
9876
c0ad8bf3
AD
98772002-09-04 Jim Meyering <jim@meyering.net>
9878
9879 * data/yacc.c: Guard the declaration of yytoknum also with
9880 `#ifdef YYPRINT', so it is declared only when used.
9881
3a93251e
AD
98822002-09-04 Akim Demaille <akim@epita.fr>
9883
9884 * configure.in: Rename as...
9885 * configure.ac: this.
9886 Bump to 1.49c.
9887
427c0dda
AD
98882002-09-04 Akim Demaille <akim@epita.fr>
9889
9890 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9891 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9892 translate maintainer only messages.
9893
6a254321
PE
98942002-08-12 Paul Eggert <eggert@twinsun.com>
9895
645e30d1
PE
9896 Version 1.49b.
9897
6a254321
PE
9898 * Makefile.am (SUBDIRS): Remove intl.
9899 (DISTCLEANFILES): Remove.
9900 * NEWS: Mention that GNU M4 is now required. Clarify what is
9901 meant by "larger grammars". Mention the pt_BR translation.
9902 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9903 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9904 Bump version from 0.11.2 to 0.11.5.
9905 (BISON_PREREQ_STAGE): Remove.
9906 (AM_GNU_GETTEXT): Use external gettext.
9907 (AC_OUTPUT): Remove intl/Makefile.
9908
9909 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9910
9911 * data/glr.c: Include string.h, for strlen.
9912 (yyreportParseError): Use size_t for yysize.
9913 (yy_yypstack): No longer nested inside yypstates, as nested
9914 functions are not portable. Do not assume size_t is the
9915 same width as int.
9916 (yypstates): Do not assume that ptrdiff_t is the same width
9917 as int, and similarly for yyposn and YYINDEX.
9918
9919 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9920
9921 * lib/Makefile.am (INCLUDES): Do not include from the intl
9922 directory, which has been removed.
9923 * src/Makefile.am (INCLUDES): Likewise.
9924
9925 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9926 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9927 New vars.
9928
9929 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9930 * tests/Makefile.am (EXTRA_DIST): Likewise.
9931
9932 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9933 Do not assume that bitset_windex is the same width as unsigned.
9934
9935 * lib/abitset.c (abitset_unused_clear): Do not assume that
9936 bitset_word is the same width as int.
9937 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9938 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9939 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9940 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9941 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9942
9943 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9944 portability to one's complement hosts!).
9945 * lib/ebitset.c (ebitset_op1): Likewise.
9946 * lib/lbitset.c (lbitset_op1): Likewise.
9947
9948 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9949 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9950 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9951 Sync with fileutils.
9952 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9953 lib/gettext.h: Sync with diffutils.
9954
9955 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9956 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9957
9958 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9959 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9960 check for void *.
9961
9962 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9963 size_t; the old version tried to do this but casted improperly.
9964 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9965 (bitset_test): Now returns int, not unsigned long.
9966
9967 * lib/bitset_stats.c: Include "gettext.h".
9968 (_): New macro.
9969 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9970 name locals "index", as it generates unnecessary warnings on some
9971 hosts that have an "index" function.
9972
9973 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9974 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9975 they need translation.
9976 * src/LR0.c (state_list_append, new_itemsets, get_state,
9977 append_states, generate_states): Likewise.
9978 * src/assoc.c (assoc_to_string): Likewise.
9979 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9980 * src/gram.c (grammar_dump): Likewise.
9981 * src/injections.c (injections_compute): Likewise.
9982 * src/lalr.c (lookaheads_print): Likewise.
9983 * src/relation.c (relation_transpose): Likewise.
9984 * src/scan-gram.l: Likewise.
9985 * src/tables.c (table_grow, pack_vector): Likewise.
9986
9987 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9988 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9989 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9990 * m4/mbstate_t.m4: Sync with fileutils.
9991 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9992
9993 * po/LINGUAS: Add pt_BR.
9994 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9995 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9996 lib/timevar.c.
9997 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9998 manual recommends.
9999 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
10000
10001 * src/complain.c (strerror_r): Remove decl; not needed.
10002 (strerror): Use same pattern as ../lib/error.c.
10003
10004 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
10005
10006 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
10007
10008 * src/main.c (main): Cast result of bindtextdomain and textdomain
10009 to void, to avoid a GCC warning when --disable-nls is in effect.
10010
10011 * src/scan-gram.l: Use strings rather than escapes when possible,
10012 to minimize the number of warnings from xgettext.
10013 (handle_action_dollar, handle_action_at): Don't use isdigit,
10014 as it mishandles negative chars and it may not work as expected
10015 outside the C locale.
10016
10017 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
10018 this is a GCC extension and is not portable to other compilers.
10019
10020 * src/system.h (alloca): Use same pattern as ../lib/error.c.
10021 Do not include <ctype.h>; no longer needed.
10022 Do not include <malloc.h>; no longer needed (and generates
10023 warnings on OpenBSD 3.0).
10024
10025 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
10026 it's not portable.
10027
10028 * tests/regression.at: Do not use 'cc -c input.c -o input';
10029 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
10030
10031 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
10032 exit status as failure, not just exit status 1. Sun C exits
10033 with status 2 sometimes.
10034
10035 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
10036 Use it for the two large tests.
10037
c8f002c7
AD
100382002-08-02 Akim Demaille <akim@epita.fr>
10039
10040 * src/conflicts.c (conflicts_output): Don't output rules never
10041 reduced here, since anyway that computation doesn't work.
10042 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
10043 (rule_useless_p, rule_never_reduced_p): New.
10044 (grammar_rules_partial_print): Use a filter instead of a range.
10045 Display the title only if needed.
10046 (grammar_rules_print): Adjust.
10047 (grammar_rules_never_reduced_report): New.
10048 * src/tables.c (action_row): Move the computation of rules never
10049 reduced to...
10050 (token_actions): here.
10051 * src/main.c (main): Make the parser before making the report, so
10052 that rules never reduced are computed.
10053 Call grammar_rules_never_reduced_report.
10054 * src/print.c (print_results): Report rules never reduced.
10055 * tests/conflicts.at, tests/reduce.at: Adjust.
10056
cd08e51e
AD
100572002-08-01 Akim Demaille <akim@epita.fr>
10058
10059 Instead of attaching lookaheads and duplicating the rules being
10060 reduced by a state, attach the lookaheads to the reductions.
10061
10062 * src/state.h (state_t): Remove the `lookaheads',
10063 `lookaheads_rule' member.
10064 (reductions_t): Add a `lookaheads' member.
10065 Use a regular array for the `rules'.
10066 * src/state.c (reductions_new): Initialize the lookaheads member
10067 to 0.
10068 (state_rule_lookaheads_print): Adjust.
10069 * src/state.h, src/state.c (state_reductions_find): New.
10070 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
10071 (count_rr_conflicts): Adjust.
10072 * src/lalr.c (LArule): Remove.
10073 (add_lookback_edge): Adjust.
10074 (state_lookaheads_count): New.
10075 (states_lookaheads_initialize): Merge into...
10076 (initialize_LA): this.
10077 (lalr_free): Adjust.
10078 * src/main.c (main): Don't free nullable and derives too early: it
10079 is used by --verbose.
10080 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
10081
bb0027a9
AD
100822002-08-01 Akim Demaille <akim@epita.fr>
10083
10084 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
10085 `rule_number_t**'.
10086 (set_derives, free_derives): Rename as...
10087 (derives_compute, derives_free): this.
10088 Adjust all dependencies.
10089 * src/nullable.c (set_nullable, free_nullable): Rename as...
10090 (nullable_compute, nullable_free): these.
10091 (rule_list_t): Store rule_t *, not rule_number_t.
10092 * src/state.c (state_rule_lookaheads_print): Directly compare rule
10093 pointers, instead of their numbers.
10094 * src/main.c (main): Call nullable_free, and derives_free earlier,
10095 as they were lo longer used.
10096
3325ddc4
AD
100972002-08-01 Akim Demaille <akim@epita.fr>
10098
10099 * lib/timevar.c (get_time): Include children time.
10100 * src/lalr.h (LA, LArule): Don't export them: used with the
10101 state_t.
10102 * src/lalr.c (LA, LArule): Static.
10103 * src/lalr.h, src/lalr.c (lalr_free): New.
10104 * src/main.c (main): Call it.
10105 * src/tables.c (pack_vector): Check whether loc is >= to the
10106 table_size, not >.
10107 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
10108 (tables_generate): do it, since that's also it which allocates
10109 them.
10110 Don't free LA and LArule, main does.
10111
c6f1a33c
AD
101122002-07-31 Akim Demaille <akim@epita.fr>
10113
10114 Separate parser tables computation and output.
10115
10116 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
10117 (conflict_list, conflict_list_cnt, table, check, table_ninf)
10118 (yydefgoto, yydefact, high): Move to...
10119 * src/tables.h, src/tables.c: here.
10120 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10121 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10122 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
10123 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
10124 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
10125 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
10126 (action_row, save_row, token_actions, save_column, default_goto)
10127 (goto_actions, sort_actions, matching_state, pack_vector)
10128 (table_ninf_remap, pack_table, prepare_actions): Move to...
10129 * src/tables.c: here.
10130 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
10131 * src/output.c (token_actions, output_base, output_conflicts)
10132 (output_check): Merge into...
10133 (prepare_actions): this.
10134 (actions_output): Rename as...
10135 (user_actions_output): this.
10136 * src/main.c (main): Call tables_generate and tables_free.
10137
1509d42f
AD
101382002-07-31 Akim Demaille <akim@epita.fr>
10139
10140 Steal GCC's --time-report support.
10141
10142 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10143 stolen/adjusted from GCC.
10144 * m4/stage.m4: Remove time related checks.
10145 * m4/timevar.m4: New.
10146 * configure.in: Adjust.
10147 * src/system.h: Adjust to using timevar.h.
10148 * src/getargs.h, src/getargs.c: Support trace_time for
10149 --trace=time.
10150 * src/main.c (stage): Remove.
10151 (main): Replace `stage' invocations with timevar calls.
10152 * src/output.c: Insert pertinent timevar calls.
10153
273a74fa
AD
101542002-07-31 Akim Demaille <akim@epita.fr>
10155
10156 Let --trace have arguments.
10157
10158 * src/getargs.h (enum trace_e): New.
10159 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10160 (long_options, short_options): --trace/-T takes an optional
10161 argument.
10162 Change all the uses of trace_flag to reflect the new flags.
10163 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10164
10165 Strengthen `stage' portability.
10166
10167 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10168 * configure.in: Use it.
10169 Don't check for malloc.h and sys/times.h.
10170 * src/system.h: Include them when appropriate.
10171 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10172 times and struct tms are available.
10173
217598da
AD
101742002-07-30 Akim Demaille <akim@epita.fr>
10175
10176 In verbose parse error message, don't report `error' as an
10177 expected token.
10178 * tests/actions.at (Printers and Destructors): Adjust.
10179 * tests/calc.at (Calculator $1): Adjust.
10180 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10181 error message, do not report the parser accepts the error token in
10182 that state.
10183
52489d44
AD
101842002-07-30 Akim Demaille <akim@epita.fr>
10185
10186 Normalize conflict related messages.
10187
10188 * src/complain.h, src/complain.c (warn, complain): New.
10189 * src/conflicts.c (conflicts_print): Use them.
10190 (conflict_report_yacc): New, extracted from...
10191 (conflicts_print): here.
10192 * tests/conflicts.at, tests/existing.at: Adjust.
10193
e8832397
AD
101942002-07-30 Akim Demaille <akim@epita.fr>
10195
10196 Report rules which are never reduced by the parser: those hidden
10197 by conflicts.
10198
10199 * src/LR0.c (save_reductions): Don't make the final state too
10200 different: save its reduction (accept) instead of having a state
10201 without any action (no shift or goto, no reduce).
10202 Note: the final state is now a ``regular'' state, i.e., the
10203 parsers now contain `reduce 0' as default reduction.
10204 Nevertheless, since they decide to `accept' when yystate =
10205 final_state, they still will not reduce rule 0.
10206 * src/print.c (print_actions, print_reduction): Adjust.
10207 * src/output.c (action_row): Track reduced rules.
10208 (token_actions): Report rules never reduced.
10209 * tests/conflicts.at, tests/regression.at: Adjust.
10210
caf23d24
AD
102112002-07-30 Akim Demaille <akim@epita.fr>
10212
10213 `stage' was accidently included in a previous patch.
10214 Initiate its autoconfiscation.
10215
10216 * configure.in: Look for malloc.h and sys/times.h.
10217 * src/main.c (stage): Adjust.
10218 Report only when trace_flag.
10219
640748ee
AD
102202002-07-29 Akim Demaille <akim@epita.fr>
10221
10222 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10223 state_number_t.
10224 (errs_t): symbol_t*, not symbol_number_t.
10225 (reductions_t): rule_t*, not rule_number_t.
10226 (FOR_EACH_SHIFT): New.
10227 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10228 * src/print.c, src/print_graph.c: Adjust.
10229
88bce5a2
AD
102302002-07-29 Akim Demaille <akim@epita.fr>
10231
10232 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10233
10234 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10235 (endtoken, accept): these.
10236 * src/reader.c (reader): Set endtoken's default tag to "$end".
10237 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10238 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10239 Adjust.
10240
1bfb97db
AD
102412002-07-29 Akim Demaille <akim@epita.fr>
10242
10243 * src/reduce.c (reduce_grammar): When the language is empty,
10244 complain about the start symbol, not the axiom.
10245 Use its location.
10246 * tests/reduce.at (Empty Language): New.
10247
fc5734fe
AD
102482002-07-26 Akim Demaille <akim@epita.fr>
10249
10250 * src/reader.h, src/reader.c (gram_error): ... can't get
10251 yycontrol without making too strong assumptions on the parser
10252 itself.
10253 * src/output.c (prepare_tokens): Use the real 0th value of
10254 token_translations instead of `0'.
10255 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10256 visible here.
10257 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10258 for the time being: %locations ought to provide it to yyerror.
10259
3650b4b8
AD
102602002-07-25 Akim Demaille <akim@epita.fr>
10261
10262 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10263 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10264 * tests/regression.at (Web2c Actions): Adjust.
10265
4b3d3a8e
AD
102662002-07-25 Akim Demaille <akim@epita.fr>
10267
10268 Stop storing rules from 1 to nrules + 1.
10269
10270 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10271 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10272 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10273 Iterate from 0 to nrules.
10274 Use rule_number_as_item_number and item_number_as_rule_number.
10275 Adjust to `derive' now containing possibly 0.
10276 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10277 Handle the `- 1' part in rule numbers from/to item numbers.
10278 * src/conflicts.c (log_resolution): Fix the message which reversed
10279 shift and reduce.
10280 * src/output.c (action_row): Initialize default_rule to -1.
10281 (token_actions): Adjust.
10282 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10283 expected output.
10284 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10285
4a2a22f4
AD
102862002-07-25 Akim Demaille <akim@epita.fr>
10287
10288 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10289 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10290 (b4_c_knr_arg_decl): New.
10291 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10292 yyreport_parse_error.
10293
b8df3223
AD
102942002-07-25 Akim Demaille <akim@epita.fr>
10295
10296 * data/yacc.c (yyreport_parse_error): New, extracted from...
10297 (yyparse): here.
10298 (yydestruct, yysymprint): Move above yyparse.
10299 Be K&R compliant.
10300
a762e609
AD
103012002-07-25 Akim Demaille <akim@epita.fr>
10302
10303 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10304 replace...
10305 (b4_sint_type, b4_uint_type): these.
10306 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10307 * tests/regression.at (Web2c Actions): Adjust.
10308
12b0043a
AD
103092002-07-25 Akim Demaille <akim@epita.fr>
10310
10311 * src/gram.h (TIEM_NUMBER_MAX): New.
10312 (item_number_of_rule_number, rule_number_of_item_number): Rename
10313 as...
10314 (rule_number_as_item_number, item_number_as_rule_number): these.
10315 Adjust dependencies.
10316 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10317 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10318 (symbol_number_to_vector_number): New.
10319 (order): Of vector_number_t* type.
10320 (base_t, BASE_MAX, BASE_MIN): New.
10321 (froms, tos, width, pos, check): Of base_t type.
10322 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10323 (actrow): Of action_number_t type.
10324 (conflrow): Of unsigned int type.
10325 (table_ninf, base_ninf): New.
10326 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10327 (muscle_insert_int_table, muscle_insert_base_table)
10328 (muscle_insert_rule_number_table): New.
10329 (prepare_tokens): Output `toknum' as int_table.
10330 (action_row): Returns a rule_number_t.
10331 Use ACTION_MIN, not SHRT_MIN.
10332 (token_actions): yydefact is rule_number_t*.
10333 (table_ninf_remap): New.
10334 (pack_table): Use it for `base' and `table'.
10335 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10336 replaced with...
10337 (YYPACT_NINF, YYTABLE_NINF): these.
10338 (yypact, yytable): Compute their types instead of hard-coded
10339 `short'.
10340 * tests/regression.at (Web2c Actions): Adjust.
10341
5dde258a
AD
103422002-07-19 Akim Demaille <akim@epita.fr>
10343
10344 * src/scan-gram.l (id): Can start with an underscore.
10345
a945ec39
AD
103462002-07-16 Akim Demaille <akim@epita.fr>
10347
10348 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10349 Adjust all former `associativity' dependencies.
10350 * src/symtab.c (symbol_new): Default associativity is `undef', not
10351 `right'.
10352 (symbol_check_alias_consistence): Adjust.
10353
fae437e8
AD
103542002-07-09 Akim Demaille <akim@epita.fr>
10355
10356 * doc/bison.texinfo: Properly set the ``header'' part.
10357 Use @dircategory ``GNU programming tools'' as per Texinfo's
10358 documentation.
10359 Use @copying.
10360
1a715ef2
AD
103612002-07-09 Akim Demaille <akim@epita.fr>
10362
10363 * lib/quotearg.h: Protect against multiple inclusions.
10364 * src/location.h (location_t): Add a `file' member.
10365 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10366 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10367 `error_one_per_line' support.
10368
a5d50994
AD
103692002-07-09 Akim Demaille <akim@epita.fr>
10370
10371 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10372 * src/reader.c (lineno): Remove.
10373 Adjust all dependencies.
10374 (get_merge_function): Take a location and use complain_at.
10375 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10376 * tests/regression.at (Invalid inputs, Mixing %token styles):
10377 Adjust.
10378
b275314e
AD
103792002-07-09 Akim Demaille <akim@epita.fr>
10380
10381 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10382 recovery rule, and forbid extensions when --yacc.
10383 (gram_error): Use complain_at.
10384 * src/reader.c (reader): Exit if there were parse errors.
10385
865b9df1
AD
103862002-07-09 Akim Demaille <akim@epita.fr>
10387
10388 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10389 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10390 Reported by R Blake <blakers@mac.com>.
10391
c76e14da
AD
103922002-07-09 Akim Demaille <akim@epita.fr>
10393
10394 * data/yacc.c: Output the copyright notive in the header.
10395
7db2ed2d
AD
103962002-07-03 Akim Demaille <akim@epita.fr>
10397
10398 * src/output.c (froms, tos): Are state_number_t.
10399 (save_column): sp, sp1, and sp2 are state_number_t.
10400 (prepare): Rename `final' as `final_state_number', `nnts' as
10401 `nterms_number', `nrules' as `rules_number', `nstates' as
10402 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10403 unused.
10404 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10405 * data/lalr1.cc (nsym_): Remove, unused.
10406
e68e0410
AD
104072002-07-03 Akim Demaille <akim@epita.fr>
10408
10409 * src/lalr.h, src/lalr.c (goto_number_t): New.
10410 * src/lalr.c (goto_list_t): New.
10411 Propagate them.
10412 * src/nullable.c (rule_list_t): New.
10413 Propagate.
10414 * src/types.h: Remove.
10415
e1a4f3a4
AD
104162002-07-03 Akim Demaille <akim@epita.fr>
10417
10418 * src/closure.c (print_fderives): Use rule_rhs_print.
10419 * src/derives.c (print_derives): Use rule_rhs_print.
10420 (rule_list_t): New, replaces `shorts'.
10421 (set_derives): Add comments.
10422 * tests/sets.at (Nullable, Firsts): Adjust.
10423
536545f3
AD
104242002-07-03 Akim Demaille <akim@epita.fr>
10425
10426 * src/output.c (prepare_actions): Free `tally' and `width'.
10427 (prepare_actions): Allocate and free `order'.
10428 * src/symtab.c (symbols_free): Free `symbols'.
10429 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10430 * src/output.c (m4_invoke): Move to...
10431 * src/scan-skel.l: here.
10432 (<<EOF>>): Close yyout, and free its name.
10433
8b752b00
AD
104342002-07-03 Akim Demaille <akim@epita.fr>
10435
10436 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10437
10438 * src/LR0.c (new_state): Merge into...
10439 (state_list_append): this.
10440 (new_states): Merge into...
10441 (generate_states): here.
10442 (set_states): Don't ensure a proper `errs' state member here, do it...
10443 * src/conflicts.c (conflicts_solve): here.
10444 * src/state.h, src/state.c: Comment changes.
10445 (state_t): Rename member `shifts' as `transitions'.
10446 Adjust all dependencies.
10447 (errs_new): For consistency, also take the values as argument.
10448 (errs_dup): Remove.
10449 (state_errs_set): New.
10450 (state_reductions_set, state_transitions_set): Assert that no
10451 previous value was assigned.
10452 (state_free): New.
10453 (states_free): Use it.
10454 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10455 temporary storage: use `errs' and `nerrs' as elsewhere.
10456 (set_conflicts): Allocate and free this `errs'.
10457
613f5e1a
AD
104582002-07-02 Akim Demaille <akim@epita.fr>
10459
10460 * lib/libiberty.h: New.
10461 * lib: Update the bitset implementation from upstream.
10462 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10463 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10464 * src/main.c: Adjust bitset stats calls.
10465
26e0cadc
PE
104662002-07-01 Paul Eggert <eggert@twinsun.com>
10467
10468 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10469 char, so that negative chars don't collide with $.
10470
1154cced
AD
104712002-06-30 Akim Demaille <akim@epita.fr>
10472
10473 Have the GLR tests be `warning' checked, and fix the warnings.
10474
10475 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10476 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10477 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10478 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10479 (yyaddDeferredAction): static.
10480 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10481 (yyreportParseError): yyprefix is const.
10482 yytokenp is used only when verbose.
10483 (yy__GNUC__): Replace with __GNUC__.
10484 (yypdumpstack): yyi is size_t.
10485 (yypreference): Un-yy local variables and arguments, to avoid
10486 clashes with `yyr1'. Anyway, we are not in the user name space.
10487 (yytname_size): be an int, as is compared with ints.
10488 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10489 Use them.
10490 * tests/cxx-gram.at: Use quotation to protect $1.
10491 Use AT_COMPILE to enable warnings hunts.
10492 Prototype yylex and yyerror.
10493 `Use' argc.
10494 Include `string.h', not `strings.h'.
10495 Produce and prototype stmtMerge only when used.
10496 yylex takes a location.
10497
97650f4e
AD
104982002-06-30 Akim Demaille <akim@epita.fr>
10499
10500 We spend a lot of time in quotearg, in particular when --verbose.
10501
10502 * src/symtab.c (symbol_get): Store a quoted version of the key.
10503 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10504 Adjust all callers.
10505
d2576365
AD
105062002-06-30 Akim Demaille <akim@epita.fr>
10507
10508 * src/state.h (reductions_t): Rename member `nreds' as num.
10509 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10510 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10511
ccaf65bc
AD
105122002-06-30 Akim Demaille <akim@epita.fr>
10513
10514 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10515 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10516 (shifts_to): Rename as...
10517 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10518 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10519 (TRANSITION_IS_DISABLED, transitions_to): these.
10520
87675353
AD
105212002-06-30 Akim Demaille <akim@epita.fr>
10522
10523 * src/print.c (print_shifts, print_gotos): Merge into...
10524 (print_transitions): this.
10525 (print_transitions, print_errs, print_reductions): Align the
10526 lookaheads columns.
10527 (print_core, print_transitions, print_errs, print_state,
10528 print_grammar): Output empty lines separator before, not after.
10529 (state_default_rule_compute): Rename as...
10530 (state_default_rule): this.
10531 * tests/conflicts.at (Defaulted Conflicted Reduction),
10532 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10533 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10534
ce4ccb4b
AD
105352002-06-30 Akim Demaille <akim@epita.fr>
10536
10537 Display items as we display rules.
10538
10539 * src/gram.h, src/gram.c (rule_lhs_print): New.
10540 * src/gram.c (grammar_rules_partial_print): Use it.
10541 * src/print.c (print_core): Likewise.
10542 * tests/conflicts.at (Defaulted Conflicted Reduction),
10543 (Unresolved SR Conflicts): Adjust.
10544 (Unresolved SR Conflicts): Adjust and rename as...
10545 (Resolved SR Conflicts): this, as was meant.
10546 * tests/regression.at (Web2c Report): Adjust.
10547
bc933ef1
AD
105482002-06-30 Akim Demaille <akim@epita.fr>
10549
10550 * src/print.c (state_default_rule_compute): New, extracted from...
10551 (print_reductions): here.
10552 Pessimize, but clarify the code.
10553 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10554
53d4308d
AD
105552002-06-30 Akim Demaille <akim@epita.fr>
10556
10557 * src/output.c (action_row): Let default_rule be always a rule
10558 number.
10559
574fb2d5
AD
105602002-06-30 Akim Demaille <akim@epita.fr>
10561
10562 * src/closure.c (print_firsts, print_fderives, closure):
10563 Use BITSET_EXECUTE.
10564 * src/lalr.c (lookaheads_print): Likewise.
10565 * src/state.c (state_rule_lookaheads_print): Likewise.
10566 * src/print_graph.c (print_core): Likewise.
10567 * src/print.c (print_reductions): Likewise.
10568 * src/output.c (action_row): Likewise.
10569 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10570
05811fd7
AD
105712002-06-30 Akim Demaille <akim@epita.fr>
10572
10573 * src/print_graph.c: Use report_flag.
10574
0e4d5753
AD
105752002-06-30 Akim Demaille <akim@epita.fr>
10576
10577 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10578 to...
10579 * src/relation.h, src/relation.c (traverse, relation_digraph)
10580 (relation_print, relation_transpose): New.
10581
24c7d800
AD
105822002-06-30 Akim Demaille <akim@epita.fr>
10583
10584 * src/state.h, src/state.c (shifts_to): New.
10585 * src/lalr.c (build_relations): Use it.
10586
9222837b
AD
105872002-06-30 Akim Demaille <akim@epita.fr>
10588
10589 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10590 (item_number_of_rule_number, rule_number_of_item_number): New.
10591 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10592 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10593 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10594 Propagate their use.
10595 Much remains to be done, in particular wrt `shorts' from types.h.
10596
260008e5
AD
105972002-06-30 Akim Demaille <akim@epita.fr>
10598
10599 * src/symtab.c (symbol_new): Initialize the `printer' member.
10600
8a731ca8
AD
106012002-06-30 Akim Demaille <akim@epita.fr>
10602
10603 * src/LR0.c (save_reductions): Remove, replaced by...
10604 * src/state.h, src/state.c (state_reductions_set): New.
10605 (reductions, errs): Rename as...
10606 (reductions_t, errs_t): these.
10607 Adjust all dependencies.
10608
32e1e0a4
AD
106092002-06-30 Akim Demaille <akim@epita.fr>
10610
10611 * src/LR0.c (state_list_t, state_list_append): New.
10612 (first_state, last_state): Now symbol_list_t.
10613 (this_state): Remove.
10614 (new_itemsets, append_states, save_reductions): Take a state_t as
10615 argument.
10616 (set_states, generate_states): Adjust.
10617 (save_shifts): Remove, replaced by...
10618 * src/state.h, src/state.c (state_shifts_set): New.
10619 (shifts): Rename as...
10620 (shifts_t): this.
10621 Adjust all dependencies.
10622 * src/state.h (state_t): Remove the `next' member.
10623
e5fb6710
AD
106242002-06-30 Akim Demaille <akim@epita.fr>
10625
10626 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10627 escaped in slot 0.
10628
c7ca99d4
AD
106292002-06-30 Akim Demaille <akim@epita.fr>
10630
10631 Use hash.h for the state hash table.
10632
10633 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10634 (allocate_storage): Use state_hash_new.
10635 (free_storage): Use state_hash_free.
10636 (new_state, get_state): Adjust.
10637 * src/lalr.h, src/lalr.c (states): Move to...
10638 * src/states.h (state_t): Remove the `link' member, no longer
10639 used.
10640 * src/states.h, src/states.c: here.
10641 (state_hash_new, state_hash_free, state_hash_lookup)
10642 (state_hash_insert, states_free): New.
10643 * src/states.c (state_table, state_compare, state_hash): New.
10644 * src/output.c (output_actions): Do not free states now, since we
10645 still need to know the final_state number in `prepare', called
10646 afterwards. Do it...
10647 * src/main.c (main): here: call states_free after `output'.
10648
df0e7316
AD
106492002-06-30 Akim Demaille <akim@epita.fr>
10650
10651 * src/state.h, src/state.c (state_new): New, extracted from...
10652 * src/LR0.c (new_state): here.
10653 * src/state.h (STATE_ALLOC): Move to...
10654 * src/state.c: here.
10655 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10656 * src/state.h, src/state.c: here.
10657
39f41916
AD
106582002-06-30 Akim Demaille <akim@epita.fr>
10659
10660 * src/reader.c (gensym): Rename as...
10661 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10662 (getsym): Rename as...
10663 (symbol_get): this.
10664
d57650a5
AD
106652002-06-30 Akim Demaille <akim@epita.fr>
10666
10667 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10668 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10669 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10670 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10671
5a08f1ce
AD
106722002-06-30 Akim Demaille <akim@epita.fr>
10673
10674 Make the test suite pass with warnings checked.
10675
10676 * tests/actions.at (Printers and Destructors): Improve.
10677 Avoid unsigned vs. signed issues.
10678 * tests/calc.at: Don't exercise the scanner here, do it...
10679 * tests/input.at (Torturing the Scanner): here.
10680
720623af
PH
106812002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10682
88e7e941 10683 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
10684 reorganize first lines parallel to yacc.c.
10685
fb8135fa
AD
106862002-06-28 Akim Demaille <akim@epita.fr>
10687
10688 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10689 (b4_token_enum, b4_token_defines): New, factored from...
10690 * data/lalr1.cc, data/yacc.c, glr.c: here.
10691
41442480
AD
106922002-06-28 Akim Demaille <akim@epita.fr>
10693
10694 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10695 unused variables.
10696 * src/output.c (merger_output): static.
10697
e0e5bf84
AD
106982002-06-28 Akim Demaille <akim@epita.fr>
10699
ba0fe3c7 10700 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
10701 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10702 pacify GCC.
10703 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 10704
676385e2
PH
107052002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10706
10707 Accumulated changelog for new GLR parsing features.
10708
6a254321 10709 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
10710 conflicts_total_count.
10711 * src/conflicts.h: Ditto.
10712 * src/output.c (token_actions): Use the new name.
10713 (output_conflicts): Change conflp => conflict_list_heads, and
10714 confl => conflict_list for better readability.
10715 * data/glr.c: Use the new names.
10716 * NEWS: Add self to GLR announcement.
e0e5bf84 10717
676385e2
PH
10718 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10719
10720 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10721 Akim Demaille.
10722
10723 * data/bison.glr: Change name to glr.c
10724 * data/glr.c: Renamed from bison.glr.
10725 * data/Makefile.am: Add glr.c
e0e5bf84
AD
10726
10727 * src/getargs.c:
10728
676385e2 10729 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 10730 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 10731
676385e2
PH
10732 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10733
10734 * data/bison.glr: Be sure to restore the
10735 current #line when returning to the skeleton contents after having
10736 exposed the input file's #line.
10737
10738 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10739
10740 * data/bison.glr: Bring up to date with changes to bison.simple.
10741
10742 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10743
10744 * data/bison.glr: Correct definitions that use b4_prefix.
10745 Various reformatting.
10746 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
10747 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
10748 yytokenp argument; now part of stack.
10749 (yychar): Define to behave as documented.
10750 (yyclearin): Ditto.
e0e5bf84 10751
676385e2
PH
10752 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10753
10754 * src/reader.h: Add declaration for free_merger_functions.
10755
10756 * src/reader.c (merge_functions): New variable.
10757 (get_merge_function): New function.
10758 (free_merger_functions): New function.
10759 (readgram): Check for %prec that is not followed by a symbol.
10760 Handle %dprec and %merge declarations.
10761 (packgram): Initialize dprec and merger fields in rules array.
10762
10763 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
10764 conflict_list_cnt, conflict_list_free): New variables.
10765 (table_grow): Also grow conflict_table.
e0e5bf84 10766 (prepare_rules): Output dprec and merger tables.
676385e2 10767 (conflict_row): New function.
e0e5bf84 10768 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
10769 default reduction in conflicted states for GLR parser so that there
10770 are spaces for the conflict lists.
10771 (save_row): Also save conflict information.
10772 (token_actions): Allocate conflict list.
10773 (merger_output): New function.
10774 (pack_vector): Pack conflict table, too.
10775 (output_conflicts): New function to output yyconflp and yyconfl.
10776 (output_check): Allocate conflict_tos.
10777 (output_actions): Output conflict tables, also.
10778 (output_skeleton): Output b4_mergers definition.
10779 (prepare): Output b4_max_rhs_length definition.
10780 Use 'bison.glr' as default skeleton for GLR parsers.
10781
10782 * src/gram.c (glr_parser): New flag.
10783 (grammar_free): Call free_merger_functions.
10784
10785 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
10786 all pairs of conflicting reductions, rather than just all tokens
10787 causing conflicts. Needed to size conflict tables.
e0e5bf84 10788 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
10789 interface.
10790 (conflicts_print): Ditto.
10791 (count_total_conflicts): New function.
10792
10793 * src/reader.h (merger_list): New type.
10794 (merge_functions): New variable.
10795
10796 * src/lex.h (tok_dprec, tok_merge): New token types.
10797
10798 * src/gram.h (rule_s): Add dprec and merger fields.
10799 (glr_parser): New flag.
10800
10801 * src/conflicts.h (count_total_conflicts): New function.
10802
10803 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10804
10805 * doc/bison.texinfo (Generalized LR Parsing): New section.
10806 (GLR Parsers): New section.
10807 (Language and Grammar): Mention GLR parsing.
10808 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
10809 Correct typo ("tge" -> "the").
10810
10811 * data/bison.glr: New skeleton for GLR parsing.
10812
10813 * tests/cxx-gram.at: New tests for GLR parsing.
10814
10815 * tests/testsuite.at: Include cxx-gram.at.
10816
10817 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 10818
676385e2
PH
10819 * src/parse-gram.y:
10820
10821 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10822
10823 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 10824
b5480d74 108252002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
10826
10827 * src/options.h, src/options.c: Remove.
10828 * src/getargs.c (short_options, long_options): New.
10829
60491a94
AD
108302002-06-27 Akim Demaille <akim@epita.fr>
10831
10832 * data/bison.simple, data/bison.c++: Rename as...
10833 * data/yacc.c, data/lalr1.cc: these.
10834 * doc/bison.texinfo (Environment Variables): Remove.
10835
9be0c25b
AD
108362002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10837
10838 * src/getargs.c (report_argmatch): Initialize strtok().
10839
1ae72863
AD
108402002-06-20 Akim Demaille <akim@epita.fr>
10841
10842 * data/bison.simple (b4_symbol_actions): New, replaces...
10843 (b4_symbol_destructor, b4_symbol_printer): these.
10844 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10845 user token numbers.
10846
87542d29
AD
108472002-06-20 Akim Demaille <akim@epita.fr>
10848
10849 * data/bison.simple (yydestructor): Rename as...
10850 (yydestruct): this.
10851
1a31ed21
AD
108522002-06-20 Akim Demaille <akim@epita.fr>
10853
10854 * src/symtab.h, src/symtab.c (symbol_type_set)
10855 (symbol_destructor_set, symbol_precedence_set): The location is
10856 the last argument.
10857 Adjust all callers.
10858
e776192e
AD
108592002-06-20 Akim Demaille <akim@epita.fr>
10860
10861 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10862 internals.
10863 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10864 Takes a location.
10865 * src/symtab.h, src/symtab.c (symbol_class_set)
10866 (symbol_user_token_number_set): Likewise.
10867 Adjust all callers.
10868 Promote complain_at.
10869 * tests/input.at (Type Clashes): Adjust.
10870
5c1180b3
AD
108712002-06-20 Akim Demaille <akim@epita.fr>
10872
10873 * data/bison.simple (YYLEX): Fix the declaration when
10874 %pure-parser.
10875
e3170060
AD
108762002-06-20 Akim Demaille <akim@epita.fr>
10877
10878 * data/bison.simple (yysymprint): Don't print the token number,
10879 just its name.
10880 * tests/actions.at (Destructors): Rename as...
10881 (Printers and Destructors): this.
10882 Also exercise %printer.
10883
253862fd
AD
108842002-06-20 Akim Demaille <akim@epita.fr>
10885
10886 * data/bison.simple (YYDSYMPRINT): New.
10887 Use it to remove many of the #if YYDEBUG/if (yydebug).
10888
366eea36
AD
108892002-06-20 Akim Demaille <akim@epita.fr>
10890
10891 * src/symtab.h, src/symtab.c (symbol_t): printer and
10892 printer_location are new members.
10893 (symbol_printer_set): New.
10894 * src/parse-gram.y (PERCENT_PRINTER): New token.
10895 Handle its associated rule.
10896 * src/scan-gram.l: Adjust.
10897 (handle_destructor_at, handle_destructor_dollar): Rename as...
10898 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10899 * src/output.c (symbol_printers_output): New.
10900 (output_skeleton): Call it.
10901 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10902 since there are already many grammar files with a user `yyprint'.
10903 Replace the calls to YYPRINT to calls to yysymprint.
10904 * tests/calc.at: Adjust.
10905 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10906 taking advantage of parser very internal details (stack size!).
10907
4f25ebb0
AD
109082002-06-20 Akim Demaille <akim@epita.fr>
10909
10910 * src/scan-gram.l: Complete the scanner with the missing patterns
10911 to pacify Flex.
10912 Use `quote' and `symbol_tag_get' where appropriate.
10913
93b68a0e
AD
109142002-06-19 Akim Demaille <akim@epita.fr>
10915
10916 * tests/actions.at (Destructors): Augment to test locations.
10917 * data/bison.simple (yydestructor): Pass it the current location
10918 if locations are enabled.
10919 Prototype only when __STDC__ or C++.
10920 Change the argument names to move into the yy name space: there is
10921 user code here.
10922
58612f1d
AD
109232002-06-19 Akim Demaille <akim@epita.fr>
10924
74310291
AD
10925 * data/bison.simple (b4_pure_if): New.
10926 Use it instead of #ifdef YYPURE.
10927
109282002-06-19 Akim Demaille <akim@epita.fr>
10929
10930 * data/bison.simple (b4_location_if): New.
58612f1d
AD
10931 Use it instead of #ifdef YYLSP_NEEDED.
10932
f25bfb75
AD
109332002-06-19 Akim Demaille <akim@epita.fr>
10934
10935 Prepare @$ in %destructor, but currently don't bind it in the
10936 skeleton, as %location use is not cleaned up yet.
10937
10938 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10939 (handle_action_at): New.
10940 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10941 a braced_code_t and a location as additional arguments.
10942 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10943 unquote one when outputting `b4_dollar_dollar'.
10944 Adjust callers.
10945 * data/bison.simple (b4_eval): Remove.
10946 (b4_symbol_destructor): Adjust.
10947 * tests/input.at (Invalid @n): Adjust.
10948
c732d2c6
AD
109492002-06-19 Zack Weinberg <zack@codesourcery.com>
10950
10951 * doc/bison.texinfo: Document ability to have multiple
10952 prologue sections.
10953
8c165d89
AD
109542002-06-18 Akim Demaille <akim@epita.fr>
10955
10956 * src/files.c (compute_base_names): When computing the output file
10957 names from the input file name, strip the directory part.
10958
ca98bf57
AD
109592002-06-18 Akim Demaille <akim@epita.fr>
10960
10961 * data/bison.simple.new: Comment changes.
10962 Reported by Andreas Schwab.
10963
0bfb02ff
AD
109642002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10965
10966 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10967 there are no `label `yyoverflowlab' defined but not used' warnings
10968 when yyoverflow is defined.
10969
24c0aad7
AD
109702002-06-18 Akim Demaille <akim@epita.fr>
10971
10972 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10973 new member.
10974 (symbol_destructor_set): Adjust.
10975 * src/output.c (symbol_destructors_output): Output the destructor
10976 locations.
10977 Output the symbol name.
10978 * data/bison.simple (b4_symbol_destructor): Adjust.
10979
5719c109
AD
109802002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10981 and Akim Demaille <akim@epita.fr>
10982
10983 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10984 what's left on the stack when the error recovery hits EOF.
10985 * tests/actions.at (Destructors): Complete to exercise this case.
10986
9280d3ef
AD
109872002-06-17 Akim Demaille <akim@epita.fr>
10988
10989 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10990 arguments is really empty, not only equal to `[]'.
10991 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10992 member.
10993 (symbol_destructor_set): New.
10994 * src/output.c (symbol_destructors_output): New.
10995 * src/reader.h (brace_code_t, current_braced_code): New.
10996 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10997 (handle_dollar): Rename as...
10998 (handle_action_dollar): this.
10999 (handle_destructor_dollar): New.
11000 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
11001 (grammar_declaration): Use it.
11002 * data/bison.simple (yystos): Is always defined.
11003 (yydestructor): New.
11004 * tests/actions.at (Destructors): New.
11005 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
11006
dafdc66f
AD
110072002-06-17 Akim Demaille <akim@epita.fr>
11008
11009 * src/symlist.h, src/symlist.c (symbol_list_length): New.
11010 * src/scan-gram.l (handle_dollar, handle_at): Compute the
11011 rule_length only when needed.
11012 * src/output.c (actions_output, token_definitions_output): Output
11013 the full M4 block.
11014 * src/symtab.c: Don't access directly to the symbol tag, use
11015 symbol_tag_get.
11016 * src/parse-gram.y: Use symbol_list_free.
11017
56c47203
AD
110182002-06-17 Akim Demaille <akim@epita.fr>
11019
11020 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
11021 (symbol_list_prepend, get_type_name): Move to...
11022 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
11023 (symbol_list_prepend, symbol_list_n_type_name_get): here.
11024 Adjust all callers.
11025 (symbol_list_free): New.
11026 * src/scan-gram.l (handle_dollar): Takes a location.
11027 * tests/input.at (Invalid $n): Adjust.
11028
1e0bab92
AD
110292002-06-17 Akim Demaille <akim@epita.fr>
11030
11031 * src/reader.h, src/reader.c (symbol_list_new): Export it.
11032 (symbol_list_prepend): New.
11033 * src/parse-gram.y (%union): `list' is a new member.
11034 (symbols.1): New, replaces...
11035 (terms_to_prec.1, nterms_to_type.1): these.
11036 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
11037 Take a location as additional argument.
11038 Adjust all callers.
11039
04e60654
AD
110402002-06-15 Akim Demaille <akim@epita.fr>
11041
11042 * src/parse-gram.y: Move %token in the declaration section so that
11043 we don't depend upon CVS Bison.
11044
10e5b8bd
AD
110452002-06-15 Akim Demaille <akim@epita.fr>
11046
11047 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
11048 * src/print.c (print_core): Use it.
11049
9801d40c
AD
110502002-06-15 Akim Demaille <akim@epita.fr>
11051
11052 * src/conflicts.c (log_resolution): Accept the rule involved in
11053 the sr conflicts instead of the lookahead number that points to
11054 that rule.
11055 (flush_reduce): Accept the current lookahead vector as argument,
11056 instead of the index in LA.
11057 (resolve_sr_conflict): Accept the current number of lookahead
11058 bitset to consider for the STATE, instead of the index in LA.
11059 (set_conflicts): Adjust.
11060 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
11061
c0263492
AD
110622002-06-15 Akim Demaille <akim@epita.fr>
11063
11064 * src/state.h (state_t): Replace the `lookaheadsp' member, a
11065 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
11066 Adjust all dependencies.
11067 * src/lalr.c (initialize_lookaheads): Split into...
11068 (states_lookaheads_count, states_lookaheads_initialize): these.
11069 (lalr): Adjust.
11070
9757c359
AD
110712002-06-15 Akim Demaille <akim@epita.fr>
11072
11073 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
11074 out of...
11075 (grammar_rules_print): here.
11076 * src/reduce.c (reduce_output): Use it.
11077 * tests/reduce.at (Useless Rules, Reduced Automaton)
11078 (Underivable Rules): Adjust.
11079
6b98e4b5
AD
110802002-06-15 Akim Demaille <akim@epita.fr>
11081
11082 Copy BYacc's nice way to report the grammar.
11083
11084 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
11085 New.
11086 Don't print the rules' location, it is confusing and useless.
11087 (rule_print): Use grammar_rhs_print.
11088 * src/print.c (print_grammar): Use grammar_rules_print.
11089
6b98e4b5
AD
110902002-06-15 Akim Demaille <akim@epita.fr>
11091
11092 Complete and rationalize `useless thing' warnings.
11093
11094 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
11095 (symbol_tag_print): New.
11096 Use them everywhere in place of accessing directly the tag member.
11097 * src/gram.h, src/gram.c (rule_print): New.
11098 Use it where a rule used to be printed `by hand'.
11099 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
11100 (reduce_grammar_tables): Report the useless rules.
11101 (reduce_print): Useless things are a warning, not an error.
11102 Report it as such.
11103 * tests/reduce.at (Useless Nonterminals, Useless Rules):
11104 (Reduced Automaton, Underivable Rules): Adjust.
11105 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
11106 * tests/conflicts.at (Unresolved SR Conflicts)
11107 (Solved SR Conflicts): Adjust.
11108
ee000ba4
AD
111092002-06-15 Akim Demaille <akim@epita.fr>
11110
11111 Let symbols have a location.
11112
11113 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
11114 (getsym): Adjust.
11115 Adjust all callers.
11116 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
11117 Use location_t, not int.
11118 * src/symtab.c (symbol_check_defined): Take advantage of the
11119 location.
11120 * tests/regression.at (Invalid inputs): Adjust.
11121
8efe435c
AD
111222002-06-15 Akim Demaille <akim@epita.fr>
11123
11124 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
11125 (input): Don't try to initialize yylloc here, do it in the
11126 scanner.
11127 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
11128 * src/gram.h (rule_t): Change line and action_line into location
11129 and action_location, of location_t type.
11130 Adjust all dependencies.
11131 * src/location.h, src/location.c (empty_location): New.
11132 * src/reader.h, src/reader.c (grammar_start_symbol_set)
11133 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
11134 (grammar_current_rule_symbol_append)
11135 (grammar_current_rule_action_append): Expect a location as argument.
11136 * src/reader.c (grammar_midrule_action): Adjust to attach an
11137 action's location as dummy symbol location.
11138 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11139 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11140 the line numbers.
11141
1921f1d7
AD
111422002-06-14 Akim Demaille <akim@epita.fr>
11143
11144 Grammar declarations may be found in the grammar section.
11145
11146 * src/parse-gram.y (rules_or_grammar_declaration): New.
11147 (declarations): Each declaration may end with a semicolon, not
11148 just...
11149 (grammar_declaration): `"%union"'.
11150 (grammar): Branch to rules_or_grammar_declaration.
11151
4515534c
AD
111522002-06-14 Akim Demaille <akim@epita.fr>
11153
11154 * src/main.c (main): Invoke scanner_free.
11155
f958596b
AD
111562002-06-14 Akim Demaille <akim@epita.fr>
11157
11158 * src/output.c (m4_invoke): Extracted from...
11159 (output_skeleton): here.
11160 Free tempfile.
11161
2c569025
AD
111622002-06-14 Akim Demaille <akim@epita.fr>
11163
11164 * src/parse-gram.y (directives, directive, gram)
11165 (grammar_directives, precedence_directives, precedence_directive):
11166 Rename as...
11167 (declarations, declaration, grammar, grammar_declaration)
11168 (precedence_declaration, precedence_declarator): these.
11169 (symbol_declaration): New.
11170
592e8d4d
AD
111712002-06-14 Akim Demaille <akim@epita.fr>
11172
11173 * src/files.c (action_obstack): Remove, unused.
11174 (output_obstack): Remove it, and all its dependencies, as it is no
11175 longer needed.
11176 * src/reader.c (epilogue_set): Build the epilogue in the
11177 muscle_obstack.
11178 * src/output.h, src/output.c (muscle_obstack): Move to...
11179 * src/muscle_tab.h, src/muscle_tab.h: here.
11180 (muscle_init): Initialize muscle_obstack.
11181 (muscle_free): New.
11182 * src/main.c (main): Call it.
11183
0c15323d
AD
111842002-06-14 Akim Demaille <akim@epita.fr>
11185
11186 * src/location.h: New, extracted from...
11187 * src/reader.h: here.
11188 * src/Makefile.am (noinst_HEADERS): Merge into
11189 (bison_SOURCES): this.
11190 Add location.h.
11191 * src/parse-gram.y: Use location_t instead of Bison's.
11192 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11193 Use location_t instead of ints.
11194
e96c9728
AD
111952002-06-14 Akim Demaille <akim@epita.fr>
11196
11197 * data/bison.simple, data/bison.c++: Be sure to restore the
11198 current #line when returning to the skeleton contents after having
11199 exposed the input file's #line.
11200
75d1fe16
AD
112012002-06-12 Akim Demaille <akim@epita.fr>
11202
11203 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11204 eager.
11205 * tests/actions.at (Exotic Dollars): New.
11206
6c35d22c
AD
112072002-06-12 Akim Demaille <akim@epita.fr>
11208
11209 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11210 ['"/] too eagerly.
11211 * tests/input.at (Torturing the Scanner): New.
11212
1d6412ad
AD
112132002-06-11 Akim Demaille <akim@epita.fr>
11214
11215 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11216 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11217 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11218 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11219 * src/reader.c (reader): Use it.
11220
4cdb01db
AD
112212002-06-11 Akim Demaille <akim@epita.fr>
11222
11223 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11224 Adjust all callers.
11225 (scanner_last_string_free): New.
11226
44995b2e
AD
112272002-06-11 Akim Demaille <akim@epita.fr>
11228
11229 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11230 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11231 (last_string, YY_OBS_FREE): New.
11232 Use them when returning an ID.
11233
e9955c83
AD
112342002-06-11 Akim Demaille <akim@epita.fr>
11235
11236 Have Bison grammars parsed by a Bison grammar.
11237
11238 * src/reader.c, src/reader.h (prologue_augment): New.
11239 * src/reader.c (copy_definition): Remove.
11240
11241 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11242 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11243 (grammar_current_rule_prec_set, grammar_current_rule_check)
11244 (grammar_current_rule_symbol_append)
11245 (grammar_current_rule_action_append): Export.
11246 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11247 (symbol_list_action_append): Remove.
11248 Hook the routines from reader.
11249 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11250 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11251
11252 * src/reader.c (read_declarations): Remove, unused.
11253
11254 * src/parse-gram.y: Handle the epilogue.
11255 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11256 (grammar_start_symbol_set): this.
11257 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11258 * src/reader.c (readgram): Remove, unused.
11259 (reader): Adjust to insert eoftoken and axiom where appropriate.
11260
11261 * src/reader.c (copy_dollar): Replace with...
11262 * src/scan-gram.h (handle_dollar): this.
11263 * src/parse-gram.y: Remove `%thong'.
11264
11265 * src/reader.c (copy_at): Replace with...
11266 * src/scan-gram.h (handle_at): this.
11267
11268 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11269 New.
11270
11271 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11272 time being.
11273
11274 * src/reader.h, src/reader.c (grammar_rule_end): New.
11275
11276 * src/parse.y (current_type, current_class): New.
11277 Implement `%nterm', `%token' support.
11278 Merge `%term' into `%token'.
11279 (string_as_id): New.
11280 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11281 type name.
11282
11283 * src/parse-gram.y: Be sure to handle properly the beginning of
11284 rules.
11285
11286 * src/parse-gram.y: Handle %type.
11287 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11288
11289 * src/parse-gram.y: More directives support.
11290 * src/options.c: No longer handle source directives.
11291
11292 * src/parse-gram.y: Fix %output.
11293
11294 * src/parse-gram.y: Handle %union.
11295 Use the prologue locations.
11296 * src/reader.c (parse_union_decl): Remove.
11297
11298 * src/reader.h, src/reader.c (epilogue_set): New.
11299 * src/parse-gram.y: Use it.
11300
11301 * data/bison.simple, data/bison.c++: b4_stype is now either not
11302 defined, then default to int, or to the contents of %union,
11303 without `union' itself.
11304 Adjust.
11305 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11306
11307 * src/output.c (actions_output): Don't output braces, as they are
11308 already handled by the scanner.
11309
11310 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11311 characters to themselves.
11312
11313 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11314 that the epilogue has a proper #line.
11315
11316 * src/parse-gram.y: Handle precedence/associativity.
11317
11318 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11319 a terminal.
11320 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11321 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11322 at all to define terminals that cannot be emitted.
11323
11324 * src/scan-gram.l: Escape M4 characters.
11325
11326 * src/scan-gram.l: Working properly with escapes in user
11327 strings/characters.
11328
11329 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11330 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11331 grammar.
11332 Use more modest sizes, as for the time being the parser does not
11333 release memory, and therefore the process swallows a huge amount
11334 of memory.
11335
11336 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11337 stricter %token grammar.
11338
11339 * src/symtab.h (associativity): Add `undef_assoc'.
11340 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11341 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11342
11343 * tests/regression.at (Invalid %directive): Remove, as it is now
11344 meaningless.
11345 (Invalid inputs): Adjust to the new error messages.
11346 (Token definitions): The new grammar doesn't allow too many
11347 eccentricities.
11348
11349 * src/lex.h, src/lex.c: Remove.
11350 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11351 (copy_character, copy_string2, copy_string, copy_identifier)
11352 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11353 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11354 (parse_action): Remove.
11355 * po/POTFILES.in: Adjust.
11356
2e047461
AD
113572002-06-11 Akim Demaille <akim@epita.fr>
11358
cd05d13c 11359 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
11360 rule's action member: return the action as a string.
11361 Don't require `rule_length' as an argument: compute it.
11362 (grammar_current_rule_symbol_append)
11363 (grammar_current_rule_action_append): New, eved out from
11364 (readgram): here.
11365 Remove `action_flag', `rulelength', unused now.
11366
9af3fbce
AD
113672002-06-11 Akim Demaille <akim@epita.fr>
11368
11369 * src/reader.c (grammar_current_rule_prec_set).
11370 (grammar_current_rule_check): New, eved out from...
11371 (readgram): here.
11372 Remove `xaction', `first_rhs': useless.
11373 * tests/input.at (Type clashes): New.
11374 * tests/existing.at (GNU Cim Grammar): Adjust.
11375
1485e106
AD
113762002-06-11 Akim Demaille <akim@epita.fr>
11377
11378 * src/reader.c (grammar_midrule_action): New, Eved out from
11379 (readgram): here.
11380
da4160c3
AD
113812002-06-11 Akim Demaille <akim@epita.fr>
11382
11383 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11384 New.
11385 (readgram): Use them as replacement of inlined code, crule and
11386 crule1.
11387
f6d0f937
AD
113882002-06-11 Akim Demaille <akim@epita.fr>
11389
11390 * src/reader.c (grammar_end, grammar_symbol_append): New.
11391 (readgram): Use them.
11392 Make the use of `p' as local as possible.
11393
69078d4b
AD
113942002-06-10 Akim Demaille <akim@epita.fr>
11395
11396 GCJ's parser requires the tokens to be defined before the prologue.
11397
11398 * data/bison.simple: Output the token definition before the user's
11399 prologue.
11400 * tests/regression.at (Braces parsing, Duplicate string)
11401 (Mixing %token styles): Check the output from bison.
11402 (Early token definitions): New.
11403
5e424082
AD
114042002-06-10 Akim Demaille <akim@epita.fr>
11405
11406 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11407 assigning twice the same user number to a token, so that we can
11408 use it in...
11409 * src/lex.c (lex): here.
11410 Also use `symbol_class_set' instead of hand written code.
11411 * src/reader.c (parse_assoc_decl): Likewise.
11412
44536b35
AD
114132002-06-10 Akim Demaille <akim@epita.fr>
11414
11415 * src/symtab.c, src/symtab.c (symbol_class_set)
11416 (symbol_user_token_number_set): New.
11417 * src/reader.c (parse_token_decl): Use them.
11418 Use a switch instead of ifs.
11419 Use a single argument.
11420
8b9f2372
AD
114212002-06-10 Akim Demaille <akim@epita.fr>
11422
11423 Remove `%thong' support as it is undocumented, unused, duplicates
11424 `%token's job, and creates useless e-mail traffic with people who
11425 want to know what it is, why it is undocumented, unused, and
11426 duplicates `%token's job.
11427
11428 * src/reader.c (parse_thong_decl): Remove.
11429 * src/options.c (option_table): Remove "thong".
11430 * src/lex.h (tok_thong): Remove.
11431
3ae2b51f
AD
114322002-06-10 Akim Demaille <akim@epita.fr>
11433
11434 * src/symtab.c, src/symtab.c (symbol_type_set)
11435 (symbol_precedence_set): New.
11436 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11437 (value_components_used): Remove, unused.
11438
2f1afb73
AD
114392002-06-09 Akim Demaille <akim@epita.fr>
11440
11441 Move symbols handling code out of the reader.
11442
11443 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11444 (axiom): Move to...
11445 * src/symtab.h, src/symtab.c: here.
11446
11447 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11448 * src/reader.c (startval): Rename as...
11449 * src/symtab.h, src/symtab.c (startsymbol): this.
11450 * src/reader.c: Adjust.
11451
11452 * src/reader.c (symbol_check_defined, symbol_make_alias)
11453 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11454 (token_translations_init)
11455 Move to...
11456 * src/symtab.c: here.
11457 * src/reader.c (packsymbols): Move to...
11458 * src/symtab.h, src/symtab.c (symbols_pack): here.
11459 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11460 argument.
11461
e9bca3ad
AD
114622002-06-03 Akim Demaille <akim@epita.fr>
11463
11464 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11465 then statements.
11466
86eff183
AD
114672002-06-03 Akim Demaille <akim@epita.fr>
11468
11469 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11470 structs with non literals.
11471 * src/scan-skel.l: never-interactive.
11472 * src/conflicts.c (enum conflict_resolution_e): No trailing
11473 comma.
11474 * src/getargs.c (usage): Split long literal strings.
11475 Reported by Hans Aberg.
11476
717be197
AD
114772002-05-28 Akim Demaille <akim@epita.fr>
11478
11479 * data/bison.c++: Use C++ ostreams.
11480 (cdebug_): New member.
11481
670ddffd
AD
114822002-05-28 Akim Demaille <akim@epita.fr>
11483
11484 * src/output.c (output_skeleton): Be sure to allocate enough room
11485 for `/' _and_ for `\0' in full_skeleton.
11486
769b430f
AD
114872002-05-28 Akim Demaille <akim@epita.fr>
11488
11489 * data/bison.c++: Catch up with bison.simple:
11490 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11491 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11492 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11493 and popping traces.
11494
7067cb36
PH
114952002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11496
11497 * src/output.c (output_skeleton): Put an explicit path in front of
11498 the skeleton file name, rather than relying on the -I directory,
11499 to partially alleviate effects of having a skeleton file lying around
11500 in the current directory.
769b430f 11501
4a713ec2
PH
115022002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11503
769b430f 11504 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
11505 obstack_printf should be obstack_fgrow1.
11506
b408954b
AD
115072002-05-26 Akim Demaille <akim@epita.fr>
11508
11509 * src/state.h (state_t): `solved_conflicts' is a new member.
11510 * src/LR0.c (new_state): Set it to 0.
11511 * src/conflicts.h, src/conflicts.c (print_conflicts)
11512 (free_conflicts, solve_conflicts): Rename as...
11513 (conflicts_print, conflicts_free, conflicts_solve): these.
11514 Adjust callers.
11515 * src/conflicts.c (enum conflict_resolution_e)
11516 (solved_conflicts_obstack): New, used by...
11517 (log_resolution): this.
11518 Adjust to attach the conflict resolution to each state.
11519 Complete the description with the precedence/associativity
11520 information.
11521 (resolve_sr_conflict): Adjust.
11522 * src/print.c (print_state): Output its solved_conflicts.
11523 * tests/conflicts.at (Unresolved SR Conflicts)
11524 (Solved SR Conflicts): Exercise --report=all.
11525
a49aecd5
AD
115262002-05-26 Akim Demaille <akim@epita.fr>
11527
11528 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11529 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11530 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11531 (token_number_t, item_number_as_token_number)
11532 (token_number_as_item_number, muscle_insert_token_number_table):
11533 Rename as...
11534 (symbol_number_t, item_number_as_symbol_number)
11535 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11536 these, since it is more appropriate.
11537
5504898e
AD
115382002-05-26 Akim Demaille <akim@epita.fr>
11539
11540 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11541 `Error:' lines.
11542 * data/bison.simple (yystos) [YYDEBUG]: New.
11543 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11544 error recovery.
11545 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11546
ec3bc396
AD
115472002-05-25 Akim Demaille <akim@epita.fr>
11548
11549 * doc/bison.texinfo (Debugging): Split into...
11550 (Tracing): this new section, its former contents, and...
11551 (Understanding): this new section.
11552 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11553 by...
11554 (report_flag): this.
11555 Adjust all dependencies.
11556 (report_args, report_types, report_argmatch): New.
11557 (usage, getargs): Report/support -r, --report.
11558 * src/options.h
11559 (struct option_table_struct): Rename as..,
11560 (struct option_table_s): this.
11561 Rename the `set_flag' member to `flag' to match with getopt_long's
11562 struct.
11563 * src/options.c (option_table): Split verbose into an entry for
11564 %verbose, and another for --verbose.
11565 Support --report/-r, so remove -r from the obsolete --raw.
11566 * src/print.c: Attach full item sets and lookaheads reports to
11567 report_flag instead of trace_flag.
11568 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11569
78df8250
PE
115702002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11571 and Paul Eggert <eggert@twinsun.com>
769b430f 11572
78df8250
PE
11573 * data/bison.simple (yyparse): Correct error handling to conform to
11574 POSIX and yacc. Specifically, after syntax error is discovered,
11575 do not reduce further before shifting the error token.
11576 Clean up the code a bit by removing the labels yyerrdefault,
11577 yyerrhandle, yyerrpop.
11578 * NEWS: Document the above.
11579
c0c9ea05
PH
115802002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11581
11582 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11583 type; it isn't always big enough, since it doesn't necessarily
11584 include non-terminals.
769b430f 11585 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
11586 the latter can be removed.
11587 (yy_token_number_type): Remove, only one use.
11588 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11589 don't use TokenNumberType as element type.
769b430f 11590
c0c9ea05
PH
11591 * tests/regression.at: Modify expected output to agree with change
11592 to yyr1 and yytranslate.
769b430f 11593
6390a83f
FK
115942002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11595
11596 * src/reader.c (parse_action): Use copy_character instead of
11597 obstack_1grow.
11598
db7c8e9a
AD
115992002-05-13 Akim Demaille <akim@epita.fr>
11600
11601 * tests/regression.at (Token definitions): Prototype yylex and
11602 yyerror.
11603
fcc61800
PH
116042002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11605
158c687b 11606 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
11607 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11608 32-bit arithmetic.
11609 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11610
5683e9b2
AD
116112002-05-07 Akim Demaille <akim@epita.fr>
11612
11613 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11614 avoid GCC warnings.
11615
0c2d3f4c
AD
116162002-05-07 Akim Demaille <akim@epita.fr>
11617
11618 Kill GCC warnings.
11619
11620 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11621 over the RHS of each rule.
11622 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11623 * src/state.h (state_t): Member `nitems' is unsigned short.
11624 * src/LR0.c (get_state): Adjust.
11625 * src/reader.c (packgram): Likewise.
11626 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11627 `Type'.
11628 (muscle_insert_int_table): Remove, unused.
11629 (prepare_rules): Remove `max'.
11630
1565b720
AD
116312002-05-06 Akim Demaille <akim@epita.fr>
11632
11633 * src/closure.c (print_firsts): Display of the symbol tags.
11634 (bitmatrix_print): Move to...
11635 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11636 here.
11637 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11638
cfaee611
AD
116392002-05-06 Akim Demaille <akim@epita.fr>
11640
11641 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11642 hash_do_for_each.
11643
458be8e0
AD
116442002-05-06 Akim Demaille <akim@epita.fr>
11645
11646 * src/LR0.c (new_state, get_state): Instead of using the global
11647 `kernel_size' and `kernel_base', have two new arguments:
11648 `core_size' and `core'.
11649 Adjust callers.
11650
a900a624
AD
116512002-05-06 Akim Demaille <akim@epita.fr>
11652
11653 * src/reader.c (packgram): No longer end `ritem' with a 0
11654 sentinel: it is not used.
11655
d4e7d3a1
AD
116562002-05-05 Akim Demaille <akim@epita.fr>
11657
11658 New experimental feature: display the lookaheads in the report and
11659 graph.
11660
11661 * src/print (print_core): When --trace-flag, display the rules
11662 lookaheads.
11663 * src/print_graph.c (print_core): Likewise.
11664 Swap the arguments.
11665 Adjust caller.
11666
39ceb25b
AD
116672002-05-05 Akim Demaille <akim@epita.fr>
11668
11669 * tests/torture.at (Many lookaheads): New test.
11670
5372019f
AD
116712002-05-05 Akim Demaille <akim@epita.fr>
11672
11673 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11674 (GENERATE_MUSCLE_INSERT_TABLE): this.
11675 (output_int_table, output_unsigned_int_table, output_short_table)
11676 (output_token_number_table, output_item_number_table): Replace with...
11677 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11678 (muscle_insert_short_table, muscle_insert_token_number_table)
11679 (muscle_insert_item_number_table): these.
11680 Adjust all callers.
11681 (prepare_tokens): Don't free `translations', since...
11682 * src/reader.h, src/reader.c (grammar_free): do it.
11683 Move to...
11684 * src/gram.h, src/gram.c (grammar_free): here.
11685 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11686 b4_translate_max.
11687
5df5f6d5
AD
116882002-05-05 Akim Demaille <akim@epita.fr>
11689
11690 * src/output.c (output_unsigned_int_table): New.
11691 (prepare_rules): `i' is unsigned.
11692 `prhs', `rline', `r2' are unsigned int.
11693 Rename muscle `rhs_number_max' as `rhs_max'.
11694 Output muscles `prhs_max', `rline_max', and `r2_max'.
11695 Free rline and r1.
11696 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11697 to compute types instead of constant types.
11698 * tests/regression.at (Web2c Actions): Adjust.
11699
b87f8b21
AD
117002002-05-04 Akim Demaille <akim@epita.fr>
11701
11702 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11703 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11704 Adjust dependencies.
11705 * src/output.c (token_definitions_output): Be sure not to output a
11706 `#define 'a'' when fed with `%token 'a' "a"'.
11707 * tests/regression.at (Token definitions): New.
11708
8bb936e4
PE
117092002-05-03 Paul Eggert <eggert@twinsun.com>
11710
11711 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11712 for K&R C.
11713
117142002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11715
11716 * Makefile.am (SUBDIRS): Remove intl.
11717 (EXTRA_DIST): Add config/config.rpath.
11718
53c71a12
AD
117192002-05-03 Akim Demaille <akim@epita.fr>
11720
11721 * data/bison.simple (m4_if): Don't output empty enums.
11722 And actually, output valid enum definitions :(.
11723
289dd0cf
AD
117242002-05-03 Akim Demaille <akim@epita.fr>
11725
11726 * configure.bat: Remove, completely obsolete.
11727 * Makefile.am (EXTRA_DIST): Adjust.
11728 Don't distribute config.rpath...
11729 * config/Makefile.am (EXTRA_DIST): Do it.
11730
db85e524
AD
117312002-05-03 Akim Demaille <akim@epita.fr>
11732
11733 * configure.in (GETTEXT_VERSION): New.
11734 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11735
83ccf991
AD
117362002-05-03 Akim Demaille <akim@epita.fr>
11737
11738 * data/bison.simple (b4_token_enum): New.
11739 (b4_token_defines): Use it to output tokens both as #define and
11740 enums.
11741 Suggested by Paul Eggert.
11742 * src/output.c (token_definitions_output): Don't output spurious
11743 white spaces.
11744
1f418995
AD
117452002-05-03 Akim Demaille <akim@epita.fr>
11746
11747 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11748
45119f04
RA
117492002-05-02 Robert Anisko <robert@lrde.epita.fr>
11750
11751 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
11752 Update the stack class, give a try to deque as the default container.
11753
b2d52318
AD
117542002-05-02 Akim Demaille <akim@epita.fr>
11755
11756 * data/bison.simple (yyparse): Do not implement @$ = @1.
11757 (YYLLOC_DEFAULT): Adjust to do it.
11758 * doc/bison.texinfo (Location Default Action): Fix.
11759
3a8b4109
AD
117602002-05-02 Akim Demaille <akim@epita.fr>
11761
11762 * src/reader.c (parse_braces): Merge into...
11763 (parse_action): this.
11764
84614e13
AD
117652002-05-02 Akim Demaille <akim@epita.fr>
11766
11767 * configure.in (ALL_LINGUAS): Remove.
11768 * po/LINGUAS, hr.po: New.
11769
fdbcd8e2
AD
117702002-05-02 Akim Demaille <akim@epita.fr>
11771
11772 Remove the so called hairy (semantic) parsers.
11773
11774 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
11775 * src/gram.h, src/gram.c (semantic_parser): Remove.
11776 (rule_t): Remove the guard and guard_line members.
11777 * src/lex.h (token_t): remove tok_guard.
11778 * src/options.c (option_table): Remove %guard and %semantic_parser
11779 support.
11780 * src/output.c, src/output.h (guards_output): Remove.
11781 (prepare): Adjust.
11782 (token_definitions_output): Don't output the `T'
11783 tokens (???).
11784 (output_skeleton): Don't output the guards.
11785 * src/files.c, src/files.c (attrsfile): Remove.
11786 * src/reader.c (symbol_list): Remove the guard and guard_line
11787 members.
11788 Adjust dependencies.
11789 (parse_guard): Remove.
11790 * data/bison.hairy: Remove.
11791 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11792 BISON_HAIRY.
11793
82b6cb3f
AD
117942002-05-02 Akim Demaille <akim@epita.fr>
11795
11796 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
11797 (parse_guard): Rename the formal argument `stack_offset' as
11798 `rule_length', which is more readable.
11799 Adjust callers.
11800 (copy_at, copy_dollar): Instead of outputting the hard coded
11801 values of $$, $n and so forth, output invocation to b4_lhs_value,
11802 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
11803 Note: this patch partially drops `semantic-parser' support: it
11804 always does `rule_length - n', where semantic parsers ought to
11805 always use `-n'.
82b6cb3f
AD
11806 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11807 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11808
6cbfbcc5
AD
118092002-05-02 Akim Demaille <akim@epita.fr>
11810
11811 * configure.in (AC_INIT): Bump to 1.49b.
11812 (AM_INIT_AUTOMAKE): Short invocation.
11813
b8548114
AD
118142002-05-02 Akim Demaille <akim@epita.fr>
11815
11816 Version 1.49a.
11817
c20cd1fa
AD
118182002-05-01 Akim Demaille <akim@epita.fr>
11819
11820 * src/skeleton.h: Remove.
11821
8a9566d4
AD
118222002-05-01 Akim Demaille <akim@epita.fr>
11823
11824 * src/skeleton.h: Fix the #endif.
11825 Reported by Magnus Fromreide.
11826
8c6d399a
PE
118272002-04-26 Paul Eggert <eggert@twinsun.com>
11828
11829 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
11830 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 11831 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 11832
2b7ed18a
RA
118332002-04-25 Robert Anisko <robert@lrde.epita.fr>
11834
11835 * src/scan-skel.l: Postprocess quadrigraphs.
11836
11837 * src/reader.c (copy_character): New function, used to output
11838 single characters while replacing `[' and `]' with quadrigraphs, to
11839 avoid troubles with M4 quotes.
11840 (copy_comment): Output characters with copy_character.
11841 (read_additionnal_code): Likewise.
11842 (copy_string2): Likewise.
11843 (copy_definition): Likewise.
11844
11845 * tests/calc.at: Exercise M4 quoting.
11846
34a89c50
AD
118472002-04-25 Akim Demaille <akim@epita.fr>
11848
11849 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11850 between `!' and the command.
11851 Reported by Paul Eggert.
11852
0dd1580a
RA
118532002-04-24 Robert Anisko <robert@lrde.epita.fr>
11854
11855 * tests/calc.at: Exercise prologue splitting.
11856
11857 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11858 `b4_post_prologue' instead of `b4_prologue'.
11859
11860 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11861 muscles.
11862 (output): Free pre_prologue_obstack and post_prologue_obstack.
11863 * src/files.h, src/files.c (attrs_obstack): Remove.
11864 (pre_prologue_obstack, post_prologue_obstack): New.
11865 * src/reader.c (copy_definition): Add a parameter to specify the
11866 obstack to fill, instead of using attrs_obstack unconditionally.
11867 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11868 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11869
83c1796f
PE
118702002-04-23 Paul Eggert <eggert@twinsun.com>
11871
11872 * data/bison.simple: Remove unnecessary commentary and white
11873 space differences from 1_29-branch.
11874 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11875
11876 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11877 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11878 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11879 constructors or destructors.
11880
11881 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11882
1207eeac
AD
118832002-04-23 Akim Demaille <akim@epita.fr>
11884
11885 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11886 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11887 location with columns.
11888 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11889 All reported by Paul Eggert.
11890
78ab8f67
AD
118912002-04-22 Akim Demaille <akim@epita.fr>
11892
11893 * src/reduce.c (dump_grammar): Move to...
11894 * src/gram.h, src/gram.c (grammar_dump): here.
11895 Be sure to separate long item numbers.
11896 Don't read the members of a rule's prec if its nil.
11897
133c20e2
AD
118982002-04-22 Akim Demaille <akim@epita.fr>
11899
11900 * src/output.c (table_size, table_grow): New.
11901 (MAXTABLE): Remove, replace uses with table_size.
11902 (pack_vector): Instead of dying when the table is too big, grow it.
11903
9515e8a7
AD
119042002-04-22 Akim Demaille <akim@epita.fr>
11905
11906 * data/bison.simple (yyr1): Its type is that of a token number.
11907 * data/bison.c++ (r1_): Likewise.
11908 * tests/regression.at (Web2c Actions): Adjust.
11909
23c5a174
AD
119102002-04-22 Akim Demaille <akim@epita.fr>
11911
11912 * src/reader.c (token_translations_init): 256 is now the default
11913 value for the error token, i.e., it will be assigned another
11914 number if the user assigned 256 to one of her tokens.
11915 (reader): Don't force 256 to error.
11916 * doc/bison.texinfo (Symbols): Adjust.
11917 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11918 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11919 etc. instead of 10, 20, 30 (which was used to `jump' over error
11920 (256) and undefined (2)).
11921
5fbb0954
AD
119222002-04-22 Akim Demaille <akim@epita.fr>
11923
11924 Propagate more token_number_t.
11925
11926 * src/gram.h (token_number_as_item_number)
11927 (item_number_as_token_number): New.
11928 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11929 Use it to create output_item_number_table and
11930 output_token_number_table.
11931 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11932 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11933 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11934 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11935
4f940944
AD
119362002-04-22 Akim Demaille <akim@epita.fr>
11937
11938 * src/output.h, src/output.c (get_lines_number): Remove.
11939
3ded9a63
AD
119402002-04-19 Akim Demaille <akim@epita.fr>
11941
11942 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11943 as Lex/Flex'.
11944 (Debugging): More details about enabling the debugging features.
11945 (Table of Symbols): Describe $$, $n, @$, and @n.
11946 Suggested by Tim Josling.
11947
e0c471a9
AD
119482002-04-19 Akim Demaille <akim@epita.fr>
11949
11950 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11951
fecc10cd
AD
119522002-04-10 Akim Demaille <akim@epita.fr>
11953
11954 * src/system.h: Rely on HAVE_LIMITS_H.
11955 Suggested by Paul Eggert.
11956
51dec47b
AD
119572002-04-09 Akim Demaille <akim@epita.fr>
11958
11959 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11960 full stderr, and strip it according to the bison options, instead
11961 of composing the error message from different bits.
11962 This makes it easier to check for several error messages.
11963 Adjust all the invocations.
11964 Add an invocation exercising the error token.
11965 Add an invocation demonstrating a stupid error message.
11966 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11967 Adjust the tests.
11968 Error message are for stderr, not stdout.
11969
007a50a4
AD
119702002-04-09 Akim Demaille <akim@epita.fr>
11971
11972 * src/gram.h, src/gram.c (error_token_number): Remove, use
11973 errtoken->number.
11974 * src/reader.c (reader): Don't specify the user token number (2)
11975 for $undefined, as it uselessly prevents using it.
11976 * src/gram.h (token_number_t): Move to...
11977 * src/symtab.h: here.
11978 (state_t.number): Is a token_number_t.
11979 * src/print.c, src/reader.c: Use undeftoken->number instead of
11980 hard coded 2.
11981 (Even though this 2 is not the same as above: the number of the
11982 undeftoken remains being 2, it is its user token number which
11983 might not be 2).
11984 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11985 `user_token_number_max'.
11986 Output `undef_token_number'.
11987 * data/bison.simple, data/bison.c++: Use them.
11988 Be sure to map invalid yylex return values to
11989 `undef_token_number'. This saves us from gratuitous SEGV.
11990
11991 * tests/conflicts.at (Solved SR Conflicts)
11992 (Unresolved SR Conflicts): Adjust.
11993 * tests/regression.at (Web2c Actions): Adjust.
11994
06446ccf
AD
119952002-04-08 Akim Demaille <akim@epita.fr>
11996
11997 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11998 Adding #line.
11999 Remove the duplicate `typedefs'.
12000 (RhsNumberType): Fix the declaration and various other typos.
12001 Use __ofile__.
12002 * data/bison.simple: Use __ofile__.
12003 * src/scan-skel.l: Handle __ofile__.
12004
62a3e4f0
AD
120052002-04-08 Akim Demaille <akim@epita.fr>
12006
12007 * src/gram.h (item_number_t): New, the type of item numbers in
12008 RITEM. Note that it must be able to code symbol numbers as
12009 positive number, and the negation of rule numbers as negative
12010 numbers.
12011 Adjust all dependencies (pretty many).
12012 * src/reduce.c (rule): Remove this `short *' pointer: use
12013 item_number_t.
12014 * src/system.h (MINSHORT, MAXSHORT): Remove.
12015 Include `limits.h'.
12016 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
12017 (shortcpy): Remove.
12018 (MAXTABLE): Move to...
12019 * src/output.c (MAXTABLE): here.
12020 (prepare_rules): Use output_int_table to output rhs.
12021 * data/bison.simple, data/bison.c++: Adjust.
12022 * tests/torture.at (Big triangle): Move the limit from 254 to
12023 500.
12024 * tests/regression.at (Web2c Actions): Ajust.
12025
12026 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
12027 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
12028 passes, but produces negative #line number, once fixed, GCC is
12029 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
12030 C), it passes.
12031 * src/state.h (state_h): Code input lines on ints, not shorts.
12032
bb88b0fc
AD
120332002-04-08 Akim Demaille <akim@epita.fr>
12034
12035 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
12036 and then the grammar.
12037
9a636f47
AD
120382002-04-08 Akim Demaille <akim@epita.fr>
12039
12040 * src/system.h: No longer using strndup.
12041
680e8701
AD
120422002-04-07 Akim Demaille <akim@epita.fr>
12043
12044 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
12045 * src/output.c (output_table_data): Return the longest number.
12046 (prepare_tokens): Output `token_number_max').
12047 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12048 New.
12049 Use them to define yy_token_number_type/TokenNumberType.
12050 Use this type for yytranslate.
12051 * tests/torture.at (Big triangle): Push the limit from 124 to
12052 253.
12053 * tests/regression.at (Web2c Actions): Adjust.
12054
817e9f41
AD
120552002-04-07 Akim Demaille <akim@epita.fr>
12056
12057 * tests/torture.at (Big triangle): New.
12058 (GNU AWK Grammar, GNU Cim Grammar): Move to...
12059 * tests/existing.at: here.
12060
5123689b
AD
120612002-04-07 Akim Demaille <akim@epita.fr>
12062
12063 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
12064 nritems.
12065 Adjust dependencies.
12066
f3849179
AD
120672002-04-07 Akim Demaille <akim@epita.fr>
12068
12069 * src/reader.c: Normalize increments to prefix form.
12070
bd02036a
AD
120712002-04-07 Akim Demaille <akim@epita.fr>
12072
12073 * src/reader.c, symtab.c: Remove debugging code.
12074
db8837cb
AD
120752002-04-07 Akim Demaille <akim@epita.fr>
12076
12077 Rename all the `bucket's as `symbol_t'.
12078
12079 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
12080 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
12081 * src/symtab.c, src/symtab.h (bucket): Rename as...
12082 (symbol_t): this.
12083 (symbol_list_new, bucket_check_defined, bucket_make_alias)
12084 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
12085 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12086 (buckets_new, buckets_free, buckets_do): Rename as...
12087 (symbol_list_new, symbol_check_defined, symbol_make_alias)
12088 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12089 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
12090 (symbols_new, symbols_free, symbols_do): these.
12091
72a23c97
AD
120922002-04-07 Akim Demaille <akim@epita.fr>
12093
12094 Use lib/hash for the symbol table.
12095
12096 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
12097 EOF.
12098 * src/lex.c (lex): Set the `number' member of new terminals.
12099 * src/reader.c (bucket_check_defined, bucket_make_alias)
12100 (bucket_check_alias_consistence, bucket_translation): New.
12101 (reader, grammar_free, readgram, token_translations_init)
12102 (packsymbols): Adjust.
12103 (reader): Number the predefined tokens.
12104 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
12105 for predefined tokens.
12106 * src/symtab.h (bucket): Remove all the hash table related
12107 members.
12108 * src/symtab.c (symtab): Replace by...
12109 (bucket_table): this.
12110 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12111 (buckets_new, buckets_do): New.
12112
280a38c3
AD
121132002-04-07 Akim Demaille <akim@epita.fr>
12114
12115 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
12116 (start_symbol, max_user_token_number, semantic_parser)
12117 (error_token_number): Initialize.
12118 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
12119 Initialize.
12120 (reader): Don't.
12121 (errtoken, eoftoken, undeftoken, axiom): Extern.
12122
03b31c0c
AD
121232002-04-07 Akim Demaille <akim@epita.fr>
12124
12125 * src/gram.h (rule_s): prec and precsym are now pointers
12126 to the bucket giving the priority/associativity.
12127 Member `associativity' removed: useless.
12128 * src/reduce.c, src/conflicts.c: Adjust.
12129
8b3df748
AD
121302002-04-07 Akim Demaille <akim@epita.fr>
12131
12132 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
12133 Properly escape the symbols' TAG when outputting them.
12134
e601aa1d
AD
121352002-04-07 Akim Demaille <akim@epita.fr>
12136
12137 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12138
b0299a2e
AD
121392002-04-07 Akim Demaille <akim@epita.fr>
12140
12141 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12142 (LArule): this, which is an array to rule_t*.
12143 * src/print.c, src/conflicts.c: Adjust.
12144
d7e1f00c
AD
121452002-04-07 Akim Demaille <akim@epita.fr>
12146
12147 * src/gram.h (rule_t): Rename `number' as `user_number'.
12148 `number' is a new member.
12149 Adjust dependencies.
12150 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12151
cc9305dd
AD
121522002-04-07 Akim Demaille <akim@epita.fr>
12153
12154 As a result of the previous patch, it is no longer needed
12155 to reorder ritem itself.
12156
12157 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12158
b0940840
AD
121592002-04-07 Akim Demaille <akim@epita.fr>
12160
12161 Be sure never to walk through RITEMS, but use only data related to
12162 the rules themselves. RITEMS should be banished.
12163
12164 * src/output.c (output_token_translations): Rename as...
12165 (prepare_tokens): this.
12166 In addition to `translate', prepare the muscles `tname' and
12167 `toknum', which were handled by...
12168 (output_rule_data): this.
12169 Remove, and move the remainder of its outputs into...
12170 (prepare_rules): this new routines, which also merges content from
12171 (output_gram): this.
12172 (prepare_rules): Be sure never to walk through RITEMS.
12173 (output_stos): Rename as...
12174 (prepare_stos): this.
12175 (output): Always invoke prepare_states, after all, just don't use it
12176 in the output if you don't need it.
12177
643a5994
AD
121782002-04-07 Akim Demaille <akim@epita.fr>
12179
12180 * src/LR0.c (new_state): Display `nstates' as the name of the
12181 newly created state.
12182 Adjust to initialize first_state and last_state if needed.
12183 Be sure to distinguish the initial from the final state.
12184 (new_states): Create the itemset of the initial state, and use
12185 new_state.
12186 * src/closure.c (closure): Now that the initial state has its
12187 items properly set, there is no need for a special case when
12188 creating `ruleset'.
12189
12190 As a result, now the rule 0, reducing to $axiom, is visible in the
12191 outputs. Adjust the test suite.
12192
12193 * tests/conflicts.at (Solved SR Conflicts)
12194 (Unresolved SR Conflicts): Adjust.
12195 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12196 * tests/conflicts.at (S/R in initial): New.
12197
b4c4ccc2
AD
121982002-04-07 Akim Demaille <akim@epita.fr>
12199
12200 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12201 the RHS of the rules.
12202 * src/output.c (output_gram): Likewise.
12203
bba97eb2
AD
122042002-04-07 Akim Demaille <akim@epita.fr>
12205
12206 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12207 bucket.
12208 Adjust all dependencies.
12209 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12210 `number' of the buckets too.
12211 * src/gram.h: Include `symtab.h'.
12212 (associativity): Move to...
12213 * src/symtab.h: here.
12214 No longer include `gram.h'.
12215
c3b407f4
AD
122162002-04-07 Akim Demaille <akim@epita.fr>
12217
12218 * src/gram.h, src/gram.c (rules_rhs_length): New.
12219 (ritem_longest_rhs): Use it.
12220 * src/gram.h (rule_t): `number' is a new member.
12221 * src/reader.c (packgram): Set it.
12222 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12223 the end of `rules', and count them out of `nrules'.
12224 (reduce_output, dump_grammar): Adjust.
12225 * src/print.c (print_grammar): It is no longer needed to check for
12226 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12227 * tests/reduce.at (Reduced Automaton): New test.
12228
11652ab3
AD
122292002-04-07 Akim Demaille <akim@epita.fr>
12230
12231 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12232 lacking `+ 1' to nrules, Bison reported as useless a token if it
12233 was used solely to set the precedence of the last rule...
12234
26b23c1a
AD
122352002-04-07 Akim Demaille <akim@epita.fr>
12236
12237 * data/bison.c++, data/bison.simple: Don't output the current file
12238 name in #line, to avoid useless diffs between two identical
12239 outputs under different names.
12240
18bcecb0
AD
122412002-04-07 Akim Demaille <akim@epita.fr>
12242
12243 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12244 Normalize loops to using `< nrules + 1', not `<= nrules'.
12245
fa770c86
AD
122462002-04-07 Akim Demaille <akim@epita.fr>
12247
12248 * TODO: Update.
12249
d9b739c3
AD
122502002-04-07 Akim Demaille <akim@epita.fr>
12251
12252 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12253 bucket.value as bucket.number.
12254
99013900
AD
122552002-04-07 Akim Demaille <akim@epita.fr>
12256
12257 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12258 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12259 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12260 RHS, instead of being an index in RITEMS.
12261
e966383b
PE
122622002-04-04 Paul Eggert <eggert@twinsun.com>
12263
12264 * doc/bison.texinfo: Update copyright date.
12265 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12266 (Symbols): Warn about running Bison in one character set,
12267 but compiling and/or running in an incompatible one.
12268 Warn about character code 256, too.
12269
122702002-04-03 Paul Eggert <eggert@twinsun.com>
12271
12272 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12273 YYERROR_VERBOSE is nonzero, not whether it is defined.
12274
12275 Merge changes from bison-1_29-branch.
c307773e 12276
8d6c48b9
PE
122772002-03-20 Paul Eggert <eggert@twinsun.com>
12278
12279 Merge fixes from Debian bison_1.34-1.diff.
12280
12281 * configure.in (AC_PREREQ): 2.53.
12282
e53c6322
AD
122832002-03-20 Akim Demaille <akim@epita.fr>
12284
12285 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12286
9ffbeca7
PE
122872002-03-19 Paul Eggert <eggert@twinsun.com>
12288
21db0b2a
PE
12289 * src/bison.simple (YYCOPY): New macro.
12290 (YYSTACK_RELOCATE): Use it.
12291 Remove Type arg; no longer needed. All callers changed.
12292 (yymemcpy): Remove; no longer needed.
12293
9ffbeca7
PE
12294 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12295 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12296
642cb8f8
AD
122972002-03-19 Akim Demaille <akim@epita.fr>
12298
12299 Test and fix the #line outputs.
12300
12301 * tests/atlocal.at (GCC): New.
12302 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 12303 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
12304 (Action synch line, Epilogue synch line): New tests.
12305 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12306 * data/bison.simple, data/bison.c++: Use it.
12307
3c31a486
AD
123082002-03-19 Akim Demaille <akim@epita.fr>
12309
12310 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12311 (Solved SR Conflicts, %expect not enough, %expect right)
12312 (%expect too much): Move to...
12313 * tests/conflicts.at: this new file.
12314
0d8bed56
AD
123152002-03-19 Akim Demaille <akim@epita.fr>
12316
12317 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12318 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12319 that we can move to enums for instance.
12320 * src/output.c (token_definitions_output): Output a list of
12321 `token-name, token-number' instead of the #define.
12322 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12323
9208d17f
AD
123242002-03-14 Akim Demaille <akim@epita.fr>
12325
12326 Use Gettext 0.11.1.
12327
af27eacb
RA
123282002-03-09 Robert Anisko <robert@lrde.epita.fr>
12329
12330 * data/bison.c++: Make the user able to add members to the generated
12331 parser by subclassing.
12332
9101a310
RA
123332002-03-05 Robert Anisko <robert@lrde.epita.fr>
12334
12335 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12336 a character.
12337 Reported by Nicolas Tisserand and Nicolas Burrus.
12338
fff9bf0b
RA
123392002-03-04 Robert Anisko <robert@lrde.epita.fr>
12340
12341 * src/reader.c: Warn about lacking semi-colons, do not complain.
12342
64dba31e
RA
123432002-03-04 Robert Anisko <robert@lrde.epita.fr>
12344
12345 * data/bison.c++: Remove a debug line.
12346
374f5a14
RA
123472002-03-04 Robert Anisko <robert@lrde.epita.fr>
12348
12349 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12350 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12351 provide a default implementation.
12352
bfcf1f3a
AD
123532002-03-04 Akim Demaille <akim@epita.fr>
12354
12355 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12356 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12357 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12358 * tests/semantic.at (Parsing Guards): Similarly.
12359 * src/reader.at (readgram): Complain if the last rule is not ended
12360 with a semi-colon.
12361
65ccf9fc
AD
123622002-03-04 Akim Demaille <akim@epita.fr>
12363
12364 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12365 * src/closure.c: here.
12366 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12367 RTC.
12368 * src/warshall.h, src/warshall.c: Remove.
12369 * tests/sets.at (Broken Closure): Adjust.
12370
d0039cbc
AD
123712002-03-04 Akim Demaille <akim@epita.fr>
12372
12373 * src/output.c (output_skeleton): tempdir is const.
12374 bytes_read is unused.
12375
345cea78
AD
123762002-03-04 Akim Demaille <akim@epita.fr>
12377
12378 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12379 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12380 Update.
12381 From Michael Hayes.
12382
564801f7
AD
123832002-03-04 Akim Demaille <akim@epita.fr>
12384
12385 * src/closure.c (closure): `r' is unused.
12386
e5352bc7
AD
123872002-03-04 Akim Demaille <akim@epita.fr>
12388
12389 * tests/sets.at (Broken Closure): Add the ending `;'.
12390 * src/reader.at (readgram): Complain if a rule is not ended with a
12391 semi-colon.
12392
914feea9
AD
123932002-03-04 Akim Demaille <akim@epita.fr>
12394
12395 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12396 (count_sr_conflicts): Use bitset_count.
12397 * src/reduce.c (inaccessable_symbols): Ditto.
12398 (bits_size): Remove.
12399 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12400
f0250de6
AD
124012002-03-04 Akim Demaille <akim@epita.fr>
12402
12403 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12404 * src/reduce.c: Remove the `bitset_zero's following the
12405 `bitset_create's, as now it is performed by the latter.
12406
ef017502
AD
124072002-03-04 Akim Demaille <akim@epita.fr>
12408
12409 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12410 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12411 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12412 latest sources from Michael.
12413
76514394
AD
124142002-03-04 Akim Demaille <akim@epita.fr>
12415
12416 * src/output.c (output): Don't free the grammar.
12417 * src/reader.c (grammar_free): New.
12418 * src/main.c (main): Call it and don't free symtab here.
12419
55024580
AD
124202002-03-04 Akim Demaille <akim@epita.fr>
12421
12422 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12423 before returning.
12424 Reported by Benoit Perrot.
12425
f9abaa2c
AD
124262002-03-04 Akim Demaille <akim@epita.fr>
12427
12428 Use bitset operations when possible, not loops over bits.
12429
12430 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12431 bitset_or.
12432 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12433 * src/reduce.c (useless_nonterminals): Formatting changes.
12434 * src/warshall.c (TC): Use bitset_or.
12435
0e721e75
AD
124362002-03-04 Akim Demaille <akim@epita.fr>
12437
12438 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12439 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12440 Ditto.
12441
0fb1ffb1
AD
124422002-03-04 Akim Demaille <akim@epita.fr>
12443
12444 * src/lalr.c (F): Now a bitset*.
12445 Adjust all dependencies.
12446
b86796bf
AD
124472002-03-04 Akim Demaille <akim@epita.fr>
12448
12449 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12450 Adjust all dependencies.
12451
602bbf31
AD
124522002-03-04 Akim Demaille <akim@epita.fr>
12453
12454 * src/L0.c, src/LR0.h (nstates): Be size_t.
12455 Adjust comparisons (signed vs unsigned).
12456 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12457 bitset*.
12458 Adjust all dependencies.
12459
d8a0245c
AD
124602002-03-04 Akim Demaille <akim@epita.fr>
12461
12462 * src/closure.c (firsts): Now, also a bitset.
12463 Adjust all dependencies.
12464 (varsetsize): Remove, now unused.
12465 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12466
34ba9743
AD
124672002-03-04 Akim Demaille <akim@epita.fr>
12468
12469 * src/print.c: Convert to use bitset.h, not hand coded iterations
12470 over ints.
12471
ed86e78c
AD
124722002-03-04 Akim Demaille <akim@epita.fr>
12473
12474 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12475
dfdb1797
AD
124762002-03-04 Akim Demaille <akim@epita.fr>
12477
12478 * src/closure.c (ruleset): Be a bitset.
12479 (rulesetsize): Remove.
12480
7086e707
AD
124812002-03-04 Akim Demaille <akim@epita.fr>
12482
12483 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12484 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12485 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12486 * src/closure.c (fderives): Be an array of bitsets.
12487
98254360
RA
124882002-02-28 Robert Anisko <robert@lrde.epita.fr>
12489
12490 * data/bison.c++: Merge the two generated headers. Insert a copyright
12491 notice in each output file.
12492
a75c057f
AD
124932002-02-28 Akim Demaille <akim@epita.fr>
12494
12495 * data/bison.c++: Copy the prologue of bison.simple to fetch
12496 useful M4 definitions, such as b4_header_guard.
12497
06b00abc
AD
124982002-02-25 Akim Demaille <akim@epita.fr>
12499
12500 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
12501 translator friendly scheme for the bgr
12502 copyright notice.
06b00abc 12503
70e7d534
AD
125042002-02-25 Akim Demaille <akim@epita.fr>
12505
12506 * src/output.c (header_output): Remove, now handled completely via
12507 M4.
12508
abe017f6
AD
125092002-02-25 Akim Demaille <akim@epita.fr>
12510
12511 * m4/m4.m4: New, from CVS Autoconf.
12512 * configure.in: Invoke it.
12513 * src/output.c (output_skeleton): Use its result instead of the
12514 hard coded name.
12515
381fb12e
AD
125162002-02-25 Akim Demaille <akim@epita.fr>
12517
12518 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12519 Fileutils 4.1.5.
12520 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12521 * src/output.c (output_skeleton): Use mkstemp to create a real
12522 temporary file.
12523 Move the filling of `skeleton' and its muscle to...
12524 (prepare): here.
12525 (output): Move the definition of the prologue muscle to...
12526 (prepare): here.
12527 * src/system.h (DEFAULT_TMPDIR): New.
12528
6f38107f
PE
125292002-02-14 Paul Eggert <eggert@twinsun.com>
12530
12531 Remove the support for C++ namespace cleanliness; it was
12532 causing more problems than it was curing, since it didn't work
12533 properly on some nonstandard C++ compilers. This can wait
12534 for a proper C++ parser.
12535
12536 * NEWS: Document this.
12537 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12538 of C++, as it's treated like C now.
12539 * src/bison.simple (YYSTD): Remove.
12540 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12541 Treat C++ just like Standard C instead of trying to support
12542 namespace cleanliness.
12543
80cce3da
AD
125442002-02-14 Akim Demaille <akim@epita.fr>
12545
12546 * tests/regression.at (else): Adjust to Andreas' change.
12547
842e8679
AD
125482002-02-14 Akim Demaille <akim@epita.fr>
12549
12550 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12551
4bda3f10
AD
125522002-02-13 Andreas Schwab <schwab@suse.de>
12553
12554 * src/output.c (output_rule_data): Don't output NULL, it might
12555 not be defined yet.
12556
4162fa07 125572002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 12558
4162fa07
RA
12559 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12560 (Copyright notice): Update.
b418ecd8 12561
bd16a5dc
AD
125622002-02-11 Akim Demaille <akim@epita.fr>
12563
12564 * tests/regression.at (%nonassoc and eof): Don't include
12565 nonportable headers.
12566
8d69a1a3
RA
125672002-02-08 Robert Anisko <robert@lrde.epita.fr>
12568
12569 * data/bison.c++: Correct error recovery. Make the user able to
12570 initialize the starting location.
12571
9b2d0677
AD
125722002-02-07 Akim Demaille <akim@epita.fr>
12573
12574 * tests/input.at: New.
12575
69e2658b
RA
125762002-02-07 Robert Anisko <robert@lrde.epita.fr>
12577
12578 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 12579 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
12580 directives around tables only needed for debugging.
12581
4aacc3a7
RA
125822002-02-07 Robert Anisko <robert@lrde.epita.fr>
12583
12584 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12585 C++ parsers.
12586 (yy::b4_name::parse): Use print_.
12587
762a801e
RA
125882002-02-07 Robert Anisko <robert@lrde.epita.fr>
12589
12590 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12591
4bb2bc3f
RA
125922002-02-07 Robert Anisko <robert@lrde.epita.fr>
12593
12594 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12595 C++ parsers.
12596 (yy::b4_name::parse): Build verbose error messages, and use error_.
12597
6b45a3ca
RA
125982002-02-06 Robert Anisko <robert@lrde.epita.fr>
12599
12600 * data/bison.c++: Fix m4 quoting in comments.
12601
50997c6e
RA
126022002-02-06 Robert Anisko <robert@lrde.epita.fr>
12603
12604 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12605 not expanded by m4.
12606
3f3eed27
AD
126072002-02-05 Akim Demaille <akim@epita.fr>
12608
12609 * data/bison.c++: Adjust to the M4 back end.
12610 More is certainly needed.
12611
be2a1a68
AD
126122002-02-05 Akim Demaille <akim@epita.fr>
12613
12614 Give a try to M4 as a back end.
12615
12616 * lib/readpipe.c: New, from wdiff.
12617 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12618 BISON_HAIRY.
12619 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12620 specific values. Now it is m4 that performs the lookup.
12621 * src/parse-skel.y: Remove.
12622 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12623 * src/output.c (actions_output, guards_output)
12624 (token_definitions_output): No longer keeps track of the output
12625 line number, hence remove the second argument.
12626 (guards_output): Check against the guard member of a rule, not the
12627 action member.
12628 Adjust callers.
12629 (output_skeleton): Don't look for the skeleton location, let m4 do
12630 that.
12631 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12632 file will be used.
12633 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12634 (prepare): Given that for the time being changesyntax is not
12635 usable in M4, rename the muscles using `-' to `_'.
12636 Define `defines_flag', `output_parser_name' and `output_header_name'.
12637 * src/output.h (actions_output, guards_output)
12638 (token_definitions_output): Adjust prototypes.
12639 * src/scan-skel.l: Instead of scanning the skeletons, it now
12640 processes the output of m4: `__oline__' and `#output'.
12641 * data/bison.simple: Adjust to be used by M4(sugar).
12642 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12643 to date.
12644 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12645 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12646 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12647 shamelessly stolen from CVS Autoconf.
12648
beda758b
AD
126492002-02-05 Akim Demaille <akim@epita.fr>
12650
12651 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12652 * configure.in: Check for the declarations of free and malloc.
12653 * src/muscle_tab.c: Adjust.
12654
5ece6d43
AD
126552002-02-05 Akim Demaille <akim@epita.fr>
12656
12657 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12658 which have no values.
12659
5bb18f9a
AD
126602002-02-05 Akim Demaille <akim@epita.fr>
12661
12662 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12663 * data/: here.
12664
894dd62e
PE
126652002-01-29 Paul Eggert <eggert@twinsun.com>
12666
12667 * src/bison.simple (YYSIZE_T): Do not define merely because
12668 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12669 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12670
82841af7
AD
126712002-01-27 Akim Demaille <akim@epita.fr>
12672
12673 Fix `%nonassoc and eof'.
12674
12675 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12676 which were not properly copied! Replace
12677 memcpy (res->errs, src->errs, src->nerrs);
12678 with
12679 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12680 !!!
12681 * tests/regression.at (%nonassoc and eof): Adjust to newest
12682 Autotest: `.' is not in the PATH.
12683
318b76e9
AD
126842002-01-27 Akim Demaille <akim@epita.fr>
12685
12686 * tests/sets.at (AT_EXTRACT_SETS): New.
12687 (Nullable): Use it.
12688 (Firsts): New.
12689
30d2f3d5
AD
126902002-01-26 Akim Demaille <akim@epita.fr>
12691
12692 * tests/actions.at, tests/calc.at, tests/headers.at,
12693 * tests/torture.at: Adjust to the newest Autotest which no longer
12694 forces `.' in the PATH.
12695
30f8c395
AD
126962002-01-25 Akim Demaille <akim@epita.fr>
12697
12698 * tests/regression.at (%nonassoc and eof): New.
12699 Suggested by Robert Anisko.
12700
29ae55f1
AD
127012002-01-24 Akim Demaille <akim@epita.fr>
12702
12703 Bison dumps core when trying to complain about broken input files.
12704 Reported by Cris van Pelt.
12705
12706 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12707 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12708 into...
12709 (Invalid inputs): Strengthen: exercise parse_percent_token.
12710
2b548aa6
RA
127112002-01-24 Robert Anisko <robert.anisko@epita.fr>
12712
12713 * src/Makefile.am: Add bison.c++.
12714 * src/bison.c++: New skeleton.
12715
bb0146c2
AD
127162002-01-21 Paolo Bonzini <bonzini@gnu.org>
12717
12718 * po/it.po: New.
12719
bec30531
AD
127202002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12721
12722 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12723
fc6edc45
MA
127242002-01-20 Marc Autret <marc@gnu.org>
12725
12726 * src/files.c (compute_output_file_names): Fix
12727
5e5d5415
MA
127282002-01-20 Marc Autret <marc@gnu.org>
12729
12730 * tests/output.at: New test.
12731 * src/files.c (compute_base_names): Don't map extensions when
12732 the YACC flag is set, use defaults.
12733 Reported by Evgeny Stambulchik.
12734
44ea3fbd
MA
127352002-01-20 Marc Autret <marc@gnu.org>
12736
ba0fe3c7
PE
12737 * src/system.h: Need to define __attribute__ away for non-GCC
12738 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
12739 Suggested by Albert Chin-A-Young.
12740
338963d1
TVH
127412002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12742
12743 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
12744 canonical definition.
12745 * src/system.h: Use the canonical definition for PARAMS (avoids
12746 a conflict with the macro from lib/hash.h).
12747
c57b2479
AD
127482002-01-11 Akim Demaille <akim@epita.fr>
12749
12750 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 12751 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 12752
b85810ae
AD
127532002-01-09 Akim Demaille <akim@epita.fr>
12754
12755 * src/files.c, src/files.h (output_infix): New.
12756 (tab_extension): Remove.
12757 (compute_base_names): Compute the former, drop the latter.
12758 * src/output.c (prepare): Insert the muscles `output-infix', and
12759 `output-suffix'.
12760 * src/parse-skel.y (string, string.1): New.
12761 (section.header): Use it.
12762 (section.yacc): Remove.
12763 (prefix): Remove too.
12764 * src/scan-skel.l: Adjust.
12765 * src/bison.simple, src/bison.hairy: Adjust.
12766
cae60122
AD
127672002-01-09 Akim Demaille <akim@epita.fr>
12768
12769 * configure.in (WERROR_CFLAGS): Compute it.
12770 * src/Makefile.am (CFLAGS): Pass it.
12771 * tests/atlocal.in (CFLAGS): Idem.
12772 * src/files.c: Fix a few warnings.
12773 (get_extension_index): Remove, unused.
12774
ae404801
AD
127752002-01-08 Akim Demaille <akim@epita.fr>
12776
12777 * src/getargs.c (AS_FILE_NAME): New.
12778 (getargs): Use it to convert DOSish file names.
12779 * src/files.c (base_name): Rename as full_base_name to avoid
12780 clashes with `base_name ()'.
12781 (filename_split): New.
12782 (compute_base_names): N-th rewrite, using filename_split.
12783
22312b71
AD
127842002-01-08 Akim Demaille <akim@epita.fr>
12785
12786 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
12787 New, stolen from the Fileutils 4.1.
12788 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12789 * configure.in: Check for the presence of memrchr, and of its
12790 prototype.
12791
a67cef01
TVH
127922002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12793
12794 * lib/hash.h (__P): Added definition for this macro.
12795 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
12796 BUILT_SOURCES, to ensure they are generated first.
12797 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
12798 %error-verbose to allow bootstrapping with bison 1.30x.
12799
2b25d624
AD
128002002-01-06 Akim Demaille <akim@epita.fr>
12801
12802 * src/reader.c (parse_braces): Don't fetch the next char, the
12803 convention is to fetch on entry.
12804 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
12805 'switch' without a following semicolon.
12806 * tests/regression.at (braces parsing): New.
12807
3460813b
AD
128082002-01-06 Akim Demaille <akim@epita.fr>
12809
12810 Bison is dead wrong in its RR conflict reports.
12811
12812 * tests/torture.at (GNU Cim Grammar): New.
12813 * src/conflicts.c (count_rr_conflicts): Fix.
12814
73784c64
AD
128152002-01-06 Akim Demaille <akim@epita.fr>
12816
12817 Creating package.m4 from configure.ac causes too many problems.
12818
12819 * tests/Makefile.am (package.m4): Create it by hand,
12820 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12821
25d81090
AD
128222002-01-06 Akim Demaille <akim@epita.fr>
12823
12824 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12825 skeleton.h.
12826
a9b8959e
PE
128272002-01-04 Paul Eggert <eggert@twinsun.com>
12828
12829 * doc/bison.texinfo (Debugging):
12830 Remove YYSTDERR; it's no longer defined or used.
12831 Also, s/cstdio.h/cstdio/.
12832
25d81090
AD
128332002-01-03 Akim Demaille <akim@epita.fr>
12834
12835 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12836
1109455c
AD
128372002-01-03 Akim Demaille <akim@epita.fr>
12838
12839 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12840 tracing code to --trace, wait for a better --trace option, with
12841 args.
12842
7ea5e977
AD
128432002-01-03 Akim Demaille <akim@epita.fr>
12844
12845 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12846 The ISO C++ standard is extremely clear about it: stderr is
12847 considered a macro, not a regular symbol (see table 94 `Header
12848 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12849 Therefore std:: does not apply to it. It still does with fprintf.
12850 Also, s/cstdio.h/cstdio/.
12851
fab5b110
AD
128522002-01-03 Akim Demaille <akim@epita.fr>
12853
12854 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12855 for non system headers.
12856
aed7fd9b
AD
128572002-01-02 Akim Demaille <akim@epita.fr>
12858
12859 Equip the skeleton chain with location tracking, runtime trace,
12860 pure parser and scanner.
12861
12862 * src/parse-skel.y: Request a pure parser, locations, and prefix
12863 renaming.
12864 (%union): Having several members with the same type does not help
12865 type mismatches, simplify.
12866 (YYPRINT, yyprint): New.
12867 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12868 (skel_error): this.
12869 Handle locations.
12870 * src/scan-skel.l: Adjust to these changes.
12871 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12872 (LOCATION_PRINT, skel_control_t): New.
12873
24fad99e
AD
128742001-12-30 Akim Demaille <akim@epita.fr>
12875
12876 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12877 replace `gb' with BLANKS.
12878 * src/scan-skel.l: Adjust.
12879
a4b36db4
AD
128802001-12-30 Akim Demaille <akim@epita.fr>
12881
12882 * src/system.h: We don't need nor want bcopy.
12883 Throw away MS-DOS crap: we don't need getpid.
12884 * configure.in: We don't need strndup. It was even causing
12885 problems: because Flex includes the headers *before* us,
12886 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12887 not visible.
12888 * lib/xstrndup.c: New.
12889 * src/scan-skel.l: Use it.
12890 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12891 * src/parse-skel.y: Use %directives instead of #defines.
12892
1239777d
AD
128932001-12-30 Akim Demaille <akim@epita.fr>
12894
12895 * src/skeleton.h: New.
12896 * src/output.c (output_parser, output_master_parser): Remove, dead
12897 code.
12898 * src/output.h (get_lines_number, actions_output, guards_output)
12899 (token_definitions_output): Prototype them.
12900 * src/parse-skel.y: Add the license notice.
12901 Include output.h and skeleton.h.
12902 (process_skeleton): Returns void, and takes a single parameter.
12903 * src/scan-skel.l: Add the license notice.
12904 Include skeleton.h.
12905 Don't use %option yylineno: it seems that then Flex imagines
12906 REJECT has been used, and therefore it won't reallocate its
12907 buffers (which makes no other sense to me than a bug). It results
12908 in warnings for `unused: yy_flex_realloc'.
12909
9b3add5b
RA
129102001-12-30 Robert Anisko <robert.anisko@epita.fr>
12911
12912 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12913 (MUSCLE_INSERT_PREFIX): ...to there.
12914 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12915 (MUSCLE_INSERT_PREFIX): Move from here...
12916
12917 * src/bison.hairy: Add a section directive. Put braces around muscle
12918 names. This parser skeleton is still broken, but Bison should not
12919 choke on a bad muscle 'syntax'.
12920 * src/bison.simple: Add a section directive. Put braces around muscle
12921 names.
12922
12923 * src/files.h (strsuffix, stringappend): Add declarations.
12924 (tab_extension): Add declaration.
12925 (short_base_name): Add declaration.
12926
12927 * src/files.c (strsuffix, stringappend): No longer static. These
12928 functions are used in the skeleton parser.
12929 (tab_extension): New.
12930 (compute_base_names): Use the computations done in this function
fab5b110 12931 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
12932 names.
12933 (short_base_name): No longer static.
12934
12935 * src/output.c (output_skeleton): New.
12936 (output): Disable call to output_master_parser, and give a try to
12937 a new skeleton handling system.
12938 (guards_output, actions_output): No longer static.
12939 (token_definitions_output, get_lines_number): No longer static.
12940
12941 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12942
fab5b110 12943 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
12944 parse-skel.y.
12945
12946 * src/parse-skel.y: New file.
12947 * src/scan-skel.l: New file.
12948
b5b61c61
AD
129492001-12-29 Akim Demaille <akim@epita.fr>
12950
12951 %name-prefix is broken.
12952
12953 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12954 Adjust all dependencies.
12955 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12956 %name-prefix.
12957
12958 Renaming yylval but not yylloc is not consistent. Now we do.
12959
12960 * src/bison.simple: Prefix yylloc if used.
12961 * doc/bison.texinfo (Decl Summary): Document that.
12962
8c9a50be
AD
129632001-12-29 Akim Demaille <akim@epita.fr>
12964
12965 * doc/bison.texinfo: Promote `%long-directive' over
12966 `%long_directive'.
12967 Remove all references to fixed-output-files, yacc is enough.
12968
d99361e6
AD
129692001-12-29 Akim Demaille <akim@epita.fr>
12970
12971 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12972 user prologue. These are defaults.
12973 * tests/actions.at (Mid-rule actions): Make sure the user can
12974 define YYDEBUG and YYERROR_VERBOSE.
12975
b9cecb91
AD
129762001-12-29 Akim Demaille <akim@epita.fr>
12977
12978 * src/output.c (header_output): Don't forget to export YYLTYPE and
12979 yylloc.
12980 * tests/headers.at (export YYLTYPE): New, make sure it does.
12981 * tests/regression.at (%union and --defines, Invalid CPP headers):
12982 Move to...
12983 * tests/headers.at: here.
12984
aea13e97
AD
129852001-12-29 Akim Demaille <akim@epita.fr>
12986
12987 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12988
931394cb
AD
129892001-12-29 Akim Demaille <akim@epita.fr>
12990
12991 * tests/actions.at (Mid-rule actions): Output on a single line
12992 instead of several.
12993
704a47c4
AD
129942001-12-29 Akim Demaille <akim@epita.fr>
12995
12996 * doc/bison.texinfo: Formatting changes.
12997
091e20bb
AD
129982001-12-29 Akim Demaille <akim@epita.fr>
12999
13000 Don't store the token defs in a muscle, just be ready to output it
13001 on command. Now possible via `symbols'. Fixes a memory leak.
13002
13003 * src/output.c (token_definitions_output): New.
13004 (output_parser, header_output): Use it.
13005 * src/reader.c (symbols_save): Remove.
13006
cce71710
AD
130072001-12-29 Akim Demaille <akim@epita.fr>
13008
13009 * src/bison.simple: Do not provide a default for YYSTYPE and
13010 YYLTYPE before the user's prologue. Otherwise it's hardly... a
13011 default.
13012
82c035a8
AD
130132001-12-29 Akim Demaille <akim@epita.fr>
13014
13015 Mid-rule actions are simply... ignored!
13016
13017 * src/reader.c (readgram): Be sure to attach mid-rule actions to
13018 the empty-rule associated to the dummy symbol, not to the host
13019 rule.
13020 * tests/actions.at (Mid-rule actions): New.
13021
8419d367
AD
130222001-12-29 Akim Demaille <akim@epita.fr>
13023
13024 Memory leak.
13025
13026 * src/reader.c (reader): Free grammar.
13027
375d5806
AD
130282001-12-29 Akim Demaille <akim@epita.fr>
13029
13030 Memory leak.
13031
13032 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
13033 since it allocates it for each state, although only one is needed.
13034 (allocate_storage): Do it here.
13035
f51cb8ff
AD
130362001-12-29 Akim Demaille <akim@epita.fr>
13037
13038 * src/options.h, src/options.c (create_long_option_table): Rename
13039 as...
13040 (long_option_table_new): this, with a clearer prototype.
13041 (percent_table): Remove, unused,
13042 * src/getargs.c (getargs): Adjust.
13043
29e88316
AD
130442001-12-29 Akim Demaille <akim@epita.fr>
13045
13046 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
13047 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
13048 as states.
13049
b9f71f19
AD
130502001-12-29 Akim Demaille <akim@epita.fr>
13051
13052 * src/lalr.c (build_relations): Rename `states' as `states1'.
13053 Sorry, I don't understand exactly what it is, no better name...
13054
1a2b5d37
AD
130552001-12-29 Akim Demaille <akim@epita.fr>
13056
13057 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
13058 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
13059 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
13060 as rules.
13061
1cca533e
AD
130622001-12-29 Akim Demaille <akim@epita.fr>
13063
13064 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
13065 ago.
13066
c03ae966
AD
130672001-12-29 Akim Demaille <akim@epita.fr>
13068
13069 * src/reader.c, src/reader.h (user_toknums): Remove.
13070 Adjust all users to use symbols[i]->user_token_number.
13071
5a670b1e
AD
130722001-12-29 Akim Demaille <akim@epita.fr>
13073
13074 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
13075 Adjust all users to use symbols[i]->prec or ->assoc.
13076
ad949da9
AD
130772001-12-29 Akim Demaille <akim@epita.fr>
13078
13079 * src/reader.c, src/reader.h (tags): Remove.
13080 Adjust all users to use symbols[i]->tag.
13081
0e78e603
AD
130822001-12-29 Akim Demaille <akim@epita.fr>
13083
13084 * src/gram.h, src/gram.c (symbols): New, similar to state_table
13085 and rule_table.
13086 * src/reader.c (packsymbols): Fill this table.
13087 Drop sprec.
13088 * src/conflicts.c (resolve_sr_conflict): Adjust.
13089 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
13090 single table.
13091 Use symbols[i]->tag instead of tags[i].
13092
213e640e
AD
130932001-12-29 Akim Demaille <akim@epita.fr>
13094
13095 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
13096 In addition, put a comment in there, to replace...
13097 * tests/regression.at (%union and C comments): Remove.
13098
e7b8bef1
AD
130992001-12-29 Akim Demaille <akim@epita.fr>
13100
13101 * tests/regression.at (Web2c Actions): Blindly move the actual
13102 output as expected output. The contents *seem* right to me, but I
13103 can't pretend reading perfectly parser tables... Nonetheless, all
13104 the other tests pass correctly, the table look OK, even though the
13105 presence of `$axiom' is to be noted: AFAICS it is useless (but
13106 harmless).
13107
b68e7744
AD
131082001-12-29 Akim Demaille <akim@epita.fr>
13109
13110 * src/reader.c (readgram): Don't add the rule 0 if there were no
13111 rules read. In other words, add it _after_ having performed
13112 grammar sanity checks.
13113 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
13114
78d5bae9
AD
131152001-12-29 Akim Demaille <akim@epita.fr>
13116
13117 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
13118 visible, and some states have now a different number.
13119
ff442794
AD
131202001-12-29 Akim Demaille <akim@epita.fr>
13121
13122 * src/reader.c (readgram): Bind the initial rule's lineno to that
13123 of the first rule.
13124 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
13125 (Solved SR Conflicts): Adjust rule 0's line number.
13126
610ab194
AD
131272001-12-29 Akim Demaille <akim@epita.fr>
13128
13129 Fix the `GAWK Grammar' failure.
13130
13131 * src/LR0.c (final_state): Initialize to -1 so that we do compute
13132 the reductions of the first state which was mistakenly confused
13133 with the final state because precisely final_state was initialized
13134 to 0.
13135 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13136 now noticed by Bison.
13137 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13138 have a reduction on $default.
13139
29d29c8f
AD
131402001-12-29 Akim Demaille <akim@epita.fr>
13141
13142 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13143 rule line numbers.
13144 * src/closure.c (print_closure): Likewise.
13145 * src/derives.c (print_derives): Likewise.
13146 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13147 now.
13148
7c6b64d0
AD
131492001-12-29 Akim Demaille <akim@epita.fr>
13150
13151 * src/lalr.c (lookaheads_print): New.
13152 (lalr): Call it when --trace-flag.
13153 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13154 are dumped.
13155
3d4daee3
AD
131562001-12-29 Akim Demaille <akim@epita.fr>
13157
13158 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13159 when walking through ritem, even via rule->rhs.
13160 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13161 (useful_production, useless_nonterminals): Likewise.
13162 (reduce_grammar_tables): Likewise, plus update nritems.
13163 * src/nullable.c (set_nullable): Likewise.
13164 * src/lalr.c (build_relations): Likewise.
13165 * tests/sets.at (Nullable): Adjust.
13166 Fortunately, now, the $axiom is no longer nullable.
13167
9e7f6bbd
AD
131682001-12-29 Akim Demaille <akim@epita.fr>
13169
13170 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13171 the 0-sentinel.
13172 * src/gram.c (ritem_longest_rhs): Likewise.
13173 * src/reduce.c (nonterminals_reduce): Likewise.
13174 * src/print_graph.c (print_graph): Likewise.
13175 * src/output.c (output_rule_data): Likewise.
13176 * src/nullable.c (set_nullable): Likewise.
13177
255ef638
AD
131782001-12-29 Akim Demaille <akim@epita.fr>
13179
13180 * src/output.c: Comment changes.
13181
0d8a7363
AD
131822001-12-27 Paul Eggert <eggert@twinsun.com>
13183
13184 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13185 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13186 Sparc, as they were causing more porting problems than the
13187 (minor) performance improvement was worth.
13188
13189 Also, catch up with 1.31's YYSTD.
13190
3db472b9
AD
131912001-12-27 Akim Demaille <akim@epita.fr>
13192
13193 * src/output.c (output_gram): Rely on nritems, not the
13194 0-sentinel. See below.
13195 Use -1 as separator, not 0.
13196 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13197 Rely on -1 as separator in yyrhs, instead of 0.
13198 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13199 twice `Now at end of input', therefore there are two lines less to
13200 expect.
13201
b365aa05
AD
132022001-12-27 Akim Demaille <akim@epita.fr>
13203
13204 * tests/regression.at (Unresolved SR Conflicts):
13205 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13206 below.
13207
30171f79
AD
132082001-12-27 Akim Demaille <akim@epita.fr>
13209
13210 * src/LR0.c (new_state): Recognize the final state by the fact it
13211 is reached by eoftoken.
13212 (insert_start_shifting_state, insert_eof_shifting_state)
13213 (insert_accepting_state, augment_automaton): Remove, since now
13214 these states are automatically computed from the initial state.
13215 (generate_states): Adjust.
13216 * src/print.c: When reporting a rule number to the user, substract
13217 1, so that the axiom rule is rule 0, and the first user rule is 1.
13218 * src/reduce.c: Likewise.
13219 * src/print_graph.c (print_core): For the time being, just as for
13220 the report, depend upon --trace-flags to dump the full set of
13221 items.
13222 * src/reader.c (readgram): Once the grammar read, insert the rule
13223 0: `$axiom: START-SYMBOL $'.
13224 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13225 number of the states has changed (the final state is no longer
13226 necessarily the last), catch up.
13227
75142d45
AD
132282001-12-27 Akim Demaille <akim@epita.fr>
13229
13230 Try to make the use of the eoftoken valid. Given that its value
13231 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13232 is used instead of > 0 where appropriate, (ii), depend upon nritems
13233 instead of the 0-sentinel.
13234
13235 * src/gram.h, src/gram.c (nritems): New.
13236 Expected to be duplication of nitems, but for the time being...
13237 * src/reader.c (packgram): Assert nritems and nitems are equal.
13238 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13239 * src/closure.c (print_closure, print_fderives): Likewise.
13240 * src/gram.c (ritem_print): Likewise.
13241 * src/print.c (print_core, print_grammar): Likewise.
13242 * src/print_graph.c: Likewise.
13243
b7c49edf
AD
132442001-12-27 Akim Demaille <akim@epita.fr>
13245
13246 * src/main.c (main): If there are complains after grammar
13247 reductions, then output the report anyway if requested, then die.
13248 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13249 * src/reader.c (eoftoken): New.
13250 (parse_token_decl): If the token being defined has value `0', it
13251 is the eoftoken.
13252 (packsymbols): No longer hack `tags' to insert `$' by hand.
13253 Be sure to preserve the value of the eoftoken.
13254 (reader): Make sure eoftoken is defined.
13255 Initialize nsyms to 0: now eoftoken is created just like the others.
13256 * src/print.c (print_grammar): Don't special case the eof token.
13257 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13258 lie anyway, albeit pleasant.
13259 * tests/calc.at: Exercise error messages with eoftoken.
13260 Change the grammar so that empty input is invalid.
13261 Adjust expectations.
13262 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13263
ec2da99f
AD
132642001-12-27 Akim Demaille <akim@epita.fr>
13265
13266 * configure.in: Check the protos of strchr ans strspn.
13267 Replace strchr if needed.
13268 * src/system.h: Provide the protos of strchr, strspn and memchr if
13269 missing.
13270 * lib/strchr.c: New.
13271 * src/reader.c (symbols_save): Use strchr.
13272
8adfa272
AD
132732001-12-27 Akim Demaille <akim@epita.fr>
13274
13275 * src/print.c, src/print_graph.c (escape): New.
13276 Use it to quote the TAGS outputs.
13277 * src/print_graph.c (print_state): Now errors are in red, and
13278 reductions in green.
13279 Prefer high to wide: output the state number on a line of its own.
13280
80dac38c
AD
132812001-12-27 Akim Demaille <akim@epita.fr>
13282
13283 * src/state.h, src/state.c (reductions_new): New.
13284 * src/LR0.c (set_state_table): Let all the states have a
13285 `reductions', even if reduced to 0.
13286 (save_reductions): Adjust.
13287 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13288 * src/print.c (print_reductions, print_actions): Adjust.
13289 * src/output.c (action_row): Adjust.
13290
2cec70b9
AD
132912001-12-27 Akim Demaille <akim@epita.fr>
13292
13293 * src/state.h, src/state.c (errs_new, errs_dup): New.
13294 * src/LR0.c (set_state_table): Let all the states have an errs,
13295 even if reduced to 0.
13296 * src/print.c (print_errs, print_reductions): Adjust.
13297 * src/output.c (output_actions, action_row): Adjust.
13298 * src/conflicts.c (resolve_sr_conflict): Adjust.
13299
13ca549a
AD
133002001-12-27 Akim Demaille <akim@epita.fr>
13301
13302 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13303
5092aba5
AD
133042001-12-27 Akim Demaille <akim@epita.fr>
13305
13306 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13307 * src/print.c: here.
13308 (lookaheadset, shiftset): New, used as additional storage by
13309 print_reductions.
13310 (print_results): Adjust.
13311 (print_shifts, print_gotos, print_errs): New, extracted from...
13312 (print_actions): here.
13313 * src/print_graph.c (print_actions): Remove dead code.
13314
11e2beca
AD
133152001-12-27 Akim Demaille <akim@epita.fr>
13316
13317 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13318 `$n' and `@n'.
13319
dac3c910
AD
133202001-12-27 Akim Demaille <akim@epita.fr>
13321
13322 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13323 (build_relations): Adjust.
13324
d0b0fefa
AD
133252001-12-27 Akim Demaille <akim@epita.fr>
13326
13327 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13328 duplication.
13329
adc8c848
AD
133302001-12-27 Akim Demaille <akim@epita.fr>
13331
13332 * src/reader.c (packgram): Catch nitems overflows.
13333
14d293ac
AD
133342001-12-27 Akim Demaille <akim@epita.fr>
13335
13336 * src/files.c, src/files.h (guard_obstack): Remove.
13337 * src/output.c (output): Adjust.
13338 * src/reader.c (parse_braces): New, factoring...
13339 (copy_action, copy_guard): these two which are renamed as...
13340 (parse_action, parse_guard): these.
13341 As a voluntary consequence, using braces around guards is now
13342 mandatory.
13343
f499b062
AD
133442001-12-27 Akim Demaille <akim@epita.fr>
13345
13346 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13347 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13348 members.
13349 (symbol_list_new): Adjust.
13350 (copy_action): action_line is the first line, not the last.
13351 (copy_guard): Just as for actions, store the `action' only, not
13352 the switch/case/break flesh.
13353 Don't parse the user action that might follow the guard, let...
13354 (readgram): do it, i.e., now, there can be an action after a
13355 guard.
13356 In other words the guard is just explicitly optional.
13357 (packgram): Adjust.
13358 * src/output.c (guards_output): New.
13359 (output_parser): Call it when needed.
13360 (output): Also free the guard and attrs obstacks.
13361 * src/files.c, src/files.h (obstack_save): Remove.
13362 (output_files): Remove.
13363 As a result, if one needs the former `.act' file, using an
13364 appropriate skeleton which requires actions and guards is now
13365 required.
13366 * src/main.c (main): Adjust.
13367 * tests/semantic.at: New.
13368 * tests/regression.at: Use `input.y' as input file name.
13369 Avoid 8+3 problems by requiring input.c when the test needs the
13370 parser.
13371
d945f5cd
AD
133722001-12-27 Akim Demaille <akim@epita.fr>
13373
13374 * src/reader.c (symbol_list_new): Be sure to initialize all the
13375 fields.
13376
d200e455
AD
133772001-12-27 Akim Demaille <akim@epita.fr>
13378
13379 All the hacks using a final pseudo state are now useless.
13380
13381 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13382 * src/lalr.c (nLA): New.
13383 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13384 instead of lookaheadsp from the pseudo state (nstate + 1).
13385
f9507c28
AD
133862001-12-27 Akim Demaille <akim@epita.fr>
13387
13388 * src/output.c (action_row, token_actions): Use a state_t instead
13389 of a integer, and nlookaheads instead of the following state's
13390 lookaheadsp.
13391
065fbd27
AD
133922001-12-27 Akim Demaille <akim@epita.fr>
13393
13394 * src/conflicts.c (log_resolution, flush_shift)
13395 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13396 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13397 (conflicts_print, print_reductions): Use a state_t instead of an
13398 integer when referring to a state.
13399 As much as possible, depend upon nlookaheads, instead of the
13400 `lookaheadsp' member of the following state (since lookaheads of
13401 successive states are successive, the difference between state n + 1
13402 and n served as the number of lookaheads for state n).
13403 * src/lalr.c (add_lookback_edge): Likewise.
13404 * src/print.c (print_core, print_actions, print_state)
13405 (print_results): Likewise.
13406 * src/print_graph.c (print_core, print_actions, print_state)
13407 (print_graph): Likewise.
13408 * src/conflicts.h: Adjust.
13409
1b177bd7
AD
134102001-12-27 Akim Demaille <akim@epita.fr>
13411
13412 * src/bison.hairy: Formatting/comment changes.
13413 ANSIfy.
13414 Remove `register' indications.
13415 Add plenty of `static'.
13416
7742ddeb
AD
134172001-12-27 Akim Demaille <akim@epita.fr>
13418
13419 * src/output.c (prepare): Drop the muscle `ntbase' which
13420 duplicates ntokens.
13421 * src/bison.simple: Formatting/comment changes.
13422 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13423 is an undocumented synonym.
13424
1fa14068
AD
134252001-12-22 Akim Demaille <akim@epita.fr>
13426
13427 * src/output.c (output_table_data): Change the prototype to use
13428 `int' for array ranges: some invocations do pass an int, not a
13429 short.
13430 Reported by Wayne Green.
13431
b9752825
AD
134322001-12-22 Akim Demaille <akim@epita.fr>
13433
13434 Some actions of web2c.y are improperly triggered.
13435 Reported by Mike Castle.
13436
13437 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13438 * tests/regression.at (Web2c): Rename as...
13439 (Web2c Report): this.
13440 (Web2c Actions): New.
13441
776209d6
AD
134422001-12-22 Akim Demaille <akim@epita.fr>
13443
13444 Reductions in web2c.y are improperly reported.
13445 Reported by Mike Castle.
13446
13447 * src/conflicts.c (print_reductions): Fix.
13448 * tests/regression.at (Web2c): New.
13449
275fc3ad
AD
134502001-12-18 Akim Demaille <akim@epita.fr>
13451
13452 Some host fail on `assert (!"foo")', which expands to
13453 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13454 Reported by Nelson Beebee.
13455
13456 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13457 `#define it_succeeded 0' and `assert (it_succeeded)'.
13458
897668ee
MA
134592001-12-17 Marc Autret <autret_m@epita.fr>
13460
13461 * src/bison.simple: Don't hard code the skeleton line and filename.
13462 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13463 New line counter 'skeleton_line' (skeleton-line muscle).
13464
ab3399e0
PE
134652001-12-17 Paul Eggert <eggert@twinsun.com>
13466
13467 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13468 YYDEBUG must be defined to a nonzero value.
13469
13470 * src/bison.simple (yytname): Do not assume that the user defines
13471 YYDEBUG to a properly parenthesized expression.
13472
3877f72b
AD
134732001-12-17 Akim Demaille <akim@epita.fr>
13474
13475 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13476 nlookaheads is a new member.
13477 Adjust all users.
13478 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13479 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13480 state.
776209d6 13481
331dbc1b
AD
134822001-12-17 Akim Demaille <akim@epita.fr>
13483
13484 * src/files.h, src/files.c (open_files, close_files): Remove.
13485 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13486 let...
13487 * src/reader.c (reader): Do it.
776209d6 13488
be750e4c
AD
134892001-12-17 Akim Demaille <akim@epita.fr>
13490
13491 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 13492
709ae8c6
AD
134932001-12-17 Akim Demaille <akim@epita.fr>
13494
13495 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13496 (flush_reduce): New.
13497 (resolve_sr_conflict): Adjust.
776209d6 13498
f87685c3
AD
134992001-12-17 Akim Demaille <akim@epita.fr>
13500
13501 * src/output.c (output_obstack): Be static and rename as...
13502 (format_obstack): this, to avoid any confusion with files.c's
13503 output_obstack.
13504 * src/reader.h (muscle_obstack): Move to...
13505 * src/output.h: here, since it's defined in output.c.
13506
837491d8
AD
135072001-12-17 Akim Demaille <akim@epita.fr>
13508
13509 * src/output.c (action_row, save_column, default_goto)
13510 (sort_actions, matching_state, pack_vector): Better variable
13511 locality.
13512
796d61fb
AD
135132001-12-17 Akim Demaille <akim@epita.fr>
13514
13515 * src/output.c: Various formatting changes.
776209d6 13516
64d15509
AD
135172001-12-17 Akim Demaille <akim@epita.fr>
13518
13519 * src/files.c (output_files): Free the output_obstack.
13520 * src/main.c (main): Call print and print_graph conditionally.
13521 * src/print.c (print): Work unconditionally.
13522 * src/print_graph.c (print_graph): Work unconditionally.
13523 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13524
fbc8ecb7
MA
135252001-12-16 Marc Autret <autret_m@epita.fr>
13526
13527 * src/output.c (actions_output): Fix. When we use %no-lines,
13528 there is one less line per action.
13529
f0440388
MA
135302001-12-16 Marc Autret <autret_m@epita.fr>
13531
13532 * src/bison.simple: Remove a useless #line directive.
13533 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13534 * src/output.c (get_lines_number): New.
776209d6 13535 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
13536 output muscles.
13537 Fix line numbering.
13538 (actions_output): Computes the number of lines taken by actions.
13539 (output_master_parser): Insert new skeleton which is the name of
13540 the output parser file name.
13541
a79986b8
MA
135422001-12-15 Marc Autret <autret_m@epita.fr>
13543
13544 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13545
4ec8e00f
MA
135462001-12-15 Marc Autret <autret_m@epita.fr>
13547
13548 * src/output.c (output_gram): Keep track of the hairy one.
13549
1a4648ff
AD
135502001-12-15 Akim Demaille <akim@epita.fr>
13551
13552 Make `make distcheck' work.
13553
13554 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13555 system.h which uses libgettext.h.
13556
9c2c67e6
AD
135572001-12-15 Akim Demaille <akim@epita.fr>
13558
13559 * src/nullable.c (set_nullable): Useless rules must be skipped,
13560 otherwise, since we range over their symbols, we might look at a
13561 nonterminal which no longer ``exists'', i.e., it is not counted in
13562 `nvars', hence we overflow our arrays.
13563
93ede233
AD
135642001-12-15 Akim Demaille <akim@epita.fr>
13565
13566 The header can also be produced directly, without any obstack!
13567 Yahoo!
13568
13569 * src/files.c, src/files.h (defines_obstack): Remove.
13570 (compute_header_macro): Global.
13571 (defines_obstack_save): Remove.
13572 * src/reader.c (parse_union_decl): No longer output to
13573 defines_obstack: its content can be found in the `stype' muscle
13574 anyway.
13575 (output_token_translations): Merge into...
13576 (symbols_output): this.
13577 Rename as...
13578 (symbols_save): this.
13579 (reader): Adjust.
13580 * src/output.c (header_output): New.
13581 (output): Call it.
13582
2666f928
AD
135832001-12-15 Akim Demaille <akim@epita.fr>
13584
13585 * src/reader.c (parse_union_decl): Instead of handling two obstack
13586 simultaneously, use one to define the `stype' muscle, and use the
13587 value of the latter to fill defines_obstack.
13588 (copy_comment): Remove.
13589 (copy_comment2): Work for a single obstack.
13590 Rename as...
13591 (copy_comment): this.
13592
428046f8
AD
135932001-12-15 Akim Demaille <akim@epita.fr>
13594
13595 * src/lex.c, src/lex.h (xgetc): No longer static.
13596 * src/reader.c (parse_union_decl): Revamp.
13597
ea52d706
AD
135982001-12-15 Akim Demaille <akim@epita.fr>
13599
13600 Still making progress in separating Bison into (i) input, (ii)
13601 process, (iii) output: now we can directly output the parser file
13602 without using table_obstack at all.
13603
13604 * src/files.c, src/files.h (table_obstack): Bye bye.
13605 (parser_file_name): New.
13606 * src/files.c (compute_output_file_names): Compute it.
13607 * src/output.c (actions_output, output_parser)
13608 (output_master_parser): To a file instead of an obstack.
13609
3f96f4dc
AD
136102001-12-15 Akim Demaille <akim@epita.fr>
13611
13612 Attach actions to rules, instead of pre-outputting them to
13613 actions_obstack.
13614
13615 * src/gram.h (rule_t): action and action_line are new members.
13616 * src/reader.c (symbol_list): Likewise.
13617 (copy_action): Save the actions within the rule.
13618 (packgram): Save them in rule_table.
13619 * src/output.c (actions_output): New.
13620 (output_parser): Use it on `%%actions'.
13621 (output_rule_data): Don't free rule_table.
13622 (output): Do it.
13623 (prepare): Don't save the `action' muscle.
13624 * src/bison.simple: s/%%action/%%actions/.
13625
51576fb3
AD
136262001-12-15 Akim Demaille <akim@epita.fr>
13627
13628 * src/reader.c (copy_action): When --yacc, don't append a `;'
13629 to the user action: let it fail if lacking.
dee049eb 13630 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 13631
2648a72d
AD
136322001-12-14 Akim Demaille <akim@epita.fr>
13633
13634 * src/lex.c (literalchar): Simply return the char you decoded, non
13635 longer mess around with obstacks and int pointers.
13636 Adjust all callers.
13637
92790e5b
AD
136382001-12-14 Akim Demaille <akim@epita.fr>
13639
13640 * src/lex.c (literalchar): Don't escape the special characters,
13641 just decode them, and keep them as char (before, eol was output as
13642 the 2 char string `\n' etc.).
13643 * src/output.c (output_rule_data): Use quotearg to output the
13644 token strings.
13645
927c1557
PE
136462001-12-13 Paul Eggert <eggert@twinsun.com>
13647
13648 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13649 Do not infringe on the global user namespace when using C++.
13650 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13651 All uses of `fprintf' and `stderr' changed.
13652
13653 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13654
ed8e1f68
AD
136552001-12-13 Akim Demaille <akim@epita.fr>
13656
13657 The computation of nullable is broken: it doesn't handle empty
13658 RHS's properly.
13659
13660 * tests/torture.at (GNU AWK Grammar): New.
13661 * tests/sets.at (Nullable): New.
13662 * src/nullable.c (set_nullable): Instead of blindly looping over
13663 `ritems', loop over the rules, and then over their rhs's.
13664
13665 Work around Autotest bugs.
13666
13667 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13668 frame, because Autotest understand lines starting with a `+' as
13669 traces from the shell. Then, they are not processed properly.
13670 Admittedly an Autotest bug, but we don't have time to wait for
13671 Autotest to catch up.
13672 * tests/regression.at (Broken Closure): Adjust to the new table
13673 frames.
13674 Move to...
13675 * tests/sets.at: here.
13676
cb581495
AD
136772001-12-13 Akim Demaille <akim@epita.fr>
13678
13679 * src/closure.c (closure): Use nrules instead of playing tricks
13680 with BITS_PER_WORD.
13681
2e729273
AD
136822001-12-13 Akim Demaille <akim@epita.fr>
13683
13684 * src/print.c (print_actions): Output the handling of `$' as the
13685 traces do: shifting the token EOF. Before EOF was treated as a
13686 nonterminal.
13687 * tests/regression.at: Adjust some tests.
13688 * src/print_graph.c (print_core): Complete the set of items via
13689 closure. The next-to-final and final states are still unsatisfying,
13690 but that's to be addressed elsewhere.
13691 No longer output the rule numbers, but do output the state number.
13692 A single loop for the shifts + gotos is enough, but picked a
13693 distinct color for each.
13694 (print_graph): Initialize and finalize closure.
13695
107f7dfb
AD
136962001-12-13 Akim Demaille <akim@epita.fr>
13697
13698 * src/reader.c (readgram): Remove dead code, an strip useless
13699 braces.
13700 (get_type): Remove, unused.
13701
9b53a24f
AD
137022001-12-12 Akim Demaille <akim@epita.fr>
13703
13704 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13705 on that of lib/error.c.
13706
dbfb6dcd
AD
137072001-12-12 Akim Demaille <akim@epita.fr>
13708
13709 Some hosts don't like `/' in includes.
13710
13711 * src/system.h: Include libgettext.h without qualifying the path.
13712 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13713 $(top_srcdir).
13714
c25fb648
MA
137152001-12-11 Marc Autret <autret_m@epita.fr>
13716
13717 * src/output.c (output_parser): Remove useless muscle.
13718
710ddc4f
MA
137192001-12-11 Marc Autret <autret_m@epita.fr>
13720
13721 * src/bison.simple: Remove #line just before %%epilogue. It
13722 is now handled in ...
13723 * src/reader.c (read_additionnal_code): Add the output of a
13724 #line for the epilogue.
13725
e83d80b8
MA
137262001-12-10 Marc Autret <autret_m@epita.fr>
13727
927c1557 13728 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
13729 replace precedent remove.
13730 * src/bison.simple: Remove #line before %%prologue because
13731 %%input-line is wrong at this time.
13732
971d5158
MA
137332001-12-10 Marc Autret <autret_m@epita.fr>
13734
13735 * src/reader.c (symbols_output): Clean up.
927c1557 13736 * src/output.c (output_gram, output): Clean up.
971d5158 13737
5edafffd
AD
137382001-12-10 Akim Demaille <akim@epita.fr>
13739
13740 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13741 * src/LR0.c (set_state_table): here.
13742 * src/lalr.c (lalr): Call it.
13743
0279f8e9
AD
137442001-12-10 Akim Demaille <akim@epita.fr>
13745
13746 * src/state.h (shifts): Remove the `number' member: shifts are
13747 attached to state, hence no longer need to be labelled with a
13748 state number.
13749
190c4f5f
AD
137502001-12-10 Akim Demaille <akim@epita.fr>
13751
13752 Now that states have a complete set of members, the linked list of
13753 shifts is useless: just fill directly the state's shifts member.
13754
13755 * src/state.h (shifts): Remove the `next' member.
13756 * src/LR0.c (first_state, last_state): Remove.
13757 Adjust the callers.
13758 (augment_automaton): Don't look for the shifts that must be added
13759 a shift on EOF: it is those of the state we looked for! But now,
13760 since shifts are attached, it is no longer needed to looking
13761 merely by its id: its number.
13762
2a73b93d
AD
137632001-12-10 Akim Demaille <akim@epita.fr>
13764
13765 * src/LR0.c (augment_automaton): Better variable locality.
13766 Remove an impossible branch: if there is a state corresponding to
13767 the start symbol being shifted, then there is shift for the start
13768 symbol from the initial state.
13769
74392f6a
AD
137702001-12-10 Akim Demaille <akim@epita.fr>
13771
13772 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13773 only when appropriate: when insert_start_shifting_state' is not
13774 invoked.
13775 * tests/regression.at (Rule Line Numbers): Adjust.
13776
37c82725
AD
137772001-12-10 Akim Demaille <akim@epita.fr>
13778
13779 * src/LR0.c (augment_automaton): Now that all states have shifts,
13780 merge the two cases addition shifts to the initial state.
13781
6a164e0c
AD
137822001-12-10 Akim Demaille <akim@epita.fr>
13783
13784 * src/lalr.c (set_state_table): Move to...
13785 * src/LR0.c: here.
13786 * src/lalr.c (lalr): Don't call it...
13787 * src/LR0.c (generate_states): do it.
13788 * src/LR0.h (first_state): Remove, only the table is used.
13789
7215de24
AD
137902001-12-10 Akim Demaille <akim@epita.fr>
13791
13792 * src/LR0.h (first_shift, first_reduction): Remove.
13793 * src/lalr.c: Don't use first_shift: find shifts through the
13794 states.
13795
80e25d4d
AD
137962001-12-10 Akim Demaille <akim@epita.fr>
13797
13798 * src/LR0.c: Attach shifts to states as soon as they are
13799 computed.
13800 * src/lalr.c (set_state_table): Instead of assigning shifts to
13801 state, just assert that the mapping was properly done.
13802
0ab3728b
AD
138032001-12-10 Akim Demaille <akim@epita.fr>
13804
13805 * src/LR0.c (insert_start_shift): Rename as...
13806 (insert_start_shifting_state): this.
13807 (insert_eof_shifting_state, insert_accepting_state): New.
13808 (augment_automaton): Adjust.
13809 Better locality of the variables.
13810 When looking if the start_symbol is shifted from the initial
13811 state, using `while (... symbol != start_symbol ...)' sounds
13812 better than `while (... symbol < start_symbol ...)': If fail
13813 to see how the order between symbols could be relevant!
13814
78af9bbc
AD
138152001-12-10 Akim Demaille <akim@epita.fr>
13816
13817 * src/getargs.h: Don't declare `spec_name_prefix' and
13818 `spec_file_prefix', declared by src/files.h.
13819 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
13820 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
13821 * src/output.c (prepare): Adjust.
13822 * src/reader.c (symbols_output): Likewise.
13823 * src/vmsgetargs.c: Vaguely adjust, but who cares?
13824
bdef2a41
AD
138252001-12-10 Akim Demaille <akim@epita.fr>
13826
13827 * src/muscle_tab.c (muscle_init): NULL is a better default than
13828 `"0"'.
13829
3735969c
AD
138302001-12-10 Akim Demaille <akim@epita.fr>
13831
13832 * src/reader.c (reader): Calling symbols_output once is enough.
13833
49701457
AD
138342001-12-10 Akim Demaille <akim@epita.fr>
13835
13836 Now that states have a complete set of members, the linked list of
13837 reductions is useless: just fill directly the state's reductions
13838 member.
13839
13840 * src/state.h (struct reductions): Remove member `number' and
13841 `next'.
13842 * src/LR0.c (first_reduction, last_reduction): Remove.
13843 (save_reductions): Don't link the new reductions, store them in
13844 this_state.
13845 * src/lalr.c (set_state_table): No need to attach reductions to
13846 states, it's already done.
13847 * src/output.c (output_actions): No longer free the shifts, then
13848 the reductions, then the states: free all the states and their
13849 members.
13850
0edad749
AD
138512001-12-10 Akim Demaille <akim@epita.fr>
13852
13853 * src/options.c (OPTN, DRTV, BOTH): New.
13854 (option_table): Use them.
13855
0edad749
AD
13856 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13857 the job of system.h.
13858 * src/options.c: Don't include stdio.h and xalloc.h for the same
13859 reasons.
13860
5449dd0f
AD
138612001-12-10 Akim Demaille <akim@epita.fr>
13862
13863 * src/output.c (output, prepare): Make sure the values of the
13864 muscles `action' and `prologue' are 0-terminated.
13865
a870c567
AD
138662001-12-10 Akim Demaille <akim@epita.fr>
13867
13868 Clean up GCC warnings.
13869
13870 * src/reader.c (copy_action): `buf' is not used.
13871 (parse_skel_decl): Be static.
13872 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13873 * src/options.h (create_long_option_table): Have a real prototype.
13874 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13875 (hash_delete_at): Return const void *.
13876 Adjust casts to preserve the const.
13877
80df8768
AD
138782001-12-10 Akim Demaille <akim@epita.fr>
13879
13880 * configure.in: Require 2.52g.
13881 M4 is not needed, but AUTOM4TE is.
13882 * m4/m4.m4: Remove.
13883 * tests/Makefile.am: Adjust.
13884
f693ad14
AD
138852001-12-10 Akim Demaille <akim@epita.fr>
13886
13887 One structure for states is enough, even though theoretically
13888 there are LR(0) states and LALR(1) states.
13889
13890 * src/lalr.h (state_t): Remove.
13891 (state_table): Be state_t **, not state_t *.
13892 * src/state.h (core, CORE_ALLOC): Rename as...
13893 (state_t, STATE_ALLOC): this.
13894 Add the LALR(1) members: shifts, reductions, errs.
13895 * src/LR0.c (state_table): Rename as...
13896 (state_hash): this, to avoid name clashes with the global
13897 `state_table'.
13898 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13899 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13900
74ffbcb6
AD
139012001-12-10 Akim Demaille <akim@epita.fr>
13902
13903 Bison dumps core on bash.y.
13904 Reported by Pascal Bart.
13905
13906 * src/warshall.c (bitmatrix_print): New.
13907 (TC): Use it.
ba0fe3c7 13908 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
13909 j must be the outer loop.
13910 * tests/regression.at (Broken Closure): New.
13911
07708e19
AD
139122001-12-05 Akim Demaille <akim@epita.fr>
13913
13914 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13915 its argument.
ba1ecc07 13916 Reported by Peter Hamorsky.
07708e19 13917
92b16366
AD
139182001-12-05 Akim Demaille <akim@epita.fr>
13919
13920 * src/conflicts.c (err_table): Remove.
13921 (resolve_sr_conflict): Adjust.
13922 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13923 Rename as...
13924 (state_t.reductions, state_t.shifts): this.
13925
076ab033
AD
139262001-12-05 Akim Demaille <akim@epita.fr>
13927
13928 * src/reduce.c (reduce_grammar_tables): No longer disable the
13929 removal of useless rules via CPP but via `if (0)', so that the
13930 compiler still check the code is valid.
13931 For instance, it should have noticed `rline' no longer exists: use
13932 the `line' member of rule_t.
13933 * src/gram.c (dummy, rline): Remove, unused.
13934
3843c413
AD
139352001-12-05 Akim Demaille <akim@epita.fr>
13936
13937 * src/output.c (pack_vector): Use assert, not berror.
13938 * src/main.c (berror): Remove, unused.
13939
43168960
AD
139402001-12-05 Akim Demaille <akim@epita.fr>
13941
13942 New experimental feature: if --verbose --trace output all the
13943 items of a state, not only its kernel.
13944
13945 * src/print.c (print_core): If `trace_flag', then invoke closure
13946 before outputting the items of the state (print_core is no longer
13947 a correct name them).
13948 (print_results): Invoke new_closure/free_closure if needed.
13949
b2872512
AD
139502001-12-05 Akim Demaille <akim@epita.fr>
13951
13952 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13953 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13954 (nitemset): for consistency with the rest of the project.
13955
23cbcc6c
AD
139562001-12-05 Akim Demaille <akim@epita.fr>
13957
13958 * src/closure.c (print_closure): Improve.
13959 (closure): Use it for printing input and output.
13960
03ec521c
AD
139612001-12-05 Akim Demaille <akim@epita.fr>
13962
13963 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13964 indexed by nonterminals.
13965
3a7456dd
AD
139662001-12-05 Akim Demaille <akim@epita.fr>
13967
13968 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13969 what it was!).
13970 * src/warshall.h: Remove accidental duplication of the content.
13971
1cbcf2e7
AD
139722001-12-05 Akim Demaille <akim@epita.fr>
13973
13974 * src/closure.c (set_fderives): De-obfuscate.
13975
84182270
AD
139762001-12-05 Akim Demaille <akim@epita.fr>
13977
13978 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13979
3f6f053c
AD
139802001-12-05 Akim Demaille <akim@epita.fr>
13981
13982 * src/closure.c (set_firsts): De-obfuscate.
13983
7a5350ba
AD
139842001-12-05 Akim Demaille <akim@epita.fr>
13985
13986 * src/output.c (action_row): De-obfuscate
13987 using the good o' techniques: arrays not pointers, variable
13988 locality, BITISSET, RESETBIT etc.
13989
d954473d
AD
139902001-12-05 Akim Demaille <akim@epita.fr>
13991
13992 Pessimize the code to simplify it: from now on, all the states
13993 have a valid SHIFTS, which NSHIFTS is possibly 0.
13994
13995 * src/LR0.c (shifts_new): Be global and move to..
13996 * src/state.c, src/state.h: here.
13997 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13998 * src/print_graph: Adjust.
13999
9839bbe5
AD
140002001-12-05 Akim Demaille <akim@epita.fr>
14001
14002 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
14003 * src/conflicts.c: Use it.
14004 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
14005 incorrectly ``simplified''.
14006
9f136c07
AD
140072001-12-05 Akim Demaille <akim@epita.fr>
14008
14009 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
14010 using the good o' techniques: arrays not pointers, variable
14011 locality, BITISSET, RESETBIT etc.
14012
b608206e
AD
140132001-12-05 Akim Demaille <akim@epita.fr>
14014
14015 * src/state.h (SHIFT_SYMBOL): New.
14016 * src/conflicts.c: Use it to deobfuscate.
14017
52afa962
AD
140182001-12-05 Akim Demaille <akim@epita.fr>
14019
14020 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
14021 (print_reductions): De-obfuscate using the good o' techniques:
14022 arrays not pointers, variable locality, BITISSET.
14023
e74dc321
AD
140242001-12-05 Akim Demaille <akim@epita.fr>
14025
14026 * src/conflicts.c (print_reductions): Arrays, not pointers.
14027 Use BITISSET.
14028
768fca83
AD
140292001-12-05 Akim Demaille <akim@epita.fr>
14030
14031 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14032
a17e599f
AD
140332001-12-05 Akim Demaille <akim@epita.fr>
14034
14035 * src/conflicts.c (print_reductions): Improve variable locality.
14036
a04bc341
AD
140372001-12-05 Akim Demaille <akim@epita.fr>
14038
14039 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14040
c8ea038e
AD
140412001-12-05 Akim Demaille <akim@epita.fr>
14042
14043 * src/conflicts.c (print_reductions): Improve variable locality.
14044
aa2aab3c
AD
140452001-12-05 Akim Demaille <akim@epita.fr>
14046
14047 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
14048 * src/lalr.c: Use them.
14049
b178c8cc
AD
140502001-12-05 Akim Demaille <akim@epita.fr>
14051
14052 * src/LR0.c (augment_automaton): Formatting changes.
14053 Better variable locality.
14054
f67d13aa
AD
140552001-12-05 Akim Demaille <akim@epita.fr>
14056
14057 * src/lalr.c (matrix_print): New.
14058 (transpose): Use it.
14059 Use arrays instead of pointers.
14060
c2713865
AD
140612001-12-05 Akim Demaille <akim@epita.fr>
14062
14063 * src/lalr.c (maxrhs): Move to...
14064 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
14065 * src/lalr.c (build_relations): Adjust.
14066
9887c18a
AD
140672001-12-05 Akim Demaille <akim@epita.fr>
14068
14069 * src/lalr.c (transpose): Free the memory allocated to the
14070 argument, as it is replaced by the results by the unique caller.
14071 (build_relations): Merely invoke transpose: it handles the memory
14072 deallocation.
14073 Improve variable locality.
14074 Avoid variables used as mere abbreviations.
14075 (compute_lookaheads): Use arrays instead of pointers.
14076
4d4f699c
AD
140772001-12-05 Akim Demaille <akim@epita.fr>
14078
14079 * src/lalr.c (initialize_F): Improve variable locality.
14080 Avoid variables used as mere abbreviations.
14081
80a69750
AD
140822001-12-05 Akim Demaille <akim@epita.fr>
14083
14084 * src/derives.c (print_derives): Display the ruleno.
14085 * src/lalr.c (initialize_F, transpose): Better variable locality
14086 to improve readability.
14087 Avoid variables used as mere abbreviations.
14088
fe961097
AD
140892001-12-05 Akim Demaille <akim@epita.fr>
14090
14091 * src/lalr.c (traverse): Use arrays instead of pointers.
14092
e3e4e814
AD
140932001-12-05 Akim Demaille <akim@epita.fr>
14094
14095 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
14096 the handling of squeue.
14097 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14098
630e182b
AD
140992001-12-05 Akim Demaille <akim@epita.fr>
14100
14101 Because useless nonterminals are now kept alive (instead of being
14102 `destroyed'), we now sometimes examine them, and store information
14103 related to them. Hence we need to know their number, and adjust
14104 memory allocations.
14105
14106 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
14107 static.
14108 * src/LR0.c (allocate_itemsets): The memory allocated to
14109 `symbol_count' was used for two different purpose: once to count
14110 the number of occurrences of each symbol, and later reassigned to
14111 `shift_symbol', containing the symbol that can be shifted from a
14112 given state.
14113 Deobfuscate, i.e., allocate, use and free `symbol_count' here
14114 only, and...
14115 (new_itemsets): Allocate `shift_symbol' here.
14116 (allocate_itemsets): symbol_count includes useless nonterminals.
14117 Make room for them.
14118 (free_storage): Use `free', not `XFREE', for pointers that cannot
14119 be null.
14120
81b51460
AD
141212001-12-05 Akim Demaille <akim@epita.fr>
14122
14123 * src/nullable.c (set_nullable): Deobfuscate the handling of
14124 ritem.
14125 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14126
3067fbef
AD
141272001-12-05 Akim Demaille <akim@epita.fr>
14128
14129 * src/gram.c, src/gram.h (ritem_print): New.
14130 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
14131 (This useless function was defined only to work around VMS linkers
14132 that can't handle compilation units with variables only).
14133 * src/reduce.c (dump_grammar): Use it to trace the construction of
14134 ritem.
14135
c2bea5f9
PE
141362001-12-04 Paul Eggert <eggert@twinsun.com>
14137
7d27c823
PE
14138 * src/bison.simple (union yyalloc): Change member names
14139 to be the same as the stack names.
14140 (yyparse): yyptr is now union yyalloc *, not char *.
14141 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14142 and may generate better code on some machines.
c2bea5f9
PE
14143 (yystpcpy): Use prototype if __STDC__ is defined, not just
14144 if __cplusplus is defined.
35687a9d 14145
2c8a9dfa
AD
141462001-11-30 Akim Demaille <akim@epita.fr>
14147
14148 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14149 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14150 Gettext doesn't compile cleanly, and dies with -Werror.
14151 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14152 Include WARNING_CFLAGS here.
14153 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14154 before being defined.
14155
f4e421e6
AD
141562001-11-27 Paul Eggert <eggert@twinsun.com>
14157
14158 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14159 First arg is int, not unsigned.
14160 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14161 (SIZE_MAX, UINT_MAX): New macros.
14162 (quotearg_n_options): Abort if N is negative.
14163 Avoid overflow check on hosts where size_t is 64 bits and int
14164 is 32 bits, as overflow is impossible there.
14165 Fix off-by-one typo that caused unnecessary reallocation.
14166
7093d0f5
AD
141672001-11-29 Paul Eggert <eggert@twinsun.com>
14168
14169 Name space cleanup in generated parser.
14170
14171 * doc/bison.texinfo (Bison Parser): Discuss system headers
14172 and their effect on the user name space.
14173
14174 * src/bison.simple:
14175 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14176 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14177 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14178
14179 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14180 on user names when possible.
14181
14182 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14183 Simplify test for whather <alloca.h> exists.
14184
14185 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14186
14187 (<stdio.h>): Include if YYDEBUG.
14188
14189 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14190 ! defined (yyoverflow) && ! defined (yymemcpy).
14191
14192 (yymemcpy, yyparse): Rename local variables as needed so that
14193 they all begin with 'yy'.
14194
14195 (yystrlen, yystpcpy): New functions.
14196
14197 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14198 All uses changed.
14199
14200 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14201 instead of relying on string.h functions. Use YYSTACK_ALLOC
14202 and YYSTACK_FREE instead of malloc and free.
14203
fd51e5ff
AD
142042001-11-30 Akim Demaille <akim@epita.fr>
14205
14206 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14207 before their first uses.
14208 (YYBISON, YYPURE): Move to the top of the output.
14209
7d13ff5f
AD
142102001-11-30 Akim Demaille <akim@epita.fr>
14211
14212 * tests/reduce.at (Useless Nonterminals): Fix.
14213
892a3995
AD
142142001-11-30 Akim Demaille <akim@epita.fr>
14215
14216 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14217 if body instead of `;' to pacify GCC's warnings.
14218
68f1e3ed
AD
142192001-11-30 Akim Demaille <akim@epita.fr>
14220
14221 Instead of mapping the LHS of unused rules to -1, keep the LHS
14222 valid, but flag the rules as invalid.
14223
14224 * src/gram.h (rule_t): `useful' is a new member.
14225 * src/print.c (print_grammar): Adjust.
14226 * src/derives.c (set_derives): Likewise.
14227 * src/reader.c (packgram, reduce_output): Likewise.
14228 * src/reduce.c (reduce_grammar_tables): Likewise.
14229 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14230
d2d1b42b
AD
142312001-11-30 Akim Demaille <akim@epita.fr>
14232
14233 * src/reduce.c (reduce_output): Formatting changes.
14234 * src/print.c (print_results, print_grammar): Likewise.
14235 * tests/regression.at (Rule Line Numbers)
14236 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14237
760b53a8
AD
142382001-11-30 Akim Demaille <akim@epita.fr>
14239
14240 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14241 useless nonterminals, move them at the end of the symbol arrays.
14242 (reduce_output): Adjust.
14243 * tests/reduce.at (Useless Nonterminals): Adjust.
14244
00238958
AD
142452001-11-30 Akim Demaille <akim@epita.fr>
14246
14247 * src/reduce.c: Various comment/formatting changes.
14248 (nonterminals_reduce): New, extracted from...
14249 (reduce_grammar_tables): here.
14250 (reduce_grammar): Call nonterminals_reduce.
14251
396452de
PE
142522001-11-29 Paul Eggert <eggert@twinsun.com>
14253
14254 * src/bison.simple (YYSTACK_REALLOC): Remove.
14255 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14256 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14257 New macros.
14258 (union yyalloc): New type.
14259 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14260 an arbitrary restriction on hosts where size_t is wider than int.
14261
14262 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14263 a parser stack overflow. Allocate just one block of memory for all
14264 three stacks, instead of allocating three blocks; this typically is
14265 faster and reduces fragmentation.
14266
14267 Do not limit the number of items in the stack to a value that fits
14268 in 'int', as this is an arbitrary limit on hosts with 64-bit
14269 size_t and 32-bit int.
14270
147e184c
MA
142712001-11-29 Marc Autret <autret_m@epita.fr>
14272
14273 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14274 of defining YYERROR_VERBOSE.
14275 [AT_DATA]: $4 is now out of C declarations in the prologue.
14276
426cf563
MA
142772001-11-28 Marc Autret <autret_m@epita.fr>
14278
14279 * src/reader.c (parse_dquoted_param): New.
14280 (parse_skel_decl): Use it.
14281 * src/lex.h: Add its prototype.
14282 * src/lex.c (literalchar): Become not static.
14283
c7925b99
MA
142842001-11-28 Marc Autret <autret_m@epita.fr>
14285
14286 * src/output.h: And put its extern declaration here.
14287 * src/output.c (error_verbose): Define here.
14288 (prepare): Echo name modification.
14289 * src/getargs.h: Clean its extern declaration.
14290 * src/getargs.c (error_verbose_flag): Remove.
14291 (getargs): Remove case 'e'.
14292 * src/options.c (option_table): 'error-verbose' is now seen as simple
14293 percent option.
14294 Include output.h.
14295
14296 * src/reader.c (read_declarations): Remove case tok_include.
14297 (parse_include_decl): Remove.
14298 * src/lex.h (token_t): Remove tok_include.
14299 * src/options.c (option_table): 'include' is now a simple command line
14300 option.
14301
5b5d1929
MA
143022001-11-28 Marc Autret <autret_m@epita.fr>
14303
14304 * src/bison.simple: Adjust muscle names.
14305 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14306 * src/output.c (prepare): s/_/-/ for the muscles names.
14307 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14308
8850be4b
MA
143092001-11-28 Marc Autret <autret_m@epita.fr>
14310
14311 * src/bison.simple: Fix debug.
14312 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14313
4a38e613
AD
143142001-11-28 Akim Demaille <akim@epita.fr>
14315
14316 * src/LR0.c (shifts_new): New.
14317 (save_shifts, insert_start_shift, augment_automaton): Use it.
14318
4b35e1c1
AD
143192001-11-28 Akim Demaille <akim@epita.fr>
14320
14321 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14322 keep ruleno only.
14323
d2b04478
AD
143242001-11-28 Akim Demaille <akim@epita.fr>
14325
14326 * src/closure.c (closure): Instead of looping over word in array
14327 then bits in words, loop over bits in array.
14328
2c4c30aa
AD
143292001-11-28 Akim Demaille <akim@epita.fr>
14330
14331 * src/closure.c (closure): No longer optimize the special case
14332 where all the bits of `ruleset[r]' are set to 0, to make the code
14333 clearer.
14334
576890b7
AD
143352001-11-28 Akim Demaille <akim@epita.fr>
14336
14337 * src/closure.c (closure): `r' and `c' are new variables, used to
14338 de-obfuscate accesses to RULESET and CORE.
14339
cb487d7d
AD
143402001-11-28 Akim Demaille <akim@epita.fr>
14341
14342 * src/reduce.c (reduce_print): Use ngettext.
14343 (dump_grammar): Improve the trace accuracy.
14344
6013d43f
AD
143452001-11-28 Akim Demaille <akim@epita.fr>
14346
14347 * src/reduce.c (dump_grammar): Don't translate trace messages.
14348
cb4956ee
AD
143492001-11-28 Akim Demaille <akim@epita.fr>
14350
14351 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14352 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14353 as all tags are free'ed afterwards.
14354 From Enrico Scholz.
14355
648185ab
PE
143562001-11-27 Paul Eggert <eggert@twinsun.com>
14357
14358 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14359 use alloca when we didn't want to, and vice versa.
14360
68254a03
MA
143612001-11-27 Marc Autret <autret_m@epita.fr>
14362
9113b58f
AD
14363 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14364 initialization.
68254a03
MA
14365 * src/output.c (prepare): Remove its update.
14366
04d843a2
MA
143672001-11-27 Marc Autret <autret_m@epita.fr>
14368
14369 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14370 Use %error-verbose.
14371
d2079671 143722001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
14373
14374 * src/bison.simple: Remove YYERROR_VERBOSE using.
14375 Use %%error_verbose.
14376 (yyparse): Likewise.
14377 * src/output.c (prepare): Give its final value.
14378 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14379 * src/getargs.h: Add its extern declaration.
14380 * src/getargs.c (error_verbose_flag): New int.
14381 (getargs): Update to catch new case.
14382 * src/options.c (option_table): 'error-verbose' is a new option.
14383 (shortopts): Update.
14384
e0327bc8
AD
143852001-11-27 Akim Demaille <akim@epita.fr>
14386
14387 * src/system.h: Use intl/libgettext.h.
14388 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14389
000f1a3c
AD
143902001-11-27 Akim Demaille <akim@epita.fr>
14391
14392 * tests/torture.at (Exploding the Stack Size with Malloc):
14393 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14394
26cfe0be
AD
143952001-11-27 Akim Demaille <akim@epita.fr>
14396
14397 * src/files.c: Include error.h.
14398 Reported by Hans Aberg.
14399
f6bd5427
MA
144002001-11-26 Marc Autret <autret_m@epita.fr>
14401
d2079671 14402 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
14403 (read_declarations): Add case tok_include.
14404 * src/getargs.h (include): Add its extern definition.
14405 * src/getargs.c (include): New const char *.
14406 (getargs): Add case '-I'.
14407 * src/options.c (option_table): Add include as command line and
14408 percent option.
14409 * src/lex.h (token_t): Add tok_include.
14410
2ca209c1
AD
144112001-11-26 Akim Demaille <akim@epita.fr>
14412
14413 * src/reader.c (readgram): Make sure rules for mid-rule actions
14414 have a lineno equal to that of their host rule.
14415 Reported by Hans Aberg.
14416 * tests/regression.at (Rule Line Numbers): New.
14417
0e41b407
AD
144182001-11-26 Akim Demaille <akim@epita.fr>
14419
14420 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14421 size_ts.
14422
144232001-11-26 Akim Demaille <akim@epita.fr>
14424
14425 * src/complain.c, src/complain.h (error): Remove, provided by
14426 lib/error.[ch].
14427
e0c40012
AD
144282001-11-26 Akim Demaille <akim@epita.fr>
14429
14430 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14431 issue an error message.
14432 * tests/regression.at (Invalid %directive): New.
14433 Reported by Hans Aberg.
14434
5e147124
AD
144352001-11-26 Akim Demaille <akim@epita.fr>
14436
14437 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14438 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14439
a034c8b8
AD
144402001-11-26 Akim Demaille <akim@epita.fr>
14441
14442 * src/conflicts.c (conflicts_print): Don't complain at all when
14443 there are no reduce/reduce conflicts, and as many shift/reduce
14444 conflicts as expected.
14445 * tests/regression.at (%expect right): Adjust.
14446
c64a20f3
AD
144472001-11-23 Akim Demaille <akim@epita.fr>
14448
14449 * lib/alloca.c: Update, from fileutils.
14450
5b0d29bb
AD
144512001-11-23 Akim Demaille <akim@epita.fr>
14452
14453 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14454
722c4bfe
AD
144552001-11-23 Akim Demaille <akim@epita.fr>
14456
14457 * src/system.h: Include alloca.h.
14458 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14459
6255b435
AD
144602001-11-23 Akim Demaille <akim@epita.fr>
14461
14462 * src/print_graph.c (print_actions): Remove `rule', unused.
14463 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14464 pacify GCC's signed < unsigned warnings.
14465 * src/closure.c (itemsetsize): Likewise.
14466 * src/reader.c (symbol_list_new): Static.
14467
b29b2ed5
AD
144682001-11-23 Akim Demaille <akim@epita.fr>
14469
14470 Attaching lineno to buckets is stupid, since only one copy of each
14471 symbol is kept, only the line of the first occurrence is kept too.
14472
14473 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14474 * src/reader.c (rline_allocated): Remove, unused.
14475 (symbol_list): Have a `line' member.
14476 (symbol_list_new): New.
14477 (readgram): Use it.
14478 * src/print.c (print_grammar): Output the rule line numbers.
14479 * tests/regression.at (Solved SR Conflicts)
14480 (Unresolved SR Conflicts): Adjust.
14481 Reported by Hans Aberg.
14482
a81b1d4a
MA
144832001-11-22 Marc Autret <autret_m@epita.fr>
14484
14485 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14486
c1ecb3c1
MA
144872001-11-22 Marc Autret <autret_m@epita.fr>
14488
14489 * src/muscle_tab.c (muscle_init): Remove initialization of
14490 skeleton muscle.
14491 * src/output.c (output_master_parser): Do it here.
14492
fbe01355
AD
144932001-11-20 Akim Demaille <akim@epita.fr>
14494
14495 * po/sv.po: New.
14496 * configure.in (ALL_LINGUAS): Adjust.
14497 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14498 longer contains strings to translate.
14499
81e895c0
AD
145002001-11-19 Akim Demaille <akim@epita.fr>
14501
14502 * src/conflicts.c (conflicts_print): Add a missing \n.
14503
6bb1878b
AD
145042001-11-19 Akim Demaille <akim@epita.fr>
14505
14506 * src/nullable.c (nullable_print): New.
14507 (set_nullable): Call it when tracing.
14508 Better locality of variables.
14509
d9ec2d07
AD
145102001-11-19 Akim Demaille <akim@epita.fr>
14511
14512 * src/print.c (print_actions): Better locality of variables.
14513
720e5c1b
AD
145142001-11-19 Akim Demaille <akim@epita.fr>
14515
14516 * src/derives.c (print_derives): Fix and enrich.
14517 * src/closure.c (print_fderives): Likewise.
14518
fb908786
AD
145192001-11-19 Akim Demaille <akim@epita.fr>
14520
14521 * src/closure.c (itemsetend): Remove, replaced with...
14522 (itemsetsize): new.
14523
125ecb56
AD
145242001-11-19 Akim Demaille <akim@epita.fr>
14525
14526 * src/LR0.c (kernel_end): Remove, replaced with...
14527 (kernel_size): new.
14528
d8cf039f
AD
145292001-11-19 Akim Demaille <akim@epita.fr>
14530
14531 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14532 to clarify.
14533
7bec0760
AD
145342001-11-19 Akim Demaille <akim@epita.fr>
14535
14536 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14537
c87d4863
AD
145382001-11-19 Akim Demaille <akim@epita.fr>
14539
14540 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14541 trace messages.
14542 * src/LR0.c: Likewise.
14543 (allocate_itemsets): Use arrays instead of pointers to clarify.
14544
9bfe901c
AD
145452001-11-19 Akim Demaille <akim@epita.fr>
14546
14547 * src/getargs.c (statistics_flag): Replace with...
14548 (trace_flag): New.
14549 (longopts): Accept --trace instead of --statistics.
14550 * src/getargs.h, src/options.c: Adjust.
14551 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14552 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14553
97db7bd4
AD
145542001-11-19 Akim Demaille <akim@epita.fr>
14555
cc72668c 14556 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
14557 pointers to clarify the code.
14558 (save_reductions, save_shifts): Factor common parts of alternatives.
14559
2c5f66ed
AD
145602001-11-19 Akim Demaille <akim@epita.fr>
14561
14562 * src/LR0.c (new_state, get_state): Complete TRACE code.
14563 * src/closure.c: Include `reader.h' to get `tags', needed by the
14564 trace code.
14565 Rename the conditional DEBUG as TRACE.
14566 Output consistently TRACEs to stderr, not stdout.
14567 * src/derives.c: Likewise.
14568 * src/reduce.c: (inaccessable_symbols): Using if is better style
14569 than goto.
14570 Use `#if TRACE' instead of `#if 0' for tracing code.
14571
300f275f
AD
145722001-11-19 Akim Demaille <akim@epita.fr>
14573
14574 * src/system.h (LIST_FREE, shortcpy): New.
14575 * src/LR0.c: Use them.
14576 * src/output.c (free_itemsets, free_reductions, free_shifts):
14577 Remove, replaced by LIST_FREE.
14578
f59c437a
AD
145792001-11-19 Akim Demaille <akim@epita.fr>
14580
14581 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14582 (REDUCTIONS_ALLOC): New.
14583 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14584 allocation.
14585
6986fd9e
AD
145862001-11-19 Akim Demaille <akim@epita.fr>
14587
14588 * src/LR0.c (new_state): Complete trace code.
14589 * src/nullable.c (set_nullable): Don't translate traces.
14590
4bc30f78
AD
145912001-11-19 Akim Demaille <akim@epita.fr>
14592
14593 * src/print_graph.c (print_core): Better locality of variables.
14594 * src/print.c (print_core): Likewise.
14595
08a946e0
AD
145962001-11-19 Akim Demaille <akim@epita.fr>
14597
14598 * src/vcg.c: You do the output, so you are responsible of the
14599 handling of VCG syntax, in particular: use quotearg.
14600 * src/print_graph.c: Don't.
14601 (print_actions): Don't output the actions as part of the nodes,
14602 since that's the job of the edges.
14603 (print_state): Don't output by hand: fill the node description,
9bfe901c 14604 and ask for its output.
08a946e0 14605
f0473484
AD
146062001-11-19 Akim Demaille <akim@epita.fr>
14607
cc72668c
AD
14608 * src/bison.simple (yyparse): When verbosely reporting an error,
14609 no longer put additional quotes around token names.
f0473484
AD
14610 * tests/calc.at: Adjust.
14611
e41dc700
AD
146122001-11-19 Akim Demaille <akim@epita.fr>
14613
14614 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14615 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14616 * src/output.c: Adjust.
14617
652a871c
AD
146182001-11-19 Akim Demaille <akim@epita.fr>
14619
14620 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14621 (rule_t): this.
14622 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14623
b2ed6e58
AD
146242001-11-19 Akim Demaille <akim@epita.fr>
14625
14626 * src/gram.h (rule_t): New.
14627 (rule_table): New.
14628 (rrhs, rlhs): Remove, part of state_t.
14629 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14630 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14631 * src/reader.c, src/reduce.c: Adjust.
14632
edad7067
AD
146332001-11-19 Akim Demaille <akim@epita.fr>
14634
14635 * src/reader.c (symbols_output): New, extracted from...
14636 (packsymbols): Here.
14637 (reader): Call it.
14638
3feec034
AD
146392001-11-19 Akim Demaille <akim@epita.fr>
14640
14641 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14642 (maxrhs): this new function.
14643
ddcd5fdf
AD
146442001-11-19 Akim Demaille <akim@epita.fr>
14645
cc72668c 14646 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
14647 Adjust.
14648
bb527fc2
AD
146492001-11-19 Akim Demaille <akim@epita.fr>
14650
cc72668c 14651 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
14652 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14653 * src/lalr.c: Adjust.
14654
a845a697
AD
146552001-11-19 Akim Demaille <akim@epita.fr>
14656
14657 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14658 (set_state_table): handle the `lookaheads' members.
14659
f004bf6a
AD
146602001-11-19 Akim Demaille <akim@epita.fr>
14661
cc72668c
AD
14662 * src/lalr.h (lookaheads): Removed array, whose contents is now
14663 a member of...
f004bf6a
AD
14664 (state_t): this structure.
14665 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14666 Adjust.
14667
de326cc0
AD
146682001-11-19 Akim Demaille <akim@epita.fr>
14669
cc72668c
AD
14670 * src/lalr.h (consistent): Removed array, whose contents is now
14671 a member of...
de326cc0
AD
14672 (state_t): this structure.
14673 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14674 Adjust.
14675
90b4416b
AD
146762001-11-19 Akim Demaille <akim@epita.fr>
14677
cc72668c
AD
14678 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14679 contents are now members of...
90b4416b
AD
14680 (state_t): this structure.
14681 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14682 Adjust.
14683
9703cc49
AD
146842001-11-19 Akim Demaille <akim@epita.fr>
14685
14686 * src/lalr.h (state_t): New.
14687 (state_table): Be a state_t * instead of a core **.
14688 (accessing_symbol): Remove, part of state_t.
14689 * src/lalr.c: Adjust.
14690 (set_accessing_symbol): Merge into...
14691 (set_state_table): this.
14692 * src/print_graph.c, src/conflicts.c: Adjust.
14693
d803322e
AD
146942001-11-14 Akim Demaille <akim@epita.fr>
14695
14696 * tests/calc.at, tests/output.at, tests/regression.at,
14697 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14698 now the tests are run in private dirs, therefore AC_CLEANUP and
14699 family can be simplified to 0-ary.
14700 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14701 use abs. path to find config.h.
14702 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14703 stderr, there can be way too much random noise.
14704 Instead pass -Werror to GCC and rely on the exit status.
14705 Reported by Wolfram Wagner.
14706
3d76b07d
AD
147072001-11-14 Akim Demaille <akim@epita.fr>
14708
14709 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14710 defined only if yyoverflow is defined, to avoid `warning: unused
14711 variable `yyvs1''.
14712 Reported by The Test Suite.
14713
09b503c8
AD
147142001-11-14 Akim Demaille <akim@epita.fr>
14715
14716 * src/print.c: Include reduce.h.
14717 Reported by Hans Aberg.
14718
147192001-11-14 Akim Demaille <akim@epita.fr>
14720
14721 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
14722 Revert a previous patch: these are really const.
14723 * src/conflicts.c (conflict_report): Additional useless pair of
14724 braces to pacify GCC's warnings for `if () if () {} else {}'.
14725 * src/lex.c (parse_percent_token): Replace equal_offset with
14726 arg_offset.
14727 arg is const.
14728 Be sure to strdup `arg' when used, since there is no reason for
14729 token_buffer not to change.
14730
0f37a994
AD
147312001-11-14 Akim Demaille <akim@epita.fr>
14732
14733 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14734 definition.
14735 * src/main.c (main): Use them.
14736 Suggested by Hans Aberg.
14737
d39d93b8
AD
147382001-11-12 Akim Demaille <akim@epita.fr>
14739
14740 * src/system.h (ngettext): Now that we use ngettext, be sure to
14741 provide a default definition when NLS are not used.
14742
9edcd895
AD
147432001-11-12 Akim Demaille <akim@epita.fr>
14744
14745 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
14746 Use @kbd to denote user input.
14747 (Language and Grammar): ANSIfy the example.
14748 Adjust its layout for info/notinfo.
14749 (Location Tracking Calc): Output error messages to stderr.
14750 Output locations in a more GNUtically correct way.
14751 Fix a couple of Englishos.
14752 Adjust @group/@end group pairs.
14753
7da99ede
AD
147542001-11-12 Akim Demaille <akim@epita.fr>
14755
e3aa65c5 14756 %expect was not functioning at all.
7da99ede
AD
14757
14758 * src/conflicts.c (expected_conflicts): Set to -1.
14759 (conflict_report): Use ngettext.
14760 (conflicts_print): Check %expect and make its violation an error.
14761 * doc/bison.texinfo (Expect Decl): Adjust.
14762 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
14763 * tests/regression.at (%expect not enough, %expect right)
14764 (%expect too much): New.
14765
ba9dda1a
AD
147662001-11-12 Akim Demaille <akim@epita.fr>
14767
14768 * tests/regression.at (Conflicts): Rename as...
14769 (Unresolved SR Conflicts): this.
14770 (Solved SR Conflicts): New.
14771
337c5bd1
AD
147722001-11-12 Akim Demaille <akim@epita.fr>
14773
14774 * src/reduce.c (print_results): Rename as...
14775 (reduce_output): This.
14776 Output to OUT, passed as argument, instead of output_obstack.
14777 (dump_grammar): Likewise.
14778 (reduce_free): New.
14779 Also free V1.
14780 (reduce_grammar): No longer call reduce_output, since...
14781 * src/print.c (print_results): do it.
14782 * src/main.c (main): Call reduce_free;
14783
c73a41af
AD
147842001-11-12 Akim Demaille <akim@epita.fr>
14785
14786 * src/conflicts.c (print_reductions): Accept OUT as argument.
14787 Output to it, not to output_obstack.
14788 * src/print.c (print_actions): Adjust.
14789
0df87bb6
AD
147902001-11-12 Akim Demaille <akim@epita.fr>
14791
14792 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
14793 the result instead of using...
14794 (src_total, rrc_total, src_count, rrc_count): Remove.
14795 (any_conflicts): Remove.
14796 (print_conflicts): Split into...
14797 (conflicts_print, conflicts_output): New.
14798 * src/conflicts.h: Adjust.
14799 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 14800 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
14801 * tests/regression.at (Conflicts): New.
14802 Reported by Tom Lane.
14803
e4d3d4de
AD
148042001-11-12 Akim Demaille <akim@epita.fr>
14805
14806 * tests/regression.at (Invalid input): Remove, duplicate with
14807 ``Invalid input: 1''.
14808
6d7d248e
AD
148092001-11-12 Akim Demaille <akim@epita.fr>
14810
14811 * tests/torture.at (AT_DATA_STACK_TORTURE)
14812 (Exploding the Stack Size with Alloca)
14813 (Exploding the Stack Size with Malloc): New.
14814
e9e4c321
AD
148152001-11-12 Akim Demaille <akim@epita.fr>
14816
14817 * src/bison.simple (YYSTACK_REALLOC): New.
14818 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 14819 Reported by Per Allansson.
e9e4c321 14820
5f7e0832
AD
148212001-11-12 Pascal Bart <pascal.bart@epita.fr>
14822
14823 * src/bison.simple: Define type yystype instead of YYSTYPE, and
14824 define CPP macro, which substitute YYSTYPE by yystype.
14825 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
14826 with yyltype/YYLTYPE. This allows inclusion of the generated
14827 header within the parser if the compiler, such as GGC, accepts
14828 multiple equivalent #defines.
14829 From Akim.
14830
e3f1699f
AD
148312001-11-05 Akim Demaille <akim@epita.fr>
14832
14833 * src/reader.c (symbols_output): New, extracted from...
14834 (packsymbols): here.
14835 (reader): Adjust.
14836
65be0866
AD
148372001-11-05 Akim Demaille <akim@epita.fr>
14838
14839 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14840
e4d910bf
AD
148412001-11-05 Akim Demaille <akim@epita.fr>
14842
14843 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14844 pattern.
14845
951366c1
AD
148462001-11-05 Akim Demaille <akim@epita.fr>
14847
14848 * src/options.h (struct option_table_struct): set_flags is void*.
14849 * src/options.c (longopts): Support `--output' and `%output'.
14850 (usage): Adjust.
14851 * src/lex.h (tok_setopt): Remove, replaced with...
14852 (tok_intopt, tok_stropt): these new guys.
14853 * src/lex.c (getopt.h): Not needed.
14854 (token_buffer, unlexed_token_buffer): Not const.
14855 (percent_table): Promote `-' over `_' in directive names.
14856 Active `%name-prefix', `file-prefix', and `output'.
14857 (parse_percent_token): Accept possible arguments to directives.
14858 Promote `-' over `_' in directive names.
14859
d8988b2f
AD
148602001-11-04 Akim Demaille <akim@epita.fr>
14861
14862 * doc/bison.texinfo (Decl Summary): Split the list into
14863 `directives for grammars' and `directives for bison'.
14864 Sort'em.
14865 Add description of `%name-prefix', `file-prefix', and `output'.
14866 Promote `-' over `_' in directive names.
14867 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14868 Simplify the description of `--name-prefix'.
14869 Promote `-' over `_' in directive names.
14870 Promote `--output' over `--output-file'.
14871 Fix the description of `--defines'.
14872 * tests/output.at: Exercise %file-prefix and %output.
14873
6468d18e
AD
148742001-11-02 Akim Demaille <akim@epita.fr>
14875
14876 * doc/refcard.tex: Update.
14877
6b7e85b9
AD
148782001-11-02 Akim Demaille <akim@epita.fr>
14879
14880 * src/symtab.h (SUNDEF): New.
14881 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14882 stand for `uninitialized', instead of 0.
14883 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14884 * src/lex.c (lex): Adjust.
14885
14886 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14887 Number it 0.
14888 Let yylex return it instead of a plain 0.
14889 Reported by Dick Streefland.
14890
cd5aafcf
AD
148912001-11-02 Akim Demaille <akim@epita.fr>
14892
14893 * tests/regression.at (Mixing %token styles): New test.
14894
037ca2f1
AD
148952001-11-02 Akim Demaille <akim@epita.fr>
14896
14897 * src/reader.c (parse_thong_decl): Formatting changes.
14898 (token_translations_init): New, extracted from...
14899 (packsymbols): Here.
14900 Adjust.
14901
270a173c
AD
149022001-11-01 Akim Demaille <akim@epita.fr>
14903
14904 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14905 Check that `9foo.y' produces correct cpp guards.
14906 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14907 guards.
14908 Reported by Wwp.
14909
561f9a30
AD
149102001-11-01 Akim Demaille <akim@epita.fr>
14911
14912 * tests/regression.at (Invalid input: 2): New.
14913 * src/lex.c (unlexed_token_buffer): New.
14914 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14915 too.
14916 Reported by Wwp.
14917
f987e9d2
AD
149182001-11-01 Akim Demaille <akim@epita.fr>
14919
14920 * tests/calc.at: Catch up with 1.30.
14921 * configure.in: Bump to 1.49a.
14922 Adjust to newer Autotest.
14923
0846f581
PB
149242001-10-19 Pascal Bart <pascal.bart@epita.fr>
14925
14926 * src/conflicts.c: Move global variables rrc_total and src_total ...
14927 (print_conflicts): here.
14928 * src/output.c (output): Free global variable user_toknums.
14929 * src/lex.c (token_obstack): Become static.
14930
3c1a79b3
AD
149312001-10-18 Akim Demaille <akim@epita.fr>
14932
14933 * tests/atlocal.in (GCC): Add.
14934 * tests/calc.at: s/m4_match/m4_bmatch/.
14935 s/m4_patsubst/m4_bpatsubst/.
14936 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14937 * configure.in: AC_SUBST(GCC).
14938
5d52e7d0
MA
149392001-10-14 Marc Autret <autret_m@epita.fr>
14940
14941 * src/options.c (create_long_option_table): Fix.
14942
631aa1d3
AD
149432001-10-10 Akim Demaille <akim@epita.fr>
14944
14945 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14946
f6ec6d13
AD
149472001-10-04 Akim Demaille <akim@epita.fr>
14948
14949 * src/reader.c (parse_union_decl): Push the caracters in
14950 union_obstack, not attrs_obstack.
14951
342b8b6e
AD
149522001-10-04 Akim Demaille <akim@epita.fr>
14953
14954 Merge in the branch 1.29.
14955
14956 * src/reader.c (packsymbols): Use a temporary obstack for
14957 `%%tokendef', since output_stack is already used elsewhere.
14958
14959 2001-10-02 Akim Demaille <akim@epita.fr>
14960
14961 Bump 1.29d.
14962
14963 2001-10-02 Akim Demaille <akim@epita.fr>
14964
14965 Version 1.29c.
14966
14967 2001-10-02 Akim Demaille <akim@epita.fr>
14968
14969 * tests/regression.at (Invalid CPP headers): New.
14970 From Alexander Belopolsky.
14971 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14972
14973 2001-10-02 Akim Demaille <akim@epita.fr>
14974
14975 * tests/regression.at (Invalid input): New.
14976 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14977 Reported by Shura.
14978
14979 2001-10-02 Akim Demaille <akim@epita.fr>
14980
14981 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14982
14983 2001-10-02 Akim Demaille <akim@epita.fr>
14984
14985 * src/output.c (output_parser): Assert `skeleton'.
14986 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14987 systems.
14988 From Shura.
14989
14990 2001-10-01 Marc Autret <autret_m@epita.fr>
14991
14992 * src/lex.h: Echo modifications.
14993 * src/lex.c (unlex): Parameter is now token_t.
14994 From Hans Aberg.
14995
14996 2001-10-01 Marc Autret <autret_m@epita.fr>
14997
14998 * src/main.c: Include lex.h.
14999 From Hans Aberg.
15000
15001 2001-09-29 Akim Demaille <akim@epita.fr>
15002
15003 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
15004
15005 2001-09-28 Akim Demaille <akim@epita.fr>
15006
15007 * tests/testsuite.at: Update to newer Autotest.
15008 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
15009
15010 2001-09-27 Akim Demaille <akim@epita.fr>
15011
15012 Position independent wrapper.
15013
15014 * tests/bison: Remove.
15015 * tests/bison.in: New.
15016 * configure.in: Adjust.
15017
15018 2001-09-27 Paul Eggert <eggert@twinsun.com>
15019
15020 Port quotearg fixes from tar 1.13.24.
15021
15022 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
15023 tm to be declared.
15024 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
15025 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
15026
15027 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
15028 * m4/mbrtowc.m4: New file.
15029 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
15030 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
15031
15032 2001-09-27 Akim Demaille <akim@epita.fr>
15033
15034 Bump to 1.29c.
15035
15036 2001-09-27 Akim Demaille <akim@epita.fr>
15037
15038 Version 1.29b.
15039
15040 2001-09-25 Akim Demaille <akim@epita.fr>
15041
15042 * src/system.h: Include `xalloc.h'.
15043 Remove it from the C files.
15044 * src/files.c (output_files): Free the obstacks.
15045 * src/lex.c (init_lex): Rename as...
15046 (lex_init): this.
15047 (lex_free): New.
15048 * src/main.c (main): Use it.
15049
15050 2001-09-24 Marc Autret <autret_m@epita.fr>
15051
15052 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
15053 to output informations in fout (FILE*).
15054 (open_graph, close_graph): Likewise.
15055 (output_graph, output_edge, output_node): Likewise.
15056 * src/vcg.h: Update function prototypes.
15057 * src/print_graph.c (print_graph): Open output graph file.
15058 (print_actions): Adjust.
15059 * src/files.h: Remove extern declaration.
15060 * src/files.c: Remove graph_obstack declaration.
15061 (open_files): Remove graph_obstack initialization.
15062 (output_files): Remove graph_obstack saving.
15063
15064 2001-09-24 Marc Autret <autret_m@epita.fr>
15065
15066 * src/files.c (compute_output_file_names): Fix.
15067
15068 2001-09-24 Marc Autret <autret_m@epita.fr>,
15069 Akim Demaille <akim@epita.fr>
15070
15071 * src/reader.c (reader): Remove call to free_symtab ().
15072 * src/main.c (main): Call it here.
15073 Include symtab.h.
15074 * src/conflicts.c (initialize_conflicts): Rename as...
15075 (solve_conflicts): this.
15076 * src/print.c (print_core, print_actions, print_state)
15077 (print_grammar): Dump to a file instead a `output_obstack'.
15078 (print_results): Dump `output_obstack', and then proceed with the
15079 FILE *.
15080 * src/files.c (compute_output_file_names, close_files): New.
15081 (output_files): Adjust.
15082 * src/main.c (main): Adjust.
15083
15084 2001-09-23 Marc Autret <autret_m@epita.fr>
15085
15086 * src/files.c (compute_header_macro): Computes header macro name
15087 from spec_defines_file when given.
15088
15089 2001-09-23 Marc Autret <autret_m@epita.fr>
15090
15091 * src/files.c (output_files): Add default extensions.
15092
15093 2001-09-22 Akim Demaille <akim@epita.fr>
15094
15095 * src/conflicts.c (finalize_conflicts): Rename as...
15096 (free_conflicts): this.
15097
15098 2001-09-22 Akim Demaille <akim@epita.fr>
15099
15100 * src/gram.c (gram_free): Rename back as...
15101 (dummy): this.
15102 (output_token_translations): Free `token_translations'.
15103 * src/symtab.c (free_symtab): Free the tag field.
15104
15105 2001-09-22 Akim Demaille <akim@epita.fr>
15106
15107 Remove `translations' as it is always set to true.
15108
15109 * src/gram.h: Adjust.
15110 * src/reader.c (packsymbols, parse_token_decl): Adjust
15111 * src/print.c (print_grammar): Adjust.
15112 * src/output.c (output_token_translations): Adjust.
15113 * src/lex.c (lex): Adjust.
15114 * src/gram.c: Be sure the set pointers to NULL.
15115 (dummy): Rename as...
15116 (gram_free): this.
15117
15118 2001-09-22 Akim Demaille <akim@epita.fr>
15119
15120 * configure.in: Invoke AM_LIB_DMALLOC.
15121 * src/system.h: Use dmalloc.
15122 * src/LR0.c: Be sure to have pointers initialized to NULL.
15123 (allocate_itemsets): Allocate kernel_items only if needed.
15124
15125 2001-09-22 Akim Demaille <akim@epita.fr>
15126
15127 * configure.in: Bump to 1.29b.
15128 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
15129 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
15130 need xmalloc.c in calc.y.
15131 From Pascal Bart.
15132
15133 2001-09-21 Akim Demaille <akim@epita.fr>
15134
15135 Version 1.29a.
15136 * Makefile.maint, config/config.guess, config/config.sub,
15137 * config/missing: Update from masters.
15138 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15139 upon package.m4.
15140 * configure.in (ALL_LINGUAS): Add `tr'.
15141
15142 2001-09-21 Akim Demaille <akim@epita.fr>
15143
15144 * tests/Makefile.am (package.m4): Move to...
15145 ($(srcdir)/$(TESTSUITE)): here.
15146
15147 2001-09-20 Akim Demaille <akim@epita.fr>
15148
15149 * src/complain.c: No longer try to be standalone: use system.h.
15150 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15151 * src/complain.h: Likewise.
15152 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15153 Remove the unused variable `n'.
15154 From Albert Chin-A-Young.
15155
15156 2001-09-18 Marc Autret <autret_m@epita.fr>
15157
15158 * doc/bison.1: Update.
15159 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15160 descriptions.
15161 (Option Cross Key): Update.
15162 Add --graph.
15163
15164 2001-09-18 Marc Autret <autret_m@epita.fr>
15165
15166 * tests/regression.at: New test (comment in %union).
15167
15168 2001-09-18 Marc Autret <autret_m@epita.fr>
15169
15170 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15171 do that.
15172 Reported by Keith Browne.
15173
15174 2001-09-18 Marc Autret <autret_m@epita.fr>
15175
15176 * tests/output.at: Add tests for --defines and --graph.
15177
15178 2001-09-18 Marc Autret <autret_m@epita.fr>
15179
15180 * tests/output.at: Removes tests of %{header,src}_extension features.
15181
15182 2001-09-18 Akim Demaille <akim@epita.fr>
15183
15184 * tests/Makefile.am (package.m4): New.
15185 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15186 (_AT_CHECK_CALC_ERROR): Likewise.
15187 Factor the `, ' part of verbose error messages.
15188
15189 2001-09-18 Marc Autret <autret_m@epita.fr>
15190
15191 * src/getargs.c (longopts): Declare --defines and --graph as options
15192 with optional arguments.
15193 * src/files.h: Add extern declarations.
15194 * src/files.c (spec_graph_file, spec_defines_file): New.
15195 (output_files): Update.
15196 Remove CPP-outed code.
15197
15198 2001-09-18 Marc Autret <autret_m@epita.fr>
15199
15200 Turn off %{source,header}_extension feature.
15201
15202 * src/files.c (compute_exts_from_gf): Update.
15203 (compute_exts_from_src): Update.
15204 (output_files): CPP-out useless code.
15205 * src/files.h: Remove {header,source}_extension extern declarations.
15206 * src/reader.c (parse_dquoted_param): CPP-out.
15207 (parse_header_extension_decl): Remove.
15208 (parse_source_extension_decl): Remove.
15209 (read_declarations): Remove cases tok_{hdrext,srcext}.
15210 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15211 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15212
15213 2001-09-10 Akim Demaille <akim@epita.fr>
15214
15215 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15216 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15217 (AT_CHECK_OUTPUT): this.
15218 Merely check ls' exit status, its output is useless.
15219
15220 2001-09-10 Akim Demaille <akim@epita.fr>
15221
15222 * tests/calc.at: Use m4_match.
15223 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15224
15225 2001-09-10 Marc Autret <autret_m@epita.fr>,
15226 Akim Demaille <akim@epita.fr>
15227
15228 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15229 enum color_e.
15230 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15231 to `normal'.
15232 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15233 * src/lex.h: Adjust prototype.
15234 (token_t): Add `tok_undef'.
15235 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15236 (parse_percent_token): Now returns token_t.
15237 Add default statement in switch.
15238 (lex): Separate `c' as an input variable, from the token_t result
15239 part.
15240 (unlexed): Is a token_t.
15241
15242 2001-09-10 Akim Demaille <akim@epita.fr>
15243
15244 * configure.in: Bump to 1.29a.
15245
15246 2001-09-07 Akim Demaille <akim@epita.fr>
15247
15248 Version 1.29.
15249
15250 2001-08-30 Akim Demaille <akim@epita.fr>
15251
15252 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15253 * m4/atconfig.m4: Remove.
15254 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15255 * tests/bison: New.
15256 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15257 m4_if, m4_patsubst, and m4_regexp.
15258 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15259 `input' file instead of echo.
15260
15261 2001-08-29 Akim Demaille <akim@epita.fr>
15262
15263 Bump to 1.28e.
15264
15265 2001-08-29 Akim Demaille <akim@epita.fr>
15266
15267 Version 1.28d.
15268
15269 2001-08-29 Paul Eggert <eggert@twinsun.com>
15270
15271 * src/bison.simple (yyparse): Don't take the address of an
15272 item before the start of an array, as that doesn't conform to
15273 the C Standard.
15274
15275 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15276
15277 * doc/bison.texinfo (Location Tracking Calc): New node.
15278
15279 2001-08-29 Paul Eggert <eggert@twinsun.com>
15280
15281 * src/output.c (output): Do not define const, as this now
15282 causes more problems than it cures.
15283
15284 2001-08-29 Akim Demaille <akim@epita.fr>
15285
15286 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15287 the nodes.
15288 Be sure to tag the `detailmenu'.
15289
15290 2001-08-29 Akim Demaille <akim@epita.fr>
15291
15292 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15293 download in a tmp dir.
15294
15295 2001-08-28 Marc Autret <autret_m@epita.fr>
15296
15297 * config/depcomp: New file.
15298
15299 2001-08-28 Marc Autret <autret_m@epita.fr>
15300
15301 * doc/bison.1 (mandoc): Adjust.
15302 From Juan Manuel Guerrero.
15303
15304 2001-08-28 Marc Autret <autret_m@epita.fr>
15305
15306 * src/print_graph.c (print_state): Fix.
15307
15308 2001-08-27 Marc Autret <autret_m@epita.fr>
15309
15310 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15311 char * members.
15312 Echo modifications to the functions prototypes.
15313 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15314
15315 2001-08-27 Marc Autret <autret_m@epita.fr>
15316
15317 * src/vcg.c: Include `xalloc.h'.
15318 (add_colorentry): New.
15319 (add_classname): New.
15320 (add_infoname): New.
15321 * src/vcg.h: Add new prototypes.
15322
15323 2001-08-27 Akim Demaille <akim@epita.fr>
15324
15325 * Makefile.maint: Sync. again with CVS Autoconf.
15326
15327 2001-08-27 Akim Demaille <akim@epita.fr>
15328
15329 * Makefile.maint: Formatting changes.
15330 (po-update, cvs-update, update): New targets.
15331 (AMTAR): Remove.
15332
15333 2001-08-27 Akim Demaille <akim@epita.fr>
15334
15335 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15336 * Makefile.maint: Sync. with CVS Autoconf.
15337
15338 2001-08-27 Marc Autret <autret_m@epita.fr>
15339
15340 * src/vcg.h (struct infoname_s): New.
15341 (struct colorentry_s): New.
15342 (graph_s): New fields {vertical,horizontal}_order in structure.
15343 Add `infoname' field.
15344 Add `colorentry' field;
15345 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15346 (G_HORIZONTAL_ORDER): New.
15347 (G_INFONAME): New.
15348 (G_COLORENTRY): New.
15349 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15350 Add output of `infoname'.
15351 Add output of `colorentry'.
15352
15353 2001-08-27 Marc Autret <autret_m@epita.fr>
15354
15355 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15356 This one shadowed a global parameter.
15357
15358 2001-08-24 Marc Autret <autret_m@epita.fr>
15359
15360 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15361 instead of `unsigned'.
15362 (print_state): Do not call obstack_object_size () in obstack_grow ()
15363 to avoid macro variables shadowing.
15364
15365 2001-08-23 Marc Autret <autret_m@epita.fr>
15366
15367 * src/lex.c (percent_table): Typo: s/naem/name/.
15368 Add graph option.
15369 Normalize new options declarations.
15370
15371 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15372
15373 * tests/suite.at: Exercise %header_extension and %source_extension.
15374
15375 2001-08-16 Marc Autret <autret_m@epita.fr>
15376
15377 * src/reader.c (parse_dquoted_param): New.
15378 (parse_header_extension_decl): Use it.
15379 (parse_source_extension_decl): Likewise.
15380
15381 2001-08-16 Marc Autret <autret_m@epita.fr>
15382
15383 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15384 (get_xxxx_str): Use assert () instead of complain ().
15385 Remove return invokations in default cases.
15386 (get_decision_str): Modify default behaviour. Remove second argument.
15387 Echo modifications on calls.
15388 (output_graph): Fix.
15389
15390 2001-08-16 Marc Autret <autret_m@epita.fr>
15391
15392 * src/getargs.c (usage): Update with ``-g, --graph''.
15393
15394 2001-08-16 Marc Autret <autret_m@epita.fr>
15395
15396 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15397 (Option Cross Key): Likewise.
15398 * doc/bison.1: Update.
15399
1c8c2190
PB
154002001-09-25 Pascal Bart <pascal.bart@epita.fr>
15401
15402 * src/output.c (output_master_parser): Don't finish action_obstack.
15403 (output_parser): Don't care about the muscle action, here.
15404 (prepare): Copy the action_obstack in the action muscle.
15405 (output): Free action_obstack.
15406
180d45ba
PB
154072001-09-23 Pascal Bart <pascal.bart@epita.fr>
15408
15409 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15410 will contain `%union' declaration.
15411 (parse_union_decl): Delete #line directive output.
15412 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15413 informations about %union.
15414 (parse_union_decl): Copy the union_obstack in the muscle stype.
15415 * src/bison.simple: Add new #line directive.
15416 Add typdef %%stype YYSTYPE.
15417
c51d1a19
PB
154182001-09-23 Pascal Bart <pascal.bart@epita.fr>
15419
15420 * src/bison.simple: Add new `#line' directive.
15421
6f9344da
PB
154222001-09-22 Pascal Bart <pascal.bart@epita.fr>
15423
15424 * src/bison.simple: New `#line' directive.
15425 * src/output.c (output_parser): Support new dynamic muscle input_line.
15426
652def80
MA
154272001-09-22 Marc Autret <autret_m@epita.fr>
15428
15429 * src/output.c (output_master_parser): New.
15430 (output_parser): Be more re-entrant.
15431
25b222fa
MA
154322001-09-21 Marc Autret <autret_m@epita.fr>
15433
15434 * src/reader.c (copy_definition, parse_union_decl): Update and use
15435 `linef' muscle.
15436 (copy_action): Likewise.
15437 Use obstack_1grow ().
15438 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15439
6bc35ae5
MA
154402001-09-21 Marc Autret <autret_m@epita.fr>
15441
15442 * src/options.c (option_table): Adjust.
15443 * src/lex.c (parse_percent_token): Fix.
15444
c0629aa1
PB
154452001-09-20 Pascal Bart <pascal.bart@epita.fr>
15446
15447 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 15448
82b6d266
PB
154492001-09-20 Pascal Bart <pascal.bart@epita.fr>
15450
15451 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15452 is now an option_table_struct*.
15453 (option_strcmp): New function option_strcmp.
15454 (parse_percent_token): Call option_strcmp.
15455 * src/getargs.c (xalloc.h, options.h): Include it.
15456 (getargs): Call create_long_option_table.
15457 (getargs): Free longopts at the end of the function.
15458 (shortopts): Move in options.c.
15459 * src/options.c (create_long_option_table): New function. Convert
15460 information from option_table to option structure.
15461 * src/reader.c (options.h): Include it.
15462
15463 * src/Makefile.am: Adjust.
15464 * src/options.c (option_table): Create from longopts and percent_table.
15465 * src/getargs.c (longopts): Delete.
15466 * src/lex.c (struct percent_table_struct): Delete.
15467 (percent_table): Delete.
15468 (options.h): Include it.
15469 * src/options.c: Create.
15470 * src/options.h: Create.
15471 Declare enum opt_access_e.
15472 Define struct option_table_struct.
15473
75f5aaea
MA
154742001-09-20 Marc Autret <autret_m@epita.fr>
15475
15476 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15477 sections of Bison.
15478
f508cb0a
PB
154792001-09-19 Pascal Bart <pascal.bart@epita.fr>
15480
15481 * src/bison.simple: s/%%filename/%%skeleton.
15482 * src/muscle_tab.c (getargs.h): Include it.
15483 (muscle_init): Insert new muscle skeleton.
15484
13105fc1
PB
154852001-09-18 Pascal Bart <pascal.bart@epita.fr>
15486
15487 * src/output.c (output_parser): Delete unused variable actions_dumped.
15488
b0c4483e
PB
154892001-09-07 Pascal Bart <pascal.bart@epita.fr>
15490
15491 * src/output.c (output): Delete call to reader_output_yylsp.
15492 * src/reader.c (reader): Likewise.
ba0fe3c7 15493 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 15494
11d82f03
MA
154952001-09-02 Marc Autret <autret_m@epita.fr>
15496
15497 * src/reader.c: Include muscle_tab.h.
15498 (parse_union_decl): Update.
15499 (parse_macro_decl): Rename parse_muscle_decl.
15500 Update to use renamed functions and variable.
15501 (read_declarations, copy_action, read_additionnal_code, : Updated
15502 with correct variables and functions names.
15503 (packsymbols, reader): Likewise.
342b8b6e 15504
11d82f03 15505 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 15506
11d82f03
MA
15507 * src/output.c: Include muscle_tab.h
15508 In all functions using macro_insert, change by using muscle_insert ().
15509 (macro_obstack): Rename muscle_obstack.
15510 Echo modifications in the whole file.
15511 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15512 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15513 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15514
15515 * src/muscle_tab.h: Update double inclusion macros.
15516 (macro_entry_s): Rename muscle_entry_s.
15517 Update prototypes.
342b8b6e 15518
11d82f03
MA
15519 * src/muscle_tab.c: Include muscle_tab.h.
15520 Rename macro_tabble to muscle_table.
15521 (mhash1, mhash2, mcmp): Use muscle_entry.
15522 (macro_init): Rename muscle_init. Update.
15523 (macro_insert): Rename muscle_insert. Update.
15524 (macro_find): Rename muscle_find. Update.
15525
15526 * src/main.c: Include muscle_tab.h.
15527 (main): Call muscle_init ().
15528 * src/Makefile.am (bison_SOURCES): Echo modifications.
15529
93a37297
MA
155302001-09-02 Marc Autret <autret_m@epita.fr>
15531
f753cd62 15532 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 15533
f753cd62
MA
15534 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15535
155362001-09-02 Marc Autret <autret_m@epita.fr>
15537
15538 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 15539
682d48cd
PB
155402001-09-01 Pascal Bart <pascal.bart@epita.fr>
15541
342b8b6e 15542 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
15543 filename.
15544
087c8fda
MA
155452001-09-01 Marc Autret <autret_m@epita.fr>
15546
15547 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15548 to an explicit value to activate the feature. We do it here.
15549
dda680cb
PB
155502001-08-31 Pascal Bart <pascal.bart@epita.fr>
15551
15552 * src/output.c (prepare): Delete the `filename' muscule insertion.
15553 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15554 (parse_union_decl): Likewise.
15555 * src/macrotab.c (macro_init): Initialize filename by infile.
15556
9e644e64
MA
155572001-08-31 Marc Autret <autret_m@epita.fr>
15558
15559 * src/bison.simple (YYLSP_NEEDED): New definition.
15560 * src/output.c (prepare): Add macro insertion of `locations_flag'
15561
17da6427
PB
155622001-08-31 Pascal Bart <pascal.bart@epita.fr>
15563
15564 * src/output.c (prepare): Delete insertion of previous muscles,
15565 and insert the `prefix' muscles.
15566 * src/macrotab.c (macro_init): Likewise.
15567 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 15568 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
15569 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15570 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 15571 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
15572 name_prefix.
15573
e8cb70b9
PB
155742001-08-31 Pascal Bart <pascal.bart@epita.fr>
15575
15576 * src/main.c (main): Standardize.
15577 * src/output.c (output_table_data, output_parser): Likewise.
15578 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15579
63c2d5de
MA
155802001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15581
342b8b6e 15582 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
15583 %%epilogue.
15584 * src/output.c (output): Rename %%declarations to %%prologue.
15585 * src/bison.simple: Echo modifications.
342b8b6e 15586
d8cb5183
MA
155872001-08-31 Marc Autret <autret_m@epita.fr>
15588
15589 * src/reader.c (readgram): CleanUp.
15590 (output_token_defines): Likewise.
15591 (packsymbols): Likewise.
15592 (reader): Likewise.
15593 * src/output.c (output): CPP-out useless code.
15594
6c686258
PB
155952001-08-31 Pascal Bart <pascal.bart@epita.fr>
15596
342b8b6e 15597 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
15598 output_trailers and output_headers.
15599 * src/output.h: Remove obsolete functions prototypes of output_headers
15600 and output_trailers.
15601
8f451ef7
PB
156022001-08-30 Pascal Bart <pascal.bart@epita.fr>
15603
15604 * src/main.c: Include macrotab.h.
342b8b6e 15605 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
15606 Adjust functions prototypes.
15607 * src/macrotab.c (macro_insert): Constify key and value.
15608 (macro_find): Constify key.
15609 (macro_insert): Include 'xalloc.h'
15610 (macro_insert): Use XMALLOC.
15611 (macro_find): Constify return value.
15612 * src/output.c (output_table_data): Rename table to table_data.
15613 (output_parser): Constify macro_key, macro_value.
15614
997b6fd0 156152001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
15616
15617 * src/reader.c (parse_skel_decl): New.
342b8b6e 15618 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
15619 * src/lex.h (token_t): New token `tok_skel'.
15620 * src/lex.c (percent_table): Add skeleton option entry.
15621 Standardize.
15622
ff48177d
MA
156232001-08-29 Marc Autret <autret_m@epita.fr>
15624
15625 * src/bison.simple: Add %%user_code directive at the end.
15626 * src/reader.c (read_additionnal_code): New.
15627 (reader): Use it.
15628 * src/output.c (output_program): Remove.
15629 (output): Update.
15630
b33160bf
MA
156312001-08-28 Marc Autret <autret_m@epita.fr>
15632
15633 * src/output.c (output_actions): Clean up.
4e5caae2 15634 (output_gram): CPP-out useless code.
b33160bf
MA
15635 * src/reader.c (reader): Clean up, CPP-out useless code.
15636
d1a2daf7
PB
156372001-08-28 Pascal Bart <pascal.bart@epita.fr>
15638
342b8b6e 15639 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 15640 directive.
d1a2daf7
PB
15641 * src/bison.simple: Add `%%definitions'.
15642
2b763dfe
MA
156432001-08-28 Marc Autret <autret_m@epita.fr>
15644
15645 * config/depcomp: New file.
15646
f1a87ef6
PE
156472001-08-27 Paul Eggert <eggert@twinsun.com>
15648
15649 * src/bison.simple (yyparse): Don't take the address of an
15650 item before the start of an array, as that doesn't conform to
15651 the C Standard.
15652
82e236e2
RA
156532001-08-27 Robert Anisko <robert.anisko@epita.fr>
15654
f1a87ef6 15655 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
15656 obstack. It was done too late here.
15657
15658 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15659 completely wrong.
15660 (reader): Initialize the macro obstack here, since we need it to grow
15661 '%define' directives.
15662
15663 * src/reader.h: Declare the macro obstack as extern.
15664
b0cfa28a
RA
156652001-08-27 Robert Anisko <robert.anisko@epita.fr>
15666
15667 * src/output.c (output_parser): Fix. Store single '%' characters in
15668 the output obstack instead of throwing them away.
15669
6fc74234
AD
156702001-08-27 Akim Demaille <akim@epita.fr>
15671
15672 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15673
9c76d118
RA
156742001-08-25 Robert Anisko <robert.anisko@epita.fr>
15675
15676 * lib/Makefile.am: Adjust.
15677
a8289c62
RA
156782001-08-25 Robert Anisko <robert.anisko@epita.fr>
15679
15680 * src/bison.simple: Update and add '%%' directives.
15681
b6610515
RA
156822001-08-25 Robert Anisko <robert.anisko@epita.fr>
15683
15684 * src/reader.c (reader): Remove calls to 'output_headers' and
15685 'output_trailers'. Remove some C output.
15686 (readgram): Disable a piece of code that was writing a default
15687 definition for 'YYSTYPE'.
15688 (reader_output_yylsp): Remove.
15689 (packsymbols): Output token defintions to a macro.
15690 (copy_definition): Disable C output.
6fc74234 15691
b6610515
RA
15692 * src/reader.c (parse_macro_decl): New function used to parse macro
15693 declarations.
15694 (copy_string2): Put the body of copy_string into this new function.
15695 Add a parameter to let the caller choose whether he wants to copy the
15696 string delimiters or not.
15697 (copy_string): Be a simple call to copy_string2 with the last argument
15698 bound to true.
15699 (read_declarations): Add case for macro definition.
15700 (copy_identifier): New.
6fc74234 15701 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
15702 rather than lex.
15703
26f609ff
RA
157042001-08-25 Robert Anisko <robert.anisko@epita.fr>
15705
15706 * src/output.c (prepare): Add prefixed names.
15707 (output_parser): Output semantic actions.
15708 (output_parser): Fix bug on '%%line' directives.
6fc74234 15709
26f609ff
RA
15710 * src/output.c (output_headers): Remove. The C code printed by this
15711 function should now be in the skeletons.
15712 (output_trailers): Remove.
15713 (output): Disable call to 'reader_output_yylsp'.
15714 (output_rule_data): Do not output tables to the table obstack.
15715
15716 * src/output.c: Remove some C dedicated output.
15717 Improve the use of macro and output obstacks.
15718 (output_defines): Remove.
6fc74234 15719
26f609ff
RA
15720 * src/output.c (output_token_translations): Associate 'translate'
15721 table with a macro. No output to the table obstack.
15722 (output_gram): Same for 'rhs' and 'prhs'.
15723 (output_stos): Same for 'stos'.
15724 (output_rule_data): Same for 'r1' and 'r2'.
15725 (token_actions): Same for 'defact'.
15726 (goto_actions): Same for 'defgoto'.
15727 (output_base): Same for 'pact' and 'pgoto'.
15728 (output_table): Same for 'table'.
15729 (output_check): Same for 'check'.
6fc74234 15730
26f609ff
RA
15731 * src/output.c (output_table_data): New function.
15732 (output_short_table): Remove.
15733 (output_short_or_char_table): Remove.
6fc74234 15734
26f609ff
RA
15735 * src/output.c (output_parser): Replace most of the skeleton copy code
15736 with something new. Skeletons are now processed character by character
15737 rather than line by line, and Bison looks for '%%' macros. This is the
15738 first step in making Bison's output process (a lot) more flexible.
15739 (output_parser): Use the macro table.
15740
6f43b113
RA
157412001-08-25 Robert Anisko <robert.anisko@epita.fr>
15742
15743 * src/main.c (main): Initialize the macro table.
15744
dd3127cf
RA
157452001-08-25 Robert Anisko <robert.anisko@epita.fr>
15746
15747 * src/lex.c (percent_table): Add tok_define.
15748 * src/lex.h: Add tok_define.
15749
aa321494
RA
157502001-08-25 Robert Anisko <robert.anisko@epita.fr>
15751
15752 * src/macrotab.c: New file.
15753 * src/macrotab.h: New file.
15754 * src/Makefile.am: Update.
15755
68bd3b6b
RA
157562001-08-25 Robert Anisko <robert.anisko@epita.fr>
15757
15758 * lib/hash.c: New file.
15759 * lib/hash.h: New file.
15760 * lib/Makefile.am: Update.
15761
45f8dd1e
AD
157622001-08-15 Akim Demaille <akim@epita.fr>
15763
15764 Version 1.28c.
15765
40a64a7a 157662001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
15767
15768 * src/reader.c (readgram): Indent output macro YYSTYPE.
15769 (packsymbols): Likewise.
15770 (output_token_defines): Likewise.
15771 * src/files.c: Standardize.
15772 (compute_header_macro): New.
15773 (defines_obstack_save): New. Use compute_header_macro.
15774 (output_files): Update. Use defines_obstack_save.
15775
f9a8293a
AD
157762001-08-15 Akim Demaille <akim@epita.fr>
15777
15778 * doc/bison.texinfo (Table of Symbols): Document
15779 YYSTACK_USE_ALLOCA.
15780
150ca7a7
AD
157812001-08-15 Akim Demaille <akim@epita.fr>
15782
15783 * missing: Update from CVS Automake.
15784 * config/config.guess, config/config.sub, config/texinfo.tex:
15785 Update from gnu.org.
15786
69b5cec4
AD
157872001-08-15 Akim Demaille <akim@epita.fr>
15788
15789 * Makefile.maint: Sync with CVS Autoconf.
15790
f2b5126e
PB
157912001-08-14 Pascal Bart <pascal.bart@epita.fr>
15792
69b5cec4 15793 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
15794 `fdl.texi'.
15795 * doc/fdl.texi: Add to package.
15796
4ecbf796
MA
157972001-08-14 Marc Autret <autret_m@epita.fr>
15798
15799 Turn on %{source,header}_extension features.
15800
69b5cec4 15801 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
15802 source_extension.
15803 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 15804 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
15805 between options.
15806
95fb5662
MA
158072001-08-14 Marc Autret <autret_m@epita.fr>
15808
15809 * src/files.c (compute_base_names): Add extensions computing when
15810 `--file-prefix' used.
15811 Standardize function calls.
15812
78d09da9
MA
158132001-08-13 Marc Autret <autret_m@epita.fr>
15814
69b5cec4 15815 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
15816 defining it (defined but null disables alloca).
15817
5a009f2c
MA
158182001-08-13 Marc Autret <autret_m@epita.fr>
15819
15820 * src/bison.simple (_yy_memcpy): CPP reformat.
15821
1e41465a
PB
158222001-08-13 Pascal Bart <pascal.bart@epita.fr>
15823
15824 * tests/atconfig.in (CPPFLAGS): Fix.
15825
c67a198d
PB
158262001-08-10 Pascal Bart <pascal.bart@epita.fr>
15827
79282c6c 15828 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
15829 `gpl.texi'.
15830 * doc/gpl.texi: Add to package.
15831
09a6de7e
MA
158322001-08-10 Marc Autret <autret_m@epita.fr>
15833
15834 * src/print_graph.h: Fix.
15835 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15836
b77b9ee0
AD
158372001-08-10 Akim Demaille <akim@epita.fr>
15838
15839 * src/system.h: Provide default declarations for stpcpy, strndup,
15840 and strnlen.
15841
3e259915
MA
158422001-08-10 Robert Anisko <anisko_r@epita.fr>
15843
15844 * doc/bison.texinfo (Locations): Update @$ stuff.
15845
ca96bc2d
MA
158462001-08-09 Robert Anisko <anisko_r@epita.fr>
15847
15848 * src/bison.simple (YYLLOC_DEFAULT): Update.
15849 (yyparse): Adjust.
15850
fdc6758b
MA
158512001-08-08 Marc Autret <autret_m@epita.fr>
15852
b77b9ee0 15853 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
15854 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15855 Reported by Fabrice Bauzac.
957d4dbf 15856
600cad3b
MA
158572001-08-08 Marc Autret <autret_m@epita.fr>
15858
15859 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15860 * src/vcg.c (output_node): Fix.
15861 * src/vcg.h: Cleanup.
15862 * src/print_graph.c: Add comments.
b77b9ee0 15863 (node_output_size): New global variable. Simplify the formatting of
600cad3b 15864 the VCG graph output.
b77b9ee0 15865 (print_actions): Unused code is now used. It notifies the final state
600cad3b 15866 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 15867 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
15868 blue.
15869 Get the current node name and node_obstack by argument.
15870 (node_obstack): New variable.
15871 (print_state): Manage node_obstack.
15872 (print_core): Use node_obstack given by argument.
15873 A node is not only computed here but in print_actions also.
15874 (print_graph): CPP out useless code instead of commenting it.
15875
976e528f
AD
158762001-08-07 Pascal Bart <pascal.bart@epita.fr>
15877
15878 * tests/atconfig.in (CPPFLAGS): Fix.
15879
20e8e5ca
AD
158802001-08-07 Akim Demaille <akim@epita.fr>
15881
15882 * src/print_graph.c (quote): New.
15883 (print_core): Use it.
15884
957d4dbf 158852001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 15886
3e3da797
AD
15887 * src/vcg.c (complain.h): Include it.
15888 Unepitaize `return' invocations.
c4b66126 15889 [NDEBUG] (main): Remove.
79282c6c 15890 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
15891 * src/files.c (open_files): Initialize graph_obstack.
15892 * src/print_graph.c (print_actions): CPP out useless code.
15893 (print_core): Don't output the last `\n' in labels.
15894 Use `quote'.
15895 * src/files.c (output_files): Output the VCG file.
15896 * src/main.c (main): Invoke print_graph ();
3e3da797 15897
957d4dbf 158982001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
15899
15900 Automaton VCG graph output.
15901 Using option ``-g'' or long option ``--graph'', you can generate
15902 a gram_filename.vcg file containing a VCG description of the LALR (1)
15903 automaton of your grammar.
15904
15905 * src/main.c: Call to print_graph() function.
15906 * src/getargs.h: Update.
15907 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15908 (graph_flag): New flag.
15909 (longopts): Update.
15910 (getargs): Add case `g'.
15911 * src/files.c (graph_obstack): New obstack struct.
15912 (open_files): Initialize new obstack.
15913 (output_files): Saves graph_obstack if required.
15914 * src/files.h (graph_obstack): New extern declaration.
15915 * src/Makefile.am: Add new source files.
15916
927c1557 159172001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
15918
15919 * src/print_graph.c, src/print_graph.h (graph): New.
15920 * src/vcg.h: New file.
15921 * src/vcg.c: New file, VCG graph handling.
15922
7333d403
AD
159232001-08-06 Marc Autret <autret_m@epita.fr>
15924
15925 Add of %source_extension and %header_extension which specify
15926 the source or/and the header output file extension.
15927
15928 * src/files.c (compute_base_names): Remove initialisation of
15929 src_extension and header_extension.
15930 (compute_exts_from_gf): Update.
15931 (compute_exts_from_src): Update.
15932 (output_files): Update.
15933 * src/reader.c (parse_header_extension_decl): New.
15934 (parse_source_extension_decl): New.
15935 (read_declarations): New case statements for the new tokens.
15936 * src/lex.c (percent_table): Add entries for %source_extension
15937 and %header_extension.
15938 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15939
84163231
AD
159402001-08-06 Marc Autret <autret_m@epita.fr>
15941
15942 * configure.in: Bump to 1.28c.
15943 * doc/bison.texinfo: Texinfo thingies.
15944
8303fc42
AD
159452001-08-04 Pascal Bart <pascal.bart@epita.fr>
15946
15947 * tests/atconfig.in (CPPFLAGS): Add.
15948 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15949
70a84437
AD
159502001-08-03 Akim Demaille <akim@epita.fr>
15951
15952 Version 1.28b.
15953
2ce10144
AD
159542001-08-03 Akim Demaille <akim@epita.fr>
15955
15956 * tests/Makefile.am (check-local): Ship testsuite.
15957 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15958 Include `string.h'.
15959
1e3e4bc1
AD
159602001-08-03 Akim Demaille <akim@epita.fr>
15961
15962 * configure.in: Try using -Wformat when compiling.
15963
42b45b7f
AD
159642001-08-03 Akim Demaille <akim@epita.fr>
15965
15966 * configure.in: Bump to 1.28b.
15967
8f13fe33
AD
159682001-08-03 Akim Demaille <akim@epita.fr>
15969
15970 * src/complain.c: Adjust strerror_r portability issues.
15971
b37ba92c
AD
159722001-08-03 Akim Demaille <akim@epita.fr>
15973
15974 Version 1.28a.
15975
b0ce6046
AD
159762001-08-03 Akim Demaille <akim@epita.fr>
15977
15978 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15979 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15980 * src/getargs.c: Include complain.h.
15981 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15982 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15983
d01c415b
AD
159842001-08-03 Akim Demaille <akim@epita.fr>
15985
15986 * src/reader.c (readgram): Display hidden chars in error messages.
15987
459dd1a6
AD
159882001-08-03 Akim Demaille <akim@epita.fr>
15989
15990 Update to gettext 0.10.39.
15991
53b74c0c
AD
159922001-08-03 Akim Demaille <akim@epita.fr>
15993
15994 * lib/strspn.c: New.
15995
234a3be3
AD
159962001-08-01 Marc Autret <autret_m@epita.fr>
15997
15998 * doc/bison.texinfo: Update.
15999 * doc/bison.1 (mandoc): Update.
16000 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
16001 * src/files.c: Support output files extensions computing.
16002 (src_extension): New static variable.
16003 (header_extension): New static variable.
16004 (tr): New function.
16005 (get_extension_index): New function, gets the index of an extension
16006 filename in a string.
16007 (compute_exts_from_gf): New function, computes extensions from the
16008 grammar file extension.
16009 (compute_exts_from_src): New functions, computes extensions from the
16010 C source file extension, file given by ``-o'' option.
16011 (compute_base_names): Update.
16012 (output_files): Update.
16013
847bf1f5
AD
160142001-08-01 Robert Anisko <anisko_r@epita.fr>
16015
d995fee7 16016 * doc/bison.texi: Document @$.
847bf1f5
AD
16017 (Locations): New section.
16018
d074a105
AD
160192001-07-18 Akim Demaille <akim@epita.fr>
16020
16021 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
16022 * config/prev-version.txt, config/move-if-change: New.
16023 * Makefile.am: Adjust.
16024
3419715d
AD
160252001-07-08 Pascal Bart <pascal.bart@epita.fr>
16026
16027 * src/bison.simple (yyparse): Suppress warning `comparaison
16028 between signed and unsigned'.
16029
62ab6972
AD
160302001-07-05 Pascal Bart <pascal.bart@epita.fr>
16031
16032 * src/getargs.h (raw_flag): Remove.
16033 * src/getargs.c: Die on `-r'/`--raw'.
16034 * src/lex.c (parse_percent_token): Die on `%raw'.
16035 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
16036 * tests/calc.at: Suppress test with option `--raw'.
16037
1e24cc5b
AD
160382001-07-14 Akim Demaille <akim@epita.fr>
16039
16040 * config/: New.
16041 * configure.in: Require Autoconf 2.50.
16042 Update to gettext 0.10.38.
16043
32dfccf8
AD
160442001-03-16 Akim Demaille <akim@epita.fr>
16045
16046 * doc/bison.texinfo: ANSIfy the examples.
16047
cd5bd6ac
AD
160482001-03-16 Akim Demaille <akim@epita.fr>
16049
16050 * getargs.c (skeleton): New variable.
16051 (longopts): --skeleton is a new option.
16052 (shortopts, getargs): -S is a new option.
16053 * getargs.h: Declare skeleton.
16054 * output.c (output_parser): Use it.
16055
5141b016
AD
160562001-03-16 Akim Demaille <akim@epita.fr>
16057
16058 * m4/strerror_r.m4: New.
16059 * m4/error.m4: Run AC_FUNC_STRERROR_R.
16060 * lib/error.h, lib/error.c: Update.
16061
447992b9
AD
160622001-03-16 Akim Demaille <akim@epita.fr>
16063
16064 * src/getargs.c (longopts): Clean up.
16065
274d42ce
AD
160662001-02-21 Akim Demaille <akim@epita.fr>
16067
16068 * src/reader.c (gensym): `gensym_count' is your own.
16069 Use a static buf to create the symbol name, as token_buffer is no
16070 longer a buffer.
16071
22c821f3
AD
160722001-02-08 Akim Demaille <akim@epita.fr>
16073
16074 * src/conflicts.c (conflict_report): Be sure not to append to res
16075 between two calls, which could happen if both first sprintf were
16076 skipped, but not the first cp += strlen.
16077
18569462
AD
160782001-02-08 Akim Demaille <akim@epita.fr>
16079
16080 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
16081 New, from fileutils 4.0.37.
16082 * configure.in: Require Autoconf 2.49c. I took some time before
16083 making this decision. This is the only way out for portability
16084 issues in Bison, it would mean way too much duplicate effort to
16085 import in Bison features implemented in 2.49c since 2.13.
16086 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
16087
0d8f3c8a
AD
160882001-02-02 Akim Demaille <akim@epita.fr>
16089
16090 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 16091 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 16092
f17bcd1f
AD
160932001-01-19 Akim Demaille <akim@epita.fr>
16094
16095 Get rid of the ad hoc handling of token_buffer in the scanner: use
16096 the obstacks.
16097
16098 * src/lex.c (token_obstack): New.
16099 (init_lex): Initialize it. No longer call...
16100 (grow_token_buffer): this. Remove it.
16101 Adjust all the places which used it to use the obstack.
16102
511e79b3
AD
161032001-01-19 Akim Demaille <akim@epita.fr>
16104
16105 * src/lex.h: Rename all the tokens:
16106 s/\bENDFILE\b/tok_eof/g;
16107 s/\bIDENTIFIER\b/tok_identifier/g;
16108 etc.
16109 Let them be enums, not #define, to ease debugging.
16110 Adjust all the code.
16111
0d6508ef
AD
161122001-01-18 Akim Demaille <akim@epita.fr>
16113
16114 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
16115 * src/lex.c (maxtoken, grow_token_buffer): Static.
16116
6deb4447
AD
161172001-01-18 Akim Demaille <akim@epita.fr>
16118
16119 Since we now use obstacks, more % directives can be enabled.
16120
16121 * src/lex.c (percent_table): Also accept `%yacc',
16122 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
16123 `%debug'.
16124 Handle the actions for `%semantic_parser' and `%pure_parser' here,
16125 instead of returning a token.
16126 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
16127 * src/reader.c (read_declarations): Adjust.
16128 * src/files.c (open_files): Don't call `compute_base_names', don't
16129 compute `attrsfile' since they depend upon data which might be
16130 *in* the input file now.
16131 (output_files): Do it here.
16132 * src/output.c (output_headers): Document the fact that this patch
16133 introduces a guaranteed SEGV for semantic parsers.
16134 * doc/bison.texinfo: Document them.
16135 * tests/suite.at: Exercise these %options.
16136
ff4423cc
AD
161372000-12-20 Akim Demaille <akim@epita.fr>
16138
16139 Also handle the output file (--verbose) with obstacks.
16140
16141 * files.c (foutput): Remove.
16142 (output_obstack): New.
16143 Adjust all dependencies.
16144 * src/conflicts.c: Return a string.
16145 * src/system.h (obstack_grow_string): Rename as...
16146 (obstack_sgrow): this. Be ready to work with non literals.
16147 (obstack_fgrow4): New.
16148
956dba3a
AD
161492000-12-20 Akim Demaille <akim@epita.fr>
16150
16151 * src/files.c (open_files): Fix the computation of short_base_name
16152 in the case of `-o foo.tab.c'.
16153
337bab46
AD
161542000-12-20 Akim Demaille <akim@epita.fr>
16155
16156 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16157 (copy_dollar): Now that everything uses obstacks, get rid of the
16158 FILE * parameters.
16159
5d3214b8
AD
161602000-12-20 Akim Demaille <akim@epita.fr>
16161
16162 * src/files.c (open_files): Actually the `.output' file is based
16163 on the short_base_name, not base_name.
16164 * tests/suite.at (Checking output file names): Adjust.
16165
29092a57
AD
161662000-12-20 Akim Demaille <akim@epita.fr>
16167
16168 * src/bison.s1: Remove, we now use directly...
16169 * src/bison.simple: this.
16170 * src/Makefile.am: Use pkgdata instead of data.
16171
ea5607fd
AD
161722000-12-20 Akim Demaille <akim@epita.fr>
16173
16174 * src/files.c (guard_obstack): New.
16175 (open_files): Initialize it.
16176 (output_files): Dump it...
16177 * src/files.h: Export it.
16178 * src/reader.c (copy_guard): Use it.
16179
27110317
AD
161802000-12-19 Akim Demaille <akim@epita.fr>
16181
16182 * src/files.c (outfile, defsfile, actfile): Removed as global
16183 vars.
16184 (open_files): Don't compute them.
16185 (output_files): Adjust.
16186 (base_name, short_base_name): Be global.
16187 Adjust dependencies.
16188
19c50364
AD
161892000-12-19 Akim Demaille <akim@epita.fr>
16190
16191 * src/files.c (strsuffix): New.
16192 (stringappend): Be just like strcat but allocate.
16193 (base_names): Eve out from open_files.
16194 Try to simplify the rather hairy computation of base_name and
16195 short_base_name.
16196 (open_files): Use it.
16197 * tests/suite.at (Checking output file names): New test.
16198
573c1d9f
AD
161992000-12-19 Akim Demaille <akim@epita.fr>
16200
16201 * src/system.h (obstack_grow_literal_string): Rename as...
16202 (obstack_grow_string): this.
16203 * src/output.c (output_parser): Recognize `%% actions' instead of
16204 `$'.
16205 * src/bison.s1: s/$/%% actions/.
16206 * src/bison.hairy: Likewise.
16207
ef7ddedd
AD
162082000-12-19 Akim Demaille <akim@epita.fr>
16209
16210 * src/output.c (output_parser): Compute the `#line' lines when
16211 there are.
16212 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16213 Suggested by Hans Aberg.
16214
ff61dabd
AD
162152000-12-19 Akim Demaille <akim@epita.fr>
16216
16217 Let the handling of the skeleton files be local to the procedures
16218 that use it.
16219
16220 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16221 longer static.
16222 (fparser, open_extra_files): Remove.
16223 (open_files, output_files): Don't take care of fparser.
16224 * src/files.h: Adjust.
16225 * src/output.c (output_parser): Open and close the file to the
16226 skeleton.
16227 * src/reader.c (read_declarations): When %semantic_parser, open
16228 fguard.
16229
55b96341
AD
162302000-12-19 Akim Demaille <akim@epita.fr>
16231
16232 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16233 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16234
358c15b7
AD
162352000-12-19 Akim Demaille <akim@epita.fr>
16236
16237 * src/files.c (open_files): Yipee! We no longer need all the code
16238 looking for `/tmp' since we have no tmp file.
16239
7de3329e
AD
162402000-12-19 Akim Demaille <akim@epita.fr>
16241
16242 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16243 New macros.
16244 * src/files.c (open_files): Less dependency on MSDOS etc.
16245
3abcd459
AD
162462000-12-14 Akim Demaille <akim@epita.fr>
16247
16248 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16249 Provide a default definition.
16250 Use it when executing the default @ action.
16251 * src/reader.c (reader_output_yylsp): No longer include
16252 `timestamp' and `text' in the default YYLTYPE.
16253
2a91a95e
AD
162542000-12-12 Akim Demaille <akim@epita.fr>
16255
16256 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16257 (copy_guard): Quote the file names.
16258 Reported by Laurent Mascherpa.
16259
14d3eb9b
AD
162602000-12-12 Akim Demaille <akim@epita.fr>
16261
16262 * src/output.c (output_headers, output_program, output): Be sure
16263 to escape special characters when outputting filenames.
16264 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16265 (output_headers): Don't depend on them, Use ACTSTR.
16266
d7045ec6
AD
162672000-11-17 Akim Demaille <akim@epita.fr>
16268
16269 * lib/obstack.h: Formatting changes.
16270 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16271 prevents type checking.
16272 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16273 cast the value to (void *): assigning a `foo *' to a `void *'
16274 variable is valid.
16275 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16276 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16277 append characters.
16278
6fd54b73
AD
162792000-11-17 Akim Demaille <akim@epita.fr>
16280
16281 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16282 as...
16283 (suite.m4, regression.m4, calc.m4): these.
16284 * tests/atgeneral.m4: Update from CVS Autoconf.
16285
4c50eae6
AD
162862000-11-17 Akim Demaille <akim@epita.fr>
16287
16288 * tests/regression.m4 (%union and --defines): New test,
16289 demonstrating a current bug in the obstack implementation.
16290
a35f64ea
AD
162912000-11-17 Akim Demaille <akim@epita.fr>
16292
16293 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16294 macros.
16295 Use them to declare the variables which are global or local to
16296 `yyparse'.
16297
7de23534
AD
162982000-11-17 Akim Demaille <akim@epita.fr>
16299
16300 * acconfig.h: Remove, no longer used.
16301
aa7815f5
AD
163022000-11-07 Akim Demaille <akim@epita.fr>
16303
16304 * src: s/Copyright (C)/Copyright/g.
16305
5af1f549
AD
163062000-11-07 Akim Demaille <akim@epita.fr>
16307
16308 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16309 defining.
16310 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16311
553e2b22
AD
163122000-11-07 Akim Demaille <akim@epita.fr>
16313
16314 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16315 Merge in a single CPP if/else.
16316
8a4f41d6
AD
163172000-11-07 Akim Demaille <akim@epita.fr>
16318
16319 * src/output.c (output): Remove useless variables.
16320 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16321 argument `data' for consistency with the prototypes.
16322 Qualify it `const'.
16323 (obstack_copy, obstack_copy0): Rename the second argument as
16324 `address' for consistency. Qualify it `const'.
16325 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16326 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16327 `const' their input argument (`data' or `address').
16328 Adjust the corresponding macros to include `const' in casts.
16329
095a3fb5
AD
163302000-11-03 Akim Demaille <akim@epita.fr>
16331
16332 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16333 s/PFILE1/BISON_HAIRY/.
16334 Adjust dependencies.
16335
d1cdce7c
AD
163362000-11-03 Akim Demaille <akim@epita.fr>
16337
090c5ebf 16338 For some reason, this was not applied.
d1cdce7c
AD
16339
16340 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16341 `unlink': it's no longer used.
16342
9311529b
AD
163432000-11-03 Akim Demaille <akim@epita.fr>
16344
16345 * src/files.c (skeleton_find): New function, eved out of...
16346 (open_files, open_extra_files): here.
16347
d8880f69
AD
163482000-11-03 Akim Demaille <akim@epita.fr>
16349
16350 Don't use `atexit'.
16351
16352 * src/files.c (obstack_save): New function.
16353 (done): Rename as...
16354 (output_files): this.
16355 Use `obstack_save'.
16356 * src/main.c (main): Don't use `atexit' to register `done', since
16357 it no longer has to remove tmp files, just call `output_files'
16358 when there are no errors.
16359
0dbb648e
AD
163602000-11-02 Akim Demaille <akim@epita.fr>
16361
16362 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16363 `unlink': it's no longer used.
16364 * src/files.h: Formatting changes.
16365
896fe5c1
AD
163662000-11-02 Akim Demaille <akim@epita.fr>
16367
16368 Remove the last uses of mktemp and unlink/delete.
16369
16370 * src/files.c (fdefines, ftable): Removed.
16371 (defines_ostack, table_obstack): New.
16372 Adjust dependencies of the former into uses of the latter.
16373 * src/output.c (output_short_or_char_table, output_short_table):
16374 Convert to using obstacks.
16375 * src/reader.c (copy_comment2): Accept one FILE * and two
16376 obstacks.
16377 (output_token_defines, reader_output_yylsp): Use obstacks.
16378 * src/system.h (obstack_fgrow3): New.
1f65350a 16379 * po/POTFILES.in: Adjust.
896fe5c1 16380
dd60faec
AD
163812000-11-01 Akim Demaille <akim@epita.fr>
16382
16383 Change each use of `fattrs' into a use of `attrs_obstack'.
16384
16385 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16386 * src/files.c (fattrs): Remove.
16387 (attrs_obstack): New.
16388 Adjust all dependencies.
16389 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16390
8c7ebe49
AD
163912000-11-01 Akim Demaille <akim@epita.fr>
16392
16393 Introduce obstacks.
16394 Change each use of `faction' into a use of `action_obstack'.
16395
16396 * lib/obstack.h, lib/obstack.c: New files.
16397 * src/files.c (faction): Remove.
16398 (action_obstack): New.
16399 Adjust all dependencies.
16400
77aee789
AD
164012000-10-20 Akim Demaille <akim@epita.fr>
16402
16403 * lib/quote.h (PARAMS): New macro. Use it.
16404
43591cec
AD
164052000-10-16 Akim Demaille <akim@epita.fr>
16406
16407 * src/output.c (output_short_or_char_table): New function.
16408 (output_short_table, output_token_translations): Use it.
16409 (goto_actions): Use output_short_table.
16410
1e9798d5
AD
164112000-10-16 Akim Demaille <akim@epita.fr>
16412
16413 * src/symtab.c (bucket_new): New function.
16414 (getsym): Use it.
16415
16416 * src/output.c (output_short_table): New argument to display the
16417 comment associated with the table.
16418 Adjust dependencies.
16419 (output_gram): Use it.
16420 (output_rule_data): Nicer output layout for YYTNAME.
16421
f282676b
AD
164222000-10-16 Akim Demaille <akim@epita.fr>
16423
16424 * src/lex.c (read_typename): New function.
16425 (lex): Use it.
16426 * src/reader.c (copy_dollar): Likewise.
16427
550a72a3
AD
164282000-10-16 Akim Demaille <akim@epita.fr>
16429
16430 * src/reader.c (copy_comment2): Expect the input stream to be on
16431 the `/' which is suspected to open a comment, instead of being
16432 called after `//' or `/*' was read.
16433 (copy_comment, copy_definition, parse_union_decl, copy_action)
16434 (copy_guard): Adjust.
16435
131e2fef
AD
164362000-10-16 Akim Demaille <akim@epita.fr>
16437
16438 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16439 `read_signed_integer'.
16440
79282c5a
AD
164412000-10-16 Akim Demaille <akim@epita.fr>
16442
16443 * src/reader.c (copy_dollar): New function.
16444 (copy_guard, copy_action): Use it.
16445
ff4a34be
AD
164462000-10-16 Akim Demaille <akim@epita.fr>
16447
16448 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16449 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16450 New files, from Fileutils 4.0.27.
16451 * src/main.c (printable_version): Remove.
16452 * src/lex.c, src/reader.c: Use `quote'.
16453
164542000-10-04 Akim Demaille <akim@epita.fr>
16455
16456 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16457
14ded682
AD
164582000-10-04 Akim Demaille <akim@epita.fr>
16459
16460 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16461
8e03724b
AD
164622000-10-04 Akim Demaille <akim@epita.fr>
16463
16464 When a literal string is used to define two different tokens,
16465 `bison -v' segfaults.
16466 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16467
16468 * tests/regression.m4: New file.
16469 Include the core of the sample provided by Piotr Gackiewicz.
16470 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16471 properly.
16472
a9e64249
AD
164732000-10-04 Akim Demaille <akim@epita.fr>
16474
16475 * src/reader.c (parse_expect_decl): Keep `count' within the size
16476 of `buffer'.
16477 From Neil Booth.
16478
da9abf43
AD
164792000-10-02 Paul Eggert <eggert@twinsun.com>
16480
16481 * bison.s1 (yyparse): Assign the default value
16482 unconditionally, to avoid a GCC warning and make the parser a
16483 tad smaller.
16484
c33638bb
AD
164852000-10-02 Akim Demaille <akim@epita.fr>
16486
16487 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16488 options.
16489
444c570a
AD
164902000-10-02 Akim Demaille <akim@epita.fr>
16491
16492 * src/derives.c, src/print.c, src/reduce.c: To ease the
16493 translation, move some `\n' out of the translated strings.
16494
89cab50d
AD
164952000-10-02 Akim Demaille <akim@epita.fr>
16496
16497 The location tracking mechanism is precious for parse error
16498 messages. Nevertheless, it is enabled only when `@n' is used in
16499 the grammar, which is a different issue (you can use it in error
16500 message, but not in the grammar per se). Therefore, there should
16501 be another means to enable it.
16502
16503 * src/getargs.c (getargs): Support `--locations'.
16504 (usage): Report it.
16505 * src/getargs.h (locationsflag): Export it.
16506 * src/lex.c (percent_table): Support `%locations'.
16507 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16508 with `locationsflag'.
16509 * doc/bison.texinfo: Document `--locations' and `%locations'.
16510 Sort the options.
16511 * tests/calc.m4: Test it.
16512
16513 For regularity of the names, replace each
16514 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16515 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16516 In addition replace each `flag' with `_flag'.
16517
d6c2cba0
AD
165182000-10-02 Akim Demaille <akim@epita.fr>
16519
16520 Also test parse error messages, including with YYERROR_VERBOSE.
16521
16522 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16523 associative).
16524 Use it to check the computations.
16525 Use it to check `nonassoc' is honored.
16526 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16527 `--yyerror-verbose'.
16528 (_AT_CHECK_CALC): Adjust to this option.
16529 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16530
5a35a6cb
AD
165312000-10-02 Akim Demaille <akim@epita.fr>
16532
16533 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16534 the latter demonstrates a flaw in the handling of non debugging
16535 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16536 was used in order to simplify:
16537
16538 #if YYDEBUG
16539 if (yydebug)
16540 {
16541 ...
16542 }
16543 #endif
16544
16545 into
16546
16547 if (yydebug)
16548 {
16549 ...
16550 }
16551
16552 unfortunately this leads to a CPP conflict when
16553 `--name-prefix=foo' is used since it produces `#define yydebug
16554 foodebug'.
16555
16556 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16557 (YYDPRINTF): New macro.
16558 Spread its use.
16559 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16560 the bison options.
16561 Also test `--verbose', `--defines' and `--name-prefix'.
16562
71da9eea
AD
165632000-10-02 Akim Demaille <akim@epita.fr>
16564
16565 Improve the readability of the produced parsers.
16566
16567 * src/bison.s1: Formatting changes.
16568 Improve the comment related to the `$' mark.
16569 (yydefault): Don't fall through to `yyresume': `goto' there.
16570 * src/output.c (output_parser): When the `$' is met, skip the end
16571 of its line.
16572 New variable, `number_of_dollar_signs', to check there's exactly
16573 one `$' in the parser skeleton.
16574
95e36146
AD
165752000-10-02 Akim Demaille <akim@epita.fr>
16576
16577 * lib/xstrdup.c: New file, from the fileutils.
16578 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16579 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16580 instead of strlen + xmalloc + strcpy.
16581 * src/symtab.c (copys): Remove, use xstrdup instead.
16582
d7020c20
AD
165832000-10-02 Akim Demaille <akim@epita.fr>
16584
16585 * src/gram.h (associativity): New enum type which replaces the
16586 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16587 `right_assoc', `left_assoc' and `non_assoc'.
16588 Adjust all dependencies.
16589 * src/reader.c: Formatting changes.
16590 (LTYPESTR): Don't define it, use it as a literal in
16591 `reader_output_yylsp'.
16592 * src/symtab.h (symbol_class): New enum type which replaces the
16593 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16594 `sunknown', `stoken and `snterm'.
16595
1916f98e
AD
165962000-10-02 Akim Demaille <akim@epita.fr>
16597
16598 * src/getargs.c (fixed_outfiles): Rename as...
16599 (yaccflag): for consistency and accuracy.
16600 Adjust dependencies.
16601
d7913476
AD
166022000-10-02 Akim Demaille <akim@epita.fr>
16603
16604 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16605 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16606 difficult and introduced a lot of core dump. It turns out that
16607 Bison used an implementation of `xmalloc' based on `calloc', and
16608 at various places it does depend upon the initialization to 0. I
16609 have not tried to isolate the pertinent places, and all the former
16610 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16611 someone should address this issue.
16612
16613 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16614 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16615 files.
16616 Adjust dependencies.
16617 * src/warshall.h: New file.
16618 Propagate.
16619
340ef489
AD
166202000-10-02 Akim Demaille <akim@epita.fr>
16621
16622 Various anti-`extern in *.c' changes.
16623
16624 * src/system.h: Include `assert.h'.
16625
b2ca4022
AD
166262000-10-02 Akim Demaille <akim@epita.fr>
16627
16628 * src/state.h (nstates, final_state, first_state, first_shift)
16629 (first_reduction): Move their exportation from here...
16630 * src/LR0.h: to here.
16631 Adjust dependencies.
16632 * src/getargs.c (statisticsflag): New variable.
16633 Add support for `--statistics'.
16634 Adjust dependencies.
16635
16636 Remove a lot of now useless `extern' statements in most files.
16637
403b315b
AD
166382000-10-02 Akim Demaille <akim@epita.fr>
16639
16640 * src/LR0.h: New file.
16641 Propagate its use.
16642
07a58c13
AD
166432000-10-02 Akim Demaille <akim@epita.fr>
16644
16645 * src/print.h: New file.
16646 Propagate its use.
16647 * src/print.c: Formatting and ordering changes.
16648 (verbose, terse): Replace with...
16649 (print_results): this new function.
16650 Adjust dependencies.
16651
0619caf0
AD
166522000-10-02 Akim Demaille <akim@epita.fr>
16653
16654 * src/conflicts.c (conflict_report): New function.
16655 (conflict_log, verbose_conflict_log): Replace with...
16656 (print_conflicts): this function.
16657 Adjust dependencies.
16658 * src/conflicts.h: New file.
16659 Propagate its inclusion.
16660
3519ec76
AD
166612000-10-02 Akim Demaille <akim@epita.fr>
16662
16663 * src/nullable.h: New file.
16664 Propagate its inclusion.
16665 * src/nullable.c: Formatting changes.
16666
015acc48
AD
166672000-10-02 Akim Demaille <akim@epita.fr>
16668
16669 * src/reduce.h: New file.
16670 Propagate its inclusion.
16671 * src/reduce.c: Topological sort and other formatting changes.
16672 (bool, TRUE, FALSE): Move their definition to...
16673 * src/system.h: here.
16674
8963a27b
AD
166752000-10-02 Akim Demaille <akim@epita.fr>
16676
16677 * src/files.c: Formatting changes.
16678 (tryopen, tryclose, openfiles): Rename as...
16679 (xfopen, xfclose, open_files): this.
16680 (stringappend): static.
16681 * src/files.h: Complete the list of exported symbols.
16682 Propagate its use.
16683
a70083a3
AD
166842000-10-02 Akim Demaille <akim@epita.fr>
16685
16686 * src/reader.h: New file.
16687 Propagate its use instead of tedious list of `extern' and
16688 prototypes.
16689 * src/reader.c: Formatting changes, topological sort,
16690 s/register//.
16691
abadc117
AD
166922000-10-02 Akim Demaille <akim@epita.fr>
16693
16694 * src/lex.h: Prototype `lex.c' exported functions.
16695 * src/reader.c: Adjust.
16696 * src/lex.c: Formatting changes.
16697 (safegetc): Rename as...
16698 (xgetc): this.
16699
720d742f
AD
167002000-10-02 Akim Demaille <akim@epita.fr>
16701
16702 * src/lalr.h: New file.
16703 Propagate its inclusion instead of prototypes and `extern'.
16704 * src/lalr.c: Formatting changes, topological sorting etc.
16705
f2acea59
AD
167062000-10-02 Akim Demaille <akim@epita.fr>
16707
16708 * src/output.c (token_actions): Introduce a temporary array,
16709 YYDEFACT, that makes it possible for this function to use
16710 output_short_table.
16711
d019d655
AD
167122000-10-02 Akim Demaille <akim@epita.fr>
16713
16714 `user_toknums' is output as a `short[]' in `output.c', while it is
16715 defined as a `int[]' in `reader.c'. For consistency with the
16716 other output tables, `user_toknums' is now defined as a table of
16717 shorts.
16718
16719 * src/reader.c (user_toknums): Be a short table instead of an int
16720 table.
16721 Adjust dependencies.
16722
16723 Factor the short table outputs.
16724
16725 * src/output.c (output_short_table): New function.
16726 * src/output.c (output_gram, output_stos, output_rule_data)
16727 (output_base, output_table, output_check): Use it.
16728
6c89f1c1
AD
167292000-10-02 Akim Demaille <akim@epita.fr>
16730
16731 * src/output.c (output): Topological sort of the functions, in
16732 order to get rid of the `static' prototypes.
16733 No longer use `register'.
16734 * src/output.h: New file.
16735 Propagate its inclusion in files explicitly prototyping functions
16736 from output.c.
16737
d9efd181
AD
167382000-09-21 Akim Demaille <akim@epita.fr>
16739
16740 * src/atgeneral.m4: Update from Autoconf.
16741
c29240e7 167422000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
16743
16744 * src/closure.h: New file.
16745 * src/closure.c: Formatting changes, topological sort over the
16746 functions, use of closure.h.
16747 (initialize_closure, finalize_closure): Rename as...
16748 (new_closure, free_closure): these. Adjust dependencies.
16749 * src/LR0.c: Formatting changes, topological sort, use of
16750 cloture.h.
16751 (initialize_states): Rename as...
16752 (new_states): this.
16753 * src/Makefile.am (noinst_HEADERS): Adjust.
16754
499daa50
AD
167552000-09-20 Akim Demaille <akim@epita.fr>
16756
16757 * src/acconfig.h: Don't protect config.h against multiple
16758 inclusion.
16759 Don't define PARAMS.
16760 * src/system.h: Define PARAMS.
16761 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
16762 purpose of config.h. system.h must not try to fix wrong
16763 definitions in config.h.
16764
cc84fd5d
AD
167652000-09-20 Akim Demaille <akim@epita.fr>
16766
16767 * src/derives.h: New file.
16768 * src/main.c, src/derives.h: Use it.
16769 Formatting changes.
16770 * src/Makefile.am (noinst_HEADERS): Adjust.
16771
db5b3a89
AD
167722000-09-20 Akim Demaille <akim@epita.fr>
16773
16774 * tests/atgeneral.m4: Update from Autoconf.
16775 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
16776 (AT_CHECK_CALC): New macros.
16777 Use these macros to test bison with options `', `--raw',
16778 `--debug', `--yacc', `--yacc --debug'.
16779
ceed8467
AD
167802000-09-19 Akim Demaille <akim@epita.fr>
16781
16782 * src/output.c: Formatting changes.
16783 * src/machine.h: Remove, leaving its contents in...
16784 * src/system.h: here.
16785 Include stdio.h.
16786 Adjust all dependencies on stdio.h and machine.h.
16787 * src/getargs.h: New file.
16788 Let all `extern' declarations about getargs.c be replaced with
16789 inclusion of `getargs.h'.
16790 * src/Makefile.am (noinst_HEADERS): Adjust.
16791
16792 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16793 scope.
16794 (yyerror): Returns void, not int.
16795 * doc/bison.texinfo: Formatting changes.
16796
05a1d24b
AD
167972000-09-19 Akim Demaille <akim@epita.fr>
16798
16799 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16800 portable.
16801
cbd25751
AD
168022000-09-18 Akim Demaille <akim@epita.fr>
16803
16804 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16805 * src/Makefile.am (INCLUDES): Don't.
16806 Be ready to fetch headers in lib/.
16807
13863333
AD
168082000-09-18 Akim Demaille <akim@epita.fr>
16809
16810 * doc/bison.texinfo: Update the copyright.
16811 ANSIfy and GNUify the examples.
16812 Remove the old menu.
16813
0d533154
AD
168142000-09-18 Akim Demaille <akim@epita.fr>
16815
16816 First set of tests: use the `calc' example from the documentation.
16817
16818 * src/bison.s1 (yyparse): Condition the code using `yytname' which
16819 is defined only when YYDEBUG is.
16820 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
16821 * src/files.c (tryopen, tryclose): Formatting changes.
16822 Move to the top and be static.
16823 * src/reader.c (read_signed_integer): Likewise.
16824 * tests/calc.m4: New file.
16825 * Makefile.am, suite.m4: Adjust.
16826 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
16827
e79137ac
AD
168282000-09-18 Akim Demaille <akim@epita.fr>
16829
16830 Add support for an Autotest test suite for Bison.
16831
16832 * m4/m4.m4, m4/atconfig.m4: New files.
16833 * m4/Makefile.am (EXTRA_DIST): Adjust.
16834 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
16835 files.
16836 * src/getargs.c: Display a more standard --version message.
16837 * src/reader.c (reader): Formatting changes.
16838 No longer depend upon VERSION_STRING.
16839 * configure.in: No longer use `dnl'.
16840 Set up the test suite and the new directory `tests/.
16841 (VERSION_STRING): Remove.
16842
27821bff
AD
168432000-04-14 Akim Demaille <akim@epita.fr>
16844
16845 * src/reader.c (copy_comment2): New function, same as former
16846 `copy_comment', but outputs into two FILE *.
16847 (copy_comment): Use it.
16848 (parse_union_decl): Use it.
16849 (get_type, parse_start_decl): Use the same `invalid' message.
16850 (parse_start_decl, parse_union_decl): Use the same `multiple'
16851 message.
16852 (parse_union_decl, copy_guard, copy_action): Use the same
16853 `unmatched' message.
16854 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16855
cfe5fbc0
AD
168562000-03-31 Akim Demaille <akim@epita.fr>
16857
16858 * src/files.c (tryopen, tryclose): Move to the top.
16859 Be static.
16860
cb7db13e
AD
168612000-03-31 Akim Demaille <akim@epita.fr>
16862
16863 * src/main.c (main): Don't call `done', exit does it.
16864
a0f6b076
AD
168652000-03-31 Akim Demaille <akim@epita.fr>
16866
36281465
AD
16867 * allocate.c: s/return (foo)/return foo/.
16868 * lalr.c: Likewise.
16869 * LR0.c: Likewise.
16870 * output.c: Likewise.
16871 * reader.c: Likewise.
16872 * symtab.c: Likewise.
16873 * vmsgetargs.c: Likewise.
16874
168752000-03-31 Akim Demaille <akim@epita.fr>
16876
16877 Clean up the error reporting functions.
a0f6b076
AD
16878
16879 * src/report.c: New file.
16880 * src/report.h: Likewise.
16881 * src/Makefile.am: Adjust.
16882 * m4/error.m4: New file.
16883 * m4/Makefile.am: Adjust.
16884 * configure.in (jm_PREREQ_ERROR): Call it.
16885 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16886 Remove.
16887 (fatal, fatals): Remove. All callers use complain.c::fatal.
16888 (warn, warni, warns, warnss, warnss): Remove. All callers use
16889 complain.c::complain.
16890 (toomany): Remove, use fatal instead.
16891 * src/files.c (done): No argument, use complain_message_count.
16892 * src/main.c (main): Register `done' to `atexit'.
16893
16894 * src/getargs.c (usage): More `fputs', less `fprintf'.
16895
18539825
AD
168962000-03-28 Akim Demaille <akim@epita.fr>
16897
16898 * lib/: New directory.
16899 * Makefile.am (SUBDIRS): Adjust.
16900 * configure.in: Adjust.
16901 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16902 useless.
16903 * src/alloca.c: Moved to lib/.
16904 * src/getopt.c: Likewise.
16905 * src/getopt1.c: Likewise.
16906 * src/getopt.h: Likewise.
16907 * src/ansi2knr.c: Likewise.
16908 * src/ansi2knr.1: Likewise.
16909 * src/Makefile.am: Adjust.
16910 * lib/Makefile.am: New file.
16911
9f306f2a
AD
169122000-03-28 Akim Demaille <akim@epita.fr>
16913
16914 * src/getargs.c (usage): Refresh the help message.
16915
0ba347b6
AD
169162000-03-17 Akim Demaille <akim@epita.fr>
16917
16918 * src/getopt1.c: Updated from textutils 2.0e
16919 * src/getopt.c: Likewise.
16920 * src/getopt.h: Likewise.
16921
dbe7f271
AD
169222000-03-17 Akim Demaille <akim@epita.fr>
16923
16924 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16925 the file name, not the whole `#line LINE FILE'.
16926
75bbe78d
AD
169272000-03-17 Akim Demaille <akim@epita.fr>
16928
16929 On syntax errors, report the token on which we choked.
16930
aa5fd0ee
AD
16931 * src/bison.s1 (yyparse): In the label yyerrlab, when
16932 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 16933
7b306f52
AD
169342000-03-17 Akim Demaille <akim@epita.fr>
16935
aa5fd0ee 16936 * src/reader.c (copy_at): New function.
7b306f52
AD
16937 (copy_guard): Use it.
16938 (copy_action): Use it.
16939
e87b5700
AD
169402000-03-17 Akim Demaille <akim@epita.fr>
16941
16942 Be kind to translators, save some useless translations.
16943
aa5fd0ee 16944 * src/main.c (banner): New function.
e87b5700
AD
16945 (fatal_banner): Use it.
16946 (warn_banner): Use it.
16947
ae3c3164
AD
169482000-03-17 Akim Demaille <akim@epita.fr>
16949
aa5fd0ee
AD
16950 * src/reader.c (copy_definition): Use copy_string and
16951 copy_comment. Removed now unused `match', `ended',
16952 `cplus_comment'.
ae3c3164
AD
16953 (copy_comment, copy_string): Moved, to be visible from
16954 copy_definition.
16955
4dc58e7c
AD
169562000-03-17 Akim Demaille <akim@epita.fr>
16957
aa5fd0ee
AD
16958 * src/reader.c (copy_string): Declare `static inline'. No
16959 problems with inline, since it is checked by configure.
4dc58e7c
AD
16960 (copy_comment): Likewise.
16961
0a6384c4
AD
169622000-03-17 Akim Demaille <akim@epita.fr>
16963
aa5fd0ee 16964 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 16965
3cef001a
AD
169662000-03-17 Akim Demaille <akim@epita.fr>
16967
aa5fd0ee 16968 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
16969 (copy_action): Use it. Removed now unused `match', `ended',
16970 `cplus_comment'.
16971 (copy_guard): Likewise.
16972
ca36d2ef
AD
169732000-03-17 Akim Demaille <akim@epita.fr>
16974
aa5fd0ee 16975 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
16976 (copy_action): Use it.
16977 (copy_guard): Likewise.
16978
6666f98f
AD
169792000-03-17 Akim Demaille <akim@epita.fr>
16980
16981 Change the handling of @s so that they behave exactly like $s.
16982 There is now a pseudo variable @$ (readble and writable), location
16983 of the lhs of the rule (by default ranging from the location of
16984 the first symbol of the rhs, to the location of the last symbol,
16985 or, if the rhs is empty, YYLLOC).
16986
16987 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16988 yyval.
16989 (yyparse): When providing a default semantic action, provide a
16990 default location action.
16991 (after the $): No longer change `*YYLSP', just stack YYLOC the
16992 same way you stack YYVAL.
16993 * src/reader.c (read_declarations): Use warns.
16994 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16995 (copy_action, case '@'): Likewise.
16996 Use a standard error message, to save useless work from
16997 translators.
16998
41aca2e0
AD
169992000-03-17 Akim Demaille <akim@epita.fr>
17000
aa5fd0ee
AD
17001 * src/bison.s1: Formatting and cosmetics changes.
17002 * src/reader.c: Likewise.
41aca2e0
AD
17003 Update the Copyright notice.
17004
dc08c1d5
AD
170052000-03-17 Akim Demaille <akim@epita.fr>
17006
aa5fd0ee
AD
17007 * src/bison.s1 (#line): All set to `#line' only, since the
17008 Makefile now handles them.
dc08c1d5 17009
9ee3c97b
AD
170102000-03-16 Akim Demaille <akim@epita.fr>
17011
17012 * src/output.c (output_rule_data): Output the documentation of
17013 some of the tables.
17014 (Copyright notice): Update.
17015 Formatting changes.
17016
0de741ca
AD
170172000-03-16 Akim Demaille <akim@epita.fr>
17018
17019 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
17020 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
17021 One `#if YYDEBUG' remains, since it uses variables which are
17022 defined only if `YYDEBUG != 0'.
17023
bb10be54
AD
170242000-03-16 Akim Demaille <akim@epita.fr>
17025
17026 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
17027 and related variables so that the similarities are highlighted.
17028
b07b484a
AD
170292000-03-16 Akim Demaille <akim@epita.fr>
17030
17031 * src/bison.s1: Properly indent CPP directives.
17032
361f60b3
AD
170332000-03-16 Akim Demaille <akim@epita.fr>
17034
17035 * src/bison.s1: Properly indent the `alloca' CPP section.
17036
8c44d3ec
AD
170372000-03-16 Akim Demaille <akim@epita.fr>
17038
17039 Do not hard code values of directories in `configure.in'.
17040 Update the `configure' tool chain.
17041
17042 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
17043 src/makefile.am.
17044 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
17045 (AC_OUTPUT): Add m4/Makefile.
17046 Bump to bison 1.28a, 1.29 has never been released.
17047 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
17048 handled via src/Makefile.am.
17049 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
17050 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
17051 autoheader.
17052 * Makefile.am (SUBDIRS): Add m4.
17053 (ACLOCAL_AM_FLAGS): New variable.
17054 (AUTOMAKE_OPTIONS): Add check-news.
17055 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
17056 the proper line number and file name.
17057 (DEFS): Propagate the location of bison library files and of the
17058 locale files.
17059 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
17060 builddir.
17061 * acinclude.m4: Remove, replaced by the directory m4.
17062 * m4/Makefile.am (EXTRA_DIST): New variable.
17063 * m4/gettext.m4: New file, from the fileutils.
17064 * m4/lcmessage.m4: Likewise
17065 * m4/progtest.m4: Likewise.
17066 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
17067
f95997e7
AD
170682000-03-10 Akim Demaille <akim@epita.fr>
17069
17070 * src/closure.c:
17071 Formatting changes of various comments.
17072 Respect the GNU coding standards at various places.
17073 Don't use `_()' when no translation is needed.
17074
170751999-12-13 Jesse Thilo <jthilo@gnu.org>
17076
17077 * src/files.c:
17078 OS/2 honors TMPDIR environment variable.
17079
170801999-12-13 Jesse Thilo <jthilo@gnu.org>
17081
17082 * doc/bison.texinfo: Tweaked spelling and grammar.
17083 Updated ISBN.
17084 Removed reference to price of printed copy.
17085 Mention BISON_SIMPLE and BISON_HAIRY.
17086
170871999-12-13 Jesse Thilo <jthilo@gnu.org>
17088
17089 * configure.in, NEWS:
17090 Bison 1.29 released.
17091
170921999-10-27 Jesse Thilo <jthilo@gnu.org>
17093
17094 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
17095 Added reference card.
17096
170971999-07-26 Jesse Thilo <jthilo@gnu.org>
17098
17099 * po/ru.po: Added Russian translation.
17100
171011999-07-26 Jesse Thilo <jthilo@gnu.org>
17102
17103 * configure.in: Added Russian translation.
17104
171051999-07-06 Jesse Thilo <jthilo@gnu.org>
17106
17107 * configure.in, NEWS, README:
17108 Released version 1.28.
17109
171101999-06-14 Jesse Thilo <jthilo@gnu.org>
17111
17112 * src/system.h:
17113 Squashed redefinition warning on some systems.
17114
17115 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
17116 Have configure build version string instead of relying on ANSI string
17117 concatentation.
17118
171191999-06-14 Jesse Thilo <jthilo@gnu.org>
17120
17121 * po/POTFILES.in: Got rid of version.c.
17122
171231999-06-14 Jesse Thilo <jthilo@gnu.org>
17124
17125 * acconfig.h, configure.in:
17126 Have configure build version string instead of relying on ANSI string
17127 concatentation.
17128
171291999-06-08 Jesse Thilo <jthilo@gnu.org>
17130
17131 * doc/bison.1:
17132 Dropped mention of `+' for long-named options.
17133
171341999-05-30 Jesse Thilo <jthilo@gnu.org>
17135
17136 * src/files.c: Added <unistd.h> for unlink().
17137
17138 * src/Makefile.am, src/system.h:
17139 I18n fixes.
17140
171411999-05-30 Jesse Thilo <jthilo@gnu.org>
17142
17143 * README: Added a FAQ list.
17144
17145 * configure.in, acconfig.h:
17146 I18n fixes.
17147
171481999-05-30 Jesse Thilo <jthilo@gnu.org>
17149
17150 * doc/FAQ, doc/Makefile.am:
17151 Added a FAQ list.
17152
171531999-05-19 Jesse Thilo <jthilo@gnu.org>
17154
17155 * src/alloc.h, src/symtab.h, src/version.c:
17156 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17157
171581999-04-18 Jesse Thilo <jthilo@gnu.org>
17159
17160 * src/.cvsignore, src/Makefile.am:
17161 Reorganized: sources in `src', documentation in `doc'.
17162
17163 * src/lex.c (literalchar):
17164 fixed the code for escaping double quotes (thanks
17165 Jonathan Czisny.)
17166
171671999-04-18 Jesse Thilo <jthilo@gnu.org>
17168
17169 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17170 Adjusted paths to reflect directory reorganization.
17171
171721999-04-18 Jesse Thilo <jthilo@gnu.org>
17173
17174 * doc/.cvsignore, doc/Makefile.am:
17175 Reorganized: sources in `src', documentation in `doc'.
17176
171771999-04-18 Jesse Thilo <jthilo@gnu.org>
17178
17179 * configure.in:
17180 Updated AC_INIT file to reflect directory reorganization.
17181
17182 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17183 Reorganized: sources in `src', documentation in `doc'.
17184
171851999-04-13 Jesse Thilo <jthilo@gnu.org>
17186
17187 * src/allocate.c:
17188 Don't declare calloc() and realloc() if not necessary.
17189
171901999-04-13 Jesse Thilo <jthilo@gnu.org>
17191
17192 * configure.in, acconfig.h, acinclude.m4:
17193 Don't declare calloc() and realloc() if not necessary.
17194
171951999-03-23 Jesse Thilo <jthilo@gnu.org>
17196
17197 * po/.cvsignore: Added i18n support.
17198
171991999-03-23 Jesse Thilo <jthilo@gnu.org>
17200
17201 * acconfig.h, configure.in, Makefile.am:
17202 Added i18n support.
17203
172041999-03-22 Jesse Thilo <jthilo@gnu.org>
17205
17206 * src/bison.s1: Fixed #line numbers.
17207
172081999-03-15 Jesse Thilo <jthilo@gnu.org>
17209
17210 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17211 Added PO files from Translation Project.
17212
172131999-03-03 Jesse Thilo <jthilo@gnu.org>
17214
17215 * Makefile.am:
17216 Added support for non-ANSI compilers (ansi2knr).
17217
172181999-02-16 Jesse Thilo <jthilo@gnu.org>
17219
17220 * configure.in: Bumped version number to 1.27.
17221
17222 * Makefile.am:
17223 Added `bison.simple' to list of files removed by `make distclean'.
17224
172251999-02-12 Jesse Thilo <jthilo@gnu.org>
17226
17227 * src/files.c, src/files.h:
17228 Defined locations of parser files in config.h instead of Makefile.
17229
172301999-02-12 Jesse Thilo <jthilo@gnu.org>
17231
17232 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17233 Defined locations of parser files in config.h instead of Makefile.
17234
172351999-02-09 Jesse Thilo <jthilo@gnu.org>
17236
17237 * Makefile.am:
17238 Removed inappropriate use of $< macro.
17239
172401999-02-05 Jesse Thilo <jthilo@gnu.org>
17241
17242 * po/Makefile.in.in, po/POTFILES.in:
17243 Add `po' directory skeleton.
17244
172451999-01-27 Jesse Thilo <jthilo@gnu.org>
17246
17247 * README: Document help-bison list.
17248
17249 * configure.in: Add check for mkstemp().
17250
172511999-01-20 Jesse Thilo <jthilo@gnu.org>
17252
17253 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17254 Hush a few compiler warnings.
17255
17256 * src/files.c:
17257 Add tryclose(), which verifies that fclose was successful.
17258 Hush a couple of compiler warnings.
17259
172601999-01-20 Jesse Thilo <jthilo@gnu.org>
17261
17262 * Makefile.am, OChangeLog:
17263 ChangeLog is now automatically generated. Include the old version as
17264 OChangeLog.
17265
172661999-01-14 Jesse Thilo <jthilo@gnu.org>
17267
17268 * 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:
17269 Update FSF address.
17270
172711999-01-14 Jesse Thilo <jthilo@gnu.org>
17272
17273 * doc/bison.texinfo: Fix formatting glitch.
17274
17275 * doc/bison.texinfo: Update FSF address.
17276
172771999-01-14 Jesse Thilo <jthilo@gnu.org>
17278
17279 * acconfig.h: Update FSF address.
17280
172811999-01-08 Jesse Thilo <jthilo@gnu.org>
17282
17283 * src/system.h:
17284 Don't define PACKAGE here, since config.h defines it.
17285
172861998-12-30 Jesse Thilo <jthilo@gnu.org>
17287
17288 * src/reader.c: Update copyright date.
17289
17290 * src/main.c:
17291 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17292 favor of output directly to stderr (avoids buffer overruns).
17293
17294 * src/reader.c: Some checks for premature EOF.
17295
17296 * 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:
17297 Use prototypes if the compiler understands them.
17298
17299 * src/files.c: Honor TMPDIR on Unix hosts.
17300 Use prototypes if the compiler understands them.
17301
17302 * src/reader.c:
17303 Fix a couple of buffer overrun bugs.
17304 Use prototypes if the compiler understands them.
17305
17306 * src/system.h: Include unistd.h and ctype.h.
17307 Use #ifdef instead of #if for NLS symbols.
17308
173091998-12-30 Jesse Thilo <jthilo@gnu.org>
17310
17311 * doc/bison.texinfo:
17312 Delete comment "consider using @set for edition number, etc..." since
17313 we now are doing so.
17314
173151998-12-30 Jesse Thilo <jthilo@gnu.org>
17316
17317 * configure.in:
17318 Use prototypes if the compiler understands them.
17319
17320 * NEWS: Document 1.26 highlights.
17321
17322 * Makefile.am: Require Automake 1.3 or later.
17323
17324 * acconfig.h:
17325 Use prototypes if the compiler understands them.
17326
173271998-12-29 Jesse Thilo <jthilo@gnu.org>
17328
17329 * src/version.c:
17330 Use VERSION symbol from automake for version number.
17331
173321998-12-29 Jesse Thilo <jthilo@gnu.org>
17333
17334 * acconfig.h, configure.in, version.cin:
17335 Use VERSION symbol from automake for version number.
17336
173371998-11-28 Jesse Thilo <jthilo@gnu.org>
17338
17339 * Makefile.am:
17340 Distribute original version of simple parser (bison.s1), not built
17341 version (bison.simple).
17342
173431998-11-28 Jesse Thilo <jthilo@gnu.org>
17344
17345 * doc/bison.texinfo: Add info dir entry.
17346
17347 * doc/bison.texinfo:
17348 Let automake put version number into documentation.
17349
173501998-11-26 Jesse Thilo <jthilo@gnu.org>
17351
17352 * src/bison.cld, src/build.com, src/vmshlp.mar:
17353 Add non-RCS files from /gd/gnu/bison.
17354
173551998-11-26 Jesse Thilo <jthilo@gnu.org>
17356
17357 * doc/bison.1:
17358 Document the BISON_HAIRY and BISON_SIMPLE variables.
17359
173601998-11-25 Jesse Thilo <jthilo@gnu.org>
17361
17362 * src/version.c: Build version.c automatically.
17363
17364 * src/reader.c:
17365 Fix token numbering (used to start at 258, not 257).
17366
17367 * src/system.h: Include config.h.
17368
17369 * src/getargs.c: Update bug report address.
17370
17371 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17372 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17373
173741998-11-25 Jesse Thilo <jthilo@gnu.org>
17375
17376 * Makefile.am:
17377 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17378
17379 * configure.in, version.cin:
17380 Build version.c automatically.
17381
17382 * AUTHORS: Add AUTHORS file.
17383
17384 * README: Update bug report address.
17385
17386 * bison.simple:
17387 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17388
17389 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17390 Add automake stuff.
17391
173921998-11-25 Jesse Thilo <jthilo@gnu.org>
17393
17394 * doc/bison.texinfo: Clean up some formatting.
17395
173961998-05-05 Richard Stallman <rms@gnu.org>
17397
17398 * doc/bison.texinfo:
17399 Explain better why to make a pure parser.
17400
174011998-01-05 Richard Stallman <rms@gnu.org>
17402
17403 * src/files.c (openfiles):
17404 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17405 find a temporary directory, if possible. Do not unlink files while
17406 they are open.
17407
174081997-08-25 Richard Stallman <rms@gnu.org>
17409
17410 * src/reader.c (stack_offset;):
17411 Change some warni to warns.
17412
17413 * src/lex.c (literalchar): Use warns, not warni.
17414
174151997-06-28 Richard Stallman <rms@gnu.org>
17416
17417 * src/bison.s1: Add a Bison version comment.
17418
17419 * src/main.c (fatal, warn, berror):
17420 Use program_name.
17421
174221997-06-28 Richard Stallman <rms@gnu.org>
17423
17424 * Makefile.in (bison_version): New variable.
17425 (dist): Use that variable.
17426 (bison.s1): Substitute the Bison version into bison.simple.
17427
17428 * bison.simple: Add a Bison version comment.
17429
174301997-06-18 Richard Stallman <rms@gnu.org>
17431
17432 * src/main.c (fatal, warn, berror):
17433 Make error messages standard.
17434 (toomany): Improve error message text.
17435
17436 * 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:
17437 new.h renamed to alloc.h.
17438
174391997-06-18 Richard Stallman <rms@gnu.org>
17440
17441 * Makefile.in: new.h renamed to alloc.h.
17442
174431997-05-24 Richard Stallman <rms@gnu.org>
17444
17445 * src/lex.c (literalchar):
17446 Fix the code for escaping \, " and '.
17447
17448 (lex): Avoid trouble when there are many chars
17449 to discard in a char literal with just several chars in it.
17450
174511997-05-17 Richard Stallman <rms@gnu.org>
17452
17453 * src/bison.s1:
17454 Use malloc, if using alloca is troublesome.
17455 (YYSTACK_USE_ALLOCA): New flag macro.
17456 Define it for some systems and compilers.
17457 (YYSTACK_ALLOC): New macro.
17458 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17459 If it was malloc'd, free it.
17460
174611997-05-17 Richard Stallman <rms@gnu.org>
17462
17463 * bison.simple:
17464 Use malloc, if using alloca is troublesome.
17465 (YYSTACK_USE_ALLOCA): New flag macro.
17466 Define it for some systems and compilers.
17467 (YYSTACK_ALLOC): New macro.
17468 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17469 If it was malloc'd, free it.
17470
174711997-04-23 Richard Stallman <rms@gnu.org>
17472
17473 * src/bison.s1:
17474 (alloca) [__hpux]: Always define as __builtin_alloca.
17475
174761997-04-23 Richard Stallman <rms@gnu.org>
17477
17478 * bison.simple:
17479 (alloca) [__hpux]: Always define as __builtin_alloca.
17480
174811997-04-22 Richard Stallman <rms@gnu.org>
17482
17483 * src/bison.s1:
17484 [__hpux]: Include alloca.h (right for HPUX 10)
17485 instead of declaring alloca (right for HPUX 9).
17486
17487 * src/bison.s1 (__yy_memcpy):
17488 Declare arg `count' as unsigned int.
17489 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17490
174911997-04-22 Richard Stallman <rms@gnu.org>
17492
17493 * bison.simple:
17494 [__hpux]: Include alloca.h (right for HPUX 10)
17495 instead of declaring alloca (right for HPUX 9).
17496
17497 * bison.simple (__yy_memcpy):
17498 Declare arg `count' as unsigned int.
17499 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17500
175011997-01-03 Richard Stallman <rms@gnu.org>
17502
17503 * src/allocate.c: [__STDC__ or _MSC_VER]:
17504 Declare calloc and realloc to return void *.
17505
175061997-01-02 Richard Stallman <rms@gnu.org>
17507
17508 * src/system.h:
17509 [_MSC_VER]: Include stdlib.h and process.h.
17510 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17511
17512 * src/main.c (main): Return FAILURE as a value.
17513 (printable_version): Declare arg as int, not char.
17514
175151997-01-02 Richard Stallman <rms@gnu.org>
17516
17517 * Makefile.in (dist):
17518 Explicitly check for symlinks, and copy them.
17519
175201996-12-19 Richard Stallman <rms@gnu.org>
17521
17522 * src/files.c:
17523 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17524
175251996-12-18 Paul Eggert <eggert@gnu.org>
17526
17527 * src/bison.s1 (yyparse):
17528 If __GNUC__ and YYPARSE_PARAM are both defined,
17529 declare yyparse to have a void * argument.
17530
175311996-12-18 Paul Eggert <eggert@gnu.org>
17532
17533 * bison.simple (yyparse):
17534 If __GNUC__ and YYPARSE_PARAM are both defined,
17535 declare yyparse to have a void * argument.
17536
175371996-12-17 Richard Stallman <rms@gnu.org>
17538
17539 * src/reduce.c (nbits): Add some casts.
17540
175411996-08-12 Richard Stallman <rms@gnu.org>
17542
17543 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17544
175451996-08-12 Richard Stallman <rms@gnu.org>
17546
17547 * bison.simple: Test _MSDOS as well as _MSDOS_.
17548
175491996-07-31 Richard Stallman <rms@gnu.org>
17550
17551 * src/bison.s1:
17552 [__sun && __i386]: Include alloca.h.
17553
175541996-07-31 Richard Stallman <rms@gnu.org>
17555
17556 * bison.simple:
17557 [__sun && __i386]: Include alloca.h.
17558
175591996-07-30 Richard Stallman <rms@gnu.org>
17560
17561 * src/bison.s1: Comment change.
17562
17563 * src/bison.s1: Test _MSDOS_, not MSDOS.
17564
175651996-07-30 Richard Stallman <rms@gnu.org>
17566
17567 * bison.simple: Comment change.
17568
17569 * bison.simple: Test _MSDOS_, not MSDOS.
17570
175711996-06-01 Richard Stallman <rms@gnu.org>
17572
17573 * 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:
17574 Insert `_' macro around many string constants.
17575
17576 * src/main.c:
17577 Insert `_' macro around many string constants.
17578
17579 (main): Call setlocale, bindtextdomain and textdomain.
17580
17581 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17582 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17583 [ENABLE_NLS]: Include libintl.h.
17584 [ENABLE_NLS] (gettext): Define.
17585 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17586 (N_, PACKAGE, LOCALEDIR): New macros.
17587
175881996-06-01 Richard Stallman <rms@gnu.org>
17589
17590 * POTFILES.in: New file.
17591
17592 * Makefile.in (allocate.o):
17593 Define target explicitly.
17594
17595 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17596 (LDFLAGS): Set to @LDFLAGS@.
17597 (configure): Run autoconf only if preceding `cd' succeeds.
17598 (bison.s1): Redirect output to temporary file then move the
17599 temporary to the target, rather than redirecting directly to bison.s1.
17600 (clean): Remove config.status and config.log.
17601 (distclean): Don't remove config.status here.
17602
176031996-05-12 Richard Stallman <rms@gnu.org>
17604
17605 * src/bison.s1:
17606 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17607
176081996-05-12 Richard Stallman <rms@gnu.org>
17609
17610 * bison.simple:
17611 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17612
176131996-05-11 Richard Stallman <rms@gnu.org>
17614
17615 * src/bison.s1 (__yy_memcpy):
17616 Really reorder the args, as was supposedly done on Feb 14 1995.
17617 (yyparse): Calls changed accordingly.
17618
176191996-05-11 Richard Stallman <rms@gnu.org>
17620
17621 * Makefile.in (dist): Don't use $(srcdir).
17622
17623 * bison.simple (__yy_memcpy):
17624 Really reorder the args, as was supposedly done on Feb 14 1995.
17625 (yyparse): Calls changed accordingly.
17626
176271996-01-27 Richard Stallman <rms@gnu.org>
17628
17629 * src/output.c (output_rule_data):
17630 Test YYERROR_VERBOSE in the conditional
17631 around the definition of ttyname.
17632
176331995-12-29 Richard Stallman <rms@gnu.org>
17634
17635 * src/bison.s1:
17636 Fix line numbers in #line commands.
17637
176381995-12-29 Richard Stallman <rms@gnu.org>
17639
17640 * bison.simple:
17641 Fix line numbers in #line commands.
17642
176431995-12-27 Richard Stallman <rms@gnu.org>
17644
17645 * src/bison.s1 (YYPARSE_PARAM_DECL):
17646 In C++, make it always null.
17647 (YYPARSE_PARAM_ARG): New macro.
17648 (yyparse): Use YYPARSE_PARAM_ARG.
17649
176501995-12-27 Richard Stallman <rms@gnu.org>
17651
17652 * bison.simple (YYPARSE_PARAM_DECL):
17653 In C++, make it always null.
17654 (YYPARSE_PARAM_ARG): New macro.
17655 (yyparse): Use YYPARSE_PARAM_ARG.
17656
176571995-11-29 Richard Stallman <rms@gnu.org>
17658
17659 * doc/bison.texinfo:
17660 Describe literal string tokens, %raw, %no_lines, %token_table.
17661
176621995-11-29 Daniel Hagerty <hag@gnu.org>
17663
17664 * doc/bison.texinfo: Fixed update date
17665
176661995-10-16 Richard Stallman <rms@gnu.org>
17667
17668 * src/version.c: Version 1.25.
17669
176701995-10-16 Richard Stallman <rms@gnu.org>
17671
17672 * NEWS: *** empty log message ***
17673
176741995-10-16 Richard Stallman <rms@gnu.org>
17675
17676 * doc/bison.1, doc/bison.rnh:
17677 Add new options.
17678
176791995-10-15 Richard Stallman <rms@gnu.org>
17680
17681 * src/vmsgetargs.c, src/getargs.c:
17682 Added -n, -k, and -raw switches.
17683 (noparserflag, toknumflag, rawtoknumflag): New variables.
17684
17685 * src/symtab.h (SALIAS):
17686 New #define for adding aliases to %token.
17687 (struct bucket): Added `alias' field.
17688
17689 * src/reduce.c (reduce_grammar):
17690 Revise error message.
17691 (print_notices): Remove final `.' from error message.
17692
17693 * src/reader.c (reader_output_yylsp):
17694 New function.
17695 (readgram): Use `#if 0' around code that accepted %command
17696 inside grammar rules: The documentation doesn't allow it,
17697 and it will fail since the %command processors scan for the next %.
17698 (parse_token_decl): Extended the %token
17699 declaration to allow a multi-character symbol as an alias.
17700 (parse_thong_decl): New function.
17701 (read_declarations): Added %thong declarations.
17702 (read_declarations): Handle NOOP to deal with allowing
17703 % declarations as another means to specify the flags.
17704 (readgram): Allow %prec prior to semantics embedded in a rule.
17705 (skip_to_char, read_declarations, copy_definition)
17706 (parse_token_decl, parse_start_decl, parse_type_decl)
17707 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17708 (get_type_name, copy_guard, copy_action, readgram)
17709 (get_type, packsymbols): Revised most error messages.
17710 Changed `fatal' to `warnxxx' to avoid aborting for error.
17711 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17712 (read_declarations): Improve the error message for
17713 an invalid character. Do not abort.
17714 (read_declarations, copy_guard, copy_action): Use
17715 printable_version to avoid unprintable characters in printed output.
17716 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
17717 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
17718 Allow the type of a non-terminal can be given
17719 more than once, as long as all specifications give the same type.
17720
17721 * src/output.c:
17722 (output_headers, output_trailers, output, output_gram)
17723 (output_rule_data): Implement noparserflag variable.
17724 Implement toknumflag variable.
17725 (output): Call reader_output_yylsp to output LTYPESTR.
17726
17727 * src/main.c (main):
17728 If reader sees an error, don't process the grammar.
17729 (fatals): Updated to not use VARARGS1.
17730 (printable_version, int_to_string, warn, warni, warns, warnss)
17731 (warnsss): New error reporting functions. Avoid abort for error.
17732
17733 * src/lex.h:
17734 Added THONG and NOOP for alias processing.
17735 Added SETOPT for the new code that allows setting options with %flags.
17736
17737 * src/lex.c:
17738 Include getopt.h. Add some extern decls.
17739 (safegetc): New function to deal with EOF gracefully.
17740 (literalchar); new function to deal with reading \ escapes.
17741 (lex): Use literalchar.
17742 (lex): Implemented "..." tokens.
17743 (literalchar, lex, parse_percent_token): Made tokenbuffer
17744 always contain the token. This includes growing the token
17745 buffer while reading an integer.
17746 (parse_percent_token): Replaced if-else statement with percent_table.
17747 (parse_percent_token): Added % declarations as another
17748 way to specify the flags -n, -l, and -r. Also added hooks for
17749 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
17750 major changes to files.c.
17751 (lex) Retain in the incoming stream a character following
17752 an incorrect '/'.
17753 (skip_white_space, lex): Revised most error messages
17754 and changed fatal to warn to avoid aborting.
17755 (percent_table): Added %thong declarations.
17756
17757 * src/gram.h: Comment changes.
17758
17759 * src/files.c (openfiles, open_extra_files, done):
17760 Add faction flag
17761 and actfile file. Handle noparserflag. Both for -n switch.
17762
17763 * src/conflicts.c (resolve_sr_conflict):
17764 Remove use of alloca.
17765
177661995-06-01 Jim Meyering <meyering@gnu.org>
17767
17768 * doc/bison.texinfo: *** empty log message ***
17769
177701995-05-06 Richard Stallman <rms@gnu.org>
17771
17772 * src/bison.s1: Comment change.
17773
177741995-05-06 Richard Stallman <rms@gnu.org>
17775
17776 * bison.simple: Comment change.
17777
177781995-05-03 Richard Stallman <rms@gnu.org>
17779
17780 * src/version.c: Version now 1.24.
17781
17782 * src/bison.s1: Change distribution terms.
17783
17784 * src/version.c: Version now 1.23.
17785
177861995-05-03 Richard Stallman <rms@gnu.org>
17787
17788 * doc/bison.texinfo:
17789 Rewrite "Conditions for Using Bison".
17790 Update version to 1.24.
17791
177921995-05-03 Richard Stallman <rms@gnu.org>
17793
17794 * bison.simple: Change distribution terms.
17795
177961995-02-23 Richard Stallman <rms@gnu.org>
17797
17798 * src/files.c: Test __VMS_POSIX as well as VMS.
17799
178001995-02-14 Jim Meyering <meyering@gnu.org>
17801
17802 * src/bison.s1 (__yy_memcpy):
17803 Renamed from __yy_bcopy to avoid
17804 confusion. Reverse FROM and TO arguments to be consistent with
17805 those of memcpy.
17806
178071995-02-14 Jim Meyering <meyering@gnu.org>
17808
17809 * bison.simple (__yy_memcpy):
17810 Renamed from __yy_bcopy to avoid
17811 confusion. Reverse FROM and TO arguments to be consistent with
17812 those of memcpy.
17813
178141994-11-10 David J. MacKenzie <djm@gnu.org>
17815
17816 * NEWS: reformat
17817
17818 * NEWS: New file.
17819
17820 * Makefile.in (DISTFILES): Include NEWS.
17821
17822 * Makefile.in (DISTFILES):
17823 Include install-sh, not install.sh.
17824
17825 * configure.in: Update to Autoconf v2 macro names.
17826
178271994-10-05 David J. MacKenzie <djm@gnu.org>
17828
17829 * Makefile.in: fix typo
17830
17831 * Makefile.in (prefix, exec_prefix):
17832 Let configure set them.
17833
178341994-09-28 David J. MacKenzie <djm@gnu.org>
17835
17836 * Makefile.in: Set datadir to $(prefix)/share.
17837
178381994-09-15 Richard Stallman <rms@gnu.org>
17839
17840 * src/bison.s1:
17841 Update copyright notice and GPL version.
17842
178431994-09-15 Richard Stallman <rms@gnu.org>
17844
17845 * bison.simple:
17846 Update copyright notice and GPL version.
17847
178481994-07-12 Richard Stallman <rms@gnu.org>
17849
17850 * src/reduce.c, src/reader.c:
17851 entered into RCS
17852
178531994-05-05 David J. MacKenzie <djm@gnu.org>
17854
17855 * Makefile.in: entered into RCS
17856
178571994-03-26 Richard Stallman <rms@gnu.org>
17858
17859 * src/bison.s1: entered into RCS
17860
178611994-03-26 Richard Stallman <rms@gnu.org>
17862
17863 * bison.simple: entered into RCS
17864
178651994-03-25 Richard Stallman <rms@gnu.org>
17866
17867 * src/main.c: entered into RCS
17868
178691994-03-24 Richard Stallman <rms@gnu.org>
17870
17871 * src/conflicts.c: entered into RCS
17872
178731994-01-02 Richard Stallman <rms@gnu.org>
17874
17875 * Makefile.in: *** empty log message ***
17876
178771993-11-21 Richard Stallman <rms@gnu.org>
17878
17879 * src/bison.s1: *** empty log message ***
17880
178811993-11-21 Richard Stallman <rms@gnu.org>
17882
17883 * doc/bison.texinfo: entered into RCS
17884
17885 * doc/bison.texinfo: *** empty log message ***
17886
178871993-11-21 Richard Stallman <rms@gnu.org>
17888
17889 * bison.simple: *** empty log message ***
17890
178911993-10-25 David J. MacKenzie <djm@gnu.org>
17892
17893 * doc/bison.texinfo: *** empty log message ***
17894
178951993-10-19 Richard Stallman <rms@gnu.org>
17896
17897 * src/bison.s1: *** empty log message ***
17898
178991993-10-19 Richard Stallman <rms@gnu.org>
17900
17901 * bison.simple: *** empty log message ***
17902
179031993-10-14 Richard Stallman <rms@gnu.org>
17904
17905 * src/bison.s1: *** empty log message ***
17906
179071993-10-14 Richard Stallman <rms@gnu.org>
17908
17909 * bison.simple: *** empty log message ***
17910
179111993-09-14 David J. MacKenzie <djm@gnu.org>
17912
17913 * doc/bison.texinfo: *** empty log message ***
17914
179151993-09-13 Noah Friedman <friedman@gnu.org>
17916
17917 * Makefile.in: *** empty log message ***
17918
179191993-09-10 Richard Stallman <rms@gnu.org>
17920
17921 * src/conflicts.c: *** empty log message ***
17922
17923 * src/system.h: entered into RCS
17924
179251993-09-10 Richard Stallman <rms@gnu.org>
17926
17927 * doc/bison.1: entered into RCS
17928
179291993-09-06 Noah Friedman <friedman@gnu.org>
17930
17931 * src/version.c: entered into RCS
17932
179331993-09-06 Noah Friedman <friedman@gnu.org>
17934
17935 * Makefile.in: *** empty log message ***
17936
179371993-07-30 David J. MacKenzie <djm@gnu.org>
17938
17939 * Makefile.in: *** empty log message ***
17940
179411993-07-24 Richard Stallman <rms@gnu.org>
17942
17943 * src/bison.s1: *** empty log message ***
17944
179451993-07-24 Richard Stallman <rms@gnu.org>
17946
17947 * bison.simple: *** empty log message ***
17948
179491993-07-08 David J. MacKenzie <djm@gnu.org>
17950
17951 * Makefile.in: *** empty log message ***
17952
179531993-07-04 Richard Stallman <rms@gnu.org>
17954
17955 * src/bison.s1: *** empty log message ***
17956
179571993-07-04 Richard Stallman <rms@gnu.org>
17958
17959 * bison.simple: *** empty log message ***
17960
179611993-06-26 David J. MacKenzie <djm@gnu.org>
17962
17963 * src/getargs.c: entered into RCS
17964
179651993-06-26 David J. MacKenzie <djm@gnu.org>
17966
17967 * doc/bison.texinfo: *** empty log message ***
17968
17969 * doc/bison.1: New file.
17970
179711993-06-25 Richard Stallman <rms@gnu.org>
17972
17973 * src/getargs.c: New file.
17974
179751993-06-16 Richard Stallman <rms@gnu.org>
17976
17977 * src/bison.s1: *** empty log message ***
17978
179791993-06-16 Richard Stallman <rms@gnu.org>
17980
17981 * bison.simple: *** empty log message ***
17982
179831993-06-03 Richard Stallman <rms@gnu.org>
17984
17985 * src/bison.s1: New file.
17986
179871993-06-03 Richard Stallman <rms@gnu.org>
17988
17989 * doc/bison.texinfo: *** empty log message ***
17990
179911993-06-03 Richard Stallman <rms@gnu.org>
17992
17993 * bison.simple: New file.
17994
179951993-05-19 Richard Stallman <rms@gnu.org>
17996
17997 * doc/bison.texinfo: New file.
17998
179991993-05-07 Noah Friedman <friedman@gnu.org>
18000
18001 * Makefile.in: *** empty log message ***
18002
180031993-04-28 Noah Friedman <friedman@gnu.org>
18004
18005 * src/reader.c: *** empty log message ***
18006
180071993-04-23 Noah Friedman <friedman@gnu.org>
18008
18009 * src/alloc.h: entered into RCS
18010
180111993-04-20 David J. MacKenzie <djm@gnu.org>
18012
18013 * src/version.c: *** empty log message ***
18014
18015 * src/files.c, src/allocate.c:
18016 entered into RCS
18017
18018 * src/reader.c: *** empty log message ***
18019
18020 * src/lex.c: entered into RCS
18021
18022 * src/conflicts.c: New file.
18023
18024 * src/symtab.c: entered into RCS
18025
18026 * src/alloc.h: New file.
18027
18028 * src/LR0.c: entered into RCS
18029
180301993-04-18 Noah Friedman <friedman@gnu.org>
18031
18032 * src/reader.c: New file.
18033
18034 * src/version.c: *** empty log message ***
18035
180361993-04-18 Noah Friedman <friedman@gnu.org>
18037
18038 * Makefile.in: *** empty log message ***
18039
180401993-04-17 Noah Friedman <friedman@gnu.org>
18041
18042 * Makefile.in: *** empty log message ***
18043
180441993-04-15 Richard Stallman <rms@gnu.org>
18045
18046 * src/main.c, src/files.c:
18047 New file.
18048
180491993-04-15 Noah Friedman <friedman@gnu.org>
18050
18051 * configure.in: entered into RCS
18052
18053 * configure.in: *** empty log message ***
18054
18055 * configure.in: New file.
18056
180571993-04-14 Richard Stallman <rms@gnu.org>
18058
18059 * Makefile.in: New file.
18060
180611993-04-13 Richard Stallman <rms@gnu.org>
18062
18063 * src/version.c: New file.
18064
180651993-03-25 Richard Stallman <rms@gnu.org>
18066
18067 * src/output.c: entered into RCS
18068
180691992-09-25 Richard Stallman <rms@gnu.org>
18070
18071 * configure.bat: entered into RCS
18072
180731992-06-22 Richard Stallman <rms@gnu.org>
18074
18075 * src/vmsgetargs.c: entered into RCS
18076
180771992-06-22 Richard Stallman <rms@gnu.org>
18078
18079 * doc/bison.rnh: entered into RCS
18080
180811992-04-20 David J. MacKenzie <djm@gnu.org>
18082
18083 * README: entered into RCS
18084
180851992-01-22 Richard Stallman <rms@gnu.org>
18086
18087 * src/machine.h: entered into RCS
18088
180891991-12-21 Richard Stallman <rms@gnu.org>
18090
18091 * src/lalr.c, src/closure.c:
18092 entered into RCS
18093
180941991-12-20 Richard Stallman <rms@gnu.org>
18095
18096 * src/state.h: entered into RCS
18097
180981991-12-18 Richard Stallman <rms@gnu.org>
18099
18100 * src/print.c, src/nullable.c, src/derives.c:
18101 entered into RCS
18102
181031991-11-03 David J. MacKenzie <djm@gnu.org>
18104
18105 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
18106 entered into RCS
18107
181081988-09-09 Richard Stallman <rms@gnu.org>
18109
18110 * src/bison.hairy: entered into RCS
18111
181121987-12-16 Richard Stallman <rms@gnu.org>
18113
18114 * REFERENCES: entered into RCS
dc546b0f 18115
f294a2c2 18116
04098407 18117 -----
f294a2c2 18118
04098407 18119 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e2a21b6f
PE
18120 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
18121 Software Foundation, Inc.
f294a2c2 18122
04098407
PE
18123 Copying and distribution of this file, with or without
18124 modification, are permitted provided the copyright notice and this
18125 notice are preserved.
e9071366
AD
18126
18127$Id$