]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-09-04 Akim Demaille <akim@epita.fr>
2
3 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
4 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
5 translate maintainer only messages.
6
72002-08-12 Paul Eggert <eggert@twinsun.com>
8
9 Version 1.49b.
10
11 * Makefile.am (SUBDIRS): Remove intl.
12 (DISTCLEANFILES): Remove.
13 * NEWS: Mention that GNU M4 is now required. Clarify what is
14 meant by "larger grammars". Mention the pt_BR translation.
15 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17 Bump version from 0.11.2 to 0.11.5.
18 (BISON_PREREQ_STAGE): Remove.
19 (AM_GNU_GETTEXT): Use external gettext.
20 (AC_OUTPUT): Remove intl/Makefile.
21
22 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
23
24 * data/glr.c: Include string.h, for strlen.
25 (yyreportParseError): Use size_t for yysize.
26 (yy_yypstack): No longer nested inside yypstates, as nested
27 functions are not portable. Do not assume size_t is the
28 same width as int.
29 (yypstates): Do not assume that ptrdiff_t is the same width
30 as int, and similarly for yyposn and YYINDEX.
31
32 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
33
34 * lib/Makefile.am (INCLUDES): Do not include from the intl
35 directory, which has been removed.
36 * src/Makefile.am (INCLUDES): Likewise.
37
38 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
39 (bitsets_sources, additional_bitsets_sources, timevars_sources):
40 New vars.
41
42 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
43 * tests/Makefile.am (EXTRA_DIST): Likewise.
44
45 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
46 Do not assume that bitset_windex is the same width as unsigned.
47
48 * lib/abitset.c (abitset_unused_clear): Do not assume that
49 bitset_word is the same width as int.
50 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
51 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
52 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
53 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
54 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
55
56 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
57 portability to one's complement hosts!).
58 * lib/ebitset.c (ebitset_op1): Likewise.
59 * lib/lbitset.c (lbitset_op1): Likewise.
60
61 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
62 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
63 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
64 Sync with fileutils.
65 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
66 lib/gettext.h: Sync with diffutils.
67
68 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
69 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
70
71 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
72 PROTOTYPES to check for prototypes, and "defined __STDC__" to
73 check for void *.
74
75 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
76 size_t; the old version tried to do this but casted improperly.
77 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
78 (bitset_test): Now returns int, not unsigned long.
79
80 * lib/bitset_stats.c: Include "gettext.h".
81 (_): New macro.
82 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
83 name locals "index", as it generates unnecessary warnings on some
84 hosts that have an "index" function.
85
86 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
87 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
88 they need translation.
89 * src/LR0.c (state_list_append, new_itemsets, get_state,
90 append_states, generate_states): Likewise.
91 * src/assoc.c (assoc_to_string): Likewise.
92 * src/closure.c (print_closure, set_firsts, closure): Likewise.
93 * src/gram.c (grammar_dump): Likewise.
94 * src/injections.c (injections_compute): Likewise.
95 * src/lalr.c (lookaheads_print): Likewise.
96 * src/relation.c (relation_transpose): Likewise.
97 * src/scan-gram.l: Likewise.
98 * src/tables.c (table_grow, pack_vector): Likewise.
99
100 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
101 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
102 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
103 * m4/mbstate_t.m4: Sync with fileutils.
104 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
105
106 * po/LINGUAS: Add pt_BR.
107 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
108 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
109 lib/timevar.c.
110 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
111 manual recommends.
112 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
113
114 * src/complain.c (strerror_r): Remove decl; not needed.
115 (strerror): Use same pattern as ../lib/error.c.
116
117 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
118
119 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
120
121 * src/main.c (main): Cast result of bindtextdomain and textdomain
122 to void, to avoid a GCC warning when --disable-nls is in effect.
123
124 * src/scan-gram.l: Use strings rather than escapes when possible,
125 to minimize the number of warnings from xgettext.
126 (handle_action_dollar, handle_action_at): Don't use isdigit,
127 as it mishandles negative chars and it may not work as expected
128 outside the C locale.
129
130 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
131 this is a GCC extension and is not portable to other compilers.
132
133 * src/system.h (alloca): Use same pattern as ../lib/error.c.
134 Do not include <ctype.h>; no longer needed.
135 Do not include <malloc.h>; no longer needed (and generates
136 warnings on OpenBSD 3.0).
137
138 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
139 it's not portable.
140
141 * tests/regression.at: Do not use 'cc -c input.c -o input';
142 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
143
144 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
145 exit status as failure, not just exit status 1. Sun C exits
146 with status 2 sometimes.
147
148 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
149 Use it for the two large tests.
150
1512002-08-02 Akim Demaille <akim@epita.fr>
152
153 * src/conflicts.c (conflicts_output): Don't output rules never
154 reduced here, since anyway that computation doesn't work.
155 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
156 (rule_useless_p, rule_never_reduced_p): New.
157 (grammar_rules_partial_print): Use a filter instead of a range.
158 Display the title only if needed.
159 (grammar_rules_print): Adjust.
160 (grammar_rules_never_reduced_report): New.
161 * src/tables.c (action_row): Move the computation of rules never
162 reduced to...
163 (token_actions): here.
164 * src/main.c (main): Make the parser before making the report, so
165 that rules never reduced are computed.
166 Call grammar_rules_never_reduced_report.
167 * src/print.c (print_results): Report rules never reduced.
168 * tests/conflicts.at, tests/reduce.at: Adjust.
169
1702002-08-01 Akim Demaille <akim@epita.fr>
171
172 Instead of attaching lookaheads and duplicating the rules being
173 reduced by a state, attach the lookaheads to the reductions.
174
175 * src/state.h (state_t): Remove the `lookaheads',
176 `lookaheads_rule' member.
177 (reductions_t): Add a `lookaheads' member.
178 Use a regular array for the `rules'.
179 * src/state.c (reductions_new): Initialize the lookaheads member
180 to 0.
181 (state_rule_lookaheads_print): Adjust.
182 * src/state.h, src/state.c (state_reductions_find): New.
183 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
184 (count_rr_conflicts): Adjust.
185 * src/lalr.c (LArule): Remove.
186 (add_lookback_edge): Adjust.
187 (state_lookaheads_count): New.
188 (states_lookaheads_initialize): Merge into...
189 (initialize_LA): this.
190 (lalr_free): Adjust.
191 * src/main.c (main): Don't free nullable and derives too early: it
192 is used by --verbose.
193 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
194
1952002-08-01 Akim Demaille <akim@epita.fr>
196
197 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
198 `rule_number_t**'.
199 (set_derives, free_derives): Rename as...
200 (derives_compute, derives_free): this.
201 Adjust all dependencies.
202 * src/nullable.c (set_nullable, free_nullable): Rename as...
203 (nullable_compute, nullable_free): these.
204 (rule_list_t): Store rule_t *, not rule_number_t.
205 * src/state.c (state_rule_lookaheads_print): Directly compare rule
206 pointers, instead of their numbers.
207 * src/main.c (main): Call nullable_free, and derives_free earlier,
208 as they were lo longer used.
209
2102002-08-01 Akim Demaille <akim@epita.fr>
211
212 * lib/timevar.c (get_time): Include children time.
213 * src/lalr.h (LA, LArule): Don't export them: used with the
214 state_t.
215 * src/lalr.c (LA, LArule): Static.
216 * src/lalr.h, src/lalr.c (lalr_free): New.
217 * src/main.c (main): Call it.
218 * src/tables.c (pack_vector): Check whether loc is >= to the
219 table_size, not >.
220 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
221 (tables_generate): do it, since that's also it which allocates
222 them.
223 Don't free LA and LArule, main does.
224
2252002-07-31 Akim Demaille <akim@epita.fr>
226
227 Separate parser tables computation and output.
228
229 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
230 (conflict_list, conflict_list_cnt, table, check, table_ninf)
231 (yydefgoto, yydefact, high): Move to...
232 * src/tables.h, src/tables.c: here.
233 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
234 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
235 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
236 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
237 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
238 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
239 (action_row, save_row, token_actions, save_column, default_goto)
240 (goto_actions, sort_actions, matching_state, pack_vector)
241 (table_ninf_remap, pack_table, prepare_actions): Move to...
242 * src/tables.c: here.
243 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
244 * src/output.c (token_actions, output_base, output_conflicts)
245 (output_check): Merge into...
246 (prepare_actions): this.
247 (actions_output): Rename as...
248 (user_actions_output): this.
249 * src/main.c (main): Call tables_generate and tables_free.
250
2512002-07-31 Akim Demaille <akim@epita.fr>
252
253 Steal GCC's --time-report support.
254
255 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
256 stolen/adjusted from GCC.
257 * m4/stage.m4: Remove time related checks.
258 * m4/timevar.m4: New.
259 * configure.in: Adjust.
260 * src/system.h: Adjust to using timevar.h.
261 * src/getargs.h, src/getargs.c: Support trace_time for
262 --trace=time.
263 * src/main.c (stage): Remove.
264 (main): Replace `stage' invocations with timevar calls.
265 * src/output.c: Insert pertinent timevar calls.
266
2672002-07-31 Akim Demaille <akim@epita.fr>
268
269 Let --trace have arguments.
270
271 * src/getargs.h (enum trace_e): New.
272 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
273 (long_options, short_options): --trace/-T takes an optional
274 argument.
275 Change all the uses of trace_flag to reflect the new flags.
276 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
277
278 Strengthen `stage' portability.
279
280 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
281 * configure.in: Use it.
282 Don't check for malloc.h and sys/times.h.
283 * src/system.h: Include them when appropriate.
284 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
285 times and struct tms are available.
286
2872002-07-30 Akim Demaille <akim@epita.fr>
288
289 In verbose parse error message, don't report `error' as an
290 expected token.
291 * tests/actions.at (Printers and Destructors): Adjust.
292 * tests/calc.at (Calculator $1): Adjust.
293 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
294 error message, do not report the parser accepts the error token in
295 that state.
296
2972002-07-30 Akim Demaille <akim@epita.fr>
298
299 Normalize conflict related messages.
300
301 * src/complain.h, src/complain.c (warn, complain): New.
302 * src/conflicts.c (conflicts_print): Use them.
303 (conflict_report_yacc): New, extracted from...
304 (conflicts_print): here.
305 * tests/conflicts.at, tests/existing.at: Adjust.
306
3072002-07-30 Akim Demaille <akim@epita.fr>
308
309 Report rules which are never reduced by the parser: those hidden
310 by conflicts.
311
312 * src/LR0.c (save_reductions): Don't make the final state too
313 different: save its reduction (accept) instead of having a state
314 without any action (no shift or goto, no reduce).
315 Note: the final state is now a ``regular'' state, i.e., the
316 parsers now contain `reduce 0' as default reduction.
317 Nevertheless, since they decide to `accept' when yystate =
318 final_state, they still will not reduce rule 0.
319 * src/print.c (print_actions, print_reduction): Adjust.
320 * src/output.c (action_row): Track reduced rules.
321 (token_actions): Report rules never reduced.
322 * tests/conflicts.at, tests/regression.at: Adjust.
323
3242002-07-30 Akim Demaille <akim@epita.fr>
325
326 `stage' was accidently included in a previous patch.
327 Initiate its autoconfiscation.
328
329 * configure.in: Look for malloc.h and sys/times.h.
330 * src/main.c (stage): Adjust.
331 Report only when trace_flag.
332
3332002-07-29 Akim Demaille <akim@epita.fr>
334
335 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
336 state_number_t.
337 (errs_t): symbol_t*, not symbol_number_t.
338 (reductions_t): rule_t*, not rule_number_t.
339 (FOR_EACH_SHIFT): New.
340 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
341 * src/print.c, src/print_graph.c: Adjust.
342
3432002-07-29 Akim Demaille <akim@epita.fr>
344
345 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
346
347 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
348 (endtoken, accept): these.
349 * src/reader.c (reader): Set endtoken's default tag to "$end".
350 Set undeftoken's tag to "$undefined" instead of "$undefined.".
351 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
352 Adjust.
353
3542002-07-29 Akim Demaille <akim@epita.fr>
355
356 * src/reduce.c (reduce_grammar): When the language is empty,
357 complain about the start symbol, not the axiom.
358 Use its location.
359 * tests/reduce.at (Empty Language): New.
360
3612002-07-26 Akim Demaille <akim@epita.fr>
362
363 * src/reader.h, src/reader.c (gram_error): ... can't get
364 yycontrol without making too strong assumptions on the parser
365 itself.
366 * src/output.c (prepare_tokens): Use the real 0th value of
367 token_translations instead of `0'.
368 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
369 visible here.
370 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
371 for the time being: %locations ought to provide it to yyerror.
372
3732002-07-25 Akim Demaille <akim@epita.fr>
374
375 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
376 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
377 * tests/regression.at (Web2c Actions): Adjust.
378
3792002-07-25 Akim Demaille <akim@epita.fr>
380
381 Stop storing rules from 1 to nrules + 1.
382
383 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
384 * src/nullable.c, src/output.c, src/print.c, src/reader.c
385 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
386 Iterate from 0 to nrules.
387 Use rule_number_as_item_number and item_number_as_rule_number.
388 Adjust to `derive' now containing possibly 0.
389 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
390 Handle the `- 1' part in rule numbers from/to item numbers.
391 * src/conflicts.c (log_resolution): Fix the message which reversed
392 shift and reduce.
393 * src/output.c (action_row): Initialize default_rule to -1.
394 (token_actions): Adjust.
395 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
396 expected output.
397 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
398
3992002-07-25 Akim Demaille <akim@epita.fr>
400
401 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
402 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
403 (b4_c_knr_arg_decl): New.
404 * data/yacc.c: Use it to define yysymprint, yydestruct, and
405 yyreport_parse_error.
406
4072002-07-25 Akim Demaille <akim@epita.fr>
408
409 * data/yacc.c (yyreport_parse_error): New, extracted from...
410 (yyparse): here.
411 (yydestruct, yysymprint): Move above yyparse.
412 Be K&R compliant.
413
4142002-07-25 Akim Demaille <akim@epita.fr>
415
416 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
417 replace...
418 (b4_sint_type, b4_uint_type): these.
419 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
420 * tests/regression.at (Web2c Actions): Adjust.
421
4222002-07-25 Akim Demaille <akim@epita.fr>
423
424 * src/gram.h (TIEM_NUMBER_MAX): New.
425 (item_number_of_rule_number, rule_number_of_item_number): Rename
426 as...
427 (rule_number_as_item_number, item_number_as_rule_number): these.
428 Adjust dependencies.
429 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
430 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
431 (symbol_number_to_vector_number): New.
432 (order): Of vector_number_t* type.
433 (base_t, BASE_MAX, BASE_MIN): New.
434 (froms, tos, width, pos, check): Of base_t type.
435 (action_number_t, ACTION_MIN, ACTION_MAX): New.
436 (actrow): Of action_number_t type.
437 (conflrow): Of unsigned int type.
438 (table_ninf, base_ninf): New.
439 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
440 (muscle_insert_int_table, muscle_insert_base_table)
441 (muscle_insert_rule_number_table): New.
442 (prepare_tokens): Output `toknum' as int_table.
443 (action_row): Returns a rule_number_t.
444 Use ACTION_MIN, not SHRT_MIN.
445 (token_actions): yydefact is rule_number_t*.
446 (table_ninf_remap): New.
447 (pack_table): Use it for `base' and `table'.
448 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
449 replaced with...
450 (YYPACT_NINF, YYTABLE_NINF): these.
451 (yypact, yytable): Compute their types instead of hard-coded
452 `short'.
453 * tests/regression.at (Web2c Actions): Adjust.
454
4552002-07-19 Akim Demaille <akim@epita.fr>
456
457 * src/scan-gram.l (id): Can start with an underscore.
458
4592002-07-16 Akim Demaille <akim@epita.fr>
460
461 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
462 Adjust all former `associativity' dependencies.
463 * src/symtab.c (symbol_new): Default associativity is `undef', not
464 `right'.
465 (symbol_check_alias_consistence): Adjust.
466
4672002-07-09 Akim Demaille <akim@epita.fr>
468
469 * doc/bison.texinfo: Properly set the ``header'' part.
470 Use @dircategory ``GNU programming tools'' as per Texinfo's
471 documentation.
472 Use @copying.
473
4742002-07-09 Akim Demaille <akim@epita.fr>
475
476 * lib/quotearg.h: Protect against multiple inclusions.
477 * src/location.h (location_t): Add a `file' member.
478 (LOCATION_RESET, LOCATION_PRINT): Adjust.
479 * src/complain.c (warn_at, complain_at, fatal_at): Drop
480 `error_one_per_line' support.
481
4822002-07-09 Akim Demaille <akim@epita.fr>
483
484 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
485 * src/reader.c (lineno): Remove.
486 Adjust all dependencies.
487 (get_merge_function): Take a location and use complain_at.
488 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
489 * tests/regression.at (Invalid inputs, Mixing %token styles):
490 Adjust.
491
4922002-07-09 Akim Demaille <akim@epita.fr>
493
494 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
495 recovery rule, and forbid extensions when --yacc.
496 (gram_error): Use complain_at.
497 * src/reader.c (reader): Exit if there were parse errors.
498
4992002-07-09 Akim Demaille <akim@epita.fr>
500
501 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
502 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
503 Reported by R Blake <blakers@mac.com>.
504
5052002-07-09 Akim Demaille <akim@epita.fr>
506
507 * data/yacc.c: Output the copyright notive in the header.
508
5092002-07-03 Akim Demaille <akim@epita.fr>
510
511 * src/output.c (froms, tos): Are state_number_t.
512 (save_column): sp, sp1, and sp2 are state_number_t.
513 (prepare): Rename `final' as `final_state_number', `nnts' as
514 `nterms_number', `nrules' as `rules_number', `nstates' as
515 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
516 unused.
517 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
518 * data/lalr1.cc (nsym_): Remove, unused.
519
5202002-07-03 Akim Demaille <akim@epita.fr>
521
522 * src/lalr.h, src/lalr.c (goto_number_t): New.
523 * src/lalr.c (goto_list_t): New.
524 Propagate them.
525 * src/nullable.c (rule_list_t): New.
526 Propagate.
527 * src/types.h: Remove.
528
5292002-07-03 Akim Demaille <akim@epita.fr>
530
531 * src/closure.c (print_fderives): Use rule_rhs_print.
532 * src/derives.c (print_derives): Use rule_rhs_print.
533 (rule_list_t): New, replaces `shorts'.
534 (set_derives): Add comments.
535 * tests/sets.at (Nullable, Firsts): Adjust.
536
5372002-07-03 Akim Demaille <akim@epita.fr>
538
539 * src/output.c (prepare_actions): Free `tally' and `width'.
540 (prepare_actions): Allocate and free `order'.
541 * src/symtab.c (symbols_free): Free `symbols'.
542 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
543 * src/output.c (m4_invoke): Move to...
544 * src/scan-skel.l: here.
545 (<<EOF>>): Close yyout, and free its name.
546
5472002-07-03 Akim Demaille <akim@epita.fr>
548
549 Fix some memory leaks, and fix a bug: state 0 was examined twice.
550
551 * src/LR0.c (new_state): Merge into...
552 (state_list_append): this.
553 (new_states): Merge into...
554 (generate_states): here.
555 (set_states): Don't ensure a proper `errs' state member here, do it...
556 * src/conflicts.c (conflicts_solve): here.
557 * src/state.h, src/state.c: Comment changes.
558 (state_t): Rename member `shifts' as `transitions'.
559 Adjust all dependencies.
560 (errs_new): For consistency, also take the values as argument.
561 (errs_dup): Remove.
562 (state_errs_set): New.
563 (state_reductions_set, state_transitions_set): Assert that no
564 previous value was assigned.
565 (state_free): New.
566 (states_free): Use it.
567 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
568 temporary storage: use `errs' and `nerrs' as elsewhere.
569 (set_conflicts): Allocate and free this `errs'.
570
5712002-07-02 Akim Demaille <akim@epita.fr>
572
573 * lib/libiberty.h: New.
574 * lib: Update the bitset implementation from upstream.
575 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
576 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
577 * src/main.c: Adjust bitset stats calls.
578
5792002-07-01 Paul Eggert <eggert@twinsun.com>
580
581 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
582 char, so that negative chars don't collide with $.
583
5842002-06-30 Akim Demaille <akim@epita.fr>
585
586 Have the GLR tests be `warning' checked, and fix the warnings.
587
588 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
589 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
590 (yyremoveDeletes): `yyi' and `yyj' are size_t.
591 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
592 (yyaddDeferredAction): static.
593 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
594 (yyreportParseError): yyprefix is const.
595 yytokenp is used only when verbose.
596 (yy__GNUC__): Replace with __GNUC__.
597 (yypdumpstack): yyi is size_t.
598 (yypreference): Un-yy local variables and arguments, to avoid
599 clashes with `yyr1'. Anyway, we are not in the user name space.
600 (yytname_size): be an int, as is compared with ints.
601 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
602 Use them.
603 * tests/cxx-gram.at: Use quotation to protect $1.
604 Use AT_COMPILE to enable warnings hunts.
605 Prototype yylex and yyerror.
606 `Use' argc.
607 Include `string.h', not `strings.h'.
608 Produce and prototype stmtMerge only when used.
609 yylex takes a location.
610
6112002-06-30 Akim Demaille <akim@epita.fr>
612
613 We spend a lot of time in quotearg, in particular when --verbose.
614
615 * src/symtab.c (symbol_get): Store a quoted version of the key.
616 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
617 Adjust all callers.
618
6192002-06-30 Akim Demaille <akim@epita.fr>
620
621 * src/state.h (reductions_t): Rename member `nreds' as num.
622 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
623 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
624
6252002-06-30 Akim Demaille <akim@epita.fr>
626
627 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
628 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
629 (shifts_to): Rename as...
630 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
631 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
632 (TRANSITION_IS_DISABLED, transitions_to): these.
633
6342002-06-30 Akim Demaille <akim@epita.fr>
635
636 * src/print.c (print_shifts, print_gotos): Merge into...
637 (print_transitions): this.
638 (print_transitions, print_errs, print_reductions): Align the
639 lookaheads columns.
640 (print_core, print_transitions, print_errs, print_state,
641 print_grammar): Output empty lines separator before, not after.
642 (state_default_rule_compute): Rename as...
643 (state_default_rule): this.
644 * tests/conflicts.at (Defaulted Conflicted Reduction),
645 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
646 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
647
6482002-06-30 Akim Demaille <akim@epita.fr>
649
650 Display items as we display rules.
651
652 * src/gram.h, src/gram.c (rule_lhs_print): New.
653 * src/gram.c (grammar_rules_partial_print): Use it.
654 * src/print.c (print_core): Likewise.
655 * tests/conflicts.at (Defaulted Conflicted Reduction),
656 (Unresolved SR Conflicts): Adjust.
657 (Unresolved SR Conflicts): Adjust and rename as...
658 (Resolved SR Conflicts): this, as was meant.
659 * tests/regression.at (Web2c Report): Adjust.
660
6612002-06-30 Akim Demaille <akim@epita.fr>
662
663 * src/print.c (state_default_rule_compute): New, extracted from...
664 (print_reductions): here.
665 Pessimize, but clarify the code.
666 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
667
6682002-06-30 Akim Demaille <akim@epita.fr>
669
670 * src/output.c (action_row): Let default_rule be always a rule
671 number.
672
6732002-06-30 Akim Demaille <akim@epita.fr>
674
675 * src/closure.c (print_firsts, print_fderives, closure):
676 Use BITSET_EXECUTE.
677 * src/lalr.c (lookaheads_print): Likewise.
678 * src/state.c (state_rule_lookaheads_print): Likewise.
679 * src/print_graph.c (print_core): Likewise.
680 * src/print.c (print_reductions): Likewise.
681 * src/output.c (action_row): Likewise.
682 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
683
6842002-06-30 Akim Demaille <akim@epita.fr>
685
686 * src/print_graph.c: Use report_flag.
687
6882002-06-30 Akim Demaille <akim@epita.fr>
689
690 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
691 to...
692 * src/relation.h, src/relation.c (traverse, relation_digraph)
693 (relation_print, relation_transpose): New.
694
6952002-06-30 Akim Demaille <akim@epita.fr>
696
697 * src/state.h, src/state.c (shifts_to): New.
698 * src/lalr.c (build_relations): Use it.
699
7002002-06-30 Akim Demaille <akim@epita.fr>
701
702 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
703 (item_number_of_rule_number, rule_number_of_item_number): New.
704 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
705 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
706 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
707 Propagate their use.
708 Much remains to be done, in particular wrt `shorts' from types.h.
709
7102002-06-30 Akim Demaille <akim@epita.fr>
711
712 * src/symtab.c (symbol_new): Initialize the `printer' member.
713
7142002-06-30 Akim Demaille <akim@epita.fr>
715
716 * src/LR0.c (save_reductions): Remove, replaced by...
717 * src/state.h, src/state.c (state_reductions_set): New.
718 (reductions, errs): Rename as...
719 (reductions_t, errs_t): these.
720 Adjust all dependencies.
721
7222002-06-30 Akim Demaille <akim@epita.fr>
723
724 * src/LR0.c (state_list_t, state_list_append): New.
725 (first_state, last_state): Now symbol_list_t.
726 (this_state): Remove.
727 (new_itemsets, append_states, save_reductions): Take a state_t as
728 argument.
729 (set_states, generate_states): Adjust.
730 (save_shifts): Remove, replaced by...
731 * src/state.h, src/state.c (state_shifts_set): New.
732 (shifts): Rename as...
733 (shifts_t): this.
734 Adjust all dependencies.
735 * src/state.h (state_t): Remove the `next' member.
736
7372002-06-30 Akim Demaille <akim@epita.fr>
738
739 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
740 escaped in slot 0.
741
7422002-06-30 Akim Demaille <akim@epita.fr>
743
744 Use hash.h for the state hash table.
745
746 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
747 (allocate_storage): Use state_hash_new.
748 (free_storage): Use state_hash_free.
749 (new_state, get_state): Adjust.
750 * src/lalr.h, src/lalr.c (states): Move to...
751 * src/states.h (state_t): Remove the `link' member, no longer
752 used.
753 * src/states.h, src/states.c: here.
754 (state_hash_new, state_hash_free, state_hash_lookup)
755 (state_hash_insert, states_free): New.
756 * src/states.c (state_table, state_compare, state_hash): New.
757 * src/output.c (output_actions): Do not free states now, since we
758 still need to know the final_state number in `prepare', called
759 afterwards. Do it...
760 * src/main.c (main): here: call states_free after `output'.
761
7622002-06-30 Akim Demaille <akim@epita.fr>
763
764 * src/state.h, src/state.c (state_new): New, extracted from...
765 * src/LR0.c (new_state): here.
766 * src/state.h (STATE_ALLOC): Move to...
767 * src/state.c: here.
768 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
769 * src/state.h, src/state.c: here.
770
7712002-06-30 Akim Demaille <akim@epita.fr>
772
773 * src/reader.c (gensym): Rename as...
774 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
775 (getsym): Rename as...
776 (symbol_get): this.
777
7782002-06-30 Akim Demaille <akim@epita.fr>
779
780 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
781 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
782 * src/output.c, src/print.c, src/print_graph.c: Propagate.
783 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
784
7852002-06-30 Akim Demaille <akim@epita.fr>
786
787 Make the test suite pass with warnings checked.
788
789 * tests/actions.at (Printers and Destructors): Improve.
790 Avoid unsigned vs. signed issues.
791 * tests/calc.at: Don't exercise the scanner here, do it...
792 * tests/input.at (Torturing the Scanner): here.
793
7942002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
795
796 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
797 reorganize first lines parallel to yacc.c.
798
7992002-06-28 Akim Demaille <akim@epita.fr>
800
801 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
802 (b4_token_enum, b4_token_defines): New, factored from...
803 * data/lalr1.cc, data/yacc.c, glr.c: here.
804
8052002-06-28 Akim Demaille <akim@epita.fr>
806
807 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
808 unused variables.
809 * src/output.c (merger_output): static.
810
8112002-06-28 Akim Demaille <akim@epita.fr>
812
813 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
814 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
815 pacify GCC.
816 * src/output.c (save_row): Initialize all the variables to pacify GCC.
817
8182002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
819
820 Accumulated changelog for new GLR parsing features.
821
822 * src/conflicts.c (count_total_conflicts): Change name to
823 conflicts_total_count.
824 * src/conflicts.h: Ditto.
825 * src/output.c (token_actions): Use the new name.
826 (output_conflicts): Change conflp => conflict_list_heads, and
827 confl => conflict_list for better readability.
828 * data/glr.c: Use the new names.
829 * NEWS: Add self to GLR announcement.
830
831 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
832
833 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
834 Akim Demaille.
835
836 * data/bison.glr: Change name to glr.c
837 * data/glr.c: Renamed from bison.glr.
838 * data/Makefile.am: Add glr.c
839
840 * src/getargs.c:
841
842 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
843 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
844
845 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
846
847 * data/bison.glr: Be sure to restore the
848 current #line when returning to the skeleton contents after having
849 exposed the input file's #line.
850
851 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
852
853 * data/bison.glr: Bring up to date with changes to bison.simple.
854
855 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
856
857 * data/bison.glr: Correct definitions that use b4_prefix.
858 Various reformatting.
859 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
860 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
861 yytokenp argument; now part of stack.
862 (yychar): Define to behave as documented.
863 (yyclearin): Ditto.
864
865 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
866
867 * src/reader.h: Add declaration for free_merger_functions.
868
869 * src/reader.c (merge_functions): New variable.
870 (get_merge_function): New function.
871 (free_merger_functions): New function.
872 (readgram): Check for %prec that is not followed by a symbol.
873 Handle %dprec and %merge declarations.
874 (packgram): Initialize dprec and merger fields in rules array.
875
876 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
877 conflict_list_cnt, conflict_list_free): New variables.
878 (table_grow): Also grow conflict_table.
879 (prepare_rules): Output dprec and merger tables.
880 (conflict_row): New function.
881 (action_row): Output conflict lists for GLR parser. Don't use
882 default reduction in conflicted states for GLR parser so that there
883 are spaces for the conflict lists.
884 (save_row): Also save conflict information.
885 (token_actions): Allocate conflict list.
886 (merger_output): New function.
887 (pack_vector): Pack conflict table, too.
888 (output_conflicts): New function to output yyconflp and yyconfl.
889 (output_check): Allocate conflict_tos.
890 (output_actions): Output conflict tables, also.
891 (output_skeleton): Output b4_mergers definition.
892 (prepare): Output b4_max_rhs_length definition.
893 Use 'bison.glr' as default skeleton for GLR parsers.
894
895 * src/gram.c (glr_parser): New flag.
896 (grammar_free): Call free_merger_functions.
897
898 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
899 all pairs of conflicting reductions, rather than just all tokens
900 causing conflicts. Needed to size conflict tables.
901 (conflicts_output): Modify call to count_rr_conflicts for new
902 interface.
903 (conflicts_print): Ditto.
904 (count_total_conflicts): New function.
905
906 * src/reader.h (merger_list): New type.
907 (merge_functions): New variable.
908
909 * src/lex.h (tok_dprec, tok_merge): New token types.
910
911 * src/gram.h (rule_s): Add dprec and merger fields.
912 (glr_parser): New flag.
913
914 * src/conflicts.h (count_total_conflicts): New function.
915
916 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
917
918 * doc/bison.texinfo (Generalized LR Parsing): New section.
919 (GLR Parsers): New section.
920 (Language and Grammar): Mention GLR parsing.
921 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
922 Correct typo ("tge" -> "the").
923
924 * data/bison.glr: New skeleton for GLR parsing.
925
926 * tests/cxx-gram.at: New tests for GLR parsing.
927
928 * tests/testsuite.at: Include cxx-gram.at.
929
930 * tests/Makefile.am: Add cxx-gram.at.
931
932 * src/parse-gram.y:
933
934 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
935
936 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
937
9382002-06-27 Akim Demaille <akim@epita.fr>
939
940 * src/options.h, src/options.c: Remove.
941 * src/getargs.c (short_options, long_options): New.
942
9432002-06-27 Akim Demaille <akim@epita.fr>
944
945 * data/bison.simple, data/bison.c++: Rename as...
946 * data/yacc.c, data/lalr1.cc: these.
947 * doc/bison.texinfo (Environment Variables): Remove.
948
9492002-06-25 Raja R Harinath <harinath@cs.umn.edu>
950
951 * src/getargs.c (report_argmatch): Initialize strtok().
952
9532002-06-20 Akim Demaille <akim@epita.fr>
954
955 * data/bison.simple (b4_symbol_actions): New, replaces...
956 (b4_symbol_destructor, b4_symbol_printer): these.
957 (yysymprint): Be sure to call YYPRINT only for tokens, and using
958 user token numbers.
959
9602002-06-20 Akim Demaille <akim@epita.fr>
961
962 * data/bison.simple (yydestructor): Rename as...
963 (yydestruct): this.
964
9652002-06-20 Akim Demaille <akim@epita.fr>
966
967 * src/symtab.h, src/symtab.c (symbol_type_set)
968 (symbol_destructor_set, symbol_precedence_set): The location is
969 the last argument.
970 Adjust all callers.
971
9722002-06-20 Akim Demaille <akim@epita.fr>
973
974 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
975 internals.
976 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
977 Takes a location.
978 * src/symtab.h, src/symtab.c (symbol_class_set)
979 (symbol_user_token_number_set): Likewise.
980 Adjust all callers.
981 Promote complain_at.
982 * tests/input.at (Type Clashes): Adjust.
983
9842002-06-20 Akim Demaille <akim@epita.fr>
985
986 * data/bison.simple (YYLEX): Fix the declaration when
987 %pure-parser.
988
9892002-06-20 Akim Demaille <akim@epita.fr>
990
991 * data/bison.simple (yysymprint): Don't print the token number,
992 just its name.
993 * tests/actions.at (Destructors): Rename as...
994 (Printers and Destructors): this.
995 Also exercise %printer.
996
9972002-06-20 Akim Demaille <akim@epita.fr>
998
999 * data/bison.simple (YYDSYMPRINT): New.
1000 Use it to remove many of the #if YYDEBUG/if (yydebug).
1001
10022002-06-20 Akim Demaille <akim@epita.fr>
1003
1004 * src/symtab.h, src/symtab.c (symbol_t): printer and
1005 printer_location are new members.
1006 (symbol_printer_set): New.
1007 * src/parse-gram.y (PERCENT_PRINTER): New token.
1008 Handle its associated rule.
1009 * src/scan-gram.l: Adjust.
1010 (handle_destructor_at, handle_destructor_dollar): Rename as...
1011 (handle_symbol_code_at, handle_symbol_code_dollar): these.
1012 * src/output.c (symbol_printers_output): New.
1013 (output_skeleton): Call it.
1014 * data/bison.simple (yysymprint): New. Cannot be named yyprint
1015 since there are already many grammar files with a user `yyprint'.
1016 Replace the calls to YYPRINT to calls to yysymprint.
1017 * tests/calc.at: Adjust.
1018 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
1019 taking advantage of parser very internal details (stack size!).
1020
10212002-06-20 Akim Demaille <akim@epita.fr>
1022
1023 * src/scan-gram.l: Complete the scanner with the missing patterns
1024 to pacify Flex.
1025 Use `quote' and `symbol_tag_get' where appropriate.
1026
10272002-06-19 Akim Demaille <akim@epita.fr>
1028
1029 * tests/actions.at (Destructors): Augment to test locations.
1030 * data/bison.simple (yydestructor): Pass it the current location
1031 if locations are enabled.
1032 Prototype only when __STDC__ or C++.
1033 Change the argument names to move into the yy name space: there is
1034 user code here.
1035
10362002-06-19 Akim Demaille <akim@epita.fr>
1037
1038 * data/bison.simple (b4_pure_if): New.
1039 Use it instead of #ifdef YYPURE.
1040
10412002-06-19 Akim Demaille <akim@epita.fr>
1042
1043 * data/bison.simple (b4_location_if): New.
1044 Use it instead of #ifdef YYLSP_NEEDED.
1045
10462002-06-19 Akim Demaille <akim@epita.fr>
1047
1048 Prepare @$ in %destructor, but currently don't bind it in the
1049 skeleton, as %location use is not cleaned up yet.
1050
1051 * src/scan-gram.l (handle_dollar, handle_destructor_at)
1052 (handle_action_at): New.
1053 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
1054 a braced_code_t and a location as additional arguments.
1055 (handle_destructor_dollar): Instead of requiring `b4_eval', just
1056 unquote one when outputting `b4_dollar_dollar'.
1057 Adjust callers.
1058 * data/bison.simple (b4_eval): Remove.
1059 (b4_symbol_destructor): Adjust.
1060 * tests/input.at (Invalid @n): Adjust.
1061
10622002-06-19 Zack Weinberg <zack@codesourcery.com>
1063
1064 * doc/bison.texinfo: Document ability to have multiple
1065 prologue sections.
1066
10672002-06-18 Akim Demaille <akim@epita.fr>
1068
1069 * src/files.c (compute_base_names): When computing the output file
1070 names from the input file name, strip the directory part.
1071
10722002-06-18 Akim Demaille <akim@epita.fr>
1073
1074 * data/bison.simple.new: Comment changes.
1075 Reported by Andreas Schwab.
1076
10772002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
1078
1079 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
1080 there are no `label `yyoverflowlab' defined but not used' warnings
1081 when yyoverflow is defined.
1082
10832002-06-18 Akim Demaille <akim@epita.fr>
1084
1085 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
1086 new member.
1087 (symbol_destructor_set): Adjust.
1088 * src/output.c (symbol_destructors_output): Output the destructor
1089 locations.
1090 Output the symbol name.
1091 * data/bison.simple (b4_symbol_destructor): Adjust.
1092
10932002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
1094 and Akim Demaille <akim@epita.fr>
1095
1096 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
1097 what's left on the stack when the error recovery hits EOF.
1098 * tests/actions.at (Destructors): Complete to exercise this case.
1099
11002002-06-17 Akim Demaille <akim@epita.fr>
1101
1102 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
1103 arguments is really empty, not only equal to `[]'.
1104 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
1105 member.
1106 (symbol_destructor_set): New.
1107 * src/output.c (symbol_destructors_output): New.
1108 * src/reader.h (brace_code_t, current_braced_code): New.
1109 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
1110 (handle_dollar): Rename as...
1111 (handle_action_dollar): this.
1112 (handle_destructor_dollar): New.
1113 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
1114 (grammar_declaration): Use it.
1115 * data/bison.simple (yystos): Is always defined.
1116 (yydestructor): New.
1117 * tests/actions.at (Destructors): New.
1118 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
1119
11202002-06-17 Akim Demaille <akim@epita.fr>
1121
1122 * src/symlist.h, src/symlist.c (symbol_list_length): New.
1123 * src/scan-gram.l (handle_dollar, handle_at): Compute the
1124 rule_length only when needed.
1125 * src/output.c (actions_output, token_definitions_output): Output
1126 the full M4 block.
1127 * src/symtab.c: Don't access directly to the symbol tag, use
1128 symbol_tag_get.
1129 * src/parse-gram.y: Use symbol_list_free.
1130
11312002-06-17 Akim Demaille <akim@epita.fr>
1132
1133 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
1134 (symbol_list_prepend, get_type_name): Move to...
1135 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
1136 (symbol_list_prepend, symbol_list_n_type_name_get): here.
1137 Adjust all callers.
1138 (symbol_list_free): New.
1139 * src/scan-gram.l (handle_dollar): Takes a location.
1140 * tests/input.at (Invalid $n): Adjust.
1141
11422002-06-17 Akim Demaille <akim@epita.fr>
1143
1144 * src/reader.h, src/reader.c (symbol_list_new): Export it.
1145 (symbol_list_prepend): New.
1146 * src/parse-gram.y (%union): `list' is a new member.
1147 (symbols.1): New, replaces...
1148 (terms_to_prec.1, nterms_to_type.1): these.
1149 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
1150 Take a location as additional argument.
1151 Adjust all callers.
1152
11532002-06-15 Akim Demaille <akim@epita.fr>
1154
1155 * src/parse-gram.y: Move %token in the declaration section so that
1156 we don't depend upon CVS Bison.
1157
11582002-06-15 Akim Demaille <akim@epita.fr>
1159
1160 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
1161 * src/print.c (print_core): Use it.
1162
11632002-06-15 Akim Demaille <akim@epita.fr>
1164
1165 * src/conflicts.c (log_resolution): Accept the rule involved in
1166 the sr conflicts instead of the lookahead number that points to
1167 that rule.
1168 (flush_reduce): Accept the current lookahead vector as argument,
1169 instead of the index in LA.
1170 (resolve_sr_conflict): Accept the current number of lookahead
1171 bitset to consider for the STATE, instead of the index in LA.
1172 (set_conflicts): Adjust.
1173 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
1174
11752002-06-15 Akim Demaille <akim@epita.fr>
1176
1177 * src/state.h (state_t): Replace the `lookaheadsp' member, a
1178 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
1179 Adjust all dependencies.
1180 * src/lalr.c (initialize_lookaheads): Split into...
1181 (states_lookaheads_count, states_lookaheads_initialize): these.
1182 (lalr): Adjust.
1183
11842002-06-15 Akim Demaille <akim@epita.fr>
1185
1186 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
1187 out of...
1188 (grammar_rules_print): here.
1189 * src/reduce.c (reduce_output): Use it.
1190 * tests/reduce.at (Useless Rules, Reduced Automaton)
1191 (Underivable Rules): Adjust.
1192
11932002-06-15 Akim Demaille <akim@epita.fr>
1194
1195 Copy BYacc's nice way to report the grammar.
1196
1197 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
1198 New.
1199 Don't print the rules' location, it is confusing and useless.
1200 (rule_print): Use grammar_rhs_print.
1201 * src/print.c (print_grammar): Use grammar_rules_print.
1202
12032002-06-15 Akim Demaille <akim@epita.fr>
1204
1205 Complete and rationalize `useless thing' warnings.
1206
1207 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
1208 (symbol_tag_print): New.
1209 Use them everywhere in place of accessing directly the tag member.
1210 * src/gram.h, src/gram.c (rule_print): New.
1211 Use it where a rule used to be printed `by hand'.
1212 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
1213 (reduce_grammar_tables): Report the useless rules.
1214 (reduce_print): Useless things are a warning, not an error.
1215 Report it as such.
1216 * tests/reduce.at (Useless Nonterminals, Useless Rules):
1217 (Reduced Automaton, Underivable Rules): Adjust.
1218 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
1219 * tests/conflicts.at (Unresolved SR Conflicts)
1220 (Solved SR Conflicts): Adjust.
1221
12222002-06-15 Akim Demaille <akim@epita.fr>
1223
1224 Let symbols have a location.
1225
1226 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
1227 (getsym): Adjust.
1228 Adjust all callers.
1229 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
1230 Use location_t, not int.
1231 * src/symtab.c (symbol_check_defined): Take advantage of the
1232 location.
1233 * tests/regression.at (Invalid inputs): Adjust.
1234
12352002-06-15 Akim Demaille <akim@epita.fr>
1236
1237 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
1238 (input): Don't try to initialize yylloc here, do it in the
1239 scanner.
1240 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
1241 * src/gram.h (rule_t): Change line and action_line into location
1242 and action_location, of location_t type.
1243 Adjust all dependencies.
1244 * src/location.h, src/location.c (empty_location): New.
1245 * src/reader.h, src/reader.c (grammar_start_symbol_set)
1246 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
1247 (grammar_current_rule_symbol_append)
1248 (grammar_current_rule_action_append): Expect a location as argument.
1249 * src/reader.c (grammar_midrule_action): Adjust to attach an
1250 action's location as dummy symbol location.
1251 * src/symtab.h, src/symtab.c (startsymbol_location): New.
1252 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
1253 the line numbers.
1254
12552002-06-14 Akim Demaille <akim@epita.fr>
1256
1257 Grammar declarations may be found in the grammar section.
1258
1259 * src/parse-gram.y (rules_or_grammar_declaration): New.
1260 (declarations): Each declaration may end with a semicolon, not
1261 just...
1262 (grammar_declaration): `"%union"'.
1263 (grammar): Branch to rules_or_grammar_declaration.
1264
12652002-06-14 Akim Demaille <akim@epita.fr>
1266
1267 * src/main.c (main): Invoke scanner_free.
1268
12692002-06-14 Akim Demaille <akim@epita.fr>
1270
1271 * src/output.c (m4_invoke): Extracted from...
1272 (output_skeleton): here.
1273 Free tempfile.
1274
12752002-06-14 Akim Demaille <akim@epita.fr>
1276
1277 * src/parse-gram.y (directives, directive, gram)
1278 (grammar_directives, precedence_directives, precedence_directive):
1279 Rename as...
1280 (declarations, declaration, grammar, grammar_declaration)
1281 (precedence_declaration, precedence_declarator): these.
1282 (symbol_declaration): New.
1283
12842002-06-14 Akim Demaille <akim@epita.fr>
1285
1286 * src/files.c (action_obstack): Remove, unused.
1287 (output_obstack): Remove it, and all its dependencies, as it is no
1288 longer needed.
1289 * src/reader.c (epilogue_set): Build the epilogue in the
1290 muscle_obstack.
1291 * src/output.h, src/output.c (muscle_obstack): Move to...
1292 * src/muscle_tab.h, src/muscle_tab.h: here.
1293 (muscle_init): Initialize muscle_obstack.
1294 (muscle_free): New.
1295 * src/main.c (main): Call it.
1296
12972002-06-14 Akim Demaille <akim@epita.fr>
1298
1299 * src/location.h: New, extracted from...
1300 * src/reader.h: here.
1301 * src/Makefile.am (noinst_HEADERS): Merge into
1302 (bison_SOURCES): this.
1303 Add location.h.
1304 * src/parse-gram.y: Use location_t instead of Bison's.
1305 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
1306 Use location_t instead of ints.
1307
13082002-06-14 Akim Demaille <akim@epita.fr>
1309
1310 * data/bison.simple, data/bison.c++: Be sure to restore the
1311 current #line when returning to the skeleton contents after having
1312 exposed the input file's #line.
1313
13142002-06-12 Akim Demaille <akim@epita.fr>
1315
1316 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
1317 eager.
1318 * tests/actions.at (Exotic Dollars): New.
1319
13202002-06-12 Akim Demaille <akim@epita.fr>
1321
1322 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
1323 ['"/] too eagerly.
1324 * tests/input.at (Torturing the Scanner): New.
1325
13262002-06-11 Akim Demaille <akim@epita.fr>
1327
1328 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
1329 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
1330 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
1331 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
1332 * src/reader.c (reader): Use it.
1333
13342002-06-11 Akim Demaille <akim@epita.fr>
1335
1336 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
1337 Adjust all callers.
1338 (scanner_last_string_free): New.
1339
13402002-06-11 Akim Demaille <akim@epita.fr>
1341
1342 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
1343 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
1344 (last_string, YY_OBS_FREE): New.
1345 Use them when returning an ID.
1346
13472002-06-11 Akim Demaille <akim@epita.fr>
1348
1349 Have Bison grammars parsed by a Bison grammar.
1350
1351 * src/reader.c, src/reader.h (prologue_augment): New.
1352 * src/reader.c (copy_definition): Remove.
1353
1354 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
1355 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
1356 (grammar_current_rule_prec_set, grammar_current_rule_check)
1357 (grammar_current_rule_symbol_append)
1358 (grammar_current_rule_action_append): Export.
1359 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
1360 (symbol_list_action_append): Remove.
1361 Hook the routines from reader.
1362 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
1363 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
1364
1365 * src/reader.c (read_declarations): Remove, unused.
1366
1367 * src/parse-gram.y: Handle the epilogue.
1368 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
1369 (grammar_start_symbol_set): this.
1370 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
1371 * src/reader.c (readgram): Remove, unused.
1372 (reader): Adjust to insert eoftoken and axiom where appropriate.
1373
1374 * src/reader.c (copy_dollar): Replace with...
1375 * src/scan-gram.h (handle_dollar): this.
1376 * src/parse-gram.y: Remove `%thong'.
1377
1378 * src/reader.c (copy_at): Replace with...
1379 * src/scan-gram.h (handle_at): this.
1380
1381 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
1382 New.
1383
1384 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
1385 time being.
1386
1387 * src/reader.h, src/reader.c (grammar_rule_end): New.
1388
1389 * src/parse.y (current_type, current_class): New.
1390 Implement `%nterm', `%token' support.
1391 Merge `%term' into `%token'.
1392 (string_as_id): New.
1393 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
1394 type name.
1395
1396 * src/parse-gram.y: Be sure to handle properly the beginning of
1397 rules.
1398
1399 * src/parse-gram.y: Handle %type.
1400 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
1401
1402 * src/parse-gram.y: More directives support.
1403 * src/options.c: No longer handle source directives.
1404
1405 * src/parse-gram.y: Fix %output.
1406
1407 * src/parse-gram.y: Handle %union.
1408 Use the prologue locations.
1409 * src/reader.c (parse_union_decl): Remove.
1410
1411 * src/reader.h, src/reader.c (epilogue_set): New.
1412 * src/parse-gram.y: Use it.
1413
1414 * data/bison.simple, data/bison.c++: b4_stype is now either not
1415 defined, then default to int, or to the contents of %union,
1416 without `union' itself.
1417 Adjust.
1418 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
1419
1420 * src/output.c (actions_output): Don't output braces, as they are
1421 already handled by the scanner.
1422
1423 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
1424 characters to themselves.
1425
1426 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
1427 that the epilogue has a proper #line.
1428
1429 * src/parse-gram.y: Handle precedence/associativity.
1430
1431 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
1432 a terminal.
1433 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
1434 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
1435 at all to define terminals that cannot be emitted.
1436
1437 * src/scan-gram.l: Escape M4 characters.
1438
1439 * src/scan-gram.l: Working properly with escapes in user
1440 strings/characters.
1441
1442 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
1443 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
1444 grammar.
1445 Use more modest sizes, as for the time being the parser does not
1446 release memory, and therefore the process swallows a huge amount
1447 of memory.
1448
1449 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
1450 stricter %token grammar.
1451
1452 * src/symtab.h (associativity): Add `undef_assoc'.
1453 (symbol_precedence_set): Do nothing when passed an undef_assoc.
1454 * src/symtab.c (symbol_check_alias_consistence): Adjust.
1455
1456 * tests/regression.at (Invalid %directive): Remove, as it is now
1457 meaningless.
1458 (Invalid inputs): Adjust to the new error messages.
1459 (Token definitions): The new grammar doesn't allow too many
1460 eccentricities.
1461
1462 * src/lex.h, src/lex.c: Remove.
1463 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
1464 (copy_character, copy_string2, copy_string, copy_identifier)
1465 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
1466 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
1467 (parse_action): Remove.
1468 * po/POTFILES.in: Adjust.
1469
14702002-06-11 Akim Demaille <akim@epita.fr>
1471
1472 * src/reader.c (parse_action): Don't store directly into the
1473 rule's action member: return the action as a string.
1474 Don't require `rule_length' as an argument: compute it.
1475 (grammar_current_rule_symbol_append)
1476 (grammar_current_rule_action_append): New, eved out from
1477 (readgram): here.
1478 Remove `action_flag', `rulelength', unused now.
1479
14802002-06-11 Akim Demaille <akim@epita.fr>
1481
1482 * src/reader.c (grammar_current_rule_prec_set).
1483 (grammar_current_rule_check): New, eved out from...
1484 (readgram): here.
1485 Remove `xaction', `first_rhs': useless.
1486 * tests/input.at (Type clashes): New.
1487 * tests/existing.at (GNU Cim Grammar): Adjust.
1488
14892002-06-11 Akim Demaille <akim@epita.fr>
1490
1491 * src/reader.c (grammar_midrule_action): New, Eved out from
1492 (readgram): here.
1493
14942002-06-11 Akim Demaille <akim@epita.fr>
1495
1496 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1497 New.
1498 (readgram): Use them as replacement of inlined code, crule and
1499 crule1.
1500
15012002-06-11 Akim Demaille <akim@epita.fr>
1502
1503 * src/reader.c (grammar_end, grammar_symbol_append): New.
1504 (readgram): Use them.
1505 Make the use of `p' as local as possible.
1506
15072002-06-10 Akim Demaille <akim@epita.fr>
1508
1509 GCJ's parser requires the tokens to be defined before the prologue.
1510
1511 * data/bison.simple: Output the token definition before the user's
1512 prologue.
1513 * tests/regression.at (Braces parsing, Duplicate string)
1514 (Mixing %token styles): Check the output from bison.
1515 (Early token definitions): New.
1516
15172002-06-10 Akim Demaille <akim@epita.fr>
1518
1519 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1520 assigning twice the same user number to a token, so that we can
1521 use it in...
1522 * src/lex.c (lex): here.
1523 Also use `symbol_class_set' instead of hand written code.
1524 * src/reader.c (parse_assoc_decl): Likewise.
1525
15262002-06-10 Akim Demaille <akim@epita.fr>
1527
1528 * src/symtab.c, src/symtab.c (symbol_class_set)
1529 (symbol_user_token_number_set): New.
1530 * src/reader.c (parse_token_decl): Use them.
1531 Use a switch instead of ifs.
1532 Use a single argument.
1533
15342002-06-10 Akim Demaille <akim@epita.fr>
1535
1536 Remove `%thong' support as it is undocumented, unused, duplicates
1537 `%token's job, and creates useless e-mail traffic with people who
1538 want to know what it is, why it is undocumented, unused, and
1539 duplicates `%token's job.
1540
1541 * src/reader.c (parse_thong_decl): Remove.
1542 * src/options.c (option_table): Remove "thong".
1543 * src/lex.h (tok_thong): Remove.
1544
15452002-06-10 Akim Demaille <akim@epita.fr>
1546
1547 * src/symtab.c, src/symtab.c (symbol_type_set)
1548 (symbol_precedence_set): New.
1549 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1550 (value_components_used): Remove, unused.
1551
15522002-06-09 Akim Demaille <akim@epita.fr>
1553
1554 Move symbols handling code out of the reader.
1555
1556 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1557 (axiom): Move to...
1558 * src/symtab.h, src/symtab.c: here.
1559
1560 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1561 * src/reader.c (startval): Rename as...
1562 * src/symtab.h, src/symtab.c (startsymbol): this.
1563 * src/reader.c: Adjust.
1564
1565 * src/reader.c (symbol_check_defined, symbol_make_alias)
1566 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1567 (token_translations_init)
1568 Move to...
1569 * src/symtab.c: here.
1570 * src/reader.c (packsymbols): Move to...
1571 * src/symtab.h, src/symtab.c (symbols_pack): here.
1572 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1573 argument.
1574
15752002-06-03 Akim Demaille <akim@epita.fr>
1576
1577 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1578 then statements.
1579
15802002-06-03 Akim Demaille <akim@epita.fr>
1581
1582 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1583 structs with non literals.
1584 * src/scan-skel.l: never-interactive.
1585 * src/conflicts.c (enum conflict_resolution_e): No trailing
1586 comma.
1587 * src/getargs.c (usage): Split long literal strings.
1588 Reported by Hans Aberg.
1589
15902002-05-28 Akim Demaille <akim@epita.fr>
1591
1592 * data/bison.c++: Use C++ ostreams.
1593 (cdebug_): New member.
1594
15952002-05-28 Akim Demaille <akim@epita.fr>
1596
1597 * src/output.c (output_skeleton): Be sure to allocate enough room
1598 for `/' _and_ for `\0' in full_skeleton.
1599
16002002-05-28 Akim Demaille <akim@epita.fr>
1601
1602 * data/bison.c++: Catch up with bison.simple:
1603 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1604 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1605 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1606 and popping traces.
1607
16082002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1609
1610 * src/output.c (output_skeleton): Put an explicit path in front of
1611 the skeleton file name, rather than relying on the -I directory,
1612 to partially alleviate effects of having a skeleton file lying around
1613 in the current directory.
1614
16152002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1616
1617 * src/conflicts.c (log_resolution): Correct typo:
1618 obstack_printf should be obstack_fgrow1.
1619
16202002-05-26 Akim Demaille <akim@epita.fr>
1621
1622 * src/state.h (state_t): `solved_conflicts' is a new member.
1623 * src/LR0.c (new_state): Set it to 0.
1624 * src/conflicts.h, src/conflicts.c (print_conflicts)
1625 (free_conflicts, solve_conflicts): Rename as...
1626 (conflicts_print, conflicts_free, conflicts_solve): these.
1627 Adjust callers.
1628 * src/conflicts.c (enum conflict_resolution_e)
1629 (solved_conflicts_obstack): New, used by...
1630 (log_resolution): this.
1631 Adjust to attach the conflict resolution to each state.
1632 Complete the description with the precedence/associativity
1633 information.
1634 (resolve_sr_conflict): Adjust.
1635 * src/print.c (print_state): Output its solved_conflicts.
1636 * tests/conflicts.at (Unresolved SR Conflicts)
1637 (Solved SR Conflicts): Exercise --report=all.
1638
16392002-05-26 Akim Demaille <akim@epita.fr>
1640
1641 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1642 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1643 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1644 (token_number_t, item_number_as_token_number)
1645 (token_number_as_item_number, muscle_insert_token_number_table):
1646 Rename as...
1647 (symbol_number_t, item_number_as_symbol_number)
1648 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1649 these, since it is more appropriate.
1650
16512002-05-26 Akim Demaille <akim@epita.fr>
1652
1653 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1654 `Error:' lines.
1655 * data/bison.simple (yystos) [YYDEBUG]: New.
1656 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1657 error recovery.
1658 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1659
16602002-05-25 Akim Demaille <akim@epita.fr>
1661
1662 * doc/bison.texinfo (Debugging): Split into...
1663 (Tracing): this new section, its former contents, and...
1664 (Understanding): this new section.
1665 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1666 by...
1667 (report_flag): this.
1668 Adjust all dependencies.
1669 (report_args, report_types, report_argmatch): New.
1670 (usage, getargs): Report/support -r, --report.
1671 * src/options.h
1672 (struct option_table_struct): Rename as..,
1673 (struct option_table_s): this.
1674 Rename the `set_flag' member to `flag' to match with getopt_long's
1675 struct.
1676 * src/options.c (option_table): Split verbose into an entry for
1677 %verbose, and another for --verbose.
1678 Support --report/-r, so remove -r from the obsolete --raw.
1679 * src/print.c: Attach full item sets and lookaheads reports to
1680 report_flag instead of trace_flag.
1681 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1682
16832002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1684 and Paul Eggert <eggert@twinsun.com>
1685
1686 * data/bison.simple (yyparse): Correct error handling to conform to
1687 POSIX and yacc. Specifically, after syntax error is discovered,
1688 do not reduce further before shifting the error token.
1689 Clean up the code a bit by removing the labels yyerrdefault,
1690 yyerrhandle, yyerrpop.
1691 * NEWS: Document the above.
1692
16932002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1694
1695 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1696 type; it isn't always big enough, since it doesn't necessarily
1697 include non-terminals.
1698 (yytranslate): Expand definition of yy_token_number_type, so that
1699 the latter can be removed.
1700 (yy_token_number_type): Remove, only one use.
1701 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1702 don't use TokenNumberType as element type.
1703
1704 * tests/regression.at: Modify expected output to agree with change
1705 to yyr1 and yytranslate.
1706
17072002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1708
1709 * src/reader.c (parse_action): Use copy_character instead of
1710 obstack_1grow.
1711
17122002-05-13 Akim Demaille <akim@epita.fr>
1713
1714 * tests/regression.at (Token definitions): Prototype yylex and
1715 yyerror.
1716
17172002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1718
1719 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
1720 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1721 32-bit arithmetic.
1722 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1723
17242002-05-07 Akim Demaille <akim@epita.fr>
1725
1726 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1727 avoid GCC warnings.
1728
17292002-05-07 Akim Demaille <akim@epita.fr>
1730
1731 Kill GCC warnings.
1732
1733 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1734 over the RHS of each rule.
1735 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1736 * src/state.h (state_t): Member `nitems' is unsigned short.
1737 * src/LR0.c (get_state): Adjust.
1738 * src/reader.c (packgram): Likewise.
1739 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1740 `Type'.
1741 (muscle_insert_int_table): Remove, unused.
1742 (prepare_rules): Remove `max'.
1743
17442002-05-06 Akim Demaille <akim@epita.fr>
1745
1746 * src/closure.c (print_firsts): Display of the symbol tags.
1747 (bitmatrix_print): Move to...
1748 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1749 here.
1750 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1751
17522002-05-06 Akim Demaille <akim@epita.fr>
1753
1754 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1755 hash_do_for_each.
1756
17572002-05-06 Akim Demaille <akim@epita.fr>
1758
1759 * src/LR0.c (new_state, get_state): Instead of using the global
1760 `kernel_size' and `kernel_base', have two new arguments:
1761 `core_size' and `core'.
1762 Adjust callers.
1763
17642002-05-06 Akim Demaille <akim@epita.fr>
1765
1766 * src/reader.c (packgram): No longer end `ritem' with a 0
1767 sentinel: it is not used.
1768
17692002-05-05 Akim Demaille <akim@epita.fr>
1770
1771 New experimental feature: display the lookaheads in the report and
1772 graph.
1773
1774 * src/print (print_core): When --trace-flag, display the rules
1775 lookaheads.
1776 * src/print_graph.c (print_core): Likewise.
1777 Swap the arguments.
1778 Adjust caller.
1779
17802002-05-05 Akim Demaille <akim@epita.fr>
1781
1782 * tests/torture.at (Many lookaheads): New test.
1783
17842002-05-05 Akim Demaille <akim@epita.fr>
1785
1786 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1787 (GENERATE_MUSCLE_INSERT_TABLE): this.
1788 (output_int_table, output_unsigned_int_table, output_short_table)
1789 (output_token_number_table, output_item_number_table): Replace with...
1790 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1791 (muscle_insert_short_table, muscle_insert_token_number_table)
1792 (muscle_insert_item_number_table): these.
1793 Adjust all callers.
1794 (prepare_tokens): Don't free `translations', since...
1795 * src/reader.h, src/reader.c (grammar_free): do it.
1796 Move to...
1797 * src/gram.h, src/gram.c (grammar_free): here.
1798 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1799 b4_translate_max.
1800
18012002-05-05 Akim Demaille <akim@epita.fr>
1802
1803 * src/output.c (output_unsigned_int_table): New.
1804 (prepare_rules): `i' is unsigned.
1805 `prhs', `rline', `r2' are unsigned int.
1806 Rename muscle `rhs_number_max' as `rhs_max'.
1807 Output muscles `prhs_max', `rline_max', and `r2_max'.
1808 Free rline and r1.
1809 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1810 to compute types instead of constant types.
1811 * tests/regression.at (Web2c Actions): Adjust.
1812
18132002-05-04 Akim Demaille <akim@epita.fr>
1814
1815 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1816 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1817 Adjust dependencies.
1818 * src/output.c (token_definitions_output): Be sure not to output a
1819 `#define 'a'' when fed with `%token 'a' "a"'.
1820 * tests/regression.at (Token definitions): New.
1821
18222002-05-03 Paul Eggert <eggert@twinsun.com>
1823
1824 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1825 for K&R C.
1826
18272002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1828
1829 * Makefile.am (SUBDIRS): Remove intl.
1830 (EXTRA_DIST): Add config/config.rpath.
1831
18322002-05-03 Akim Demaille <akim@epita.fr>
1833
1834 * data/bison.simple (m4_if): Don't output empty enums.
1835 And actually, output valid enum definitions :(.
1836
18372002-05-03 Akim Demaille <akim@epita.fr>
1838
1839 * configure.bat: Remove, completely obsolete.
1840 * Makefile.am (EXTRA_DIST): Adjust.
1841 Don't distribute config.rpath...
1842 * config/Makefile.am (EXTRA_DIST): Do it.
1843
18442002-05-03 Akim Demaille <akim@epita.fr>
1845
1846 * configure.in (GETTEXT_VERSION): New.
1847 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1848
18492002-05-03 Akim Demaille <akim@epita.fr>
1850
1851 * data/bison.simple (b4_token_enum): New.
1852 (b4_token_defines): Use it to output tokens both as #define and
1853 enums.
1854 Suggested by Paul Eggert.
1855 * src/output.c (token_definitions_output): Don't output spurious
1856 white spaces.
1857
18582002-05-03 Akim Demaille <akim@epita.fr>
1859
1860 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1861
18622002-05-02 Robert Anisko <robert@lrde.epita.fr>
1863
1864 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1865 Update the stack class, give a try to deque as the default container.
1866
18672002-05-02 Akim Demaille <akim@epita.fr>
1868
1869 * data/bison.simple (yyparse): Do not implement @$ = @1.
1870 (YYLLOC_DEFAULT): Adjust to do it.
1871 * doc/bison.texinfo (Location Default Action): Fix.
1872
18732002-05-02 Akim Demaille <akim@epita.fr>
1874
1875 * src/reader.c (parse_braces): Merge into...
1876 (parse_action): this.
1877
18782002-05-02 Akim Demaille <akim@epita.fr>
1879
1880 * configure.in (ALL_LINGUAS): Remove.
1881 * po/LINGUAS, hr.po: New.
1882
18832002-05-02 Akim Demaille <akim@epita.fr>
1884
1885 Remove the so called hairy (semantic) parsers.
1886
1887 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1888 * src/gram.h, src/gram.c (semantic_parser): Remove.
1889 (rule_t): Remove the guard and guard_line members.
1890 * src/lex.h (token_t): remove tok_guard.
1891 * src/options.c (option_table): Remove %guard and %semantic_parser
1892 support.
1893 * src/output.c, src/output.h (guards_output): Remove.
1894 (prepare): Adjust.
1895 (token_definitions_output): Don't output the `T'
1896 tokens (???).
1897 (output_skeleton): Don't output the guards.
1898 * src/files.c, src/files.c (attrsfile): Remove.
1899 * src/reader.c (symbol_list): Remove the guard and guard_line
1900 members.
1901 Adjust dependencies.
1902 (parse_guard): Remove.
1903 * data/bison.hairy: Remove.
1904 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1905 BISON_HAIRY.
1906
19072002-05-02 Akim Demaille <akim@epita.fr>
1908
1909 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1910 (parse_guard): Rename the formal argument `stack_offset' as
1911 `rule_length', which is more readable.
1912 Adjust callers.
1913 (copy_at, copy_dollar): Instead of outputting the hard coded
1914 values of $$, $n and so forth, output invocation to b4_lhs_value,
1915 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
1916 Note: this patch partially drops `semantic-parser' support: it
1917 always does `rule_length - n', where semantic parsers ought to
1918 always use `-n'.
1919 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1920 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1921
19222002-05-02 Akim Demaille <akim@epita.fr>
1923
1924 * configure.in (AC_INIT): Bump to 1.49b.
1925 (AM_INIT_AUTOMAKE): Short invocation.
1926
19272002-05-02 Akim Demaille <akim@epita.fr>
1928
1929 Version 1.49a.
1930
19312002-05-01 Akim Demaille <akim@epita.fr>
1932
1933 * src/skeleton.h: Remove.
1934
19352002-05-01 Akim Demaille <akim@epita.fr>
1936
1937 * src/skeleton.h: Fix the #endif.
1938 Reported by Magnus Fromreide.
1939
19402002-04-26 Paul Eggert <eggert@twinsun.com>
1941
1942 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1943 Define if we define YYSTYPE and YYLTYPE, respectively.
1944 (YYCOPY): Fix [] quoting problem in the non-GCC case.
1945
19462002-04-25 Robert Anisko <robert@lrde.epita.fr>
1947
1948 * src/scan-skel.l: Postprocess quadrigraphs.
1949
1950 * src/reader.c (copy_character): New function, used to output
1951 single characters while replacing `[' and `]' with quadrigraphs, to
1952 avoid troubles with M4 quotes.
1953 (copy_comment): Output characters with copy_character.
1954 (read_additionnal_code): Likewise.
1955 (copy_string2): Likewise.
1956 (copy_definition): Likewise.
1957
1958 * tests/calc.at: Exercise M4 quoting.
1959
19602002-04-25 Akim Demaille <akim@epita.fr>
1961
1962 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1963 between `!' and the command.
1964 Reported by Paul Eggert.
1965
19662002-04-24 Robert Anisko <robert@lrde.epita.fr>
1967
1968 * tests/calc.at: Exercise prologue splitting.
1969
1970 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1971 `b4_post_prologue' instead of `b4_prologue'.
1972
1973 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1974 muscles.
1975 (output): Free pre_prologue_obstack and post_prologue_obstack.
1976 * src/files.h, src/files.c (attrs_obstack): Remove.
1977 (pre_prologue_obstack, post_prologue_obstack): New.
1978 * src/reader.c (copy_definition): Add a parameter to specify the
1979 obstack to fill, instead of using attrs_obstack unconditionally.
1980 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1981 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1982
19832002-04-23 Paul Eggert <eggert@twinsun.com>
1984
1985 * data/bison.simple: Remove unnecessary commentary and white
1986 space differences from 1_29-branch.
1987 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1988
1989 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1990 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1991 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1992 constructors or destructors.
1993
1994 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1995
19962002-04-23 Akim Demaille <akim@epita.fr>
1997
1998 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1999 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
2000 location with columns.
2001 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
2002 All reported by Paul Eggert.
2003
20042002-04-22 Akim Demaille <akim@epita.fr>
2005
2006 * src/reduce.c (dump_grammar): Move to...
2007 * src/gram.h, src/gram.c (grammar_dump): here.
2008 Be sure to separate long item numbers.
2009 Don't read the members of a rule's prec if its nil.
2010
20112002-04-22 Akim Demaille <akim@epita.fr>
2012
2013 * src/output.c (table_size, table_grow): New.
2014 (MAXTABLE): Remove, replace uses with table_size.
2015 (pack_vector): Instead of dying when the table is too big, grow it.
2016
20172002-04-22 Akim Demaille <akim@epita.fr>
2018
2019 * data/bison.simple (yyr1): Its type is that of a token number.
2020 * data/bison.c++ (r1_): Likewise.
2021 * tests/regression.at (Web2c Actions): Adjust.
2022
20232002-04-22 Akim Demaille <akim@epita.fr>
2024
2025 * src/reader.c (token_translations_init): 256 is now the default
2026 value for the error token, i.e., it will be assigned another
2027 number if the user assigned 256 to one of her tokens.
2028 (reader): Don't force 256 to error.
2029 * doc/bison.texinfo (Symbols): Adjust.
2030 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
2031 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
2032 etc. instead of 10, 20, 30 (which was used to `jump' over error
2033 (256) and undefined (2)).
2034
20352002-04-22 Akim Demaille <akim@epita.fr>
2036
2037 Propagate more token_number_t.
2038
2039 * src/gram.h (token_number_as_item_number)
2040 (item_number_as_token_number): New.
2041 * src/output.c (GENERATE_OUTPUT_TABLE): New.
2042 Use it to create output_item_number_table and
2043 output_token_number_table.
2044 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2045 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
2046 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
2047 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
2048
20492002-04-22 Akim Demaille <akim@epita.fr>
2050
2051 * src/output.h, src/output.c (get_lines_number): Remove.
2052
20532002-04-19 Akim Demaille <akim@epita.fr>
2054
2055 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
2056 as Lex/Flex'.
2057 (Debugging): More details about enabling the debugging features.
2058 (Table of Symbols): Describe $$, $n, @$, and @n.
2059 Suggested by Tim Josling.
2060
20612002-04-19 Akim Demaille <akim@epita.fr>
2062
2063 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
2064
20652002-04-10 Akim Demaille <akim@epita.fr>
2066
2067 * src/system.h: Rely on HAVE_LIMITS_H.
2068 Suggested by Paul Eggert.
2069
20702002-04-09 Akim Demaille <akim@epita.fr>
2071
2072 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
2073 full stderr, and strip it according to the bison options, instead
2074 of composing the error message from different bits.
2075 This makes it easier to check for several error messages.
2076 Adjust all the invocations.
2077 Add an invocation exercising the error token.
2078 Add an invocation demonstrating a stupid error message.
2079 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
2080 Adjust the tests.
2081 Error message are for stderr, not stdout.
2082
20832002-04-09 Akim Demaille <akim@epita.fr>
2084
2085 * src/gram.h, src/gram.c (error_token_number): Remove, use
2086 errtoken->number.
2087 * src/reader.c (reader): Don't specify the user token number (2)
2088 for $undefined, as it uselessly prevents using it.
2089 * src/gram.h (token_number_t): Move to...
2090 * src/symtab.h: here.
2091 (state_t.number): Is a token_number_t.
2092 * src/print.c, src/reader.c: Use undeftoken->number instead of
2093 hard coded 2.
2094 (Even though this 2 is not the same as above: the number of the
2095 undeftoken remains being 2, it is its user token number which
2096 might not be 2).
2097 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
2098 `user_token_number_max'.
2099 Output `undef_token_number'.
2100 * data/bison.simple, data/bison.c++: Use them.
2101 Be sure to map invalid yylex return values to
2102 `undef_token_number'. This saves us from gratuitous SEGV.
2103
2104 * tests/conflicts.at (Solved SR Conflicts)
2105 (Unresolved SR Conflicts): Adjust.
2106 * tests/regression.at (Web2c Actions): Adjust.
2107
21082002-04-08 Akim Demaille <akim@epita.fr>
2109
2110 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
2111 Adding #line.
2112 Remove the duplicate `typedefs'.
2113 (RhsNumberType): Fix the declaration and various other typos.
2114 Use __ofile__.
2115 * data/bison.simple: Use __ofile__.
2116 * src/scan-skel.l: Handle __ofile__.
2117
21182002-04-08 Akim Demaille <akim@epita.fr>
2119
2120 * src/gram.h (item_number_t): New, the type of item numbers in
2121 RITEM. Note that it must be able to code symbol numbers as
2122 positive number, and the negation of rule numbers as negative
2123 numbers.
2124 Adjust all dependencies (pretty many).
2125 * src/reduce.c (rule): Remove this `short *' pointer: use
2126 item_number_t.
2127 * src/system.h (MINSHORT, MAXSHORT): Remove.
2128 Include `limits.h'.
2129 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
2130 (shortcpy): Remove.
2131 (MAXTABLE): Move to...
2132 * src/output.c (MAXTABLE): here.
2133 (prepare_rules): Use output_int_table to output rhs.
2134 * data/bison.simple, data/bison.c++: Adjust.
2135 * tests/torture.at (Big triangle): Move the limit from 254 to
2136 500.
2137 * tests/regression.at (Web2c Actions): Ajust.
2138
2139 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
2140 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
2141 passes, but produces negative #line number, once fixed, GCC is
2142 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
2143 C), it passes.
2144 * src/state.h (state_h): Code input lines on ints, not shorts.
2145
21462002-04-08 Akim Demaille <akim@epita.fr>
2147
2148 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
2149 and then the grammar.
2150
21512002-04-08 Akim Demaille <akim@epita.fr>
2152
2153 * src/system.h: No longer using strndup.
2154
21552002-04-07 Akim Demaille <akim@epita.fr>
2156
2157 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
2158 * src/output.c (output_table_data): Return the longest number.
2159 (prepare_tokens): Output `token_number_max').
2160 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
2161 New.
2162 Use them to define yy_token_number_type/TokenNumberType.
2163 Use this type for yytranslate.
2164 * tests/torture.at (Big triangle): Push the limit from 124 to
2165 253.
2166 * tests/regression.at (Web2c Actions): Adjust.
2167
21682002-04-07 Akim Demaille <akim@epita.fr>
2169
2170 * tests/torture.at (Big triangle): New.
2171 (GNU AWK Grammar, GNU Cim Grammar): Move to...
2172 * tests/existing.at: here.
2173
21742002-04-07 Akim Demaille <akim@epita.fr>
2175
2176 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
2177 nritems.
2178 Adjust dependencies.
2179
21802002-04-07 Akim Demaille <akim@epita.fr>
2181
2182 * src/reader.c: Normalize increments to prefix form.
2183
21842002-04-07 Akim Demaille <akim@epita.fr>
2185
2186 * src/reader.c, symtab.c: Remove debugging code.
2187
21882002-04-07 Akim Demaille <akim@epita.fr>
2189
2190 Rename all the `bucket's as `symbol_t'.
2191
2192 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
2193 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
2194 * src/symtab.c, src/symtab.h (bucket): Rename as...
2195 (symbol_t): this.
2196 (symbol_list_new, bucket_check_defined, bucket_make_alias)
2197 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
2198 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2199 (buckets_new, buckets_free, buckets_do): Rename as...
2200 (symbol_list_new, symbol_check_defined, symbol_make_alias)
2201 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2202 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
2203 (symbols_new, symbols_free, symbols_do): these.
2204
22052002-04-07 Akim Demaille <akim@epita.fr>
2206
2207 Use lib/hash for the symbol table.
2208
2209 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
2210 EOF.
2211 * src/lex.c (lex): Set the `number' member of new terminals.
2212 * src/reader.c (bucket_check_defined, bucket_make_alias)
2213 (bucket_check_alias_consistence, bucket_translation): New.
2214 (reader, grammar_free, readgram, token_translations_init)
2215 (packsymbols): Adjust.
2216 (reader): Number the predefined tokens.
2217 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
2218 for predefined tokens.
2219 * src/symtab.h (bucket): Remove all the hash table related
2220 members.
2221 * src/symtab.c (symtab): Replace by...
2222 (bucket_table): this.
2223 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2224 (buckets_new, buckets_do): New.
2225
22262002-04-07 Akim Demaille <akim@epita.fr>
2227
2228 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
2229 (start_symbol, max_user_token_number, semantic_parser)
2230 (error_token_number): Initialize.
2231 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
2232 Initialize.
2233 (reader): Don't.
2234 (errtoken, eoftoken, undeftoken, axiom): Extern.
2235
22362002-04-07 Akim Demaille <akim@epita.fr>
2237
2238 * src/gram.h (rule_s): prec and precsym are now pointers
2239 to the bucket giving the priority/associativity.
2240 Member `associativity' removed: useless.
2241 * src/reduce.c, src/conflicts.c: Adjust.
2242
22432002-04-07 Akim Demaille <akim@epita.fr>
2244
2245 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
2246 Properly escape the symbols' TAG when outputting them.
2247
22482002-04-07 Akim Demaille <akim@epita.fr>
2249
2250 * src/lalr.h (LA): Is a bitsetv, not bitset*.
2251
22522002-04-07 Akim Demaille <akim@epita.fr>
2253
2254 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
2255 (LArule): this, which is an array to rule_t*.
2256 * src/print.c, src/conflicts.c: Adjust.
2257
22582002-04-07 Akim Demaille <akim@epita.fr>
2259
2260 * src/gram.h (rule_t): Rename `number' as `user_number'.
2261 `number' is a new member.
2262 Adjust dependencies.
2263 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
2264
22652002-04-07 Akim Demaille <akim@epita.fr>
2266
2267 As a result of the previous patch, it is no longer needed
2268 to reorder ritem itself.
2269
2270 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
2271
22722002-04-07 Akim Demaille <akim@epita.fr>
2273
2274 Be sure never to walk through RITEMS, but use only data related to
2275 the rules themselves. RITEMS should be banished.
2276
2277 * src/output.c (output_token_translations): Rename as...
2278 (prepare_tokens): this.
2279 In addition to `translate', prepare the muscles `tname' and
2280 `toknum', which were handled by...
2281 (output_rule_data): this.
2282 Remove, and move the remainder of its outputs into...
2283 (prepare_rules): this new routines, which also merges content from
2284 (output_gram): this.
2285 (prepare_rules): Be sure never to walk through RITEMS.
2286 (output_stos): Rename as...
2287 (prepare_stos): this.
2288 (output): Always invoke prepare_states, after all, just don't use it
2289 in the output if you don't need it.
2290
22912002-04-07 Akim Demaille <akim@epita.fr>
2292
2293 * src/LR0.c (new_state): Display `nstates' as the name of the
2294 newly created state.
2295 Adjust to initialize first_state and last_state if needed.
2296 Be sure to distinguish the initial from the final state.
2297 (new_states): Create the itemset of the initial state, and use
2298 new_state.
2299 * src/closure.c (closure): Now that the initial state has its
2300 items properly set, there is no need for a special case when
2301 creating `ruleset'.
2302
2303 As a result, now the rule 0, reducing to $axiom, is visible in the
2304 outputs. Adjust the test suite.
2305
2306 * tests/conflicts.at (Solved SR Conflicts)
2307 (Unresolved SR Conflicts): Adjust.
2308 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
2309 * tests/conflicts.at (S/R in initial): New.
2310
23112002-04-07 Akim Demaille <akim@epita.fr>
2312
2313 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
2314 the RHS of the rules.
2315 * src/output.c (output_gram): Likewise.
2316
23172002-04-07 Akim Demaille <akim@epita.fr>
2318
2319 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
2320 bucket.
2321 Adjust all dependencies.
2322 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
2323 `number' of the buckets too.
2324 * src/gram.h: Include `symtab.h'.
2325 (associativity): Move to...
2326 * src/symtab.h: here.
2327 No longer include `gram.h'.
2328
23292002-04-07 Akim Demaille <akim@epita.fr>
2330
2331 * src/gram.h, src/gram.c (rules_rhs_length): New.
2332 (ritem_longest_rhs): Use it.
2333 * src/gram.h (rule_t): `number' is a new member.
2334 * src/reader.c (packgram): Set it.
2335 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
2336 the end of `rules', and count them out of `nrules'.
2337 (reduce_output, dump_grammar): Adjust.
2338 * src/print.c (print_grammar): It is no longer needed to check for
2339 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
2340 * tests/reduce.at (Reduced Automaton): New test.
2341
23422002-04-07 Akim Demaille <akim@epita.fr>
2343
2344 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
2345 lacking `+ 1' to nrules, Bison reported as useless a token if it
2346 was used solely to set the precedence of the last rule...
2347
23482002-04-07 Akim Demaille <akim@epita.fr>
2349
2350 * data/bison.c++, data/bison.simple: Don't output the current file
2351 name in #line, to avoid useless diffs between two identical
2352 outputs under different names.
2353
23542002-04-07 Akim Demaille <akim@epita.fr>
2355
2356 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
2357 Normalize loops to using `< nrules + 1', not `<= nrules'.
2358
23592002-04-07 Akim Demaille <akim@epita.fr>
2360
2361 * TODO: Update.
2362
23632002-04-07 Akim Demaille <akim@epita.fr>
2364
2365 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
2366 bucket.value as bucket.number.
2367
23682002-04-07 Akim Demaille <akim@epita.fr>
2369
2370 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
2371 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2372 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
2373 RHS, instead of being an index in RITEMS.
2374
23752002-04-04 Paul Eggert <eggert@twinsun.com>
2376
2377 * doc/bison.texinfo: Update copyright date.
2378 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
2379 (Symbols): Warn about running Bison in one character set,
2380 but compiling and/or running in an incompatible one.
2381 Warn about character code 256, too.
2382
23832002-04-03 Paul Eggert <eggert@twinsun.com>
2384
2385 * src/bison.data (YYSTACK_ALLOC): Depend on whether
2386 YYERROR_VERBOSE is nonzero, not whether it is defined.
2387
2388 Merge changes from bison-1_29-branch.
2389
23902002-03-20 Paul Eggert <eggert@twinsun.com>
2391
2392 Merge fixes from Debian bison_1.34-1.diff.
2393
2394 * configure.in (AC_PREREQ): 2.53.
2395
23962002-03-20 Akim Demaille <akim@epita.fr>
2397
2398 * src/conflicts.c (log_resolution): Argument `resolution' is const.
2399
24002002-03-19 Paul Eggert <eggert@twinsun.com>
2401
2402 * src/bison.simple (YYCOPY): New macro.
2403 (YYSTACK_RELOCATE): Use it.
2404 Remove Type arg; no longer needed. All callers changed.
2405 (yymemcpy): Remove; no longer needed.
2406
2407 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
2408 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2409
24102002-03-19 Akim Demaille <akim@epita.fr>
2411
2412 Test and fix the #line outputs.
2413
2414 * tests/atlocal.at (GCC): New.
2415 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
2416 (Prologue synch line, ,%union synch line, Postprologue synch line)
2417 (Action synch line, Epilogue synch line): New tests.
2418 * src/reader.c (parse_union_decl): Define the muscle stype_line.
2419 * data/bison.simple, data/bison.c++: Use it.
2420
24212002-03-19 Akim Demaille <akim@epita.fr>
2422
2423 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
2424 (Solved SR Conflicts, %expect not enough, %expect right)
2425 (%expect too much): Move to...
2426 * tests/conflicts.at: this new file.
2427
24282002-03-19 Akim Demaille <akim@epita.fr>
2429
2430 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2431 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
2432 that we can move to enums for instance.
2433 * src/output.c (token_definitions_output): Output a list of
2434 `token-name, token-number' instead of the #define.
2435 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
2436
24372002-03-14 Akim Demaille <akim@epita.fr>
2438
2439 Use Gettext 0.11.1.
2440
24412002-03-09 Robert Anisko <robert@lrde.epita.fr>
2442
2443 * data/bison.c++: Make the user able to add members to the generated
2444 parser by subclassing.
2445
24462002-03-05 Robert Anisko <robert@lrde.epita.fr>
2447
2448 * src/reader.c (read_additionnal_code): `c' should be an integer, not
2449 a character.
2450 Reported by Nicolas Tisserand and Nicolas Burrus.
2451
24522002-03-04 Robert Anisko <robert@lrde.epita.fr>
2453
2454 * src/reader.c: Warn about lacking semi-colons, do not complain.
2455
24562002-03-04 Robert Anisko <robert@lrde.epita.fr>
2457
2458 * data/bison.c++: Remove a debug line.
2459
24602002-03-04 Robert Anisko <robert@lrde.epita.fr>
2461
2462 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
2463 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
2464 provide a default implementation.
2465
24662002-03-04 Akim Demaille <akim@epita.fr>
2467
2468 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
2469 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
2470 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
2471 * tests/semantic.at (Parsing Guards): Similarly.
2472 * src/reader.at (readgram): Complain if the last rule is not ended
2473 with a semi-colon.
2474
24752002-03-04 Akim Demaille <akim@epita.fr>
2476
2477 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
2478 * src/closure.c: here.
2479 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
2480 RTC.
2481 * src/warshall.h, src/warshall.c: Remove.
2482 * tests/sets.at (Broken Closure): Adjust.
2483
24842002-03-04 Akim Demaille <akim@epita.fr>
2485
2486 * src/output.c (output_skeleton): tempdir is const.
2487 bytes_read is unused.
2488
24892002-03-04 Akim Demaille <akim@epita.fr>
2490
2491 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2492 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2493 Update.
2494 From Michael Hayes.
2495
24962002-03-04 Akim Demaille <akim@epita.fr>
2497
2498 * src/closure.c (closure): `r' is unused.
2499
25002002-03-04 Akim Demaille <akim@epita.fr>
2501
2502 * tests/sets.at (Broken Closure): Add the ending `;'.
2503 * src/reader.at (readgram): Complain if a rule is not ended with a
2504 semi-colon.
2505
25062002-03-04 Akim Demaille <akim@epita.fr>
2507
2508 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2509 (count_sr_conflicts): Use bitset_count.
2510 * src/reduce.c (inaccessable_symbols): Ditto.
2511 (bits_size): Remove.
2512 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2513
25142002-03-04 Akim Demaille <akim@epita.fr>
2515
2516 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2517 * src/reduce.c: Remove the `bitset_zero's following the
2518 `bitset_create's, as now it is performed by the latter.
2519
25202002-03-04 Akim Demaille <akim@epita.fr>
2521
2522 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2523 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2524 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2525 latest sources from Michael.
2526
25272002-03-04 Akim Demaille <akim@epita.fr>
2528
2529 * src/output.c (output): Don't free the grammar.
2530 * src/reader.c (grammar_free): New.
2531 * src/main.c (main): Call it and don't free symtab here.
2532
25332002-03-04 Akim Demaille <akim@epita.fr>
2534
2535 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2536 before returning.
2537 Reported by Benoit Perrot.
2538
25392002-03-04 Akim Demaille <akim@epita.fr>
2540
2541 Use bitset operations when possible, not loops over bits.
2542
2543 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2544 bitset_or.
2545 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2546 * src/reduce.c (useless_nonterminals): Formatting changes.
2547 * src/warshall.c (TC): Use bitset_or.
2548
25492002-03-04 Akim Demaille <akim@epita.fr>
2550
2551 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2552 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2553 Ditto.
2554
25552002-03-04 Akim Demaille <akim@epita.fr>
2556
2557 * src/lalr.c (F): Now a bitset*.
2558 Adjust all dependencies.
2559
25602002-03-04 Akim Demaille <akim@epita.fr>
2561
2562 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2563 Adjust all dependencies.
2564
25652002-03-04 Akim Demaille <akim@epita.fr>
2566
2567 * src/L0.c, src/LR0.h (nstates): Be size_t.
2568 Adjust comparisons (signed vs unsigned).
2569 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2570 bitset*.
2571 Adjust all dependencies.
2572
25732002-03-04 Akim Demaille <akim@epita.fr>
2574
2575 * src/closure.c (firsts): Now, also a bitset.
2576 Adjust all dependencies.
2577 (varsetsize): Remove, now unused.
2578 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2579
25802002-03-04 Akim Demaille <akim@epita.fr>
2581
2582 * src/print.c: Convert to use bitset.h, not hand coded iterations
2583 over ints.
2584
25852002-03-04 Akim Demaille <akim@epita.fr>
2586
2587 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2588
25892002-03-04 Akim Demaille <akim@epita.fr>
2590
2591 * src/closure.c (ruleset): Be a bitset.
2592 (rulesetsize): Remove.
2593
25942002-03-04 Akim Demaille <akim@epita.fr>
2595
2596 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2597 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2598 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2599 * src/closure.c (fderives): Be an array of bitsets.
2600
26012002-02-28 Robert Anisko <robert@lrde.epita.fr>
2602
2603 * data/bison.c++: Merge the two generated headers. Insert a copyright
2604 notice in each output file.
2605
26062002-02-28 Akim Demaille <akim@epita.fr>
2607
2608 * data/bison.c++: Copy the prologue of bison.simple to fetch
2609 useful M4 definitions, such as b4_header_guard.
2610
26112002-02-25 Akim Demaille <akim@epita.fr>
2612
2613 * src/getargs.c (version): Give the name of the authors, and use a
2614 translator friendly scheme for the bgr
2615 copyright notice.
2616
26172002-02-25 Akim Demaille <akim@epita.fr>
2618
2619 * src/output.c (header_output): Remove, now handled completely via
2620 M4.
2621
26222002-02-25 Akim Demaille <akim@epita.fr>
2623
2624 * m4/m4.m4: New, from CVS Autoconf.
2625 * configure.in: Invoke it.
2626 * src/output.c (output_skeleton): Use its result instead of the
2627 hard coded name.
2628
26292002-02-25 Akim Demaille <akim@epita.fr>
2630
2631 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2632 Fileutils 4.1.5.
2633 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2634 * src/output.c (output_skeleton): Use mkstemp to create a real
2635 temporary file.
2636 Move the filling of `skeleton' and its muscle to...
2637 (prepare): here.
2638 (output): Move the definition of the prologue muscle to...
2639 (prepare): here.
2640 * src/system.h (DEFAULT_TMPDIR): New.
2641
26422002-02-14 Paul Eggert <eggert@twinsun.com>
2643
2644 Remove the support for C++ namespace cleanliness; it was
2645 causing more problems than it was curing, since it didn't work
2646 properly on some nonstandard C++ compilers. This can wait
2647 for a proper C++ parser.
2648
2649 * NEWS: Document this.
2650 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2651 of C++, as it's treated like C now.
2652 * src/bison.simple (YYSTD): Remove.
2653 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2654 Treat C++ just like Standard C instead of trying to support
2655 namespace cleanliness.
2656
26572002-02-14 Akim Demaille <akim@epita.fr>
2658
2659 * tests/regression.at (else): Adjust to Andreas' change.
2660
26612002-02-14 Akim Demaille <akim@epita.fr>
2662
2663 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2664
26652002-02-13 Andreas Schwab <schwab@suse.de>
2666
2667 * src/output.c (output_rule_data): Don't output NULL, it might
2668 not be defined yet.
2669
26702002-02-11 Robert Anisko <robert@lrde.epita.fr>
2671
2672 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2673 (Copyright notice): Update.
2674
26752002-02-11 Akim Demaille <akim@epita.fr>
2676
2677 * tests/regression.at (%nonassoc and eof): Don't include
2678 nonportable headers.
2679
26802002-02-08 Robert Anisko <robert@lrde.epita.fr>
2681
2682 * data/bison.c++: Correct error recovery. Make the user able to
2683 initialize the starting location.
2684
26852002-02-07 Akim Demaille <akim@epita.fr>
2686
2687 * tests/input.at: New.
2688
26892002-02-07 Robert Anisko <robert@lrde.epita.fr>
2690
2691 * data/bison.c++: Replace some direct m4 expansions by constants. Be
2692 more consistent when naming methods and variables. Put preprocessor
2693 directives around tables only needed for debugging.
2694
26952002-02-07 Robert Anisko <robert@lrde.epita.fr>
2696
2697 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2698 C++ parsers.
2699 (yy::b4_name::parse): Use print_.
2700
27012002-02-07 Robert Anisko <robert@lrde.epita.fr>
2702
2703 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2704
27052002-02-07 Robert Anisko <robert@lrde.epita.fr>
2706
2707 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2708 C++ parsers.
2709 (yy::b4_name::parse): Build verbose error messages, and use error_.
2710
27112002-02-06 Robert Anisko <robert@lrde.epita.fr>
2712
2713 * data/bison.c++: Fix m4 quoting in comments.
2714
27152002-02-06 Robert Anisko <robert@lrde.epita.fr>
2716
2717 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2718 not expanded by m4.
2719
27202002-02-05 Akim Demaille <akim@epita.fr>
2721
2722 * data/bison.c++: Adjust to the M4 back end.
2723 More is certainly needed.
2724
27252002-02-05 Akim Demaille <akim@epita.fr>
2726
2727 Give a try to M4 as a back end.
2728
2729 * lib/readpipe.c: New, from wdiff.
2730 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2731 BISON_HAIRY.
2732 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2733 specific values. Now it is m4 that performs the lookup.
2734 * src/parse-skel.y: Remove.
2735 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2736 * src/output.c (actions_output, guards_output)
2737 (token_definitions_output): No longer keeps track of the output
2738 line number, hence remove the second argument.
2739 (guards_output): Check against the guard member of a rule, not the
2740 action member.
2741 Adjust callers.
2742 (output_skeleton): Don't look for the skeleton location, let m4 do
2743 that.
2744 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2745 file will be used.
2746 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2747 (prepare): Given that for the time being changesyntax is not
2748 usable in M4, rename the muscles using `-' to `_'.
2749 Define `defines_flag', `output_parser_name' and `output_header_name'.
2750 * src/output.h (actions_output, guards_output)
2751 (token_definitions_output): Adjust prototypes.
2752 * src/scan-skel.l: Instead of scanning the skeletons, it now
2753 processes the output of m4: `__oline__' and `#output'.
2754 * data/bison.simple: Adjust to be used by M4(sugar).
2755 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2756 to date.
2757 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2758 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2759 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2760 shamelessly stolen from CVS Autoconf.
2761
27622002-02-05 Akim Demaille <akim@epita.fr>
2763
2764 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2765 * configure.in: Check for the declarations of free and malloc.
2766 * src/muscle_tab.c: Adjust.
2767
27682002-02-05 Akim Demaille <akim@epita.fr>
2769
2770 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2771 which have no values.
2772
27732002-02-05 Akim Demaille <akim@epita.fr>
2774
2775 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2776 * data/: here.
2777
27782002-01-29 Paul Eggert <eggert@twinsun.com>
2779
2780 * src/bison.simple (YYSIZE_T): Do not define merely because
2781 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2782 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2783
27842002-01-27 Akim Demaille <akim@epita.fr>
2785
2786 Fix `%nonassoc and eof'.
2787
2788 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2789 which were not properly copied! Replace
2790 memcpy (res->errs, src->errs, src->nerrs);
2791 with
2792 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2793 !!!
2794 * tests/regression.at (%nonassoc and eof): Adjust to newest
2795 Autotest: `.' is not in the PATH.
2796
27972002-01-27 Akim Demaille <akim@epita.fr>
2798
2799 * tests/sets.at (AT_EXTRACT_SETS): New.
2800 (Nullable): Use it.
2801 (Firsts): New.
2802
28032002-01-26 Akim Demaille <akim@epita.fr>
2804
2805 * tests/actions.at, tests/calc.at, tests/headers.at,
2806 * tests/torture.at: Adjust to the newest Autotest which no longer
2807 forces `.' in the PATH.
2808
28092002-01-25 Akim Demaille <akim@epita.fr>
2810
2811 * tests/regression.at (%nonassoc and eof): New.
2812 Suggested by Robert Anisko.
2813
28142002-01-24 Akim Demaille <akim@epita.fr>
2815
2816 Bison dumps core when trying to complain about broken input files.
2817 Reported by Cris van Pelt.
2818
2819 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2820 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2821 into...
2822 (Invalid inputs): Strengthen: exercise parse_percent_token.
2823
28242002-01-24 Robert Anisko <robert.anisko@epita.fr>
2825
2826 * src/Makefile.am: Add bison.c++.
2827 * src/bison.c++: New skeleton.
2828
28292002-01-21 Paolo Bonzini <bonzini@gnu.org>
2830
2831 * po/it.po: New.
2832
28332002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2834
2835 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2836
28372002-01-20 Marc Autret <marc@gnu.org>
2838
2839 * src/files.c (compute_output_file_names): Fix
2840
28412002-01-20 Marc Autret <marc@gnu.org>
2842
2843 * tests/output.at: New test.
2844 * src/files.c (compute_base_names): Don't map extensions when
2845 the YACC flag is set, use defaults.
2846 Reported by Evgeny Stambulchik.
2847
28482002-01-20 Marc Autret <marc@gnu.org>
2849
2850 * src/system.h: Need to define __attribute__ away for non-GCC
2851 compilers as well (i.e. the vendor C compiler).
2852 Suggested by Albert Chin-A-Young.
2853
28542002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2855
2856 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2857 canonical definition.
2858 * src/system.h: Use the canonical definition for PARAMS (avoids
2859 a conflict with the macro from lib/hash.h).
2860
28612002-01-11 Akim Demaille <akim@epita.fr>
2862
2863 * configure.in: Use AC_FUNC_STRNLEN.
2864 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
2865
28662002-01-09 Akim Demaille <akim@epita.fr>
2867
2868 * src/files.c, src/files.h (output_infix): New.
2869 (tab_extension): Remove.
2870 (compute_base_names): Compute the former, drop the latter.
2871 * src/output.c (prepare): Insert the muscles `output-infix', and
2872 `output-suffix'.
2873 * src/parse-skel.y (string, string.1): New.
2874 (section.header): Use it.
2875 (section.yacc): Remove.
2876 (prefix): Remove too.
2877 * src/scan-skel.l: Adjust.
2878 * src/bison.simple, src/bison.hairy: Adjust.
2879
28802002-01-09 Akim Demaille <akim@epita.fr>
2881
2882 * configure.in (WERROR_CFLAGS): Compute it.
2883 * src/Makefile.am (CFLAGS): Pass it.
2884 * tests/atlocal.in (CFLAGS): Idem.
2885 * src/files.c: Fix a few warnings.
2886 (get_extension_index): Remove, unused.
2887
28882002-01-08 Akim Demaille <akim@epita.fr>
2889
2890 * src/getargs.c (AS_FILE_NAME): New.
2891 (getargs): Use it to convert DOSish file names.
2892 * src/files.c (base_name): Rename as full_base_name to avoid
2893 clashes with `base_name ()'.
2894 (filename_split): New.
2895 (compute_base_names): N-th rewrite, using filename_split.
2896
28972002-01-08 Akim Demaille <akim@epita.fr>
2898
2899 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2900 New, stolen from the Fileutils 4.1.
2901 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2902 * configure.in: Check for the presence of memrchr, and of its
2903 prototype.
2904
29052002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2906
2907 * lib/hash.h (__P): Added definition for this macro.
2908 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2909 BUILT_SOURCES, to ensure they are generated first.
2910 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2911 %error-verbose to allow bootstrapping with bison 1.30x.
2912
29132002-01-06 Akim Demaille <akim@epita.fr>
2914
2915 * src/reader.c (parse_braces): Don't fetch the next char, the
2916 convention is to fetch on entry.
2917 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2918 'switch' without a following semicolon.
2919 * tests/regression.at (braces parsing): New.
2920
29212002-01-06 Akim Demaille <akim@epita.fr>
2922
2923 Bison is dead wrong in its RR conflict reports.
2924
2925 * tests/torture.at (GNU Cim Grammar): New.
2926 * src/conflicts.c (count_rr_conflicts): Fix.
2927
29282002-01-06 Akim Demaille <akim@epita.fr>
2929
2930 Creating package.m4 from configure.ac causes too many problems.
2931
2932 * tests/Makefile.am (package.m4): Create it by hand,
2933 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2934
29352002-01-06 Akim Demaille <akim@epita.fr>
2936
2937 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2938 skeleton.h.
2939
29402002-01-04 Paul Eggert <eggert@twinsun.com>
2941
2942 * doc/bison.texinfo (Debugging):
2943 Remove YYSTDERR; it's no longer defined or used.
2944 Also, s/cstdio.h/cstdio/.
2945
29462002-01-03 Akim Demaille <akim@epita.fr>
2947
2948 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2949
29502002-01-03 Akim Demaille <akim@epita.fr>
2951
2952 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2953 tracing code to --trace, wait for a better --trace option, with
2954 args.
2955
29562002-01-03 Akim Demaille <akim@epita.fr>
2957
2958 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2959 The ISO C++ standard is extremely clear about it: stderr is
2960 considered a macro, not a regular symbol (see table 94 `Header
2961 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2962 Therefore std:: does not apply to it. It still does with fprintf.
2963 Also, s/cstdio.h/cstdio/.
2964
29652002-01-03 Akim Demaille <akim@epita.fr>
2966
2967 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2968 for non system headers.
2969
29702002-01-02 Akim Demaille <akim@epita.fr>
2971
2972 Equip the skeleton chain with location tracking, runtime trace,
2973 pure parser and scanner.
2974
2975 * src/parse-skel.y: Request a pure parser, locations, and prefix
2976 renaming.
2977 (%union): Having several members with the same type does not help
2978 type mismatches, simplify.
2979 (YYPRINT, yyprint): New.
2980 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2981 (skel_error): this.
2982 Handle locations.
2983 * src/scan-skel.l: Adjust to these changes.
2984 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2985 (LOCATION_PRINT, skel_control_t): New.
2986
29872001-12-30 Akim Demaille <akim@epita.fr>
2988
2989 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2990 replace `gb' with BLANKS.
2991 * src/scan-skel.l: Adjust.
2992
29932001-12-30 Akim Demaille <akim@epita.fr>
2994
2995 * src/system.h: We don't need nor want bcopy.
2996 Throw away MS-DOS crap: we don't need getpid.
2997 * configure.in: We don't need strndup. It was even causing
2998 problems: because Flex includes the headers *before* us,
2999 _GNU_SOURCE is not defined by config.h, and therefore strndup was
3000 not visible.
3001 * lib/xstrndup.c: New.
3002 * src/scan-skel.l: Use it.
3003 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
3004 * src/parse-skel.y: Use %directives instead of #defines.
3005
30062001-12-30 Akim Demaille <akim@epita.fr>
3007
3008 * src/skeleton.h: New.
3009 * src/output.c (output_parser, output_master_parser): Remove, dead
3010 code.
3011 * src/output.h (get_lines_number, actions_output, guards_output)
3012 (token_definitions_output): Prototype them.
3013 * src/parse-skel.y: Add the license notice.
3014 Include output.h and skeleton.h.
3015 (process_skeleton): Returns void, and takes a single parameter.
3016 * src/scan-skel.l: Add the license notice.
3017 Include skeleton.h.
3018 Don't use %option yylineno: it seems that then Flex imagines
3019 REJECT has been used, and therefore it won't reallocate its
3020 buffers (which makes no other sense to me than a bug). It results
3021 in warnings for `unused: yy_flex_realloc'.
3022
30232001-12-30 Robert Anisko <robert.anisko@epita.fr>
3024
3025 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3026 (MUSCLE_INSERT_PREFIX): ...to there.
3027 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3028 (MUSCLE_INSERT_PREFIX): Move from here...
3029
3030 * src/bison.hairy: Add a section directive. Put braces around muscle
3031 names. This parser skeleton is still broken, but Bison should not
3032 choke on a bad muscle 'syntax'.
3033 * src/bison.simple: Add a section directive. Put braces around muscle
3034 names.
3035
3036 * src/files.h (strsuffix, stringappend): Add declarations.
3037 (tab_extension): Add declaration.
3038 (short_base_name): Add declaration.
3039
3040 * src/files.c (strsuffix, stringappend): No longer static. These
3041 functions are used in the skeleton parser.
3042 (tab_extension): New.
3043 (compute_base_names): Use the computations done in this function
3044 to guess if the generated parsers should have '.tab' in their
3045 names.
3046 (short_base_name): No longer static.
3047
3048 * src/output.c (output_skeleton): New.
3049 (output): Disable call to output_master_parser, and give a try to
3050 a new skeleton handling system.
3051 (guards_output, actions_output): No longer static.
3052 (token_definitions_output, get_lines_number): No longer static.
3053
3054 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
3055
3056 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
3057 parse-skel.y.
3058
3059 * src/parse-skel.y: New file.
3060 * src/scan-skel.l: New file.
3061
30622001-12-29 Akim Demaille <akim@epita.fr>
3063
3064 %name-prefix is broken.
3065
3066 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
3067 Adjust all dependencies.
3068 * tests/headers.at (export YYLTYPE): Strengthen this test: use
3069 %name-prefix.
3070
3071 Renaming yylval but not yylloc is not consistent. Now we do.
3072
3073 * src/bison.simple: Prefix yylloc if used.
3074 * doc/bison.texinfo (Decl Summary): Document that.
3075
30762001-12-29 Akim Demaille <akim@epita.fr>
3077
3078 * doc/bison.texinfo: Promote `%long-directive' over
3079 `%long_directive'.
3080 Remove all references to fixed-output-files, yacc is enough.
3081
30822001-12-29 Akim Demaille <akim@epita.fr>
3083
3084 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
3085 user prologue. These are defaults.
3086 * tests/actions.at (Mid-rule actions): Make sure the user can
3087 define YYDEBUG and YYERROR_VERBOSE.
3088
30892001-12-29 Akim Demaille <akim@epita.fr>
3090
3091 * src/output.c (header_output): Don't forget to export YYLTYPE and
3092 yylloc.
3093 * tests/headers.at (export YYLTYPE): New, make sure it does.
3094 * tests/regression.at (%union and --defines, Invalid CPP headers):
3095 Move to...
3096 * tests/headers.at: here.
3097
30982001-12-29 Akim Demaille <akim@epita.fr>
3099
3100 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
3101
31022001-12-29 Akim Demaille <akim@epita.fr>
3103
3104 * tests/actions.at (Mid-rule actions): Output on a single line
3105 instead of several.
3106
31072001-12-29 Akim Demaille <akim@epita.fr>
3108
3109 * doc/bison.texinfo: Formatting changes.
3110
31112001-12-29 Akim Demaille <akim@epita.fr>
3112
3113 Don't store the token defs in a muscle, just be ready to output it
3114 on command. Now possible via `symbols'. Fixes a memory leak.
3115
3116 * src/output.c (token_definitions_output): New.
3117 (output_parser, header_output): Use it.
3118 * src/reader.c (symbols_save): Remove.
3119
31202001-12-29 Akim Demaille <akim@epita.fr>
3121
3122 * src/bison.simple: Do not provide a default for YYSTYPE and
3123 YYLTYPE before the user's prologue. Otherwise it's hardly... a
3124 default.
3125
31262001-12-29 Akim Demaille <akim@epita.fr>
3127
3128 Mid-rule actions are simply... ignored!
3129
3130 * src/reader.c (readgram): Be sure to attach mid-rule actions to
3131 the empty-rule associated to the dummy symbol, not to the host
3132 rule.
3133 * tests/actions.at (Mid-rule actions): New.
3134
31352001-12-29 Akim Demaille <akim@epita.fr>
3136
3137 Memory leak.
3138
3139 * src/reader.c (reader): Free grammar.
3140
31412001-12-29 Akim Demaille <akim@epita.fr>
3142
3143 Memory leak.
3144
3145 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
3146 since it allocates it for each state, although only one is needed.
3147 (allocate_storage): Do it here.
3148
31492001-12-29 Akim Demaille <akim@epita.fr>
3150
3151 * src/options.h, src/options.c (create_long_option_table): Rename
3152 as...
3153 (long_option_table_new): this, with a clearer prototype.
3154 (percent_table): Remove, unused,
3155 * src/getargs.c (getargs): Adjust.
3156
31572001-12-29 Akim Demaille <akim@epita.fr>
3158
3159 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
3160 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
3161 as states.
3162
31632001-12-29 Akim Demaille <akim@epita.fr>
3164
3165 * src/lalr.c (build_relations): Rename `states' as `states1'.
3166 Sorry, I don't understand exactly what it is, no better name...
3167
31682001-12-29 Akim Demaille <akim@epita.fr>
3169
3170 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
3171 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
3172 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
3173 as rules.
3174
31752001-12-29 Akim Demaille <akim@epita.fr>
3176
3177 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
3178 ago.
3179
31802001-12-29 Akim Demaille <akim@epita.fr>
3181
3182 * src/reader.c, src/reader.h (user_toknums): Remove.
3183 Adjust all users to use symbols[i]->user_token_number.
3184
31852001-12-29 Akim Demaille <akim@epita.fr>
3186
3187 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
3188 Adjust all users to use symbols[i]->prec or ->assoc.
3189
31902001-12-29 Akim Demaille <akim@epita.fr>
3191
3192 * src/reader.c, src/reader.h (tags): Remove.
3193 Adjust all users to use symbols[i]->tag.
3194
31952001-12-29 Akim Demaille <akim@epita.fr>
3196
3197 * src/gram.h, src/gram.c (symbols): New, similar to state_table
3198 and rule_table.
3199 * src/reader.c (packsymbols): Fill this table.
3200 Drop sprec.
3201 * src/conflicts.c (resolve_sr_conflict): Adjust.
3202 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
3203 single table.
3204 Use symbols[i]->tag instead of tags[i].
3205
32062001-12-29 Akim Demaille <akim@epita.fr>
3207
3208 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
3209 In addition, put a comment in there, to replace...
3210 * tests/regression.at (%union and C comments): Remove.
3211
32122001-12-29 Akim Demaille <akim@epita.fr>
3213
3214 * tests/regression.at (Web2c Actions): Blindly move the actual
3215 output as expected output. The contents *seem* right to me, but I
3216 can't pretend reading perfectly parser tables... Nonetheless, all
3217 the other tests pass correctly, the table look OK, even though the
3218 presence of `$axiom' is to be noted: AFAICS it is useless (but
3219 harmless).
3220
32212001-12-29 Akim Demaille <akim@epita.fr>
3222
3223 * src/reader.c (readgram): Don't add the rule 0 if there were no
3224 rules read. In other words, add it _after_ having performed
3225 grammar sanity checks.
3226 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
3227
32282001-12-29 Akim Demaille <akim@epita.fr>
3229
3230 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
3231 visible, and some states have now a different number.
3232
32332001-12-29 Akim Demaille <akim@epita.fr>
3234
3235 * src/reader.c (readgram): Bind the initial rule's lineno to that
3236 of the first rule.
3237 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
3238 (Solved SR Conflicts): Adjust rule 0's line number.
3239
32402001-12-29 Akim Demaille <akim@epita.fr>
3241
3242 Fix the `GAWK Grammar' failure.
3243
3244 * src/LR0.c (final_state): Initialize to -1 so that we do compute
3245 the reductions of the first state which was mistakenly confused
3246 with the final state because precisely final_state was initialized
3247 to 0.
3248 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
3249 now noticed by Bison.
3250 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
3251 have a reduction on $default.
3252
32532001-12-29 Akim Demaille <akim@epita.fr>
3254
3255 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
3256 rule line numbers.
3257 * src/closure.c (print_closure): Likewise.
3258 * src/derives.c (print_derives): Likewise.
3259 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
3260 now.
3261
32622001-12-29 Akim Demaille <akim@epita.fr>
3263
3264 * src/lalr.c (lookaheads_print): New.
3265 (lalr): Call it when --trace-flag.
3266 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
3267 are dumped.
3268
32692001-12-29 Akim Demaille <akim@epita.fr>
3270
3271 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
3272 when walking through ritem, even via rule->rhs.
3273 * src/reduce.c (dump_grammar, useful_production, reduce_output)
3274 (useful_production, useless_nonterminals): Likewise.
3275 (reduce_grammar_tables): Likewise, plus update nritems.
3276 * src/nullable.c (set_nullable): Likewise.
3277 * src/lalr.c (build_relations): Likewise.
3278 * tests/sets.at (Nullable): Adjust.
3279 Fortunately, now, the $axiom is no longer nullable.
3280
32812001-12-29 Akim Demaille <akim@epita.fr>
3282
3283 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
3284 the 0-sentinel.
3285 * src/gram.c (ritem_longest_rhs): Likewise.
3286 * src/reduce.c (nonterminals_reduce): Likewise.
3287 * src/print_graph.c (print_graph): Likewise.
3288 * src/output.c (output_rule_data): Likewise.
3289 * src/nullable.c (set_nullable): Likewise.
3290
32912001-12-29 Akim Demaille <akim@epita.fr>
3292
3293 * src/output.c: Comment changes.
3294
32952001-12-27 Paul Eggert <eggert@twinsun.com>
3296
3297 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
3298 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
3299 Sparc, as they were causing more porting problems than the
3300 (minor) performance improvement was worth.
3301
3302 Also, catch up with 1.31's YYSTD.
3303
33042001-12-27 Akim Demaille <akim@epita.fr>
3305
3306 * src/output.c (output_gram): Rely on nritems, not the
3307 0-sentinel. See below.
3308 Use -1 as separator, not 0.
3309 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
3310 Rely on -1 as separator in yyrhs, instead of 0.
3311 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
3312 twice `Now at end of input', therefore there are two lines less to
3313 expect.
3314
33152001-12-27 Akim Demaille <akim@epita.fr>
3316
3317 * tests/regression.at (Unresolved SR Conflicts):
3318 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
3319 below.
3320
33212001-12-27 Akim Demaille <akim@epita.fr>
3322
3323 * src/LR0.c (new_state): Recognize the final state by the fact it
3324 is reached by eoftoken.
3325 (insert_start_shifting_state, insert_eof_shifting_state)
3326 (insert_accepting_state, augment_automaton): Remove, since now
3327 these states are automatically computed from the initial state.
3328 (generate_states): Adjust.
3329 * src/print.c: When reporting a rule number to the user, substract
3330 1, so that the axiom rule is rule 0, and the first user rule is 1.
3331 * src/reduce.c: Likewise.
3332 * src/print_graph.c (print_core): For the time being, just as for
3333 the report, depend upon --trace-flags to dump the full set of
3334 items.
3335 * src/reader.c (readgram): Once the grammar read, insert the rule
3336 0: `$axiom: START-SYMBOL $'.
3337 * tests/set.at: Adjust: rule 0 is now displayed, and since the
3338 number of the states has changed (the final state is no longer
3339 necessarily the last), catch up.
3340
33412001-12-27 Akim Demaille <akim@epita.fr>
3342
3343 Try to make the use of the eoftoken valid. Given that its value
3344 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
3345 is used instead of > 0 where appropriate, (ii), depend upon nritems
3346 instead of the 0-sentinel.
3347
3348 * src/gram.h, src/gram.c (nritems): New.
3349 Expected to be duplication of nitems, but for the time being...
3350 * src/reader.c (packgram): Assert nritems and nitems are equal.
3351 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
3352 * src/closure.c (print_closure, print_fderives): Likewise.
3353 * src/gram.c (ritem_print): Likewise.
3354 * src/print.c (print_core, print_grammar): Likewise.
3355 * src/print_graph.c: Likewise.
3356
33572001-12-27 Akim Demaille <akim@epita.fr>
3358
3359 * src/main.c (main): If there are complains after grammar
3360 reductions, then output the report anyway if requested, then die.
3361 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
3362 * src/reader.c (eoftoken): New.
3363 (parse_token_decl): If the token being defined has value `0', it
3364 is the eoftoken.
3365 (packsymbols): No longer hack `tags' to insert `$' by hand.
3366 Be sure to preserve the value of the eoftoken.
3367 (reader): Make sure eoftoken is defined.
3368 Initialize nsyms to 0: now eoftoken is created just like the others.
3369 * src/print.c (print_grammar): Don't special case the eof token.
3370 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
3371 lie anyway, albeit pleasant.
3372 * tests/calc.at: Exercise error messages with eoftoken.
3373 Change the grammar so that empty input is invalid.
3374 Adjust expectations.
3375 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
3376
33772001-12-27 Akim Demaille <akim@epita.fr>
3378
3379 * configure.in: Check the protos of strchr ans strspn.
3380 Replace strchr if needed.
3381 * src/system.h: Provide the protos of strchr, strspn and memchr if
3382 missing.
3383 * lib/strchr.c: New.
3384 * src/reader.c (symbols_save): Use strchr.
3385
33862001-12-27 Akim Demaille <akim@epita.fr>
3387
3388 * src/print.c, src/print_graph.c (escape): New.
3389 Use it to quote the TAGS outputs.
3390 * src/print_graph.c (print_state): Now errors are in red, and
3391 reductions in green.
3392 Prefer high to wide: output the state number on a line of its own.
3393
33942001-12-27 Akim Demaille <akim@epita.fr>
3395
3396 * src/state.h, src/state.c (reductions_new): New.
3397 * src/LR0.c (set_state_table): Let all the states have a
3398 `reductions', even if reduced to 0.
3399 (save_reductions): Adjust.
3400 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
3401 * src/print.c (print_reductions, print_actions): Adjust.
3402 * src/output.c (action_row): Adjust.
3403
34042001-12-27 Akim Demaille <akim@epita.fr>
3405
3406 * src/state.h, src/state.c (errs_new, errs_dup): New.
3407 * src/LR0.c (set_state_table): Let all the states have an errs,
3408 even if reduced to 0.
3409 * src/print.c (print_errs, print_reductions): Adjust.
3410 * src/output.c (output_actions, action_row): Adjust.
3411 * src/conflicts.c (resolve_sr_conflict): Adjust.
3412
34132001-12-27 Akim Demaille <akim@epita.fr>
3414
3415 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
3416
34172001-12-27 Akim Demaille <akim@epita.fr>
3418
3419 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
3420 * src/print.c: here.
3421 (lookaheadset, shiftset): New, used as additional storage by
3422 print_reductions.
3423 (print_results): Adjust.
3424 (print_shifts, print_gotos, print_errs): New, extracted from...
3425 (print_actions): here.
3426 * src/print_graph.c (print_actions): Remove dead code.
3427
34282001-12-27 Akim Demaille <akim@epita.fr>
3429
3430 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
3431 `$n' and `@n'.
3432
34332001-12-27 Akim Demaille <akim@epita.fr>
3434
3435 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
3436 (build_relations): Adjust.
3437
34382001-12-27 Akim Demaille <akim@epita.fr>
3439
3440 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
3441 duplication.
3442
34432001-12-27 Akim Demaille <akim@epita.fr>
3444
3445 * src/reader.c (packgram): Catch nitems overflows.
3446
34472001-12-27 Akim Demaille <akim@epita.fr>
3448
3449 * src/files.c, src/files.h (guard_obstack): Remove.
3450 * src/output.c (output): Adjust.
3451 * src/reader.c (parse_braces): New, factoring...
3452 (copy_action, copy_guard): these two which are renamed as...
3453 (parse_action, parse_guard): these.
3454 As a voluntary consequence, using braces around guards is now
3455 mandatory.
3456
34572001-12-27 Akim Demaille <akim@epita.fr>
3458
3459 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
3460 * src/reader.c (symbol_list): `guard' and `guard_line' are new
3461 members.
3462 (symbol_list_new): Adjust.
3463 (copy_action): action_line is the first line, not the last.
3464 (copy_guard): Just as for actions, store the `action' only, not
3465 the switch/case/break flesh.
3466 Don't parse the user action that might follow the guard, let...
3467 (readgram): do it, i.e., now, there can be an action after a
3468 guard.
3469 In other words the guard is just explicitly optional.
3470 (packgram): Adjust.
3471 * src/output.c (guards_output): New.
3472 (output_parser): Call it when needed.
3473 (output): Also free the guard and attrs obstacks.
3474 * src/files.c, src/files.h (obstack_save): Remove.
3475 (output_files): Remove.
3476 As a result, if one needs the former `.act' file, using an
3477 appropriate skeleton which requires actions and guards is now
3478 required.
3479 * src/main.c (main): Adjust.
3480 * tests/semantic.at: New.
3481 * tests/regression.at: Use `input.y' as input file name.
3482 Avoid 8+3 problems by requiring input.c when the test needs the
3483 parser.
3484
34852001-12-27 Akim Demaille <akim@epita.fr>
3486
3487 * src/reader.c (symbol_list_new): Be sure to initialize all the
3488 fields.
3489
34902001-12-27 Akim Demaille <akim@epita.fr>
3491
3492 All the hacks using a final pseudo state are now useless.
3493
3494 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3495 * src/lalr.c (nLA): New.
3496 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3497 instead of lookaheadsp from the pseudo state (nstate + 1).
3498
34992001-12-27 Akim Demaille <akim@epita.fr>
3500
3501 * src/output.c (action_row, token_actions): Use a state_t instead
3502 of a integer, and nlookaheads instead of the following state's
3503 lookaheadsp.
3504
35052001-12-27 Akim Demaille <akim@epita.fr>
3506
3507 * src/conflicts.c (log_resolution, flush_shift)
3508 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3509 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3510 (conflicts_print, print_reductions): Use a state_t instead of an
3511 integer when referring to a state.
3512 As much as possible, depend upon nlookaheads, instead of the
3513 `lookaheadsp' member of the following state (since lookaheads of
3514 successive states are successive, the difference between state n + 1
3515 and n served as the number of lookaheads for state n).
3516 * src/lalr.c (add_lookback_edge): Likewise.
3517 * src/print.c (print_core, print_actions, print_state)
3518 (print_results): Likewise.
3519 * src/print_graph.c (print_core, print_actions, print_state)
3520 (print_graph): Likewise.
3521 * src/conflicts.h: Adjust.
3522
35232001-12-27 Akim Demaille <akim@epita.fr>
3524
3525 * src/bison.hairy: Formatting/comment changes.
3526 ANSIfy.
3527 Remove `register' indications.
3528 Add plenty of `static'.
3529
35302001-12-27 Akim Demaille <akim@epita.fr>
3531
3532 * src/output.c (prepare): Drop the muscle `ntbase' which
3533 duplicates ntokens.
3534 * src/bison.simple: Formatting/comment changes.
3535 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3536 is an undocumented synonym.
3537
35382001-12-22 Akim Demaille <akim@epita.fr>
3539
3540 * src/output.c (output_table_data): Change the prototype to use
3541 `int' for array ranges: some invocations do pass an int, not a
3542 short.
3543 Reported by Wayne Green.
3544
35452001-12-22 Akim Demaille <akim@epita.fr>
3546
3547 Some actions of web2c.y are improperly triggered.
3548 Reported by Mike Castle.
3549
3550 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3551 * tests/regression.at (Web2c): Rename as...
3552 (Web2c Report): this.
3553 (Web2c Actions): New.
3554
35552001-12-22 Akim Demaille <akim@epita.fr>
3556
3557 Reductions in web2c.y are improperly reported.
3558 Reported by Mike Castle.
3559
3560 * src/conflicts.c (print_reductions): Fix.
3561 * tests/regression.at (Web2c): New.
3562
35632001-12-18 Akim Demaille <akim@epita.fr>
3564
3565 Some host fail on `assert (!"foo")', which expands to
3566 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3567 Reported by Nelson Beebee.
3568
3569 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3570 `#define it_succeeded 0' and `assert (it_succeeded)'.
3571
35722001-12-17 Marc Autret <autret_m@epita.fr>
3573
3574 * src/bison.simple: Don't hard code the skeleton line and filename.
3575 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3576 New line counter 'skeleton_line' (skeleton-line muscle).
3577
35782001-12-17 Paul Eggert <eggert@twinsun.com>
3579
3580 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3581 YYDEBUG must be defined to a nonzero value.
3582
3583 * src/bison.simple (yytname): Do not assume that the user defines
3584 YYDEBUG to a properly parenthesized expression.
3585
35862001-12-17 Akim Demaille <akim@epita.fr>
3587
3588 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3589 nlookaheads is a new member.
3590 Adjust all users.
3591 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3592 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3593 state.
3594
35952001-12-17 Akim Demaille <akim@epita.fr>
3596
3597 * src/files.h, src/files.c (open_files, close_files): Remove.
3598 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3599 let...
3600 * src/reader.c (reader): Do it.
3601
36022001-12-17 Akim Demaille <akim@epita.fr>
3603
3604 * src/conflicts.c (print_reductions): Formatting changes.
3605
36062001-12-17 Akim Demaille <akim@epita.fr>
3607
3608 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3609 (flush_reduce): New.
3610 (resolve_sr_conflict): Adjust.
3611
36122001-12-17 Akim Demaille <akim@epita.fr>
3613
3614 * src/output.c (output_obstack): Be static and rename as...
3615 (format_obstack): this, to avoid any confusion with files.c's
3616 output_obstack.
3617 * src/reader.h (muscle_obstack): Move to...
3618 * src/output.h: here, since it's defined in output.c.
3619
36202001-12-17 Akim Demaille <akim@epita.fr>
3621
3622 * src/output.c (action_row, save_column, default_goto)
3623 (sort_actions, matching_state, pack_vector): Better variable
3624 locality.
3625
36262001-12-17 Akim Demaille <akim@epita.fr>
3627
3628 * src/output.c: Various formatting changes.
3629
36302001-12-17 Akim Demaille <akim@epita.fr>
3631
3632 * src/files.c (output_files): Free the output_obstack.
3633 * src/main.c (main): Call print and print_graph conditionally.
3634 * src/print.c (print): Work unconditionally.
3635 * src/print_graph.c (print_graph): Work unconditionally.
3636 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3637
36382001-12-16 Marc Autret <autret_m@epita.fr>
3639
3640 * src/output.c (actions_output): Fix. When we use %no-lines,
3641 there is one less line per action.
3642
36432001-12-16 Marc Autret <autret_m@epita.fr>
3644
3645 * src/bison.simple: Remove a useless #line directive.
3646 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3647 * src/output.c (get_lines_number): New.
3648 (output_parser): Adjust, now takes care about the lines of a
3649 output muscles.
3650 Fix line numbering.
3651 (actions_output): Computes the number of lines taken by actions.
3652 (output_master_parser): Insert new skeleton which is the name of
3653 the output parser file name.
3654
36552001-12-15 Marc Autret <autret_m@epita.fr>
3656
3657 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3658
36592001-12-15 Marc Autret <autret_m@epita.fr>
3660
3661 * src/output.c (output_gram): Keep track of the hairy one.
3662
36632001-12-15 Akim Demaille <akim@epita.fr>
3664
3665 Make `make distcheck' work.
3666
3667 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3668 system.h which uses libgettext.h.
3669
36702001-12-15 Akim Demaille <akim@epita.fr>
3671
3672 * src/nullable.c (set_nullable): Useless rules must be skipped,
3673 otherwise, since we range over their symbols, we might look at a
3674 nonterminal which no longer ``exists'', i.e., it is not counted in
3675 `nvars', hence we overflow our arrays.
3676
36772001-12-15 Akim Demaille <akim@epita.fr>
3678
3679 The header can also be produced directly, without any obstack!
3680 Yahoo!
3681
3682 * src/files.c, src/files.h (defines_obstack): Remove.
3683 (compute_header_macro): Global.
3684 (defines_obstack_save): Remove.
3685 * src/reader.c (parse_union_decl): No longer output to
3686 defines_obstack: its content can be found in the `stype' muscle
3687 anyway.
3688 (output_token_translations): Merge into...
3689 (symbols_output): this.
3690 Rename as...
3691 (symbols_save): this.
3692 (reader): Adjust.
3693 * src/output.c (header_output): New.
3694 (output): Call it.
3695
36962001-12-15 Akim Demaille <akim@epita.fr>
3697
3698 * src/reader.c (parse_union_decl): Instead of handling two obstack
3699 simultaneously, use one to define the `stype' muscle, and use the
3700 value of the latter to fill defines_obstack.
3701 (copy_comment): Remove.
3702 (copy_comment2): Work for a single obstack.
3703 Rename as...
3704 (copy_comment): this.
3705
37062001-12-15 Akim Demaille <akim@epita.fr>
3707
3708 * src/lex.c, src/lex.h (xgetc): No longer static.
3709 * src/reader.c (parse_union_decl): Revamp.
3710
37112001-12-15 Akim Demaille <akim@epita.fr>
3712
3713 Still making progress in separating Bison into (i) input, (ii)
3714 process, (iii) output: now we can directly output the parser file
3715 without using table_obstack at all.
3716
3717 * src/files.c, src/files.h (table_obstack): Bye bye.
3718 (parser_file_name): New.
3719 * src/files.c (compute_output_file_names): Compute it.
3720 * src/output.c (actions_output, output_parser)
3721 (output_master_parser): To a file instead of an obstack.
3722
37232001-12-15 Akim Demaille <akim@epita.fr>
3724
3725 Attach actions to rules, instead of pre-outputting them to
3726 actions_obstack.
3727
3728 * src/gram.h (rule_t): action and action_line are new members.
3729 * src/reader.c (symbol_list): Likewise.
3730 (copy_action): Save the actions within the rule.
3731 (packgram): Save them in rule_table.
3732 * src/output.c (actions_output): New.
3733 (output_parser): Use it on `%%actions'.
3734 (output_rule_data): Don't free rule_table.
3735 (output): Do it.
3736 (prepare): Don't save the `action' muscle.
3737 * src/bison.simple: s/%%action/%%actions/.
3738
37392001-12-15 Akim Demaille <akim@epita.fr>
3740
3741 * src/reader.c (copy_action): When --yacc, don't append a `;'
3742 to the user action: let it fail if lacking.
3743 Suggested by Arnold Robbins and Tom Tromey.
3744
37452001-12-14 Akim Demaille <akim@epita.fr>
3746
3747 * src/lex.c (literalchar): Simply return the char you decoded, non
3748 longer mess around with obstacks and int pointers.
3749 Adjust all callers.
3750
37512001-12-14 Akim Demaille <akim@epita.fr>
3752
3753 * src/lex.c (literalchar): Don't escape the special characters,
3754 just decode them, and keep them as char (before, eol was output as
3755 the 2 char string `\n' etc.).
3756 * src/output.c (output_rule_data): Use quotearg to output the
3757 token strings.
3758
37592001-12-13 Paul Eggert <eggert@twinsun.com>
3760
3761 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3762 Do not infringe on the global user namespace when using C++.
3763 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3764 All uses of `fprintf' and `stderr' changed.
3765
3766 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3767
37682001-12-13 Akim Demaille <akim@epita.fr>
3769
3770 The computation of nullable is broken: it doesn't handle empty
3771 RHS's properly.
3772
3773 * tests/torture.at (GNU AWK Grammar): New.
3774 * tests/sets.at (Nullable): New.
3775 * src/nullable.c (set_nullable): Instead of blindly looping over
3776 `ritems', loop over the rules, and then over their rhs's.
3777
3778 Work around Autotest bugs.
3779
3780 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3781 frame, because Autotest understand lines starting with a `+' as
3782 traces from the shell. Then, they are not processed properly.
3783 Admittedly an Autotest bug, but we don't have time to wait for
3784 Autotest to catch up.
3785 * tests/regression.at (Broken Closure): Adjust to the new table
3786 frames.
3787 Move to...
3788 * tests/sets.at: here.
3789
37902001-12-13 Akim Demaille <akim@epita.fr>
3791
3792 * src/closure.c (closure): Use nrules instead of playing tricks
3793 with BITS_PER_WORD.
3794
37952001-12-13 Akim Demaille <akim@epita.fr>
3796
3797 * src/print.c (print_actions): Output the handling of `$' as the
3798 traces do: shifting the token EOF. Before EOF was treated as a
3799 nonterminal.
3800 * tests/regression.at: Adjust some tests.
3801 * src/print_graph.c (print_core): Complete the set of items via
3802 closure. The next-to-final and final states are still unsatisfying,
3803 but that's to be addressed elsewhere.
3804 No longer output the rule numbers, but do output the state number.
3805 A single loop for the shifts + gotos is enough, but picked a
3806 distinct color for each.
3807 (print_graph): Initialize and finalize closure.
3808
38092001-12-13 Akim Demaille <akim@epita.fr>
3810
3811 * src/reader.c (readgram): Remove dead code, an strip useless
3812 braces.
3813 (get_type): Remove, unused.
3814
38152001-12-12 Akim Demaille <akim@epita.fr>
3816
3817 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3818 on that of lib/error.c.
3819
38202001-12-12 Akim Demaille <akim@epita.fr>
3821
3822 Some hosts don't like `/' in includes.
3823
3824 * src/system.h: Include libgettext.h without qualifying the path.
3825 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3826 $(top_srcdir).
3827
38282001-12-11 Marc Autret <autret_m@epita.fr>
3829
3830 * src/output.c (output_parser): Remove useless muscle.
3831
38322001-12-11 Marc Autret <autret_m@epita.fr>
3833
3834 * src/bison.simple: Remove #line just before %%epilogue. It
3835 is now handled in ...
3836 * src/reader.c (read_additionnal_code): Add the output of a
3837 #line for the epilogue.
3838
38392001-12-10 Marc Autret <autret_m@epita.fr>
3840
3841 * src/reader.c (copy_definition): Re-use CPP-outed code which
3842 replace precedent remove.
3843 * src/bison.simple: Remove #line before %%prologue because
3844 %%input-line is wrong at this time.
3845
38462001-12-10 Marc Autret <autret_m@epita.fr>
3847
3848 * src/reader.c (symbols_output): Clean up.
3849 * src/output.c (output_gram, output): Clean up.
3850
38512001-12-10 Akim Demaille <akim@epita.fr>
3852
3853 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3854 * src/LR0.c (set_state_table): here.
3855 * src/lalr.c (lalr): Call it.
3856
38572001-12-10 Akim Demaille <akim@epita.fr>
3858
3859 * src/state.h (shifts): Remove the `number' member: shifts are
3860 attached to state, hence no longer need to be labelled with a
3861 state number.
3862
38632001-12-10 Akim Demaille <akim@epita.fr>
3864
3865 Now that states have a complete set of members, the linked list of
3866 shifts is useless: just fill directly the state's shifts member.
3867
3868 * src/state.h (shifts): Remove the `next' member.
3869 * src/LR0.c (first_state, last_state): Remove.
3870 Adjust the callers.
3871 (augment_automaton): Don't look for the shifts that must be added
3872 a shift on EOF: it is those of the state we looked for! But now,
3873 since shifts are attached, it is no longer needed to looking
3874 merely by its id: its number.
3875
38762001-12-10 Akim Demaille <akim@epita.fr>
3877
3878 * src/LR0.c (augment_automaton): Better variable locality.
3879 Remove an impossible branch: if there is a state corresponding to
3880 the start symbol being shifted, then there is shift for the start
3881 symbol from the initial state.
3882
38832001-12-10 Akim Demaille <akim@epita.fr>
3884
3885 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3886 only when appropriate: when insert_start_shifting_state' is not
3887 invoked.
3888 * tests/regression.at (Rule Line Numbers): Adjust.
3889
38902001-12-10 Akim Demaille <akim@epita.fr>
3891
3892 * src/LR0.c (augment_automaton): Now that all states have shifts,
3893 merge the two cases addition shifts to the initial state.
3894
38952001-12-10 Akim Demaille <akim@epita.fr>
3896
3897 * src/lalr.c (set_state_table): Move to...
3898 * src/LR0.c: here.
3899 * src/lalr.c (lalr): Don't call it...
3900 * src/LR0.c (generate_states): do it.
3901 * src/LR0.h (first_state): Remove, only the table is used.
3902
39032001-12-10 Akim Demaille <akim@epita.fr>
3904
3905 * src/LR0.h (first_shift, first_reduction): Remove.
3906 * src/lalr.c: Don't use first_shift: find shifts through the
3907 states.
3908
39092001-12-10 Akim Demaille <akim@epita.fr>
3910
3911 * src/LR0.c: Attach shifts to states as soon as they are
3912 computed.
3913 * src/lalr.c (set_state_table): Instead of assigning shifts to
3914 state, just assert that the mapping was properly done.
3915
39162001-12-10 Akim Demaille <akim@epita.fr>
3917
3918 * src/LR0.c (insert_start_shift): Rename as...
3919 (insert_start_shifting_state): this.
3920 (insert_eof_shifting_state, insert_accepting_state): New.
3921 (augment_automaton): Adjust.
3922 Better locality of the variables.
3923 When looking if the start_symbol is shifted from the initial
3924 state, using `while (... symbol != start_symbol ...)' sounds
3925 better than `while (... symbol < start_symbol ...)': If fail
3926 to see how the order between symbols could be relevant!
3927
39282001-12-10 Akim Demaille <akim@epita.fr>
3929
3930 * src/getargs.h: Don't declare `spec_name_prefix' and
3931 `spec_file_prefix', declared by src/files.h.
3932 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3933 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3934 * src/output.c (prepare): Adjust.
3935 * src/reader.c (symbols_output): Likewise.
3936 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3937
39382001-12-10 Akim Demaille <akim@epita.fr>
3939
3940 * src/muscle_tab.c (muscle_init): NULL is a better default than
3941 `"0"'.
3942
39432001-12-10 Akim Demaille <akim@epita.fr>
3944
3945 * src/reader.c (reader): Calling symbols_output once is enough.
3946
39472001-12-10 Akim Demaille <akim@epita.fr>
3948
3949 Now that states have a complete set of members, the linked list of
3950 reductions is useless: just fill directly the state's reductions
3951 member.
3952
3953 * src/state.h (struct reductions): Remove member `number' and
3954 `next'.
3955 * src/LR0.c (first_reduction, last_reduction): Remove.
3956 (save_reductions): Don't link the new reductions, store them in
3957 this_state.
3958 * src/lalr.c (set_state_table): No need to attach reductions to
3959 states, it's already done.
3960 * src/output.c (output_actions): No longer free the shifts, then
3961 the reductions, then the states: free all the states and their
3962 members.
3963
39642001-12-10 Akim Demaille <akim@epita.fr>
3965
3966 * src/options.c (OPTN, DRTV, BOTH): New.
3967 (option_table): Use them.
3968
3969 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3970 the job of system.h.
3971 * src/options.c: Don't include stdio.h and xalloc.h for the same
3972 reasons.
3973
39742001-12-10 Akim Demaille <akim@epita.fr>
3975
3976 * src/output.c (output, prepare): Make sure the values of the
3977 muscles `action' and `prologue' are 0-terminated.
3978
39792001-12-10 Akim Demaille <akim@epita.fr>
3980
3981 Clean up GCC warnings.
3982
3983 * src/reader.c (copy_action): `buf' is not used.
3984 (parse_skel_decl): Be static.
3985 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3986 * src/options.h (create_long_option_table): Have a real prototype.
3987 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3988 (hash_delete_at): Return const void *.
3989 Adjust casts to preserve the const.
3990
39912001-12-10 Akim Demaille <akim@epita.fr>
3992
3993 * configure.in: Require 2.52g.
3994 M4 is not needed, but AUTOM4TE is.
3995 * m4/m4.m4: Remove.
3996 * tests/Makefile.am: Adjust.
3997
39982001-12-10 Akim Demaille <akim@epita.fr>
3999
4000 One structure for states is enough, even though theoretically
4001 there are LR(0) states and LALR(1) states.
4002
4003 * src/lalr.h (state_t): Remove.
4004 (state_table): Be state_t **, not state_t *.
4005 * src/state.h (core, CORE_ALLOC): Rename as...
4006 (state_t, STATE_ALLOC): this.
4007 Add the LALR(1) members: shifts, reductions, errs.
4008 * src/LR0.c (state_table): Rename as...
4009 (state_hash): this, to avoid name clashes with the global
4010 `state_table'.
4011 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
4012 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
4013
40142001-12-10 Akim Demaille <akim@epita.fr>
4015
4016 Bison dumps core on bash.y.
4017 Reported by Pascal Bart.
4018
4019 * src/warshall.c (bitmatrix_print): New.
4020 (TC): Use it.
4021 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
4022 j must be the outer loop.
4023 * tests/regression.at (Broken Closure): New.
4024
40252001-12-05 Akim Demaille <akim@epita.fr>
4026
4027 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
4028 its argument.
4029