]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* tests/calc.at: Change all the AT_CHECK_CALC_LALR and
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-11-03 Akim Demaille <akim@epita.fr>
2
3 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
4 AT_CHECK_CALC_GLR invocations to use % directives, instead of
5 command line options.
6 * tests/cxx-type.at: Formatting changes.
7
82002-11-03 Paul Eggert <eggert@twinsun.com>
9
10 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11 to count columns correctly, and to check for invalid inputs.
12
13 Use mbsnwidth to count columns correctly. Account for tabs, too.
14 Include mbswidth.h.
15 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16 (extend_location): New function.
17 (YY_LINES): Remove.
18
19 Handle CRLF in C code rather than in Lex code.
20 (YY_INPUT): New macro.
21 (no_cr_read): New function.
22
23 Scan UCNs, even though we don't fully handle them yet.
24 (convert_ucn_to_byte): New function.
25
26 Handle backslash-newline correctly in C code.
27 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
28 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
29 all uses changed.
30 (tag, splice): New EREs. Do not allow NUL or newline in tags.
31 Use {splice} wherever C allows backslash-newline.
32 YY_STEP after space, newline, vertical-tab.
33 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
34
35 (letter, id): Don't assume ASCII; e.g., spell out a-z.
36
37 ({int}, handle_action_dollar, handle_action_at): Check for integer
38 overflow.
39
40 (YY_STEP): Omit trailing semicolon, so that it's more like C.
41
42 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
43 as well as \000. Check for UCHAR_MAX, not 255.
44 Allow \x with an arbitrary positive number of digits, as in C.
45 Check for overflow here.
46 Allow \? and UCNs, for compatibility with C.
47
48 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
49 with quote slot used by complain_at.
50
51 * tests/input.at: Add tests for backslash-newline, m4 quotes
52 in symbols, long literals, and funny escapes in strings.
53
54 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
55 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
56 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
57 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
58 * m4/mbswidth.m4: New file, from GNU coreutils.
59
60 * doc/bison.texinfo (Grammar Outline): Document // comments.
61 (Symbols): Document that trigraphs have no special meaning in Bison,
62 nor is backslash-newline allowed.
63 (Actions): Document that trigraphs have no special meaning.
64
65 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
66 no longer used.
67
682002-11-02 Paul Eggert <eggert@twinsun.com>
69
70 * src/reader.c: Don't include quote.h; not needed.
71 (get_merge_function): Reword warning to be consistent with
72 type clash diagnostic in grammar_current_rule_check.
73
74 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
75 bug in trigraph handling.
76
77 * src/output.c (prepare_symbols): When printing token names,
78 escape "[" as "@<:@" and likewise for "]".
79
80 * src/system.h (errno): Remove declaration, as we are now
81 assuming C89 or better, and C89 guarantees errno.
82
832002-10-30 Paul Eggert <eggert@twinsun.com>
84
85 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
86 Check for close failures.
87 * src/files.h (xfclose): Return void, not int, since it always
88 returned zero.
89 * src/files.c (xfclose): Likewise. Report I/O error if ferror
90 indicates one.
91 * src/output.c (output_skeleton): Use xfclose rather than fclose
92 and ferror. xfclose now checks ferror.
93
94 * data/glr.c (YYLEFTMOST_STATE): Remove.
95 (yyreportTree): Use a stack-based leftmost state. This avoids
96 our continuing battles with bogus warnings about initializers.
97
982002-10-30 Akim Demaille <akim@epita.fr>
99
100 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
101 #if.
102
1032002-10-24 Paul Eggert <eggert@twinsun.com>
104
105 Version 1.75a.
106
107 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
108 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
109 we use malloc. Don't assume 'A' through 'Z' are contiguous.
110 Don't assume strdup exists; POSIX says its an XSI extension.
111 Check for buffer overflow on input.
112
1132002-10-24 Akim Demaille <akim@epita.fr>
114
115 * src/output.c (output_skeleton): Don't disable M4sugar comments
116 too soon: it results in comments being expanded.
117 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
118 first output.
119
1202002-10-24 Akim Demaille <akim@epita.fr>
121
122 * data/yacc.c (m4_int_type): New.
123 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
124 char' as only yacc.c wants K&R portability.
125 * data/glr.c (yysigned_char): Remove.
126 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
127 Reported by Quoc Peyrot.
128
1292002-10-23 Paul Eggert <eggert@twinsun.com>
130
131 * src/main.c (main): With --trace=time, report times even if a
132 non-fatal error occurs. Formerly, the times were reported in some
133 such cases but not in others.
134 * src/reader.c (reader): Just return if a complaint has been issued,
135 instead of exiting, so that 'main' can report times.
136
1372002-10-22 Akim Demaille <akim@epita.fr>
138
139 * src/system.h: Include sys/types.
140 Reported by Bert Deknuydt.
141
1422002-10-23 Paul Eggert <eggert@twinsun.com>
143
144 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
145 Suggested by Art Haas.
146
1472002-10-22 Paul Eggert <eggert@twinsun.com>
148
149 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
150 decl; not needed any more.
151 * src/main.c (main): Use return to exit, undoing yesterday's change.
152 The last OS that we could find where this wouldn't work is
153 SunOS 3.5, and that's too old to worry about now.
154
155 * data/glr.c (struct yyltype): Define members even when not
156 doing locations. This is more consistent with yacc.c, and it
157 works around the following bug reports:
158 http://mail.gnu.org/pipermail/bug-bison/2002-October/001764.html
159 http://mail.gnu.org/pipermail/bug-bison/2002-October/001769.html
160 and I hope it also fixes this bug report:
161 http://mail.gnu.org/pipermail/bug-bison/2002-October/001748.html
162
163 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
164 @acronym consistently. Standardize on "Yacc" instead of "YACC",
165 "Algol" instead of "ALGOL". Give a bit more history about BNF.
166
1672002-10-22 Akim Demaille <akim@epita.fr>
168
169 * data/README: New.
170
1712002-10-21 Paul Eggert <eggert@twinsun.com>
172
173 Be consistent about 'bool'; the old code used an enum in one
174 module and an int in another, and this violates the C standard.
175 * m4/stdbool.m4: New file, from coreutils 4.5.3.
176 * configure.ac (AC_HEADER_STDBOOL): Add.
177 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
178 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
179 * src/symtab.c (hash_compare_symbol_t): Likewise.
180 * src/system.h (bool, false, true): Use a definition consistent
181 with ../lib/hash.c. All uses changed.
182
183 * src/complain.c (warning_issued): Renamed from warn_message_count,
184 so that we needn't worry about integer overflow (!).
185 Now of type bool. All uses changed.
186 (complaint_issued): Renamed from complain_message_count; likewise.
187
188 * src/main.c (main): Use exit to exit with failure.
189
190 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
191 rather than 1 and 0.
192 * src/main.c (main): Likewise.
193 * src/getargs.c (getargs): Likewise.
194 * src/reader.c (reader): Likewise.
195
196 * src/getarg.c (getargs): Remove duplicate code for
197 "Try `bison --help'".
198
199 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
200 What was that "2" for?
201
202 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
203 * src/getargs.c (usage): Likewise.
204
205 * src/getargs.c (getargs): When there are too few operands, report
206 the last one. When there are too many, report the first extra
207 one. This is how diffutils does it.
208
2092002-10-20 Paul Eggert <eggert@twinsun.com>
210
211 Remove K&R vestiges.
212 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
213 * src/complain.c (VA_START): Remove. Assume prototypes.
214 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
215 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
216 fatal): Assume prototypes.
217 * src/complain.h: Assume prototypes.
218 * src/system.h (PARAMS): Remove.
219 Include <limits.h> unconditionally, since it's guaranteeed even
220 for a freestanding C89 compiler.
221 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
222 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
223
2242002-10-20 Akim Demaille <akim@epita.fr>
225
226 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
227 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
228 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
229 (yyresolveStates, yyresolveAction, yyresolveStack)
230 (yyprocessOneStack): Use them.
231 (yy_reduce_print): New.
232 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
233
2342002-10-20 Akim Demaille <akim@epita.fr>
235
236 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
237 arguments and output `void'.
238 (b4_c_function): Rename as...
239 (b4_c_function_def): this.
240 (b4_c_function_decl, b4_c_ansi_function_def)
241 (b4_c_ansi_function_decl): New.
242 Change the interpretation of the arguments: before `int, foo', now
243 `int foo, foo'.
244 * data/yacc.c (yyparse): Prototype and define thanks to these.
245 Adjust b4_c_function_def uses.
246 * data/glr.c (yyparse): Likewise, but ANSI only.
247
2482002-10-20 Akim Demaille <akim@epita.fr>
249
250 * src/output.c (prepare): Move the definition of `tokens_number',
251 `nterms_number', `undef_token_number', `user_token_number_max'
252 to...
253 (prepare_tokens): Here.
254 (prepare_tokens): Rename as...
255 (prepare_symbols): this.
256 (prepare): Move the definition of `rules_number' to...
257 (prepare_rules): here.
258 (prepare): Move the definition of `last', `final_state_number',
259 `states_number' to...
260 (prepare_states): here.
261 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
262
2632002-10-20 Akim Demaille <akim@epita.fr>
264
265 * src/tables.h, src/tables.c, src/output.c: Comment changes.
266
2672002-10-20 Akim Demaille <akim@epita.fr>
268
269 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
270 * data/c.m4: here.
271
2722002-10-20 Akim Demaille <akim@epita.fr>
273
274 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
275 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
276 `pair'.
277 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
278 `name' to...
279 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
280 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
281 These.
282
2832002-10-19 Paul Eggert <eggert@twinsun.com>
284
285 Do not create a temporary file, as that involves security and
286 cleanup headaches. Instead, use a pair of pipes.
287 Derived from a suggestion by Florian Krohm.
288 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
289 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
290 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
291 (BISON_PREREQ_SUBPIPE): Add.
292 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
293 Add subpipe.h, subpipe.c.
294 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
295 * po/POTFILES.in: Add lib/subpipe.c.
296 * src/output.c: Include "subpipe.h".
297 (m4_invoke): Remove decl.
298 (scan_skel): New decl.
299 (output_skeleton): Use pipe rather than temporary file for m4 input.
300 Check that m4sugar.m4 is readable, to avoid deadlock.
301 Check for pipe I/O error.
302 * src/scan-skel.l (readpipe): Remove decl.
303 (scan_skel): New function, to be used in place of m4_invoke.
304 Read from stream rather than file.
305
306 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
307 float, as this generates a warning on Solaris 8 + GCC 3.2 with
308 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
309 this generates a more-accurate value anyway.
310
311 * lib/timevar.c (timervar_accumulate): Rename locals to
312 avoid confusion with similarly-named more-global.
313 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
314
315 * src/output.c (prepare): Use xstrdup to convert char const *
316 to char *, to avoid GCC warning.
317
3182002-10-19 Akim Demaille <akim@epita.fr>
319
320 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
321 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
322 Use them to have `calc.y' ready for %pure-parser.
323 * data/yacc.c (YYLEX): Pass a yylex return type to
324 b4_c_function_call.
325
3262002-10-19 Akim Demaille <akim@epita.fr>
327
328 Prototype support of %lex-param and %parse-param.
329
330 * src/parse-gram.y: Add the definition of the %lex-param and
331 %parse-param tokens, plus their rules.
332 Drop the `_' version of %glr-parser.
333 Add the "," token.
334 * src/scan-gram.l (INITIAL): Scan them.
335 * src/muscle_tab.c: Comment changes.
336 (muscle_insert, muscle_find): Rename `pair' as `probe'.
337 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
338 (muscle_entry_s): The `value' member is no longer const.
339 Adjust all dependencies.
340 * src/muscle_tab.c (muscle_init): Adjust: use
341 MUSCLE_INSERT_STRING.
342 Initialize the obstack earlier.
343 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
344 (muscle_pair_list_grow): New.
345 * data/c.m4 (b4_c_function_call, b4_c_args): New.
346 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
347 * tests/calc.at: Use %locations, not --locations.
348 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
349
3502002-10-19 Akim Demaille <akim@epita.fr>
351
352 * src/getargs.c (usage): Take status as argument and exit
353 accordingly.
354 Report the traditional `Try ... --help' message when status != 0.
355 (usage, version): Don't take a FILE * as arg, it is pointless.
356 (getargs): When there is an incorrect number of arguments, make it
357 an error, and report it GNUlically thanks to `usage ()'.
358
3592002-10-18 Paul Eggert <eggert@twinsun.com>
360
361 * data/glr.c (yyreportParseError): Don't assume that sprintf
362 yields the length of the printed string, as this is not true
363 on SunOS 4.1.4. Reported by Peter Klein.
364
365 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
366 * tests/conflicts.at (%nonassoc and eof): Likewise.
367 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
368
3692002-10-17 Akim Demaille <akim@epita.fr>
370
371 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
372 * src/getargs.c (trace_types, trace_args): Adjust.
373 * src/reader.c (grammar_current_rule_prec_set)
374 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
375 Standardize error messages.
376 And s/@prec/%prec/!
377 (reader): Use trace_flag to enable scanner/parser debugging,
378 instead of an adhoc scheme.
379 * src/scan-gram.l: Remove trailing debugging code.
380
3812002-10-16 Paul Eggert <eggert@twinsun.com>
382
383 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
384 MUSCLE_TAB_H.
385
386 * NEWS: Officially drop support for building Bison with K&R C,
387 since it didn't work anyway and it's not worth worrying about.
388 * Makefile.maint (wget_files): Remove ansi2knr.c.
389 (ansi2knr.c-url_prefix): Remove.
390 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
391 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
392 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
393
3942002-10-15 Paul Eggert <eggert@twinsun.com>
395
396 Stop using the "enum_" trick for K&R-style function definitions;
397 it confused me, and I was the author! Instead, assume that people
398 who want to use K&R C compilers (when using these modules in GCC,
399 perhaps?) will run ansi2knr.
400
401 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
402 All uses of "enum_" changed to "enum ".
403 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
404 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
405
406 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
407 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
408 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
409 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
410 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
411 abitset_not, abitset_ones, abitset_or, abitset_or_and,
412 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
413 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
414 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
415 Use function prototypes; this removes the need for declaring
416 static functions simply to provide their prototypes.
417 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
418 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
419 bitset_count_, bitset_create, bitset_dump, bitset_first,
420 bitset_free, bitset_init, bitset_last, bitset_next,
421 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
422 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
423 bitset_print, bitset_release_memory, bitset_toggle_,
424 bitset_type_choose, bitset_type_get, bitset_type_name_get,
425 debug_bitset): Likewise.
426 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
427 * lib/bitset_stats.c (bitset_log_histogram_print,
428 bitset_percent_histogram_print, bitset_stats_and,
429 bitset_stats_and_cmp, bitset_stats_and_or,
430 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
431 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
432 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
433 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
434 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
435 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
436 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
437 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
438 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
439 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
440 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
441 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
442 bitset_stats_zero): Likewise.
443 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
444 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
445 bitsetv_dump, debug_bitsetv): Likewise.
446 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
447 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
448 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
449 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
450 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
451 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
452 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
453 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
454 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
455 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
456 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
457 Likewise.
458 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
459 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
460 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
461 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
462 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
463 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
464 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
465 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
466 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
467 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
468 lbitset_xor_cmp, lbitset_zero): Likewise.
469
4702002-10-14 Akim Demaille <akim@epita.fr>
471
472 Version 1.75.
473
4742002-10-14 Akim Demaille <akim@epita.fr>
475
476 * tests/Makefile.am (maintainer-check-posix): New.
477
4782002-10-14 Akim Demaille <akim@epita.fr>
479
480 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
481 member.
482
4832002-10-14 Akim Demaille <akim@epita.fr>
484
485 * src/tables.c (table_ninf_remap): base -> tab.
486 Reported by Matt Rosing.
487
4882002-10-14 Paul Eggert <eggert@twinsun.com>
489
490 * tests/action.at, tests/calc.at, tests/conflicts.at,
491 tests/cxx-type.at, tests/headers.at, tests/input.at,
492 tests/regression.at, tests/synclines.at, tests/torture.at:
493 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
494 so that the tests still work even if POSIXLY_CORRECT is set.
495 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
496
497 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
498 for portability to K&R hosts. Fix typo: signed char is guaranteed
499 only to 127, not to 128.
500 * data/glr.c (yysigned_char): New type.
501 * data/yacc.c (yysigned_char): Likewise.
502 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
503
5042002-10-13 Paul Eggert <eggert@twinsun.com>
505
506 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
507 true due to limited range of data type" warning from GCC.
508
509 * data/c.m4 (b4_token_defines): Protect against double-inclusion
510 by wrapping enum yytokentype's definition inside #ifndef
511 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
512
5132002-10-13 Akim Demaille <akim@epita.fr>
514
515 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
516 Un yy- yyrhs to avoid the name clash with the global YYRHS.
517
5182002-10-13 Akim Demaille <akim@epita.fr>
519
520 * Makefile.maint: Update from Autoconf 2.54.
521 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
522
5232002-10-13 Akim Demaille <akim@epita.fr>
524
525 * src/print.c (print_state): Separate the list of solved conflicts
526 from the other items.
527 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
528
5292002-10-13 Akim Demaille <akim@epita.fr>
530
531 Let nondeterministic skeletons be usable with deterministic
532 tables.
533
534 With the patch, GAWK compiled by GCC without -O2 passes its test
535 suite using a GLR parser driven by LALR tables. It fails with -O2
536 because `struct stat' gives two different answers on my machine:
537 88 (definition of an auto var) and later 96 (memset on this var).
538 Hence the stack is badly corrumpted. The headers inclusion is to
539 blame: if I move the awk.h inclusion before GLR's system header
540 inclusion, the two struct stat have the same size.
541
542 * src/tables.c (pack_table): Always create conflict_table.
543 (token_actions): Always create conflict_list.
544 * data/glr.c (YYFLAG): Remove, unused.
545
5462002-10-13 Akim Demaille <akim@epita.fr>
547
548 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
549 (O0FLAGS): New.
550 (VALGRIND, GXX): New.
551 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
552 * tests/bison.in: Run $PREBISON a pre-command.
553 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
554 (maintainer-check-g++): New.
555 * Makefile.am (maintainer-check): New.
556
5572002-10-13 Akim Demaille <akim@epita.fr>
558
559 * data/glr.c: Formatting changes.
560 Tweak some trace messages to match yacc.c's.
561
5622002-10-13 Akim Demaille <akim@epita.fr>
563
564 GLR parsers sometimes raise parse errors instead of performing the
565 default reduction.
566 Reported by Charles-Henry de Boysson.
567
568 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
569 check the length of the traces when %glr.
570 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
571 GLR's traces.
572 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
573 Test GLR parsers.
574 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
575 (yyltype): Remove the yy prefix from the member names.
576 (yytable): Complete its comment.
577 (yygetLRActions): Map error action number from YYTABLE from
578 YYTABLE_NINF to 0.
579 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
580 (which was a bug: it should have been YYTABEL_NINF, and yet it was
581 not satisfying as we could compare an YYACTION computed from
582 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
583 only value for error actions.
584 (yyreportParseError): In verbose parse error messages, don't issue
585 `error' in the list of expected tokens.
586 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
587 next action to perform to match glr.c's decoding.
588 (yytable): Complete its comment.
589
5902002-10-13 Paul Eggert <eggert@twinsun.com>
591
592 Fix problem reported by Henrik Grubbstroem in
593 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001670.html>:
594 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
595 because the Bison parser reads the second action before reducing
596 the first one.
597 * src/scan-gram.l (rule_length): New static var.
598 Use it to keep track of the rule length in the scanner, since
599 we can't expect the parser to be in lock-step sync with the scanner.
600 (handle_action_dollar, handle_action_at): Use this var.
601 * tests/actions.at (Exotic Dollars): Test for the problem.
602
6032002-10-12 Paul Eggert <eggert@twinsun.com>
604
605 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
606 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
607 Include <sys/time.h> when checking for clock_t and struct tms.
608 Use same include order as source.
609 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
610 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001674.html>.
611
612 * lib/timevar.c: Update copyright date and clarify comments.
613 (get_time) [IN_GCC]: Keep the GCC version for reference.
614
615 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
616 GCC version as of today, then merge Bison's changes.
617 Change "GCC" to "Bison" in copyright notice. timevar.def's
618 author is Akim, so change that too.
619
620 * src/reader.c (grammar_current_rule_check):
621 Don't worry about the default action if $$ is untyped.
622 Prevents bogus warnings reported by Jim Gifford in
623 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001673.html>.
624
625 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
626 * data/glr.c, data/lalr1.cc, data/yacc.c:
627 Output token definitions before the first part of user declarations.
628 Fixes compatibility problem reported by Jim Gifford for kbd in
629 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001672.html>.
630
6312002-10-11 Paul Eggert <eggert@twinsun.com>
632
633 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
634 (yyparse): here. This undoes some of the 2002-07-25 change.
635 Compatibility problem reported by Ralf S. Engelschall with
636 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
637
6382002-10-11 Akim Demaille <akim@epita.fr>
639
640 * tests/regression.at Characters Escapes): New.
641 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
642 characters.
643 Reported by Jan Nieuwenhuizen.
644
6452002-10-11 Akim Demaille <akim@epita.fr>
646
647 * po/id.po: New.
648
6492002-10-10 Paul Eggert <eggert@twinsun.com>
650
651 Portability fixes for bitsets; this also avoids several GCC
652 warnings.
653
654 * lib/abitset.c: Include <stddef.h>, for offsetof.
655 * lib/lbitset.c: Likewise.
656
657 * lib/abitset.c (abitset_bytes): Return a size that is aligned
658 properly for vectors of objects. Do not assume that adding a
659 header size to a multiple of a word size yields a value that is
660 properly aligned for the whole union.
661 * lib/bitsetv.c (bitsetv_alloc): Likewise.
662
663 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
664 unique names for structures.
665 * lib/ebitset.c (ebitset_bytes): Likewise.
666 * lib/lbitset.c (lbitset_bytes): Likewise.
667
668 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
669 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
670 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
671 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
672 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
673 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
674 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
675 to improve the type-checking that GCC can do.
676 * lib/bitset.c (bitset_op4_cmp): Likewise.
677 * lib/bitset_stats.c (bitset_stats_count,
678 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
679 bitset_stats_copy, bitset_stats_disjoint_p,
680 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
681 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
682 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
683 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
684 bitset_stats_and_or_cmp, bitset_stats_andn_or,
685 bitset_stats_andn_or_cmp, bitset_stats_or_and,
686 bitset_stats_or_and_cmp): Likewise.
687 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
688 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
689 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
690 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
691
692 * lib/abitset.h: Include bitset.h, not bbitset.h.
693 * lib/ebitset.h: Likewise.
694 * lib/lbitset.h: Likewise.
695
696 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
697 All instances of parameters of type enum bitset_opts are now of
698 type enum_bitset_opts, to conform to the C Standard, and similarly
699 for enum_bitset_type.
700 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
701 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
702
703 Do not use "struct bitset_struct" to mean different things in
704 different modules. Not only is this confusing, it violates
705 the C Standard, which requires that structure types in different
706 modules must be compatible if one is to be passed to the other.
707 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
708 All instances of "struct bitset_struct *" replaced with "bitset".
709 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
710 (union bitset_union, struct abitset_struct, struct ebitset_struct,
711 struct lbitset_struct, struct bitset_stats_struct): New types.
712 All uses of struct bitset_struct changed to union bitset_union,
713 etc.
714 * lib/abitset.c (struct abitset_struct, abitset,
715 struct bitset_struct): Remove.
716 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
717 struct bitset_struct): Remove.
718 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
719 bitset_struct): Remove.
720 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
721 Likewise.
722
723 Do not call a function of type T using a call that assumes the
724 function is of a different type U. Standard C requires that a
725 function must be called with a type that is compatible with its
726 definition.
727 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
728 New decls.
729 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
730 New functions.
731 * lib/ebitset.c (PFV): Remove.
732 * lib/lbitset.c (PFV): Likewise.
733 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
734 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
735 decls.
736 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
737 (ebitset_vtable): Use them.
738 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
739 lbitset_xor): New functions.
740 (lbitset_vtable): Use them.
741
742 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
743 Declare.
744
745 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
746 GCC warning.
747 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
748 Use offsetof, for simplicity.
749
7502002-10-06 Paul Eggert <eggert@twinsun.com>
751
752 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
753 the same width as int. This reapplies a hunk of the 2002-08-12 patch
754 <http://mail.gnu.org/pipermail/bison-patches/2002-August/001111.html>,
755 which was inadvertently undone by the 2002-09-30 patch.
756 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
757 the same width as int.
758
7592002-10-04 Paul Eggert <eggert@twinsun.com>
760
761 Version 1.50.
762
763 * configure.ac (AC_INIT), NEWS: Increment version number.
764
765 * doc/bison.texinfo: Minor spelling, grammar, and white space
766 fixes.
767 (Symbols): Mention that any negative value returned from yylex
768 signifies end-of-input. Warn about negative chars. Mention
769 the portable Standard C character set.
770
771 The GNU coding standard says CFLAGS and YFLAGS are reserved
772 for the installer to set.
773 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
774 * src/Makefile.am (AM_CFLAGS): Likewise.
775 (AM_YFLAGS): Renamed from YFLAGS.
776
777 Fix some MAX and MIN problems.
778 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
779 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
780 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
781 * src/reader.c (reader): Use it.
782
783 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
784 POSIX 1003.1-2001 has removed fgrep.
785
7862002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
787
788 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
789 interpreted as signed.
790 * lib/ebitset.c (ebitset_list): Fix bug.
791
7922002-10-01 Paul Eggert <eggert@twinsun.com>
793
794 More fixes for 64-bit hosts and large bitsets.
795
796 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
797 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
798 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
799 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
800 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
801 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
802 bitset_count_): Likewise.
803 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
804 bitset_first, bitset_last): Likewise.
805 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
806 bitset_stats_list_reverse, bitset_stats_size,
807 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
808 Likewise.
809 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
810 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
811 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
812 bitsetv_reflexive_transitive_closure): Likewise.
813 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
814 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
815 Likewise.
816 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
817 Likewise.
818
819 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
820 Use size_t, not unsigned int, to count bytes.
821 * lib/abitset.h (abitset_bytes): Likewise.
822 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
823 Likewise.
824 * lib/bitset.h (bitset_bytes): Likewise.
825 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
826 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
827 * lib/bitsetv.c (bitsetv_alloc): Likewise.
828 * lib/ebitset.c (ebitset_bytes): Likewise.
829 * lib/ebitset.h (ebitset_bytes): Likewise.
830 * lib/lbitset.c (lbitset_bytes): Likewise.
831 * lib/lbitset.h (lbitset_bytes): Likewise.
832
833 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
834 abitset_subset_p, abitset_disjoint_p, abitset_and,
835 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
836 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
837 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
838 abitset_or_and, abitset_or_and_cmp):
839 Use bitset_windex instead of unsigned int.
840 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
841 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
842 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
843 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
844 Likewise.
845 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
846
847 * lib/bitset.c (bitset_print):
848 Use proper printf formats for widths of integer types.
849 * lib/bitset_stats.c (bitset_percent_histogram_print,
850 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
851 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
852 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
853 * lib/lbitset.c (lbitset_bytes): Likewise.
854
855 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
856 BITSET_SIZE_MAX): New macros.
857 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
858 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
859 to BITSET_WINDEX_MAX.
860
861 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
862 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
863 since we now return the bitset_bindex type (not int).
864
865 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
866 when computing sizes.
867 * lib/ebitset.c (ebitset_elts_grow): Likewise.
868
869 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
870 and avoid cast to unsigned.
871
8722002-09-30 Akim Demaille <akim@epita.fr>
873
874 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
875 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
876 Updates from Michael Hayes.
877
8782002-09-30 Art Haas <ahaas@neosoft.com>
879
880 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
881 invocations.
882 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
883 defined.
884
8852002-09-27 Akim Demaille <akim@epita.fr>
886
887 Version 1.49c.
888
8892002-09-27 Akim Demaille <akim@epita.fr>
890
891 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
892 (Because of AC_LIBSOURCE).
893
8942002-09-27 Akim Demaille <akim@epita.fr>
895
896 Playing with Autoscan.
897
898 * configure.ac: Remove the old LIBOBJ tweaks.
899 (AC_REPLACE_FUNCS): Add strrchr and strtol.
900 * lib/strrchr.c: New.
901 * lib/strtol.c: New, from the Coreutils 4.5.1.
902
9032002-09-27 Akim Demaille <akim@epita.fr>
904
905 Playing with Autoscan.
906
907 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
908 * lib/Makefile.am (libbison_a_SOURCES): No longer include
909 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
910 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
911 Coreutils 4.5.1.
912
9132002-09-24 Akim Demaille <akim@epita.fr>
914
915 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
916 (Frequently Asked Questions, Parser Stack Overflow): New.
917
9182002-09-13 Akim Demaille <akim@epita.fr>
919
920 Playing with autoscan.
921
922 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
923 * src/files.c (skeleton_find): Remove, unused.
924 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
925 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
926
9272002-09-13 Akim Demaille <akim@epita.fr>
928
929 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
930 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
931
9322002-09-13 Akim Demaille <akim@epita.fr>
933
934 * configure.ac: Require 2.54.
935 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
936 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
937 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
938 Remove, provided by Autoconf macros.
939
9402002-09-12 Akim Demaille <akim@epita.fr>
941
942 * m4/prereq.m4: Update, from Coreutils 4.5.1.
943
9442002-09-12 Akim Demaille <akim@epita.fr>
945
946 * m4/prereq.m4: Update, from Fileutils 4.1.5.
947 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
948 Reported by Martin Mokrejs.
949
9502002-09-10 Akim Demaille <akim@epita.fr>
951
952 * src/parse-gram.y: Associate a human readable string to each
953 token type.
954 * tests/regression.at (Invalid inputs): Adjust.
955
9562002-09-10 Gary V. Vaughan <gary@gnu.org>
957
958 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
959 with an Autoconf-2.5x style configure.ac.
960
9612002-09-06 Paul Eggert <eggert@twinsun.com>
962
963 * doc/bison.texinfo (Conditions): Make explicit that the GPL
964 exception applies only to yacc.c. This is a modification of a
965 patch originally suggested by Akim Demaille.
966
9672002-09-06 Akim Demaille <akim@epita.fr>
968
969 * data/c.m4 (b4_copyright): Move the GPL exception comment from
970 here to...
971 * data/yacc.c: here.
972
973 * data/lalr1.cc (struct yyltype): Don't define it, since we use
974 LocationType.
975 (b4_ltype): Default to yy::Location from location.hh.
976
9772002-09-04 Jim Meyering <jim@meyering.net>
978
979 * data/yacc.c: Guard the declaration of yytoknum also with
980 `#ifdef YYPRINT', so it is declared only when used.
981
9822002-09-04 Akim Demaille <akim@epita.fr>
983
984 * configure.in: Rename as...
985 * configure.ac: this.
986 Bump to 1.49c.
987
9882002-09-04 Akim Demaille <akim@epita.fr>
989
990 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
991 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
992 translate maintainer only messages.
993
9942002-08-12 Paul Eggert <eggert@twinsun.com>
995
996 Version 1.49b.
997
998 * Makefile.am (SUBDIRS): Remove intl.
999 (DISTCLEANFILES): Remove.
1000 * NEWS: Mention that GNU M4 is now required. Clarify what is
1001 meant by "larger grammars". Mention the pt_BR translation.
1002 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
1003 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
1004 Bump version from 0.11.2 to 0.11.5.
1005 (BISON_PREREQ_STAGE): Remove.
1006 (AM_GNU_GETTEXT): Use external gettext.
1007 (AC_OUTPUT): Remove intl/Makefile.
1008
1009 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
1010
1011 * data/glr.c: Include string.h, for strlen.
1012 (yyreportParseError): Use size_t for yysize.
1013 (yy_yypstack): No longer nested inside yypstates, as nested
1014 functions are not portable. Do not assume size_t is the
1015 same width as int.
1016 (yypstates): Do not assume that ptrdiff_t is the same width
1017 as int, and similarly for yyposn and YYINDEX.
1018
1019 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
1020
1021 * lib/Makefile.am (INCLUDES): Do not include from the intl
1022 directory, which has been removed.
1023 * src/Makefile.am (INCLUDES): Likewise.
1024
1025 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
1026 (bitsets_sources, additional_bitsets_sources, timevars_sources):
1027 New vars.
1028
1029 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
1030 * tests/Makefile.am (EXTRA_DIST): Likewise.
1031
1032 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
1033 Do not assume that bitset_windex is the same width as unsigned.
1034
1035 * lib/abitset.c (abitset_unused_clear): Do not assume that
1036 bitset_word is the same width as int.
1037 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
1038 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
1039 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
1040 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
1041 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
1042
1043 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
1044 portability to one's complement hosts!).
1045 * lib/ebitset.c (ebitset_op1): Likewise.
1046 * lib/lbitset.c (lbitset_op1): Likewise.
1047
1048 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
1049 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
1050 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
1051 Sync with fileutils.
1052 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
1053 lib/gettext.h: Sync with diffutils.
1054
1055 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
1056 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
1057
1058 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
1059 PROTOTYPES to check for prototypes, and "defined __STDC__" to
1060 check for void *.
1061
1062 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
1063 size_t; the old version tried to do this but casted improperly.
1064 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
1065 (bitset_test): Now returns int, not unsigned long.
1066
1067 * lib/bitset_stats.c: Include "gettext.h".
1068 (_): New macro.
1069 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
1070 name locals "index", as it generates unnecessary warnings on some
1071 hosts that have an "index" function.
1072
1073 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
1074 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
1075 they need translation.
1076 * src/LR0.c (state_list_append, new_itemsets, get_state,
1077 append_states, generate_states): Likewise.
1078 * src/assoc.c (assoc_to_string): Likewise.
1079 * src/closure.c (print_closure, set_firsts, closure): Likewise.
1080 * src/gram.c (grammar_dump): Likewise.
1081 * src/injections.c (injections_compute): Likewise.
1082 * src/lalr.c (lookaheads_print): Likewise.
1083 * src/relation.c (relation_transpose): Likewise.
1084 * src/scan-gram.l: Likewise.
1085 * src/tables.c (table_grow, pack_vector): Likewise.
1086
1087 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
1088 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
1089 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
1090 * m4/mbstate_t.m4: Sync with fileutils.
1091 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
1092
1093 * po/LINGUAS: Add pt_BR.
1094 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
1095 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
1096 lib/timevar.c.
1097 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
1098 manual recommends.
1099 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
1100
1101 * src/complain.c (strerror_r): Remove decl; not needed.
1102 (strerror): Use same pattern as ../lib/error.c.
1103
1104 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
1105
1106 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
1107
1108 * src/main.c (main): Cast result of bindtextdomain and textdomain
1109 to void, to avoid a GCC warning when --disable-nls is in effect.
1110
1111 * src/scan-gram.l: Use strings rather than escapes when possible,
1112 to minimize the number of warnings from xgettext.
1113 (handle_action_dollar, handle_action_at): Don't use isdigit,
1114 as it mishandles negative chars and it may not work as expected
1115 outside the C locale.
1116
1117 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
1118 this is a GCC extension and is not portable to other compilers.
1119
1120 * src/system.h (alloca): Use same pattern as ../lib/error.c.
1121 Do not include <ctype.h>; no longer needed.
1122 Do not include <malloc.h>; no longer needed (and generates
1123 warnings on OpenBSD 3.0).
1124
1125 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
1126 it's not portable.
1127
1128 * tests/regression.at: Do not use 'cc -c input.c -o input';
1129 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
1130
1131 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
1132 exit status as failure, not just exit status 1. Sun C exits
1133 with status 2 sometimes.
1134
1135 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
1136 Use it for the two large tests.
1137
11382002-08-02 Akim Demaille <akim@epita.fr>
1139
1140 * src/conflicts.c (conflicts_output): Don't output rules never
1141 reduced here, since anyway that computation doesn't work.
1142 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
1143 (rule_useless_p, rule_never_reduced_p): New.
1144 (grammar_rules_partial_print): Use a filter instead of a range.
1145 Display the title only if needed.
1146 (grammar_rules_print): Adjust.
1147 (grammar_rules_never_reduced_report): New.
1148 * src/tables.c (action_row): Move the computation of rules never
1149 reduced to...
1150 (token_actions): here.
1151 * src/main.c (main): Make the parser before making the report, so
1152 that rules never reduced are computed.
1153 Call grammar_rules_never_reduced_report.
1154 * src/print.c (print_results): Report rules never reduced.
1155 * tests/conflicts.at, tests/reduce.at: Adjust.
1156
11572002-08-01 Akim Demaille <akim@epita.fr>
1158
1159 Instead of attaching lookaheads and duplicating the rules being
1160 reduced by a state, attach the lookaheads to the reductions.
1161
1162 * src/state.h (state_t): Remove the `lookaheads',
1163 `lookaheads_rule' member.
1164 (reductions_t): Add a `lookaheads' member.
1165 Use a regular array for the `rules'.
1166 * src/state.c (reductions_new): Initialize the lookaheads member
1167 to 0.
1168 (state_rule_lookaheads_print): Adjust.
1169 * src/state.h, src/state.c (state_reductions_find): New.
1170 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
1171 (count_rr_conflicts): Adjust.
1172 * src/lalr.c (LArule): Remove.
1173 (add_lookback_edge): Adjust.
1174 (state_lookaheads_count): New.
1175 (states_lookaheads_initialize): Merge into...
1176 (initialize_LA): this.
1177 (lalr_free): Adjust.
1178 * src/main.c (main): Don't free nullable and derives too early: it
1179 is used by --verbose.
1180 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
1181
11822002-08-01 Akim Demaille <akim@epita.fr>
1183
1184 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
1185 `rule_number_t**'.
1186 (set_derives, free_derives): Rename as...
1187 (derives_compute, derives_free): this.
1188 Adjust all dependencies.
1189 * src/nullable.c (set_nullable, free_nullable): Rename as...
1190 (nullable_compute, nullable_free): these.
1191 (rule_list_t): Store rule_t *, not rule_number_t.
1192 * src/state.c (state_rule_lookaheads_print): Directly compare rule
1193 pointers, instead of their numbers.
1194 * src/main.c (main): Call nullable_free, and derives_free earlier,
1195 as they were lo longer used.
1196
11972002-08-01 Akim Demaille <akim@epita.fr>
1198
1199 * lib/timevar.c (get_time): Include children time.
1200 * src/lalr.h (LA, LArule): Don't export them: used with the
1201 state_t.
1202 * src/lalr.c (LA, LArule): Static.
1203 * src/lalr.h, src/lalr.c (lalr_free): New.
1204 * src/main.c (main): Call it.
1205 * src/tables.c (pack_vector): Check whether loc is >= to the
1206 table_size, not >.
1207 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
1208 (tables_generate): do it, since that's also it which allocates
1209 them.
1210 Don't free LA and LArule, main does.
1211
12122002-07-31 Akim Demaille <akim@epita.fr>
1213
1214 Separate parser tables computation and output.
1215
1216 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
1217 (conflict_list, conflict_list_cnt, table, check, table_ninf)
1218 (yydefgoto, yydefact, high): Move to...
1219 * src/tables.h, src/tables.c: here.
1220 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1221 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1222 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
1223 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
1224 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
1225 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
1226 (action_row, save_row, token_actions, save_column, default_goto)
1227 (goto_actions, sort_actions, matching_state, pack_vector)
1228 (table_ninf_remap, pack_table, prepare_actions): Move to...
1229 * src/tables.c: here.
1230 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
1231 * src/output.c (token_actions, output_base, output_conflicts)
1232 (output_check): Merge into...
1233 (prepare_actions): this.
1234 (actions_output): Rename as...
1235 (user_actions_output): this.
1236 * src/main.c (main): Call tables_generate and tables_free.
1237
12382002-07-31 Akim Demaille <akim@epita.fr>
1239
1240 Steal GCC's --time-report support.
1241
1242 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
1243 stolen/adjusted from GCC.
1244 * m4/stage.m4: Remove time related checks.
1245 * m4/timevar.m4: New.
1246 * configure.in: Adjust.
1247 * src/system.h: Adjust to using timevar.h.
1248 * src/getargs.h, src/getargs.c: Support trace_time for
1249 --trace=time.
1250 * src/main.c (stage): Remove.
1251 (main): Replace `stage' invocations with timevar calls.
1252 * src/output.c: Insert pertinent timevar calls.
1253
12542002-07-31 Akim Demaille <akim@epita.fr>
1255
1256 Let --trace have arguments.
1257
1258 * src/getargs.h (enum trace_e): New.
1259 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
1260 (long_options, short_options): --trace/-T takes an optional
1261 argument.
1262 Change all the uses of trace_flag to reflect the new flags.
1263 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
1264
1265 Strengthen `stage' portability.
1266
1267 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
1268 * configure.in: Use it.
1269 Don't check for malloc.h and sys/times.h.
1270 * src/system.h: Include them when appropriate.
1271 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
1272 times and struct tms are available.
1273
12742002-07-30 Akim Demaille <akim@epita.fr>
1275
1276 In verbose parse error message, don't report `error' as an
1277 expected token.
1278 * tests/actions.at (Printers and Destructors): Adjust.
1279 * tests/calc.at (Calculator $1): Adjust.
1280 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
1281 error message, do not report the parser accepts the error token in
1282 that state.
1283
12842002-07-30 Akim Demaille <akim@epita.fr>
1285
1286 Normalize conflict related messages.
1287
1288 * src/complain.h, src/complain.c (warn, complain): New.
1289 * src/conflicts.c (conflicts_print): Use them.
1290 (conflict_report_yacc): New, extracted from...
1291 (conflicts_print): here.
1292 * tests/conflicts.at, tests/existing.at: Adjust.
1293
12942002-07-30 Akim Demaille <akim@epita.fr>
1295
1296 Report rules which are never reduced by the parser: those hidden
1297 by conflicts.
1298
1299 * src/LR0.c (save_reductions): Don't make the final state too
1300 different: save its reduction (accept) instead of having a state
1301 without any action (no shift or goto, no reduce).
1302 Note: the final state is now a ``regular'' state, i.e., the
1303 parsers now contain `reduce 0' as default reduction.
1304 Nevertheless, since they decide to `accept' when yystate =
1305 final_state, they still will not reduce rule 0.
1306 * src/print.c (print_actions, print_reduction): Adjust.
1307 * src/output.c (action_row): Track reduced rules.
1308 (token_actions): Report rules never reduced.
1309 * tests/conflicts.at, tests/regression.at: Adjust.
1310
13112002-07-30 Akim Demaille <akim@epita.fr>
1312
1313 `stage' was accidently included in a previous patch.
1314 Initiate its autoconfiscation.
1315
1316 * configure.in: Look for malloc.h and sys/times.h.
1317 * src/main.c (stage): Adjust.
1318 Report only when trace_flag.
1319
13202002-07-29 Akim Demaille <akim@epita.fr>
1321
1322 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
1323 state_number_t.
1324 (errs_t): symbol_t*, not symbol_number_t.
1325 (reductions_t): rule_t*, not rule_number_t.
1326 (FOR_EACH_SHIFT): New.
1327 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
1328 * src/print.c, src/print_graph.c: Adjust.
1329
13302002-07-29 Akim Demaille <akim@epita.fr>
1331
1332 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
1333
1334 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
1335 (endtoken, accept): these.
1336 * src/reader.c (reader): Set endtoken's default tag to "$end".
1337 Set undeftoken's tag to "$undefined" instead of "$undefined.".
1338 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
1339 Adjust.
1340
13412002-07-29 Akim Demaille <akim@epita.fr>
1342
1343 * src/reduce.c (reduce_grammar): When the language is empty,
1344 complain about the start symbol, not the axiom.
1345 Use its location.
1346 * tests/reduce.at (Empty Language): New.
1347
13482002-07-26 Akim Demaille <akim@epita.fr>
1349
1350 * src/reader.h, src/reader.c (gram_error): ... can't get
1351 yycontrol without making too strong assumptions on the parser
1352 itself.
1353 * src/output.c (prepare_tokens): Use the real 0th value of
1354 token_translations instead of `0'.
1355 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
1356 visible here.
1357 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
1358 for the time being: %locations ought to provide it to yyerror.
1359
13602002-07-25 Akim Demaille <akim@epita.fr>
1361
1362 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
1363 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
1364 * tests/regression.at (Web2c Actions): Adjust.
1365
13662002-07-25 Akim Demaille <akim@epita.fr>
1367
1368 Stop storing rules from 1 to nrules + 1.
1369
1370 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
1371 * src/nullable.c, src/output.c, src/print.c, src/reader.c
1372 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
1373 Iterate from 0 to nrules.
1374 Use rule_number_as_item_number and item_number_as_rule_number.
1375 Adjust to `derive' now containing possibly 0.
1376 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
1377 Handle the `- 1' part in rule numbers from/to item numbers.
1378 * src/conflicts.c (log_resolution): Fix the message which reversed
1379 shift and reduce.
1380 * src/output.c (action_row): Initialize default_rule to -1.
1381 (token_actions): Adjust.
1382 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
1383 expected output.
1384 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
1385
13862002-07-25 Akim Demaille <akim@epita.fr>
1387
1388 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
1389 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
1390 (b4_c_knr_arg_decl): New.
1391 * data/yacc.c: Use it to define yysymprint, yydestruct, and
1392 yyreport_parse_error.
1393
13942002-07-25 Akim Demaille <akim@epita.fr>
1395
1396 * data/yacc.c (yyreport_parse_error): New, extracted from...
1397 (yyparse): here.
1398 (yydestruct, yysymprint): Move above yyparse.
1399 Be K&R compliant.
1400
14012002-07-25 Akim Demaille <akim@epita.fr>
1402
1403 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
1404 replace...
1405 (b4_sint_type, b4_uint_type): these.
1406 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
1407 * tests/regression.at (Web2c Actions): Adjust.
1408
14092002-07-25 Akim Demaille <akim@epita.fr>
1410
1411 * src/gram.h (TIEM_NUMBER_MAX): New.
1412 (item_number_of_rule_number, rule_number_of_item_number): Rename
1413 as...
1414 (rule_number_as_item_number, item_number_as_rule_number): these.
1415 Adjust dependencies.
1416 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1417 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1418 (symbol_number_to_vector_number): New.
1419 (order): Of vector_number_t* type.
1420 (base_t, BASE_MAX, BASE_MIN): New.
1421 (froms, tos, width, pos, check): Of base_t type.
1422 (action_number_t, ACTION_MIN, ACTION_MAX): New.
1423 (actrow): Of action_number_t type.
1424 (conflrow): Of unsigned int type.
1425 (table_ninf, base_ninf): New.
1426 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
1427 (muscle_insert_int_table, muscle_insert_base_table)
1428 (muscle_insert_rule_number_table): New.
1429 (prepare_tokens): Output `toknum' as int_table.
1430 (action_row): Returns a rule_number_t.
1431 Use ACTION_MIN, not SHRT_MIN.
1432 (token_actions): yydefact is rule_number_t*.
1433 (table_ninf_remap): New.
1434 (pack_table): Use it for `base' and `table'.
1435 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
1436 replaced with...
1437 (YYPACT_NINF, YYTABLE_NINF): these.
1438 (yypact, yytable): Compute their types instead of hard-coded
1439 `short'.
1440 * tests/regression.at (Web2c Actions): Adjust.
1441
14422002-07-19 Akim Demaille <akim@epita.fr>
1443
1444 * src/scan-gram.l (id): Can start with an underscore.
1445
14462002-07-16 Akim Demaille <akim@epita.fr>
1447
1448 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
1449 Adjust all former `associativity' dependencies.
1450 * src/symtab.c (symbol_new): Default associativity is `undef', not
1451 `right'.
1452 (symbol_check_alias_consistence): Adjust.
1453
14542002-07-09 Akim Demaille <akim@epita.fr>
1455
1456 * doc/bison.texinfo: Properly set the ``header'' part.
1457 Use @dircategory ``GNU programming tools'' as per Texinfo's
1458 documentation.
1459 Use @copying.
1460
14612002-07-09 Akim Demaille <akim@epita.fr>
1462
1463 * lib/quotearg.h: Protect against multiple inclusions.
1464 * src/location.h (location_t): Add a `file' member.
1465 (LOCATION_RESET, LOCATION_PRINT): Adjust.
1466 * src/complain.c (warn_at, complain_at, fatal_at): Drop
1467 `error_one_per_line' support.
1468
14692002-07-09 Akim Demaille <akim@epita.fr>
1470
1471 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
1472 * src/reader.c (lineno): Remove.
1473 Adjust all dependencies.
1474 (get_merge_function): Take a location and use complain_at.
1475 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
1476 * tests/regression.at (Invalid inputs, Mixing %token styles):
1477 Adjust.
1478
14792002-07-09 Akim Demaille <akim@epita.fr>
1480
1481 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
1482 recovery rule, and forbid extensions when --yacc.
1483 (gram_error): Use complain_at.
1484 * src/reader.c (reader): Exit if there were parse errors.
1485
14862002-07-09 Akim Demaille <akim@epita.fr>
1487
1488 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
1489 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
1490 Reported by R Blake <blakers@mac.com>.
1491
14922002-07-09 Akim Demaille <akim@epita.fr>
1493
1494 * data/yacc.c: Output the copyright notive in the header.
1495
14962002-07-03 Akim Demaille <akim@epita.fr>
1497
1498 * src/output.c (froms, tos): Are state_number_t.
1499 (save_column): sp, sp1, and sp2 are state_number_t.
1500 (prepare): Rename `final' as `final_state_number', `nnts' as
1501 `nterms_number', `nrules' as `rules_number', `nstates' as
1502 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
1503 unused.
1504 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
1505 * data/lalr1.cc (nsym_): Remove, unused.
1506
15072002-07-03 Akim Demaille <akim@epita.fr>
1508
1509 * src/lalr.h, src/lalr.c (goto_number_t): New.
1510 * src/lalr.c (goto_list_t): New.
1511 Propagate them.
1512 * src/nullable.c (rule_list_t): New.
1513 Propagate.
1514 * src/types.h: Remove.
1515
15162002-07-03 Akim Demaille <akim@epita.fr>
1517
1518 * src/closure.c (print_fderives): Use rule_rhs_print.
1519 * src/derives.c (print_derives): Use rule_rhs_print.
1520 (rule_list_t): New, replaces `shorts'.
1521 (set_derives): Add comments.
1522 * tests/sets.at (Nullable, Firsts): Adjust.
1523
15242002-07-03 Akim Demaille <akim@epita.fr>
1525
1526 * src/output.c (prepare_actions): Free `tally' and `width'.
1527 (prepare_actions): Allocate and free `order'.
1528 * src/symtab.c (symbols_free): Free `symbols'.
1529 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
1530 * src/output.c (m4_invoke): Move to...
1531 * src/scan-skel.l: here.
1532 (<<EOF>>): Close yyout, and free its name.
1533
15342002-07-03 Akim Demaille <akim@epita.fr>
1535
1536 Fix some memory leaks, and fix a bug: state 0 was examined twice.
1537
1538 * src/LR0.c (new_state): Merge into...
1539 (state_list_append): this.
1540 (new_states): Merge into...
1541 (generate_states): here.
1542 (set_states): Don't ensure a proper `errs' state member here, do it...
1543 * src/conflicts.c (conflicts_solve): here.
1544 * src/state.h, src/state.c: Comment changes.
1545 (state_t): Rename member `shifts' as `transitions'.
1546 Adjust all dependencies.
1547 (errs_new): For consistency, also take the values as argument.
1548 (errs_dup): Remove.
1549 (state_errs_set): New.
1550 (state_reductions_set, state_transitions_set): Assert that no
1551 previous value was assigned.
1552 (state_free): New.
1553 (states_free): Use it.
1554 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
1555 temporary storage: use `errs' and `nerrs' as elsewhere.
1556 (set_conflicts): Allocate and free this `errs'.
1557
15582002-07-02 Akim Demaille <akim@epita.fr>
1559
1560 * lib/libiberty.h: New.
1561 * lib: Update the bitset implementation from upstream.
1562 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
1563 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
1564 * src/main.c: Adjust bitset stats calls.
1565
15662002-07-01 Paul Eggert <eggert@twinsun.com>
1567
1568 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
1569 char, so that negative chars don't collide with $.
1570
15712002-06-30 Akim Demaille <akim@epita.fr>
1572
1573 Have the GLR tests be `warning' checked, and fix the warnings.
1574
1575 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
1576 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
1577 (yyremoveDeletes): `yyi' and `yyj' are size_t.
1578 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
1579 (yyaddDeferredAction): static.
1580 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
1581 (yyreportParseError): yyprefix is const.
1582 yytokenp is used only when verbose.
1583 (yy__GNUC__): Replace with __GNUC__.
1584 (yypdumpstack): yyi is size_t.
1585 (yypreference): Un-yy local variables and arguments, to avoid
1586 clashes with `yyr1'. Anyway, we are not in the user name space.
1587 (yytname_size): be an int, as is compared with ints.
1588 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
1589 Use them.
1590 * tests/cxx-gram.at: Use quotation to protect $1.
1591 Use AT_COMPILE to enable warnings hunts.
1592 Prototype yylex and yyerror.
1593 `Use' argc.
1594 Include `string.h', not `strings.h'.
1595 Produce and prototype stmtMerge only when used.
1596 yylex takes a location.
1597
15982002-06-30 Akim Demaille <akim@epita.fr>
1599
1600 We spend a lot of time in quotearg, in particular when --verbose.
1601
1602 * src/symtab.c (symbol_get): Store a quoted version of the key.
1603 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
1604 Adjust all callers.
1605
16062002-06-30 Akim Demaille <akim@epita.fr>
1607
1608 * src/state.h (reductions_t): Rename member `nreds' as num.
1609 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
1610 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
1611
16122002-06-30 Akim Demaille <akim@epita.fr>
1613
1614 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
1615 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
1616 (shifts_to): Rename as...
1617 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
1618 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
1619 (TRANSITION_IS_DISABLED, transitions_to): these.
1620
16212002-06-30 Akim Demaille <akim@epita.fr>
1622
1623 * src/print.c (print_shifts, print_gotos): Merge into...
1624 (print_transitions): this.
1625 (print_transitions, print_errs, print_reductions): Align the
1626 lookaheads columns.
1627 (print_core, print_transitions, print_errs, print_state,
1628 print_grammar): Output empty lines separator before, not after.
1629 (state_default_rule_compute): Rename as...
1630 (state_default_rule): this.
1631 * tests/conflicts.at (Defaulted Conflicted Reduction),
1632 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
1633 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
1634
16352002-06-30 Akim Demaille <akim@epita.fr>
1636
1637 Display items as we display rules.
1638
1639 * src/gram.h, src/gram.c (rule_lhs_print): New.
1640 * src/gram.c (grammar_rules_partial_print): Use it.
1641 * src/print.c (print_core): Likewise.
1642 * tests/conflicts.at (Defaulted Conflicted Reduction),
1643 (Unresolved SR Conflicts): Adjust.
1644 (Unresolved SR Conflicts): Adjust and rename as...
1645 (Resolved SR Conflicts): this, as was meant.
1646 * tests/regression.at (Web2c Report): Adjust.
1647
16482002-06-30 Akim Demaille <akim@epita.fr>
1649
1650 * src/print.c (state_default_rule_compute): New, extracted from...
1651 (print_reductions): here.
1652 Pessimize, but clarify the code.
1653 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
1654
16552002-06-30 Akim Demaille <akim@epita.fr>
1656
1657 * src/output.c (action_row): Let default_rule be always a rule
1658 number.
1659
16602002-06-30 Akim Demaille <akim@epita.fr>
1661
1662 * src/closure.c (print_firsts, print_fderives, closure):
1663 Use BITSET_EXECUTE.
1664 * src/lalr.c (lookaheads_print): Likewise.
1665 * src/state.c (state_rule_lookaheads_print): Likewise.
1666 * src/print_graph.c (print_core): Likewise.
1667 * src/print.c (print_reductions): Likewise.
1668 * src/output.c (action_row): Likewise.
1669 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
1670
16712002-06-30 Akim Demaille <akim@epita.fr>
1672
1673 * src/print_graph.c: Use report_flag.
1674
16752002-06-30 Akim Demaille <akim@epita.fr>
1676
1677 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
1678 to...
1679 * src/relation.h, src/relation.c (traverse, relation_digraph)
1680 (relation_print, relation_transpose): New.
1681
16822002-06-30 Akim Demaille <akim@epita.fr>
1683
1684 * src/state.h, src/state.c (shifts_to): New.
1685 * src/lalr.c (build_relations): Use it.
1686
16872002-06-30 Akim Demaille <akim@epita.fr>
1688
1689 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
1690 (item_number_of_rule_number, rule_number_of_item_number): New.
1691 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
1692 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
1693 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
1694 Propagate their use.
1695 Much remains to be done, in particular wrt `shorts' from types.h.
1696
16972002-06-30 Akim Demaille <akim@epita.fr>
1698
1699 * src/symtab.c (symbol_new): Initialize the `printer' member.
1700
17012002-06-30 Akim Demaille <akim@epita.fr>
1702
1703 * src/LR0.c (save_reductions): Remove, replaced by...
1704 * src/state.h, src/state.c (state_reductions_set): New.
1705 (reductions, errs): Rename as...
1706 (reductions_t, errs_t): these.
1707 Adjust all dependencies.
1708
17092002-06-30 Akim Demaille <akim@epita.fr>
1710
1711 * src/LR0.c (state_list_t, state_list_append): New.
1712 (first_state, last_state): Now symbol_list_t.
1713 (this_state): Remove.
1714 (new_itemsets, append_states, save_reductions): Take a state_t as
1715 argument.
1716 (set_states, generate_states): Adjust.
1717 (save_shifts): Remove, replaced by...
1718 * src/state.h, src/state.c (state_shifts_set): New.
1719 (shifts): Rename as...
1720 (shifts_t): this.
1721 Adjust all dependencies.
1722 * src/state.h (state_t): Remove the `next' member.
1723
17242002-06-30 Akim Demaille <akim@epita.fr>
1725
1726 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
1727 escaped in slot 0.
1728
17292002-06-30 Akim Demaille <akim@epita.fr>
1730
1731 Use hash.h for the state hash table.
1732
1733 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
1734 (allocate_storage): Use state_hash_new.
1735 (free_storage): Use state_hash_free.
1736 (new_state, get_state): Adjust.
1737 * src/lalr.h, src/lalr.c (states): Move to...
1738 * src/states.h (state_t): Remove the `link' member, no longer
1739 used.
1740 * src/states.h, src/states.c: here.
1741 (state_hash_new, state_hash_free, state_hash_lookup)
1742 (state_hash_insert, states_free): New.
1743 * src/states.c (state_table, state_compare, state_hash): New.
1744 * src/output.c (output_actions): Do not free states now, since we
1745 still need to know the final_state number in `prepare', called
1746 afterwards. Do it...
1747 * src/main.c (main): here: call states_free after `output'.
1748
17492002-06-30 Akim Demaille <akim@epita.fr>
1750
1751 * src/state.h, src/state.c (state_new): New, extracted from...
1752 * src/LR0.c (new_state): here.
1753 * src/state.h (STATE_ALLOC): Move to...
1754 * src/state.c: here.
1755 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
1756 * src/state.h, src/state.c: here.
1757
17582002-06-30 Akim Demaille <akim@epita.fr>
1759
1760 * src/reader.c (gensym): Rename as...
1761 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
1762 (getsym): Rename as...
1763 (symbol_get): this.
1764
17652002-06-30 Akim Demaille <akim@epita.fr>
1766
1767 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
1768 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
1769 * src/output.c, src/print.c, src/print_graph.c: Propagate.
1770 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
1771
17722002-06-30 Akim Demaille <akim@epita.fr>
1773
1774 Make the test suite pass with warnings checked.
1775
1776 * tests/actions.at (Printers and Destructors): Improve.
1777 Avoid unsigned vs. signed issues.
1778 * tests/calc.at: Don't exercise the scanner here, do it...
1779 * tests/input.at (Torturing the Scanner): here.
1780
17812002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1782
1783 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
1784 reorganize first lines parallel to yacc.c.
1785
17862002-06-28 Akim Demaille <akim@epita.fr>
1787
1788 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
1789 (b4_token_enum, b4_token_defines): New, factored from...
1790 * data/lalr1.cc, data/yacc.c, glr.c: here.
1791
17922002-06-28 Akim Demaille <akim@epita.fr>
1793
1794 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
1795 unused variables.
1796 * src/output.c (merger_output): static.
1797
17982002-06-28 Akim Demaille <akim@epita.fr>
1799
1800 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
1801 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
1802 pacify GCC.
1803 * src/output.c (save_row): Initialize all the variables to pacify GCC.
1804
18052002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1806
1807 Accumulated changelog for new GLR parsing features.
1808
1809 * src/conflicts.c (count_total_conflicts): Change name to
1810 conflicts_total_count.
1811 * src/conflicts.h: Ditto.
1812 * src/output.c (token_actions): Use the new name.
1813 (output_conflicts): Change conflp => conflict_list_heads, and
1814 confl => conflict_list for better readability.
1815 * data/glr.c: Use the new names.
1816 * NEWS: Add self to GLR announcement.
1817
1818 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
1819
1820 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
1821 Akim Demaille.
1822
1823 * data/bison.glr: Change name to glr.c
1824 * data/glr.c: Renamed from bison.glr.
1825 * data/Makefile.am: Add glr.c
1826
1827 * src/getargs.c:
1828
1829 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
1830 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
1831
1832 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1833
1834 * data/bison.glr: Be sure to restore the
1835 current #line when returning to the skeleton contents after having
1836 exposed the input file's #line.
1837
1838 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1839
1840 * data/bison.glr: Bring up to date with changes to bison.simple.
1841
1842 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1843
1844 * data/bison.glr: Correct definitions that use b4_prefix.
1845 Various reformatting.
1846 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
1847 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
1848 yytokenp argument; now part of stack.
1849 (yychar): Define to behave as documented.
1850 (yyclearin): Ditto.
1851
1852 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1853
1854 * src/reader.h: Add declaration for free_merger_functions.
1855
1856 * src/reader.c (merge_functions): New variable.
1857 (get_merge_function): New function.
1858 (free_merger_functions): New function.
1859 (readgram): Check for %prec that is not followed by a symbol.
1860 Handle %dprec and %merge declarations.
1861 (packgram): Initialize dprec and merger fields in rules array.
1862
1863 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
1864 conflict_list_cnt, conflict_list_free): New variables.
1865 (table_grow): Also grow conflict_table.
1866 (prepare_rules): Output dprec and merger tables.
1867 (conflict_row): New function.
1868 (action_row): Output conflict lists for GLR parser. Don't use
1869 default reduction in conflicted states for GLR parser so that there
1870 are spaces for the conflict lists.
1871 (save_row): Also save conflict information.
1872 (token_actions): Allocate conflict list.
1873 (merger_output): New function.
1874 (pack_vector): Pack conflict table, too.
1875 (output_conflicts): New function to output yyconflp and yyconfl.
1876 (output_check): Allocate conflict_tos.
1877 (output_actions): Output conflict tables, also.
1878 (output_skeleton): Output b4_mergers definition.
1879 (prepare): Output b4_max_rhs_length definition.
1880 Use 'bison.glr' as default skeleton for GLR parsers.
1881
1882 * src/gram.c (glr_parser): New flag.
1883 (grammar_free): Call free_merger_functions.
1884
1885 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
1886 all pairs of conflicting reductions, rather than just all tokens
1887 causing conflicts. Needed to size conflict tables.
1888 (conflicts_output): Modify call to count_rr_conflicts for new
1889 interface.
1890 (conflicts_print): Ditto.
1891 (count_total_conflicts): New function.
1892
1893 * src/reader.h (merger_list): New type.
1894 (merge_functions): New variable.
1895
1896 * src/lex.h (tok_dprec, tok_merge): New token types.
1897
1898 * src/gram.h (rule_s): Add dprec and merger fields.
1899 (glr_parser): New flag.
1900
1901 * src/conflicts.h (count_total_conflicts): New function.
1902
1903 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
1904
1905 * doc/bison.texinfo (Generalized LR Parsing): New section.
1906 (GLR Parsers): New section.
1907 (Language and Grammar): Mention GLR parsing.
1908 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
1909 Correct typo ("tge" -> "the").
1910
1911 * data/bison.glr: New skeleton for GLR parsing.
1912
1913 * tests/cxx-gram.at: New tests for GLR parsing.
1914
1915 * tests/testsuite.at: Include cxx-gram.at.
1916
1917 * tests/Makefile.am: Add cxx-gram.at.
1918
1919 * src/parse-gram.y:
1920
1921 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
1922
1923 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
1924
19252002-06-27 Akim Demaille <akim@epita.fr>
1926
1927 * src/options.h, src/options.c: Remove.
1928 * src/getargs.c (short_options, long_options): New.
1929
19302002-06-27 Akim Demaille <akim@epita.fr>
1931
1932 * data/bison.simple, data/bison.c++: Rename as...
1933 * data/yacc.c, data/lalr1.cc: these.
1934 * doc/bison.texinfo (Environment Variables): Remove.
1935
19362002-06-25 Raja R Harinath <harinath@cs.umn.edu>
1937
1938 * src/getargs.c (report_argmatch): Initialize strtok().
1939
19402002-06-20 Akim Demaille <akim@epita.fr>
1941
1942 * data/bison.simple (b4_symbol_actions): New, replaces...
1943 (b4_symbol_destructor, b4_symbol_printer): these.
1944 (yysymprint): Be sure to call YYPRINT only for tokens, and using
1945 user token numbers.
1946
19472002-06-20 Akim Demaille <akim@epita.fr>
1948
1949 * data/bison.simple (yydestructor): Rename as...
1950 (yydestruct): this.
1951
19522002-06-20 Akim Demaille <akim@epita.fr>
1953
1954 * src/symtab.h, src/symtab.c (symbol_type_set)
1955 (symbol_destructor_set, symbol_precedence_set): The location is
1956 the last argument.
1957 Adjust all callers.
1958
19592002-06-20 Akim Demaille <akim@epita.fr>
1960
1961 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
1962 internals.
1963 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
1964 Takes a location.
1965 * src/symtab.h, src/symtab.c (symbol_class_set)
1966 (symbol_user_token_number_set): Likewise.
1967 Adjust all callers.
1968 Promote complain_at.
1969 * tests/input.at (Type Clashes): Adjust.
1970
19712002-06-20 Akim Demaille <akim@epita.fr>
1972
1973 * data/bison.simple (YYLEX): Fix the declaration when
1974 %pure-parser.
1975
19762002-06-20 Akim Demaille <akim@epita.fr>
1977
1978 * data/bison.simple (yysymprint): Don't print the token number,
1979 just its name.
1980 * tests/actions.at (Destructors): Rename as...
1981 (Printers and Destructors): this.
1982 Also exercise %printer.
1983
19842002-06-20 Akim Demaille <akim@epita.fr>
1985
1986 * data/bison.simple (YYDSYMPRINT): New.
1987 Use it to remove many of the #if YYDEBUG/if (yydebug).
1988
19892002-06-20 Akim Demaille <akim@epita.fr>
1990
1991 * src/symtab.h, src/symtab.c (symbol_t): printer and
1992 printer_location are new members.
1993 (symbol_printer_set): New.
1994 * src/parse-gram.y (PERCENT_PRINTER): New token.
1995 Handle its associated rule.
1996 * src/scan-gram.l: Adjust.
1997 (handle_destructor_at, handle_destructor_dollar): Rename as...
1998 (handle_symbol_code_at, handle_symbol_code_dollar): these.
1999 * src/output.c (symbol_printers_output): New.
2000 (output_skeleton): Call it.
2001 * data/bison.simple (yysymprint): New. Cannot be named yyprint
2002 since there are already many grammar files with a user `yyprint'.
2003 Replace the calls to YYPRINT to calls to yysymprint.
2004 * tests/calc.at: Adjust.
2005 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
2006 taking advantage of parser very internal details (stack size!).
2007
20082002-06-20 Akim Demaille <akim@epita.fr>
2009
2010 * src/scan-gram.l: Complete the scanner with the missing patterns
2011 to pacify Flex.
2012 Use `quote' and `symbol_tag_get' where appropriate.
2013
20142002-06-19 Akim Demaille <akim@epita.fr>
2015
2016 * tests/actions.at (Destructors): Augment to test locations.
2017 * data/bison.simple (yydestructor): Pass it the current location
2018 if locations are enabled.
2019 Prototype only when __STDC__ or C++.
2020 Change the argument names to move into the yy name space: there is
2021 user code here.
2022
20232002-06-19 Akim Demaille <akim@epita.fr>
2024
2025 * data/bison.simple (b4_pure_if): New.
2026 Use it instead of #ifdef YYPURE.
2027
20282002-06-19 Akim Demaille <akim@epita.fr>
2029
2030 * data/bison.simple (b4_location_if): New.
2031 Use it instead of #ifdef YYLSP_NEEDED.
2032
20332002-06-19 Akim Demaille <akim@epita.fr>
2034
2035 Prepare @$ in %destructor, but currently don't bind it in the
2036 skeleton, as %location use is not cleaned up yet.
2037
2038 * src/scan-gram.l (handle_dollar, handle_destructor_at)
2039 (handle_action_at): New.
2040 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
2041 a braced_code_t and a location as additional arguments.
2042 (handle_destructor_dollar): Instead of requiring `b4_eval', just
2043 unquote one when outputting `b4_dollar_dollar'.
2044 Adjust callers.
2045 * data/bison.simple (b4_eval): Remove.
2046 (b4_symbol_destructor): Adjust.
2047 * tests/input.at (Invalid @n): Adjust.
2048
20492002-06-19 Zack Weinberg <zack@codesourcery.com>
2050
2051 * doc/bison.texinfo: Document ability to have multiple
2052 prologue sections.
2053
20542002-06-18 Akim Demaille <akim@epita.fr>
2055
2056 * src/files.c (compute_base_names): When computing the output file
2057 names from the input file name, strip the directory part.
2058
20592002-06-18 Akim Demaille <akim@epita.fr>
2060
2061 * data/bison.simple.new: Comment changes.
2062 Reported by Andreas Schwab.
2063
20642002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
2065
2066 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
2067 there are no `label `yyoverflowlab' defined but not used' warnings
2068 when yyoverflow is defined.
2069
20702002-06-18 Akim Demaille <akim@epita.fr>
2071
2072 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
2073 new member.
2074 (symbol_destructor_set): Adjust.
2075 * src/output.c (symbol_destructors_output): Output the destructor
2076 locations.
2077 Output the symbol name.
2078 * data/bison.simple (b4_symbol_destructor): Adjust.
2079
20802002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
2081 and Akim Demaille <akim@epita.fr>
2082
2083 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
2084 what's left on the stack when the error recovery hits EOF.
2085 * tests/actions.at (Destructors): Complete to exercise this case.
2086
20872002-06-17 Akim Demaille <akim@epita.fr>
2088
2089 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
2090 arguments is really empty, not only equal to `[]'.
2091 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
2092 member.
2093 (symbol_destructor_set): New.
2094 * src/output.c (symbol_destructors_output): New.
2095 * src/reader.h (brace_code_t, current_braced_code): New.
2096 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
2097 (handle_dollar): Rename as...
2098 (handle_action_dollar): this.
2099 (handle_destructor_dollar): New.
2100 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
2101 (grammar_declaration): Use it.
2102 * data/bison.simple (yystos): Is always defined.
2103 (yydestructor): New.
2104 * tests/actions.at (Destructors): New.
2105 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
2106
21072002-06-17 Akim Demaille <akim@epita.fr>
2108
2109 * src/symlist.h, src/symlist.c (symbol_list_length): New.
2110 * src/scan-gram.l (handle_dollar, handle_at): Compute the
2111 rule_length only when needed.
2112 * src/output.c (actions_output, token_definitions_output): Output
2113 the full M4 block.
2114 * src/symtab.c: Don't access directly to the symbol tag, use
2115 symbol_tag_get.
2116 * src/parse-gram.y: Use symbol_list_free.
2117
21182002-06-17 Akim Demaille <akim@epita.fr>
2119
2120 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
2121 (symbol_list_prepend, get_type_name): Move to...
2122 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
2123 (symbol_list_prepend, symbol_list_n_type_name_get): here.
2124 Adjust all callers.
2125 (symbol_list_free): New.
2126 * src/scan-gram.l (handle_dollar): Takes a location.
2127 * tests/input.at (Invalid $n): Adjust.
2128
21292002-06-17 Akim Demaille <akim@epita.fr>
2130
2131 * src/reader.h, src/reader.c (symbol_list_new): Export it.
2132 (symbol_list_prepend): New.
2133 * src/parse-gram.y (%union): `list' is a new member.
2134 (symbols.1): New, replaces...
2135 (terms_to_prec.1, nterms_to_type.1): these.
2136 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
2137 Take a location as additional argument.
2138 Adjust all callers.
2139
21402002-06-15 Akim Demaille <akim@epita.fr>
2141
2142 * src/parse-gram.y: Move %token in the declaration section so that
2143 we don't depend upon CVS Bison.
2144
21452002-06-15 Akim Demaille <akim@epita.fr>
2146
2147 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
2148 * src/print.c (print_core): Use it.
2149
21502002-06-15 Akim Demaille <akim@epita.fr>
2151
2152 * src/conflicts.c (log_resolution): Accept the rule involved in
2153 the sr conflicts instead of the lookahead number that points to
2154 that rule.
2155 (flush_reduce): Accept the current lookahead vector as argument,
2156 instead of the index in LA.
2157 (resolve_sr_conflict): Accept the current number of lookahead
2158 bitset to consider for the STATE, instead of the index in LA.
2159 (set_conflicts): Adjust.
2160 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
2161
21622002-06-15 Akim Demaille <akim@epita.fr>
2163
2164 * src/state.h (state_t): Replace the `lookaheadsp' member, a
2165 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
2166 Adjust all dependencies.
2167 * src/lalr.c (initialize_lookaheads): Split into...
2168 (states_lookaheads_count, states_lookaheads_initialize): these.
2169 (lalr): Adjust.
2170
21712002-06-15 Akim Demaille <akim@epita.fr>
2172
2173 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
2174 out of...
2175 (grammar_rules_print): here.
2176 * src/reduce.c (reduce_output): Use it.
2177 * tests/reduce.at (Useless Rules, Reduced Automaton)
2178 (Underivable Rules): Adjust.
2179
21802002-06-15 Akim Demaille <akim@epita.fr>
2181
2182 Copy BYacc's nice way to report the grammar.
2183
2184 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
2185 New.
2186 Don't print the rules' location, it is confusing and useless.
2187 (rule_print): Use grammar_rhs_print.
2188 * src/print.c (print_grammar): Use grammar_rules_print.
2189
21902002-06-15 Akim Demaille <akim@epita.fr>
2191
2192 Complete and rationalize `useless thing' warnings.
2193
2194 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
2195 (symbol_tag_print): New.
2196 Use them everywhere in place of accessing directly the tag member.
2197 * src/gram.h, src/gram.c (rule_print): New.
2198 Use it where a rule used to be printed `by hand'.
2199 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
2200 (reduce_grammar_tables): Report the useless rules.
2201 (reduce_print): Useless things are a warning, not an error.
2202 Report it as such.
2203 * tests/reduce.at (Useless Nonterminals, Useless Rules):
2204 (Reduced Automaton, Underivable Rules): Adjust.
2205 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
2206 * tests/conflicts.at (Unresolved SR Conflicts)
2207 (Solved SR Conflicts): Adjust.
2208
22092002-06-15 Akim Demaille <akim@epita.fr>
2210
2211 Let symbols have a location.
2212
2213 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
2214 (getsym): Adjust.
2215 Adjust all callers.
2216 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
2217 Use location_t, not int.
2218 * src/symtab.c (symbol_check_defined): Take advantage of the
2219 location.
2220 * tests/regression.at (Invalid inputs): Adjust.
2221
22222002-06-15 Akim Demaille <akim@epita.fr>
2223
2224 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
2225 (input): Don't try to initialize yylloc here, do it in the
2226 scanner.
2227 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
2228 * src/gram.h (rule_t): Change line and action_line into location
2229 and action_location, of location_t type.
2230 Adjust all dependencies.
2231 * src/location.h, src/location.c (empty_location): New.
2232 * src/reader.h, src/reader.c (grammar_start_symbol_set)
2233 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
2234 (grammar_current_rule_symbol_append)
2235 (grammar_current_rule_action_append): Expect a location as argument.
2236 * src/reader.c (grammar_midrule_action): Adjust to attach an
2237 action's location as dummy symbol location.
2238 * src/symtab.h, src/symtab.c (startsymbol_location): New.
2239 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
2240 the line numbers.
2241
22422002-06-14 Akim Demaille <akim@epita.fr>
2243
2244 Grammar declarations may be found in the grammar section.
2245
2246 * src/parse-gram.y (rules_or_grammar_declaration): New.
2247 (declarations): Each declaration may end with a semicolon, not
2248 just...
2249 (grammar_declaration): `"%union"'.
2250 (grammar): Branch to rules_or_grammar_declaration.
2251
22522002-06-14 Akim Demaille <akim@epita.fr>
2253
2254 * src/main.c (main): Invoke scanner_free.
2255
22562002-06-14 Akim Demaille <akim@epita.fr>
2257
2258 * src/output.c (m4_invoke): Extracted from...
2259 (output_skeleton): here.
2260 Free tempfile.
2261
22622002-06-14 Akim Demaille <akim@epita.fr>
2263
2264 * src/parse-gram.y (directives, directive, gram)
2265 (grammar_directives, precedence_directives, precedence_directive):
2266 Rename as...
2267 (declarations, declaration, grammar, grammar_declaration)
2268 (precedence_declaration, precedence_declarator): these.
2269 (symbol_declaration): New.
2270
22712002-06-14 Akim Demaille <akim@epita.fr>
2272
2273 * src/files.c (action_obstack): Remove, unused.
2274 (output_obstack): Remove it, and all its dependencies, as it is no
2275 longer needed.
2276 * src/reader.c (epilogue_set): Build the epilogue in the
2277 muscle_obstack.
2278 * src/output.h, src/output.c (muscle_obstack): Move to...
2279 * src/muscle_tab.h, src/muscle_tab.h: here.
2280 (muscle_init): Initialize muscle_obstack.
2281 (muscle_free): New.
2282 * src/main.c (main): Call it.
2283
22842002-06-14 Akim Demaille <akim@epita.fr>
2285
2286 * src/location.h: New, extracted from...
2287 * src/reader.h: here.
2288 * src/Makefile.am (noinst_HEADERS): Merge into
2289 (bison_SOURCES): this.
2290 Add location.h.
2291 * src/parse-gram.y: Use location_t instead of Bison's.
2292 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
2293 Use location_t instead of ints.
2294
22952002-06-14 Akim Demaille <akim@epita.fr>
2296
2297 * data/bison.simple, data/bison.c++: Be sure to restore the
2298 current #line when returning to the skeleton contents after having
2299 exposed the input file's #line.
2300
23012002-06-12 Akim Demaille <akim@epita.fr>
2302
2303 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
2304 eager.
2305 * tests/actions.at (Exotic Dollars): New.
2306
23072002-06-12 Akim Demaille <akim@epita.fr>
2308
2309 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
2310 ['"/] too eagerly.
2311 * tests/input.at (Torturing the Scanner): New.
2312
23132002-06-11 Akim Demaille <akim@epita.fr>
2314
2315 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
2316 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
2317 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
2318 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
2319 * src/reader.c (reader): Use it.
2320
23212002-06-11 Akim Demaille <akim@epita.fr>
2322
2323 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
2324 Adjust all callers.
2325 (scanner_last_string_free): New.
2326
23272002-06-11 Akim Demaille <akim@epita.fr>
2328
2329 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
2330 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
2331 (last_string, YY_OBS_FREE): New.
2332 Use them when returning an ID.
2333
23342002-06-11 Akim Demaille <akim@epita.fr>
2335
2336 Have Bison grammars parsed by a Bison grammar.
2337
2338 * src/reader.c, src/reader.h (prologue_augment): New.
2339 * src/reader.c (copy_definition): Remove.
2340
2341 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
2342 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
2343 (grammar_current_rule_prec_set, grammar_current_rule_check)
2344 (grammar_current_rule_symbol_append)
2345 (grammar_current_rule_action_append): Export.
2346 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
2347 (symbol_list_action_append): Remove.
2348 Hook the routines from reader.
2349 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
2350 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
2351
2352 * src/reader.c (read_declarations): Remove, unused.
2353
2354 * src/parse-gram.y: Handle the epilogue.
2355 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
2356 (grammar_start_symbol_set): this.
2357 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
2358 * src/reader.c (readgram): Remove, unused.
2359 (reader): Adjust to insert eoftoken and axiom where appropriate.
2360
2361 * src/reader.c (copy_dollar): Replace with...
2362 * src/scan-gram.h (handle_dollar): this.
2363 * src/parse-gram.y: Remove `%thong'.
2364
2365 * src/reader.c (copy_at): Replace with...
2366 * src/scan-gram.h (handle_at): this.
2367
2368 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
2369 New.
2370
2371 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
2372 time being.
2373
2374 * src/reader.h, src/reader.c (grammar_rule_end): New.
2375
2376 * src/parse.y (current_type, current_class): New.
2377 Implement `%nterm', `%token' support.
2378 Merge `%term' into `%token'.
2379 (string_as_id): New.
2380 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
2381 type name.
2382
2383 * src/parse-gram.y: Be sure to handle properly the beginning of
2384 rules.
2385
2386 * src/parse-gram.y: Handle %type.
2387 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
2388
2389 * src/parse-gram.y: More directives support.
2390 * src/options.c: No longer handle source directives.
2391
2392 * src/parse-gram.y: Fix %output.
2393
2394 * src/parse-gram.y: Handle %union.
2395 Use the prologue locations.
2396 * src/reader.c (parse_union_decl): Remove.
2397
2398 * src/reader.h, src/reader.c (epilogue_set): New.
2399 * src/parse-gram.y: Use it.
2400
2401 * data/bison.simple, data/bison.c++: b4_stype is now either not
2402 defined, then default to int, or to the contents of %union,
2403 without `union' itself.
2404 Adjust.
2405 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
2406
2407 * src/output.c (actions_output): Don't output braces, as they are
2408 already handled by the scanner.
2409
2410 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
2411 characters to themselves.
2412
2413 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
2414 that the epilogue has a proper #line.
2415
2416 * src/parse-gram.y: Handle precedence/associativity.
2417
2418 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
2419 a terminal.
2420 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
2421 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
2422 at all to define terminals that cannot be emitted.
2423
2424 * src/scan-gram.l: Escape M4 characters.
2425
2426 * src/scan-gram.l: Working properly with escapes in user
2427 strings/characters.
2428
2429 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
2430 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
2431 grammar.
2432 Use more modest sizes, as for the time being the parser does not
2433 release memory, and therefore the process swallows a huge amount
2434 of memory.
2435
2436 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
2437 stricter %token grammar.
2438
2439 * src/symtab.h (associativity): Add `undef_assoc'.
2440 (symbol_precedence_set): Do nothing when passed an undef_assoc.
2441 * src/symtab.c (symbol_check_alias_consistence): Adjust.
2442
2443 * tests/regression.at (Invalid %directive): Remove, as it is now
2444 meaningless.
2445 (Invalid inputs): Adjust to the new error messages.
2446 (Token definitions): The new grammar doesn't allow too many
2447 eccentricities.
2448
2449 * src/lex.h, src/lex.c: Remove.
2450 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
2451 (copy_character, copy_string2, copy_string, copy_identifier)
2452 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
2453 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
2454 (parse_action): Remove.
2455 * po/POTFILES.in: Adjust.
2456
24572002-06-11 Akim Demaille <akim@epita.fr>
2458
2459 * src/reader.c (parse_action): Don't store directly into the
2460 rule's action member: return the action as a string.
2461 Don't require `rule_length' as an argument: compute it.
2462 (grammar_current_rule_symbol_append)
2463 (grammar_current_rule_action_append): New, eved out from
2464 (readgram): here.
2465 Remove `action_flag', `rulelength', unused now.
2466
24672002-06-11 Akim Demaille <akim@epita.fr>
2468
2469 * src/reader.c (grammar_current_rule_prec_set).
2470 (grammar_current_rule_check): New, eved out from...
2471 (readgram): here.
2472 Remove `xaction', `first_rhs': useless.
2473 * tests/input.at (Type clashes): New.
2474 * tests/existing.at (GNU Cim Grammar): Adjust.
2475
24762002-06-11 Akim Demaille <akim@epita.fr>
2477
2478 * src/reader.c (grammar_midrule_action): New, Eved out from
2479 (readgram): here.
2480
24812002-06-11 Akim Demaille <akim@epita.fr>
2482
2483 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
2484 New.
2485 (readgram): Use them as replacement of inlined code, crule and
2486 crule1.
2487
24882002-06-11 Akim Demaille <akim@epita.fr>
2489
2490 * src/reader.c (grammar_end, grammar_symbol_append): New.
2491 (readgram): Use them.
2492 Make the use of `p' as local as possible.
2493
24942002-06-10 Akim Demaille <akim@epita.fr>
2495
2496 GCJ's parser requires the tokens to be defined before the prologue.
2497
2498 * data/bison.simple: Output the token definition before the user's
2499 prologue.
2500 * tests/regression.at (Braces parsing, Duplicate string)
2501 (Mixing %token styles): Check the output from bison.
2502 (Early token definitions): New.
2503
25042002-06-10 Akim Demaille <akim@epita.fr>
2505
2506 * src/symtab.c (symbol_user_token_number_set): Don't complain when
2507 assigning twice the same user number to a token, so that we can
2508 use it in...
2509 * src/lex.c (lex): here.
2510 Also use `symbol_class_set' instead of hand written code.
2511 * src/reader.c (parse_assoc_decl): Likewise.
2512
25132002-06-10 Akim Demaille <akim@epita.fr>
2514
2515 * src/symtab.c, src/symtab.c (symbol_class_set)
2516 (symbol_user_token_number_set): New.
2517 * src/reader.c (parse_token_decl): Use them.
2518 Use a switch instead of ifs.
2519 Use a single argument.
2520
25212002-06-10 Akim Demaille <akim@epita.fr>
2522
2523 Remove `%thong' support as it is undocumented, unused, duplicates
2524 `%token's job, and creates useless e-mail traffic with people who
2525 want to know what it is, why it is undocumented, unused, and
2526 duplicates `%token's job.
2527
2528 * src/reader.c (parse_thong_decl): Remove.
2529 * src/options.c (option_table): Remove "thong".
2530 * src/lex.h (tok_thong): Remove.
2531
25322002-06-10 Akim Demaille <akim@epita.fr>
2533
2534 * src/symtab.c, src/symtab.c (symbol_type_set)
2535 (symbol_precedence_set): New.
2536 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
2537 (value_components_used): Remove, unused.
2538
25392002-06-09 Akim Demaille <akim@epita.fr>
2540
2541 Move symbols handling code out of the reader.
2542
2543 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
2544 (axiom): Move to...
2545 * src/symtab.h, src/symtab.c: here.
2546
2547 * src/gram.c (start_symbol): Remove: use startsymbol->number.
2548 * src/reader.c (startval): Rename as...
2549 * src/symtab.h, src/symtab.c (startsymbol): this.
2550 * src/reader.c: Adjust.
2551
2552 * src/reader.c (symbol_check_defined, symbol_make_alias)
2553 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2554 (token_translations_init)
2555 Move to...
2556 * src/symtab.c: here.
2557 * src/reader.c (packsymbols): Move to...
2558 * src/symtab.h, src/symtab.c (symbols_pack): here.
2559 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
2560 argument.
2561
25622002-06-03 Akim Demaille <akim@epita.fr>
2563
2564 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
2565 then statements.
2566
25672002-06-03 Akim Demaille <akim@epita.fr>
2568
2569 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
2570 structs with non literals.
2571 * src/scan-skel.l: never-interactive.
2572 * src/conflicts.c (enum conflict_resolution_e): No trailing
2573 comma.
2574 * src/getargs.c (usage): Split long literal strings.
2575 Reported by Hans Aberg.
2576
25772002-05-28 Akim Demaille <akim@epita.fr>
2578
2579 * data/bison.c++: Use C++ ostreams.
2580 (cdebug_): New member.
2581
25822002-05-28 Akim Demaille <akim@epita.fr>
2583
2584 * src/output.c (output_skeleton): Be sure to allocate enough room
2585 for `/' _and_ for `\0' in full_skeleton.
2586
25872002-05-28 Akim Demaille <akim@epita.fr>
2588
2589 * data/bison.c++: Catch up with bison.simple:
2590 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2591 and Paul Eggert <eggert@twinsun.com>: `error' handing.
2592 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
2593 and popping traces.
2594
25952002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2596
2597 * src/output.c (output_skeleton): Put an explicit path in front of
2598 the skeleton file name, rather than relying on the -I directory,
2599 to partially alleviate effects of having a skeleton file lying around
2600 in the current directory.
2601
26022002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2603
2604 * src/conflicts.c (log_resolution): Correct typo:
2605 obstack_printf should be obstack_fgrow1.
2606
26072002-05-26 Akim Demaille <akim@epita.fr>
2608
2609 * src/state.h (state_t): `solved_conflicts' is a new member.
2610 * src/LR0.c (new_state): Set it to 0.
2611 * src/conflicts.h, src/conflicts.c (print_conflicts)
2612 (free_conflicts, solve_conflicts): Rename as...
2613 (conflicts_print, conflicts_free, conflicts_solve): these.
2614 Adjust callers.
2615 * src/conflicts.c (enum conflict_resolution_e)
2616 (solved_conflicts_obstack): New, used by...
2617 (log_resolution): this.
2618 Adjust to attach the conflict resolution to each state.
2619 Complete the description with the precedence/associativity
2620 information.
2621 (resolve_sr_conflict): Adjust.
2622 * src/print.c (print_state): Output its solved_conflicts.
2623 * tests/conflicts.at (Unresolved SR Conflicts)
2624 (Solved SR Conflicts): Exercise --report=all.
2625
26262002-05-26 Akim Demaille <akim@epita.fr>
2627
2628 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2629 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2630 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
2631 (token_number_t, item_number_as_token_number)
2632 (token_number_as_item_number, muscle_insert_token_number_table):
2633 Rename as...
2634 (symbol_number_t, item_number_as_symbol_number)
2635 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
2636 these, since it is more appropriate.
2637
26382002-05-26 Akim Demaille <akim@epita.fr>
2639
2640 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
2641 `Error:' lines.
2642 * data/bison.simple (yystos) [YYDEBUG]: New.
2643 (yyparse) [YYDEBUG]: Display the symbols which are popped during
2644 error recovery.
2645 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
2646
26472002-05-25 Akim Demaille <akim@epita.fr>
2648
2649 * doc/bison.texinfo (Debugging): Split into...
2650 (Tracing): this new section, its former contents, and...
2651 (Understanding): this new section.
2652 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
2653 by...
2654 (report_flag): this.
2655 Adjust all dependencies.
2656 (report_args, report_types, report_argmatch): New.
2657 (usage, getargs): Report/support -r, --report.
2658 * src/options.h
2659 (struct option_table_struct): Rename as..,
2660 (struct option_table_s): this.
2661 Rename the `set_flag' member to `flag' to match with getopt_long's
2662 struct.
2663 * src/options.c (option_table): Split verbose into an entry for
2664 %verbose, and another for --verbose.
2665 Support --report/-r, so remove -r from the obsolete --raw.
2666 * src/print.c: Attach full item sets and lookaheads reports to
2667 report_flag instead of trace_flag.
2668 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2669
26702002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2671 and Paul Eggert <eggert@twinsun.com>
2672
2673 * data/bison.simple (yyparse): Correct error handling to conform to
2674 POSIX and yacc. Specifically, after syntax error is discovered,
2675 do not reduce further before shifting the error token.
2676 Clean up the code a bit by removing the labels yyerrdefault,
2677 yyerrhandle, yyerrpop.
2678 * NEWS: Document the above.
2679
26802002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2681
2682 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
2683 type; it isn't always big enough, since it doesn't necessarily
2684 include non-terminals.
2685 (yytranslate): Expand definition of yy_token_number_type, so that
2686 the latter can be removed.
2687 (yy_token_number_type): Remove, only one use.
2688 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
2689 don't use TokenNumberType as element type.
2690
2691 * tests/regression.at: Modify expected output to agree with change
2692 to yyr1 and yytranslate.
2693
26942002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
2695
2696 * src/reader.c (parse_action): Use copy_character instead of
2697 obstack_1grow.
2698
26992002-05-13 Akim Demaille <akim@epita.fr>
2700
2701 * tests/regression.at (Token definitions): Prototype yylex and
2702 yyerror.
2703
27042002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2705
2706 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
2707 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
2708 32-bit arithmetic.
2709 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
2710
27112002-05-07 Akim Demaille <akim@epita.fr>
2712
2713 * tests/synclines.at: Be sure to prototype yylex and yyerror to
2714 avoid GCC warnings.
2715
27162002-05-07 Akim Demaille <akim@epita.fr>
2717
2718 Kill GCC warnings.
2719
2720 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
2721 over the RHS of each rule.
2722 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
2723 * src/state.h (state_t): Member `nitems' is unsigned short.
2724 * src/LR0.c (get_state): Adjust.
2725 * src/reader.c (packgram): Likewise.
2726 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
2727 `Type'.
2728 (muscle_insert_int_table): Remove, unused.
2729 (prepare_rules): Remove `max'.
2730
27312002-05-06 Akim Demaille <akim@epita.fr>
2732
2733 * src/closure.c (print_firsts): Display of the symbol tags.
2734 (bitmatrix_print): Move to...
2735 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
2736 here.
2737 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
2738
27392002-05-06 Akim Demaille <akim@epita.fr>
2740
2741 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
2742 hash_do_for_each.
2743
27442002-05-06 Akim Demaille <akim@epita.fr>
2745
2746 * src/LR0.c (new_state, get_state): Instead of using the global
2747 `kernel_size' and `kernel_base', have two new arguments:
2748 `core_size' and `core'.
2749 Adjust callers.
2750
27512002-05-06 Akim Demaille <akim@epita.fr>
2752
2753 * src/reader.c (packgram): No longer end `ritem' with a 0
2754 sentinel: it is not used.
2755
27562002-05-05 Akim Demaille <akim@epita.fr>
2757
2758 New experimental feature: display the lookaheads in the report and
2759 graph.
2760
2761 * src/print (print_core): When --trace-flag, display the rules
2762 lookaheads.
2763 * src/print_graph.c (print_core): Likewise.
2764 Swap the arguments.
2765 Adjust caller.
2766
27672002-05-05 Akim Demaille <akim@epita.fr>
2768
2769 * tests/torture.at (Many lookaheads): New test.
2770
27712002-05-05 Akim Demaille <akim@epita.fr>
2772
2773 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
2774 (GENERATE_MUSCLE_INSERT_TABLE): this.
2775 (output_int_table, output_unsigned_int_table, output_short_table)
2776 (output_token_number_table, output_item_number_table): Replace with...
2777 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
2778 (muscle_insert_short_table, muscle_insert_token_number_table)
2779 (muscle_insert_item_number_table): these.
2780 Adjust all callers.
2781 (prepare_tokens): Don't free `translations', since...
2782 * src/reader.h, src/reader.c (grammar_free): do it.
2783 Move to...
2784 * src/gram.h, src/gram.c (grammar_free): here.
2785 * data/bison.simple, data/bison.c++: b4_token_number_max is now
2786 b4_translate_max.
2787
27882002-05-05 Akim Demaille <akim@epita.fr>
2789
2790 * src/output.c (output_unsigned_int_table): New.
2791 (prepare_rules): `i' is unsigned.
2792 `prhs', `rline', `r2' are unsigned int.
2793 Rename muscle `rhs_number_max' as `rhs_max'.
2794 Output muscles `prhs_max', `rline_max', and `r2_max'.
2795 Free rline and r1.
2796 * data/bison.simple, data/bison.c++: Adjust to use these muscles
2797 to compute types instead of constant types.
2798 * tests/regression.at (Web2c Actions): Adjust.
2799
28002002-05-04 Akim Demaille <akim@epita.fr>
2801
2802 * src/symtab.h (SALIAS, SUNDEF): Rename as...
2803 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
2804 Adjust dependencies.
2805 * src/output.c (token_definitions_output): Be sure not to output a
2806 `#define 'a'' when fed with `%token 'a' "a"'.
2807 * tests/regression.at (Token definitions): New.
2808
28092002-05-03 Paul Eggert <eggert@twinsun.com>
2810
2811 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
2812 for K&R C.
2813
28142002-05-03 gettextize <bug-gnu-gettext@gnu.org>
2815
2816 * Makefile.am (SUBDIRS): Remove intl.
2817 (EXTRA_DIST): Add config/config.rpath.
2818
28192002-05-03 Akim Demaille <akim@epita.fr>
2820
2821 * data/bison.simple (m4_if): Don't output empty enums.
2822 And actually, output valid enum definitions :(.
2823
28242002-05-03 Akim Demaille <akim@epita.fr>
2825
2826 * configure.bat: Remove, completely obsolete.
2827 * Makefile.am (EXTRA_DIST): Adjust.
2828 Don't distribute config.rpath...
2829 * config/Makefile.am (EXTRA_DIST): Do it.
2830
28312002-05-03 Akim Demaille <akim@epita.fr>
2832
2833 * configure.in (GETTEXT_VERSION): New.
2834 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
2835
28362002-05-03 Akim Demaille <akim@epita.fr>
2837
2838 * data/bison.simple (b4_token_enum): New.
2839 (b4_token_defines): Use it to output tokens both as #define and
2840 enums.
2841 Suggested by Paul Eggert.
2842 * src/output.c (token_definitions_output): Don't output spurious
2843 white spaces.
2844
28452002-05-03 Akim Demaille <akim@epita.fr>
2846
2847 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2848
28492002-05-02 Robert Anisko <robert@lrde.epita.fr>
2850
2851 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
2852 Update the stack class, give a try to deque as the default container.
2853
28542002-05-02 Akim Demaille <akim@epita.fr>
2855
2856 * data/bison.simple (yyparse): Do not implement @$ = @1.
2857 (YYLLOC_DEFAULT): Adjust to do it.
2858 * doc/bison.texinfo (Location Default Action): Fix.
2859
28602002-05-02 Akim Demaille <akim@epita.fr>
2861
2862 * src/reader.c (parse_braces): Merge into...
2863 (parse_action): this.
2864
28652002-05-02 Akim Demaille <akim@epita.fr>
2866
2867 * configure.in (ALL_LINGUAS): Remove.
2868 * po/LINGUAS, hr.po: New.
2869
28702002-05-02 Akim Demaille <akim@epita.fr>
2871
2872 Remove the so called hairy (semantic) parsers.
2873
2874 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
2875 * src/gram.h, src/gram.c (semantic_parser): Remove.
2876 (rule_t): Remove the guard and guard_line members.
2877 * src/lex.h (token_t): remove tok_guard.
2878 * src/options.c (option_table): Remove %guard and %semantic_parser
2879 support.
2880 * src/output.c, src/output.h (guards_output): Remove.
2881 (prepare): Adjust.
2882 (token_definitions_output): Don't output the `T'
2883 tokens (???).
2884 (output_skeleton): Don't output the guards.
2885 * src/files.c, src/files.c (attrsfile): Remove.
2886 * src/reader.c (symbol_list): Remove the guard and guard_line
2887 members.
2888 Adjust dependencies.
2889 (parse_guard): Remove.
2890 * data/bison.hairy: Remove.
2891 * doc/bison.texinfo (Environment Variables): Remove occurrences of
2892 BISON_HAIRY.
2893
28942002-05-02 Akim Demaille <akim@epita.fr>
2895
2896 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
2897 (parse_guard): Rename the formal argument `stack_offset' as
2898 `rule_length', which is more readable.
2899 Adjust callers.
2900 (copy_at, copy_dollar): Instead of outputting the hard coded
2901 values of $$, $n and so forth, output invocation to b4_lhs_value,
2902 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
2903 Note: this patch partially drops `semantic-parser' support: it
2904 always does `rule_length - n', where semantic parsers ought to
2905 always use `-n'.
2906 * data/bison.simple, data/bison.c++ (b4_lhs_value)
2907 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
2908
29092002-05-02 Akim Demaille <akim@epita.fr>
2910
2911 * configure.in (AC_INIT): Bump to 1.49b.
2912 (AM_INIT_AUTOMAKE): Short invocation.
2913
29142002-05-02 Akim Demaille <akim@epita.fr>
2915
2916 Version 1.49a.
2917
29182002-05-01 Akim Demaille <akim@epita.fr>
2919
2920 * src/skeleton.h: Remove.
2921
29222002-05-01 Akim Demaille <akim@epita.fr>
2923
2924 * src/skeleton.h: Fix the #endif.
2925 Reported by Magnus Fromreide.
2926
29272002-04-26 Paul Eggert <eggert@twinsun.com>
2928
2929 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
2930 Define if we define YYSTYPE and YYLTYPE, respectively.
2931 (YYCOPY): Fix [] quoting problem in the non-GCC case.
2932
29332002-04-25 Robert Anisko <robert@lrde.epita.fr>
2934
2935 * src/scan-skel.l: Postprocess quadrigraphs.
2936
2937 * src/reader.c (copy_character): New function, used to output
2938 single characters while replacing `[' and `]' with quadrigraphs, to
2939 avoid troubles with M4 quotes.
2940 (copy_comment): Output characters with copy_character.
2941 (read_additionnal_code): Likewise.
2942 (copy_string2): Likewise.
2943 (copy_definition): Likewise.
2944
2945 * tests/calc.at: Exercise M4 quoting.
2946
29472002-04-25 Akim Demaille <akim@epita.fr>
2948
2949 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
2950 between `!' and the command.
2951 Reported by Paul Eggert.
2952
29532002-04-24 Robert Anisko <robert@lrde.epita.fr>
2954
2955 * tests/calc.at: Exercise prologue splitting.
2956
2957 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
2958 `b4_post_prologue' instead of `b4_prologue'.
2959
2960 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
2961 muscles.
2962 (output): Free pre_prologue_obstack and post_prologue_obstack.
2963 * src/files.h, src/files.c (attrs_obstack): Remove.
2964 (pre_prologue_obstack, post_prologue_obstack): New.
2965 * src/reader.c (copy_definition): Add a parameter to specify the
2966 obstack to fill, instead of using attrs_obstack unconditionally.
2967 (read_declarations): Pass pre_prologue_obstack to copy_definition if
2968 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
2969
29702002-04-23 Paul Eggert <eggert@twinsun.com>
2971
2972 * data/bison.simple: Remove unnecessary commentary and white
2973 space differences from 1_29-branch.
2974 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
2975
2976 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
2977 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
2978 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
2979 constructors or destructors.
2980
2981 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
2982
29832002-04-23 Akim Demaille <akim@epita.fr>
2984
2985 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
2986 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
2987 location with columns.
2988 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
2989 All reported by Paul Eggert.
2990
29912002-04-22 Akim Demaille <akim@epita.fr>
2992
2993 * src/reduce.c (dump_grammar): Move to...
2994 * src/gram.h, src/gram.c (grammar_dump): here.
2995 Be sure to separate long item numbers.
2996 Don't read the members of a rule's prec if its nil.
2997
29982002-04-22 Akim Demaille <akim@epita.fr>
2999
3000 * src/output.c (table_size, table_grow): New.
3001 (MAXTABLE): Remove, replace uses with table_size.
3002 (pack_vector): Instead of dying when the table is too big, grow it.
3003
30042002-04-22 Akim Demaille <akim@epita.fr>
3005
3006 * data/bison.simple (yyr1): Its type is that of a token number.
3007 * data/bison.c++ (r1_): Likewise.
3008 * tests/regression.at (Web2c Actions): Adjust.
3009
30102002-04-22 Akim Demaille <akim@epita.fr>
3011
3012 * src/reader.c (token_translations_init): 256 is now the default
3013 value for the error token, i.e., it will be assigned another
3014 number if the user assigned 256 to one of her tokens.
3015 (reader): Don't force 256 to error.
3016 * doc/bison.texinfo (Symbols): Adjust.
3017 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
3018 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
3019 etc. instead of 10, 20, 30 (which was used to `jump' over error
3020 (256) and undefined (2)).
3021
30222002-04-22 Akim Demaille <akim@epita.fr>
3023
3024 Propagate more token_number_t.
3025
3026 * src/gram.h (token_number_as_item_number)
3027 (item_number_as_token_number): New.
3028 * src/output.c (GENERATE_OUTPUT_TABLE): New.
3029 Use it to create output_item_number_table and
3030 output_token_number_table.
3031 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
3032 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
3033 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
3034 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
3035
30362002-04-22 Akim Demaille <akim@epita.fr>
3037
3038 * src/output.h, src/output.c (get_lines_number): Remove.
3039
30402002-04-19 Akim Demaille <akim@epita.fr>
3041
3042 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
3043 as Lex/Flex'.
3044 (Debugging): More details about enabling the debugging features.
3045 (Table of Symbols): Describe $$, $n, @$, and @n.
3046 Suggested by Tim Josling.
3047
30482002-04-19 Akim Demaille <akim@epita.fr>
3049
3050 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
3051
30522002-04-10 Akim Demaille <akim@epita.fr>
3053
3054 * src/system.h: Rely on HAVE_LIMITS_H.
3055 Suggested by Paul Eggert.
3056
30572002-04-09 Akim Demaille <akim@epita.fr>
3058
3059 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
3060 full stderr, and strip it according to the bison options, instead
3061 of composing the error message from different bits.
3062 This makes it easier to check for several error messages.
3063 Adjust all the invocations.
3064 Add an invocation exercising the error token.
3065 Add an invocation demonstrating a stupid error message.
3066 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
3067 Adjust the tests.
3068 Error message are for stderr, not stdout.
3069
30702002-04-09 Akim Demaille <akim@epita.fr>
3071
3072 * src/gram.h, src/gram.c (error_token_number): Remove, use
3073 errtoken->number.
3074 * src/reader.c (reader): Don't specify the user token number (2)
3075 for $undefined, as it uselessly prevents using it.
3076 * src/gram.h (token_number_t): Move to...
3077 * src/symtab.h: here.
3078 (state_t.number): Is a token_number_t.
3079 * src/print.c, src/reader.c: Use undeftoken->number instead of
3080 hard coded 2.
3081 (Even though this 2 is not the same as above: the number of the
3082 undeftoken remains being 2, it is its user token number which
3083 might not be 2).
3084 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
3085 `user_token_number_max'.
3086 Output `undef_token_number'.
3087 * data/bison.simple, data/bison.c++: Use them.
3088 Be sure to map invalid yylex return values to
3089 `undef_token_number'. This saves us from gratuitous SEGV.
3090
3091 * tests/conflicts.at (Solved SR Conflicts)
3092 (Unresolved SR Conflicts): Adjust.
3093 * tests/regression.at (Web2c Actions): Adjust.
3094
30952002-04-08 Akim Demaille <akim@epita.fr>
3096
3097 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
3098 Adding #line.
3099 Remove the duplicate `typedefs'.
3100 (RhsNumberType): Fix the declaration and various other typos.
3101 Use __ofile__.
3102 * data/bison.simple: Use __ofile__.
3103 * src/scan-skel.l: Handle __ofile__.
3104
31052002-04-08 Akim Demaille <akim@epita.fr>
3106
3107 * src/gram.h (item_number_t): New, the type of item numbers in
3108 RITEM. Note that it must be able to code symbol numbers as
3109 positive number, and the negation of rule numbers as negative
3110 numbers.
3111 Adjust all dependencies (pretty many).
3112 * src/reduce.c (rule): Remove this `short *' pointer: use
3113 item_number_t.
3114 * src/system.h (MINSHORT, MAXSHORT): Remove.
3115 Include `limits.h'.
3116 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
3117 (shortcpy): Remove.
3118 (MAXTABLE): Move to...
3119 * src/output.c (MAXTABLE): here.
3120 (prepare_rules): Use output_int_table to output rhs.
3121 * data/bison.simple, data/bison.c++: Adjust.
3122 * tests/torture.at (Big triangle): Move the limit from 254 to
3123 500.
3124 * tests/regression.at (Web2c Actions): Ajust.
3125
3126 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
3127 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
3128 passes, but produces negative #line number, once fixed, GCC is
3129 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
3130 C), it passes.
3131 * src/state.h (state_h): Code input lines on ints, not shorts.
3132
31332002-04-08 Akim Demaille <akim@epita.fr>
3134
3135 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
3136 and then the grammar.
3137
31382002-04-08 Akim Demaille <akim@epita.fr>
3139
3140 * src/system.h: No longer using strndup.
3141
31422002-04-07 Akim Demaille <akim@epita.fr>
3143
3144 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
3145 * src/output.c (output_table_data): Return the longest number.
3146 (prepare_tokens): Output `token_number_max').
3147 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
3148 New.
3149 Use them to define yy_token_number_type/TokenNumberType.
3150 Use this type for yytranslate.
3151 * tests/torture.at (Big triangle): Push the limit from 124 to
3152 253.
3153 * tests/regression.at (Web2c Actions): Adjust.
3154
31552002-04-07 Akim Demaille <akim@epita.fr>
3156
3157 * tests/torture.at (Big triangle): New.
3158 (GNU AWK Grammar, GNU Cim Grammar): Move to...
3159 * tests/existing.at: here.
3160
31612002-04-07 Akim Demaille <akim@epita.fr>
3162
3163 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
3164 nritems.
3165 Adjust dependencies.
3166
31672002-04-07 Akim Demaille <akim@epita.fr>
3168
3169 * src/reader.c: Normalize increments to prefix form.
3170
31712002-04-07 Akim Demaille <akim@epita.fr>
3172
3173 * src/reader.c, symtab.c: Remove debugging code.
3174
31752002-04-07 Akim Demaille <akim@epita.fr>
3176
3177 Rename all the `bucket's as `symbol_t'.
3178
3179 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
3180 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
3181 * src/symtab.c, src/symtab.h (bucket): Rename as...
3182 (symbol_t): this.
3183 (symbol_list_new, bucket_check_defined, bucket_make_alias)
3184 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
3185 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3186 (buckets_new, buckets_free, buckets_do): Rename as...
3187 (symbol_list_new, symbol_check_defined, symbol_make_alias)
3188 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
3189 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
3190 (symbols_new, symbols_free, symbols_do): these.
3191
31922002-04-07 Akim Demaille <akim@epita.fr>
3193
3194 Use lib/hash for the symbol table.
3195
3196 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
3197 EOF.
3198 * src/lex.c (lex): Set the `number' member of new terminals.
3199 * src/reader.c (bucket_check_defined, bucket_make_alias)
3200 (bucket_check_alias_consistence, bucket_translation): New.
3201 (reader, grammar_free, readgram, token_translations_init)
3202 (packsymbols): Adjust.
3203 (reader): Number the predefined tokens.
3204 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
3205 for predefined tokens.
3206 * src/symtab.h (bucket): Remove all the hash table related
3207 members.
3208 * src/symtab.c (symtab): Replace by...
3209 (bucket_table): this.
3210 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3211 (buckets_new, buckets_do): New.
3212
32132002-04-07 Akim Demaille <akim@epita.fr>
3214
3215 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
3216 (start_symbol, max_user_token_number, semantic_parser)
3217 (error_token_number): Initialize.
3218 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
3219 Initialize.
3220 (reader): Don't.
3221 (errtoken, eoftoken, undeftoken, axiom): Extern.
3222
32232002-04-07 Akim Demaille <akim@epita.fr>
3224
3225 * src/gram.h (rule_s): prec and precsym are now pointers
3226 to the bucket giving the priority/associativity.
3227 Member `associativity' removed: useless.
3228 * src/reduce.c, src/conflicts.c: Adjust.
3229
32302002-04-07 Akim Demaille <akim@epita.fr>
3231
3232 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
3233 Properly escape the symbols' TAG when outputting them.
3234
32352002-04-07 Akim Demaille <akim@epita.fr>
3236
3237 * src/lalr.h (LA): Is a bitsetv, not bitset*.
3238
32392002-04-07 Akim Demaille <akim@epita.fr>
3240
3241 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
3242 (LArule): this, which is an array to rule_t*.
3243 * src/print.c, src/conflicts.c: Adjust.
3244
32452002-04-07 Akim Demaille <akim@epita.fr>
3246
3247 * src/gram.h (rule_t): Rename `number' as `user_number'.
3248 `number' is a new member.
3249 Adjust dependencies.
3250 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
3251
32522002-04-07 Akim Demaille <akim@epita.fr>
3253
3254 As a result of the previous patch, it is no longer needed
3255 to reorder ritem itself.
3256
3257 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
3258
32592002-04-07 Akim Demaille <akim@epita.fr>
3260
3261 Be sure never to walk through RITEMS, but use only data related to
3262 the rules themselves. RITEMS should be banished.
3263
3264 * src/output.c (output_token_translations): Rename as...
3265 (prepare_tokens): this.
3266 In addition to `translate', prepare the muscles `tname' and
3267 `toknum', which were handled by...
3268 (output_rule_data): this.
3269 Remove, and move the remainder of its outputs into...
3270 (prepare_rules): this new routines, which also merges content from
3271 (output_gram): this.
3272 (prepare_rules): Be sure never to walk through RITEMS.
3273 (output_stos): Rename as...
3274 (prepare_stos): this.
3275 (output): Always invoke prepare_states, after all, just don't use it
3276 in the output if you don't need it.
3277
32782002-04-07 Akim Demaille <akim@epita.fr>
3279
3280 * src/LR0.c (new_state): Display `nstates' as the name of the
3281 newly created state.
3282 Adjust to initialize first_state and last_state if needed.
3283 Be sure to distinguish the initial from the final state.
3284 (new_states): Create the itemset of the initial state, and use
3285 new_state.
3286 * src/closure.c (closure): Now that the initial state has its
3287 items properly set, there is no need for a special case when
3288 creating `ruleset'.
3289
3290 As a result, now the rule 0, reducing to $axiom, is visible in the
3291 outputs. Adjust the test suite.
3292
3293 * tests/conflicts.at (Solved SR Conflicts)
3294 (Unresolved SR Conflicts): Adjust.
3295 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
3296 * tests/conflicts.at (S/R in initial): New.
3297
32982002-04-07 Akim Demaille <akim@epita.fr>
3299
3300 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
3301 the RHS of the rules.
3302 * src/output.c (output_gram): Likewise.
3303
33042002-04-07 Akim Demaille <akim@epita.fr>
3305
3306 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
3307 bucket.
3308 Adjust all dependencies.
3309 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
3310 `number' of the buckets too.
3311 * src/gram.h: Include `symtab.h'.
3312 (associativity): Move to...
3313 * src/symtab.h: here.
3314 No longer include `gram.h'.
3315
33162002-04-07 Akim Demaille <akim@epita.fr>
3317
3318 * src/gram.h, src/gram.c (rules_rhs_length): New.
3319 (ritem_longest_rhs): Use it.
3320 * src/gram.h (rule_t): `number' is a new member.
3321 * src/reader.c (packgram): Set it.
3322 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
3323 the end of `rules', and count them out of `nrules'.
3324 (reduce_output, dump_grammar): Adjust.
3325 * src/print.c (print_grammar): It is no longer needed to check for
3326 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
3327 * tests/reduce.at (Reduced Automaton): New test.
3328
33292002-04-07 Akim Demaille <akim@epita.fr>
3330
3331 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
3332 lacking `+ 1' to nrules, Bison reported as useless a token if it
3333 was used solely to set the precedence of the last rule...
3334
33352002-04-07 Akim Demaille <akim@epita.fr>
3336
3337 * data/bison.c++, data/bison.simple: Don't output the current file
3338 name in #line, to avoid useless diffs between two identical
3339 outputs under different names.
3340
33412002-04-07 Akim Demaille <akim@epita.fr>
3342
3343 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
3344 Normalize loops to using `< nrules + 1', not `<= nrules'.
3345
33462002-04-07 Akim Demaille <akim@epita.fr>
3347
3348 * TODO: Update.
3349
33502002-04-07 Akim Demaille <akim@epita.fr>
3351
3352 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
3353 bucket.value as bucket.number.
3354
33552002-04-07 Akim Demaille <akim@epita.fr>
3356
3357 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
3358 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
3359 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
3360 RHS, instead of being an index in RITEMS.
3361
33622002-04-04 Paul Eggert <eggert@twinsun.com>
3363
3364 * doc/bison.texinfo: Update copyright date.
3365 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
3366 (Symbols): Warn about running Bison in one character set,
3367 but compiling and/or running in an incompatible one.
3368 Warn about character code 256, too.
3369
33702002-04-03 Paul Eggert <eggert@twinsun.com>
3371
3372 * src/bison.data (YYSTACK_ALLOC): Depend on whether
3373 YYERROR_VERBOSE is nonzero, not whether it is defined.
3374
3375 Merge changes from bison-1_29-branch.
3376
33772002-03-20 Paul Eggert <eggert@twinsun.com>
3378
3379 Merge fixes from Debian bison_1.34-1.diff.
3380
3381 * configure.in (AC_PREREQ): 2.53.
3382
33832002-03-20 Akim Demaille <akim@epita.fr>
3384
3385 * src/conflicts.c (log_resolution): Argument `resolution' is const.
3386
33872002-03-19 Paul Eggert <eggert@twinsun.com>
3388
3389 * src/bison.simple (YYCOPY): New macro.
3390 (YYSTACK_RELOCATE): Use it.
3391 Remove Type arg; no longer needed. All callers changed.
3392 (yymemcpy): Remove; no longer needed.
3393
3394 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
3395 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3396
33972002-03-19 Akim Demaille <akim@epita.fr>
3398
3399 Test and fix the #line outputs.
3400
3401 * tests/atlocal.at (GCC): New.
3402 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
3403 (Prologue synch line, ,%union synch line, Postprologue synch line)
3404 (Action synch line, Epilogue synch line): New tests.
3405 * src/reader.c (parse_union_decl): Define the muscle stype_line.
3406 * data/bison.simple, data/bison.c++: Use it.
3407
34082002-03-19 Akim Demaille <akim@epita.fr>
3409
3410 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
3411 (Solved SR Conflicts, %expect not enough, %expect right)
3412 (%expect too much): Move to...
3413 * tests/conflicts.at: this new file.
3414
34152002-03-19 Akim Demaille <akim@epita.fr>
3416
3417 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
3418 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
3419 that we can move to enums for instance.
3420 * src/output.c (token_definitions_output): Output a list of
3421 `token-name, token-number' instead of the #define.
3422 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
3423
34242002-03-14 Akim Demaille <akim@epita.fr>
3425
3426 Use Gettext 0.11.1.
3427
34282002-03-09 Robert Anisko <robert@lrde.epita.fr>
3429
3430 * data/bison.c++: Make the user able to add members to the generated
3431 parser by subclassing.
3432
34332002-03-05 Robert Anisko <robert@lrde.epita.fr>
3434
3435 * src/reader.c (read_additionnal_code): `c' should be an integer, not
3436 a character.
3437 Reported by Nicolas Tisserand and Nicolas Burrus.
3438
34392002-03-04 Robert Anisko <robert@lrde.epita.fr>
3440
3441 * src/reader.c: Warn about lacking semi-colons, do not complain.
3442
34432002-03-04 Robert Anisko <robert@lrde.epita.fr>
3444
3445 * data/bison.c++: Remove a debug line.
3446
34472002-03-04 Robert Anisko <robert@lrde.epita.fr>
3448
3449 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
3450 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
3451 provide a default implementation.
3452
34532002-03-04 Akim Demaille <akim@epita.fr>
3454
3455 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
3456 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
3457 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
3458 * tests/semantic.at (Parsing Guards): Similarly.
3459 * src/reader.at (readgram): Complain if the last rule is not ended
3460 with a semi-colon.
3461
34622002-03-04 Akim Demaille <akim@epita.fr>
3463
3464 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
3465 * src/closure.c: here.
3466 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
3467 RTC.
3468 * src/warshall.h, src/warshall.c: Remove.
3469 * tests/sets.at (Broken Closure): Adjust.
3470
34712002-03-04 Akim Demaille <akim@epita.fr>
3472
3473 * src/output.c (output_skeleton): tempdir is const.
3474 bytes_read is unused.
3475
34762002-03-04 Akim Demaille <akim@epita.fr>
3477
3478 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
3479 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
3480 Update.
3481 From Michael Hayes.
3482
34832002-03-04 Akim Demaille <akim@epita.fr>
3484
3485 * src/closure.c (closure): `r' is unused.
3486
34872002-03-04 Akim Demaille <akim@epita.fr>
3488
3489 * tests/sets.at (Broken Closure): Add the ending `;'.
3490 * src/reader.at (readgram): Complain if a rule is not ended with a
3491 semi-colon.
3492
34932002-03-04 Akim Demaille <akim@epita.fr>
3494
3495 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
3496 (count_sr_conflicts): Use bitset_count.
3497 * src/reduce.c (inaccessable_symbols): Ditto.
3498 (bits_size): Remove.
3499 * src/warshall.h, src/warshall.c: Convert to bitsetv.
3500
35012002-03-04 Akim Demaille <akim@epita.fr>
3502
3503 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
3504 * src/reduce.c: Remove the `bitset_zero's following the
3505 `bitset_create's, as now it is performed by the latter.
3506
35072002-03-04 Akim Demaille <akim@epita.fr>
3508
3509 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
3510 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
3511 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
3512 latest sources from Michael.
3513
35142002-03-04 Akim Demaille <akim@epita.fr>
3515
3516 * src/output.c (output): Don't free the grammar.
3517 * src/reader.c (grammar_free): New.
3518 * src/main.c (main): Call it and don't free symtab here.
3519
35202002-03-04 Akim Demaille <akim@epita.fr>
3521
3522 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
3523 before returning.
3524 Reported by Benoit Perrot.
3525
35262002-03-04 Akim Demaille <akim@epita.fr>
3527
3528 Use bitset operations when possible, not loops over bits.
3529
3530 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
3531 bitset_or.
3532 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
3533 * src/reduce.c (useless_nonterminals): Formatting changes.
3534 * src/warshall.c (TC): Use bitset_or.
3535
35362002-03-04 Akim Demaille <akim@epita.fr>
3537
3538 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
3539 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
3540 Ditto.
3541
35422002-03-04 Akim Demaille <akim@epita.fr>
3543
3544 * src/lalr.c (F): Now a bitset*.
3545 Adjust all dependencies.
3546
35472002-03-04 Akim Demaille <akim@epita.fr>
3548
3549 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
3550 Adjust all dependencies.
3551
35522002-03-04 Akim Demaille <akim@epita.fr>
3553
3554 * src/L0.c, src/LR0.h (nstates): Be size_t.
3555 Adjust comparisons (signed vs unsigned).
3556 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
3557 bitset*.
3558 Adjust all dependencies.
3559
35602002-03-04 Akim Demaille <akim@epita.fr>
3561
3562 * src/closure.c (firsts): Now, also a bitset.
3563 Adjust all dependencies.
3564 (varsetsize): Remove, now unused.
3565 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
3566
35672002-03-04 Akim Demaille <akim@epita.fr>
3568
3569 * src/print.c: Convert to use bitset.h, not hand coded iterations
3570 over ints.
3571
35722002-03-04 Akim Demaille <akim@epita.fr>
3573
3574 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
3575
35762002-03-04 Akim Demaille <akim@epita.fr>
3577
3578 * src/closure.c (ruleset): Be a bitset.
3579 (rulesetsize): Remove.
3580
35812002-03-04 Akim Demaille <akim@epita.fr>
3582
3583 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
3584 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
3585 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
3586 * src/closure.c (fderives): Be an array of bitsets.
3587
35882002-02-28 Robert Anisko <robert@lrde.epita.fr>
3589
3590 * data/bison.c++: Merge the two generated headers. Insert a copyright
3591 notice in each output file.
3592
35932002-02-28 Akim Demaille <akim@epita.fr>
3594
3595 * data/bison.c++: Copy the prologue of bison.simple to fetch
3596 useful M4 definitions, such as b4_header_guard.
3597
35982002-02-25 Akim Demaille <akim@epita.fr>
3599
3600 * src/getargs.c (version): Give the name of the authors, and use a
3601 translator friendly scheme for the bgr
3602 copyright notice.
3603
36042002-02-25 Akim Demaille <akim@epita.fr>
3605
3606 * src/output.c (header_output): Remove, now handled completely via
3607 M4.
3608
36092002-02-25 Akim Demaille <akim@epita.fr>
3610
3611 * m4/m4.m4: New, from CVS Autoconf.
3612 * configure.in: Invoke it.
3613 * src/output.c (output_skeleton): Use its result instead of the
3614 hard coded name.
3615
36162002-02-25 Akim Demaille <akim@epita.fr>
3617
3618 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
3619 Fileutils 4.1.5.
3620 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
3621 * src/output.c (output_skeleton): Use mkstemp to create a real
3622 temporary file.
3623 Move the filling of `skeleton' and its muscle to...
3624 (prepare): here.
3625 (output): Move the definition of the prologue muscle to...
3626 (prepare): here.
3627 * src/system.h (DEFAULT_TMPDIR): New.
3628
36292002-02-14 Paul Eggert <eggert@twinsun.com>
3630
3631 Remove the support for C++ namespace cleanliness; it was
3632 causing more problems than it was curing, since it didn't work
3633 properly on some nonstandard C++ compilers. This can wait
3634 for a proper C++ parser.
3635
3636 * NEWS: Document this.
3637 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
3638 of C++, as it's treated like C now.
3639 * src/bison.simple (YYSTD): Remove.
3640 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
3641 Treat C++ just like Standard C instead of trying to support
3642 namespace cleanliness.
3643
36442002-02-14 Akim Demaille <akim@epita.fr>
3645
3646 * tests/regression.at (else): Adjust to Andreas' change.
3647
36482002-02-14 Akim Demaille <akim@epita.fr>
3649
3650 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
3651
36522002-02-13 Andreas Schwab <schwab@suse.de>
3653
3654 * src/output.c (output_rule_data): Don't output NULL, it might
3655 not be defined yet.
3656
36572002-02-11 Robert Anisko <robert@lrde.epita.fr>
3658
3659 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
3660 (Copyright notice): Update.
3661
36622002-02-11 Akim Demaille <akim@epita.fr>
3663
3664 * tests/regression.at (%nonassoc and eof): Don't include
3665 nonportable headers.
3666
36672002-02-08 Robert Anisko <robert@lrde.epita.fr>
3668
3669 * data/bison.c++: Correct error recovery. Make the user able to
3670 initialize the starting location.
3671
36722002-02-07 Akim Demaille <akim@epita.fr>
3673
3674 * tests/input.at: New.
3675
36762002-02-07 Robert Anisko <robert@lrde.epita.fr>
3677
3678 * data/bison.c++: Replace some direct m4 expansions by constants. Be
3679 more consistent when naming methods and variables. Put preprocessor
3680 directives around tables only needed for debugging.
3681
36822002-02-07 Robert Anisko <robert@lrde.epita.fr>
3683
3684 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
3685 C++ parsers.
3686 (yy::b4_name::parse): Use print_.
3687
36882002-02-07 Robert Anisko <robert@lrde.epita.fr>
3689
3690 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
3691
36922002-02-07 Robert Anisko <robert@lrde.epita.fr>
3693
3694 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
3695 C++ parsers.
3696 (yy::b4_name::parse): Build verbose error messages, and use error_.
3697
36982002-02-06 Robert Anisko <robert@lrde.epita.fr>
3699
3700 * data/bison.c++: Fix m4 quoting in comments.
3701
37022002-02-06 Robert Anisko <robert@lrde.epita.fr>
3703
3704 * data/bison.c++: Adjust the parser code. Fix some muscles that were
3705 not expanded by m4.
3706
37072002-02-05 Akim Demaille <akim@epita.fr>
3708
3709 * data/bison.c++: Adjust to the M4 back end.
3710 More is certainly needed.
3711
37122002-02-05 Akim Demaille <akim@epita.fr>
3713
3714 Give a try to M4 as a back end.
3715
3716 * lib/readpipe.c: New, from wdiff.
3717 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
3718 BISON_HAIRY.
3719 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
3720 specific values. Now it is m4 that performs the lookup.
3721 * src/parse-skel.y: Remove.
3722 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
3723 * src/output.c (actions_output, guards_output)
3724 (token_definitions_output): No longer keeps track of the output
3725 line number, hence remove the second argument.
3726 (guards_output): Check against the guard member of a rule, not the
3727 action member.
3728 Adjust callers.
3729 (output_skeleton): Don't look for the skeleton location, let m4 do
3730 that.
3731 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
3732 file will be used.
3733 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
3734 (prepare): Given that for the time being changesyntax is not
3735 usable in M4, rename the muscles using `-' to `_'.
3736 Define `defines_flag', `output_parser_name' and `output_header_name'.
3737 * src/output.h (actions_output, guards_output)
3738 (token_definitions_output): Adjust prototypes.
3739 * src/scan-skel.l: Instead of scanning the skeletons, it now
3740 processes the output of m4: `__oline__' and `#output'.
3741 * data/bison.simple: Adjust to be used by M4(sugar).
3742 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
3743 to date.
3744 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
3745 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
3746 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
3747 shamelessly stolen from CVS Autoconf.
3748
37492002-02-05 Akim Demaille <akim@epita.fr>
3750
3751 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
3752 * configure.in: Check for the declarations of free and malloc.
3753 * src/muscle_tab.c: Adjust.
3754
37552002-02-05 Akim Demaille <akim@epita.fr>
3756
3757 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
3758 which have no values.
3759
37602002-02-05 Akim Demaille <akim@epita.fr>
3761
3762 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
3763 * data/: here.
3764
37652002-01-29 Paul Eggert <eggert@twinsun.com>
3766
3767 * src/bison.simple (YYSIZE_T): Do not define merely because
3768 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
3769 On some platforms, <alloca.h> does not declare YYSTD (size_t).
3770
37712002-01-27 Akim Demaille <akim@epita.fr>
3772
3773 Fix `%nonassoc and eof'.
3774
3775 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
3776 which were not properly copied! Replace
3777 memcpy (res->errs, src->errs, src->nerrs);
3778 with
3779 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
3780 !!!
3781 * tests/regression.at (%nonassoc and eof): Adjust to newest
3782 Autotest: `.' is not in the PATH.
3783
37842002-01-27 Akim Demaille <akim@epita.fr>
3785
3786 * tests/sets.at (AT_EXTRACT_SETS): New.
3787 (Nullable): Use it.
3788 (Firsts): New.
3789
37902002-01-26 Akim Demaille <akim@epita.fr>
3791
3792 * tests/actions.at, tests/calc.at, tests/headers.at,
3793 * tests/torture.at: Adjust to the newest Autotest which no longer
3794 forces `.' in the PATH.
3795
37962002-01-25 Akim Demaille <akim@epita.fr>
3797
3798 * tests/regression.at (%nonassoc and eof): New.
3799 Suggested by Robert Anisko.
3800
38012002-01-24 Akim Demaille <akim@epita.fr>
3802
3803 Bison dumps core when trying to complain about broken input files.
3804 Reported by Cris van Pelt.
3805
3806 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
3807 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
3808 into...
3809 (Invalid inputs): Strengthen: exercise parse_percent_token.
3810
38112002-01-24 Robert Anisko <robert.anisko@epita.fr>
3812
3813 * src/Makefile.am: Add bison.c++.
3814 * src/bison.c++: New skeleton.
3815
38162002-01-21 Paolo Bonzini <bonzini@gnu.org>
3817
3818 * po/it.po: New.
3819
38202002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
3821
3822 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
3823
38242002-01-20 Marc Autret <marc@gnu.org>
3825
3826 * src/files.c (compute_output_file_names): Fix
3827
38282002-01-20 Marc Autret <marc@gnu.org>
3829
3830 * tests/output.at: New test.
3831 * src/files.c (compute_base_names): Don't map extensions when
3832 the YACC flag is set, use defaults.
3833 Reported by Evgeny Stambulchik.
3834
38352002-01-20 Marc Autret <marc@gnu.org>
3836
3837 * src/system.h: Need to define __attribute__ away for non-GCC
3838 compilers as well (i.e. the vendor C compiler).
3839 Suggested by Albert Chin-A-Young.
3840
38412002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
3842
3843 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
3844 canonical definition.
3845 * src/system.h: Use the canonical definition for PARAMS (avoids
3846 a conflict with the macro from lib/hash.h).
3847
38482002-01-11 Akim Demaille <akim@epita.fr>
3849
3850 * configure.in: Use AC_FUNC_STRNLEN.
3851 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
3852
38532002-01-09 Akim Demaille <akim@epita.fr>
3854
3855 * src/files.c, src/files.h (output_infix): New.
3856 (tab_extension): Remove.
3857 (compute_base_names): Compute the former, drop the latter.
3858 * src/output.c (prepare): Insert the muscles `output-infix', and
3859 `output-suffix'.
3860 * src/parse-skel.y (string, string.1): New.
3861 (section.header): Use it.
3862 (section.yacc): Remove.
3863 (prefix): Remove too.
3864 * src/scan-skel.l: Adjust.
3865 * src/bison.simple, src/bison.hairy: Adjust.
3866
38672002-01-09 Akim Demaille <akim@epita.fr>
3868
3869 * configure.in (WERROR_CFLAGS): Compute it.
3870 * src/Makefile.am (CFLAGS): Pass it.
3871 * tests/atlocal.in (CFLAGS): Idem.
3872 * src/files.c: Fix a few warnings.
3873 (get_extension_index): Remove, unused.
3874
38752002-01-08 Akim Demaille <akim@epita.fr>
3876
3877 * src/getargs.c (AS_FILE_NAME): New.
3878 (getargs): Use it to convert DOSish file names.
3879 * src/files.c (base_name): Rename as full_base_name to avoid
3880 clashes with `base_name ()'.
3881 (filename_split): New.
3882 (compute_base_names): N-th rewrite, using filename_split.
3883
38842002-01-08 Akim Demaille <akim@epita.fr>
3885
3886 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
3887 New, stolen from the Fileutils 4.1.
3888 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
3889 * configure.in: Check for the presence of memrchr, and of its
3890 prototype.
3891
38922002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
3893
3894 * lib/hash.h (__P): Added definition for this macro.
3895 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
3896 BUILT_SOURCES, to ensure they are generated first.
3897 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
3898 %error-verbose to allow bootstrapping with bison 1.30x.
3899
39002002-01-06 Akim Demaille <akim@epita.fr>
3901
3902 * src/reader.c (parse_braces): Don't fetch the next char, the
3903 convention is to fetch on entry.
3904 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
3905 'switch' without a following semicolon.
3906 * tests/regression.at (braces parsing): New.
3907
39082002-01-06 Akim Demaille <akim@epita.fr>
3909
3910 Bison is dead wrong in its RR conflict reports.
3911
3912 * tests/torture.at (GNU Cim Grammar): New.
3913 * src/conflicts.c (count_rr_conflicts): Fix.
3914
39152002-01-06 Akim Demaille <akim@epita.fr>
3916
3917 Creating package.m4 from configure.ac causes too many problems.
3918
3919 * tests/Makefile.am (package.m4): Create it by hand,
3920 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
3921
39222002-01-06 Akim Demaille <akim@epita.fr>
3923
3924 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
3925 skeleton.h.
3926
39272002-01-04 Paul Eggert <eggert@twinsun.com>
3928
3929 * doc/bison.texinfo (Debugging):
3930 Remove YYSTDERR; it's no longer defined or used.
3931 Also, s/cstdio.h/cstdio/.
3932
39332002-01-03 Akim Demaille <akim@epita.fr>
3934
3935 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
3936
39372002-01-03 Akim Demaille <akim@epita.fr>
3938
3939 * src/parse-skel.y (process_skeleton): Don't bind the parser's
3940 tracing code to --trace, wait for a better --trace option, with
3941 args.
3942
39432002-01-03 Akim Demaille <akim@epita.fr>
3944
3945 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
3946 The ISO C++ standard is extremely clear about it: stderr is
3947 considered a macro, not a regular symbol (see table 94 `Header
3948 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
3949 Therefore std:: does not apply to it. It still does with fprintf.
3950 Also, s/cstdio.h/cstdio/.
3951
39522002-01-03 Akim Demaille <akim@epita.fr>
3953
3954 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
3955 for non system headers.
3956
39572002-01-02 Akim Demaille <akim@epita.fr>
3958
3959 Equip the skeleton chain with location tracking, runtime trace,
3960 pure parser and scanner.
3961
3962 * src/parse-skel.y: Request a pure parser, locations, and prefix
3963 renaming.
3964 (%union): Having several members with the same type does not help
3965 type mismatches, simplify.
3966 (YYPRINT, yyprint): New.
3967 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
3968 (skel_error): this.
3969 Handle locations.
3970 * src/scan-skel.l: Adjust to these changes.
3971 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
3972 (LOCATION_PRINT, skel_control_t): New.
3973
39742001-12-30 Akim Demaille <akim@epita.fr>
3975
3976 * src/parse-skel.y: Get rid of the shift/reduce conflict:
3977 replace `gb' with BLANKS.
3978 * src/scan-skel.l: Adjust.
3979
39802001-12-30 Akim Demaille <akim@epita.fr>
3981
3982 * src/system.h: We don't need nor want bcopy.
3983 Throw away MS-DOS crap: we don't need getpid.
3984 * configure.in: We don't need strndup. It was even causing
3985 problems: because Flex includes the headers *before* us,
3986 _GNU_SOURCE is not defined by config.h, and therefore strndup was
3987 not visible.
3988 * lib/xstrndup.c: New.
3989 * src/scan-skel.l: Use it.
3990 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
3991 * src/parse-skel.y: Use %directives instead of #defines.
3992
39932001-12-30 Akim Demaille <akim@epita.fr>
3994
3995 * src/skeleton.h: New.
3996 * src/output.c (output_parser, output_master_parser): Remove, dead
3997 code.
3998 * src/output.h (get_lines_number, actions_output, guards_output)
3999 (token_definitions_output): Prototype them.
4000 * src/parse-skel.y: Add the license notice.
4001 Include output.h and skeleton.h.
4002 (process_skeleton): Returns void, and takes a single parameter.
4003 * src/scan-skel.l: Add the license notice.
4004 Include skeleton.h.
4005 Don't use %option yylineno: it seems that then Flex imagines
4006 REJECT has been used, and therefore it won't reallocate its
4007 buffers (which makes no other sense to me than a bug). It results
4008 in warnings for `unused: yy_flex_realloc'.
4009
40102001-12-30 Robert Anisko <robert.anisko@epita.fr>
4011
4012 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
4013 (MUSCLE_INSERT_PREFIX): ...to there.
4014 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
4015 (MUSCLE_INSERT_PREFIX): Move from here...
4016
4017 * src/bison.hairy: Add a section directive. Put braces around muscle
4018 names. This parser skeleton is still broken, but Bison should not
4019 choke on a bad muscle 'syntax'.
4020 * src/bison.simple: Add a section directive. Put braces around muscle
4021 names.
4022
4023 * src/files.h (strsuffix, stringappend): Add declarations.
4024 (tab_extension): Add declaration.
4025 (short_base_name): Add declaration.
4026
4027 * src/files.c (strsuffix, stringappend): No longer static. These
4028 functions are used in the skeleton parser.
4029 (tab_extension): New.
4030 (compute_base_names): Use the computations done in this function
4031 to guess if the generated parsers should have '.tab' in their
4032 names.
4033 (short_base_name): No longer static.
4034
4035 * src/output.c (output_skeleton): New.
4036 (output): Disable call to output_master_parser, and give a try to
4037 a new skeleton handling system.
4038 (guards_output, actions_output): No longer static.
4039 (token_definitions_output, get_lines_number): No longer static.
4040
4041 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
4042
4043 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
4044 parse-skel.y.
4045
4046 * src/parse-skel.y: New file.
4047 * src/scan-skel.l: New file.
4048
40492001-12-29 Akim Demaille <akim@epita.fr>
4050
4051 %name-prefix is broken.
4052
4053 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
4054 Adjust all dependencies.
4055 * tests/headers.at (export YYLTYPE): Strengthen this test: use
4056 %name-prefix.
4057
4058 Renaming yylval but not yylloc is not consistent. Now we do.
4059
4060 * src/bison.simple: Prefix yylloc if used.
4061 * doc/bison.texinfo (Decl Summary): Document that.
4062
40632001-12-29 Akim Demaille <akim@epita.fr>
4064
4065 * doc/bison.texinfo: Promote `%long-directive' over
4066 `%long_directive'.
4067 Remove all references to fixed-output-files, yacc is enough.
4068
40692001-12-29 Akim Demaille <akim@epita.fr>
4070
4071 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
4072 user prologue. These are defaults.
4073 * tests/actions.at (Mid-rule actions): Make sure the user can
4074 define YYDEBUG and YYERROR_VERBOSE.
4075
40762001-12-29 Akim Demaille <akim@epita.fr>
4077
4078 * src/output.c (header_output): Don't forget to export YYLTYPE and
4079 yylloc.
4080 * tests/headers.at (export YYLTYPE): New, make sure it does.
4081 * tests/regression.at (%union and --defines, Invalid CPP headers):
4082 Move to...
4083 * tests/headers.at: here.
4084
40852001-12-29 Akim Demaille <akim@epita.fr>
4086
4087 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
4088
40892001-12-29 Akim Demaille <akim@epita.fr>
4090
4091 * tests/actions.at (Mid-rule actions): Output on a single line
4092 instead of several.
4093
40942001-12-29 Akim Demaille <akim@epita.fr>
4095
4096 * doc/bison.texinfo: Formatting changes.
4097
40982001-12-29 Akim Demaille <akim@epita.fr>
4099
4100 Don't store the token defs in a muscle, just be ready to output it
4101 on command. Now possible via `symbols'. Fixes a memory leak.
4102
4103 * src/output.c (token_definitions_output): New.
4104 (output_parser, header_output): Use it.
4105 * src/reader.c (symbols_save): Remove.
4106
41072001-12-29 Akim Demaille <akim@epita.fr>
4108
4109 * src/bison.simple: Do not provide a default for YYSTYPE and
4110 YYLTYPE before the user's prologue. Otherwise it's hardly... a
4111 default.
4112
41132001-12-29 Akim Demaille <akim@epita.fr>
4114
4115 Mid-rule actions are simply... ignored!
4116
4117 * src/reader.c (readgram): Be sure to attach mid-rule actions to
4118 the empty-rule associated to the dummy symbol, not to the host
4119 rule.
4120 * tests/actions.at (Mid-rule actions): New.
4121
41222001-12-29 Akim Demaille <akim@epita.fr>
4123
4124 Memory leak.
4125
4126 * src/reader.c (reader): Free grammar.
4127
41282001-12-29 Akim Demaille <akim@epita.fr>
4129
4130 Memory leak.
4131
4132 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
4133 since it allocates it for each state, although only one is needed.
4134 (allocate_storage): Do it here.
4135
41362001-12-29 Akim Demaille <akim@epita.fr>
4137
4138 * src/options.h, src/options.c (create_long_option_table): Rename
4139 as...
4140 (long_option_table_new): this, with a clearer prototype.
4141 (percent_table): Remove, unused,
4142 * src/getargs.c (getargs): Adjust.
4143
41442001-12-29 Akim Demaille <akim@epita.fr>
4145
4146 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
4147 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
4148 as states.
4149
41502001-12-29 Akim Demaille <akim@epita.fr>
4151
4152 * src/lalr.c (build_relations): Rename `states' as `states1'.
4153 Sorry, I don't understand exactly what it is, no better name...
4154
41552001-12-29 Akim Demaille <akim@epita.fr>
4156
4157 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
4158 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
4159 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
4160 as rules.
4161
41622001-12-29 Akim Demaille <akim@epita.fr>
4163
4164 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
4165 ago.
4166
41672001-12-29 Akim Demaille <akim@epita.fr>
4168
4169 * src/reader.c, src/reader.h (user_toknums): Remove.
4170 Adjust all users to use symbols[i]->user_token_number.
4171
41722001-12-29 Akim Demaille <akim@epita.fr>
4173
4174 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
4175 Adjust all users to use symbols[i]->prec or ->assoc.
4176
41772001-12-29 Akim Demaille <akim@epita.fr>
4178
4179 * src/reader.c, src/reader.h (tags): Remove.
4180 Adjust all users to use symbols[i]->tag.
4181
41822001-12-29 Akim Demaille <akim@epita.fr>
4183
4184 * src/gram.h, src/gram.c (symbols): New, similar to state_table
4185 and rule_table.
4186 * src/reader.c (packsymbols): Fill this table.
4187 Drop sprec.
4188 * src/conflicts.c (resolve_sr_conflict): Adjust.
4189 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
4190 single table.
4191 Use symbols[i]->tag instead of tags[i].
4192
41932001-12-29 Akim Demaille <akim@epita.fr>
4194
4195 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
4196 In addition, put a comment in there, to replace...
4197 * tests/regression.at (%union and C comments): Remove.
4198
41992001-12-29 Akim Demaille <akim@epita.fr>
4200
4201 * tests/regression.at (Web2c Actions): Blindly move the actual
4202 output as expected output. The contents *seem* right to me, but I
4203 can't pretend reading perfectly parser tables... Nonetheless, all
4204 the other tests pass correctly, the table look OK, even though the
4205 presence of `$axiom' is to be noted: AFAICS it is useless (but
4206 harmless).
4207
42082001-12-29 Akim Demaille <akim@epita.fr>
4209
4210 * src/reader.c (readgram): Don't add the rule 0 if there were no
4211 rules read. In other words, add it _after_ having performed
4212 grammar sanity checks.
4213 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
4214
42152001-12-29 Akim Demaille <akim@epita.fr>
4216
4217 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
4218 visible, and some states have now a different number.
4219
42202001-12-29 Akim Demaille <akim@epita.fr>
4221
4222 * src/reader.c (readgram): Bind the initial rule's lineno to that
4223 of the first rule.
4224 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
4225 (Solved SR Conflicts): Adjust rule 0's line number.
4226
42272001-12-29 Akim Demaille <akim@epita.fr>
4228
4229 Fix the `GAWK Grammar' failure.
4230
4231 * src/LR0.c (final_state): Initialize to -1 so that we do compute
4232 the reductions of the first state which was mistakenly confused
4233 with the final state because precisely final_state was initialized
4234 to 0.
4235 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
4236 now noticed by Bison.
4237 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
4238 have a reduction on $default.
4239
42402001-12-29 Akim Demaille <akim@epita.fr>
4241
4242 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
4243 rule line numbers.
4244 * src/closure.c (print_closure): Likewise.
4245 * src/derives.c (print_derives): Likewise.
4246 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
4247 now.
4248
42492001-12-29 Akim Demaille <akim@epita.fr>
4250
4251 * src/lalr.c (lookaheads_print): New.
4252 (lalr): Call it when --trace-flag.
4253 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
4254 are dumped.
4255
42562001-12-29 Akim Demaille <akim@epita.fr>
4257
4258 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
4259 when walking through ritem, even via rule->rhs.
4260 * src/reduce.c (dump_grammar, useful_production, reduce_output)
4261 (useful_production, useless_nonterminals): Likewise.
4262 (reduce_grammar_tables): Likewise, plus update nritems.
4263 * src/nullable.c (set_nullable): Likewise.
4264 * src/lalr.c (build_relations): Likewise.
4265 * tests/sets.at (Nullable): Adjust.
4266 Fortunately, now, the $axiom is no longer nullable.
4267
42682001-12-29 Akim Demaille <akim@epita.fr>
4269
4270 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
4271 the 0-sentinel.
4272 * src/gram.c (ritem_longest_rhs): Likewise.
4273 * src/reduce.c (nonterminals_reduce): Likewise.
4274 * src/print_graph.c (print_graph): Likewise.
4275 * src/output.c (output_rule_data): Likewise.
4276 * src/nullable.c (set_nullable): Likewise.
4277
42782001-12-29 Akim Demaille <akim@epita.fr>
4279
4280 * src/output.c: Comment changes.
4281
42822001-12-27 Paul Eggert <eggert@twinsun.com>
4283
4284 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
4285 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
4286 Sparc, as they were causing more porting problems than the
4287 (minor) performance improvement was worth.
4288
4289 Also, catch up with 1.31's YYSTD.
4290
42912001-12-27 Akim Demaille <akim@epita.fr>
4292
4293 * src/output.c (output_gram): Rely on nritems, not the
4294 0-sentinel. See below.
4295 Use -1 as separator, not 0.
4296 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
4297 Rely on -1 as separator in yyrhs, instead of 0.
4298 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
4299 twice `Now at end of input', therefore there are two lines less to
4300 expect.
4301
43022001-12-27 Akim Demaille <akim@epita.fr>
4303
4304 * tests/regression.at (Unresolved SR Conflicts):
4305 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
4306 below.
4307
43082001-12-27 Akim Demaille <akim@epita.fr>
4309
4310 * src/LR0.c (new_state): Recognize the final state by the fact it
4311 is reached by eoftoken.
4312 (insert_start_shifting_state, insert_eof_shifting_state)
4313 (insert_accepting_state, augment_automaton): Remove, since now
4314 these states are automatically computed from the initial state.
4315 (generate_states): Adjust.
4316 * src/print.c: When reporting a rule number to the user, substract
4317 1, so that the axiom rule is rule 0, and the first user rule is 1.
4318 * src/reduce.c: Likewise.
4319 * src/print_graph.c (print_core): For the time being, just as for
4320 the report, depend upon --trace-flags to dump the full set of
4321 items.
4322 * src/reader.c (readgram): Once the grammar read, insert the rule
4323 0: `$axiom: START-SYMBOL $'.
4324 * tests/set.at: Adjust: rule 0 is now displayed, and since the
4325 number of the states has changed (the final state is no longer
4326 necessarily the last), catch up.
4327
43282001-12-27 Akim Demaille <akim@epita.fr>
4329
4330 Try to make the use of the eoftoken valid. Given that its value
4331 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
4332 is used instead of > 0 where appropriate, (ii), depend upon nritems
4333 instead of the 0-sentinel.
4334
4335 * src/gram.h, src/gram.c (nritems): New.
4336 Expected to be duplication of nitems, but for the time being...
4337 * src/reader.c (packgram): Assert nritems and nitems are equal.
4338 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
4339 * src/closure.c (print_closure, print_fderives): Likewise.
4340 * src/gram.c (ritem_print): Likewise.
4341 * src/print.c (print_core, print_grammar): Likewise.
4342 * src/print_graph.c: Likewise.
4343
43442001-12-27 Akim Demaille <akim@epita.fr>
4345
4346 * src/main.c (main): If there are complains after grammar
4347 reductions, then output the report anyway if requested, then die.
4348 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
4349 * src/reader.c (eoftoken): New.
4350 (parse_token_decl): If the token being defined has value `0', it
4351 is the eoftoken.
4352 (packsymbols): No longer hack `tags' to insert `$' by hand.
4353 Be sure to preserve the value of the eoftoken.
4354 (reader): Make sure eoftoken is defined.
4355 Initialize nsyms to 0: now eoftoken is created just like the others.
4356 * src/print.c (print_grammar): Don't special case the eof token.
4357 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
4358 lie anyway, albeit pleasant.
4359 * tests/calc.at: Exercise error messages with eoftoken.
4360 Change the grammar so that empty input is invalid.
4361 Adjust expectations.
4362 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
4363
43642001-12-27 Akim Demaille <akim@epita.fr>
4365
4366 * configure.in: Check the protos of strchr ans strspn.
4367 Replace strchr if needed.
4368 * src/system.h: Provide the protos of strchr, strspn and memchr if
4369 missing.
4370 * lib/strchr.c: New.
4371 * src/reader.c (symbols_save): Use strchr.
4372
43732001-12-27 Akim Demaille <akim@epita.fr>
4374
4375 * src/print.c, src/print_graph.c (escape): New.
4376 Use it to quote the TAGS outputs.
4377 * src/print_graph.c (print_state): Now errors are in red, and
4378 reductions in green.
4379 Prefer high to wide: output the state number on a line of its own.
4380
43812001-12-27 Akim Demaille <akim@epita.fr>
4382
4383 * src/state.h, src/state.c (reductions_new): New.
4384 * src/LR0.c (set_state_table): Let all the states have a
4385 `reductions', even if reduced to 0.
4386 (save_reductions): Adjust.
4387 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
4388 * src/print.c (print_reductions, print_actions): Adjust.
4389 * src/output.c (action_row): Adjust.
4390
43912001-12-27 Akim Demaille <akim@epita.fr>
4392
4393 * src/state.h, src/state.c (errs_new, errs_dup): New.
4394 * src/LR0.c (set_state_table): Let all the states have an errs,
4395 even if reduced to 0.
4396 * src/print.c (print_errs, print_reductions): Adjust.
4397 * src/output.c (output_actions, action_row): Adjust.
4398 * src/conflicts.c (resolve_sr_conflict): Adjust.
4399
44002001-12-27 Akim Demaille <akim@epita.fr>
4401
4402 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
4403
44042001-12-27 Akim Demaille <akim@epita.fr>
4405
4406 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
4407 * src/print.c: here.
4408 (lookaheadset, shiftset): New, used as additional storage by
4409 print_reductions.
4410 (print_results): Adjust.
4411 (print_shifts, print_gotos, print_errs): New, extracted from...
4412 (print_actions): here.
4413 * src/print_graph.c (print_actions): Remove dead code.
4414
44152001-12-27 Akim Demaille <akim@epita.fr>
4416
4417 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
4418 `$n' and `@n'.
4419
44202001-12-27 Akim Demaille <akim@epita.fr>
4421
4422 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
4423 (build_relations): Adjust.
4424
44252001-12-27 Akim Demaille <akim@epita.fr>
4426
4427 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
4428 duplication.
4429
44302001-12-27 Akim Demaille <akim@epita.fr>
4431
4432 * src/reader.c (packgram): Catch nitems overflows.
4433
44342001-12-27 Akim Demaille <akim@epita.fr>
4435
4436 * src/files.c, src/files.h (guard_obstack): Remove.
4437 * src/output.c (output): Adjust.
4438 * src/reader.c (parse_braces): New, factoring...
4439 (copy_action, copy_guard): these two which are renamed as...
4440 (parse_action, parse_guard): these.
4441 As a voluntary consequence, using braces around guards is now
4442 mandatory.
4443
44442001-12-27 Akim Demaille <akim@epita.fr>
4445
4446 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
4447 * src/reader.c (symbol_list): `guard' and `guard_line' are new
4448 members.
4449 (symbol_list_new): Adjust.
4450 (copy_action): action_line is the first line, not the last.
4451 (copy_guard): Just as for actions, store the `action' only, not
4452 the switch/case/break flesh.
4453 Don't parse the user action that might follow the guard, let...
4454 (readgram): do it, i.e., now, there can be an action after a
4455 guard.
4456 In other words the guard is just explicitly optional.
4457 (packgram): Adjust.
4458 * src/output.c (guards_output): New.
4459 (output_parser): Call it when needed.
4460 (output): Also free the guard and attrs obstacks.
4461 * src/files.c, src/files.h (obstack_save): Remove.
4462 (output_files): Remove.
4463 As a result, if one needs the former `.act' file, using an
4464 appropriate skeleton which requires actions and guards is now
4465 required.
4466 * src/main.c (main): Adjust.
4467 * tests/semantic.at: New.
4468 * tests/regression.at: Use `input.y' as input file name.
4469 Avoid 8+3 problems by requiring input.c when the test needs the
4470 parser.
4471
44722001-12-27 Akim Demaille <akim@epita.fr>
4473
4474 * src/reader.c (symbol_list_new): Be sure to initialize all the
4475 fields.
4476
44772001-12-27 Akim Demaille <akim@epita.fr>
4478
4479 All the hacks using a final pseudo state are now useless.
4480
4481 * src/LR0.c (set_state_table): state_table holds exactly nstates.
4482 * src/lalr.c (nLA): New.
4483 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
4484 instead of lookaheadsp from the pseudo state (nstate + 1).
4485
44862001-12-27 Akim Demaille <akim@epita.fr>
4487
4488 * src/output.c (action_row, token_actions): Use a state_t instead
4489 of a integer, and nlookaheads instead of the following state's
4490 lookaheadsp.
4491
44922001-12-27 Akim Demaille <akim@epita.fr>
4493
4494 * src/conflicts.c (log_resolution, flush_shift)
4495 (resolve_sr_conflict, set_conflicts, solve_conflicts)
4496 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
4497 (conflicts_print, print_reductions): Use a state_t instead of an
4498 integer when referring to a state.
4499 As much as possible, depend upon nlookaheads, instead of the
4500 `lookaheadsp' member of the following state (since lookaheads of
4501 successive states are successive, the difference between state n + 1
4502 and n served as the number of lookaheads for state n).
4503 * src/lalr.c (add_lookback_edge): Likewise.
4504 * src/print.c (print_core, print_actions, print_state)
4505 (print_results): Likewise.
4506 * src/print_graph.c (print_core, print_actions, print_state)
4507 (print_graph): Likewise.
4508 * src/conflicts.h: Adjust.
4509
45102001-12-27 Akim Demaille <akim@epita.fr>
4511
4512 * src/bison.hairy: Formatting/comment changes.
4513 ANSIfy.
4514 Remove `register' indications.
4515 Add plenty of `static'.
4516
45172001-12-27 Akim Demaille <akim@epita.fr>
4518
4519 * src/output.c (prepare): Drop the muscle `ntbase' which
4520 duplicates ntokens.
4521 * src/bison.simple: Formatting/comment changes.
4522 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
4523 is an undocumented synonym.
4524
45252001-12-22 Akim Demaille <akim@epita.fr>
4526
4527 * src/output.c (output_table_data): Change the prototype to use
4528 `int' for array ranges: some invocations do pass an int, not a
4529 short.
4530 Reported by Wayne Green.
4531
45322001-12-22 Akim Demaille <akim@epita.fr>
4533
4534 Some actions of web2c.y are improperly triggered.
4535 Reported by Mike Castle.
4536
4537 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
4538 * tests/regression.at (Web2c): Rename as...
4539 (Web2c Report): this.
4540 (Web2c Actions): New.
4541
45422001-12-22 Akim Demaille <akim@epita.fr>
4543
4544 Reductions in web2c.y are improperly reported.
4545 Reported by Mike Castle.
4546
4547 * src/conflicts.c (print_reductions): Fix.
4548 * tests/regression.at (Web2c): New.
4549
45502001-12-18 Akim Demaille <akim@epita.fr>
4551
4552 Some host fail on `assert (!"foo")', which expands to
4553 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
4554 Reported by Nelson Beebee.
4555
4556 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
4557 `#define it_succeeded 0' and `assert (it_succeeded)'.
4558
45592001-12-17 Marc Autret <autret_m@epita.fr>
4560
4561 * src/bison.simple: Don't hard code the skeleton line and filename.
4562 * src/output.c (output_parser): Rename 'line' as 'output_line'.
4563 New line counter 'skeleton_line' (skeleton-line muscle).
4564
45652001-12-17 Paul Eggert <eggert@twinsun.com>
4566
4567 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
4568 YYDEBUG must be defined to a nonzero value.
4569
4570 * src/bison.simple (yytname): Do not assume that the user defines
4571 YYDEBUG to a properly parenthesized expression.
4572
45732001-12-17 Akim Demaille <akim@epita.fr>
4574
4575 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
4576 nlookaheads is a new member.
4577 Adjust all users.
4578 * src/lalr.h (nlookaheads): Remove this orphan declaration.
4579 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
4580 state.
4581
45822001-12-17 Akim Demaille <akim@epita.fr>
4583
4584 * src/files.h, src/files.c (open_files, close_files): Remove.
4585 * src/main.c (main): Don't open/close files, nor invoke lex_free,
4586 let...
4587 * src/reader.c (reader): Do it.
4588
45892001-12-17 Akim Demaille <akim@epita.fr>
4590
4591 * src/conflicts.c (print_reductions): Formatting changes.
4592
45932001-12-17 Akim Demaille <akim@epita.fr>
4594
4595 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
4596 (flush_reduce): New.
4597 (resolve_sr_conflict): Adjust.
4598
45992001-12-17 Akim Demaille <akim@epita.fr>
4600
4601 * src/output.c (output_obstack): Be static and rename as...
4602 (format_obstack): this, to avoid any confusion with files.c's
4603 output_obstack.
4604 * src/reader.h (muscle_obstack): Move to...
4605 * src/output.h: here, since it's defined in output.c.
4606
46072001-12-17 Akim Demaille <akim@epita.fr>
4608
4609 * src/output.c (action_row, save_column, default_goto)
4610 (sort_actions, matching_state, pack_vector): Better variable
4611 locality.
4612
46132001-12-17 Akim Demaille <akim@epita.fr>
4614
4615 * src/output.c: Various formatting changes.
4616
46172001-12-17 Akim Demaille <akim@epita.fr>
4618
4619 * src/files.c (output_files): Free the output_obstack.
4620 * src/main.c (main): Call print and print_graph conditionally.
4621 * src/print.c (print): Work unconditionally.
4622 * src/print_graph.c (print_graph): Work unconditionally.
4623 * src/conflicts.c (log_resolution): Output only if verbose_flag.
4624
46252001-12-16 Marc Autret <autret_m@epita.fr>
4626
4627 * src/output.c (actions_output): Fix. When we use %no-lines,
4628 there is one less line per action.
4629
46302001-12-16 Marc Autret <autret_m@epita.fr>
4631
4632 * src/bison.simple: Remove a useless #line directive.
4633 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
4634 * src/output.c (get_lines_number): New.
4635 (output_parser): Adjust, now takes care about the lines of a
4636 output muscles.
4637 Fix line numbering.
4638 (actions_output): Computes the number of lines taken by actions.
4639 (output_master_parser): Insert new skeleton which is the name of
4640 the output parser file name.
4641
46422001-12-15 Marc Autret <autret_m@epita.fr>
4643
4644 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
4645
46462001-12-15 Marc Autret <autret_m@epita.fr>
4647
4648 * src/output.c (output_gram): Keep track of the hairy one.
4649
46502001-12-15 Akim Demaille <akim@epita.fr>
4651
4652 Make `make distcheck' work.
4653
4654 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
4655 system.h which uses libgettext.h.
4656
46572001-12-15 Akim Demaille <akim@epita.fr>
4658
4659 * src/nullable.c (set_nullable): Useless rules must be skipped,
4660 otherwise, since we range over their symbols, we might look at a
4661 nonterminal which no longer ``exists'', i.e., it is not counted in
4662 `nvars', hence we overflow our arrays.
4663
46642001-12-15 Akim Demaille <akim@epita.fr>
4665
4666 The header can also be produced directly, without any obstack!
4667 Yahoo!
4668
4669 * src/files.c, src/files.h (defines_obstack): Remove.
4670 (compute_header_macro): Global.
4671 (defines_obstack_save): Remove.
4672 * src/reader.c (parse_union_decl): No longer output to
4673 defines_obstack: its content can be found in the `stype' muscle
4674 anyway.
4675 (output_token_translations): Merge into...
4676 (symbols_output): this.
4677 Rename as...
4678 (symbols_save): this.
4679 (reader): Adjust.
4680 * src/output.c (header_output): New.
4681 (output): Call it.
4682
46832001-12-15 Akim Demaille <akim@epita.fr>
4684
4685 * src/reader.c (parse_union_decl): Instead of handling two obstack
4686 simultaneously, use one to define the `stype' muscle, and use the
4687 value of the latter to fill defines_obstack.
4688 (copy_comment): Remove.
4689 (copy_comment2): Work for a single obstack.
4690 Rename as...
4691 (copy_comment): this.
4692
46932001-12-15 Akim Demaille <akim@epita.fr>
4694
4695 * src/lex.c, src/lex.h (xgetc): No longer static.
4696 * src/reader.c (parse_union_decl): Revamp.
4697
46982001-12-15 Akim Demaille <akim@epita.fr>
4699
4700 Still making progress in separating Bison into (i) input, (ii)
4701 process, (iii) output: now we can directly output the parser file
4702 without using table_obstack at all.
4703
4704 * src/files.c, src/files.h (table_obstack): Bye bye.
4705 (parser_file_name): New.
4706 * src/files.c (compute_output_file_names): Compute it.
4707 * src/output.c (actions_output, output_parser)
4708 (output_master_parser): To a file instead of an obstack.
4709
47102001-12-15 Akim Demaille <akim@epita.fr>
4711
4712 Attach actions to rules, instead of pre-outputting them to
4713 actions_obstack.
4714
4715 * src/gram.h (rule_t): action and action_line are new members.
4716 * src/reader.c (symbol_list): Likewise.
4717 (copy_action): Save the actions within the rule.
4718 (packgram): Save them in rule_table.
4719 * src/output.c (actions_output): New.
4720 (output_parser): Use it on `%%actions'.
4721 (output_rule_data): Don't free rule_table.
4722 (output): Do it.
4723 (prepare): Don't save the `action' muscle.
4724 * src/bison.simple: s/%%action/%%actions/.
4725
47262001-12-15 Akim Demaille <akim@epita.fr>
4727
4728 * src/reader.c (copy_action): When --yacc, don't append a `;'
4729 to the user action: let it fail if lacking.
4730 Suggested by Arnold Robbins and Tom Tromey.
4731
47322001-12-14 Akim Demaille <akim@epita.fr>
4733
4734 * src/lex.c (literalchar): Simply return the char you decoded, non
4735 longer mess around with obstacks and int pointers.
4736 Adjust all callers.
4737
47382001-12-14 Akim Demaille <akim@epita.fr>
4739
4740 * src/lex.c (literalchar): Don't escape the special characters,
4741 just decode them, and keep them as char (before, eol was output as
4742 the 2 char string `\n' etc.).
4743 * src/output.c (output_rule_data): Use quotearg to output the
4744 token strings.
4745
47462001-12-13 Paul Eggert <eggert@twinsun.com>
4747
4748 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
4749 Do not infringe on the global user namespace when using C++.
4750 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
4751 All uses of `fprintf' and `stderr' changed.
4752
4753 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
4754
47552001-12-13 Akim Demaille <akim@epita.fr>
4756
4757 The computation of nullable is broken: it doesn't handle empty
4758 RHS's properly.
4759
4760 * tests/torture.at (GNU AWK Grammar): New.
4761 * tests/sets.at (Nullable): New.
4762 * src/nullable.c (set_nullable): Instead of blindly looping over
4763 `ritems', loop over the rules, and then over their rhs's.
4764
4765 Work around Autotest bugs.
4766
4767 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
4768 frame, because Autotest understand lines starting with a `+' as
4769 traces from the shell. Then, they are not processed properly.
4770 Admittedly an Autotest bug, but we don't have time to wait for
4771 Autotest to catch up.
4772 * tests/regression.at (Broken Closure): Adjust to the new table
4773 frames.
4774 Move to...
4775 * tests/sets.at: here.
4776
47772001-12-13 Akim Demaille <akim@epita.fr>
4778
4779 * src/closure.c (closure): Use nrules instead of playing tricks
4780 with BITS_PER_WORD.
4781
47822001-12-13 Akim Demaille <akim@epita.fr>
4783
4784 * src/print.c (print_actions): Output the handling of `$' as the
4785 traces do: shifting the token EOF. Before EOF was treated as a
4786 nonterminal.
4787 * tests/regression.at: Adjust some tests.
4788 * src/print_graph.c (print_core): Complete the set of items via
4789 closure. The next-to-final and final states are still unsatisfying,
4790 but that's to be addressed elsewhere.
4791 No longer output the rule numbers, but do output the state number.
4792 A single loop for the shifts + gotos is enough, but picked a
4793 distinct color for each.
4794 (print_graph): Initialize and finalize closure.
4795
47962001-12-13 Akim Demaille <akim@epita.fr>
4797
4798 * src/reader.c (readgram): Remove dead code, an strip useless
4799 braces.
4800 (get_type): Remove, unused.
4801
48022001-12-12 Akim Demaille <akim@epita.fr>
4803
4804 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
4805 on that of lib/error.c.
4806
48072001-12-12 Akim Demaille <akim@epita.fr>
4808
4809 Some hosts don't like `/' in includes.
4810
4811 * src/system.h: Include libgettext.h without qualifying the path.
4812 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
4813 $(top_srcdir).
4814
48152001-12-11 Marc Autret <autret_m@epita.fr>
4816
4817 * src/output.c (output_parser): Remove useless muscle.
4818
48192001-12-11 Marc Autret <autret_m@epita.fr>
4820
4821 * src/bison.simple: Remove #line just before %%epilogue. It
4822 is now handled in ...
4823 * src/reader.c (read_additionnal_code): Add the output of a
4824 #line for the epilogue.
4825
48262001-12-10 Marc Autret <autret_m@epita.fr>
4827
4828 * src/reader.c (copy_definition): Re-use CPP-outed code which
4829 replace precedent remove.
4830 * src/bison.simple: Remove #line before %%prologue because
4831 %%input-line is wrong at this time.
4832
48332001-12-10 Marc Autret <autret_m@epita.fr>
4834
4835 * src/reader.c (symbols_output): Clean up.
4836 * src/output.c (output_gram, output): Clean up.
4837
48382001-12-10 Akim Demaille <akim@epita.fr>
4839
4840 * src/lalr.c (initialize_lookaheads): New. Extracted from...
4841 * src/LR0.c (set_state_table): here.
4842 * src/lalr.c (lalr): Call it.
4843
48442001-12-10 Akim Demaille <akim@epita.fr>
4845
4846 * src/state.h (shifts): Remove the `number' member: shifts are
4847 attached to state, hence no longer need to be labelled with a
4848 state number.
4849
48502001-12-10 Akim Demaille <akim@epita.fr>
4851
4852 Now that states have a complete set of members, the linked list of
4853 shifts is useless: just fill directly the state's shifts member.
4854
4855 * src/state.h (shifts): Remove the `next' member.
4856 * src/LR0.c (first_state, last_state): Remove.
4857 Adjust the callers.
4858 (augment_automaton): Don't look for the shifts that must be added
4859 a shift on EOF: it is those of the state we looked for! But now,
4860 since shifts are attached, it is no longer needed to looking
4861 merely by its id: its number.
4862
48632001-12-10 Akim Demaille <akim@epita.fr>
4864
4865 * src/LR0.c (augment_automaton): Better variable locality.
4866 Remove an impossible branch: if there is a state corresponding to
4867 the start symbol being shifted, then there is shift for the start
4868 symbol from the initial state.
4869
48702001-12-10 Akim Demaille <akim@epita.fr>
4871
4872 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
4873 only when appropriate: when insert_start_shifting_state' is not
4874 invoked.
4875 * tests/regression.at (Rule Line Numbers): Adjust.
4876
48772001-12-10 Akim Demaille <akim@epita.fr>
4878
4879 * src/LR0.c (augment_automaton): Now that all states have shifts,
4880 merge the two cases addition shifts to the initial state.
4881
48822001-12-10 Akim Demaille <akim@epita.fr>
4883
4884 * src/lalr.c (set_state_table): Move to...
4885 * src/LR0.c: here.
4886 * src/lalr.c (lalr): Don't call it...
4887 * src/LR0.c (generate_states): do it.
4888 * src/LR0.h (first_state): Remove, only the table is used.
4889
48902001-12-10 Akim Demaille <akim@epita.fr>
4891
4892 * src/LR0.h (first_shift, first_reduction): Remove.
4893 * src/lalr.c: Don't use first_shift: find shifts through the
4894 states.
4895
48962001-12-10 Akim Demaille <akim@epita.fr>
4897
4898 * src/LR0.c: Attach shifts to states as soon as they are
4899 computed.
4900 * src/lalr.c (set_state_table): Instead of assigning shifts to
4901 state, just assert that the mapping was properly done.
4902
49032001-12-10 Akim Demaille <akim@epita.fr>
4904
4905 * src/LR0.c (insert_start_shift): Rename as...
4906 (insert_start_shifting_state): this.
4907 (insert_eof_shifting_state, insert_accepting_state): New.
4908 (augment_automaton): Adjust.
4909 Better locality of the variables.
4910 When looking if the start_symbol is shifted from the initial
4911 state, using `while (... symbol != start_symbol ...)' sounds
4912 better than `while (... symbol < start_symbol ...)': If fail
4913 to see how the order between symbols could be relevant!
4914
49152001-12-10 Akim Demaille <akim@epita.fr>
4916
4917 * src/getargs.h: Don't declare `spec_name_prefix' and
4918 `spec_file_prefix', declared by src/files.h.
4919 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
4920 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
4921 * src/output.c (prepare): Adjust.
4922 * src/reader.c (symbols_output): Likewise.
4923 * src/vmsgetargs.c: Vaguely adjust, but who cares?
4924
49252001-12-10 Akim Demaille <akim@epita.fr>
4926
4927 * src/muscle_tab.c (muscle_init): NULL is a better default than
4928 `"0"'.
4929
49302001-12-10 Akim Demaille <akim@epita.fr>
4931
4932 * src/reader.c (reader): Calling symbols_output once is enough.
4933
49342001-12-10 Akim Demaille <akim@epita.fr>
4935
4936 Now that states have a complete set of members, the linked list of
4937 reductions is useless: just fill directly the state's reductions
4938 member.
4939
4940 * src/state.h (struct reductions): Remove member `number' and
4941 `next'.
4942 * src/LR0.c (first_reduction, last_reduction): Remove.
4943 (save_reductions): Don't link the new reductions, store them in
4944 this_state.
4945 * src/lalr.c (set_state_table): No need to attach reductions to
4946 states, it's already done.
4947 * src/output.c (output_actions): No longer free the shifts, then
4948 the reductions, then the states: free all the states and their
4949 members.
4950
49512001-12-10 Akim Demaille <akim@epita.fr>
4952
4953 * src/options.c (OPTN, DRTV, BOTH): New.
4954 (option_table): Use them.
4955
4956 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
4957 the job of system.h.
4958 * src/options.c: Don't include stdio.h and xalloc.h for the same
4959 reasons.
4960
49612001-12-10 Akim Demaille <akim@epita.fr>
4962
4963 * src/output.c (output, prepare): Make sure the values of the
4964 muscles `action' and `prologue' are 0-terminated.
4965
49662001-12-10 Akim Demaille <akim@epita.fr>
4967
4968 Clean up GCC warnings.
4969
4970 * src/reader.c (copy_action): `buf' is not used.
4971 (parse_skel_decl): Be static.
4972 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
4973 * src/options.h (create_long_option_table): Have a real prototype.
4974 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
4975 (hash_delete_at): Return const void *.
4976 Adjust casts to preserve the const.
4977
49782001-12-10 Akim Demaille <akim@epita.fr>
4979
4980 * configure.in: Require 2.52g.
4981 M4 is not needed, but AUTOM4TE is.
4982 * m4/m4.m4: Remove.
4983 * tests/Makefile.am: Adjust.
4984
49852001-12-10 Akim Demaille <akim@epita.fr>
4986
4987 One structure for states is enough, even though theoretically
4988 there are LR(0) states and LALR(1) states.
4989
4990 * src/lalr.h (state_t): Remove.
4991 (state_table): Be state_t **, not state_t *.
4992 * src/state.h (core, CORE_ALLOC): Rename as...
4993 (state_t, STATE_ALLOC): this.
4994 Add the LALR(1) members: shifts, reductions, errs.
4995 * src/LR0.c (state_table): Rename as...
4996 (state_hash): this, to avoid name clashes with the global
4997 `state_table'.
4998 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
4999 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
5000
50012001-12-10 Akim Demaille <akim@epita.fr>
5002
5003 Bison dumps core on bash.y.
5004 Reported by Pascal Bart.
5005
5006 * src/warshall.c (bitmatrix_print): New.
5007 (TC): Use it.
5008 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
5009 j must be the outer loop.
5010 * tests/regression.at (Broken Closure): New.
5011
50122001-12-05 Akim Demaille <akim@epita.fr>
5013
5014 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
5015 its argument.
5016