]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
(_AT_DATA_CALC_Y): Remove unused strcat declaration.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-10-24 Akim Demaille <akim@epita.fr>
2
3 * src/output.c (output_skeleton): Don't disable M4sugar comments
4 too soon: it results in comments being expanded.
5 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
6 first output.
7
82002-10-24 Akim Demaille <akim@epita.fr>
9
10 * data/yacc.c (m4_int_type): New.
11 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
12 char' as only yacc.c wants K&R portability.
13 * data/glr.c (yysigned_char): Remove.
14 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15 Reported by Quoc Peyrot.
16
172002-10-23 Paul Eggert <eggert@twinsun.com>
18
19 * src/main.c (main): With --trace=time, report times even if a
20 non-fatal error occurs. Formerly, the times were reported in some
21 such cases but not in others.
22 * src/reader.c (reader): Just return if a complaint has been issued,
23 instead of exiting, so that 'main' can report times.
24
252002-10-22 Akim Demaille <akim@epita.fr>
26
27 * src/system.h: Include sys/types.
28 Reported by Bert Deknuydt.
29
302002-10-23 Paul Eggert <eggert@twinsun.com>
31
32 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
33 Suggested by Art Haas.
34
352002-10-22 Paul Eggert <eggert@twinsun.com>
36
37 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
38 decl; not needed any more.
39 * src/main.c (main): Use return to exit, undoing yesterday's change.
40 The last OS that we could find where this wouldn't work is
41 SunOS 3.5, and that's too old to worry about now.
42
43 * data/glr.c (struct yyltype): Define members even when not
44 doing locations. This is more consistent with yacc.c, and it
45 works around the following bug reports:
46 http://mail.gnu.org/pipermail/bug-bison/2002-October/001764.html
47 http://mail.gnu.org/pipermail/bug-bison/2002-October/001769.html
48 and I hope it also fixes this bug report:
49 http://mail.gnu.org/pipermail/bug-bison/2002-October/001748.html
50
51 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
52 @acronym consistently. Standardize on "Yacc" instead of "YACC",
53 "Algol" instead of "ALGOL". Give a bit more history about BNF.
54
552002-10-22 Akim Demaille <akim@epita.fr>
56
57 * data/README: New.
58
592002-10-21 Paul Eggert <eggert@twinsun.com>
60
61 Be consistent about 'bool'; the old code used an enum in one
62 module and an int in another, and this violates the C standard.
63 * m4/stdbool.m4: New file, from coreutils 4.5.3.
64 * configure.ac (AC_HEADER_STDBOOL): Add.
65 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
66 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
67 * src/symtab.c (hash_compare_symbol_t): Likewise.
68 * src/system.h (bool, false, true): Use a definition consistent
69 with ../lib/hash.c. All uses changed.
70
71 * src/complain.c (warning_issued): Renamed from warn_message_count,
72 so that we needn't worry about integer overflow (!).
73 Now of type bool. All uses changed.
74 (complaint_issued): Renamed from complain_message_count; likewise.
75
76 * src/main.c (main): Use exit to exit with failure.
77
78 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
79 rather than 1 and 0.
80 * src/main.c (main): Likewise.
81 * src/getargs.c (getargs): Likewise.
82 * src/reader.c (reader): Likewise.
83
84 * src/getarg.c (getargs): Remove duplicate code for
85 "Try `bison --help'".
86
87 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
88 What was that "2" for?
89
90 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
91 * src/getargs.c (usage): Likewise.
92
93 * src/getargs.c (getargs): When there are too few operands, report
94 the last one. When there are too many, report the first extra
95 one. This is how diffutils does it.
96
972002-10-20 Paul Eggert <eggert@twinsun.com>
98
99 Remove K&R vestiges.
100 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
101 * src/complain.c (VA_START): Remove. Assume prototypes.
102 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
103 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
104 fatal): Assume prototypes.
105 * src/complain.h: Assume prototypes.
106 * src/system.h (PARAMS): Remove.
107 Include <limits.h> unconditionally, since it's guaranteeed even
108 for a freestanding C89 compiler.
109 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
110 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
111
1122002-10-20 Akim Demaille <akim@epita.fr>
113
114 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
115 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
116 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
117 (yyresolveStates, yyresolveAction, yyresolveStack)
118 (yyprocessOneStack): Use them.
119 (yy_reduce_print): New.
120 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
121
1222002-10-20 Akim Demaille <akim@epita.fr>
123
124 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
125 arguments and output `void'.
126 (b4_c_function): Rename as...
127 (b4_c_function_def): this.
128 (b4_c_function_decl, b4_c_ansi_function_def)
129 (b4_c_ansi_function_decl): New.
130 Change the interpretation of the arguments: before `int, foo', now
131 `int foo, foo'.
132 * data/yacc.c (yyparse): Prototype and define thanks to these.
133 Adjust b4_c_function_def uses.
134 * data/glr.c (yyparse): Likewise, but ANSI only.
135
1362002-10-20 Akim Demaille <akim@epita.fr>
137
138 * src/output.c (prepare): Move the definition of `tokens_number',
139 `nterms_number', `undef_token_number', `user_token_number_max'
140 to...
141 (prepare_tokens): Here.
142 (prepare_tokens): Rename as...
143 (prepare_symbols): this.
144 (prepare): Move the definition of `rules_number' to...
145 (prepare_rules): here.
146 (prepare): Move the definition of `last', `final_state_number',
147 `states_number' to...
148 (prepare_states): here.
149 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
150
1512002-10-20 Akim Demaille <akim@epita.fr>
152
153 * src/tables.h, src/tables.c, src/output.c: Comment changes.
154
1552002-10-20 Akim Demaille <akim@epita.fr>
156
157 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
158 * data/c.m4: here.
159
1602002-10-20 Akim Demaille <akim@epita.fr>
161
162 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
163 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
164 `pair'.
165 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
166 `name' to...
167 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
168 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
169 These.
170
1712002-10-19 Paul Eggert <eggert@twinsun.com>
172
173 Do not create a temporary file, as that involves security and
174 cleanup headaches. Instead, use a pair of pipes.
175 Derived from a suggestion by Florian Krohm.
176 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
177 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
178 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
179 (BISON_PREREQ_SUBPIPE): Add.
180 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
181 Add subpipe.h, subpipe.c.
182 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
183 * po/POTFILES.in: Add lib/subpipe.c.
184 * src/output.c: Include "subpipe.h".
185 (m4_invoke): Remove decl.
186 (scan_skel): New decl.
187 (output_skeleton): Use pipe rather than temporary file for m4 input.
188 Check that m4sugar.m4 is readable, to avoid deadlock.
189 Check for pipe I/O error.
190 * src/scan-skel.l (readpipe): Remove decl.
191 (scan_skel): New function, to be used in place of m4_invoke.
192 Read from stream rather than file.
193
194 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
195 float, as this generates a warning on Solaris 8 + GCC 3.2 with
196 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
197 this generates a more-accurate value anyway.
198
199 * lib/timevar.c (timervar_accumulate): Rename locals to
200 avoid confusion with similarly-named more-global.
201 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
202
203 * src/output.c (prepare): Use xstrdup to convert char const *
204 to char *, to avoid GCC warning.
205
2062002-10-19 Akim Demaille <akim@epita.fr>
207
208 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
209 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
210 Use them to have `calc.y' ready for %pure-parser.
211 * data/yacc.c (YYLEX): Pass a yylex return type to
212 b4_c_function_call.
213
2142002-10-19 Akim Demaille <akim@epita.fr>
215
216 Prototype support of %lex-param and %parse-param.
217
218 * src/parse-gram.y: Add the definition of the %lex-param and
219 %parse-param tokens, plus their rules.
220 Drop the `_' version of %glr-parser.
221 Add the "," token.
222 * src/scan-gram.l (INITIAL): Scan them.
223 * src/muscle_tab.c: Comment changes.
224 (muscle_insert, muscle_find): Rename `pair' as `probe'.
225 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
226 (muscle_entry_s): The `value' member is no longer const.
227 Adjust all dependencies.
228 * src/muscle_tab.c (muscle_init): Adjust: use
229 MUSCLE_INSERT_STRING.
230 Initialize the obstack earlier.
231 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
232 (muscle_pair_list_grow): New.
233 * data/c.m4 (b4_c_function_call, b4_c_args): New.
234 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
235 * tests/calc.at: Use %locations, not --locations.
236 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
237
2382002-10-19 Akim Demaille <akim@epita.fr>
239
240 * src/getargs.c (usage): Take status as argument and exit
241 accordingly.
242 Report the traditional `Try ... --help' message when status != 0.
243 (usage, version): Don't take a FILE * as arg, it is pointless.
244 (getargs): When there is an incorrect number of arguments, make it
245 an error, and report it GNUlically thanks to `usage ()'.
246
2472002-10-18 Paul Eggert <eggert@twinsun.com>
248
249 * data/glr.c (yyreportParseError): Don't assume that sprintf
250 yields the length of the printed string, as this is not true
251 on SunOS 4.1.4. Reported by Peter Klein.
252
253 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
254 * tests/conflicts.at (%nonassoc and eof): Likewise.
255 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
256
2572002-10-17 Akim Demaille <akim@epita.fr>
258
259 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
260 * src/getargs.c (trace_types, trace_args): Adjust.
261 * src/reader.c (grammar_current_rule_prec_set)
262 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
263 Standardize error messages.
264 And s/@prec/%prec/!
265 (reader): Use trace_flag to enable scanner/parser debugging,
266 instead of an adhoc scheme.
267 * src/scan-gram.l: Remove trailing debugging code.
268
2692002-10-16 Paul Eggert <eggert@twinsun.com>
270
271 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
272 MUSCLE_TAB_H.
273
274 * NEWS: Officially drop support for building Bison with K&R C,
275 since it didn't work anyway and it's not worth worrying about.
276 * Makefile.maint (wget_files): Remove ansi2knr.c.
277 (ansi2knr.c-url_prefix): Remove.
278 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
279 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
280 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
281
2822002-10-15 Paul Eggert <eggert@twinsun.com>
283
284 Stop using the "enum_" trick for K&R-style function definitions;
285 it confused me, and I was the author! Instead, assume that people
286 who want to use K&R C compilers (when using these modules in GCC,
287 perhaps?) will run ansi2knr.
288
289 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
290 All uses of "enum_" changed to "enum ".
291 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
292 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
293
294 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
295 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
296 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
297 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
298 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
299 abitset_not, abitset_ones, abitset_or, abitset_or_and,
300 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
301 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
302 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
303 Use function prototypes; this removes the need for declaring
304 static functions simply to provide their prototypes.
305 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
306 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
307 bitset_count_, bitset_create, bitset_dump, bitset_first,
308 bitset_free, bitset_init, bitset_last, bitset_next,
309 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
310 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
311 bitset_print, bitset_release_memory, bitset_toggle_,
312 bitset_type_choose, bitset_type_get, bitset_type_name_get,
313 debug_bitset): Likewise.
314 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
315 * lib/bitset_stats.c (bitset_log_histogram_print,
316 bitset_percent_histogram_print, bitset_stats_and,
317 bitset_stats_and_cmp, bitset_stats_and_or,
318 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
319 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
320 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
321 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
322 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
323 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
324 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
325 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
326 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
327 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
328 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
329 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
330 bitset_stats_zero): Likewise.
331 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
332 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
333 bitsetv_dump, debug_bitsetv): Likewise.
334 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
335 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
336 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
337 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
338 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
339 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
340 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
341 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
342 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
343 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
344 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
345 Likewise.
346 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
347 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
348 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
349 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
350 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
351 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
352 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
353 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
354 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
355 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
356 lbitset_xor_cmp, lbitset_zero): Likewise.
357
3582002-10-14 Akim Demaille <akim@epita.fr>
359
360 Version 1.75.
361
3622002-10-14 Akim Demaille <akim@epita.fr>
363
364 * tests/Makefile.am (maintainer-check-posix): New.
365
3662002-10-14 Akim Demaille <akim@epita.fr>
367
368 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
369 member.
370
3712002-10-14 Akim Demaille <akim@epita.fr>
372
373 * src/tables.c (table_ninf_remap): base -> tab.
374 Reported by Matt Rosing.
375
3762002-10-14 Paul Eggert <eggert@twinsun.com>
377
378 * tests/action.at, tests/calc.at, tests/conflicts.at,
379 tests/cxx-type.at, tests/headers.at, tests/input.at,
380 tests/regression.at, tests/synclines.at, tests/torture.at:
381 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
382 so that the tests still work even if POSIXLY_CORRECT is set.
383 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
384
385 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
386 for portability to K&R hosts. Fix typo: signed char is guaranteed
387 only to 127, not to 128.
388 * data/glr.c (yysigned_char): New type.
389 * data/yacc.c (yysigned_char): Likewise.
390 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
391
3922002-10-13 Paul Eggert <eggert@twinsun.com>
393
394 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
395 true due to limited range of data type" warning from GCC.
396
397 * data/c.m4 (b4_token_defines): Protect against double-inclusion
398 by wrapping enum yytokentype's definition inside #ifndef
399 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
400
4012002-10-13 Akim Demaille <akim@epita.fr>
402
403 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
404 Un yy- yyrhs to avoid the name clash with the global YYRHS.
405
4062002-10-13 Akim Demaille <akim@epita.fr>
407
408 * Makefile.maint: Update from Autoconf 2.54.
409 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
410
4112002-10-13 Akim Demaille <akim@epita.fr>
412
413 * src/print.c (print_state): Separate the list of solved conflicts
414 from the other items.
415 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
416
4172002-10-13 Akim Demaille <akim@epita.fr>
418
419 Let nondeterministic skeletons be usable with deterministic
420 tables.
421
422 With the patch, GAWK compiled by GCC without -O2 passes its test
423 suite using a GLR parser driven by LALR tables. It fails with -O2
424 because `struct stat' gives two different answers on my machine:
425 88 (definition of an auto var) and later 96 (memset on this var).
426 Hence the stack is badly corrumpted. The headers inclusion is to
427 blame: if I move the awk.h inclusion before GLR's system header
428 inclusion, the two struct stat have the same size.
429
430 * src/tables.c (pack_table): Always create conflict_table.
431 (token_actions): Always create conflict_list.
432 * data/glr.c (YYFLAG): Remove, unused.
433
4342002-10-13 Akim Demaille <akim@epita.fr>
435
436 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
437 (O0FLAGS): New.
438 (VALGRIND, GXX): New.
439 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
440 * tests/bison.in: Run $PREBISON a pre-command.
441 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
442 (maintainer-check-g++): New.
443 * Makefile.am (maintainer-check): New.
444
4452002-10-13 Akim Demaille <akim@epita.fr>
446
447 * data/glr.c: Formatting changes.
448 Tweak some trace messages to match yacc.c's.
449
4502002-10-13 Akim Demaille <akim@epita.fr>
451
452 GLR parsers sometimes raise parse errors instead of performing the
453 default reduction.
454 Reported by Charles-Henry de Boysson.
455
456 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
457 check the length of the traces when %glr.
458 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
459 GLR's traces.
460 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
461 Test GLR parsers.
462 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
463 (yyltype): Remove the yy prefix from the member names.
464 (yytable): Complete its comment.
465 (yygetLRActions): Map error action number from YYTABLE from
466 YYTABLE_NINF to 0.
467 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
468 (which was a bug: it should have been YYTABEL_NINF, and yet it was
469 not satisfying as we could compare an YYACTION computed from
470 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
471 only value for error actions.
472 (yyreportParseError): In verbose parse error messages, don't issue
473 `error' in the list of expected tokens.
474 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
475 next action to perform to match glr.c's decoding.
476 (yytable): Complete its comment.
477
4782002-10-13 Paul Eggert <eggert@twinsun.com>
479
480 Fix problem reported by Henrik Grubbstroem in
481 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001670.html>:
482 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
483 because the Bison parser reads the second action before reducing
484 the first one.
485 * src/scan-gram.l (rule_length): New static var.
486 Use it to keep track of the rule length in the scanner, since
487 we can't expect the parser to be in lock-step sync with the scanner.
488 (handle_action_dollar, handle_action_at): Use this var.
489 * tests/actions.at (Exotic Dollars): Test for the problem.
490
4912002-10-12 Paul Eggert <eggert@twinsun.com>
492
493 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
494 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
495 Include <sys/time.h> when checking for clock_t and struct tms.
496 Use same include order as source.
497 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
498 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001674.html>.
499
500 * lib/timevar.c: Update copyright date and clarify comments.
501 (get_time) [IN_GCC]: Keep the GCC version for reference.
502
503 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
504 GCC version as of today, then merge Bison's changes.
505 Change "GCC" to "Bison" in copyright notice. timevar.def's
506 author is Akim, so change that too.
507
508 * src/reader.c (grammar_current_rule_check):
509 Don't worry about the default action if $$ is untyped.
510 Prevents bogus warnings reported by Jim Gifford in
511 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001673.html>.
512
513 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
514 * data/glr.c, data/lalr1.cc, data/yacc.c:
515 Output token definitions before the first part of user declarations.
516 Fixes compatibility problem reported by Jim Gifford for kbd in
517 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001672.html>.
518
5192002-10-11 Paul Eggert <eggert@twinsun.com>
520
521 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
522 (yyparse): here. This undoes some of the 2002-07-25 change.
523 Compatibility problem reported by Ralf S. Engelschall with
524 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
525
5262002-10-11 Akim Demaille <akim@epita.fr>
527
528 * tests/regression.at Characters Escapes): New.
529 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
530 characters.
531 Reported by Jan Nieuwenhuizen.
532
5332002-10-11 Akim Demaille <akim@epita.fr>
534
535 * po/id.po: New.
536
5372002-10-10 Paul Eggert <eggert@twinsun.com>
538
539 Portability fixes for bitsets; this also avoids several GCC
540 warnings.
541
542 * lib/abitset.c: Include <stddef.h>, for offsetof.
543 * lib/lbitset.c: Likewise.
544
545 * lib/abitset.c (abitset_bytes): Return a size that is aligned
546 properly for vectors of objects. Do not assume that adding a
547 header size to a multiple of a word size yields a value that is
548 properly aligned for the whole union.
549 * lib/bitsetv.c (bitsetv_alloc): Likewise.
550
551 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
552 unique names for structures.
553 * lib/ebitset.c (ebitset_bytes): Likewise.
554 * lib/lbitset.c (lbitset_bytes): Likewise.
555
556 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
557 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
558 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
559 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
560 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
561 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
562 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
563 to improve the type-checking that GCC can do.
564 * lib/bitset.c (bitset_op4_cmp): Likewise.
565 * lib/bitset_stats.c (bitset_stats_count,
566 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
567 bitset_stats_copy, bitset_stats_disjoint_p,
568 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
569 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
570 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
571 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
572 bitset_stats_and_or_cmp, bitset_stats_andn_or,
573 bitset_stats_andn_or_cmp, bitset_stats_or_and,
574 bitset_stats_or_and_cmp): Likewise.
575 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
576 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
577 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
578 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
579
580 * lib/abitset.h: Include bitset.h, not bbitset.h.
581 * lib/ebitset.h: Likewise.
582 * lib/lbitset.h: Likewise.
583
584 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
585 All instances of parameters of type enum bitset_opts are now of
586 type enum_bitset_opts, to conform to the C Standard, and similarly
587 for enum_bitset_type.
588 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
589 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
590
591 Do not use "struct bitset_struct" to mean different things in
592 different modules. Not only is this confusing, it violates
593 the C Standard, which requires that structure types in different
594 modules must be compatible if one is to be passed to the other.
595 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
596 All instances of "struct bitset_struct *" replaced with "bitset".
597 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
598 (union bitset_union, struct abitset_struct, struct ebitset_struct,
599 struct lbitset_struct, struct bitset_stats_struct): New types.
600 All uses of struct bitset_struct changed to union bitset_union,
601 etc.
602 * lib/abitset.c (struct abitset_struct, abitset,
603 struct bitset_struct): Remove.
604 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
605 struct bitset_struct): Remove.
606 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
607 bitset_struct): Remove.
608 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
609 Likewise.
610
611 Do not call a function of type T using a call that assumes the
612 function is of a different type U. Standard C requires that a
613 function must be called with a type that is compatible with its
614 definition.
615 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
616 New decls.
617 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
618 New functions.
619 * lib/ebitset.c (PFV): Remove.
620 * lib/lbitset.c (PFV): Likewise.
621 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
622 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
623 decls.
624 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
625 (ebitset_vtable): Use them.
626 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
627 lbitset_xor): New functions.
628 (lbitset_vtable): Use them.
629
630 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
631 Declare.
632
633 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
634 GCC warning.
635 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
636 Use offsetof, for simplicity.
637
6382002-10-06 Paul Eggert <eggert@twinsun.com>
639
640 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
641 the same width as int. This reapplies a hunk of the 2002-08-12 patch
642 <http://mail.gnu.org/pipermail/bison-patches/2002-August/001111.html>,
643 which was inadvertently undone by the 2002-09-30 patch.
644 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
645 the same width as int.
646
6472002-10-04 Paul Eggert <eggert@twinsun.com>
648
649 Version 1.50.
650
651 * configure.ac (AC_INIT), NEWS: Increment version number.
652
653 * doc/bison.texinfo: Minor spelling, grammar, and white space
654 fixes.
655 (Symbols): Mention that any negative value returned from yylex
656 signifies end-of-input. Warn about negative chars. Mention
657 the portable Standard C character set.
658
659 The GNU coding standard says CFLAGS and YFLAGS are reserved
660 for the installer to set.
661 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
662 * src/Makefile.am (AM_CFLAGS): Likewise.
663 (AM_YFLAGS): Renamed from YFLAGS.
664
665 Fix some MAX and MIN problems.
666 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
667 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
668 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
669 * src/reader.c (reader): Use it.
670
671 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
672 POSIX 1003.1-2001 has removed fgrep.
673
6742002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
675
676 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
677 interpreted as signed.
678 * lib/ebitset.c (ebitset_list): Fix bug.
679
6802002-10-01 Paul Eggert <eggert@twinsun.com>
681
682 More fixes for 64-bit hosts and large bitsets.
683
684 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
685 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
686 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
687 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
688 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
689 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
690 bitset_count_): Likewise.
691 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
692 bitset_first, bitset_last): Likewise.
693 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
694 bitset_stats_list_reverse, bitset_stats_size,
695 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
696 Likewise.
697 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
698 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
699 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
700 bitsetv_reflexive_transitive_closure): Likewise.
701 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
702 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
703 Likewise.
704 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
705 Likewise.
706
707 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
708 Use size_t, not unsigned int, to count bytes.
709 * lib/abitset.h (abitset_bytes): Likewise.
710 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
711 Likewise.
712 * lib/bitset.h (bitset_bytes): Likewise.
713 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
714 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
715 * lib/bitsetv.c (bitsetv_alloc): Likewise.
716 * lib/ebitset.c (ebitset_bytes): Likewise.
717 * lib/ebitset.h (ebitset_bytes): Likewise.
718 * lib/lbitset.c (lbitset_bytes): Likewise.
719 * lib/lbitset.h (lbitset_bytes): Likewise.
720
721 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
722 abitset_subset_p, abitset_disjoint_p, abitset_and,
723 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
724 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
725 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
726 abitset_or_and, abitset_or_and_cmp):
727 Use bitset_windex instead of unsigned int.
728 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
729 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
730 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
731 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
732 Likewise.
733 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
734
735 * lib/bitset.c (bitset_print):
736 Use proper printf formats for widths of integer types.
737 * lib/bitset_stats.c (bitset_percent_histogram_print,
738 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
739 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
740 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
741 * lib/lbitset.c (lbitset_bytes): Likewise.
742
743 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
744 BITSET_SIZE_MAX): New macros.
745 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
746 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
747 to BITSET_WINDEX_MAX.
748
749 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
750 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
751 since we now return the bitset_bindex type (not int).
752
753 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
754 when computing sizes.
755 * lib/ebitset.c (ebitset_elts_grow): Likewise.
756
757 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
758 and avoid cast to unsigned.
759
7602002-09-30 Akim Demaille <akim@epita.fr>
761
762 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
763 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
764 Updates from Michael Hayes.
765
7662002-09-30 Art Haas <ahaas@neosoft.com>
767
768 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
769 invocations.
770 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
771 defined.
772
7732002-09-27 Akim Demaille <akim@epita.fr>
774
775 Version 1.49c.
776
7772002-09-27 Akim Demaille <akim@epita.fr>
778
779 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
780 (Because of AC_LIBSOURCE).
781
7822002-09-27 Akim Demaille <akim@epita.fr>
783
784 Playing with Autoscan.
785
786 * configure.ac: Remove the old LIBOBJ tweaks.
787 (AC_REPLACE_FUNCS): Add strrchr and strtol.
788 * lib/strrchr.c: New.
789 * lib/strtol.c: New, from the Coreutils 4.5.1.
790
7912002-09-27 Akim Demaille <akim@epita.fr>
792
793 Playing with Autoscan.
794
795 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
796 * lib/Makefile.am (libbison_a_SOURCES): No longer include
797 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
798 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
799 Coreutils 4.5.1.
800
8012002-09-24 Akim Demaille <akim@epita.fr>
802
803 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
804 (Frequently Asked Questions, Parser Stack Overflow): New.
805
8062002-09-13 Akim Demaille <akim@epita.fr>
807
808 Playing with autoscan.
809
810 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
811 * src/files.c (skeleton_find): Remove, unused.
812 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
813 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
814
8152002-09-13 Akim Demaille <akim@epita.fr>
816
817 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
818 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
819
8202002-09-13 Akim Demaille <akim@epita.fr>
821
822 * configure.ac: Require 2.54.
823 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
824 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
825 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
826 Remove, provided by Autoconf macros.
827
8282002-09-12 Akim Demaille <akim@epita.fr>
829
830 * m4/prereq.m4: Update, from Coreutils 4.5.1.
831
8322002-09-12 Akim Demaille <akim@epita.fr>
833
834 * m4/prereq.m4: Update, from Fileutils 4.1.5.
835 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
836 Reported by Martin Mokrejs.
837
8382002-09-10 Akim Demaille <akim@epita.fr>
839
840 * src/parse-gram.y: Associate a human readable string to each
841 token type.
842 * tests/regression.at (Invalid inputs): Adjust.
843
8442002-09-10 Gary V. Vaughan <gary@gnu.org>
845
846 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
847 with an Autoconf-2.5x style configure.ac.
848
8492002-09-06 Paul Eggert <eggert@twinsun.com>
850
851 * doc/bison.texinfo (Conditions): Make explicit that the GPL
852 exception applies only to yacc.c. This is a modification of a
853 patch originally suggested by Akim Demaille.
854
8552002-09-06 Akim Demaille <akim@epita.fr>
856
857 * data/c.m4 (b4_copyright): Move the GPL exception comment from
858 here to...
859 * data/yacc.c: here.
860
861 * data/lalr1.cc (struct yyltype): Don't define it, since we use
862 LocationType.
863 (b4_ltype): Default to yy::Location from location.hh.
864
8652002-09-04 Jim Meyering <jim@meyering.net>
866
867 * data/yacc.c: Guard the declaration of yytoknum also with
868 `#ifdef YYPRINT', so it is declared only when used.
869
8702002-09-04 Akim Demaille <akim@epita.fr>
871
872 * configure.in: Rename as...
873 * configure.ac: this.
874 Bump to 1.49c.
875
8762002-09-04 Akim Demaille <akim@epita.fr>
877
878 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
879 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
880 translate maintainer only messages.
881
8822002-08-12 Paul Eggert <eggert@twinsun.com>
883
884 Version 1.49b.
885
886 * Makefile.am (SUBDIRS): Remove intl.
887 (DISTCLEANFILES): Remove.
888 * NEWS: Mention that GNU M4 is now required. Clarify what is
889 meant by "larger grammars". Mention the pt_BR translation.
890 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
891 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
892 Bump version from 0.11.2 to 0.11.5.
893 (BISON_PREREQ_STAGE): Remove.
894 (AM_GNU_GETTEXT): Use external gettext.
895 (AC_OUTPUT): Remove intl/Makefile.
896
897 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
898
899 * data/glr.c: Include string.h, for strlen.
900 (yyreportParseError): Use size_t for yysize.
901 (yy_yypstack): No longer nested inside yypstates, as nested
902 functions are not portable. Do not assume size_t is the
903 same width as int.
904 (yypstates): Do not assume that ptrdiff_t is the same width
905 as int, and similarly for yyposn and YYINDEX.
906
907 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
908
909 * lib/Makefile.am (INCLUDES): Do not include from the intl
910 directory, which has been removed.
911 * src/Makefile.am (INCLUDES): Likewise.
912
913 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
914 (bitsets_sources, additional_bitsets_sources, timevars_sources):
915 New vars.
916
917 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
918 * tests/Makefile.am (EXTRA_DIST): Likewise.
919
920 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
921 Do not assume that bitset_windex is the same width as unsigned.
922
923 * lib/abitset.c (abitset_unused_clear): Do not assume that
924 bitset_word is the same width as int.
925 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
926 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
927 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
928 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
929 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
930
931 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
932 portability to one's complement hosts!).
933 * lib/ebitset.c (ebitset_op1): Likewise.
934 * lib/lbitset.c (lbitset_op1): Likewise.
935
936 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
937 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
938 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
939 Sync with fileutils.
940 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
941 lib/gettext.h: Sync with diffutils.
942
943 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
944 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
945
946 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
947 PROTOTYPES to check for prototypes, and "defined __STDC__" to
948 check for void *.
949
950 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
951 size_t; the old version tried to do this but casted improperly.
952 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
953 (bitset_test): Now returns int, not unsigned long.
954
955 * lib/bitset_stats.c: Include "gettext.h".
956 (_): New macro.
957 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
958 name locals "index", as it generates unnecessary warnings on some
959 hosts that have an "index" function.
960
961 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
962 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
963 they need translation.
964 * src/LR0.c (state_list_append, new_itemsets, get_state,
965 append_states, generate_states): Likewise.
966 * src/assoc.c (assoc_to_string): Likewise.
967 * src/closure.c (print_closure, set_firsts, closure): Likewise.
968 * src/gram.c (grammar_dump): Likewise.
969 * src/injections.c (injections_compute): Likewise.
970 * src/lalr.c (lookaheads_print): Likewise.
971 * src/relation.c (relation_transpose): Likewise.
972 * src/scan-gram.l: Likewise.
973 * src/tables.c (table_grow, pack_vector): Likewise.
974
975 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
976 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
977 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
978 * m4/mbstate_t.m4: Sync with fileutils.
979 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
980
981 * po/LINGUAS: Add pt_BR.
982 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
983 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
984 lib/timevar.c.
985 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
986 manual recommends.
987 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
988
989 * src/complain.c (strerror_r): Remove decl; not needed.
990 (strerror): Use same pattern as ../lib/error.c.
991
992 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
993
994 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
995
996 * src/main.c (main): Cast result of bindtextdomain and textdomain
997 to void, to avoid a GCC warning when --disable-nls is in effect.
998
999 * src/scan-gram.l: Use strings rather than escapes when possible,
1000 to minimize the number of warnings from xgettext.
1001 (handle_action_dollar, handle_action_at): Don't use isdigit,
1002 as it mishandles negative chars and it may not work as expected
1003 outside the C locale.
1004
1005 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
1006 this is a GCC extension and is not portable to other compilers.
1007
1008 * src/system.h (alloca): Use same pattern as ../lib/error.c.
1009 Do not include <ctype.h>; no longer needed.
1010 Do not include <malloc.h>; no longer needed (and generates
1011 warnings on OpenBSD 3.0).
1012
1013 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
1014 it's not portable.
1015
1016 * tests/regression.at: Do not use 'cc -c input.c -o input';
1017 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
1018
1019 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
1020 exit status as failure, not just exit status 1. Sun C exits
1021 with status 2 sometimes.
1022
1023 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
1024 Use it for the two large tests.
1025
10262002-08-02 Akim Demaille <akim@epita.fr>
1027
1028 * src/conflicts.c (conflicts_output): Don't output rules never
1029 reduced here, since anyway that computation doesn't work.
1030 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
1031 (rule_useless_p, rule_never_reduced_p): New.
1032 (grammar_rules_partial_print): Use a filter instead of a range.
1033 Display the title only if needed.
1034 (grammar_rules_print): Adjust.
1035 (grammar_rules_never_reduced_report): New.
1036 * src/tables.c (action_row): Move the computation of rules never
1037 reduced to...
1038 (token_actions): here.
1039 * src/main.c (main): Make the parser before making the report, so
1040 that rules never reduced are computed.
1041 Call grammar_rules_never_reduced_report.
1042 * src/print.c (print_results): Report rules never reduced.
1043 * tests/conflicts.at, tests/reduce.at: Adjust.
1044
10452002-08-01 Akim Demaille <akim@epita.fr>
1046
1047 Instead of attaching lookaheads and duplicating the rules being
1048 reduced by a state, attach the lookaheads to the reductions.
1049
1050 * src/state.h (state_t): Remove the `lookaheads',
1051 `lookaheads_rule' member.
1052 (reductions_t): Add a `lookaheads' member.
1053 Use a regular array for the `rules'.
1054 * src/state.c (reductions_new): Initialize the lookaheads member
1055 to 0.
1056 (state_rule_lookaheads_print): Adjust.
1057 * src/state.h, src/state.c (state_reductions_find): New.
1058 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
1059 (count_rr_conflicts): Adjust.
1060 * src/lalr.c (LArule): Remove.
1061 (add_lookback_edge): Adjust.
1062 (state_lookaheads_count): New.
1063 (states_lookaheads_initialize): Merge into...
1064 (initialize_LA): this.
1065 (lalr_free): Adjust.
1066 * src/main.c (main): Don't free nullable and derives too early: it
1067 is used by --verbose.
1068 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
1069
10702002-08-01 Akim Demaille <akim@epita.fr>
1071
1072 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
1073 `rule_number_t**'.
1074 (set_derives, free_derives): Rename as...
1075 (derives_compute, derives_free): this.
1076 Adjust all dependencies.
1077 * src/nullable.c (set_nullable, free_nullable): Rename as...
1078 (nullable_compute, nullable_free): these.
1079 (rule_list_t): Store rule_t *, not rule_number_t.
1080 * src/state.c (state_rule_lookaheads_print): Directly compare rule
1081 pointers, instead of their numbers.
1082 * src/main.c (main): Call nullable_free, and derives_free earlier,
1083 as they were lo longer used.
1084
10852002-08-01 Akim Demaille <akim@epita.fr>
1086
1087 * lib/timevar.c (get_time): Include children time.
1088 * src/lalr.h (LA, LArule): Don't export them: used with the
1089 state_t.
1090 * src/lalr.c (LA, LArule): Static.
1091 * src/lalr.h, src/lalr.c (lalr_free): New.
1092 * src/main.c (main): Call it.
1093 * src/tables.c (pack_vector): Check whether loc is >= to the
1094 table_size, not >.
1095 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
1096 (tables_generate): do it, since that's also it which allocates
1097 them.
1098 Don't free LA and LArule, main does.
1099
11002002-07-31 Akim Demaille <akim@epita.fr>
1101
1102 Separate parser tables computation and output.
1103
1104 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
1105 (conflict_list, conflict_list_cnt, table, check, table_ninf)
1106 (yydefgoto, yydefact, high): Move to...
1107 * src/tables.h, src/tables.c: here.
1108 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1109 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1110 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
1111 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
1112 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
1113 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
1114 (action_row, save_row, token_actions, save_column, default_goto)
1115 (goto_actions, sort_actions, matching_state, pack_vector)
1116 (table_ninf_remap, pack_table, prepare_actions): Move to...
1117 * src/tables.c: here.
1118 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
1119 * src/output.c (token_actions, output_base, output_conflicts)
1120 (output_check): Merge into...
1121 (prepare_actions): this.
1122 (actions_output): Rename as...
1123 (user_actions_output): this.
1124 * src/main.c (main): Call tables_generate and tables_free.
1125
11262002-07-31 Akim Demaille <akim@epita.fr>
1127
1128 Steal GCC's --time-report support.
1129
1130 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
1131 stolen/adjusted from GCC.
1132 * m4/stage.m4: Remove time related checks.
1133 * m4/timevar.m4: New.
1134 * configure.in: Adjust.
1135 * src/system.h: Adjust to using timevar.h.
1136 * src/getargs.h, src/getargs.c: Support trace_time for
1137 --trace=time.
1138 * src/main.c (stage): Remove.
1139 (main): Replace `stage' invocations with timevar calls.
1140 * src/output.c: Insert pertinent timevar calls.
1141
11422002-07-31 Akim Demaille <akim@epita.fr>
1143
1144 Let --trace have arguments.
1145
1146 * src/getargs.h (enum trace_e): New.
1147 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
1148 (long_options, short_options): --trace/-T takes an optional
1149 argument.
1150 Change all the uses of trace_flag to reflect the new flags.
1151 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
1152
1153 Strengthen `stage' portability.
1154
1155 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
1156 * configure.in: Use it.
1157 Don't check for malloc.h and sys/times.h.
1158 * src/system.h: Include them when appropriate.
1159 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
1160 times and struct tms are available.
1161
11622002-07-30 Akim Demaille <akim@epita.fr>
1163
1164 In verbose parse error message, don't report `error' as an
1165 expected token.
1166 * tests/actions.at (Printers and Destructors): Adjust.
1167 * tests/calc.at (Calculator $1): Adjust.
1168 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
1169 error message, do not report the parser accepts the error token in
1170 that state.
1171
11722002-07-30 Akim Demaille <akim@epita.fr>
1173
1174 Normalize conflict related messages.
1175
1176 * src/complain.h, src/complain.c (warn, complain): New.
1177 * src/conflicts.c (conflicts_print): Use them.
1178 (conflict_report_yacc): New, extracted from...
1179 (conflicts_print): here.
1180 * tests/conflicts.at, tests/existing.at: Adjust.
1181
11822002-07-30 Akim Demaille <akim@epita.fr>
1183
1184 Report rules which are never reduced by the parser: those hidden
1185 by conflicts.
1186
1187 * src/LR0.c (save_reductions): Don't make the final state too
1188 different: save its reduction (accept) instead of having a state
1189 without any action (no shift or goto, no reduce).
1190 Note: the final state is now a ``regular'' state, i.e., the
1191 parsers now contain `reduce 0' as default reduction.
1192 Nevertheless, since they decide to `accept' when yystate =
1193 final_state, they still will not reduce rule 0.
1194 * src/print.c (print_actions, print_reduction): Adjust.
1195 * src/output.c (action_row): Track reduced rules.
1196 (token_actions): Report rules never reduced.
1197 * tests/conflicts.at, tests/regression.at: Adjust.
1198
11992002-07-30 Akim Demaille <akim@epita.fr>
1200
1201 `stage' was accidently included in a previous patch.
1202 Initiate its autoconfiscation.
1203
1204 * configure.in: Look for malloc.h and sys/times.h.
1205 * src/main.c (stage): Adjust.
1206 Report only when trace_flag.
1207
12082002-07-29 Akim Demaille <akim@epita.fr>
1209
1210 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
1211 state_number_t.
1212 (errs_t): symbol_t*, not symbol_number_t.
1213 (reductions_t): rule_t*, not rule_number_t.
1214 (FOR_EACH_SHIFT): New.
1215 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
1216 * src/print.c, src/print_graph.c: Adjust.
1217
12182002-07-29 Akim Demaille <akim@epita.fr>
1219
1220 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
1221
1222 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
1223 (endtoken, accept): these.
1224 * src/reader.c (reader): Set endtoken's default tag to "$end".
1225 Set undeftoken's tag to "$undefined" instead of "$undefined.".
1226 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
1227 Adjust.
1228
12292002-07-29 Akim Demaille <akim@epita.fr>
1230
1231 * src/reduce.c (reduce_grammar): When the language is empty,
1232 complain about the start symbol, not the axiom.
1233 Use its location.
1234 * tests/reduce.at (Empty Language): New.
1235
12362002-07-26 Akim Demaille <akim@epita.fr>
1237
1238 * src/reader.h, src/reader.c (gram_error): ... can't get
1239 yycontrol without making too strong assumptions on the parser
1240 itself.
1241 * src/output.c (prepare_tokens): Use the real 0th value of
1242 token_translations instead of `0'.
1243 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
1244 visible here.
1245 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
1246 for the time being: %locations ought to provide it to yyerror.
1247
12482002-07-25 Akim Demaille <akim@epita.fr>
1249
1250 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
1251 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
1252 * tests/regression.at (Web2c Actions): Adjust.
1253
12542002-07-25 Akim Demaille <akim@epita.fr>
1255
1256 Stop storing rules from 1 to nrules + 1.
1257
1258 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
1259 * src/nullable.c, src/output.c, src/print.c, src/reader.c
1260 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
1261 Iterate from 0 to nrules.
1262 Use rule_number_as_item_number and item_number_as_rule_number.
1263 Adjust to `derive' now containing possibly 0.
1264 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
1265 Handle the `- 1' part in rule numbers from/to item numbers.
1266 * src/conflicts.c (log_resolution): Fix the message which reversed
1267 shift and reduce.
1268 * src/output.c (action_row): Initialize default_rule to -1.
1269 (token_actions): Adjust.
1270 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
1271 expected output.
1272 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
1273
12742002-07-25 Akim Demaille <akim@epita.fr>
1275
1276 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
1277 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
1278 (b4_c_knr_arg_decl): New.
1279 * data/yacc.c: Use it to define yysymprint, yydestruct, and
1280 yyreport_parse_error.
1281
12822002-07-25 Akim Demaille <akim@epita.fr>
1283
1284 * data/yacc.c (yyreport_parse_error): New, extracted from...
1285 (yyparse): here.
1286 (yydestruct, yysymprint): Move above yyparse.
1287 Be K&R compliant.
1288
12892002-07-25 Akim Demaille <akim@epita.fr>
1290
1291 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
1292 replace...
1293 (b4_sint_type, b4_uint_type): these.
1294 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
1295 * tests/regression.at (Web2c Actions): Adjust.
1296
12972002-07-25 Akim Demaille <akim@epita.fr>
1298
1299 * src/gram.h (TIEM_NUMBER_MAX): New.
1300 (item_number_of_rule_number, rule_number_of_item_number): Rename
1301 as...
1302 (rule_number_as_item_number, item_number_as_rule_number): these.
1303 Adjust dependencies.
1304 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1305 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1306 (symbol_number_to_vector_number): New.
1307 (order): Of vector_number_t* type.
1308 (base_t, BASE_MAX, BASE_MIN): New.
1309 (froms, tos, width, pos, check): Of base_t type.
1310 (action_number_t, ACTION_MIN, ACTION_MAX): New.
1311 (actrow): Of action_number_t type.
1312 (conflrow): Of unsigned int type.
1313 (table_ninf, base_ninf): New.
1314 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
1315 (muscle_insert_int_table, muscle_insert_base_table)
1316 (muscle_insert_rule_number_table): New.
1317 (prepare_tokens): Output `toknum' as int_table.
1318 (action_row): Returns a rule_number_t.
1319 Use ACTION_MIN, not SHRT_MIN.
1320 (token_actions): yydefact is rule_number_t*.
1321 (table_ninf_remap): New.
1322 (pack_table): Use it for `base' and `table'.
1323 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
1324 replaced with...
1325 (YYPACT_NINF, YYTABLE_NINF): these.
1326 (yypact, yytable): Compute their types instead of hard-coded
1327 `short'.
1328 * tests/regression.at (Web2c Actions): Adjust.
1329
13302002-07-19 Akim Demaille <akim@epita.fr>
1331
1332 * src/scan-gram.l (id): Can start with an underscore.
1333
13342002-07-16 Akim Demaille <akim@epita.fr>
1335
1336 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
1337 Adjust all former `associativity' dependencies.
1338 * src/symtab.c (symbol_new): Default associativity is `undef', not
1339 `right'.
1340 (symbol_check_alias_consistence): Adjust.
1341
13422002-07-09 Akim Demaille <akim@epita.fr>
1343
1344 * doc/bison.texinfo: Properly set the ``header'' part.
1345 Use @dircategory ``GNU programming tools'' as per Texinfo's
1346 documentation.
1347 Use @copying.
1348
13492002-07-09 Akim Demaille <akim@epita.fr>
1350
1351 * lib/quotearg.h: Protect against multiple inclusions.
1352 * src/location.h (location_t): Add a `file' member.
1353 (LOCATION_RESET, LOCATION_PRINT): Adjust.
1354 * src/complain.c (warn_at, complain_at, fatal_at): Drop
1355 `error_one_per_line' support.
1356
13572002-07-09 Akim Demaille <akim@epita.fr>
1358
1359 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
1360 * src/reader.c (lineno): Remove.
1361 Adjust all dependencies.
1362 (get_merge_function): Take a location and use complain_at.
1363 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
1364 * tests/regression.at (Invalid inputs, Mixing %token styles):
1365 Adjust.
1366
13672002-07-09 Akim Demaille <akim@epita.fr>
1368
1369 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
1370 recovery rule, and forbid extensions when --yacc.
1371 (gram_error): Use complain_at.
1372 * src/reader.c (reader): Exit if there were parse errors.
1373
13742002-07-09 Akim Demaille <akim@epita.fr>
1375
1376 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
1377 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
1378 Reported by R Blake <blakers@mac.com>.
1379
13802002-07-09 Akim Demaille <akim@epita.fr>
1381
1382 * data/yacc.c: Output the copyright notive in the header.
1383
13842002-07-03 Akim Demaille <akim@epita.fr>
1385
1386 * src/output.c (froms, tos): Are state_number_t.
1387 (save_column): sp, sp1, and sp2 are state_number_t.
1388 (prepare): Rename `final' as `final_state_number', `nnts' as
1389 `nterms_number', `nrules' as `rules_number', `nstates' as
1390 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
1391 unused.
1392 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
1393 * data/lalr1.cc (nsym_): Remove, unused.
1394
13952002-07-03 Akim Demaille <akim@epita.fr>
1396
1397 * src/lalr.h, src/lalr.c (goto_number_t): New.
1398 * src/lalr.c (goto_list_t): New.
1399 Propagate them.
1400 * src/nullable.c (rule_list_t): New.
1401 Propagate.
1402 * src/types.h: Remove.
1403
14042002-07-03 Akim Demaille <akim@epita.fr>
1405
1406 * src/closure.c (print_fderives): Use rule_rhs_print.
1407 * src/derives.c (print_derives): Use rule_rhs_print.
1408 (rule_list_t): New, replaces `shorts'.
1409 (set_derives): Add comments.
1410 * tests/sets.at (Nullable, Firsts): Adjust.
1411
14122002-07-03 Akim Demaille <akim@epita.fr>
1413
1414 * src/output.c (prepare_actions): Free `tally' and `width'.
1415 (prepare_actions): Allocate and free `order'.
1416 * src/symtab.c (symbols_free): Free `symbols'.
1417 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
1418 * src/output.c (m4_invoke): Move to...
1419 * src/scan-skel.l: here.
1420 (<<EOF>>): Close yyout, and free its name.
1421
14222002-07-03 Akim Demaille <akim@epita.fr>
1423
1424 Fix some memory leaks, and fix a bug: state 0 was examined twice.
1425
1426 * src/LR0.c (new_state): Merge into...
1427 (state_list_append): this.
1428 (new_states): Merge into...
1429 (generate_states): here.
1430 (set_states): Don't ensure a proper `errs' state member here, do it...
1431 * src/conflicts.c (conflicts_solve): here.
1432 * src/state.h, src/state.c: Comment changes.
1433 (state_t): Rename member `shifts' as `transitions'.
1434 Adjust all dependencies.
1435 (errs_new): For consistency, also take the values as argument.
1436 (errs_dup): Remove.
1437 (state_errs_set): New.
1438 (state_reductions_set, state_transitions_set): Assert that no
1439 previous value was assigned.
1440 (state_free): New.
1441 (states_free): Use it.
1442 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
1443 temporary storage: use `errs' and `nerrs' as elsewhere.
1444 (set_conflicts): Allocate and free this `errs'.
1445
14462002-07-02 Akim Demaille <akim@epita.fr>
1447
1448 * lib/libiberty.h: New.
1449 * lib: Update the bitset implementation from upstream.
1450 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
1451 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
1452 * src/main.c: Adjust bitset stats calls.
1453
14542002-07-01 Paul Eggert <eggert@twinsun.com>
1455
1456 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
1457 char, so that negative chars don't collide with $.
1458
14592002-06-30 Akim Demaille <akim@epita.fr>
1460
1461 Have the GLR tests be `warning' checked, and fix the warnings.
1462
1463 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
1464 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
1465 (yyremoveDeletes): `yyi' and `yyj' are size_t.
1466 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
1467 (yyaddDeferredAction): static.
1468 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
1469 (yyreportParseError): yyprefix is const.
1470 yytokenp is used only when verbose.
1471 (yy__GNUC__): Replace with __GNUC__.
1472 (yypdumpstack): yyi is size_t.
1473 (yypreference): Un-yy local variables and arguments, to avoid
1474 clashes with `yyr1'. Anyway, we are not in the user name space.
1475 (yytname_size): be an int, as is compared with ints.
1476 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
1477 Use them.
1478 * tests/cxx-gram.at: Use quotation to protect $1.
1479 Use AT_COMPILE to enable warnings hunts.
1480 Prototype yylex and yyerror.
1481 `Use' argc.
1482 Include `string.h', not `strings.h'.
1483 Produce and prototype stmtMerge only when used.
1484 yylex takes a location.
1485
14862002-06-30 Akim Demaille <akim@epita.fr>
1487
1488 We spend a lot of time in quotearg, in particular when --verbose.
1489
1490 * src/symtab.c (symbol_get): Store a quoted version of the key.
1491 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
1492 Adjust all callers.
1493
14942002-06-30 Akim Demaille <akim@epita.fr>
1495
1496 * src/state.h (reductions_t): Rename member `nreds' as num.
1497 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
1498 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
1499
15002002-06-30 Akim Demaille <akim@epita.fr>
1501
1502 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
1503 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
1504 (shifts_to): Rename as...
1505 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
1506 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
1507 (TRANSITION_IS_DISABLED, transitions_to): these.
1508
15092002-06-30 Akim Demaille <akim@epita.fr>
1510
1511 * src/print.c (print_shifts, print_gotos): Merge into...
1512 (print_transitions): this.
1513 (print_transitions, print_errs, print_reductions): Align the
1514 lookaheads columns.
1515 (print_core, print_transitions, print_errs, print_state,
1516 print_grammar): Output empty lines separator before, not after.
1517 (state_default_rule_compute): Rename as...
1518 (state_default_rule): this.
1519 * tests/conflicts.at (Defaulted Conflicted Reduction),
1520 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
1521 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
1522
15232002-06-30 Akim Demaille <akim@epita.fr>
1524
1525 Display items as we display rules.
1526
1527 * src/gram.h, src/gram.c (rule_lhs_print): New.
1528 * src/gram.c (grammar_rules_partial_print): Use it.
1529 * src/print.c (print_core): Likewise.
1530 * tests/conflicts.at (Defaulted Conflicted Reduction),
1531 (Unresolved SR Conflicts): Adjust.
1532 (Unresolved SR Conflicts): Adjust and rename as...
1533 (Resolved SR Conflicts): this, as was meant.
1534 * tests/regression.at (Web2c Report): Adjust.
1535
15362002-06-30 Akim Demaille <akim@epita.fr>
1537
1538 * src/print.c (state_default_rule_compute): New, extracted from...
1539 (print_reductions): here.
1540 Pessimize, but clarify the code.
1541 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
1542
15432002-06-30 Akim Demaille <akim@epita.fr>
1544
1545 * src/output.c (action_row): Let default_rule be always a rule
1546 number.
1547
15482002-06-30 Akim Demaille <akim@epita.fr>
1549
1550 * src/closure.c (print_firsts, print_fderives, closure):
1551 Use BITSET_EXECUTE.
1552 * src/lalr.c (lookaheads_print): Likewise.
1553 * src/state.c (state_rule_lookaheads_print): Likewise.
1554 * src/print_graph.c (print_core): Likewise.
1555 * src/print.c (print_reductions): Likewise.
1556 * src/output.c (action_row): Likewise.
1557 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
1558
15592002-06-30 Akim Demaille <akim@epita.fr>
1560
1561 * src/print_graph.c: Use report_flag.
1562
15632002-06-30 Akim Demaille <akim@epita.fr>
1564
1565 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
1566 to...
1567 * src/relation.h, src/relation.c (traverse, relation_digraph)
1568 (relation_print, relation_transpose): New.
1569
15702002-06-30 Akim Demaille <akim@epita.fr>
1571
1572 * src/state.h, src/state.c (shifts_to): New.
1573 * src/lalr.c (build_relations): Use it.
1574
15752002-06-30 Akim Demaille <akim@epita.fr>
1576
1577 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
1578 (item_number_of_rule_number, rule_number_of_item_number): New.
1579 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
1580 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
1581 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
1582 Propagate their use.
1583 Much remains to be done, in particular wrt `shorts' from types.h.
1584
15852002-06-30 Akim Demaille <akim@epita.fr>
1586
1587 * src/symtab.c (symbol_new): Initialize the `printer' member.
1588
15892002-06-30 Akim Demaille <akim@epita.fr>
1590
1591 * src/LR0.c (save_reductions): Remove, replaced by...
1592 * src/state.h, src/state.c (state_reductions_set): New.
1593 (reductions, errs): Rename as...
1594 (reductions_t, errs_t): these.
1595 Adjust all dependencies.
1596
15972002-06-30 Akim Demaille <akim@epita.fr>
1598
1599 * src/LR0.c (state_list_t, state_list_append): New.
1600 (first_state, last_state): Now symbol_list_t.
1601 (this_state): Remove.
1602 (new_itemsets, append_states, save_reductions): Take a state_t as
1603 argument.
1604 (set_states, generate_states): Adjust.
1605 (save_shifts): Remove, replaced by...
1606 * src/state.h, src/state.c (state_shifts_set): New.
1607 (shifts): Rename as...
1608 (shifts_t): this.
1609 Adjust all dependencies.
1610 * src/state.h (state_t): Remove the `next' member.
1611
16122002-06-30 Akim Demaille <akim@epita.fr>
1613
1614 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
1615 escaped in slot 0.
1616
16172002-06-30 Akim Demaille <akim@epita.fr>
1618
1619 Use hash.h for the state hash table.
1620
1621 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
1622 (allocate_storage): Use state_hash_new.
1623 (free_storage): Use state_hash_free.
1624 (new_state, get_state): Adjust.
1625 * src/lalr.h, src/lalr.c (states): Move to...
1626 * src/states.h (state_t): Remove the `link' member, no longer
1627 used.
1628 * src/states.h, src/states.c: here.
1629 (state_hash_new, state_hash_free, state_hash_lookup)
1630 (state_hash_insert, states_free): New.
1631 * src/states.c (state_table, state_compare, state_hash): New.
1632 * src/output.c (output_actions): Do not free states now, since we
1633 still need to know the final_state number in `prepare', called
1634 afterwards. Do it...
1635 * src/main.c (main): here: call states_free after `output'.
1636
16372002-06-30 Akim Demaille <akim@epita.fr>
1638
1639 * src/state.h, src/state.c (state_new): New, extracted from...
1640 * src/LR0.c (new_state): here.
1641 * src/state.h (STATE_ALLOC): Move to...
1642 * src/state.c: here.
1643 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
1644 * src/state.h, src/state.c: here.
1645
16462002-06-30 Akim Demaille <akim@epita.fr>
1647
1648 * src/reader.c (gensym): Rename as...
1649 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
1650 (getsym): Rename as...
1651 (symbol_get): this.
1652
16532002-06-30 Akim Demaille <akim@epita.fr>
1654
1655 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
1656 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
1657 * src/output.c, src/print.c, src/print_graph.c: Propagate.
1658 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
1659
16602002-06-30 Akim Demaille <akim@epita.fr>
1661
1662 Make the test suite pass with warnings checked.
1663
1664 * tests/actions.at (Printers and Destructors): Improve.
1665 Avoid unsigned vs. signed issues.
1666 * tests/calc.at: Don't exercise the scanner here, do it...
1667 * tests/input.at (Torturing the Scanner): here.
1668
16692002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1670
1671 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
1672 reorganize first lines parallel to yacc.c.
1673
16742002-06-28 Akim Demaille <akim@epita.fr>
1675
1676 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
1677 (b4_token_enum, b4_token_defines): New, factored from...
1678 * data/lalr1.cc, data/yacc.c, glr.c: here.
1679
16802002-06-28 Akim Demaille <akim@epita.fr>
1681
1682 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
1683 unused variables.
1684 * src/output.c (merger_output): static.
1685
16862002-06-28 Akim Demaille <akim@epita.fr>
1687
1688 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
1689 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
1690 pacify GCC.
1691 * src/output.c (save_row): Initialize all the variables to pacify GCC.
1692
16932002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1694
1695 Accumulated changelog for new GLR parsing features.
1696
1697 * src/conflicts.c (count_total_conflicts): Change name to
1698 conflicts_total_count.
1699 * src/conflicts.h: Ditto.
1700 * src/output.c (token_actions): Use the new name.
1701 (output_conflicts): Change conflp => conflict_list_heads, and
1702 confl => conflict_list for better readability.
1703 * data/glr.c: Use the new names.
1704 * NEWS: Add self to GLR announcement.
1705
1706 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
1707
1708 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
1709 Akim Demaille.
1710
1711 * data/bison.glr: Change name to glr.c
1712 * data/glr.c: Renamed from bison.glr.
1713 * data/Makefile.am: Add glr.c
1714
1715 * src/getargs.c:
1716
1717 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
1718 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
1719
1720 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1721
1722 * data/bison.glr: Be sure to restore the
1723 current #line when returning to the skeleton contents after having
1724 exposed the input file's #line.
1725
1726 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1727
1728 * data/bison.glr: Bring up to date with changes to bison.simple.
1729
1730 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1731
1732 * data/bison.glr: Correct definitions that use b4_prefix.
1733 Various reformatting.
1734 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
1735 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
1736 yytokenp argument; now part of stack.
1737 (yychar): Define to behave as documented.
1738 (yyclearin): Ditto.
1739
1740 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1741
1742 * src/reader.h: Add declaration for free_merger_functions.
1743
1744 * src/reader.c (merge_functions): New variable.
1745 (get_merge_function): New function.
1746 (free_merger_functions): New function.
1747 (readgram): Check for %prec that is not followed by a symbol.
1748 Handle %dprec and %merge declarations.
1749 (packgram): Initialize dprec and merger fields in rules array.
1750
1751 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
1752 conflict_list_cnt, conflict_list_free): New variables.
1753 (table_grow): Also grow conflict_table.
1754 (prepare_rules): Output dprec and merger tables.
1755 (conflict_row): New function.
1756 (action_row): Output conflict lists for GLR parser. Don't use
1757 default reduction in conflicted states for GLR parser so that there
1758 are spaces for the conflict lists.
1759 (save_row): Also save conflict information.
1760 (token_actions): Allocate conflict list.
1761 (merger_output): New function.
1762 (pack_vector): Pack conflict table, too.
1763 (output_conflicts): New function to output yyconflp and yyconfl.
1764 (output_check): Allocate conflict_tos.
1765 (output_actions): Output conflict tables, also.
1766 (output_skeleton): Output b4_mergers definition.
1767 (prepare): Output b4_max_rhs_length definition.
1768 Use 'bison.glr' as default skeleton for GLR parsers.
1769
1770 * src/gram.c (glr_parser): New flag.
1771 (grammar_free): Call free_merger_functions.
1772
1773 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
1774 all pairs of conflicting reductions, rather than just all tokens
1775 causing conflicts. Needed to size conflict tables.
1776 (conflicts_output): Modify call to count_rr_conflicts for new
1777 interface.
1778 (conflicts_print): Ditto.
1779 (count_total_conflicts): New function.
1780
1781 * src/reader.h (merger_list): New type.
1782 (merge_functions): New variable.
1783
1784 * src/lex.h (tok_dprec, tok_merge): New token types.
1785
1786 * src/gram.h (rule_s): Add dprec and merger fields.
1787 (glr_parser): New flag.
1788
1789 * src/conflicts.h (count_total_conflicts): New function.
1790
1791 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
1792
1793 * doc/bison.texinfo (Generalized LR Parsing): New section.
1794 (GLR Parsers): New section.
1795 (Language and Grammar): Mention GLR parsing.
1796 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
1797 Correct typo ("tge" -> "the").
1798
1799 * data/bison.glr: New skeleton for GLR parsing.
1800
1801 * tests/cxx-gram.at: New tests for GLR parsing.
1802
1803 * tests/testsuite.at: Include cxx-gram.at.
1804
1805 * tests/Makefile.am: Add cxx-gram.at.
1806
1807 * src/parse-gram.y:
1808
1809 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
1810
1811 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
1812
18132002-06-27 Akim Demaille <akim@epita.fr>
1814
1815 * src/options.h, src/options.c: Remove.
1816 * src/getargs.c (short_options, long_options): New.
1817
18182002-06-27 Akim Demaille <akim@epita.fr>
1819
1820 * data/bison.simple, data/bison.c++: Rename as...
1821 * data/yacc.c, data/lalr1.cc: these.
1822 * doc/bison.texinfo (Environment Variables): Remove.
1823
18242002-06-25 Raja R Harinath <harinath@cs.umn.edu>
1825
1826 * src/getargs.c (report_argmatch): Initialize strtok().
1827
18282002-06-20 Akim Demaille <akim@epita.fr>
1829
1830 * data/bison.simple (b4_symbol_actions): New, replaces...
1831 (b4_symbol_destructor, b4_symbol_printer): these.
1832 (yysymprint): Be sure to call YYPRINT only for tokens, and using
1833 user token numbers.
1834
18352002-06-20 Akim Demaille <akim@epita.fr>
1836
1837 * data/bison.simple (yydestructor): Rename as...
1838 (yydestruct): this.
1839
18402002-06-20 Akim Demaille <akim@epita.fr>
1841
1842 * src/symtab.h, src/symtab.c (symbol_type_set)
1843 (symbol_destructor_set, symbol_precedence_set): The location is
1844 the last argument.
1845 Adjust all callers.
1846
18472002-06-20 Akim Demaille <akim@epita.fr>
1848
1849 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
1850 internals.
1851 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
1852 Takes a location.
1853 * src/symtab.h, src/symtab.c (symbol_class_set)
1854 (symbol_user_token_number_set): Likewise.
1855 Adjust all callers.
1856 Promote complain_at.
1857 * tests/input.at (Type Clashes): Adjust.
1858
18592002-06-20 Akim Demaille <akim@epita.fr>
1860
1861 * data/bison.simple (YYLEX): Fix the declaration when
1862 %pure-parser.
1863
18642002-06-20 Akim Demaille <akim@epita.fr>
1865
1866 * data/bison.simple (yysymprint): Don't print the token number,
1867 just its name.
1868 * tests/actions.at (Destructors): Rename as...
1869 (Printers and Destructors): this.
1870 Also exercise %printer.
1871
18722002-06-20 Akim Demaille <akim@epita.fr>
1873
1874 * data/bison.simple (YYDSYMPRINT): New.
1875 Use it to remove many of the #if YYDEBUG/if (yydebug).
1876
18772002-06-20 Akim Demaille <akim@epita.fr>
1878
1879 * src/symtab.h, src/symtab.c (symbol_t): printer and
1880 printer_location are new members.
1881 (symbol_printer_set): New.
1882 * src/parse-gram.y (PERCENT_PRINTER): New token.
1883 Handle its associated rule.
1884 * src/scan-gram.l: Adjust.
1885 (handle_destructor_at, handle_destructor_dollar): Rename as...
1886 (handle_symbol_code_at, handle_symbol_code_dollar): these.
1887 * src/output.c (symbol_printers_output): New.
1888 (output_skeleton): Call it.
1889 * data/bison.simple (yysymprint): New. Cannot be named yyprint
1890 since there are already many grammar files with a user `yyprint'.
1891 Replace the calls to YYPRINT to calls to yysymprint.
1892 * tests/calc.at: Adjust.
1893 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
1894 taking advantage of parser very internal details (stack size!).
1895
18962002-06-20 Akim Demaille <akim@epita.fr>
1897
1898 * src/scan-gram.l: Complete the scanner with the missing patterns
1899 to pacify Flex.
1900 Use `quote' and `symbol_tag_get' where appropriate.
1901
19022002-06-19 Akim Demaille <akim@epita.fr>
1903
1904 * tests/actions.at (Destructors): Augment to test locations.
1905 * data/bison.simple (yydestructor): Pass it the current location
1906 if locations are enabled.
1907 Prototype only when __STDC__ or C++.
1908 Change the argument names to move into the yy name space: there is
1909 user code here.
1910
19112002-06-19 Akim Demaille <akim@epita.fr>
1912
1913 * data/bison.simple (b4_pure_if): New.
1914 Use it instead of #ifdef YYPURE.
1915
19162002-06-19 Akim Demaille <akim@epita.fr>
1917
1918 * data/bison.simple (b4_location_if): New.
1919 Use it instead of #ifdef YYLSP_NEEDED.
1920
19212002-06-19 Akim Demaille <akim@epita.fr>
1922
1923 Prepare @$ in %destructor, but currently don't bind it in the
1924 skeleton, as %location use is not cleaned up yet.
1925
1926 * src/scan-gram.l (handle_dollar, handle_destructor_at)
1927 (handle_action_at): New.
1928 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
1929 a braced_code_t and a location as additional arguments.
1930 (handle_destructor_dollar): Instead of requiring `b4_eval', just
1931 unquote one when outputting `b4_dollar_dollar'.
1932 Adjust callers.
1933 * data/bison.simple (b4_eval): Remove.
1934 (b4_symbol_destructor): Adjust.
1935 * tests/input.at (Invalid @n): Adjust.
1936
19372002-06-19 Zack Weinberg <zack@codesourcery.com>
1938
1939 * doc/bison.texinfo: Document ability to have multiple
1940 prologue sections.
1941
19422002-06-18 Akim Demaille <akim@epita.fr>
1943
1944 * src/files.c (compute_base_names): When computing the output file
1945 names from the input file name, strip the directory part.
1946
19472002-06-18 Akim Demaille <akim@epita.fr>
1948
1949 * data/bison.simple.new: Comment changes.
1950 Reported by Andreas Schwab.
1951
19522002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
1953
1954 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
1955 there are no `label `yyoverflowlab' defined but not used' warnings
1956 when yyoverflow is defined.
1957
19582002-06-18 Akim Demaille <akim@epita.fr>
1959
1960 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
1961 new member.
1962 (symbol_destructor_set): Adjust.
1963 * src/output.c (symbol_destructors_output): Output the destructor
1964 locations.
1965 Output the symbol name.
1966 * data/bison.simple (b4_symbol_destructor): Adjust.
1967
19682002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
1969 and Akim Demaille <akim@epita.fr>
1970
1971 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
1972 what's left on the stack when the error recovery hits EOF.
1973 * tests/actions.at (Destructors): Complete to exercise this case.
1974
19752002-06-17 Akim Demaille <akim@epita.fr>
1976
1977 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
1978 arguments is really empty, not only equal to `[]'.
1979 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
1980 member.
1981 (symbol_destructor_set): New.
1982 * src/output.c (symbol_destructors_output): New.
1983 * src/reader.h (brace_code_t, current_braced_code): New.
1984 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
1985 (handle_dollar): Rename as...
1986 (handle_action_dollar): this.
1987 (handle_destructor_dollar): New.
1988 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
1989 (grammar_declaration): Use it.
1990 * data/bison.simple (yystos): Is always defined.
1991 (yydestructor): New.
1992 * tests/actions.at (Destructors): New.
1993 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
1994
19952002-06-17 Akim Demaille <akim@epita.fr>
1996
1997 * src/symlist.h, src/symlist.c (symbol_list_length): New.
1998 * src/scan-gram.l (handle_dollar, handle_at): Compute the
1999 rule_length only when needed.
2000 * src/output.c (actions_output, token_definitions_output): Output
2001 the full M4 block.
2002 * src/symtab.c: Don't access directly to the symbol tag, use
2003 symbol_tag_get.
2004 * src/parse-gram.y: Use symbol_list_free.
2005
20062002-06-17 Akim Demaille <akim@epita.fr>
2007
2008 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
2009 (symbol_list_prepend, get_type_name): Move to...
2010 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
2011 (symbol_list_prepend, symbol_list_n_type_name_get): here.
2012 Adjust all callers.
2013 (symbol_list_free): New.
2014 * src/scan-gram.l (handle_dollar): Takes a location.
2015 * tests/input.at (Invalid $n): Adjust.
2016
20172002-06-17 Akim Demaille <akim@epita.fr>
2018
2019 * src/reader.h, src/reader.c (symbol_list_new): Export it.
2020 (symbol_list_prepend): New.
2021 * src/parse-gram.y (%union): `list' is a new member.
2022 (symbols.1): New, replaces...
2023 (terms_to_prec.1, nterms_to_type.1): these.
2024 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
2025 Take a location as additional argument.
2026 Adjust all callers.
2027
20282002-06-15 Akim Demaille <akim@epita.fr>
2029
2030 * src/parse-gram.y: Move %token in the declaration section so that
2031 we don't depend upon CVS Bison.
2032
20332002-06-15 Akim Demaille <akim@epita.fr>
2034
2035 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
2036 * src/print.c (print_core): Use it.
2037
20382002-06-15 Akim Demaille <akim@epita.fr>
2039
2040 * src/conflicts.c (log_resolution): Accept the rule involved in
2041 the sr conflicts instead of the lookahead number that points to
2042 that rule.
2043 (flush_reduce): Accept the current lookahead vector as argument,
2044 instead of the index in LA.
2045 (resolve_sr_conflict): Accept the current number of lookahead
2046 bitset to consider for the STATE, instead of the index in LA.
2047 (set_conflicts): Adjust.
2048 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
2049
20502002-06-15 Akim Demaille <akim@epita.fr>
2051
2052 * src/state.h (state_t): Replace the `lookaheadsp' member, a
2053 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
2054 Adjust all dependencies.
2055 * src/lalr.c (initialize_lookaheads): Split into...
2056 (states_lookaheads_count, states_lookaheads_initialize): these.
2057 (lalr): Adjust.
2058
20592002-06-15 Akim Demaille <akim@epita.fr>
2060
2061 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
2062 out of...
2063 (grammar_rules_print): here.
2064 * src/reduce.c (reduce_output): Use it.
2065 * tests/reduce.at (Useless Rules, Reduced Automaton)
2066 (Underivable Rules): Adjust.
2067
20682002-06-15 Akim Demaille <akim@epita.fr>
2069
2070 Copy BYacc's nice way to report the grammar.
2071
2072 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
2073 New.
2074 Don't print the rules' location, it is confusing and useless.
2075 (rule_print): Use grammar_rhs_print.
2076 * src/print.c (print_grammar): Use grammar_rules_print.
2077
20782002-06-15 Akim Demaille <akim@epita.fr>
2079
2080 Complete and rationalize `useless thing' warnings.
2081
2082 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
2083 (symbol_tag_print): New.
2084 Use them everywhere in place of accessing directly the tag member.
2085 * src/gram.h, src/gram.c (rule_print): New.
2086 Use it where a rule used to be printed `by hand'.
2087 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
2088 (reduce_grammar_tables): Report the useless rules.
2089 (reduce_print): Useless things are a warning, not an error.
2090 Report it as such.
2091 * tests/reduce.at (Useless Nonterminals, Useless Rules):
2092 (Reduced Automaton, Underivable Rules): Adjust.
2093 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
2094 * tests/conflicts.at (Unresolved SR Conflicts)
2095 (Solved SR Conflicts): Adjust.
2096
20972002-06-15 Akim Demaille <akim@epita.fr>
2098
2099 Let symbols have a location.
2100
2101 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
2102 (getsym): Adjust.
2103 Adjust all callers.
2104 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
2105 Use location_t, not int.
2106 * src/symtab.c (symbol_check_defined): Take advantage of the
2107 location.
2108 * tests/regression.at (Invalid inputs): Adjust.
2109
21102002-06-15 Akim Demaille <akim@epita.fr>
2111
2112 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
2113 (input): Don't try to initialize yylloc here, do it in the
2114 scanner.
2115 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
2116 * src/gram.h (rule_t): Change line and action_line into location
2117 and action_location, of location_t type.
2118 Adjust all dependencies.
2119 * src/location.h, src/location.c (empty_location): New.
2120 * src/reader.h, src/reader.c (grammar_start_symbol_set)
2121 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
2122 (grammar_current_rule_symbol_append)
2123 (grammar_current_rule_action_append): Expect a location as argument.
2124 * src/reader.c (grammar_midrule_action): Adjust to attach an
2125 action's location as dummy symbol location.
2126 * src/symtab.h, src/symtab.c (startsymbol_location): New.
2127 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
2128 the line numbers.
2129
21302002-06-14 Akim Demaille <akim@epita.fr>
2131
2132 Grammar declarations may be found in the grammar section.
2133
2134 * src/parse-gram.y (rules_or_grammar_declaration): New.
2135 (declarations): Each declaration may end with a semicolon, not
2136 just...
2137 (grammar_declaration): `"%union"'.
2138 (grammar): Branch to rules_or_grammar_declaration.
2139
21402002-06-14 Akim Demaille <akim@epita.fr>
2141
2142 * src/main.c (main): Invoke scanner_free.
2143
21442002-06-14 Akim Demaille <akim@epita.fr>
2145
2146 * src/output.c (m4_invoke): Extracted from...
2147 (output_skeleton): here.
2148 Free tempfile.
2149
21502002-06-14 Akim Demaille <akim@epita.fr>
2151
2152 * src/parse-gram.y (directives, directive, gram)
2153 (grammar_directives, precedence_directives, precedence_directive):
2154 Rename as...
2155 (declarations, declaration, grammar, grammar_declaration)
2156 (precedence_declaration, precedence_declarator): these.
2157 (symbol_declaration): New.
2158
21592002-06-14 Akim Demaille <akim@epita.fr>
2160
2161 * src/files.c (action_obstack): Remove, unused.
2162 (output_obstack): Remove it, and all its dependencies, as it is no
2163 longer needed.
2164 * src/reader.c (epilogue_set): Build the epilogue in the
2165 muscle_obstack.
2166 * src/output.h, src/output.c (muscle_obstack): Move to...
2167 * src/muscle_tab.h, src/muscle_tab.h: here.
2168 (muscle_init): Initialize muscle_obstack.
2169 (muscle_free): New.
2170 * src/main.c (main): Call it.
2171
21722002-06-14 Akim Demaille <akim@epita.fr>
2173
2174 * src/location.h: New, extracted from...
2175 * src/reader.h: here.
2176 * src/Makefile.am (noinst_HEADERS): Merge into
2177 (bison_SOURCES): this.
2178 Add location.h.
2179 * src/parse-gram.y: Use location_t instead of Bison's.
2180 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
2181 Use location_t instead of ints.
2182
21832002-06-14 Akim Demaille <akim@epita.fr>
2184
2185 * data/bison.simple, data/bison.c++: Be sure to restore the
2186 current #line when returning to the skeleton contents after having
2187 exposed the input file's #line.
2188
21892002-06-12 Akim Demaille <akim@epita.fr>
2190
2191 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
2192 eager.
2193 * tests/actions.at (Exotic Dollars): New.
2194
21952002-06-12 Akim Demaille <akim@epita.fr>
2196
2197 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
2198 ['"/] too eagerly.
2199 * tests/input.at (Torturing the Scanner): New.
2200
22012002-06-11 Akim Demaille <akim@epita.fr>
2202
2203 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
2204 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
2205 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
2206 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
2207 * src/reader.c (reader): Use it.
2208
22092002-06-11 Akim Demaille <akim@epita.fr>
2210
2211 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
2212 Adjust all callers.
2213 (scanner_last_string_free): New.
2214
22152002-06-11 Akim Demaille <akim@epita.fr>
2216
2217 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
2218 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
2219 (last_string, YY_OBS_FREE): New.
2220 Use them when returning an ID.
2221
22222002-06-11 Akim Demaille <akim@epita.fr>
2223
2224 Have Bison grammars parsed by a Bison grammar.
2225
2226 * src/reader.c, src/reader.h (prologue_augment): New.
2227 * src/reader.c (copy_definition): Remove.
2228
2229 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
2230 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
2231 (grammar_current_rule_prec_set, grammar_current_rule_check)
2232 (grammar_current_rule_symbol_append)
2233 (grammar_current_rule_action_append): Export.
2234 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
2235 (symbol_list_action_append): Remove.
2236 Hook the routines from reader.
2237 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
2238 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
2239
2240 * src/reader.c (read_declarations): Remove, unused.
2241
2242 * src/parse-gram.y: Handle the epilogue.
2243 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
2244 (grammar_start_symbol_set): this.
2245 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
2246 * src/reader.c (readgram): Remove, unused.
2247 (reader): Adjust to insert eoftoken and axiom where appropriate.
2248
2249 * src/reader.c (copy_dollar): Replace with...
2250 * src/scan-gram.h (handle_dollar): this.
2251 * src/parse-gram.y: Remove `%thong'.
2252
2253 * src/reader.c (copy_at): Replace with...
2254 * src/scan-gram.h (handle_at): this.
2255
2256 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
2257 New.
2258
2259 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
2260 time being.
2261
2262 * src/reader.h, src/reader.c (grammar_rule_end): New.
2263
2264 * src/parse.y (current_type, current_class): New.
2265 Implement `%nterm', `%token' support.
2266 Merge `%term' into `%token'.
2267 (string_as_id): New.
2268 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
2269 type name.
2270
2271 * src/parse-gram.y: Be sure to handle properly the beginning of
2272 rules.
2273
2274 * src/parse-gram.y: Handle %type.
2275 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
2276
2277 * src/parse-gram.y: More directives support.
2278 * src/options.c: No longer handle source directives.
2279
2280 * src/parse-gram.y: Fix %output.
2281
2282 * src/parse-gram.y: Handle %union.
2283 Use the prologue locations.
2284 * src/reader.c (parse_union_decl): Remove.
2285
2286 * src/reader.h, src/reader.c (epilogue_set): New.
2287 * src/parse-gram.y: Use it.
2288
2289 * data/bison.simple, data/bison.c++: b4_stype is now either not
2290 defined, then default to int, or to the contents of %union,
2291 without `union' itself.
2292 Adjust.
2293 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
2294
2295 * src/output.c (actions_output): Don't output braces, as they are
2296 already handled by the scanner.
2297
2298 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
2299 characters to themselves.
2300
2301 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
2302 that the epilogue has a proper #line.
2303
2304 * src/parse-gram.y: Handle precedence/associativity.
2305
2306 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
2307 a terminal.
2308 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
2309 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
2310 at all to define terminals that cannot be emitted.
2311
2312 * src/scan-gram.l: Escape M4 characters.
2313
2314 * src/scan-gram.l: Working properly with escapes in user
2315 strings/characters.
2316
2317 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
2318 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
2319 grammar.
2320 Use more modest sizes, as for the time being the parser does not
2321 release memory, and therefore the process swallows a huge amount
2322 of memory.
2323
2324 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
2325 stricter %token grammar.
2326
2327 * src/symtab.h (associativity): Add `undef_assoc'.
2328 (symbol_precedence_set): Do nothing when passed an undef_assoc.
2329 * src/symtab.c (symbol_check_alias_consistence): Adjust.
2330
2331 * tests/regression.at (Invalid %directive): Remove, as it is now
2332 meaningless.
2333 (Invalid inputs): Adjust to the new error messages.
2334 (Token definitions): The new grammar doesn't allow too many
2335 eccentricities.
2336
2337 * src/lex.h, src/lex.c: Remove.
2338 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
2339 (copy_character, copy_string2, copy_string, copy_identifier)
2340 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
2341 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
2342 (parse_action): Remove.
2343 * po/POTFILES.in: Adjust.
2344
23452002-06-11 Akim Demaille <akim@epita.fr>
2346
2347 * src/reader.c (parse_action): Don't store directly into the
2348 rule's action member: return the action as a string.
2349 Don't require `rule_length' as an argument: compute it.
2350 (grammar_current_rule_symbol_append)
2351 (grammar_current_rule_action_append): New, eved out from
2352 (readgram): here.
2353 Remove `action_flag', `rulelength', unused now.
2354
23552002-06-11 Akim Demaille <akim@epita.fr>
2356
2357 * src/reader.c (grammar_current_rule_prec_set).
2358 (grammar_current_rule_check): New, eved out from...
2359 (readgram): here.
2360 Remove `xaction', `first_rhs': useless.
2361 * tests/input.at (Type clashes): New.
2362 * tests/existing.at (GNU Cim Grammar): Adjust.
2363
23642002-06-11 Akim Demaille <akim@epita.fr>
2365
2366 * src/reader.c (grammar_midrule_action): New, Eved out from
2367 (readgram): here.
2368
23692002-06-11 Akim Demaille <akim@epita.fr>
2370
2371 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
2372 New.
2373 (readgram): Use them as replacement of inlined code, crule and
2374 crule1.
2375
23762002-06-11 Akim Demaille <akim@epita.fr>
2377
2378 * src/reader.c (grammar_end, grammar_symbol_append): New.
2379 (readgram): Use them.
2380 Make the use of `p' as local as possible.
2381
23822002-06-10 Akim Demaille <akim@epita.fr>
2383
2384 GCJ's parser requires the tokens to be defined before the prologue.
2385
2386 * data/bison.simple: Output the token definition before the user's
2387 prologue.
2388 * tests/regression.at (Braces parsing, Duplicate string)
2389 (Mixing %token styles): Check the output from bison.
2390 (Early token definitions): New.
2391
23922002-06-10 Akim Demaille <akim@epita.fr>
2393
2394 * src/symtab.c (symbol_user_token_number_set): Don't complain when
2395 assigning twice the same user number to a token, so that we can
2396 use it in...
2397 * src/lex.c (lex): here.
2398 Also use `symbol_class_set' instead of hand written code.
2399 * src/reader.c (parse_assoc_decl): Likewise.
2400
24012002-06-10 Akim Demaille <akim@epita.fr>
2402
2403 * src/symtab.c, src/symtab.c (symbol_class_set)
2404 (symbol_user_token_number_set): New.
2405 * src/reader.c (parse_token_decl): Use them.
2406 Use a switch instead of ifs.
2407 Use a single argument.
2408
24092002-06-10 Akim Demaille <akim@epita.fr>
2410
2411 Remove `%thong' support as it is undocumented, unused, duplicates
2412 `%token's job, and creates useless e-mail traffic with people who
2413 want to know what it is, why it is undocumented, unused, and
2414 duplicates `%token's job.
2415
2416 * src/reader.c (parse_thong_decl): Remove.
2417 * src/options.c (option_table): Remove "thong".
2418 * src/lex.h (tok_thong): Remove.
2419
24202002-06-10 Akim Demaille <akim@epita.fr>
2421
2422 * src/symtab.c, src/symtab.c (symbol_type_set)
2423 (symbol_precedence_set): New.
2424 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
2425 (value_components_used): Remove, unused.
2426
24272002-06-09 Akim Demaille <akim@epita.fr>
2428
2429 Move symbols handling code out of the reader.
2430
2431 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
2432 (axiom): Move to...
2433 * src/symtab.h, src/symtab.c: here.
2434
2435 * src/gram.c (start_symbol): Remove: use startsymbol->number.
2436 * src/reader.c (startval): Rename as...
2437 * src/symtab.h, src/symtab.c (startsymbol): this.
2438 * src/reader.c: Adjust.
2439
2440 * src/reader.c (symbol_check_defined, symbol_make_alias)
2441 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2442 (token_translations_init)
2443 Move to...
2444 * src/symtab.c: here.
2445 * src/reader.c (packsymbols): Move to...
2446 * src/symtab.h, src/symtab.c (symbols_pack): here.
2447 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
2448 argument.
2449
24502002-06-03 Akim Demaille <akim@epita.fr>
2451
2452 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
2453 then statements.
2454
24552002-06-03 Akim Demaille <akim@epita.fr>
2456
2457 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
2458 structs with non literals.
2459 * src/scan-skel.l: never-interactive.
2460 * src/conflicts.c (enum conflict_resolution_e): No trailing
2461 comma.
2462 * src/getargs.c (usage): Split long literal strings.
2463 Reported by Hans Aberg.
2464
24652002-05-28 Akim Demaille <akim@epita.fr>
2466
2467 * data/bison.c++: Use C++ ostreams.
2468 (cdebug_): New member.
2469
24702002-05-28 Akim Demaille <akim@epita.fr>
2471
2472 * src/output.c (output_skeleton): Be sure to allocate enough room
2473 for `/' _and_ for `\0' in full_skeleton.
2474
24752002-05-28 Akim Demaille <akim@epita.fr>
2476
2477 * data/bison.c++: Catch up with bison.simple:
2478 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2479 and Paul Eggert <eggert@twinsun.com>: `error' handing.
2480 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
2481 and popping traces.
2482
24832002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2484
2485 * src/output.c (output_skeleton): Put an explicit path in front of
2486 the skeleton file name, rather than relying on the -I directory,
2487 to partially alleviate effects of having a skeleton file lying around
2488 in the current directory.
2489
24902002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2491
2492 * src/conflicts.c (log_resolution): Correct typo:
2493 obstack_printf should be obstack_fgrow1.
2494
24952002-05-26 Akim Demaille <akim@epita.fr>
2496
2497 * src/state.h (state_t): `solved_conflicts' is a new member.
2498 * src/LR0.c (new_state): Set it to 0.
2499 * src/conflicts.h, src/conflicts.c (print_conflicts)
2500 (free_conflicts, solve_conflicts): Rename as...
2501 (conflicts_print, conflicts_free, conflicts_solve): these.
2502 Adjust callers.
2503 * src/conflicts.c (enum conflict_resolution_e)
2504 (solved_conflicts_obstack): New, used by...
2505 (log_resolution): this.
2506 Adjust to attach the conflict resolution to each state.
2507 Complete the description with the precedence/associativity
2508 information.
2509 (resolve_sr_conflict): Adjust.
2510 * src/print.c (print_state): Output its solved_conflicts.
2511 * tests/conflicts.at (Unresolved SR Conflicts)
2512 (Solved SR Conflicts): Exercise --report=all.
2513
25142002-05-26 Akim Demaille <akim@epita.fr>
2515
2516 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2517 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2518 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
2519 (token_number_t, item_number_as_token_number)
2520 (token_number_as_item_number, muscle_insert_token_number_table):
2521 Rename as...
2522 (symbol_number_t, item_number_as_symbol_number)
2523 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
2524 these, since it is more appropriate.
2525
25262002-05-26 Akim Demaille <akim@epita.fr>
2527
2528 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
2529 `Error:' lines.
2530 * data/bison.simple (yystos) [YYDEBUG]: New.
2531 (yyparse) [YYDEBUG]: Display the symbols which are popped during
2532 error recovery.
2533 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
2534
25352002-05-25 Akim Demaille <akim@epita.fr>
2536
2537 * doc/bison.texinfo (Debugging): Split into...
2538 (Tracing): this new section, its former contents, and...
2539 (Understanding): this new section.
2540 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
2541 by...
2542 (report_flag): this.
2543 Adjust all dependencies.
2544 (report_args, report_types, report_argmatch): New.
2545 (usage, getargs): Report/support -r, --report.
2546 * src/options.h
2547 (struct option_table_struct): Rename as..,
2548 (struct option_table_s): this.
2549 Rename the `set_flag' member to `flag' to match with getopt_long's
2550 struct.
2551 * src/options.c (option_table): Split verbose into an entry for
2552 %verbose, and another for --verbose.
2553 Support --report/-r, so remove -r from the obsolete --raw.
2554 * src/print.c: Attach full item sets and lookaheads reports to
2555 report_flag instead of trace_flag.
2556 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2557
25582002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2559 and Paul Eggert <eggert@twinsun.com>
2560
2561 * data/bison.simple (yyparse): Correct error handling to conform to
2562 POSIX and yacc. Specifically, after syntax error is discovered,
2563 do not reduce further before shifting the error token.
2564 Clean up the code a bit by removing the labels yyerrdefault,
2565 yyerrhandle, yyerrpop.
2566 * NEWS: Document the above.
2567
25682002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2569
2570 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
2571 type; it isn't always big enough, since it doesn't necessarily
2572 include non-terminals.
2573 (yytranslate): Expand definition of yy_token_number_type, so that
2574 the latter can be removed.
2575 (yy_token_number_type): Remove, only one use.
2576 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
2577 don't use TokenNumberType as element type.
2578
2579 * tests/regression.at: Modify expected output to agree with change
2580 to yyr1 and yytranslate.
2581
25822002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
2583
2584 * src/reader.c (parse_action): Use copy_character instead of
2585 obstack_1grow.
2586
25872002-05-13 Akim Demaille <akim@epita.fr>
2588
2589 * tests/regression.at (Token definitions): Prototype yylex and
2590 yyerror.
2591
25922002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2593
2594 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
2595 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
2596 32-bit arithmetic.
2597 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
2598
25992002-05-07 Akim Demaille <akim@epita.fr>
2600
2601 * tests/synclines.at: Be sure to prototype yylex and yyerror to
2602 avoid GCC warnings.
2603
26042002-05-07 Akim Demaille <akim@epita.fr>
2605
2606 Kill GCC warnings.
2607
2608 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
2609 over the RHS of each rule.
2610 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
2611 * src/state.h (state_t): Member `nitems' is unsigned short.
2612 * src/LR0.c (get_state): Adjust.
2613 * src/reader.c (packgram): Likewise.
2614 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
2615 `Type'.
2616 (muscle_insert_int_table): Remove, unused.
2617 (prepare_rules): Remove `max'.
2618
26192002-05-06 Akim Demaille <akim@epita.fr>
2620
2621 * src/closure.c (print_firsts): Display of the symbol tags.
2622 (bitmatrix_print): Move to...
2623 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
2624 here.
2625 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
2626
26272002-05-06 Akim Demaille <akim@epita.fr>
2628
2629 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
2630 hash_do_for_each.
2631
26322002-05-06 Akim Demaille <akim@epita.fr>
2633
2634 * src/LR0.c (new_state, get_state): Instead of using the global
2635 `kernel_size' and `kernel_base', have two new arguments:
2636 `core_size' and `core'.
2637 Adjust callers.
2638
26392002-05-06 Akim Demaille <akim@epita.fr>
2640
2641 * src/reader.c (packgram): No longer end `ritem' with a 0
2642 sentinel: it is not used.
2643
26442002-05-05 Akim Demaille <akim@epita.fr>
2645
2646 New experimental feature: display the lookaheads in the report and
2647 graph.
2648
2649 * src/print (print_core): When --trace-flag, display the rules
2650 lookaheads.
2651 * src/print_graph.c (print_core): Likewise.
2652 Swap the arguments.
2653 Adjust caller.
2654
26552002-05-05 Akim Demaille <akim@epita.fr>
2656
2657 * tests/torture.at (Many lookaheads): New test.
2658
26592002-05-05 Akim Demaille <akim@epita.fr>
2660
2661 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
2662 (GENERATE_MUSCLE_INSERT_TABLE): this.
2663 (output_int_table, output_unsigned_int_table, output_short_table)
2664 (output_token_number_table, output_item_number_table): Replace with...
2665 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
2666 (muscle_insert_short_table, muscle_insert_token_number_table)
2667 (muscle_insert_item_number_table): these.
2668 Adjust all callers.
2669 (prepare_tokens): Don't free `translations', since...
2670 * src/reader.h, src/reader.c (grammar_free): do it.
2671 Move to...
2672 * src/gram.h, src/gram.c (grammar_free): here.
2673 * data/bison.simple, data/bison.c++: b4_token_number_max is now
2674 b4_translate_max.
2675
26762002-05-05 Akim Demaille <akim@epita.fr>
2677
2678 * src/output.c (output_unsigned_int_table): New.
2679 (prepare_rules): `i' is unsigned.
2680 `prhs', `rline', `r2' are unsigned int.
2681 Rename muscle `rhs_number_max' as `rhs_max'.
2682 Output muscles `prhs_max', `rline_max', and `r2_max'.
2683 Free rline and r1.
2684 * data/bison.simple, data/bison.c++: Adjust to use these muscles
2685 to compute types instead of constant types.
2686 * tests/regression.at (Web2c Actions): Adjust.
2687
26882002-05-04 Akim Demaille <akim@epita.fr>
2689
2690 * src/symtab.h (SALIAS, SUNDEF): Rename as...
2691 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
2692 Adjust dependencies.
2693 * src/output.c (token_definitions_output): Be sure not to output a
2694 `#define 'a'' when fed with `%token 'a' "a"'.
2695 * tests/regression.at (Token definitions): New.
2696
26972002-05-03 Paul Eggert <eggert@twinsun.com>
2698
2699 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
2700 for K&R C.
2701
27022002-05-03 gettextize <bug-gnu-gettext@gnu.org>
2703
2704 * Makefile.am (SUBDIRS): Remove intl.
2705 (EXTRA_DIST): Add config/config.rpath.
2706
27072002-05-03 Akim Demaille <akim@epita.fr>
2708
2709 * data/bison.simple (m4_if): Don't output empty enums.
2710 And actually, output valid enum definitions :(.
2711
27122002-05-03 Akim Demaille <akim@epita.fr>
2713
2714 * configure.bat: Remove, completely obsolete.
2715 * Makefile.am (EXTRA_DIST): Adjust.
2716 Don't distribute config.rpath...
2717 * config/Makefile.am (EXTRA_DIST): Do it.
2718
27192002-05-03 Akim Demaille <akim@epita.fr>
2720
2721 * configure.in (GETTEXT_VERSION): New.
2722 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
2723
27242002-05-03 Akim Demaille <akim@epita.fr>
2725
2726 * data/bison.simple (b4_token_enum): New.
2727 (b4_token_defines): Use it to output tokens both as #define and
2728 enums.
2729 Suggested by Paul Eggert.
2730 * src/output.c (token_definitions_output): Don't output spurious
2731 white spaces.
2732
27332002-05-03 Akim Demaille <akim@epita.fr>
2734
2735 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2736
27372002-05-02 Robert Anisko <robert@lrde.epita.fr>
2738
2739 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
2740 Update the stack class, give a try to deque as the default container.
2741
27422002-05-02 Akim Demaille <akim@epita.fr>
2743
2744 * data/bison.simple (yyparse): Do not implement @$ = @1.
2745 (YYLLOC_DEFAULT): Adjust to do it.
2746 * doc/bison.texinfo (Location Default Action): Fix.
2747
27482002-05-02 Akim Demaille <akim@epita.fr>
2749
2750 * src/reader.c (parse_braces): Merge into...
2751 (parse_action): this.
2752
27532002-05-02 Akim Demaille <akim@epita.fr>
2754
2755 * configure.in (ALL_LINGUAS): Remove.
2756 * po/LINGUAS, hr.po: New.
2757
27582002-05-02 Akim Demaille <akim@epita.fr>
2759
2760 Remove the so called hairy (semantic) parsers.
2761
2762 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
2763 * src/gram.h, src/gram.c (semantic_parser): Remove.
2764 (rule_t): Remove the guard and guard_line members.
2765 * src/lex.h (token_t): remove tok_guard.
2766 * src/options.c (option_table): Remove %guard and %semantic_parser
2767 support.
2768 * src/output.c, src/output.h (guards_output): Remove.
2769 (prepare): Adjust.
2770 (token_definitions_output): Don't output the `T'
2771 tokens (???).
2772 (output_skeleton): Don't output the guards.
2773 * src/files.c, src/files.c (attrsfile): Remove.
2774 * src/reader.c (symbol_list): Remove the guard and guard_line
2775 members.
2776 Adjust dependencies.
2777 (parse_guard): Remove.
2778 * data/bison.hairy: Remove.
2779 * doc/bison.texinfo (Environment Variables): Remove occurrences of
2780 BISON_HAIRY.
2781
27822002-05-02 Akim Demaille <akim@epita.fr>
2783
2784 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
2785 (parse_guard): Rename the formal argument `stack_offset' as
2786 `rule_length', which is more readable.
2787 Adjust callers.
2788 (copy_at, copy_dollar): Instead of outputting the hard coded
2789 values of $$, $n and so forth, output invocation to b4_lhs_value,
2790 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
2791 Note: this patch partially drops `semantic-parser' support: it
2792 always does `rule_length - n', where semantic parsers ought to
2793 always use `-n'.
2794 * data/bison.simple, data/bison.c++ (b4_lhs_value)
2795 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
2796
27972002-05-02 Akim Demaille <akim@epita.fr>
2798
2799 * configure.in (AC_INIT): Bump to 1.49b.
2800 (AM_INIT_AUTOMAKE): Short invocation.
2801
28022002-05-02 Akim Demaille <akim@epita.fr>
2803
2804 Version 1.49a.
2805
28062002-05-01 Akim Demaille <akim@epita.fr>
2807
2808 * src/skeleton.h: Remove.
2809
28102002-05-01 Akim Demaille <akim@epita.fr>
2811
2812 * src/skeleton.h: Fix the #endif.
2813 Reported by Magnus Fromreide.
2814
28152002-04-26 Paul Eggert <eggert@twinsun.com>
2816
2817 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
2818 Define if we define YYSTYPE and YYLTYPE, respectively.
2819 (YYCOPY): Fix [] quoting problem in the non-GCC case.
2820
28212002-04-25 Robert Anisko <robert@lrde.epita.fr>
2822
2823 * src/scan-skel.l: Postprocess quadrigraphs.
2824
2825 * src/reader.c (copy_character): New function, used to output
2826 single characters while replacing `[' and `]' with quadrigraphs, to
2827 avoid troubles with M4 quotes.
2828 (copy_comment): Output characters with copy_character.
2829 (read_additionnal_code): Likewise.
2830 (copy_string2): Likewise.
2831 (copy_definition): Likewise.
2832
2833 * tests/calc.at: Exercise M4 quoting.
2834
28352002-04-25 Akim Demaille <akim@epita.fr>
2836
2837 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
2838 between `!' and the command.
2839 Reported by Paul Eggert.
2840
28412002-04-24 Robert Anisko <robert@lrde.epita.fr>
2842
2843 * tests/calc.at: Exercise prologue splitting.
2844
2845 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
2846 `b4_post_prologue' instead of `b4_prologue'.
2847
2848 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
2849 muscles.
2850 (output): Free pre_prologue_obstack and post_prologue_obstack.
2851 * src/files.h, src/files.c (attrs_obstack): Remove.
2852 (pre_prologue_obstack, post_prologue_obstack): New.
2853 * src/reader.c (copy_definition): Add a parameter to specify the
2854 obstack to fill, instead of using attrs_obstack unconditionally.
2855 (read_declarations): Pass pre_prologue_obstack to copy_definition if
2856 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
2857
28582002-04-23 Paul Eggert <eggert@twinsun.com>
2859
2860 * data/bison.simple: Remove unnecessary commentary and white
2861 space differences from 1_29-branch.
2862 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
2863
2864 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
2865 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
2866 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
2867 constructors or destructors.
2868
2869 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
2870
28712002-04-23 Akim Demaille <akim@epita.fr>
2872
2873 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
2874 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
2875 location with columns.
2876 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
2877 All reported by Paul Eggert.
2878
28792002-04-22 Akim Demaille <akim@epita.fr>
2880
2881 * src/reduce.c (dump_grammar): Move to...
2882 * src/gram.h, src/gram.c (grammar_dump): here.
2883 Be sure to separate long item numbers.
2884 Don't read the members of a rule's prec if its nil.
2885
28862002-04-22 Akim Demaille <akim@epita.fr>
2887
2888 * src/output.c (table_size, table_grow): New.
2889 (MAXTABLE): Remove, replace uses with table_size.
2890 (pack_vector): Instead of dying when the table is too big, grow it.
2891
28922002-04-22 Akim Demaille <akim@epita.fr>
2893
2894 * data/bison.simple (yyr1): Its type is that of a token number.
2895 * data/bison.c++ (r1_): Likewise.
2896 * tests/regression.at (Web2c Actions): Adjust.
2897
28982002-04-22 Akim Demaille <akim@epita.fr>
2899
2900 * src/reader.c (token_translations_init): 256 is now the default
2901 value for the error token, i.e., it will be assigned another
2902 number if the user assigned 256 to one of her tokens.
2903 (reader): Don't force 256 to error.
2904 * doc/bison.texinfo (Symbols): Adjust.
2905 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
2906 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
2907 etc. instead of 10, 20, 30 (which was used to `jump' over error
2908 (256) and undefined (2)).
2909
29102002-04-22 Akim Demaille <akim@epita.fr>
2911
2912 Propagate more token_number_t.
2913
2914 * src/gram.h (token_number_as_item_number)
2915 (item_number_as_token_number): New.
2916 * src/output.c (GENERATE_OUTPUT_TABLE): New.
2917 Use it to create output_item_number_table and
2918 output_token_number_table.
2919 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2920 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
2921 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
2922 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
2923
29242002-04-22 Akim Demaille <akim@epita.fr>
2925
2926 * src/output.h, src/output.c (get_lines_number): Remove.
2927
29282002-04-19 Akim Demaille <akim@epita.fr>
2929
2930 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
2931 as Lex/Flex'.
2932 (Debugging): More details about enabling the debugging features.
2933 (Table of Symbols): Describe $$, $n, @$, and @n.
2934 Suggested by Tim Josling.
2935
29362002-04-19 Akim Demaille <akim@epita.fr>
2937
2938 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
2939
29402002-04-10 Akim Demaille <akim@epita.fr>
2941
2942 * src/system.h: Rely on HAVE_LIMITS_H.
2943 Suggested by Paul Eggert.
2944
29452002-04-09 Akim Demaille <akim@epita.fr>
2946
2947 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
2948 full stderr, and strip it according to the bison options, instead
2949 of composing the error message from different bits.
2950 This makes it easier to check for several error messages.
2951 Adjust all the invocations.
2952 Add an invocation exercising the error token.
2953 Add an invocation demonstrating a stupid error message.
2954 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
2955 Adjust the tests.
2956 Error message are for stderr, not stdout.
2957
29582002-04-09 Akim Demaille <akim@epita.fr>
2959
2960 * src/gram.h, src/gram.c (error_token_number): Remove, use
2961 errtoken->number.
2962 * src/reader.c (reader): Don't specify the user token number (2)
2963 for $undefined, as it uselessly prevents using it.
2964 * src/gram.h (token_number_t): Move to...
2965 * src/symtab.h: here.
2966 (state_t.number): Is a token_number_t.
2967 * src/print.c, src/reader.c: Use undeftoken->number instead of
2968 hard coded 2.
2969 (Even though this 2 is not the same as above: the number of the
2970 undeftoken remains being 2, it is its user token number which
2971 might not be 2).
2972 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
2973 `user_token_number_max'.
2974 Output `undef_token_number'.
2975 * data/bison.simple, data/bison.c++: Use them.
2976 Be sure to map invalid yylex return values to
2977 `undef_token_number'. This saves us from gratuitous SEGV.
2978
2979 * tests/conflicts.at (Solved SR Conflicts)
2980 (Unresolved SR Conflicts): Adjust.
2981 * tests/regression.at (Web2c Actions): Adjust.
2982
29832002-04-08 Akim Demaille <akim@epita.fr>
2984
2985 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
2986 Adding #line.
2987 Remove the duplicate `typedefs'.
2988 (RhsNumberType): Fix the declaration and various other typos.
2989 Use __ofile__.
2990 * data/bison.simple: Use __ofile__.
2991 * src/scan-skel.l: Handle __ofile__.
2992
29932002-04-08 Akim Demaille <akim@epita.fr>
2994
2995 * src/gram.h (item_number_t): New, the type of item numbers in
2996 RITEM. Note that it must be able to code symbol numbers as
2997 positive number, and the negation of rule numbers as negative
2998 numbers.
2999 Adjust all dependencies (pretty many).
3000 * src/reduce.c (rule): Remove this `short *' pointer: use
3001 item_number_t.
3002 * src/system.h (MINSHORT, MAXSHORT): Remove.
3003 Include `limits.h'.
3004 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
3005 (shortcpy): Remove.
3006 (MAXTABLE): Move to...
3007 * src/output.c (MAXTABLE): here.
3008 (prepare_rules): Use output_int_table to output rhs.
3009 * data/bison.simple, data/bison.c++: Adjust.
3010 * tests/torture.at (Big triangle): Move the limit from 254 to
3011 500.
3012 * tests/regression.at (Web2c Actions): Ajust.
3013
3014 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
3015 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
3016 passes, but produces negative #line number, once fixed, GCC is
3017 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
3018 C), it passes.
3019 * src/state.h (state_h): Code input lines on ints, not shorts.
3020
30212002-04-08 Akim Demaille <akim@epita.fr>
3022
3023 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
3024 and then the grammar.
3025
30262002-04-08 Akim Demaille <akim@epita.fr>
3027
3028 * src/system.h: No longer using strndup.
3029
30302002-04-07 Akim Demaille <akim@epita.fr>
3031
3032 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
3033 * src/output.c (output_table_data): Return the longest number.
3034 (prepare_tokens): Output `token_number_max').
3035 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
3036 New.
3037 Use them to define yy_token_number_type/TokenNumberType.
3038 Use this type for yytranslate.
3039 * tests/torture.at (Big triangle): Push the limit from 124 to
3040 253.
3041 * tests/regression.at (Web2c Actions): Adjust.
3042
30432002-04-07 Akim Demaille <akim@epita.fr>
3044
3045 * tests/torture.at (Big triangle): New.
3046 (GNU AWK Grammar, GNU Cim Grammar): Move to...
3047 * tests/existing.at: here.
3048
30492002-04-07 Akim Demaille <akim@epita.fr>
3050
3051 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
3052 nritems.
3053 Adjust dependencies.
3054
30552002-04-07 Akim Demaille <akim@epita.fr>
3056
3057 * src/reader.c: Normalize increments to prefix form.
3058
30592002-04-07 Akim Demaille <akim@epita.fr>
3060
3061 * src/reader.c, symtab.c: Remove debugging code.
3062
30632002-04-07 Akim Demaille <akim@epita.fr>
3064
3065 Rename all the `bucket's as `symbol_t'.
3066
3067 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
3068 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
3069 * src/symtab.c, src/symtab.h (bucket): Rename as...
3070 (symbol_t): this.
3071 (symbol_list_new, bucket_check_defined, bucket_make_alias)
3072 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
3073 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3074 (buckets_new, buckets_free, buckets_do): Rename as...
3075 (symbol_list_new, symbol_check_defined, symbol_make_alias)
3076 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
3077 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
3078 (symbols_new, symbols_free, symbols_do): these.
3079
30802002-04-07 Akim Demaille <akim@epita.fr>
3081
3082 Use lib/hash for the symbol table.
3083
3084 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
3085 EOF.
3086 * src/lex.c (lex): Set the `number' member of new terminals.
3087 * src/reader.c (bucket_check_defined, bucket_make_alias)
3088 (bucket_check_alias_consistence, bucket_translation): New.
3089 (reader, grammar_free, readgram, token_translations_init)
3090 (packsymbols): Adjust.
3091 (reader): Number the predefined tokens.
3092 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
3093 for predefined tokens.
3094 * src/symtab.h (bucket): Remove all the hash table related
3095 members.
3096 * src/symtab.c (symtab): Replace by...
3097 (bucket_table): this.
3098 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3099 (buckets_new, buckets_do): New.
3100
31012002-04-07 Akim Demaille <akim@epita.fr>
3102
3103 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
3104 (start_symbol, max_user_token_number, semantic_parser)
3105 (error_token_number): Initialize.
3106 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
3107 Initialize.
3108 (reader): Don't.
3109 (errtoken, eoftoken, undeftoken, axiom): Extern.
3110
31112002-04-07 Akim Demaille <akim@epita.fr>
3112
3113 * src/gram.h (rule_s): prec and precsym are now pointers
3114 to the bucket giving the priority/associativity.
3115 Member `associativity' removed: useless.
3116 * src/reduce.c, src/conflicts.c: Adjust.
3117
31182002-04-07 Akim Demaille <akim@epita.fr>
3119
3120 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
3121 Properly escape the symbols' TAG when outputting them.
3122
31232002-04-07 Akim Demaille <akim@epita.fr>
3124
3125 * src/lalr.h (LA): Is a bitsetv, not bitset*.
3126
31272002-04-07 Akim Demaille <akim@epita.fr>
3128
3129 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
3130 (LArule): this, which is an array to rule_t*.
3131 * src/print.c, src/conflicts.c: Adjust.
3132
31332002-04-07 Akim Demaille <akim@epita.fr>
3134
3135 * src/gram.h (rule_t): Rename `number' as `user_number'.
3136 `number' is a new member.
3137 Adjust dependencies.
3138 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
3139
31402002-04-07 Akim Demaille <akim@epita.fr>
3141
3142 As a result of the previous patch, it is no longer needed
3143 to reorder ritem itself.
3144
3145 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
3146
31472002-04-07 Akim Demaille <akim@epita.fr>
3148
3149 Be sure never to walk through RITEMS, but use only data related to
3150 the rules themselves. RITEMS should be banished.
3151
3152 * src/output.c (output_token_translations): Rename as...
3153 (prepare_tokens): this.
3154 In addition to `translate', prepare the muscles `tname' and
3155 `toknum', which were handled by...
3156 (output_rule_data): this.
3157 Remove, and move the remainder of its outputs into...
3158 (prepare_rules): this new routines, which also merges content from
3159 (output_gram): this.
3160 (prepare_rules): Be sure never to walk through RITEMS.
3161 (output_stos): Rename as...
3162 (prepare_stos): this.
3163 (output): Always invoke prepare_states, after all, just don't use it
3164 in the output if you don't need it.
3165
31662002-04-07 Akim Demaille <akim@epita.fr>
3167
3168 * src/LR0.c (new_state): Display `nstates' as the name of the
3169 newly created state.
3170 Adjust to initialize first_state and last_state if needed.
3171 Be sure to distinguish the initial from the final state.
3172 (new_states): Create the itemset of the initial state, and use
3173 new_state.
3174 * src/closure.c (closure): Now that the initial state has its
3175 items properly set, there is no need for a special case when
3176 creating `ruleset'.
3177
3178 As a result, now the rule 0, reducing to $axiom, is visible in the
3179 outputs. Adjust the test suite.
3180
3181 * tests/conflicts.at (Solved SR Conflicts)
3182 (Unresolved SR Conflicts): Adjust.
3183 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
3184 * tests/conflicts.at (S/R in initial): New.
3185
31862002-04-07 Akim Demaille <akim@epita.fr>
3187
3188 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
3189 the RHS of the rules.
3190 * src/output.c (output_gram): Likewise.
3191
31922002-04-07 Akim Demaille <akim@epita.fr>
3193
3194 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
3195 bucket.
3196 Adjust all dependencies.
3197 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
3198 `number' of the buckets too.
3199 * src/gram.h: Include `symtab.h'.
3200 (associativity): Move to...
3201 * src/symtab.h: here.
3202 No longer include `gram.h'.
3203
32042002-04-07 Akim Demaille <akim@epita.fr>
3205
3206 * src/gram.h, src/gram.c (rules_rhs_length): New.
3207 (ritem_longest_rhs): Use it.
3208 * src/gram.h (rule_t): `number' is a new member.
3209 * src/reader.c (packgram): Set it.
3210 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
3211 the end of `rules', and count them out of `nrules'.
3212 (reduce_output, dump_grammar): Adjust.
3213 * src/print.c (print_grammar): It is no longer needed to check for
3214 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
3215 * tests/reduce.at (Reduced Automaton): New test.
3216
32172002-04-07 Akim Demaille <akim@epita.fr>
3218
3219 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
3220 lacking `+ 1' to nrules, Bison reported as useless a token if it
3221 was used solely to set the precedence of the last rule...
3222
32232002-04-07 Akim Demaille <akim@epita.fr>
3224
3225 * data/bison.c++, data/bison.simple: Don't output the current file
3226 name in #line, to avoid useless diffs between two identical
3227 outputs under different names.
3228
32292002-04-07 Akim Demaille <akim@epita.fr>
3230
3231 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
3232 Normalize loops to using `< nrules + 1', not `<= nrules'.
3233
32342002-04-07 Akim Demaille <akim@epita.fr>
3235
3236 * TODO: Update.
3237
32382002-04-07 Akim Demaille <akim@epita.fr>
3239
3240 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
3241 bucket.value as bucket.number.
3242
32432002-04-07 Akim Demaille <akim@epita.fr>
3244
3245 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
3246 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
3247 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
3248 RHS, instead of being an index in RITEMS.
3249
32502002-04-04 Paul Eggert <eggert@twinsun.com>
3251
3252 * doc/bison.texinfo: Update copyright date.
3253 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
3254 (Symbols): Warn about running Bison in one character set,
3255 but compiling and/or running in an incompatible one.
3256 Warn about character code 256, too.
3257
32582002-04-03 Paul Eggert <eggert@twinsun.com>
3259
3260 * src/bison.data (YYSTACK_ALLOC): Depend on whether
3261 YYERROR_VERBOSE is nonzero, not whether it is defined.
3262
3263 Merge changes from bison-1_29-branch.
3264
32652002-03-20 Paul Eggert <eggert@twinsun.com>
3266
3267 Merge fixes from Debian bison_1.34-1.diff.
3268
3269 * configure.in (AC_PREREQ): 2.53.
3270
32712002-03-20 Akim Demaille <akim@epita.fr>
3272
3273 * src/conflicts.c (log_resolution): Argument `resolution' is const.
3274
32752002-03-19 Paul Eggert <eggert@twinsun.com>
3276
3277 * src/bison.simple (YYCOPY): New macro.
3278 (YYSTACK_RELOCATE): Use it.
3279 Remove Type arg; no longer needed. All callers changed.
3280 (yymemcpy): Remove; no longer needed.
3281
3282 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
3283 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3284
32852002-03-19 Akim Demaille <akim@epita.fr>
3286
3287 Test and fix the #line outputs.
3288
3289 * tests/atlocal.at (GCC): New.
3290 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
3291 (Prologue synch line, ,%union synch line, Postprologue synch line)
3292 (Action synch line, Epilogue synch line): New tests.
3293 * src/reader.c (parse_union_decl): Define the muscle stype_line.
3294 * data/bison.simple, data/bison.c++: Use it.
3295
32962002-03-19 Akim Demaille <akim@epita.fr>
3297
3298 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
3299 (Solved SR Conflicts, %expect not enough, %expect right)
3300 (%expect too much): Move to...
3301 * tests/conflicts.at: this new file.
3302
33032002-03-19 Akim Demaille <akim@epita.fr>
3304
3305 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
3306 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
3307 that we can move to enums for instance.
3308 * src/output.c (token_definitions_output): Output a list of
3309 `token-name, token-number' instead of the #define.
3310 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
3311
33122002-03-14 Akim Demaille <akim@epita.fr>
3313
3314 Use Gettext 0.11.1.
3315
33162002-03-09 Robert Anisko <robert@lrde.epita.fr>
3317
3318 * data/bison.c++: Make the user able to add members to the generated
3319 parser by subclassing.
3320
33212002-03-05 Robert Anisko <robert@lrde.epita.fr>
3322
3323 * src/reader.c (read_additionnal_code): `c' should be an integer, not
3324 a character.
3325 Reported by Nicolas Tisserand and Nicolas Burrus.
3326
33272002-03-04 Robert Anisko <robert@lrde.epita.fr>
3328
3329 * src/reader.c: Warn about lacking semi-colons, do not complain.
3330
33312002-03-04 Robert Anisko <robert@lrde.epita.fr>
3332
3333 * data/bison.c++: Remove a debug line.
3334
33352002-03-04 Robert Anisko <robert@lrde.epita.fr>
3336
3337 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
3338 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
3339 provide a default implementation.
3340
33412002-03-04 Akim Demaille <akim@epita.fr>
3342
3343 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
3344 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
3345 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
3346 * tests/semantic.at (Parsing Guards): Similarly.
3347 * src/reader.at (readgram): Complain if the last rule is not ended
3348 with a semi-colon.
3349
33502002-03-04 Akim Demaille <akim@epita.fr>
3351
3352 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
3353 * src/closure.c: here.
3354 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
3355 RTC.
3356 * src/warshall.h, src/warshall.c: Remove.
3357 * tests/sets.at (Broken Closure): Adjust.
3358
33592002-03-04 Akim Demaille <akim@epita.fr>
3360
3361 * src/output.c (output_skeleton): tempdir is const.
3362 bytes_read is unused.
3363
33642002-03-04 Akim Demaille <akim@epita.fr>
3365
3366 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
3367 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
3368 Update.
3369 From Michael Hayes.
3370
33712002-03-04 Akim Demaille <akim@epita.fr>
3372
3373 * src/closure.c (closure): `r' is unused.
3374
33752002-03-04 Akim Demaille <akim@epita.fr>
3376
3377 * tests/sets.at (Broken Closure): Add the ending `;'.
3378 * src/reader.at (readgram): Complain if a rule is not ended with a
3379 semi-colon.
3380
33812002-03-04 Akim Demaille <akim@epita.fr>
3382
3383 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
3384 (count_sr_conflicts): Use bitset_count.
3385 * src/reduce.c (inaccessable_symbols): Ditto.
3386 (bits_size): Remove.
3387 * src/warshall.h, src/warshall.c: Convert to bitsetv.
3388
33892002-03-04 Akim Demaille <akim@epita.fr>
3390
3391 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
3392 * src/reduce.c: Remove the `bitset_zero's following the
3393 `bitset_create's, as now it is performed by the latter.
3394
33952002-03-04 Akim Demaille <akim@epita.fr>
3396
3397 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
3398 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
3399 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
3400 latest sources from Michael.
3401
34022002-03-04 Akim Demaille <akim@epita.fr>
3403
3404 * src/output.c (output): Don't free the grammar.
3405 * src/reader.c (grammar_free): New.
3406 * src/main.c (main): Call it and don't free symtab here.
3407
34082002-03-04 Akim Demaille <akim@epita.fr>
3409
3410 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
3411 before returning.
3412 Reported by Benoit Perrot.
3413
34142002-03-04 Akim Demaille <akim@epita.fr>
3415
3416 Use bitset operations when possible, not loops over bits.
3417
3418 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
3419 bitset_or.
3420 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
3421 * src/reduce.c (useless_nonterminals): Formatting changes.
3422 * src/warshall.c (TC): Use bitset_or.
3423
34242002-03-04 Akim Demaille <akim@epita.fr>
3425
3426 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
3427 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
3428 Ditto.
3429
34302002-03-04 Akim Demaille <akim@epita.fr>
3431
3432 * src/lalr.c (F): Now a bitset*.
3433 Adjust all dependencies.
3434
34352002-03-04 Akim Demaille <akim@epita.fr>
3436
3437 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
3438 Adjust all dependencies.
3439
34402002-03-04 Akim Demaille <akim@epita.fr>
3441
3442 * src/L0.c, src/LR0.h (nstates): Be size_t.
3443 Adjust comparisons (signed vs unsigned).
3444 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
3445 bitset*.
3446 Adjust all dependencies.
3447
34482002-03-04 Akim Demaille <akim@epita.fr>
3449
3450 * src/closure.c (firsts): Now, also a bitset.
3451 Adjust all dependencies.
3452 (varsetsize): Remove, now unused.
3453 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
3454
34552002-03-04 Akim Demaille <akim@epita.fr>
3456
3457 * src/print.c: Convert to use bitset.h, not hand coded iterations
3458 over ints.
3459
34602002-03-04 Akim Demaille <akim@epita.fr>
3461
3462 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
3463
34642002-03-04 Akim Demaille <akim@epita.fr>
3465
3466 * src/closure.c (ruleset): Be a bitset.
3467 (rulesetsize): Remove.
3468
34692002-03-04 Akim Demaille <akim@epita.fr>
3470
3471 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
3472 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
3473 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
3474 * src/closure.c (fderives): Be an array of bitsets.
3475
34762002-02-28 Robert Anisko <robert@lrde.epita.fr>
3477
3478 * data/bison.c++: Merge the two generated headers. Insert a copyright
3479 notice in each output file.
3480
34812002-02-28 Akim Demaille <akim@epita.fr>
3482
3483 * data/bison.c++: Copy the prologue of bison.simple to fetch
3484 useful M4 definitions, such as b4_header_guard.
3485
34862002-02-25 Akim Demaille <akim@epita.fr>
3487
3488 * src/getargs.c (version): Give the name of the authors, and use a
3489 translator friendly scheme for the bgr
3490 copyright notice.
3491
34922002-02-25 Akim Demaille <akim@epita.fr>
3493
3494 * src/output.c (header_output): Remove, now handled completely via
3495 M4.
3496
34972002-02-25 Akim Demaille <akim@epita.fr>
3498
3499 * m4/m4.m4: New, from CVS Autoconf.
3500 * configure.in: Invoke it.
3501 * src/output.c (output_skeleton): Use its result instead of the
3502 hard coded name.
3503
35042002-02-25 Akim Demaille <akim@epita.fr>
3505
3506 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
3507 Fileutils 4.1.5.
3508 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
3509 * src/output.c (output_skeleton): Use mkstemp to create a real
3510 temporary file.
3511 Move the filling of `skeleton' and its muscle to...
3512 (prepare): here.
3513 (output): Move the definition of the prologue muscle to...
3514 (prepare): here.
3515 * src/system.h (DEFAULT_TMPDIR): New.
3516
35172002-02-14 Paul Eggert <eggert@twinsun.com>
3518
3519 Remove the support for C++ namespace cleanliness; it was
3520 causing more problems than it was curing, since it didn't work
3521 properly on some nonstandard C++ compilers. This can wait
3522 for a proper C++ parser.
3523
3524 * NEWS: Document this.
3525 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
3526 of C++, as it's treated like C now.
3527 * src/bison.simple (YYSTD): Remove.
3528 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
3529 Treat C++ just like Standard C instead of trying to support
3530 namespace cleanliness.
3531
35322002-02-14 Akim Demaille <akim@epita.fr>
3533
3534 * tests/regression.at (else): Adjust to Andreas' change.
3535
35362002-02-14 Akim Demaille <akim@epita.fr>
3537
3538 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
3539
35402002-02-13 Andreas Schwab <schwab@suse.de>
3541
3542 * src/output.c (output_rule_data): Don't output NULL, it might
3543 not be defined yet.
3544
35452002-02-11 Robert Anisko <robert@lrde.epita.fr>
3546
3547 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
3548 (Copyright notice): Update.
3549
35502002-02-11 Akim Demaille <akim@epita.fr>
3551
3552 * tests/regression.at (%nonassoc and eof): Don't include
3553 nonportable headers.
3554
35552002-02-08 Robert Anisko <robert@lrde.epita.fr>
3556
3557 * data/bison.c++: Correct error recovery. Make the user able to
3558 initialize the starting location.
3559
35602002-02-07 Akim Demaille <akim@epita.fr>
3561
3562 * tests/input.at: New.
3563
35642002-02-07 Robert Anisko <robert@lrde.epita.fr>
3565
3566 * data/bison.c++: Replace some direct m4 expansions by constants. Be
3567 more consistent when naming methods and variables. Put preprocessor
3568 directives around tables only needed for debugging.
3569
35702002-02-07 Robert Anisko <robert@lrde.epita.fr>
3571
3572 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
3573 C++ parsers.
3574 (yy::b4_name::parse): Use print_.
3575
35762002-02-07 Robert Anisko <robert@lrde.epita.fr>
3577
3578 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
3579
35802002-02-07 Robert Anisko <robert@lrde.epita.fr>
3581
3582 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
3583 C++ parsers.
3584 (yy::b4_name::parse): Build verbose error messages, and use error_.
3585
35862002-02-06 Robert Anisko <robert@lrde.epita.fr>
3587
3588 * data/bison.c++: Fix m4 quoting in comments.
3589
35902002-02-06 Robert Anisko <robert@lrde.epita.fr>
3591
3592 * data/bison.c++: Adjust the parser code. Fix some muscles that were
3593 not expanded by m4.
3594
35952002-02-05 Akim Demaille <akim@epita.fr>
3596
3597 * data/bison.c++: Adjust to the M4 back end.
3598 More is certainly needed.
3599
36002002-02-05 Akim Demaille <akim@epita.fr>
3601
3602 Give a try to M4 as a back end.
3603
3604 * lib/readpipe.c: New, from wdiff.
3605 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
3606 BISON_HAIRY.
3607 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
3608 specific values. Now it is m4 that performs the lookup.
3609 * src/parse-skel.y: Remove.
3610 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
3611 * src/output.c (actions_output, guards_output)
3612 (token_definitions_output): No longer keeps track of the output
3613 line number, hence remove the second argument.
3614 (guards_output): Check against the guard member of a rule, not the
3615 action member.
3616 Adjust callers.
3617 (output_skeleton): Don't look for the skeleton location, let m4 do
3618 that.
3619 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
3620 file will be used.
3621 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
3622 (prepare): Given that for the time being changesyntax is not
3623 usable in M4, rename the muscles using `-' to `_'.
3624 Define `defines_flag', `output_parser_name' and `output_header_name'.
3625 * src/output.h (actions_output, guards_output)
3626 (token_definitions_output): Adjust prototypes.
3627 * src/scan-skel.l: Instead of scanning the skeletons, it now
3628 processes the output of m4: `__oline__' and `#output'.
3629 * data/bison.simple: Adjust to be used by M4(sugar).
3630 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
3631 to date.
3632 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
3633 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
3634 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
3635 shamelessly stolen from CVS Autoconf.
3636
36372002-02-05 Akim Demaille <akim@epita.fr>
3638
3639 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
3640 * configure.in: Check for the declarations of free and malloc.
3641 * src/muscle_tab.c: Adjust.
3642
36432002-02-05 Akim Demaille <akim@epita.fr>
3644
3645 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
3646 which have no values.
3647
36482002-02-05 Akim Demaille <akim@epita.fr>
3649
3650 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
3651 * data/: here.
3652
36532002-01-29 Paul Eggert <eggert@twinsun.com>
3654
3655 * src/bison.simple (YYSIZE_T): Do not define merely because
3656 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
3657 On some platforms, <alloca.h> does not declare YYSTD (size_t).
3658
36592002-01-27 Akim Demaille <akim@epita.fr>
3660
3661 Fix `%nonassoc and eof'.
3662
3663 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
3664 which were not properly copied! Replace
3665 memcpy (res->errs, src->errs, src->nerrs);
3666 with
3667 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
3668 !!!
3669 * tests/regression.at (%nonassoc and eof): Adjust to newest
3670 Autotest: `.' is not in the PATH.
3671
36722002-01-27 Akim Demaille <akim@epita.fr>
3673
3674 * tests/sets.at (AT_EXTRACT_SETS): New.
3675 (Nullable): Use it.
3676 (Firsts): New.
3677
36782002-01-26 Akim Demaille <akim@epita.fr>
3679
3680 * tests/actions.at, tests/calc.at, tests/headers.at,
3681 * tests/torture.at: Adjust to the newest Autotest which no longer
3682 forces `.' in the PATH.
3683
36842002-01-25 Akim Demaille <akim@epita.fr>
3685
3686 * tests/regression.at (%nonassoc and eof): New.
3687 Suggested by Robert Anisko.
3688
36892002-01-24 Akim Demaille <akim@epita.fr>
3690
3691 Bison dumps core when trying to complain about broken input files.
3692 Reported by Cris van Pelt.
3693
3694 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
3695 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
3696 into...
3697 (Invalid inputs): Strengthen: exercise parse_percent_token.
3698
36992002-01-24 Robert Anisko <robert.anisko@epita.fr>
3700
3701 * src/Makefile.am: Add bison.c++.
3702 * src/bison.c++: New skeleton.
3703
37042002-01-21 Paolo Bonzini <bonzini@gnu.org>
3705
3706 * po/it.po: New.
3707
37082002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
3709
3710 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
3711
37122002-01-20 Marc Autret <marc@gnu.org>
3713
3714 * src/files.c (compute_output_file_names): Fix
3715
37162002-01-20 Marc Autret <marc@gnu.org>
3717
3718 * tests/output.at: New test.
3719 * src/files.c (compute_base_names): Don't map extensions when
3720 the YACC flag is set, use defaults.
3721 Reported by Evgeny Stambulchik.
3722
37232002-01-20 Marc Autret <marc@gnu.org>
3724
3725 * src/system.h: Need to define __attribute__ away for non-GCC
3726 compilers as well (i.e. the vendor C compiler).
3727 Suggested by Albert Chin-A-Young.
3728
37292002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
3730
3731 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
3732 canonical definition.
3733 * src/system.h: Use the canonical definition for PARAMS (avoids
3734 a conflict with the macro from lib/hash.h).
3735
37362002-01-11 Akim Demaille <akim@epita.fr>
3737
3738 * configure.in: Use AC_FUNC_STRNLEN.
3739 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
3740
37412002-01-09 Akim Demaille <akim@epita.fr>
3742
3743 * src/files.c, src/files.h (output_infix): New.
3744 (tab_extension): Remove.
3745 (compute_base_names): Compute the former, drop the latter.
3746 * src/output.c (prepare): Insert the muscles `output-infix', and
3747 `output-suffix'.
3748 * src/parse-skel.y (string, string.1): New.
3749 (section.header): Use it.
3750 (section.yacc): Remove.
3751 (prefix): Remove too.
3752 * src/scan-skel.l: Adjust.
3753 * src/bison.simple, src/bison.hairy: Adjust.
3754
37552002-01-09 Akim Demaille <akim@epita.fr>
3756
3757 * configure.in (WERROR_CFLAGS): Compute it.
3758 * src/Makefile.am (CFLAGS): Pass it.
3759 * tests/atlocal.in (CFLAGS): Idem.
3760 * src/files.c: Fix a few warnings.
3761 (get_extension_index): Remove, unused.
3762
37632002-01-08 Akim Demaille <akim@epita.fr>
3764
3765 * src/getargs.c (AS_FILE_NAME): New.
3766 (getargs): Use it to convert DOSish file names.
3767 * src/files.c (base_name): Rename as full_base_name to avoid
3768 clashes with `base_name ()'.
3769 (filename_split): New.
3770 (compute_base_names): N-th rewrite, using filename_split.
3771
37722002-01-08 Akim Demaille <akim@epita.fr>
3773
3774 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
3775 New, stolen from the Fileutils 4.1.
3776 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
3777 * configure.in: Check for the presence of memrchr, and of its
3778 prototype.
3779
37802002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
3781
3782 * lib/hash.h (__P): Added definition for this macro.
3783 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
3784 BUILT_SOURCES, to ensure they are generated first.
3785 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
3786 %error-verbose to allow bootstrapping with bison 1.30x.
3787
37882002-01-06 Akim Demaille <akim@epita.fr>
3789
3790 * src/reader.c (parse_braces): Don't fetch the next char, the
3791 convention is to fetch on entry.
3792 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
3793 'switch' without a following semicolon.
3794 * tests/regression.at (braces parsing): New.
3795
37962002-01-06 Akim Demaille <akim@epita.fr>
3797
3798 Bison is dead wrong in its RR conflict reports.
3799
3800 * tests/torture.at (GNU Cim Grammar): New.
3801 * src/conflicts.c (count_rr_conflicts): Fix.
3802
38032002-01-06 Akim Demaille <akim@epita.fr>
3804
3805 Creating package.m4 from configure.ac causes too many problems.
3806
3807 * tests/Makefile.am (package.m4): Create it by hand,
3808 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
3809
38102002-01-06 Akim Demaille <akim@epita.fr>
3811
3812 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
3813 skeleton.h.
3814
38152002-01-04 Paul Eggert <eggert@twinsun.com>
3816
3817 * doc/bison.texinfo (Debugging):
3818 Remove YYSTDERR; it's no longer defined or used.
3819 Also, s/cstdio.h/cstdio/.
3820
38212002-01-03 Akim Demaille <akim@epita.fr>
3822
3823 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
3824
38252002-01-03 Akim Demaille <akim@epita.fr>
3826
3827 * src/parse-skel.y (process_skeleton): Don't bind the parser's
3828 tracing code to --trace, wait for a better --trace option, with
3829 args.
3830
38312002-01-03 Akim Demaille <akim@epita.fr>
3832
3833 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
3834 The ISO C++ standard is extremely clear about it: stderr is
3835 considered a macro, not a regular symbol (see table 94 `Header
3836 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
3837 Therefore std:: does not apply to it. It still does with fprintf.
3838 Also, s/cstdio.h/cstdio/.
3839
38402002-01-03 Akim Demaille <akim@epita.fr>
3841
3842 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
3843 for non system headers.
3844
38452002-01-02 Akim Demaille <akim@epita.fr>
3846
3847 Equip the skeleton chain with location tracking, runtime trace,
3848 pure parser and scanner.
3849
3850 * src/parse-skel.y: Request a pure parser, locations, and prefix
3851 renaming.
3852 (%union): Having several members with the same type does not help
3853 type mismatches, simplify.
3854 (YYPRINT, yyprint): New.
3855 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
3856 (skel_error): this.
3857 Handle locations.
3858 * src/scan-skel.l: Adjust to these changes.
3859 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
3860 (LOCATION_PRINT, skel_control_t): New.
3861
38622001-12-30 Akim Demaille <akim@epita.fr>
3863
3864 * src/parse-skel.y: Get rid of the shift/reduce conflict:
3865 replace `gb' with BLANKS.
3866 * src/scan-skel.l: Adjust.
3867
38682001-12-30 Akim Demaille <akim@epita.fr>
3869
3870 * src/system.h: We don't need nor want bcopy.
3871 Throw away MS-DOS crap: we don't need getpid.
3872 * configure.in: We don't need strndup. It was even causing
3873 problems: because Flex includes the headers *before* us,
3874 _GNU_SOURCE is not defined by config.h, and therefore strndup was
3875 not visible.
3876 * lib/xstrndup.c: New.
3877 * src/scan-skel.l: Use it.
3878 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
3879 * src/parse-skel.y: Use %directives instead of #defines.
3880
38812001-12-30 Akim Demaille <akim@epita.fr>
3882
3883 * src/skeleton.h: New.
3884 * src/output.c (output_parser, output_master_parser): Remove, dead
3885 code.
3886 * src/output.h (get_lines_number, actions_output, guards_output)
3887 (token_definitions_output): Prototype them.
3888 * src/parse-skel.y: Add the license notice.
3889 Include output.h and skeleton.h.
3890 (process_skeleton): Returns void, and takes a single parameter.
3891 * src/scan-skel.l: Add the license notice.
3892 Include skeleton.h.
3893 Don't use %option yylineno: it seems that then Flex imagines
3894 REJECT has been used, and therefore it won't reallocate its
3895 buffers (which makes no other sense to me than a bug). It results
3896 in warnings for `unused: yy_flex_realloc'.
3897
38982001-12-30 Robert Anisko <robert.anisko@epita.fr>
3899
3900 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3901 (MUSCLE_INSERT_PREFIX): ...to there.
3902 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3903 (MUSCLE_INSERT_PREFIX): Move from here...
3904
3905 * src/bison.hairy: Add a section directive. Put braces around muscle
3906 names. This parser skeleton is still broken, but Bison should not
3907 choke on a bad muscle 'syntax'.
3908 * src/bison.simple: Add a section directive. Put braces around muscle
3909 names.
3910
3911 * src/files.h (strsuffix, stringappend): Add declarations.
3912 (tab_extension): Add declaration.
3913 (short_base_name): Add declaration.
3914
3915 * src/files.c (strsuffix, stringappend): No longer static. These
3916 functions are used in the skeleton parser.
3917 (tab_extension): New.
3918 (compute_base_names): Use the computations done in this function
3919 to guess if the generated parsers should have '.tab' in their
3920 names.
3921 (short_base_name): No longer static.
3922
3923 * src/output.c (output_skeleton): New.
3924 (output): Disable call to output_master_parser, and give a try to
3925 a new skeleton handling system.
3926 (guards_output, actions_output): No longer static.
3927 (token_definitions_output, get_lines_number): No longer static.
3928
3929 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
3930
3931 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
3932 parse-skel.y.
3933
3934 * src/parse-skel.y: New file.
3935 * src/scan-skel.l: New file.
3936
39372001-12-29 Akim Demaille <akim@epita.fr>
3938
3939 %name-prefix is broken.
3940
3941 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
3942 Adjust all dependencies.
3943 * tests/headers.at (export YYLTYPE): Strengthen this test: use
3944 %name-prefix.
3945
3946 Renaming yylval but not yylloc is not consistent. Now we do.
3947
3948 * src/bison.simple: Prefix yylloc if used.
3949 * doc/bison.texinfo (Decl Summary): Document that.
3950
39512001-12-29 Akim Demaille <akim@epita.fr>
3952
3953 * doc/bison.texinfo: Promote `%long-directive' over
3954 `%long_directive'.
3955 Remove all references to fixed-output-files, yacc is enough.
3956
39572001-12-29 Akim Demaille <akim@epita.fr>
3958
3959 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
3960 user prologue. These are defaults.
3961 * tests/actions.at (Mid-rule actions): Make sure the user can
3962 define YYDEBUG and YYERROR_VERBOSE.
3963
39642001-12-29 Akim Demaille <akim@epita.fr>
3965
3966 * src/output.c (header_output): Don't forget to export YYLTYPE and
3967 yylloc.
3968 * tests/headers.at (export YYLTYPE): New, make sure it does.
3969 * tests/regression.at (%union and --defines, Invalid CPP headers):
3970 Move to...
3971 * tests/headers.at: here.
3972
39732001-12-29 Akim Demaille <akim@epita.fr>
3974
3975 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
3976
39772001-12-29 Akim Demaille <akim@epita.fr>
3978
3979 * tests/actions.at (Mid-rule actions): Output on a single line
3980 instead of several.
3981
39822001-12-29 Akim Demaille <akim@epita.fr>
3983
3984 * doc/bison.texinfo: Formatting changes.
3985
39862001-12-29 Akim Demaille <akim@epita.fr>
3987
3988 Don't store the token defs in a muscle, just be ready to output it
3989 on command. Now possible via `symbols'. Fixes a memory leak.
3990
3991 * src/output.c (token_definitions_output): New.
3992 (output_parser, header_output): Use it.
3993 * src/reader.c (symbols_save): Remove.
3994
39952001-12-29 Akim Demaille <akim@epita.fr>
3996
3997 * src/bison.simple: Do not provide a default for YYSTYPE and
3998 YYLTYPE before the user's prologue. Otherwise it's hardly... a
3999 default.
4000
40012001-12-29 Akim Demaille <akim@epita.fr>
4002
4003 Mid-rule actions are simply... ignored!
4004
4005 * src/reader.c (readgram): Be sure to attach mid-rule actions to
4006 the empty-rule associated to the dummy symbol, not to the host
4007 rule.
4008 * tests/actions.at (Mid-rule actions): New.
4009
40102001-12-29 Akim Demaille <akim@epita.fr>
4011
4012 Memory leak.
4013
4014 * src/reader.c (reader): Free grammar.
4015
40162001-12-29 Akim Demaille <akim@epita.fr>
4017
4018 Memory leak.
4019
4020 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
4021 since it allocates it for each state, although only one is needed.
4022 (allocate_storage): Do it here.
4023
40242001-12-29 Akim Demaille <akim@epita.fr>
4025
4026 * src/options.h, src/options.c (create_long_option_table): Rename
4027 as...
4028 (long_option_table_new): this, with a clearer prototype.
4029 (percent_table): Remove, unused,
4030 * src/getargs.c (getargs): Adjust.
4031
40322001-12-29 Akim Demaille <akim@epita.fr>
4033
4034 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
4035 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
4036 as states.
4037
40382001-12-29 Akim Demaille <akim@epita.fr>
4039
4040 * src/lalr.c (build_relations): Rename `states' as `states1'.
4041 Sorry, I don't understand exactly what it is, no better name...
4042
40432001-12-29 Akim Demaille <akim@epita.fr>
4044
4045 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
4046 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
4047 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
4048 as rules.
4049
40502001-12-29 Akim Demaille <akim@epita.fr>
4051
4052 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
4053 ago.
4054
40552001-12-29 Akim Demaille <akim@epita.fr>
4056
4057 * src/reader.c, src/reader.h (user_toknums): Remove.
4058 Adjust all users to use symbols[i]->user_token_number.
4059
40602001-12-29 Akim Demaille <akim@epita.fr>
4061
4062 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
4063 Adjust all users to use symbols[i]->prec or ->assoc.
4064
40652001-12-29 Akim Demaille <akim@epita.fr>
4066
4067 * src/reader.c, src/reader.h (tags): Remove.
4068 Adjust all users to use symbols[i]->tag.
4069
40702001-12-29 Akim Demaille <akim@epita.fr>
4071
4072 * src/gram.h, src/gram.c (symbols): New, similar to state_table
4073 and rule_table.
4074 * src/reader.c (packsymbols): Fill this table.
4075 Drop sprec.
4076 * src/conflicts.c (resolve_sr_conflict): Adjust.
4077 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
4078 single table.
4079 Use symbols[i]->tag instead of tags[i].
4080
40812001-12-29 Akim Demaille <akim@epita.fr>
4082
4083 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
4084 In addition, put a comment in there, to replace...
4085 * tests/regression.at (%union and C comments): Remove.
4086
40872001-12-29 Akim Demaille <akim@epita.fr>
4088
4089 * tests/regression.at (Web2c Actions): Blindly move the actual
4090 output as expected output. The contents *seem* right to me, but I
4091 can't pretend reading perfectly parser tables... Nonetheless, all
4092 the other tests pass correctly, the table look OK, even though the
4093 presence of `$axiom' is to be noted: AFAICS it is useless (but
4094 harmless).
4095
40962001-12-29 Akim Demaille <akim@epita.fr>
4097
4098 * src/reader.c (readgram): Don't add the rule 0 if there were no
4099 rules read. In other words, add it _after_ having performed
4100 grammar sanity checks.
4101 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
4102
41032001-12-29 Akim Demaille <akim@epita.fr>
4104
4105 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
4106 visible, and some states have now a different number.
4107
41082001-12-29 Akim Demaille <akim@epita.fr>
4109
4110 * src/reader.c (readgram): Bind the initial rule's lineno to that
4111 of the first rule.
4112 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
4113 (Solved SR Conflicts): Adjust rule 0's line number.
4114
41152001-12-29 Akim Demaille <akim@epita.fr>
4116
4117 Fix the `GAWK Grammar' failure.
4118
4119 * src/LR0.c (final_state): Initialize to -1 so that we do compute
4120 the reductions of the first state which was mistakenly confused
4121 with the final state because precisely final_state was initialized
4122 to 0.
4123 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
4124 now noticed by Bison.
4125 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
4126 have a reduction on $default.
4127
41282001-12-29 Akim Demaille <akim@epita.fr>
4129
4130 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
4131 rule line numbers.
4132 * src/closure.c (print_closure): Likewise.
4133 * src/derives.c (print_derives): Likewise.
4134 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
4135 now.
4136
41372001-12-29 Akim Demaille <akim@epita.fr>
4138
4139 * src/lalr.c (lookaheads_print): New.
4140 (lalr): Call it when --trace-flag.
4141 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
4142 are dumped.
4143
41442001-12-29 Akim Demaille <akim@epita.fr>
4145
4146 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
4147 when walking through ritem, even via rule->rhs.
4148 * src/reduce.c (dump_grammar, useful_production, reduce_output)
4149 (useful_production, useless_nonterminals): Likewise.
4150 (reduce_grammar_tables): Likewise, plus update nritems.
4151 * src/nullable.c (set_nullable): Likewise.
4152 * src/lalr.c (build_relations): Likewise.
4153 * tests/sets.at (Nullable): Adjust.
4154 Fortunately, now, the $axiom is no longer nullable.
4155
41562001-12-29 Akim Demaille <akim@epita.fr>
4157
4158 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
4159 the 0-sentinel.
4160 * src/gram.c (ritem_longest_rhs): Likewise.
4161 * src/reduce.c (nonterminals_reduce): Likewise.
4162 * src/print_graph.c (print_graph): Likewise.
4163 * src/output.c (output_rule_data): Likewise.
4164 * src/nullable.c (set_nullable): Likewise.
4165
41662001-12-29 Akim Demaille <akim@epita.fr>
4167
4168 * src/output.c: Comment changes.
4169
41702001-12-27 Paul Eggert <eggert@twinsun.com>
4171
4172 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
4173 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
4174 Sparc, as they were causing more porting problems than the
4175 (minor) performance improvement was worth.
4176
4177 Also, catch up with 1.31's YYSTD.
4178
41792001-12-27 Akim Demaille <akim@epita.fr>
4180
4181 * src/output.c (output_gram): Rely on nritems, not the
4182 0-sentinel. See below.
4183 Use -1 as separator, not 0.
4184 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
4185 Rely on -1 as separator in yyrhs, instead of 0.
4186 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
4187 twice `Now at end of input', therefore there are two lines less to
4188 expect.
4189
41902001-12-27 Akim Demaille <akim@epita.fr>
4191
4192 * tests/regression.at (Unresolved SR Conflicts):
4193 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
4194 below.
4195
41962001-12-27 Akim Demaille <akim@epita.fr>
4197
4198 * src/LR0.c (new_state): Recognize the final state by the fact it
4199 is reached by eoftoken.
4200 (insert_start_shifting_state, insert_eof_shifting_state)
4201 (insert_accepting_state, augment_automaton): Remove, since now
4202 these states are automatically computed from the initial state.
4203 (generate_states): Adjust.
4204 * src/print.c: When reporting a rule number to the user, substract
4205 1, so that the axiom rule is rule 0, and the first user rule is 1.
4206 * src/reduce.c: Likewise.
4207 * src/print_graph.c (print_core): For the time being, just as for
4208 the report, depend upon --trace-flags to dump the full set of
4209 items.
4210 * src/reader.c (readgram): Once the grammar read, insert the rule
4211 0: `$axiom: START-SYMBOL $'.
4212 * tests/set.at: Adjust: rule 0 is now displayed, and since the
4213 number of the states has changed (the final state is no longer
4214 necessarily the last), catch up.
4215
42162001-12-27 Akim Demaille <akim@epita.fr>
4217
4218 Try to make the use of the eoftoken valid. Given that its value
4219 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
4220 is used instead of > 0 where appropriate, (ii), depend upon nritems
4221 instead of the 0-sentinel.
4222
4223 * src/gram.h, src/gram.c (nritems): New.
4224 Expected to be duplication of nitems, but for the time being...
4225 * src/reader.c (packgram): Assert nritems and nitems are equal.
4226 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
4227 * src/closure.c (print_closure, print_fderives): Likewise.
4228 * src/gram.c (ritem_print): Likewise.
4229 * src/print.c (print_core, print_grammar): Likewise.
4230 * src/print_graph.c: Likewise.
4231
42322001-12-27 Akim Demaille <akim@epita.fr>
4233
4234 * src/main.c (main): If there are complains after grammar
4235 reductions, then output the report anyway if requested, then die.
4236 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
4237 * src/reader.c (eoftoken): New.
4238 (parse_token_decl): If the token being defined has value `0', it
4239 is the eoftoken.
4240 (packsymbols): No longer hack `tags' to insert `$' by hand.
4241 Be sure to preserve the value of the eoftoken.
4242 (reader): Make sure eoftoken is defined.
4243 Initialize nsyms to 0: now eoftoken is created just like the others.
4244 * src/print.c (print_grammar): Don't special case the eof token.
4245 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
4246 lie anyway, albeit pleasant.
4247 * tests/calc.at: Exercise error messages with eoftoken.
4248 Change the grammar so that empty input is invalid.
4249 Adjust expectations.
4250 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
4251
42522001-12-27 Akim Demaille <akim@epita.fr>
4253
4254 * configure.in: Check the protos of strchr ans strspn.
4255 Replace strchr if needed.
4256 * src/system.h: Provide the protos of strchr, strspn and memchr if
4257 missing.
4258 * lib/strchr.c: New.
4259 * src/reader.c (symbols_save): Use strchr.
4260
42612001-12-27 Akim Demaille <akim@epita.fr>
4262
4263 * src/print.c, src/print_graph.c (escape): New.
4264 Use it to quote the TAGS outputs.
4265 * src/print_graph.c (print_state): Now errors are in red, and
4266 reductions in green.
4267 Prefer high to wide: output the state number on a line of its own.
4268
42692001-12-27 Akim Demaille <akim@epita.fr>
4270
4271 * src/state.h, src/state.c (reductions_new): New.
4272 * src/LR0.c (set_state_table): Let all the states have a
4273 `reductions', even if reduced to 0.
4274 (save_reductions): Adjust.
4275 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
4276 * src/print.c (print_reductions, print_actions): Adjust.
4277 * src/output.c (action_row): Adjust.
4278
42792001-12-27 Akim Demaille <akim@epita.fr>
4280
4281 * src/state.h, src/state.c (errs_new, errs_dup): New.
4282 * src/LR0.c (set_state_table): Let all the states have an errs,
4283 even if reduced to 0.
4284 * src/print.c (print_errs, print_reductions): Adjust.
4285 * src/output.c (output_actions, action_row): Adjust.
4286 * src/conflicts.c (resolve_sr_conflict): Adjust.
4287
42882001-12-27 Akim Demaille <akim@epita.fr>
4289
4290 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
4291
42922001-12-27 Akim Demaille <akim@epita.fr>
4293
4294 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
4295 * src/print.c: here.
4296 (lookaheadset, shiftset): New, used as additional storage by
4297 print_reductions.
4298 (print_results): Adjust.
4299 (print_shifts, print_gotos, print_errs): New, extracted from...
4300 (print_actions): here.
4301 * src/print_graph.c (print_actions): Remove dead code.
4302
43032001-12-27 Akim Demaille <akim@epita.fr>
4304
4305 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
4306 `$n' and `@n'.
4307
43082001-12-27 Akim Demaille <akim@epita.fr>
4309
4310 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
4311 (build_relations): Adjust.
4312
43132001-12-27 Akim Demaille <akim@epita.fr>
4314
4315 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
4316 duplication.
4317
43182001-12-27 Akim Demaille <akim@epita.fr>
4319
4320 * src/reader.c (packgram): Catch nitems overflows.
4321
43222001-12-27 Akim Demaille <akim@epita.fr>
4323
4324 * src/files.c, src/files.h (guard_obstack): Remove.
4325 * src/output.c (output): Adjust.
4326 * src/reader.c (parse_braces): New, factoring...
4327 (copy_action, copy_guard): these two which are renamed as...
4328 (parse_action, parse_guard): these.
4329 As a voluntary consequence, using braces around guards is now
4330 mandatory.
4331
43322001-12-27 Akim Demaille <akim@epita.fr>
4333
4334 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
4335 * src/reader.c (symbol_list): `guard' and `guard_line' are new
4336 members.
4337 (symbol_list_new): Adjust.
4338 (copy_action): action_line is the first line, not the last.
4339 (copy_guard): Just as for actions, store the `action' only, not
4340 the switch/case/break flesh.
4341 Don't parse the user action that might follow the guard, let...
4342 (readgram): do it, i.e., now, there can be an action after a
4343 guard.
4344 In other words the guard is just explicitly optional.
4345 (packgram): Adjust.
4346 * src/output.c (guards_output): New.
4347 (output_parser): Call it when needed.
4348 (output): Also free the guard and attrs obstacks.
4349 * src/files.c, src/files.h (obstack_save): Remove.
4350 (output_files): Remove.
4351 As a result, if one needs the former `.act' file, using an
4352 appropriate skeleton which requires actions and guards is now
4353 required.
4354 * src/main.c (main): Adjust.
4355 * tests/semantic.at: New.
4356 * tests/regression.at: Use `input.y' as input file name.
4357 Avoid 8+3 problems by requiring input.c when the test needs the
4358 parser.
4359
43602001-12-27 Akim Demaille <akim@epita.fr>
4361
4362 * src/reader.c (symbol_list_new): Be sure to initialize all the
4363 fields.
4364
43652001-12-27 Akim Demaille <akim@epita.fr>
4366
4367 All the hacks using a final pseudo state are now useless.
4368
4369 * src/LR0.c (set_state_table): state_table holds exactly nstates.
4370 * src/lalr.c (nLA): New.
4371 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
4372 instead of lookaheadsp from the pseudo state (nstate + 1).
4373
43742001-12-27 Akim Demaille <akim@epita.fr>
4375
4376 * src/output.c (action_row, token_actions): Use a state_t instead
4377 of a integer, and nlookaheads instead of the following state's
4378 lookaheadsp.
4379
43802001-12-27 Akim Demaille <akim@epita.fr>
4381
4382 * src/conflicts.c (log_resolution, flush_shift)
4383 (resolve_sr_conflict, set_conflicts, solve_conflicts)
4384 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
4385 (conflicts_print, print_reductions): Use a state_t instead of an
4386 integer when referring to a state.
4387 As much as possible, depend upon nlookaheads, instead of the
4388 `lookaheadsp' member of the following state (since lookaheads of
4389 successive states are successive, the difference between state n + 1
4390 and n served as the number of lookaheads for state n).
4391 * src/lalr.c (add_lookback_edge): Likewise.
4392 * src/print.c (print_core, print_actions, print_state)
4393 (print_results): Likewise.
4394 * src/print_graph.c (print_core, print_actions, print_state)
4395 (print_graph): Likewise.
4396 * src/conflicts.h: Adjust.
4397
43982001-12-27 Akim Demaille <akim@epita.fr>
4399
4400 * src/bison.hairy: Formatting/comment changes.
4401 ANSIfy.
4402 Remove `register' indications.
4403 Add plenty of `static'.
4404
44052001-12-27 Akim Demaille <akim@epita.fr>
4406
4407 * src/output.c (prepare): Drop the muscle `ntbase' which
4408 duplicates ntokens.
4409 * src/bison.simple: Formatting/comment changes.
4410 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
4411 is an undocumented synonym.
4412
44132001-12-22 Akim Demaille <akim@epita.fr>
4414
4415 * src/output.c (output_table_data): Change the prototype to use
4416 `int' for array ranges: some invocations do pass an int, not a
4417 short.
4418 Reported by Wayne Green.
4419
44202001-12-22 Akim Demaille <akim@epita.fr>
4421
4422 Some actions of web2c.y are improperly triggered.
4423 Reported by Mike Castle.
4424
4425 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
4426 * tests/regression.at (Web2c): Rename as...
4427 (Web2c Report): this.
4428 (Web2c Actions): New.
4429
44302001-12-22 Akim Demaille <akim@epita.fr>
4431
4432 Reductions in web2c.y are improperly reported.
4433 Reported by Mike Castle.
4434
4435 * src/conflicts.c (print_reductions): Fix.
4436 * tests/regression.at (Web2c): New.
4437
44382001-12-18 Akim Demaille <akim@epita.fr>
4439
4440 Some host fail on `assert (!"foo")', which expands to
4441 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
4442 Reported by Nelson Beebee.
4443
4444 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
4445 `#define it_succeeded 0' and `assert (it_succeeded)'.
4446
44472001-12-17 Marc Autret <autret_m@epita.fr>
4448
4449 * src/bison.simple: Don't hard code the skeleton line and filename.
4450 * src/output.c (output_parser): Rename 'line' as 'output_line'.
4451 New line counter 'skeleton_line' (skeleton-line muscle).
4452
44532001-12-17 Paul Eggert <eggert@twinsun.com>
4454
4455 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
4456 YYDEBUG must be defined to a nonzero value.
4457
4458 * src/bison.simple (yytname): Do not assume that the user defines
4459 YYDEBUG to a properly parenthesized expression.
4460
44612001-12-17 Akim Demaille <akim@epita.fr>
4462
4463 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
4464 nlookaheads is a new member.
4465 Adjust all users.
4466 * src/lalr.h (nlookaheads): Remove this orphan declaration.
4467 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
4468 state.
4469
44702001-12-17 Akim Demaille <akim@epita.fr>
4471
4472 * src/files.h, src/files.c (open_files, close_files): Remove.
4473 * src/main.c (main): Don't open/close files, nor invoke lex_free,
4474 let...
4475 * src/reader.c (reader): Do it.
4476
44772001-12-17 Akim Demaille <akim@epita.fr>
4478
4479 * src/conflicts.c (print_reductions): Formatting changes.
4480
44812001-12-17 Akim Demaille <akim@epita.fr>
4482
4483 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
4484 (flush_reduce): New.
4485 (resolve_sr_conflict): Adjust.
4486
44872001-12-17 Akim Demaille <akim@epita.fr>
4488
4489 * src/output.c (output_obstack): Be static and rename as...
4490 (format_obstack): this, to avoid any confusion with files.c's
4491 output_obstack.
4492 * src/reader.h (muscle_obstack): Move to...
4493 * src/output.h: here, since it's defined in output.c.
4494
44952001-12-17 Akim Demaille <akim@epita.fr>
4496
4497 * src/output.c (action_row, save_column, default_goto)
4498 (sort_actions, matching_state, pack_vector): Better variable
4499 locality.
4500
45012001-12-17 Akim Demaille <akim@epita.fr>
4502
4503 * src/output.c: Various formatting changes.
4504
45052001-12-17 Akim Demaille <akim@epita.fr>
4506
4507 * src/files.c (output_files): Free the output_obstack.
4508 * src/main.c (main): Call print and print_graph conditionally.
4509 * src/print.c (print): Work unconditionally.
4510 * src/print_graph.c (print_graph): Work unconditionally.
4511 * src/conflicts.c (log_resolution): Output only if verbose_flag.
4512
45132001-12-16 Marc Autret <autret_m@epita.fr>
4514
4515 * src/output.c (actions_output): Fix. When we use %no-lines,
4516 there is one less line per action.
4517
45182001-12-16 Marc Autret <autret_m@epita.fr>
4519
4520 * src/bison.simple: Remove a useless #line directive.
4521 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
4522 * src/output.c (get_lines_number): New.
4523 (output_parser): Adjust, now takes care about the lines of a
4524 output muscles.
4525 Fix line numbering.
4526 (actions_output): Computes the number of lines taken by actions.
4527 (output_master_parser): Insert new skeleton which is the name of
4528 the output parser file name.
4529
45302001-12-15 Marc Autret <autret_m@epita.fr>
4531
4532 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
4533
45342001-12-15 Marc Autret <autret_m@epita.fr>
4535
4536 * src/output.c (output_gram): Keep track of the hairy one.
4537
45382001-12-15 Akim Demaille <akim@epita.fr>
4539
4540 Make `make distcheck' work.
4541
4542 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
4543 system.h which uses libgettext.h.
4544
45452001-12-15 Akim Demaille <akim@epita.fr>
4546
4547 * src/nullable.c (set_nullable): Useless rules must be skipped,
4548 otherwise, since we range over their symbols, we might look at a
4549 nonterminal which no longer ``exists'', i.e., it is not counted in
4550 `nvars', hence we overflow our arrays.
4551
45522001-12-15 Akim Demaille <akim@epita.fr>
4553
4554 The header can also be produced directly, without any obstack!
4555 Yahoo!
4556
4557 * src/files.c, src/files.h (defines_obstack): Remove.
4558 (compute_header_macro): Global.
4559 (defines_obstack_save): Remove.
4560 * src/reader.c (parse_union_decl): No longer output to
4561 defines_obstack: its content can be found in the `stype' muscle
4562 anyway.
4563 (output_token_translations): Merge into...
4564 (symbols_output): this.
4565 Rename as...
4566 (symbols_save): this.
4567 (reader): Adjust.
4568 * src/output.c (header_output): New.
4569 (output): Call it.
4570
45712001-12-15 Akim Demaille <akim@epita.fr>
4572
4573 * src/reader.c (parse_union_decl): Instead of handling two obstack
4574 simultaneously, use one to define the `stype' muscle, and use the
4575 value of the latter to fill defines_obstack.
4576 (copy_comment): Remove.
4577 (copy_comment2): Work for a single obstack.
4578 Rename as...
4579 (copy_comment): this.
4580
45812001-12-15 Akim Demaille <akim@epita.fr>
4582
4583 * src/lex.c, src/lex.h (xgetc): No longer static.
4584 * src/reader.c (parse_union_decl): Revamp.
4585
45862001-12-15 Akim Demaille <akim@epita.fr>
4587
4588 Still making progress in separating Bison into (i) input, (ii)
4589 process, (iii) output: now we can directly output the parser file
4590 without using table_obstack at all.
4591
4592 * src/files.c, src/files.h (table_obstack): Bye bye.
4593 (parser_file_name): New.
4594 * src/files.c (compute_output_file_names): Compute it.
4595 * src/output.c (actions_output, output_parser)
4596 (output_master_parser): To a file instead of an obstack.
4597
45982001-12-15 Akim Demaille <akim@epita.fr>
4599
4600 Attach actions to rules, instead of pre-outputting them to
4601 actions_obstack.
4602
4603 * src/gram.h (rule_t): action and action_line are new members.
4604 * src/reader.c (symbol_list): Likewise.
4605 (copy_action): Save the actions within the rule.
4606 (packgram): Save them in rule_table.
4607 * src/output.c (actions_output): New.
4608 (output_parser): Use it on `%%actions'.
4609 (output_rule_data): Don't free rule_table.
4610 (output): Do it.
4611 (prepare): Don't save the `action' muscle.
4612 * src/bison.simple: s/%%action/%%actions/.
4613
46142001-12-15 Akim Demaille <akim@epita.fr>
4615
4616 * src/reader.c (copy_action): When --yacc, don't append a `;'
4617 to the user action: let it fail if lacking.
4618 Suggested by Arnold Robbins and Tom Tromey.
4619
46202001-12-14 Akim Demaille <akim@epita.fr>
4621
4622 * src/lex.c (literalchar): Simply return the char you decoded, non
4623 longer mess around with obstacks and int pointers.
4624 Adjust all callers.
4625
46262001-12-14 Akim Demaille <akim@epita.fr>
4627
4628 * src/lex.c (literalchar): Don't escape the special characters,
4629 just decode them, and keep them as char (before, eol was output as
4630 the 2 char string `\n' etc.).
4631 * src/output.c (output_rule_data): Use quotearg to output the
4632 token strings.
4633
46342001-12-13 Paul Eggert <eggert@twinsun.com>
4635
4636 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
4637 Do not infringe on the global user namespace when using C++.
4638 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
4639 All uses of `fprintf' and `stderr' changed.
4640
4641 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
4642
46432001-12-13 Akim Demaille <akim@epita.fr>
4644
4645 The computation of nullable is broken: it doesn't handle empty
4646 RHS's properly.
4647
4648 * tests/torture.at (GNU AWK Grammar): New.
4649 * tests/sets.at (Nullable): New.
4650 * src/nullable.c (set_nullable): Instead of blindly looping over
4651 `ritems', loop over the rules, and then over their rhs's.
4652
4653 Work around Autotest bugs.
4654
4655 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
4656 frame, because Autotest understand lines starting with a `+' as
4657 traces from the shell. Then, they are not processed properly.
4658 Admittedly an Autotest bug, but we don't have time to wait for
4659 Autotest to catch up.
4660 * tests/regression.at (Broken Closure): Adjust to the new table
4661 frames.
4662 Move to...
4663 * tests/sets.at: here.
4664
46652001-12-13 Akim Demaille <akim@epita.fr>
4666
4667 * src/closure.c (closure): Use nrules instead of playing tricks
4668 with BITS_PER_WORD.
4669
46702001-12-13 Akim Demaille <akim@epita.fr>
4671
4672 * src/print.c (print_actions): Output the handling of `$' as the
4673 traces do: shifting the token EOF. Before EOF was treated as a
4674 nonterminal.
4675 * tests/regression.at: Adjust some tests.
4676 * src/print_graph.c (print_core): Complete the set of items via
4677 closure. The next-to-final and final states are still unsatisfying,
4678 but that's to be addressed elsewhere.
4679 No longer output the rule numbers, but do output the state number.
4680 A single loop for the shifts + gotos is enough, but picked a
4681 distinct color for each.
4682 (print_graph): Initialize and finalize closure.
4683
46842001-12-13 Akim Demaille <akim@epita.fr>
4685
4686 * src/reader.c (readgram): Remove dead code, an strip useless
4687 braces.
4688 (get_type): Remove, unused.
4689
46902001-12-12 Akim Demaille <akim@epita.fr>
4691
4692 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
4693 on that of lib/error.c.
4694
46952001-12-12 Akim Demaille <akim@epita.fr>
4696
4697 Some hosts don't like `/' in includes.
4698
4699 * src/system.h: Include libgettext.h without qualifying the path.
4700 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
4701 $(top_srcdir).
4702
47032001-12-11 Marc Autret <autret_m@epita.fr>
4704
4705 * src/output.c (output_parser): Remove useless muscle.
4706
47072001-12-11 Marc Autret <autret_m@epita.fr>
4708
4709 * src/bison.simple: Remove #line just before %%epilogue. It
4710 is now handled in ...
4711 * src/reader.c (read_additionnal_code): Add the output of a
4712 #line for the epilogue.
4713
47142001-12-10 Marc Autret <autret_m@epita.fr>
4715
4716 * src/reader.c (copy_definition): Re-use CPP-outed code which
4717 replace precedent remove.
4718 * src/bison.simple: Remove #line before %%prologue because
4719 %%input-line is wrong at this time.
4720
47212001-12-10 Marc Autret <autret_m@epita.fr>
4722
4723 * src/reader.c (symbols_output): Clean up.
4724 * src/output.c (output_gram, output): Clean up.
4725
47262001-12-10 Akim Demaille <akim@epita.fr>
4727
4728 * src/lalr.c (initialize_lookaheads): New. Extracted from...
4729 * src/LR0.c (set_state_table): here.
4730 * src/lalr.c (lalr): Call it.
4731
47322001-12-10 Akim Demaille <akim@epita.fr>
4733
4734 * src/state.h (shifts): Remove the `number' member: shifts are
4735 attached to state, hence no longer need to be labelled with a
4736 state number.
4737
47382001-12-10 Akim Demaille <akim@epita.fr>
4739
4740 Now that states have a complete set of members, the linked list of
4741 shifts is useless: just fill directly the state's shifts member.
4742
4743 * src/state.h (shifts): Remove the `next' member.
4744 * src/LR0.c (first_state, last_state): Remove.
4745 Adjust the callers.
4746 (augment_automaton): Don't look for the shifts that must be added
4747 a shift on EOF: it is those of the state we looked for! But now,
4748 since shifts are attached, it is no longer needed to looking
4749 merely by its id: its number.
4750
47512001-12-10 Akim Demaille <akim@epita.fr>
4752
4753 * src/LR0.c (augment_automaton): Better variable locality.
4754 Remove an impossible branch: if there is a state corresponding to
4755 the start symbol being shifted, then there is shift for the start
4756 symbol from the initial state.
4757
47582001-12-10 Akim Demaille <akim@epita.fr>
4759
4760 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
4761 only when appropriate: when insert_start_shifting_state' is not
4762 invoked.
4763 * tests/regression.at (Rule Line Numbers): Adjust.
4764
47652001-12-10 Akim Demaille <akim@epita.fr>
4766
4767 * src/LR0.c (augment_automaton): Now that all states have shifts,
4768 merge the two cases addition shifts to the initial state.
4769
47702001-12-10 Akim Demaille <akim@epita.fr>
4771
4772 * src/lalr.c (set_state_table): Move to...
4773 * src/LR0.c: here.
4774 * src/lalr.c (lalr): Don't call it...
4775 * src/LR0.c (generate_states): do it.
4776 * src/LR0.h (first_state): Remove, only the table is used.
4777
47782001-12-10 Akim Demaille <akim@epita.fr>
4779
4780 * src/LR0.h (first_shift, first_reduction): Remove.
4781 * src/lalr.c: Don't use first_shift: find shifts through the
4782 states.
4783
47842001-12-10 Akim Demaille <akim@epita.fr>
4785
4786 * src/LR0.c: Attach shifts to states as soon as they are
4787 computed.
4788 * src/lalr.c (set_state_table): Instead of assigning shifts to
4789 state, just assert that the mapping was properly done.
4790
47912001-12-10 Akim Demaille <akim@epita.fr>
4792
4793 * src/LR0.c (insert_start_shift): Rename as...
4794 (insert_start_shifting_state): this.
4795 (insert_eof_shifting_state, insert_accepting_state): New.
4796 (augment_automaton): Adjust.
4797 Better locality of the variables.
4798 When looking if the start_symbol is shifted from the initial
4799 state, using `while (... symbol != start_symbol ...)' sounds
4800 better than `while (... symbol < start_symbol ...)': If fail
4801 to see how the order between symbols could be relevant!
4802
48032001-12-10 Akim Demaille <akim@epita.fr>
4804
4805 * src/getargs.h: Don't declare `spec_name_prefix' and
4806 `spec_file_prefix', declared by src/files.h.
4807 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
4808 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
4809 * src/output.c (prepare): Adjust.
4810 * src/reader.c (symbols_output): Likewise.
4811 * src/vmsgetargs.c: Vaguely adjust, but who cares?
4812
48132001-12-10 Akim Demaille <akim@epita.fr>
4814
4815 * src/muscle_tab.c (muscle_init): NULL is a better default than
4816 `"0"'.
4817
48182001-12-10 Akim Demaille <akim@epita.fr>
4819
4820 * src/reader.c (reader): Calling symbols_output once is enough.
4821
48222001-12-10 Akim Demaille <akim@epita.fr>
4823
4824 Now that states have a complete set of members, the linked list of
4825 reductions is useless: just fill directly the state's reductions
4826 member.
4827
4828 * src/state.h (struct reductions): Remove member `number' and
4829 `next'.
4830 * src/LR0.c (first_reduction, last_reduction): Remove.
4831 (save_reductions): Don't link the new reductions, store them in
4832 this_state.
4833 * src/lalr.c (set_state_table): No need to attach reductions to
4834 states, it's already done.
4835 * src/output.c (output_actions): No longer free the shifts, then
4836 the reductions, then the states: free all the states and their
4837 members.
4838
48392001-12-10 Akim Demaille <akim@epita.fr>
4840
4841 * src/options.c (OPTN, DRTV, BOTH): New.
4842 (option_table): Use them.
4843
4844 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
4845 the job of system.h.
4846 * src/options.c: Don't include stdio.h and xalloc.h for the same
4847 reasons.
4848
48492001-12-10 Akim Demaille <akim@epita.fr>
4850
4851 * src/output.c (output, prepare): Make sure the values of the
4852 muscles `action' and `prologue' are 0-terminated.
4853
48542001-12-10 Akim Demaille <akim@epita.fr>
4855
4856 Clean up GCC warnings.
4857
4858 * src/reader.c (copy_action): `buf' is not used.
4859 (parse_skel_decl): Be static.
4860 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
4861 * src/options.h (create_long_option_table): Have a real prototype.
4862 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
4863 (hash_delete_at): Return const void *.
4864 Adjust casts to preserve the const.
4865
48662001-12-10 Akim Demaille <akim@epita.fr>
4867
4868 * configure.in: Require 2.52g.
4869 M4 is not needed, but AUTOM4TE is.
4870 * m4/m4.m4: Remove.
4871 * tests/Makefile.am: Adjust.
4872
48732001-12-10 Akim Demaille <akim@epita.fr>
4874
4875 One structure for states is enough, even though theoretically
4876 there are LR(0) states and LALR(1) states.
4877
4878 * src/lalr.h (state_t): Remove.
4879 (state_table): Be state_t **, not state_t *.
4880 * src/state.h (core, CORE_ALLOC): Rename as...
4881 (state_t, STATE_ALLOC): this.
4882 Add the LALR(1) members: shifts, reductions, errs.
4883 * src/LR0.c (state_table): Rename as...
4884 (state_hash): this, to avoid name clashes with the global
4885 `state_table'.
4886 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
4887 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
4888
48892001-12-10 Akim Demaille <akim@epita.fr>
4890
4891 Bison dumps core on bash.y.
4892 Reported by Pascal Bart.
4893
4894 * src/warshall.c (bitmatrix_print): New.
4895 (TC): Use it.
4896 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
4897 j must be the outer loop.
4898 * tests/regression.at (Broken Closure): New.
4899
49002001-12-05 Akim Demaille <akim@epita.fr>
4901
4902 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
4903 its argument.
4904