]> git.saurik.com Git - bison.git/blame - ChangeLog
Encapsulate the push parser state variables into an M4 macro so the
[bison.git] / ChangeLog
CommitLineData
bb010fe5
JD
12006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Encapsulate the push parser state variables into an M4 macro so the
4 push skeleton doesn't have to list them again for pull mode's yyparse.
5 For push mode, remove yypush_parse's local equivalents of these
6 variables to eliminate unnecessary copying between the two sets at
7 run-time. This patch also fixes at least a bug related to multiple
8 %initial-action invocations in push mode.
9 * data/push.c (b4_declare_parser_variables): Rename to...
10 (b4_declare_scanner_communication_variables): ... this for clarity and
11 update both uses.
12 (b4_declare_yyparse_variables): Remove and move its contents to the one
13 spot where it was invoked.
14 (b4_declare_parser_state_variables): New macro containing the parser
15 state variables required by push mode.
16 (struct yypstate): Replace all fields but yynew with
17 b4_declare_parser_state_variables.
18 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
19 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
20 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
21 (yyparse or yypush_parse): For yyparse in pull mode, replace local
22 parser state variable declarations with
23 b4_declare_parser_state_variables.
24 Don't initialize parser state variables when calling yypush_parse since
25 yypstate_new already does that.
26 Invoke the user's initial action only upon the first yypush_parse
27 invocation.
28 Remove all code that copies between the local parser state variables
29 and the yypstate.
30
2d212f8c
JD
312006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
32
33 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
34 prevent a name collision in a future patch where these names will
35 sometimes be #define'd.
36 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
37 since it no longer has the same name as the existing argument.
38 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
39
e6e704dc
JD
402006-12-19 Paolo Bonzini <bonzini@gnu.org>
41 and Joel E. Denny <jdenny@ces.clemson.edu>
42
43 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
44 that the argument is case-insensitive, and there's no `=' here.
45 For the %skeleton entry, mention that %language is better.
46 (Bison Options): Likewise for --language and --skeleton. Move the
47 --skeleton entry so that the `Tuning the parser' section is sorted
48 alphabetically on long options.
49 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
50 %language directive in detail here; cross-reference the %language
51 documentation instead.
52 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
53 `%require "2.3b"' so that the example is always up-to-date.
54 (Bison Symbols): Add entries for %language and %skeleton.
55 * examples/extexi (normalize): Instead of replacing every %require
56 argument with the current Bison version, just substitute for
57 `@value{VERSION}'. This guarantees that we're testing what actually
58 appears in the documentation.
59 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
60 rather than `@VERSION@'.
61
0e021770
PE
622006-12-18 Paul Eggert <eggert@cs.ucla.edu>
63
fd575f05
PE
64 * NEWS: Reword the %language news a bit, and put it earlier.
65
0e021770
PE
66 * src/getargs.c (skeleton_arg): Last arg is now location const *.
67 Rewrite to simplify the logic.
68 (language_argmatch): Likewise.
fd575f05
PE
69 (program_name): We now own this var.
70 * src/getargs.h (struct bison_language): Use char[] rather than
71 const char *.
0e021770
PE
72
73 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
74 Java is supported.
75 * src/complain.c (program_name): Remove decl; no longer needed.
76 * src/main.c (program_name): Remove; now belongs to getargs.
77
782006-12-18 Paolo Bonzini <bonzini@gnu.org>
79
80 * NEWS: Document %language.
81
82 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
83
84 * data/c-skel.m4, data/c++-skel.m4: New files.
85 * data/glr.c: Complain on push parsers.
86
87 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
88 over %skeleton.
89 (Directives): Document %language and %skeleton.
90 (Command line): Document -L.
91
92 * examples/extexi: Rewrite %require directive.
93 * examples/calc++/Makefile.am: Pass VERSION to extexi.
94
95 * src/files.c (compute_exts_from_gc): Look in language structure
96 for .y extension.
97 (compute_file_name_parts): Check whether .tab should be added.
98 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
99 (language, skeleton_arg, language_argmatch): New.
100 (long_options): Add --language.
101 (getargs): Use skeleton_arg, add -L/--language.
102 * src/getargs.h: Include location.h.
103 (struct bison_language, language, skeleton_arg, language_argmatch): New.
104 * src/output.c (prepare): Pick default skeleton from struct language.
105 Don't dispatch C skeletons here.
106 * src/parse-gram.y (PERCENT_LANGUAGE): New.
107 (prologue_declaration): Add "%language" rule, use skeleton_arg.
108 * src/scan-gram.l ("%language"): New rule.
109
110 * tests/calc.at: Test %skeleton and %language.
111 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
112 (AT_GLR_IF): Look for %skeleton "glr.cc".
113 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
114 (AT_YACC_IF): Reject %language.
115
5691bf57
PE
1162006-12-18 Paul Eggert <eggert@cs.ucla.edu>
117
db06f0ce
PE
118 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
119 since it wasn't used; only the typedef name 'semantic_type' is needed.
120 Also, omit trailing white space.
121
5691bf57
PE
122 * bootstrap: Sync from coreutils.
123 (gnulib_extra_files): Add build-aux/announce.gen.
124 (slurp): Adjust .gitignore files like .cvsignore files.
125 * build-aux/announce-gen: Remove from CVS, since bootstrap
126 now creates this.
127
791934e4
JD
1282006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
129
130 Make %push-parser imply %pure-parser. This fixes several bugs; see
131 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
132 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
133 pure_parser = true.
134 * data/push.c: Don't bother testing b4_push_if when deciding whether
135 to expand b4_declare_parser_variables globally.
136 (yypush_parse): Likewise in here.
137
138 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
139 (yy_reduce_print): Reformat M4 for readability.
140
ee5abb37
JD
1412006-12-15 Bob Rossi <bob@brasko.net>
142 and Joel Denny <jdenny@ces.clemson.edu>
143
144 * data/push.c (yypstate): Add typedef, and update all uses of
145 struct yypstate to just yypstate.
146 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
147
16ca01f9
JD
1482006-12-14 Bob Rossi <bob@brasko.net>
149
150 * data/push.c (yypush_parse): Declare prototype regardless of
151 %locations option.
152
ab8e7e1a
JD
1532006-12-14 Bob Rossi <bob@brasko.net>
154
155 * data/push.c (yyparse): Remove the prototype and the #define when in
156 push-parser mode.
157
9bf32be3
JD
1582006-12-13 Bob Rossi <bob@brasko.net>
159
160 * data/push.c (yypstate_init): Rename to...
161 (yypstate_new): ... this and use b4_c_function_def.
162 (yypstate_delete): New.
163 (yypush_parse): Change parameters yynval and yynlloc to be const.
164 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
165 yypstate_delete functions.
166
f02e2948
JD
1672006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
168
169 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
170 strange test case titles. Reported by Bob Rossi.
171
38eb7751
PE
1722006-12-13 Paul Eggert <eggert@cs.ucla.edu>
173
174 * TODO: Add pointer to Sylvain Schmitz's work on static detection
175 of potential ambiguities in GLR grammers.
176
bd9d212b
JD
1772006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
178
179 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
180 `bison ', use m4_index instead of m4_substr since chopping up a string
181 containing M4-special characters causes problems here.
182
183 Fix a couple of bugs related to special characters in user-specified
184 file names, and make it easier for skeletons to compute output file
185 names with the same file name prefix as Bison-computed output file
186 names.
187 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
188 b4_parser_file_name and b4_spec_defines_file instead of
189 @output_parser_name@ and @output_header_name@, which are now redundant.
190 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
191 b4_parser_file_name, b4_spec_defines_file, and the new
192 @basename(FILENAME@) instead of @output_parser_name@ and
193 @output_header_name@, which inappropriately escaped the file names as
194 C string literals.
195 * src/files.c (all_but_ext): Remove static qualifier.
196 (compute_output_file_names): Move `free (all_but_ext)' to...
197 (output_file_names_free): ... here since all_but_ext is needed later.
198 * src/files.h (all_but_ext): Extern.
199 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
200 exactly what MUSCLE_INSERT_STRING used to do.
201 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
202 characters are escaped properly.
203 * src/output.c (prepare): Define muscle file_name_all_but_ext as
204 all_but_ext.
205 For pkgdatadir muscle, maintain previous functionality by using
206 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
207 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
208 digraphs would never be expanded. Hopefully no one has M4-special
209 characters in his Bison installation path.
210 * src/scan-skel.l: Don't parse @output_header_name@ and
211 @output_parser_name@ anymore since they're now redundant.
212 In @output, use decode_at_digraphs.
213 Parse a new @basename command that invokes last_component.
214 (decode_at_digraphs): New.
215 (BASE_QPUTS): Remove unused.
216 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
217 (Output file name): New tests.
218
3f7ca628
JD
2192006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
220
221 Warn about output files that are generated by the skeletons and that
222 conflict with other output files.
223 * data/glr.c: Don't generate the header file here when glr.cc does.
224 * src/files.c (file_names, file_names_count): New static globals.
225 (compute_output_file_names): Invoke output_file_name_check for files
226 not generated by the skeletons and remove existing checks.
227 (output_file_name_check): New function that warns about conflicting
228 output file names.
229 (output_file_names_free): Free file_names.
230 * src/files.h (output_file_name_check): Declare.
231 * src/scan-skel.l: Invoke output_file_name_check for files generated by
232 the skeletons.
233 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
234 (Conflicting output files): New tests.
235
178e123e
PE
2362006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
237
238 * doc/bison.texinfo: Fix a couple of typos.
239
2402006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
241
242 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
243 Rename to...
244 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
245 update all uses.
246 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
247 (yypush_parse): Rename yypvars argument to yyps and remove redundant
248 local pv.
249 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
250 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
251
ea17f233
JD
2522006-12-07 Bob Rossi <bob@brasko.net>
253 and Joel Denny <jdenny@ces.clemson.edu>
254
255 * data/push.c (yypvarsinit): Change return type from void* to struct
256 yypvars*. No longer cast to void* on return.
257 (struct yypvars): Remove yylen since it need not be remembered between
258 yypushparse invocations.
259 (yypushparse): Don't copy between yylen and pv->yylen.
260
55a30bda
JD
2612006-12-05 Bob Rossi <bob@brasko.net>
262
263 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
264 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
265 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
266 (struct yypvars): Remove b4_declare_parser_variables.
267 (yypvarsinit): Remove init code for removed variables.
268 (global scope): Do not declare b4_declare_parser_variables if
269 push or pure mode.
270 (yypushparse): Add b4_declare_parser_variables.
271 Init new local variables, and remove init code for removed
272 yypvars variables.
273 (yyparse): Delete.
274 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
275 and yyparse for other modes.
276 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
277 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
278 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
279 (AT_PURE_LEX_IF): True if pure or push parser.
280
85894313
JD
2812006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
282
283 Document Yacc prologue alternatives and default %destructor's and
284 %printer's as experimental. Don't mention Java yet. Discussed at
285 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
286 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
287 (2.3a): Annotate this entry to say the old forms of these features were
288 also experimental.
289 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
290 Bison Symbols): Say they're experimental. Comment out any mention
291 of Java (we'll want this back eventually).
292
02975b9a
JD
2932006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
294
295 Support a file name argument to %defines. Deprecate `=' in
296 %file-prefix, %name-prefix, and %output. Discussed at
297 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
298 * NEWS (2.3a+): Mention.
299 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
300 form of %defines, and remove `=' from entries for %file-prefix,
301 %name-prefix, and %output.
302 * src/parse-gram.y (prologue_declaration): Implement.
303 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
304 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
305 all but one occurrence of %name-prefix.
306 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
307 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
308 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
309 occurrence of each of %file-prefix and %output. Add check for %defines
310 with argument.
311 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
312 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
313 Remove the `=' from %output.
314
287b314e
JD
3152006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
316
317 Don't escape $ in test case titles since Autoconf 2.61 now does that
318 correctly.
319 * tests/actions.at (Default %printer and %destructor are not for error
320 or $undefined): Here.
321 (Default %printer and %destructor are not for $accept): Here.
322 * tests/input.at (Invalid $n and @n): Here.
323
3ebecc24
JD
3242006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
325
326 Rename <!> to <>. Discussed starting at
327 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
328 * NEWS (2.3a+): Update.
329 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
330 Update.
331 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
332 * src/scan-gram.l (INITIAL): Implement.
333 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
334 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
335 comment.
336 * tests/actions.at (Default tagless %printer and %destructor,
337 Default tagged and per-type %printer and %destructor,
338 Default %printer and %destructor are not for error or $undefined,
339 Default %printer and %destructor are not for $accept,
340 Default %printer and %destructor for mid-rule values): Update.
341 * tests/input.at (Default %printer and %destructor redeclared,
342 Unused values with default %destructor): Update.
343
26b8a438
JD
3442006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
345
346 Don't let %prec take a nonterminal.
347 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
348 token.
349 * tests/input.at (%prec takes a token): New test checking that %prec
350 won't take a nonterminal.
351
07c39ae9
JD
3522006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
353
405d53b7
JD
354 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
355 it was double-quoted.
07c39ae9
JD
356 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
357 grammar is maintained with Bison's highest standards.
358 * src/getargs.c: Fix some typos in Doxygen comments.
359
580b8926
JD
3602006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
361
362 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
363 later. Reported by Paul Eggert in
364 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
365 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
366 * src/scan-code.l (translate_action): Don't bother invoking
367 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
368 (code_scanner_free): Instead of invoking
369 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
370 which frees more.
371 * src/scan-gram.l (gram_scanner_free): Likewise.
372 * src/scan-skel.l (scan_skel): Likewise.
373
4502eadc
JD
3742006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
375
376 * src/files.c (tr): Change return type to void.
377 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
378 has been called previously for the same key.
379 (muscle_find): Return storage instead of value so that
380 --enable-gcc-warnings doesn't produce warnings that the return discards
381 const. aver that the value and storage are the same since storage
382 could potentially be NULL when value is not.
383 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
384 same as 0.
385
7746c8f6
PE
3862006-11-08 Paul Eggert <eggert@cs.ucla.edu>
387
388 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
389 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
390 us a slightly cleaner distribution, and also works.
391 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
392 gnulib changes.
393
eb095650
PE
3942006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
395 and Paul Eggert <eggert@cs.ucla.edu>
396
397 Don't let Bison leak memory except when it complains.
398 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
399 (spec_defines_file, dir_prefix): Now char *, not const char *,
400 since they are freed.
401 * src/files.c: Likewise.
402 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
403 Likewise.
404 (tr): Now operates in-place. All uses changed.
405 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
406 values.
407 (compute_file_name_parts, compute_output_file_names): Don't store
408 read-only data in variables that will be freed.
409 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
410 src_extension, and header_extension.
411 (output_file_names_free): New public function to free
412 spec_verbose_file, spec_graph_file, spec_defines_file,
413 parser_file_name, and dir_prefix.
414 * src/getargs.c (getargs): Don't store read-only data in variables that
415 will be freed.
416 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
417 (which previously existed but was unused), and quotearg_free.
418 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
419 * src/muscle_tab.c: Likewise.
420 (muscle_entry): Make the value char const *,
421 and add a new storage member that is char * and can be freed.
422 (muscle_entry_free): New private function.
423 (muscle_init): Use it instead of free.
424 (muscle_insert, muscle_grow): Update and use new storage member.
425 (muscle_code_grow): Free the string passed to muscle_grow
426 since it's not needed anymore.
427 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
428 add a new `char *code' member.
429 ("{...}"): Declare semantic type as code.
430 * src/scan-code.h (translate_rule_action):
431 (translate_symbol_action, translate_code, translate_action): Return
432 `char const *' rather than `char *' since external code should not free
433 these strings.
434 * src/scan-code.l: Likewise.
435 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
436 which is "{...}" in the parser.
437 * tests/Makefile.am (maintainer-check-valgrind): Set
438 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
439 Valgrind.
440 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
441 complain.
442 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
443 expecting a non-zero exit status sets --leak-check=summary and
444 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
445 this case, and we don't want to hear about it.
446
ac564be4
PE
4472006-11-08 Paul Eggert <eggert@cs.ucla.edu>
448
449 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
450 instead of from the template, to simplify configuration a bit.
451 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
452 and m4/wint_t.m4, as they are needed with the latest gnulib.
453
17bd8a73
JD
4542006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
455
456 Disable unset/unused mid-rule value warnings by default, and recognize
457 --warnings=midrule-values to enable them. Discussed starting at
458 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
459 * NEWS (2.3a+): Mention.
460 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
461 warnings): Add entry for midrule-values subargument.
462 * src/reader.c (symbol_should_be_used): Don't return true just because
463 the value is a set/used mid-rule value unless
464 --warnings=midrule-values was specified.
465 * tests/input.at (Unused values, Unused values before symbol
466 declarations): Run tests with and without --warnings=midrule-values.
467
468 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
469 than LIST_FREE directly.
470
89eb3c76
JD
4712006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
472
473 Finish implementing --warnings=error, which should not be implied by
474 --warnings=all (or by its synonyms -W and --warnings without
475 subarguments).
476 * src/complain.c (set_warning_issued): New function to report that
477 warnings are being treated as errors and to record an error if so.
478 Invoke...
479 (warn_at, warn): ... here.
480 * src/getargs.c (warnings_args, warnings_types): Reorder so that
481 "error - warnings are errors" does not appear above "all - all of the
482 above".
483 (getargs): For -W and --warnings without subarguments, don't let
484 FLAGS_ARGMATCH set warnings_error in warnings_flag.
485 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
486
ba7560e2
JD
4872006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
488
489 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
490 empty subargument list. For example: `bison --warnings= parser.y'.
491
31283fc3
JD
4922006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
493
494 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
495 the parser header file so that gcc doesn't warn.
496
12e35840
JD
4972006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
498
499 Split the default %destructor/%printer into two kinds: <*> and <!>.
500 Discussed starting at
501 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
502 * NEWS (2.3a+): Mention.
503 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
504 previous change today related to mid-rules.
505 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 506 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
507 (TYPE_TAG_ANY): Add as <*>.
508 (TYPE_TAG_NONE): Add as <!>.
509 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
510 for <*> and <!>.
511 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
512 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
513 * src/symlist.c (symbol_list_default_new): Split into tagged and
514 tagless versions.
515 (symbol_list_destructor_set, symbol_list_printer_set): Split
516 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
517 SYMLIST_DEFAULT_TAGLESS.
518 * src/symlist.h: Update symbol_list_default*_new prototypes.
519 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
520 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
521 * src/symtab.c (default_destructor, default_destructor_location,
522 default_printer, default_printer_location): Split each into tagged and
523 tagless versions.
524 (symbol_destructor_get, symbol_destructor_location_get,
525 symbol_printer_get, symbol_printer_location_get): Implement tagged
526 default and tagless default cases.
527 (default_destructor_set, default_printer_set): Split each into tagged
528 and tagless versions.
529 * src/symtab.h: Update prototypes.
530 * tests/actions.at (Default %printer and %destructor): Rename to...
531 (Default tagless %printer and %destructor): ... this, and extend.
532 (Per-type %printer and %destructor): Rename to...
533 (Default tagged and per-type %printer and %destructor): ... this, and
534 extend.
535 (Default %printer and %destructor for user-defined end token): Extend.
536 (Default %printer and %destructor are not for error or $undefined):
537 Update.
538 (Default %printer and %destructor are not for $accept): Update.
539 (Default %printer and %destructor for mid-rule values): Extend.
540 * tests/input.at (Default %printer and %destructor redeclared): Extend.
541 (Unused values with default %destructor): Extend.
542
f91b1629
JD
5432006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
544
545 Don't apply the default %destructor/%printer to an unreferenced midrule
546 value. Mentioned at
547 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
548 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
549 like $@n instead of just @n so that the default %destructor/%printer
550 logic doesn't see them as user-defined symbols.
551 (symbol_is_dummy): Check for both forms of the name.
552 * src/reader.c (packgram): Remove the `$' from each midrule symbol
553 name for which the midrule value is referenced in any action.
554 * tests/actions.at (Default %printer and %destructor for mid-rule
555 values): New test.
556 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
557 for change to dummy symbol names.
558
519d0004
JD
5592006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
560
561 Warn about unset midrule $$ if the corresponding $n is used.
562 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
563 $n usage.
564 (packgram): Before invoking grammar_rule_check on any rule, make sure
565 all actions have already been scanned in order to set `used' flags.
566 Otherwise, checking that a midrule's $$ is set will not always work
567 properly because the midrule check must forward-reference the midrule's
568 parent rule.
569 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
570 warning.
571
a501eca9
JD
5722006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
573
574 More improvements to the documentation of the prologue alternatives:
575 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
576 Bison manual.
577 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
578 some text to clarify the relative importance of the new directives and
579 to show how these directives may be viewed as code labels.
580
2cbe6b7f
JD
5812006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
582
583 Similar to the recently removed %before-header, add %code-top as the
584 alternative to the pre-prologue. Mentioned at
585 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
586 Also, let the prologue alternatives appear in the grammar section.
587 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
588 (prologue_declaration): Move the existing prologue alternatives to...
589 (grammar_declaration): ... here and add %code-top.
590 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
591
592 Clean up and extend documentation for the prologue alternatives.
593 * NEWS (2.3a+): Describe prologue alternatives.
594 * doc/bison.texinfo (Prologue): Move discussion of prologue
595 alternatives to...
596 (Prologue Alternatives): ... this new section, and extend it to discuss
597 all 4 directives in detail.
598 (Bison Symbols): Clean up discussion of prologue alternatives and add
599 %code-top.
600
e557d3ea
JMG
6012006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
602
603 DJGPP specific issues.
604
605 * djgpp/config.bat: config.hin has been moved to lib. Adjust
606 config.bat accordingly.
607 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
608 * djgpp/config.site: Likewise.
609
136a0f76
PB
6102006-10-16 Paolo Bonzini <bonzini@gnu.org>
611
27bd5d67
PB
612 Replace %*-header with %provides, %requires, %code. See discussion at
613 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
614
136a0f76
PB
615 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
616 (b4_user_start_header): Remove.
617 * data/glr.c: Use new macros instead of b4_*start_header
618 and b4_*end_header.
619 * data/glr.cc: Likewise.
620 * data/lalr1.cc: Likewise.
621 * data/push.c: Likewise.
622 * data/yacc.c: Likewise.
623
624 * doc/bison.texinfo: Remove %before-header, rename
625 %{start,end,after}-header to %requires, %provides, %code.
626
627 * src/parse-gram.y: Likewise (also rename token names accordingly).
628 * src/scan-gram.l: Likewise.
629 * tests/actions.at: Likewise.
630
10f429ef
PE
6312006-10-14 Paul Eggert <eggert@cs.ucla.edu>
632
633 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
634 Problem reported by Joel E. Denny.
635
6362006-10-14 Jim Meyering <jim@meyering.net>
637
638 (Sync from coreutils.)
639 Work also when the working directory (with e.g. coreutils sources)
640 is version controlled with git, rather than CVS.
641 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
642 rather than CVS.
643 In messages and comments, say e.g., "checked-out sources",
644 rather than "CVS sources".
645 (version_controlled_file): New function. Work for git as well as
646 for CVS. Don't use grep's -q option.
647 (slurp): Call it here, in place of CVS-specific code.
648
c4bd5bf7
JD
6492006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
650
651 Fix testsuite for ./configure --enable-gcc-warnings:
652 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
653 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
654 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
655 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
656 * test/regression.at (Diagnostic that expects two alternatives):
657 Likewise.
658
46356ea4
PE
6592006-10-12 Paul Eggert <eggert@cs.ucla.edu>
660
231ed89a
PE
661 * bootstrap.conf (gnulib_modules): Add config-h.
662 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
663 worry about HAVE_CONFIG_H.
664 * lib/abitset.c: Likewise.
665 * lib/bitset.c: Likewise.
666 * lib/bitset_stats.c: Likewise.
667 * lib/bitsetv-print.c: Likewise.
668 * lib/bitsetv.c: Likewise.
669 * lib/ebitset.c: Likewise.
670 * lib/get-errno.c: Likewise.
671 * lib/lbitset.c: Likewise.
672 * lib/subpipe.c: Likewise.
673 * lib/timevar.c: Likewise.
674 * lib/vbitset.c: Likewise.
675 * lib/bitset.c: Include "bitset.h" first, to test interface.
676 * lib/bitset_stats.c: Include "bitset_stats.h" first.
677 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
678 * lib/bitsetv.c: Include "bitsetv.h" first.
679 * lib/get-errno.c: Include "get-errno.h" first.
680 * m4/.cvsignore: Add config-h.m4.
681 * tests/actions.at (Default %printer and %destructor for ...):
682 Adjust expected line numbers in output to reflect removal of #if
683 HAVE_CONFIG_H lines.
684 * tests/glr-regression.at (Missed %merge type warnings when ...):
685 Likewise.
686 * tests/regression.at (Braced code in declaration in rules section):
687 Likewise.
688 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
689 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
690 Include <config.h> unconditionally.
691
46356ea4
PE
692 * bootstrap: Sync from coreutils, as follows:
693
694 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
695
696 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
697 variable was sometimes used without being initialized. This
698 messed up the installation of the INSTALL file in some cases.
699
700 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
701
702 * bootstrap (usage, main program, symlink_to_gnulib): Add option
703 --copy. Inspired by a suggestion from Bruno Haible.
704
705 2006-10-03 Jim Meyering <jim@meyering.net>
706
707 * bootstrap: Undo last change to this file, since now gnulib-tool
708 sticks with the automake default in generating dependencies.
709
dd4bf078
PE
7102006-10-12 Paul Eggert <eggert@cs.ucla.edu>
711
cf2a5f7c
PE
712 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
713 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
714
715 * doc/bison.1: Add copyright notice.
716
717 * data/glr.c: Don't include <stdarg.h>; not used.
718
35fe0834
PE
719 * NEWS: The -g and --graph options now output graphs in Graphviz
720 DOT format, not VCG format.
721 * doc/bison.1: Likewise.
722 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
723 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
724 of this change in
725 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
726 * TODO: Remove Graphviz entry.
727 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
728 remove vcg.c, vcg.h, vcg_defaults.h.
729 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
730 * src/graphviz.c, src/graphviz.h: New files.
731 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
732 * src/files.h: Make comment more generic.
733 * src/main.c (main): Likewise.
734 * src/print_graph.h: Likewise.
735 * src/getargs.c (usage): Make usage description more generic.
736 * src/print_graph.c: Include graphviz.h rather than vcg.h.
737 (static_graph, fgraph): Remove. All uses changed to pass
738 arguments instead of sharing a static var.
739 (print_core, print_actions, print_state, print_graph):
740 Output graphviz format rather than VCG format.
741 * tests/.cvsignore: Remove *.vcg; add *.dot.
742 * tests/output.at: Expect *.dot files, not *.vcg files.
743
dd4bf078
PE
744 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
745 accommodates the 2006-10-08 change.
746
efdd7421
PE
7472006-10-11 Bob Rossi <bob@brasko.net>
748
749 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
750 (b4_yyssa, b4_yyerror_range): New macros.
751 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
752 (yypvarsinit): Remove init of removed fields.
753 (yypushparse): Remove use of removed fields; use new macros instead.
754
96a1981a
PE
7552006-10-11 Paul Eggert <eggert@cs.ucla.edu>
756
757 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
758 in a push parser. Reindent slightly to match yacc.c better.
759
7602006-10-11 Bob Rossi <bob@brasko.net>
761
46356ea4
PE
762 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
763 yymsg_alloc fields.
764 (yypvarsinit, yypushparse): Remove init of removed fields.
765 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 766
c1630a8b
PE
7672006-10-09 Paul Eggert <eggert@cs.ucla.edu>
768
769 * THANKS: Add Paolo Bonzini and Bob Rossi.
770
90b9908d
PB
7712006-10-08 Paolo Bonzini <bonzini@gnu.org>
772
773 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
774 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
775 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
776 b4_define_user_cde and uses): Remove.
777 (b4_comment, b4_prefix, b4_sync_start): New.
778 * data/bison.m4: New file, with most of the content removed from c.m4.
779 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
780 * src/output.c (output_skeleton): Pass bison.m4.
781 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
782 only if specified.
783
cf806753
PE
7842006-10-05 Paul Eggert <eggert@cs.ucla.edu>
785
786 Fix test failure reported by Tom Lane in
787 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
788 and try to make such failures easier to catch in the future.
789 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
790 that's now the caller's responsibility.
791 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
792 Set yychar = YYEOF if it's negative.
793 * tests/actions.at (yylex): Abort if asked to read past EOF.
794 * tests/conflicts.at (yylex): Likewise.
795 * tests/cxx-type.at (yylex): Likewise.
796 * tests/glr-regression.at (yylex): Likewise.
797 * tests/input.at (yylex): Likewise.
798 * tests/regression.at (yylex): Likewise.
799 * tests/torture.at (yylex): Likewise.
800
0e2f006a
PE
8012006-10-01 Paul Eggert <eggert@cs.ucla.edu>
802
803 Fix problems with translating English-language diagnostics.
804 * bootstrap: Fix bug introduced in recent bootstrap changes, with
805 respect to bison-runtime pot generation. The YY_ stuff
806 wasn't being captured.
807 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
808 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
809 * runtime-po/POTFILES.in: Add data/push.c.
810
e3ddc1e3
PE
8112006-09-29 Paul Eggert <eggert@cs.ucla.edu>
812
813 Merge bootstrap changes from coreutils.
814
815 2006-09-28 Jim Meyering <jim@meyering.net>
816
817 Automatically generated dependencies are important even
818 when all of the sources in a directory come from gnulib.
819 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
820 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
821
822 2006-09-23 Jim Meyering <jim@meyering.net>
823
824 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
825
826 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
827
828 * bootstrap: Add support for --force.
829 (usage): New function. Describe usage less tersely.
830 (CVS_only_file): New var.
831
01e972b3
PE
8322006-09-21 Paul Eggert <eggert@cs.ucla.edu>
833
834 * data/push.c (YYPUSH_MORE): Make it an enum instead.
835 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
836 Adjust white space and comments to match GNU style better.
837
c63d3e90
PE
8382006-09-20 Bob Rossi <bob@brasko.net>
839
840 * data/push.c (yyresult_get): Remove function.
841 (YYPUSH_MORE): Add #define.
842 (yypushparse): Modify return value.
843
e70f46d1
PE
8442006-09-20 Paul Eggert <eggert@cs.ucla.edu>
845
846 * stamp-h.in: Remove; no longer needed.
847 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
848 Remove config.h, config.hin, intl (no longer created).
849 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
850 stamp-h1.
851
852 Sync bootstrap from coreutils, as follows:
853
854 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
855
856 * bootstrap (symlink_to_gnulib): New function.
857 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
858 to copies-of-gnulib.
859 (cp_mark_as_generated, slurp, gnulib_files):
860 Avoid making a copy if it's the same as the old version.
861 (gnulib_files): Add support for this variable (used by Bison).
862
a92be413
PE
8632006-09-20 Paul Eggert <eggert@cs.ucla.edu>
864
865 * src/getargs.c (usage): Rework to use conventions similar to
866 coreutils, to make translation a bit easier and the code a bit
867 smaller. Problem reported by Tim Van Holder.
868
4f82b42a
PE
8692006-09-15 Paul Eggert <eggert@cs.ucla.edu>
870
3b2942e6
PE
871 Use some of gnulib's new modules, taken from coreutils.
872
873 * bootstrap: Sync from coreutils, except add support for gnulib_files.
874 * bootstrap.conf: New file.
875 (gnulib_modules): Add configmake, inttypes, unistd.
876 (XGETTEXT_OPTIONS): Add complain, complain_at,
877 fatal, fatal_at, warn, warn_at, unexpected_end.
878 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
879 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
880 (gl_EARLY): Add.
881 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
882 (gl_INIT): Add
883 (GNULIB_AUTOCONF_SNIPPET): Remove.
884 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
885 the pickiest.
886 * lib/.cvsignore: Add inttypes_.h.
887 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
888 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
889 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
890 no-longer-necessary initializations.
891 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
892 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
893 use the unistd module.
894 * src/system.h: Likewise.
895 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
896 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
897 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
898 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
899 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
900 * src/system.h: Include inttypes.h unconditionally, now that we
901 use the inttypes module. Don't bother to include stdint.h, since
902 inttypes.h now does that for us.
903 (LOCALEDIR): Remove, now that we use the configmake module.
904 * src/getargs.c: Include configmake.h.
905 * src/main.c: Likewise.
906 * src/output.c: Likewise.
907 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
908 not from $abs_top_builddir, since config.h moved.
909
910
4f82b42a
PE
911 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
912 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
913
914 * src/parse-gram.y (symbol_declaration): Don't put statements
915 before declarations; it's not portable to C89.
916 * src/scan-code.l (handle_action_at): Likewise.
917
918 * src/scan-code.l: Always initialize braces_level; the old code
919 left it uninitialized and therefore had undefined behavior.
920
921 Don't attempt to redefine 'assert', since it runs afoul of
922 systems where standard headers (mistakenly) include <assert.h>.
923 Instead, define and use our own alternative, called 'aver'.
924 * src/reader.c: Don't include assert.h, since we no longer
925 use assert.
926 * src/scan-code.l: Likewise.
927 * src/system.h (assert): Remove, replacing with....
928 (aver): New function, taking a bool arg. All uses changed.
929 * src/tables.c (pack_vector): Ensure that aver arg is bool,
930 not merely an integer.
931
31c10e38
PE
9322006-09-15 Bob Rossi <bob@brasko.net>
933
934 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
935 * data/c.m4 (YYPUSH): New.
936 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
937 * src/getargs.c (push_parser): New var.
938 * src/getargs.h (push_parser): New declaration.
939 * src/output.c (prepare): Add macro insertion of `push_flag'.
940 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
941 (prologue_declaration): Parse %push-parser.
942 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
943 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
944 list of removed lines from the traces observed.
945 (AT_CHECK_CALC_LALR): Added push parser tests.
946
fa7b79c0
PE
9472006-09-13 Paul Eggert <eggert@cs.ucla.edu>
948
21fe08ca
PE
949 * NEWS: Version 2.3a.
950 * configure.ac (AC_INIT): Likewise.
951
e8ec4d9b
PE
952 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
953 "#define YYSTYPE int" that caused "make maintainer-check" to fail
954 due to header ordering dependencies. I don't know why the #define
955 was there.
956
fa7b79c0
PE
957 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
958 runtime cost when YYDEBUG is not defined, and so that some tests
959 that used to fail now work. Problem and initial suggestion by
960 Paolo Bonzini.
961 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
962 * data/glr.cc (b4_parser_class_name):
963 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
964 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
965 (yydebug_) [YYDEBUG]: New member.
966 (yycdebug_): Now defined only if YYDEBUG.
967 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
968 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
969 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
970 if YYYDEBUG.
971 (debug_stream, set_debug_stream, debug_level, set_debug_level):
972 Define only if YYDEBUG.
973 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
974 set_debug_level.
975 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
976 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
977 AT_CHECK_CALC_GLR_CC that are working now.
978
4ec13d60
PE
9792006-09-12 Paul Eggert <eggert@cs.ucla.edu>
980
981 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
982 We don't need them in glr.cc, and glr.c defines them.
983 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
984 assumes that defining it to anything is the same as defining
985 it to 1. Problem reported by Paolo Bonzini.
986
8e1687ae
PE
9872006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
988
989 * data/c.m4 (b4_null, b4_case): Define.
990 * src/output.c (prepare_symbols): Use b4_null.
991 (user_actions_output): Use b4_case.
992
3dc5e96b
PE
9932006-09-11 Paul Eggert <eggert@cs.ucla.edu>
994
aef3da86
PE
995 * data/glr.c (b4_shared_declarations): Put start-header first,
996 before any #includes that we generate, so that feature-test
997 macros work. Problem reported by Michael Deutschmann in
998 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
999 * data/lalr1.cc: Likewise.
1000 * doc/bison.texinfo (Prologue): Document that feature-test macros
1001 should be defined before any Bison declarations.
1002 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
1003 that depend on location.hh after, not before, Bison decls, since
1004 we now include location.hh after the first user prologue.
1005
3dc5e96b
PE
1006 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
1007 Sander Brandenburg in
1008 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
1009 Also, fix minor white space and comment issues.
aef3da86
PE
1010 (Prologue): Mention that it's better to define feature-test macros
1011 before Bison declarations. Problem reported by Michael Deutschmann.
1012
1013 * README-cvs: Fix typo: "&" should be "&&". Problem reported
1014 by Jim Meyering.
1015 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
1016 This adjusts to recent gnulib changes.
3dc5e96b 1017
b2a0b7ca
JD
10182006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1019
1020 Finish implementation of per-type %destructor/%printer. Discussed
1021 starting at
1022 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
1023 and
1024 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
1025 * NEWS (2.3+): Add a description of this feature to the default
1026 %destructor/%printer description.
1027 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
1028 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1029 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
1030 list node contains a semantic type.
1031 * src/symtab.c, src/symtab.h: Extend with a table that associates
1032 semantic types with their %destructor's and %printer's.
1033 (semantic_type_from_uniqstr, semantic_type_get,
1034 semantic_type_destructor_set, semantic_type_printer_set): New functions
1035 composing the public interface of that table.
1036 (symbol_destructor_get, symbol_destructor_location_get,
1037 symbol_printer_get, symbol_printer_location_get): If there's no
1038 per-symbol %destructor/%printer, look up the per-type before trying
1039 the default.
1040 * tests/actions.at (Per-type %printer and %destructor): New test case.
1041 * tests/input.at (Default %printer and %destructor redeclared):
1042 Extend to check that multiple occurrences of %symbol-default in a
1043 single %destructor/%printer declaration is an error.
1044 (Per-type %printer and %destructor redeclared, Unused values with
1045 per-type %destructor): New test cases.
1046
3be03b13
JD
10472006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1048
1049 Require default %destructor/%printer to be declared using
1050 %symbol-default instead of an empty symbol list, and start working on
1051 new per-type %destructor/%printer. Discussed at
1052 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
1053 * NEWS (2.3+): Add %symbol-default to example.
1054 * bison.texinfo (Freeing Discarded Symbols): Likewise.
1055 (Bison Symbols): Add entry for %symbol-default.
1056 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
1057 (generic_symlist, generic_symlist_item): New nonterminals for creating
1058 a list in which each item is a symbol, semantic type, or
1059 %symbol-default.
1060 (grammar_declaration): Use generic_symlist in %destructor and %printer
1061 declarations instead of symbols.1 or an empty list.
1062 (symbol_declaration, precedence_declaration, symbols.1): Update actions
1063 for changes to symbol_list.
1064 * src/reader.c: Update for changes to symbol_list.
1065 * src/scan-code.l: Likewise.
1066 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
1067 * src/symlist.c, src/symlist.h: Extend such that a list node may
1068 represent a semantic type or a %symbol-default in addition to just an
1069 ordinary symbol. Add switched functions for setting %destructor's and
1070 %printer's.
1071 * tests/actions.at, tests/input.at: Add %symbol-default to all default
1072 %destructor/%printer declarations.
1073
3508ce36
JD
10742006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
1075
1076 Whether the default %destructor/%printer applies to a particular symbol
1077 isn't a question of whether the user *declares* that symbol (in %token,
1078 for example). It's a question of whether the user by any means
1079 *defines* the symbol at all (by simply using a char token, for
1080 example). $end is defined by Bison whereas any other token with token
1081 number 0 is defined by the user. The error token is always defined by
1082 Bison regardless of whether the user declares it with %token, but we
1083 may one day let the user define error as a nonterminal instead.
1084 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
1085 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
1086 the meaning of "user-defined".
1087 * tests/actions.at (Default %printer and %destructor for user-declared
1088 end token): Rename to...
1089 (Default %printer and %destructor for user-defined end token): ...
1090 this.
1091
1092 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
1093 computation of whether to apply the default, don't maintain a list of
1094 every Bison-defined symbol. Instead, just check for a first character
1095 of '$', which a user symbol cannot have, and check for the error token.
1096
9350499c
JD
10972006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
1098
1099 Don't apply the default %destructor or %printer to the error token,
1100 $undefined, or $accept. This change fits the general rule that the
1101 default %destructor and %printer are only for user-declared symbols,
1102 and it solves several difficulties that are described in the new test
1103 cases listed below.
1104 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
1105 * tests/actions.at (Default %printer and %destructor are not for error
1106 or $undefined, Default %printer and %destructor are not for $accept):
1107 New test cases.
1108
4d7370cb
JD
11092006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
1110
1111 Allow %start after the first rule.
1112 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
1113 when parsing the first rule.
1114 (check_and_convert_grammar): Search for it here after all grammar
1115 declarations have been parsed. Skip midrules, which have dummy LHS
1116 nonterminals.
1117 * src/symtab.c (symbol_is_dummy): New function.
1118 * src/symtab.h (symbol_is_dummy): Declare it.
1119 * tests/input.at (%start after first rule): New test.
1120
6d0ef4ec
JD
11212006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1122
1123 Redo some of the previous commit: add back the ability to use
1124 non-aliased/undeclared string literals since it might be useful to
1125 those declaring %token-table.
1126 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1127 commit: don't worry about complaints from symbols_pack.
1128 * src/symtab.c (symbol_new, symbol_class_set,
1129 symbol_check_alias_consistency): Undo changes in previous commit: count
1130 each string literal as a new symbol and token, assign it a symbol
1131 number, and don't complain about non-aliased string literals.
1132 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1133 and token counts but does still set aliased tokens to the same number,
1134 symbol_pack_processor now leaves empty slots in the symbols array.
1135 Remove those slots.
1136 * tests/regression.at (Undeclared string literal): Remove test case
1137 added in previous commit since non-aliased string literals are allowed
1138 again.
1139 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1140 remove unnecessary string literal declarations.
1141 * tests/sets.at (Firsts): Likewise.
1142
965537bc
JD
11432006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1144
1145 Don't allow an undeclared string literal, but allow a string literal to
1146 be used before its declaration.
1147 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1148 symbols_pack complained.
1149 * src/symtab.c (symbol_new): Don't count a string literal as a new
1150 symbol.
1151 (symbol_class_set): Don't count a string literal as a new token, and
1152 don't assign it a symbol number since symbol_make_alias does that.
1153 (symbol_make_alias): It's not necessary to decrement the symbol and
1154 token counts anymore. Don't assume that an alias declaration occurs
1155 before any uses of the identifier or string, and thus don't assert that
1156 one of them has the highest symbol number so far.
1157 (symbol_check_alias_consistency): Complain if there's a string literal
1158 that wasn't declared as an alias.
1159 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1160 symbol_pack asserts that every token has been assigned a symbol number
1161 although undeclared string literals have not.
1162 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 1163 string literal): New test cases.
965537bc
JD
1164 (Characters Escapes, Web2c Actions): Declare string literals as
1165 aliases.
1166 * tests/sets.at (Firsts): Likewise.
1167
47aee066
JD
11682006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1169
1170 In the grammar scanner, STRING_FINISH unclosed constructs and return
1171 them to the parser in order to improve error messages.
1172 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1173 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1174 * tests/input.at (Unclosed constructs): New test case.
1175 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1176 seen.
1177
1178 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1179 unused global.
1180
1f6b3679
JD
11812006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1182
1183 Handle string aliases for character tokens correctly.
1184 * src/symtab.c (symbol_user_token_number_set): If the token has an
1185 alias, check and set its alias's user token number instead of its own,
1186 which is set to indicate the alias. Previously, every occurrence of
1187 the character token in the grammar overwrote that alias indicator with
1188 the character code.
1189 * tests/input.at (String aliases for character tokens): New test.
1190
219741d8
JD
11912006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1192
1193 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1194
11daa4e7
PE
11952006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1196
1197 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1198 to prevent failures when building on older platforms.
1199 Check for autopoint failure.
1200 Set XGETTEXT_OPTIONS to values that check for C format strings,
1201 so that translators are warned about them (this also helps
1202 prevent core dumps).
1203
1204 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1205 function, since it simplifies our code a bit.
1206
1207 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1208 rather than -W, so we don't get bogus warnings about sign comparisons.
1209 Add -Wpointer-arith, since that warning is useful (it reports code
1210 that does not conform to C89 and that some compilers reject).
1211 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1212 since it's no longer needed.
1213
f9bfc42a
JD
12142006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1215
1216 Clean up scanners a bit.
1217 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1218 definitions so gcc won't warn when obstack_for_string is unused.
1219 * src/scan-code.l: config.h and system.h are already #include'd by
1220 scan-code-c.c, so get rid of them here.
1221 * src/scan-gram.l: Likewise.
1222 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1223 definitions rather than duplicating the rest of it.
1224 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1225
06e8700a
JD
12262006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1227
1228 Suppress signed/unsigned comparison warnings for yycheck.
1229 * data/c.m4 (b4_safest_int_type): New macro.
1230 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1231 a signed int type, cast it to b4_safest_int_type first.
1232 * data/yacc.c: Likewise.
1233 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1234 also overwritten.
1235
9c437126
PE
12362006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1237
1238 * doc/bison.texinfo: Fix some typos.
1239
284d8a13
PE
12402006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1241
1242 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1243 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1244
1245 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1246 the latest gnulib does this a different way.
1247 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1248 translation was patched, so stop omitting it.
1249
ec5479ce
JD
12502006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1251
1252 Enable declaration of default %printer/%destructor. Make the parser
1253 use these for all user-declared grammar symbols for which the user does
1254 not declare a specific %printer/%destructor. Thus, the parser uses it
1255 for token 0 if the user declares it but not if Bison generates it as
1256 $end. Discussed starting at
1257 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1258 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1259 and
1260 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1261 * NEWS (2.3+): Mention.
1262 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1263 declare a %destructor for a mid-rule's semantic value. It's just
1264 impossible to declare one specific to it.
1265 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1266 code. Describe default %destructor form.
1267 * src/parse-gram.y (grammar_declaration): Parse default
1268 %printer/%destructor declarations.
1269 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1270 and symbol_destructor_location_get rather than accessing the destructor
1271 and destructor_location members of struct symbol.
1272 (symbol_printers_output): Likewise but for %printer's.
1273 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1274 again.
1275 * src/symtab.c (default_destructor, default_destructor_location,
1276 default_printer, default_printer_location): New static global
1277 variables to record the default %destructor and %printer.
1278 (symbol_destructor_get, symbol_destructor_location_get,
1279 symbol_printer_get, symbol_printer_location_get): New functions to
1280 compute the appropriate %destructor and %printer for a symbol.
1281 (default_destructor_set, default_printer_set): New functions to set the
1282 default %destructor and %printer.
1283 * src/symtab.h: Prototype all those new functions.
1284 * tests/actions.at (Default %printer and %destructor): New test to
1285 check that the right %printer and %destructor are called, that they're
1286 not called for $end, and that $$ and @$ work correctly.
1287 (Default %printer and %destructor for user-declared end token): New
1288 test to check that the default %printer and %destructor are called for
1289 a user-declared end token.
1290 * tests/input.at (Default %printer and %destructor redeclared, Unused
1291 values with default %destructor): New tests to check related grammar
1292 warnings and errors.
1293
868d2d96
JD
12942006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1295
1296 Clean up handling of %destructor for the end token (token 0).
1297 Discussed starting at
1298 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1299 and
1300 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1301
1302 Make the skeletons consistent in how they pop the end token and invoke
1303 its %destructor.
1304 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1305 state, which has token number 0, since this would invoke the
1306 %destructor for the end token.
1307 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1308 until after shifting the end token, or else it won't be popped.
1309 * data/yacc.c (yyparse): Likewise.
1310
1311 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1312 it's the end token. Upon termination, destroy an unshifted lookahead
1313 even when it's the end token.
1314 * data/lalr1.cc (yy::parser::parse): Likewise.
1315 * data/yacc.c (yyparse): Likewise.
1316
1317 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1318 value warnings for the end token when the user gives the end token a
1319 %destructor.
1320
1321 * tests/actions.at (Printers and Destructors): Test all the above.
1322
62a9592d
PE
13232006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1324
1325 Update to latest gnulib and gettext versions.
1326 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1327 Add fopen-safer.
1328 (gnulib_files): Add m4/warning.m4. Don't worry about files
1329 overwritten by autopoint.
1330 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1331 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1332 rejects them.
1333 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1334 so that we can remove the intl files at a better time.
1335 (intl_files_to_remove): Remove aclocal.m4, since it gets
1336 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1337 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1338 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1339 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1340 Remove datarootdir hack; no longer needed.
1341 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1342 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1343 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1344 strdup.h.
1345 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1346 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1347
10d6970f
PE
13482006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1349
1350 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1351 it with --assume-autoconf='latest-stable'.
1352
50a33993
JD
13532006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1354
1355 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1356 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1357 YYSTYPE' and `{'.
1358 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1359 those from muscle_tab.c since the old ones are misleading.
1360
2ce4ed68
AD
13612006-07-13 Akim Demaille <akim@epita.fr>
1362
1363 Support %define "KEY" {VALUE}.
1364 * src/scan-code.h, src/scan-code.l (translate_action)
1365 (translate_rule_action, translate_symbol_action, translate_code):
1366 Return char *, not const char *.
1367 * src/parse-gram.y (declaration): Rename as...
1368 (prologue_declaration): this.
1369 (string_content): Remove this nonterminal, use STRING.
1370 (braceless, content, content.opt): New nonterminal.
1371 Use them.
1372 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1373 as value.
1374 * src/scan-gram.l (getargs.h): Don't include it.
1375
db7e5eb5
PE
13762006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1377
1378 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1379 rather than a for-loop that declares a local bool variable. This
1380 should work around a compatibility problem with a Cray x1e C++
1381 compiler reported by Hung Nguyen in
1382 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1383 The for-loop was introduced in the 2004-11-17 change but I don't
1384 know why it was needed.
1385
a5d80ba5
AD
13862006-07-12 Akim Demaille <akim@epita.fr>
1387
1388 * data/c.m4: Comment changes.
1389
23eb2a69
AD
13902006-07-10 Akim Demaille <akim@lrde.epita.fr>
1391
1392 * src/complain.c (error_message, ERROR_MESSAGE): New.
1393 To factor...
1394 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1395 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1396
ddc8ede1
PE
13972006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1398
1399 * NEWS: Instead of %union, you can define and use your own union type
1400 YYSTYPE if your grammar contains at least one <type> tag.
1401 Your YYSTYPE need not be a macro; it can be a typedef.
1402 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1403 (Union Decl, Decl Summary): Document this.
1404 * data/glr.c (YYSTYPE): Implement this.
1405 * data/glr.cc (YYSTYPE): Likewise.
1406 * data/lalr1.cc (YYSTYPE): Likewise.
1407 * data/yacc.c (YYSTYPE): Likewise.
1408 * src/output.c (prepare): Output tag_seen_flag.
1409 * src/parse-gram.y (declaration, grammar_declaration):
1410 Use 'union_seen' rather than 'typed' to determine whether
1411 %union has been seen, since grammars can now be typed without
1412 %union.
1413 (symbol_declaration, type.opt, symbol_def):
1414 Keep track of whether a tag has been seen.
1415 * src/reader.c (union_seen, tag_seen): New vars.
1416 (typed): remove.
1417 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1418 * src/scan-code.l (untyped_var_seen): New variable.
1419 (handle_action_dollar): Adjust to above changes.
1420 (handle_action_dollar, handle_action_at):
1421 Improve overflow checking for outlandish numbers.
1422 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1423 avoid new diagnostics generated by above changes.
1424 * tests/regression.at (YYSTYPE typedef): Add test to check
1425 for type tags without %union.
1426
1427 * src/symlist.c (symbol_list_length): Return int, not unsigned
1428 int, since callers expect int. This may need to get revisited
1429 once we have proper integer overflow checking.
1430
1431 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1432 object is now static.
1433
1434 * src/getargs.c (flags_argmatch): Return void, not int,
1435 to pacify ./configure --enable-gcc-warnings.
1436
1437 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1438 since last_string is already defined to FLEX_PREFIX (last_string).
1439
7b42569e
AD
14402006-07-09 Akim Demaille <akim@lrde.epita.fr>
1441
1442 Implement --warnings/-W.
1443 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1444 replaced by...
1445 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1446 Adjust callers.
1447 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1448 (warnings_args, warnings_types): New.
1449 (getargs, short_options, long_options): Accept -W/--warnings.
1450 Sort the options by alphabetical order, upper case letter right
1451 before its lower case.
1452
3b452f4e
JD
14532006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1454
1455 Change %merge result type clash warnings to errors. Discussed at
1456 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1457 * src/reader.c (record_merge_function_type): Use complain_at.
1458 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1459 declared later): Update test case results.
1460
b8a41559
AD
14612006-07-09 Akim Demaille <akim@lrde.epita.fr>
1462
1463 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1464 to be in alphabetical order.
1465 (trace_args): Spelling fixes.
1466
cd9e1ba2
PE
14672006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1468
1469 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1470 so they don't collide with user-defined macros.
1471 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1472 this was never guaranteed, and now that we're using gnulib stdint,
1473 which defines int_fast16_t to long int, the problem is exposed.
1474
cb48f191
PE
14752006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1476
b8445a15
PE
1477 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1478 need the full POSIX semantics (and weren't implementing them
1479 anyway).
1480
cb48f191
PE
1481 Adjust to Autoconf 2.60 and today's gnulib.
1482 * bootstrap (gnulib_modules): Add stdint.
1483 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1484 no longer copies it.
1485 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1486 since stdint needs the former and wcwidth (which is now required
1487 by mbswidth) needs the latter.
1488 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1489 work around a compatibility glitch between gettext 0.14.6 and
1490 Autoconf 2.60.
1491 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1492 Do not check for uintptr_t, since new stdint module does the right
1493 thing.
1494 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1495 Add stdint.h, stdint_.h, wcwidth.h.
1496 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1497 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1498 stdint.m4, wchar_t.m4, wcwidth.m4.
1499 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1500 usual order for ../lib/*.h files.
1501 (file_name_split): Use last_component, not base_name, to adjust
1502 to gnulib changes.
1503 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1504 for ../lib/*.h files.
1505 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1506 Define unconditionally, since we now assume the stdint module.
1507 * src/scan-skel.l: Include <dirname.h>.
1508 (BASE_QPUTS): Use last_component, not base_name.
1509 * src/system.h: Include <unlocked-io.h> in the usual order
1510 for ../lib/*.h files. Include <stdint.h> unconditionally,
1511 since we now use the stdint module.
1512 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1513 HAVE_UINTPTR_T, since we now use the stdint module.
1514 (base_name): Remove decl, since files now include <dirname.h>
1515 to get the decl.
1516
cd48d21d
AD
15172006-07-08 Akim Demaille <akim@lrde.epita.fr>
1518
1519 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1520 New, default to 1.
1521 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1522 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1523 default.
1524 * tests/calc.at: Adjust.
1525
8ec0a172
AD
15262006-07-08 Akim Demaille <akim@lrde.epita.fr>
1527
b8445a15 1528 * data/c.m4 (b4_basename): New.
8ec0a172
AD
1529 (b4_syncline): Also output the location of its invocation (from
1530 the skeleton).
1531 (b4_user_action, b4_define_user_action, b4_user_actions)
1532 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1533 (b4_user_stype): New.
1534 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1535
4a678af8
JD
15362006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1537
1538 In the grammar file, the first column is 1 not 0 on the first line as
1539 on every other line.
1540 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1541 * tests/input.at (Torturing the Scanner): Update output.
1542
1543 * src/scan-gram.l (scanner_cursor): Declare it static.
1544
dd60572a
JD
15452006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1546
1547 In warnings, say "previous declaration" rather than "first
1548 declaration".
1549 * src/symtab.c (redeclaration): Do that here.
1550 * src/reader.c (record_merge_function_type): In the case of a result
1551 type clash, report the previous declaration rather than the very first
1552 one in the grammar file.
1553 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1554 declared later): Add a third declaration to check this behavior.
1555 * tests/input.at (Incompatible Aliases): Update output.
1556
2073e1b6
AD
15572006-06-27 Akim Demaille <akim@epita.fr>
1558
1559 * doc/Doxyfile.in: New.
1560 * doc/Makefile.am: Use it.
1561 * src/lalr.h, src/symtab.h: Initial doxygenation.
1562
8ee5b538
JD
15632006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1564
1565 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
1566 declared after the %merge. This continues the effort of the previous
1567 patch.
8ee5b538
JD
1568 * src/reader.c (get_merge_function): Don't set the merger type yet.
1569 (record_merge_function_type): New function for setting the merger type
1570 and checking for clashes.
1571 (grammar_current_rule_merge_set): Set the location of the %merge for
1572 the current rule.
1573 (packgram): Invoke record_merge_function_type for each rule now that
1574 all symbol type declarations have been parsed.
1575 * src/reader.h (merger_list.type_declaration_location): New member
1576 storing the location of the first %merge from which the type for this
1577 merging function was derived.
1578 * src/symlist.h (symbol_list.merger_declaration_location): New member
1579 storing the location of a rule's %merge, if any.
1580 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1581 declared later): New test to catch the error fixed by the above patch.
1582
ffa4ba3a
JD
15832006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1584
1585 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
1586 declarations appear after the rules. Discussed at
1587 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1588 and
1589 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1590 Don't mistake the type of $$ in a midrule to be that of its parent
1591 rule's $$.
ffa4ba3a
JD
1592 * src/reader.c (grammar_current_rule_end): Don't invoke
1593 grammar_rule_check yet since not all symbol declarations may have been
1594 parsed yet.
1595 (grammar_midrule_action): Likewise.
1596 Don't record whether the midrule's $$ has been used yet since actions
1597 haven't been translated yet.
1598 Record the midrule's parent rule and its RHS index within the parent
1599 rule.
1600 (grammar_current_rule_action_append): Don't translate the action yet
1601 since not all symbol declarations may have been parsed yet and, thus,
1602 warnings about types for $$, $n, @$, and @n can't be reported yet.
1603 (packgram): Translate the action and invoke grammar_rule_check now that
1604 all symbol declarations have been parsed.
1605 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1606 after parsing the entire grammar file, the symbol list here in the case
1607 of a midrule is actually the midrule's empty RHS, so reference its
1608 parent rule's RHS where necessary.
1609 On the other hand, now that you can already know it's a midrule, you
1610 aren't forced to think $$ has the same type as its parent rule's $$.
1611 (handle_action_at): In the case of a midrule, reference the parent rule
1612 where necessary.
1613 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1614 members.
1615 (symbol_list_length): Now that this is invoked after all rules have
1616 been parsed, a NULL symbol (rather than a NULL symbol list node)
1617 terminates a rule. symbol_list_print already does this correctly.
1618 * src/symlist.h (symbol_list.midrule_parent_rule,
1619 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1620 remember their relationships with their parents.
1621 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1622 fixed by the above patch.
1623 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1624 implementing...
1625 (Unused values): ... this old test case and...
1626 (Unused values before symbol declarations): ... this new test case.
1627 This one is the same as `Unused values' except that all symbol
1628 declarations appear after the rules in order to catch the rest of the
1629 errors fixed by the above patch.
1630
e256e17f
JD
16312006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1632
300a1930
JD
1633 More cleanup.
1634 * src/reader.c (current_rule): Declare it static since it's no longer
1635 used outside this file.
1636 (grammar_current_rule_action_append): Remove redundant arguments from
1637 translate_rule_action invocation.
1638 * src/reader.h (current_rule): Remove this unused extern.
1639 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1640 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 1641
381ecb06
JD
16422006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1643
1644 Clean up yesterday's patch.
1645 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1646 to...
1647 * src/reader.c (grammar_current_rule_action_append): ... here for
1648 consistency with grammar_current_rule_symbol_append.
1649 * tests/regression.at (Braced code in declaration in rules section):
1650 Make yyerror and yylex static as usual.
1651
4210cd0b
JD
16522006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1653
1654 Fix bug that mistakes braced code in a declaration in the rules section
1655 to be a rule action. Mentioned at
1656 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1657 * src/scan-gram.l: Move midrule action detection from the start of the
1658 scanning of any braced code to...
1659 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1660 action. For readability, use $2 and @2 rather than the equivalent
1661 global variables.
1662 * tests/regression.at (Braced code in declaration in rules section):
1663 New test to catch the error fixed by the above patch.
1664
1665 Work on code readability some.
1666 * src/scan-code.l (current_rule): Get rid of this misleading and
1667 redundant declaration: it's actually extern'ed in reader.h.
1668 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1669 translate_action): Add a rule argument and use it instead of the global
1670 current_rule.
1671 (translate_rule_action): This already receives current_rule through an
1672 argument, so pass it on to translate_action instead of assigning
1673 current_rule to current_rule.
1674 (translate_symbol_action, translate_code): Pass rule = NULL to
1675 translate_action.
1676
34f98f46
JD
16772006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1678
1679 Rename %before-definitions to %start-header and %after-definitions to
1680 %end-header. Don't use these declarations to separate pre-prologue
1681 blocks from post-prologue blocks. Add new order-independent
1682 declarations %before-header and %after-header as alternatives to the
1683 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1684 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1685 * NEWS (2.3+): Update for these changes.
1686 * data/glr.c (b4_before_definitions): Update to...
1687 (b4_start_header): ... this.
1688 (b4_after_definitions): Update to...
1689 (b4_end_header): ... this.
1690 * data/glr.cc: Likewise.
1691 * data/lalr1.cc: Likewise.
1692 * data/yacc.c: Likewise.
1693 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1694 prologue blocks with %*-header declarations.
1695 (Calc++ Parser): Likewise.
1696 (Bison Declaration Summary): Update names.
1697 (Bison Symbols): Update description.
1698 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1699 (PERCENT_END_HEADER): ... this.
1700 (PERCENT_BEFORE_DEFINITIONS): Update to...
1701 (PERCENT_START_HEADER): ... this.
1702 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1703 (declaration): Update token names and m4 macro names.
1704 When parsing %end-header and %start-header, invoke translate_code
1705 before muscle_code_grow, and no longer set global booleans to remember
1706 whether these declarations have been seen.
1707 Parse new %after-header and %before-header.
1708 * src/reader.c (before_definitions, after_definitions): Remove.
1709 (prologue_augment): Accept a new bool argument to specify whether to
1710 augment the pre-prologue or post-prologue.
1711 * src/reader.h (before_definitions, after_definitions): Remove these
1712 extern's.
1713 (prologue_augment): Add new bool argument.
1714 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
1715 (PERCENT_END_HEADER): ... this.
1716 (PERCENT_BEFORE_DEFINITIONS): Update to...
1717 (PERCENT_START_HEADER): ... this.
1718 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1719 * tests/actions.at (Printers and Destructors): Update names.
1720
31b2b07e
JD
17212006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1722
1723 Add comparison operators for C++ location classes. Discussed at
1724 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
1725 * data/c++.m4 (b4_define_location_comparison): New boolean %define
1726 declaration indicating whether filename_type has an operator==. If
1727 filename_type is `std::string', it defaults to `1', `0' otherwise.
1728 * data/location.cc: Iff b4_define_location_comparison is `1', add
1729 operator== and operator!= for class position and for class location.
1730
1731 Some minor fixes.
1732 * src/scan-action.l: Remove unused file.
1733 * src/symtab.c (symbol_printer_set): Use printer_location not
1734 destructor_location.
1735 * src/symtab.h (struct symbol): Replace incorrect source comment for
1736 printer members.
1737 * tests/input.at (Incompatible Aliases): Update output with correct
1738 printer location.
1739
9bc0dd67
JD
17402006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1741
1742 Don't put the pre-prologue in the header file. For the yacc.c code
1743 file and the glr.c header and code files, move the pre-prologue before
1744 the token definitions. Add new %before-definitions and
1745 %after-definitions to declare code that will go in both the header file
1746 and code file. Discussed at
1747 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
1748 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
1749 and
1750 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
1751 * NEWS (2.3+): Describe these changes.
1752 * data/glr.c (b4_pre_prologue): Move from within to before...
1753 (b4_shared_declarations): ... this.
1754 Add new b4_before_definitions before b4_token_enums.
1755 Add new b4_after_definitions at the end.
1756 * data/glr.cc (b4_pre_prologue): Replace with...
1757 (b4_before_definitions): ... this in the header file.
1758 (b4_after_definitions): New near the end of the header file.
1759 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
1760 code file right before including the header file.
1761 (b4_before_definitions): New in the previous position of
1762 b4_pre_prologue in the header file.
1763 (b4_after_definitions): New near the end of the header file.
1764 * data/yacc.c: Clean up some m4 quoting especially in the header file.
1765 (b4_token_enums_defines): In the code file, move to right before
1766 YYSTYPE for consistency with the header file.
1767 (b4_before_definitions): New right before b4_token_enums_defines in
1768 both the header and code file.
1769 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
1770 header and code file.
1771 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
1772 of prologues for %union dependencies.
1773 (Bison Declaration Summary): In %defines description, mention the
1774 effect of %before-definitions and %after-definitions on the header
1775 file.
1776 (Calc++ Parser): Forward declare driver in a %before-definitions rather
1777 than in the pre-prologue so that make check succeeds.
1778 (Bison Symbols): Add entries for %before-definitions and
1779 %after-definitions.
1780 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
1781 %before-definitions.
1782 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
1783 (declaration): Parse those declarations and append to
1784 b4_before_definitions and b4_after_definitions, respectively.
1785 * src/reader.c (before_definitions, after_definitions): New bools to
1786 track whether those declarations have been seen.
1787 (prologue_augment): Add to the post-prologue if %union,
1788 %before-definitions, or %after-definitions has been seen.
1789 * src/reader.h (before_definitions, after_definitions): New extern's.
1790 * src/scan-gram.l: Scan the new declarations.
1791 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
1792 prologue block in a %before-definitions or a %after-definitions based
1793 on whether the %union is declared.
1794 * tests/regression.at (Early token definitions with --yacc, Early token
1795 definitions without --yacc): Move tests for token definitions into the
1796 post-prologue since token names are no longer defined in the
1797 pre-prologue.
1798
203b9274
AD
17992006-06-20 Akim Demaille <akim@epita.fr>
1800
1801 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1802 (symbol_get): Use it.
1803 * src/parse-gram.y: Use it.
1804
a7ee59cf
JD
18052006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1806
1807 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1808 build succeeds when configured with --enable-gcc-warnings.
1809
5a2baae7
PE
18102006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1811
33ad1a9c
PE
1812 * src/parse-gram.y (char_name): New function.
1813 (CHAR, STRING, string_content): For %printer, properly escape.
1814 (ID): Prefer fputs to fprintf.
1815 (id): Reindent to be consistent with other rules.
1816 Properly quote char.
1817
5a2baae7
PE
1818 The Translation Project changed its way of publishing translations
1819 to maintainers. I haven't received any responses to my request
1820 for supporting the old way, or for documenting the new way. I
1821 have modified 'bootstrap' to use screen scraping
1822 (in this case, HTML scraping). This is unreliable and inelegant,
1823 but I don't see any better way. Yuck.
1824 * bootstrap (TP_URL, WGET_COMMAND): New vars.
1825 (get_translations): New function, which uses HTML scraping to
1826 deduce locations of latest translations.
1827 Use this function to grab both bison and bison-runtime .po files.
1828 Don't bother priming the pump for the runtime-po domain any more,
1829 as it's now translated better than bison is.
1830
58d7a1a1
AD
18312006-06-19 Akim Demaille <akim@epita.fr>
1832
1833 * src/scan-gram.l: No longer "parse" things after `%union' until
1834 `{'. Rather, return a single "%union" token.
1835 No longer make symbols: return strings, and leave the conversion
1836 to symbols to the parser.
1837 (SC_PRE_CODE, token_type): Remove.
1838 * src/parse-gram.y (%union): New field `character'.
1839 Sort tokens.
1840 (CHAR): New token.
1841 (ID, ID_COLON): Now that the scanner no longer makes them
1842 identifiers, adjust all uses to invoke symbol_get.
1843 (id_colon): New, wraps the conversion from string to symbol.
1844 (%union): Accept a possible union_name.
1845 (symbol): Now can be a char.
1846 * data/c.m4 (b4_union_name): Leave a default value.
1847 * data/glr.c, data/yacc.c: Use it.
1848
b931235e
JD
18492006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1850
1851 For associating token numbers with token names for "yacc.c", don't use
1852 #define statements unless `--yacc' is specified; always use enum
1853 yytokentype. Most important discussions start at:
1854 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1855 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1856 and
1857 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1858 * NEWS (2.3+): Mention.
1859 * data/c.m4 (b4_yacc_if): New.
1860 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1861 token #define's.
1862 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1863 on token name definitions.
1864 * src/getargs.c (usage): Capitalize `Yacc' in English.
1865 * src/output.c (prepare): Define b4_yacc_flag.
1866 * tests/regression.at (Early token definitions): Test that tokens names
1867 are defined before the pre-prologue not just before the post-prologue.
1868 Remove this test case and copy to...
1869 (Early token definitions with --yacc): ... this to test #define's.
1870 (Early token definitions without --yacc): ... and this to test enums.
1871
9e6e7ed2
PE
18722006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1873
1874 * NEWS: Reword the post-2.3 change to not be so optimistic about
1875 removing the old "look-ahead" spelling.
1876 Update previous look-ahead/lookahead change reports.
1877 * REFERENCES: look-ahead -> lookahead (since that's
1878 what he actually wrote).
1879 * doc/refcard.tex: look ahead -> lookahead,
1880 look-ahead -> lookahead
1881
742e4900
JD
18822006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1883
1884 For consistency, use `lookahead' instead of `look-ahead' or
1885 `look_ahead'. Discussed starting at
1886 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1887 and then at
1888 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1889 * NEWS: For the next release, note the change to `--report'.
1890 * TODO, doc/bison.1: Update English.
1891 * doc/bison.texinfo: Update English.
1892 (Understanding Your Parser, Bison Options): Document as
1893 `--report=lookahead' rather than `--report=look-ahead'.
1894 * src/conflicts.c: Update English in comments.
1895 (lookahead_set): Rename from look_ahead_set.
1896 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1897 (resolve_sr_conflict): Rename local look_ahead_tokens to
1898 lookahead_tokens, and update other uses.
1899 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1900 count_rr_conflicts, conflicts_free): Update uses.
1901 * src/getargs.c (report_args): Move "lookahead" before alternate
1902 spellings.
1903 (report_types): Update uses.
1904 (usage): For `--report' usage description, state `lookahead' spelling
1905 rather than `look-ahead'.
1906 * src/getargs.h (report.report_lookahead_tokens): Rename from
1907 report_look_ahead_tokens.
1908 * src/lalr.c: Update English in comments.
1909 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1910 (state_lookahead_tokens_count): Rename from
1911 state_look_ahead_tokens_count.
1912 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1913 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1914 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1915 Update other uses.
1916 Update English in output.
1917 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1918 * src/print.c: Update English in comments.
1919 (lookahead_set): Rename from look_ahead_set.
1920 (print_reduction): Rename argument lookahead_token from
1921 look_ahead_token.
1922 (print_core, state_default_rule, print_reductions, print_results):
1923 Update uses.
1924 * src/print_graph.c: Update English in comments.
1925 (print_core): Update uses.
1926 * src/state.c: Update English in comments.
1927 (reductions_new): Update uses.
1928 (state_rule_lookahead_tokens_print): Rename from
1929 state_rule_look_ahead_tokens_print, and update other uses.
1930 * src/state.h: Update English in comments.
1931 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1932 (state_rule_lookahead_tokens_print): Rename from
1933 state_rule_look_ahead_tokens_print.
1934 * src/tables.c: Update English in comments.
1935 (conflict_row, action_row): Update uses.
1936 * tests/glr-regression.at
1937 (Incorrect lookahead during deterministic GLR,
1938 Incorrect lookahead during nondeterministic GLR): Rename
1939 print_look_ahead to print_lookahead.
1940 * tests/torture.at: Update English in comments.
1941 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1942 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1943 (Many lookahead tokens): Update uses.
1944 * data/glr.c: Update English in comments.
1945 * lalr1.cc: Likewise.
1946 * yacc.c: Likewise.
1947 * src/conflicts.h: Likewise.
1948 * src/lalr.h: Likewise.
1949 * src/main.c: Likewise.
1950 * src/output.c: Likewise.
1951 * src/parse-gram.c: Likewise.
1952 * src/tables.h: Likewise.
1953 * tests/calc.at: Likewise.
1954
3c40d0b5
JD
19552006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1956
1957 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1958
5d278082
PE
19592006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1960
1961 * TODO: Add request from Nelson H. F. Beebe to be able to install
1962 Bison without installing the yacc script.
1963
9e668899
JD
19642006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1965
1966 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1967 and yytext if they're already #define'd.
1968 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1969 * src/scan-code-c.c: ... here.
1970 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1971 <config.h>.
1972
0c8e079f
JD
19732006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1974
1975 Get Bison to build again when configured with --enable-gcc-warnings.
1976 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1977 missing #include's.
1978 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1979 loc argument as it shadows a global.
1980 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1981 invocation.
1982
1983 * src/.cvsignore: Add scan-code.c.
1984
2346344a
AD
19852006-06-07 Akim Demaille <akim@epita.fr>
1986
1987 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1988 to...
1989 * src/scan-code.l: here.
1990 * tests/input.at (Torturing the Scanner): Fix another location
1991 error.
1992
4862bdfd
AD
19932006-06-07 Akim Demaille <akim@epita.fr>
1994
1995 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1996
e9071366
AD
19972006-06-06 Akim Demaille <akim@epita.fr>
1998
1999 Extract the parsing of user actions from the grammar scanner.
2000 As a consequence, the relation between the grammar scanner and
2001 parser is much simpler. We can also split "composite tokens" back
2002 into simple tokens.
2003 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
2004 * src/scan-gram.l (add_column_width, adjust_location): Move to and
2005 rename as...
2006 * src/location.h, src/location.c (add_column_width)
2007 (location_compute): these.
2008 Fix the column count: the initial column is 0.
2009 (location_print): Be robust to ending column being 0.
2010 * src/location.h (boundary_set): New.
2011 * src/main.c: Adjust to scanner_free being renamed as
2012 gram_scanner_free.
2013 * src/output.c: Include scan-code.h.
2014 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
2015 Use boundary_set.
2016 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
2017 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
2018 which is now, again, a separate token.
2019 Adjust all dependencies.
2020 Whereever actions with $ and @ are used, use translate_code.
2021 (action): Remove this nonterminal which is now useless.
2022 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
2023 (grammar_current_rule_action_append): Use translate_code.
2024 (packgram): Bound check ruleno, itemno, and rule_length.
2025 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
2026 (last_string, last_braced_code_loc, max_left_semantic_context)
2027 (scanner_initialize, scanner_free, scanner_last_string_free)
2028 (gram_out, gram_lineno, YY_DECL_): Move to...
2029 * src/scan-gram.h: this new file.
2030 (YY_DECL): Rename as...
2031 (GRAM_DECL): this.
2032 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
2033 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2034 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2035 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2036 Move these declarations, and...
2037 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
2038 these to...
2039 * src/flex-scanner.h: this new file.
2040 * src/scan-gram.l (rule_length, rule_length_overflow)
2041 (increment_rule_length): Remove.
2042 (last_braced_code_loc): Rename as...
2043 (gram_last_braced_code_loc): this.
2044 Adjust to the changes of the parser.
2045 Move all the handling of $ and @ into...
2046 * src/scan-code.l: here.
2047 * src/scan-gram.l (handle_dollar, handle_at): Remove.
2048 (handle_action_dollar, handle_action_at): Move to...
2049 * src/scan-code.l: here.
2050 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
2051 scan-code.h, scan-code-c.c, scan-gram.h.
2052 (EXTRA_bison_SOURCES): Add scan-code.l.
2053 (BUILT_SOURCES): Add scan-code.c.
2054 (yacc): Be robust to white spaces.
2055
2056 * tests/conflicts.at, tests/input.at, tests/reduce.at,
2057 * tests/regression.at: Adjust the column numbers.
2058 * tests/regression.at: Adjust the error message.
7891a7c4 2059
184e42f0
JD
20602006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2061
2062 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2063 Use Akim's wording from
2064 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
2065
7891a7c4
JD
20662006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2067
2068 Between Bison releases, manually append `+' to the previous Bison
2069 release number, and use that as a signal to automatically print the
2070 ChangeLog's CVS Id keyword from --version. Discussed starting at
2071 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
2072 * ChangeLog: Add Id header.
2073 * configure.ac (AC_INIT): Append `+' to `2.3'.
2074 * src/.cvsignore: Add revision.c.
2075 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
2076 (BUILT_SOURCES): Add revision.c.
2077 (revision.c): New target rule. This file defines a new global variable
2078 named revision. It initializes it with either the Id from ChangeLog
2079 or, if VERSION doesn't contain `+', with the empty string.
2080 * src/getargs.c (version): Print the value of revision.
2081 * src/revision.h: Extern revision.
2082
4ad3ed84
PE
20832006-06-05 Paul Eggert <eggert@cs.ucla.edu>
2084
2085 * NEWS: Version 2.3.
2086 * configure.ac (AC_INIT): Likewise.
2087
02103984
PE
20882006-05-30 Paul Eggert <eggert@cs.ucla.edu>
2089
2090 * data/glr.c (YYRECOVERING): Define to be a function-like macro
2091 with no arguments, not as an object-like macro. This is for
2092 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
2093 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
2094 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
2095 Document this.
2096
2c08afa5
JD
20972006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
2098
2099 * src/getargs.c (usage): Back out yesterday's modification of the
2100 --help output so that we don't have to wait for translation before
2101 releasing 2.3.
2102
6077da58
PE
21032006-05-29 Paul Eggert <eggert@cs.ucla.edu>
2104
2105 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
2106 Problem reported by Akim Demaille.
2107
2a26b6c2
JD
21082006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2109
2110 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2111
aefef0d6
PE
21122006-05-26 Paul Eggert <eggert@cs.ucla.edu>
2113
2114 * data/yacc.c (yy_reduce_print): Omit trailing white space in
2115 generated source code. Problem reported by Frans Englich in
2116 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
2117
fcd8e201
PE
21182006-05-22 Paul Eggert <eggert@cs.ucla.edu>
2119
2120 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
2121 shell, not within 'make', so that 'make' by an ordinary builder
2122 (using GNU make) does not worry about configuring gzip. This also
2123 works around a bug reported independently by Keith Thompson and by
2124 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
2125 stderr rather than stdout, messing up the build logs.
2126
7b5cdcbd
JD
21272006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2128
2129 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2130 to make sure that YYID will never be unused. This fixes a 'make
2131 maintainer-check' failure caused by the recent changes to the 'Trivial
2132 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2133 not used.
2134 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2135
5ad0a449
JD
21362006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2137
2138 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2139 state before an empty RHS is always resolved here. Only the location
2140 of that state is guaranteed to be resolved, and that's enough. This
2141 fixes the remaining bug reported by Derek M. Jones in
2142 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2143 * tests/glr-regression.at (Uninitialized location when reporting
2144 ambiguity): Test the above case.
2145 Also, the embedded comments in this test case claim it checks the case
2146 of an empty RHS that has inherited the initial location. However, the
2147 corresponding LHS was already resolved, so yyresolveLocations didn't
2148 actually have reason to modify it. Fix this by forcing
2149 nondeterministic operation at the beginning of the parse.
2150
50cce58e
PE
21512006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2152
2153 * data/c.m4 (b4_yy_symbol_print_generate):
2154 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2155 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2156 of the bugs reported today by Derek M Jones in
2157 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2158 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2159 defined to be a type name without parens or brackets.
2160 (Location Type): Similarly for YYLTYPE.
2161 * tests/regression.at (Trivial grammars): Put in a test for this
2162 bug that will be caught by 'make maintainer-check' (though not,
2163 alas, by 'make check' unless your compiler is picky).
2164
ab8d9dc5
PE
21652006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2166
0d2c8934 2167 * NEWS: Version 2.2.
ab8d9dc5
PE
2168 * configure.ac (AC_INIT): Likewise.
2169
9138c575
JD
21702006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2171
2172 * data/glr.c (yyreportTree): Make room in yystates for the state
2173 preceding the RHS. This fixes the segmentation fault reported by Derek
2174 M. Jones in
2175 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2176 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2177 to the user. Reported for yyreportTree by Derek M. Jones later in the
2178 same thread.
2179 * THANKS: Add Derek M. Jones.
2180 Update my email address.
2181 Fix typo in Steve Murphy's name.
2182
276f48df
PE
21832006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2184
d6645148
PE
2185 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2186 checking against YYLAST that caused the parser to miss a potential
2187 alternative in its diagnostic.
2188 Problem reported by Maria Jose Moron Fernandez in
2189 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2190 * data/lalr1.cc (yysyntax_error_): Likewise.
2191 * data/yacc.c (yysyntax_error): Likewise.
2192 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2193 tokens, in case we run into an older C compiler.
2194 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2195 Use them to check for the off-by-one error fixed above.
2196
276f48df
PE
2197 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2198 YYSIZE_T, not size_t.
2199 * tests/regression.at (Trivial grammars): New test, to catch
2200 the error fixed by the above patch.
2201
cd8b5791
AD
22022006-05-14 Akim Demaille <akim@lrde.epita.fr>
2203
2204 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2205 scheme.
2206 Reported by Steve Murphy.
2207
34376418
AD
22082006-05-14 Akim Demaille <akim@lrde.epita.fr>
2209
2210 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2211 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2212
327afc7c
AD
22132006-05-14 Akim Demaille <akim@lrde.epita.fr>
2214
2215 Implement --trace=m4.
2216 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2217 * src/output.c (output_skeleton): When set, pass -dV to m4.
2218
2219 Factor the handling of flags in m4.
2220 * src/output.c (prepare): Rename the muscle names debug, defines,
2221 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2222 * data/c.m4: Adjust.
2223 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2224 Use b4_define_flag_if to define other b4_FLAG_if macros.
2225 (b4_location_if): As a consequence, rename as...
2226 (b4_locations_if): this, for consistency.
2227 Adjust all the skeletons.
2228
ba9ecd19
AD
22292006-05-14 Akim Demaille <akim@lrde.epita.fr>
2230
2231 * etc/bench.pm: Shorten bench names.
2232
4e83ea15
AD
22332006-05-14 Akim Demaille <akim@lrde.epita.fr>
2234
2235 * src/output.h, src/output.c (error_verbose): Move to...
2236 * src/getargs.h, src/getargs.c: here.
2237 Sort the flags.
2238 Adjust dependencies.
2239
6e93d810
PE
22402006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2241
2242 * data/c.m4 (b4_copyright): Put the special exception for Bison
2243 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
2244 uses changed. Suggested by Akim Demaille. Also, wrap the
2245 copyright notice, in case it is longer than 80 columns. Replace
2246 comma by newline after title.
6e93d810 2247
eaea13f5
PE
22482006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2249
2250 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2251 incompatibility, not a bug. Mention that it wasn't fixed as of
2252 flex 2.5.33.
2253
3cf084ec
AD
22542006-05-11 Akim Demaille <akim@lrde.epita.fr>
2255
2256 * examples/extexi: Enforce the precedence of concatenation over
2257 >>.
0a9f1c7d 2258 Reported by Tommy Nordgren.
3cf084ec 2259
32c96bd7
AD
22602006-05-11 Akim Demaille <akim@lrde.epita.fr>
2261
2262 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2263 with the member "token".
f94705b2 2264 Reported by Martin Nylin.
32c96bd7 2265
eaea13f5
PE
22662006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2267
2268 * data/glr.c: Switch to Bison 2.2 special-exception language in
2269 the copyright notice. Use more-regular format for titles and
2270 copyright notices.
2271 * data/glr.cc: Likewise.
2272 * data/location.cc: Likewise.
2273 * data/yacc.cc: Likewise.
2274 * doc/bison.texinfo (Conditions): Document this.
2275 * NEWS: likewise. Upgrade version to 2.2.
2276
6e2d1146
AD
22772006-04-27 Akim Demaille <akim@lrde.epita.fr>
2278
2279 * data/glr.cc: Remove dead code.
2280
47671055
PE
22812006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2282
2283 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2284 that variable and the line breaks the bootstrap. Problem reported
2285 by Juan M. Guerrero.
2286
ed2e6384
AD
22872006-04-24 Akim Demaille <akim@lrde.epita.fr>
2288
2289 * doc/bison.texinfo (Multiple start-symbols): New.
2290
3cedc2dc
AD
22912006-04-24 Akim Demaille <akim@lrde.epita.fr>
2292
2293 * etc/README, etc/bench.pl: New.
2294
b2ddc3f3
AD
22952006-04-03 Akim Demaille <akim@lrde.epita.fr>
2296
2297 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2298 rule.
2299 Reported by Mickael Labau.
2300 * tests/input.at (Torturing the Scanner): Test it.
2301
91e3ac9a
PE
23022006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2303
2304 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2305 Problem reported by Bob Rossi.
2306
23072006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2308
2309 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2310 and didn't really work.
2311 For the index, use @ifnotinfo, not @iftex.
2312 Minor cleanups of spacing and terminology.
2313
5cf61e93
AD
23142006-03-12 Akim Demaille <akim@lrde.epita.fr>
2315
2316 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2317 of AT_NAME_PREFIX when %name-prefix is not used.
2318
aa08666d
AD
23192006-03-12 Akim Demaille <akim@lrde.epita.fr>
2320
2321 Apply --prefix to C++ skeletons too: they change the namespace.
2322 The test suite already exercize these cases.
2323 * data/c++.m4 (b4_namespace): New.
2324 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2325 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2326 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2327 * doc/bison.texinfo: Document it.
2328 (Option Cross Key): Use @multitable in all formats. It looks
2329 nicer, even in TeX outputs.
2330 (Rules): Use the same code whatever the output type is.
2331 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2332 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2333 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 2334
45567173
AD
23352006-03-10 Akim Demaille <akim@lrde.epita.fr>
2336
2337 * TODO: Remove dead items.
2338
e9d8f881 23392006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
2340
2341 * doc/FAQ: Remove, merged into...
2342 * doc/bison.texinfo (FAQ): this.
2343 * doc/Makefile.am (EXTRA_DIST): Adjust.
2344
c095d689
AD
23452006-03-10 Akim Demaille <akim@lrde.epita.fr>
2346
2347 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2348 even if empty.
2349 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2350 * doc/bison.texinfo (Calc++ Scanner): Use it.
2351
6e0f8287
PE
23522006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2353
2354 Fix two nits reported by twlevo, plus one more that I discovered.
2355
2356 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2357 this is the usual Bison style.
2358 * src/location.h (location_print): Likewise.
2359
2360 * src/reader.h (token_name): Likewise.
2361
d6b771c3
PE
23622006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2363
2364 Fix some nits reported by twlevo.
2365 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2366 and "POSIX". Use more-modern syntax for URLs. Mention C++
2367 and ask for Java. Don't hardwire OS version numbers. Add
2368 copyright notice.
2369 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2370 * src/conflicts.c (solved_conflicts_obstack): Now static.
2371
1e137b71
JD
23722006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2373
2374 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2375 page. Say "you can use it" not "you may use it" as on the web page;
2376 we're describing capabilities not granting permission.
2377
73f2e47e
PE
23782006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2379
6d05403d
PE
2380 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2381 shadowing warnings. Use usual patter for iterating through RHS.
2382 * tests/glr-regression.at
2383 (Uninitialized location when reporting ambiguity):
2384 Modify yylex so that it uses its argument, rather than trying
2385 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2386 const char -> char const.
2387
73f2e47e
PE
2388 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2389 Don't use tabs inside commands; it messes up 'ps'.
2390 Problem reported by twlevo.
2391
8710fc41
JD
23922006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2393
2394 * tests/glr-regression.at (Uninitialized location when reporting
2395 ambiguity): New test case.
2396 * data/glr.c (yyresolveLocations): New function, which uses
2397 YYLLOC_DEFAULT.
2398 (yyresolveValue): Invoke yyresolveLocations before reporting an
2399 ambiguity.
2400 * doc/bison.texinfo (Default Action for Locations): Note
2401 YYLLOC_DEFAULT's usage for ambiguity locations.
2402 (GLR Semantic Actions): Cross-reference those notes.
2403
ae952af2
JD
24042006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2405
2406 * tests/glr-regression.at (Leaked semantic values when reporting
2407 ambiguity): Remove unnecessary union and type declarations.
2408 (Leaked lookahead after nondeterministic parse syntax error): New test
2409 case.
2410 * data/glr.c (yyparse): Check for zero stacks remaining before
2411 attempting to shift the lookahead so that you don't lose it.
2412
35ee866a
JD
24132006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2414
2415 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2416 * tests/glr-regression.at (Leaked semantic values when reporting
2417 ambiguity): New test case.
2418 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2419 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2420 now unnecessary yystackp parameter.
2421 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2422 destructors can be called.
2423
2424 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2425 in existing testcases.
2426
520181ab
JD
24272006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2428
2429 Don't leak semantic values for parent RHS when a user action cuts the
2430 parser, and clean up related code a bit.
2431 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
2432 cuts parse): Rename to...
2433 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
2434 for leaked parent RHS values.
2435 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2436 between an unresolved state (non-empty chain of semantic options) and
2437 an incomplete one (signaled by an empty chain).
ae952af2 2438 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
2439 successfully or unsuccessfully resolved yyGLRState to...
2440 (yyresolveValue): ... here so that yyresolveValue always leaves a
2441 yyGLRState with consistent data and thus is easier to understand.
2442 Remove the yyvalp and yylocp parameters since they are always just
2443 taken from the yys parameter. When reporting a discarded merged value
2444 in debugging output, note that it is incompletely merged. Document the
2445 interface.
2446 (yyresolveAction): If resolving any of the RHS states fails, destroy
2447 them all rather than leaking them. Thus, as long as user actions are
2448 written to clean up the RHS correctly, yyresolveAction always cleans up
2449 the RHS of a semantic option. Document the interface.
2450
18d9185c
PE
24512006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2452
2453 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2454 led to a segmentation fault in GNU Pascal. Problem reported
2455 by Waldek Hebisch.
2456
841a7737
JD
24572006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2458
2459 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2460 mid-rule action inside a nonterminal symbol in order to declare a
2461 destructor for its semantic value.
2462
fc3f467f
PE
24632006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2464
2465 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2466 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2467 __cplusplus && ! defined _STDLIB_H && !
2468 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2469 defined free))]: Include <stdlib.h> rather than rolling our own
2470 declarations of malloc and free, to avoid problems with
2471 incompatible declarations (using 'throw') C++'s stdlib.h. This
2472 should fix Debian bug 340012
2473 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2474 reported by Guillaume Melquiond.
2475
a3af26dd
PE
24762006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2477
4d7bc38c
PE
2478 * NEWS: Clarify symbols versus types in unused-value warnings.
2479
a3af26dd
PE
2480 * configure.ac (AC_INIT): Bump version number.
2481
4e26c69e
PE
24822006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2483
2484 * NEWS: Version 2.1a.
2485 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2486 since C99 requires this.
2487
498e897c
PE
24882006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2489
2490 * m4/c-working.m4: New file.
2491 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2492
57bb17ca
PE
24932006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2494
2495 * Makefile.maint: Merge from coreutils.
2496
0be105dc
PE
24972006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2498
2499 More portability fixes for problems summarized by Nelson H. F. Beebe.
2500
2501 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2502 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2503 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2504 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2505 messes up because C++ code is compiled in 32-bit mode but linked
2506 in 64-bit mode.
2507
6fc0c024
PE
25082006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2509
2510 More portability fixes for problems summarized by Nelson H. F. Beebe.
2511
7870f699
PE
2512 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2513 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2514
6fc0c024
PE
2515 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2516 nodist_PROGRAMS, since we don't need to actually compile the
2517 example if we're just doing a plain 'make'. This avoids bothering
2518 the installer unnecessarily about problems due to weird C++
2519 compilers.
2520
fe6c2fde
PE
25212006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2522
2523 More portability fixes for problems summarized by Nelson H. F. Beebe.
2524
2525 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2526 than #include "...", and compile with -I'.'. The old method was
2527 not portable, according to Posix and the C standard, and it does
2528 not work with Sun C 5.7, where previous #line directives affect
2529 the working directory used in later #include "..." directives.
2530
927b425b
JMG
25312006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2532
2533 Various DJGGP specific issues in /djgpp
2534
d9735e9e
PE
25352006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2536
2537 More portability fixes for problems summarized by Nelson H. F. Beebe.
2538
2539 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2540 '#include <map>' works and that you can apply ++ to iterators.
2541
5a6755af
PE
25422006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2543
67a0dc4f
PE
2544 Work around portability problems summarized by Nelson H. F. Beebe in
2545 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2546
8c86f0ef
PE
2547 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2548 that '#include <string>' works.
2549
de35dd59
PE
2550 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2551 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2552 "warning: sorry: semantics of inline function static data `const
2553 unsigned char translate_table[262]' are wrong (you'll wind up with
2554 multiple copies)".
2555
67a0dc4f
PE
2556 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2557 or, xor to not_, and_, or_, and xor_, respectively. This works
2558 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2559 random system header somewhere that includes the equivalent of
2560 <iso646.h>.
2561
5a6755af
PE
2562 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2563 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 2564 Suite Version 2.0.
5a6755af 2565
3f001415
JD
25662006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2567
2568 During deterministic GLR operation, user actions should be able to
2569 influence the parse by changing yychar. To make this easier to fix and
2570 to make glr.c easier to evolve in general, don't maintain yytoken in
2571 parallel with yychar; just compute yytoken when needed.
2572 * tests/glr-regression.at (Incorrect lookahead during deterministic
2573 GLR): Check that setting yychar in a user action has the intended
2574 effect.
2575 * data/glr.c (yyGLRStack): Remove yytokenp member.
2576 (yyclearin): Don't set *yytokenp.
2577 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2578 yychar rather than *yytokenp to determine the current lookahead.
2579 Compute yytoken locally when needed.
2580 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2581 point to.
2582
2583 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2584 after `--report' documentation.
2585
e2a8c0f5
PE
25862006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2587
2588 * src/parse-gram.y (grammar_declaration): Location of printer
2589 symbol is @1, not list->location. Bug reported by twlevo.
2590 * tests/input.at (Incompatible Aliases): Adjust to above change.
2591
6b702268
PE
25922006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2593
27622431
PE
2594 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2595 all the test at once. This makes the output easier to read in the
2596 normal case.
2597
6b702268
PE
2598 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2599 got from <http://bro-ids.org/download.html>. The bug is that
2600 when two actions appeared in succession, the second one was
2601 scanned before the first one was added to the grammar rule
2602 as a midrule action. Bison then output the incorrect warning
2603 "parse.y:905.17-906.36: warning: unused value: $3".
2604 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2605 associated with a value.
2606 (rhs): Don't invoke grammar_current_rule_action_append.
2607 (action): Invoke it here instead.
2608 * src/reader.c (grammar_midrule_action): Now extern.
2609 (grammar_current_rule_action_append): Don't invoke
2610 grammar_midrule_action; that is now the scanner's job.
2611 * src/reader.h (last_string, last_braced_code_loc):
2612 (grammar_midrule_action): New decls.
2613 * src/scan-gram.l (last_string): Now extern, sigh.
2614 (last_braced_code_loc): New extern variable.
2615 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2616 rule already has an action.
2617 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2618 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2619 Add some tests to check that the above changes fixed the bug.
2620
d40ba6c2
PE
26212006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2622
2623 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2624 All used changed. Check whether the symbol has a destructor,
2625 not whether it is typed.
2626 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2627 that the values are still reported as unused. All line numbers
2628 adjusted.
2629
401aace6
PE
26302006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2631
2632 Work around a bug in bro 0.8, which underparenthesizes its
2633 definition of YYLLOC_DEFAULT.
2634 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2635 their arguments.
2636 * data/lalr1.cc: Likewise.
2637 * data/yacc.cc: Likewise.
2638
06f01bc4
PE
26392006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2640
401aace6
PE
2641 Work around a bug in Pike 7.0, and give the Pike folks a
2642 better way to override the usual int widths.
2643 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2644 user can override the types.
2645 (short): #undef, to work around a bug in Pike 7.0.
2646 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2647 (union yyalloc.yyss): Use yytype_int16 rather than short.
2648 All uses changed.
2649 (yysigned_char): Remove.
2650 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2651 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2652 * tests/regression.at (Web2c Actions): Adjust to above changes.
2653
2654 * src/reader.c (check_and_convert_grammar): New function.
2655 (reader): Close the input file even if something went wrong during
2656 parsing. Minor file descriptor leak reported by twlevo.
2657
06f01bc4
PE
2658 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2659 to pacify gcc -Wswitch-default.
2660 * src/scan-gram.l (adjust_location): Use a default: break; case
2661 to pacify gcc -Wswitch-default.
2662 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2663 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2664 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2665 Move these decls to scan-skel.l, since they don't need to be
2666 visible elsewhere.
2667 * src/scan-skel.l: Accept the above decls.
2668 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2669 is used.
2670
02650b7f
PE
26712006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2672
2673 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2674 since we don't want to insist on a version number at the start
2675 of the changelog every time.
2676 * Makefile.maint: Sync from coreutils a bit better.
2677 (sc_trailing_blank): Renamed from sc_trailing_space.
2678 All uses changed.
2679 (sc_no_if_have_config_h, sc_require_config_h):
2680 (sc_prohibit_assert_without_use): New rules.
2681 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2682 (sc_dd_max_sym_length): Fix leading spaces in rule.
2683 (sc_system_h_headers): Prefix with @.
2684 (sc_useless_cpp_parens, m4-check): Output line numbers.
2685 (changelog-check): Allow version only in head.
2686 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2687 satisfy new Makefile.maint rule.
2688 * data/glr.c: Likewise.
2689 * data/glr.cc: Likewise.
2690 * data/lalr1.cc: Likewise.
2691 * data/yacc.c: Likewise.
2692 * lib/ebitsetv.c: Likewise.
2693 * lib/lbitset.c: Likewise.
2694 * lib/subpipe.c: Likewise.
2695 * lib/timevar.c: Likewise.
2696 * src/system.h: Likewise.
2697 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2698 * djgpp/Makefile.maint: Add copyright notice.
2699 * djgpp/README.in: Likewise.
2700 * djgpp/config.bat: Likewise.
2701 * djgpp/config.site: Likewise.
2702 * djgpp/config_h.sed: Likewise.
2703 * djgpp/djunpack.bat: Likewise.
2704 * djgpp/config.sed: Fix copyright notice to match standard format.
2705 * djgpp/subpipe.h: Likewise.
2706 * lib/bitsetv-print.c: Likewise.
2707 * lib/bitsetv.c: Likewise.
2708 * lib/subpipe.h: Likewise.
2709 * lib/timevar.c: Likewise.
2710 * lib/timevar.h: Likewise.
2711 * djgpp/subpipe.c: Use standard recipe for config.h.
2712 * lib/abitset.c: Likewise.
2713 * lib/bitset.c: Likewise.
2714 * lib/bitset_stats.c: Likewise.
2715 * lib/bitsetv-print.c: Likewise.
2716 * lib/bitsetv.c: Likewise.
2717 * lib/ebitsetv.c: Likewise.
2718 * lib/get-errno.c: Likewise.
2719 * lib/lbitset.c: Likewise.
2720 * lib/subpipe.c: Likewise.
2721 * lib/timevar.c: Likewise.
2722 * lib/vbitset.c: Likewise.
2723 * tests/local.at: Likewise.
2724 * src/scan-gram.l: Don't include verify.h, since system.h does
2725 that for us.
2726 * .x-sc_require_config_h: New file.
2727 * .x-sc_unmarked_diagnostics: New file.
2728
287c78f6
PE
27292006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2730
287c78f6
PE
2731 Be a bit more systematic about using 'abort'.
2732 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
2733 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
2734 Put 'default: abort ();' before some other case, to satisfy older
2735 pedantic compilers.
2736 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2737 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
2738 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
2739 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
2740 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
2741 (get_decision_str, get_orientation_str, get_node_alignment_str):
2742 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
2743 (get_linestyle_str, get_arrowstyle_str): Likewise.
2744 * src/conflicts.c (resolve_sr_conflict):
2745 Use a default case rather than one for the one remaining enum
2746 value, to catch invalid enum values as well.
2747 * src/lalr.c (set_goto_map, map_goto):
2748 Prefer "assert (FOO);" to "if (!FOO) abort ();".
2749 * src/nullable.c (nullable_compute, token_definitions_output):
2750 Likewise.
2751 * src/reader.c (packgram, reader): Likewise.
2752 * src/state.c (transitions_to, state_new, state_reduction_find):
2753 Likewise.
2754 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
2755 (symbol_pack): Likewise.
2756 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
2757 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
2758 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
2759 * src/system.h: Don't include <assert.h>.
2760 (assert): New macro.
2761
2762 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
2763 (Destructor Decl, Parser Function, Pure Calling):
2764 Describe rules for braces inside C code more carefully.
287c78f6 2765
c66dfadd
PE
27662006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2767
c21493b8
PE
2768 Fix some porting glitches found by Nelson H. F. Beebe.
2769 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
2770 compilers that don't understand that abort () does not return.
2771 * src/state.c (transitions_to): Likewise.
2772 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2773 that '#include <cstdlib>' works.
2774 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
2775 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
2776 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
2777 for the benefit of some pre-C99 compilers.
2778
b6e3facf
PE
2779 * bootstrap: Undo changes to gnulib files that autoreconf made.
2780
c66dfadd
PE
2781 Minor fixups to get 'make maintainer-check' to work.
2782 * configure.ac: Don't use -Wnested-externs, as it's incompatible
2783 with the new verify.h implementation.
2784 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
2785 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
2786 * data/yacc.c (YYUSE): Likewise.
2787 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
2788 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
2789 * src/parse-gram.y (declaration): Don't pass a string constant
2790 to a function that expects char *, since GCC might complain
2791 about the constant value.
2792 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
2793 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
2794 before #defining them.
2795 * tests/glr-regression.at
2796 (Incorrectly initialized location for empty right-hand side in GLR):
2797 In yyerror, use the msg arg.
2798 (Corrupted semantic options if user action cuts parse):
2799 (Incorrect lookahead during deterministic GLR):
2800 (Incorrect lookahead during nondeterministic GLR):
2801 Don't name a local var 'index'; it shadows string.h's 'index'.
2802
ed94ef2a
AD
28032006-01-19 Akim Demaille <akim@epita.fr>
2804
2805 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2806 location, not just parts of it.
2807
e9ad4aec
PE
28082006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2809
d6ca7905
PE
2810 * NEWS: Document the fact that multiple %unions are now allowed.
2811 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
2812 * TODO: This feature is now implemented, so remove it from
2813 the wishlist.
d6ca7905 2814
ef1b70e0
PE
2815 * Makefile.maint: Merge with coreutils Makefile.maint.
2816 (CVS_LIST): Use build-aux version if available.
2817 (VERSION_REGEXP): New macro.
2818 (syntax-check-rules): Add sc_no_if_have_config_h,
2819 sc_prohibit_assert_without_use, sc_require_config_h,
2820 sc_useless_cpp_parens.
2821 (sc_obsolete_symbols): Check for O_NDELAY.
2822 (sc_dd_max_sym_length): Track coreutils.
2823 (sc_unmarked_diagnostics): Look in all files, not just *.c.
2824 (sc_useless_cpp_parens): New rule.
2825 (news-date-check): Look for version or today's date.
2826 (changelog-check): Don't require version number near head.
2827 (copyright-check): Use current year instead of hardwiring 2005.
2828 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
2829 (announcement): Add --gpg-key-ID.
2830
2831 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2832 with "file system".
2833
2073ce56 2834 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
2835 array. Problem reported by twlevo.
2836 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2837 * src/lalr.c (build_relations): Rely on new sentinel.
2838 * src/gram.c (gram_free): Adjust to new sentinel.
2839
b7691f15
JD
28402006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2841
2842 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2843 yylookaheadNeeds. All uses updated.
2844 (yysplitStack): Rename local yynewLookaheadStatuses to
2845 yynewLookaheadNeeds.
2846 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2847 GLR): In comments, change `lookahead status' to `lookahead need'.
2848
ddee1b06
PH
28492006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2850
2851 * data/glr.c (yysplitStack): A little stylistic rewrite.
2852
12f4614d
PH
28532006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2854
2855 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2856
32c29292
JD
28572006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2858
2859 * doc/bison.texinfo: Fix some typos.
2860 (GLR Semantic Actions): New subsection discussing special
2861 considerations because GLR semantic actions might be deferred.
2862 (Actions): Mention look-ahead usage of yylval.
2863 (Actions and Locations): Mention look-ahead usage of yylloc.
2864 (Special Features for Use in Actions): Add YYEOF entry and mention it
2865 in the yychar entry.
2866 In the yychar entry, remove mention of the local yychar case (pure
2867 parser) since this is irrelevant information when writing semantic
2868 actions and since it's already discussed in `Bison Symbols' where
2869 yychar is otherwise described as an external variable.
2870 In the yychar entry, don't call it the `current' look-ahead since it
2871 isn't when semantic actions are deferred.
2872 In the yychar and yyclearin entries, add note about deferred semantic
2873 actions.
2874 Add yylloc and yylval entries discussing look-ahead usage.
2875 (Look-Ahead Tokens): When discussing yychar, don't call it the
2876 `current' look-ahead, and do mention yylval and yylloc.
2877 (Error Recovery): Cross-reference `Action Features' when mentioning
2878 yyclearin.
2879 (Bison Symbols): In the yychar entry, don't call it the `current'
2880 look-ahead.
2881 In the yylloc and yylval entries, mention look-ahead usage.
2882
de366a2f 28832006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
2884
2885 * tests/glr-regression.at: Update copyright year to 2006.
2886
bf70fa87
JD
28872006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2888
2889 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2890 use during nondeterministic operation to track which stacks have
2891 actually needed the current lookahead.
2892 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2893 Allocate, deallocate, resize, and otherwise shuffle space for
2894 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2895 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2896 appropriately during nondeterministic operation.
2897 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2898 members to store the current lookahead to be used by the deferred
2899 user action.
2900 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2901 from which the RHS is taken. Set the lookahead members of the new
2902 yySemanticOption according to the lookahead status for stack yyk.
2903 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2904 yyaddDeferredAction.
2905 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2906 members of yySemanticOption before invoking yyuserAction, and then set
2907 them back to their current values afterward.
2908 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2909 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2910 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2911 titles for consistency.
2912 (Leaked merged semantic value if user action cuts parse): In order to
2913 suppress lint warnings, use arguments in merge function, and assign
2914 char value < 128 in main.
2915 (Incorrect lookahead during deterministic GLR): New test case.
2916 (Incorrect lookahead during nondeterministic GLR): New test case.
2917
05449a2c
JD
29182006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2919
de366a2f 2920 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
2921 !yyvaluep as signal that no semantic value is available to print.
2922 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2923 to print a semantic value.
2924
4158e0a1 29252006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 2926
4158e0a1
JD
2927 * tests/glr-regression.at: For consistency with my newer test cases,
2928 don't thank myself.
2929
d659304d
JD
29302006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2931
2932 * data/glr.c (yyresolveValue): When merging semantic options, if at
2933 least one user action succeeds but a later one cuts the parse, then
2934 destroy the semantic value before returning rather than leaking it.
2935 (yyresolveStates): If a user action cuts the parse and thus
2936 yyresolveValue fails, ignore the (unset) semantic value rather than
2937 corrupting the yyGLRState, and empty the semantic options list since
2938 the user actions should have called all necessary destructors.
2939 Simplify code with YYCHK.
2940 * tests/glr-regression.at (Corrupted semantic options if user action
2941 cuts parse): New test case.
2942 (Undesirable destructors if user action cuts parse): New test case.
2943 Before applying any of this patch, this test case never actually failed
2944 for me... but only because the corrupted semantic options usually
2945 masked this bug.
2946 (Leaked merged semantic value if user action cuts parse): New test
2947 case.
2948
6ec2c0f2
AD
29492006-01-05 Akim Demaille <akim@epita.fr>
2950
2951 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2952
1b9c21fb
PE
29532006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2954
2955 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2956 _MSC_VER. Problem reported by Cenzato Marco.
2957 (b4_c_function_def): Use it.
2958 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2959 b4_c_modern.
2960 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2961 than rolling our own.
2962
84866159
AD
29632006-01-04 Akim Demaille <akim@epita.fr>
2964
2965 Also warn about non-used mid-rule values.
2966 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2967 member.
2968 (symbol_list_new): Adjust.
2969 * src/reader.c (symbol_typed_p): New.
2970 (grammar_rule_check): Use it.
2971 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2972 Check its rule.
2973 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2974 Use it.
2975 * tests/actions.at (Exotic Dollars): Adjust.
2976
378f4bd8
AD
29772006-01-04 Akim Demaille <akim@epita.fr>
2978
2979 * src/reader.c (grammar_midrule_action): If $$ is set in a
2980 mid-rule, move the `used' bit to its lhs.
2981 * tests/input.at (Unused values): New.
2982 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2983
e2a21b6f
PE
29842006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2985
54662697
PE
2986 * doc/bison.texinfo (Bison Options): Say more accurately what
2987 --yacc does.
2988 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2989 about declarations in the grammar when in Yacc mode, as POSIX does
2990 not require a diagnostic when the grammar uses extensions.
2991
2992 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2993
073f9288
PE
2994 Warn about dubious constructions like "%token T T".
2995 Reported by twlevo.
2996 * src/symtab.h (struct symbol.declared): New member.
2997 * src/symtab.c (symbol_new): Initialize it to false.
2998 (symbol_class_set): New arg DECLARING, specifying whether
2999 this is a declaration that we want to warn about, if there
3000 is more than one of them. All uses changed.
3001
1221b78a
PE
3002 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
3003 Allow multiple %union directives, whose contents concatenate.
3004 * src/parse-gram.y (grammar_declaration): Likewise.
3005 Use muscle_code_grow, so that we don't need stype_line any more.
3006 All uses changed.
3007
3008 * src/muscle_tab.c (muscle_grow): Fix comment.
3009
e2a21b6f
PE
3010 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
3011 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
3012 Update copyright year to 2006.
3013
8f7e3cf9
AD
30142006-01-03 Akim Demaille <akim@epita.fr>
3015
3016 Have glr.cc pass (some of) the calc.at tests.
3017 * data/glr.cc (b4_parse_param_orig): New.
3018 (b4_parse_param): Improve its definition, and bound it more
3019 clearly in the skeleton.
3020 (b4_epilogue): Append, instead of prepending, in order to keep
3021 #line consistency.
3022 Simplify the generation of auxiliary functions: locations and
3023 purity are mandated.
3024 (b4_global_tokens_and_yystype): Honor it.
3025 * data/location.cc (c++.m4): Don't include it.
3026 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
3027 and AT_SKEL_CC_IF.
3028 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
3029 AT_LALR1_CC_IF.
3030 Be sure to initialize the first position's filename.
3031 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
3032 mandated anyway.
3033 (AT_CHECK_CALC_GLR_CC): New.
3034 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
3035
3953ed88
AD
30362006-01-02 Akim Demaille <akim@epita.fr>
3037
3038 * src/output.c (output_skeleton): Don't hard wire the inclusion of
3039 c.m4.
0a96ba81 3040 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
3041 * data/glr.cc: Do not include stack.hh.
3042
9ecafbbf
AD
30432006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3044
3045 * data/glr.c: Reformat whitespace with tabs.
3046 (b4_lpure_formals): Remove this unused m4 macro.
3047 * tests/cxx-type.at: Reformat whitespace with tabs.
3048 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
3049 since it's a member. Rename type to isNterm for clarity.
3050
c4d497a0
AD
30512005-12-29 Akim <akim@sulaco.local>
3052
3053 Let glr.cc catch up with symbol_value_print.
3054 * data/glr.cc (b4_yysymprint_generate): Replace by...
3055 (b4_yy_symbol_print_generate): this.
3056 (yy_symbol_print, yy_symbol_value_print): Declare them.
3057
4517da37
PE
30582005-12-28 Paul Eggert <eggert@cs.ucla.edu>
3059
3060 * src/location.h (boundary): Note that a line or column equal
3061 to INT_MAX indicates an overflow.
3062 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
3063 (rule_length_overflow, increment_rule_length, add_column_width):
3064 New functions.
3065 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
3066 (<SC_BRACED_CODE>"}"):
3067 Use increment_rule_length rather than incrementing it by hand.
3068 (adjust_location, handle_syncline): Diagnose overflow.
3069 (handle_action_dollar, handle_action_at):
3070 Fix bug with monstrosities like $-2147483648.
3071 Remove now-unnecessary checks.
3072 (scan_integer): Verify assumptions and remove now-unnecessary checks.
3073 (convert_ucn_to_byte): Verify assumptions.
3074 (handle_syncline): New arg LOC. All callers changed.
3075 Don't store through a value derived from char const * pointer.
3076
3077 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
3078 GCC warnings.
3079
e3233bf6
PE
30802005-12-27 Paul Eggert <eggert@cs.ucla.edu>
3081
3082 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
3083 Remove unnecessary forward static decls.
3084
8f3596a6
AD
30852005-12-27 Akim Demaille <akim@epita.fr>
3086
3087 * src/reader.c (grammar_current_rule_check): Also check that $$
3088 is used.
3089 Take the rule to check as argument, hence rename as...
3090 (grammar_rule_check): this.
3091 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
3092 Rename as...
3093 (grammar_rule_begin, grammar_rule_end): these, for consistency.
3094 (grammar_midrule_action, grammar_symbol_append): Now static.
3095 * tests/torture.at (input): Don't rely on the default action
3096 being always performed.
3097 * tests/calc.at: "Set" $$ even when the action is "cut" with
3098 YYERROR or other.
3099 * tests/actions.at (Exotic Dollars): Instead of using unused
3100 values, check that the warning is issued.
3101
721be13c
PE
31022005-12-22 Paul Eggert <eggert@cs.ucla.edu>
3103
3104 * NEWS: Improve wording for unused-value warnings.
3105
a0af42fc
AD
31062005-12-22 Akim Demaille <akim@epita.fr>
3107
3108 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
3109 (b4_yysymprint_generate): Rename as...
3110 (b4_yy_symbol_print_generate): this.
3111 Generate yy_symbol_print instead of yysymprint.
3112 Generate also yy_symbol_value_print, and use it.
3113
affac613
AD
31142005-12-22 Akim Demaille <akim@epita.fr>
3115
721be13c 3116 * NEWS: Warn about unused values.
affac613
AD
3117 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
3118 a `used' member.
3119 (symbol_list_n_get, symbol_list_n_used_set): New.
3120 (symbol_list_n_type_name_get): Use symbol_list_n_get.
3121 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
3122 * src/reader.c (grammar_current_rule_check): Check that values are
3123 used.
3124 * src/symtab.c (symbol_print): Accept 0.
3125 * tests/existing.at: Remove the type information.
3126 Empty the actions.
3127 Remove useless actions (beware of mid-rule actions: perl -000
3128 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3129 * tests/actions.at (Exotic Dollars): Use unused values.
3130 * tests/calc.at: Likewise.
3131 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3132 Likewise.
3133
3134 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3135 rule_useful_p.
3136
9d9b8b70
PE
31372005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3138
8bb4c753
PE
3139 Undo 2005-12-01 tentative license wording change. The wording is
3140 still being reviewed by the lawyers, and we don't want to wait for
3141 them before publishing a test release. For now, revert to the
3142 previous wording.
3143 * NEWS: Undo 2005-12-01 change.
3144 * data/glr.c: Revert to previous license wording.
3145 * data/glr.cc: Likewise.
3146 * data/lalr1.cc: Likewise.
3147 * data/location.cc: Likewise.
3148 * data/yacc.c: Likewise.
3149
9d9b8b70
PE
3150 * NEWS: Reword %destructor vs YYABORT etc.
3151 * data/glr.c: Use American spacing, for consistency.
3152 * data/glr.cc: Likewise.
3153 * data/lalr1.cc: Likewise.
3154 * data/yacc.c: Likewise.
3155 * data/yacc.c: Reformat comments slightly.
3156 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3157 for consistency. Fix some spelling errors and reword recently-included
3158 text slightly.
3159 * tests/cxx-type.at: Cast results of malloc, for C++.
3160
2c3b392a
AD
31612005-12-21 Joel E. Denny <address@hidden>
3162
3163 * tests/cxx-type.at: Construct a tree, count the parents of shared
3164 nodes, and free each node once and only once. Previously, the memory
3165 for semantic values was leaked instead.
3166
d6cff4dc
AD
31672005-12-21 Joel E. Denny <address@hidden>
3168
3169 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3170 (yylval, yylloc): If pure, #define to yystackp->yyval and
3171 yystackp->yyloc similar to yychar and yynerrs.
3172 (yyparse): If pure, remove local yylval and yylloc. Add local
3173 yystackp to accommodate pure definitions of yylval and yylloc.
3174 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3175 yylvalp and yyllocp to &yylval and &yylloc.
3176 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3177 namespace. Previously, nerrs and char were missing, but lval and lloc
3178 weren't necessary.
3179 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3180 yylvalp and yyllocp parameters since, if pure, these are now always
3181 accessible through yystackp. If not pure, they are still accessible
3182 globally.
3183 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3184 `if (YYID (N))' to pacify lint.
3185
a85284cf
AD
31862005-12-21 Akim Demaille <akim@epita.fr>
3187
3188 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3189 destroy the RHS symbols of a rule.
3190 * data/yacc.c (yylen): Initialize to 0.
3191 Keep its value to the number of items to possibly shift.
3192 In particular, a regular successful parse that ends on YYFINAL by
3193 a (internal) YYACCEPT must not have yylen != 0.
3194 (yyerrorlab, yyreturn): Pop the RHS.
3195 Reorder a bit to emphasize the `shifting' bits of code.
3196 (YYPOPSTACK): Now accept a number of items to pop.
3197 * data/lalr1.cc: Likewise.
3198 * data/glr.c: Formatting changes.
3199 Use goto instead of fall through.
3200 * doc/bison.texinfo (Destructor Decl): Complete.
3201
d508c281
JMG
32022005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3203
3204 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3205 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3206 * djgpp/config.bat: Replace every occurence of the file name
3207 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3208 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3209 * djgpp/config.sed: Replace every occurence of the file name
3210 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3211 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3212 * djgpp/djunpack.bat: DJGPP specific file.
3213 * djgpp/fnchange.lst: DJGPP specific file.
3214 * djgpp/README.in: Add new information about how to unpack the bison
3215 source on MSDOS and other systems which have 8.3 file name restrictions
3216 using djunpack.bat and fnchange.lst.
3217
3e7a2cd9
PE
32182005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3219
3220 * bootstrap (build_cvs_prefix): Remove; unused.
3221 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3222 when getting gnulib.
3223
32242005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3225
3226 * data/glr.c: Reorder typedef declarations for structs to match order
3227 of struct declarations.
3228 Rename yystack everywhere to yystackp except in yyparse where it's not
3229 a pointer.
3230 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3231 consistency.
3232 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3233 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3234 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3235 lint.
3236
877519f8
PE
32372005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3238
0eca5a39
PE
3239 * tests/sets.at (Accept): Fix typos in regular expression used to
3240 sed out the final state number.
3241
2cec9080
PE
3242 Work around portability problem on Solaris 10: flex-generated
3243 files include <stdio.h> before <config.h>, which messes up
3244 because the latter defines __EXTENSIONS__. Address the problem
3245 by creating two new little files that include <config.h> first,
3246 then include the flex-generated files. Rewrite everyone else
3247 to include <config.h> first, as well.
3248 * lib/timevar.c: Always include "config.h".
3249 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3250 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3251 (EXTRA_bison_SOURCES): New macro.
3252 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3253 * src/system.h: Don't include config.h.
3254 * src/LR0.c: Include <config.h> first.
3255 * src/assoc.c: Likewise.
3256 * src/closure.c: Likewise.
3257 * src/complain.c: Likewise.
3258 * src/conflicts.c: Likewise.
3259 * src/derives.c: Likewise.
3260 * src/files.c: Likewise.
3261 * src/getargs.c: Likewise.
3262 * src/gram.c: Likewise.
3263 * src/lalr.c: Likewise.
3264 * src/location.c: Likewise.
3265 * src/main.c: Likewise.
3266 * src/muscle_tab.c: Likewise.
3267 * src/nullable.c: Likewise.
3268 * src/output.c: Likewise.
3269 * src/parse-gram.y: Likewise.
3270 * src/print.c: Likewise.
3271 * src/print_graph.c: Likewise.
3272 * src/reader.c: Likewise.
3273 * src/reduce.c: Likewise.
3274 * src/relation.c: Likewise.
3275 * src/state.c: Likewise.
3276 * src/symlist.c: Likewise.
3277 * src/symtab.c: Likewise.
3278 * src/tables.c: Likewise.
3279 * src/uniqstr.c: Likewise.
3280 * src/vcg.c: Likewise.
3281
877519f8
PE
3282 * src/parse-gram.y: Fix minor problems uncovered by lint.
3283 (current_lhs, current_lhs_location): Now static.
3284 (current_assoc): Remove unused variable.
3285
3286 Cleanups so that Bison-generated parsers have less lint.
3287 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3288 Prepend /*ARGSUSED*/, for lint's sake.
3289 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3290 definition if 'lint' is defined.
3291 (YYID): New macro (or function, if lint).
3292 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3293 * data/yacc.c: Likewise.
3294 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3295 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3296 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3297 is C++ only.
3298 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3299 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3300 Use YYID(0) rather than 0, for lint.
3301 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3302 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3303
f5228370
PE
33042005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3305
3306 * tests/glr-regression.at
3307 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3308 Close memory leak reported by twlevo.
3309
69ce078b
PE
33102005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3311
6ff99711
PE
3312 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3313 all stacks.
3314 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
3315 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3316 New test case.
3317 (Duplicated user destructor for lookahead): This test now is expected
3318 to succeed.
3319
af3412cd
PE
33202005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3321
32b5b719 3322 * NEWS: Document the following change.
af3412cd
PE
3323 * data/yacc.c: Say "parser skeleton" rather than "file", since
3324 it's no longer just a file.
3325 * data/glr.c: Grant a special exception for C GLR parsers, that
3326 reads like the already-existing exception for C LALR(1) parsers.
3327 * data/glr.cc: Likewise.
3328 * data/lalr1.cc: Likewise.
3329 * data/location.cc: Likewise.
3330 * data/yacc.c: Reword the "written by" statement to clarify that
3331 it was the parser skeleton, not the entire output file.
3332 * data/glr.c: Written by Paul Hilfinger.
3333 * data/glr.cc: Written by Akim Demaille.
3334 * data/lalr1.cc: Likewise.
3335
035aa4a0
PE
33362005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3337
d9963c85
PE
3338 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3339 Fix typos in previous change that broke 'make check'.
3340 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3341 supported in C.
3342 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3343 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3344 We can revert this once things settle down.
3345
035aa4a0
PE
3346 * src/conflicts.c (conflicts_print): Don't print file name twice
3347 when %expect fails because there were no conflicts.
3348 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3349 change.
3350 * tests/conflicts.at (%expect not enough, %expect too much):
3351 (%expect with reduce conflicts): Adjust to new behavior.
3352
33532005-11-18 Akim Demaille <akim@epita.fr>
3354
3355 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3356 errors.
3357 * NEWS: Document this.
3358 * doc/bison.texinfo (Expect Decl): Likewise.
3359
d1ff7a7c
AD
33602005-11-16 Akim Demaille <akim@epita.fr>
3361
3362 Generalize the display of semantic values and locations in traces.
3363 * data/glr.c (yy_reduce_print): Fix indices (again).
3364 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3365 literal integers.
3366 * data/lalr1.cc (yyreduce_print): Rename as...
3367 (yy_reduce_print): this.
3368 Display values and locations.
3369 * data/yacc.c (yy_reduce_print): Likewise.
3370 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3371 (yysymprint): Move higher to be visible from yy_reduce_print).
3372 (yyparse): Adjust.
3373 * tests/calc.at: Adjust the expected length of the traces.
3374
6de5398d
AD
33752005-11-14 Akim Demaille <akim@epita.fr>
3376
3377 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3378 from 1 to N, while values and location start at 0.
3379 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3380
a1373f55
AD
33812005-11-14 Akim Demaille <akim@epita.fr>
3382
3383 * data/glr.c (yy_reduce_print): Fix the $ number.
3384
613d8952
AD
33852005-11-14 Akim Demaille <akim@epita.fr>
3386
3387 "Use" parse parameters.
3388 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3389 * data/glr.c, data/glr.cc: Use them.
3390 * data/glr.c (YYUSE): Have a C++ definition that supports
3391 non-pointer types.
3392
b2741627
AD
33932005-11-14 Akim Demaille <akim@epita.fr>
3394
3395 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3396
5059b5c8
AD
33972005-11-14 Akim Demaille <akim@epita.fr>
3398
42249483
AD
3399 * data/glr.cc: New.
3400 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 3401
4626a15d
AD
34022005-11-12 Akim Demaille <akim@epita.fr>
3403
3404 Let position and location be PODs.
3405 * data/location.cc (position::initialize, location::initialize): New.
3406 (position::position, location::location): Define only if
3407 b4_location_constructors is defined.
3408 * data/lalr1.cc (b4_location_constructors): Define it for backward
3409 compatibility.
3410 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3411
34122005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
3413
3414 * data/lalr1.cc: Move the body of the ctor and dtor into the
3415 parser file (instead of the header).
3416 Wrap the implementations in a "namespace yy".
3417
34182005-11-12 Akim Demaille <akim@epita.fr>
3419
3420 Have glr.c include its header file when created.
3421 * data/glr.c (b4_shared_declarations): New.
3422 Output them verbatim in the parser if !%defines, otherwise
3423 output then in the header file, and include it instead.
3424
1989d947
AD
34252005-11-11 Akim Demaille <akim@epita.fr>
3426
3427 * data/glr.c: Comment changes.
3428
34292005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
3430
3431 When yydebug, report semantic and location values for reductions.
3432 * data/glr.c (yy_reduce_print): Report the semantic values and the
3433 locations.
3434 (YY_REDUCE_PRINT): Adjust.
3435 (yyglrReduce): Use them.
3436 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3437 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3438 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3439 traces.
3440
02998094
AD
34412005-11-10 Akim Demaille <akim@epita.fr>
3442
3443 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3444 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3445 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3446
5210672f
PE
34472005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3448
3449 * m4/cxx.m4, examples/Makefile.am: Don't build
3450 examples/calc++ if no C++ compiler is available. (trivial change)
3451
a8991a1d
AD
34522005-11-09 Akim Demaille <akim@epita.fr>
3453
3454 * src/scan-skel.l: Use a couple of asserts.
3455
36b5e963
AD
34562005-11-03 Akim Demaille <akim@epita.fr>
3457
3458 In some (weird) cases, the final state number is incorrect.
3459 Reported by Alexandre Duret-Lutz.
3460 * src/LR0.c (state_list_append): Remove the computation of
3461 final_state.
3462 (save_reductions): Do it here.
3463 (get_state): Alpha conversion.
3464 (generate_states): Use a for loop.
3465 * src/gram.h (item_number_is_rule_number)
3466 (item_number_is_symbol_number): New.
3467 * src/state.c: Use assert.
3468 * src/system.h: Include assert.h.
3469 * tests/sets.at (Accept): New.
3470
44e7ead1
PH
34712005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3472
3473 * data/glr.c (yyfill): Adjust comment.
36b5e963 3474 (yyresolveAction): Initialize default location properly
44e7ead1
PH
3475 for empty right-hand sides.
3476 (yydoAction): Ditto.
3477 Add comment explaining apparently dead code.
36b5e963
AD
3478 * tests/glr-regression.at
3479 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 3480 New test.
36b5e963 3481
e10a80ee
PE
34822005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3483
3484 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3485 gnulib when interrupted. This fixes some race conditions and
3486 works around some portability problems (one noted by Paul
3487 Hilfinger).
3488
067b32ee
AD
34892005-10-22 Akim <akim@epita.fr>
3490
3491 * Makefile.cfg: Adjust to config -> build-aux.
3492 Reported by twledo.
3493
4b367315
AD
34942005-10-21 Akim Demaille <akim@epita.fr>
3495
3496 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3497 the %parse-params.
3498 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3499 * data/yacc.c (b4_Pure_if): Rename as...
3500 (b4_yacc_pure_if): this.
3501 (YY_SYMBOL_PRINT, yyparse): Adjust.
3502 * doc/bison.texinfo: Formatting changes.
3503
24cc23d9
AD
35042005-10-21 Akim Demaille <akim@epita.fr>
3505
3506 Finish the transition config -> build-aux.
3507 * configure.ac, Makefile.am: Use build-aux.
3508 * config/prev-version, config/announce-gen, config/Makefile.am:
3509 Move to...
3510 * build-aux/prev-version, build-aux/announce-gen,
3511 * build-aux/Makefile.am: here.
3512
d4476375
AD
35132005-10-14 Akim Demaille <akim@epita.fr>
3514
3515 * examples/calc++/test: Use set -x only when VERBOSE.
3516
302c0aee
PE
35172005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3518
3519 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3520 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3521
7625ec2c
AD
35222005-10-13 Akim Demaille <akim@epita.fr>
3523
3524 * src/scan-skel.l: Output the base name parts of the parser and
3525 header file names.
302c0aee 3526 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
3527 additional checks.
3528 Use this to exercise C++ outputs in subdirs.
3529 Reported by Oleg Smolsky.
3530
ba0fe3c7
PE
35312005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3532
3533 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3534 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3535 Problem reported by John P. Hartmann.
3536 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3537 already defined it.
3538
9b8a5ce0
AD
35392005-10-12 Akim Demaille <akim@epita.fr>
3540
3541 * src/parse-gram.y (version_check): Exit 63 to please missing
3542 (stands for "version mismatch).
3543 * tests/input.at, doc/bison.texinfo: Adjust.
3544
4f6e011e
PE
35452005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3546
3547 Work around portability problems with Visual Age C compiler
3548 (xlc and xlC_r) reported by John P. Hartmann.
3549 * data/location.cc (initial_column, initial_line): Remove.
3550 All uses replaced by 0 and 1.
3551 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3552 that xlc complains about.
3553 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 3554 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 3555 as __STDC__.
4d7aa45e
PE
3556 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3557 __STDC_VERSION__. Use it everywhere instead of looking at
3558 __STDC__ and __cplusplus.
4f6e011e 3559
a1b3bf8c
AD
35602005-10-10 Akim Demaille <akim@epita.fr>
3561
3562 * examples/calc++/test: Be quiet unless VERBOSE.
3563
412e44aa
PE
35642005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3565
2a4647a3
PE
3566 * data/c.m4 (yydestruct, yysymprint):
3567 Use YYUSE instead of casting to void.
3568 * data/glr.c (YYUSE): New macro.
3569 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3570 Use it instead of rolling our own.
3571 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3572 (YYCHK1):
3573 Use /*CONSTCOND*/ to suppress lint warnings.
3574 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3575 (YY_STACK_PRINT): Use 'false' not '0'.
3576 (YYUSE): New macro.
3577 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3578 * data/yacc.c (YYUSE): New macro.
3579 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3580 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3581 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3582
3583
412e44aa
PE
3584 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3585 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3586
88c6637f
PE
35872005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3588
2f4f028d
PE
3589 Undo the parts of the unlocked-I/O change that substituted
3590 putc or puts for printf. This might hurt performance a bit,
3591 but some people prefer the printf style.
3592 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3593 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3594 All uses replaced by YYFPRINTF and YYDPRINTF.
3595 * data/yacc.c: Likewise.
3596 * lib/bitset.c (bitset_print): Likewise.
3597 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3598 putc and puts.
3599 * lib/lbitset.c (debug_lbitset): Likewise.
3600 * src/closure.c (print_firsts, print_fderives): Likewise.
3601 * src/gram.c (grammar_dump): Likewise.
3602 * src/lalr.c (look_ahead_tokens_print): Likewise.
3603 * src/output.c (escaped_output): Likewise.
3604 (user_actions_output): Break apart two printfs.
3605 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3606 * src/reduce.c (reduce_print): Likewise.
3607 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3608 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3609
88c6637f
PE
3610 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3611 Use assignments rather than casts-to-void to suppress
3612 unused-variable warnings. This pacifies 'lint'.
3613 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3614 unused-variable warnings.
3615
fb32e373
JMG
36162005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3617
3618 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3619
edb8f44f
PE
36202005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3621
fb9c0b33
PE
3622 Use unlocked I/O for a minor performance improvement on hosts like
3623 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3624 is to use the gnlib unlocked-io module, and to prefer putc and
3625 puts to printf when either will work (since the latter doesn't
3626 come in an unlocked flavor).
3627 * bootstrap (gnulib_modules): Add unlocked-io.
3628 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3629 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3630 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3631 and similarly for puts and putc and printf.
3632 * data/yacc.c: Likewise.
3633 * lib/bitset.c (bitset_print): Likewise.
3634 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3635 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3636 to printf.
3637 * lib/lbitset.c (debug_lbitset): Likewise.
3638 * src/closure.c (print_firsts, print_fderives): Likewise.
3639 * src/gram.c (grammar_dump): Likewise.
3640 * src/lalr.c (look_ahead_tokens_print): Likewise.
3641 * src/output.c (escaped_output): Likewise.
3642 (user_actions_output): Coalesce two printfs.
2f4f028d 3643 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
3644 * src/reduce.c (reduce_print): Likewise.
3645 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 3646 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 3647
edb8f44f
PE
3648 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3649 this confuses xgettext.
3650
b50d2359
AD
36512005-10-02 Akim Demaille <akim@epita.fr>
3652
3653 * bootstrap (gnulib_modules): Add strverscmp.
3654 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3655 * m4/.cvsignore: Add strverscmp.m4.
3656 * src/parse-gram.y (%require): New token, new rule.
3657 (version_check): New.
3658 * src/scan-gram.l (%require): Adjust.
3659 * tests/input.at (AT_REQUIRE): New.
3660 Use it.
3661 * doc/bison.texinfo (Require Decl): New.
3662 (Calc++ Parser): Use %require.
3663
21667f64
AD
36642005-10-02 Akim Demaille <akim@epita.fr>
3665
3666 * data/location.cc: New.
3667
2b81e969
AD
36682005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3669 Akim Demaille <akim@epita.fr>
3670
3671 Make sure -odir/foo.cc creates dir/location.hh etc.
3672 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3673 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3674 (spec_defines_file): Now const.
3675 (dir_prefix): New.
3676 (short_base_name): Remove.
3677 * src/files.c: Adjust.
3678 (dirname.h): Include.
3679 (base_name): Don't prototype it.
3680 (finput): Remove, duplicates gram_in.
3681 (full_base_name, short_base_name): Replace by...
3682 (all_but_ext, all_but_tab_ext): these.
3683 (compute_base_names): Rename as...
3684 (compute_file_name_parts): this.
3685 Update to compute the new variables, including dir_prefix.
3686 Adjust dependencies.
3687 * src/output.c (prepare): Output them.
3688 * src/reader.c: Adjust to use gram_in, not finput.
3689 * src/scan-skel.l (@dir_prefix@): New.
3690
ad6a9b97
JMG
36912005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3692
3693 * lib/subpipe.c: New function end_of_output_subpipe() added
3694 to allow support for non-posix systems. This is a no-op function
3695 for posix systems.
3696
3697 * lib/subpipe.h: New function end_of_output_subpipe() added
3698 to allow support for non-posix systems. This is a no-op function
3699 for posix systems.
3700
3701 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3702 handle the lack of pipe/fork functionality on non-posix systems.
3703
3704 * djgpp/Makefile.maint: DJGPP specific file.
3705
3706 * djgpp/README.in: DJGPP specific file.
3707
3708 * djgpp/config.bat: DJGPP specific configuration file.
3709
3710 * djgpp/config.sed: DJGPP specific configuration file.
3711
3712 * djgpp/config.site: DJGPP specific configuration file.
3713
3714 * djgpp/config_h.sed: DJGPP specific configuration file.
3715
3716 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3717
3718 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3719
fc695704
AD
37202005-10-02 Akim Demaille <akim@epita.fr>
3721
3722 * data/location.cc: New, extract from...
3723 * data/lalr1.cc: here.
3724 (location.hh): Include it after the user prologue, in case the
3725 filename type is defined by the user.
3726 Forward declation location and position before the pre-prologue.
3727 (yyresult_): Rename as...
3728 (yyresult): this, it's a local variable, not an attribute.
3729 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
3730
37312005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
3732
3733 * examples/extexi: Restore the #line generation.
3734
fb9712a9
AD
37352005-09-30 Akim Demaille <akim@epita.fr>,
3736 Alexandre Duret-Lutz <adl@gnu.org>
3737
3738 Move the token type and YYSTYPE in the parser class.
3739 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
3740 (parser::token): New, from the moved free definition of tokens.
3741 (parser::semantic_value): Now a full definition instead of an
3742 indirection to YYSTYPE.
3743 (b4_post_prologue): No longer included in the header file, but
3744 in the implementation file.
3745 * doc/bison.texi (C+ Language Interface): Update.
3746 * src/parse-gram.y: Support unary %define.
3747 * tests/actions.at: Define global_tokens_and_yystype for backward
3748 compatibility until we update the tests.
3749 * tests/calc.at: Idem.
3750 (first_line, first_column, last_line, last_column): Define for lalr1.cc
3751 to simplify the code.
3752
55f0c7b1
PE
37532005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3754
3755 Port to SunOS 4.1.4, which lacks strtoul and strerror.
3756 Ah, the good old days! Problem reported by Peter Klein.
3757 * bootstrap (gnulib_modules): Add strerror, strtoul.
3758 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
3759 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
3760
fb9712a9 37612005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
3762
3763 * data/c.m4 (b4_error_verbose_if): New.
3764 * data/lalr1.cc: Use it.
3765 (YYERROR_VERBOSE_IF): Remove.
3766 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
3767 parser members, replaced by...
3768 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
3769 local variables.
3770 (yysyntax_error_): Takes the state number as argument.
3771 (yyreduce_print_): Use the argument yyrule, not the former
3772 attribute yyn_.
3773
8a6f72f3
PE
37742005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3775
3776 * bootstrap (gnulib_modules): Add verify.
3777 * lib/.cvsignore: Add verify.h.
3778 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
3779 * src/system.h (verify): Remove.
3780 Include verify.h instead.
3781 * src/tables.c (tables_generate): Use new API for 'verify'.
3782
0d50976f
PE
37832005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3784
ebc3737e
PE
3785 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
3786 local variables whose names begin with 'yy'.
3787 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
3788 Trivial changes from Joel E. Denny.
3789
0d50976f
PE
3790 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3791 it itself.
3792 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3793 don't use alloca any more.
3794
3795 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
3796 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 3797 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
3798 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
3799 to match yacc.c, to test more hosts.
3800
a05b79df
PE
38012005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3802
55289366
PE
3803 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
3804 doesn't affect behavior.
3805 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
3806 Solaris, AIX, MSC.
3807 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
3808 This works a bit better with glibc, if user code has already included
3809 stdlib.h.
3810 * doc/bison.texinfo (Bison Parser): Document that users can't
3811 arbitrarily use malloc and free for other purposes. Document
3812 that <alloca.h> and <malloc.h> might be included.
3813 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
3814 user must declare alloca.
3815
a05b79df
PE
3816 * HACKING (release): Forwarn the Translation Project about
3817 stable releses.
3818
3ab2ca22
AD
38192005-09-20 Akim Demaille <akim@epita.fr>
3820
3821 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3822
a9739e7c
PE
38232005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3824
a702593e
PE
3825 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
3826 (YYSTACK_ALLOC_MAXIMUM): Use it.
3827 (yysyntax_error): New function.
3828 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
3829 multiple syntax errors are reported, and alloca is being used.
3830 Instead, reallocate buffers twice as big each time, so that
3831 we waste at most half the allocated memory. Start with a small
3832 (128-byte) buffer that will suffice in most cases anyway.
3833 Use yysyntax_error to do most of the work.
3834
3835 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3836 yynerrs is the number of errors reported, not the number of
3837 errors encountered.
3838
a9739e7c
PE
3839 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3840 Mark it as expected to fail.
3841 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3842 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3843 Don't start user-code symbols with "yy", to avoid name space problems.
3844
f479c6c6
AD
38452005-09-19 Akim Demaille <akim@epita.fr>
3846
3847 Remove the traits, failed experiment.
3848 It never proved useful, and anyway because of the current
3849 definition, it was not possible to have several specialization of
3850 this traits, making it useless.
3851 * data/lalr1.cc (yy:traits): Remove.
3852 Inline its definitions in the parser class.
3853
e2586f82
AD
38542005-09-19 Akim Demaille <akim@epita.fr>
3855
3856 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3857 least Mac OSX with a /usr/local install of gettext.
3858
2e8cf949
AD
38592005-09-19 Akim Demaille <akim@epita.fr>
3860
3861 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3862 and yytoken for similarity with the other skeletons.
3863
c7fb0b90
AD
38642005-09-19 Akim Demaille <akim@epita.fr>
3865
4e26c69e 3866 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 3867
1bd0deda
PE
38682005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3869
3870 * NEWS: Version 2.1.
3871
3872 * NEWS: Remove notice of yytname change, since it was never in an
3873 official release.
3874 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3875 diagnostic.
3876 * src/output.c (prepare): Likewise.
3877 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3878 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3879 is not defined. This is an awful hack, but it's enough for now.
3880 All callers changed.
3881 * tests/glr-regression-at (make_value): Args are const pointers now,
3882 to avoid GCC warning.
3883 (Duplicated user destructor for lookahead): New test. Currently
3884 skipped. It fails on my host but I'm not sure it'll always fail.
3885
38862005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
3887
3888 * src/symtab.h (struct symbol): Declare the printer and destructor
3889 as const, to avoid accidental calls to free.
3890 (symbol_destructor_set, symbol_printer_set): Adjust.
3891 * src/symtab.c: Adjust.
3892
1bd0deda 38932005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
3894
3895 * data/c.m4 (b4_token_enums): New.
3896 (b4_token_defines): Rename as...
3897 (b4_token_enums_defines): this.
3898 (b4_token_defines): New, output only the #defines.
3899 * data/yacc.c, data/glr.c: Adjust.
3900 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3901 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3902 as default values.
3903
dbcdae2d
AD
39042005-09-16 Akim Demaille <akim@epita.fr>
3905
3906 * data/lalr1.cc (yylex_): Remove, inline its code.
3907 (yyreport_syntax_error_): Remove, replaced by...
3908 (yysyntax_error_): this which returns a string and leaves to the
3909 caller the call to the users' error function.
3910 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3911 Move from members of the parser object...
3912 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3913 to local variables of the parse function.
3914
70d8f291
AD
39152005-09-16 Akim Demaille <akim@epita.fr>
3916
3917 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3918 since it's in Bison's name space.
3919
b47dbebe
PE
39202005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3921
ae199bf1
PE
3922 * data/glr.c (yyresolveValue): Add default case to pacify
3923 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3924
b47dbebe
PE
3925 * NEWS: Document when yyparse started to return 2.
3926 * doc/bison.texinfo (Parser Function): Document when yyparse
3927 returns 2.
3928
3929 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3930 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3931 changed.
3932 (class position): file_name -> filename (reverting). All uses changed.
3933
39342005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3935
3936 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3937 do anything if $@ exists. This reverts part of the 2005-07-07
3938 patch.
3939
00292f66
PE
39402005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3941
3942 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3943 contains obsolete information and isn't worth distributing as a
3944 separate file anyway.
3945 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3946 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3947 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3948 (yyparse): Abort if user code uses longjmp to throw an unexpected
3949 value.
3950
a420f962
PE
39512005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3952
00292f66
PE
3953 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3954 Suggested by twlevo@xs4all.nl.
3955
127287e9
PE
3956 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3957 This avoids a diagnostic from gcc -Wswitch-enum.
3958 Problem reported by twlevo@xs4all.nl.
3959
a420f962
PE
3960 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3961 standards. Use "file name" or "file" or "name", depending on
3962 the context.
3963 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3964 not to hack/foo.tab.c.
3965 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
3966 * data/glr.c: b4_filename -> b4_file_name.
3967 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3968 All uses changed.
3969 (class position): filename -> file_name. All uses changed.
3970 * data/yacc.c: b4_filename -> b4_file_name.
3971 * lib/bitset.h: filename -> file_name in local vars.
3972 * lib/bitset_stats.c: Likewise.
3973 * src/files.c: Likewise.
3974 * src/scan-skel.l ("@output ".*\n): Likewise.
3975 * src/files.c (file_name_split): Renamed from filename_split.
3976 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
3977
39782005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3979
3980 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3981 to accommodate latest gnulib.
3982
3983 * tests/glr-regression.at (Duplicate representation of merged trees):
3984 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3985
3986 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3987 needed.
3988
42a6501d
PE
39892005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3990
3991 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3992 All uses changed. Invoke user destructor after an error during a
3993 split parse (trivial change from Joel E. Denny).
3994
3995 * tests/glr-regression.at
3996 (User destructor after an error during a split parse): New test case.
3997 Problem reported by Joel E. Denny in:
3998 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3999
ef9a1faf
PE
40002005-08-25 Paul Eggert <eggert@cs.ucla.edu>
4001
5b4aaf78
PE
4002 * README-cvs: Give URLs for recommended tools.
4003 Mention Gzip version problem, and bootstrapping issues.
4004 Remove troubleshooting section, as it's somewhat obsolete.
4005
b5240ba5
PE
4006 * bootstrap (no_cache): New var, to accommodate different wget
4007 variants. Use it instead of '-C off'. Problem reported by
4008 twlevo@xs4all.nl.
4009
ef9a1faf
PE
4010 * data/glr.c (yydestroyStackItem): New function.
4011 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
4012 debugging information. Problem reported by Joel E. Denny.
4013
e6efa9da
AD
40142005-08-25 Akim Demaille <akim@epita.fr>
4015
4016 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
4017
adc90f13
PE
40182005-08-24 Paul Eggert <eggert@cs.ucla.edu>
4019
4020 * data/glr.c (yyrecoverSyntaxError, yyreturn):
4021 Don't invoke destructor on unresolved entries.
4022 * tests/glr-regression.at
4023 (User destructor for unresolved GLR semantic value): New test case.
4024 Problem reported by Joel E. Denny in:
4025 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
4026
f9315de5
PE
40272005-08-21 Paul Eggert <eggert@cs.ucla.edu>
4028
15d29c1f
PE
4029 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
4030 Add strnlen.c.
4031 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
4032 lib-prefix.m4, po.m4.
4033
dd5f2af2
PE
4034 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
4035 in yydestruct diagnostic, since it might not be an error.
4036 Problem reported by Joel Denny near end of
4037 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 4038 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
4039 * data/yacc.c (yyreturn): Likewise.
4040 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
4041
4042 * src/files.c: Remove obsolete FIXME comment.
4043
4044 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
4045 with the other templates, and to fix bogus run-on messages such
4046 as the one reported at the end of
4047 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4048 All callers changed to avoid the newline.
4049 (yyprocessOneStack): Output two lines rather than one, to accommodate
4050 the above change. This changes the debug output format slightly.
4051
f9315de5
PE
4052 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
4053 reported by Joel E. Denny in
4054 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
4055 (trivial change).
4056 * tests/glr-regression.at (Duplicate representation of merged trees):
4057 New test, from Joel E. Denny in:
4058 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
4059 * THANKS: Add Joel E. Denny.
4060
4061 * configure.ac (AC_INIT): Bump to 2.0c.
4062
04098407
PE
40632005-07-24 Paul Eggert <eggert@cs.ucla.edu>
4064
4065 * NEWS: Version 2.0b.
4066
ca5d2013
PE
4067 * Makefile.am (SUBDIRS): Put examples before tests, so that
4068 "make check" doesn't finish with "All 1 tests passed".
4069
3d54b576
PE
4070 * tests/regression.at (Token definitions): Don't rely on
4071 AT_PARSER_CHECK for data that contains backslashes. It currently
4072 uses 'echo', and 'echo' isn't portable if its argument contains
4073 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
4074 that the byte '\0xff' is not printable in the C locale; it is,
4075 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
4076 not printable, so use '\0x81' to test.
4077
d53ae497
PE
4078 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
4079 version of GCC, since the macro is used with non-GCC compilers.
4080
fc01665e
PE
4081 Fix core dump reported by Pablo De Napoli in
4082 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
4083 * tests/regression.at (Invalid inputs with {}): New test.
4084 * src/parse-gram.y (token_name): Translate type before using
4085 it as an index.
4086
04098407
PE
4087 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
4088 the user's name space. All uses changed to __attribute__
4089 ((__unused__)).
4090 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
4091 Add __attribute__ ((__noreturn__)).
4092
4093 * etc/clcommit: Remove. We weren't using it, and it failed
4094 "make maintainer-distcheck".
4095 * Makefile.maint: Merge from coreutils.
4096 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
4097 (syntax-check-rules): Change list of rules as described below.
4098 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
4099 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
4100 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
4101 (sc_trailing_space): New rules.
4102 (sc_xalloc_h_in_src): Remove.
4103 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
4104 (sc_space_tab, sc_error_exit_success, sc_changelog):
4105 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
4106 (makefile-check, po-check, author_mark_check):
4107 (makefile_path_separator_check, copyright-check):
4108 Use grep -n, to make it easier to find violations.
4109 Use CVS_LIST and CVS_LIST_EXCEPT.
4110 (header_regexp, h_re): Remove.
4111 (dd_c): New macro.
4112 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
4113 (my-distcheck): Use more-modern GCC flags.
4114 (signatures, %.asc): Remove.
4115 (rel-files, announcement): Remove signatures.
4116 Restore old updating code, even though we don't use it, so
4117 that we're the same as coreutils.
4118 (alpha, beta, major): Depend on news-date-check.
4119 Make the upload commands.
4120
4121 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
4122 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
4123 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
4124 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
4125 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
4126 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4127 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4128 * tests/sets.at: Likewise.
4129
4130 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4131 we comment out the Autoconf version number.
4132 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4133 it's error-prone and "make maintainer-distcheck" rejects it.
4134
4135 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4136 Indent calls to "error" to pacify "make maintainer-distcheck",
4137 when the calls are not intended to be translated.
4138 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4139
4140 * src/Makefile.am (DEFS): Use +=, to pacify
4141 "make maintainer-distcheck".
4142 (bison_SOURCES): Add scan-skel.h.
4143 (sc_tight_scope): New rule, from coreutils.
4144
4145 * src/files.c (src_extension, header_extension):
4146 Now static, not extern.
4147 * src/getargs.c (short_options): Likewise.
4148 * src/muscle_tab.c (muscle_table): Likewise.
4149 * src/parse-gram.y (current_class, current_type, current_prec):
4150 Likewise.
4151 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4152 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4153 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4154 void, to avoid warning when NLS is disabled.
4155 * src/output.c: Include scan-skel.h.
4156 (scan_skel): Remove decl, since scan-skel.h does this.
4157 (output_skeleton):
4158 Indent calls to "error" to pacify "make maintainer-distcheck".
4159 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4160 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4161 "make maintainer-distcheck".
4162 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4163 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4164 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4165 (skel_lex_destroy, scan_skel): Move these decls to...
4166 * src/scan-skel.h: New file.
4167 * src/uniqstr.c (uniqstr_assert):
4168 Indent calls to "error" to pacify "make maintainer-distcheck".
4169
4170 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4171 not @VAR@.
4172
4173 * tests/torture.at: Revamp to avoid misuse of atoi that
4174 "make maintainer-distcheck" complained about.
4175
4176 * examples/extexi (message): Don't print a message more than once,
4177 and omit line-number decoration that makes Emacs compile think
4178 that informative messages are worth worrying about.
4179
41802005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4181
4182 * configure.ac: Update version number.
4183
4184 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4185 accidentally.
4186 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4187 autogenerated by the maintainer.
4188 * examples/calc++/.cvsignore: Add *.yy.
4189
4190 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4191 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4192 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4193
4194 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4195
4196 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4197 from maintainer-distcheck about casting the argument of 'free'.
4198
4199 * NEWS: Mention recent yytname changes.
4200 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4201
4202 * bootstrap: For translations that have not yet been upgraded to
4203 the new runtime-po domain, prime the pump by extracting the
4204 relevant strings from the obsolete translations. This code can be
4205 removed once the bison-runtime domain has been translated by each
4206 team.
4207
4208 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4209 now that token names are already quoted.
4210
4211 Fix problem reported by Anthony Heading.
4212 * data/glr.c (YYTOKEN_TABLE): New macro.
4213 (yytname): Define if YYTOKEN_TABLE.
4214 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4215 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4216 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4217 * src/output.c (prepare_symbols): Output token_table_flag.
4218
0ffda363
PE
42192005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4220
4221 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4222 again if the first call fails.
4223
4224 * data/glr.c (yytnamerr): New function.
4225 (yyreportSyntaxError): Use it to dequote most string literals.
4226 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4227 with other skeletons. All uses changed.
4228 (yytnameerr_): New function.
4229 (yyreport_syntax_error): Use it to dequote most string literals.
4230 * data/yacc.c (yytnamerr): New function.
4231 (yyerrlab): Use it to decode most string literals.
4232 * doc/bison.texinfo (Decl Summary, Calling Convention):
4233 Clarify quoting convention of yytname.
4234 * src/output.c (prepare_symbols): Quote all names. This undoes
4235 the 2005-04-17 change, which is now accomplished (mostly) via
4236 changes in the parsers as described above.
4237 * tests/regression.at (Token definitions, Web2c Actions):
4238 Undo most 2005-04-17 change here, too.
4239
42402005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4241
4242 Fix more problems reported by twlevo@xs4all.nl.
4243 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4244 remove trailing spaces. This loses the exit status of ./types,
4245 and isn't needed since ./types shouldn't be emitting trailing
4246 spaces.
4247 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4248 as the stack isn't valid in that case.
4249
4250 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4251 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4252 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4253 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4254 is used.
4255 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4256 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4257 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4258 Likewise.
4259
4260 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4261 overly-picky compilers that reject 'char *foo = "bar";'.
4262
4263 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4264 to FILE * parameter, not to stderr. This fixes a typo introduced
4265 in the 2005-07-12 change.
4266
4267 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4268 warnings from GCC 4.
4269
4270 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4271 (yyglrShiftDefer, yysplitStack):
4272 Remove unused parameters b4_pure_formals. All uses changed.
4273 (yyglrShift): Remove unused parameters b4_user_formals.
4274 All uses changed.
4275 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4276
6100a9aa
PE
42772005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4278
258b75ca
PE
4279 Destructor cleanups and regularization among the three skeletons.
4280 * NEWS: Document the behavior changes.
4281 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4282 stack before failing, as the cleanup code will do it for us now.
4283 * data/lalr1.cc (yyerrlab): Likewise.
4284 * data/glr.c (yyparse): Pop everything off the stack before
4285 freeing it, so that destructors get called properly.
4286 * data/lalr1.cc (yyreturn): Likewise.
4287 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4288 This is more consistent.
4289 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4290 why destructors might be called. 1.875 -> 2.1.
4291 (Destructor Decl, Decl Summary, Table of Symbols):
4292 Some English-language cleanups for %destructor.
4293 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4294 Add output line for destructor of start symbol.
4295 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4296 because of that same extra output line.
4297
1a059451
PE
4298 * NEWS: Document minor wording changes in diagnostics of
4299 Bison-generated parsers.
4300 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4301 Remove unused formals. All uses changed.
4302 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4303 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4304 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4305 Rename yyoverflowab to yyexhaustedlab.
4306 When memory exhaustion occurs during syntax-error reporting,
4307 report it separately rather than in a single diagnostic; this
4308 eases translation.
4309 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4310 (Memory Exhausted): Renamed from Parser Stack Overflow.
4311 Revamp wording slightly to prefer "memory exhaustion".
4312 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4313
97460c78
PE
4314 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4315
30757c8c
PE
4316 Add i18n support to the GLR skeleton. Partially fix the C++
4317 skeleton; a C++ expert needs to finish this. Remove debugging
4318 msgids; there's little point to having them translated, since they
4319 can be understood only by someone who can read the
4320 (English-language) source code.
4321
4322 Generate runtime-po/bison-runtime.pot automatically, so that we
4323 don't have to worry about garbage getting in that file. We'll
4324 make sure after the next official release that old msgids don't
4325 get lost. See
4326 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4327
4328 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4329 Now auto-generated.
4330 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4331 Fix typos in explanations of the runtime file.
4332 * bootstrap: Change gettext keyword from YYI18N to YY_.
4333 Use standard Makefile.in.in in runtime-po, since we'll arrange
4334 for backward-compatible bison-runtime.po files in a different way.
4335 * data/glr.c (YY_): New macro, from yacc.c.
4336 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4337 Translate messages intended for users.
4338 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4339 the wording in the other skeletons. We don't know that the memory
4340 is virtual.
4341 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4342 Use same method that yacc.c uses.
4343 Don't translate debugging messages.
4344 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4345 it doesn't work (yet), and requires C++ expertise to fix.
4346 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4347 Move defn to a more logical place, to be consistent with other
4348 skeletons.
4349 Don't translate debugging messages.
4350 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4351 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4352 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4353 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4354
ac8c5689
PE
4355 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4356 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4357 void, not int.
4358 * tests/glr-regression.at (Badly Collapsed GLR States):
4359 Likewise.
4360 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4361 yylex should return 0 at EOF rather than aborting.
4362
6100a9aa
PE
4363 Improve tests for stack overflow in GLR parser.
4364 Problem reported by twlevo@xs4all.nl.
4365 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4366 All uses removed.
4367 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4368 can handle the problem.
4369 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4370 (yyparse): New local variable yyresult to record the result.
4371 Use result of setjmp to set it, rather than storing itinto
4372 struct.
4373 (yyDone): Remove label.
4374 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4375 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4376 if YYABORT is used).
4377 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4378 yyparse status; put status > 1 into diagnostic.
4379 Check that status==2 works.
4380 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4381 Use exit status 3 for failure to open (which shouldn't happen).
4382
15f40952
PE
43832005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4384
67fd79c4
PE
4385 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4386 1 on syntax error; just let yyparse do its thing.
4387 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4388 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4389 (Exploding the Stack Size with Alloca):
4390 (Exploding the Stack Size with Malloc):
4391 Expect exit status 2, not 1, since the parser is supposed to blow
4392 its stack. Problem reported by twlevo@xs4all.nl.
4393
15f40952
PE
4394 * data/glr.c (yyparse): Don't assume that the initial calls
4395 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4396 Print a stack-overflow message and fail instead.
4397 Initialize the line-number information before creating the stack,
4398 so that the stack-overflow message can report line zero safely.
4399
f32c66b5
PE
44002005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4401
a22ff96f 4402 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
4403 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4404 (yyuserMerge): Provide a default case if b4_mergers is empty.
4405 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4406 * tests/glr-regression.at
4407 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 4408 Add casts to pacify C++ compilers.
1beb0b24
PE
4409 * tests/glr-regression.at (Improper merging of GLR delayed action
4410 sets): Declare yylex before using it.
f32c66b5 4411 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
4412 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4413 test for valgrind; valgrind is independent of g++.
4414 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4415 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4416 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4417 Use a destructor, so that we can expand the stack. Change
4418 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 4419
d741bd1b
PE
44202005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4421
4422 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4423 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4424
0410a6e0
PE
44252005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4426
4427 * PACKAGING: New file, suggested by Bruno Haible and taken from
4428 similar wording in gettext's PACKAGING file.
4429 * NEWS: Mention PACKAGING.
4430 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4431
f7ab6a50
PE
44322005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4433
baf785db 4434 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
4435 * bootstrap: Get runtime translations into runtime-po.
4436 Create runtime-po files automatically, if possible.
4437 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4438 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4439 does not infringe on the user's name space.
4440 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4441 * doc/bison.texinfo (Internationalization): Revamp the English
4442 and Texinfo syntax a bit, to try to make it clearer.
4443 (Bison Options, Option Cross Key): Mention --print-localedir.
4444 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4445 YYENABLE_NLS. Quote a bit more.
4446 * runtime-po/.cvsignore: New file.
4447 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4448 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4449 * runtime-po/quot.sed: Likewise.
4450 * runtime-po/boldquot.sed: Likewise.
4451 * runtime-po/en@quot.header: Likewise.
4452 * runtime-po/en@boldquot.header: Likewise.
4453 * runtime-po/insert-header.sin: Likewise.
4454 * runtime-po/remove-potcdate.sin: Likewise.
4455 * runtime-po/Makevars: Likewise.
4456 * runtime-po/LINGUAS: Likewise.
4457 * runtime-po/de.po: Likewise; we will rely on the translation project
4458 to maintain this, so "bootstrap" should get it.
0410a6e0 4459 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
4460 its value.
4461 * src/main.c (main): Bind the bison-runtime domain, too.
4462
44632005-07-12 Bruno Haible <bruno@clisp.org>
4464
4465 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4466 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4467 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4468 * runtime-po: New directory.
4469 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4470 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4471 * runtime-po/Rules-quot: New file, copied from po/.
4472 * runtime-po/quot.sed: Likewise.
4473 * runtime-po/boldquot.sed: Likewise.
4474 * runtime-po/en@quot.header: Likewise.
4475 * runtime-po/en@boldquot.header: Likewise.
4476 * runtime-po/insert-header.sin: Likewise.
4477 * runtime-po/remove-potcdate.sin: Likewise.
4478 * runtime-po/Makevars: New file.
4479 * runtime-po/POTFILES.in: New file.
4480 * runtime-po/LINGUAS: New file.
4481 * runtime-po/bison-runtime.pot: New file.
4482 * runtime-po/de.po: New file.
4483 * m4/bison.m4: New file.
4484 * Makefile.am (SUBDIRS): Add runtime-po.
4485 (aclocaldir, aclocal_DATA): New variables.
4486 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4487 Define aclocaldir.
4488 * src/getargs.c (usage): Document --print-localedir option.
4489 (PRINT_LOCALEDIR_OPTION): New enum item.
4490 (long_options): Add --print-localedir option.
4491 (getargs): Handle --print-localedir option.
4492 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4493 (Internationalization): New section.
4494
22dda0f0
AD
44952005-07-12 Akim Demaille <akim@epita.fr>
4496
4497 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4498 for consistency with the rest of the code.
4499 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4500 Add separators.
4501
82b248ad
AD
45022005-07-12 Akim Demaille <akim@epita.fr>
4503
4504 * src/parse-gram.y: Use %printer instead of YYPRINT.
4505
fa0e9314
AD
45062005-07-12 Akim Demaille <akim@epita.fr>
4507
867a3e00
AD
4508 * src/symtab.h, src/symtab.c (symbol_print): New.
4509 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4510 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4511
45122005-07-12 Akim Demaille <akim@epita.fr>
4513
4514 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
4515 b4_at_dollar and b4_dollar_dollar.
4516
e054b190
PE
45172005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4518
4519 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4520 and Pennello's paper.
4521
34160ec4
PE
45222005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4523
407d4a75
PE
4524 * data/yacc.c (yyparse): Undo previous patch. Instead,
4525 set yylsp[0] and yyvsp[0] only if the initial action
4526 sets yylloc and yylval, respectively.
4527
34160ec4
PE
4528 * data/yacc.c (yyparse): In the initial action, set
4529 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4530 This avoids the use of undefined variables if the initial
4531 action does not set yylloc and/or yylval.
4532
c3d5a4a7
PE
45332005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4534
b34d96c1
PE
4535 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4536 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4537 Remove from CVS. These files are automatically generated.
4538 * examples/extexi: Clarify that this file is now part of Bison,
4539 not GNU M4, and that it works with any POSIX-compatible Awk.
4540 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4541 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4542 so that we also get calc++-parser.yy. Geneate it.
4543 Use $(AWK), not gawk, since any conforming Awk will do.
4544 Put comment before action, since older 'make' can't handle comment
4545 in action.
4546 $(BUILT_SOURCES): List all built sources, not just some of them.
4547 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4548 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4549 $($(calc_sources_generated)): Remove unnecessary test for existence
4550 of target. (This had a shell syntax error anyway; a stray "x".)
4551 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4552 calc++-parser.yy.
4553 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4554
c3d5a4a7
PE
4555 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4556 implied by the other modules.
4557
828c373b
AD
45582005-07-06 Akim Demaille <akim@epita.fr>
4559
4560 Bind examples/calc++ to the package.
4561 * examples/calc++/Makefile: Remove, replaced by...
4562 * examples/calc++/Makefile.am: ... this new file.
4563 * examples/calc++/test: Remove input.
4564 * examples/calc++/compile: Remove.
4565 * examples/Makefile.am: New.
4566 * configure.ac, Makefile.am: Adjust.
4567 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4568
63cb01d6
PE
45692005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4570
fd2df2ed
PE
4571 * data/glr.c (yyFail): Drastically simplify; since the format argument
4572 never had any % directives, we can simply pass it to yyerror.
4573 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4574 be modified later, as that is the usual style in glr.c.
4575 Problems reported by Paul Hilfinger.
4576
63cb01d6
PE
4577 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4578 and size overflow errors.
4579 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4580 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4581 (YYSIZEMAX): New macro.
4582 (yystpcpy): New function, taken from yacc.c.
4583 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4584 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4585 so that we don't have to maintain their signatures.
4586 (yyFail): Check for buffer overflow, by using vsnprintf rather
4587 than vsprintf. Allocate a bigger buffer if possible.
4588 Report an error if buffer allocation fails.
4589 (yyStackOverflow): New function.
4590 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4591 the initialization was successful. It might fail if storage was
4592 exhausted.
4593 (yyexpandGLRStack): Add more checks for storage allocation failure.
4594 Use yyStackOverflow to report failures.
4595 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4596 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4597 Don't assume stack number fits in int.
4598 (yysplitStack): Check for storage allocation failure.
4599 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4600 can print diagnostics on storage allocation failure. All callers
4601 changed.
4602 (yyresolveValue): Use yybool for boolean.
4603 (yyreportSyntaxError): Check for size-calculation overflow.
4604 This code is taken from yacc.c.
4605 (yyparse): Check for storage allocation errors when allocating
4606 the initial stack.
4607
1c59e0a1
AD
46082005-07-05 Akim Demaille <akim@epita.fr>
4609
4610 Extract calc++ from the documentation.
4611 * doc/bison.texinfo (Calc++): Add the extraction marks.
4612 * examples/extexi: New, from the aborted GNU Programming 2E.
4613 Separate the different paragraph of a file with empty lines.
4614 * examples/Makefile: Use it to extract the whole calc++ example.
4615
8a0adb01
AD
46162005-06-24 Akim Demaille <akim@epita.fr>
4617
4618 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4619 class typedefs.
4620
12545799
AD
46212005-06-22 Akim Demaille <akim@epita.fr>
4622
4623 * doc/bison.texinfo (C++ Language Interface): First stab.
4624 (C++ Parsers): Remove.
4625
99be0235
AD
46262005-06-22 Akim Demaille <akim@epita.fr>
4627
4628 * data/lalr1.cc (yylex_): Honor %lex-param.
4629
0ffd4fd1
AD
46302005-06-22 Akim Demaille <akim@epita.fr>
4631
4632 Start a set of simple examples.
4633 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4634 * examples/calc++/calc++-driver.hh,
4635 * examples/calc++/calc++-parser.yy,
4636 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4637 * examples/calc++/compile, examples/calc++/test: New.
4638
0925ebb4
PE
46392005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4640
4641 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4642 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4643 which stems from the 2005-05-27 patch.
4644
43d3b664
PH
46452005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4646
4647 * data/glr.c: Modify treatment of unused parameters to permit use
4648 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4649
3062864d
PE
46502005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4651
4652 Fix infringement on user name space reported by Janos Zoltan Szabo.
4653 * data/yacc.c (yyparse): strlen -> yystrlen.
4654
989b5b8e
AD
46552005-05-30 Akim Demaille <akim@epita.fr>
4656
4657 * data/lalr1.cc (_): New.
4658 Translate the various messages.
4659
bedf57f5
PE
46602005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4661
4662 Fix infringement on user name space reported by Bruno Haible.
4663 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4664 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4665 the user's name space.
4666 (alloca): Include <stdlib.h> to get it, if it's not built in.
4667 (YYMALLOC, YYFREE): Define only if needed.
4668 (malloc, free): Declare, but only if needed, as this infringes on
4669 the user name space.
4670
4d1801f1
PE
46712005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4672
4673 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4674 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4675 with %d format.
4676 * lib/ebitset.c (min, max): Undef before defining.
4677 * lib/vbitset.c (min, max): Likewise.
4678 * lib/subpipe.c (create_subpipe): Save local variables in case
4679 vfork clobbers them.
4680
46812005-05-24 Bruno Haible <bruno@clisp.org>
4682
4683 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4684 error message syntax used by gcc-4.0.
4685
b94a9e1e
PE
46862005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4687
85ac3861
PE
4688 * README: Mention m4 1.4.3. Remove obsolete advice about
4689 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4690
b94a9e1e
PE
4691 * bootstrap: Remove workaround for problem I encountered with
4692 gettext 0.14.1; it seems to be fixed now.
4693
51c30d21
PE
46942005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4695
009ce67d
PE
4696 * NEWS: Version 2.0a.
4697
f2a97c62
PE
4698 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4699 the previous change.
4700
c8775f93
PE
4701 Various maintainer cleanups.
4702 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4703 conftest*, for benefit of CVS commands run at the same time as
4704 "configure". Add build-aux, since "bootstrap" now creates it and
4705 its subfiles.
4706 * Makefile.cfg (move_if_change): Remove.
4707 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
4708 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
4709 (po_repo, do-po-update, po-update, wget_files, get-targets):
4710 (config.guess-url_prefix, config.sub-url_prefix):
4711 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
4712 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
4713 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
4714 Remove.
4715 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
4716 this is now the recommended name.
4717 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
4718 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
4719 ylwrap. These files now go into build-aux.
4720 * config/move-if-change: Remove.
4721 * config/prev-version.txt: Bump from 1.75 to 2.0.
4722
3ea5f0ec
PE
4723 * bootstrap: Add stdio-safer, unistd-safer modules.
4724 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4725 we don't need it).
4726 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
4727 fopen-safer.c, stdio-safer.h, unistd-safer.h.
4728 * lib/subpipe.c: Include "unistd-safer.h".
4729 (create_subpipe): Make sure all the newly-created
4730 file descriptors are > 2, so that diagnostics don't
4731 get sent down them (which might cause Bison to hang, in theory).
4732 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
4733 * src/files.c (xfopen): Use fopen_safer, not fopen.
4734
51c30d21
PE
4735 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4736 yesterday's yacc.c fix.
4737
cea1469d
PE
47382005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4739
3ea5f0ec
PE
4740 * data/glr.c, data/lalr1.cc: Update copyright date.
4741
cea1469d
PE
4742 Fix a destructor bug reported by Wolfgang Spraul in
4743 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
4744 * data/yacc.c (yyabortlab): Don't call destructor, and
4745 don't set yychar to EMPTY.
4746 (yyoverflowlab): Don't call destructor.
4747 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
4748 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
4749 since we no longer output the message "discarding lookahead token
4750 end of input ()".
4751
5e6f62f2
PH
47522005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4753
4754 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
4755 fix a small glitch in debugging output.
4756 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
4757 after YY_SYMBOL_PRINT where needed.
4758
4759 (struct yyGLRState): Add some comments.
4760 (struct yySemanticOption): Add some comments.
4761 (union yyGLRStackItem): Add comment.
4762
4763 (yymergeOptionSets): Correct this to properly perform the union,
4764 avoiding infinite reported by Michael Rosien.
4765 Update comment.
4766
4767 * tests/glr-regression.at: Add test for GLR merging error reported
4768 by M. Rosien.
cea1469d 4769
0fb669f9
PE
47702005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4771
4772 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
4773 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
4774 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
4775 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
4776 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
4777 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
4778 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
4779 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
4780 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
4781 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
4782 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
4783 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
4784 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
4785 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
4786 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
4787 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
4788 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
4789 src/derives.h, src/files.c, src/files.h, src/getargs.c,
4790 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
4791 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
4792 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
4793 src/output.h, src/parse-gram.c, src/parse-gram.h,
4794 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
4795 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
4796 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
4797 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
4798 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
4799 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
4800 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
4801 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
4802 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
4803 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
4804 tests/reduce.at, tests/regression.at, tests/sets.at,
4805 tests/synclines.at, tests/testsuite.at, tests/torture.at:
4806 Update FSF postal mail address.
4807
51f4735e
PE
48082005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4809
4810 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4811 Problem reported by Ralf Menzel.
4812
80ce3401
PE
48132005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4814
4815 * tests/actions.at: Test that stack overflow invokes destructors.
4816 From Marcus Holland-Moritz.
4817 * data/yacc.c (yyerrlab): Move the code that destroys the stack
4818 from here....
4819 (yyreturn): to here. That way, destructors are called properly
4820 even if the stack overflows, or the user calls YYACCEPT or
4821 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
4822 (yyoverflowlab): Destroy the lookahead.
4823
48242005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4825
4826 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4827
72f000b0
PE
48282005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4829
4830 * NEWS: Bison-generated C parsers no longer quote literal strings
4831 associated with tokens.
4832 * src/output.c (prepare_symbols): Don't escape strings,
4833 since users don't want to see C escapes.
4834 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4835 in diagnostics.
c19683bb 4836 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
4837 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4838
1094323f
PE
48392005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4840
4841 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4842 the data size is known to be too small and we can't increase it.
4843 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4844
ca407bdf
PE
48452005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4846
4847 * src/parse-gram.y: Include quotearg.h.
4848 (string_as_id): Quote $1 before using it as a key, since the
4849 lexer no longer quotes it for us.
4850 (string_content): Don't strip quotes, since lexer no longer
4851 quotes it for us.
4852 * src/scan-gram.l: Include quotearg.h.
4853 ("\""): Omit quote.
4854 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4855 a key, since the rest of the lexer doesn't quote it.
4856 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4857 * tests/regression.at (Token definitions): Check for backslashes
4858 in token strings.
4859
4860 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4861 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4862 (yyparse): Revamp code to generate long syntax error message, to
4863 make it easier to translate, and to avoid problems with arithmetic
4864 overflow. Change "virtual memory" to "memory" in diagnostic, since
4865 we don't know whether the memory is virtual.
4866
1ce59070
PE
48672005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4868
4869 * NEWS: Bison-generated C parsers now use the _ macro to
4870 translate strings.
4871 * data/yacc.c (_) [!defined _]: New macro.
4872 All English strings wrapped inside this macro.
4873 * doc/bison.texinfo (Bison Parser): Document _.
4874 * po/POTFILES.in: Include src/parse-gram.c, since it now
4875 includes translateable strings that parse-gram.y doesn't.
4876
a749a695
PE
48772005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4880 reverting the 2004-10-11 change to this function.
4881 (symbol_check_alias_consistency): Don't call symbol_type_set
4882 if the type name is already correct.
4883 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4884
8fb1053b
PE
48852005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4886
4887 * tests/regression.at (Token definitions): Don't use a token named
4888 c, as that generates a "#define c ..." that runs afoul of buggy
4889 stdlib.h that uses the identifier c as a member of struct
4890 drand48_data. Problem reported by Horst Wente.
4891
ff498c4a
PE
48922005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4893
4894 * bootstrap: Change translation URL from
4895 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4896 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4897 redirection glitches. Problem reported by twlevo@xs4all.nl.
4898
65211d70
PE
48992005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4900
4901 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4902 after operands; POSIX says this isn't portable for the c99 command.
4903
9577fb1f
PE
49042005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4905
4906 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4907 immediately if a data overrun has occurred; this may help us track
4908 down what may be a spurious failure on MacOS.
4909
78b178f7
PE
49102005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4911
a2599d0f
PE
4912 Respond to problems reported by twlevo@xs4all.nl.
4913
4914 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4915
78b178f7
PE
4916 * src/vcg.h: Comment fix.
4917 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4918 (G_CMAX): Change to -1 instead of INT_MAX.
4919
4920 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 4921
7296e729
PE
49222005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4923
4924 * src/tables.c (state_number_to_vector_number): Put it inside an
4925 "#if 0", since it's not currently used. Problem reported by
4926 Roland McGrath.
4927
05ac60f3
PE
49282005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4929
4930 * src/output.c (escaped_output): Renamed from
4931 escaped_file_name_output, since we now use it for symbol tags as
4932 well. All uses changed.
4933 (symbol_destructors_output, symbol_printers_output):
4934 Escape symbol tags too.
4935 Problem reported by Matyas Forstner in
4936 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4937
4938 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4939 not needed.
4940 * src/output.c (user_actions_output, token_definitions_output,
4941 symbol_destructors_output, symbol_printers_output): Likewise.
4942 * src/reader.c (prologue_augment): Likewise.
4943 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4944
4945 * src/vcg.c (output_edge): Don't quote linestyle arg.
4946 Problem reported by twlevo@xs4all.nl.
4947
7eb453ac
PE
49482005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4949
4950 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4951 example, reported by Derek M Jones. Also, make the example even
4952 more outrageous, to better illustrate how bad the problem is.
4953
4c04c52a
PE
49542005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4955
4956 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4957 putsym. Typo reported by Sebastian Piping.
4958
a61e1620
PE
49592005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4960
4961 * doc/bison.texinfo (Language and Grammar): some -> same
4962 (Epilogue): int he -> in the
4963 Typos reported by Sebastian Piping via Justin Pence.
4964
9ec93868
PE
49652005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4966
4967 * tests/glr-regression.at (Improper handling of embedded actions
4968 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4969 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4970 with dollar signs in test names.
4971 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4972 for a similar reason.
4973
73ce7e7e
PE
49742005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4975
4976 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4977 wants to redefine G_VIEW.
4978
2e72b98e
PE
49792005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4980
4981 * src/vcg.c (get_view_str): Remove case for normal_view.
4982 Problem reported by twlevo@xs4all.nl.
4983
e0d634e5
PE
49842005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4985
ccf830a4
PE
4986 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4987 Problem reported by twlevo@xs4all.nl.
4988
e0d634e5
PE
4989 * doc/bison.texinfo: Change @dircategory from "GNU programming
4990 tools" to "Software development". Requested by Richard Stallman
4991 via Karl Berry.
4992
7bbc8cb0
PE
49932005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4994
4995 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4996 Problem reported by twlevo@xs4all.nl.
4997
08b770bc
PE
49982005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4999
5000 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
5001 keyword; it's not needed with modern compilers, and it doesn't
5002 affect correctness with older compilers. Suggested by
5003 twlevo@xs4all.nl.
5004
95f22ad2
PE
50052005-01-17 Paul Eggert <eggert@cs.ucla.edu>
5006
5007 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
5008 gcc -Wswitch-default.
5009 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5010 * data/yacc.c (yyparse): Likewise.
5011
d229d15c
PE
50122005-01-12 Paul Eggert <eggert@cs.ucla.edu>
5013
5014 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
5015 already. Let config.h define any nonstandard values.
5016
ecadd90f
PE
50172005-01-10 Paul Eggert <eggert@cs.ucla.edu>
5018
5019 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
5020 for the benefit of slower hosts. Problem reported by
5021 Nelson H. F. Beebe.
5022
213744b5
PE
50232005-01-07 Paul Eggert <eggert@cs.ucla.edu>
5024
5025 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
5026 being defined and not used.
5027 * data/lalr1.cc (yyparse): Likewise.
5028 Use "if (false)" rather than "if (0)".
5029
249d3236
PE
50302005-01-05 Paul Eggert <eggert@cs.ucla.edu>
5031
5032 * TODO: Mention that we should allow NUL bytes in tokens.
5033
987cc1fb
PE
50342005-01-02 Paul Eggert <eggert@cs.ucla.edu>
5035
5036 * src/scan-skel.l (<<EOF>>): Don't close standard output.
5037 Problem reported by Hans Aberg.
5038
08fe02d9
PE
50392005-01-01 Paul Eggert <eggert@cs.ucla.edu>
5040
5041 * src/getargs.c (version): Happy new year; update overall
5042 program copyright date from 2004 to 2005.
5043
5044 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
5045 Problem reported by Hans Aberg.
5046 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
5047 (Output file names.): Add a test for the case when standard output
5048 is closed.
5049
010c0266
PE
50502004-12-26 Paul Eggert <eggert@cs.ucla.edu>
5051
5052 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
5053 to fix an oversight in the Bison 2.0 manual.
5054
da12206a
PE
50552004-12-25 Paul Eggert <eggert@cs.ucla.edu>
5056
5057 * NEWS: Version 2.0. Reformat the existing news items since
5058 1.875, so that related items are grouped together.
3a4734aa 5059 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
5060 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
5061
c935d934
PE
5062 * tests/torture.at (Exploding the Stack Size with Alloca): Set
5063 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
5064 otherwise, we're not testing alloca. Unfortunately there's no
5065 simple way to consult HAVE_ALLOCA here.
5066
da12206a
PE
5067 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
5068 for yymsg, too.
5069
5070 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
5071 hand. This avoids a warning about comparing int to size_t when
5072 GCC warnings are enabled.
5073
0a2c5137
PE
50742004-12-22 Paul Eggert <eggert@cs.ucla.edu>
5075
d7e14fc0
PE
5076 * NEWS: Bison-generated parsers no longer default to using the
5077 alloca function (when available) to extend the parser stack, due
5078 to widespread problems in unchecked stack-overflow detection.
5079 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
5080 responsibility to set it to a positive value. This lets the user
5081 specify a value that is not a preprocessor constant.
5082 * data/yacc.c (YYMAXDEPTH): Likewise.
5083 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
5084 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
5085 to be a compile-time constant. However, explain the constraints on it.
5086 Also, explain the constraints on YYINITDEPTH.
5087 (Table of Symbols): Explain that alloca is no longer the default.
5088 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
5089 to 1.
5090
0a2c5137
PE
5091 * doc/bison.texinfo (Location Default Action): Mention that n must
5092 be zero when k is zero. Suggested by Frank Heckenbach.
5093
e019c247
AD
50942004-12-22 Akim Demaille <akim@epita.fr>
5095
5096 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
5097 (parser::state_type, parser::semantic_type, parser::location_type):
5098 Private, not public.
5099 (parser::parse): Return ints, not bool.
5100 Returning a bool introduces a problem: 0 corresponds to false, and
5101 it seems weird to return false on success. Returning true changes
5102 the conventions for yyparse.
5103 Alternatively we could return void and send an exception.
5104 There is no clear consensus (yet?).
5105 (state_stack, semantic_stack, location_stack): Rename as...
5106 (state_stack_type, semantic_stack_type, location_stack_type): these.
5107 Private, not public.
5108 * tests/c++.at: New.
5109 * tests/testsuite.at, tests/Makefile.am: Adjust.
5110
72731bb7
AD
51112004-12-21 Akim Demaille <akim@epita.fr>
5112
5113 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
5114
9a0d8bec
AD
51152004-12-21 Akim Demaille <akim@epita.fr>
5116
5117 Don't impose std::string for filenames.
5118
5119 * data/lalr1.cc (b4_filename_type): New.
5120 (position::filename): Use it.
5121 (parser.hh): Move the inclusion of stack.hh and location.hh below
5122 the user code, so that needed headers for the filename type can be
5123 included first.
72731bb7
AD
5124 Forward declare them before the user code.
5125 * tests/Makefile.am (check-local, installcheck-local): Pass
5126 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 5127
99880de5
AD
51282004-12-20 Akim Demaille <akim@epita.fr>
5129
5130 Use more STL like names: my_class instead of MyClass.
5131
5132 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5133 (SemanticStack, SemanticType, StateStack, StateType)
5134 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5135 (Parser::value): Rename as...
5136 (location_stack, location_type, rhs_number_type, semantic_stack)
5137 (semantic_type, state_stack, state_type, token_number_type, stack)
5138 (slice, traits, parser::yylloc, parser::yylval): these.
5139
5140 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5141
9bec482e
PE
51422004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5143
5144 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5145 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5146
f6fbd3da
PE
51472004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5148
5149 Remove uses of 'short int' and 'unsigned short int'. This raises
5150 some arbitrary limits. It uses more memory but nowadays that's
5151 not much of an issue.
5152
5153 This change does not affect the generated parsers; that's a different
5154 task, as some users will want to conserve memory there.
5155
5156 Ideally we should use size_t to represent all object counts, and
5157 something like ptrdiff_t to represent signed differences of object
5158 counts; but that will require more code-cleanup than I have the
5159 time to do right now.
5160
5161 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5162 Use size_t, not int or short int, to count objects.
5163 * src/closure.c (nritemset, closure): Likewise.
5164 * src/closure.h (nritemset, closure): Likewise.
5165 * src/nullable.c (nullable_compute): Likewise.
5166 * src/print.c (print_core): Likewise.
5167 * src/print_graph.c (print_core): Likewise.
5168 * src/state.c (state_compare, state_hash): Likewise.
5169 * src/state.h (struct state): Likewise.
5170 * src/tables.c (default_goto, goto_actions): Likewise.
5171
5172 * src/gram.h (rule_number, rule): Use int, not short int.
5173 * src/output.c (prepare_rules): Likewise.
5174 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5175 errs, reductions): Likewise.
5176 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5177 Likewise.
5178 * src/tables.c (vector_number, tally, action_number,
5179 ACTION_NUMBER_MINIMUM): Likewise.
5180 * src/output.c (muscle_insert_short_int_table): Remove.
5181
efeed023
AD
51822004-12-17 Akim Demaille <akim@epita.fr>
5183
5184 * data/lalr1.cc: Extensive Doxygenation.
5185 (error_): Rename as...
5186 (error): this, since it is visible to the user.
5187 Adjust callers.
5188 (Parser::message): Now an automatic variable from...
5189 (Parser::yyreport_syntax_error_): here.
5190 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5191 Parser::error.
5192 * tests/input.at: Escape $.
5193
bc82c5a5
PE
51942004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5195
5196 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5197 Parenthesize rhs to avoid obscure problems with mistakes like
5198 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5199 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5200 b4_rhs_location): Likewise.
5201 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5202 b4_rhs_location): Likewise.
5203
fd19f271
AD
52042004-12-16 Akim Demaille <akim@epita.fr>
5205
5206 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5207 yacc.c: be sure to stay within yycheck_.
5208 * tests/actions.at: Re-enable C++ tests.
5209
10454ea4
AD
52102004-12-16 Akim Demaille <akim@epita.fr>
5211
5212 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5213 real.
5214
c5b95ccf
AD
52152004-12-16 Akim Demaille <akim@epita.fr>
5216
5217 Use #define to handle the %name-prefix.
5218
5219 * data/glr.c, data/yacc.c: Comment changes.
5220 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5221 so that one can refer to yylex in the parser file, and have it
5222 renamed, as is the case with other skeletons.
5223
617a8f12
AD
52242004-12-16 Akim Demaille <akim@epita.fr>
5225
5226 Move lalr1.cc internals into yy*.
5227
5228 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5229 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5230 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5231 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5232 (empty_, final_, terror_, errcode_, ntokens_)
5233 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5234 (looka_, ilooka_, error_range_, nerrs_):
5235 Rename as...
5236 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5237 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5238 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5239 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5240 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5241 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5242 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5243 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5244 these.
5245
1e547e6e
PE
52462004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5247
5248 Fix some problems reported by twlevo at xs4all.
5249 * src/symtab.c (symbol_new): Report an error if the input grammar
5250 contains too many symbols. This is better than calling abort() later.
5251 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5252 (struct node, struct graph):
5253 Rename member expand to stretch. All uses changed.
5254 (struct graph): Remove member layoutalgorithm. All uses removed.
5255 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5256 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5257 All uses changed.
5258 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5259
735d6bd4
AD
52602004-12-15 Akim Demaille <akim@epita.fr>
5261
5262 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5263 Add more Doxygen comments.
5264 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5265 (report_syntax_error_, translate_): Rename as...
5266 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5267 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5268
2e1f5829
AD
52692004-12-15 Akim Demaille <akim@epita.fr>
5270
5271 * data/lalr1.cc (lex_): Rename as...
5272 (yylex_): this.
5273 Move the trace here.
5274 Take the %name-prefix into account.
5275 Reported by Alexandre Duret-Lutz.
5276
a3cb6248
AD
52772004-12-15 Akim Demaille <akim@epita.fr>
5278
5279 Simplify the C++ parser constructor.
5280
5281 * data/lalr1.cc (debug_): Rename as...
5282 (yydebug_): so that the parser's internals are always in the yy*
5283 pseudo namespace.
5284 Adjust uses.
5285 (b4_parse_param_decl): Remove the leading comma as it is now only
5286 called as unique argument list.
5287 (Parser::Parser): Remove the constructor accepting a location and
5288 an initial debugging level.
5289 Remove from the other ctor the argument for the debugging level.
5290 (debug_level_type, debug_level, set_debug_level): New.
5291
5292 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5293 constructor calls.
5294
07fed891
AD
52952004-12-15 Akim Demaille <akim@epita.fr>
5296
5297 Remove b4_root related material: failure experiment
a3cb6248 5298 (which goal was to allow to derive from a class).
07fed891
AD
5299
5300 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5301 definitions and uses.
5302
e603eaa5
PE
53032004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5304
5305 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5306 not 2, since it's not portable to subtract 1 from the start of an
5307 array. The new item 0 is never set or used. All uses changed.
5308
5309 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5310 the default definition of YYLLOC_DEFAULT. Problem reported
5311 by Frank Heckenbach.
5312
fafb007d
PE
53132004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5314
5315 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5316 the normal case and one for the error case. Just use the
5317 first one uniformly. Problem reported by Frank Heckenbach.
5318 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5319 use exactly the same macro in both places.
5320 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5321 so that the normal-case YYRHSLOC works for the error case too.
5322 All uses changed.
5323 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5324 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5325 * doc/bison.texinfo (Location Default Action): Don't claim that
5326 we have an array of locations. Use the same macro for both glr
5327 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5328 the index is 0.
5329
48814dcd
PE
53302004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5331
a4e1a53b
PE
5332 * HACKING: Update email addresses to send announcements to.
5333
48814dcd
PE
5334 * configure.ac (AC_INIT): Bump version to 1.875f.
5335
337116ba
PE
53362004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5337
5338 * NEWS: Version 1.875e.
5339 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5340
5341 * src/scan-skel.l: Include "complain.h", for "fatal".
5342
5343 * src/relation.h (relation_print, relation_digraph):
5344 Relation sizes are of type relation_node, not size_t (this is
5345 merely a doc fix, since the two types are equivalent).
5346 (relation_transpose): Relation sizes are of type relation_node,
5347 not int.
5348 * src/relation.c: Likewise.
5349 (top, infinity): Now of type relation_node, not int.
5350 (traverse, relation_transpose): Use relation_node, not int.
5351
5352 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5353 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5354 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5355
5356 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 5357 specifying whether the test should be skipped. Use it tp
337116ba 5358 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 5359 fail on some hosts, and should be skipped.
337116ba 5360
da2a7671
PE
53612004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5362
5363 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5364 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5365 unless otherwise specified below.
5366
5367 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5368 to allocate kernel_base, kernel_items, kernel_size, since
5369 they needn't be initialized to 0.
5370 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5371 * src/closure.c (new_closure): Likewise, for itemset.
5372 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5373 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5374 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5375 (build_relations): Likewise for edge, states1, includes.
5376 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5377 * src/reader.c (packgram): Likewise, for ritem, rules.
5378 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5379 * src/relation.c (relation_digraph): Likewise for VERTICES.
5380 (relation_transpose): Likewise for new_R, end_R.
5381 * src/symtab.c (symbols_token_translations_init): Likewise for
5382 token_translations.
5383 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5384 (token_actions): Likewise for yydefact, actrow, conflrow,
5385 conflict_list.
5386 (save_column): Likewise for froms[symno], tos[symno].
5387 (goto_actions): Likewise for state_count.
5388 (pack_table): Likewise for base, pos, check.
5389 (tables_generate): Likewise for width.
5390
5391 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5392 for initial core. Just have a separate core, so we needn't worry
5393 about whether kernel_size and kernel_base are initialized.
5394
5395 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5396 kernel_size, kernel_items): Remove unnecessary initialization.
5397 * src/conflicts.c (conflicts): Likewise.
5398 * src/derives.c (derives): Likewise.
5399 * src/muscle_tablc (muscle_insert): Likewise.
5400 * src/relation.c (relation_digraph): Likewise.
5401 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5402 conflrow, conflict_table, conflict_list, table, check):
5403 Likewise.
5404
5405 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5406 This is because all callers pass unsigned int.
5407 * src/closure.h (new_closure): Likewise.
5408
5409 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5410 (build_relations): Initialize includes[i] in all cases.
5411 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5412 and rules[ruleno].precsym. Initialize members in order.
5413 * src/relation.c (relation_transpose): Always initialize new_R[i]
5414 and end_R[i].
5415 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5416
5417 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5418 conflict_list[0] was always 0, but now it isn't initialized.
5419
5420 * src/table.c (table_grow): When conflict_table grew, the grown
5421 area wasn't cleared. Fix this.
5422
5423 * lib/.cvsignore: Add strdup.c, strdup.h.
5424 * m4/.cvsignore: Add strdup.m4.
5425
00baeeac
PE
54262004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5427
5428 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5429 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5430 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5431 ngotos + 1 without checking for overflow.
5432 (build_relations): Use END_NODE, not -1, to denote end of edges.
5433 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5434 build_relations): Use goto_number, not int, for goto numbers.
5435 * src/tables.c (save_column, default_goto): Likewise.
5436
be3d9d42
AD
54372004-11-23 Akim Demaille <akim@epita.fr>
5438
5439 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5440 of #defining from yystype.
5441 Don't typedef yystype, C++ does not need it.
5442 This lets it possible to forward declare it as union.
5443
78e526d5
PE
54442004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5445
5446 * bootstrap (gnulib_modules): Add extensions.
5447 Problem reported by Jim Meyering.
5448
afbb696d
PE
54492004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5450
5451 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5452 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5453 src/system.h, src/tables.c: XFREE -> free, to accommodate
5454 recent change to gnulib xalloc.h.
78e526d5 5455 Problem reported by Jim Meyering.
afbb696d 5456
c1f8f16a
AD
54572004-11-17 Akim Demaille <akim@epita.fr>
5458
5459 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5460
db7e5eb5 54612004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
5462 Alexandre Duret-Lutz <adl@gnu.org>
5463
5464 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5465 changes.
5466 (YYCDEBUG): Adjust.
5467 Use it instead of cdebug_.
5468 (Parser::debug_stream, Parser::set_debug_stream): New.
5469 (Parser::symprint_): Define cdebug_ for temporary backward
5470 compatibility.
5471 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5472 debug_stream ().
5473
68e11668
AD
54742004-11-17 Akim Demaille <akim@epita.fr>
5475
5476 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5477 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5478 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5479 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5480
97cbc73e
PE
54812004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5482
5483 * data/glr.c (yyloc_default): Remove; not used.
5484 Problem reported by Frank Heckenbach.
5485
e342c3be
AD
54862004-10-25 Akim Demaille <akim@epita.fr>
5487
5488 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5489 Introduce another definition to address simple location arrays.
5490 (yyGLRStack): New member: yyerror_range.
5491 (yyrecoverSyntaxError, yyparse): Update it.
5492 (yyrecoverSyntaxError): Use it when shifting the error token to
5493 have an accurate range, equivalent to the one computed by both
5494 yacc.c and lalr1.cc.
5495 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5496 that column numbers start at column 0, as per GNU Coding
5497 Standards, the others tests, and the doc.
5498 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5499 Adjust to the above change (first column is 0).
5500 And adjust the location of the "<error>", now covering the whole
5501 line.
5502
93602feb 55032004-10-22 Akim Demaille <akim@epita.fr>
04098407 5504 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
5505
5506 Remove some arbitrary limits on goto numbers and relations.
5507 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5508 initial values, since they're never used.
5509 (set_goto_map): ngotos is now unsigned, so test for overflow
5510 by seeing whether it wraps around to zero.
5511 * src/lalr.h (goto_number): Now size_t, not short int.
5512 (GOTO_NUMBER_MAXIMUM): Remove.
5513 * src/relation.c (relation_print, traverse, relation_transpose):
5514 Check for END_NODE rather than looking at sign.
5515 * src/relation.h (END_NODE): New macro.
5516 (relation_node): Now size_t, not short int.
5517
dba08b04
PE
55182004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5519
5520 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5521 keyword, not an identifier. Problem reported by Baron Schwartz in
5522 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5523
df09ef2e
AD
55242004-10-11 Akim Demaille <akim@epita.fr>
5525
5526 * src/symtab.c (symbol_check_alias_consistency): Also check
5527 type names, destructors, and printers.
5528 Reported by Alexandre Duret-Lutz.
5529 Recode the handling of associativity and precedence in terms
5530 of symbol_precedence_set.
5531 Accept no redeclaration at all, not even equal to the previous
5532 value.
5533 (redeclaration): New.
5534 Use it to factor redeclaration complaints.
5535 (symbol_make_alias): Don't set the type of the alias, let
5536 symbol_check_alias_consistency do it as for other features.
5537 * src/symtab.h (symbol): Add new member prec_location, and
5538 type_location.
5539 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5540 * tests/input.at (Incompatible Aliases): New.
5541
146bc99d
PE
55422004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5543
5544 .cvsignore fixes to accommodate gnulib changes,
5545 and the practice of naming build directories "_build".
5546 * .cvsignore: Add "_*". Sort.
5547 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5548 * m4/.cvsignore: Add "*_gl.m4".
5549
e503aa60
AD
55502004-10-06 Akim Demaille <akim@epita.fr>
5551
5552 * src/parse-gram.y (add_param): Fix the truncation of trailing
5553 spaces.
5554
b4a20338
AD
55552004-10-05 Akim Demaille <akim@epita.fr>
5556
5557 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5558 whether the reducion was empty or not. This leaves room to
5559 improve the use of YYLLOC_DEFAULT in such a case.
5560 lalr1.cc is still experimental, so changing this is acceptable.
5561 And finally, there are probably not many users who changed the
5562 handling of locations in GLR, so changing is admissible too.
5563
5564 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5565 empty reduction, set @$ to an empty location ending the previously
5566 stacked symbol.
5567 Adjust uses to make sure the code is triggered on empty
5568 reductions.
5569 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5570 expected output: empty reductions have empty locations.
5571
f85a5e6f
AD
55722004-09-29 Akim Demaille <akim@epita.fr>
5573
5574 * data/lalr1.cc: Move towards a more standard C++ coding style
5575 for templates: Class < T > -> Class<T>.
5576
b203fc2c
AD
55772004-09-29 Akim Demaille <akim@epita.fr>
5578
5579 * data/lalr1.cc: Reinstall the former ctor, for sake of
5580 compatibility, but warn it will be removed.
5581 Move towards a more standard C++ coding style (i.e., type *var ->
5582 type* var).
5583
5b7e1e73
PE
55842004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5585
3fee967f
PE
5586 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5587 since it's less likely to work if NULs are involved in the future.
5b7e1e73 5588
0dcca5c2
AD
55892004-09-27 Akim Demaille <akim@epita.fr>
5590
5591 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5592
6dde1c82
AD
55932004-09-27 Akim Demaille <akim@epita.fr>
5594
5595 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 5596 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
5597 and argument names.
5598 (b4_cc_constructor_call): Likewise.
5599
b233d555
AD
56002004-09-24 Akim Demaille <akim@epita.fr>
5601
5602 * src/parse-gram.y (add_param): Strip the leading and trailing
5603 blanks from a formal argument declaration.
5604 (YY_LOCATION_PRINT): New.
5605
619404e3
AD
56062004-09-24 Akim Demaille <akim@epita.fr>
5607
5608 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5609 after the location.
5610
dd8d9022
AD
56112004-09-24 Akim Demaille <akim@epita.fr>
5612
5613 * doc/bison.texinfo (Table of Symbols): Sort.
5614
0092f063
AD
56152004-09-21 Akim Demaille <akim@epita.fr>
5616
5617 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5618 the useless parentheses.
5619 Suggested by Paul Eggert.
5620
451364ed
AD
56212004-09-20 Akim Demaille <akim@epita.fr>
5622
5623 Let the initial-action act on the look-ahead, and use it for the
5624 "initial push" (corresponding to an hypothetical beginning-of-file).
5625 And let lalr1.cc honor %initial-action.
5626
5627 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5628 example.
5629 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5630 (Parser::Parser): Remove the ctor that used to initialize it.
5631 (Parser::parse): Like in the other skeletons, issue the "starting
5632 parse" message before any action.
5633 Honor %initial-action.
5634 Initialize the stacks with the lookahead.
5635 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5636 look-ahead.
5637 Push them in the stacks.
5638 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5639
18d192f0
AD
56402004-09-20 Akim Demaille <akim@epita.fr>
5641
5642 * doc/bison.texinfo (Initial Action Decl): New.
5643
b8458aa5
AD
56442004-09-20 Akim Demaille <akim@epita.fr>
5645
5646 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5647 clearer criterion to define it.
5648 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5649 When reducing on an empty RHS, use the latest stacked location as
5650 location.
5651 yylloc is not always available.
5652 * data/glr.c: Likewise.
5653 Also, honor initial-actions.
5654
3fc16193
AD
56552004-09-20 Akim Demaille <akim@epita.fr>
5656
5657 * data/yacc.c (YY_LOCATION_PRINT): New.
5658 Define when we know YYLTYPE's structure, i.e., when the default
5659 YYLLOC_DEFAULT is used.
5660 * data/c.m4 (b4_yysymprint_generate): Use it.
5661 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5662 value of the result.
5663 (error_start_): Replace with...
5664 (error_range_): this location array.
5665 This allows to replace code relying on the implementation of
5666 locations by portable code.
5667 * data/yacc.c (yylerrsp): Replace with...
5668 (yyerror_range): this.
5669 Every time a token is popped, update yyerror_range[0], to have an
5670 accurate location for the error token.
5671 * data/glr.c (YY_LOCATION_PRINT): New.
5672 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5673 deference a pointer.
5674 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5675 report the location in %printers.
5676
5677 * src/scan-skel.l: Instead of abort, report error messages to ease
5678 understanding skeleton scanning failures.
5679
ecfe33e7
AD
56802004-09-16 Akim Demaille <akim@epita.fr>
5681
5682 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5683 (iterator, const_iterator): these, to be more in the C++ spirit.
5684 Also, return reverse iterators so that when displaying the stack
5685 we display its bottom first.
5686 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5687 from yacc.c.
5688 We should probably use vector here though.
5689
1576d44d
AD
56902004-09-16 Akim Demaille <akim@epita.fr>
5691
5692 Have more complete shift traces.
5693
5694 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5695 to report Shifts instead of ad hoc YYDPRINTF invocations,
5696 including for the error token.
5697 * data/lalr1.cc (symprint_): Output the location.
5698 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5699 output the location within the %printer.
5700 Activate GLR tests, at least to make sure they compile properly.
5701 They still don't pass though.
5702 * tests/calc.at: Adjust expect verbose output, since now "Entering
5703 state..." is on a different line than the "Shifting" message.
5704
9c66f418
AD
57052004-09-08 Akim Demaille <akim@epita.fr>
5706
5707 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
5708 Bison directive from the Bison file to the invocation of this
5709 macro, so that these directives are passed to
5710 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
5711 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
5712 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
5713 the extra Bison directives instead of the whole series.
5714 Change the grammar so that there are recoverable errors, and
5715 unrecoverable errors. Now we can have the parser give up before
5716 consuming the whole input. As a result we now can observe that
5717 the lookahead is freed when needed.
5718 Change the parser source to parse argv[1] instead of a hard coded
5719 string.
5720 Simplify yylex, and give a value and location to EOF.
5721 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
5722 passed directives already coded in the file.
5723 Add some tests to check the location of "error".
5724 For some tests, the C++ parser is correct, and not yacc.c.
5725 For other tests, they provide different, but unsatisfying, values,
5726 so keep the C++ value so that at least one parser is "correct"
5727 according to the test suite.
5728 (Actions after errors): Remove, this is subsumed by the
5729 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
5730
52d5733f
AD
57312004-09-06 Akim Demaille <akim@epita.fr>
5732
5733 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 5734 (Parser::pop): New.
52d5733f
AD
5735 Use it.
5736
a0e68930
AD
57372004-09-06 Akim Demaille <akim@epita.fr>
5738
5739 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
5740 argument, an informative message.
5741 Call YY_SYMBOL_PRINT.
5742 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
5743 * data/lalr1.cc (destruct_): Likewise.
5744 In addition, no longer depend on b4_yysymprint_generate and
5745 b4_yydestruct_generate to generate these functions, do it "by
5746 hand".
5747
e757bb10
AD
57482004-09-03 Akim Demaille <akim@epita.fr>
5749
5750 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
5751 invoked, yydestruct the lookahead.
5752 * tests/calc.at (Calculator $1): Update the expected lengths of
5753 traces: there is an added line for the discarded lookahead.
5754 * doc/bison.texinfo (Destructor Decl): Some rewording.
5755 Define "discarded" symbols.
5756
0fe1f06d
AD
57572004-09-02 Akim Demaille <akim@epita.fr>
5758
5759 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5760
284acc8b
AD
57612004-09-02 Akim Demaille <akim@epita.fr>
5762
5763 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
5764 (YYDSYMPRINTF): Rename as...
5765 (YY_SYMBOL_PRINT): this.
5766 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
5767 two.
5768 Use it instead of direct symprint_ calls.
5769 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5770 one.
5771
a5eb1ed2
AD
57722004-09-02 Akim Demaille <akim@epita.fr>
5773
b7c72fe1
AD
5774 * data/lalr1.cc (b4_yysymprint_generate): New.
5775 (symprint_): New member function, defined when YYDEBUG.
5776 Use it consistently instead of token/nterm debugging output by
5777 hand.
a5eb1ed2
AD
5778 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5779 %printer calls to use cdebug_ when using lalr1.cc.
5780
417141dd
AD
57812004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5782
5783 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5784 with #ifdef YYDEBUG.
5785
2fa09258
AD
57862004-08-26 Akim Demaille <akim@epita.fr>
5787
5788 * doc/bison.texinfo (Implementing Loops): Rename as...
5789 (Implementing Gotos/Loops): this.
5790
9378b508
PE
57912004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5792
5793 Adjust to latest gnulib.
5794 * bootstrap (gnulib_modules): Add xalloc-die.
5795 Set LC_ALL=C so that file names sort consistently.
5796 Prefer the gnulib copies of gettext.m4, glibc21.m4,
5797 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
5798 uintmax_t.m4, ulonglong.m4.
5799 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
5800 po.m4 since we are now using _gl.m4 instead.
5801
87a8ad5c
PE
58022004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5803
5804 * src/scan-action.l: Remove. Scanning of semantic actions is
5805 handled in scan-gram.l.
5806
dca81a78
PE
58072004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5808
5809 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5810
5811 * src/location.h (struct): The file member is a uniqstr.
5812 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5813
c9cbf7c5
PE
58142004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5815
5816 Fix bug with non-%union parsers that have printers or destructors,
5817 which led to a Bison core dump. Reported by Peter Fales in
5818 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 5819
c9cbf7c5
PE
5820 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
5821 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
5822 not to our own type.
5823 * src/output.c (symbol_destructors_output, symbol_printers_output):
5824 Don't assume %union.
5825 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
5826 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
5827 UNION-FLAG. All callers changed.
5828 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
5829 Use type char, not unsigned int, when declaring an array of char;
5830 this lets us remove a cast.
5831 (Printers and Destructors): Add non-%union test cases.
5832
fa7e68c3
PE
58332004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5834
5835 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5836 GLR writeups. E.g., avoid frenchspacing and the future tense,
5837 change "lookahead" to "look-ahead", and change "wrt" to "with
5838 respect to".
2fa09258 5839
fa7e68c3
PE
58402004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5841
5842 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5843 New sections, split off from the GLR Parsers section. Put the new
5844 Simple GLR Parser near the start of the GLR section, for clarity.
5845 Rewrite connective text.
5846
99a9344e
PE
58472004-06-21 Frank Heckenbach <frank@g-n-u.de>
5848
5849 * doc/bison.texinfo (Simple GLR Parsers): New section.
5850
8dd162d3
PE
58512004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5852
5853 * NEWS, TODO, doc/bison.texinfo:
5854 Use "look-ahead" instead of "lookahead", to be consistent.
5855 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5856 while we're fixing "look-ahead".
5857 * src/conflicts.c (shift_set): Renamed from shiftset.
5858 (look_ahead_set): Renamed from lookaheadset.
5859 * src/print.c: Likewise.
5860 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5861 name for "lookahead".
5862 (report_types, usage): Likewise.
5863 * src/getargs.h (report_look_ahead_tokens): Renamed from
5864 report_lookaheads.
5865 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5866 compute_lookaheads.
5867 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5868 (look_ahead_tokens_print): Renamed from lookaheads_print.
5869 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5870 state_rule_lookaheads_print.
5871 * src/state.h: Likewise.
5872 (reductions.look_ahead_tokens): Renamed from lookaheads.
5873 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5874 AT_DATA_LOOKAHEADS_GRAMMAR.
5875
57a90331
PE
58762004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5877
5878 * README: Update location of patched M4 distribution.
5879
8ed3234a
PE
58802004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5881
5882 Don't assume the C++ compiler takes the same arguments as the C compiler
5883 (trivial change).
5884 * configure.ac (O0CXXFLAGS): New var.
5885 * tests/atlocal.in (CXXFLAGS): Use it.
5886
07971983
PE
58872004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5888
5889 Fix some "make check" problems with C++ reported by
5890 Albert Chin-A-Young for Tru64 C++ in this thread:
5891 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5892
5893 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5894 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5895 Output to a .cc file for C++, not to a .c file.
5896 * tests/calc.at (AT_CHECK_CALC): Likewise.
5897 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5898 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5899
29058652
PE
59002004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5901
5902 * tests/calc.at, tests/actions.at: Workaround for SGI
5903 C++ compiler. (trivial change)
5904
62cb8a99
PE
59052004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5906
fd418816
PE
5907 Spent a few hours checking out which prerequisite versions the
5908 current sources actually require. I went all the way back to
5909 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5910 a seemingly endless set of combinations of versions more recent
5911 than that. The bottom line is that the current sources require
5912 fairly recent versions of the build tools, and it'll be some work
5913 to change this.
5914 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5915 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5916 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5917 Add comments explaining why those particular versions are
5918 currently needed.
2fa09258 5919
62cb8a99
PE
5920 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5921 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 5922 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
5923
5924 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5925 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5926
caa52c10
PE
59272004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5928
5929 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5930 0.11.5. Suggested by Bruno Haible.
5931 * bootstrap: Remove gettext version checking.
5932
5933 * doc/bison.texinfo (Decl Summary): Also mention that %union
5934 can depend on prerequisite types. Problem reported by Tim
5935 Van Holder.
5936
4bfd5e4e
PE
59372004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5938
2cef3017
PE
5939 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5940 * README-alpha: Don't tell people not to package this.
5941
b9c85d5c
PE
5942 * bootstrap: Don't assume $(...) works; use `...` instead.
5943 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5944 gettext better.
5945
4bfd5e4e
PE
5946 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5947 put into the -d output file, and mention what to do if YYSTYPE is
5948 defined as a macro.
5949
6a36ff94
PE
59502004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5951
6712933e
PE
5952 Undo change made earlier today: it caused autopoint to not bring
5953 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5954 autopoint's.
5955
5956 * bootstrap: Check that gettext version matches what's in
5957 configure.ac. Warn users to ignore robots.txt ERROR 404.
5958 * bootstrap: Undo today's earlier change (logged below).
5959 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 5960
6a36ff94
PE
5961 The gettext version checking is causing more trouble than it's
5962 curing; remove it. Problem reported by Paul Hilfinger.
5963
5964 * bootstrap: Issue a warning that one can expect a message
5965 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5966 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5967
209ea708
PE
59682004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5969
5970 Ensure that the C++ compiler used for testing actually works on a
5971 simple test program; if not, skip the C++-related tests. Problem
5972 reported by Vin Shelton in:
161a71f3 5973 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
5974
5975 * m4/cxx.m4: New file.
5976 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5977 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5978 * tests/local.at (AT_COMPILE_CXX): Use it.
5979
41ca2549
PE
59802004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5981
383e69dc
PE
5982 * data/glr.c (yylloc): Output this macro even if locations are not
5983 being generated, as the GLR parser needs it even in that case.
5984 Problem reported by Troy A. Johnson
5985 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5986
41ca2549
PE
5987 * configure.ac (AC_INIT): Update to 1.875e.
5988
e476c87d
PE
59892004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5990
5991 * NEWS: Version 1.875d.
5992 * configure.ac (AC_INIT): Likewise.
5993 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5994
5995 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5996 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5997 lalr1.cc runs afoul of the first, and the last two are no longer
5998 supported by GCC 3.4.0.
5999 * README: Mention GNU m4 1.4 or later; mention m4 patches.
6000 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
6001
233a88ad
PE
60022004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6003
6004 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
6005 unsigned int, for compatibility with latest gnulib hash module.
6006 * src/state.c (state_hash, state_hasher): Likewise.
6007 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
6008 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 6009
12ffdd28
PE
60102004-05-03 Paul Eggert <eggert@cs.ucla.edu>
6011
6012 * NEWS: Unescaped newlines are no longer allowed in char & strings.
6013
6014 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
6015 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
6016 character and string literals.
6017 (unexpected_end): New function.
6018 (unexpected_eof): Use it.
6019 (unexpected_newline): New function.
6020 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
6021 actions.
e476c87d 6022
12ffdd28
PE
6023 * NEWS: Document %expect-rr.
6024
6025 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
6026 Fix typo by replacing $1 with $option.
6027 Remove more 'intl'-related files.
9668e2be 6028 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
6029
6030 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
6031 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
6032 strtoul.c.
6033 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
6034 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
6035 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
6036 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
6037 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
6038 * src/.cvsignore: Add *.output.
6039
6040 * src/parse-gram.y: Put copyright notice inside %{ %} so it
6041 gets copied to the output file.
e476c87d 6042
1f65350a
PE
60432004-04-28 Paul Eggert <eggert@twinsun.com>
6044
6045 Get files from the gnulib and po repositories, instead of relying
6046 on them being in our CVS. Upgrade to latest versions of gnulib
6047 and Automake.
6048
6049 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
6050 * bootstrap: Bootstrap from gnulib and po repositories.
6051 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
6052 * README-cvs: Document these changes. Remove version numbers from
6053 mentions of build tools, since they change so often. Mention Flex.
6054
6055 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
6056 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
6057 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
6058 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 6059 does this for us.
12ffdd28
PE
6060 (AC_ISC_POSIX): Remove; we no longer support this
6061 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
6062 (AC_HEADER_STDC): Remove: we now assume C89 or better.
6063 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
6064 Do not check for C89 headers, except for locale.h which is used
6065 by the Yacc library and must port to K&R hosts.
6066 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
6067 Do not check for C89 functions, except for setlocale which is
6068 used by the Yacc library.
6069 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
6070 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
6071 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
6072 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
6073 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
6074 AM_GNU_GETTEXT): Remove; now done by:
6075 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
6076 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
6077 for us.
6078
6079 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
6080 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
6081 Define to empty, as gnulib.mk will do the rest for us.
6082 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
6083 for us.
6084 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
6085 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
6086
6087 * src/files.c: Include gnulib's xstrndup.h.
6088
6089 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
6090 (REALLOC): Use xnrealloc, for likewise.
6091 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
6092 (strnlen, memrchr): Remove decls; functions no longer used.
6093 Include <stpcpy.h>.
6094
6095 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
6096 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6097 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
6098 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
6099 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
6100 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
6101 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
6102 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
6103 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
6104 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
6105 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
6106 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6107 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
6108 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
6109 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
6110 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
6111 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
6112 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
6113 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
6114 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
6115 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
6116 Remove, as these files are now generated automatically
6117 by bootstrap or automake.
6118
6119 * po/ChangeLog: Remove: all but one entry was a duplicate
6120 of this file, and I moved that 2000-11-02 entry here.
6121
6122 * config/.cvsignore: Add Makefile, depcomp, install-sh.
6123 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
6124 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
6125 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
6126 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6127 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6128 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6129 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6130 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6131 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6132 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6133 xstrndup.h.
6134 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6135 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6136 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6137 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6138 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6139 * src/.cvsignore: Remove *_.c.
6140
6141
6142 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6143 support it. (The latest stable gzip doesn't.)
6144
61452004-04-27 Paul Eggert <eggert@twinsun.com>
6146
6147 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6148 case, as stos_ is now used by destructors due to the 2004-02-09
6149 change.
6150
6151 Remove more K&R C support.
6152 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6153 * lib/subpipe.c (errno): Remove decl.
6154 Include <stdlib.h> unconditionally.
6155 (EXIT_FAILURE): Remove macro.
6156 * src/complain.c (vfprintf, strerror): Remove.
6157 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6158 unconditionally.
6159 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6160 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6161 (strchr, strspn, memchr): Remove decls.
6162 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6163 unconditionally. Do not declare perror.
6164 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6165 unconditionally.
6166
6167 * src/complain.c (_): Remove useless defn, as system.h defines this.
6168
6169 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6170 with latest obstack.h.
6171 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6172 to procedure types, as obstack.h now does that for us.
6173 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6174
6175 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6176 so that this include file can stand alone.
6177 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6178 does this now. Include subpipe.h first after config.h, to
6179 test whether it can stand alone.
6180
6181 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6182 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6183 unused declaration.
6184
6185 * tests/synclines.at (%union synch line): Put a dummy member in
6186 the union, because empty unions aren't allowed in C. Caught
6187 by GCC 3.4.0.
6188
4f16766c
PE
61892004-04-13 Jim Meyering <jim@meyering.net>
6190
6191 * src/conflicts.c (conflicts_print): Correct format string typo:
6192 use `%%' to produce literal `%'. (trivial change)
6193
779e7ceb
PE
61942004-03-30 Paul Eggert <eggert@twinsun.com>
6195
6196 * src/getargs.c (version): Update copyright year to 2004.
6197
6198 * data/c.m4 (b4_int_type): Use 'short int' rather than
6199 'short', and similarly for 'long', 'unsigned', etc.
6200 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6201 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6202 yy_yypstack, yydumpstack): Likewise.
6203 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6204 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6205 Likewise.
6206 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6207 yy_stack_print, yyparse): Likewise.
6208 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6209 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6210 * lib/bitset.c (bitset_print): Likewise.
6211 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6212 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6213 * lib/bitsetv.c (bitsetv_dump): Likewise.
6214 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6215 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6216 Likewise.
6217 * src/LR0.c (allocate_itemsets): Likewise.
6218 * src/gram.h (rule_number, rule): Likewise.
6219 * src/lalr.h (goto_number): Likewise.
6220 * src/nullable.c (nullable_compute): Likewise.
6221 * src/output.c (prepare_rules): Likewise.
6222 * src/relation.c (relation_print, relation_digraph): Likewise.
6223 * src/relation.h (relation_node): Likewise.
6224 * src/state.h (state_number, transitions, errs, reductions,
6225 struct state): Likewise.
6226 * src/symtab.h (symbol_number, struct symbol): Likewise.
6227 * src/tables.c (vector_number, tally, action_number,
6228 default_goto, goto_actions): Likewise.
6229 * tests/existing.at (GNU Cim Grammar): Likewise.
6230 * tests/regression.at (Web2c Actions): Likewise.
6231
6232 * src/output.c (muscle_insert_short_int_table): Renamed from
6233 muscle_insert_short_table. All uses changed.
6234
d6328241
PH
62352004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6236
6237 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6238 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6239 Add %expect-rr rule.
4f16766c 6240
d6328241
PH
6241 * src/scan-gram.l: Recognize %expect-rr.
6242
4f16766c 6243 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 6244 expected_conflicts.
4f16766c 6245 (expected_rr_conflicts): Declare.
d6328241
PH
6246
6247 * src/conflicts.c (expected_sr_conflicts): Rename from
6248 expected_conflicts.
6249 (expected_rr_conflicts): Define.
6250 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6251 for GLR parsers.
6252 Use expected_sr_conflicts in place of expected_conflicts.
6253 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 6254
d6328241 6255 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 6256
1452af69
PE
62572004-03-08 Paul Eggert <eggert@gnu.org>
6258
6259 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 6260 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
6261
6262 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6263 in lalr1.cc.
6264 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6265 * src/scan-gram.l (scan_integer): New function.
6266 ({int}): Use it.
6267 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6268 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6269 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6270 Say "long int", not "long", for uniformity with GNU style.
6271
006d217d
PE
62722004-02-25 Paul Eggert <eggert@twinsun.com>
6273
6274 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6275 compilers. This fixes a problem with Intel's C++ compiler being
6276 chatty, reported by Guido Trentalancia in
161a71f3 6277 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 6278
c2729758
ADL
62792004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6280
6281 Support %destructor and merge error locations in lalr1.cc.
6282
6283 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6284 (Parser::stos_): Define unconditionally.
6285 (Parser::destruct_): New method. Generate its body with
6286 b4_yydestruct_generate.
6287 (Parser::error_start_): New attribute.
6288 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6289 token which are discarded.
6290 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6291 error_start_ when erroneous token are discarded.
6292 (Parser::parse) <yyerrlab1>: Compute the location of the error
6293 token so that it covers all the discarded tokens.
6294 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6295 it can be called with `%skeleton "lalr1.cc"', and do that.
6296
dd0e0635
PE
62972004-02-02 Paul Eggert <eggert@twinsun.com>
6298
6299 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6300 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6301 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6302 There's no need to mention top_builddir since Automake does that
6303 for us.
6304 (INCLUDES): Remove, as Automake says it's obsolescent.
6305 Contents migrated into AM_CPPFLAGS as described above.
6306 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6307
63082004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6309
6310 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6311 (yyreportSyntaxError): Handle case where lookahead token is
6312 YYEMPTY.
6313
be16239b
PH
63142004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6315
6316 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6317 resulting parsers are compilable with C++.
6318
5fa90832
PE
63192003-12-23 Paul Eggert <eggert@twinsun.com>
6320
6321 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6322 * src/output.c (output_skeleton): Rename local var.
6323 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6324 Bison tokens, as this runs afoul of the 2003-10-07 change that
6325 disallowed NUL bytes in character constants or string literals.
6326
6327 * tests/local.at: Require Autoconf 2.59's Autotest.
6328 * tests/testsuite.at: Don't include local.at, since we now assume
6329 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6330 including it.
6331 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6332 multiple inclusion warnings.
dd0e0635 6333
b165c324
AD
63342003-12-02 Akim Demaille <akim@epita.fr>
6335
6336 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6337 conditions.
6338 From Bruno Haible.
6339
26e06a21
ADL
63402003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6341
6342 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6343
92ac3705
PE
63442003-10-07 Paul Eggert <eggert@twinsun.com>
6345
6a5ecb38
PE
6346 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6347 if testsuite doesn't exist.
6348
92ac3705
PE
6349 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6350 literals, unfortunately.
6351 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6352 Complain about NUL bytes in character constants or string literals.
6353
91d2c560
PE
63542003-10-05 Paul Eggert <eggert@twinsun.com>
6355
6356 * NEWS: Don't document %no-default-prec, as it's still
6357 too experimental.
6358 * doc/bison.texinfo: Document %no-default-prec only if
6359 the defaultprec flag is set. Normally it's not.
6360
0cc3da3a
PE
63612003-10-04 Paul Eggert <eggert@twinsun.com>
6362
6363 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6364 non-modifiable lvalue, instead of a modifiable one.
6365 * doc/bison.texinfo (Actions): Document that $$ can
6366 be assigned to. Do not claim that $$ and $N are
6367 array element references: user code should not rely on this.
6368
22fccf95
PE
63692003-10-01 Paul Eggert <eggert@twinsun.com>
6370
6371 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6372 (grammar_declaration): Use it.
6373 * src/scan-gram.l: New token %no-default-prec.
6374 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6375 * NEWS, doc/bison.texinfo: Document the above.
6376
fc8f2965
AD
63772003-10-01 Akim Demaille <akim@epita.fr>
6378
6379 VCG no longer supports long_straight_phase.
6380
6381 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6382 * src/print_graph.c (print_graph): Adjust.
6383
39a06c25
PE
63842003-09-30 Frank Heckenbach <frank@g-n-u.de>
6385 and Paul Eggert <eggert@twinsun.com>
6386
6387 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6388 Table of Symbols): Document %default-prec.
6389 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6390 (grammar_declaration): Set default_prec on %default-prec.
6391 * src/scan-gram.l (%default-prec): New token.
6392 * src/reader.h (default_prec): New flag.
6393 * src/reader.c: Likewise.
6394 (packgram): Handle it.
6395 * tests/conflicts.at (%default-prec without %prec,
6396 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 6397
39a06c25
PE
63982003-09-30 Paul Eggert <eggert@twinsun.com>
6399
6400 * tests/testsuite.at: Include local.at, not input.at, fixing
6401 a typo in the 2003-08-25 patch.
6402
62b6aef9
AD
64032003-08-27 Akim Demaille <akim@epita.fr>
6404
6405 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6406 GCC warnings.
6407
89e1cc61
AD
64082003-08-26 Akim Demaille <akim@epita.fr>
6409
6410 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6411 "<\#" to avoid magic from Gnus when posting parts of this script.
6412
a08460b0
AD
64132003-08-26 Akim Demaille <akim@epita.fr>
6414
6415 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6416 (Parser::parse): here.
6417 Adjust: nerrs and errstatus is now replaced by...
6418 (Parser::nerrs_, Parser::errstatus_): New.
6419
603f1cfd
AD
64202003-08-25 Akim Demaille <akim@epita.fr>
6421
6422 * config/announce-gen, Makefile.cfg: New.
6423 * Makefile.am: Adjust.
6424 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6425 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6426
cd3684cf
AD
64272003-08-25 Akim Demaille <akim@epita.fr>
6428
6429 When reducing initial empty rules, Bison parser read an initial
6430 location that is not defined. This results in garbage, and that
6431 affects Bison's own parser. Therefore we need (i) to extend Bison
6432 to support a means to initialize this location, and (ii) to use
6433 this CVS Bison to fix CVS Bison's parser.
6434
6435 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6436 with...
6437 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6438 * src/parse-gram.y: Adjust.
6439 (%initial-action): New.
6440 (%error-verbose): Since we require CVS Bison, there is no reason
6441 not to use it.
6442 * src/scan-gram.l: Adjust.
6443 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6444 * data/yacc.c (yyparse): Use b4_initial_action.
6445
4e03e201
AD
64462003-08-25 Akim Demaille <akim@epita.fr>
6447
6448 * doc/bison.texinfo: Don't promote stdout for error messages.
6449
8c182d05
AD
64502003-08-25 Akim Demaille <akim@epita.fr>
6451
6452 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6453 From Alexandre Duret-Lutz.
6454
6a60c4cf
PE
64552003-08-25 Akim Demaille <akim@epita.fr>
6456
6457 Version 1.875c.
6458
25f66e1a
AD
64592003-08-25 Akim Demaille <akim@epita.fr>
6460
6461 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6462 Use them.
6463
5348bfbe
AD
64642003-08-25 Akim Demaille <akim@epita.fr>
6465
6466 * data/lalr1.cc (Parser::reduce_print_): New.
6467 Use it.
6468
47301314
AD
64692003-08-25 Akim Demaille <akim@epita.fr>
6470
6471 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6472 error recovery loops. This patch is based on
161a71f3 6473 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
6474 Also, augment the similarity between lalr1.cc and yacc.c.
6475 Note: the locations of error recovery rules are not correct yet.
6476
6477 * data/lalr1.cc: Comment changes to augment the similarity between
6478 lalr1.cc and yacc.c.
6479 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6480 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6481 yyerrlab), when hitting EOF, pop the whole stack here instead of
6482 merely falling thru the default error handling mechanism.
6483 (yyerrorlab): New label, with the old contents of YYERROR,
6484 plus the following change: pop the stack of rhs corresponding
6485 to the production that invoked YYERROR. That is how Yacc
6486 behaves (required by POSIX).
6487 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6488 fail.
6489
1f7a61ff
AD
64902003-08-25 Akim Demaille <akim@epita.fr>
6491
6492 Tune local.at so that people can "autom4te -l autotest calc.at -o
6493 calc" for instance, to extract a sub test suite.
6494
6495 * tests/testsuite.at: Move the initialization, Autotest version
6496 requirement, and AT_TESTED invocation into...
6497 * tests/local.at: here.
6498 * tests/testsuite.at: Include it for compatibility with Autoconf
6499 2.57.
6500 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6501 be ignore.
6502
327b5b56
PE
65032003-08-04 Paul Eggert <eggert@twinsun.com>
6504
6505 Rework code slightly to avoid gcc -Wtraditional warnings.
6506 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6507 The returned value is now stored in *YY0. All callers changed.
6508 * src/output.c (merge_output): Adjust to the above change.
6509
0051e3ed
PE
65102003-07-26 Paul Eggert <eggert@twinsun.com>
6511
6512 * data/glr.c (YYASSERT): New macro.
6513 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6514 yyresolveStates, yyprocessOneStack):
6515 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6516 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 6517
137437c6
PE
65182003-07-25 Paul Eggert <eggert@twinsun.com>
6519
5b620e06
PE
6520 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6521 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 6522 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
6523 by Frank Heckenbach, though I have omitted the structure-initialization
6524 part of his glr-knr.diff patch since I recall that the Portable
6525 C Compiler didn't require that change.
6526
137437c6
PE
6527 Let the user specify how to allocate and free memory.
6528 Derived from a suggestion by Frank Heckenbach in
161a71f3 6529 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
6530 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6531 All uses of free, malloc, realloc changed to use these macros,
6532 and unnecessary casts removed.
6533 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6534
ddb85ca5
PE
65352003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6536
6537 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6538 use s.empty() rather than s == "" to test for empty string; see
161a71f3 6539 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
6540 (trivial change)
6541
39910e09
AD
65422003-06-25 Akim Demaille <akim@epita.fr>
6543
6544 * config/depcomp, config/install-sh: Update from masters.
6545
0ae99356
PE
65462003-06-20 Paul Eggert <eggert@twinsun.com>
6547
6548 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6549 and return properly parenthesized result.
6550 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6551 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6552 Remove unnecessary parentheses from uses.
6553 * doc/bison.texinfo (Location Default Action): Describe the
6554 conventions for parentheses.
6555
cd05d13c
PE
65562003-06-19 Paul Eggert <eggert@twinsun.com>
6557
81fd08ca
PE
6558 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6559 yyreportTree): Do not assume that size_t is the same width as int,
6560 when printing sizes. Print sizes using an unsigned format.
6561 Problem reported by Frank Heckenbach in
161a71f3 6562 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 6563
cd05d13c
PE
6564 Port to Forte Developer 7 C compiler.
6565 * data/glr.c (struct YYLTYPE): If locations are not being used,
6566 declare a single dummy member, as empty structs do not conform
6567 to the C standard.
6568 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6569 the Forte Developer 7 C compiler complains that end-of-loop
6570 code is not reached.
6571
4dcf140b
PE
65722003-06-17 Paul Eggert <eggert@twinsun.com>
6573
6574 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6575 avoid warnings from picky compilers about redefinition of PARAMS.
6576
8dd76bee
PE
65772003-06-17 Paul Eggert <eggert@twinsun.com>
6578
6579 Version 1.875b.
6580
6581 * NEWS: Document 1.875b.
6582
6583 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6584 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6585 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6586 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6587 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6588 per recent gettext manual's suggestion.
6589 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6590 Use prototypes, not old-style definitions.
6591 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6592 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6593 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6594 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6595 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6596 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6597 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6598 vbitset_or_and_cmp, vbitset_copy): Likewise.
6599
6600 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6601 Do not include <stdlib.h>.
6602 (PARAMS): Define unconditionally for C89.
6603 (ATTRIBUTE_NORETURN): Remove.
6604 (ATTRIBUTE_UNUSED): Define unconditionally.
6605
6606 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 6607 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
6608 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6609 * lib/vbitset.c, lib/vbitset.h: New files.
6610 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6611 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6612 from libbitset.
6613
6614 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6615 `How Can I Reset @code{yyparse}', since texinfo does not allow
6616 arbitrary @ in node names.
6617
6618 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6619 shouldn't be needed according to the gettext 0.12.1 documentation
6620 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 6621 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 6622 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 6623 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 6624
8dd76bee
PE
6625 * lib/.cvsignore: Add stdbool.h.
6626 * m4/.cvsignore: Add nls.m4, po.m4.
6627
6628 Upgrade to CVS gnulib.
6629 * stdbool_.h: File renamed from stdbool.h.in.
6630 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6631 AC_HEADER_STDBOOL.
6632 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6633 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6634 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6635 (MOSTLYCLEANFILES): New var.
6636 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6637 (stdbool.h): New rule.
6638 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6639 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6640 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6641 m4/quote.m4: Upgrade to today's gnulib.
6642
6643 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6644 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6645 the tests right now.
6646 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6647 yyerror are declared before use; C99 requires this.
6648
25005f6a
PH
66492003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6650
6651 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6652 first.
6653 (yyrecoverSyntaxError): Correct the logic for setting and testing
6654 yyerrState.
6655 Correct comment on handling EOF.
6656 Allow states with only a default reduction, rather than failing
8dd76bee 6657 (I can't quite reconstruct why these were not allowed before).
25005f6a 6658
137437c6 6659 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 6660 buffer overruns, corrupting state.
8dd76bee
PE
6661
6662 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
6663 definition.
6664 * src/reader.h (max_left_semantic_context): New variable declaration.
6665 * src/scan-gram.l (max_left_semantic_context): Define.
6666 (handle_action_dollar): Update max_left_semantic_context.
6667 * data/glr.c (YYMAXLEFT): New definition.
6668 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6669 (yyresolveAction): Ditto.
6670
6671 Fixes to problems with location handling in GLR parsers reported by
6672 Frank Heckenbach (2003/06/05).
6673
6674 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6675 (YYRHSLOC): Add parentheses, and define only if locations used.
6676 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6677 locations not used.
6678 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6679 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 6680
25005f6a
PH
6681 * tests/cxx-type.at: Exercise location information; update tests
6682 to differentiate output with and without locations.
8dd76bee 6683 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
6684 because default YYLTYPE not yet defined.
6685 Change semantic actions to compute strings, rather than printing
6686 them directly (to test proper passing of semantics values). Change
6687 output to prefix notation and update test data and expected results.
6688 (yylex): Track locations.
6689 (stmtMerge): Return value rather than printing, and include arguments
6690 in value.
8dd76bee 6691
711f40b7
PE
66922003-06-03 Paul Eggert <eggert@twinsun.com>
6693
6694 Avoid warnings generated by GCC 2.95.4 when Bison is
6695 configured with --enable-gcc-warnings.
6696 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6697 yy::]b4_parser_class_name[::translate_,
6698 yy::Stack::operator[] (unsigned),
6699 yy::Stack::operator[] (unsigned) const,
6700 yy::Slice::operator[] (unsigned),
6701 yy::Slice::operator[] (unsigned) const):
6702 Rename local vars to avoid warnings.
6703 * tests/glr-regression.at (Improper handling of embedded actions
6704 and $-N in GLR parsers): Remove unused local variable from yylex.
6705 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6706 (void) as arg when not pure, since we now assume C89 when building
6707 Bison. Pacify GCC by using parameter.
6708
ac695f7d
PE
67092003-06-02 Paul Eggert <eggert@twinsun.com>
6710
6711 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
6712 yy::Location::lines, yy::Location::columns): Rename arguments
6713 to avoid shadowing; this removes a warning generated by GCC 3.3.
6714
26ec81e0
PE
67152003-06-01 Paul Eggert <eggert@twinsun.com>
6716
6717 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
6718 to g++, as GCC 3.3 complains if you do it.
6719 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
6720 everything that WARNING_CFLAGS has, except omit warnings
6721 not suitable for C++.
6722 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
6723 * tests/atlocal.in (CXXFLAGS): New var.
6724 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
6725
6726 Fix a GLR parser bug I reported in February; see
161a71f3 6727 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
6728 The problem was that GLR parsers did not conform to the C standard,
6729 because actions like { $1 = $2 + $3; } expanded to expressions
6730 that invoked YYFILL in separate subexpressions, and YYFILL assigned
6731 to a local variable. The C standard says that expressions
6732 like (var = f ()) + (var = f ()) have undefined behavior.
6733 Another problem was that GCC sometimes issues warnings that
6734 yyfill and its parameters are unused.
6735
6736 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6737 as possibly unused.
6738 (yyfill): New function.
6739 (YYFILL): Use it.
6740 (yyuserAction): Change type of yynormal to bool, so that it matches
6741 the new yyfill signature. Mark it as possibly unused.
6742
6743
6744 Follow up on a bug I reported in February, where a Bison-generated
6745 parser can loop. Provide a test case and a fix for yacc.c. I
6746 don't have a fix for lalr1.cc or for glr.c, unfortunately.
6747 The original bug report is in:
161a71f3 6748 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
6749
6750 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
6751 macro's size was becoming unwieldy.
6752 (yyerrlab): Do not discard an empty lookahead symbol, as this
6753 might destroy garbage.
6754 (yyerrorlab): New label, with the old contents of YYERROR,
6755 plus the following change: pop the stack of rhs corresponding
6756 to the production that invoked YYERROR. That is how Yacc
6757 behaves, and POSIX requires this behavior.
6758 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
6759 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
6760 Define 'alarm' to do nothing if unistd.h is not available.
6761 Add a new rule "exp: '-' error;" to test the above change to
6762 data/yacc.c. Use 'alarm' to abort any test taking longer than
6763 10 seconds, as it's probably looping.
6764 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
6765 Also, the new yacc.c generates two fewer diagnostics for an
6766 existing test.
6767
d0829076
PE
67682003-05-24 Paul Eggert <eggert@twinsun.com>
6769
c6ae27df
PE
6770 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
6771 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
6772 This fixes a problem reported by John Bowman when the Compaq/HP
6773 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
6774 -ansi -Wall -gall).
6775 * data/yacc.c (union yyalloc): Likewise.
6776 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 6777
d0829076
PE
6778 Switch from 'int' to 'bool' where that makes sense.
6779
6780 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
6781 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
6782 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
6783 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
6784 Return or accept bool, not int. All callers changed.
6785 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
6786 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
6787 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
6788 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
6789 bitset_or_and_cmp_): Likewise.
6790 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
6791 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
6792 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
6793 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
6794 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
6795 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
6796 bitset_stats_or_and_cmp): Likewise.
6797 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
6798 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
6799 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
6800 ebitset_xor_cmp): Likewise.
6801 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
6802 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
6803 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
6804 lbitset_xor_cmp): Likewise.
6805 * lib/bbitset.h: Include <stdbool.h>.
6806 (struct bitset_vtable): The following members now return bool, not
6807 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
6808 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
6809 or_and_cmp).
6810 * src/conflicts.c (count_rr_conflicts): Likewise.
6811 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6812 All uses changed.
6813 * lib/ebitset.c (ebitset_obstack_init): Likewise.
6814 * lib/lbitset.c (lbitset_obstack_init): Likewise.
6815 * src/getargs.c (debug_flag, defines_flag, locations_flag,
6816 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6817 graph_flag): Likewise.
6818 * src/getargs.h (debug_flag, defines_flag, locations_flag,
6819 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6820 graph_flag): Likewise.
6821 * src/output.c (error_verbose): Likewise.
6822 * src/output.h (error_verbose): Likewise.
6823 * src/reader.c (start_flag, typed): Likewise.
6824 * src/reader.h (typed): Likewise.
6825 * src/getargs.c (LOCATIONS_OPTION): New constant.
6826 (long_options, getargs): Use it.
6827 * src/lalr.c (build_relations): Use bool, not int.
6828 * src/nullable.c (nullable_compute): Likewise.
6829 * src/print.c (print_reductions): Likewise.
6830 * src/tables.c (action_row, pack_vector): Likewise.
6831 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6832 * src/output.c (prepare): Use it.
6833 * src/output.c (token_definitions_output,
6834 symbol_destructors_output, symbol_destructors_output): Use string,
6835 not boolean integer, to keep track of whether to output separator.
6836 * src/print_graph.c (print_core): Likewise.
6837 * src/state.c (state_rule_lookaheads_print): Likewise.
6838
6839 * config/install-sh: Sync from automake 1.7.5.
6840
6b2584b7
PE
68412003-05-14 Paul Eggert <eggert@twinsun.com>
6842
6843 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6844 semicolon after a grammar declaration, in the interest of possible
6845 future changes to the Bison input language.
6846 Do not allow a stray semicolon at the start of the grammar.
6847 (rhses.1): Allow one or more semicolons after any rule, including
6848 just before "|" as required by POSIX.
6849 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6850 grammar.
6851
caf37a36
ADL
68522003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6853
6854 %parse-param support for lalr1.cc.
6855
6856 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6857 b4_cc_constructor_calls, b4_cc_constructor_call,
6858 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6859 definitions.
6860 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6861 parse-param arguments.
6862 (yy::b4_parser_class_name): Declare instance variables to
6863 hold parse-param arguments.
6864 * tests/calc.at: s/value/semantic_value/ because value clashes
6865 with a member of yy::b4_parser_class_name. Adjust C++ code
6866 to handle %parse-param. Enable %parse-param test in C++.
6867
3ab37077
PE
68682003-05-12 Paul Eggert <eggert@twinsun.com>
6869
6870 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6871 English a bit. Fix fclose typo. Change "const char" to "char
6872 const", and use ANSI C rather than K&R for "main". Suggest
6873 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6874 and suggest yy_switch_to_buffer.
6875
68762003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
6877
6878 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6879 C89. This avoids a diagnostic on compilers that define __STDC__
6880 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 6881 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 6882
e743727f
PE
68832003-05-03 Paul Eggert <eggert@twinsun.com>
6884
6885 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6886 Do not overrun array bounds.
6887 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 6888 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 6889
916708d5
AD
68902003-04-29 Akim Demaille <akim@epita.fr>
6891
6892 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6893 * src/getargs.c, src/getargs.h: here, as bool, not int.
6894 (nondeterministic_parser): New.
6895 * src/parse-gram.y, src/scan-gram.l: Support
6896 %nondeterministic-parser.
6897 * src/output.c (prepare): Use nondeterministic_parser instead
6898 of glr_parser where appropriate.
6899 * src/tables.c (conflict_row, action_row, save_row)
6900 (token_actions, token_actions, pack_vector): Ditto.
6901
a06ea4aa
AD
69022003-04-29 Akim Demaille <akim@epita.fr>
6903
6904 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6905
211074ca
AD
69062003-04-29 Akim Demaille <akim@epita.fr>
6907
6908 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6909 with %pure-parser and %locations to exercise the patch from Yakov
6910 Markovitch below.
6911
6175ffe3
PE
69122003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6913
6914 * data/yacc.c: (b4_lex_param): Corrected for the case where
6915 %lex-param is provided and %pure-parser isn't.
6916
b1e95857
PE
69172003-04-27 Paul Eggert <eggert@twinsun.com>
6918
6919 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 6920 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
6921 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6922 if it is not defined.
6923 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6924
acda9df6
PE
69252003-04-26 Paul Eggert <eggert@twinsun.com>
6926
3470c57b
PE
6927 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6928 Declare to be of type suitable for the ninf value itself, not of
6929 type suitable for the corresponding table, since the latter might
6930 be unsigned but the ninf value might be negative. This fixes a
6931 bug reported by Alexandre Duret-Lutz in
161a71f3 6932 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 6933
acda9df6
PE
6934 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6935 invokes it. We shouldn't invoke it twice because it will attempt
6936 to put error.o in the archive twice. This fixes a glitch reported
6937 by Martin Mokrejs in
161a71f3 6938 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 6939
b5250f26
PE
69402003-04-21 Paul Eggert <eggert@twinsun.com>
6941
6942 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6943 to gnulib.
6944
089ac0f1
PE
69452003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6946
6947 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6948 Fix obvious typo that results in uncompilable GLR parsers
6949 when both %pure-parser and %locations are used. (trivial change)
6950
5ededac6
PE
69512003-04-17 Paul Eggert <eggert@twinsun.com>
6952
1b8f2fff
PE
6953 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6954 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6955 Do not insert the expected token via unput, as this runs afoul
6956 of a POSIX-compatibility bug in flex 2.5.31.
6957 All uses changed to BEGIN the parent state,
6958 since we no longer insert the expected token via unput.
6959 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6960 that is no longer emitted after the above change.
6961
5ededac6
PE
6962 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6963 the first one. This change is from Paul Hilfinger, and it fixes
6964 regression reported by Werner Lemberg in
161a71f3 6965 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
6966
6967 (resolve_sr_conflict): Don't invoke state_errs_set
6968 unless one or more tokens have been explicitly made errors.
6969 Otherwise, the above change causes Bison to abort.
6970
6971 * tests/existing.at (GNU pic Grammar): New test case, taken from
6972 Lemberg's email.
6973
b8be9132
AD
69742003-03-31 Akim Demaille <akim@epita.fr>
6975
6976 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6977
d423d460
AD
69782003-03-31 Akim Demaille <akim@epita.fr>
6979
6980 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6981 output.
6982
c7e441b4
AD
69832003-03-31 Akim Demaille <akim@epita.fr>
6984
6985 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6986 From Paul Hilfinger.
6987
231897ad
AD
69882003-03-29 Akim Demaille <akim@epita.fr>
6989
6990 * m4/error.m4: Do not put under dynamic conditions some code which
6991 expansion is under static control.
6992
5b066063
AD
69932003-03-29 Akim Demaille <akim@epita.fr>
6994
6995 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6996
22a74fec
AD
69972003-03-29 Akim Demaille <akim@epita.fr>
6998
6999 * doc/bison.texinfo (Strings are Destroyed): New.
7000
0eee27e7
PE
70012003-03-13 Paul Eggert <eggert@twinsun.com>
7002
7003 * .cvsignore: Add configure.lineno.
7004 * src/.cvsignore: Add yacc.
7005 * tests/.cvsignore: Add testsuite.log.
7006 * doc/fdl.texi: Sync with latest FSF version.
7007
f61aad93
PE
70082003-03-12 Paul Eggert <eggert@twinsun.com>
7009
537636c7
PE
7010 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
7011 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
7012 cursor, instead of leaving it undefined. This fixes a bug
7013 reported by Tim Van Holder in
161a71f3 7014 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
7015 * tests/input.at (Torturing the Scanner): Test the scanner on
7016 an empty input file, which was Tim Van Holder's test case.
7017
7018 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
7019 <sys/resource.h> can be included, include sys/time.h and
7020 sys/times.h first, if available. This works around the SunOS
7021 4.1.4 porting bug reported by Bruce Becker in
161a71f3 7022 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
7023
7024 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
7025 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
7026 AC_HEADER_SYS_WAIT.
7027
f61aad93
PE
7028 Merge changes from gnulib. This was prompted because the CVS
7029 snapshot didn't build on Solaris 7 due to strnlen problems.
7030
7031 These changes need to be merged back into gnulib:
7032 * lib/hash.c: Include <stdbool.h> unconditionally.
7033 * m4/onceonly.m4 (m4_quote): New macro.
7034 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
7035 Quote AC_FOREACH variable-expansions properly.
7036 The 2003-01-03 obstack.h change also needs merging.
7037 {end of changes requiring merging}
5b066063 7038
f61aad93
PE
7039 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7040 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
7041 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
7042 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
7043 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
7044 New files, imported from gnulib.
7045 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
7046 above.
7047
7048 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
7049 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
7050 gnulib sources.
7051
7052 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
7053 Add.
7054 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
7055 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
7056 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
7057 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
7058 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
7059 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
7060 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
7061 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
7062 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
7063 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
7064 (jm_PREREQ_ARGMATCH): Remove.
7065 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
7066 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
7067
7068 * src/system.h: Include <stdbool.h> unconditionally.
7069
7070 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
7071 assuming at least C89 in the bitset code for some time now.
7072
d2ffe116
AD
70732003-03-03 Akim Demaille <akim@epita.fr>
7074
7075 * ro.po: New.
7076
052826fd
AD
70772003-03-02 Akim Demaille <akim@epita.fr>
7078
7079 * doc/bison.texinfo (Table of Symbols): Reactivate the
7080 documentation for %lex-param, and %parse-param.
7081
c4749565
AD
70822003-03-02 Akim Demaille <akim@epita.fr>
7083
7084 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
7085 generate verbose error messages.
7086 Use the number of tokens as an upper bound in yytname, as it
7087 cannot be a non terminal.
7088
d5286af1
AD
70892003-03-02 Akim Demaille <akim@epita.fr>
7090
7091 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
7092 message.
7093
22e304a6
AD
70942003-03-02 Akim Demaille <akim@epita.fr>
7095
22e304a6
AD
7096 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
7097 Use them to exercise yycheck overrun.
7098 Based on Andrew Suffield's grammar.
7099
67a25fed
AD
71002003-03-02 Akim Demaille <akim@epita.fr>
7101
7102 Create tests/local.at for Bison generic testing macros.
7103
7104 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
7105 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
7106 This new file.
7107 * tests/calc.at (AT_CHECK_CALC): Adjust.
7108 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
7109 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
7110 * tests/local.at: here.
7111 (AT_COMPILE_CXX): Tags the tests using it as c++.
7112 Ignore the test if CXX is not functional.
7113
9c2b381f
PE
71142003-03-01 Paul Eggert <eggert@twinsun.com>
7115
7116 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
7117 not loc->end, since loc->end might contain garbage and this leads
7118 to undefined behavior on some platforms.
7119 (id_loc, token_start): Use (IF_LINTed) initial values that do not
7120 depend on *loc, so that the reader doesn't give the the false
7121 impression that *loc is initialized.
7122 (<INITIAL>"%%"): Do not bother setting code_start, since its value
7123 does not survive the return.
7124
0433ba88
AD
71252003-03-01 Akim Demaille <akim@epita.fr>
7126
7127 * src/scan-gram.l (code_start): Always initialize it when entering
7128 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7129 yylex invocation. An alternative would be making it static, but
7130 then it starts with the second %%'s beginning, instead of its end.
7131
b305ea69
PE
71322003-02-28 Paul Eggert <eggert@twinsun.com>
7133
7134 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7135 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 7136 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 7137
c3d25e01
PE
71382003-02-26 Paul Eggert <eggert@twinsun.com>
7139
7140 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7141 Remove Sequent/Pyramid discussion (nobody uses them any more).
7142 Merge VMS and MS-DOS discussion; these ports may well be dead
7143 but let's keep mentioning them for now. Put <> around email
7144 addresses. Add copyright notice.
7145
c267ffbc
PE
71462003-02-24 Paul Eggert <eggert@twinsun.com>
7147
7148 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7149 to avoid collision with flex use of yylineno.
7150 Problem reported by Bruce Lilly in
161a71f3 7151 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
7152 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7153 * data/yacc.c (yy_reduce_print): Likewise.
7154
7155 * config/depcomp: Sync with Automake 1.7.3.
7156
f939fc12
AD
71572003-02-21 Akim Demaille <akim@epita.fr>
7158
7159 * data/lalr1.cc: Use temporary variables instead of casts to
7160 change integer types.
7161 Suggested by Paul Eggert.
7162
95923bd6
AD
71632003-02-21 Akim Demaille <akim@epita.fr>
7164
7165 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7166 to avoid confusions with lalr1.cc's notion of Position.
7167 Suggested by Paul Eggert.
7168
2cdc240e
AD
71692003-02-20 Akim Demaille <akim@epita.fr>
7170
7171 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7172 before initial_columns.
7173 (location.hh): Use consistent variable names when defining the
7174 operator<<.
7175 Use "last" so that we subtract from Positions, not from unsigned.
7176
5d003116
AD
71772003-02-20 Akim Demaille <akim@epita.fr>
7178
7179 * data/lalr1.cc (position.hh): New subfile, including the extended
7180 and Doxygen'ed documentation of class Position.
7181 (location.hh): Use it.
7182 Document a` la Doxygen.
ba1ecc07 7183 With the help of Benoit Perrot.
5d003116 7184
d02b25f9
AD
71852003-02-20 Akim Demaille <akim@epita.fr>
7186
7187 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7188 AT_YACC_IF.
7189 Redefine AT_YYERROR_SEES_LOC_IF using it.
7190 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7191 not defined.
7192 Don't use the location in yy::Parser::error_ and
7193 yy::Parser::print_ when not %locations.
7194 Activate more lalr1.cc tests.
7195
0d1c3a04
AD
71962003-02-19 Akim Demaille <akim@epita.fr>
7197
7198 * data/lalr1.cc: When displaying a line number, be sure to make it
7199 an int.
7200
60a777aa
AD
72012003-02-19 Akim Demaille <akim@epita.fr>
7202
7203 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7204 Remove, useless.
7205 (YYABORT, YYACCEPT, YYERROR): New.
7206 * tests/calc.at: Renable the lalr1.cc test.
7207
0b86fc41
AD
72082003-02-19 Akim Demaille <akim@epita.fr>
7209
7210 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7211 error recovery, mixing with/without pops and discarding of the
7212 lookahead.
7213 Exercise YYERROR.
7214 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7215
da99a5dc
PE
72162003-02-17 Paul Eggert <eggert@twinsun.com>
7217
7218 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7219 * tests/testsuite.at (AT_COMPILE): Use them.
7220 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 7221 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 7222
93b8c255
PE
72232003-02-12 Paul Eggert <eggert@twinsun.com>
7224
7225 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7226 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 7227 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
7228 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7229 Check for malloc failure, for consistency with yacc.c.
7230 (yytname_size): Remove, for consistency with yacc.c.
7231
7232 The bug still remains in data/lalr1.cc, as I didn't have time
7233 to fix it there.
7234
7548fed2
AD
72352003-02-06 Akim Demaille <akim@epita.fr>
7236
7237 * configure.ac (GXX): Rename as...
7238 (CXX): this, to keep the original Autoconf semantics.
7239 Require 2.57.
7240 * data/lalr1.cc: Fix b4_copyright invocations.
7241 If YYDEBUG is not defined, don't depend upon name_ being defined.
7242 (location.hh): Include string and iostream.
7243 (Position::filename): New member.
7244 (Position::Position ()): New.
7245 (operator<< (Position)): New.
7246 (operator- (Position, int)): New.
7247 (Location::first, Location::last): Rename as...
7248 (Location::begin, Location::end): these, to mock the conventional
7249 iterator names.
7250 (operator<< (Location)): New.
7251 * tests/atlocal.in (CXX): New.
7252 * tests/testsuite.at (AT_COMPILE_CXX): New.
7253 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7254 locations in a more synthetic way.
7255 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7256 lalr1.cc is used.
7257 Adjust the C locations to match those from Emacs: first column is
7258 column 0.
7259 Change all the expected results.
7260 Conform to the GCS: simplify the locations when applicable.
7261 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7262 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7263 these CPP macros with the m4 macros new defined by...
7264 (AT_CHECK_PUSHDEFS): this, i.e.:
7265 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 7266 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
7267 New macros.
7268 (AT_CHECK_POPDEFS): Undefine them.
7269 (AT_CHECK_CALC_LALR1_CC): New.
7270 Use it for the first lalr1.cc test.
7271
43a176ef
AD
72722003-02-04 Akim Demaille <akim@epita.fr>
7273
7274 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7275 Location as is defined.
7276
fc049e9c
AD
72772003-02-04 Akim Demaille <akim@epita.fr>
7278
7279 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7280 name_ being defined.
7281
a737b216
PE
72822003-02-03 Paul Eggert <eggert@twinsun.com>
7283
7284 * src/gram.h (start_symbol): Remove unused decl.
7285
7286 Use more-consistent naming conventions for local vars.
7287
7288 * src/derives.c (derives_compute): Change type of local var from
7289 int to rule_number.
7290 * src/gram.c (grammar_rules_partial_print): Likewise.
7291 * src/print.c (print_core): Likewise.
7292 * src/reduce.c (reduce_grammar_tables): Likewise.
7293
7294 * src/gram.c (grammar_dump): Change name of item_number *
7295 local var from r to rp.
7296 * src/nullable.c (nullable_compute): Likewise.
7297
7298 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7299
7300 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7301 for symbol or symbol_number var.
7302 * src/reader.c (grammar_start_symbol_set): Likewise.
7303 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7304 Likewise.
7305 * src/state.c (transitions_to): Likewise.
7306 * src/state.h: Likewise.
7307 * src/tables.c (symbol_number_to_vector_number): Likewise.
7308
7309 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7310 char * var.
7311
7312 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7313 var.
7314
7315 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7316 var.
7317
7318 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7319 Use str, not s, for char * var. Use ch, not c, for character var.
7320 Use size for size var.
7321
7322 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7323 char * var.
7324 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7325 uniqstr var.
7326 * src/uniqstr.h: Likewise.
7327
7328 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7329 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7330 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7331 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7332 param to have same name as that of enum, so that we don't use
7333 "s" to stand for a non-state.
7334
68e93ad5
AD
73352003-02-02 Akim Demaille <akim@epita.fr>
7336
7337 * src/scan-skel.l: Scan more than one inert character per yylex
7338 invocation.
7339
92898986
PE
73402003-02-01 Paul Eggert <eggert@twinsun.com>
7341
7342 Version 1.875a.
7343
1d9d5d71
PE
7344 * po/LINGUAS: Add ms.
7345
0435d061
AD
73462003-01-30 Akim Demaille <akim@epita.fr>
7347
7348 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7349
6029a57f
PH
73502003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7351
7352 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7353 of $1.
0435d061
AD
7354
7355 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 7356 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 7357 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 7358
6029a57f
PH
7359 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7360 (b4_rhs_location): Ditto.
0435d061 7361 (yyfill): New function to copy from stack tree into array
6029a57f 7362 incrementally.
0435d061
AD
7363 (yyuserAction): Modify to allow incremental move of semantic values
7364 to rhs array when in GLR mode.
7365 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
7366 as needed.
7367 Remove dummy use of yystack, as there is now a guaranteed use.
7368 (yydoAction): Modify to allow incremental move of semantic values
7369 to rhs array when in GLR mode.
7370 (yyresolveAction): Ditto.
7371 (yyglrShiftDefer): Update comment.
0435d061 7372 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
7373 (yyglrReduce): Ditto.
7374 (yydoAction): Ditto
0435d061 7375
6029a57f
PH
7376 * tests/glr-regr1.at: Rename to ...
7377 * tests/glr-regression.at: Add new regression test for the problems
7378 described above (adapted from S. Eken).
7379 Update copyright notice.
7380 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7381 * tests/Makefile.am: Ditto.
7382
6cee6297
PE
73832003-01-28 Paul Eggert <eggert@twinsun.com>
7384
7385 * data/lalr1.cc: Do not use @output_header_name@ unless
7386 b4_defines_flag is set. This fixes two bugs reported by
7387 Tim Van Holder in
161a71f3
PE
7388 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7389 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 7390
b2a836b5
PE
73912003-01-21 Paul Eggert <eggert@twinsun.com>
7392
7393 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7394 we don't need to worry about yyerrlab1 being reported as an
7395 "unused label" by non-GCC C compilers. The downside is that if
7396 locations are used then a couple of statements are duplicated each
7397 time YYERROR is invoked, but the upside is that the warnings
7398 should vanish.
7399 (yyerrlab1): Move code to YERROR.
7400 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7401 This reverts some of the 2002-12-27 change.
7402
4196b931
PE
74032003-01-17 Paul Eggert <eggert@twinsun.com>
7404
7405 * src/output.c (symbol_printers_output): Fix typo that led
7406 to core dump. Problem reported by Antonio Rus in
161a71f3 7407 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 7408
3ae831b4
AD
74092003-01-13 Akim Demaille <akim@epita.fr>,
7410 Quoc Peyrot <chojin@lrde.epita.fr>,
7411 Robert Anisko <anisko_r@lrde.epita.fr>
7412
7413 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7414 when the stacks contain one element, as the loop would otherwise
7415 free the last state, and then use the top state (the one we just
7416 popped). This means that the initial elements will not be freed
7417 explicitly, as is the case in yacc.c; it is not a problem, as
7418 these elements have fake values.
7419
e3aa65c5
PE
74202003-01-11 Paul Eggert <eggert@twinsun.com>
7421
7422 * NEWS: %expect-violations are now just warnings, reverting
7423 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7424 bootstrapping problem reported by Matthias Klose; see
161a71f3 7425 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
7426 * src/conflicts.c (conflicts_print): Likewise.
7427 * tests/conflicts.at (%expect not enough, %expect too much,
7428 %expect with reduce conflicts): Likewise.
7429 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7430 that the warning is enabled if the number of conflicts changes
7431 (not necessarily increases).
7432
7433 * src/getargs.c (version): Update copyright year.
7434
f0057011
AD
74352003-01-09 Akim Demaille <akim@epita.fr>
7436
7437 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7438
1ee6d2a0
PE
74392003-01-08 Paul Eggert <eggert@twinsun.com>
7440
7441 * Makefile.maint (WGETFLAGS):
7442 New macro, containing "-C off" to disable proxy caches.
7443 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7444 (rel-check): Use $(WGET) instead of wget.
7445
d4fd77c4
PE
74462003-01-06 Paul Eggert <eggert@twinsun.com>
7447
7448 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7449 the GLR paper of Scott, Johnstone and Hussain.
7450
464c6927
PE
74512003-01-04 Paul Eggert <eggert@twinsun.com>
7452
d600ee67
PE
7453 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7454 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7455 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7456 (EXTRA_LIBRARIES): New var, for liby.a.
7457 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7458 (EXTRA_SCRIPTS): New var, for yacc.
7459
464c6927
PE
7460 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7461 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7462 Problem reported by Nelson H. F. Beebe.
7463
74642003-01-03 Paul Eggert <eggert@twinsun.com>
7465
7466 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7467 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7468 when compiling Bison 1.875's `bitset bset = obstack_alloc
7469 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7470
7471 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7472 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7473 grow to a huge size with typical invocation.
d600ee67 7474
464c6927
PE
7475 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7476 Use the pattern recommended by Autoconf 2.57, except also protect
7477 against double-definition.
7478 * src/system.h: Likewise.
7479 Portability issues reported by Nelson H. F. Beebe.
d600ee67 7480
464c6927
PE
7481 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7482 All uses changed. Provide a definition in both C and C++.
7483 (yytrue, yyfalse): Define even if defined (__cplusplus).
7484
7485 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7486 Reported by Nelson H. F. Beebe.
d600ee67 7487
464c6927
PE
7488 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7489
0f42c7d5
PE
74902003-01-02 Paul Eggert <eggert@twinsun.com>
7491
7492 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7493 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7494 Bug reported by Nelson H. F. Beebe.
7495
dc546b0f
PE
74962003-01-01 Paul Eggert <eggert@twinsun.com>
7497
7498 * Version 1.875.
7499
2c09b6a7
PE
75002002-12-30 Paul Eggert <eggert@twinsun.com>
7501
7502 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7503 Moved here from...
7504 (<INITIAL>","): Here. This causes stray "," to be treated
7505 more uniformly.
7506
dc546b0f 7507 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
7508 last brace in braced code when not in Yacc mode, for compatibility
7509 with Bison 1.35. This resurrects the 2001-12-15 patch to
7510 src/reader.c.
7511
7512 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7513 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7514
535c0f63
PE
75152002-12-28 Paul Eggert <eggert@twinsun.com>
7516
7517 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7518 that of SYM's type. This fixes Debian bug 168069, reported by
7519 Thomas Olsson.
d600ee67 7520
963fcc17
PE
75212002-12-28 Paul Eggert <eggert@twinsun.com>
7522
7523 Version 1.75f.
7524
7525 Switch back to the Yacc style of conflict reports, undoing some
7526 of the 2002-07-30 change.
7527 * doc/bison.texinfo (Understanding): Use Yacc style for
7528 conflict reports. Also, use new way of locating rules.
7529 * src/conflicts.c (conflict_report):
7530 Renamed from conflict_report_yacc, removing the old
7531 'conflict_report'. Translate the entire conflict report at once,
7532 so that we don't assume that "," has the same interpretation in
7533 all languages.
7534 (conflicts_output): Use Yacc-style conflict report for each state,
7535 instead of our more-complicated style.
7536 (conflicts_print): Use Yacc-style conflict report, except print
7537 the input file name when not emulating Yacc.
7538 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7539 Conflicted Reduction, %expect not enough, %expect too much,
7540 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7541 * tests/existing.at (GNU Cim Grammar): Likewise.
7542 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7543
7544 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7545 fatal): Don't invoke fflush; it's not needed and it might even be
7546 harmful for stdout, as stdout might not be open.
7547 * src/reduce.c (reduce_print): Likewise.
7548
b1efe548
PE
75492002-12-27 Paul Eggert <eggert@twinsun.com>
7550
7551 Fix a bug where error locations were not being recorded correctly.
7552 This problem was originally reported by Paul Hilfinger in
161a71f3 7553 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
7554
7555 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7556 top of the location stack's error locations.
7557 (yyerrlab): Set it. When discarding a token, push its location
7558 onto yylerrsp so that we don't lose track of the error's end.
7559 (yyerrlab1): Now is only the target of YYERROR, so that we can
7560 properly record the location of the action that failed. For GCC
7561 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7562 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7563 (yyerrlab2): New label, which yyerrlab now falls through to.
7564 Compute the error's location by applying YYLLOC_DEFAULT to
7565 the locations of all the symbols that went into the error.
7566 * doc/bison.texinfo (Location Default Action): Mention that
7567 YYLLOC_DEFAULT is also invoked for syntax errors.
7568 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7569 Error locations include the locations of all the tokens that were
7570 discarded, not just the last token.
d600ee67 7571
983c5c2c
PE
75722002-12-26 Paul Eggert <eggert@twinsun.com>
7573
b1efe548
PE
7574 * src/files.c: Include quote.h.
7575 (compute_output_file_names): Warn if we detect conflicting
7576 outputs to the same file. This should catch the misunderstanding
7577 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7578
7579 * src/conflicts.c (conflicts_print): If the user specifies
7580 "%expect N", report an error if there are any reduce/reduce
7581 conflicts. This is what the manual says should happen.
7582 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7583 * tests/conflicts.at (%expect with reduce conflicts): New test.
7584
983c5c2c
PE
7585 Don't use m4_include on relative file names, as it doesn't work as
7586 desired if there happens to be a file with that name under ".".
d600ee67 7587
983c5c2c
PE
7588 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7589 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7590 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7591 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7592 * src/output.c (output_skeleton): Use full path names when
7593 specifying a file to include; don't rely on include path, as
7594 it's unreliable when the working file contains a file with
7595 that name.
d600ee67 7596
983c5c2c
PE
75972002-12-25 Paul Eggert <eggert@twinsun.com>
7598
7599 Remove obsolete references to bison.simple and bison.hairy.
7600 Problem mentioned by Aubin Mahe in
161a71f3 7601 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
7602 * data/glr.c: Comment fix.
7603 * doc/bison.1: Remove references. Also, mention "yacc".
7604
7605 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7606 with -g option.
7607
7608 * src/parse-gram.y (declaration): Use enum "report_states" rather
7609 than its numeric value 1.
7610
7611 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7612 opening a new one. This fixes Debian bug 165349, reported by
7613 Bruce Stephens.
7614
23f2d9dc
PE
76152002-12-24 Paul Eggert <eggert@twinsun.com>
7616
7617 Version 1.75e.
7618
7619 * Makefile.maint (cvs-update): Don't assume that the shell
7620 supports $(...), as Solaris sh doesn't.
7621
7622 * src/parse-gram.y (lloc_default): Remove test for empty
7623 nonterminals at the end, since it didn't change the result.
7624
76252002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
7626
7627 If the user does not define YYSTYPE as a macro, Bison now declares it
7628 using typedef instead of defining it as a macro. POSIX requires this.
7629 For consistency, YYLTYPE is also declared instead of defined.
7630
7631 %union directives can now have a tag before the `{', e.g., the
7632 directive `%union foo {...}' now generates the C code
7633 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7634 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7635 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7636 instead of `yyltype'.
7637
7638 `yystype' and `yyltype' are now obsolescent macros instead of being
7639 typedefs or tags; they are no longer documented and will be
7640 withdrawn in a future release.
7641
7642 * data/glr.c (b4_location_type): Remove.
7643 (YYSTYPE): Renamed from yystype.
7644 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7645 (struct YYLTYPE): Renamed from struct yyltype.
7646 (YYLTYPE): Renamed from yyltype.
7647 (yyltype, yystype): New (and obsolescent) macros,
7648 for backward compatibility.
7649 * data/yacc.c: Likewise.
7650
7651 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7652 does not specify a union tag. This is for compatibility with
7653 Solaris 9 yacc.
7654
7655 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7656 const *, since it is now modified by stripping surrounding { }.
7657 (current_braced_code): Remove.
7658 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7659 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7660 trailing " {...}". Now of type <chars>.
7661 (grammar_declaration): Adjust to bundled tokens.
7662 (code_content): Remove; stripping is now done by add_param.
7663 (print_token_value): Print contents of bundled tokens.
7664 (token_name): New function.
7665
7666 * src/reader.h (braced_code, current_braced_code): Remove.
7667 (token_name): New decl.
7668
7669 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7670 token_type, not braced_code code_kind. All uses changed.
7671 (SC_PRE_CODE): New state, for scanning after a keyword that
7672 has (or usually has) an immediately-following braced code.
7673 (token_type): New local var, to keep track of which token type
7674 to return when scanning braced code.
7675 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 7676 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
7677 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7678 instead of returning a token type immediately.
7679 (<INITIAL>"{"): Set token type.
7680 (<SC_BRACED_CODE>"}"): Use it.
7681 (handle_action_dollar, handle_action_at): Now returns bool
7682 indicating success. Fail if ! current_rule; this prevents a core dump.
7683 (handle_symbol_code_dollar, handle_symbol_code_at):
7684 Remove; merge body into caller.
7685 (handle_dollar, handle_at): Complain in invalid contexts.
7686
7687 * NEWS, doc/bison.texinfo: Document the above.
7688 * NEWS: Fix years and program names in copyright notice.
7689
879ca4f8
PE
76902002-12-17 Paul Eggert <eggert@twinsun.com>
7691
7692 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7693 Reporting, Table of Symbols): Omit mentions of %lex-param and
7694 %parse-param from the documentation for now.
7695
1c5fe69d
PE
76962002-12-15 Paul Eggert <eggert@twinsun.com>
7697
7698 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7699 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7700 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
7701 disagreed with the Bison documentation. Bug
7702 reported by Andrew Walrond.
d600ee67 7703
1c5fe69d
PE
7704 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7705 as the caller now does that.
7706 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7707 (YYEMPTY): Parenthesize right hand side, since others use it.
7708 (yyparse): Don't assume that our generated code is the only code
7709 that sets yychar.
7710
d1de5372
PE
77112002-12-13 Paul Eggert <eggert@twinsun.com>
7712
7713 Version 1.75d.
7714
7715 POSIX requires a "yacc" command.
7716 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7717 (MOSTLYCLEANFILES): Add yacc.
7718 (yacc): New rule.
1c5fe69d 7719 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
7720 as an alias for bison y.
7721
7722 * po/LINGUAS: Add da.
d600ee67 7723
d1de5372
PE
7724 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
7725 problem with latest <getopt.h>.
7726 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
7727
7728 * doc/fdl.texi: Upgrade to 1.2.
7729 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
7730 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
7731 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
7732 gnulib.
7733 * config/install-sh: Sync with autotools.
7734
7735 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 7736 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
7737 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
7738 locations are requested.
7739 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
7740 locations are requested.
7741
d0f3fe23
PE
77422002-12-12 Paul Eggert <eggert@twinsun.com>
7743
7744 Remove unportable casts and storage allocation tricks.
7745 While we're at it, remove almost all casts, since they
7746 usually aren't needed and are a sign of trouble.
7747
7748 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7749
7750 * src/derives.c (derives_compute): Do not subtract NTOKENS from
7751 the pointer DSET returned by malloc; this isn't portable.
7752 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
7753 Similarly for DERIVES.
7754 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
7755 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
7756 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
7757
7758 * src/derives.c (derives_compute): Do not bother invoking
7759 int_of_rule_number, since rule numbers are integers.
7760
7761 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7762 rather than XMALLOC (char, N).
7763
7764 * src/files.c (filename_split): Rewrite to avoid cast.
7765
7766 * src/gram.h (symbol_number_as_item_number,
7767 item_number_as_symbol_number, rule_number_as_item_number,
7768 item_number_as_rule_number):
7769 Now inline functions rather than macros, to avoid casts.
7770 * src/state.h (state_number_as_int): Likewise.
7771 * src/tables.c (state_number_to_vector_number,
7772 symbol_number_to_vector_number): Likewise.
7773
7774 * src/gram.h (int_of_rule_number): Remove; no longer used.
7775
7776 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7777 since the resulting storage is always stored into.
7778
7779 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7780 where it's needed.
7781
7782 * src/muscle_tab.c (muscle_m4_output):
7783 Now inline. Return bool, not int.
7784 * src/state.c (state_compare): Likewise.
7785 * src/symtab.c (symbol_check_defined,
7786 symbol_check_alias_consistency, symbol_pack, symbol_translation,
7787 hash_compare_symbol, hash_symbol):
7788 Likewise.
7789 * src/uniqstr.c (uniqstr_print): Likewise.
7790 * src/muscle_tab.c (muscle_m4_output_processor):
7791 New function, to avoid casts.
7792 * src/state.c (state_comparator, stage_hasher): Likewise.
7793 * src/symtab.c (symbol_check_defined_processor,
7794 symbol_check_alias_consistency_processor, symbol_pack_processor,
7795 symbol_translation_processor, hash_symbol_comparator,
7796 hash_symbol_hasher): Likewise.
7797 * src/uniqstr.c (uniqstr_print_processor): Likewise.
7798 * src/muscle_tab.c (muscles_m4_output):
7799 Use new functions instead of casting old functions unportably.
7800 * src/state.c (state_hash_new): Likewise.
7801 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
7802 symbols_token_translations_init):
7803 Likewise.
7804 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7805
7806 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
7807 var instead of casting to long, to avoid casts.
7808 (prepare_states): Use MALLOC rather than alloca, so that we don't
7809 have to worry about alloca.
7810 * src/state.c (state_hash_lookup): Likewise.
7811
7812 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7813 local var instead of casting to unsigned char, to avoid casts.
7814
7815 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
7816 STATE_ALLOC): Remove.
7817 (transitions_new, errs_new, reductions_new, state_new): Use malloc
7818 rather than calloc, and use offsetof to avoid allocating slightly
7819 too much storage.
7820 (state_new): Initialize all members.
7821
7822 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7823
7824 * src/symtab.c (symbol_free): Remove; unused.
7825 (symbol_get): Remove cast in lhs of assignment.
7826 (symbols_do): Now static. Accept generic arguments, not
7827 hashing-related ones.
7828
7829 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7830 (symbol_processor): Remove.
7831 (symbols_do): Remove decl; now static.
7832
7833 * src/system.h (alloca): Remove; decl no longer needed.
7834 (<stddef.h>): Include, for offsetof.
7835 (<inttypes.>, <stdint.h>): Include if available.
7836 (uintptr_t): New type, if system lacks it.
7837 (CALLOC, MALLOC, REALLOC): New macros.
7838 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7839 new macros.
7840
7841 * src/tables.c (table_size): Now int, to pacify GCC.
7842 (table_grow, table_ninf_remap): Use signed table size.
7843 (save_row): Don't bother initializing locals when not needed.
7844 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7845 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7846
7847 * src/vcg.h: Correct misspellings.
7848
7849 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7850
7851
7852 * src/getargs.c (getargs): Don't assume EOF == -1.
7853
26b4a969
PE
78542002-12-09 Paul Eggert <eggert@twinsun.com>
7855
7856 Change identifier spellings to avoid collisions with names
7857 that are reserved by POSIX.
7858
7859 Don't use names ending in _t, since POSIX reserves them.
7860 For consistency, remove _e and _s endings -- they're weren't
7861 needed to remove ambiguity. All uses changed.
7862 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7863 turn was just renamed from struniq_t.
7864 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7865 which in turn was just renamed from struniq_processor_t.
7866 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7867 in turn was renamed from hash_compare_struniq_t.
7868 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7869 (state_list): Renamed from state_list_t.
7870 * src/assoc.h (assoc): Renamed from assoc_t.
7871 * src/conflicts.c (enum conflict_resolution): Renamed from
7872 enum conflict_resolution_e.
7873 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7874 (rule_list): Renamed from rule_list_t.
7875 * src/getargs.h (enum trace): Renamed from enum trace_e.
7876 (enum report): Renamed from enum report_e.
7877 * src/gram.h (item_number): Renamed from item_number_t.
7878 (rule_number): Renamed from rule_number_t.
7879 (struct rule_s): Remove the "rule_s" part; not used.
7880 (rule): Renamed from rule_t.
7881 (rule_filter): Renamed from rule_filter_t.
7882 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7883 (goto_list): Renamed from goto_list_t.
7884 * src/lalr.h (goto_number): Renamed from goto_number_t.
7885 * src/location.h (location): Renamed from location_t.
7886 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7887 and moved here from:
7888 * src/muscle_tab.h (muscle_entry_t): here.
7889 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7890 (rule_list): Renamed from rule_list_t.
7891 * src/print_graph.c (static_graph): Renamed from graph.
7892 * src/reader.h (braced_code): Renamed from braced_code_t.
7893 Remove brace_code_e tag.
7894 * src/relation.h (relation_node): Renamed from relation_node_t.
7895 (relation_nodes): Renamed from relation_nodes_t.
7896 (relation): Renamed from relation_t.
7897 * src/state.h (state_number): Renamed from state_number_t.
7898 (struct state): Renamed from struct state_s.
7899 (state): Renamed from state_t.
7900 (transitions): Renamed from transitions_t. Unused (and
7901 misspelled) transtion_s tag removed.
7902 (errs): Renamed from errs_t. Unused errs_s tag removed.
7903 (reductions): Renamed from reductions_t. Unused tag
7904 reductions_s removed.
7905 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7906 (struct symbol_list): Renamed from struct symbol_list_s.
7907 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7908 (struct symbol): Renamed from struct symbol_s.
7909 (symbol): Renamed from symbol_t.
7910 * src/tables.c (vector_number): Renamed from vector_number_t.
7911 (action_number): Renamed from action_t.
7912 * src/tables.h (base_number): Renamed from base_t.
7913 * src/vcg.h (enum color): Renamed from enum color_e.
7914 (enum textmode): Renamed from enum textmode_e.
7915 (enum shape): Renamed from enum shape_e.
7916 (struct colorentry): Renamed from struct colorentry_s.
7917 (struct classname): Renamed from struct classname_s.
7918 (struct infoname): Renamed from struct infoname_s.
7919 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7920 (enum decision): Renamed from enum decision_e.
7921 (enum orientation): Renamed from enum orientation_e.
7922 (enum alignment): Renamed from enum alignment_e.
7923 (enum arrow_mode): Renamed from enum arrow_mode_e.
7924 (enum crossing_type): Renamed from enum crossing_type_e.
7925 (enum view): Renamed from enum view_e.
7926 (struct node): Renamed from struct node_s.
7927 (node): Renamed from node_t.
7928 (enum linestyle): Renamed from enum linestyle_e.
7929 (enum arrowstyle): Renamed from enum arrowstyle_e.
7930 (struct edge): Renamed from struct edge.
7931 (edge): Renamed from edge_t.
7932 (struct graph): Renamed from struct graph_s.
7933 (graph): Renamed from graph_t.
7934 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7935 Rename value_t -> value.
7936 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7937 value_t_as_yystype -> value_as_yystype.
7938
7939 Don't include <errno.h> in the mainstream code, since it
7940 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7941 * lib/get-errno.c, lib/get-errno.h: New files.
7942 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7943 get-errno.c.
7944 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7945 * src/output.c (output_skeleton): Likewise.
7946 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7947 instead of errno.
7948 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7949 Likewise.
7950 (handle_action_dollar, handle_action_at): Likewise.
7951 * src/system.h: Do not include <errno.h>.
7952 (TAB_EXT): Renamed from EXT_TAB.
7953 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7954
7955 Avoid str[a-z]*, since <string.h> reserves that name space.
7956 Change all instances of "struniq" in names to "uniqstr", and
7957 likewise for "STRUNIQ" and "UNIQSTR".
7958 * src/uniqstr.c: Renamed from src/struniq.c.
7959 * src/uniqstr.h: Renamed from src/struniq.h.
7960 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7961 * src/files.c (strsuffix): Remove; unused.
7962 (concat2): Renamed from stringappend. Now static.
7963 * src/files.h (strsuffix, stringappend): Remove; unused.
7964 * src/parse-gram.y (<chars>): Renamed from <string>.
7965 (<uniqstr>): Renamed from <struniq>.
7966 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7967 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7968 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7969 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7970 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7971 (N_EXPAND): Renamed from N_STRETCH.
7972
7973 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7974 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7975 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7976 Remove; unused.
7977 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7978 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7979 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7980 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7981 (BASE_MAXIMUM): Renamed from BASE_MAX.
7982 (BASE_MINIMUM): Renamed from BASE_MIN.
7983 (ACTION_MAX): Remove; unused.
7984 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7985 Unnecessary casts removed from above defines.
7986
7987
7988 Fix misspelling in names.
7989 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7990 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7991 G_NODE_ALIGNEMENT.
7992
7993
7994 * lib/timevar.c (timevar_report): Renamed from time_report,
7995 for consistency with other names.
7996 * lib/timevar.h (timevar_report): New decl.
7997 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7998
7999
8000 Sort include-file uses.
8001
8002 Reorder all include files under src to be in the order "system.h".
8003 then the ../lib include files in angle brackets (alphabetized),
8004 then the . include files in double-quotes (alphabetized). Fix
8005 dependency breakages encountered in this process, as follows:
8006 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
8007 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
8008 * src/state.h: Include "symtab.h".
8009
996b1c7e
PE
80102002-12-08 Paul Eggert <eggert@twinsun.com>
8011
8012 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
8013 since this causes problems when __file__ contains character
8014 sequences like "@" that are treated specially by src/scan-skel.l.
8015 Instead, just use the file's basename. This fixes the bug
8016 reported by Martin Mokrejs in
161a71f3 8017 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 8018
e19c4e5d
PE
80192002-12-06 Paul Eggert <eggert@twinsun.com>
8020
8021 Add support for rules that do not have trailing semicolons, as
8022 POSIX requires. Improve the quality of locations in Bison
8023 diagnostics.
26b4a969 8024
e19c4e5d
PE
8025 * src/location.c: Include <quotearg.h>.
8026 (empty_location): Now const.
8027 (location_print): New function. Follow the recommendation of the
8028 GNU Coding Standards for locations that span file boundaries.
8029 * src/location.h: Do not include <quotearg.h>; no longer needed.
8030 (boundary): New type.
8031 (location_t): Use it. This allows locations to span file boundaries.
8032 All member uses changed: file -> start.file or end.file (as needed),
8033 first_line -> start.line, first_column -> start.column,
8034 last_line -> end.line, last_column -> end.column.
8035 (equal_boundaries): New function.
8036 (LOCATION_RESET, LOCATION_STEP): Remove.
8037 (LOCATION_PRINT): Remove. All callers changed to use location_print.
8038 (empty_location): Now const.
8039 (location_print): New decl.
8040 * src/parse-gram.y (lloc_default): New function, which handles
8041 empty locations more accurately.
8042 (YYLLOC_DEFAULT): Use it.
8043 (%token COLON): Remove.
8044 (%token ID_COLON): New token.
26b4a969 8045 (rules): Use it.
e19c4e5d
PE
8046 (declarations, rules): Remove trailing semicolon.
8047 (declaration, rules_or_grammar_declaration):
8048 Allow empty (";") declaration.
8049 (symbol_def): Remove empty actions; no longer needed.
8050 (rules_or_grammar_declaration): Remove trailing semicolon.
8051 (semi_colon.opt): Remove.
8052 * src/reader.h: Include location.h.
8053 (scanner_cursor): New decl.
8054 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
8055 rolling our own.
8056 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
8057 of *loc.
8058 (STEP): Remove. No longer needed, now that adjust_location does
8059 the work. All uses removed.
8060 (scanner_cursor): New var.
8061 (adjust_location): Renamed from extend_location. It now sets
8062 *loc and adjusts the scanner cursor. All uses changed.
8063 Don't bother testing for CR.
8064 (handle_syncline): Remove location arg; now updates scanner cursor.
8065 All callers changed.
8066 (unexpected_end_of_file): Now accepts start boundary of token or
8067 comment, not location. All callers changed. Update scanner cursor,
8068 not the location.
8069 (SC_AFTER_IDENTIFIER): New state.
8070 (context_state): Renamed from c_context. All uses changed.
8071 (id_loc, code_start, token_start): New local vars.
8072 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
8073 processing of Yacc white space and equivalents here.
8074 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
8075 instead of returning ID immediately, since we need to search for
8076 a subsequent colon.
8077 (<INITIAL>"'", "\""): Save token_start.
8078 (<INITIAL>"%{", "{", "%%"): Save code_start.
8079 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
8080 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
8081 BEGIN context_state at end, not INITIAL.
8082 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
8083 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
8084 Return correct token start.
8085 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
8086 the start of a character, string or multiline comment is found.
8087 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
8088 Reduction): Adjust reported locations to match the more-precise
8089 results now expected.
8090 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
8091 * tests/reduce.at (Useless Rules, Reduced Automaton,
8092 Underivable Rules): Likewise.
8093 * tests/regression.at (Invalid inputs): No longer `expecting ";"
8094 or "|"' now that so many other tokens are allowed by the new grammar.
8095
8096 * src/complain.h (current_file): Remove duplicate decl;
8097 current_file is now owned by files.h.
8098 * src/complain.c, src/scan-gram.l: Include files.h.
8099
81002002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 8101
e19c4e5d
PE
8102 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
8103 promotes to int; it might be unsigned int.
8104 * data/yacc.c (yy_reduce_print): Likewise.
8105
8106 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
8107 be #defined in the prologue, not in the Bison declarations.
8108 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 8109
b64755e3
PE
81102002-12-02 Paul Eggert <eggert@twinsun.com>
8111
8112 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
8113 * lib/strtoul.c: New file, from gnulib.
8114 This fixes a porting bug reported by Peter Klein in
161a71f3 8115 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 8116
6e746484
PE
81172002-11-30 Paul Eggert <eggert@twinsun.com>
8118
b64755e3
PE
8119 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
8120 and put only a forward declaration in the prologue. This is for
8121 consistency with the other scanner helper functions.
8122
6ba55592
PE
8123 Type clashes now generate warnings, not errors, since it
8124 appears that POSIX may allow some grammars with type clashes.
8125 * src/reader.c (grammar_current_rule_check): Warn about
8126 type clashes instead of complaining.
8127 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8128
6e746484
PE
8129 Add Yacc library, since POSIX requires it.
8130 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8131 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8132 * lib/main.c, lib/yyerror.c: New files.
8133
8134 gram_error can be static; it need not be extern.
8135 * src/reader.h (gram_error): Remove decl.
8136 * src/parse-gram.y (gram_error): Now static. Add static decl.
8137 (print_token_value): Omit parameter names from forward decl,
8138 for consistency.
8139
88510f9c
PE
81402002-11-29 Paul Eggert <eggert@twinsun.com>
8141
6e746484
PE
8142 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8143 be declared before being used. E.g., one should typically
8144 declare them in the prologue. Use GNU coding style in examples.
8145 Put "const" consistently after the type it modifies. Mention
8146 that C99 supports "inline". Mention that yyerror traditionally
8147 returns "int".
8148
88510f9c
PE
8149 %parse-param and %lex-param now take just one argument, the
8150 declaration; the argument name is deduced from the declaration.
8151
8152 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8153 Reporting, Table of Symbols): Document this.
8154 * src/parse-gram.y (add_param): New function.
8155 (COMMA): Remove.
8156 (declaration): Implement new rule for %parse-param and %lex-param.
8157 * src/scan-gram.l: "," now elicits a warning, rather than being
8158 a token; this is more compatible with byacc.
8159 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8160
bb92250c
PE
81612002-11-27 Paul Eggert <eggert@twinsun.com>
8162
8163 Rename identifiers to avoid real and potential collisions.
8164
8165 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8166 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 8167 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
8168 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8169 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8170 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8171 All uses changed.
8172 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8173 The name "yycontrol" violates the name space rules, and this stuff
8174 wasn't being used anyway.
8175 (input): Remove action; this stuff wasn't being used.
8176 (gram_error): Rename local variable yylloc -> loc.
8177 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8178 (YY_DECL): Don't use "yy" at start of local variables.
8179 All uses changed, e.g., yylloc -> loc.
8180 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8181 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8182 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8183 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8184
8185 * src/parse-gram.y (gram_error): loc is now const *.
8186 * src/reader.h (gram_error): Likewise.
8187
3af4feb2
PE
81882002-11-24 Paul Eggert <eggert@twinsun.com>
8189
8190 Version 1.75c.
8191
8192 * tests/actions.at (Actions after errors): Use an output format
8193 more similar to that of the Printers and Destructors test.
8194 Test the position of the ';' token too.
8195 (Printers and Destructors): Likewise.
8196 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8197 unnecessarily alarming people when the test fails.
8198
8199 * data/yacc.c (yyerrlab1): Move this label down, so that the
8200 parser does not discard the lookahead token if the user code
8201 invokes YYERROR. This change is required for POSIX conformance.
8202
8203 * lib/error.c: Sync with gnulib.
8204
82052002-11-22 Paul Eggert <eggert@twinsun.com>
8206
8207 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8208 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8209 * lib/xmalloc.c: Likewise.
26b4a969 8210
58004308
PE
82112002-11-20 Paul Eggert <eggert@twinsun.com>
8212
8213 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8214
82152002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 8216
58004308
PE
8217 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8218 should use `if (! x) abort ();' rather than `assert (x);', and
8219 anyway it's one less thing to worry about configuring.
8220
8221 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8222 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8223 and replace all instances of assert with abort.
8224 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8225 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8226
8227 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8228 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8229 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8230 hash_find_entry, hash_rehash, hash_insert): Likewise.
8231 * src/conflicts.c (resolve_sr_conflict): Likewise.
8232 * src/lalr.c (set_goto_map, map_goto): Likewise.
8233 * src/nullable.c (nullable_compute): Likewise.
8234 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8235 * src/reader.c (packgram, reader): Likewise.
8236 * src/state.c (state_new, state_free, state_transitions_set,
8237 state_reduction_find): Likewise.
8238 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8239 symbol_pack): Likewise.
8240 * src/tables.c (conflict_row, pack_vector): Likewise.
8241 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8242 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8243 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8244 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8245
8246 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8247 (ARGMATCH_CONSTRAINT): New macro.
8248 (ARGMATCH_ASSERT): Use it.
8249
8250 * src/system.h (verify): New macro.
8251 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8252 rather than assert.
8253 * src/tables.c (tables_generate): Likewise.
8254
8255 * src/struniq.c (struniq_assert): Now returns void, and aborts
8256 if the assertion is false.
8257 (struniq_assert_p): Remove.
8258 * src/struniq.h: Likewise.
8259
76ae8198
PE
82602002-11-18 Paul Eggert <eggert@twinsun.com>
8261
8262 * data/glr.c (yygetLRActions): Replace `yyindex' with
8263 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8264 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 8265 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 8266
d3c4e709
AD
82672002-11-18 Akim Demaille <akim@epita.fr>
8268
8269 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8270 space.
8271 From Tim Van Holder.
8272
8d8a7238
PE
82732002-11-17 Paul Eggert <eggert@twinsun.com>
8274
8275 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8276 to "SyntaxError" for consistency with my 2002-11-15 change.
8277
8278 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8279 not define to {}, since this breaks the common use of `YYDPRINTF
8280 ((...));' if a single statement is desired (e.g. before `else').
8281 Work around GCC warnings by surrounding corresponding calls with
8282 {} if needed.
8283 (yyhasResolvedValue): Remove unused function.
8284 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8285 loop body.
8286 (yyreportSyntaxError): Renamed from yyreportParseError.
8287 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8288 All uses changed.
8289 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8290 extern when possible. Remove unused initializations.
8291
b0937b22
AD
82922002-11-16 Akim Demaille <akim@epita.fr>
8293
8294 Augment the similarity between GLR and LALR traces.
8295
8296 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8297 (YY_REDUCE_PRINT): New.
8298 (yyparse): Use them.
8299 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8300 YYDPRINT here.
8301 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8302 state reached after the reduction/recovery, since...
8303 (yyparse, yyprocessOneStack): Report the state we are entering in.
8304
c5e3e510
AD
83052002-11-16 Akim Demaille <akim@epita.fr>
8306
8307 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8308 Add support for --trace=skeleton.
8309 * src/scan-skel.l: %option debug.
8310 Scan strings of non-@ or \n instead of character by character.
8311 (scan_skel): Handle trace_skeleton.
8312 (QPUTS): New.
8313 (@output_parser_name@, @output_header_name@): ``Restore'' their
8314 support (used to be M4 macros).
8315 * data/yacc.c: Quote larger chunks, a la glr.c.
8316 * data/lalr1.cc: Likewise.
8317 The header guards are no longer available, so use some other
8318 string than `YYLSP_NEEDED'.
8319
4c6cc1db
AD
83202002-11-16 Akim Demaille <akim@epita.fr>
8321
8322 Make the ``Printers and Destructors'' test more verbose, taking
8323 `yacc.c''s behavior as (possibly wrong) reference.
8324
8325 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8326 instead of fprint on stdout.
8327 Set and report the last_line of the symbols.
8328 Consistently display values and locations.
8329
6d9e8019
PE
83302002-11-16 Paul Eggert <eggert@twinsun.com>
8331
8332 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8333
6e649e65
PE
83342002-11-15 Paul Eggert <eggert@twinsun.com>
8335
b25d88f6
PE
8336 * tests/actions.at (Actions after errors): New test case.
8337
6e649e65
PE
8338 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8339 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8340 tests/action.at, tests/calc.at, tests/conflicts.at,
8341 tests/cxx-type.at, tests/regression.at:
8342 "parse error" -> "syntax error" for POSIX compatibility.
8343 "parsing stack overflow..." -> "parser stack overflow" so
8344 that code matches Bison documentation.
8345
0f39aab9
AD
83462002-11-15 Akim Demaille <akim@epita.fr>
8347
8348 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8349 take two BRACED_CODE, not two string_content.
8350 Free the scanner's obstack when we are done.
8351 (code_content): New.
8352 * tests/calc.at: Adjust.
8353 * doc/bison.texinfo: Adjust.
8354 Also, make sure to include the `,' for these declarations.
8355
761c1926
AD
83562002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8357
8358 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8359 definition; avoids potential autoreconf problems.
8360
b0f98b10
AD
83612002-11-15 Akim Demaille <akim@epita.fr>
8362
8363 Always check the value returned by yyparse.
8364
8365 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8366 returned by yyparse.
8367 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8368 Adjust calls.
8369 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8370 returned by yyparse.
8371
970785f1
PH
83722002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8373
8374 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8375 on input.at test.
8376
8fcc7db1
PE
83772002-11-14 Paul Eggert <eggert@twinsun.com>
8378
7ec1b48e
PE
8379 * src/output.c (output_skeleton): Call xfopen instead of
8380 duplicating xfopen's body.
8381
cfff7583 8382 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 8383 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 8384
8fcc7db1
PE
8385 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8386 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8387 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8388 file twice in the grammar, as an extra check.
8389
8390 * tests/input.at (Torturing the Scanner): Surround the
8391 backslash-newline tests with "#if 0", to make it less likely that
8392 we'll run into compiler bugs. Bring back solitary \ inside
8393 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 8394 test backslash-newline in C character constant.
8fcc7db1 8395
4e8d992c
AD
83962002-11-14 Akim Demaille <akim@epita.fr>
8397
8398 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8399 status of the compiler.
f32b346d 8400 Calling `exit 1' is no longer needed.
4e8d992c
AD
8401 Reported by Nelson H. F. Beebe.
8402
9501dc6e
AD
84032002-11-14 Akim Demaille <akim@epita.fr>
8404
8405 * tests/atlocal.in (CPPFLAGS): We have config.h.
8406 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8407 New.
8408 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8409 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8410 * tests/regression.at, tests/torture.at: Use them for all the
8411 grammars that are to be compiled.
8412 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8413 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8414 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8415
18b519c0
AD
84162002-11-14 Akim Demaille <akim@epita.fr>
8417
8418 * doc/bison.texinfo: Various formatting changes (alignments in
8419 samples, additional @group/@end group, GCS in samples.
8420 Use @deffn instead of simple @table to define the directives,
8421 macros, variables etc.
8422
9a86cdb9
PE
84232002-11-13 Paul Eggert <eggert@twinsun.com>
8424
daa33def 8425 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 8426 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 8427
daa33def 8428 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 8429 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
8430 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8431 * tests/headers.at (export YYLTYPE): Likewise.
8432
8433 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 8434 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 8435
9a86cdb9
PE
8436 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8437 comments, since they're not portable. Use GNU coding style.
8438
9c1e26bd
AD
84392002-11-13 Akim Demaille <akim@epita.fr>
8440
8441 * data/yacc.c: Leave bigger chunks of quoted text.
8442 (YYDSYMPRINTF): New.
8443 Use it to report symbol activities.
8444 * data/glr.c (YYDSYMPRINTF): New.
8445 Use it.
8446
87f721cc
PE
84472002-11-12 Paul Eggert <eggert@twinsun.com>
8448
8449 Version 1.75b.
8450
8451 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8452 (yyglrReduce): Return yyok, not 0.
8453 This should avoid the enumerated-type warnings reported
464c6927 8454 by Nelson H. F. Beebe in
161a71f3 8455 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
8456
8457 * lib/bbitset.h (BITSET_INLINE): Remove.
8458 * lib/bitset.h [! BITSET_INLINE]: Remove.
8459 (bitset_set, bitset_reset, bitset_test): Rename local vars
8460 to avoid shadowing warnings by GCC.
8461
8462 * data/glr.c (inline): Remove #define. It's the user's
8463 responsibility to #define it away, just like 'const'.
464c6927 8464 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 8465 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 8466
87f721cc
PE
8467 * Makefile.maint (po-check): Scan .l and .y files instead of the
8468 .c and the .h files that they generate. This fixes the bug
8469 reported by Tim Van Holder in:
161a71f3 8470 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
8471 Look for N_ as well as for _. Try to avoid matching #define for
8472 N_ and _.
8473 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8474 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8475 * src/scan-gram.l: Revamp regular expressions so that " and '
8476 do not confuse xgettext.
8477
8478 * src/struniq.h (struniq_new): Do not declare the return type
8479 to be 'const'; this violates the C standard.
8480 * src/struniq.c (struniq_new): Likewise.
8481
be14ade5
AD
84822002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8483
8484 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8485 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8486 linker.
8487
05291fbc
AD
84882002-11-12 Akim Demaille <akim@epita.fr>
8489
8490 * Makefile.maint: Sync with Autoconf:
8491 (local_updates): New.
8492
1f5fd52e
AD
84932002-11-12 Akim Demaille <akim@epita.fr>
8494
8495 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8496
283f1e64
AD
84972002-11-12 Akim Demaille <akim@epita.fr>
8498
8499 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8500 locations.
8501
886b69d1
AD
85022002-11-12 Akim Demaille <akim@epita.fr>
8503
8504 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8505 not yyvalue.
8506
3df37415
AD
85072002-11-12 Akim Demaille <akim@epita.fr>
8508
8509 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8510 Use it to test the GLR parser.
8511
7bd6c77e
AD
85122002-11-12 Akim Demaille <akim@epita.fr>
8513
8514 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8515 defines it.
8516 * data/glr.c (yystos): New.
8517 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8518 (YYDSYMPRINT): New.
8519 (yyval): Don't define it, it is handled via M4.
8520 (yyrecoverParseError): Free verbosely the discarded symbols.
8521 * data/yacc.c (yysymprint): Remove, rather...
8522 (b4_yysymprint_generate): invoke.
8523 * data/c.m4 (b4_yysymprint_generate): New.
8524 Accept pointers as arguments, as opposed to the version from
8525 yacc.c.
8526 (b4_yydestruct_generate): Likewise.
8527 * tests/cations.at (Printers and Destructors): Use Bison directives
8528 instead of CPP macros.
8529 Don't rely on internal details.
8530
b0400cc6
AD
85312002-11-12 Akim Demaille <akim@epita.fr>
8532
8533 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8534 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8535 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8536 it against YYEMPTY and so forth), work on yytoken (i.e., set
8537 it to YYEMPTY etc.).
8538 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8539 (b4_symbol_actions): Remove.
8540 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8541 for 0, end-of-input.
8542
72f889cc
AD
85432002-11-12 Akim Demaille <akim@epita.fr>
8544
8545 * doc/bison.texinfo (Destructor Decl): New.
8546
b1ae9233
AD
85472002-11-12 Akim Demaille <akim@epita.fr>
8548
8549 * src/tables.c (tables_generate): Use free for pointers that
8550 cannot be NULL, not XFREE.
8551 (pack_vector): Use assert, not fatal, for bound violations.
8552 * src/state.c (state_new): Likewise.
8553 * src/reader.c (reader): Likewise.
8554 * src/lalr.c (set_goto_map): Likewise.
72f889cc 8555 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
8556 the file name.
8557
7ec2d4cd
AD
85582002-11-12 Akim Demaille <akim@epita.fr>
8559
8560 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8561 Restore.
8562 * src/scan-gram.l (last_string): Is global to the file, not to
8563 yylex.
8564 * src/parse-gram.y (input): Don't append the epilogue here,
8565 (epilogue.opt): do it here, and free the scanner's obstack.
8566 * src/reader.c (epilogue_set): Rename as...
8567 (epilogue_augment): this.
8568 * data/c.m4 (b4_epilogue): Defaults to empty.
8569
573a6cd3
AD
85702002-11-12 Akim Demaille <akim@epita.fr>
8571
8572 * src/getargs.c (long_options): Remove duplicates.
8573 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8574 Remove.
8575 * doc/bison.rnh: Remove.
8576 * doc/bison.texinfo (VMS Invocation): Remove.
8577
95612cfa
AD
85782002-11-12 Akim Demaille <akim@epita.fr>
8579
8580 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8581 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8582
8583 Use struniq for symbols.
8584
8585 * src/symtab.h (symbol_t): The tag member is a struniq.
8586 (symbol_type_set): Adjust.
8587 * src/symtab.c (symbol_new): Takes a struniq.
8588 (symbol_free): Don't free the tag member.
8589 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8590 (hash_compare_symbol, hash_symbol): these.
8591 Use the fact that tags as struniqs.
8592 (symbol_get): Use struniq_new.
8593 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8594 Returns a strniq.
8595 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8596 and type members are struniqs.
8597 * src/reader.c (get_merge_function)
8598 (grammar_current_rule_merge_set): Adjust.
8599 (TYPE, current_type): Are struniq.
8600
8601 Use struniq for file names.
8602
8603 * src/files.h, src/files.c (infile): Split into...
8604 (grammar_file, current_file): these.
8605 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8606 * src/reduce.c (reduce_print): Likewise.
8607 * src/getargs.c (getargs): Likewise.
8608 * src/complain.h, src/complain.c: Likewise.
8609 * src/main.c (main): Call struniqs_new early enough to use it for
8610 file names.
8611 Don't free the input file name.
8612
3e6656f9
AD
86132002-11-12 Akim Demaille <akim@epita.fr>
8614
8615 * src/symtab.c (symbol_free): Remove dead deactivated code:
8616 type_name are properly removed.
8617 Don't use XFREE to free items that cannot be NULL.
8618 * src/struniq.h, src/struniq.c: New.
8619 * src/main.c (main): Initialize/free struniqs.
8620 * src/parse-gram.y (%union): Add astruniq member.
8621 (yyprint): Adjust.
8622 * src/scan-gram.l (<{tag}>): Return a struniq.
8623 Free the obstack bit that used to store it.
8624 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8625
7672019c
PE
86262002-11-11 Paul Eggert <eggert@twinsun.com>
8627
8628 Revamp to fix many (but not all) of the C- and M4-related quoting
8629 problems. Among other things, this fixes the Bison bug reported
8630 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 8631 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
8632
8633 Use new @ escapes consistently. Represent brackets with @{ and @}
8634 rather than @<:@ and @:>@, since this works a bit better with dumb
8635 editors like vi. Represent @ with @@, since @ is now consistently
8636 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8637 __ofile__, to avoid unexpected expansions. Similarly, use @output
8638 rather than #output.
8639
8640 * data/c.m4 (b4_copyright): Omit file name from comment, since
8641 the file name could contain "*/".
8642 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8643 be quoted. All uses changed.
8644
8645 * data/glr.c: Use new @ escapes consistently.
8646 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8647 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8648 Remove, since they couldn't handle arbitrary characters in file
8649 names.
8650 * data/lalr1.cc: Likewise.
8651 * data/yacc.c: Likewise.
8652
8653 * src/files.c (output_infix): Remove; all uses removed.
8654 * src/files.h: Likewise.
8655
8656 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8657 mishandled funny characters in file names, and anyway it isn't
8658 needed any more.
8659 * data/yacc.c: Likewise.
8660 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8661
8662 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8663 * data/yacc.c: Likewise.
8664
8665 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8666 strings now.
8667 (muscle_init): Quote filename as a C string.
8668 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8669 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8670 * src/output.c (escaped_file_name_output): New function.
8671 (prepare_symbols): Quote tokens for M4.
8672 (prepare): Don't insert output_infix, output_prefix,
8673 output_parser_name, output_header_name; this is now down by scan-skel.
8674 Insert skeleton as a C string.
8675
8676 * src/output.c (user_actions_output, symbol_destructors_output,
8677 symbol_printers_output): Quote filenames for C and M4.
8678 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8679
8680 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8681 escapes other than \\ and \'; this simplifies the code.
8682 (<SC_STRING>): Likewise, for \\ and \".
8683 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8684 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8685 Use new escapes @{ and @} for [ and ].
8686
8687 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8688 them with auto vars.
8689 Switch to new escape scheme, where @ is the escape character uniformly.
8690 Abort if a stray escape character is found. Avoid unbounded input
8691 buffer when parsing non-escaped text.
8692
8693 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8694 __oline__, #output, $@, and @{ do not have unintended meanings.
8695
acea4f3b
PE
86962002-11-09 Paul Eggert <eggert@twinsun.com>
8697
8698 Fix the test failure due to GCC warnings described in
161a71f3 8699 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
8700 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8701 evaluate to 0 if it's impossible for NINF to be in the respective
8702 table.
8703 (yygetLRActions, yyrecoverParseError): Use them.
8704
8705 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8706 counted in the token inserted at end of file. Now takes
8707 location_t *, not location_t, so that the location can be
8708 adjusted. All uses changed.
8709
8710 * tests/regression.at (Invalid inputs): Adjust wording in
8711 diagnostic to match the new behavior.
8712
8713 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
8714 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
8715 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
8716 abort ();'. This reduces the runtime of the "Many lookaheads"
8717 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
8718 GCC 3.2.
8719
20ef1ad5
PE
87202002-11-07 Paul Eggert <eggert@twinsun.com>
8721
8722 * src/parse-gram.y (CHARACTER): Remove unused token.
8723 All uses removed.
8724
8725 * src/scan-gram.l: Remove stack option. We no longer use the
8726 stack, since the stack was never deeper than 1; instead, use the
8727 new auto var c_context to record the stacked value.
8728
8729 Remove nounput option. At an unexpected end of file, we now unput
8730 the minimal input necessary to end cleanly; this simplifies the
8731 code.
8732
8733 Avoid unbounded token sizes where this is easy.
8734
8735 (unexpected_end_of_file): New function.
8736 Use it to systematize the error message on unexpected EOF.
8737 (last-string): Now auto, not static.
8738 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
8739 (scanner_last_string_free): Remove; not used.
8740 (percent_percent_count): Move decl to just before use.
8741 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
8742 not the (never otherwised-used) CHARACTER.
8743
93724f13
AD
87442002-11-07 Akim Demaille <akim@epita.fr>
8745
8746 Let yyerror always receive the msg as last argument, so that
8747 yyerror can be variadic.
8748
8749 * data/yacc.c (b4_yyerror_args): New.
8750 Use it when calling yyerror.
8751 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
8752 Use it when calling yyerror.
8753 * doc/bison.texinfo (Error Reporting): Adjust.
8754 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
8755 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
8756
6e40b4eb
AD
87572002-11-06 Akim Demaille <akim@epita.fr>
8758
8759 #line should have quoted strings.
8760 Ideally, this should be done by m4_quotearg.
8761
8762 * src/scan-skel.l: Include quotearg.h.
8763 Quote __ofile__.
8764 * src/output.c (symbol_printers_output)
8765 (symbol_destructors_output): Quote the file name.
8766
2dfbfc12
AD
87672002-11-06 Akim Demaille <akim@epita.fr>
8768
8769 * tests/regression.at (Invalid inputs): Adjust to the recent
8770 messages.
8771
437c2d80
AD
87722002-11-06 Akim Demaille <akim@epita.fr>
8773
8774 Restore --no-lines.
8775 Reported by Jim Kent.
8776
8777 * data/c.m4 (b4_syncline): New.
8778 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
8779 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
8780 * src/output.c (user_actions_output): Likewise.
8781 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 8782 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 8783
900c5db5
AD
87842002-11-06 Akim Demaille <akim@epita.fr>
8785
8786 * src/main.c (main): Free `infile'.
8787 * src/scan-gram.l (handle_syncline): New.
8788 Recognize `#line'.
8789 * src/output.c (user_actions_output, symbol_destructors_output)
8790 (symbol_printers_output): Use the location's file name, not
8791 infile.
8792 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8793
e183b123 87942002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 8795
e183b123 8796 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 8797 either has GLR conflict entries.
e183b123 8798
193eb6b7
PE
87992002-11-05 Paul Eggert <eggert@twinsun.com>
8800
e183b123
PE
8801 * src/scan-gram.l: Use more accurate diagnostics, e.g.
8802 "integer out of range" rather than "invalid value".
8803 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
8804 accordingly.
8805
193eb6b7
PE
8806 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8807 Also, remove one static variable in the scanner.
8808
8809 * src/scan-gram.l (braces_level): Now auto, not static.
8810 Initialize to zero if the compiler is being picky.
8811 (INITIAL): Clear braces_level instead of incrementing it.
8812 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
8813 as POSIX 1003.1-2001 requires.
8814 * src/system.h (IF_LINT): New macro, taken from coreutils.
8815 * configure.ac: Define "lint" if --enable-gcc-warnings.
8816
29c01725
AD
88172002-11-05 Akim Demaille <akim@epita.fr>
8818
8819 * src/scan-gram.l: When it starts with `%', complain about the
8820 whole directive, not just that `invalid character: %'.
8821
8aeac3ca
AD
88222002-11-04 Akim Demaille <akim@epita.fr>
8823
8824 * Makefile.maint: Update from Autoconf.
8825 (update, cvs-update, po-update, do-po-update): New.
8826
793a58bb
AD
88272002-11-04 Akim Demaille <akim@epita.fr>
8828
8829 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8830 and yyerror.
8831 Have yyerror `use' its arguments.
8832 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8833 returns true when location & yacc & pure & parse-param.
8834 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8835
c4d720cd
AD
88362002-11-04 Akim Demaille <akim@epita.fr>
8837
8838 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8839 clashes.
8840 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8841 font-lock-mode.
8842 Use complain_at.
8843 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8844 slot 0.
8845
613a0dc5
PE
88462002-11-03 Paul Eggert <eggert@twinsun.com>
8847
8848 * src/reader.c (get_merge_function, grammar_current_rule_check):
8849 Use consistent diagnostics for reporting type name clashes.
8850 Quote the types with <>, for consistency with Yacc.
8851 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8852
2a8d363a
AD
88532002-11-03 Akim Demaille <akim@epita.fr>
8854
8855 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8856 New.
8857 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8858 (b4_parse_param): Remove.
8859 Use b4_identification.
8860 Propagate b4_pure_args where needed to pass them to yyerror.
8861 * data/glr.m4 (b4_parse_param): Remove.
8862 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8863 (b4_lpure_formals): New.
8864 Use b4_identification.
8865 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8866 b4_user_formals and b4_user_args.
8867 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8868 (yyreportAmbiguity): When using a pure parser, also need
8869 the location, and the parse-params.
8870 Adjust callers.
8871 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8872 When using a pure parser, also need the parse-params.
8873 Adjust callers.
8874 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8875 (%pure-parser + %parse-param) LALR and GLR parsers.
8876 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8877 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8878 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8879 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8880 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8881 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8882 * doc/bison.texinfo: Untabify the whole file.
8883 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8884 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8885 (Error Reporting): Adjust to these new directives.
8886 Document %error-verbose, deprecate YYERROR_VERBOSE.
8887
9e32add8
AD
88882002-11-03 Akim Demaille <akim@epita.fr>
8889
8890 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8891 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8892 command line options.
8893 * tests/cxx-type.at: Formatting changes.
8894
b02d90a5
PE
88952002-11-03 Paul Eggert <eggert@twinsun.com>
8896
8897 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8898 to count columns correctly, and to check for invalid inputs.
9e32add8 8899
b02d90a5
PE
8900 Use mbsnwidth to count columns correctly. Account for tabs, too.
8901 Include mbswidth.h.
8902 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8903 (extend_location): New function.
8904 (YY_LINES): Remove.
8905
8906 Handle CRLF in C code rather than in Lex code.
8907 (YY_INPUT): New macro.
8908 (no_cr_read): New function.
8909
8910 Scan UCNs, even though we don't fully handle them yet.
8911 (convert_ucn_to_byte): New function.
8912
8913 Handle backslash-newline correctly in C code.
8914 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8915 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8916 all uses changed.
8917 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8918 Use {splice} wherever C allows backslash-newline.
8919 YY_STEP after space, newline, vertical-tab.
8920 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 8921
b02d90a5
PE
8922 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8923
8924 ({int}, handle_action_dollar, handle_action_at): Check for integer
8925 overflow.
9e32add8 8926
b02d90a5
PE
8927 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8928
8929 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8930 as well as \000. Check for UCHAR_MAX, not 255.
8931 Allow \x with an arbitrary positive number of digits, as in C.
8932 Check for overflow here.
8933 Allow \? and UCNs, for compatibility with C.
8934
8935 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8936 with quote slot used by complain_at.
8937
8938 * tests/input.at: Add tests for backslash-newline, m4 quotes
8939 in symbols, long literals, and funny escapes in strings.
8940
8941 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8942 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8943 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8944 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8945 * m4/mbswidth.m4: New file, from GNU coreutils.
8946
8947 * doc/bison.texinfo (Grammar Outline): Document // comments.
8948 (Symbols): Document that trigraphs have no special meaning in Bison,
8949 nor is backslash-newline allowed.
8950 (Actions): Document that trigraphs have no special meaning.
8951
8952 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8953 no longer used.
8954
89552002-11-02 Paul Eggert <eggert@twinsun.com>
8956
8957 * src/reader.c: Don't include quote.h; not needed.
8958 (get_merge_function): Reword warning to be consistent with
8959 type clash diagnostic in grammar_current_rule_check.
8960
8961 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8962 bug in trigraph handling.
8963
8964 * src/output.c (prepare_symbols): When printing token names,
8965 escape "[" as "@<:@" and likewise for "]".
8966
8967 * src/system.h (errno): Remove declaration, as we are now
8968 assuming C89 or better, and C89 guarantees errno.
8969
762b212b
PE
89702002-10-30 Paul Eggert <eggert@twinsun.com>
8971
8972 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8973 Check for close failures.
8974 * src/files.h (xfclose): Return void, not int, since it always
8975 returned zero.
8976 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8977 indicates one.
8978 * src/output.c (output_skeleton): Use xfclose rather than fclose
8979 and ferror. xfclose now checks ferror.
8980
8981 * data/glr.c (YYLEFTMOST_STATE): Remove.
8982 (yyreportTree): Use a stack-based leftmost state. This avoids
8983 our continuing battles with bogus warnings about initializers.
8984
56100c60
AD
89852002-10-30 Akim Demaille <akim@epita.fr>
8986
8987 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8988 #if.
8989
51b4a04c
PH
89902002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8991
8992 * tests/glr-regr1.at: New test for reported regressions.
8993 * tests/testsuite.at: Add glr-regr1.at test.
8994 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 8995
bf1ebda2
PE
89962002-10-24 Paul Eggert <eggert@twinsun.com>
8997
5c16c6b1
PE
8998 Version 1.75a.
8999
bf1ebda2
PE
9000 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
9001 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
9002 we use malloc. Don't assume 'A' through 'Z' are contiguous.
9003 Don't assume strdup exists; POSIX says its an XSI extension.
9004 Check for buffer overflow on input.
9005
b526ee61
AD
90062002-10-24 Akim Demaille <akim@epita.fr>
9007
9008 * src/output.c (output_skeleton): Don't disable M4sugar comments
9009 too soon: it results in comments being expanded.
9010 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
9011 first output.
9012
f1886bb2
AD
90132002-10-24 Akim Demaille <akim@epita.fr>
9014
9015 * data/yacc.c (m4_int_type): New.
9016 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
9017 char' as only yacc.c wants K&R portability.
9018 * data/glr.c (yysigned_char): Remove.
9019 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
9020 Reported by Quoc Peyrot.
9021
c5576256
PE
90222002-10-23 Paul Eggert <eggert@twinsun.com>
9023
9024 * src/main.c (main): With --trace=time, report times even if a
9025 non-fatal error occurs. Formerly, the times were reported in some
9026 such cases but not in others.
9027 * src/reader.c (reader): Just return if a complaint has been issued,
9028 instead of exiting, so that 'main' can report times.
9029
27b0ffea
AD
90302002-10-22 Akim Demaille <akim@epita.fr>
9031
9032 * src/system.h: Include sys/types.
9033 Reported by Bert Deknuydt.
9034
223a7883
PE
90352002-10-23 Paul Eggert <eggert@twinsun.com>
9036
9037 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
9038 Suggested by Art Haas.
9039
90402002-10-22 Paul Eggert <eggert@twinsun.com>
9041
9042 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
9043 decl; not needed any more.
9044 * src/main.c (main): Use return to exit, undoing yesterday's change.
9045 The last OS that we could find where this wouldn't work is
9046 SunOS 3.5, and that's too old to worry about now.
9047
9048 * data/glr.c (struct yyltype): Define members even when not
9049 doing locations. This is more consistent with yacc.c, and it
9050 works around the following bug reports:
161a71f3
PE
9051 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
9052 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 9053
223a7883
PE
9054 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
9055 @acronym consistently. Standardize on "Yacc" instead of "YACC",
9056 "Algol" instead of "ALGOL". Give a bit more history about BNF.
9057
8b76775a
AD
90582002-10-22 Akim Demaille <akim@epita.fr>
9059
9060 * data/README: New.
9061
6db10d14
PE
90622002-10-21 Paul Eggert <eggert@twinsun.com>
9063
9064 Be consistent about 'bool'; the old code used an enum in one
9065 module and an int in another, and this violates the C standard.
9066 * m4/stdbool.m4: New file, from coreutils 4.5.3.
9067 * configure.ac (AC_HEADER_STDBOOL): Add.
9068 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
9069 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
9070 * src/symtab.c (hash_compare_symbol_t): Likewise.
9071 * src/system.h (bool, false, true): Use a definition consistent
9072 with ../lib/hash.c. All uses changed.
9073
9074 * src/complain.c (warning_issued): Renamed from warn_message_count,
9075 so that we needn't worry about integer overflow (!).
9076 Now of type bool. All uses changed.
9077 (complaint_issued): Renamed from complain_message_count; likewise.
9078
9079 * src/main.c (main): Use exit to exit with failure.
27b0ffea 9080
6db10d14
PE
9081 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
9082 rather than 1 and 0.
9083 * src/main.c (main): Likewise.
9084 * src/getargs.c (getargs): Likewise.
9085 * src/reader.c (reader): Likewise.
9086
9087 * src/getarg.c (getargs): Remove duplicate code for
9088 "Try `bison --help'".
9089
9090 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
9091 What was that "2" for?
9092
9093 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
9094 * src/getargs.c (usage): Likewise.
9095
9096 * src/getargs.c (getargs): When there are too few operands, report
9097 the last one. When there are too many, report the first extra
9098 one. This is how diffutils does it.
9099
92a060fd
PE
91002002-10-20 Paul Eggert <eggert@twinsun.com>
9101
9102 Remove K&R vestiges.
9103 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
9104 * src/complain.c (VA_START): Remove. Assume prototypes.
9105 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
9106 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
9107 fatal): Assume prototypes.
9108 * src/complain.h: Assume prototypes.
9109 * src/system.h (PARAMS): Remove.
9110 Include <limits.h> unconditionally, since it's guaranteeed even
9111 for a freestanding C89 compiler.
9112 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
9113 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 9114
e7cb57c0
AD
91152002-10-20 Akim Demaille <akim@epita.fr>
9116
9117 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
9118 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
9119 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
9120 (yyresolveStates, yyresolveAction, yyresolveStack)
9121 (yyprocessOneStack): Use them.
9122 (yy_reduce_print): New.
9123 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
9124
0245f82d
AD
91252002-10-20 Akim Demaille <akim@epita.fr>
9126
9127 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9128 arguments and output `void'.
9129 (b4_c_function): Rename as...
9130 (b4_c_function_def): this.
9131 (b4_c_function_decl, b4_c_ansi_function_def)
9132 (b4_c_ansi_function_decl): New.
9133 Change the interpretation of the arguments: before `int, foo', now
9134 `int foo, foo'.
9135 * data/yacc.c (yyparse): Prototype and define thanks to these.
9136 Adjust b4_c_function_def uses.
9137 * data/glr.c (yyparse): Likewise, but ANSI only.
9138
39912f52
AD
91392002-10-20 Akim Demaille <akim@epita.fr>
9140
9141 * src/output.c (prepare): Move the definition of `tokens_number',
9142 `nterms_number', `undef_token_number', `user_token_number_max'
9143 to...
9144 (prepare_tokens): Here.
9145 (prepare_tokens): Rename as...
9146 (prepare_symbols): this.
9147 (prepare): Move the definition of `rules_number' to...
9148 (prepare_rules): here.
9149 (prepare): Move the definition of `last', `final_state_number',
9150 `states_number' to...
9151 (prepare_states): here.
9152 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9153
20c1e2ad
AD
91542002-10-20 Akim Demaille <akim@epita.fr>
9155
9156 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9157
21964f43
AD
91582002-10-20 Akim Demaille <akim@epita.fr>
9159
9160 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9161 * data/c.m4: here.
9162
66d30cd4
AD
91632002-10-20 Akim Demaille <akim@epita.fr>
9164
9165 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9166 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9167 `pair'.
9168 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9169 `name' to...
9170 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9171 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9172 These.
9173
95f2c9fe
PE
91742002-10-19 Paul Eggert <eggert@twinsun.com>
9175
9176 Do not create a temporary file, as that involves security and
9177 cleanup headaches. Instead, use a pair of pipes.
9178 Derived from a suggestion by Florian Krohm.
9179 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9180 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9181 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9182 (BISON_PREREQ_SUBPIPE): Add.
9183 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9184 Add subpipe.h, subpipe.c.
9185 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9186 * po/POTFILES.in: Add lib/subpipe.c.
9187 * src/output.c: Include "subpipe.h".
9188 (m4_invoke): Remove decl.
9189 (scan_skel): New decl.
9190 (output_skeleton): Use pipe rather than temporary file for m4 input.
9191 Check that m4sugar.m4 is readable, to avoid deadlock.
9192 Check for pipe I/O error.
9193 * src/scan-skel.l (readpipe): Remove decl.
9194 (scan_skel): New function, to be used in place of m4_invoke.
9195 Read from stream rather than file.
66d30cd4 9196
95f2c9fe
PE
9197 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9198 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9199 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9200 this generates a more-accurate value anyway.
9201
9202 * lib/timevar.c (timervar_accumulate): Rename locals to
9203 avoid confusion with similarly-named more-global.
9204 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9205
9206 * src/output.c (prepare): Use xstrdup to convert char const *
9207 to char *, to avoid GCC warning.
9208
c19988b7
AD
92092002-10-19 Akim Demaille <akim@epita.fr>
9210
9211 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9212 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9213 Use them to have `calc.y' ready for %pure-parser.
9214 * data/yacc.c (YYLEX): Pass a yylex return type to
9215 b4_c_function_call.
9216
ae7453f2
AD
92172002-10-19 Akim Demaille <akim@epita.fr>
9218
9219 Prototype support of %lex-param and %parse-param.
9220
9221 * src/parse-gram.y: Add the definition of the %lex-param and
9222 %parse-param tokens, plus their rules.
9223 Drop the `_' version of %glr-parser.
9224 Add the "," token.
9225 * src/scan-gram.l (INITIAL): Scan them.
9226 * src/muscle_tab.c: Comment changes.
9227 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9228 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9229 (muscle_entry_s): The `value' member is no longer const.
9230 Adjust all dependencies.
9231 * src/muscle_tab.c (muscle_init): Adjust: use
9232 MUSCLE_INSERT_STRING.
9233 Initialize the obstack earlier.
9234 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9235 (muscle_pair_list_grow): New.
9236 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9237 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9238 * tests/calc.at: Use %locations, not --locations.
9239 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9240
0e575721
AD
92412002-10-19 Akim Demaille <akim@epita.fr>
9242
9243 * src/getargs.c (usage): Take status as argument and exit
9244 accordingly.
9245 Report the traditional `Try ... --help' message when status != 0.
9246 (usage, version): Don't take a FILE * as arg, it is pointless.
9247 (getargs): When there is an incorrect number of arguments, make it
9248 an error, and report it GNUlically thanks to `usage ()'.
9249
724ce7f5
PE
92502002-10-18 Paul Eggert <eggert@twinsun.com>
9251
3a781eb2
PE
9252 * data/glr.c (yyreportParseError): Don't assume that sprintf
9253 yields the length of the printed string, as this is not true
9254 on SunOS 4.1.4. Reported by Peter Klein.
9255
724ce7f5
PE
9256 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9257 * tests/conflicts.at (%nonassoc and eof): Likewise.
9258 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9259
473d0a75
AD
92602002-10-17 Akim Demaille <akim@epita.fr>
9261
9262 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9263 * src/getargs.c (trace_types, trace_args): Adjust.
9264 * src/reader.c (grammar_current_rule_prec_set)
9265 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9266 Standardize error messages.
9267 And s/@prec/%prec/!
9268 (reader): Use trace_flag to enable scanner/parser debugging,
9269 instead of an adhoc scheme.
9270 * src/scan-gram.l: Remove trailing debugging code.
9271
e76d2469
PE
92722002-10-16 Paul Eggert <eggert@twinsun.com>
9273
93e2236a
PE
9274 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9275 MUSCLE_TAB_H.
9276
e76d2469
PE
9277 * NEWS: Officially drop support for building Bison with K&R C,
9278 since it didn't work anyway and it's not worth worrying about.
9279 * Makefile.maint (wget_files): Remove ansi2knr.c.
9280 (ansi2knr.c-url_prefix): Remove.
9281 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9282 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9283 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9284
5bd1c419
PE
92852002-10-15 Paul Eggert <eggert@twinsun.com>
9286
9287 Stop using the "enum_" trick for K&R-style function definitions;
9288 it confused me, and I was the author! Instead, assume that people
9289 who want to use K&R C compilers (when using these modules in GCC,
9290 perhaps?) will run ansi2knr.
9291
9292 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9293 All uses of "enum_" changed to "enum ".
9294 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9295 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 9296
5bd1c419
PE
9297 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9298 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9299 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9300 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9301 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9302 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9303 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9304 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9305 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9306 Use function prototypes; this removes the need for declaring
9307 static functions simply to provide their prototypes.
9308 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9309 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9310 bitset_count_, bitset_create, bitset_dump, bitset_first,
9311 bitset_free, bitset_init, bitset_last, bitset_next,
9312 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9313 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9314 bitset_print, bitset_release_memory, bitset_toggle_,
9315 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9316 debug_bitset): Likewise.
9317 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9318 * lib/bitset_stats.c (bitset_log_histogram_print,
9319 bitset_percent_histogram_print, bitset_stats_and,
9320 bitset_stats_and_cmp, bitset_stats_and_or,
9321 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9322 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9323 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9324 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9325 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9326 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9327 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9328 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9329 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9330 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9331 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9332 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9333 bitset_stats_zero): Likewise.
9334 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9335 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9336 bitsetv_dump, debug_bitsetv): Likewise.
9337 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9338 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9339 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9340 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9341 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9342 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9343 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9344 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9345 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9346 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9347 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9348 Likewise.
9349 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9350 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9351 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9352 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9353 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9354 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9355 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9356 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9357 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9358 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9359 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 9360
ae26e1f0
AD
93612002-10-14 Akim Demaille <akim@epita.fr>
9362
9363 Version 1.75.
9364
d43baf71
AD
93652002-10-14 Akim Demaille <akim@epita.fr>
9366
9367 * tests/Makefile.am (maintainer-check-posix): New.
9368
7ebc83e3
AD
93692002-10-14 Akim Demaille <akim@epita.fr>
9370
9371 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9372 member.
9373
05846dae
AD
93742002-10-14 Akim Demaille <akim@epita.fr>
9375
9376 * src/tables.c (table_ninf_remap): base -> tab.
9377 Reported by Matt Rosing.
9378
1318e37d
PE
93792002-10-14 Paul Eggert <eggert@twinsun.com>
9380
447fbb17
PE
9381 * tests/action.at, tests/calc.at, tests/conflicts.at,
9382 tests/cxx-type.at, tests/headers.at, tests/input.at,
9383 tests/regression.at, tests/synclines.at, tests/torture.at:
9384 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9385 so that the tests still work even if POSIXLY_CORRECT is set.
9386 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 9387
1318e37d
PE
9388 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9389 for portability to K&R hosts. Fix typo: signed char is guaranteed
9390 only to 127, not to 128.
9391 * data/glr.c (yysigned_char): New type.
9392 * data/yacc.c (yysigned_char): Likewise.
9393 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9394
cc0f0794
PE
93952002-10-13 Paul Eggert <eggert@twinsun.com>
9396
5038f418
PE
9397 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9398 true due to limited range of data type" warning from GCC.
9399
cc0f0794
PE
9400 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9401 by wrapping enum yytokentype's definition inside #ifndef
9402 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9403
6fed0802
AD
94042002-10-13 Akim Demaille <akim@epita.fr>
9405
9406 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9407 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9408
32f0598d
AD
94092002-10-13 Akim Demaille <akim@epita.fr>
9410
9411 * Makefile.maint: Update from Autoconf 2.54.
9412 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9413
7ea9a33f
AD
94142002-10-13 Akim Demaille <akim@epita.fr>
9415
9416 * src/print.c (print_state): Separate the list of solved conflicts
9417 from the other items.
9418 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9419
ea99527d
AD
94202002-10-13 Akim Demaille <akim@epita.fr>
9421
9422 Let nondeterministic skeletons be usable with deterministic
9423 tables.
9424
9425 With the patch, GAWK compiled by GCC without -O2 passes its test
9426 suite using a GLR parser driven by LALR tables. It fails with -O2
9427 because `struct stat' gives two different answers on my machine:
9428 88 (definition of an auto var) and later 96 (memset on this var).
9429 Hence the stack is badly corrumpted. The headers inclusion is to
9430 blame: if I move the awk.h inclusion before GLR's system header
9431 inclusion, the two struct stat have the same size.
9432
9433 * src/tables.c (pack_table): Always create conflict_table.
9434 (token_actions): Always create conflict_list.
9435 * data/glr.c (YYFLAG): Remove, unused.
9436
f377f69f
AD
94372002-10-13 Akim Demaille <akim@epita.fr>
9438
9439 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9440 (O0FLAGS): New.
9441 (VALGRIND, GXX): New.
9442 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9443 * tests/bison.in: Run $PREBISON a pre-command.
9444 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9445 (maintainer-check-g++): New.
9446 * Makefile.am (maintainer-check): New.
9447
2a1fe6ed
AD
94482002-10-13 Akim Demaille <akim@epita.fr>
9449
9450 * data/glr.c: Formatting changes.
9451 Tweak some trace messages to match yacc.c's.
9452
f50adbbd
AD
94532002-10-13 Akim Demaille <akim@epita.fr>
9454
9455 GLR parsers sometimes raise parse errors instead of performing the
9456 default reduction.
9457 Reported by Charles-Henry de Boysson.
9458
9459 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 9460 check the length of the traces when %glr.
f50adbbd
AD
9461 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9462 GLR's traces.
9463 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9464 Test GLR parsers.
9465 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9466 (yyltype): Remove the yy prefix from the member names.
9467 (yytable): Complete its comment.
9468 (yygetLRActions): Map error action number from YYTABLE from
9469 YYTABLE_NINF to 0.
9470 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9471 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9472 not satisfying as we could compare an YYACTION computed from
9473 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9474 only value for error actions.
9475 (yyreportParseError): In verbose parse error messages, don't issue
9476 `error' in the list of expected tokens.
9477 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9478 next action to perform to match glr.c's decoding.
9479 (yytable): Complete its comment.
9480
bcbad5b9
PE
94812002-10-13 Paul Eggert <eggert@twinsun.com>
9482
9483 Fix problem reported by Henrik Grubbstroem in
161a71f3 9484 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
9485 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9486 because the Bison parser reads the second action before reducing
9487 the first one.
9488 * src/scan-gram.l (rule_length): New static var.
9489 Use it to keep track of the rule length in the scanner, since
9490 we can't expect the parser to be in lock-step sync with the scanner.
9491 (handle_action_dollar, handle_action_at): Use this var.
9492 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 9493
14904b89
PE
94942002-10-12 Paul Eggert <eggert@twinsun.com>
9495
1fe611e5
PE
9496 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9497 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9498 Include <sys/time.h> when checking for clock_t and struct tms.
9499 Use same include order as source.
9500 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 9501 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 9502
1fe611e5
PE
9503 * lib/timevar.c: Update copyright date and clarify comments.
9504 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 9505
1fe611e5
PE
9506 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9507 GCC version as of today, then merge Bison's changes.
9508 Change "GCC" to "Bison" in copyright notice. timevar.def's
9509 author is Akim, so change that too.
9510
98194095
PE
9511 * src/reader.c (grammar_current_rule_check):
9512 Don't worry about the default action if $$ is untyped.
9513 Prevents bogus warnings reported by Jim Gifford in
161a71f3 9514 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 9515
14904b89
PE
9516 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9517 * data/glr.c, data/lalr1.cc, data/yacc.c:
9518 Output token definitions before the first part of user declarations.
9519 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 9520 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 9521
ff6dca18
PE
95222002-10-11 Paul Eggert <eggert@twinsun.com>
9523
9524 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9525 (yyparse): here. This undoes some of the 2002-07-25 change.
9526 Compatibility problem reported by Ralf S. Engelschall with
9527 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9528
eb714592
AD
95292002-10-11 Akim Demaille <akim@epita.fr>
9530
9531 * tests/regression.at Characters Escapes): New.
9532 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9533 characters.
9534 Reported by Jan Nieuwenhuizen.
9535
b7195100
AD
95362002-10-11 Akim Demaille <akim@epita.fr>
9537
9538 * po/id.po: New.
9539
f28a0f2d
PE
95402002-10-10 Paul Eggert <eggert@twinsun.com>
9541
9542 Portability fixes for bitsets; this also avoids several GCC
9543 warnings.
9544
9545 * lib/abitset.c: Include <stddef.h>, for offsetof.
9546 * lib/lbitset.c: Likewise.
9547
9548 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9549 properly for vectors of objects. Do not assume that adding a
9550 header size to a multiple of a word size yields a value that is
9551 properly aligned for the whole union.
9552 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9553
9554 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9555 unique names for structures.
9556 * lib/ebitset.c (ebitset_bytes): Likewise.
9557 * lib/lbitset.c (lbitset_bytes): Likewise.
9558
9559 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9560 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9561 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9562 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9563 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9564 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9565 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9566 to improve the type-checking that GCC can do.
9567 * lib/bitset.c (bitset_op4_cmp): Likewise.
9568 * lib/bitset_stats.c (bitset_stats_count,
9569 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9570 bitset_stats_copy, bitset_stats_disjoint_p,
9571 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9572 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9573 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9574 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9575 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9576 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9577 bitset_stats_or_and_cmp): Likewise.
9578 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9579 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9580 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9581 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9582
9583 * lib/abitset.h: Include bitset.h, not bbitset.h.
9584 * lib/ebitset.h: Likewise.
9585 * lib/lbitset.h: Likewise.
9586
9587 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9588 All instances of parameters of type enum bitset_opts are now of
9589 type enum_bitset_opts, to conform to the C Standard, and similarly
9590 for enum_bitset_type.
9591 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9592 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9593
9594 Do not use "struct bitset_struct" to mean different things in
9595 different modules. Not only is this confusing, it violates
9596 the C Standard, which requires that structure types in different
9597 modules must be compatible if one is to be passed to the other.
9598 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9599 All instances of "struct bitset_struct *" replaced with "bitset".
9600 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9601 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9602 struct lbitset_struct, struct bitset_stats_struct): New types.
9603 All uses of struct bitset_struct changed to union bitset_union,
9604 etc.
ba0fe3c7 9605 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
9606 struct bitset_struct): Remove.
9607 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9608 struct bitset_struct): Remove.
9609 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9610 bitset_struct): Remove.
9611 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9612 Likewise.
9613
9614 Do not call a function of type T using a call that assumes the
9615 function is of a different type U. Standard C requires that a
9616 function must be called with a type that is compatible with its
9617 definition.
9618 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9619 New decls.
9620 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9621 New functions.
9622 * lib/ebitset.c (PFV): Remove.
9623 * lib/lbitset.c (PFV): Likewise.
9624 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9625 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9626 decls.
9627 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9628 (ebitset_vtable): Use them.
9629 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9630 lbitset_xor): New functions.
9631 (lbitset_vtable): Use them.
9632
9633 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9634 Declare.
9635
9636 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9637 GCC warning.
9638 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9639 Use offsetof, for simplicity.
9640
6fbe4984
PE
96412002-10-06 Paul Eggert <eggert@twinsun.com>
9642
9643 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9644 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 9645 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
9646 which was inadvertently undone by the 2002-09-30 patch.
9647 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9648 the same width as int.
9649
420f93c8
PE
96502002-10-04 Paul Eggert <eggert@twinsun.com>
9651
9652 Version 1.50.
9653
9654 * configure.ac (AC_INIT), NEWS: Increment version number.
9655
9656 * doc/bison.texinfo: Minor spelling, grammar, and white space
9657 fixes.
9658 (Symbols): Mention that any negative value returned from yylex
9659 signifies end-of-input. Warn about negative chars. Mention
9660 the portable Standard C character set.
9661
9662 The GNU coding standard says CFLAGS and YFLAGS are reserved
9663 for the installer to set.
9664 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9665 * src/Makefile.am (AM_CFLAGS): Likewise.
9666 (AM_YFLAGS): Renamed from YFLAGS.
9667
9668 Fix some MAX and MIN problems.
9669 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9670 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9671 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9672 * src/reader.c (reader): Use it.
9673
9674 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9675 POSIX 1003.1-2001 has removed fgrep.
9676
96772002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9678
9679 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9680 interpreted as signed.
9681 * lib/ebitset.c (ebitset_list): Fix bug.
9682
ff68026d
PE
96832002-10-01 Paul Eggert <eggert@twinsun.com>
9684
9685 More fixes for 64-bit hosts and large bitsets.
9686
9687 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9688 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9689 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9690 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9691 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9692 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9693 bitset_count_): Likewise.
9694 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9695 bitset_first, bitset_last): Likewise.
9696 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9697 bitset_stats_list_reverse, bitset_stats_size,
9698 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9699 Likewise.
9700 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9701 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9702 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9703 bitsetv_reflexive_transitive_closure): Likewise.
9704 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9705 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9706 Likewise.
9707 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9708 Likewise.
420f93c8 9709
ff68026d
PE
9710 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
9711 Use size_t, not unsigned int, to count bytes.
9712 * lib/abitset.h (abitset_bytes): Likewise.
9713 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
9714 Likewise.
9715 * lib/bitset.h (bitset_bytes): Likewise.
9716 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
9717 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
9718 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9719 * lib/ebitset.c (ebitset_bytes): Likewise.
9720 * lib/ebitset.h (ebitset_bytes): Likewise.
9721 * lib/lbitset.c (lbitset_bytes): Likewise.
9722 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 9723
ff68026d
PE
9724 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
9725 abitset_subset_p, abitset_disjoint_p, abitset_and,
9726 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
9727 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
9728 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
9729 abitset_or_and, abitset_or_and_cmp):
9730 Use bitset_windex instead of unsigned int.
9731 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9732 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
9733 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
9734 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
9735 Likewise.
9736 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 9737
ff68026d
PE
9738 * lib/bitset.c (bitset_print):
9739 Use proper printf formats for widths of integer types.
9740 * lib/bitset_stats.c (bitset_percent_histogram_print,
9741 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
9742 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9743 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9744 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 9745
ff68026d
PE
9746 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
9747 BITSET_SIZE_MAX): New macros.
9748 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
9749 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
9750 to BITSET_WINDEX_MAX.
9751
9752 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
9753 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
9754 since we now return the bitset_bindex type (not int).
9755
9756 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9757 when computing sizes.
9758 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9759
9760 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9761 and avoid cast to unsigned.
9762
6aa452a6
AD
97632002-09-30 Akim Demaille <akim@epita.fr>
9764
9765 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9766 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
9767 Updates from Michael Hayes.
9768
927f7817
AD
97692002-09-30 Art Haas <ahaas@neosoft.com>
9770
9771 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9772 invocations.
9773 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9774 defined.
9775
9738f41e
AD
97762002-09-27 Akim Demaille <akim@epita.fr>
9777
9778 Version 1.49c.
9779
a5c75d7f
AD
97802002-09-27 Akim Demaille <akim@epita.fr>
9781
9782 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9783 (Because of AC_LIBSOURCE).
9784
8280e179
AD
97852002-09-27 Akim Demaille <akim@epita.fr>
9786
9787 Playing with Autoscan.
9788
9789 * configure.ac: Remove the old LIBOBJ tweaks.
9790 (AC_REPLACE_FUNCS): Add strrchr and strtol.
9791 * lib/strrchr.c: New.
9792 * lib/strtol.c: New, from the Coreutils 4.5.1.
9793
ae64af35
AD
97942002-09-27 Akim Demaille <akim@epita.fr>
9795
9796 Playing with Autoscan.
9797
9798 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
9799 * lib/Makefile.am (libbison_a_SOURCES): No longer include
9800 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
9801 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
9802 Coreutils 4.5.1.
9803
d1a1114f
AD
98042002-09-24 Akim Demaille <akim@epita.fr>
9805
9806 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9807 (Frequently Asked Questions, Parser Stack Overflow): New.
9808
b906441c
AD
98092002-09-13 Akim Demaille <akim@epita.fr>
9810
9811 Playing with autoscan.
9812
9813 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
9814 * src/files.c (skeleton_find): Remove, unused.
9815 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
9816 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
9817
bd701811
AD
98182002-09-13 Akim Demaille <akim@epita.fr>
9819
9820 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9821 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9822
e0a13e7b
AD
98232002-09-13 Akim Demaille <akim@epita.fr>
9824
9825 * configure.ac: Require 2.54.
9826 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
9827 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
9828 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
9829 Remove, provided by Autoconf macros.
9830
c97011bf
AD
98312002-09-12 Akim Demaille <akim@epita.fr>
9832
9833 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9834
d862b1be
AD
98352002-09-12 Akim Demaille <akim@epita.fr>
9836
9837 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9838 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9839 Reported by Martin Mokrejs.
9840
3d38c03a
AD
98412002-09-10 Akim Demaille <akim@epita.fr>
9842
9843 * src/parse-gram.y: Associate a human readable string to each
9844 token type.
9845 * tests/regression.at (Invalid inputs): Adjust.
9846
b6347355
AD
98472002-09-10 Gary V. Vaughan <gary@gnu.org>
9848
9849 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9850 with an Autoconf-2.5x style configure.ac.
9851
09ba4ab2
PE
98522002-09-06 Paul Eggert <eggert@twinsun.com>
9853
9854 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9855 exception applies only to yacc.c. This is a modification of a
9856 patch originally suggested by Akim Demaille.
9857
21846f69
AD
98582002-09-06 Akim Demaille <akim@epita.fr>
9859
09ba4ab2
PE
9860 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9861 here to...
9862 * data/yacc.c: here.
9863
21846f69
AD
9864 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9865 LocationType.
9866 (b4_ltype): Default to yy::Location from location.hh.
9867
c0ad8bf3
AD
98682002-09-04 Jim Meyering <jim@meyering.net>
9869
9870 * data/yacc.c: Guard the declaration of yytoknum also with
9871 `#ifdef YYPRINT', so it is declared only when used.
9872
3a93251e
AD
98732002-09-04 Akim Demaille <akim@epita.fr>
9874
9875 * configure.in: Rename as...
9876 * configure.ac: this.
9877 Bump to 1.49c.
9878
427c0dda
AD
98792002-09-04 Akim Demaille <akim@epita.fr>
9880
9881 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9882 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9883 translate maintainer only messages.
9884
6a254321
PE
98852002-08-12 Paul Eggert <eggert@twinsun.com>
9886
645e30d1
PE
9887 Version 1.49b.
9888
6a254321
PE
9889 * Makefile.am (SUBDIRS): Remove intl.
9890 (DISTCLEANFILES): Remove.
9891 * NEWS: Mention that GNU M4 is now required. Clarify what is
9892 meant by "larger grammars". Mention the pt_BR translation.
9893 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9894 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9895 Bump version from 0.11.2 to 0.11.5.
9896 (BISON_PREREQ_STAGE): Remove.
9897 (AM_GNU_GETTEXT): Use external gettext.
9898 (AC_OUTPUT): Remove intl/Makefile.
9899
9900 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9901
9902 * data/glr.c: Include string.h, for strlen.
9903 (yyreportParseError): Use size_t for yysize.
9904 (yy_yypstack): No longer nested inside yypstates, as nested
9905 functions are not portable. Do not assume size_t is the
9906 same width as int.
9907 (yypstates): Do not assume that ptrdiff_t is the same width
9908 as int, and similarly for yyposn and YYINDEX.
9909
9910 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9911
9912 * lib/Makefile.am (INCLUDES): Do not include from the intl
9913 directory, which has been removed.
9914 * src/Makefile.am (INCLUDES): Likewise.
9915
9916 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9917 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9918 New vars.
9919
9920 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9921 * tests/Makefile.am (EXTRA_DIST): Likewise.
9922
9923 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9924 Do not assume that bitset_windex is the same width as unsigned.
9925
9926 * lib/abitset.c (abitset_unused_clear): Do not assume that
9927 bitset_word is the same width as int.
9928 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9929 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9930 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9931 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9932 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9933
9934 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9935 portability to one's complement hosts!).
9936 * lib/ebitset.c (ebitset_op1): Likewise.
9937 * lib/lbitset.c (lbitset_op1): Likewise.
9938
9939 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9940 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9941 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9942 Sync with fileutils.
9943 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9944 lib/gettext.h: Sync with diffutils.
9945
9946 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9947 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9948
9949 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9950 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9951 check for void *.
9952
9953 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9954 size_t; the old version tried to do this but casted improperly.
9955 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9956 (bitset_test): Now returns int, not unsigned long.
9957
9958 * lib/bitset_stats.c: Include "gettext.h".
9959 (_): New macro.
9960 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9961 name locals "index", as it generates unnecessary warnings on some
9962 hosts that have an "index" function.
9963
9964 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9965 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9966 they need translation.
9967 * src/LR0.c (state_list_append, new_itemsets, get_state,
9968 append_states, generate_states): Likewise.
9969 * src/assoc.c (assoc_to_string): Likewise.
9970 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9971 * src/gram.c (grammar_dump): Likewise.
9972 * src/injections.c (injections_compute): Likewise.
9973 * src/lalr.c (lookaheads_print): Likewise.
9974 * src/relation.c (relation_transpose): Likewise.
9975 * src/scan-gram.l: Likewise.
9976 * src/tables.c (table_grow, pack_vector): Likewise.
9977
9978 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9979 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9980 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9981 * m4/mbstate_t.m4: Sync with fileutils.
9982 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9983
9984 * po/LINGUAS: Add pt_BR.
9985 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9986 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9987 lib/timevar.c.
9988 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9989 manual recommends.
9990 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9991
9992 * src/complain.c (strerror_r): Remove decl; not needed.
9993 (strerror): Use same pattern as ../lib/error.c.
9994
9995 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9996
9997 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9998
9999 * src/main.c (main): Cast result of bindtextdomain and textdomain
10000 to void, to avoid a GCC warning when --disable-nls is in effect.
10001
10002 * src/scan-gram.l: Use strings rather than escapes when possible,
10003 to minimize the number of warnings from xgettext.
10004 (handle_action_dollar, handle_action_at): Don't use isdigit,
10005 as it mishandles negative chars and it may not work as expected
10006 outside the C locale.
10007
10008 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
10009 this is a GCC extension and is not portable to other compilers.
10010
10011 * src/system.h (alloca): Use same pattern as ../lib/error.c.
10012 Do not include <ctype.h>; no longer needed.
10013 Do not include <malloc.h>; no longer needed (and generates
10014 warnings on OpenBSD 3.0).
10015
10016 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
10017 it's not portable.
10018
10019 * tests/regression.at: Do not use 'cc -c input.c -o input';
10020 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
10021
10022 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
10023 exit status as failure, not just exit status 1. Sun C exits
10024 with status 2 sometimes.
10025
10026 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
10027 Use it for the two large tests.
10028
c8f002c7
AD
100292002-08-02 Akim Demaille <akim@epita.fr>
10030
10031 * src/conflicts.c (conflicts_output): Don't output rules never
10032 reduced here, since anyway that computation doesn't work.
10033 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
10034 (rule_useless_p, rule_never_reduced_p): New.
10035 (grammar_rules_partial_print): Use a filter instead of a range.
10036 Display the title only if needed.
10037 (grammar_rules_print): Adjust.
10038 (grammar_rules_never_reduced_report): New.
10039 * src/tables.c (action_row): Move the computation of rules never
10040 reduced to...
10041 (token_actions): here.
10042 * src/main.c (main): Make the parser before making the report, so
10043 that rules never reduced are computed.
10044 Call grammar_rules_never_reduced_report.
10045 * src/print.c (print_results): Report rules never reduced.
10046 * tests/conflicts.at, tests/reduce.at: Adjust.
10047
cd08e51e
AD
100482002-08-01 Akim Demaille <akim@epita.fr>
10049
10050 Instead of attaching lookaheads and duplicating the rules being
10051 reduced by a state, attach the lookaheads to the reductions.
10052
10053 * src/state.h (state_t): Remove the `lookaheads',
10054 `lookaheads_rule' member.
10055 (reductions_t): Add a `lookaheads' member.
10056 Use a regular array for the `rules'.
10057 * src/state.c (reductions_new): Initialize the lookaheads member
10058 to 0.
10059 (state_rule_lookaheads_print): Adjust.
10060 * src/state.h, src/state.c (state_reductions_find): New.
10061 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
10062 (count_rr_conflicts): Adjust.
10063 * src/lalr.c (LArule): Remove.
10064 (add_lookback_edge): Adjust.
10065 (state_lookaheads_count): New.
10066 (states_lookaheads_initialize): Merge into...
10067 (initialize_LA): this.
10068 (lalr_free): Adjust.
10069 * src/main.c (main): Don't free nullable and derives too early: it
10070 is used by --verbose.
10071 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
10072
bb0027a9
AD
100732002-08-01 Akim Demaille <akim@epita.fr>
10074
10075 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
10076 `rule_number_t**'.
10077 (set_derives, free_derives): Rename as...
10078 (derives_compute, derives_free): this.
10079 Adjust all dependencies.
10080 * src/nullable.c (set_nullable, free_nullable): Rename as...
10081 (nullable_compute, nullable_free): these.
10082 (rule_list_t): Store rule_t *, not rule_number_t.
10083 * src/state.c (state_rule_lookaheads_print): Directly compare rule
10084 pointers, instead of their numbers.
10085 * src/main.c (main): Call nullable_free, and derives_free earlier,
10086 as they were lo longer used.
10087
3325ddc4
AD
100882002-08-01 Akim Demaille <akim@epita.fr>
10089
10090 * lib/timevar.c (get_time): Include children time.
10091 * src/lalr.h (LA, LArule): Don't export them: used with the
10092 state_t.
10093 * src/lalr.c (LA, LArule): Static.
10094 * src/lalr.h, src/lalr.c (lalr_free): New.
10095 * src/main.c (main): Call it.
10096 * src/tables.c (pack_vector): Check whether loc is >= to the
10097 table_size, not >.
10098 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
10099 (tables_generate): do it, since that's also it which allocates
10100 them.
10101 Don't free LA and LArule, main does.
10102
c6f1a33c
AD
101032002-07-31 Akim Demaille <akim@epita.fr>
10104
10105 Separate parser tables computation and output.
10106
10107 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
10108 (conflict_list, conflict_list_cnt, table, check, table_ninf)
10109 (yydefgoto, yydefact, high): Move to...
10110 * src/tables.h, src/tables.c: here.
10111 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10112 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10113 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
10114 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
10115 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
10116 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
10117 (action_row, save_row, token_actions, save_column, default_goto)
10118 (goto_actions, sort_actions, matching_state, pack_vector)
10119 (table_ninf_remap, pack_table, prepare_actions): Move to...
10120 * src/tables.c: here.
10121 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
10122 * src/output.c (token_actions, output_base, output_conflicts)
10123 (output_check): Merge into...
10124 (prepare_actions): this.
10125 (actions_output): Rename as...
10126 (user_actions_output): this.
10127 * src/main.c (main): Call tables_generate and tables_free.
10128
1509d42f
AD
101292002-07-31 Akim Demaille <akim@epita.fr>
10130
10131 Steal GCC's --time-report support.
10132
10133 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10134 stolen/adjusted from GCC.
10135 * m4/stage.m4: Remove time related checks.
10136 * m4/timevar.m4: New.
10137 * configure.in: Adjust.
10138 * src/system.h: Adjust to using timevar.h.
10139 * src/getargs.h, src/getargs.c: Support trace_time for
10140 --trace=time.
10141 * src/main.c (stage): Remove.
10142 (main): Replace `stage' invocations with timevar calls.
10143 * src/output.c: Insert pertinent timevar calls.
10144
273a74fa
AD
101452002-07-31 Akim Demaille <akim@epita.fr>
10146
10147 Let --trace have arguments.
10148
10149 * src/getargs.h (enum trace_e): New.
10150 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10151 (long_options, short_options): --trace/-T takes an optional
10152 argument.
10153 Change all the uses of trace_flag to reflect the new flags.
10154 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10155
10156 Strengthen `stage' portability.
10157
10158 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10159 * configure.in: Use it.
10160 Don't check for malloc.h and sys/times.h.
10161 * src/system.h: Include them when appropriate.
10162 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10163 times and struct tms are available.
10164
217598da
AD
101652002-07-30 Akim Demaille <akim@epita.fr>
10166
10167 In verbose parse error message, don't report `error' as an
10168 expected token.
10169 * tests/actions.at (Printers and Destructors): Adjust.
10170 * tests/calc.at (Calculator $1): Adjust.
10171 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10172 error message, do not report the parser accepts the error token in
10173 that state.
10174
52489d44
AD
101752002-07-30 Akim Demaille <akim@epita.fr>
10176
10177 Normalize conflict related messages.
10178
10179 * src/complain.h, src/complain.c (warn, complain): New.
10180 * src/conflicts.c (conflicts_print): Use them.
10181 (conflict_report_yacc): New, extracted from...
10182 (conflicts_print): here.
10183 * tests/conflicts.at, tests/existing.at: Adjust.
10184
e8832397
AD
101852002-07-30 Akim Demaille <akim@epita.fr>
10186
10187 Report rules which are never reduced by the parser: those hidden
10188 by conflicts.
10189
10190 * src/LR0.c (save_reductions): Don't make the final state too
10191 different: save its reduction (accept) instead of having a state
10192 without any action (no shift or goto, no reduce).
10193 Note: the final state is now a ``regular'' state, i.e., the
10194 parsers now contain `reduce 0' as default reduction.
10195 Nevertheless, since they decide to `accept' when yystate =
10196 final_state, they still will not reduce rule 0.
10197 * src/print.c (print_actions, print_reduction): Adjust.
10198 * src/output.c (action_row): Track reduced rules.
10199 (token_actions): Report rules never reduced.
10200 * tests/conflicts.at, tests/regression.at: Adjust.
10201
caf23d24
AD
102022002-07-30 Akim Demaille <akim@epita.fr>
10203
10204 `stage' was accidently included in a previous patch.
10205 Initiate its autoconfiscation.
10206
10207 * configure.in: Look for malloc.h and sys/times.h.
10208 * src/main.c (stage): Adjust.
10209 Report only when trace_flag.
10210
640748ee
AD
102112002-07-29 Akim Demaille <akim@epita.fr>
10212
10213 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10214 state_number_t.
10215 (errs_t): symbol_t*, not symbol_number_t.
10216 (reductions_t): rule_t*, not rule_number_t.
10217 (FOR_EACH_SHIFT): New.
10218 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10219 * src/print.c, src/print_graph.c: Adjust.
10220
88bce5a2
AD
102212002-07-29 Akim Demaille <akim@epita.fr>
10222
10223 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10224
10225 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10226 (endtoken, accept): these.
10227 * src/reader.c (reader): Set endtoken's default tag to "$end".
10228 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10229 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10230 Adjust.
10231
1bfb97db
AD
102322002-07-29 Akim Demaille <akim@epita.fr>
10233
10234 * src/reduce.c (reduce_grammar): When the language is empty,
10235 complain about the start symbol, not the axiom.
10236 Use its location.
10237 * tests/reduce.at (Empty Language): New.
10238
fc5734fe
AD
102392002-07-26 Akim Demaille <akim@epita.fr>
10240
10241 * src/reader.h, src/reader.c (gram_error): ... can't get
10242 yycontrol without making too strong assumptions on the parser
10243 itself.
10244 * src/output.c (prepare_tokens): Use the real 0th value of
10245 token_translations instead of `0'.
10246 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10247 visible here.
10248 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10249 for the time being: %locations ought to provide it to yyerror.
10250
3650b4b8
AD
102512002-07-25 Akim Demaille <akim@epita.fr>
10252
10253 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10254 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10255 * tests/regression.at (Web2c Actions): Adjust.
10256
4b3d3a8e
AD
102572002-07-25 Akim Demaille <akim@epita.fr>
10258
10259 Stop storing rules from 1 to nrules + 1.
10260
10261 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10262 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10263 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10264 Iterate from 0 to nrules.
10265 Use rule_number_as_item_number and item_number_as_rule_number.
10266 Adjust to `derive' now containing possibly 0.
10267 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10268 Handle the `- 1' part in rule numbers from/to item numbers.
10269 * src/conflicts.c (log_resolution): Fix the message which reversed
10270 shift and reduce.
10271 * src/output.c (action_row): Initialize default_rule to -1.
10272 (token_actions): Adjust.
10273 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10274 expected output.
10275 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10276
4a2a22f4
AD
102772002-07-25 Akim Demaille <akim@epita.fr>
10278
10279 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10280 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10281 (b4_c_knr_arg_decl): New.
10282 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10283 yyreport_parse_error.
10284
b8df3223
AD
102852002-07-25 Akim Demaille <akim@epita.fr>
10286
10287 * data/yacc.c (yyreport_parse_error): New, extracted from...
10288 (yyparse): here.
10289 (yydestruct, yysymprint): Move above yyparse.
10290 Be K&R compliant.
10291
a762e609
AD
102922002-07-25 Akim Demaille <akim@epita.fr>
10293
10294 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10295 replace...
10296 (b4_sint_type, b4_uint_type): these.
10297 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10298 * tests/regression.at (Web2c Actions): Adjust.
10299
12b0043a
AD
103002002-07-25 Akim Demaille <akim@epita.fr>
10301
10302 * src/gram.h (TIEM_NUMBER_MAX): New.
10303 (item_number_of_rule_number, rule_number_of_item_number): Rename
10304 as...
10305 (rule_number_as_item_number, item_number_as_rule_number): these.
10306 Adjust dependencies.
10307 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10308 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10309 (symbol_number_to_vector_number): New.
10310 (order): Of vector_number_t* type.
10311 (base_t, BASE_MAX, BASE_MIN): New.
10312 (froms, tos, width, pos, check): Of base_t type.
10313 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10314 (actrow): Of action_number_t type.
10315 (conflrow): Of unsigned int type.
10316 (table_ninf, base_ninf): New.
10317 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10318 (muscle_insert_int_table, muscle_insert_base_table)
10319 (muscle_insert_rule_number_table): New.
10320 (prepare_tokens): Output `toknum' as int_table.
10321 (action_row): Returns a rule_number_t.
10322 Use ACTION_MIN, not SHRT_MIN.
10323 (token_actions): yydefact is rule_number_t*.
10324 (table_ninf_remap): New.
10325 (pack_table): Use it for `base' and `table'.
10326 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10327 replaced with...
10328 (YYPACT_NINF, YYTABLE_NINF): these.
10329 (yypact, yytable): Compute their types instead of hard-coded
10330 `short'.
10331 * tests/regression.at (Web2c Actions): Adjust.
10332
5dde258a
AD
103332002-07-19 Akim Demaille <akim@epita.fr>
10334
10335 * src/scan-gram.l (id): Can start with an underscore.
10336
a945ec39
AD
103372002-07-16 Akim Demaille <akim@epita.fr>
10338
10339 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10340 Adjust all former `associativity' dependencies.
10341 * src/symtab.c (symbol_new): Default associativity is `undef', not
10342 `right'.
10343 (symbol_check_alias_consistence): Adjust.
10344
fae437e8
AD
103452002-07-09 Akim Demaille <akim@epita.fr>
10346
10347 * doc/bison.texinfo: Properly set the ``header'' part.
10348 Use @dircategory ``GNU programming tools'' as per Texinfo's
10349 documentation.
10350 Use @copying.
10351
1a715ef2
AD
103522002-07-09 Akim Demaille <akim@epita.fr>
10353
10354 * lib/quotearg.h: Protect against multiple inclusions.
10355 * src/location.h (location_t): Add a `file' member.
10356 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10357 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10358 `error_one_per_line' support.
10359
a5d50994
AD
103602002-07-09 Akim Demaille <akim@epita.fr>
10361
10362 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10363 * src/reader.c (lineno): Remove.
10364 Adjust all dependencies.
10365 (get_merge_function): Take a location and use complain_at.
10366 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10367 * tests/regression.at (Invalid inputs, Mixing %token styles):
10368 Adjust.
10369
b275314e
AD
103702002-07-09 Akim Demaille <akim@epita.fr>
10371
10372 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10373 recovery rule, and forbid extensions when --yacc.
10374 (gram_error): Use complain_at.
10375 * src/reader.c (reader): Exit if there were parse errors.
10376
865b9df1
AD
103772002-07-09 Akim Demaille <akim@epita.fr>
10378
10379 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10380 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10381 Reported by R Blake <blakers@mac.com>.
10382
c76e14da
AD
103832002-07-09 Akim Demaille <akim@epita.fr>
10384
10385 * data/yacc.c: Output the copyright notive in the header.
10386
7db2ed2d
AD
103872002-07-03 Akim Demaille <akim@epita.fr>
10388
10389 * src/output.c (froms, tos): Are state_number_t.
10390 (save_column): sp, sp1, and sp2 are state_number_t.
10391 (prepare): Rename `final' as `final_state_number', `nnts' as
10392 `nterms_number', `nrules' as `rules_number', `nstates' as
10393 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10394 unused.
10395 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10396 * data/lalr1.cc (nsym_): Remove, unused.
10397
e68e0410
AD
103982002-07-03 Akim Demaille <akim@epita.fr>
10399
10400 * src/lalr.h, src/lalr.c (goto_number_t): New.
10401 * src/lalr.c (goto_list_t): New.
10402 Propagate them.
10403 * src/nullable.c (rule_list_t): New.
10404 Propagate.
10405 * src/types.h: Remove.
10406
e1a4f3a4
AD
104072002-07-03 Akim Demaille <akim@epita.fr>
10408
10409 * src/closure.c (print_fderives): Use rule_rhs_print.
10410 * src/derives.c (print_derives): Use rule_rhs_print.
10411 (rule_list_t): New, replaces `shorts'.
10412 (set_derives): Add comments.
10413 * tests/sets.at (Nullable, Firsts): Adjust.
10414
536545f3
AD
104152002-07-03 Akim Demaille <akim@epita.fr>
10416
10417 * src/output.c (prepare_actions): Free `tally' and `width'.
10418 (prepare_actions): Allocate and free `order'.
10419 * src/symtab.c (symbols_free): Free `symbols'.
10420 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10421 * src/output.c (m4_invoke): Move to...
10422 * src/scan-skel.l: here.
10423 (<<EOF>>): Close yyout, and free its name.
10424
8b752b00
AD
104252002-07-03 Akim Demaille <akim@epita.fr>
10426
10427 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10428
10429 * src/LR0.c (new_state): Merge into...
10430 (state_list_append): this.
10431 (new_states): Merge into...
10432 (generate_states): here.
10433 (set_states): Don't ensure a proper `errs' state member here, do it...
10434 * src/conflicts.c (conflicts_solve): here.
10435 * src/state.h, src/state.c: Comment changes.
10436 (state_t): Rename member `shifts' as `transitions'.
10437 Adjust all dependencies.
10438 (errs_new): For consistency, also take the values as argument.
10439 (errs_dup): Remove.
10440 (state_errs_set): New.
10441 (state_reductions_set, state_transitions_set): Assert that no
10442 previous value was assigned.
10443 (state_free): New.
10444 (states_free): Use it.
10445 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10446 temporary storage: use `errs' and `nerrs' as elsewhere.
10447 (set_conflicts): Allocate and free this `errs'.
10448
613f5e1a
AD
104492002-07-02 Akim Demaille <akim@epita.fr>
10450
10451 * lib/libiberty.h: New.
10452 * lib: Update the bitset implementation from upstream.
10453 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10454 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10455 * src/main.c: Adjust bitset stats calls.
10456
26e0cadc
PE
104572002-07-01 Paul Eggert <eggert@twinsun.com>
10458
10459 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10460 char, so that negative chars don't collide with $.
10461
1154cced
AD
104622002-06-30 Akim Demaille <akim@epita.fr>
10463
10464 Have the GLR tests be `warning' checked, and fix the warnings.
10465
10466 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10467 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10468 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10469 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10470 (yyaddDeferredAction): static.
10471 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10472 (yyreportParseError): yyprefix is const.
10473 yytokenp is used only when verbose.
10474 (yy__GNUC__): Replace with __GNUC__.
10475 (yypdumpstack): yyi is size_t.
10476 (yypreference): Un-yy local variables and arguments, to avoid
10477 clashes with `yyr1'. Anyway, we are not in the user name space.
10478 (yytname_size): be an int, as is compared with ints.
10479 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10480 Use them.
10481 * tests/cxx-gram.at: Use quotation to protect $1.
10482 Use AT_COMPILE to enable warnings hunts.
10483 Prototype yylex and yyerror.
10484 `Use' argc.
10485 Include `string.h', not `strings.h'.
10486 Produce and prototype stmtMerge only when used.
10487 yylex takes a location.
10488
97650f4e
AD
104892002-06-30 Akim Demaille <akim@epita.fr>
10490
10491 We spend a lot of time in quotearg, in particular when --verbose.
10492
10493 * src/symtab.c (symbol_get): Store a quoted version of the key.
10494 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10495 Adjust all callers.
10496
d2576365
AD
104972002-06-30 Akim Demaille <akim@epita.fr>
10498
10499 * src/state.h (reductions_t): Rename member `nreds' as num.
10500 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10501 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10502
ccaf65bc
AD
105032002-06-30 Akim Demaille <akim@epita.fr>
10504
10505 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10506 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10507 (shifts_to): Rename as...
10508 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10509 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10510 (TRANSITION_IS_DISABLED, transitions_to): these.
10511
87675353
AD
105122002-06-30 Akim Demaille <akim@epita.fr>
10513
10514 * src/print.c (print_shifts, print_gotos): Merge into...
10515 (print_transitions): this.
10516 (print_transitions, print_errs, print_reductions): Align the
10517 lookaheads columns.
10518 (print_core, print_transitions, print_errs, print_state,
10519 print_grammar): Output empty lines separator before, not after.
10520 (state_default_rule_compute): Rename as...
10521 (state_default_rule): this.
10522 * tests/conflicts.at (Defaulted Conflicted Reduction),
10523 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10524 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10525
ce4ccb4b
AD
105262002-06-30 Akim Demaille <akim@epita.fr>
10527
10528 Display items as we display rules.
10529
10530 * src/gram.h, src/gram.c (rule_lhs_print): New.
10531 * src/gram.c (grammar_rules_partial_print): Use it.
10532 * src/print.c (print_core): Likewise.
10533 * tests/conflicts.at (Defaulted Conflicted Reduction),
10534 (Unresolved SR Conflicts): Adjust.
10535 (Unresolved SR Conflicts): Adjust and rename as...
10536 (Resolved SR Conflicts): this, as was meant.
10537 * tests/regression.at (Web2c Report): Adjust.
10538
bc933ef1
AD
105392002-06-30 Akim Demaille <akim@epita.fr>
10540
10541 * src/print.c (state_default_rule_compute): New, extracted from...
10542 (print_reductions): here.
10543 Pessimize, but clarify the code.
10544 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10545
53d4308d
AD
105462002-06-30 Akim Demaille <akim@epita.fr>
10547
10548 * src/output.c (action_row): Let default_rule be always a rule
10549 number.
10550
574fb2d5
AD
105512002-06-30 Akim Demaille <akim@epita.fr>
10552
10553 * src/closure.c (print_firsts, print_fderives, closure):
10554 Use BITSET_EXECUTE.
10555 * src/lalr.c (lookaheads_print): Likewise.
10556 * src/state.c (state_rule_lookaheads_print): Likewise.
10557 * src/print_graph.c (print_core): Likewise.
10558 * src/print.c (print_reductions): Likewise.
10559 * src/output.c (action_row): Likewise.
10560 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10561
05811fd7
AD
105622002-06-30 Akim Demaille <akim@epita.fr>
10563
10564 * src/print_graph.c: Use report_flag.
10565
0e4d5753
AD
105662002-06-30 Akim Demaille <akim@epita.fr>
10567
10568 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10569 to...
10570 * src/relation.h, src/relation.c (traverse, relation_digraph)
10571 (relation_print, relation_transpose): New.
10572
24c7d800
AD
105732002-06-30 Akim Demaille <akim@epita.fr>
10574
10575 * src/state.h, src/state.c (shifts_to): New.
10576 * src/lalr.c (build_relations): Use it.
10577
9222837b
AD
105782002-06-30 Akim Demaille <akim@epita.fr>
10579
10580 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10581 (item_number_of_rule_number, rule_number_of_item_number): New.
10582 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10583 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10584 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10585 Propagate their use.
10586 Much remains to be done, in particular wrt `shorts' from types.h.
10587
260008e5
AD
105882002-06-30 Akim Demaille <akim@epita.fr>
10589
10590 * src/symtab.c (symbol_new): Initialize the `printer' member.
10591
8a731ca8
AD
105922002-06-30 Akim Demaille <akim@epita.fr>
10593
10594 * src/LR0.c (save_reductions): Remove, replaced by...
10595 * src/state.h, src/state.c (state_reductions_set): New.
10596 (reductions, errs): Rename as...
10597 (reductions_t, errs_t): these.
10598 Adjust all dependencies.
10599
32e1e0a4
AD
106002002-06-30 Akim Demaille <akim@epita.fr>
10601
10602 * src/LR0.c (state_list_t, state_list_append): New.
10603 (first_state, last_state): Now symbol_list_t.
10604 (this_state): Remove.
10605 (new_itemsets, append_states, save_reductions): Take a state_t as
10606 argument.
10607 (set_states, generate_states): Adjust.
10608 (save_shifts): Remove, replaced by...
10609 * src/state.h, src/state.c (state_shifts_set): New.
10610 (shifts): Rename as...
10611 (shifts_t): this.
10612 Adjust all dependencies.
10613 * src/state.h (state_t): Remove the `next' member.
10614
e5fb6710
AD
106152002-06-30 Akim Demaille <akim@epita.fr>
10616
10617 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10618 escaped in slot 0.
10619
c7ca99d4
AD
106202002-06-30 Akim Demaille <akim@epita.fr>
10621
10622 Use hash.h for the state hash table.
10623
10624 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10625 (allocate_storage): Use state_hash_new.
10626 (free_storage): Use state_hash_free.
10627 (new_state, get_state): Adjust.
10628 * src/lalr.h, src/lalr.c (states): Move to...
10629 * src/states.h (state_t): Remove the `link' member, no longer
10630 used.
10631 * src/states.h, src/states.c: here.
10632 (state_hash_new, state_hash_free, state_hash_lookup)
10633 (state_hash_insert, states_free): New.
10634 * src/states.c (state_table, state_compare, state_hash): New.
10635 * src/output.c (output_actions): Do not free states now, since we
10636 still need to know the final_state number in `prepare', called
10637 afterwards. Do it...
10638 * src/main.c (main): here: call states_free after `output'.
10639
df0e7316
AD
106402002-06-30 Akim Demaille <akim@epita.fr>
10641
10642 * src/state.h, src/state.c (state_new): New, extracted from...
10643 * src/LR0.c (new_state): here.
10644 * src/state.h (STATE_ALLOC): Move to...
10645 * src/state.c: here.
10646 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10647 * src/state.h, src/state.c: here.
10648
39f41916
AD
106492002-06-30 Akim Demaille <akim@epita.fr>
10650
10651 * src/reader.c (gensym): Rename as...
10652 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10653 (getsym): Rename as...
10654 (symbol_get): this.
10655
d57650a5
AD
106562002-06-30 Akim Demaille <akim@epita.fr>
10657
10658 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10659 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10660 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10661 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10662
5a08f1ce
AD
106632002-06-30 Akim Demaille <akim@epita.fr>
10664
10665 Make the test suite pass with warnings checked.
10666
10667 * tests/actions.at (Printers and Destructors): Improve.
10668 Avoid unsigned vs. signed issues.
10669 * tests/calc.at: Don't exercise the scanner here, do it...
10670 * tests/input.at (Torturing the Scanner): here.
10671
720623af
PH
106722002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10673
88e7e941 10674 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
10675 reorganize first lines parallel to yacc.c.
10676
fb8135fa
AD
106772002-06-28 Akim Demaille <akim@epita.fr>
10678
10679 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10680 (b4_token_enum, b4_token_defines): New, factored from...
10681 * data/lalr1.cc, data/yacc.c, glr.c: here.
10682
41442480
AD
106832002-06-28 Akim Demaille <akim@epita.fr>
10684
10685 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10686 unused variables.
10687 * src/output.c (merger_output): static.
10688
e0e5bf84
AD
106892002-06-28 Akim Demaille <akim@epita.fr>
10690
ba0fe3c7 10691 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
10692 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10693 pacify GCC.
10694 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 10695
676385e2
PH
106962002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10697
10698 Accumulated changelog for new GLR parsing features.
10699
6a254321 10700 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
10701 conflicts_total_count.
10702 * src/conflicts.h: Ditto.
10703 * src/output.c (token_actions): Use the new name.
10704 (output_conflicts): Change conflp => conflict_list_heads, and
10705 confl => conflict_list for better readability.
10706 * data/glr.c: Use the new names.
10707 * NEWS: Add self to GLR announcement.
e0e5bf84 10708
676385e2
PH
10709 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10710
10711 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10712 Akim Demaille.
10713
10714 * data/bison.glr: Change name to glr.c
10715 * data/glr.c: Renamed from bison.glr.
10716 * data/Makefile.am: Add glr.c
e0e5bf84
AD
10717
10718 * src/getargs.c:
10719
676385e2 10720 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 10721 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 10722
676385e2
PH
10723 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10724
10725 * data/bison.glr: Be sure to restore the
10726 current #line when returning to the skeleton contents after having
10727 exposed the input file's #line.
10728
10729 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10730
10731 * data/bison.glr: Bring up to date with changes to bison.simple.
10732
10733 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10734
10735 * data/bison.glr: Correct definitions that use b4_prefix.
10736 Various reformatting.
10737 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
10738 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
10739 yytokenp argument; now part of stack.
10740 (yychar): Define to behave as documented.
10741 (yyclearin): Ditto.
e0e5bf84 10742
676385e2
PH
10743 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10744
10745 * src/reader.h: Add declaration for free_merger_functions.
10746
10747 * src/reader.c (merge_functions): New variable.
10748 (get_merge_function): New function.
10749 (free_merger_functions): New function.
10750 (readgram): Check for %prec that is not followed by a symbol.
10751 Handle %dprec and %merge declarations.
10752 (packgram): Initialize dprec and merger fields in rules array.
10753
10754 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
10755 conflict_list_cnt, conflict_list_free): New variables.
10756 (table_grow): Also grow conflict_table.
e0e5bf84 10757 (prepare_rules): Output dprec and merger tables.
676385e2 10758 (conflict_row): New function.
e0e5bf84 10759 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
10760 default reduction in conflicted states for GLR parser so that there
10761 are spaces for the conflict lists.
10762 (save_row): Also save conflict information.
10763 (token_actions): Allocate conflict list.
10764 (merger_output): New function.
10765 (pack_vector): Pack conflict table, too.
10766 (output_conflicts): New function to output yyconflp and yyconfl.
10767 (output_check): Allocate conflict_tos.
10768 (output_actions): Output conflict tables, also.
10769 (output_skeleton): Output b4_mergers definition.
10770 (prepare): Output b4_max_rhs_length definition.
10771 Use 'bison.glr' as default skeleton for GLR parsers.
10772
10773 * src/gram.c (glr_parser): New flag.
10774 (grammar_free): Call free_merger_functions.
10775
10776 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
10777 all pairs of conflicting reductions, rather than just all tokens
10778 causing conflicts. Needed to size conflict tables.
e0e5bf84 10779 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
10780 interface.
10781 (conflicts_print): Ditto.
10782 (count_total_conflicts): New function.
10783
10784 * src/reader.h (merger_list): New type.
10785 (merge_functions): New variable.
10786
10787 * src/lex.h (tok_dprec, tok_merge): New token types.
10788
10789 * src/gram.h (rule_s): Add dprec and merger fields.
10790 (glr_parser): New flag.
10791
10792 * src/conflicts.h (count_total_conflicts): New function.
10793
10794 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10795
10796 * doc/bison.texinfo (Generalized LR Parsing): New section.
10797 (GLR Parsers): New section.
10798 (Language and Grammar): Mention GLR parsing.
10799 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
10800 Correct typo ("tge" -> "the").
10801
10802 * data/bison.glr: New skeleton for GLR parsing.
10803
10804 * tests/cxx-gram.at: New tests for GLR parsing.
10805
10806 * tests/testsuite.at: Include cxx-gram.at.
10807
10808 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 10809
676385e2
PH
10810 * src/parse-gram.y:
10811
10812 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10813
10814 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 10815
b5480d74 108162002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
10817
10818 * src/options.h, src/options.c: Remove.
10819 * src/getargs.c (short_options, long_options): New.
10820
60491a94
AD
108212002-06-27 Akim Demaille <akim@epita.fr>
10822
10823 * data/bison.simple, data/bison.c++: Rename as...
10824 * data/yacc.c, data/lalr1.cc: these.
10825 * doc/bison.texinfo (Environment Variables): Remove.
10826
9be0c25b
AD
108272002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10828
10829 * src/getargs.c (report_argmatch): Initialize strtok().
10830
1ae72863
AD
108312002-06-20 Akim Demaille <akim@epita.fr>
10832
10833 * data/bison.simple (b4_symbol_actions): New, replaces...
10834 (b4_symbol_destructor, b4_symbol_printer): these.
10835 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10836 user token numbers.
10837
87542d29
AD
108382002-06-20 Akim Demaille <akim@epita.fr>
10839
10840 * data/bison.simple (yydestructor): Rename as...
10841 (yydestruct): this.
10842
1a31ed21
AD
108432002-06-20 Akim Demaille <akim@epita.fr>
10844
10845 * src/symtab.h, src/symtab.c (symbol_type_set)
10846 (symbol_destructor_set, symbol_precedence_set): The location is
10847 the last argument.
10848 Adjust all callers.
10849
e776192e
AD
108502002-06-20 Akim Demaille <akim@epita.fr>
10851
10852 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10853 internals.
10854 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10855 Takes a location.
10856 * src/symtab.h, src/symtab.c (symbol_class_set)
10857 (symbol_user_token_number_set): Likewise.
10858 Adjust all callers.
10859 Promote complain_at.
10860 * tests/input.at (Type Clashes): Adjust.
10861
5c1180b3
AD
108622002-06-20 Akim Demaille <akim@epita.fr>
10863
10864 * data/bison.simple (YYLEX): Fix the declaration when
10865 %pure-parser.
10866
e3170060
AD
108672002-06-20 Akim Demaille <akim@epita.fr>
10868
10869 * data/bison.simple (yysymprint): Don't print the token number,
10870 just its name.
10871 * tests/actions.at (Destructors): Rename as...
10872 (Printers and Destructors): this.
10873 Also exercise %printer.
10874
253862fd
AD
108752002-06-20 Akim Demaille <akim@epita.fr>
10876
10877 * data/bison.simple (YYDSYMPRINT): New.
10878 Use it to remove many of the #if YYDEBUG/if (yydebug).
10879
366eea36
AD
108802002-06-20 Akim Demaille <akim@epita.fr>
10881
10882 * src/symtab.h, src/symtab.c (symbol_t): printer and
10883 printer_location are new members.
10884 (symbol_printer_set): New.
10885 * src/parse-gram.y (PERCENT_PRINTER): New token.
10886 Handle its associated rule.
10887 * src/scan-gram.l: Adjust.
10888 (handle_destructor_at, handle_destructor_dollar): Rename as...
10889 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10890 * src/output.c (symbol_printers_output): New.
10891 (output_skeleton): Call it.
10892 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10893 since there are already many grammar files with a user `yyprint'.
10894 Replace the calls to YYPRINT to calls to yysymprint.
10895 * tests/calc.at: Adjust.
10896 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10897 taking advantage of parser very internal details (stack size!).
10898
4f25ebb0
AD
108992002-06-20 Akim Demaille <akim@epita.fr>
10900
10901 * src/scan-gram.l: Complete the scanner with the missing patterns
10902 to pacify Flex.
10903 Use `quote' and `symbol_tag_get' where appropriate.
10904
93b68a0e
AD
109052002-06-19 Akim Demaille <akim@epita.fr>
10906
10907 * tests/actions.at (Destructors): Augment to test locations.
10908 * data/bison.simple (yydestructor): Pass it the current location
10909 if locations are enabled.
10910 Prototype only when __STDC__ or C++.
10911 Change the argument names to move into the yy name space: there is
10912 user code here.
10913
58612f1d
AD
109142002-06-19 Akim Demaille <akim@epita.fr>
10915
74310291
AD
10916 * data/bison.simple (b4_pure_if): New.
10917 Use it instead of #ifdef YYPURE.
10918
109192002-06-19 Akim Demaille <akim@epita.fr>
10920
10921 * data/bison.simple (b4_location_if): New.
58612f1d
AD
10922 Use it instead of #ifdef YYLSP_NEEDED.
10923
f25bfb75
AD
109242002-06-19 Akim Demaille <akim@epita.fr>
10925
10926 Prepare @$ in %destructor, but currently don't bind it in the
10927 skeleton, as %location use is not cleaned up yet.
10928
10929 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10930 (handle_action_at): New.
10931 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10932 a braced_code_t and a location as additional arguments.
10933 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10934 unquote one when outputting `b4_dollar_dollar'.
10935 Adjust callers.
10936 * data/bison.simple (b4_eval): Remove.
10937 (b4_symbol_destructor): Adjust.
10938 * tests/input.at (Invalid @n): Adjust.
10939
c732d2c6
AD
109402002-06-19 Zack Weinberg <zack@codesourcery.com>
10941
10942 * doc/bison.texinfo: Document ability to have multiple
10943 prologue sections.
10944
8c165d89
AD
109452002-06-18 Akim Demaille <akim@epita.fr>
10946
10947 * src/files.c (compute_base_names): When computing the output file
10948 names from the input file name, strip the directory part.
10949
ca98bf57
AD
109502002-06-18 Akim Demaille <akim@epita.fr>
10951
10952 * data/bison.simple.new: Comment changes.
10953 Reported by Andreas Schwab.
10954
0bfb02ff
AD
109552002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10956
10957 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10958 there are no `label `yyoverflowlab' defined but not used' warnings
10959 when yyoverflow is defined.
10960
24c0aad7
AD
109612002-06-18 Akim Demaille <akim@epita.fr>
10962
10963 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10964 new member.
10965 (symbol_destructor_set): Adjust.
10966 * src/output.c (symbol_destructors_output): Output the destructor
10967 locations.
10968 Output the symbol name.
10969 * data/bison.simple (b4_symbol_destructor): Adjust.
10970
5719c109
AD
109712002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10972 and Akim Demaille <akim@epita.fr>
10973
10974 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10975 what's left on the stack when the error recovery hits EOF.
10976 * tests/actions.at (Destructors): Complete to exercise this case.
10977
9280d3ef
AD
109782002-06-17 Akim Demaille <akim@epita.fr>
10979
10980 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10981 arguments is really empty, not only equal to `[]'.
10982 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10983 member.
10984 (symbol_destructor_set): New.
10985 * src/output.c (symbol_destructors_output): New.
10986 * src/reader.h (brace_code_t, current_braced_code): New.
10987 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10988 (handle_dollar): Rename as...
10989 (handle_action_dollar): this.
10990 (handle_destructor_dollar): New.
10991 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10992 (grammar_declaration): Use it.
10993 * data/bison.simple (yystos): Is always defined.
10994 (yydestructor): New.
10995 * tests/actions.at (Destructors): New.
10996 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10997
dafdc66f
AD
109982002-06-17 Akim Demaille <akim@epita.fr>
10999
11000 * src/symlist.h, src/symlist.c (symbol_list_length): New.
11001 * src/scan-gram.l (handle_dollar, handle_at): Compute the
11002 rule_length only when needed.
11003 * src/output.c (actions_output, token_definitions_output): Output
11004 the full M4 block.
11005 * src/symtab.c: Don't access directly to the symbol tag, use
11006 symbol_tag_get.
11007 * src/parse-gram.y: Use symbol_list_free.
11008
56c47203
AD
110092002-06-17 Akim Demaille <akim@epita.fr>
11010
11011 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
11012 (symbol_list_prepend, get_type_name): Move to...
11013 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
11014 (symbol_list_prepend, symbol_list_n_type_name_get): here.
11015 Adjust all callers.
11016 (symbol_list_free): New.
11017 * src/scan-gram.l (handle_dollar): Takes a location.
11018 * tests/input.at (Invalid $n): Adjust.
11019
1e0bab92
AD
110202002-06-17 Akim Demaille <akim@epita.fr>
11021
11022 * src/reader.h, src/reader.c (symbol_list_new): Export it.
11023 (symbol_list_prepend): New.
11024 * src/parse-gram.y (%union): `list' is a new member.
11025 (symbols.1): New, replaces...
11026 (terms_to_prec.1, nterms_to_type.1): these.
11027 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
11028 Take a location as additional argument.
11029 Adjust all callers.
11030
04e60654
AD
110312002-06-15 Akim Demaille <akim@epita.fr>
11032
11033 * src/parse-gram.y: Move %token in the declaration section so that
11034 we don't depend upon CVS Bison.
11035
10e5b8bd
AD
110362002-06-15 Akim Demaille <akim@epita.fr>
11037
11038 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
11039 * src/print.c (print_core): Use it.
11040
9801d40c
AD
110412002-06-15 Akim Demaille <akim@epita.fr>
11042
11043 * src/conflicts.c (log_resolution): Accept the rule involved in
11044 the sr conflicts instead of the lookahead number that points to
11045 that rule.
11046 (flush_reduce): Accept the current lookahead vector as argument,
11047 instead of the index in LA.
11048 (resolve_sr_conflict): Accept the current number of lookahead
11049 bitset to consider for the STATE, instead of the index in LA.
11050 (set_conflicts): Adjust.
11051 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
11052
c0263492
AD
110532002-06-15 Akim Demaille <akim@epita.fr>
11054
11055 * src/state.h (state_t): Replace the `lookaheadsp' member, a
11056 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
11057 Adjust all dependencies.
11058 * src/lalr.c (initialize_lookaheads): Split into...
11059 (states_lookaheads_count, states_lookaheads_initialize): these.
11060 (lalr): Adjust.
11061
9757c359
AD
110622002-06-15 Akim Demaille <akim@epita.fr>
11063
11064 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
11065 out of...
11066 (grammar_rules_print): here.
11067 * src/reduce.c (reduce_output): Use it.
11068 * tests/reduce.at (Useless Rules, Reduced Automaton)
11069 (Underivable Rules): Adjust.
11070
6b98e4b5
AD
110712002-06-15 Akim Demaille <akim@epita.fr>
11072
11073 Copy BYacc's nice way to report the grammar.
11074
11075 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
11076 New.
11077 Don't print the rules' location, it is confusing and useless.
11078 (rule_print): Use grammar_rhs_print.
11079 * src/print.c (print_grammar): Use grammar_rules_print.
11080
6b98e4b5
AD
110812002-06-15 Akim Demaille <akim@epita.fr>
11082
11083 Complete and rationalize `useless thing' warnings.
11084
11085 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
11086 (symbol_tag_print): New.
11087 Use them everywhere in place of accessing directly the tag member.
11088 * src/gram.h, src/gram.c (rule_print): New.
11089 Use it where a rule used to be printed `by hand'.
11090 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
11091 (reduce_grammar_tables): Report the useless rules.
11092 (reduce_print): Useless things are a warning, not an error.
11093 Report it as such.
11094 * tests/reduce.at (Useless Nonterminals, Useless Rules):
11095 (Reduced Automaton, Underivable Rules): Adjust.
11096 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
11097 * tests/conflicts.at (Unresolved SR Conflicts)
11098 (Solved SR Conflicts): Adjust.
11099
ee000ba4
AD
111002002-06-15 Akim Demaille <akim@epita.fr>
11101
11102 Let symbols have a location.
11103
11104 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
11105 (getsym): Adjust.
11106 Adjust all callers.
11107 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
11108 Use location_t, not int.
11109 * src/symtab.c (symbol_check_defined): Take advantage of the
11110 location.
11111 * tests/regression.at (Invalid inputs): Adjust.
11112
8efe435c
AD
111132002-06-15 Akim Demaille <akim@epita.fr>
11114
11115 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
11116 (input): Don't try to initialize yylloc here, do it in the
11117 scanner.
11118 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
11119 * src/gram.h (rule_t): Change line and action_line into location
11120 and action_location, of location_t type.
11121 Adjust all dependencies.
11122 * src/location.h, src/location.c (empty_location): New.
11123 * src/reader.h, src/reader.c (grammar_start_symbol_set)
11124 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
11125 (grammar_current_rule_symbol_append)
11126 (grammar_current_rule_action_append): Expect a location as argument.
11127 * src/reader.c (grammar_midrule_action): Adjust to attach an
11128 action's location as dummy symbol location.
11129 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11130 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11131 the line numbers.
11132
1921f1d7
AD
111332002-06-14 Akim Demaille <akim@epita.fr>
11134
11135 Grammar declarations may be found in the grammar section.
11136
11137 * src/parse-gram.y (rules_or_grammar_declaration): New.
11138 (declarations): Each declaration may end with a semicolon, not
11139 just...
11140 (grammar_declaration): `"%union"'.
11141 (grammar): Branch to rules_or_grammar_declaration.
11142
4515534c
AD
111432002-06-14 Akim Demaille <akim@epita.fr>
11144
11145 * src/main.c (main): Invoke scanner_free.
11146
f958596b
AD
111472002-06-14 Akim Demaille <akim@epita.fr>
11148
11149 * src/output.c (m4_invoke): Extracted from...
11150 (output_skeleton): here.
11151 Free tempfile.
11152
2c569025
AD
111532002-06-14 Akim Demaille <akim@epita.fr>
11154
11155 * src/parse-gram.y (directives, directive, gram)
11156 (grammar_directives, precedence_directives, precedence_directive):
11157 Rename as...
11158 (declarations, declaration, grammar, grammar_declaration)
11159 (precedence_declaration, precedence_declarator): these.
11160 (symbol_declaration): New.
11161
592e8d4d
AD
111622002-06-14 Akim Demaille <akim@epita.fr>
11163
11164 * src/files.c (action_obstack): Remove, unused.
11165 (output_obstack): Remove it, and all its dependencies, as it is no
11166 longer needed.
11167 * src/reader.c (epilogue_set): Build the epilogue in the
11168 muscle_obstack.
11169 * src/output.h, src/output.c (muscle_obstack): Move to...
11170 * src/muscle_tab.h, src/muscle_tab.h: here.
11171 (muscle_init): Initialize muscle_obstack.
11172 (muscle_free): New.
11173 * src/main.c (main): Call it.
11174
0c15323d
AD
111752002-06-14 Akim Demaille <akim@epita.fr>
11176
11177 * src/location.h: New, extracted from...
11178 * src/reader.h: here.
11179 * src/Makefile.am (noinst_HEADERS): Merge into
11180 (bison_SOURCES): this.
11181 Add location.h.
11182 * src/parse-gram.y: Use location_t instead of Bison's.
11183 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11184 Use location_t instead of ints.
11185
e96c9728
AD
111862002-06-14 Akim Demaille <akim@epita.fr>
11187
11188 * data/bison.simple, data/bison.c++: Be sure to restore the
11189 current #line when returning to the skeleton contents after having
11190 exposed the input file's #line.
11191
75d1fe16
AD
111922002-06-12 Akim Demaille <akim@epita.fr>
11193
11194 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11195 eager.
11196 * tests/actions.at (Exotic Dollars): New.
11197
6c35d22c
AD
111982002-06-12 Akim Demaille <akim@epita.fr>
11199
11200 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11201 ['"/] too eagerly.
11202 * tests/input.at (Torturing the Scanner): New.
11203
1d6412ad
AD
112042002-06-11 Akim Demaille <akim@epita.fr>
11205
11206 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11207 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11208 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11209 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11210 * src/reader.c (reader): Use it.
11211
4cdb01db
AD
112122002-06-11 Akim Demaille <akim@epita.fr>
11213
11214 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11215 Adjust all callers.
11216 (scanner_last_string_free): New.
11217
44995b2e
AD
112182002-06-11 Akim Demaille <akim@epita.fr>
11219
11220 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11221 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11222 (last_string, YY_OBS_FREE): New.
11223 Use them when returning an ID.
11224
e9955c83
AD
112252002-06-11 Akim Demaille <akim@epita.fr>
11226
11227 Have Bison grammars parsed by a Bison grammar.
11228
11229 * src/reader.c, src/reader.h (prologue_augment): New.
11230 * src/reader.c (copy_definition): Remove.
11231
11232 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11233 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11234 (grammar_current_rule_prec_set, grammar_current_rule_check)
11235 (grammar_current_rule_symbol_append)
11236 (grammar_current_rule_action_append): Export.
11237 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11238 (symbol_list_action_append): Remove.
11239 Hook the routines from reader.
11240 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11241 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11242
11243 * src/reader.c (read_declarations): Remove, unused.
11244
11245 * src/parse-gram.y: Handle the epilogue.
11246 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11247 (grammar_start_symbol_set): this.
11248 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11249 * src/reader.c (readgram): Remove, unused.
11250 (reader): Adjust to insert eoftoken and axiom where appropriate.
11251
11252 * src/reader.c (copy_dollar): Replace with...
11253 * src/scan-gram.h (handle_dollar): this.
11254 * src/parse-gram.y: Remove `%thong'.
11255
11256 * src/reader.c (copy_at): Replace with...
11257 * src/scan-gram.h (handle_at): this.
11258
11259 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11260 New.
11261
11262 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11263 time being.
11264
11265 * src/reader.h, src/reader.c (grammar_rule_end): New.
11266
11267 * src/parse.y (current_type, current_class): New.
11268 Implement `%nterm', `%token' support.
11269 Merge `%term' into `%token'.
11270 (string_as_id): New.
11271 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11272 type name.
11273
11274 * src/parse-gram.y: Be sure to handle properly the beginning of
11275 rules.
11276
11277 * src/parse-gram.y: Handle %type.
11278 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11279
11280 * src/parse-gram.y: More directives support.
11281 * src/options.c: No longer handle source directives.
11282
11283 * src/parse-gram.y: Fix %output.
11284
11285 * src/parse-gram.y: Handle %union.
11286 Use the prologue locations.
11287 * src/reader.c (parse_union_decl): Remove.
11288
11289 * src/reader.h, src/reader.c (epilogue_set): New.
11290 * src/parse-gram.y: Use it.
11291
11292 * data/bison.simple, data/bison.c++: b4_stype is now either not
11293 defined, then default to int, or to the contents of %union,
11294 without `union' itself.
11295 Adjust.
11296 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11297
11298 * src/output.c (actions_output): Don't output braces, as they are
11299 already handled by the scanner.
11300
11301 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11302 characters to themselves.
11303
11304 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11305 that the epilogue has a proper #line.
11306
11307 * src/parse-gram.y: Handle precedence/associativity.
11308
11309 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11310 a terminal.
11311 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11312 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11313 at all to define terminals that cannot be emitted.
11314
11315 * src/scan-gram.l: Escape M4 characters.
11316
11317 * src/scan-gram.l: Working properly with escapes in user
11318 strings/characters.
11319
11320 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11321 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11322 grammar.
11323 Use more modest sizes, as for the time being the parser does not
11324 release memory, and therefore the process swallows a huge amount
11325 of memory.
11326
11327 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11328 stricter %token grammar.
11329
11330 * src/symtab.h (associativity): Add `undef_assoc'.
11331 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11332 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11333
11334 * tests/regression.at (Invalid %directive): Remove, as it is now
11335 meaningless.
11336 (Invalid inputs): Adjust to the new error messages.
11337 (Token definitions): The new grammar doesn't allow too many
11338 eccentricities.
11339
11340 * src/lex.h, src/lex.c: Remove.
11341 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11342 (copy_character, copy_string2, copy_string, copy_identifier)
11343 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11344 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11345 (parse_action): Remove.
11346 * po/POTFILES.in: Adjust.
11347
2e047461
AD
113482002-06-11 Akim Demaille <akim@epita.fr>
11349
cd05d13c 11350 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
11351 rule's action member: return the action as a string.
11352 Don't require `rule_length' as an argument: compute it.
11353 (grammar_current_rule_symbol_append)
11354 (grammar_current_rule_action_append): New, eved out from
11355 (readgram): here.
11356 Remove `action_flag', `rulelength', unused now.
11357
9af3fbce
AD
113582002-06-11 Akim Demaille <akim@epita.fr>
11359
11360 * src/reader.c (grammar_current_rule_prec_set).
11361 (grammar_current_rule_check): New, eved out from...
11362 (readgram): here.
11363 Remove `xaction', `first_rhs': useless.
11364 * tests/input.at (Type clashes): New.
11365 * tests/existing.at (GNU Cim Grammar): Adjust.
11366
1485e106
AD
113672002-06-11 Akim Demaille <akim@epita.fr>
11368
11369 * src/reader.c (grammar_midrule_action): New, Eved out from
11370 (readgram): here.
11371
da4160c3
AD
113722002-06-11 Akim Demaille <akim@epita.fr>
11373
11374 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11375 New.
11376 (readgram): Use them as replacement of inlined code, crule and
11377 crule1.
11378
f6d0f937
AD
113792002-06-11 Akim Demaille <akim@epita.fr>
11380
11381 * src/reader.c (grammar_end, grammar_symbol_append): New.
11382 (readgram): Use them.
11383 Make the use of `p' as local as possible.
11384
69078d4b
AD
113852002-06-10 Akim Demaille <akim@epita.fr>
11386
11387 GCJ's parser requires the tokens to be defined before the prologue.
11388
11389 * data/bison.simple: Output the token definition before the user's
11390 prologue.
11391 * tests/regression.at (Braces parsing, Duplicate string)
11392 (Mixing %token styles): Check the output from bison.
11393 (Early token definitions): New.
11394
5e424082
AD
113952002-06-10 Akim Demaille <akim@epita.fr>
11396
11397 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11398 assigning twice the same user number to a token, so that we can
11399 use it in...
11400 * src/lex.c (lex): here.
11401 Also use `symbol_class_set' instead of hand written code.
11402 * src/reader.c (parse_assoc_decl): Likewise.
11403
44536b35
AD
114042002-06-10 Akim Demaille <akim@epita.fr>
11405
11406 * src/symtab.c, src/symtab.c (symbol_class_set)
11407 (symbol_user_token_number_set): New.
11408 * src/reader.c (parse_token_decl): Use them.
11409 Use a switch instead of ifs.
11410 Use a single argument.
11411
8b9f2372
AD
114122002-06-10 Akim Demaille <akim@epita.fr>
11413
11414 Remove `%thong' support as it is undocumented, unused, duplicates
11415 `%token's job, and creates useless e-mail traffic with people who
11416 want to know what it is, why it is undocumented, unused, and
11417 duplicates `%token's job.
11418
11419 * src/reader.c (parse_thong_decl): Remove.
11420 * src/options.c (option_table): Remove "thong".
11421 * src/lex.h (tok_thong): Remove.
11422
3ae2b51f
AD
114232002-06-10 Akim Demaille <akim@epita.fr>
11424
11425 * src/symtab.c, src/symtab.c (symbol_type_set)
11426 (symbol_precedence_set): New.
11427 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11428 (value_components_used): Remove, unused.
11429
2f1afb73
AD
114302002-06-09 Akim Demaille <akim@epita.fr>
11431
11432 Move symbols handling code out of the reader.
11433
11434 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11435 (axiom): Move to...
11436 * src/symtab.h, src/symtab.c: here.
11437
11438 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11439 * src/reader.c (startval): Rename as...
11440 * src/symtab.h, src/symtab.c (startsymbol): this.
11441 * src/reader.c: Adjust.
11442
11443 * src/reader.c (symbol_check_defined, symbol_make_alias)
11444 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11445 (token_translations_init)
11446 Move to...
11447 * src/symtab.c: here.
11448 * src/reader.c (packsymbols): Move to...
11449 * src/symtab.h, src/symtab.c (symbols_pack): here.
11450 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11451 argument.
11452
e9bca3ad
AD
114532002-06-03 Akim Demaille <akim@epita.fr>
11454
11455 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11456 then statements.
11457
86eff183
AD
114582002-06-03 Akim Demaille <akim@epita.fr>
11459
11460 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11461 structs with non literals.
11462 * src/scan-skel.l: never-interactive.
11463 * src/conflicts.c (enum conflict_resolution_e): No trailing
11464 comma.
11465 * src/getargs.c (usage): Split long literal strings.
11466 Reported by Hans Aberg.
11467
717be197
AD
114682002-05-28 Akim Demaille <akim@epita.fr>
11469
11470 * data/bison.c++: Use C++ ostreams.
11471 (cdebug_): New member.
11472
670ddffd
AD
114732002-05-28 Akim Demaille <akim@epita.fr>
11474
11475 * src/output.c (output_skeleton): Be sure to allocate enough room
11476 for `/' _and_ for `\0' in full_skeleton.
11477
769b430f
AD
114782002-05-28 Akim Demaille <akim@epita.fr>
11479
11480 * data/bison.c++: Catch up with bison.simple:
11481 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11482 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11483 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11484 and popping traces.
11485
7067cb36
PH
114862002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11487
11488 * src/output.c (output_skeleton): Put an explicit path in front of
11489 the skeleton file name, rather than relying on the -I directory,
11490 to partially alleviate effects of having a skeleton file lying around
11491 in the current directory.
769b430f 11492
4a713ec2
PH
114932002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11494
769b430f 11495 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
11496 obstack_printf should be obstack_fgrow1.
11497
b408954b
AD
114982002-05-26 Akim Demaille <akim@epita.fr>
11499
11500 * src/state.h (state_t): `solved_conflicts' is a new member.
11501 * src/LR0.c (new_state): Set it to 0.
11502 * src/conflicts.h, src/conflicts.c (print_conflicts)
11503 (free_conflicts, solve_conflicts): Rename as...
11504 (conflicts_print, conflicts_free, conflicts_solve): these.
11505 Adjust callers.
11506 * src/conflicts.c (enum conflict_resolution_e)
11507 (solved_conflicts_obstack): New, used by...
11508 (log_resolution): this.
11509 Adjust to attach the conflict resolution to each state.
11510 Complete the description with the precedence/associativity
11511 information.
11512 (resolve_sr_conflict): Adjust.
11513 * src/print.c (print_state): Output its solved_conflicts.
11514 * tests/conflicts.at (Unresolved SR Conflicts)
11515 (Solved SR Conflicts): Exercise --report=all.
11516
a49aecd5
AD
115172002-05-26 Akim Demaille <akim@epita.fr>
11518
11519 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11520 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11521 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11522 (token_number_t, item_number_as_token_number)
11523 (token_number_as_item_number, muscle_insert_token_number_table):
11524 Rename as...
11525 (symbol_number_t, item_number_as_symbol_number)
11526 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11527 these, since it is more appropriate.
11528
5504898e
AD
115292002-05-26 Akim Demaille <akim@epita.fr>
11530
11531 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11532 `Error:' lines.
11533 * data/bison.simple (yystos) [YYDEBUG]: New.
11534 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11535 error recovery.
11536 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11537
ec3bc396
AD
115382002-05-25 Akim Demaille <akim@epita.fr>
11539
11540 * doc/bison.texinfo (Debugging): Split into...
11541 (Tracing): this new section, its former contents, and...
11542 (Understanding): this new section.
11543 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11544 by...
11545 (report_flag): this.
11546 Adjust all dependencies.
11547 (report_args, report_types, report_argmatch): New.
11548 (usage, getargs): Report/support -r, --report.
11549 * src/options.h
11550 (struct option_table_struct): Rename as..,
11551 (struct option_table_s): this.
11552 Rename the `set_flag' member to `flag' to match with getopt_long's
11553 struct.
11554 * src/options.c (option_table): Split verbose into an entry for
11555 %verbose, and another for --verbose.
11556 Support --report/-r, so remove -r from the obsolete --raw.
11557 * src/print.c: Attach full item sets and lookaheads reports to
11558 report_flag instead of trace_flag.
11559 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11560
78df8250
PE
115612002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11562 and Paul Eggert <eggert@twinsun.com>
769b430f 11563
78df8250
PE
11564 * data/bison.simple (yyparse): Correct error handling to conform to
11565 POSIX and yacc. Specifically, after syntax error is discovered,
11566 do not reduce further before shifting the error token.
11567 Clean up the code a bit by removing the labels yyerrdefault,
11568 yyerrhandle, yyerrpop.
11569 * NEWS: Document the above.
11570
c0c9ea05
PH
115712002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11572
11573 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11574 type; it isn't always big enough, since it doesn't necessarily
11575 include non-terminals.
769b430f 11576 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
11577 the latter can be removed.
11578 (yy_token_number_type): Remove, only one use.
11579 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11580 don't use TokenNumberType as element type.
769b430f 11581
c0c9ea05
PH
11582 * tests/regression.at: Modify expected output to agree with change
11583 to yyr1 and yytranslate.
769b430f 11584
6390a83f
FK
115852002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11586
11587 * src/reader.c (parse_action): Use copy_character instead of
11588 obstack_1grow.
11589
db7c8e9a
AD
115902002-05-13 Akim Demaille <akim@epita.fr>
11591
11592 * tests/regression.at (Token definitions): Prototype yylex and
11593 yyerror.
11594
fcc61800
PH
115952002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11596
158c687b 11597 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
11598 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11599 32-bit arithmetic.
11600 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11601
5683e9b2
AD
116022002-05-07 Akim Demaille <akim@epita.fr>
11603
11604 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11605 avoid GCC warnings.
11606
0c2d3f4c
AD
116072002-05-07 Akim Demaille <akim@epita.fr>
11608
11609 Kill GCC warnings.
11610
11611 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11612 over the RHS of each rule.
11613 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11614 * src/state.h (state_t): Member `nitems' is unsigned short.
11615 * src/LR0.c (get_state): Adjust.
11616 * src/reader.c (packgram): Likewise.
11617 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11618 `Type'.
11619 (muscle_insert_int_table): Remove, unused.
11620 (prepare_rules): Remove `max'.
11621
1565b720
AD
116222002-05-06 Akim Demaille <akim@epita.fr>
11623
11624 * src/closure.c (print_firsts): Display of the symbol tags.
11625 (bitmatrix_print): Move to...
11626 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11627 here.
11628 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11629
cfaee611
AD
116302002-05-06 Akim Demaille <akim@epita.fr>
11631
11632 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11633 hash_do_for_each.
11634
458be8e0
AD
116352002-05-06 Akim Demaille <akim@epita.fr>
11636
11637 * src/LR0.c (new_state, get_state): Instead of using the global
11638 `kernel_size' and `kernel_base', have two new arguments:
11639 `core_size' and `core'.
11640 Adjust callers.
11641
a900a624
AD
116422002-05-06 Akim Demaille <akim@epita.fr>
11643
11644 * src/reader.c (packgram): No longer end `ritem' with a 0
11645 sentinel: it is not used.
11646
d4e7d3a1
AD
116472002-05-05 Akim Demaille <akim@epita.fr>
11648
11649 New experimental feature: display the lookaheads in the report and
11650 graph.
11651
11652 * src/print (print_core): When --trace-flag, display the rules
11653 lookaheads.
11654 * src/print_graph.c (print_core): Likewise.
11655 Swap the arguments.
11656 Adjust caller.
11657
39ceb25b
AD
116582002-05-05 Akim Demaille <akim@epita.fr>
11659
11660 * tests/torture.at (Many lookaheads): New test.
11661
5372019f
AD
116622002-05-05 Akim Demaille <akim@epita.fr>
11663
11664 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11665 (GENERATE_MUSCLE_INSERT_TABLE): this.
11666 (output_int_table, output_unsigned_int_table, output_short_table)
11667 (output_token_number_table, output_item_number_table): Replace with...
11668 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11669 (muscle_insert_short_table, muscle_insert_token_number_table)
11670 (muscle_insert_item_number_table): these.
11671 Adjust all callers.
11672 (prepare_tokens): Don't free `translations', since...
11673 * src/reader.h, src/reader.c (grammar_free): do it.
11674 Move to...
11675 * src/gram.h, src/gram.c (grammar_free): here.
11676 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11677 b4_translate_max.
11678
5df5f6d5
AD
116792002-05-05 Akim Demaille <akim@epita.fr>
11680
11681 * src/output.c (output_unsigned_int_table): New.
11682 (prepare_rules): `i' is unsigned.
11683 `prhs', `rline', `r2' are unsigned int.
11684 Rename muscle `rhs_number_max' as `rhs_max'.
11685 Output muscles `prhs_max', `rline_max', and `r2_max'.
11686 Free rline and r1.
11687 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11688 to compute types instead of constant types.
11689 * tests/regression.at (Web2c Actions): Adjust.
11690
b87f8b21
AD
116912002-05-04 Akim Demaille <akim@epita.fr>
11692
11693 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11694 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11695 Adjust dependencies.
11696 * src/output.c (token_definitions_output): Be sure not to output a
11697 `#define 'a'' when fed with `%token 'a' "a"'.
11698 * tests/regression.at (Token definitions): New.
11699
8bb936e4
PE
117002002-05-03 Paul Eggert <eggert@twinsun.com>
11701
11702 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11703 for K&R C.
11704
117052002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11706
11707 * Makefile.am (SUBDIRS): Remove intl.
11708 (EXTRA_DIST): Add config/config.rpath.
11709
53c71a12
AD
117102002-05-03 Akim Demaille <akim@epita.fr>
11711
11712 * data/bison.simple (m4_if): Don't output empty enums.
11713 And actually, output valid enum definitions :(.
11714
289dd0cf
AD
117152002-05-03 Akim Demaille <akim@epita.fr>
11716
11717 * configure.bat: Remove, completely obsolete.
11718 * Makefile.am (EXTRA_DIST): Adjust.
11719 Don't distribute config.rpath...
11720 * config/Makefile.am (EXTRA_DIST): Do it.
11721
db85e524
AD
117222002-05-03 Akim Demaille <akim@epita.fr>
11723
11724 * configure.in (GETTEXT_VERSION): New.
11725 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11726
83ccf991
AD
117272002-05-03 Akim Demaille <akim@epita.fr>
11728
11729 * data/bison.simple (b4_token_enum): New.
11730 (b4_token_defines): Use it to output tokens both as #define and
11731 enums.
11732 Suggested by Paul Eggert.
11733 * src/output.c (token_definitions_output): Don't output spurious
11734 white spaces.
11735
1f418995
AD
117362002-05-03 Akim Demaille <akim@epita.fr>
11737
11738 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11739
45119f04
RA
117402002-05-02 Robert Anisko <robert@lrde.epita.fr>
11741
11742 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
11743 Update the stack class, give a try to deque as the default container.
11744
b2d52318
AD
117452002-05-02 Akim Demaille <akim@epita.fr>
11746
11747 * data/bison.simple (yyparse): Do not implement @$ = @1.
11748 (YYLLOC_DEFAULT): Adjust to do it.
11749 * doc/bison.texinfo (Location Default Action): Fix.
11750
3a8b4109
AD
117512002-05-02 Akim Demaille <akim@epita.fr>
11752
11753 * src/reader.c (parse_braces): Merge into...
11754 (parse_action): this.
11755
84614e13
AD
117562002-05-02 Akim Demaille <akim@epita.fr>
11757
11758 * configure.in (ALL_LINGUAS): Remove.
11759 * po/LINGUAS, hr.po: New.
11760
fdbcd8e2
AD
117612002-05-02 Akim Demaille <akim@epita.fr>
11762
11763 Remove the so called hairy (semantic) parsers.
11764
11765 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
11766 * src/gram.h, src/gram.c (semantic_parser): Remove.
11767 (rule_t): Remove the guard and guard_line members.
11768 * src/lex.h (token_t): remove tok_guard.
11769 * src/options.c (option_table): Remove %guard and %semantic_parser
11770 support.
11771 * src/output.c, src/output.h (guards_output): Remove.
11772 (prepare): Adjust.
11773 (token_definitions_output): Don't output the `T'
11774 tokens (???).
11775 (output_skeleton): Don't output the guards.
11776 * src/files.c, src/files.c (attrsfile): Remove.
11777 * src/reader.c (symbol_list): Remove the guard and guard_line
11778 members.
11779 Adjust dependencies.
11780 (parse_guard): Remove.
11781 * data/bison.hairy: Remove.
11782 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11783 BISON_HAIRY.
11784
82b6cb3f
AD
117852002-05-02 Akim Demaille <akim@epita.fr>
11786
11787 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
11788 (parse_guard): Rename the formal argument `stack_offset' as
11789 `rule_length', which is more readable.
11790 Adjust callers.
11791 (copy_at, copy_dollar): Instead of outputting the hard coded
11792 values of $$, $n and so forth, output invocation to b4_lhs_value,
11793 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
11794 Note: this patch partially drops `semantic-parser' support: it
11795 always does `rule_length - n', where semantic parsers ought to
11796 always use `-n'.
82b6cb3f
AD
11797 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11798 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11799
6cbfbcc5
AD
118002002-05-02 Akim Demaille <akim@epita.fr>
11801
11802 * configure.in (AC_INIT): Bump to 1.49b.
11803 (AM_INIT_AUTOMAKE): Short invocation.
11804
b8548114
AD
118052002-05-02 Akim Demaille <akim@epita.fr>
11806
11807 Version 1.49a.
11808
c20cd1fa
AD
118092002-05-01 Akim Demaille <akim@epita.fr>
11810
11811 * src/skeleton.h: Remove.
11812
8a9566d4
AD
118132002-05-01 Akim Demaille <akim@epita.fr>
11814
11815 * src/skeleton.h: Fix the #endif.
11816 Reported by Magnus Fromreide.
11817
8c6d399a
PE
118182002-04-26 Paul Eggert <eggert@twinsun.com>
11819
11820 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
11821 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 11822 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 11823
2b7ed18a
RA
118242002-04-25 Robert Anisko <robert@lrde.epita.fr>
11825
11826 * src/scan-skel.l: Postprocess quadrigraphs.
11827
11828 * src/reader.c (copy_character): New function, used to output
11829 single characters while replacing `[' and `]' with quadrigraphs, to
11830 avoid troubles with M4 quotes.
11831 (copy_comment): Output characters with copy_character.
11832 (read_additionnal_code): Likewise.
11833 (copy_string2): Likewise.
11834 (copy_definition): Likewise.
11835
11836 * tests/calc.at: Exercise M4 quoting.
11837
34a89c50
AD
118382002-04-25 Akim Demaille <akim@epita.fr>
11839
11840 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11841 between `!' and the command.
11842 Reported by Paul Eggert.
11843
0dd1580a
RA
118442002-04-24 Robert Anisko <robert@lrde.epita.fr>
11845
11846 * tests/calc.at: Exercise prologue splitting.
11847
11848 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11849 `b4_post_prologue' instead of `b4_prologue'.
11850
11851 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11852 muscles.
11853 (output): Free pre_prologue_obstack and post_prologue_obstack.
11854 * src/files.h, src/files.c (attrs_obstack): Remove.
11855 (pre_prologue_obstack, post_prologue_obstack): New.
11856 * src/reader.c (copy_definition): Add a parameter to specify the
11857 obstack to fill, instead of using attrs_obstack unconditionally.
11858 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11859 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11860
83c1796f
PE
118612002-04-23 Paul Eggert <eggert@twinsun.com>
11862
11863 * data/bison.simple: Remove unnecessary commentary and white
11864 space differences from 1_29-branch.
11865 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11866
11867 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11868 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11869 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11870 constructors or destructors.
11871
11872 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11873
1207eeac
AD
118742002-04-23 Akim Demaille <akim@epita.fr>
11875
11876 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11877 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11878 location with columns.
11879 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11880 All reported by Paul Eggert.
11881
78ab8f67
AD
118822002-04-22 Akim Demaille <akim@epita.fr>
11883
11884 * src/reduce.c (dump_grammar): Move to...
11885 * src/gram.h, src/gram.c (grammar_dump): here.
11886 Be sure to separate long item numbers.
11887 Don't read the members of a rule's prec if its nil.
11888
133c20e2
AD
118892002-04-22 Akim Demaille <akim@epita.fr>
11890
11891 * src/output.c (table_size, table_grow): New.
11892 (MAXTABLE): Remove, replace uses with table_size.
11893 (pack_vector): Instead of dying when the table is too big, grow it.
11894
9515e8a7
AD
118952002-04-22 Akim Demaille <akim@epita.fr>
11896
11897 * data/bison.simple (yyr1): Its type is that of a token number.
11898 * data/bison.c++ (r1_): Likewise.
11899 * tests/regression.at (Web2c Actions): Adjust.
11900
23c5a174
AD
119012002-04-22 Akim Demaille <akim@epita.fr>
11902
11903 * src/reader.c (token_translations_init): 256 is now the default
11904 value for the error token, i.e., it will be assigned another
11905 number if the user assigned 256 to one of her tokens.
11906 (reader): Don't force 256 to error.
11907 * doc/bison.texinfo (Symbols): Adjust.
11908 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11909 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11910 etc. instead of 10, 20, 30 (which was used to `jump' over error
11911 (256) and undefined (2)).
11912
5fbb0954
AD
119132002-04-22 Akim Demaille <akim@epita.fr>
11914
11915 Propagate more token_number_t.
11916
11917 * src/gram.h (token_number_as_item_number)
11918 (item_number_as_token_number): New.
11919 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11920 Use it to create output_item_number_table and
11921 output_token_number_table.
11922 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11923 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11924 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11925 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11926
4f940944
AD
119272002-04-22 Akim Demaille <akim@epita.fr>
11928
11929 * src/output.h, src/output.c (get_lines_number): Remove.
11930
3ded9a63
AD
119312002-04-19 Akim Demaille <akim@epita.fr>
11932
11933 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11934 as Lex/Flex'.
11935 (Debugging): More details about enabling the debugging features.
11936 (Table of Symbols): Describe $$, $n, @$, and @n.
11937 Suggested by Tim Josling.
11938
e0c471a9
AD
119392002-04-19 Akim Demaille <akim@epita.fr>
11940
11941 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11942
fecc10cd
AD
119432002-04-10 Akim Demaille <akim@epita.fr>
11944
11945 * src/system.h: Rely on HAVE_LIMITS_H.
11946 Suggested by Paul Eggert.
11947
51dec47b
AD
119482002-04-09 Akim Demaille <akim@epita.fr>
11949
11950 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11951 full stderr, and strip it according to the bison options, instead
11952 of composing the error message from different bits.
11953 This makes it easier to check for several error messages.
11954 Adjust all the invocations.
11955 Add an invocation exercising the error token.
11956 Add an invocation demonstrating a stupid error message.
11957 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11958 Adjust the tests.
11959 Error message are for stderr, not stdout.
11960
007a50a4
AD
119612002-04-09 Akim Demaille <akim@epita.fr>
11962
11963 * src/gram.h, src/gram.c (error_token_number): Remove, use
11964 errtoken->number.
11965 * src/reader.c (reader): Don't specify the user token number (2)
11966 for $undefined, as it uselessly prevents using it.
11967 * src/gram.h (token_number_t): Move to...
11968 * src/symtab.h: here.
11969 (state_t.number): Is a token_number_t.
11970 * src/print.c, src/reader.c: Use undeftoken->number instead of
11971 hard coded 2.
11972 (Even though this 2 is not the same as above: the number of the
11973 undeftoken remains being 2, it is its user token number which
11974 might not be 2).
11975 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11976 `user_token_number_max'.
11977 Output `undef_token_number'.
11978 * data/bison.simple, data/bison.c++: Use them.
11979 Be sure to map invalid yylex return values to
11980 `undef_token_number'. This saves us from gratuitous SEGV.
11981
11982 * tests/conflicts.at (Solved SR Conflicts)
11983 (Unresolved SR Conflicts): Adjust.
11984 * tests/regression.at (Web2c Actions): Adjust.
11985
06446ccf
AD
119862002-04-08 Akim Demaille <akim@epita.fr>
11987
11988 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11989 Adding #line.
11990 Remove the duplicate `typedefs'.
11991 (RhsNumberType): Fix the declaration and various other typos.
11992 Use __ofile__.
11993 * data/bison.simple: Use __ofile__.
11994 * src/scan-skel.l: Handle __ofile__.
11995
62a3e4f0
AD
119962002-04-08 Akim Demaille <akim@epita.fr>
11997
11998 * src/gram.h (item_number_t): New, the type of item numbers in
11999 RITEM. Note that it must be able to code symbol numbers as
12000 positive number, and the negation of rule numbers as negative
12001 numbers.
12002 Adjust all dependencies (pretty many).
12003 * src/reduce.c (rule): Remove this `short *' pointer: use
12004 item_number_t.
12005 * src/system.h (MINSHORT, MAXSHORT): Remove.
12006 Include `limits.h'.
12007 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
12008 (shortcpy): Remove.
12009 (MAXTABLE): Move to...
12010 * src/output.c (MAXTABLE): here.
12011 (prepare_rules): Use output_int_table to output rhs.
12012 * data/bison.simple, data/bison.c++: Adjust.
12013 * tests/torture.at (Big triangle): Move the limit from 254 to
12014 500.
12015 * tests/regression.at (Web2c Actions): Ajust.
12016
12017 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
12018 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
12019 passes, but produces negative #line number, once fixed, GCC is
12020 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
12021 C), it passes.
12022 * src/state.h (state_h): Code input lines on ints, not shorts.
12023
bb88b0fc
AD
120242002-04-08 Akim Demaille <akim@epita.fr>
12025
12026 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
12027 and then the grammar.
12028
9a636f47
AD
120292002-04-08 Akim Demaille <akim@epita.fr>
12030
12031 * src/system.h: No longer using strndup.
12032
680e8701
AD
120332002-04-07 Akim Demaille <akim@epita.fr>
12034
12035 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
12036 * src/output.c (output_table_data): Return the longest number.
12037 (prepare_tokens): Output `token_number_max').
12038 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12039 New.
12040 Use them to define yy_token_number_type/TokenNumberType.
12041 Use this type for yytranslate.
12042 * tests/torture.at (Big triangle): Push the limit from 124 to
12043 253.
12044 * tests/regression.at (Web2c Actions): Adjust.
12045
817e9f41
AD
120462002-04-07 Akim Demaille <akim@epita.fr>
12047
12048 * tests/torture.at (Big triangle): New.
12049 (GNU AWK Grammar, GNU Cim Grammar): Move to...
12050 * tests/existing.at: here.
12051
5123689b
AD
120522002-04-07 Akim Demaille <akim@epita.fr>
12053
12054 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
12055 nritems.
12056 Adjust dependencies.
12057
f3849179
AD
120582002-04-07 Akim Demaille <akim@epita.fr>
12059
12060 * src/reader.c: Normalize increments to prefix form.
12061
bd02036a
AD
120622002-04-07 Akim Demaille <akim@epita.fr>
12063
12064 * src/reader.c, symtab.c: Remove debugging code.
12065
db8837cb
AD
120662002-04-07 Akim Demaille <akim@epita.fr>
12067
12068 Rename all the `bucket's as `symbol_t'.
12069
12070 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
12071 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
12072 * src/symtab.c, src/symtab.h (bucket): Rename as...
12073 (symbol_t): this.
12074 (symbol_list_new, bucket_check_defined, bucket_make_alias)
12075 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
12076 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12077 (buckets_new, buckets_free, buckets_do): Rename as...
12078 (symbol_list_new, symbol_check_defined, symbol_make_alias)
12079 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12080 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
12081 (symbols_new, symbols_free, symbols_do): these.
12082
72a23c97
AD
120832002-04-07 Akim Demaille <akim@epita.fr>
12084
12085 Use lib/hash for the symbol table.
12086
12087 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
12088 EOF.
12089 * src/lex.c (lex): Set the `number' member of new terminals.
12090 * src/reader.c (bucket_check_defined, bucket_make_alias)
12091 (bucket_check_alias_consistence, bucket_translation): New.
12092 (reader, grammar_free, readgram, token_translations_init)
12093 (packsymbols): Adjust.
12094 (reader): Number the predefined tokens.
12095 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
12096 for predefined tokens.
12097 * src/symtab.h (bucket): Remove all the hash table related
12098 members.
12099 * src/symtab.c (symtab): Replace by...
12100 (bucket_table): this.
12101 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12102 (buckets_new, buckets_do): New.
12103
280a38c3
AD
121042002-04-07 Akim Demaille <akim@epita.fr>
12105
12106 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
12107 (start_symbol, max_user_token_number, semantic_parser)
12108 (error_token_number): Initialize.
12109 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
12110 Initialize.
12111 (reader): Don't.
12112 (errtoken, eoftoken, undeftoken, axiom): Extern.
12113
03b31c0c
AD
121142002-04-07 Akim Demaille <akim@epita.fr>
12115
12116 * src/gram.h (rule_s): prec and precsym are now pointers
12117 to the bucket giving the priority/associativity.
12118 Member `associativity' removed: useless.
12119 * src/reduce.c, src/conflicts.c: Adjust.
12120
8b3df748
AD
121212002-04-07 Akim Demaille <akim@epita.fr>
12122
12123 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
12124 Properly escape the symbols' TAG when outputting them.
12125
e601aa1d
AD
121262002-04-07 Akim Demaille <akim@epita.fr>
12127
12128 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12129
b0299a2e
AD
121302002-04-07 Akim Demaille <akim@epita.fr>
12131
12132 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12133 (LArule): this, which is an array to rule_t*.
12134 * src/print.c, src/conflicts.c: Adjust.
12135
d7e1f00c
AD
121362002-04-07 Akim Demaille <akim@epita.fr>
12137
12138 * src/gram.h (rule_t): Rename `number' as `user_number'.
12139 `number' is a new member.
12140 Adjust dependencies.
12141 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12142
cc9305dd
AD
121432002-04-07 Akim Demaille <akim@epita.fr>
12144
12145 As a result of the previous patch, it is no longer needed
12146 to reorder ritem itself.
12147
12148 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12149
b0940840
AD
121502002-04-07 Akim Demaille <akim@epita.fr>
12151
12152 Be sure never to walk through RITEMS, but use only data related to
12153 the rules themselves. RITEMS should be banished.
12154
12155 * src/output.c (output_token_translations): Rename as...
12156 (prepare_tokens): this.
12157 In addition to `translate', prepare the muscles `tname' and
12158 `toknum', which were handled by...
12159 (output_rule_data): this.
12160 Remove, and move the remainder of its outputs into...
12161 (prepare_rules): this new routines, which also merges content from
12162 (output_gram): this.
12163 (prepare_rules): Be sure never to walk through RITEMS.
12164 (output_stos): Rename as...
12165 (prepare_stos): this.
12166 (output): Always invoke prepare_states, after all, just don't use it
12167 in the output if you don't need it.
12168
643a5994
AD
121692002-04-07 Akim Demaille <akim@epita.fr>
12170
12171 * src/LR0.c (new_state): Display `nstates' as the name of the
12172 newly created state.
12173 Adjust to initialize first_state and last_state if needed.
12174 Be sure to distinguish the initial from the final state.
12175 (new_states): Create the itemset of the initial state, and use
12176 new_state.
12177 * src/closure.c (closure): Now that the initial state has its
12178 items properly set, there is no need for a special case when
12179 creating `ruleset'.
12180
12181 As a result, now the rule 0, reducing to $axiom, is visible in the
12182 outputs. Adjust the test suite.
12183
12184 * tests/conflicts.at (Solved SR Conflicts)
12185 (Unresolved SR Conflicts): Adjust.
12186 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12187 * tests/conflicts.at (S/R in initial): New.
12188
b4c4ccc2
AD
121892002-04-07 Akim Demaille <akim@epita.fr>
12190
12191 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12192 the RHS of the rules.
12193 * src/output.c (output_gram): Likewise.
12194
bba97eb2
AD
121952002-04-07 Akim Demaille <akim@epita.fr>
12196
12197 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12198 bucket.
12199 Adjust all dependencies.
12200 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12201 `number' of the buckets too.
12202 * src/gram.h: Include `symtab.h'.
12203 (associativity): Move to...
12204 * src/symtab.h: here.
12205 No longer include `gram.h'.
12206
c3b407f4
AD
122072002-04-07 Akim Demaille <akim@epita.fr>
12208
12209 * src/gram.h, src/gram.c (rules_rhs_length): New.
12210 (ritem_longest_rhs): Use it.
12211 * src/gram.h (rule_t): `number' is a new member.
12212 * src/reader.c (packgram): Set it.
12213 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12214 the end of `rules', and count them out of `nrules'.
12215 (reduce_output, dump_grammar): Adjust.
12216 * src/print.c (print_grammar): It is no longer needed to check for
12217 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12218 * tests/reduce.at (Reduced Automaton): New test.
12219
11652ab3
AD
122202002-04-07 Akim Demaille <akim@epita.fr>
12221
12222 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12223 lacking `+ 1' to nrules, Bison reported as useless a token if it
12224 was used solely to set the precedence of the last rule...
12225
26b23c1a
AD
122262002-04-07 Akim Demaille <akim@epita.fr>
12227
12228 * data/bison.c++, data/bison.simple: Don't output the current file
12229 name in #line, to avoid useless diffs between two identical
12230 outputs under different names.
12231
18bcecb0
AD
122322002-04-07 Akim Demaille <akim@epita.fr>
12233
12234 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12235 Normalize loops to using `< nrules + 1', not `<= nrules'.
12236
fa770c86
AD
122372002-04-07 Akim Demaille <akim@epita.fr>
12238
12239 * TODO: Update.
12240
d9b739c3
AD
122412002-04-07 Akim Demaille <akim@epita.fr>
12242
12243 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12244 bucket.value as bucket.number.
12245
99013900
AD
122462002-04-07 Akim Demaille <akim@epita.fr>
12247
12248 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12249 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12250 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12251 RHS, instead of being an index in RITEMS.
12252
e966383b
PE
122532002-04-04 Paul Eggert <eggert@twinsun.com>
12254
12255 * doc/bison.texinfo: Update copyright date.
12256 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12257 (Symbols): Warn about running Bison in one character set,
12258 but compiling and/or running in an incompatible one.
12259 Warn about character code 256, too.
12260
122612002-04-03 Paul Eggert <eggert@twinsun.com>
12262
12263 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12264 YYERROR_VERBOSE is nonzero, not whether it is defined.
12265
12266 Merge changes from bison-1_29-branch.
c307773e 12267
8d6c48b9
PE
122682002-03-20 Paul Eggert <eggert@twinsun.com>
12269
12270 Merge fixes from Debian bison_1.34-1.diff.
12271
12272 * configure.in (AC_PREREQ): 2.53.
12273
e53c6322
AD
122742002-03-20 Akim Demaille <akim@epita.fr>
12275
12276 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12277
9ffbeca7
PE
122782002-03-19 Paul Eggert <eggert@twinsun.com>
12279
21db0b2a
PE
12280 * src/bison.simple (YYCOPY): New macro.
12281 (YYSTACK_RELOCATE): Use it.
12282 Remove Type arg; no longer needed. All callers changed.
12283 (yymemcpy): Remove; no longer needed.
12284
9ffbeca7
PE
12285 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12286 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12287
642cb8f8
AD
122882002-03-19 Akim Demaille <akim@epita.fr>
12289
12290 Test and fix the #line outputs.
12291
12292 * tests/atlocal.at (GCC): New.
12293 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 12294 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
12295 (Action synch line, Epilogue synch line): New tests.
12296 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12297 * data/bison.simple, data/bison.c++: Use it.
12298
3c31a486
AD
122992002-03-19 Akim Demaille <akim@epita.fr>
12300
12301 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12302 (Solved SR Conflicts, %expect not enough, %expect right)
12303 (%expect too much): Move to...
12304 * tests/conflicts.at: this new file.
12305
0d8bed56
AD
123062002-03-19 Akim Demaille <akim@epita.fr>
12307
12308 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12309 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12310 that we can move to enums for instance.
12311 * src/output.c (token_definitions_output): Output a list of
12312 `token-name, token-number' instead of the #define.
12313 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12314
9208d17f
AD
123152002-03-14 Akim Demaille <akim@epita.fr>
12316
12317 Use Gettext 0.11.1.
12318
af27eacb
RA
123192002-03-09 Robert Anisko <robert@lrde.epita.fr>
12320
12321 * data/bison.c++: Make the user able to add members to the generated
12322 parser by subclassing.
12323
9101a310
RA
123242002-03-05 Robert Anisko <robert@lrde.epita.fr>
12325
12326 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12327 a character.
12328 Reported by Nicolas Tisserand and Nicolas Burrus.
12329
fff9bf0b
RA
123302002-03-04 Robert Anisko <robert@lrde.epita.fr>
12331
12332 * src/reader.c: Warn about lacking semi-colons, do not complain.
12333
64dba31e
RA
123342002-03-04 Robert Anisko <robert@lrde.epita.fr>
12335
12336 * data/bison.c++: Remove a debug line.
12337
374f5a14
RA
123382002-03-04 Robert Anisko <robert@lrde.epita.fr>
12339
12340 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12341 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12342 provide a default implementation.
12343
bfcf1f3a
AD
123442002-03-04 Akim Demaille <akim@epita.fr>
12345
12346 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12347 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12348 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12349 * tests/semantic.at (Parsing Guards): Similarly.
12350 * src/reader.at (readgram): Complain if the last rule is not ended
12351 with a semi-colon.
12352
65ccf9fc
AD
123532002-03-04 Akim Demaille <akim@epita.fr>
12354
12355 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12356 * src/closure.c: here.
12357 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12358 RTC.
12359 * src/warshall.h, src/warshall.c: Remove.
12360 * tests/sets.at (Broken Closure): Adjust.
12361
d0039cbc
AD
123622002-03-04 Akim Demaille <akim@epita.fr>
12363
12364 * src/output.c (output_skeleton): tempdir is const.
12365 bytes_read is unused.
12366
345cea78
AD
123672002-03-04 Akim Demaille <akim@epita.fr>
12368
12369 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12370 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12371 Update.
12372 From Michael Hayes.
12373
564801f7
AD
123742002-03-04 Akim Demaille <akim@epita.fr>
12375
12376 * src/closure.c (closure): `r' is unused.
12377
e5352bc7
AD
123782002-03-04 Akim Demaille <akim@epita.fr>
12379
12380 * tests/sets.at (Broken Closure): Add the ending `;'.
12381 * src/reader.at (readgram): Complain if a rule is not ended with a
12382 semi-colon.
12383
914feea9
AD
123842002-03-04 Akim Demaille <akim@epita.fr>
12385
12386 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12387 (count_sr_conflicts): Use bitset_count.
12388 * src/reduce.c (inaccessable_symbols): Ditto.
12389 (bits_size): Remove.
12390 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12391
f0250de6
AD
123922002-03-04 Akim Demaille <akim@epita.fr>
12393
12394 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12395 * src/reduce.c: Remove the `bitset_zero's following the
12396 `bitset_create's, as now it is performed by the latter.
12397
ef017502
AD
123982002-03-04 Akim Demaille <akim@epita.fr>
12399
12400 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12401 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12402 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12403 latest sources from Michael.
12404
76514394
AD
124052002-03-04 Akim Demaille <akim@epita.fr>
12406
12407 * src/output.c (output): Don't free the grammar.
12408 * src/reader.c (grammar_free): New.
12409 * src/main.c (main): Call it and don't free symtab here.
12410
55024580
AD
124112002-03-04 Akim Demaille <akim@epita.fr>
12412
12413 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12414 before returning.
12415 Reported by Benoit Perrot.
12416
f9abaa2c
AD
124172002-03-04 Akim Demaille <akim@epita.fr>
12418
12419 Use bitset operations when possible, not loops over bits.
12420
12421 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12422 bitset_or.
12423 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12424 * src/reduce.c (useless_nonterminals): Formatting changes.
12425 * src/warshall.c (TC): Use bitset_or.
12426
0e721e75
AD
124272002-03-04 Akim Demaille <akim@epita.fr>
12428
12429 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12430 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12431 Ditto.
12432
0fb1ffb1
AD
124332002-03-04 Akim Demaille <akim@epita.fr>
12434
12435 * src/lalr.c (F): Now a bitset*.
12436 Adjust all dependencies.
12437
b86796bf
AD
124382002-03-04 Akim Demaille <akim@epita.fr>
12439
12440 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12441 Adjust all dependencies.
12442
602bbf31
AD
124432002-03-04 Akim Demaille <akim@epita.fr>
12444
12445 * src/L0.c, src/LR0.h (nstates): Be size_t.
12446 Adjust comparisons (signed vs unsigned).
12447 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12448 bitset*.
12449 Adjust all dependencies.
12450
d8a0245c
AD
124512002-03-04 Akim Demaille <akim@epita.fr>
12452
12453 * src/closure.c (firsts): Now, also a bitset.
12454 Adjust all dependencies.
12455 (varsetsize): Remove, now unused.
12456 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12457
34ba9743
AD
124582002-03-04 Akim Demaille <akim@epita.fr>
12459
12460 * src/print.c: Convert to use bitset.h, not hand coded iterations
12461 over ints.
12462
ed86e78c
AD
124632002-03-04 Akim Demaille <akim@epita.fr>
12464
12465 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12466
dfdb1797
AD
124672002-03-04 Akim Demaille <akim@epita.fr>
12468
12469 * src/closure.c (ruleset): Be a bitset.
12470 (rulesetsize): Remove.
12471
7086e707
AD
124722002-03-04 Akim Demaille <akim@epita.fr>
12473
12474 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12475 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12476 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12477 * src/closure.c (fderives): Be an array of bitsets.
12478
98254360
RA
124792002-02-28 Robert Anisko <robert@lrde.epita.fr>
12480
12481 * data/bison.c++: Merge the two generated headers. Insert a copyright
12482 notice in each output file.
12483
a75c057f
AD
124842002-02-28 Akim Demaille <akim@epita.fr>
12485
12486 * data/bison.c++: Copy the prologue of bison.simple to fetch
12487 useful M4 definitions, such as b4_header_guard.
12488
06b00abc
AD
124892002-02-25 Akim Demaille <akim@epita.fr>
12490
12491 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
12492 translator friendly scheme for the bgr
12493 copyright notice.
06b00abc 12494
70e7d534
AD
124952002-02-25 Akim Demaille <akim@epita.fr>
12496
12497 * src/output.c (header_output): Remove, now handled completely via
12498 M4.
12499
abe017f6
AD
125002002-02-25 Akim Demaille <akim@epita.fr>
12501
12502 * m4/m4.m4: New, from CVS Autoconf.
12503 * configure.in: Invoke it.
12504 * src/output.c (output_skeleton): Use its result instead of the
12505 hard coded name.
12506
381fb12e
AD
125072002-02-25 Akim Demaille <akim@epita.fr>
12508
12509 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12510 Fileutils 4.1.5.
12511 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12512 * src/output.c (output_skeleton): Use mkstemp to create a real
12513 temporary file.
12514 Move the filling of `skeleton' and its muscle to...
12515 (prepare): here.
12516 (output): Move the definition of the prologue muscle to...
12517 (prepare): here.
12518 * src/system.h (DEFAULT_TMPDIR): New.
12519
6f38107f
PE
125202002-02-14 Paul Eggert <eggert@twinsun.com>
12521
12522 Remove the support for C++ namespace cleanliness; it was
12523 causing more problems than it was curing, since it didn't work
12524 properly on some nonstandard C++ compilers. This can wait
12525 for a proper C++ parser.
12526
12527 * NEWS: Document this.
12528 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12529 of C++, as it's treated like C now.
12530 * src/bison.simple (YYSTD): Remove.
12531 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12532 Treat C++ just like Standard C instead of trying to support
12533 namespace cleanliness.
12534
80cce3da
AD
125352002-02-14 Akim Demaille <akim@epita.fr>
12536
12537 * tests/regression.at (else): Adjust to Andreas' change.
12538
842e8679
AD
125392002-02-14 Akim Demaille <akim@epita.fr>
12540
12541 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12542
4bda3f10
AD
125432002-02-13 Andreas Schwab <schwab@suse.de>
12544
12545 * src/output.c (output_rule_data): Don't output NULL, it might
12546 not be defined yet.
12547
4162fa07 125482002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 12549
4162fa07
RA
12550 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12551 (Copyright notice): Update.
b418ecd8 12552
bd16a5dc
AD
125532002-02-11 Akim Demaille <akim@epita.fr>
12554
12555 * tests/regression.at (%nonassoc and eof): Don't include
12556 nonportable headers.
12557
8d69a1a3
RA
125582002-02-08 Robert Anisko <robert@lrde.epita.fr>
12559
12560 * data/bison.c++: Correct error recovery. Make the user able to
12561 initialize the starting location.
12562
9b2d0677
AD
125632002-02-07 Akim Demaille <akim@epita.fr>
12564
12565 * tests/input.at: New.
12566
69e2658b
RA
125672002-02-07 Robert Anisko <robert@lrde.epita.fr>
12568
12569 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 12570 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
12571 directives around tables only needed for debugging.
12572
4aacc3a7
RA
125732002-02-07 Robert Anisko <robert@lrde.epita.fr>
12574
12575 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12576 C++ parsers.
12577 (yy::b4_name::parse): Use print_.
12578
762a801e
RA
125792002-02-07 Robert Anisko <robert@lrde.epita.fr>
12580
12581 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12582
4bb2bc3f
RA
125832002-02-07 Robert Anisko <robert@lrde.epita.fr>
12584
12585 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12586 C++ parsers.
12587 (yy::b4_name::parse): Build verbose error messages, and use error_.
12588
6b45a3ca
RA
125892002-02-06 Robert Anisko <robert@lrde.epita.fr>
12590
12591 * data/bison.c++: Fix m4 quoting in comments.
12592
50997c6e
RA
125932002-02-06 Robert Anisko <robert@lrde.epita.fr>
12594
12595 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12596 not expanded by m4.
12597
3f3eed27
AD
125982002-02-05 Akim Demaille <akim@epita.fr>
12599
12600 * data/bison.c++: Adjust to the M4 back end.
12601 More is certainly needed.
12602
be2a1a68
AD
126032002-02-05 Akim Demaille <akim@epita.fr>
12604
12605 Give a try to M4 as a back end.
12606
12607 * lib/readpipe.c: New, from wdiff.
12608 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12609 BISON_HAIRY.
12610 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12611 specific values. Now it is m4 that performs the lookup.
12612 * src/parse-skel.y: Remove.
12613 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12614 * src/output.c (actions_output, guards_output)
12615 (token_definitions_output): No longer keeps track of the output
12616 line number, hence remove the second argument.
12617 (guards_output): Check against the guard member of a rule, not the
12618 action member.
12619 Adjust callers.
12620 (output_skeleton): Don't look for the skeleton location, let m4 do
12621 that.
12622 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12623 file will be used.
12624 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12625 (prepare): Given that for the time being changesyntax is not
12626 usable in M4, rename the muscles using `-' to `_'.
12627 Define `defines_flag', `output_parser_name' and `output_header_name'.
12628 * src/output.h (actions_output, guards_output)
12629 (token_definitions_output): Adjust prototypes.
12630 * src/scan-skel.l: Instead of scanning the skeletons, it now
12631 processes the output of m4: `__oline__' and `#output'.
12632 * data/bison.simple: Adjust to be used by M4(sugar).
12633 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12634 to date.
12635 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12636 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12637 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12638 shamelessly stolen from CVS Autoconf.
12639
beda758b
AD
126402002-02-05 Akim Demaille <akim@epita.fr>
12641
12642 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12643 * configure.in: Check for the declarations of free and malloc.
12644 * src/muscle_tab.c: Adjust.
12645
5ece6d43
AD
126462002-02-05 Akim Demaille <akim@epita.fr>
12647
12648 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12649 which have no values.
12650
5bb18f9a
AD
126512002-02-05 Akim Demaille <akim@epita.fr>
12652
12653 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12654 * data/: here.
12655
894dd62e
PE
126562002-01-29 Paul Eggert <eggert@twinsun.com>
12657
12658 * src/bison.simple (YYSIZE_T): Do not define merely because
12659 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12660 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12661
82841af7
AD
126622002-01-27 Akim Demaille <akim@epita.fr>
12663
12664 Fix `%nonassoc and eof'.
12665
12666 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12667 which were not properly copied! Replace
12668 memcpy (res->errs, src->errs, src->nerrs);
12669 with
12670 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12671 !!!
12672 * tests/regression.at (%nonassoc and eof): Adjust to newest
12673 Autotest: `.' is not in the PATH.
12674
318b76e9
AD
126752002-01-27 Akim Demaille <akim@epita.fr>
12676
12677 * tests/sets.at (AT_EXTRACT_SETS): New.
12678 (Nullable): Use it.
12679 (Firsts): New.
12680
30d2f3d5
AD
126812002-01-26 Akim Demaille <akim@epita.fr>
12682
12683 * tests/actions.at, tests/calc.at, tests/headers.at,
12684 * tests/torture.at: Adjust to the newest Autotest which no longer
12685 forces `.' in the PATH.
12686
30f8c395
AD
126872002-01-25 Akim Demaille <akim@epita.fr>
12688
12689 * tests/regression.at (%nonassoc and eof): New.
12690 Suggested by Robert Anisko.
12691
29ae55f1
AD
126922002-01-24 Akim Demaille <akim@epita.fr>
12693
12694 Bison dumps core when trying to complain about broken input files.
12695 Reported by Cris van Pelt.
12696
12697 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12698 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12699 into...
12700 (Invalid inputs): Strengthen: exercise parse_percent_token.
12701
2b548aa6
RA
127022002-01-24 Robert Anisko <robert.anisko@epita.fr>
12703
12704 * src/Makefile.am: Add bison.c++.
12705 * src/bison.c++: New skeleton.
12706
bb0146c2
AD
127072002-01-21 Paolo Bonzini <bonzini@gnu.org>
12708
12709 * po/it.po: New.
12710
bec30531
AD
127112002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12712
12713 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12714
fc6edc45
MA
127152002-01-20 Marc Autret <marc@gnu.org>
12716
12717 * src/files.c (compute_output_file_names): Fix
12718
5e5d5415
MA
127192002-01-20 Marc Autret <marc@gnu.org>
12720
12721 * tests/output.at: New test.
12722 * src/files.c (compute_base_names): Don't map extensions when
12723 the YACC flag is set, use defaults.
12724 Reported by Evgeny Stambulchik.
12725
44ea3fbd
MA
127262002-01-20 Marc Autret <marc@gnu.org>
12727
ba0fe3c7
PE
12728 * src/system.h: Need to define __attribute__ away for non-GCC
12729 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
12730 Suggested by Albert Chin-A-Young.
12731
338963d1
TVH
127322002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12733
12734 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
12735 canonical definition.
12736 * src/system.h: Use the canonical definition for PARAMS (avoids
12737 a conflict with the macro from lib/hash.h).
12738
c57b2479
AD
127392002-01-11 Akim Demaille <akim@epita.fr>
12740
12741 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 12742 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 12743
b85810ae
AD
127442002-01-09 Akim Demaille <akim@epita.fr>
12745
12746 * src/files.c, src/files.h (output_infix): New.
12747 (tab_extension): Remove.
12748 (compute_base_names): Compute the former, drop the latter.
12749 * src/output.c (prepare): Insert the muscles `output-infix', and
12750 `output-suffix'.
12751 * src/parse-skel.y (string, string.1): New.
12752 (section.header): Use it.
12753 (section.yacc): Remove.
12754 (prefix): Remove too.
12755 * src/scan-skel.l: Adjust.
12756 * src/bison.simple, src/bison.hairy: Adjust.
12757
cae60122
AD
127582002-01-09 Akim Demaille <akim@epita.fr>
12759
12760 * configure.in (WERROR_CFLAGS): Compute it.
12761 * src/Makefile.am (CFLAGS): Pass it.
12762 * tests/atlocal.in (CFLAGS): Idem.
12763 * src/files.c: Fix a few warnings.
12764 (get_extension_index): Remove, unused.
12765
ae404801
AD
127662002-01-08 Akim Demaille <akim@epita.fr>
12767
12768 * src/getargs.c (AS_FILE_NAME): New.
12769 (getargs): Use it to convert DOSish file names.
12770 * src/files.c (base_name): Rename as full_base_name to avoid
12771 clashes with `base_name ()'.
12772 (filename_split): New.
12773 (compute_base_names): N-th rewrite, using filename_split.
12774
22312b71
AD
127752002-01-08 Akim Demaille <akim@epita.fr>
12776
12777 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
12778 New, stolen from the Fileutils 4.1.
12779 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12780 * configure.in: Check for the presence of memrchr, and of its
12781 prototype.
12782
a67cef01
TVH
127832002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12784
12785 * lib/hash.h (__P): Added definition for this macro.
12786 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
12787 BUILT_SOURCES, to ensure they are generated first.
12788 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
12789 %error-verbose to allow bootstrapping with bison 1.30x.
12790
2b25d624
AD
127912002-01-06 Akim Demaille <akim@epita.fr>
12792
12793 * src/reader.c (parse_braces): Don't fetch the next char, the
12794 convention is to fetch on entry.
12795 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
12796 'switch' without a following semicolon.
12797 * tests/regression.at (braces parsing): New.
12798
3460813b
AD
127992002-01-06 Akim Demaille <akim@epita.fr>
12800
12801 Bison is dead wrong in its RR conflict reports.
12802
12803 * tests/torture.at (GNU Cim Grammar): New.
12804 * src/conflicts.c (count_rr_conflicts): Fix.
12805
73784c64
AD
128062002-01-06 Akim Demaille <akim@epita.fr>
12807
12808 Creating package.m4 from configure.ac causes too many problems.
12809
12810 * tests/Makefile.am (package.m4): Create it by hand,
12811 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12812
25d81090
AD
128132002-01-06 Akim Demaille <akim@epita.fr>
12814
12815 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12816 skeleton.h.
12817
a9b8959e
PE
128182002-01-04 Paul Eggert <eggert@twinsun.com>
12819
12820 * doc/bison.texinfo (Debugging):
12821 Remove YYSTDERR; it's no longer defined or used.
12822 Also, s/cstdio.h/cstdio/.
12823
25d81090
AD
128242002-01-03 Akim Demaille <akim@epita.fr>
12825
12826 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12827
1109455c
AD
128282002-01-03 Akim Demaille <akim@epita.fr>
12829
12830 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12831 tracing code to --trace, wait for a better --trace option, with
12832 args.
12833
7ea5e977
AD
128342002-01-03 Akim Demaille <akim@epita.fr>
12835
12836 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12837 The ISO C++ standard is extremely clear about it: stderr is
12838 considered a macro, not a regular symbol (see table 94 `Header
12839 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12840 Therefore std:: does not apply to it. It still does with fprintf.
12841 Also, s/cstdio.h/cstdio/.
12842
fab5b110
AD
128432002-01-03 Akim Demaille <akim@epita.fr>
12844
12845 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12846 for non system headers.
12847
aed7fd9b
AD
128482002-01-02 Akim Demaille <akim@epita.fr>
12849
12850 Equip the skeleton chain with location tracking, runtime trace,
12851 pure parser and scanner.
12852
12853 * src/parse-skel.y: Request a pure parser, locations, and prefix
12854 renaming.
12855 (%union): Having several members with the same type does not help
12856 type mismatches, simplify.
12857 (YYPRINT, yyprint): New.
12858 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12859 (skel_error): this.
12860 Handle locations.
12861 * src/scan-skel.l: Adjust to these changes.
12862 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12863 (LOCATION_PRINT, skel_control_t): New.
12864
24fad99e
AD
128652001-12-30 Akim Demaille <akim@epita.fr>
12866
12867 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12868 replace `gb' with BLANKS.
12869 * src/scan-skel.l: Adjust.
12870
a4b36db4
AD
128712001-12-30 Akim Demaille <akim@epita.fr>
12872
12873 * src/system.h: We don't need nor want bcopy.
12874 Throw away MS-DOS crap: we don't need getpid.
12875 * configure.in: We don't need strndup. It was even causing
12876 problems: because Flex includes the headers *before* us,
12877 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12878 not visible.
12879 * lib/xstrndup.c: New.
12880 * src/scan-skel.l: Use it.
12881 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12882 * src/parse-skel.y: Use %directives instead of #defines.
12883
1239777d
AD
128842001-12-30 Akim Demaille <akim@epita.fr>
12885
12886 * src/skeleton.h: New.
12887 * src/output.c (output_parser, output_master_parser): Remove, dead
12888 code.
12889 * src/output.h (get_lines_number, actions_output, guards_output)
12890 (token_definitions_output): Prototype them.
12891 * src/parse-skel.y: Add the license notice.
12892 Include output.h and skeleton.h.
12893 (process_skeleton): Returns void, and takes a single parameter.
12894 * src/scan-skel.l: Add the license notice.
12895 Include skeleton.h.
12896 Don't use %option yylineno: it seems that then Flex imagines
12897 REJECT has been used, and therefore it won't reallocate its
12898 buffers (which makes no other sense to me than a bug). It results
12899 in warnings for `unused: yy_flex_realloc'.
12900
9b3add5b
RA
129012001-12-30 Robert Anisko <robert.anisko@epita.fr>
12902
12903 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12904 (MUSCLE_INSERT_PREFIX): ...to there.
12905 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12906 (MUSCLE_INSERT_PREFIX): Move from here...
12907
12908 * src/bison.hairy: Add a section directive. Put braces around muscle
12909 names. This parser skeleton is still broken, but Bison should not
12910 choke on a bad muscle 'syntax'.
12911 * src/bison.simple: Add a section directive. Put braces around muscle
12912 names.
12913
12914 * src/files.h (strsuffix, stringappend): Add declarations.
12915 (tab_extension): Add declaration.
12916 (short_base_name): Add declaration.
12917
12918 * src/files.c (strsuffix, stringappend): No longer static. These
12919 functions are used in the skeleton parser.
12920 (tab_extension): New.
12921 (compute_base_names): Use the computations done in this function
fab5b110 12922 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
12923 names.
12924 (short_base_name): No longer static.
12925
12926 * src/output.c (output_skeleton): New.
12927 (output): Disable call to output_master_parser, and give a try to
12928 a new skeleton handling system.
12929 (guards_output, actions_output): No longer static.
12930 (token_definitions_output, get_lines_number): No longer static.
12931
12932 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12933
fab5b110 12934 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
12935 parse-skel.y.
12936
12937 * src/parse-skel.y: New file.
12938 * src/scan-skel.l: New file.
12939
b5b61c61
AD
129402001-12-29 Akim Demaille <akim@epita.fr>
12941
12942 %name-prefix is broken.
12943
12944 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12945 Adjust all dependencies.
12946 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12947 %name-prefix.
12948
12949 Renaming yylval but not yylloc is not consistent. Now we do.
12950
12951 * src/bison.simple: Prefix yylloc if used.
12952 * doc/bison.texinfo (Decl Summary): Document that.
12953
8c9a50be
AD
129542001-12-29 Akim Demaille <akim@epita.fr>
12955
12956 * doc/bison.texinfo: Promote `%long-directive' over
12957 `%long_directive'.
12958 Remove all references to fixed-output-files, yacc is enough.
12959
d99361e6
AD
129602001-12-29 Akim Demaille <akim@epita.fr>
12961
12962 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12963 user prologue. These are defaults.
12964 * tests/actions.at (Mid-rule actions): Make sure the user can
12965 define YYDEBUG and YYERROR_VERBOSE.
12966
b9cecb91
AD
129672001-12-29 Akim Demaille <akim@epita.fr>
12968
12969 * src/output.c (header_output): Don't forget to export YYLTYPE and
12970 yylloc.
12971 * tests/headers.at (export YYLTYPE): New, make sure it does.
12972 * tests/regression.at (%union and --defines, Invalid CPP headers):
12973 Move to...
12974 * tests/headers.at: here.
12975
aea13e97
AD
129762001-12-29 Akim Demaille <akim@epita.fr>
12977
12978 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12979
931394cb
AD
129802001-12-29 Akim Demaille <akim@epita.fr>
12981
12982 * tests/actions.at (Mid-rule actions): Output on a single line
12983 instead of several.
12984
704a47c4
AD
129852001-12-29 Akim Demaille <akim@epita.fr>
12986
12987 * doc/bison.texinfo: Formatting changes.
12988
091e20bb
AD
129892001-12-29 Akim Demaille <akim@epita.fr>
12990
12991 Don't store the token defs in a muscle, just be ready to output it
12992 on command. Now possible via `symbols'. Fixes a memory leak.
12993
12994 * src/output.c (token_definitions_output): New.
12995 (output_parser, header_output): Use it.
12996 * src/reader.c (symbols_save): Remove.
12997
cce71710
AD
129982001-12-29 Akim Demaille <akim@epita.fr>
12999
13000 * src/bison.simple: Do not provide a default for YYSTYPE and
13001 YYLTYPE before the user's prologue. Otherwise it's hardly... a
13002 default.
13003
82c035a8
AD
130042001-12-29 Akim Demaille <akim@epita.fr>
13005
13006 Mid-rule actions are simply... ignored!
13007
13008 * src/reader.c (readgram): Be sure to attach mid-rule actions to
13009 the empty-rule associated to the dummy symbol, not to the host
13010 rule.
13011 * tests/actions.at (Mid-rule actions): New.
13012
8419d367
AD
130132001-12-29 Akim Demaille <akim@epita.fr>
13014
13015 Memory leak.
13016
13017 * src/reader.c (reader): Free grammar.
13018
375d5806
AD
130192001-12-29 Akim Demaille <akim@epita.fr>
13020
13021 Memory leak.
13022
13023 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
13024 since it allocates it for each state, although only one is needed.
13025 (allocate_storage): Do it here.
13026
f51cb8ff
AD
130272001-12-29 Akim Demaille <akim@epita.fr>
13028
13029 * src/options.h, src/options.c (create_long_option_table): Rename
13030 as...
13031 (long_option_table_new): this, with a clearer prototype.
13032 (percent_table): Remove, unused,
13033 * src/getargs.c (getargs): Adjust.
13034
29e88316
AD
130352001-12-29 Akim Demaille <akim@epita.fr>
13036
13037 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
13038 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
13039 as states.
13040
b9f71f19
AD
130412001-12-29 Akim Demaille <akim@epita.fr>
13042
13043 * src/lalr.c (build_relations): Rename `states' as `states1'.
13044 Sorry, I don't understand exactly what it is, no better name...
13045
1a2b5d37
AD
130462001-12-29 Akim Demaille <akim@epita.fr>
13047
13048 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
13049 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
13050 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
13051 as rules.
13052
1cca533e
AD
130532001-12-29 Akim Demaille <akim@epita.fr>
13054
13055 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
13056 ago.
13057
c03ae966
AD
130582001-12-29 Akim Demaille <akim@epita.fr>
13059
13060 * src/reader.c, src/reader.h (user_toknums): Remove.
13061 Adjust all users to use symbols[i]->user_token_number.
13062
5a670b1e
AD
130632001-12-29 Akim Demaille <akim@epita.fr>
13064
13065 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
13066 Adjust all users to use symbols[i]->prec or ->assoc.
13067
ad949da9
AD
130682001-12-29 Akim Demaille <akim@epita.fr>
13069
13070 * src/reader.c, src/reader.h (tags): Remove.
13071 Adjust all users to use symbols[i]->tag.
13072
0e78e603
AD
130732001-12-29 Akim Demaille <akim@epita.fr>
13074
13075 * src/gram.h, src/gram.c (symbols): New, similar to state_table
13076 and rule_table.
13077 * src/reader.c (packsymbols): Fill this table.
13078 Drop sprec.
13079 * src/conflicts.c (resolve_sr_conflict): Adjust.
13080 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
13081 single table.
13082 Use symbols[i]->tag instead of tags[i].
13083
213e640e
AD
130842001-12-29 Akim Demaille <akim@epita.fr>
13085
13086 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
13087 In addition, put a comment in there, to replace...
13088 * tests/regression.at (%union and C comments): Remove.
13089
e7b8bef1
AD
130902001-12-29 Akim Demaille <akim@epita.fr>
13091
13092 * tests/regression.at (Web2c Actions): Blindly move the actual
13093 output as expected output. The contents *seem* right to me, but I
13094 can't pretend reading perfectly parser tables... Nonetheless, all
13095 the other tests pass correctly, the table look OK, even though the
13096 presence of `$axiom' is to be noted: AFAICS it is useless (but
13097 harmless).
13098
b68e7744
AD
130992001-12-29 Akim Demaille <akim@epita.fr>
13100
13101 * src/reader.c (readgram): Don't add the rule 0 if there were no
13102 rules read. In other words, add it _after_ having performed
13103 grammar sanity checks.
13104 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
13105
78d5bae9
AD
131062001-12-29 Akim Demaille <akim@epita.fr>
13107
13108 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
13109 visible, and some states have now a different number.
13110
ff442794
AD
131112001-12-29 Akim Demaille <akim@epita.fr>
13112
13113 * src/reader.c (readgram): Bind the initial rule's lineno to that
13114 of the first rule.
13115 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
13116 (Solved SR Conflicts): Adjust rule 0's line number.
13117
610ab194
AD
131182001-12-29 Akim Demaille <akim@epita.fr>
13119
13120 Fix the `GAWK Grammar' failure.
13121
13122 * src/LR0.c (final_state): Initialize to -1 so that we do compute
13123 the reductions of the first state which was mistakenly confused
13124 with the final state because precisely final_state was initialized
13125 to 0.
13126 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13127 now noticed by Bison.
13128 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13129 have a reduction on $default.
13130
29d29c8f
AD
131312001-12-29 Akim Demaille <akim@epita.fr>
13132
13133 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13134 rule line numbers.
13135 * src/closure.c (print_closure): Likewise.
13136 * src/derives.c (print_derives): Likewise.
13137 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13138 now.
13139
7c6b64d0
AD
131402001-12-29 Akim Demaille <akim@epita.fr>
13141
13142 * src/lalr.c (lookaheads_print): New.
13143 (lalr): Call it when --trace-flag.
13144 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13145 are dumped.
13146
3d4daee3
AD
131472001-12-29 Akim Demaille <akim@epita.fr>
13148
13149 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13150 when walking through ritem, even via rule->rhs.
13151 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13152 (useful_production, useless_nonterminals): Likewise.
13153 (reduce_grammar_tables): Likewise, plus update nritems.
13154 * src/nullable.c (set_nullable): Likewise.
13155 * src/lalr.c (build_relations): Likewise.
13156 * tests/sets.at (Nullable): Adjust.
13157 Fortunately, now, the $axiom is no longer nullable.
13158
9e7f6bbd
AD
131592001-12-29 Akim Demaille <akim@epita.fr>
13160
13161 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13162 the 0-sentinel.
13163 * src/gram.c (ritem_longest_rhs): Likewise.
13164 * src/reduce.c (nonterminals_reduce): Likewise.
13165 * src/print_graph.c (print_graph): Likewise.
13166 * src/output.c (output_rule_data): Likewise.
13167 * src/nullable.c (set_nullable): Likewise.
13168
255ef638
AD
131692001-12-29 Akim Demaille <akim@epita.fr>
13170
13171 * src/output.c: Comment changes.
13172
0d8a7363
AD
131732001-12-27 Paul Eggert <eggert@twinsun.com>
13174
13175 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13176 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13177 Sparc, as they were causing more porting problems than the
13178 (minor) performance improvement was worth.
13179
13180 Also, catch up with 1.31's YYSTD.
13181
3db472b9
AD
131822001-12-27 Akim Demaille <akim@epita.fr>
13183
13184 * src/output.c (output_gram): Rely on nritems, not the
13185 0-sentinel. See below.
13186 Use -1 as separator, not 0.
13187 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13188 Rely on -1 as separator in yyrhs, instead of 0.
13189 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13190 twice `Now at end of input', therefore there are two lines less to
13191 expect.
13192
b365aa05
AD
131932001-12-27 Akim Demaille <akim@epita.fr>
13194
13195 * tests/regression.at (Unresolved SR Conflicts):
13196 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13197 below.
13198
30171f79
AD
131992001-12-27 Akim Demaille <akim@epita.fr>
13200
13201 * src/LR0.c (new_state): Recognize the final state by the fact it
13202 is reached by eoftoken.
13203 (insert_start_shifting_state, insert_eof_shifting_state)
13204 (insert_accepting_state, augment_automaton): Remove, since now
13205 these states are automatically computed from the initial state.
13206 (generate_states): Adjust.
13207 * src/print.c: When reporting a rule number to the user, substract
13208 1, so that the axiom rule is rule 0, and the first user rule is 1.
13209 * src/reduce.c: Likewise.
13210 * src/print_graph.c (print_core): For the time being, just as for
13211 the report, depend upon --trace-flags to dump the full set of
13212 items.
13213 * src/reader.c (readgram): Once the grammar read, insert the rule
13214 0: `$axiom: START-SYMBOL $'.
13215 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13216 number of the states has changed (the final state is no longer
13217 necessarily the last), catch up.
13218
75142d45
AD
132192001-12-27 Akim Demaille <akim@epita.fr>
13220
13221 Try to make the use of the eoftoken valid. Given that its value
13222 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13223 is used instead of > 0 where appropriate, (ii), depend upon nritems
13224 instead of the 0-sentinel.
13225
13226 * src/gram.h, src/gram.c (nritems): New.
13227 Expected to be duplication of nitems, but for the time being...
13228 * src/reader.c (packgram): Assert nritems and nitems are equal.
13229 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13230 * src/closure.c (print_closure, print_fderives): Likewise.
13231 * src/gram.c (ritem_print): Likewise.
13232 * src/print.c (print_core, print_grammar): Likewise.
13233 * src/print_graph.c: Likewise.
13234
b7c49edf
AD
132352001-12-27 Akim Demaille <akim@epita.fr>
13236
13237 * src/main.c (main): If there are complains after grammar
13238 reductions, then output the report anyway if requested, then die.
13239 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13240 * src/reader.c (eoftoken): New.
13241 (parse_token_decl): If the token being defined has value `0', it
13242 is the eoftoken.
13243 (packsymbols): No longer hack `tags' to insert `$' by hand.
13244 Be sure to preserve the value of the eoftoken.
13245 (reader): Make sure eoftoken is defined.
13246 Initialize nsyms to 0: now eoftoken is created just like the others.
13247 * src/print.c (print_grammar): Don't special case the eof token.
13248 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13249 lie anyway, albeit pleasant.
13250 * tests/calc.at: Exercise error messages with eoftoken.
13251 Change the grammar so that empty input is invalid.
13252 Adjust expectations.
13253 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13254
ec2da99f
AD
132552001-12-27 Akim Demaille <akim@epita.fr>
13256
13257 * configure.in: Check the protos of strchr ans strspn.
13258 Replace strchr if needed.
13259 * src/system.h: Provide the protos of strchr, strspn and memchr if
13260 missing.
13261 * lib/strchr.c: New.
13262 * src/reader.c (symbols_save): Use strchr.
13263
8adfa272
AD
132642001-12-27 Akim Demaille <akim@epita.fr>
13265
13266 * src/print.c, src/print_graph.c (escape): New.
13267 Use it to quote the TAGS outputs.
13268 * src/print_graph.c (print_state): Now errors are in red, and
13269 reductions in green.
13270 Prefer high to wide: output the state number on a line of its own.
13271
80dac38c
AD
132722001-12-27 Akim Demaille <akim@epita.fr>
13273
13274 * src/state.h, src/state.c (reductions_new): New.
13275 * src/LR0.c (set_state_table): Let all the states have a
13276 `reductions', even if reduced to 0.
13277 (save_reductions): Adjust.
13278 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13279 * src/print.c (print_reductions, print_actions): Adjust.
13280 * src/output.c (action_row): Adjust.
13281
2cec70b9
AD
132822001-12-27 Akim Demaille <akim@epita.fr>
13283
13284 * src/state.h, src/state.c (errs_new, errs_dup): New.
13285 * src/LR0.c (set_state_table): Let all the states have an errs,
13286 even if reduced to 0.
13287 * src/print.c (print_errs, print_reductions): Adjust.
13288 * src/output.c (output_actions, action_row): Adjust.
13289 * src/conflicts.c (resolve_sr_conflict): Adjust.
13290
13ca549a
AD
132912001-12-27 Akim Demaille <akim@epita.fr>
13292
13293 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13294
5092aba5
AD
132952001-12-27 Akim Demaille <akim@epita.fr>
13296
13297 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13298 * src/print.c: here.
13299 (lookaheadset, shiftset): New, used as additional storage by
13300 print_reductions.
13301 (print_results): Adjust.
13302 (print_shifts, print_gotos, print_errs): New, extracted from...
13303 (print_actions): here.
13304 * src/print_graph.c (print_actions): Remove dead code.
13305
11e2beca
AD
133062001-12-27 Akim Demaille <akim@epita.fr>
13307
13308 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13309 `$n' and `@n'.
13310
dac3c910
AD
133112001-12-27 Akim Demaille <akim@epita.fr>
13312
13313 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13314 (build_relations): Adjust.
13315
d0b0fefa
AD
133162001-12-27 Akim Demaille <akim@epita.fr>
13317
13318 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13319 duplication.
13320
adc8c848
AD
133212001-12-27 Akim Demaille <akim@epita.fr>
13322
13323 * src/reader.c (packgram): Catch nitems overflows.
13324
14d293ac
AD
133252001-12-27 Akim Demaille <akim@epita.fr>
13326
13327 * src/files.c, src/files.h (guard_obstack): Remove.
13328 * src/output.c (output): Adjust.
13329 * src/reader.c (parse_braces): New, factoring...
13330 (copy_action, copy_guard): these two which are renamed as...
13331 (parse_action, parse_guard): these.
13332 As a voluntary consequence, using braces around guards is now
13333 mandatory.
13334
f499b062
AD
133352001-12-27 Akim Demaille <akim@epita.fr>
13336
13337 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13338 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13339 members.
13340 (symbol_list_new): Adjust.
13341 (copy_action): action_line is the first line, not the last.
13342 (copy_guard): Just as for actions, store the `action' only, not
13343 the switch/case/break flesh.
13344 Don't parse the user action that might follow the guard, let...
13345 (readgram): do it, i.e., now, there can be an action after a
13346 guard.
13347 In other words the guard is just explicitly optional.
13348 (packgram): Adjust.
13349 * src/output.c (guards_output): New.
13350 (output_parser): Call it when needed.
13351 (output): Also free the guard and attrs obstacks.
13352 * src/files.c, src/files.h (obstack_save): Remove.
13353 (output_files): Remove.
13354 As a result, if one needs the former `.act' file, using an
13355 appropriate skeleton which requires actions and guards is now
13356 required.
13357 * src/main.c (main): Adjust.
13358 * tests/semantic.at: New.
13359 * tests/regression.at: Use `input.y' as input file name.
13360 Avoid 8+3 problems by requiring input.c when the test needs the
13361 parser.
13362
d945f5cd
AD
133632001-12-27 Akim Demaille <akim@epita.fr>
13364
13365 * src/reader.c (symbol_list_new): Be sure to initialize all the
13366 fields.
13367
d200e455
AD
133682001-12-27 Akim Demaille <akim@epita.fr>
13369
13370 All the hacks using a final pseudo state are now useless.
13371
13372 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13373 * src/lalr.c (nLA): New.
13374 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13375 instead of lookaheadsp from the pseudo state (nstate + 1).
13376
f9507c28
AD
133772001-12-27 Akim Demaille <akim@epita.fr>
13378
13379 * src/output.c (action_row, token_actions): Use a state_t instead
13380 of a integer, and nlookaheads instead of the following state's
13381 lookaheadsp.
13382
065fbd27
AD
133832001-12-27 Akim Demaille <akim@epita.fr>
13384
13385 * src/conflicts.c (log_resolution, flush_shift)
13386 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13387 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13388 (conflicts_print, print_reductions): Use a state_t instead of an
13389 integer when referring to a state.
13390 As much as possible, depend upon nlookaheads, instead of the
13391 `lookaheadsp' member of the following state (since lookaheads of
13392 successive states are successive, the difference between state n + 1
13393 and n served as the number of lookaheads for state n).
13394 * src/lalr.c (add_lookback_edge): Likewise.
13395 * src/print.c (print_core, print_actions, print_state)
13396 (print_results): Likewise.
13397 * src/print_graph.c (print_core, print_actions, print_state)
13398 (print_graph): Likewise.
13399 * src/conflicts.h: Adjust.
13400
1b177bd7
AD
134012001-12-27 Akim Demaille <akim@epita.fr>
13402
13403 * src/bison.hairy: Formatting/comment changes.
13404 ANSIfy.
13405 Remove `register' indications.
13406 Add plenty of `static'.
13407
7742ddeb
AD
134082001-12-27 Akim Demaille <akim@epita.fr>
13409
13410 * src/output.c (prepare): Drop the muscle `ntbase' which
13411 duplicates ntokens.
13412 * src/bison.simple: Formatting/comment changes.
13413 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13414 is an undocumented synonym.
13415
1fa14068
AD
134162001-12-22 Akim Demaille <akim@epita.fr>
13417
13418 * src/output.c (output_table_data): Change the prototype to use
13419 `int' for array ranges: some invocations do pass an int, not a
13420 short.
13421 Reported by Wayne Green.
13422
b9752825
AD
134232001-12-22 Akim Demaille <akim@epita.fr>
13424
13425 Some actions of web2c.y are improperly triggered.
13426 Reported by Mike Castle.
13427
13428 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13429 * tests/regression.at (Web2c): Rename as...
13430 (Web2c Report): this.
13431 (Web2c Actions): New.
13432
776209d6
AD
134332001-12-22 Akim Demaille <akim@epita.fr>
13434
13435 Reductions in web2c.y are improperly reported.
13436 Reported by Mike Castle.
13437
13438 * src/conflicts.c (print_reductions): Fix.
13439 * tests/regression.at (Web2c): New.
13440
275fc3ad
AD
134412001-12-18 Akim Demaille <akim@epita.fr>
13442
13443 Some host fail on `assert (!"foo")', which expands to
13444 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13445 Reported by Nelson Beebee.
13446
13447 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13448 `#define it_succeeded 0' and `assert (it_succeeded)'.
13449
897668ee
MA
134502001-12-17 Marc Autret <autret_m@epita.fr>
13451
13452 * src/bison.simple: Don't hard code the skeleton line and filename.
13453 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13454 New line counter 'skeleton_line' (skeleton-line muscle).
13455
ab3399e0
PE
134562001-12-17 Paul Eggert <eggert@twinsun.com>
13457
13458 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13459 YYDEBUG must be defined to a nonzero value.
13460
13461 * src/bison.simple (yytname): Do not assume that the user defines
13462 YYDEBUG to a properly parenthesized expression.
13463
3877f72b
AD
134642001-12-17 Akim Demaille <akim@epita.fr>
13465
13466 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13467 nlookaheads is a new member.
13468 Adjust all users.
13469 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13470 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13471 state.
776209d6 13472
331dbc1b
AD
134732001-12-17 Akim Demaille <akim@epita.fr>
13474
13475 * src/files.h, src/files.c (open_files, close_files): Remove.
13476 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13477 let...
13478 * src/reader.c (reader): Do it.
776209d6 13479
be750e4c
AD
134802001-12-17 Akim Demaille <akim@epita.fr>
13481
13482 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 13483
709ae8c6
AD
134842001-12-17 Akim Demaille <akim@epita.fr>
13485
13486 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13487 (flush_reduce): New.
13488 (resolve_sr_conflict): Adjust.
776209d6 13489
f87685c3
AD
134902001-12-17 Akim Demaille <akim@epita.fr>
13491
13492 * src/output.c (output_obstack): Be static and rename as...
13493 (format_obstack): this, to avoid any confusion with files.c's
13494 output_obstack.
13495 * src/reader.h (muscle_obstack): Move to...
13496 * src/output.h: here, since it's defined in output.c.
13497
837491d8
AD
134982001-12-17 Akim Demaille <akim@epita.fr>
13499
13500 * src/output.c (action_row, save_column, default_goto)
13501 (sort_actions, matching_state, pack_vector): Better variable
13502 locality.
13503
796d61fb
AD
135042001-12-17 Akim Demaille <akim@epita.fr>
13505
13506 * src/output.c: Various formatting changes.
776209d6 13507
64d15509
AD
135082001-12-17 Akim Demaille <akim@epita.fr>
13509
13510 * src/files.c (output_files): Free the output_obstack.
13511 * src/main.c (main): Call print and print_graph conditionally.
13512 * src/print.c (print): Work unconditionally.
13513 * src/print_graph.c (print_graph): Work unconditionally.
13514 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13515
fbc8ecb7
MA
135162001-12-16 Marc Autret <autret_m@epita.fr>
13517
13518 * src/output.c (actions_output): Fix. When we use %no-lines,
13519 there is one less line per action.
13520
f0440388
MA
135212001-12-16 Marc Autret <autret_m@epita.fr>
13522
13523 * src/bison.simple: Remove a useless #line directive.
13524 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13525 * src/output.c (get_lines_number): New.
776209d6 13526 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
13527 output muscles.
13528 Fix line numbering.
13529 (actions_output): Computes the number of lines taken by actions.
13530 (output_master_parser): Insert new skeleton which is the name of
13531 the output parser file name.
13532
a79986b8
MA
135332001-12-15 Marc Autret <autret_m@epita.fr>
13534
13535 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13536
4ec8e00f
MA
135372001-12-15 Marc Autret <autret_m@epita.fr>
13538
13539 * src/output.c (output_gram): Keep track of the hairy one.
13540
1a4648ff
AD
135412001-12-15 Akim Demaille <akim@epita.fr>
13542
13543 Make `make distcheck' work.
13544
13545 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13546 system.h which uses libgettext.h.
13547
9c2c67e6
AD
135482001-12-15 Akim Demaille <akim@epita.fr>
13549
13550 * src/nullable.c (set_nullable): Useless rules must be skipped,
13551 otherwise, since we range over their symbols, we might look at a
13552 nonterminal which no longer ``exists'', i.e., it is not counted in
13553 `nvars', hence we overflow our arrays.
13554
93ede233
AD
135552001-12-15 Akim Demaille <akim@epita.fr>
13556
13557 The header can also be produced directly, without any obstack!
13558 Yahoo!
13559
13560 * src/files.c, src/files.h (defines_obstack): Remove.
13561 (compute_header_macro): Global.
13562 (defines_obstack_save): Remove.
13563 * src/reader.c (parse_union_decl): No longer output to
13564 defines_obstack: its content can be found in the `stype' muscle
13565 anyway.
13566 (output_token_translations): Merge into...
13567 (symbols_output): this.
13568 Rename as...
13569 (symbols_save): this.
13570 (reader): Adjust.
13571 * src/output.c (header_output): New.
13572 (output): Call it.
13573
2666f928
AD
135742001-12-15 Akim Demaille <akim@epita.fr>
13575
13576 * src/reader.c (parse_union_decl): Instead of handling two obstack
13577 simultaneously, use one to define the `stype' muscle, and use the
13578 value of the latter to fill defines_obstack.
13579 (copy_comment): Remove.
13580 (copy_comment2): Work for a single obstack.
13581 Rename as...
13582 (copy_comment): this.
13583
428046f8
AD
135842001-12-15 Akim Demaille <akim@epita.fr>
13585
13586 * src/lex.c, src/lex.h (xgetc): No longer static.
13587 * src/reader.c (parse_union_decl): Revamp.
13588
ea52d706
AD
135892001-12-15 Akim Demaille <akim@epita.fr>
13590
13591 Still making progress in separating Bison into (i) input, (ii)
13592 process, (iii) output: now we can directly output the parser file
13593 without using table_obstack at all.
13594
13595 * src/files.c, src/files.h (table_obstack): Bye bye.
13596 (parser_file_name): New.
13597 * src/files.c (compute_output_file_names): Compute it.
13598 * src/output.c (actions_output, output_parser)
13599 (output_master_parser): To a file instead of an obstack.
13600
3f96f4dc
AD
136012001-12-15 Akim Demaille <akim@epita.fr>
13602
13603 Attach actions to rules, instead of pre-outputting them to
13604 actions_obstack.
13605
13606 * src/gram.h (rule_t): action and action_line are new members.
13607 * src/reader.c (symbol_list): Likewise.
13608 (copy_action): Save the actions within the rule.
13609 (packgram): Save them in rule_table.
13610 * src/output.c (actions_output): New.
13611 (output_parser): Use it on `%%actions'.
13612 (output_rule_data): Don't free rule_table.
13613 (output): Do it.
13614 (prepare): Don't save the `action' muscle.
13615 * src/bison.simple: s/%%action/%%actions/.
13616
51576fb3
AD
136172001-12-15 Akim Demaille <akim@epita.fr>
13618
13619 * src/reader.c (copy_action): When --yacc, don't append a `;'
13620 to the user action: let it fail if lacking.
dee049eb 13621 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 13622
2648a72d
AD
136232001-12-14 Akim Demaille <akim@epita.fr>
13624
13625 * src/lex.c (literalchar): Simply return the char you decoded, non
13626 longer mess around with obstacks and int pointers.
13627 Adjust all callers.
13628
92790e5b
AD
136292001-12-14 Akim Demaille <akim@epita.fr>
13630
13631 * src/lex.c (literalchar): Don't escape the special characters,
13632 just decode them, and keep them as char (before, eol was output as
13633 the 2 char string `\n' etc.).
13634 * src/output.c (output_rule_data): Use quotearg to output the
13635 token strings.
13636
927c1557
PE
136372001-12-13 Paul Eggert <eggert@twinsun.com>
13638
13639 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13640 Do not infringe on the global user namespace when using C++.
13641 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13642 All uses of `fprintf' and `stderr' changed.
13643
13644 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13645
ed8e1f68
AD
136462001-12-13 Akim Demaille <akim@epita.fr>
13647
13648 The computation of nullable is broken: it doesn't handle empty
13649 RHS's properly.
13650
13651 * tests/torture.at (GNU AWK Grammar): New.
13652 * tests/sets.at (Nullable): New.
13653 * src/nullable.c (set_nullable): Instead of blindly looping over
13654 `ritems', loop over the rules, and then over their rhs's.
13655
13656 Work around Autotest bugs.
13657
13658 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13659 frame, because Autotest understand lines starting with a `+' as
13660 traces from the shell. Then, they are not processed properly.
13661 Admittedly an Autotest bug, but we don't have time to wait for
13662 Autotest to catch up.
13663 * tests/regression.at (Broken Closure): Adjust to the new table
13664 frames.
13665 Move to...
13666 * tests/sets.at: here.
13667
cb581495
AD
136682001-12-13 Akim Demaille <akim@epita.fr>
13669
13670 * src/closure.c (closure): Use nrules instead of playing tricks
13671 with BITS_PER_WORD.
13672
2e729273
AD
136732001-12-13 Akim Demaille <akim@epita.fr>
13674
13675 * src/print.c (print_actions): Output the handling of `$' as the
13676 traces do: shifting the token EOF. Before EOF was treated as a
13677 nonterminal.
13678 * tests/regression.at: Adjust some tests.
13679 * src/print_graph.c (print_core): Complete the set of items via
13680 closure. The next-to-final and final states are still unsatisfying,
13681 but that's to be addressed elsewhere.
13682 No longer output the rule numbers, but do output the state number.
13683 A single loop for the shifts + gotos is enough, but picked a
13684 distinct color for each.
13685 (print_graph): Initialize and finalize closure.
13686
107f7dfb
AD
136872001-12-13 Akim Demaille <akim@epita.fr>
13688
13689 * src/reader.c (readgram): Remove dead code, an strip useless
13690 braces.
13691 (get_type): Remove, unused.
13692
9b53a24f
AD
136932001-12-12 Akim Demaille <akim@epita.fr>
13694
13695 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13696 on that of lib/error.c.
13697
dbfb6dcd
AD
136982001-12-12 Akim Demaille <akim@epita.fr>
13699
13700 Some hosts don't like `/' in includes.
13701
13702 * src/system.h: Include libgettext.h without qualifying the path.
13703 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13704 $(top_srcdir).
13705
c25fb648
MA
137062001-12-11 Marc Autret <autret_m@epita.fr>
13707
13708 * src/output.c (output_parser): Remove useless muscle.
13709
710ddc4f
MA
137102001-12-11 Marc Autret <autret_m@epita.fr>
13711
13712 * src/bison.simple: Remove #line just before %%epilogue. It
13713 is now handled in ...
13714 * src/reader.c (read_additionnal_code): Add the output of a
13715 #line for the epilogue.
13716
e83d80b8
MA
137172001-12-10 Marc Autret <autret_m@epita.fr>
13718
927c1557 13719 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
13720 replace precedent remove.
13721 * src/bison.simple: Remove #line before %%prologue because
13722 %%input-line is wrong at this time.
13723
971d5158
MA
137242001-12-10 Marc Autret <autret_m@epita.fr>
13725
13726 * src/reader.c (symbols_output): Clean up.
927c1557 13727 * src/output.c (output_gram, output): Clean up.
971d5158 13728
5edafffd
AD
137292001-12-10 Akim Demaille <akim@epita.fr>
13730
13731 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13732 * src/LR0.c (set_state_table): here.
13733 * src/lalr.c (lalr): Call it.
13734
0279f8e9
AD
137352001-12-10 Akim Demaille <akim@epita.fr>
13736
13737 * src/state.h (shifts): Remove the `number' member: shifts are
13738 attached to state, hence no longer need to be labelled with a
13739 state number.
13740
190c4f5f
AD
137412001-12-10 Akim Demaille <akim@epita.fr>
13742
13743 Now that states have a complete set of members, the linked list of
13744 shifts is useless: just fill directly the state's shifts member.
13745
13746 * src/state.h (shifts): Remove the `next' member.
13747 * src/LR0.c (first_state, last_state): Remove.
13748 Adjust the callers.
13749 (augment_automaton): Don't look for the shifts that must be added
13750 a shift on EOF: it is those of the state we looked for! But now,
13751 since shifts are attached, it is no longer needed to looking
13752 merely by its id: its number.
13753
2a73b93d
AD
137542001-12-10 Akim Demaille <akim@epita.fr>
13755
13756 * src/LR0.c (augment_automaton): Better variable locality.
13757 Remove an impossible branch: if there is a state corresponding to
13758 the start symbol being shifted, then there is shift for the start
13759 symbol from the initial state.
13760
74392f6a
AD
137612001-12-10 Akim Demaille <akim@epita.fr>
13762
13763 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13764 only when appropriate: when insert_start_shifting_state' is not
13765 invoked.
13766 * tests/regression.at (Rule Line Numbers): Adjust.
13767
37c82725
AD
137682001-12-10 Akim Demaille <akim@epita.fr>
13769
13770 * src/LR0.c (augment_automaton): Now that all states have shifts,
13771 merge the two cases addition shifts to the initial state.
13772
6a164e0c
AD
137732001-12-10 Akim Demaille <akim@epita.fr>
13774
13775 * src/lalr.c (set_state_table): Move to...
13776 * src/LR0.c: here.
13777 * src/lalr.c (lalr): Don't call it...
13778 * src/LR0.c (generate_states): do it.
13779 * src/LR0.h (first_state): Remove, only the table is used.
13780
7215de24
AD
137812001-12-10 Akim Demaille <akim@epita.fr>
13782
13783 * src/LR0.h (first_shift, first_reduction): Remove.
13784 * src/lalr.c: Don't use first_shift: find shifts through the
13785 states.
13786
80e25d4d
AD
137872001-12-10 Akim Demaille <akim@epita.fr>
13788
13789 * src/LR0.c: Attach shifts to states as soon as they are
13790 computed.
13791 * src/lalr.c (set_state_table): Instead of assigning shifts to
13792 state, just assert that the mapping was properly done.
13793
0ab3728b
AD
137942001-12-10 Akim Demaille <akim@epita.fr>
13795
13796 * src/LR0.c (insert_start_shift): Rename as...
13797 (insert_start_shifting_state): this.
13798 (insert_eof_shifting_state, insert_accepting_state): New.
13799 (augment_automaton): Adjust.
13800 Better locality of the variables.
13801 When looking if the start_symbol is shifted from the initial
13802 state, using `while (... symbol != start_symbol ...)' sounds
13803 better than `while (... symbol < start_symbol ...)': If fail
13804 to see how the order between symbols could be relevant!
13805
78af9bbc
AD
138062001-12-10 Akim Demaille <akim@epita.fr>
13807
13808 * src/getargs.h: Don't declare `spec_name_prefix' and
13809 `spec_file_prefix', declared by src/files.h.
13810 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
13811 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
13812 * src/output.c (prepare): Adjust.
13813 * src/reader.c (symbols_output): Likewise.
13814 * src/vmsgetargs.c: Vaguely adjust, but who cares?
13815
bdef2a41
AD
138162001-12-10 Akim Demaille <akim@epita.fr>
13817
13818 * src/muscle_tab.c (muscle_init): NULL is a better default than
13819 `"0"'.
13820
3735969c
AD
138212001-12-10 Akim Demaille <akim@epita.fr>
13822
13823 * src/reader.c (reader): Calling symbols_output once is enough.
13824
49701457
AD
138252001-12-10 Akim Demaille <akim@epita.fr>
13826
13827 Now that states have a complete set of members, the linked list of
13828 reductions is useless: just fill directly the state's reductions
13829 member.
13830
13831 * src/state.h (struct reductions): Remove member `number' and
13832 `next'.
13833 * src/LR0.c (first_reduction, last_reduction): Remove.
13834 (save_reductions): Don't link the new reductions, store them in
13835 this_state.
13836 * src/lalr.c (set_state_table): No need to attach reductions to
13837 states, it's already done.
13838 * src/output.c (output_actions): No longer free the shifts, then
13839 the reductions, then the states: free all the states and their
13840 members.
13841
0edad749
AD
138422001-12-10 Akim Demaille <akim@epita.fr>
13843
13844 * src/options.c (OPTN, DRTV, BOTH): New.
13845 (option_table): Use them.
13846
0edad749
AD
13847 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13848 the job of system.h.
13849 * src/options.c: Don't include stdio.h and xalloc.h for the same
13850 reasons.
13851
5449dd0f
AD
138522001-12-10 Akim Demaille <akim@epita.fr>
13853
13854 * src/output.c (output, prepare): Make sure the values of the
13855 muscles `action' and `prologue' are 0-terminated.
13856
a870c567
AD
138572001-12-10 Akim Demaille <akim@epita.fr>
13858
13859 Clean up GCC warnings.
13860
13861 * src/reader.c (copy_action): `buf' is not used.
13862 (parse_skel_decl): Be static.
13863 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13864 * src/options.h (create_long_option_table): Have a real prototype.
13865 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13866 (hash_delete_at): Return const void *.
13867 Adjust casts to preserve the const.
13868
80df8768
AD
138692001-12-10 Akim Demaille <akim@epita.fr>
13870
13871 * configure.in: Require 2.52g.
13872 M4 is not needed, but AUTOM4TE is.
13873 * m4/m4.m4: Remove.
13874 * tests/Makefile.am: Adjust.
13875
f693ad14
AD
138762001-12-10 Akim Demaille <akim@epita.fr>
13877
13878 One structure for states is enough, even though theoretically
13879 there are LR(0) states and LALR(1) states.
13880
13881 * src/lalr.h (state_t): Remove.
13882 (state_table): Be state_t **, not state_t *.
13883 * src/state.h (core, CORE_ALLOC): Rename as...
13884 (state_t, STATE_ALLOC): this.
13885 Add the LALR(1) members: shifts, reductions, errs.
13886 * src/LR0.c (state_table): Rename as...
13887 (state_hash): this, to avoid name clashes with the global
13888 `state_table'.
13889 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13890 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13891
74ffbcb6
AD
138922001-12-10 Akim Demaille <akim@epita.fr>
13893
13894 Bison dumps core on bash.y.
13895 Reported by Pascal Bart.
13896
13897 * src/warshall.c (bitmatrix_print): New.
13898 (TC): Use it.
ba0fe3c7 13899 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
13900 j must be the outer loop.
13901 * tests/regression.at (Broken Closure): New.
13902
07708e19
AD
139032001-12-05 Akim Demaille <akim@epita.fr>
13904
13905 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13906 its argument.
ba1ecc07 13907 Reported by Peter Hamorsky.
07708e19 13908
92b16366
AD
139092001-12-05 Akim Demaille <akim@epita.fr>
13910
13911 * src/conflicts.c (err_table): Remove.
13912 (resolve_sr_conflict): Adjust.
13913 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13914 Rename as...
13915 (state_t.reductions, state_t.shifts): this.
13916
076ab033
AD
139172001-12-05 Akim Demaille <akim@epita.fr>
13918
13919 * src/reduce.c (reduce_grammar_tables): No longer disable the
13920 removal of useless rules via CPP but via `if (0)', so that the
13921 compiler still check the code is valid.
13922 For instance, it should have noticed `rline' no longer exists: use
13923 the `line' member of rule_t.
13924 * src/gram.c (dummy, rline): Remove, unused.
13925
3843c413
AD
139262001-12-05 Akim Demaille <akim@epita.fr>
13927
13928 * src/output.c (pack_vector): Use assert, not berror.
13929 * src/main.c (berror): Remove, unused.
13930
43168960
AD
139312001-12-05 Akim Demaille <akim@epita.fr>
13932
13933 New experimental feature: if --verbose --trace output all the
13934 items of a state, not only its kernel.
13935
13936 * src/print.c (print_core): If `trace_flag', then invoke closure
13937 before outputting the items of the state (print_core is no longer
13938 a correct name them).
13939 (print_results): Invoke new_closure/free_closure if needed.
13940
b2872512
AD
139412001-12-05 Akim Demaille <akim@epita.fr>
13942
13943 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13944 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13945 (nitemset): for consistency with the rest of the project.
13946
23cbcc6c
AD
139472001-12-05 Akim Demaille <akim@epita.fr>
13948
13949 * src/closure.c (print_closure): Improve.
13950 (closure): Use it for printing input and output.
13951
03ec521c
AD
139522001-12-05 Akim Demaille <akim@epita.fr>
13953
13954 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13955 indexed by nonterminals.
13956
3a7456dd
AD
139572001-12-05 Akim Demaille <akim@epita.fr>
13958
13959 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13960 what it was!).
13961 * src/warshall.h: Remove accidental duplication of the content.
13962
1cbcf2e7
AD
139632001-12-05 Akim Demaille <akim@epita.fr>
13964
13965 * src/closure.c (set_fderives): De-obfuscate.
13966
84182270
AD
139672001-12-05 Akim Demaille <akim@epita.fr>
13968
13969 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13970
3f6f053c
AD
139712001-12-05 Akim Demaille <akim@epita.fr>
13972
13973 * src/closure.c (set_firsts): De-obfuscate.
13974
7a5350ba
AD
139752001-12-05 Akim Demaille <akim@epita.fr>
13976
13977 * src/output.c (action_row): De-obfuscate
13978 using the good o' techniques: arrays not pointers, variable
13979 locality, BITISSET, RESETBIT etc.
13980
d954473d
AD
139812001-12-05 Akim Demaille <akim@epita.fr>
13982
13983 Pessimize the code to simplify it: from now on, all the states
13984 have a valid SHIFTS, which NSHIFTS is possibly 0.
13985
13986 * src/LR0.c (shifts_new): Be global and move to..
13987 * src/state.c, src/state.h: here.
13988 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13989 * src/print_graph: Adjust.
13990
9839bbe5
AD
139912001-12-05 Akim Demaille <akim@epita.fr>
13992
13993 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13994 * src/conflicts.c: Use it.
13995 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13996 incorrectly ``simplified''.
13997
9f136c07
AD
139982001-12-05 Akim Demaille <akim@epita.fr>
13999
14000 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
14001 using the good o' techniques: arrays not pointers, variable
14002 locality, BITISSET, RESETBIT etc.
14003
b608206e
AD
140042001-12-05 Akim Demaille <akim@epita.fr>
14005
14006 * src/state.h (SHIFT_SYMBOL): New.
14007 * src/conflicts.c: Use it to deobfuscate.
14008
52afa962
AD
140092001-12-05 Akim Demaille <akim@epita.fr>
14010
14011 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
14012 (print_reductions): De-obfuscate using the good o' techniques:
14013 arrays not pointers, variable locality, BITISSET.
14014
e74dc321
AD
140152001-12-05 Akim Demaille <akim@epita.fr>
14016
14017 * src/conflicts.c (print_reductions): Arrays, not pointers.
14018 Use BITISSET.
14019
768fca83
AD
140202001-12-05 Akim Demaille <akim@epita.fr>
14021
14022 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14023
a17e599f
AD
140242001-12-05 Akim Demaille <akim@epita.fr>
14025
14026 * src/conflicts.c (print_reductions): Improve variable locality.
14027
a04bc341
AD
140282001-12-05 Akim Demaille <akim@epita.fr>
14029
14030 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14031
c8ea038e
AD
140322001-12-05 Akim Demaille <akim@epita.fr>
14033
14034 * src/conflicts.c (print_reductions): Improve variable locality.
14035
aa2aab3c
AD
140362001-12-05 Akim Demaille <akim@epita.fr>
14037
14038 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
14039 * src/lalr.c: Use them.
14040
b178c8cc
AD
140412001-12-05 Akim Demaille <akim@epita.fr>
14042
14043 * src/LR0.c (augment_automaton): Formatting changes.
14044 Better variable locality.
14045
f67d13aa
AD
140462001-12-05 Akim Demaille <akim@epita.fr>
14047
14048 * src/lalr.c (matrix_print): New.
14049 (transpose): Use it.
14050 Use arrays instead of pointers.
14051
c2713865
AD
140522001-12-05 Akim Demaille <akim@epita.fr>
14053
14054 * src/lalr.c (maxrhs): Move to...
14055 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
14056 * src/lalr.c (build_relations): Adjust.
14057
9887c18a
AD
140582001-12-05 Akim Demaille <akim@epita.fr>
14059
14060 * src/lalr.c (transpose): Free the memory allocated to the
14061 argument, as it is replaced by the results by the unique caller.
14062 (build_relations): Merely invoke transpose: it handles the memory
14063 deallocation.
14064 Improve variable locality.
14065 Avoid variables used as mere abbreviations.
14066 (compute_lookaheads): Use arrays instead of pointers.
14067
4d4f699c
AD
140682001-12-05 Akim Demaille <akim@epita.fr>
14069
14070 * src/lalr.c (initialize_F): Improve variable locality.
14071 Avoid variables used as mere abbreviations.
14072
80a69750
AD
140732001-12-05 Akim Demaille <akim@epita.fr>
14074
14075 * src/derives.c (print_derives): Display the ruleno.
14076 * src/lalr.c (initialize_F, transpose): Better variable locality
14077 to improve readability.
14078 Avoid variables used as mere abbreviations.
14079
fe961097
AD
140802001-12-05 Akim Demaille <akim@epita.fr>
14081
14082 * src/lalr.c (traverse): Use arrays instead of pointers.
14083
e3e4e814
AD
140842001-12-05 Akim Demaille <akim@epita.fr>
14085
14086 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
14087 the handling of squeue.
14088 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14089
630e182b
AD
140902001-12-05 Akim Demaille <akim@epita.fr>
14091
14092 Because useless nonterminals are now kept alive (instead of being
14093 `destroyed'), we now sometimes examine them, and store information
14094 related to them. Hence we need to know their number, and adjust
14095 memory allocations.
14096
14097 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
14098 static.
14099 * src/LR0.c (allocate_itemsets): The memory allocated to
14100 `symbol_count' was used for two different purpose: once to count
14101 the number of occurrences of each symbol, and later reassigned to
14102 `shift_symbol', containing the symbol that can be shifted from a
14103 given state.
14104 Deobfuscate, i.e., allocate, use and free `symbol_count' here
14105 only, and...
14106 (new_itemsets): Allocate `shift_symbol' here.
14107 (allocate_itemsets): symbol_count includes useless nonterminals.
14108 Make room for them.
14109 (free_storage): Use `free', not `XFREE', for pointers that cannot
14110 be null.
14111
81b51460
AD
141122001-12-05 Akim Demaille <akim@epita.fr>
14113
14114 * src/nullable.c (set_nullable): Deobfuscate the handling of
14115 ritem.
14116 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14117
3067fbef
AD
141182001-12-05 Akim Demaille <akim@epita.fr>
14119
14120 * src/gram.c, src/gram.h (ritem_print): New.
14121 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
14122 (This useless function was defined only to work around VMS linkers
14123 that can't handle compilation units with variables only).
14124 * src/reduce.c (dump_grammar): Use it to trace the construction of
14125 ritem.
14126
c2bea5f9
PE
141272001-12-04 Paul Eggert <eggert@twinsun.com>
14128
7d27c823
PE
14129 * src/bison.simple (union yyalloc): Change member names
14130 to be the same as the stack names.
14131 (yyparse): yyptr is now union yyalloc *, not char *.
14132 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14133 and may generate better code on some machines.
c2bea5f9
PE
14134 (yystpcpy): Use prototype if __STDC__ is defined, not just
14135 if __cplusplus is defined.
35687a9d 14136
2c8a9dfa
AD
141372001-11-30 Akim Demaille <akim@epita.fr>
14138
14139 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14140 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14141 Gettext doesn't compile cleanly, and dies with -Werror.
14142 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14143 Include WARNING_CFLAGS here.
14144 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14145 before being defined.
14146
f4e421e6
AD
141472001-11-27 Paul Eggert <eggert@twinsun.com>
14148
14149 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14150 First arg is int, not unsigned.
14151 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14152 (SIZE_MAX, UINT_MAX): New macros.
14153 (quotearg_n_options): Abort if N is negative.
14154 Avoid overflow check on hosts where size_t is 64 bits and int
14155 is 32 bits, as overflow is impossible there.
14156 Fix off-by-one typo that caused unnecessary reallocation.
14157
7093d0f5
AD
141582001-11-29 Paul Eggert <eggert@twinsun.com>
14159
14160 Name space cleanup in generated parser.
14161
14162 * doc/bison.texinfo (Bison Parser): Discuss system headers
14163 and their effect on the user name space.
14164
14165 * src/bison.simple:
14166 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14167 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14168 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14169
14170 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14171 on user names when possible.
14172
14173 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14174 Simplify test for whather <alloca.h> exists.
14175
14176 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14177
14178 (<stdio.h>): Include if YYDEBUG.
14179
14180 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14181 ! defined (yyoverflow) && ! defined (yymemcpy).
14182
14183 (yymemcpy, yyparse): Rename local variables as needed so that
14184 they all begin with 'yy'.
14185
14186 (yystrlen, yystpcpy): New functions.
14187
14188 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14189 All uses changed.
14190
14191 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14192 instead of relying on string.h functions. Use YYSTACK_ALLOC
14193 and YYSTACK_FREE instead of malloc and free.
14194
fd51e5ff
AD
141952001-11-30 Akim Demaille <akim@epita.fr>
14196
14197 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14198 before their first uses.
14199 (YYBISON, YYPURE): Move to the top of the output.
14200
7d13ff5f
AD
142012001-11-30 Akim Demaille <akim@epita.fr>
14202
14203 * tests/reduce.at (Useless Nonterminals): Fix.
14204
892a3995
AD
142052001-11-30 Akim Demaille <akim@epita.fr>
14206
14207 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14208 if body instead of `;' to pacify GCC's warnings.
14209
68f1e3ed
AD
142102001-11-30 Akim Demaille <akim@epita.fr>
14211
14212 Instead of mapping the LHS of unused rules to -1, keep the LHS
14213 valid, but flag the rules as invalid.
14214
14215 * src/gram.h (rule_t): `useful' is a new member.
14216 * src/print.c (print_grammar): Adjust.
14217 * src/derives.c (set_derives): Likewise.
14218 * src/reader.c (packgram, reduce_output): Likewise.
14219 * src/reduce.c (reduce_grammar_tables): Likewise.
14220 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14221
d2d1b42b
AD
142222001-11-30 Akim Demaille <akim@epita.fr>
14223
14224 * src/reduce.c (reduce_output): Formatting changes.
14225 * src/print.c (print_results, print_grammar): Likewise.
14226 * tests/regression.at (Rule Line Numbers)
14227 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14228
760b53a8
AD
142292001-11-30 Akim Demaille <akim@epita.fr>
14230
14231 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14232 useless nonterminals, move them at the end of the symbol arrays.
14233 (reduce_output): Adjust.
14234 * tests/reduce.at (Useless Nonterminals): Adjust.
14235
00238958
AD
142362001-11-30 Akim Demaille <akim@epita.fr>
14237
14238 * src/reduce.c: Various comment/formatting changes.
14239 (nonterminals_reduce): New, extracted from...
14240 (reduce_grammar_tables): here.
14241 (reduce_grammar): Call nonterminals_reduce.
14242
396452de
PE
142432001-11-29 Paul Eggert <eggert@twinsun.com>
14244
14245 * src/bison.simple (YYSTACK_REALLOC): Remove.
14246 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14247 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14248 New macros.
14249 (union yyalloc): New type.
14250 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14251 an arbitrary restriction on hosts where size_t is wider than int.
14252
14253 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14254 a parser stack overflow. Allocate just one block of memory for all
14255 three stacks, instead of allocating three blocks; this typically is
14256 faster and reduces fragmentation.
14257
14258 Do not limit the number of items in the stack to a value that fits
14259 in 'int', as this is an arbitrary limit on hosts with 64-bit
14260 size_t and 32-bit int.
14261
147e184c
MA
142622001-11-29 Marc Autret <autret_m@epita.fr>
14263
14264 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14265 of defining YYERROR_VERBOSE.
14266 [AT_DATA]: $4 is now out of C declarations in the prologue.
14267
426cf563
MA
142682001-11-28 Marc Autret <autret_m@epita.fr>
14269
14270 * src/reader.c (parse_dquoted_param): New.
14271 (parse_skel_decl): Use it.
14272 * src/lex.h: Add its prototype.
14273 * src/lex.c (literalchar): Become not static.
14274
c7925b99
MA
142752001-11-28 Marc Autret <autret_m@epita.fr>
14276
14277 * src/output.h: And put its extern declaration here.
14278 * src/output.c (error_verbose): Define here.
14279 (prepare): Echo name modification.
14280 * src/getargs.h: Clean its extern declaration.
14281 * src/getargs.c (error_verbose_flag): Remove.
14282 (getargs): Remove case 'e'.
14283 * src/options.c (option_table): 'error-verbose' is now seen as simple
14284 percent option.
14285 Include output.h.
14286
14287 * src/reader.c (read_declarations): Remove case tok_include.
14288 (parse_include_decl): Remove.
14289 * src/lex.h (token_t): Remove tok_include.
14290 * src/options.c (option_table): 'include' is now a simple command line
14291 option.
14292
5b5d1929
MA
142932001-11-28 Marc Autret <autret_m@epita.fr>
14294
14295 * src/bison.simple: Adjust muscle names.
14296 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14297 * src/output.c (prepare): s/_/-/ for the muscles names.
14298 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14299
8850be4b
MA
143002001-11-28 Marc Autret <autret_m@epita.fr>
14301
14302 * src/bison.simple: Fix debug.
14303 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14304
4a38e613
AD
143052001-11-28 Akim Demaille <akim@epita.fr>
14306
14307 * src/LR0.c (shifts_new): New.
14308 (save_shifts, insert_start_shift, augment_automaton): Use it.
14309
4b35e1c1
AD
143102001-11-28 Akim Demaille <akim@epita.fr>
14311
14312 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14313 keep ruleno only.
14314
d2b04478
AD
143152001-11-28 Akim Demaille <akim@epita.fr>
14316
14317 * src/closure.c (closure): Instead of looping over word in array
14318 then bits in words, loop over bits in array.
14319
2c4c30aa
AD
143202001-11-28 Akim Demaille <akim@epita.fr>
14321
14322 * src/closure.c (closure): No longer optimize the special case
14323 where all the bits of `ruleset[r]' are set to 0, to make the code
14324 clearer.
14325
576890b7
AD
143262001-11-28 Akim Demaille <akim@epita.fr>
14327
14328 * src/closure.c (closure): `r' and `c' are new variables, used to
14329 de-obfuscate accesses to RULESET and CORE.
14330
cb487d7d
AD
143312001-11-28 Akim Demaille <akim@epita.fr>
14332
14333 * src/reduce.c (reduce_print): Use ngettext.
14334 (dump_grammar): Improve the trace accuracy.
14335
6013d43f
AD
143362001-11-28 Akim Demaille <akim@epita.fr>
14337
14338 * src/reduce.c (dump_grammar): Don't translate trace messages.
14339
cb4956ee
AD
143402001-11-28 Akim Demaille <akim@epita.fr>
14341
14342 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14343 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14344 as all tags are free'ed afterwards.
14345 From Enrico Scholz.
14346
648185ab
PE
143472001-11-27 Paul Eggert <eggert@twinsun.com>
14348
14349 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14350 use alloca when we didn't want to, and vice versa.
14351
68254a03
MA
143522001-11-27 Marc Autret <autret_m@epita.fr>
14353
9113b58f
AD
14354 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14355 initialization.
68254a03
MA
14356 * src/output.c (prepare): Remove its update.
14357
04d843a2
MA
143582001-11-27 Marc Autret <autret_m@epita.fr>
14359
14360 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14361 Use %error-verbose.
14362
d2079671 143632001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
14364
14365 * src/bison.simple: Remove YYERROR_VERBOSE using.
14366 Use %%error_verbose.
14367 (yyparse): Likewise.
14368 * src/output.c (prepare): Give its final value.
14369 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14370 * src/getargs.h: Add its extern declaration.
14371 * src/getargs.c (error_verbose_flag): New int.
14372 (getargs): Update to catch new case.
14373 * src/options.c (option_table): 'error-verbose' is a new option.
14374 (shortopts): Update.
14375
e0327bc8
AD
143762001-11-27 Akim Demaille <akim@epita.fr>
14377
14378 * src/system.h: Use intl/libgettext.h.
14379 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14380
000f1a3c
AD
143812001-11-27 Akim Demaille <akim@epita.fr>
14382
14383 * tests/torture.at (Exploding the Stack Size with Malloc):
14384 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14385
26cfe0be
AD
143862001-11-27 Akim Demaille <akim@epita.fr>
14387
14388 * src/files.c: Include error.h.
14389 Reported by Hans Aberg.
14390
f6bd5427
MA
143912001-11-26 Marc Autret <autret_m@epita.fr>
14392
d2079671 14393 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
14394 (read_declarations): Add case tok_include.
14395 * src/getargs.h (include): Add its extern definition.
14396 * src/getargs.c (include): New const char *.
14397 (getargs): Add case '-I'.
14398 * src/options.c (option_table): Add include as command line and
14399 percent option.
14400 * src/lex.h (token_t): Add tok_include.
14401
2ca209c1
AD
144022001-11-26 Akim Demaille <akim@epita.fr>
14403
14404 * src/reader.c (readgram): Make sure rules for mid-rule actions
14405 have a lineno equal to that of their host rule.
14406 Reported by Hans Aberg.
14407 * tests/regression.at (Rule Line Numbers): New.
14408
0e41b407
AD
144092001-11-26 Akim Demaille <akim@epita.fr>
14410
14411 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14412 size_ts.
14413
144142001-11-26 Akim Demaille <akim@epita.fr>
14415
14416 * src/complain.c, src/complain.h (error): Remove, provided by
14417 lib/error.[ch].
14418
e0c40012
AD
144192001-11-26 Akim Demaille <akim@epita.fr>
14420
14421 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14422 issue an error message.
14423 * tests/regression.at (Invalid %directive): New.
14424 Reported by Hans Aberg.
14425
5e147124
AD
144262001-11-26 Akim Demaille <akim@epita.fr>
14427
14428 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14429 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14430
a034c8b8
AD
144312001-11-26 Akim Demaille <akim@epita.fr>
14432
14433 * src/conflicts.c (conflicts_print): Don't complain at all when
14434 there are no reduce/reduce conflicts, and as many shift/reduce
14435 conflicts as expected.
14436 * tests/regression.at (%expect right): Adjust.
14437
c64a20f3
AD
144382001-11-23 Akim Demaille <akim@epita.fr>
14439
14440 * lib/alloca.c: Update, from fileutils.
14441
5b0d29bb
AD
144422001-11-23 Akim Demaille <akim@epita.fr>
14443
14444 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14445
722c4bfe
AD
144462001-11-23 Akim Demaille <akim@epita.fr>
14447
14448 * src/system.h: Include alloca.h.
14449 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14450
6255b435
AD
144512001-11-23 Akim Demaille <akim@epita.fr>
14452
14453 * src/print_graph.c (print_actions): Remove `rule', unused.
14454 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14455 pacify GCC's signed < unsigned warnings.
14456 * src/closure.c (itemsetsize): Likewise.
14457 * src/reader.c (symbol_list_new): Static.
14458
b29b2ed5
AD
144592001-11-23 Akim Demaille <akim@epita.fr>
14460
14461 Attaching lineno to buckets is stupid, since only one copy of each
14462 symbol is kept, only the line of the first occurrence is kept too.
14463
14464 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14465 * src/reader.c (rline_allocated): Remove, unused.
14466 (symbol_list): Have a `line' member.
14467 (symbol_list_new): New.
14468 (readgram): Use it.
14469 * src/print.c (print_grammar): Output the rule line numbers.
14470 * tests/regression.at (Solved SR Conflicts)
14471 (Unresolved SR Conflicts): Adjust.
14472 Reported by Hans Aberg.
14473
a81b1d4a
MA
144742001-11-22 Marc Autret <autret_m@epita.fr>
14475
14476 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14477
c1ecb3c1
MA
144782001-11-22 Marc Autret <autret_m@epita.fr>
14479
14480 * src/muscle_tab.c (muscle_init): Remove initialization of
14481 skeleton muscle.
14482 * src/output.c (output_master_parser): Do it here.
14483
fbe01355
AD
144842001-11-20 Akim Demaille <akim@epita.fr>
14485
14486 * po/sv.po: New.
14487 * configure.in (ALL_LINGUAS): Adjust.
14488 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14489 longer contains strings to translate.
14490
81e895c0
AD
144912001-11-19 Akim Demaille <akim@epita.fr>
14492
14493 * src/conflicts.c (conflicts_print): Add a missing \n.
14494
6bb1878b
AD
144952001-11-19 Akim Demaille <akim@epita.fr>
14496
14497 * src/nullable.c (nullable_print): New.
14498 (set_nullable): Call it when tracing.
14499 Better locality of variables.
14500
d9ec2d07
AD
145012001-11-19 Akim Demaille <akim@epita.fr>
14502
14503 * src/print.c (print_actions): Better locality of variables.
14504
720e5c1b
AD
145052001-11-19 Akim Demaille <akim@epita.fr>
14506
14507 * src/derives.c (print_derives): Fix and enrich.
14508 * src/closure.c (print_fderives): Likewise.
14509
fb908786
AD
145102001-11-19 Akim Demaille <akim@epita.fr>
14511
14512 * src/closure.c (itemsetend): Remove, replaced with...
14513 (itemsetsize): new.
14514
125ecb56
AD
145152001-11-19 Akim Demaille <akim@epita.fr>
14516
14517 * src/LR0.c (kernel_end): Remove, replaced with...
14518 (kernel_size): new.
14519
d8cf039f
AD
145202001-11-19 Akim Demaille <akim@epita.fr>
14521
14522 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14523 to clarify.
14524
7bec0760
AD
145252001-11-19 Akim Demaille <akim@epita.fr>
14526
14527 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14528
c87d4863
AD
145292001-11-19 Akim Demaille <akim@epita.fr>
14530
14531 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14532 trace messages.
14533 * src/LR0.c: Likewise.
14534 (allocate_itemsets): Use arrays instead of pointers to clarify.
14535
9bfe901c
AD
145362001-11-19 Akim Demaille <akim@epita.fr>
14537
14538 * src/getargs.c (statistics_flag): Replace with...
14539 (trace_flag): New.
14540 (longopts): Accept --trace instead of --statistics.
14541 * src/getargs.h, src/options.c: Adjust.
14542 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14543 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14544
97db7bd4
AD
145452001-11-19 Akim Demaille <akim@epita.fr>
14546
cc72668c 14547 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
14548 pointers to clarify the code.
14549 (save_reductions, save_shifts): Factor common parts of alternatives.
14550
2c5f66ed
AD
145512001-11-19 Akim Demaille <akim@epita.fr>
14552
14553 * src/LR0.c (new_state, get_state): Complete TRACE code.
14554 * src/closure.c: Include `reader.h' to get `tags', needed by the
14555 trace code.
14556 Rename the conditional DEBUG as TRACE.
14557 Output consistently TRACEs to stderr, not stdout.
14558 * src/derives.c: Likewise.
14559 * src/reduce.c: (inaccessable_symbols): Using if is better style
14560 than goto.
14561 Use `#if TRACE' instead of `#if 0' for tracing code.
14562
300f275f
AD
145632001-11-19 Akim Demaille <akim@epita.fr>
14564
14565 * src/system.h (LIST_FREE, shortcpy): New.
14566 * src/LR0.c: Use them.
14567 * src/output.c (free_itemsets, free_reductions, free_shifts):
14568 Remove, replaced by LIST_FREE.
14569
f59c437a
AD
145702001-11-19 Akim Demaille <akim@epita.fr>
14571
14572 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14573 (REDUCTIONS_ALLOC): New.
14574 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14575 allocation.
14576
6986fd9e
AD
145772001-11-19 Akim Demaille <akim@epita.fr>
14578
14579 * src/LR0.c (new_state): Complete trace code.
14580 * src/nullable.c (set_nullable): Don't translate traces.
14581
4bc30f78
AD
145822001-11-19 Akim Demaille <akim@epita.fr>
14583
14584 * src/print_graph.c (print_core): Better locality of variables.
14585 * src/print.c (print_core): Likewise.
14586
08a946e0
AD
145872001-11-19 Akim Demaille <akim@epita.fr>
14588
14589 * src/vcg.c: You do the output, so you are responsible of the
14590 handling of VCG syntax, in particular: use quotearg.
14591 * src/print_graph.c: Don't.
14592 (print_actions): Don't output the actions as part of the nodes,
14593 since that's the job of the edges.
14594 (print_state): Don't output by hand: fill the node description,
9bfe901c 14595 and ask for its output.
08a946e0 14596
f0473484
AD
145972001-11-19 Akim Demaille <akim@epita.fr>
14598
cc72668c
AD
14599 * src/bison.simple (yyparse): When verbosely reporting an error,
14600 no longer put additional quotes around token names.
f0473484
AD
14601 * tests/calc.at: Adjust.
14602
e41dc700
AD
146032001-11-19 Akim Demaille <akim@epita.fr>
14604
14605 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14606 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14607 * src/output.c: Adjust.
14608
652a871c
AD
146092001-11-19 Akim Demaille <akim@epita.fr>
14610
14611 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14612 (rule_t): this.
14613 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14614
b2ed6e58
AD
146152001-11-19 Akim Demaille <akim@epita.fr>
14616
14617 * src/gram.h (rule_t): New.
14618 (rule_table): New.
14619 (rrhs, rlhs): Remove, part of state_t.
14620 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14621 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14622 * src/reader.c, src/reduce.c: Adjust.
14623
edad7067
AD
146242001-11-19 Akim Demaille <akim@epita.fr>
14625
14626 * src/reader.c (symbols_output): New, extracted from...
14627 (packsymbols): Here.
14628 (reader): Call it.
14629
3feec034
AD
146302001-11-19 Akim Demaille <akim@epita.fr>
14631
14632 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14633 (maxrhs): this new function.
14634
ddcd5fdf
AD
146352001-11-19 Akim Demaille <akim@epita.fr>
14636
cc72668c 14637 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
14638 Adjust.
14639
bb527fc2
AD
146402001-11-19 Akim Demaille <akim@epita.fr>
14641
cc72668c 14642 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
14643 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14644 * src/lalr.c: Adjust.
14645
a845a697
AD
146462001-11-19 Akim Demaille <akim@epita.fr>
14647
14648 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14649 (set_state_table): handle the `lookaheads' members.
14650
f004bf6a
AD
146512001-11-19 Akim Demaille <akim@epita.fr>
14652
cc72668c
AD
14653 * src/lalr.h (lookaheads): Removed array, whose contents is now
14654 a member of...
f004bf6a
AD
14655 (state_t): this structure.
14656 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14657 Adjust.
14658
de326cc0
AD
146592001-11-19 Akim Demaille <akim@epita.fr>
14660
cc72668c
AD
14661 * src/lalr.h (consistent): Removed array, whose contents is now
14662 a member of...
de326cc0
AD
14663 (state_t): this structure.
14664 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14665 Adjust.
14666
90b4416b
AD
146672001-11-19 Akim Demaille <akim@epita.fr>
14668
cc72668c
AD
14669 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14670 contents are now members of...
90b4416b
AD
14671 (state_t): this structure.
14672 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14673 Adjust.
14674
9703cc49
AD
146752001-11-19 Akim Demaille <akim@epita.fr>
14676
14677 * src/lalr.h (state_t): New.
14678 (state_table): Be a state_t * instead of a core **.
14679 (accessing_symbol): Remove, part of state_t.
14680 * src/lalr.c: Adjust.
14681 (set_accessing_symbol): Merge into...
14682 (set_state_table): this.
14683 * src/print_graph.c, src/conflicts.c: Adjust.
14684
d803322e
AD
146852001-11-14 Akim Demaille <akim@epita.fr>
14686
14687 * tests/calc.at, tests/output.at, tests/regression.at,
14688 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14689 now the tests are run in private dirs, therefore AC_CLEANUP and
14690 family can be simplified to 0-ary.
14691 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14692 use abs. path to find config.h.
14693 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14694 stderr, there can be way too much random noise.
14695 Instead pass -Werror to GCC and rely on the exit status.
14696 Reported by Wolfram Wagner.
14697
3d76b07d
AD
146982001-11-14 Akim Demaille <akim@epita.fr>
14699
14700 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14701 defined only if yyoverflow is defined, to avoid `warning: unused
14702 variable `yyvs1''.
14703 Reported by The Test Suite.
14704
09b503c8
AD
147052001-11-14 Akim Demaille <akim@epita.fr>
14706
14707 * src/print.c: Include reduce.h.
14708 Reported by Hans Aberg.
14709
147102001-11-14 Akim Demaille <akim@epita.fr>
14711
14712 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
14713 Revert a previous patch: these are really const.
14714 * src/conflicts.c (conflict_report): Additional useless pair of
14715 braces to pacify GCC's warnings for `if () if () {} else {}'.
14716 * src/lex.c (parse_percent_token): Replace equal_offset with
14717 arg_offset.
14718 arg is const.
14719 Be sure to strdup `arg' when used, since there is no reason for
14720 token_buffer not to change.
14721
0f37a994
AD
147222001-11-14 Akim Demaille <akim@epita.fr>
14723
14724 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14725 definition.
14726 * src/main.c (main): Use them.
14727 Suggested by Hans Aberg.
14728
d39d93b8
AD
147292001-11-12 Akim Demaille <akim@epita.fr>
14730
14731 * src/system.h (ngettext): Now that we use ngettext, be sure to
14732 provide a default definition when NLS are not used.
14733
9edcd895
AD
147342001-11-12 Akim Demaille <akim@epita.fr>
14735
14736 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
14737 Use @kbd to denote user input.
14738 (Language and Grammar): ANSIfy the example.
14739 Adjust its layout for info/notinfo.
14740 (Location Tracking Calc): Output error messages to stderr.
14741 Output locations in a more GNUtically correct way.
14742 Fix a couple of Englishos.
14743 Adjust @group/@end group pairs.
14744
7da99ede
AD
147452001-11-12 Akim Demaille <akim@epita.fr>
14746
e3aa65c5 14747 %expect was not functioning at all.
7da99ede
AD
14748
14749 * src/conflicts.c (expected_conflicts): Set to -1.
14750 (conflict_report): Use ngettext.
14751 (conflicts_print): Check %expect and make its violation an error.
14752 * doc/bison.texinfo (Expect Decl): Adjust.
14753 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
14754 * tests/regression.at (%expect not enough, %expect right)
14755 (%expect too much): New.
14756
ba9dda1a
AD
147572001-11-12 Akim Demaille <akim@epita.fr>
14758
14759 * tests/regression.at (Conflicts): Rename as...
14760 (Unresolved SR Conflicts): this.
14761 (Solved SR Conflicts): New.
14762
337c5bd1
AD
147632001-11-12 Akim Demaille <akim@epita.fr>
14764
14765 * src/reduce.c (print_results): Rename as...
14766 (reduce_output): This.
14767 Output to OUT, passed as argument, instead of output_obstack.
14768 (dump_grammar): Likewise.
14769 (reduce_free): New.
14770 Also free V1.
14771 (reduce_grammar): No longer call reduce_output, since...
14772 * src/print.c (print_results): do it.
14773 * src/main.c (main): Call reduce_free;
14774
c73a41af
AD
147752001-11-12 Akim Demaille <akim@epita.fr>
14776
14777 * src/conflicts.c (print_reductions): Accept OUT as argument.
14778 Output to it, not to output_obstack.
14779 * src/print.c (print_actions): Adjust.
14780
0df87bb6
AD
147812001-11-12 Akim Demaille <akim@epita.fr>
14782
14783 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
14784 the result instead of using...
14785 (src_total, rrc_total, src_count, rrc_count): Remove.
14786 (any_conflicts): Remove.
14787 (print_conflicts): Split into...
14788 (conflicts_print, conflicts_output): New.
14789 * src/conflicts.h: Adjust.
14790 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 14791 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
14792 * tests/regression.at (Conflicts): New.
14793 Reported by Tom Lane.
14794
e4d3d4de
AD
147952001-11-12 Akim Demaille <akim@epita.fr>
14796
14797 * tests/regression.at (Invalid input): Remove, duplicate with
14798 ``Invalid input: 1''.
14799
6d7d248e
AD
148002001-11-12 Akim Demaille <akim@epita.fr>
14801
14802 * tests/torture.at (AT_DATA_STACK_TORTURE)
14803 (Exploding the Stack Size with Alloca)
14804 (Exploding the Stack Size with Malloc): New.
14805
e9e4c321
AD
148062001-11-12 Akim Demaille <akim@epita.fr>
14807
14808 * src/bison.simple (YYSTACK_REALLOC): New.
14809 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 14810 Reported by Per Allansson.
e9e4c321 14811
5f7e0832
AD
148122001-11-12 Pascal Bart <pascal.bart@epita.fr>
14813
14814 * src/bison.simple: Define type yystype instead of YYSTYPE, and
14815 define CPP macro, which substitute YYSTYPE by yystype.
14816 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
14817 with yyltype/YYLTYPE. This allows inclusion of the generated
14818 header within the parser if the compiler, such as GGC, accepts
14819 multiple equivalent #defines.
14820 From Akim.
14821
e3f1699f
AD
148222001-11-05 Akim Demaille <akim@epita.fr>
14823
14824 * src/reader.c (symbols_output): New, extracted from...
14825 (packsymbols): here.
14826 (reader): Adjust.
14827
65be0866
AD
148282001-11-05 Akim Demaille <akim@epita.fr>
14829
14830 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14831
e4d910bf
AD
148322001-11-05 Akim Demaille <akim@epita.fr>
14833
14834 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14835 pattern.
14836
951366c1
AD
148372001-11-05 Akim Demaille <akim@epita.fr>
14838
14839 * src/options.h (struct option_table_struct): set_flags is void*.
14840 * src/options.c (longopts): Support `--output' and `%output'.
14841 (usage): Adjust.
14842 * src/lex.h (tok_setopt): Remove, replaced with...
14843 (tok_intopt, tok_stropt): these new guys.
14844 * src/lex.c (getopt.h): Not needed.
14845 (token_buffer, unlexed_token_buffer): Not const.
14846 (percent_table): Promote `-' over `_' in directive names.
14847 Active `%name-prefix', `file-prefix', and `output'.
14848 (parse_percent_token): Accept possible arguments to directives.
14849 Promote `-' over `_' in directive names.
14850
d8988b2f
AD
148512001-11-04 Akim Demaille <akim@epita.fr>
14852
14853 * doc/bison.texinfo (Decl Summary): Split the list into
14854 `directives for grammars' and `directives for bison'.
14855 Sort'em.
14856 Add description of `%name-prefix', `file-prefix', and `output'.
14857 Promote `-' over `_' in directive names.
14858 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14859 Simplify the description of `--name-prefix'.
14860 Promote `-' over `_' in directive names.
14861 Promote `--output' over `--output-file'.
14862 Fix the description of `--defines'.
14863 * tests/output.at: Exercise %file-prefix and %output.
14864
6468d18e
AD
148652001-11-02 Akim Demaille <akim@epita.fr>
14866
14867 * doc/refcard.tex: Update.
14868
6b7e85b9
AD
148692001-11-02 Akim Demaille <akim@epita.fr>
14870
14871 * src/symtab.h (SUNDEF): New.
14872 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14873 stand for `uninitialized', instead of 0.
14874 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14875 * src/lex.c (lex): Adjust.
14876
14877 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14878 Number it 0.
14879 Let yylex return it instead of a plain 0.
14880 Reported by Dick Streefland.
14881
cd5aafcf
AD
148822001-11-02 Akim Demaille <akim@epita.fr>
14883
14884 * tests/regression.at (Mixing %token styles): New test.
14885
037ca2f1
AD
148862001-11-02 Akim Demaille <akim@epita.fr>
14887
14888 * src/reader.c (parse_thong_decl): Formatting changes.
14889 (token_translations_init): New, extracted from...
14890 (packsymbols): Here.
14891 Adjust.
14892
270a173c
AD
148932001-11-01 Akim Demaille <akim@epita.fr>
14894
14895 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14896 Check that `9foo.y' produces correct cpp guards.
14897 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14898 guards.
14899 Reported by Wwp.
14900
561f9a30
AD
149012001-11-01 Akim Demaille <akim@epita.fr>
14902
14903 * tests/regression.at (Invalid input: 2): New.
14904 * src/lex.c (unlexed_token_buffer): New.
14905 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14906 too.
14907 Reported by Wwp.
14908
f987e9d2
AD
149092001-11-01 Akim Demaille <akim@epita.fr>
14910
14911 * tests/calc.at: Catch up with 1.30.
14912 * configure.in: Bump to 1.49a.
14913 Adjust to newer Autotest.
14914
0846f581
PB
149152001-10-19 Pascal Bart <pascal.bart@epita.fr>
14916
14917 * src/conflicts.c: Move global variables rrc_total and src_total ...
14918 (print_conflicts): here.
14919 * src/output.c (output): Free global variable user_toknums.
14920 * src/lex.c (token_obstack): Become static.
14921
3c1a79b3
AD
149222001-10-18 Akim Demaille <akim@epita.fr>
14923
14924 * tests/atlocal.in (GCC): Add.
14925 * tests/calc.at: s/m4_match/m4_bmatch/.
14926 s/m4_patsubst/m4_bpatsubst/.
14927 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14928 * configure.in: AC_SUBST(GCC).
14929
5d52e7d0
MA
149302001-10-14 Marc Autret <autret_m@epita.fr>
14931
14932 * src/options.c (create_long_option_table): Fix.
14933
631aa1d3
AD
149342001-10-10 Akim Demaille <akim@epita.fr>
14935
14936 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14937
f6ec6d13
AD
149382001-10-04 Akim Demaille <akim@epita.fr>
14939
14940 * src/reader.c (parse_union_decl): Push the caracters in
14941 union_obstack, not attrs_obstack.
14942
342b8b6e
AD
149432001-10-04 Akim Demaille <akim@epita.fr>
14944
14945 Merge in the branch 1.29.
14946
14947 * src/reader.c (packsymbols): Use a temporary obstack for
14948 `%%tokendef', since output_stack is already used elsewhere.
14949
14950 2001-10-02 Akim Demaille <akim@epita.fr>
14951
14952 Bump 1.29d.
14953
14954 2001-10-02 Akim Demaille <akim@epita.fr>
14955
14956 Version 1.29c.
14957
14958 2001-10-02 Akim Demaille <akim@epita.fr>
14959
14960 * tests/regression.at (Invalid CPP headers): New.
14961 From Alexander Belopolsky.
14962 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14963
14964 2001-10-02 Akim Demaille <akim@epita.fr>
14965
14966 * tests/regression.at (Invalid input): New.
14967 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14968 Reported by Shura.
14969
14970 2001-10-02 Akim Demaille <akim@epita.fr>
14971
14972 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14973
14974 2001-10-02 Akim Demaille <akim@epita.fr>
14975
14976 * src/output.c (output_parser): Assert `skeleton'.
14977 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14978 systems.
14979 From Shura.
14980
14981 2001-10-01 Marc Autret <autret_m@epita.fr>
14982
14983 * src/lex.h: Echo modifications.
14984 * src/lex.c (unlex): Parameter is now token_t.
14985 From Hans Aberg.
14986
14987 2001-10-01 Marc Autret <autret_m@epita.fr>
14988
14989 * src/main.c: Include lex.h.
14990 From Hans Aberg.
14991
14992 2001-09-29 Akim Demaille <akim@epita.fr>
14993
14994 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14995
14996 2001-09-28 Akim Demaille <akim@epita.fr>
14997
14998 * tests/testsuite.at: Update to newer Autotest.
14999 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
15000
15001 2001-09-27 Akim Demaille <akim@epita.fr>
15002
15003 Position independent wrapper.
15004
15005 * tests/bison: Remove.
15006 * tests/bison.in: New.
15007 * configure.in: Adjust.
15008
15009 2001-09-27 Paul Eggert <eggert@twinsun.com>
15010
15011 Port quotearg fixes from tar 1.13.24.
15012
15013 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
15014 tm to be declared.
15015 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
15016 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
15017
15018 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
15019 * m4/mbrtowc.m4: New file.
15020 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
15021 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
15022
15023 2001-09-27 Akim Demaille <akim@epita.fr>
15024
15025 Bump to 1.29c.
15026
15027 2001-09-27 Akim Demaille <akim@epita.fr>
15028
15029 Version 1.29b.
15030
15031 2001-09-25 Akim Demaille <akim@epita.fr>
15032
15033 * src/system.h: Include `xalloc.h'.
15034 Remove it from the C files.
15035 * src/files.c (output_files): Free the obstacks.
15036 * src/lex.c (init_lex): Rename as...
15037 (lex_init): this.
15038 (lex_free): New.
15039 * src/main.c (main): Use it.
15040
15041 2001-09-24 Marc Autret <autret_m@epita.fr>
15042
15043 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
15044 to output informations in fout (FILE*).
15045 (open_graph, close_graph): Likewise.
15046 (output_graph, output_edge, output_node): Likewise.
15047 * src/vcg.h: Update function prototypes.
15048 * src/print_graph.c (print_graph): Open output graph file.
15049 (print_actions): Adjust.
15050 * src/files.h: Remove extern declaration.
15051 * src/files.c: Remove graph_obstack declaration.
15052 (open_files): Remove graph_obstack initialization.
15053 (output_files): Remove graph_obstack saving.
15054
15055 2001-09-24 Marc Autret <autret_m@epita.fr>
15056
15057 * src/files.c (compute_output_file_names): Fix.
15058
15059 2001-09-24 Marc Autret <autret_m@epita.fr>,
15060 Akim Demaille <akim@epita.fr>
15061
15062 * src/reader.c (reader): Remove call to free_symtab ().
15063 * src/main.c (main): Call it here.
15064 Include symtab.h.
15065 * src/conflicts.c (initialize_conflicts): Rename as...
15066 (solve_conflicts): this.
15067 * src/print.c (print_core, print_actions, print_state)
15068 (print_grammar): Dump to a file instead a `output_obstack'.
15069 (print_results): Dump `output_obstack', and then proceed with the
15070 FILE *.
15071 * src/files.c (compute_output_file_names, close_files): New.
15072 (output_files): Adjust.
15073 * src/main.c (main): Adjust.
15074
15075 2001-09-23 Marc Autret <autret_m@epita.fr>
15076
15077 * src/files.c (compute_header_macro): Computes header macro name
15078 from spec_defines_file when given.
15079
15080 2001-09-23 Marc Autret <autret_m@epita.fr>
15081
15082 * src/files.c (output_files): Add default extensions.
15083
15084 2001-09-22 Akim Demaille <akim@epita.fr>
15085
15086 * src/conflicts.c (finalize_conflicts): Rename as...
15087 (free_conflicts): this.
15088
15089 2001-09-22 Akim Demaille <akim@epita.fr>
15090
15091 * src/gram.c (gram_free): Rename back as...
15092 (dummy): this.
15093 (output_token_translations): Free `token_translations'.
15094 * src/symtab.c (free_symtab): Free the tag field.
15095
15096 2001-09-22 Akim Demaille <akim@epita.fr>
15097
15098 Remove `translations' as it is always set to true.
15099
15100 * src/gram.h: Adjust.
15101 * src/reader.c (packsymbols, parse_token_decl): Adjust
15102 * src/print.c (print_grammar): Adjust.
15103 * src/output.c (output_token_translations): Adjust.
15104 * src/lex.c (lex): Adjust.
15105 * src/gram.c: Be sure the set pointers to NULL.
15106 (dummy): Rename as...
15107 (gram_free): this.
15108
15109 2001-09-22 Akim Demaille <akim@epita.fr>
15110
15111 * configure.in: Invoke AM_LIB_DMALLOC.
15112 * src/system.h: Use dmalloc.
15113 * src/LR0.c: Be sure to have pointers initialized to NULL.
15114 (allocate_itemsets): Allocate kernel_items only if needed.
15115
15116 2001-09-22 Akim Demaille <akim@epita.fr>
15117
15118 * configure.in: Bump to 1.29b.
15119 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
15120 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
15121 need xmalloc.c in calc.y.
15122 From Pascal Bart.
15123
15124 2001-09-21 Akim Demaille <akim@epita.fr>
15125
15126 Version 1.29a.
15127 * Makefile.maint, config/config.guess, config/config.sub,
15128 * config/missing: Update from masters.
15129 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15130 upon package.m4.
15131 * configure.in (ALL_LINGUAS): Add `tr'.
15132
15133 2001-09-21 Akim Demaille <akim@epita.fr>
15134
15135 * tests/Makefile.am (package.m4): Move to...
15136 ($(srcdir)/$(TESTSUITE)): here.
15137
15138 2001-09-20 Akim Demaille <akim@epita.fr>
15139
15140 * src/complain.c: No longer try to be standalone: use system.h.
15141 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15142 * src/complain.h: Likewise.
15143 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15144 Remove the unused variable `n'.
15145 From Albert Chin-A-Young.
15146
15147 2001-09-18 Marc Autret <autret_m@epita.fr>
15148
15149 * doc/bison.1: Update.
15150 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15151 descriptions.
15152 (Option Cross Key): Update.
15153 Add --graph.
15154
15155 2001-09-18 Marc Autret <autret_m@epita.fr>
15156
15157 * tests/regression.at: New test (comment in %union).
15158
15159 2001-09-18 Marc Autret <autret_m@epita.fr>
15160
15161 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15162 do that.
15163 Reported by Keith Browne.
15164
15165 2001-09-18 Marc Autret <autret_m@epita.fr>
15166
15167 * tests/output.at: Add tests for --defines and --graph.
15168
15169 2001-09-18 Marc Autret <autret_m@epita.fr>
15170
15171 * tests/output.at: Removes tests of %{header,src}_extension features.
15172
15173 2001-09-18 Akim Demaille <akim@epita.fr>
15174
15175 * tests/Makefile.am (package.m4): New.
15176 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15177 (_AT_CHECK_CALC_ERROR): Likewise.
15178 Factor the `, ' part of verbose error messages.
15179
15180 2001-09-18 Marc Autret <autret_m@epita.fr>
15181
15182 * src/getargs.c (longopts): Declare --defines and --graph as options
15183 with optional arguments.
15184 * src/files.h: Add extern declarations.
15185 * src/files.c (spec_graph_file, spec_defines_file): New.
15186 (output_files): Update.
15187 Remove CPP-outed code.
15188
15189 2001-09-18 Marc Autret <autret_m@epita.fr>
15190
15191 Turn off %{source,header}_extension feature.
15192
15193 * src/files.c (compute_exts_from_gf): Update.
15194 (compute_exts_from_src): Update.
15195 (output_files): CPP-out useless code.
15196 * src/files.h: Remove {header,source}_extension extern declarations.
15197 * src/reader.c (parse_dquoted_param): CPP-out.
15198 (parse_header_extension_decl): Remove.
15199 (parse_source_extension_decl): Remove.
15200 (read_declarations): Remove cases tok_{hdrext,srcext}.
15201 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15202 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15203
15204 2001-09-10 Akim Demaille <akim@epita.fr>
15205
15206 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15207 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15208 (AT_CHECK_OUTPUT): this.
15209 Merely check ls' exit status, its output is useless.
15210
15211 2001-09-10 Akim Demaille <akim@epita.fr>
15212
15213 * tests/calc.at: Use m4_match.
15214 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15215
15216 2001-09-10 Marc Autret <autret_m@epita.fr>,
15217 Akim Demaille <akim@epita.fr>
15218
15219 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15220 enum color_e.
15221 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15222 to `normal'.
15223 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15224 * src/lex.h: Adjust prototype.
15225 (token_t): Add `tok_undef'.
15226 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15227 (parse_percent_token): Now returns token_t.
15228 Add default statement in switch.
15229 (lex): Separate `c' as an input variable, from the token_t result
15230 part.
15231 (unlexed): Is a token_t.
15232
15233 2001-09-10 Akim Demaille <akim@epita.fr>
15234
15235 * configure.in: Bump to 1.29a.
15236
15237 2001-09-07 Akim Demaille <akim@epita.fr>
15238
15239 Version 1.29.
15240
15241 2001-08-30 Akim Demaille <akim@epita.fr>
15242
15243 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15244 * m4/atconfig.m4: Remove.
15245 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15246 * tests/bison: New.
15247 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15248 m4_if, m4_patsubst, and m4_regexp.
15249 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15250 `input' file instead of echo.
15251
15252 2001-08-29 Akim Demaille <akim@epita.fr>
15253
15254 Bump to 1.28e.
15255
15256 2001-08-29 Akim Demaille <akim@epita.fr>
15257
15258 Version 1.28d.
15259
15260 2001-08-29 Paul Eggert <eggert@twinsun.com>
15261
15262 * src/bison.simple (yyparse): Don't take the address of an
15263 item before the start of an array, as that doesn't conform to
15264 the C Standard.
15265
15266 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15267
15268 * doc/bison.texinfo (Location Tracking Calc): New node.
15269
15270 2001-08-29 Paul Eggert <eggert@twinsun.com>
15271
15272 * src/output.c (output): Do not define const, as this now
15273 causes more problems than it cures.
15274
15275 2001-08-29 Akim Demaille <akim@epita.fr>
15276
15277 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15278 the nodes.
15279 Be sure to tag the `detailmenu'.
15280
15281 2001-08-29 Akim Demaille <akim@epita.fr>
15282
15283 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15284 download in a tmp dir.
15285
15286 2001-08-28 Marc Autret <autret_m@epita.fr>
15287
15288 * config/depcomp: New file.
15289
15290 2001-08-28 Marc Autret <autret_m@epita.fr>
15291
15292 * doc/bison.1 (mandoc): Adjust.
15293 From Juan Manuel Guerrero.
15294
15295 2001-08-28 Marc Autret <autret_m@epita.fr>
15296
15297 * src/print_graph.c (print_state): Fix.
15298
15299 2001-08-27 Marc Autret <autret_m@epita.fr>
15300
15301 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15302 char * members.
15303 Echo modifications to the functions prototypes.
15304 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15305
15306 2001-08-27 Marc Autret <autret_m@epita.fr>
15307
15308 * src/vcg.c: Include `xalloc.h'.
15309 (add_colorentry): New.
15310 (add_classname): New.
15311 (add_infoname): New.
15312 * src/vcg.h: Add new prototypes.
15313
15314 2001-08-27 Akim Demaille <akim@epita.fr>
15315
15316 * Makefile.maint: Sync. again with CVS Autoconf.
15317
15318 2001-08-27 Akim Demaille <akim@epita.fr>
15319
15320 * Makefile.maint: Formatting changes.
15321 (po-update, cvs-update, update): New targets.
15322 (AMTAR): Remove.
15323
15324 2001-08-27 Akim Demaille <akim@epita.fr>
15325
15326 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15327 * Makefile.maint: Sync. with CVS Autoconf.
15328
15329 2001-08-27 Marc Autret <autret_m@epita.fr>
15330
15331 * src/vcg.h (struct infoname_s): New.
15332 (struct colorentry_s): New.
15333 (graph_s): New fields {vertical,horizontal}_order in structure.
15334 Add `infoname' field.
15335 Add `colorentry' field;
15336 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15337 (G_HORIZONTAL_ORDER): New.
15338 (G_INFONAME): New.
15339 (G_COLORENTRY): New.
15340 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15341 Add output of `infoname'.
15342 Add output of `colorentry'.
15343
15344 2001-08-27 Marc Autret <autret_m@epita.fr>
15345
15346 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15347 This one shadowed a global parameter.
15348
15349 2001-08-24 Marc Autret <autret_m@epita.fr>
15350
15351 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15352 instead of `unsigned'.
15353 (print_state): Do not call obstack_object_size () in obstack_grow ()
15354 to avoid macro variables shadowing.
15355
15356 2001-08-23 Marc Autret <autret_m@epita.fr>
15357
15358 * src/lex.c (percent_table): Typo: s/naem/name/.
15359 Add graph option.
15360 Normalize new options declarations.
15361
15362 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15363
15364 * tests/suite.at: Exercise %header_extension and %source_extension.
15365
15366 2001-08-16 Marc Autret <autret_m@epita.fr>
15367
15368 * src/reader.c (parse_dquoted_param): New.
15369 (parse_header_extension_decl): Use it.
15370 (parse_source_extension_decl): Likewise.
15371
15372 2001-08-16 Marc Autret <autret_m@epita.fr>
15373
15374 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15375 (get_xxxx_str): Use assert () instead of complain ().
15376 Remove return invokations in default cases.
15377 (get_decision_str): Modify default behaviour. Remove second argument.
15378 Echo modifications on calls.
15379 (output_graph): Fix.
15380
15381 2001-08-16 Marc Autret <autret_m@epita.fr>
15382
15383 * src/getargs.c (usage): Update with ``-g, --graph''.
15384
15385 2001-08-16 Marc Autret <autret_m@epita.fr>
15386
15387 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15388 (Option Cross Key): Likewise.
15389 * doc/bison.1: Update.
15390
1c8c2190
PB
153912001-09-25 Pascal Bart <pascal.bart@epita.fr>
15392
15393 * src/output.c (output_master_parser): Don't finish action_obstack.
15394 (output_parser): Don't care about the muscle action, here.
15395 (prepare): Copy the action_obstack in the action muscle.
15396 (output): Free action_obstack.
15397
180d45ba
PB
153982001-09-23 Pascal Bart <pascal.bart@epita.fr>
15399
15400 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15401 will contain `%union' declaration.
15402 (parse_union_decl): Delete #line directive output.
15403 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15404 informations about %union.
15405 (parse_union_decl): Copy the union_obstack in the muscle stype.
15406 * src/bison.simple: Add new #line directive.
15407 Add typdef %%stype YYSTYPE.
15408
c51d1a19
PB
154092001-09-23 Pascal Bart <pascal.bart@epita.fr>
15410
15411 * src/bison.simple: Add new `#line' directive.
15412
6f9344da
PB
154132001-09-22 Pascal Bart <pascal.bart@epita.fr>
15414
15415 * src/bison.simple: New `#line' directive.
15416 * src/output.c (output_parser): Support new dynamic muscle input_line.
15417
652def80
MA
154182001-09-22 Marc Autret <autret_m@epita.fr>
15419
15420 * src/output.c (output_master_parser): New.
15421 (output_parser): Be more re-entrant.
15422
25b222fa
MA
154232001-09-21 Marc Autret <autret_m@epita.fr>
15424
15425 * src/reader.c (copy_definition, parse_union_decl): Update and use
15426 `linef' muscle.
15427 (copy_action): Likewise.
15428 Use obstack_1grow ().
15429 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15430
6bc35ae5
MA
154312001-09-21 Marc Autret <autret_m@epita.fr>
15432
15433 * src/options.c (option_table): Adjust.
15434 * src/lex.c (parse_percent_token): Fix.
15435
c0629aa1
PB
154362001-09-20 Pascal Bart <pascal.bart@epita.fr>
15437
15438 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 15439
82b6d266
PB
154402001-09-20 Pascal Bart <pascal.bart@epita.fr>
15441
15442 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15443 is now an option_table_struct*.
15444 (option_strcmp): New function option_strcmp.
15445 (parse_percent_token): Call option_strcmp.
15446 * src/getargs.c (xalloc.h, options.h): Include it.
15447 (getargs): Call create_long_option_table.
15448 (getargs): Free longopts at the end of the function.
15449 (shortopts): Move in options.c.
15450 * src/options.c (create_long_option_table): New function. Convert
15451 information from option_table to option structure.
15452 * src/reader.c (options.h): Include it.
15453
15454 * src/Makefile.am: Adjust.
15455 * src/options.c (option_table): Create from longopts and percent_table.
15456 * src/getargs.c (longopts): Delete.
15457 * src/lex.c (struct percent_table_struct): Delete.
15458 (percent_table): Delete.
15459 (options.h): Include it.
15460 * src/options.c: Create.
15461 * src/options.h: Create.
15462 Declare enum opt_access_e.
15463 Define struct option_table_struct.
15464
75f5aaea
MA
154652001-09-20 Marc Autret <autret_m@epita.fr>
15466
15467 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15468 sections of Bison.
15469
f508cb0a
PB
154702001-09-19 Pascal Bart <pascal.bart@epita.fr>
15471
15472 * src/bison.simple: s/%%filename/%%skeleton.
15473 * src/muscle_tab.c (getargs.h): Include it.
15474 (muscle_init): Insert new muscle skeleton.
15475
13105fc1
PB
154762001-09-18 Pascal Bart <pascal.bart@epita.fr>
15477
15478 * src/output.c (output_parser): Delete unused variable actions_dumped.
15479
b0c4483e
PB
154802001-09-07 Pascal Bart <pascal.bart@epita.fr>
15481
15482 * src/output.c (output): Delete call to reader_output_yylsp.
15483 * src/reader.c (reader): Likewise.
ba0fe3c7 15484 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 15485
11d82f03
MA
154862001-09-02 Marc Autret <autret_m@epita.fr>
15487
15488 * src/reader.c: Include muscle_tab.h.
15489 (parse_union_decl): Update.
15490 (parse_macro_decl): Rename parse_muscle_decl.
15491 Update to use renamed functions and variable.
15492 (read_declarations, copy_action, read_additionnal_code, : Updated
15493 with correct variables and functions names.
15494 (packsymbols, reader): Likewise.
342b8b6e 15495
11d82f03 15496 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 15497
11d82f03
MA
15498 * src/output.c: Include muscle_tab.h
15499 In all functions using macro_insert, change by using muscle_insert ().
15500 (macro_obstack): Rename muscle_obstack.
15501 Echo modifications in the whole file.
15502 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15503 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15504 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15505
15506 * src/muscle_tab.h: Update double inclusion macros.
15507 (macro_entry_s): Rename muscle_entry_s.
15508 Update prototypes.
342b8b6e 15509
11d82f03
MA
15510 * src/muscle_tab.c: Include muscle_tab.h.
15511 Rename macro_tabble to muscle_table.
15512 (mhash1, mhash2, mcmp): Use muscle_entry.
15513 (macro_init): Rename muscle_init. Update.
15514 (macro_insert): Rename muscle_insert. Update.
15515 (macro_find): Rename muscle_find. Update.
15516
15517 * src/main.c: Include muscle_tab.h.
15518 (main): Call muscle_init ().
15519 * src/Makefile.am (bison_SOURCES): Echo modifications.
15520
93a37297
MA
155212001-09-02 Marc Autret <autret_m@epita.fr>
15522
f753cd62 15523 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 15524
f753cd62
MA
15525 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15526
155272001-09-02 Marc Autret <autret_m@epita.fr>
15528
15529 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 15530
682d48cd
PB
155312001-09-01 Pascal Bart <pascal.bart@epita.fr>
15532
342b8b6e 15533 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
15534 filename.
15535
087c8fda
MA
155362001-09-01 Marc Autret <autret_m@epita.fr>
15537
15538 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15539 to an explicit value to activate the feature. We do it here.
15540
dda680cb
PB
155412001-08-31 Pascal Bart <pascal.bart@epita.fr>
15542
15543 * src/output.c (prepare): Delete the `filename' muscule insertion.
15544 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15545 (parse_union_decl): Likewise.
15546 * src/macrotab.c (macro_init): Initialize filename by infile.
15547
9e644e64
MA
155482001-08-31 Marc Autret <autret_m@epita.fr>
15549
15550 * src/bison.simple (YYLSP_NEEDED): New definition.
15551 * src/output.c (prepare): Add macro insertion of `locations_flag'
15552
17da6427
PB
155532001-08-31 Pascal Bart <pascal.bart@epita.fr>
15554
15555 * src/output.c (prepare): Delete insertion of previous muscles,
15556 and insert the `prefix' muscles.
15557 * src/macrotab.c (macro_init): Likewise.
15558 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 15559 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
15560 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15561 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 15562 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
15563 name_prefix.
15564
e8cb70b9
PB
155652001-08-31 Pascal Bart <pascal.bart@epita.fr>
15566
15567 * src/main.c (main): Standardize.
15568 * src/output.c (output_table_data, output_parser): Likewise.
15569 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15570
63c2d5de
MA
155712001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15572
342b8b6e 15573 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
15574 %%epilogue.
15575 * src/output.c (output): Rename %%declarations to %%prologue.
15576 * src/bison.simple: Echo modifications.
342b8b6e 15577
d8cb5183
MA
155782001-08-31 Marc Autret <autret_m@epita.fr>
15579
15580 * src/reader.c (readgram): CleanUp.
15581 (output_token_defines): Likewise.
15582 (packsymbols): Likewise.
15583 (reader): Likewise.
15584 * src/output.c (output): CPP-out useless code.
15585
6c686258
PB
155862001-08-31 Pascal Bart <pascal.bart@epita.fr>
15587
342b8b6e 15588 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
15589 output_trailers and output_headers.
15590 * src/output.h: Remove obsolete functions prototypes of output_headers
15591 and output_trailers.
15592
8f451ef7
PB
155932001-08-30 Pascal Bart <pascal.bart@epita.fr>
15594
15595 * src/main.c: Include macrotab.h.
342b8b6e 15596 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
15597 Adjust functions prototypes.
15598 * src/macrotab.c (macro_insert): Constify key and value.
15599 (macro_find): Constify key.
15600 (macro_insert): Include 'xalloc.h'
15601 (macro_insert): Use XMALLOC.
15602 (macro_find): Constify return value.
15603 * src/output.c (output_table_data): Rename table to table_data.
15604 (output_parser): Constify macro_key, macro_value.
15605
997b6fd0 156062001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
15607
15608 * src/reader.c (parse_skel_decl): New.
342b8b6e 15609 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
15610 * src/lex.h (token_t): New token `tok_skel'.
15611 * src/lex.c (percent_table): Add skeleton option entry.
15612 Standardize.
15613
ff48177d
MA
156142001-08-29 Marc Autret <autret_m@epita.fr>
15615
15616 * src/bison.simple: Add %%user_code directive at the end.
15617 * src/reader.c (read_additionnal_code): New.
15618 (reader): Use it.
15619 * src/output.c (output_program): Remove.
15620 (output): Update.
15621
b33160bf
MA
156222001-08-28 Marc Autret <autret_m@epita.fr>
15623
15624 * src/output.c (output_actions): Clean up.
4e5caae2 15625 (output_gram): CPP-out useless code.
b33160bf
MA
15626 * src/reader.c (reader): Clean up, CPP-out useless code.
15627
d1a2daf7
PB
156282001-08-28 Pascal Bart <pascal.bart@epita.fr>
15629
342b8b6e 15630 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 15631 directive.
d1a2daf7
PB
15632 * src/bison.simple: Add `%%definitions'.
15633
2b763dfe
MA
156342001-08-28 Marc Autret <autret_m@epita.fr>
15635
15636 * config/depcomp: New file.
15637
f1a87ef6
PE
156382001-08-27 Paul Eggert <eggert@twinsun.com>
15639
15640 * src/bison.simple (yyparse): Don't take the address of an
15641 item before the start of an array, as that doesn't conform to
15642 the C Standard.
15643
82e236e2
RA
156442001-08-27 Robert Anisko <robert.anisko@epita.fr>
15645
f1a87ef6 15646 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
15647 obstack. It was done too late here.
15648
15649 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15650 completely wrong.
15651 (reader): Initialize the macro obstack here, since we need it to grow
15652 '%define' directives.
15653
15654 * src/reader.h: Declare the macro obstack as extern.
15655
b0cfa28a
RA
156562001-08-27 Robert Anisko <robert.anisko@epita.fr>
15657
15658 * src/output.c (output_parser): Fix. Store single '%' characters in
15659 the output obstack instead of throwing them away.
15660
6fc74234
AD
156612001-08-27 Akim Demaille <akim@epita.fr>
15662
15663 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15664
9c76d118
RA
156652001-08-25 Robert Anisko <robert.anisko@epita.fr>
15666
15667 * lib/Makefile.am: Adjust.
15668
a8289c62
RA
156692001-08-25 Robert Anisko <robert.anisko@epita.fr>
15670
15671 * src/bison.simple: Update and add '%%' directives.
15672
b6610515
RA
156732001-08-25 Robert Anisko <robert.anisko@epita.fr>
15674
15675 * src/reader.c (reader): Remove calls to 'output_headers' and
15676 'output_trailers'. Remove some C output.
15677 (readgram): Disable a piece of code that was writing a default
15678 definition for 'YYSTYPE'.
15679 (reader_output_yylsp): Remove.
15680 (packsymbols): Output token defintions to a macro.
15681 (copy_definition): Disable C output.
6fc74234 15682
b6610515
RA
15683 * src/reader.c (parse_macro_decl): New function used to parse macro
15684 declarations.
15685 (copy_string2): Put the body of copy_string into this new function.
15686 Add a parameter to let the caller choose whether he wants to copy the
15687 string delimiters or not.
15688 (copy_string): Be a simple call to copy_string2 with the last argument
15689 bound to true.
15690 (read_declarations): Add case for macro definition.
15691 (copy_identifier): New.
6fc74234 15692 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
15693 rather than lex.
15694
26f609ff
RA
156952001-08-25 Robert Anisko <robert.anisko@epita.fr>
15696
15697 * src/output.c (prepare): Add prefixed names.
15698 (output_parser): Output semantic actions.
15699 (output_parser): Fix bug on '%%line' directives.
6fc74234 15700
26f609ff
RA
15701 * src/output.c (output_headers): Remove. The C code printed by this
15702 function should now be in the skeletons.
15703 (output_trailers): Remove.
15704 (output): Disable call to 'reader_output_yylsp'.
15705 (output_rule_data): Do not output tables to the table obstack.
15706
15707 * src/output.c: Remove some C dedicated output.
15708 Improve the use of macro and output obstacks.
15709 (output_defines): Remove.
6fc74234 15710
26f609ff
RA
15711 * src/output.c (output_token_translations): Associate 'translate'
15712 table with a macro. No output to the table obstack.
15713 (output_gram): Same for 'rhs' and 'prhs'.
15714 (output_stos): Same for 'stos'.
15715 (output_rule_data): Same for 'r1' and 'r2'.
15716 (token_actions): Same for 'defact'.
15717 (goto_actions): Same for 'defgoto'.
15718 (output_base): Same for 'pact' and 'pgoto'.
15719 (output_table): Same for 'table'.
15720 (output_check): Same for 'check'.
6fc74234 15721
26f609ff
RA
15722 * src/output.c (output_table_data): New function.
15723 (output_short_table): Remove.
15724 (output_short_or_char_table): Remove.
6fc74234 15725
26f609ff
RA
15726 * src/output.c (output_parser): Replace most of the skeleton copy code
15727 with something new. Skeletons are now processed character by character
15728 rather than line by line, and Bison looks for '%%' macros. This is the
15729 first step in making Bison's output process (a lot) more flexible.
15730 (output_parser): Use the macro table.
15731
6f43b113
RA
157322001-08-25 Robert Anisko <robert.anisko@epita.fr>
15733
15734 * src/main.c (main): Initialize the macro table.
15735
dd3127cf
RA
157362001-08-25 Robert Anisko <robert.anisko@epita.fr>
15737
15738 * src/lex.c (percent_table): Add tok_define.
15739 * src/lex.h: Add tok_define.
15740
aa321494
RA
157412001-08-25 Robert Anisko <robert.anisko@epita.fr>
15742
15743 * src/macrotab.c: New file.
15744 * src/macrotab.h: New file.
15745 * src/Makefile.am: Update.
15746
68bd3b6b
RA
157472001-08-25 Robert Anisko <robert.anisko@epita.fr>
15748
15749 * lib/hash.c: New file.
15750 * lib/hash.h: New file.
15751 * lib/Makefile.am: Update.
15752
45f8dd1e
AD
157532001-08-15 Akim Demaille <akim@epita.fr>
15754
15755 Version 1.28c.
15756
40a64a7a 157572001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
15758
15759 * src/reader.c (readgram): Indent output macro YYSTYPE.
15760 (packsymbols): Likewise.
15761 (output_token_defines): Likewise.
15762 * src/files.c: Standardize.
15763 (compute_header_macro): New.
15764 (defines_obstack_save): New. Use compute_header_macro.
15765 (output_files): Update. Use defines_obstack_save.
15766
f9a8293a
AD
157672001-08-15 Akim Demaille <akim@epita.fr>
15768
15769 * doc/bison.texinfo (Table of Symbols): Document
15770 YYSTACK_USE_ALLOCA.
15771
150ca7a7
AD
157722001-08-15 Akim Demaille <akim@epita.fr>
15773
15774 * missing: Update from CVS Automake.
15775 * config/config.guess, config/config.sub, config/texinfo.tex:
15776 Update from gnu.org.
15777
69b5cec4
AD
157782001-08-15 Akim Demaille <akim@epita.fr>
15779
15780 * Makefile.maint: Sync with CVS Autoconf.
15781
f2b5126e
PB
157822001-08-14 Pascal Bart <pascal.bart@epita.fr>
15783
69b5cec4 15784 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
15785 `fdl.texi'.
15786 * doc/fdl.texi: Add to package.
15787
4ecbf796
MA
157882001-08-14 Marc Autret <autret_m@epita.fr>
15789
15790 Turn on %{source,header}_extension features.
15791
69b5cec4 15792 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
15793 source_extension.
15794 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 15795 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
15796 between options.
15797
95fb5662
MA
157982001-08-14 Marc Autret <autret_m@epita.fr>
15799
15800 * src/files.c (compute_base_names): Add extensions computing when
15801 `--file-prefix' used.
15802 Standardize function calls.
15803
78d09da9
MA
158042001-08-13 Marc Autret <autret_m@epita.fr>
15805
69b5cec4 15806 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
15807 defining it (defined but null disables alloca).
15808
5a009f2c
MA
158092001-08-13 Marc Autret <autret_m@epita.fr>
15810
15811 * src/bison.simple (_yy_memcpy): CPP reformat.
15812
1e41465a
PB
158132001-08-13 Pascal Bart <pascal.bart@epita.fr>
15814
15815 * tests/atconfig.in (CPPFLAGS): Fix.
15816
c67a198d
PB
158172001-08-10 Pascal Bart <pascal.bart@epita.fr>
15818
79282c6c 15819 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
15820 `gpl.texi'.
15821 * doc/gpl.texi: Add to package.
15822
09a6de7e
MA
158232001-08-10 Marc Autret <autret_m@epita.fr>
15824
15825 * src/print_graph.h: Fix.
15826 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15827
b77b9ee0
AD
158282001-08-10 Akim Demaille <akim@epita.fr>
15829
15830 * src/system.h: Provide default declarations for stpcpy, strndup,
15831 and strnlen.
15832
3e259915
MA
158332001-08-10 Robert Anisko <anisko_r@epita.fr>
15834
15835 * doc/bison.texinfo (Locations): Update @$ stuff.
15836
ca96bc2d
MA
158372001-08-09 Robert Anisko <anisko_r@epita.fr>
15838
15839 * src/bison.simple (YYLLOC_DEFAULT): Update.
15840 (yyparse): Adjust.
15841
fdc6758b
MA
158422001-08-08 Marc Autret <autret_m@epita.fr>
15843
b77b9ee0 15844 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
15845 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15846 Reported by Fabrice Bauzac.
957d4dbf 15847
600cad3b
MA
158482001-08-08 Marc Autret <autret_m@epita.fr>
15849
15850 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15851 * src/vcg.c (output_node): Fix.
15852 * src/vcg.h: Cleanup.
15853 * src/print_graph.c: Add comments.
b77b9ee0 15854 (node_output_size): New global variable. Simplify the formatting of
600cad3b 15855 the VCG graph output.
b77b9ee0 15856 (print_actions): Unused code is now used. It notifies the final state
600cad3b 15857 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 15858 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
15859 blue.
15860 Get the current node name and node_obstack by argument.
15861 (node_obstack): New variable.
15862 (print_state): Manage node_obstack.
15863 (print_core): Use node_obstack given by argument.
15864 A node is not only computed here but in print_actions also.
15865 (print_graph): CPP out useless code instead of commenting it.
15866
976e528f
AD
158672001-08-07 Pascal Bart <pascal.bart@epita.fr>
15868
15869 * tests/atconfig.in (CPPFLAGS): Fix.
15870
20e8e5ca
AD
158712001-08-07 Akim Demaille <akim@epita.fr>
15872
15873 * src/print_graph.c (quote): New.
15874 (print_core): Use it.
15875
957d4dbf 158762001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 15877
3e3da797
AD
15878 * src/vcg.c (complain.h): Include it.
15879 Unepitaize `return' invocations.
c4b66126 15880 [NDEBUG] (main): Remove.
79282c6c 15881 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
15882 * src/files.c (open_files): Initialize graph_obstack.
15883 * src/print_graph.c (print_actions): CPP out useless code.
15884 (print_core): Don't output the last `\n' in labels.
15885 Use `quote'.
15886 * src/files.c (output_files): Output the VCG file.
15887 * src/main.c (main): Invoke print_graph ();
3e3da797 15888
957d4dbf 158892001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
15890
15891 Automaton VCG graph output.
15892 Using option ``-g'' or long option ``--graph'', you can generate
15893 a gram_filename.vcg file containing a VCG description of the LALR (1)
15894 automaton of your grammar.
15895
15896 * src/main.c: Call to print_graph() function.
15897 * src/getargs.h: Update.
15898 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15899 (graph_flag): New flag.
15900 (longopts): Update.
15901 (getargs): Add case `g'.
15902 * src/files.c (graph_obstack): New obstack struct.
15903 (open_files): Initialize new obstack.
15904 (output_files): Saves graph_obstack if required.
15905 * src/files.h (graph_obstack): New extern declaration.
15906 * src/Makefile.am: Add new source files.
15907
927c1557 159082001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
15909
15910 * src/print_graph.c, src/print_graph.h (graph): New.
15911 * src/vcg.h: New file.
15912 * src/vcg.c: New file, VCG graph handling.
15913
7333d403
AD
159142001-08-06 Marc Autret <autret_m@epita.fr>
15915
15916 Add of %source_extension and %header_extension which specify
15917 the source or/and the header output file extension.
15918
15919 * src/files.c (compute_base_names): Remove initialisation of
15920 src_extension and header_extension.
15921 (compute_exts_from_gf): Update.
15922 (compute_exts_from_src): Update.
15923 (output_files): Update.
15924 * src/reader.c (parse_header_extension_decl): New.
15925 (parse_source_extension_decl): New.
15926 (read_declarations): New case statements for the new tokens.
15927 * src/lex.c (percent_table): Add entries for %source_extension
15928 and %header_extension.
15929 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15930
84163231
AD
159312001-08-06 Marc Autret <autret_m@epita.fr>
15932
15933 * configure.in: Bump to 1.28c.
15934 * doc/bison.texinfo: Texinfo thingies.
15935
8303fc42
AD
159362001-08-04 Pascal Bart <pascal.bart@epita.fr>
15937
15938 * tests/atconfig.in (CPPFLAGS): Add.
15939 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15940
70a84437
AD
159412001-08-03 Akim Demaille <akim@epita.fr>
15942
15943 Version 1.28b.
15944
2ce10144
AD
159452001-08-03 Akim Demaille <akim@epita.fr>
15946
15947 * tests/Makefile.am (check-local): Ship testsuite.
15948 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15949 Include `string.h'.
15950
1e3e4bc1
AD
159512001-08-03 Akim Demaille <akim@epita.fr>
15952
15953 * configure.in: Try using -Wformat when compiling.
15954
42b45b7f
AD
159552001-08-03 Akim Demaille <akim@epita.fr>
15956
15957 * configure.in: Bump to 1.28b.
15958
8f13fe33
AD
159592001-08-03 Akim Demaille <akim@epita.fr>
15960
15961 * src/complain.c: Adjust strerror_r portability issues.
15962
b37ba92c
AD
159632001-08-03 Akim Demaille <akim@epita.fr>
15964
15965 Version 1.28a.
15966
b0ce6046
AD
159672001-08-03 Akim Demaille <akim@epita.fr>
15968
15969 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15970 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15971 * src/getargs.c: Include complain.h.
15972 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15973 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15974
d01c415b
AD
159752001-08-03 Akim Demaille <akim@epita.fr>
15976
15977 * src/reader.c (readgram): Display hidden chars in error messages.
15978
459dd1a6
AD
159792001-08-03 Akim Demaille <akim@epita.fr>
15980
15981 Update to gettext 0.10.39.
15982
53b74c0c
AD
159832001-08-03 Akim Demaille <akim@epita.fr>
15984
15985 * lib/strspn.c: New.
15986
234a3be3
AD
159872001-08-01 Marc Autret <autret_m@epita.fr>
15988
15989 * doc/bison.texinfo: Update.
15990 * doc/bison.1 (mandoc): Update.
15991 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15992 * src/files.c: Support output files extensions computing.
15993 (src_extension): New static variable.
15994 (header_extension): New static variable.
15995 (tr): New function.
15996 (get_extension_index): New function, gets the index of an extension
15997 filename in a string.
15998 (compute_exts_from_gf): New function, computes extensions from the
15999 grammar file extension.
16000 (compute_exts_from_src): New functions, computes extensions from the
16001 C source file extension, file given by ``-o'' option.
16002 (compute_base_names): Update.
16003 (output_files): Update.
16004
847bf1f5
AD
160052001-08-01 Robert Anisko <anisko_r@epita.fr>
16006
d995fee7 16007 * doc/bison.texi: Document @$.
847bf1f5
AD
16008 (Locations): New section.
16009
d074a105
AD
160102001-07-18 Akim Demaille <akim@epita.fr>
16011
16012 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
16013 * config/prev-version.txt, config/move-if-change: New.
16014 * Makefile.am: Adjust.
16015
3419715d
AD
160162001-07-08 Pascal Bart <pascal.bart@epita.fr>
16017
16018 * src/bison.simple (yyparse): Suppress warning `comparaison
16019 between signed and unsigned'.
16020
62ab6972
AD
160212001-07-05 Pascal Bart <pascal.bart@epita.fr>
16022
16023 * src/getargs.h (raw_flag): Remove.
16024 * src/getargs.c: Die on `-r'/`--raw'.
16025 * src/lex.c (parse_percent_token): Die on `%raw'.
16026 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
16027 * tests/calc.at: Suppress test with option `--raw'.
16028
1e24cc5b
AD
160292001-07-14 Akim Demaille <akim@epita.fr>
16030
16031 * config/: New.
16032 * configure.in: Require Autoconf 2.50.
16033 Update to gettext 0.10.38.
16034
32dfccf8
AD
160352001-03-16 Akim Demaille <akim@epita.fr>
16036
16037 * doc/bison.texinfo: ANSIfy the examples.
16038
cd5bd6ac
AD
160392001-03-16 Akim Demaille <akim@epita.fr>
16040
16041 * getargs.c (skeleton): New variable.
16042 (longopts): --skeleton is a new option.
16043 (shortopts, getargs): -S is a new option.
16044 * getargs.h: Declare skeleton.
16045 * output.c (output_parser): Use it.
16046
5141b016
AD
160472001-03-16 Akim Demaille <akim@epita.fr>
16048
16049 * m4/strerror_r.m4: New.
16050 * m4/error.m4: Run AC_FUNC_STRERROR_R.
16051 * lib/error.h, lib/error.c: Update.
16052
447992b9
AD
160532001-03-16 Akim Demaille <akim@epita.fr>
16054
16055 * src/getargs.c (longopts): Clean up.
16056
274d42ce
AD
160572001-02-21 Akim Demaille <akim@epita.fr>
16058
16059 * src/reader.c (gensym): `gensym_count' is your own.
16060 Use a static buf to create the symbol name, as token_buffer is no
16061 longer a buffer.
16062
22c821f3
AD
160632001-02-08 Akim Demaille <akim@epita.fr>
16064
16065 * src/conflicts.c (conflict_report): Be sure not to append to res
16066 between two calls, which could happen if both first sprintf were
16067 skipped, but not the first cp += strlen.
16068
18569462
AD
160692001-02-08 Akim Demaille <akim@epita.fr>
16070
16071 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
16072 New, from fileutils 4.0.37.
16073 * configure.in: Require Autoconf 2.49c. I took some time before
16074 making this decision. This is the only way out for portability
16075 issues in Bison, it would mean way too much duplicate effort to
16076 import in Bison features implemented in 2.49c since 2.13.
16077 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
16078
0d8f3c8a
AD
160792001-02-02 Akim Demaille <akim@epita.fr>
16080
16081 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 16082 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 16083
f17bcd1f
AD
160842001-01-19 Akim Demaille <akim@epita.fr>
16085
16086 Get rid of the ad hoc handling of token_buffer in the scanner: use
16087 the obstacks.
16088
16089 * src/lex.c (token_obstack): New.
16090 (init_lex): Initialize it. No longer call...
16091 (grow_token_buffer): this. Remove it.
16092 Adjust all the places which used it to use the obstack.
16093
511e79b3
AD
160942001-01-19 Akim Demaille <akim@epita.fr>
16095
16096 * src/lex.h: Rename all the tokens:
16097 s/\bENDFILE\b/tok_eof/g;
16098 s/\bIDENTIFIER\b/tok_identifier/g;
16099 etc.
16100 Let them be enums, not #define, to ease debugging.
16101 Adjust all the code.
16102
0d6508ef
AD
161032001-01-18 Akim Demaille <akim@epita.fr>
16104
16105 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
16106 * src/lex.c (maxtoken, grow_token_buffer): Static.
16107
6deb4447
AD
161082001-01-18 Akim Demaille <akim@epita.fr>
16109
16110 Since we now use obstacks, more % directives can be enabled.
16111
16112 * src/lex.c (percent_table): Also accept `%yacc',
16113 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
16114 `%debug'.
16115 Handle the actions for `%semantic_parser' and `%pure_parser' here,
16116 instead of returning a token.
16117 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
16118 * src/reader.c (read_declarations): Adjust.
16119 * src/files.c (open_files): Don't call `compute_base_names', don't
16120 compute `attrsfile' since they depend upon data which might be
16121 *in* the input file now.
16122 (output_files): Do it here.
16123 * src/output.c (output_headers): Document the fact that this patch
16124 introduces a guaranteed SEGV for semantic parsers.
16125 * doc/bison.texinfo: Document them.
16126 * tests/suite.at: Exercise these %options.
16127
ff4423cc
AD
161282000-12-20 Akim Demaille <akim@epita.fr>
16129
16130 Also handle the output file (--verbose) with obstacks.
16131
16132 * files.c (foutput): Remove.
16133 (output_obstack): New.
16134 Adjust all dependencies.
16135 * src/conflicts.c: Return a string.
16136 * src/system.h (obstack_grow_string): Rename as...
16137 (obstack_sgrow): this. Be ready to work with non literals.
16138 (obstack_fgrow4): New.
16139
956dba3a
AD
161402000-12-20 Akim Demaille <akim@epita.fr>
16141
16142 * src/files.c (open_files): Fix the computation of short_base_name
16143 in the case of `-o foo.tab.c'.
16144
337bab46
AD
161452000-12-20 Akim Demaille <akim@epita.fr>
16146
16147 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16148 (copy_dollar): Now that everything uses obstacks, get rid of the
16149 FILE * parameters.
16150
5d3214b8
AD
161512000-12-20 Akim Demaille <akim@epita.fr>
16152
16153 * src/files.c (open_files): Actually the `.output' file is based
16154 on the short_base_name, not base_name.
16155 * tests/suite.at (Checking output file names): Adjust.
16156
29092a57
AD
161572000-12-20 Akim Demaille <akim@epita.fr>
16158
16159 * src/bison.s1: Remove, we now use directly...
16160 * src/bison.simple: this.
16161 * src/Makefile.am: Use pkgdata instead of data.
16162
ea5607fd
AD
161632000-12-20 Akim Demaille <akim@epita.fr>
16164
16165 * src/files.c (guard_obstack): New.
16166 (open_files): Initialize it.
16167 (output_files): Dump it...
16168 * src/files.h: Export it.
16169 * src/reader.c (copy_guard): Use it.
16170
27110317
AD
161712000-12-19 Akim Demaille <akim@epita.fr>
16172
16173 * src/files.c (outfile, defsfile, actfile): Removed as global
16174 vars.
16175 (open_files): Don't compute them.
16176 (output_files): Adjust.
16177 (base_name, short_base_name): Be global.
16178 Adjust dependencies.
16179
19c50364
AD
161802000-12-19 Akim Demaille <akim@epita.fr>
16181
16182 * src/files.c (strsuffix): New.
16183 (stringappend): Be just like strcat but allocate.
16184 (base_names): Eve out from open_files.
16185 Try to simplify the rather hairy computation of base_name and
16186 short_base_name.
16187 (open_files): Use it.
16188 * tests/suite.at (Checking output file names): New test.
16189
573c1d9f
AD
161902000-12-19 Akim Demaille <akim@epita.fr>
16191
16192 * src/system.h (obstack_grow_literal_string): Rename as...
16193 (obstack_grow_string): this.
16194 * src/output.c (output_parser): Recognize `%% actions' instead of
16195 `$'.
16196 * src/bison.s1: s/$/%% actions/.
16197 * src/bison.hairy: Likewise.
16198
ef7ddedd
AD
161992000-12-19 Akim Demaille <akim@epita.fr>
16200
16201 * src/output.c (output_parser): Compute the `#line' lines when
16202 there are.
16203 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16204 Suggested by Hans Aberg.
16205
ff61dabd
AD
162062000-12-19 Akim Demaille <akim@epita.fr>
16207
16208 Let the handling of the skeleton files be local to the procedures
16209 that use it.
16210
16211 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16212 longer static.
16213 (fparser, open_extra_files): Remove.
16214 (open_files, output_files): Don't take care of fparser.
16215 * src/files.h: Adjust.
16216 * src/output.c (output_parser): Open and close the file to the
16217 skeleton.
16218 * src/reader.c (read_declarations): When %semantic_parser, open
16219 fguard.
16220
55b96341
AD
162212000-12-19 Akim Demaille <akim@epita.fr>
16222
16223 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16224 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16225
358c15b7
AD
162262000-12-19 Akim Demaille <akim@epita.fr>
16227
16228 * src/files.c (open_files): Yipee! We no longer need all the code
16229 looking for `/tmp' since we have no tmp file.
16230
7de3329e
AD
162312000-12-19 Akim Demaille <akim@epita.fr>
16232
16233 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16234 New macros.
16235 * src/files.c (open_files): Less dependency on MSDOS etc.
16236
3abcd459
AD
162372000-12-14 Akim Demaille <akim@epita.fr>
16238
16239 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16240 Provide a default definition.
16241 Use it when executing the default @ action.
16242 * src/reader.c (reader_output_yylsp): No longer include
16243 `timestamp' and `text' in the default YYLTYPE.
16244
2a91a95e
AD
162452000-12-12 Akim Demaille <akim@epita.fr>
16246
16247 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16248 (copy_guard): Quote the file names.
16249 Reported by Laurent Mascherpa.
16250
14d3eb9b
AD
162512000-12-12 Akim Demaille <akim@epita.fr>
16252
16253 * src/output.c (output_headers, output_program, output): Be sure
16254 to escape special characters when outputting filenames.
16255 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16256 (output_headers): Don't depend on them, Use ACTSTR.
16257
d7045ec6
AD
162582000-11-17 Akim Demaille <akim@epita.fr>
16259
16260 * lib/obstack.h: Formatting changes.
16261 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16262 prevents type checking.
16263 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16264 cast the value to (void *): assigning a `foo *' to a `void *'
16265 variable is valid.
16266 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16267 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16268 append characters.
16269
6fd54b73
AD
162702000-11-17 Akim Demaille <akim@epita.fr>
16271
16272 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16273 as...
16274 (suite.m4, regression.m4, calc.m4): these.
16275 * tests/atgeneral.m4: Update from CVS Autoconf.
16276
4c50eae6
AD
162772000-11-17 Akim Demaille <akim@epita.fr>
16278
16279 * tests/regression.m4 (%union and --defines): New test,
16280 demonstrating a current bug in the obstack implementation.
16281
a35f64ea
AD
162822000-11-17 Akim Demaille <akim@epita.fr>
16283
16284 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16285 macros.
16286 Use them to declare the variables which are global or local to
16287 `yyparse'.
16288
7de23534
AD
162892000-11-17 Akim Demaille <akim@epita.fr>
16290
16291 * acconfig.h: Remove, no longer used.
16292
aa7815f5
AD
162932000-11-07 Akim Demaille <akim@epita.fr>
16294
16295 * src: s/Copyright (C)/Copyright/g.
16296
5af1f549
AD
162972000-11-07 Akim Demaille <akim@epita.fr>
16298
16299 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16300 defining.
16301 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16302
553e2b22
AD
163032000-11-07 Akim Demaille <akim@epita.fr>
16304
16305 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16306 Merge in a single CPP if/else.
16307
8a4f41d6
AD
163082000-11-07 Akim Demaille <akim@epita.fr>
16309
16310 * src/output.c (output): Remove useless variables.
16311 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16312 argument `data' for consistency with the prototypes.
16313 Qualify it `const'.
16314 (obstack_copy, obstack_copy0): Rename the second argument as
16315 `address' for consistency. Qualify it `const'.
16316 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16317 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16318 `const' their input argument (`data' or `address').
16319 Adjust the corresponding macros to include `const' in casts.
16320
095a3fb5
AD
163212000-11-03 Akim Demaille <akim@epita.fr>
16322
16323 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16324 s/PFILE1/BISON_HAIRY/.
16325 Adjust dependencies.
16326
d1cdce7c
AD
163272000-11-03 Akim Demaille <akim@epita.fr>
16328
090c5ebf 16329 For some reason, this was not applied.
d1cdce7c
AD
16330
16331 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16332 `unlink': it's no longer used.
16333
9311529b
AD
163342000-11-03 Akim Demaille <akim@epita.fr>
16335
16336 * src/files.c (skeleton_find): New function, eved out of...
16337 (open_files, open_extra_files): here.
16338
d8880f69
AD
163392000-11-03 Akim Demaille <akim@epita.fr>
16340
16341 Don't use `atexit'.
16342
16343 * src/files.c (obstack_save): New function.
16344 (done): Rename as...
16345 (output_files): this.
16346 Use `obstack_save'.
16347 * src/main.c (main): Don't use `atexit' to register `done', since
16348 it no longer has to remove tmp files, just call `output_files'
16349 when there are no errors.
16350
0dbb648e
AD
163512000-11-02 Akim Demaille <akim@epita.fr>
16352
16353 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16354 `unlink': it's no longer used.
16355 * src/files.h: Formatting changes.
16356
896fe5c1
AD
163572000-11-02 Akim Demaille <akim@epita.fr>
16358
16359 Remove the last uses of mktemp and unlink/delete.
16360
16361 * src/files.c (fdefines, ftable): Removed.
16362 (defines_ostack, table_obstack): New.
16363 Adjust dependencies of the former into uses of the latter.
16364 * src/output.c (output_short_or_char_table, output_short_table):
16365 Convert to using obstacks.
16366 * src/reader.c (copy_comment2): Accept one FILE * and two
16367 obstacks.
16368 (output_token_defines, reader_output_yylsp): Use obstacks.
16369 * src/system.h (obstack_fgrow3): New.
1f65350a 16370 * po/POTFILES.in: Adjust.
896fe5c1 16371
dd60faec
AD
163722000-11-01 Akim Demaille <akim@epita.fr>
16373
16374 Change each use of `fattrs' into a use of `attrs_obstack'.
16375
16376 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16377 * src/files.c (fattrs): Remove.
16378 (attrs_obstack): New.
16379 Adjust all dependencies.
16380 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16381
8c7ebe49
AD
163822000-11-01 Akim Demaille <akim@epita.fr>
16383
16384 Introduce obstacks.
16385 Change each use of `faction' into a use of `action_obstack'.
16386
16387 * lib/obstack.h, lib/obstack.c: New files.
16388 * src/files.c (faction): Remove.
16389 (action_obstack): New.
16390 Adjust all dependencies.
16391
77aee789
AD
163922000-10-20 Akim Demaille <akim@epita.fr>
16393
16394 * lib/quote.h (PARAMS): New macro. Use it.
16395
43591cec
AD
163962000-10-16 Akim Demaille <akim@epita.fr>
16397
16398 * src/output.c (output_short_or_char_table): New function.
16399 (output_short_table, output_token_translations): Use it.
16400 (goto_actions): Use output_short_table.
16401
1e9798d5
AD
164022000-10-16 Akim Demaille <akim@epita.fr>
16403
16404 * src/symtab.c (bucket_new): New function.
16405 (getsym): Use it.
16406
16407 * src/output.c (output_short_table): New argument to display the
16408 comment associated with the table.
16409 Adjust dependencies.
16410 (output_gram): Use it.
16411 (output_rule_data): Nicer output layout for YYTNAME.
16412
f282676b
AD
164132000-10-16 Akim Demaille <akim@epita.fr>
16414
16415 * src/lex.c (read_typename): New function.
16416 (lex): Use it.
16417 * src/reader.c (copy_dollar): Likewise.
16418
550a72a3
AD
164192000-10-16 Akim Demaille <akim@epita.fr>
16420
16421 * src/reader.c (copy_comment2): Expect the input stream to be on
16422 the `/' which is suspected to open a comment, instead of being
16423 called after `//' or `/*' was read.
16424 (copy_comment, copy_definition, parse_union_decl, copy_action)
16425 (copy_guard): Adjust.
16426
131e2fef
AD
164272000-10-16 Akim Demaille <akim@epita.fr>
16428
16429 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16430 `read_signed_integer'.
16431
79282c5a
AD
164322000-10-16 Akim Demaille <akim@epita.fr>
16433
16434 * src/reader.c (copy_dollar): New function.
16435 (copy_guard, copy_action): Use it.
16436
ff4a34be
AD
164372000-10-16 Akim Demaille <akim@epita.fr>
16438
16439 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16440 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16441 New files, from Fileutils 4.0.27.
16442 * src/main.c (printable_version): Remove.
16443 * src/lex.c, src/reader.c: Use `quote'.
16444
164452000-10-04 Akim Demaille <akim@epita.fr>
16446
16447 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16448
14ded682
AD
164492000-10-04 Akim Demaille <akim@epita.fr>
16450
16451 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16452
8e03724b
AD
164532000-10-04 Akim Demaille <akim@epita.fr>
16454
16455 When a literal string is used to define two different tokens,
16456 `bison -v' segfaults.
16457 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16458
16459 * tests/regression.m4: New file.
16460 Include the core of the sample provided by Piotr Gackiewicz.
16461 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16462 properly.
16463
a9e64249
AD
164642000-10-04 Akim Demaille <akim@epita.fr>
16465
16466 * src/reader.c (parse_expect_decl): Keep `count' within the size
16467 of `buffer'.
16468 From Neil Booth.
16469
da9abf43
AD
164702000-10-02 Paul Eggert <eggert@twinsun.com>
16471
16472 * bison.s1 (yyparse): Assign the default value
16473 unconditionally, to avoid a GCC warning and make the parser a
16474 tad smaller.
16475
c33638bb
AD
164762000-10-02 Akim Demaille <akim@epita.fr>
16477
16478 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16479 options.
16480
444c570a
AD
164812000-10-02 Akim Demaille <akim@epita.fr>
16482
16483 * src/derives.c, src/print.c, src/reduce.c: To ease the
16484 translation, move some `\n' out of the translated strings.
16485
89cab50d
AD
164862000-10-02 Akim Demaille <akim@epita.fr>
16487
16488 The location tracking mechanism is precious for parse error
16489 messages. Nevertheless, it is enabled only when `@n' is used in
16490 the grammar, which is a different issue (you can use it in error
16491 message, but not in the grammar per se). Therefore, there should
16492 be another means to enable it.
16493
16494 * src/getargs.c (getargs): Support `--locations'.
16495 (usage): Report it.
16496 * src/getargs.h (locationsflag): Export it.
16497 * src/lex.c (percent_table): Support `%locations'.
16498 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16499 with `locationsflag'.
16500 * doc/bison.texinfo: Document `--locations' and `%locations'.
16501 Sort the options.
16502 * tests/calc.m4: Test it.
16503
16504 For regularity of the names, replace each
16505 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16506 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16507 In addition replace each `flag' with `_flag'.
16508
d6c2cba0
AD
165092000-10-02 Akim Demaille <akim@epita.fr>
16510
16511 Also test parse error messages, including with YYERROR_VERBOSE.
16512
16513 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16514 associative).
16515 Use it to check the computations.
16516 Use it to check `nonassoc' is honored.
16517 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16518 `--yyerror-verbose'.
16519 (_AT_CHECK_CALC): Adjust to this option.
16520 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16521
5a35a6cb
AD
165222000-10-02 Akim Demaille <akim@epita.fr>
16523
16524 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16525 the latter demonstrates a flaw in the handling of non debugging
16526 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16527 was used in order to simplify:
16528
16529 #if YYDEBUG
16530 if (yydebug)
16531 {
16532 ...
16533 }
16534 #endif
16535
16536 into
16537
16538 if (yydebug)
16539 {
16540 ...
16541 }
16542
16543 unfortunately this leads to a CPP conflict when
16544 `--name-prefix=foo' is used since it produces `#define yydebug
16545 foodebug'.
16546
16547 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16548 (YYDPRINTF): New macro.
16549 Spread its use.
16550 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16551 the bison options.
16552 Also test `--verbose', `--defines' and `--name-prefix'.
16553
71da9eea
AD
165542000-10-02 Akim Demaille <akim@epita.fr>
16555
16556 Improve the readability of the produced parsers.
16557
16558 * src/bison.s1: Formatting changes.
16559 Improve the comment related to the `$' mark.
16560 (yydefault): Don't fall through to `yyresume': `goto' there.
16561 * src/output.c (output_parser): When the `$' is met, skip the end
16562 of its line.
16563 New variable, `number_of_dollar_signs', to check there's exactly
16564 one `$' in the parser skeleton.
16565
95e36146
AD
165662000-10-02 Akim Demaille <akim@epita.fr>
16567
16568 * lib/xstrdup.c: New file, from the fileutils.
16569 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16570 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16571 instead of strlen + xmalloc + strcpy.
16572 * src/symtab.c (copys): Remove, use xstrdup instead.
16573
d7020c20
AD
165742000-10-02 Akim Demaille <akim@epita.fr>
16575
16576 * src/gram.h (associativity): New enum type which replaces the
16577 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16578 `right_assoc', `left_assoc' and `non_assoc'.
16579 Adjust all dependencies.
16580 * src/reader.c: Formatting changes.
16581 (LTYPESTR): Don't define it, use it as a literal in
16582 `reader_output_yylsp'.
16583 * src/symtab.h (symbol_class): New enum type which replaces the
16584 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16585 `sunknown', `stoken and `snterm'.
16586
1916f98e
AD
165872000-10-02 Akim Demaille <akim@epita.fr>
16588
16589 * src/getargs.c (fixed_outfiles): Rename as...
16590 (yaccflag): for consistency and accuracy.
16591 Adjust dependencies.
16592
d7913476
AD
165932000-10-02 Akim Demaille <akim@epita.fr>
16594
16595 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16596 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16597 difficult and introduced a lot of core dump. It turns out that
16598 Bison used an implementation of `xmalloc' based on `calloc', and
16599 at various places it does depend upon the initialization to 0. I
16600 have not tried to isolate the pertinent places, and all the former
16601 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16602 someone should address this issue.
16603
16604 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16605 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16606 files.
16607 Adjust dependencies.
16608 * src/warshall.h: New file.
16609 Propagate.
16610
340ef489
AD
166112000-10-02 Akim Demaille <akim@epita.fr>
16612
16613 Various anti-`extern in *.c' changes.
16614
16615 * src/system.h: Include `assert.h'.
16616
b2ca4022
AD
166172000-10-02 Akim Demaille <akim@epita.fr>
16618
16619 * src/state.h (nstates, final_state, first_state, first_shift)
16620 (first_reduction): Move their exportation from here...
16621 * src/LR0.h: to here.
16622 Adjust dependencies.
16623 * src/getargs.c (statisticsflag): New variable.
16624 Add support for `--statistics'.
16625 Adjust dependencies.
16626
16627 Remove a lot of now useless `extern' statements in most files.
16628
403b315b
AD
166292000-10-02 Akim Demaille <akim@epita.fr>
16630
16631 * src/LR0.h: New file.
16632 Propagate its use.
16633
07a58c13
AD
166342000-10-02 Akim Demaille <akim@epita.fr>
16635
16636 * src/print.h: New file.
16637 Propagate its use.
16638 * src/print.c: Formatting and ordering changes.
16639 (verbose, terse): Replace with...
16640 (print_results): this new function.
16641 Adjust dependencies.
16642
0619caf0
AD
166432000-10-02 Akim Demaille <akim@epita.fr>
16644
16645 * src/conflicts.c (conflict_report): New function.
16646 (conflict_log, verbose_conflict_log): Replace with...
16647 (print_conflicts): this function.
16648 Adjust dependencies.
16649 * src/conflicts.h: New file.
16650 Propagate its inclusion.
16651
3519ec76
AD
166522000-10-02 Akim Demaille <akim@epita.fr>
16653
16654 * src/nullable.h: New file.
16655 Propagate its inclusion.
16656 * src/nullable.c: Formatting changes.
16657
015acc48
AD
166582000-10-02 Akim Demaille <akim@epita.fr>
16659
16660 * src/reduce.h: New file.
16661 Propagate its inclusion.
16662 * src/reduce.c: Topological sort and other formatting changes.
16663 (bool, TRUE, FALSE): Move their definition to...
16664 * src/system.h: here.
16665
8963a27b
AD
166662000-10-02 Akim Demaille <akim@epita.fr>
16667
16668 * src/files.c: Formatting changes.
16669 (tryopen, tryclose, openfiles): Rename as...
16670 (xfopen, xfclose, open_files): this.
16671 (stringappend): static.
16672 * src/files.h: Complete the list of exported symbols.
16673 Propagate its use.
16674
a70083a3
AD
166752000-10-02 Akim Demaille <akim@epita.fr>
16676
16677 * src/reader.h: New file.
16678 Propagate its use instead of tedious list of `extern' and
16679 prototypes.
16680 * src/reader.c: Formatting changes, topological sort,
16681 s/register//.
16682
abadc117
AD
166832000-10-02 Akim Demaille <akim@epita.fr>
16684
16685 * src/lex.h: Prototype `lex.c' exported functions.
16686 * src/reader.c: Adjust.
16687 * src/lex.c: Formatting changes.
16688 (safegetc): Rename as...
16689 (xgetc): this.
16690
720d742f
AD
166912000-10-02 Akim Demaille <akim@epita.fr>
16692
16693 * src/lalr.h: New file.
16694 Propagate its inclusion instead of prototypes and `extern'.
16695 * src/lalr.c: Formatting changes, topological sorting etc.
16696
f2acea59
AD
166972000-10-02 Akim Demaille <akim@epita.fr>
16698
16699 * src/output.c (token_actions): Introduce a temporary array,
16700 YYDEFACT, that makes it possible for this function to use
16701 output_short_table.
16702
d019d655
AD
167032000-10-02 Akim Demaille <akim@epita.fr>
16704
16705 `user_toknums' is output as a `short[]' in `output.c', while it is
16706 defined as a `int[]' in `reader.c'. For consistency with the
16707 other output tables, `user_toknums' is now defined as a table of
16708 shorts.
16709
16710 * src/reader.c (user_toknums): Be a short table instead of an int
16711 table.
16712 Adjust dependencies.
16713
16714 Factor the short table outputs.
16715
16716 * src/output.c (output_short_table): New function.
16717 * src/output.c (output_gram, output_stos, output_rule_data)
16718 (output_base, output_table, output_check): Use it.
16719
6c89f1c1
AD
167202000-10-02 Akim Demaille <akim@epita.fr>
16721
16722 * src/output.c (output): Topological sort of the functions, in
16723 order to get rid of the `static' prototypes.
16724 No longer use `register'.
16725 * src/output.h: New file.
16726 Propagate its inclusion in files explicitly prototyping functions
16727 from output.c.
16728
d9efd181
AD
167292000-09-21 Akim Demaille <akim@epita.fr>
16730
16731 * src/atgeneral.m4: Update from Autoconf.
16732
c29240e7 167332000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
16734
16735 * src/closure.h: New file.
16736 * src/closure.c: Formatting changes, topological sort over the
16737 functions, use of closure.h.
16738 (initialize_closure, finalize_closure): Rename as...
16739 (new_closure, free_closure): these. Adjust dependencies.
16740 * src/LR0.c: Formatting changes, topological sort, use of
16741 cloture.h.
16742 (initialize_states): Rename as...
16743 (new_states): this.
16744 * src/Makefile.am (noinst_HEADERS): Adjust.
16745
499daa50
AD
167462000-09-20 Akim Demaille <akim@epita.fr>
16747
16748 * src/acconfig.h: Don't protect config.h against multiple
16749 inclusion.
16750 Don't define PARAMS.
16751 * src/system.h: Define PARAMS.
16752 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
16753 purpose of config.h. system.h must not try to fix wrong
16754 definitions in config.h.
16755
cc84fd5d
AD
167562000-09-20 Akim Demaille <akim@epita.fr>
16757
16758 * src/derives.h: New file.
16759 * src/main.c, src/derives.h: Use it.
16760 Formatting changes.
16761 * src/Makefile.am (noinst_HEADERS): Adjust.
16762
db5b3a89
AD
167632000-09-20 Akim Demaille <akim@epita.fr>
16764
16765 * tests/atgeneral.m4: Update from Autoconf.
16766 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
16767 (AT_CHECK_CALC): New macros.
16768 Use these macros to test bison with options `', `--raw',
16769 `--debug', `--yacc', `--yacc --debug'.
16770
ceed8467
AD
167712000-09-19 Akim Demaille <akim@epita.fr>
16772
16773 * src/output.c: Formatting changes.
16774 * src/machine.h: Remove, leaving its contents in...
16775 * src/system.h: here.
16776 Include stdio.h.
16777 Adjust all dependencies on stdio.h and machine.h.
16778 * src/getargs.h: New file.
16779 Let all `extern' declarations about getargs.c be replaced with
16780 inclusion of `getargs.h'.
16781 * src/Makefile.am (noinst_HEADERS): Adjust.
16782
16783 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16784 scope.
16785 (yyerror): Returns void, not int.
16786 * doc/bison.texinfo: Formatting changes.
16787
05a1d24b
AD
167882000-09-19 Akim Demaille <akim@epita.fr>
16789
16790 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16791 portable.
16792
cbd25751
AD
167932000-09-18 Akim Demaille <akim@epita.fr>
16794
16795 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16796 * src/Makefile.am (INCLUDES): Don't.
16797 Be ready to fetch headers in lib/.
16798
13863333
AD
167992000-09-18 Akim Demaille <akim@epita.fr>
16800
16801 * doc/bison.texinfo: Update the copyright.
16802 ANSIfy and GNUify the examples.
16803 Remove the old menu.
16804
0d533154
AD
168052000-09-18 Akim Demaille <akim@epita.fr>
16806
16807 First set of tests: use the `calc' example from the documentation.
16808
16809 * src/bison.s1 (yyparse): Condition the code using `yytname' which
16810 is defined only when YYDEBUG is.
16811 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
16812 * src/files.c (tryopen, tryclose): Formatting changes.
16813 Move to the top and be static.
16814 * src/reader.c (read_signed_integer): Likewise.
16815 * tests/calc.m4: New file.
16816 * Makefile.am, suite.m4: Adjust.
16817 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
16818
e79137ac
AD
168192000-09-18 Akim Demaille <akim@epita.fr>
16820
16821 Add support for an Autotest test suite for Bison.
16822
16823 * m4/m4.m4, m4/atconfig.m4: New files.
16824 * m4/Makefile.am (EXTRA_DIST): Adjust.
16825 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
16826 files.
16827 * src/getargs.c: Display a more standard --version message.
16828 * src/reader.c (reader): Formatting changes.
16829 No longer depend upon VERSION_STRING.
16830 * configure.in: No longer use `dnl'.
16831 Set up the test suite and the new directory `tests/.
16832 (VERSION_STRING): Remove.
16833
27821bff
AD
168342000-04-14 Akim Demaille <akim@epita.fr>
16835
16836 * src/reader.c (copy_comment2): New function, same as former
16837 `copy_comment', but outputs into two FILE *.
16838 (copy_comment): Use it.
16839 (parse_union_decl): Use it.
16840 (get_type, parse_start_decl): Use the same `invalid' message.
16841 (parse_start_decl, parse_union_decl): Use the same `multiple'
16842 message.
16843 (parse_union_decl, copy_guard, copy_action): Use the same
16844 `unmatched' message.
16845 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16846
cfe5fbc0
AD
168472000-03-31 Akim Demaille <akim@epita.fr>
16848
16849 * src/files.c (tryopen, tryclose): Move to the top.
16850 Be static.
16851
cb7db13e
AD
168522000-03-31 Akim Demaille <akim@epita.fr>
16853
16854 * src/main.c (main): Don't call `done', exit does it.
16855
a0f6b076
AD
168562000-03-31 Akim Demaille <akim@epita.fr>
16857
36281465
AD
16858 * allocate.c: s/return (foo)/return foo/.
16859 * lalr.c: Likewise.
16860 * LR0.c: Likewise.
16861 * output.c: Likewise.
16862 * reader.c: Likewise.
16863 * symtab.c: Likewise.
16864 * vmsgetargs.c: Likewise.
16865
168662000-03-31 Akim Demaille <akim@epita.fr>
16867
16868 Clean up the error reporting functions.
a0f6b076
AD
16869
16870 * src/report.c: New file.
16871 * src/report.h: Likewise.
16872 * src/Makefile.am: Adjust.
16873 * m4/error.m4: New file.
16874 * m4/Makefile.am: Adjust.
16875 * configure.in (jm_PREREQ_ERROR): Call it.
16876 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16877 Remove.
16878 (fatal, fatals): Remove. All callers use complain.c::fatal.
16879 (warn, warni, warns, warnss, warnss): Remove. All callers use
16880 complain.c::complain.
16881 (toomany): Remove, use fatal instead.
16882 * src/files.c (done): No argument, use complain_message_count.
16883 * src/main.c (main): Register `done' to `atexit'.
16884
16885 * src/getargs.c (usage): More `fputs', less `fprintf'.
16886
18539825
AD
168872000-03-28 Akim Demaille <akim@epita.fr>
16888
16889 * lib/: New directory.
16890 * Makefile.am (SUBDIRS): Adjust.
16891 * configure.in: Adjust.
16892 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16893 useless.
16894 * src/alloca.c: Moved to lib/.
16895 * src/getopt.c: Likewise.
16896 * src/getopt1.c: Likewise.
16897 * src/getopt.h: Likewise.
16898 * src/ansi2knr.c: Likewise.
16899 * src/ansi2knr.1: Likewise.
16900 * src/Makefile.am: Adjust.
16901 * lib/Makefile.am: New file.
16902
9f306f2a
AD
169032000-03-28 Akim Demaille <akim@epita.fr>
16904
16905 * src/getargs.c (usage): Refresh the help message.
16906
0ba347b6
AD
169072000-03-17 Akim Demaille <akim@epita.fr>
16908
16909 * src/getopt1.c: Updated from textutils 2.0e
16910 * src/getopt.c: Likewise.
16911 * src/getopt.h: Likewise.
16912
dbe7f271
AD
169132000-03-17 Akim Demaille <akim@epita.fr>
16914
16915 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16916 the file name, not the whole `#line LINE FILE'.
16917
75bbe78d
AD
169182000-03-17 Akim Demaille <akim@epita.fr>
16919
16920 On syntax errors, report the token on which we choked.
16921
aa5fd0ee
AD
16922 * src/bison.s1 (yyparse): In the label yyerrlab, when
16923 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 16924
7b306f52
AD
169252000-03-17 Akim Demaille <akim@epita.fr>
16926
aa5fd0ee 16927 * src/reader.c (copy_at): New function.
7b306f52
AD
16928 (copy_guard): Use it.
16929 (copy_action): Use it.
16930
e87b5700
AD
169312000-03-17 Akim Demaille <akim@epita.fr>
16932
16933 Be kind to translators, save some useless translations.
16934
aa5fd0ee 16935 * src/main.c (banner): New function.
e87b5700
AD
16936 (fatal_banner): Use it.
16937 (warn_banner): Use it.
16938
ae3c3164
AD
169392000-03-17 Akim Demaille <akim@epita.fr>
16940
aa5fd0ee
AD
16941 * src/reader.c (copy_definition): Use copy_string and
16942 copy_comment. Removed now unused `match', `ended',
16943 `cplus_comment'.
ae3c3164
AD
16944 (copy_comment, copy_string): Moved, to be visible from
16945 copy_definition.
16946
4dc58e7c
AD
169472000-03-17 Akim Demaille <akim@epita.fr>
16948
aa5fd0ee
AD
16949 * src/reader.c (copy_string): Declare `static inline'. No
16950 problems with inline, since it is checked by configure.
4dc58e7c
AD
16951 (copy_comment): Likewise.
16952
0a6384c4
AD
169532000-03-17 Akim Demaille <akim@epita.fr>
16954
aa5fd0ee 16955 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 16956
3cef001a
AD
169572000-03-17 Akim Demaille <akim@epita.fr>
16958
aa5fd0ee 16959 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
16960 (copy_action): Use it. Removed now unused `match', `ended',
16961 `cplus_comment'.
16962 (copy_guard): Likewise.
16963
ca36d2ef
AD
169642000-03-17 Akim Demaille <akim@epita.fr>
16965
aa5fd0ee 16966 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
16967 (copy_action): Use it.
16968 (copy_guard): Likewise.
16969
6666f98f
AD
169702000-03-17 Akim Demaille <akim@epita.fr>
16971
16972 Change the handling of @s so that they behave exactly like $s.
16973 There is now a pseudo variable @$ (readble and writable), location
16974 of the lhs of the rule (by default ranging from the location of
16975 the first symbol of the rhs, to the location of the last symbol,
16976 or, if the rhs is empty, YYLLOC).
16977
16978 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16979 yyval.
16980 (yyparse): When providing a default semantic action, provide a
16981 default location action.
16982 (after the $): No longer change `*YYLSP', just stack YYLOC the
16983 same way you stack YYVAL.
16984 * src/reader.c (read_declarations): Use warns.
16985 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16986 (copy_action, case '@'): Likewise.
16987 Use a standard error message, to save useless work from
16988 translators.
16989
41aca2e0
AD
169902000-03-17 Akim Demaille <akim@epita.fr>
16991
aa5fd0ee
AD
16992 * src/bison.s1: Formatting and cosmetics changes.
16993 * src/reader.c: Likewise.
41aca2e0
AD
16994 Update the Copyright notice.
16995
dc08c1d5
AD
169962000-03-17 Akim Demaille <akim@epita.fr>
16997
aa5fd0ee
AD
16998 * src/bison.s1 (#line): All set to `#line' only, since the
16999 Makefile now handles them.
dc08c1d5 17000
9ee3c97b
AD
170012000-03-16 Akim Demaille <akim@epita.fr>
17002
17003 * src/output.c (output_rule_data): Output the documentation of
17004 some of the tables.
17005 (Copyright notice): Update.
17006 Formatting changes.
17007
0de741ca
AD
170082000-03-16 Akim Demaille <akim@epita.fr>
17009
17010 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
17011 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
17012 One `#if YYDEBUG' remains, since it uses variables which are
17013 defined only if `YYDEBUG != 0'.
17014
bb10be54
AD
170152000-03-16 Akim Demaille <akim@epita.fr>
17016
17017 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
17018 and related variables so that the similarities are highlighted.
17019
b07b484a
AD
170202000-03-16 Akim Demaille <akim@epita.fr>
17021
17022 * src/bison.s1: Properly indent CPP directives.
17023
361f60b3
AD
170242000-03-16 Akim Demaille <akim@epita.fr>
17025
17026 * src/bison.s1: Properly indent the `alloca' CPP section.
17027
8c44d3ec
AD
170282000-03-16 Akim Demaille <akim@epita.fr>
17029
17030 Do not hard code values of directories in `configure.in'.
17031 Update the `configure' tool chain.
17032
17033 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
17034 src/makefile.am.
17035 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
17036 (AC_OUTPUT): Add m4/Makefile.
17037 Bump to bison 1.28a, 1.29 has never been released.
17038 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
17039 handled via src/Makefile.am.
17040 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
17041 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
17042 autoheader.
17043 * Makefile.am (SUBDIRS): Add m4.
17044 (ACLOCAL_AM_FLAGS): New variable.
17045 (AUTOMAKE_OPTIONS): Add check-news.
17046 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
17047 the proper line number and file name.
17048 (DEFS): Propagate the location of bison library files and of the
17049 locale files.
17050 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
17051 builddir.
17052 * acinclude.m4: Remove, replaced by the directory m4.
17053 * m4/Makefile.am (EXTRA_DIST): New variable.
17054 * m4/gettext.m4: New file, from the fileutils.
17055 * m4/lcmessage.m4: Likewise
17056 * m4/progtest.m4: Likewise.
17057 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
17058
f95997e7
AD
170592000-03-10 Akim Demaille <akim@epita.fr>
17060
17061 * src/closure.c:
17062 Formatting changes of various comments.
17063 Respect the GNU coding standards at various places.
17064 Don't use `_()' when no translation is needed.
17065
170661999-12-13 Jesse Thilo <jthilo@gnu.org>
17067
17068 * src/files.c:
17069 OS/2 honors TMPDIR environment variable.
17070
170711999-12-13 Jesse Thilo <jthilo@gnu.org>
17072
17073 * doc/bison.texinfo: Tweaked spelling and grammar.
17074 Updated ISBN.
17075 Removed reference to price of printed copy.
17076 Mention BISON_SIMPLE and BISON_HAIRY.
17077
170781999-12-13 Jesse Thilo <jthilo@gnu.org>
17079
17080 * configure.in, NEWS:
17081 Bison 1.29 released.
17082
170831999-10-27 Jesse Thilo <jthilo@gnu.org>
17084
17085 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
17086 Added reference card.
17087
170881999-07-26 Jesse Thilo <jthilo@gnu.org>
17089
17090 * po/ru.po: Added Russian translation.
17091
170921999-07-26 Jesse Thilo <jthilo@gnu.org>
17093
17094 * configure.in: Added Russian translation.
17095
170961999-07-06 Jesse Thilo <jthilo@gnu.org>
17097
17098 * configure.in, NEWS, README:
17099 Released version 1.28.
17100
171011999-06-14 Jesse Thilo <jthilo@gnu.org>
17102
17103 * src/system.h:
17104 Squashed redefinition warning on some systems.
17105
17106 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
17107 Have configure build version string instead of relying on ANSI string
17108 concatentation.
17109
171101999-06-14 Jesse Thilo <jthilo@gnu.org>
17111
17112 * po/POTFILES.in: Got rid of version.c.
17113
171141999-06-14 Jesse Thilo <jthilo@gnu.org>
17115
17116 * acconfig.h, configure.in:
17117 Have configure build version string instead of relying on ANSI string
17118 concatentation.
17119
171201999-06-08 Jesse Thilo <jthilo@gnu.org>
17121
17122 * doc/bison.1:
17123 Dropped mention of `+' for long-named options.
17124
171251999-05-30 Jesse Thilo <jthilo@gnu.org>
17126
17127 * src/files.c: Added <unistd.h> for unlink().
17128
17129 * src/Makefile.am, src/system.h:
17130 I18n fixes.
17131
171321999-05-30 Jesse Thilo <jthilo@gnu.org>
17133
17134 * README: Added a FAQ list.
17135
17136 * configure.in, acconfig.h:
17137 I18n fixes.
17138
171391999-05-30 Jesse Thilo <jthilo@gnu.org>
17140
17141 * doc/FAQ, doc/Makefile.am:
17142 Added a FAQ list.
17143
171441999-05-19 Jesse Thilo <jthilo@gnu.org>
17145
17146 * src/alloc.h, src/symtab.h, src/version.c:
17147 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17148
171491999-04-18 Jesse Thilo <jthilo@gnu.org>
17150
17151 * src/.cvsignore, src/Makefile.am:
17152 Reorganized: sources in `src', documentation in `doc'.
17153
17154 * src/lex.c (literalchar):
17155 fixed the code for escaping double quotes (thanks
17156 Jonathan Czisny.)
17157
171581999-04-18 Jesse Thilo <jthilo@gnu.org>
17159
17160 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17161 Adjusted paths to reflect directory reorganization.
17162
171631999-04-18 Jesse Thilo <jthilo@gnu.org>
17164
17165 * doc/.cvsignore, doc/Makefile.am:
17166 Reorganized: sources in `src', documentation in `doc'.
17167
171681999-04-18 Jesse Thilo <jthilo@gnu.org>
17169
17170 * configure.in:
17171 Updated AC_INIT file to reflect directory reorganization.
17172
17173 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17174 Reorganized: sources in `src', documentation in `doc'.
17175
171761999-04-13 Jesse Thilo <jthilo@gnu.org>
17177
17178 * src/allocate.c:
17179 Don't declare calloc() and realloc() if not necessary.
17180
171811999-04-13 Jesse Thilo <jthilo@gnu.org>
17182
17183 * configure.in, acconfig.h, acinclude.m4:
17184 Don't declare calloc() and realloc() if not necessary.
17185
171861999-03-23 Jesse Thilo <jthilo@gnu.org>
17187
17188 * po/.cvsignore: Added i18n support.
17189
171901999-03-23 Jesse Thilo <jthilo@gnu.org>
17191
17192 * acconfig.h, configure.in, Makefile.am:
17193 Added i18n support.
17194
171951999-03-22 Jesse Thilo <jthilo@gnu.org>
17196
17197 * src/bison.s1: Fixed #line numbers.
17198
171991999-03-15 Jesse Thilo <jthilo@gnu.org>
17200
17201 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17202 Added PO files from Translation Project.
17203
172041999-03-03 Jesse Thilo <jthilo@gnu.org>
17205
17206 * Makefile.am:
17207 Added support for non-ANSI compilers (ansi2knr).
17208
172091999-02-16 Jesse Thilo <jthilo@gnu.org>
17210
17211 * configure.in: Bumped version number to 1.27.
17212
17213 * Makefile.am:
17214 Added `bison.simple' to list of files removed by `make distclean'.
17215
172161999-02-12 Jesse Thilo <jthilo@gnu.org>
17217
17218 * src/files.c, src/files.h:
17219 Defined locations of parser files in config.h instead of Makefile.
17220
172211999-02-12 Jesse Thilo <jthilo@gnu.org>
17222
17223 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17224 Defined locations of parser files in config.h instead of Makefile.
17225
172261999-02-09 Jesse Thilo <jthilo@gnu.org>
17227
17228 * Makefile.am:
17229 Removed inappropriate use of $< macro.
17230
172311999-02-05 Jesse Thilo <jthilo@gnu.org>
17232
17233 * po/Makefile.in.in, po/POTFILES.in:
17234 Add `po' directory skeleton.
17235
172361999-01-27 Jesse Thilo <jthilo@gnu.org>
17237
17238 * README: Document help-bison list.
17239
17240 * configure.in: Add check for mkstemp().
17241
172421999-01-20 Jesse Thilo <jthilo@gnu.org>
17243
17244 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17245 Hush a few compiler warnings.
17246
17247 * src/files.c:
17248 Add tryclose(), which verifies that fclose was successful.
17249 Hush a couple of compiler warnings.
17250
172511999-01-20 Jesse Thilo <jthilo@gnu.org>
17252
17253 * Makefile.am, OChangeLog:
17254 ChangeLog is now automatically generated. Include the old version as
17255 OChangeLog.
17256
172571999-01-14 Jesse Thilo <jthilo@gnu.org>
17258
17259 * 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:
17260 Update FSF address.
17261
172621999-01-14 Jesse Thilo <jthilo@gnu.org>
17263
17264 * doc/bison.texinfo: Fix formatting glitch.
17265
17266 * doc/bison.texinfo: Update FSF address.
17267
172681999-01-14 Jesse Thilo <jthilo@gnu.org>
17269
17270 * acconfig.h: Update FSF address.
17271
172721999-01-08 Jesse Thilo <jthilo@gnu.org>
17273
17274 * src/system.h:
17275 Don't define PACKAGE here, since config.h defines it.
17276
172771998-12-30 Jesse Thilo <jthilo@gnu.org>
17278
17279 * src/reader.c: Update copyright date.
17280
17281 * src/main.c:
17282 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17283 favor of output directly to stderr (avoids buffer overruns).
17284
17285 * src/reader.c: Some checks for premature EOF.
17286
17287 * 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:
17288 Use prototypes if the compiler understands them.
17289
17290 * src/files.c: Honor TMPDIR on Unix hosts.
17291 Use prototypes if the compiler understands them.
17292
17293 * src/reader.c:
17294 Fix a couple of buffer overrun bugs.
17295 Use prototypes if the compiler understands them.
17296
17297 * src/system.h: Include unistd.h and ctype.h.
17298 Use #ifdef instead of #if for NLS symbols.
17299
173001998-12-30 Jesse Thilo <jthilo@gnu.org>
17301
17302 * doc/bison.texinfo:
17303 Delete comment "consider using @set for edition number, etc..." since
17304 we now are doing so.
17305
173061998-12-30 Jesse Thilo <jthilo@gnu.org>
17307
17308 * configure.in:
17309 Use prototypes if the compiler understands them.
17310
17311 * NEWS: Document 1.26 highlights.
17312
17313 * Makefile.am: Require Automake 1.3 or later.
17314
17315 * acconfig.h:
17316 Use prototypes if the compiler understands them.
17317
173181998-12-29 Jesse Thilo <jthilo@gnu.org>
17319
17320 * src/version.c:
17321 Use VERSION symbol from automake for version number.
17322
173231998-12-29 Jesse Thilo <jthilo@gnu.org>
17324
17325 * acconfig.h, configure.in, version.cin:
17326 Use VERSION symbol from automake for version number.
17327
173281998-11-28 Jesse Thilo <jthilo@gnu.org>
17329
17330 * Makefile.am:
17331 Distribute original version of simple parser (bison.s1), not built
17332 version (bison.simple).
17333
173341998-11-28 Jesse Thilo <jthilo@gnu.org>
17335
17336 * doc/bison.texinfo: Add info dir entry.
17337
17338 * doc/bison.texinfo:
17339 Let automake put version number into documentation.
17340
173411998-11-26 Jesse Thilo <jthilo@gnu.org>
17342
17343 * src/bison.cld, src/build.com, src/vmshlp.mar:
17344 Add non-RCS files from /gd/gnu/bison.
17345
173461998-11-26 Jesse Thilo <jthilo@gnu.org>
17347
17348 * doc/bison.1:
17349 Document the BISON_HAIRY and BISON_SIMPLE variables.
17350
173511998-11-25 Jesse Thilo <jthilo@gnu.org>
17352
17353 * src/version.c: Build version.c automatically.
17354
17355 * src/reader.c:
17356 Fix token numbering (used to start at 258, not 257).
17357
17358 * src/system.h: Include config.h.
17359
17360 * src/getargs.c: Update bug report address.
17361
17362 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17363 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17364
173651998-11-25 Jesse Thilo <jthilo@gnu.org>
17366
17367 * Makefile.am:
17368 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17369
17370 * configure.in, version.cin:
17371 Build version.c automatically.
17372
17373 * AUTHORS: Add AUTHORS file.
17374
17375 * README: Update bug report address.
17376
17377 * bison.simple:
17378 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17379
17380 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17381 Add automake stuff.
17382
173831998-11-25 Jesse Thilo <jthilo@gnu.org>
17384
17385 * doc/bison.texinfo: Clean up some formatting.
17386
173871998-05-05 Richard Stallman <rms@gnu.org>
17388
17389 * doc/bison.texinfo:
17390 Explain better why to make a pure parser.
17391
173921998-01-05 Richard Stallman <rms@gnu.org>
17393
17394 * src/files.c (openfiles):
17395 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17396 find a temporary directory, if possible. Do not unlink files while
17397 they are open.
17398
173991997-08-25 Richard Stallman <rms@gnu.org>
17400
17401 * src/reader.c (stack_offset;):
17402 Change some warni to warns.
17403
17404 * src/lex.c (literalchar): Use warns, not warni.
17405
174061997-06-28 Richard Stallman <rms@gnu.org>
17407
17408 * src/bison.s1: Add a Bison version comment.
17409
17410 * src/main.c (fatal, warn, berror):
17411 Use program_name.
17412
174131997-06-28 Richard Stallman <rms@gnu.org>
17414
17415 * Makefile.in (bison_version): New variable.
17416 (dist): Use that variable.
17417 (bison.s1): Substitute the Bison version into bison.simple.
17418
17419 * bison.simple: Add a Bison version comment.
17420
174211997-06-18 Richard Stallman <rms@gnu.org>
17422
17423 * src/main.c (fatal, warn, berror):
17424 Make error messages standard.
17425 (toomany): Improve error message text.
17426
17427 * 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:
17428 new.h renamed to alloc.h.
17429
174301997-06-18 Richard Stallman <rms@gnu.org>
17431
17432 * Makefile.in: new.h renamed to alloc.h.
17433
174341997-05-24 Richard Stallman <rms@gnu.org>
17435
17436 * src/lex.c (literalchar):
17437 Fix the code for escaping \, " and '.
17438
17439 (lex): Avoid trouble when there are many chars
17440 to discard in a char literal with just several chars in it.
17441
174421997-05-17 Richard Stallman <rms@gnu.org>
17443
17444 * src/bison.s1:
17445 Use malloc, if using alloca is troublesome.
17446 (YYSTACK_USE_ALLOCA): New flag macro.
17447 Define it for some systems and compilers.
17448 (YYSTACK_ALLOC): New macro.
17449 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17450 If it was malloc'd, free it.
17451
174521997-05-17 Richard Stallman <rms@gnu.org>
17453
17454 * bison.simple:
17455 Use malloc, if using alloca is troublesome.
17456 (YYSTACK_USE_ALLOCA): New flag macro.
17457 Define it for some systems and compilers.
17458 (YYSTACK_ALLOC): New macro.
17459 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17460 If it was malloc'd, free it.
17461
174621997-04-23 Richard Stallman <rms@gnu.org>
17463
17464 * src/bison.s1:
17465 (alloca) [__hpux]: Always define as __builtin_alloca.
17466
174671997-04-23 Richard Stallman <rms@gnu.org>
17468
17469 * bison.simple:
17470 (alloca) [__hpux]: Always define as __builtin_alloca.
17471
174721997-04-22 Richard Stallman <rms@gnu.org>
17473
17474 * src/bison.s1:
17475 [__hpux]: Include alloca.h (right for HPUX 10)
17476 instead of declaring alloca (right for HPUX 9).
17477
17478 * src/bison.s1 (__yy_memcpy):
17479 Declare arg `count' as unsigned int.
17480 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17481
174821997-04-22 Richard Stallman <rms@gnu.org>
17483
17484 * bison.simple:
17485 [__hpux]: Include alloca.h (right for HPUX 10)
17486 instead of declaring alloca (right for HPUX 9).
17487
17488 * bison.simple (__yy_memcpy):
17489 Declare arg `count' as unsigned int.
17490 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17491
174921997-01-03 Richard Stallman <rms@gnu.org>
17493
17494 * src/allocate.c: [__STDC__ or _MSC_VER]:
17495 Declare calloc and realloc to return void *.
17496
174971997-01-02 Richard Stallman <rms@gnu.org>
17498
17499 * src/system.h:
17500 [_MSC_VER]: Include stdlib.h and process.h.
17501 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17502
17503 * src/main.c (main): Return FAILURE as a value.
17504 (printable_version): Declare arg as int, not char.
17505
175061997-01-02 Richard Stallman <rms@gnu.org>
17507
17508 * Makefile.in (dist):
17509 Explicitly check for symlinks, and copy them.
17510
175111996-12-19 Richard Stallman <rms@gnu.org>
17512
17513 * src/files.c:
17514 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17515
175161996-12-18 Paul Eggert <eggert@gnu.org>
17517
17518 * src/bison.s1 (yyparse):
17519 If __GNUC__ and YYPARSE_PARAM are both defined,
17520 declare yyparse to have a void * argument.
17521
175221996-12-18 Paul Eggert <eggert@gnu.org>
17523
17524 * bison.simple (yyparse):
17525 If __GNUC__ and YYPARSE_PARAM are both defined,
17526 declare yyparse to have a void * argument.
17527
175281996-12-17 Richard Stallman <rms@gnu.org>
17529
17530 * src/reduce.c (nbits): Add some casts.
17531
175321996-08-12 Richard Stallman <rms@gnu.org>
17533
17534 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17535
175361996-08-12 Richard Stallman <rms@gnu.org>
17537
17538 * bison.simple: Test _MSDOS as well as _MSDOS_.
17539
175401996-07-31 Richard Stallman <rms@gnu.org>
17541
17542 * src/bison.s1:
17543 [__sun && __i386]: Include alloca.h.
17544
175451996-07-31 Richard Stallman <rms@gnu.org>
17546
17547 * bison.simple:
17548 [__sun && __i386]: Include alloca.h.
17549
175501996-07-30 Richard Stallman <rms@gnu.org>
17551
17552 * src/bison.s1: Comment change.
17553
17554 * src/bison.s1: Test _MSDOS_, not MSDOS.
17555
175561996-07-30 Richard Stallman <rms@gnu.org>
17557
17558 * bison.simple: Comment change.
17559
17560 * bison.simple: Test _MSDOS_, not MSDOS.
17561
175621996-06-01 Richard Stallman <rms@gnu.org>
17563
17564 * 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:
17565 Insert `_' macro around many string constants.
17566
17567 * src/main.c:
17568 Insert `_' macro around many string constants.
17569
17570 (main): Call setlocale, bindtextdomain and textdomain.
17571
17572 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17573 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17574 [ENABLE_NLS]: Include libintl.h.
17575 [ENABLE_NLS] (gettext): Define.
17576 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17577 (N_, PACKAGE, LOCALEDIR): New macros.
17578
175791996-06-01 Richard Stallman <rms@gnu.org>
17580
17581 * POTFILES.in: New file.
17582
17583 * Makefile.in (allocate.o):
17584 Define target explicitly.
17585
17586 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17587 (LDFLAGS): Set to @LDFLAGS@.
17588 (configure): Run autoconf only if preceding `cd' succeeds.
17589 (bison.s1): Redirect output to temporary file then move the
17590 temporary to the target, rather than redirecting directly to bison.s1.
17591 (clean): Remove config.status and config.log.
17592 (distclean): Don't remove config.status here.
17593
175941996-05-12 Richard Stallman <rms@gnu.org>
17595
17596 * src/bison.s1:
17597 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17598
175991996-05-12 Richard Stallman <rms@gnu.org>
17600
17601 * bison.simple:
17602 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17603
176041996-05-11 Richard Stallman <rms@gnu.org>
17605
17606 * src/bison.s1 (__yy_memcpy):
17607 Really reorder the args, as was supposedly done on Feb 14 1995.
17608 (yyparse): Calls changed accordingly.
17609
176101996-05-11 Richard Stallman <rms@gnu.org>
17611
17612 * Makefile.in (dist): Don't use $(srcdir).
17613
17614 * bison.simple (__yy_memcpy):
17615 Really reorder the args, as was supposedly done on Feb 14 1995.
17616 (yyparse): Calls changed accordingly.
17617
176181996-01-27 Richard Stallman <rms@gnu.org>
17619
17620 * src/output.c (output_rule_data):
17621 Test YYERROR_VERBOSE in the conditional
17622 around the definition of ttyname.
17623
176241995-12-29 Richard Stallman <rms@gnu.org>
17625
17626 * src/bison.s1:
17627 Fix line numbers in #line commands.
17628
176291995-12-29 Richard Stallman <rms@gnu.org>
17630
17631 * bison.simple:
17632 Fix line numbers in #line commands.
17633
176341995-12-27 Richard Stallman <rms@gnu.org>
17635
17636 * src/bison.s1 (YYPARSE_PARAM_DECL):
17637 In C++, make it always null.
17638 (YYPARSE_PARAM_ARG): New macro.
17639 (yyparse): Use YYPARSE_PARAM_ARG.
17640
176411995-12-27 Richard Stallman <rms@gnu.org>
17642
17643 * bison.simple (YYPARSE_PARAM_DECL):
17644 In C++, make it always null.
17645 (YYPARSE_PARAM_ARG): New macro.
17646 (yyparse): Use YYPARSE_PARAM_ARG.
17647
176481995-11-29 Richard Stallman <rms@gnu.org>
17649
17650 * doc/bison.texinfo:
17651 Describe literal string tokens, %raw, %no_lines, %token_table.
17652
176531995-11-29 Daniel Hagerty <hag@gnu.org>
17654
17655 * doc/bison.texinfo: Fixed update date
17656
176571995-10-16 Richard Stallman <rms@gnu.org>
17658
17659 * src/version.c: Version 1.25.
17660
176611995-10-16 Richard Stallman <rms@gnu.org>
17662
17663 * NEWS: *** empty log message ***
17664
176651995-10-16 Richard Stallman <rms@gnu.org>
17666
17667 * doc/bison.1, doc/bison.rnh:
17668 Add new options.
17669
176701995-10-15 Richard Stallman <rms@gnu.org>
17671
17672 * src/vmsgetargs.c, src/getargs.c:
17673 Added -n, -k, and -raw switches.
17674 (noparserflag, toknumflag, rawtoknumflag): New variables.
17675
17676 * src/symtab.h (SALIAS):
17677 New #define for adding aliases to %token.
17678 (struct bucket): Added `alias' field.
17679
17680 * src/reduce.c (reduce_grammar):
17681 Revise error message.
17682 (print_notices): Remove final `.' from error message.
17683
17684 * src/reader.c (reader_output_yylsp):
17685 New function.
17686 (readgram): Use `#if 0' around code that accepted %command
17687 inside grammar rules: The documentation doesn't allow it,
17688 and it will fail since the %command processors scan for the next %.
17689 (parse_token_decl): Extended the %token
17690 declaration to allow a multi-character symbol as an alias.
17691 (parse_thong_decl): New function.
17692 (read_declarations): Added %thong declarations.
17693 (read_declarations): Handle NOOP to deal with allowing
17694 % declarations as another means to specify the flags.
17695 (readgram): Allow %prec prior to semantics embedded in a rule.
17696 (skip_to_char, read_declarations, copy_definition)
17697 (parse_token_decl, parse_start_decl, parse_type_decl)
17698 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17699 (get_type_name, copy_guard, copy_action, readgram)
17700 (get_type, packsymbols): Revised most error messages.
17701 Changed `fatal' to `warnxxx' to avoid aborting for error.
17702 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17703 (read_declarations): Improve the error message for
17704 an invalid character. Do not abort.
17705 (read_declarations, copy_guard, copy_action): Use
17706 printable_version to avoid unprintable characters in printed output.
17707 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
17708 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
17709 Allow the type of a non-terminal can be given
17710 more than once, as long as all specifications give the same type.
17711
17712 * src/output.c:
17713 (output_headers, output_trailers, output, output_gram)
17714 (output_rule_data): Implement noparserflag variable.
17715 Implement toknumflag variable.
17716 (output): Call reader_output_yylsp to output LTYPESTR.
17717
17718 * src/main.c (main):
17719 If reader sees an error, don't process the grammar.
17720 (fatals): Updated to not use VARARGS1.
17721 (printable_version, int_to_string, warn, warni, warns, warnss)
17722 (warnsss): New error reporting functions. Avoid abort for error.
17723
17724 * src/lex.h:
17725 Added THONG and NOOP for alias processing.
17726 Added SETOPT for the new code that allows setting options with %flags.
17727
17728 * src/lex.c:
17729 Include getopt.h. Add some extern decls.
17730 (safegetc): New function to deal with EOF gracefully.
17731 (literalchar); new function to deal with reading \ escapes.
17732 (lex): Use literalchar.
17733 (lex): Implemented "..." tokens.
17734 (literalchar, lex, parse_percent_token): Made tokenbuffer
17735 always contain the token. This includes growing the token
17736 buffer while reading an integer.
17737 (parse_percent_token): Replaced if-else statement with percent_table.
17738 (parse_percent_token): Added % declarations as another
17739 way to specify the flags -n, -l, and -r. Also added hooks for
17740 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
17741 major changes to files.c.
17742 (lex) Retain in the incoming stream a character following
17743 an incorrect '/'.
17744 (skip_white_space, lex): Revised most error messages
17745 and changed fatal to warn to avoid aborting.
17746 (percent_table): Added %thong declarations.
17747
17748 * src/gram.h: Comment changes.
17749
17750 * src/files.c (openfiles, open_extra_files, done):
17751 Add faction flag
17752 and actfile file. Handle noparserflag. Both for -n switch.
17753
17754 * src/conflicts.c (resolve_sr_conflict):
17755 Remove use of alloca.
17756
177571995-06-01 Jim Meyering <meyering@gnu.org>
17758
17759 * doc/bison.texinfo: *** empty log message ***
17760
177611995-05-06 Richard Stallman <rms@gnu.org>
17762
17763 * src/bison.s1: Comment change.
17764
177651995-05-06 Richard Stallman <rms@gnu.org>
17766
17767 * bison.simple: Comment change.
17768
177691995-05-03 Richard Stallman <rms@gnu.org>
17770
17771 * src/version.c: Version now 1.24.
17772
17773 * src/bison.s1: Change distribution terms.
17774
17775 * src/version.c: Version now 1.23.
17776
177771995-05-03 Richard Stallman <rms@gnu.org>
17778
17779 * doc/bison.texinfo:
17780 Rewrite "Conditions for Using Bison".
17781 Update version to 1.24.
17782
177831995-05-03 Richard Stallman <rms@gnu.org>
17784
17785 * bison.simple: Change distribution terms.
17786
177871995-02-23 Richard Stallman <rms@gnu.org>
17788
17789 * src/files.c: Test __VMS_POSIX as well as VMS.
17790
177911995-02-14 Jim Meyering <meyering@gnu.org>
17792
17793 * src/bison.s1 (__yy_memcpy):
17794 Renamed from __yy_bcopy to avoid
17795 confusion. Reverse FROM and TO arguments to be consistent with
17796 those of memcpy.
17797
177981995-02-14 Jim Meyering <meyering@gnu.org>
17799
17800 * bison.simple (__yy_memcpy):
17801 Renamed from __yy_bcopy to avoid
17802 confusion. Reverse FROM and TO arguments to be consistent with
17803 those of memcpy.
17804
178051994-11-10 David J. MacKenzie <djm@gnu.org>
17806
17807 * NEWS: reformat
17808
17809 * NEWS: New file.
17810
17811 * Makefile.in (DISTFILES): Include NEWS.
17812
17813 * Makefile.in (DISTFILES):
17814 Include install-sh, not install.sh.
17815
17816 * configure.in: Update to Autoconf v2 macro names.
17817
178181994-10-05 David J. MacKenzie <djm@gnu.org>
17819
17820 * Makefile.in: fix typo
17821
17822 * Makefile.in (prefix, exec_prefix):
17823 Let configure set them.
17824
178251994-09-28 David J. MacKenzie <djm@gnu.org>
17826
17827 * Makefile.in: Set datadir to $(prefix)/share.
17828
178291994-09-15 Richard Stallman <rms@gnu.org>
17830
17831 * src/bison.s1:
17832 Update copyright notice and GPL version.
17833
178341994-09-15 Richard Stallman <rms@gnu.org>
17835
17836 * bison.simple:
17837 Update copyright notice and GPL version.
17838
178391994-07-12 Richard Stallman <rms@gnu.org>
17840
17841 * src/reduce.c, src/reader.c:
17842 entered into RCS
17843
178441994-05-05 David J. MacKenzie <djm@gnu.org>
17845
17846 * Makefile.in: entered into RCS
17847
178481994-03-26 Richard Stallman <rms@gnu.org>
17849
17850 * src/bison.s1: entered into RCS
17851
178521994-03-26 Richard Stallman <rms@gnu.org>
17853
17854 * bison.simple: entered into RCS
17855
178561994-03-25 Richard Stallman <rms@gnu.org>
17857
17858 * src/main.c: entered into RCS
17859
178601994-03-24 Richard Stallman <rms@gnu.org>
17861
17862 * src/conflicts.c: entered into RCS
17863
178641994-01-02 Richard Stallman <rms@gnu.org>
17865
17866 * Makefile.in: *** empty log message ***
17867
178681993-11-21 Richard Stallman <rms@gnu.org>
17869
17870 * src/bison.s1: *** empty log message ***
17871
178721993-11-21 Richard Stallman <rms@gnu.org>
17873
17874 * doc/bison.texinfo: entered into RCS
17875
17876 * doc/bison.texinfo: *** empty log message ***
17877
178781993-11-21 Richard Stallman <rms@gnu.org>
17879
17880 * bison.simple: *** empty log message ***
17881
178821993-10-25 David J. MacKenzie <djm@gnu.org>
17883
17884 * doc/bison.texinfo: *** empty log message ***
17885
178861993-10-19 Richard Stallman <rms@gnu.org>
17887
17888 * src/bison.s1: *** empty log message ***
17889
178901993-10-19 Richard Stallman <rms@gnu.org>
17891
17892 * bison.simple: *** empty log message ***
17893
178941993-10-14 Richard Stallman <rms@gnu.org>
17895
17896 * src/bison.s1: *** empty log message ***
17897
178981993-10-14 Richard Stallman <rms@gnu.org>
17899
17900 * bison.simple: *** empty log message ***
17901
179021993-09-14 David J. MacKenzie <djm@gnu.org>
17903
17904 * doc/bison.texinfo: *** empty log message ***
17905
179061993-09-13 Noah Friedman <friedman@gnu.org>
17907
17908 * Makefile.in: *** empty log message ***
17909
179101993-09-10 Richard Stallman <rms@gnu.org>
17911
17912 * src/conflicts.c: *** empty log message ***
17913
17914 * src/system.h: entered into RCS
17915
179161993-09-10 Richard Stallman <rms@gnu.org>
17917
17918 * doc/bison.1: entered into RCS
17919
179201993-09-06 Noah Friedman <friedman@gnu.org>
17921
17922 * src/version.c: entered into RCS
17923
179241993-09-06 Noah Friedman <friedman@gnu.org>
17925
17926 * Makefile.in: *** empty log message ***
17927
179281993-07-30 David J. MacKenzie <djm@gnu.org>
17929
17930 * Makefile.in: *** empty log message ***
17931
179321993-07-24 Richard Stallman <rms@gnu.org>
17933
17934 * src/bison.s1: *** empty log message ***
17935
179361993-07-24 Richard Stallman <rms@gnu.org>
17937
17938 * bison.simple: *** empty log message ***
17939
179401993-07-08 David J. MacKenzie <djm@gnu.org>
17941
17942 * Makefile.in: *** empty log message ***
17943
179441993-07-04 Richard Stallman <rms@gnu.org>
17945
17946 * src/bison.s1: *** empty log message ***
17947
179481993-07-04 Richard Stallman <rms@gnu.org>
17949
17950 * bison.simple: *** empty log message ***
17951
179521993-06-26 David J. MacKenzie <djm@gnu.org>
17953
17954 * src/getargs.c: entered into RCS
17955
179561993-06-26 David J. MacKenzie <djm@gnu.org>
17957
17958 * doc/bison.texinfo: *** empty log message ***
17959
17960 * doc/bison.1: New file.
17961
179621993-06-25 Richard Stallman <rms@gnu.org>
17963
17964 * src/getargs.c: New file.
17965
179661993-06-16 Richard Stallman <rms@gnu.org>
17967
17968 * src/bison.s1: *** empty log message ***
17969
179701993-06-16 Richard Stallman <rms@gnu.org>
17971
17972 * bison.simple: *** empty log message ***
17973
179741993-06-03 Richard Stallman <rms@gnu.org>
17975
17976 * src/bison.s1: New file.
17977
179781993-06-03 Richard Stallman <rms@gnu.org>
17979
17980 * doc/bison.texinfo: *** empty log message ***
17981
179821993-06-03 Richard Stallman <rms@gnu.org>
17983
17984 * bison.simple: New file.
17985
179861993-05-19 Richard Stallman <rms@gnu.org>
17987
17988 * doc/bison.texinfo: New file.
17989
179901993-05-07 Noah Friedman <friedman@gnu.org>
17991
17992 * Makefile.in: *** empty log message ***
17993
179941993-04-28 Noah Friedman <friedman@gnu.org>
17995
17996 * src/reader.c: *** empty log message ***
17997
179981993-04-23 Noah Friedman <friedman@gnu.org>
17999
18000 * src/alloc.h: entered into RCS
18001
180021993-04-20 David J. MacKenzie <djm@gnu.org>
18003
18004 * src/version.c: *** empty log message ***
18005
18006 * src/files.c, src/allocate.c:
18007 entered into RCS
18008
18009 * src/reader.c: *** empty log message ***
18010
18011 * src/lex.c: entered into RCS
18012
18013 * src/conflicts.c: New file.
18014
18015 * src/symtab.c: entered into RCS
18016
18017 * src/alloc.h: New file.
18018
18019 * src/LR0.c: entered into RCS
18020
180211993-04-18 Noah Friedman <friedman@gnu.org>
18022
18023 * src/reader.c: New file.
18024
18025 * src/version.c: *** empty log message ***
18026
180271993-04-18 Noah Friedman <friedman@gnu.org>
18028
18029 * Makefile.in: *** empty log message ***
18030
180311993-04-17 Noah Friedman <friedman@gnu.org>
18032
18033 * Makefile.in: *** empty log message ***
18034
180351993-04-15 Richard Stallman <rms@gnu.org>
18036
18037 * src/main.c, src/files.c:
18038 New file.
18039
180401993-04-15 Noah Friedman <friedman@gnu.org>
18041
18042 * configure.in: entered into RCS
18043
18044 * configure.in: *** empty log message ***
18045
18046 * configure.in: New file.
18047
180481993-04-14 Richard Stallman <rms@gnu.org>
18049
18050 * Makefile.in: New file.
18051
180521993-04-13 Richard Stallman <rms@gnu.org>
18053
18054 * src/version.c: New file.
18055
180561993-03-25 Richard Stallman <rms@gnu.org>
18057
18058 * src/output.c: entered into RCS
18059
180601992-09-25 Richard Stallman <rms@gnu.org>
18061
18062 * configure.bat: entered into RCS
18063
180641992-06-22 Richard Stallman <rms@gnu.org>
18065
18066 * src/vmsgetargs.c: entered into RCS
18067
180681992-06-22 Richard Stallman <rms@gnu.org>
18069
18070 * doc/bison.rnh: entered into RCS
18071
180721992-04-20 David J. MacKenzie <djm@gnu.org>
18073
18074 * README: entered into RCS
18075
180761992-01-22 Richard Stallman <rms@gnu.org>
18077
18078 * src/machine.h: entered into RCS
18079
180801991-12-21 Richard Stallman <rms@gnu.org>
18081
18082 * src/lalr.c, src/closure.c:
18083 entered into RCS
18084
180851991-12-20 Richard Stallman <rms@gnu.org>
18086
18087 * src/state.h: entered into RCS
18088
180891991-12-18 Richard Stallman <rms@gnu.org>
18090
18091 * src/print.c, src/nullable.c, src/derives.c:
18092 entered into RCS
18093
180941991-11-03 David J. MacKenzie <djm@gnu.org>
18095
18096 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
18097 entered into RCS
18098
180991988-09-09 Richard Stallman <rms@gnu.org>
18100
18101 * src/bison.hairy: entered into RCS
18102
181031987-12-16 Richard Stallman <rms@gnu.org>
18104
18105 * REFERENCES: entered into RCS
dc546b0f 18106
f294a2c2 18107
04098407 18108 -----
f294a2c2 18109
04098407 18110 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e2a21b6f
PE
18111 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
18112 Software Foundation, Inc.
f294a2c2 18113
04098407
PE
18114 Copying and distribution of this file, with or without
18115 modification, are permitted provided the copyright notice and this
18116 notice are preserved.
e9071366
AD
18117
18118$Id$