]> git.saurik.com Git - bison.git/blame - ChangeLog
* doc/bison.texinfo (Stack Overflow): xref to Recursion.
[bison.git] / ChangeLog
CommitLineData
d1a1114f
AD
12002-09-24 Akim Demaille <akim@epita.fr>
2
3 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
4 (Frequently Asked Questions, Parser Stack Overflow): New.
5
b906441c
AD
62002-09-13 Akim Demaille <akim@epita.fr>
7
8 Playing with autoscan.
9
10 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
11 * src/files.c (skeleton_find): Remove, unused.
12 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14
bd701811
AD
152002-09-13 Akim Demaille <akim@epita.fr>
16
17 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
18 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
19
e0a13e7b
AD
202002-09-13 Akim Demaille <akim@epita.fr>
21
22 * configure.ac: Require 2.54.
23 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
24 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
25 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
26 Remove, provided by Autoconf macros.
27
c97011bf
AD
282002-09-12 Akim Demaille <akim@epita.fr>
29
30 * m4/prereq.m4: Update, from Coreutils 4.5.1.
31
d862b1be
AD
322002-09-12 Akim Demaille <akim@epita.fr>
33
34 * m4/prereq.m4: Update, from Fileutils 4.1.5.
35 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
36 Reported by Martin Mokrejs.
37
3d38c03a
AD
382002-09-10 Akim Demaille <akim@epita.fr>
39
40 * src/parse-gram.y: Associate a human readable string to each
41 token type.
42 * tests/regression.at (Invalid inputs): Adjust.
43
b6347355
AD
442002-09-10 Gary V. Vaughan <gary@gnu.org>
45
46 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
47 with an Autoconf-2.5x style configure.ac.
48
09ba4ab2
PE
492002-09-06 Paul Eggert <eggert@twinsun.com>
50
51 * doc/bison.texinfo (Conditions): Make explicit that the GPL
52 exception applies only to yacc.c. This is a modification of a
53 patch originally suggested by Akim Demaille.
54
21846f69
AD
552002-09-06 Akim Demaille <akim@epita.fr>
56
09ba4ab2
PE
57 * data/c.m4 (b4_copyright): Move the GPL exception comment from
58 here to...
59 * data/yacc.c: here.
60
21846f69
AD
61 * data/lalr1.cc (struct yyltype): Don't define it, since we use
62 LocationType.
63 (b4_ltype): Default to yy::Location from location.hh.
64
c0ad8bf3
AD
652002-09-04 Jim Meyering <jim@meyering.net>
66
67 * data/yacc.c: Guard the declaration of yytoknum also with
68 `#ifdef YYPRINT', so it is declared only when used.
69
3a93251e
AD
702002-09-04 Akim Demaille <akim@epita.fr>
71
72 * configure.in: Rename as...
73 * configure.ac: this.
74 Bump to 1.49c.
75
427c0dda
AD
762002-09-04 Akim Demaille <akim@epita.fr>
77
78 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
79 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
80 translate maintainer only messages.
81
6a254321
PE
822002-08-12 Paul Eggert <eggert@twinsun.com>
83
645e30d1
PE
84 Version 1.49b.
85
6a254321
PE
86 * Makefile.am (SUBDIRS): Remove intl.
87 (DISTCLEANFILES): Remove.
88 * NEWS: Mention that GNU M4 is now required. Clarify what is
89 meant by "larger grammars". Mention the pt_BR translation.
90 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
91 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
92 Bump version from 0.11.2 to 0.11.5.
93 (BISON_PREREQ_STAGE): Remove.
94 (AM_GNU_GETTEXT): Use external gettext.
95 (AC_OUTPUT): Remove intl/Makefile.
96
97 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
98
99 * data/glr.c: Include string.h, for strlen.
100 (yyreportParseError): Use size_t for yysize.
101 (yy_yypstack): No longer nested inside yypstates, as nested
102 functions are not portable. Do not assume size_t is the
103 same width as int.
104 (yypstates): Do not assume that ptrdiff_t is the same width
105 as int, and similarly for yyposn and YYINDEX.
106
107 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
108
109 * lib/Makefile.am (INCLUDES): Do not include from the intl
110 directory, which has been removed.
111 * src/Makefile.am (INCLUDES): Likewise.
112
113 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
114 (bitsets_sources, additional_bitsets_sources, timevars_sources):
115 New vars.
116
117 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
118 * tests/Makefile.am (EXTRA_DIST): Likewise.
119
120 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
121 Do not assume that bitset_windex is the same width as unsigned.
122
123 * lib/abitset.c (abitset_unused_clear): Do not assume that
124 bitset_word is the same width as int.
125 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
126 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
127 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
128 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
129 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
130
131 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
132 portability to one's complement hosts!).
133 * lib/ebitset.c (ebitset_op1): Likewise.
134 * lib/lbitset.c (lbitset_op1): Likewise.
135
136 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
137 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
138 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
139 Sync with fileutils.
140 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
141 lib/gettext.h: Sync with diffutils.
142
143 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
144 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
145
146 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
147 PROTOTYPES to check for prototypes, and "defined __STDC__" to
148 check for void *.
149
150 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
151 size_t; the old version tried to do this but casted improperly.
152 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
153 (bitset_test): Now returns int, not unsigned long.
154
155 * lib/bitset_stats.c: Include "gettext.h".
156 (_): New macro.
157 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
158 name locals "index", as it generates unnecessary warnings on some
159 hosts that have an "index" function.
160
161 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
162 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
163 they need translation.
164 * src/LR0.c (state_list_append, new_itemsets, get_state,
165 append_states, generate_states): Likewise.
166 * src/assoc.c (assoc_to_string): Likewise.
167 * src/closure.c (print_closure, set_firsts, closure): Likewise.
168 * src/gram.c (grammar_dump): Likewise.
169 * src/injections.c (injections_compute): Likewise.
170 * src/lalr.c (lookaheads_print): Likewise.
171 * src/relation.c (relation_transpose): Likewise.
172 * src/scan-gram.l: Likewise.
173 * src/tables.c (table_grow, pack_vector): Likewise.
174
175 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
176 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
177 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
178 * m4/mbstate_t.m4: Sync with fileutils.
179 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
180
181 * po/LINGUAS: Add pt_BR.
182 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
183 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
184 lib/timevar.c.
185 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
186 manual recommends.
187 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
188
189 * src/complain.c (strerror_r): Remove decl; not needed.
190 (strerror): Use same pattern as ../lib/error.c.
191
192 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
193
194 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
195
196 * src/main.c (main): Cast result of bindtextdomain and textdomain
197 to void, to avoid a GCC warning when --disable-nls is in effect.
198
199 * src/scan-gram.l: Use strings rather than escapes when possible,
200 to minimize the number of warnings from xgettext.
201 (handle_action_dollar, handle_action_at): Don't use isdigit,
202 as it mishandles negative chars and it may not work as expected
203 outside the C locale.
204
205 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
206 this is a GCC extension and is not portable to other compilers.
207
208 * src/system.h (alloca): Use same pattern as ../lib/error.c.
209 Do not include <ctype.h>; no longer needed.
210 Do not include <malloc.h>; no longer needed (and generates
211 warnings on OpenBSD 3.0).
212
213 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
214 it's not portable.
215
216 * tests/regression.at: Do not use 'cc -c input.c -o input';
217 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
218
219 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
220 exit status as failure, not just exit status 1. Sun C exits
221 with status 2 sometimes.
222
223 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
224 Use it for the two large tests.
225
c8f002c7
AD
2262002-08-02 Akim Demaille <akim@epita.fr>
227
228 * src/conflicts.c (conflicts_output): Don't output rules never
229 reduced here, since anyway that computation doesn't work.
230 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
231 (rule_useless_p, rule_never_reduced_p): New.
232 (grammar_rules_partial_print): Use a filter instead of a range.
233 Display the title only if needed.
234 (grammar_rules_print): Adjust.
235 (grammar_rules_never_reduced_report): New.
236 * src/tables.c (action_row): Move the computation of rules never
237 reduced to...
238 (token_actions): here.
239 * src/main.c (main): Make the parser before making the report, so
240 that rules never reduced are computed.
241 Call grammar_rules_never_reduced_report.
242 * src/print.c (print_results): Report rules never reduced.
243 * tests/conflicts.at, tests/reduce.at: Adjust.
244
cd08e51e
AD
2452002-08-01 Akim Demaille <akim@epita.fr>
246
247 Instead of attaching lookaheads and duplicating the rules being
248 reduced by a state, attach the lookaheads to the reductions.
249
250 * src/state.h (state_t): Remove the `lookaheads',
251 `lookaheads_rule' member.
252 (reductions_t): Add a `lookaheads' member.
253 Use a regular array for the `rules'.
254 * src/state.c (reductions_new): Initialize the lookaheads member
255 to 0.
256 (state_rule_lookaheads_print): Adjust.
257 * src/state.h, src/state.c (state_reductions_find): New.
258 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
259 (count_rr_conflicts): Adjust.
260 * src/lalr.c (LArule): Remove.
261 (add_lookback_edge): Adjust.
262 (state_lookaheads_count): New.
263 (states_lookaheads_initialize): Merge into...
264 (initialize_LA): this.
265 (lalr_free): Adjust.
266 * src/main.c (main): Don't free nullable and derives too early: it
267 is used by --verbose.
268 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
269
bb0027a9
AD
2702002-08-01 Akim Demaille <akim@epita.fr>
271
272 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
273 `rule_number_t**'.
274 (set_derives, free_derives): Rename as...
275 (derives_compute, derives_free): this.
276 Adjust all dependencies.
277 * src/nullable.c (set_nullable, free_nullable): Rename as...
278 (nullable_compute, nullable_free): these.
279 (rule_list_t): Store rule_t *, not rule_number_t.
280 * src/state.c (state_rule_lookaheads_print): Directly compare rule
281 pointers, instead of their numbers.
282 * src/main.c (main): Call nullable_free, and derives_free earlier,
283 as they were lo longer used.
284
3325ddc4
AD
2852002-08-01 Akim Demaille <akim@epita.fr>
286
287 * lib/timevar.c (get_time): Include children time.
288 * src/lalr.h (LA, LArule): Don't export them: used with the
289 state_t.
290 * src/lalr.c (LA, LArule): Static.
291 * src/lalr.h, src/lalr.c (lalr_free): New.
292 * src/main.c (main): Call it.
293 * src/tables.c (pack_vector): Check whether loc is >= to the
294 table_size, not >.
295 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
296 (tables_generate): do it, since that's also it which allocates
297 them.
298 Don't free LA and LArule, main does.
299
c6f1a33c
AD
3002002-07-31 Akim Demaille <akim@epita.fr>
301
302 Separate parser tables computation and output.
303
304 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
305 (conflict_list, conflict_list_cnt, table, check, table_ninf)
306 (yydefgoto, yydefact, high): Move to...
307 * src/tables.h, src/tables.c: here.
308 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
309 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
310 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
311 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
312 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
313 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
314 (action_row, save_row, token_actions, save_column, default_goto)
315 (goto_actions, sort_actions, matching_state, pack_vector)
316 (table_ninf_remap, pack_table, prepare_actions): Move to...
317 * src/tables.c: here.
318 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
319 * src/output.c (token_actions, output_base, output_conflicts)
320 (output_check): Merge into...
321 (prepare_actions): this.
322 (actions_output): Rename as...
323 (user_actions_output): this.
324 * src/main.c (main): Call tables_generate and tables_free.
325
1509d42f
AD
3262002-07-31 Akim Demaille <akim@epita.fr>
327
328 Steal GCC's --time-report support.
329
330 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
331 stolen/adjusted from GCC.
332 * m4/stage.m4: Remove time related checks.
333 * m4/timevar.m4: New.
334 * configure.in: Adjust.
335 * src/system.h: Adjust to using timevar.h.
336 * src/getargs.h, src/getargs.c: Support trace_time for
337 --trace=time.
338 * src/main.c (stage): Remove.
339 (main): Replace `stage' invocations with timevar calls.
340 * src/output.c: Insert pertinent timevar calls.
341
273a74fa
AD
3422002-07-31 Akim Demaille <akim@epita.fr>
343
344 Let --trace have arguments.
345
346 * src/getargs.h (enum trace_e): New.
347 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
348 (long_options, short_options): --trace/-T takes an optional
349 argument.
350 Change all the uses of trace_flag to reflect the new flags.
351 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
352
353 Strengthen `stage' portability.
354
355 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
356 * configure.in: Use it.
357 Don't check for malloc.h and sys/times.h.
358 * src/system.h: Include them when appropriate.
359 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
360 times and struct tms are available.
361
217598da
AD
3622002-07-30 Akim Demaille <akim@epita.fr>
363
364 In verbose parse error message, don't report `error' as an
365 expected token.
366 * tests/actions.at (Printers and Destructors): Adjust.
367 * tests/calc.at (Calculator $1): Adjust.
368 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
369 error message, do not report the parser accepts the error token in
370 that state.
371
52489d44
AD
3722002-07-30 Akim Demaille <akim@epita.fr>
373
374 Normalize conflict related messages.
375
376 * src/complain.h, src/complain.c (warn, complain): New.
377 * src/conflicts.c (conflicts_print): Use them.
378 (conflict_report_yacc): New, extracted from...
379 (conflicts_print): here.
380 * tests/conflicts.at, tests/existing.at: Adjust.
381
e8832397
AD
3822002-07-30 Akim Demaille <akim@epita.fr>
383
384 Report rules which are never reduced by the parser: those hidden
385 by conflicts.
386
387 * src/LR0.c (save_reductions): Don't make the final state too
388 different: save its reduction (accept) instead of having a state
389 without any action (no shift or goto, no reduce).
390 Note: the final state is now a ``regular'' state, i.e., the
391 parsers now contain `reduce 0' as default reduction.
392 Nevertheless, since they decide to `accept' when yystate =
393 final_state, they still will not reduce rule 0.
394 * src/print.c (print_actions, print_reduction): Adjust.
395 * src/output.c (action_row): Track reduced rules.
396 (token_actions): Report rules never reduced.
397 * tests/conflicts.at, tests/regression.at: Adjust.
398
caf23d24
AD
3992002-07-30 Akim Demaille <akim@epita.fr>
400
401 `stage' was accidently included in a previous patch.
402 Initiate its autoconfiscation.
403
404 * configure.in: Look for malloc.h and sys/times.h.
405 * src/main.c (stage): Adjust.
406 Report only when trace_flag.
407
640748ee
AD
4082002-07-29 Akim Demaille <akim@epita.fr>
409
410 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
411 state_number_t.
412 (errs_t): symbol_t*, not symbol_number_t.
413 (reductions_t): rule_t*, not rule_number_t.
414 (FOR_EACH_SHIFT): New.
415 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
416 * src/print.c, src/print_graph.c: Adjust.
417
88bce5a2
AD
4182002-07-29 Akim Demaille <akim@epita.fr>
419
420 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
421
422 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
423 (endtoken, accept): these.
424 * src/reader.c (reader): Set endtoken's default tag to "$end".
425 Set undeftoken's tag to "$undefined" instead of "$undefined.".
426 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
427 Adjust.
428
1bfb97db
AD
4292002-07-29 Akim Demaille <akim@epita.fr>
430
431 * src/reduce.c (reduce_grammar): When the language is empty,
432 complain about the start symbol, not the axiom.
433 Use its location.
434 * tests/reduce.at (Empty Language): New.
435
fc5734fe
AD
4362002-07-26 Akim Demaille <akim@epita.fr>
437
438 * src/reader.h, src/reader.c (gram_error): ... can't get
439 yycontrol without making too strong assumptions on the parser
440 itself.
441 * src/output.c (prepare_tokens): Use the real 0th value of
442 token_translations instead of `0'.
443 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
444 visible here.
445 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
446 for the time being: %locations ought to provide it to yyerror.
447
3650b4b8
AD
4482002-07-25 Akim Demaille <akim@epita.fr>
449
450 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
451 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
452 * tests/regression.at (Web2c Actions): Adjust.
453
4b3d3a8e
AD
4542002-07-25 Akim Demaille <akim@epita.fr>
455
456 Stop storing rules from 1 to nrules + 1.
457
458 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
459 * src/nullable.c, src/output.c, src/print.c, src/reader.c
460 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
461 Iterate from 0 to nrules.
462 Use rule_number_as_item_number and item_number_as_rule_number.
463 Adjust to `derive' now containing possibly 0.
464 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
465 Handle the `- 1' part in rule numbers from/to item numbers.
466 * src/conflicts.c (log_resolution): Fix the message which reversed
467 shift and reduce.
468 * src/output.c (action_row): Initialize default_rule to -1.
469 (token_actions): Adjust.
470 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
471 expected output.
472 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
473
4a2a22f4
AD
4742002-07-25 Akim Demaille <akim@epita.fr>
475
476 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
477 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
478 (b4_c_knr_arg_decl): New.
479 * data/yacc.c: Use it to define yysymprint, yydestruct, and
480 yyreport_parse_error.
481
b8df3223
AD
4822002-07-25 Akim Demaille <akim@epita.fr>
483
484 * data/yacc.c (yyreport_parse_error): New, extracted from...
485 (yyparse): here.
486 (yydestruct, yysymprint): Move above yyparse.
487 Be K&R compliant.
488
a762e609
AD
4892002-07-25 Akim Demaille <akim@epita.fr>
490
491 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
492 replace...
493 (b4_sint_type, b4_uint_type): these.
494 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
495 * tests/regression.at (Web2c Actions): Adjust.
496
12b0043a
AD
4972002-07-25 Akim Demaille <akim@epita.fr>
498
499 * src/gram.h (TIEM_NUMBER_MAX): New.
500 (item_number_of_rule_number, rule_number_of_item_number): Rename
501 as...
502 (rule_number_as_item_number, item_number_as_rule_number): these.
503 Adjust dependencies.
504 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
505 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
506 (symbol_number_to_vector_number): New.
507 (order): Of vector_number_t* type.
508 (base_t, BASE_MAX, BASE_MIN): New.
509 (froms, tos, width, pos, check): Of base_t type.
510 (action_number_t, ACTION_MIN, ACTION_MAX): New.
511 (actrow): Of action_number_t type.
512 (conflrow): Of unsigned int type.
513 (table_ninf, base_ninf): New.
514 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
515 (muscle_insert_int_table, muscle_insert_base_table)
516 (muscle_insert_rule_number_table): New.
517 (prepare_tokens): Output `toknum' as int_table.
518 (action_row): Returns a rule_number_t.
519 Use ACTION_MIN, not SHRT_MIN.
520 (token_actions): yydefact is rule_number_t*.
521 (table_ninf_remap): New.
522 (pack_table): Use it for `base' and `table'.
523 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
524 replaced with...
525 (YYPACT_NINF, YYTABLE_NINF): these.
526 (yypact, yytable): Compute their types instead of hard-coded
527 `short'.
528 * tests/regression.at (Web2c Actions): Adjust.
529
5dde258a
AD
5302002-07-19 Akim Demaille <akim@epita.fr>
531
532 * src/scan-gram.l (id): Can start with an underscore.
533
a945ec39
AD
5342002-07-16 Akim Demaille <akim@epita.fr>
535
536 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
537 Adjust all former `associativity' dependencies.
538 * src/symtab.c (symbol_new): Default associativity is `undef', not
539 `right'.
540 (symbol_check_alias_consistence): Adjust.
541
fae437e8
AD
5422002-07-09 Akim Demaille <akim@epita.fr>
543
544 * doc/bison.texinfo: Properly set the ``header'' part.
545 Use @dircategory ``GNU programming tools'' as per Texinfo's
546 documentation.
547 Use @copying.
548
1a715ef2
AD
5492002-07-09 Akim Demaille <akim@epita.fr>
550
551 * lib/quotearg.h: Protect against multiple inclusions.
552 * src/location.h (location_t): Add a `file' member.
553 (LOCATION_RESET, LOCATION_PRINT): Adjust.
554 * src/complain.c (warn_at, complain_at, fatal_at): Drop
555 `error_one_per_line' support.
556
a5d50994
AD
5572002-07-09 Akim Demaille <akim@epita.fr>
558
559 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
560 * src/reader.c (lineno): Remove.
561 Adjust all dependencies.
562 (get_merge_function): Take a location and use complain_at.
563 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
564 * tests/regression.at (Invalid inputs, Mixing %token styles):
565 Adjust.
566
b275314e
AD
5672002-07-09 Akim Demaille <akim@epita.fr>
568
569 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
570 recovery rule, and forbid extensions when --yacc.
571 (gram_error): Use complain_at.
572 * src/reader.c (reader): Exit if there were parse errors.
573
865b9df1
AD
5742002-07-09 Akim Demaille <akim@epita.fr>
575
576 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
577 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
578 Reported by R Blake <blakers@mac.com>.
579
c76e14da
AD
5802002-07-09 Akim Demaille <akim@epita.fr>
581
582 * data/yacc.c: Output the copyright notive in the header.
583
7db2ed2d
AD
5842002-07-03 Akim Demaille <akim@epita.fr>
585
586 * src/output.c (froms, tos): Are state_number_t.
587 (save_column): sp, sp1, and sp2 are state_number_t.
588 (prepare): Rename `final' as `final_state_number', `nnts' as
589 `nterms_number', `nrules' as `rules_number', `nstates' as
590 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
591 unused.
592 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
593 * data/lalr1.cc (nsym_): Remove, unused.
594
e68e0410
AD
5952002-07-03 Akim Demaille <akim@epita.fr>
596
597 * src/lalr.h, src/lalr.c (goto_number_t): New.
598 * src/lalr.c (goto_list_t): New.
599 Propagate them.
600 * src/nullable.c (rule_list_t): New.
601 Propagate.
602 * src/types.h: Remove.
603
e1a4f3a4
AD
6042002-07-03 Akim Demaille <akim@epita.fr>
605
606 * src/closure.c (print_fderives): Use rule_rhs_print.
607 * src/derives.c (print_derives): Use rule_rhs_print.
608 (rule_list_t): New, replaces `shorts'.
609 (set_derives): Add comments.
610 * tests/sets.at (Nullable, Firsts): Adjust.
611
536545f3
AD
6122002-07-03 Akim Demaille <akim@epita.fr>
613
614 * src/output.c (prepare_actions): Free `tally' and `width'.
615 (prepare_actions): Allocate and free `order'.
616 * src/symtab.c (symbols_free): Free `symbols'.
617 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
618 * src/output.c (m4_invoke): Move to...
619 * src/scan-skel.l: here.
620 (<<EOF>>): Close yyout, and free its name.
621
8b752b00
AD
6222002-07-03 Akim Demaille <akim@epita.fr>
623
624 Fix some memory leaks, and fix a bug: state 0 was examined twice.
625
626 * src/LR0.c (new_state): Merge into...
627 (state_list_append): this.
628 (new_states): Merge into...
629 (generate_states): here.
630 (set_states): Don't ensure a proper `errs' state member here, do it...
631 * src/conflicts.c (conflicts_solve): here.
632 * src/state.h, src/state.c: Comment changes.
633 (state_t): Rename member `shifts' as `transitions'.
634 Adjust all dependencies.
635 (errs_new): For consistency, also take the values as argument.
636 (errs_dup): Remove.
637 (state_errs_set): New.
638 (state_reductions_set, state_transitions_set): Assert that no
639 previous value was assigned.
640 (state_free): New.
641 (states_free): Use it.
642 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
643 temporary storage: use `errs' and `nerrs' as elsewhere.
644 (set_conflicts): Allocate and free this `errs'.
645
613f5e1a
AD
6462002-07-02 Akim Demaille <akim@epita.fr>
647
648 * lib/libiberty.h: New.
649 * lib: Update the bitset implementation from upstream.
650 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
651 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
652 * src/main.c: Adjust bitset stats calls.
653
26e0cadc
PE
6542002-07-01 Paul Eggert <eggert@twinsun.com>
655
656 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
657 char, so that negative chars don't collide with $.
658
1154cced
AD
6592002-06-30 Akim Demaille <akim@epita.fr>
660
661 Have the GLR tests be `warning' checked, and fix the warnings.
662
663 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
664 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
665 (yyremoveDeletes): `yyi' and `yyj' are size_t.
666 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
667 (yyaddDeferredAction): static.
668 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
669 (yyreportParseError): yyprefix is const.
670 yytokenp is used only when verbose.
671 (yy__GNUC__): Replace with __GNUC__.
672 (yypdumpstack): yyi is size_t.
673 (yypreference): Un-yy local variables and arguments, to avoid
674 clashes with `yyr1'. Anyway, we are not in the user name space.
675 (yytname_size): be an int, as is compared with ints.
676 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
677 Use them.
678 * tests/cxx-gram.at: Use quotation to protect $1.
679 Use AT_COMPILE to enable warnings hunts.
680 Prototype yylex and yyerror.
681 `Use' argc.
682 Include `string.h', not `strings.h'.
683 Produce and prototype stmtMerge only when used.
684 yylex takes a location.
685
97650f4e
AD
6862002-06-30 Akim Demaille <akim@epita.fr>
687
688 We spend a lot of time in quotearg, in particular when --verbose.
689
690 * src/symtab.c (symbol_get): Store a quoted version of the key.
691 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
692 Adjust all callers.
693
d2576365
AD
6942002-06-30 Akim Demaille <akim@epita.fr>
695
696 * src/state.h (reductions_t): Rename member `nreds' as num.
697 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
698 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
699
ccaf65bc
AD
7002002-06-30 Akim Demaille <akim@epita.fr>
701
702 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
703 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
704 (shifts_to): Rename as...
705 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
706 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
707 (TRANSITION_IS_DISABLED, transitions_to): these.
708
87675353
AD
7092002-06-30 Akim Demaille <akim@epita.fr>
710
711 * src/print.c (print_shifts, print_gotos): Merge into...
712 (print_transitions): this.
713 (print_transitions, print_errs, print_reductions): Align the
714 lookaheads columns.
715 (print_core, print_transitions, print_errs, print_state,
716 print_grammar): Output empty lines separator before, not after.
717 (state_default_rule_compute): Rename as...
718 (state_default_rule): this.
719 * tests/conflicts.at (Defaulted Conflicted Reduction),
720 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
721 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
722
ce4ccb4b
AD
7232002-06-30 Akim Demaille <akim@epita.fr>
724
725 Display items as we display rules.
726
727 * src/gram.h, src/gram.c (rule_lhs_print): New.
728 * src/gram.c (grammar_rules_partial_print): Use it.
729 * src/print.c (print_core): Likewise.
730 * tests/conflicts.at (Defaulted Conflicted Reduction),
731 (Unresolved SR Conflicts): Adjust.
732 (Unresolved SR Conflicts): Adjust and rename as...
733 (Resolved SR Conflicts): this, as was meant.
734 * tests/regression.at (Web2c Report): Adjust.
735
bc933ef1
AD
7362002-06-30 Akim Demaille <akim@epita.fr>
737
738 * src/print.c (state_default_rule_compute): New, extracted from...
739 (print_reductions): here.
740 Pessimize, but clarify the code.
741 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
742
53d4308d
AD
7432002-06-30 Akim Demaille <akim@epita.fr>
744
745 * src/output.c (action_row): Let default_rule be always a rule
746 number.
747
574fb2d5
AD
7482002-06-30 Akim Demaille <akim@epita.fr>
749
750 * src/closure.c (print_firsts, print_fderives, closure):
751 Use BITSET_EXECUTE.
752 * src/lalr.c (lookaheads_print): Likewise.
753 * src/state.c (state_rule_lookaheads_print): Likewise.
754 * src/print_graph.c (print_core): Likewise.
755 * src/print.c (print_reductions): Likewise.
756 * src/output.c (action_row): Likewise.
757 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
758
05811fd7
AD
7592002-06-30 Akim Demaille <akim@epita.fr>
760
761 * src/print_graph.c: Use report_flag.
762
0e4d5753
AD
7632002-06-30 Akim Demaille <akim@epita.fr>
764
765 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
766 to...
767 * src/relation.h, src/relation.c (traverse, relation_digraph)
768 (relation_print, relation_transpose): New.
769
24c7d800
AD
7702002-06-30 Akim Demaille <akim@epita.fr>
771
772 * src/state.h, src/state.c (shifts_to): New.
773 * src/lalr.c (build_relations): Use it.
774
9222837b
AD
7752002-06-30 Akim Demaille <akim@epita.fr>
776
777 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
778 (item_number_of_rule_number, rule_number_of_item_number): New.
779 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
780 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
781 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
782 Propagate their use.
783 Much remains to be done, in particular wrt `shorts' from types.h.
784
260008e5
AD
7852002-06-30 Akim Demaille <akim@epita.fr>
786
787 * src/symtab.c (symbol_new): Initialize the `printer' member.
788
8a731ca8
AD
7892002-06-30 Akim Demaille <akim@epita.fr>
790
791 * src/LR0.c (save_reductions): Remove, replaced by...
792 * src/state.h, src/state.c (state_reductions_set): New.
793 (reductions, errs): Rename as...
794 (reductions_t, errs_t): these.
795 Adjust all dependencies.
796
32e1e0a4
AD
7972002-06-30 Akim Demaille <akim@epita.fr>
798
799 * src/LR0.c (state_list_t, state_list_append): New.
800 (first_state, last_state): Now symbol_list_t.
801 (this_state): Remove.
802 (new_itemsets, append_states, save_reductions): Take a state_t as
803 argument.
804 (set_states, generate_states): Adjust.
805 (save_shifts): Remove, replaced by...
806 * src/state.h, src/state.c (state_shifts_set): New.
807 (shifts): Rename as...
808 (shifts_t): this.
809 Adjust all dependencies.
810 * src/state.h (state_t): Remove the `next' member.
811
e5fb6710
AD
8122002-06-30 Akim Demaille <akim@epita.fr>
813
814 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
815 escaped in slot 0.
816
c7ca99d4
AD
8172002-06-30 Akim Demaille <akim@epita.fr>
818
819 Use hash.h for the state hash table.
820
821 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
822 (allocate_storage): Use state_hash_new.
823 (free_storage): Use state_hash_free.
824 (new_state, get_state): Adjust.
825 * src/lalr.h, src/lalr.c (states): Move to...
826 * src/states.h (state_t): Remove the `link' member, no longer
827 used.
828 * src/states.h, src/states.c: here.
829 (state_hash_new, state_hash_free, state_hash_lookup)
830 (state_hash_insert, states_free): New.
831 * src/states.c (state_table, state_compare, state_hash): New.
832 * src/output.c (output_actions): Do not free states now, since we
833 still need to know the final_state number in `prepare', called
834 afterwards. Do it...
835 * src/main.c (main): here: call states_free after `output'.
836
df0e7316
AD
8372002-06-30 Akim Demaille <akim@epita.fr>
838
839 * src/state.h, src/state.c (state_new): New, extracted from...
840 * src/LR0.c (new_state): here.
841 * src/state.h (STATE_ALLOC): Move to...
842 * src/state.c: here.
843 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
844 * src/state.h, src/state.c: here.
845
39f41916
AD
8462002-06-30 Akim Demaille <akim@epita.fr>
847
848 * src/reader.c (gensym): Rename as...
849 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
850 (getsym): Rename as...
851 (symbol_get): this.
852
d57650a5
AD
8532002-06-30 Akim Demaille <akim@epita.fr>
854
855 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
856 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
857 * src/output.c, src/print.c, src/print_graph.c: Propagate.
858 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
859
5a08f1ce
AD
8602002-06-30 Akim Demaille <akim@epita.fr>
861
862 Make the test suite pass with warnings checked.
863
864 * tests/actions.at (Printers and Destructors): Improve.
865 Avoid unsigned vs. signed issues.
866 * tests/calc.at: Don't exercise the scanner here, do it...
867 * tests/input.at (Torturing the Scanner): here.
868
720623af
PH
8692002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
870
88e7e941 871 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
872 reorganize first lines parallel to yacc.c.
873
fb8135fa
AD
8742002-06-28 Akim Demaille <akim@epita.fr>
875
876 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
877 (b4_token_enum, b4_token_defines): New, factored from...
878 * data/lalr1.cc, data/yacc.c, glr.c: here.
879
41442480
AD
8802002-06-28 Akim Demaille <akim@epita.fr>
881
882 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
883 unused variables.
884 * src/output.c (merger_output): static.
885
e0e5bf84
AD
8862002-06-28 Akim Demaille <akim@epita.fr>
887
888 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
889 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
890 pacify GCC.
891 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 892
676385e2
PH
8932002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
894
895 Accumulated changelog for new GLR parsing features.
896
6a254321 897 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
898 conflicts_total_count.
899 * src/conflicts.h: Ditto.
900 * src/output.c (token_actions): Use the new name.
901 (output_conflicts): Change conflp => conflict_list_heads, and
902 confl => conflict_list for better readability.
903 * data/glr.c: Use the new names.
904 * NEWS: Add self to GLR announcement.
e0e5bf84 905
676385e2
PH
906 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
907
908 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
909 Akim Demaille.
910
911 * data/bison.glr: Change name to glr.c
912 * data/glr.c: Renamed from bison.glr.
913 * data/Makefile.am: Add glr.c
e0e5bf84
AD
914
915 * src/getargs.c:
916
676385e2
PH
917 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
918 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 919
676385e2
PH
920 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
921
922 * data/bison.glr: Be sure to restore the
923 current #line when returning to the skeleton contents after having
924 exposed the input file's #line.
925
926 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
927
928 * data/bison.glr: Bring up to date with changes to bison.simple.
929
930 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
931
932 * data/bison.glr: Correct definitions that use b4_prefix.
933 Various reformatting.
934 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
935 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
936 yytokenp argument; now part of stack.
937 (yychar): Define to behave as documented.
938 (yyclearin): Ditto.
e0e5bf84 939
676385e2
PH
940 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
941
942 * src/reader.h: Add declaration for free_merger_functions.
943
944 * src/reader.c (merge_functions): New variable.
945 (get_merge_function): New function.
946 (free_merger_functions): New function.
947 (readgram): Check for %prec that is not followed by a symbol.
948 Handle %dprec and %merge declarations.
949 (packgram): Initialize dprec and merger fields in rules array.
950
951 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
952 conflict_list_cnt, conflict_list_free): New variables.
953 (table_grow): Also grow conflict_table.
e0e5bf84 954 (prepare_rules): Output dprec and merger tables.
676385e2 955 (conflict_row): New function.
e0e5bf84 956 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
957 default reduction in conflicted states for GLR parser so that there
958 are spaces for the conflict lists.
959 (save_row): Also save conflict information.
960 (token_actions): Allocate conflict list.
961 (merger_output): New function.
962 (pack_vector): Pack conflict table, too.
963 (output_conflicts): New function to output yyconflp and yyconfl.
964 (output_check): Allocate conflict_tos.
965 (output_actions): Output conflict tables, also.
966 (output_skeleton): Output b4_mergers definition.
967 (prepare): Output b4_max_rhs_length definition.
968 Use 'bison.glr' as default skeleton for GLR parsers.
969
970 * src/gram.c (glr_parser): New flag.
971 (grammar_free): Call free_merger_functions.
972
973 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
974 all pairs of conflicting reductions, rather than just all tokens
975 causing conflicts. Needed to size conflict tables.
e0e5bf84 976 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
977 interface.
978 (conflicts_print): Ditto.
979 (count_total_conflicts): New function.
980
981 * src/reader.h (merger_list): New type.
982 (merge_functions): New variable.
983
984 * src/lex.h (tok_dprec, tok_merge): New token types.
985
986 * src/gram.h (rule_s): Add dprec and merger fields.
987 (glr_parser): New flag.
988
989 * src/conflicts.h (count_total_conflicts): New function.
990
991 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
992
993 * doc/bison.texinfo (Generalized LR Parsing): New section.
994 (GLR Parsers): New section.
995 (Language and Grammar): Mention GLR parsing.
996 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
997 Correct typo ("tge" -> "the").
998
999 * data/bison.glr: New skeleton for GLR parsing.
1000
1001 * tests/cxx-gram.at: New tests for GLR parsing.
1002
1003 * tests/testsuite.at: Include cxx-gram.at.
1004
1005 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 1006
676385e2
PH
1007 * src/parse-gram.y:
1008
1009 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
1010
1011 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 1012
b5480d74 10132002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
1014
1015 * src/options.h, src/options.c: Remove.
1016 * src/getargs.c (short_options, long_options): New.
1017
60491a94
AD
10182002-06-27 Akim Demaille <akim@epita.fr>
1019
1020 * data/bison.simple, data/bison.c++: Rename as...
1021 * data/yacc.c, data/lalr1.cc: these.
1022 * doc/bison.texinfo (Environment Variables): Remove.
1023
9be0c25b
AD
10242002-06-25 Raja R Harinath <harinath@cs.umn.edu>
1025
1026 * src/getargs.c (report_argmatch): Initialize strtok().
1027
1ae72863
AD
10282002-06-20 Akim Demaille <akim@epita.fr>
1029
1030 * data/bison.simple (b4_symbol_actions): New, replaces...
1031 (b4_symbol_destructor, b4_symbol_printer): these.
1032 (yysymprint): Be sure to call YYPRINT only for tokens, and using
1033 user token numbers.
1034
87542d29
AD
10352002-06-20 Akim Demaille <akim@epita.fr>
1036
1037 * data/bison.simple (yydestructor): Rename as...
1038 (yydestruct): this.
1039
1a31ed21
AD
10402002-06-20 Akim Demaille <akim@epita.fr>
1041
1042 * src/symtab.h, src/symtab.c (symbol_type_set)
1043 (symbol_destructor_set, symbol_precedence_set): The location is
1044 the last argument.
1045 Adjust all callers.
1046
e776192e
AD
10472002-06-20 Akim Demaille <akim@epita.fr>
1048
1049 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
1050 internals.
1051 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
1052 Takes a location.
1053 * src/symtab.h, src/symtab.c (symbol_class_set)
1054 (symbol_user_token_number_set): Likewise.
1055 Adjust all callers.
1056 Promote complain_at.
1057 * tests/input.at (Type Clashes): Adjust.
1058
5c1180b3
AD
10592002-06-20 Akim Demaille <akim@epita.fr>
1060
1061 * data/bison.simple (YYLEX): Fix the declaration when
1062 %pure-parser.
1063
e3170060
AD
10642002-06-20 Akim Demaille <akim@epita.fr>
1065
1066 * data/bison.simple (yysymprint): Don't print the token number,
1067 just its name.
1068 * tests/actions.at (Destructors): Rename as...
1069 (Printers and Destructors): this.
1070 Also exercise %printer.
1071
253862fd
AD
10722002-06-20 Akim Demaille <akim@epita.fr>
1073
1074 * data/bison.simple (YYDSYMPRINT): New.
1075 Use it to remove many of the #if YYDEBUG/if (yydebug).
1076
366eea36
AD
10772002-06-20 Akim Demaille <akim@epita.fr>
1078
1079 * src/symtab.h, src/symtab.c (symbol_t): printer and
1080 printer_location are new members.
1081 (symbol_printer_set): New.
1082 * src/parse-gram.y (PERCENT_PRINTER): New token.
1083 Handle its associated rule.
1084 * src/scan-gram.l: Adjust.
1085 (handle_destructor_at, handle_destructor_dollar): Rename as...
1086 (handle_symbol_code_at, handle_symbol_code_dollar): these.
1087 * src/output.c (symbol_printers_output): New.
1088 (output_skeleton): Call it.
1089 * data/bison.simple (yysymprint): New. Cannot be named yyprint
1090 since there are already many grammar files with a user `yyprint'.
1091 Replace the calls to YYPRINT to calls to yysymprint.
1092 * tests/calc.at: Adjust.
1093 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
1094 taking advantage of parser very internal details (stack size!).
1095
4f25ebb0
AD
10962002-06-20 Akim Demaille <akim@epita.fr>
1097
1098 * src/scan-gram.l: Complete the scanner with the missing patterns
1099 to pacify Flex.
1100 Use `quote' and `symbol_tag_get' where appropriate.
1101
93b68a0e
AD
11022002-06-19 Akim Demaille <akim@epita.fr>
1103
1104 * tests/actions.at (Destructors): Augment to test locations.
1105 * data/bison.simple (yydestructor): Pass it the current location
1106 if locations are enabled.
1107 Prototype only when __STDC__ or C++.
1108 Change the argument names to move into the yy name space: there is
1109 user code here.
1110
58612f1d
AD
11112002-06-19 Akim Demaille <akim@epita.fr>
1112
74310291
AD
1113 * data/bison.simple (b4_pure_if): New.
1114 Use it instead of #ifdef YYPURE.
1115
11162002-06-19 Akim Demaille <akim@epita.fr>
1117
1118 * data/bison.simple (b4_location_if): New.
58612f1d
AD
1119 Use it instead of #ifdef YYLSP_NEEDED.
1120
f25bfb75
AD
11212002-06-19 Akim Demaille <akim@epita.fr>
1122
1123 Prepare @$ in %destructor, but currently don't bind it in the
1124 skeleton, as %location use is not cleaned up yet.
1125
1126 * src/scan-gram.l (handle_dollar, handle_destructor_at)
1127 (handle_action_at): New.
1128 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
1129 a braced_code_t and a location as additional arguments.
1130 (handle_destructor_dollar): Instead of requiring `b4_eval', just
1131 unquote one when outputting `b4_dollar_dollar'.
1132 Adjust callers.
1133 * data/bison.simple (b4_eval): Remove.
1134 (b4_symbol_destructor): Adjust.
1135 * tests/input.at (Invalid @n): Adjust.
1136
c732d2c6
AD
11372002-06-19 Zack Weinberg <zack@codesourcery.com>
1138
1139 * doc/bison.texinfo: Document ability to have multiple
1140 prologue sections.
1141
8c165d89
AD
11422002-06-18 Akim Demaille <akim@epita.fr>
1143
1144 * src/files.c (compute_base_names): When computing the output file
1145 names from the input file name, strip the directory part.
1146
ca98bf57
AD
11472002-06-18 Akim Demaille <akim@epita.fr>
1148
1149 * data/bison.simple.new: Comment changes.
1150 Reported by Andreas Schwab.
1151
0bfb02ff
AD
11522002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
1153
1154 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
1155 there are no `label `yyoverflowlab' defined but not used' warnings
1156 when yyoverflow is defined.
1157
24c0aad7
AD
11582002-06-18 Akim Demaille <akim@epita.fr>
1159
1160 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
1161 new member.
1162 (symbol_destructor_set): Adjust.
1163 * src/output.c (symbol_destructors_output): Output the destructor
1164 locations.
1165 Output the symbol name.
1166 * data/bison.simple (b4_symbol_destructor): Adjust.
1167
5719c109
AD
11682002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
1169 and Akim Demaille <akim@epita.fr>
1170
1171 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
1172 what's left on the stack when the error recovery hits EOF.
1173 * tests/actions.at (Destructors): Complete to exercise this case.
1174
9280d3ef
AD
11752002-06-17 Akim Demaille <akim@epita.fr>
1176
1177 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
1178 arguments is really empty, not only equal to `[]'.
1179 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
1180 member.
1181 (symbol_destructor_set): New.
1182 * src/output.c (symbol_destructors_output): New.
1183 * src/reader.h (brace_code_t, current_braced_code): New.
1184 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
1185 (handle_dollar): Rename as...
1186 (handle_action_dollar): this.
1187 (handle_destructor_dollar): New.
1188 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
1189 (grammar_declaration): Use it.
1190 * data/bison.simple (yystos): Is always defined.
1191 (yydestructor): New.
1192 * tests/actions.at (Destructors): New.
1193 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
1194
dafdc66f
AD
11952002-06-17 Akim Demaille <akim@epita.fr>
1196
1197 * src/symlist.h, src/symlist.c (symbol_list_length): New.
1198 * src/scan-gram.l (handle_dollar, handle_at): Compute the
1199 rule_length only when needed.
1200 * src/output.c (actions_output, token_definitions_output): Output
1201 the full M4 block.
1202 * src/symtab.c: Don't access directly to the symbol tag, use
1203 symbol_tag_get.
1204 * src/parse-gram.y: Use symbol_list_free.
1205
56c47203
AD
12062002-06-17 Akim Demaille <akim@epita.fr>
1207
1208 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
1209 (symbol_list_prepend, get_type_name): Move to...
1210 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
1211 (symbol_list_prepend, symbol_list_n_type_name_get): here.
1212 Adjust all callers.
1213 (symbol_list_free): New.
1214 * src/scan-gram.l (handle_dollar): Takes a location.
1215 * tests/input.at (Invalid $n): Adjust.
1216
1e0bab92
AD
12172002-06-17 Akim Demaille <akim@epita.fr>
1218
1219 * src/reader.h, src/reader.c (symbol_list_new): Export it.
1220 (symbol_list_prepend): New.
1221 * src/parse-gram.y (%union): `list' is a new member.
1222 (symbols.1): New, replaces...
1223 (terms_to_prec.1, nterms_to_type.1): these.
1224 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
1225 Take a location as additional argument.
1226 Adjust all callers.
1227
04e60654
AD
12282002-06-15 Akim Demaille <akim@epita.fr>
1229
1230 * src/parse-gram.y: Move %token in the declaration section so that
1231 we don't depend upon CVS Bison.
1232
10e5b8bd
AD
12332002-06-15 Akim Demaille <akim@epita.fr>
1234
1235 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
1236 * src/print.c (print_core): Use it.
1237
9801d40c
AD
12382002-06-15 Akim Demaille <akim@epita.fr>
1239
1240 * src/conflicts.c (log_resolution): Accept the rule involved in
1241 the sr conflicts instead of the lookahead number that points to
1242 that rule.
1243 (flush_reduce): Accept the current lookahead vector as argument,
1244 instead of the index in LA.
1245 (resolve_sr_conflict): Accept the current number of lookahead
1246 bitset to consider for the STATE, instead of the index in LA.
1247 (set_conflicts): Adjust.
1248 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
1249
c0263492
AD
12502002-06-15 Akim Demaille <akim@epita.fr>
1251
1252 * src/state.h (state_t): Replace the `lookaheadsp' member, a
1253 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
1254 Adjust all dependencies.
1255 * src/lalr.c (initialize_lookaheads): Split into...
1256 (states_lookaheads_count, states_lookaheads_initialize): these.
1257 (lalr): Adjust.
1258
9757c359
AD
12592002-06-15 Akim Demaille <akim@epita.fr>
1260
1261 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
1262 out of...
1263 (grammar_rules_print): here.
1264 * src/reduce.c (reduce_output): Use it.
1265 * tests/reduce.at (Useless Rules, Reduced Automaton)
1266 (Underivable Rules): Adjust.
1267
6b98e4b5
AD
12682002-06-15 Akim Demaille <akim@epita.fr>
1269
1270 Copy BYacc's nice way to report the grammar.
1271
1272 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
1273 New.
1274 Don't print the rules' location, it is confusing and useless.
1275 (rule_print): Use grammar_rhs_print.
1276 * src/print.c (print_grammar): Use grammar_rules_print.
1277
6b98e4b5
AD
12782002-06-15 Akim Demaille <akim@epita.fr>
1279
1280 Complete and rationalize `useless thing' warnings.
1281
1282 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
1283 (symbol_tag_print): New.
1284 Use them everywhere in place of accessing directly the tag member.
1285 * src/gram.h, src/gram.c (rule_print): New.
1286 Use it where a rule used to be printed `by hand'.
1287 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
1288 (reduce_grammar_tables): Report the useless rules.
1289 (reduce_print): Useless things are a warning, not an error.
1290 Report it as such.
1291 * tests/reduce.at (Useless Nonterminals, Useless Rules):
1292 (Reduced Automaton, Underivable Rules): Adjust.
1293 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
1294 * tests/conflicts.at (Unresolved SR Conflicts)
1295 (Solved SR Conflicts): Adjust.
1296
ee000ba4
AD
12972002-06-15 Akim Demaille <akim@epita.fr>
1298
1299 Let symbols have a location.
1300
1301 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
1302 (getsym): Adjust.
1303 Adjust all callers.
1304 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
1305 Use location_t, not int.
1306 * src/symtab.c (symbol_check_defined): Take advantage of the
1307 location.
1308 * tests/regression.at (Invalid inputs): Adjust.
1309
8efe435c
AD
13102002-06-15 Akim Demaille <akim@epita.fr>
1311
1312 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
1313 (input): Don't try to initialize yylloc here, do it in the
1314 scanner.
1315 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
1316 * src/gram.h (rule_t): Change line and action_line into location
1317 and action_location, of location_t type.
1318 Adjust all dependencies.
1319 * src/location.h, src/location.c (empty_location): New.
1320 * src/reader.h, src/reader.c (grammar_start_symbol_set)
1321 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
1322 (grammar_current_rule_symbol_append)
1323 (grammar_current_rule_action_append): Expect a location as argument.
1324 * src/reader.c (grammar_midrule_action): Adjust to attach an
1325 action's location as dummy symbol location.
1326 * src/symtab.h, src/symtab.c (startsymbol_location): New.
1327 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
1328 the line numbers.
1329
1921f1d7
AD
13302002-06-14 Akim Demaille <akim@epita.fr>
1331
1332 Grammar declarations may be found in the grammar section.
1333
1334 * src/parse-gram.y (rules_or_grammar_declaration): New.
1335 (declarations): Each declaration may end with a semicolon, not
1336 just...
1337 (grammar_declaration): `"%union"'.
1338 (grammar): Branch to rules_or_grammar_declaration.
1339
4515534c
AD
13402002-06-14 Akim Demaille <akim@epita.fr>
1341
1342 * src/main.c (main): Invoke scanner_free.
1343
f958596b
AD
13442002-06-14 Akim Demaille <akim@epita.fr>
1345
1346 * src/output.c (m4_invoke): Extracted from...
1347 (output_skeleton): here.
1348 Free tempfile.
1349
2c569025
AD
13502002-06-14 Akim Demaille <akim@epita.fr>
1351
1352 * src/parse-gram.y (directives, directive, gram)
1353 (grammar_directives, precedence_directives, precedence_directive):
1354 Rename as...
1355 (declarations, declaration, grammar, grammar_declaration)
1356 (precedence_declaration, precedence_declarator): these.
1357 (symbol_declaration): New.
1358
592e8d4d
AD
13592002-06-14 Akim Demaille <akim@epita.fr>
1360
1361 * src/files.c (action_obstack): Remove, unused.
1362 (output_obstack): Remove it, and all its dependencies, as it is no
1363 longer needed.
1364 * src/reader.c (epilogue_set): Build the epilogue in the
1365 muscle_obstack.
1366 * src/output.h, src/output.c (muscle_obstack): Move to...
1367 * src/muscle_tab.h, src/muscle_tab.h: here.
1368 (muscle_init): Initialize muscle_obstack.
1369 (muscle_free): New.
1370 * src/main.c (main): Call it.
1371
0c15323d
AD
13722002-06-14 Akim Demaille <akim@epita.fr>
1373
1374 * src/location.h: New, extracted from...
1375 * src/reader.h: here.
1376 * src/Makefile.am (noinst_HEADERS): Merge into
1377 (bison_SOURCES): this.
1378 Add location.h.
1379 * src/parse-gram.y: Use location_t instead of Bison's.
1380 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
1381 Use location_t instead of ints.
1382
e96c9728
AD
13832002-06-14 Akim Demaille <akim@epita.fr>
1384
1385 * data/bison.simple, data/bison.c++: Be sure to restore the
1386 current #line when returning to the skeleton contents after having
1387 exposed the input file's #line.
1388
75d1fe16
AD
13892002-06-12 Akim Demaille <akim@epita.fr>
1390
1391 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
1392 eager.
1393 * tests/actions.at (Exotic Dollars): New.
1394
6c35d22c
AD
13952002-06-12 Akim Demaille <akim@epita.fr>
1396
1397 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
1398 ['"/] too eagerly.
1399 * tests/input.at (Torturing the Scanner): New.
1400
1d6412ad
AD
14012002-06-11 Akim Demaille <akim@epita.fr>
1402
1403 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
1404 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
1405 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
1406 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
1407 * src/reader.c (reader): Use it.
1408
4cdb01db
AD
14092002-06-11 Akim Demaille <akim@epita.fr>
1410
1411 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
1412 Adjust all callers.
1413 (scanner_last_string_free): New.
1414
44995b2e
AD
14152002-06-11 Akim Demaille <akim@epita.fr>
1416
1417 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
1418 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
1419 (last_string, YY_OBS_FREE): New.
1420 Use them when returning an ID.
1421
e9955c83
AD
14222002-06-11 Akim Demaille <akim@epita.fr>
1423
1424 Have Bison grammars parsed by a Bison grammar.
1425
1426 * src/reader.c, src/reader.h (prologue_augment): New.
1427 * src/reader.c (copy_definition): Remove.
1428
1429 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
1430 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
1431 (grammar_current_rule_prec_set, grammar_current_rule_check)
1432 (grammar_current_rule_symbol_append)
1433 (grammar_current_rule_action_append): Export.
1434 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
1435 (symbol_list_action_append): Remove.
1436 Hook the routines from reader.
1437 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
1438 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
1439
1440 * src/reader.c (read_declarations): Remove, unused.
1441
1442 * src/parse-gram.y: Handle the epilogue.
1443 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
1444 (grammar_start_symbol_set): this.
1445 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
1446 * src/reader.c (readgram): Remove, unused.
1447 (reader): Adjust to insert eoftoken and axiom where appropriate.
1448
1449 * src/reader.c (copy_dollar): Replace with...
1450 * src/scan-gram.h (handle_dollar): this.
1451 * src/parse-gram.y: Remove `%thong'.
1452
1453 * src/reader.c (copy_at): Replace with...
1454 * src/scan-gram.h (handle_at): this.
1455
1456 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
1457 New.
1458
1459 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
1460 time being.
1461
1462 * src/reader.h, src/reader.c (grammar_rule_end): New.
1463
1464 * src/parse.y (current_type, current_class): New.
1465 Implement `%nterm', `%token' support.
1466 Merge `%term' into `%token'.
1467 (string_as_id): New.
1468 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
1469 type name.
1470
1471 * src/parse-gram.y: Be sure to handle properly the beginning of
1472 rules.
1473
1474 * src/parse-gram.y: Handle %type.
1475 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
1476
1477 * src/parse-gram.y: More directives support.
1478 * src/options.c: No longer handle source directives.
1479
1480 * src/parse-gram.y: Fix %output.
1481
1482 * src/parse-gram.y: Handle %union.
1483 Use the prologue locations.
1484 * src/reader.c (parse_union_decl): Remove.
1485
1486 * src/reader.h, src/reader.c (epilogue_set): New.
1487 * src/parse-gram.y: Use it.
1488
1489 * data/bison.simple, data/bison.c++: b4_stype is now either not
1490 defined, then default to int, or to the contents of %union,
1491 without `union' itself.
1492 Adjust.
1493 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
1494
1495 * src/output.c (actions_output): Don't output braces, as they are
1496 already handled by the scanner.
1497
1498 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
1499 characters to themselves.
1500
1501 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
1502 that the epilogue has a proper #line.
1503
1504 * src/parse-gram.y: Handle precedence/associativity.
1505
1506 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
1507 a terminal.
1508 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
1509 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
1510 at all to define terminals that cannot be emitted.
1511
1512 * src/scan-gram.l: Escape M4 characters.
1513
1514 * src/scan-gram.l: Working properly with escapes in user
1515 strings/characters.
1516
1517 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
1518 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
1519 grammar.
1520 Use more modest sizes, as for the time being the parser does not
1521 release memory, and therefore the process swallows a huge amount
1522 of memory.
1523
1524 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
1525 stricter %token grammar.
1526
1527 * src/symtab.h (associativity): Add `undef_assoc'.
1528 (symbol_precedence_set): Do nothing when passed an undef_assoc.
1529 * src/symtab.c (symbol_check_alias_consistence): Adjust.
1530
1531 * tests/regression.at (Invalid %directive): Remove, as it is now
1532 meaningless.
1533 (Invalid inputs): Adjust to the new error messages.
1534 (Token definitions): The new grammar doesn't allow too many
1535 eccentricities.
1536
1537 * src/lex.h, src/lex.c: Remove.
1538 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
1539 (copy_character, copy_string2, copy_string, copy_identifier)
1540 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
1541 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
1542 (parse_action): Remove.
1543 * po/POTFILES.in: Adjust.
1544
2e047461
AD
15452002-06-11 Akim Demaille <akim@epita.fr>
1546
1547 * src/reader.c (parse_action): Don't store directly into the
1548 rule's action member: return the action as a string.
1549 Don't require `rule_length' as an argument: compute it.
1550 (grammar_current_rule_symbol_append)
1551 (grammar_current_rule_action_append): New, eved out from
1552 (readgram): here.
1553 Remove `action_flag', `rulelength', unused now.
1554
9af3fbce
AD
15552002-06-11 Akim Demaille <akim@epita.fr>
1556
1557 * src/reader.c (grammar_current_rule_prec_set).
1558 (grammar_current_rule_check): New, eved out from...
1559 (readgram): here.
1560 Remove `xaction', `first_rhs': useless.
1561 * tests/input.at (Type clashes): New.
1562 * tests/existing.at (GNU Cim Grammar): Adjust.
1563
1485e106
AD
15642002-06-11 Akim Demaille <akim@epita.fr>
1565
1566 * src/reader.c (grammar_midrule_action): New, Eved out from
1567 (readgram): here.
1568
da4160c3
AD
15692002-06-11 Akim Demaille <akim@epita.fr>
1570
1571 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1572 New.
1573 (readgram): Use them as replacement of inlined code, crule and
1574 crule1.
1575
f6d0f937
AD
15762002-06-11 Akim Demaille <akim@epita.fr>
1577
1578 * src/reader.c (grammar_end, grammar_symbol_append): New.
1579 (readgram): Use them.
1580 Make the use of `p' as local as possible.
1581
69078d4b
AD
15822002-06-10 Akim Demaille <akim@epita.fr>
1583
1584 GCJ's parser requires the tokens to be defined before the prologue.
1585
1586 * data/bison.simple: Output the token definition before the user's
1587 prologue.
1588 * tests/regression.at (Braces parsing, Duplicate string)
1589 (Mixing %token styles): Check the output from bison.
1590 (Early token definitions): New.
1591
5e424082
AD
15922002-06-10 Akim Demaille <akim@epita.fr>
1593
1594 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1595 assigning twice the same user number to a token, so that we can
1596 use it in...
1597 * src/lex.c (lex): here.
1598 Also use `symbol_class_set' instead of hand written code.
1599 * src/reader.c (parse_assoc_decl): Likewise.
1600
44536b35
AD
16012002-06-10 Akim Demaille <akim@epita.fr>
1602
1603 * src/symtab.c, src/symtab.c (symbol_class_set)
1604 (symbol_user_token_number_set): New.
1605 * src/reader.c (parse_token_decl): Use them.
1606 Use a switch instead of ifs.
1607 Use a single argument.
1608
8b9f2372
AD
16092002-06-10 Akim Demaille <akim@epita.fr>
1610
1611 Remove `%thong' support as it is undocumented, unused, duplicates
1612 `%token's job, and creates useless e-mail traffic with people who
1613 want to know what it is, why it is undocumented, unused, and
1614 duplicates `%token's job.
1615
1616 * src/reader.c (parse_thong_decl): Remove.
1617 * src/options.c (option_table): Remove "thong".
1618 * src/lex.h (tok_thong): Remove.
1619
3ae2b51f
AD
16202002-06-10 Akim Demaille <akim@epita.fr>
1621
1622 * src/symtab.c, src/symtab.c (symbol_type_set)
1623 (symbol_precedence_set): New.
1624 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1625 (value_components_used): Remove, unused.
1626
2f1afb73
AD
16272002-06-09 Akim Demaille <akim@epita.fr>
1628
1629 Move symbols handling code out of the reader.
1630
1631 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1632 (axiom): Move to...
1633 * src/symtab.h, src/symtab.c: here.
1634
1635 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1636 * src/reader.c (startval): Rename as...
1637 * src/symtab.h, src/symtab.c (startsymbol): this.
1638 * src/reader.c: Adjust.
1639
1640 * src/reader.c (symbol_check_defined, symbol_make_alias)
1641 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1642 (token_translations_init)
1643 Move to...
1644 * src/symtab.c: here.
1645 * src/reader.c (packsymbols): Move to...
1646 * src/symtab.h, src/symtab.c (symbols_pack): here.
1647 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1648 argument.
1649
e9bca3ad
AD
16502002-06-03 Akim Demaille <akim@epita.fr>
1651
1652 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1653 then statements.
1654
86eff183
AD
16552002-06-03 Akim Demaille <akim@epita.fr>
1656
1657 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1658 structs with non literals.
1659 * src/scan-skel.l: never-interactive.
1660 * src/conflicts.c (enum conflict_resolution_e): No trailing
1661 comma.
1662 * src/getargs.c (usage): Split long literal strings.
1663 Reported by Hans Aberg.
1664
717be197
AD
16652002-05-28 Akim Demaille <akim@epita.fr>
1666
1667 * data/bison.c++: Use C++ ostreams.
1668 (cdebug_): New member.
1669
670ddffd
AD
16702002-05-28 Akim Demaille <akim@epita.fr>
1671
1672 * src/output.c (output_skeleton): Be sure to allocate enough room
1673 for `/' _and_ for `\0' in full_skeleton.
1674
769b430f
AD
16752002-05-28 Akim Demaille <akim@epita.fr>
1676
1677 * data/bison.c++: Catch up with bison.simple:
1678 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1679 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1680 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1681 and popping traces.
1682
7067cb36
PH
16832002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1684
1685 * src/output.c (output_skeleton): Put an explicit path in front of
1686 the skeleton file name, rather than relying on the -I directory,
1687 to partially alleviate effects of having a skeleton file lying around
1688 in the current directory.
769b430f 1689
4a713ec2
PH
16902002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1691
769b430f 1692 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
1693 obstack_printf should be obstack_fgrow1.
1694
b408954b
AD
16952002-05-26 Akim Demaille <akim@epita.fr>
1696
1697 * src/state.h (state_t): `solved_conflicts' is a new member.
1698 * src/LR0.c (new_state): Set it to 0.
1699 * src/conflicts.h, src/conflicts.c (print_conflicts)
1700 (free_conflicts, solve_conflicts): Rename as...
1701 (conflicts_print, conflicts_free, conflicts_solve): these.
1702 Adjust callers.
1703 * src/conflicts.c (enum conflict_resolution_e)
1704 (solved_conflicts_obstack): New, used by...
1705 (log_resolution): this.
1706 Adjust to attach the conflict resolution to each state.
1707 Complete the description with the precedence/associativity
1708 information.
1709 (resolve_sr_conflict): Adjust.
1710 * src/print.c (print_state): Output its solved_conflicts.
1711 * tests/conflicts.at (Unresolved SR Conflicts)
1712 (Solved SR Conflicts): Exercise --report=all.
1713
a49aecd5
AD
17142002-05-26 Akim Demaille <akim@epita.fr>
1715
1716 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1717 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1718 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1719 (token_number_t, item_number_as_token_number)
1720 (token_number_as_item_number, muscle_insert_token_number_table):
1721 Rename as...
1722 (symbol_number_t, item_number_as_symbol_number)
1723 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1724 these, since it is more appropriate.
1725
5504898e
AD
17262002-05-26 Akim Demaille <akim@epita.fr>
1727
1728 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1729 `Error:' lines.
1730 * data/bison.simple (yystos) [YYDEBUG]: New.
1731 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1732 error recovery.
1733 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1734
ec3bc396
AD
17352002-05-25 Akim Demaille <akim@epita.fr>
1736
1737 * doc/bison.texinfo (Debugging): Split into...
1738 (Tracing): this new section, its former contents, and...
1739 (Understanding): this new section.
1740 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1741 by...
1742 (report_flag): this.
1743 Adjust all dependencies.
1744 (report_args, report_types, report_argmatch): New.
1745 (usage, getargs): Report/support -r, --report.
1746 * src/options.h
1747 (struct option_table_struct): Rename as..,
1748 (struct option_table_s): this.
1749 Rename the `set_flag' member to `flag' to match with getopt_long's
1750 struct.
1751 * src/options.c (option_table): Split verbose into an entry for
1752 %verbose, and another for --verbose.
1753 Support --report/-r, so remove -r from the obsolete --raw.
1754 * src/print.c: Attach full item sets and lookaheads reports to
1755 report_flag instead of trace_flag.
1756 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1757
78df8250
PE
17582002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1759 and Paul Eggert <eggert@twinsun.com>
769b430f 1760
78df8250
PE
1761 * data/bison.simple (yyparse): Correct error handling to conform to
1762 POSIX and yacc. Specifically, after syntax error is discovered,
1763 do not reduce further before shifting the error token.
1764 Clean up the code a bit by removing the labels yyerrdefault,
1765 yyerrhandle, yyerrpop.
1766 * NEWS: Document the above.
1767
c0c9ea05
PH
17682002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1769
1770 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1771 type; it isn't always big enough, since it doesn't necessarily
1772 include non-terminals.
769b430f 1773 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
1774 the latter can be removed.
1775 (yy_token_number_type): Remove, only one use.
1776 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1777 don't use TokenNumberType as element type.
769b430f 1778
c0c9ea05
PH
1779 * tests/regression.at: Modify expected output to agree with change
1780 to yyr1 and yytranslate.
769b430f 1781
6390a83f
FK
17822002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1783
1784 * src/reader.c (parse_action): Use copy_character instead of
1785 obstack_1grow.
1786
db7c8e9a
AD
17872002-05-13 Akim Demaille <akim@epita.fr>
1788
1789 * tests/regression.at (Token definitions): Prototype yylex and
1790 yyerror.
1791
fcc61800
PH
17922002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1793
158c687b 1794 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
1795 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1796 32-bit arithmetic.
1797 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1798
5683e9b2
AD
17992002-05-07 Akim Demaille <akim@epita.fr>
1800
1801 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1802 avoid GCC warnings.
1803
0c2d3f4c
AD
18042002-05-07 Akim Demaille <akim@epita.fr>
1805
1806 Kill GCC warnings.
1807
1808 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1809 over the RHS of each rule.
1810 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1811 * src/state.h (state_t): Member `nitems' is unsigned short.
1812 * src/LR0.c (get_state): Adjust.
1813 * src/reader.c (packgram): Likewise.
1814 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1815 `Type'.
1816 (muscle_insert_int_table): Remove, unused.
1817 (prepare_rules): Remove `max'.
1818
1565b720
AD
18192002-05-06 Akim Demaille <akim@epita.fr>
1820
1821 * src/closure.c (print_firsts): Display of the symbol tags.
1822 (bitmatrix_print): Move to...
1823 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1824 here.
1825 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1826
cfaee611
AD
18272002-05-06 Akim Demaille <akim@epita.fr>
1828
1829 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1830 hash_do_for_each.
1831
458be8e0
AD
18322002-05-06 Akim Demaille <akim@epita.fr>
1833
1834 * src/LR0.c (new_state, get_state): Instead of using the global
1835 `kernel_size' and `kernel_base', have two new arguments:
1836 `core_size' and `core'.
1837 Adjust callers.
1838
a900a624
AD
18392002-05-06 Akim Demaille <akim@epita.fr>
1840
1841 * src/reader.c (packgram): No longer end `ritem' with a 0
1842 sentinel: it is not used.
1843
d4e7d3a1
AD
18442002-05-05 Akim Demaille <akim@epita.fr>
1845
1846 New experimental feature: display the lookaheads in the report and
1847 graph.
1848
1849 * src/print (print_core): When --trace-flag, display the rules
1850 lookaheads.
1851 * src/print_graph.c (print_core): Likewise.
1852 Swap the arguments.
1853 Adjust caller.
1854
39ceb25b
AD
18552002-05-05 Akim Demaille <akim@epita.fr>
1856
1857 * tests/torture.at (Many lookaheads): New test.
1858
5372019f
AD
18592002-05-05 Akim Demaille <akim@epita.fr>
1860
1861 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1862 (GENERATE_MUSCLE_INSERT_TABLE): this.
1863 (output_int_table, output_unsigned_int_table, output_short_table)
1864 (output_token_number_table, output_item_number_table): Replace with...
1865 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1866 (muscle_insert_short_table, muscle_insert_token_number_table)
1867 (muscle_insert_item_number_table): these.
1868 Adjust all callers.
1869 (prepare_tokens): Don't free `translations', since...
1870 * src/reader.h, src/reader.c (grammar_free): do it.
1871 Move to...
1872 * src/gram.h, src/gram.c (grammar_free): here.
1873 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1874 b4_translate_max.
1875
5df5f6d5
AD
18762002-05-05 Akim Demaille <akim@epita.fr>
1877
1878 * src/output.c (output_unsigned_int_table): New.
1879 (prepare_rules): `i' is unsigned.
1880 `prhs', `rline', `r2' are unsigned int.
1881 Rename muscle `rhs_number_max' as `rhs_max'.
1882 Output muscles `prhs_max', `rline_max', and `r2_max'.
1883 Free rline and r1.
1884 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1885 to compute types instead of constant types.
1886 * tests/regression.at (Web2c Actions): Adjust.
1887
b87f8b21
AD
18882002-05-04 Akim Demaille <akim@epita.fr>
1889
1890 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1891 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1892 Adjust dependencies.
1893 * src/output.c (token_definitions_output): Be sure not to output a
1894 `#define 'a'' when fed with `%token 'a' "a"'.
1895 * tests/regression.at (Token definitions): New.
1896
8bb936e4
PE
18972002-05-03 Paul Eggert <eggert@twinsun.com>
1898
1899 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1900 for K&R C.
1901
19022002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1903
1904 * Makefile.am (SUBDIRS): Remove intl.
1905 (EXTRA_DIST): Add config/config.rpath.
1906
53c71a12
AD
19072002-05-03 Akim Demaille <akim@epita.fr>
1908
1909 * data/bison.simple (m4_if): Don't output empty enums.
1910 And actually, output valid enum definitions :(.
1911
289dd0cf
AD
19122002-05-03 Akim Demaille <akim@epita.fr>
1913
1914 * configure.bat: Remove, completely obsolete.
1915 * Makefile.am (EXTRA_DIST): Adjust.
1916 Don't distribute config.rpath...
1917 * config/Makefile.am (EXTRA_DIST): Do it.
1918
db85e524
AD
19192002-05-03 Akim Demaille <akim@epita.fr>
1920
1921 * configure.in (GETTEXT_VERSION): New.
1922 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1923
83ccf991
AD
19242002-05-03 Akim Demaille <akim@epita.fr>
1925
1926 * data/bison.simple (b4_token_enum): New.
1927 (b4_token_defines): Use it to output tokens both as #define and
1928 enums.
1929 Suggested by Paul Eggert.
1930 * src/output.c (token_definitions_output): Don't output spurious
1931 white spaces.
1932
1f418995
AD
19332002-05-03 Akim Demaille <akim@epita.fr>
1934
1935 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1936
45119f04
RA
19372002-05-02 Robert Anisko <robert@lrde.epita.fr>
1938
1939 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1940 Update the stack class, give a try to deque as the default container.
1941
b2d52318
AD
19422002-05-02 Akim Demaille <akim@epita.fr>
1943
1944 * data/bison.simple (yyparse): Do not implement @$ = @1.
1945 (YYLLOC_DEFAULT): Adjust to do it.
1946 * doc/bison.texinfo (Location Default Action): Fix.
1947
3a8b4109
AD
19482002-05-02 Akim Demaille <akim@epita.fr>
1949
1950 * src/reader.c (parse_braces): Merge into...
1951 (parse_action): this.
1952
84614e13
AD
19532002-05-02 Akim Demaille <akim@epita.fr>
1954
1955 * configure.in (ALL_LINGUAS): Remove.
1956 * po/LINGUAS, hr.po: New.
1957
fdbcd8e2
AD
19582002-05-02 Akim Demaille <akim@epita.fr>
1959
1960 Remove the so called hairy (semantic) parsers.
1961
1962 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1963 * src/gram.h, src/gram.c (semantic_parser): Remove.
1964 (rule_t): Remove the guard and guard_line members.
1965 * src/lex.h (token_t): remove tok_guard.
1966 * src/options.c (option_table): Remove %guard and %semantic_parser
1967 support.
1968 * src/output.c, src/output.h (guards_output): Remove.
1969 (prepare): Adjust.
1970 (token_definitions_output): Don't output the `T'
1971 tokens (???).
1972 (output_skeleton): Don't output the guards.
1973 * src/files.c, src/files.c (attrsfile): Remove.
1974 * src/reader.c (symbol_list): Remove the guard and guard_line
1975 members.
1976 Adjust dependencies.
1977 (parse_guard): Remove.
1978 * data/bison.hairy: Remove.
1979 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1980 BISON_HAIRY.
1981
82b6cb3f
AD
19822002-05-02 Akim Demaille <akim@epita.fr>
1983
1984 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1985 (parse_guard): Rename the formal argument `stack_offset' as
1986 `rule_length', which is more readable.
1987 Adjust callers.
1988 (copy_at, copy_dollar): Instead of outputting the hard coded
1989 values of $$, $n and so forth, output invocation to b4_lhs_value,
1990 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1991 Note: this patch partially drops `semantic-parser' support: it
1992 always does `rule_length - n', where semantic parsers ought to
1993 always use `-n'.
82b6cb3f
AD
1994 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1995 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1996
6cbfbcc5
AD
19972002-05-02 Akim Demaille <akim@epita.fr>
1998
1999 * configure.in (AC_INIT): Bump to 1.49b.
2000 (AM_INIT_AUTOMAKE): Short invocation.
2001
b8548114
AD
20022002-05-02 Akim Demaille <akim@epita.fr>
2003
2004 Version 1.49a.
2005
c20cd1fa
AD
20062002-05-01 Akim Demaille <akim@epita.fr>
2007
2008 * src/skeleton.h: Remove.
2009
8a9566d4
AD
20102002-05-01 Akim Demaille <akim@epita.fr>
2011
2012 * src/skeleton.h: Fix the #endif.
2013 Reported by Magnus Fromreide.
2014
8c6d399a
PE
20152002-04-26 Paul Eggert <eggert@twinsun.com>
2016
2017 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
2018 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 2019 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 2020
2b7ed18a
RA
20212002-04-25 Robert Anisko <robert@lrde.epita.fr>
2022
2023 * src/scan-skel.l: Postprocess quadrigraphs.
2024
2025 * src/reader.c (copy_character): New function, used to output
2026 single characters while replacing `[' and `]' with quadrigraphs, to
2027 avoid troubles with M4 quotes.
2028 (copy_comment): Output characters with copy_character.
2029 (read_additionnal_code): Likewise.
2030 (copy_string2): Likewise.
2031 (copy_definition): Likewise.
2032
2033 * tests/calc.at: Exercise M4 quoting.
2034
34a89c50
AD
20352002-04-25 Akim Demaille <akim@epita.fr>
2036
2037 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
2038 between `!' and the command.
2039 Reported by Paul Eggert.
2040
0dd1580a
RA
20412002-04-24 Robert Anisko <robert@lrde.epita.fr>
2042
2043 * tests/calc.at: Exercise prologue splitting.
2044
2045 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
2046 `b4_post_prologue' instead of `b4_prologue'.
2047
2048 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
2049 muscles.
2050 (output): Free pre_prologue_obstack and post_prologue_obstack.
2051 * src/files.h, src/files.c (attrs_obstack): Remove.
2052 (pre_prologue_obstack, post_prologue_obstack): New.
2053 * src/reader.c (copy_definition): Add a parameter to specify the
2054 obstack to fill, instead of using attrs_obstack unconditionally.
2055 (read_declarations): Pass pre_prologue_obstack to copy_definition if
2056 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
2057
83c1796f
PE
20582002-04-23 Paul Eggert <eggert@twinsun.com>
2059
2060 * data/bison.simple: Remove unnecessary commentary and white
2061 space differences from 1_29-branch.
2062 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
2063
2064 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
2065 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
2066 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
2067 constructors or destructors.
2068
2069 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
2070
1207eeac
AD
20712002-04-23 Akim Demaille <akim@epita.fr>
2072
2073 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
2074 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
2075 location with columns.
2076 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
2077 All reported by Paul Eggert.
2078
78ab8f67
AD
20792002-04-22 Akim Demaille <akim@epita.fr>
2080
2081 * src/reduce.c (dump_grammar): Move to...
2082 * src/gram.h, src/gram.c (grammar_dump): here.
2083 Be sure to separate long item numbers.
2084 Don't read the members of a rule's prec if its nil.
2085
133c20e2
AD
20862002-04-22 Akim Demaille <akim@epita.fr>
2087
2088 * src/output.c (table_size, table_grow): New.
2089 (MAXTABLE): Remove, replace uses with table_size.
2090 (pack_vector): Instead of dying when the table is too big, grow it.
2091
9515e8a7
AD
20922002-04-22 Akim Demaille <akim@epita.fr>
2093
2094 * data/bison.simple (yyr1): Its type is that of a token number.
2095 * data/bison.c++ (r1_): Likewise.
2096 * tests/regression.at (Web2c Actions): Adjust.
2097
23c5a174
AD
20982002-04-22 Akim Demaille <akim@epita.fr>
2099
2100 * src/reader.c (token_translations_init): 256 is now the default
2101 value for the error token, i.e., it will be assigned another
2102 number if the user assigned 256 to one of her tokens.
2103 (reader): Don't force 256 to error.
2104 * doc/bison.texinfo (Symbols): Adjust.
2105 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
2106 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
2107 etc. instead of 10, 20, 30 (which was used to `jump' over error
2108 (256) and undefined (2)).
2109
5fbb0954
AD
21102002-04-22 Akim Demaille <akim@epita.fr>
2111
2112 Propagate more token_number_t.
2113
2114 * src/gram.h (token_number_as_item_number)
2115 (item_number_as_token_number): New.
2116 * src/output.c (GENERATE_OUTPUT_TABLE): New.
2117 Use it to create output_item_number_table and
2118 output_token_number_table.
2119 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2120 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
2121 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
2122 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
2123
4f940944
AD
21242002-04-22 Akim Demaille <akim@epita.fr>
2125
2126 * src/output.h, src/output.c (get_lines_number): Remove.
2127
3ded9a63
AD
21282002-04-19 Akim Demaille <akim@epita.fr>
2129
2130 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
2131 as Lex/Flex'.
2132 (Debugging): More details about enabling the debugging features.
2133 (Table of Symbols): Describe $$, $n, @$, and @n.
2134 Suggested by Tim Josling.
2135
e0c471a9
AD
21362002-04-19 Akim Demaille <akim@epita.fr>
2137
2138 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
2139
fecc10cd
AD
21402002-04-10 Akim Demaille <akim@epita.fr>
2141
2142 * src/system.h: Rely on HAVE_LIMITS_H.
2143 Suggested by Paul Eggert.
2144
51dec47b
AD
21452002-04-09 Akim Demaille <akim@epita.fr>
2146
2147 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
2148 full stderr, and strip it according to the bison options, instead
2149 of composing the error message from different bits.
2150 This makes it easier to check for several error messages.
2151 Adjust all the invocations.
2152 Add an invocation exercising the error token.
2153 Add an invocation demonstrating a stupid error message.
2154 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
2155 Adjust the tests.
2156 Error message are for stderr, not stdout.
2157
007a50a4
AD
21582002-04-09 Akim Demaille <akim@epita.fr>
2159
2160 * src/gram.h, src/gram.c (error_token_number): Remove, use
2161 errtoken->number.
2162 * src/reader.c (reader): Don't specify the user token number (2)
2163 for $undefined, as it uselessly prevents using it.
2164 * src/gram.h (token_number_t): Move to...
2165 * src/symtab.h: here.
2166 (state_t.number): Is a token_number_t.
2167 * src/print.c, src/reader.c: Use undeftoken->number instead of
2168 hard coded 2.
2169 (Even though this 2 is not the same as above: the number of the
2170 undeftoken remains being 2, it is its user token number which
2171 might not be 2).
2172 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
2173 `user_token_number_max'.
2174 Output `undef_token_number'.
2175 * data/bison.simple, data/bison.c++: Use them.
2176 Be sure to map invalid yylex return values to
2177 `undef_token_number'. This saves us from gratuitous SEGV.
2178
2179 * tests/conflicts.at (Solved SR Conflicts)
2180 (Unresolved SR Conflicts): Adjust.
2181 * tests/regression.at (Web2c Actions): Adjust.
2182
06446ccf
AD
21832002-04-08 Akim Demaille <akim@epita.fr>
2184
2185 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
2186 Adding #line.
2187 Remove the duplicate `typedefs'.
2188 (RhsNumberType): Fix the declaration and various other typos.
2189 Use __ofile__.
2190 * data/bison.simple: Use __ofile__.
2191 * src/scan-skel.l: Handle __ofile__.
2192
62a3e4f0
AD
21932002-04-08 Akim Demaille <akim@epita.fr>
2194
2195 * src/gram.h (item_number_t): New, the type of item numbers in
2196 RITEM. Note that it must be able to code symbol numbers as
2197 positive number, and the negation of rule numbers as negative
2198 numbers.
2199 Adjust all dependencies (pretty many).
2200 * src/reduce.c (rule): Remove this `short *' pointer: use
2201 item_number_t.
2202 * src/system.h (MINSHORT, MAXSHORT): Remove.
2203 Include `limits.h'.
2204 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
2205 (shortcpy): Remove.
2206 (MAXTABLE): Move to...
2207 * src/output.c (MAXTABLE): here.
2208 (prepare_rules): Use output_int_table to output rhs.
2209 * data/bison.simple, data/bison.c++: Adjust.
2210 * tests/torture.at (Big triangle): Move the limit from 254 to
2211 500.
2212 * tests/regression.at (Web2c Actions): Ajust.
2213
2214 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
2215 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
2216 passes, but produces negative #line number, once fixed, GCC is
2217 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
2218 C), it passes.
2219 * src/state.h (state_h): Code input lines on ints, not shorts.
2220
bb88b0fc
AD
22212002-04-08 Akim Demaille <akim@epita.fr>
2222
2223 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
2224 and then the grammar.
2225
9a636f47
AD
22262002-04-08 Akim Demaille <akim@epita.fr>
2227
2228 * src/system.h: No longer using strndup.
2229
680e8701
AD
22302002-04-07 Akim Demaille <akim@epita.fr>
2231
2232 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
2233 * src/output.c (output_table_data): Return the longest number.
2234 (prepare_tokens): Output `token_number_max').
2235 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
2236 New.
2237 Use them to define yy_token_number_type/TokenNumberType.
2238 Use this type for yytranslate.
2239 * tests/torture.at (Big triangle): Push the limit from 124 to
2240 253.
2241 * tests/regression.at (Web2c Actions): Adjust.
2242
817e9f41
AD
22432002-04-07 Akim Demaille <akim@epita.fr>
2244
2245 * tests/torture.at (Big triangle): New.
2246 (GNU AWK Grammar, GNU Cim Grammar): Move to...
2247 * tests/existing.at: here.
2248
5123689b
AD
22492002-04-07 Akim Demaille <akim@epita.fr>
2250
2251 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
2252 nritems.
2253 Adjust dependencies.
2254
f3849179
AD
22552002-04-07 Akim Demaille <akim@epita.fr>
2256
2257 * src/reader.c: Normalize increments to prefix form.
2258
bd02036a
AD
22592002-04-07 Akim Demaille <akim@epita.fr>
2260
2261 * src/reader.c, symtab.c: Remove debugging code.
2262
db8837cb
AD
22632002-04-07 Akim Demaille <akim@epita.fr>
2264
2265 Rename all the `bucket's as `symbol_t'.
2266
2267 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
2268 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
2269 * src/symtab.c, src/symtab.h (bucket): Rename as...
2270 (symbol_t): this.
2271 (symbol_list_new, bucket_check_defined, bucket_make_alias)
2272 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
2273 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2274 (buckets_new, buckets_free, buckets_do): Rename as...
2275 (symbol_list_new, symbol_check_defined, symbol_make_alias)
2276 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2277 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
2278 (symbols_new, symbols_free, symbols_do): these.
2279
72a23c97
AD
22802002-04-07 Akim Demaille <akim@epita.fr>
2281
2282 Use lib/hash for the symbol table.
2283
2284 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
2285 EOF.
2286 * src/lex.c (lex): Set the `number' member of new terminals.
2287 * src/reader.c (bucket_check_defined, bucket_make_alias)
2288 (bucket_check_alias_consistence, bucket_translation): New.
2289 (reader, grammar_free, readgram, token_translations_init)
2290 (packsymbols): Adjust.
2291 (reader): Number the predefined tokens.
2292 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
2293 for predefined tokens.
2294 * src/symtab.h (bucket): Remove all the hash table related
2295 members.
2296 * src/symtab.c (symtab): Replace by...
2297 (bucket_table): this.
2298 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2299 (buckets_new, buckets_do): New.
2300
280a38c3
AD
23012002-04-07 Akim Demaille <akim@epita.fr>
2302
2303 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
2304 (start_symbol, max_user_token_number, semantic_parser)
2305 (error_token_number): Initialize.
2306 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
2307 Initialize.
2308 (reader): Don't.
2309 (errtoken, eoftoken, undeftoken, axiom): Extern.
2310
03b31c0c
AD
23112002-04-07 Akim Demaille <akim@epita.fr>
2312
2313 * src/gram.h (rule_s): prec and precsym are now pointers
2314 to the bucket giving the priority/associativity.
2315 Member `associativity' removed: useless.
2316 * src/reduce.c, src/conflicts.c: Adjust.
2317
8b3df748
AD
23182002-04-07 Akim Demaille <akim@epita.fr>
2319
2320 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
2321 Properly escape the symbols' TAG when outputting them.
2322
e601aa1d
AD
23232002-04-07 Akim Demaille <akim@epita.fr>
2324
2325 * src/lalr.h (LA): Is a bitsetv, not bitset*.
2326
b0299a2e
AD
23272002-04-07 Akim Demaille <akim@epita.fr>
2328
2329 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
2330 (LArule): this, which is an array to rule_t*.
2331 * src/print.c, src/conflicts.c: Adjust.
2332
d7e1f00c
AD
23332002-04-07 Akim Demaille <akim@epita.fr>
2334
2335 * src/gram.h (rule_t): Rename `number' as `user_number'.
2336 `number' is a new member.
2337 Adjust dependencies.
2338 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
2339
cc9305dd
AD
23402002-04-07 Akim Demaille <akim@epita.fr>
2341
2342 As a result of the previous patch, it is no longer needed
2343 to reorder ritem itself.
2344
2345 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
2346
b0940840
AD
23472002-04-07 Akim Demaille <akim@epita.fr>
2348
2349 Be sure never to walk through RITEMS, but use only data related to
2350 the rules themselves. RITEMS should be banished.
2351
2352 * src/output.c (output_token_translations): Rename as...
2353 (prepare_tokens): this.
2354 In addition to `translate', prepare the muscles `tname' and
2355 `toknum', which were handled by...
2356 (output_rule_data): this.
2357 Remove, and move the remainder of its outputs into...
2358 (prepare_rules): this new routines, which also merges content from
2359 (output_gram): this.
2360 (prepare_rules): Be sure never to walk through RITEMS.
2361 (output_stos): Rename as...
2362 (prepare_stos): this.
2363 (output): Always invoke prepare_states, after all, just don't use it
2364 in the output if you don't need it.
2365
643a5994
AD
23662002-04-07 Akim Demaille <akim@epita.fr>
2367
2368 * src/LR0.c (new_state): Display `nstates' as the name of the
2369 newly created state.
2370 Adjust to initialize first_state and last_state if needed.
2371 Be sure to distinguish the initial from the final state.
2372 (new_states): Create the itemset of the initial state, and use
2373 new_state.
2374 * src/closure.c (closure): Now that the initial state has its
2375 items properly set, there is no need for a special case when
2376 creating `ruleset'.
2377
2378 As a result, now the rule 0, reducing to $axiom, is visible in the
2379 outputs. Adjust the test suite.
2380
2381 * tests/conflicts.at (Solved SR Conflicts)
2382 (Unresolved SR Conflicts): Adjust.
2383 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
2384 * tests/conflicts.at (S/R in initial): New.
2385
b4c4ccc2
AD
23862002-04-07 Akim Demaille <akim@epita.fr>
2387
2388 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
2389 the RHS of the rules.
2390 * src/output.c (output_gram): Likewise.
2391
bba97eb2
AD
23922002-04-07 Akim Demaille <akim@epita.fr>
2393
2394 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
2395 bucket.
2396 Adjust all dependencies.
2397 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
2398 `number' of the buckets too.
2399 * src/gram.h: Include `symtab.h'.
2400 (associativity): Move to...
2401 * src/symtab.h: here.
2402 No longer include `gram.h'.
2403
c3b407f4
AD
24042002-04-07 Akim Demaille <akim@epita.fr>
2405
2406 * src/gram.h, src/gram.c (rules_rhs_length): New.
2407 (ritem_longest_rhs): Use it.
2408 * src/gram.h (rule_t): `number' is a new member.
2409 * src/reader.c (packgram): Set it.
2410 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
2411 the end of `rules', and count them out of `nrules'.
2412 (reduce_output, dump_grammar): Adjust.
2413 * src/print.c (print_grammar): It is no longer needed to check for
2414 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
2415 * tests/reduce.at (Reduced Automaton): New test.
2416
11652ab3
AD
24172002-04-07 Akim Demaille <akim@epita.fr>
2418
2419 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
2420 lacking `+ 1' to nrules, Bison reported as useless a token if it
2421 was used solely to set the precedence of the last rule...
2422
26b23c1a
AD
24232002-04-07 Akim Demaille <akim@epita.fr>
2424
2425 * data/bison.c++, data/bison.simple: Don't output the current file
2426 name in #line, to avoid useless diffs between two identical
2427 outputs under different names.
2428
18bcecb0
AD
24292002-04-07 Akim Demaille <akim@epita.fr>
2430
2431 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
2432 Normalize loops to using `< nrules + 1', not `<= nrules'.
2433
fa770c86
AD
24342002-04-07 Akim Demaille <akim@epita.fr>
2435
2436 * TODO: Update.
2437
d9b739c3
AD
24382002-04-07 Akim Demaille <akim@epita.fr>
2439
2440 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
2441 bucket.value as bucket.number.
2442
99013900
AD
24432002-04-07 Akim Demaille <akim@epita.fr>
2444
2445 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
2446 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2447 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
2448 RHS, instead of being an index in RITEMS.
2449
e966383b
PE
24502002-04-04 Paul Eggert <eggert@twinsun.com>
2451
2452 * doc/bison.texinfo: Update copyright date.
2453 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
2454 (Symbols): Warn about running Bison in one character set,
2455 but compiling and/or running in an incompatible one.
2456 Warn about character code 256, too.
2457
24582002-04-03 Paul Eggert <eggert@twinsun.com>
2459
2460 * src/bison.data (YYSTACK_ALLOC): Depend on whether
2461 YYERROR_VERBOSE is nonzero, not whether it is defined.
2462
2463 Merge changes from bison-1_29-branch.
c307773e 2464
8d6c48b9
PE
24652002-03-20 Paul Eggert <eggert@twinsun.com>
2466
2467 Merge fixes from Debian bison_1.34-1.diff.
2468
2469 * configure.in (AC_PREREQ): 2.53.
2470
e53c6322
AD
24712002-03-20 Akim Demaille <akim@epita.fr>
2472
2473 * src/conflicts.c (log_resolution): Argument `resolution' is const.
2474
9ffbeca7
PE
24752002-03-19 Paul Eggert <eggert@twinsun.com>
2476
21db0b2a
PE
2477 * src/bison.simple (YYCOPY): New macro.
2478 (YYSTACK_RELOCATE): Use it.
2479 Remove Type arg; no longer needed. All callers changed.
2480 (yymemcpy): Remove; no longer needed.
2481
9ffbeca7
PE
2482 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
2483 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2484
642cb8f8
AD
24852002-03-19 Akim Demaille <akim@epita.fr>
2486
2487 Test and fix the #line outputs.
2488
2489 * tests/atlocal.at (GCC): New.
2490 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
2491 (Prologue synch line, ,%union synch line, Postprologue synch line)
2492 (Action synch line, Epilogue synch line): New tests.
2493 * src/reader.c (parse_union_decl): Define the muscle stype_line.
2494 * data/bison.simple, data/bison.c++: Use it.
2495
3c31a486
AD
24962002-03-19 Akim Demaille <akim@epita.fr>
2497
2498 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
2499 (Solved SR Conflicts, %expect not enough, %expect right)
2500 (%expect too much): Move to...
2501 * tests/conflicts.at: this new file.
2502
0d8bed56
AD
25032002-03-19 Akim Demaille <akim@epita.fr>
2504
2505 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2506 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
2507 that we can move to enums for instance.
2508 * src/output.c (token_definitions_output): Output a list of
2509 `token-name, token-number' instead of the #define.
2510 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
2511
9208d17f
AD
25122002-03-14 Akim Demaille <akim@epita.fr>
2513
2514 Use Gettext 0.11.1.
2515
af27eacb
RA
25162002-03-09 Robert Anisko <robert@lrde.epita.fr>
2517
2518 * data/bison.c++: Make the user able to add members to the generated
2519 parser by subclassing.
2520
9101a310
RA
25212002-03-05 Robert Anisko <robert@lrde.epita.fr>
2522
2523 * src/reader.c (read_additionnal_code): `c' should be an integer, not
2524 a character.
2525 Reported by Nicolas Tisserand and Nicolas Burrus.
2526
fff9bf0b
RA
25272002-03-04 Robert Anisko <robert@lrde.epita.fr>
2528
2529 * src/reader.c: Warn about lacking semi-colons, do not complain.
2530
64dba31e
RA
25312002-03-04 Robert Anisko <robert@lrde.epita.fr>
2532
2533 * data/bison.c++: Remove a debug line.
2534
374f5a14
RA
25352002-03-04 Robert Anisko <robert@lrde.epita.fr>
2536
2537 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
2538 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
2539 provide a default implementation.
2540
bfcf1f3a
AD
25412002-03-04 Akim Demaille <akim@epita.fr>
2542
2543 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
2544 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
2545 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
2546 * tests/semantic.at (Parsing Guards): Similarly.
2547 * src/reader.at (readgram): Complain if the last rule is not ended
2548 with a semi-colon.
2549
65ccf9fc
AD
25502002-03-04 Akim Demaille <akim@epita.fr>
2551
2552 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
2553 * src/closure.c: here.
2554 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
2555 RTC.
2556 * src/warshall.h, src/warshall.c: Remove.
2557 * tests/sets.at (Broken Closure): Adjust.
2558
d0039cbc
AD
25592002-03-04 Akim Demaille <akim@epita.fr>
2560
2561 * src/output.c (output_skeleton): tempdir is const.
2562 bytes_read is unused.
2563
345cea78
AD
25642002-03-04 Akim Demaille <akim@epita.fr>
2565
2566 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2567 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2568 Update.
2569 From Michael Hayes.
2570
564801f7
AD
25712002-03-04 Akim Demaille <akim@epita.fr>
2572
2573 * src/closure.c (closure): `r' is unused.
2574
e5352bc7
AD
25752002-03-04 Akim Demaille <akim@epita.fr>
2576
2577 * tests/sets.at (Broken Closure): Add the ending `;'.
2578 * src/reader.at (readgram): Complain if a rule is not ended with a
2579 semi-colon.
2580
914feea9
AD
25812002-03-04 Akim Demaille <akim@epita.fr>
2582
2583 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2584 (count_sr_conflicts): Use bitset_count.
2585 * src/reduce.c (inaccessable_symbols): Ditto.
2586 (bits_size): Remove.
2587 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2588
f0250de6
AD
25892002-03-04 Akim Demaille <akim@epita.fr>
2590
2591 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2592 * src/reduce.c: Remove the `bitset_zero's following the
2593 `bitset_create's, as now it is performed by the latter.
2594
ef017502
AD
25952002-03-04 Akim Demaille <akim@epita.fr>
2596
2597 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2598 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2599 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2600 latest sources from Michael.
2601
76514394
AD
26022002-03-04 Akim Demaille <akim@epita.fr>
2603
2604 * src/output.c (output): Don't free the grammar.
2605 * src/reader.c (grammar_free): New.
2606 * src/main.c (main): Call it and don't free symtab here.
2607
55024580
AD
26082002-03-04 Akim Demaille <akim@epita.fr>
2609
2610 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2611 before returning.
2612 Reported by Benoit Perrot.
2613
f9abaa2c
AD
26142002-03-04 Akim Demaille <akim@epita.fr>
2615
2616 Use bitset operations when possible, not loops over bits.
2617
2618 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2619 bitset_or.
2620 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2621 * src/reduce.c (useless_nonterminals): Formatting changes.
2622 * src/warshall.c (TC): Use bitset_or.
2623
0e721e75
AD
26242002-03-04 Akim Demaille <akim@epita.fr>
2625
2626 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2627 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2628 Ditto.
2629
0fb1ffb1
AD
26302002-03-04 Akim Demaille <akim@epita.fr>
2631
2632 * src/lalr.c (F): Now a bitset*.
2633 Adjust all dependencies.
2634
b86796bf
AD
26352002-03-04 Akim Demaille <akim@epita.fr>
2636
2637 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2638 Adjust all dependencies.
2639
602bbf31
AD
26402002-03-04 Akim Demaille <akim@epita.fr>
2641
2642 * src/L0.c, src/LR0.h (nstates): Be size_t.
2643 Adjust comparisons (signed vs unsigned).
2644 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2645 bitset*.
2646 Adjust all dependencies.
2647
d8a0245c
AD
26482002-03-04 Akim Demaille <akim@epita.fr>
2649
2650 * src/closure.c (firsts): Now, also a bitset.
2651 Adjust all dependencies.
2652 (varsetsize): Remove, now unused.
2653 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2654
34ba9743
AD
26552002-03-04 Akim Demaille <akim@epita.fr>
2656
2657 * src/print.c: Convert to use bitset.h, not hand coded iterations
2658 over ints.
2659
ed86e78c
AD
26602002-03-04 Akim Demaille <akim@epita.fr>
2661
2662 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2663
dfdb1797
AD
26642002-03-04 Akim Demaille <akim@epita.fr>
2665
2666 * src/closure.c (ruleset): Be a bitset.
2667 (rulesetsize): Remove.
2668
7086e707
AD
26692002-03-04 Akim Demaille <akim@epita.fr>
2670
2671 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2672 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2673 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2674 * src/closure.c (fderives): Be an array of bitsets.
2675
98254360
RA
26762002-02-28 Robert Anisko <robert@lrde.epita.fr>
2677
2678 * data/bison.c++: Merge the two generated headers. Insert a copyright
2679 notice in each output file.
2680
a75c057f
AD
26812002-02-28 Akim Demaille <akim@epita.fr>
2682
2683 * data/bison.c++: Copy the prologue of bison.simple to fetch
2684 useful M4 definitions, such as b4_header_guard.
2685
06b00abc
AD
26862002-02-25 Akim Demaille <akim@epita.fr>
2687
2688 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
2689 translator friendly scheme for the bgr
2690 copyright notice.
06b00abc 2691
70e7d534
AD
26922002-02-25 Akim Demaille <akim@epita.fr>
2693
2694 * src/output.c (header_output): Remove, now handled completely via
2695 M4.
2696
abe017f6
AD
26972002-02-25 Akim Demaille <akim@epita.fr>
2698
2699 * m4/m4.m4: New, from CVS Autoconf.
2700 * configure.in: Invoke it.
2701 * src/output.c (output_skeleton): Use its result instead of the
2702 hard coded name.
2703
381fb12e
AD
27042002-02-25 Akim Demaille <akim@epita.fr>
2705
2706 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2707 Fileutils 4.1.5.
2708 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2709 * src/output.c (output_skeleton): Use mkstemp to create a real
2710 temporary file.
2711 Move the filling of `skeleton' and its muscle to...
2712 (prepare): here.
2713 (output): Move the definition of the prologue muscle to...
2714 (prepare): here.
2715 * src/system.h (DEFAULT_TMPDIR): New.
2716
6f38107f
PE
27172002-02-14 Paul Eggert <eggert@twinsun.com>
2718
2719 Remove the support for C++ namespace cleanliness; it was
2720 causing more problems than it was curing, since it didn't work
2721 properly on some nonstandard C++ compilers. This can wait
2722 for a proper C++ parser.
2723
2724 * NEWS: Document this.
2725 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2726 of C++, as it's treated like C now.
2727 * src/bison.simple (YYSTD): Remove.
2728 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2729 Treat C++ just like Standard C instead of trying to support
2730 namespace cleanliness.
2731
80cce3da
AD
27322002-02-14 Akim Demaille <akim@epita.fr>
2733
2734 * tests/regression.at (else): Adjust to Andreas' change.
2735
842e8679
AD
27362002-02-14 Akim Demaille <akim@epita.fr>
2737
2738 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2739
4bda3f10
AD
27402002-02-13 Andreas Schwab <schwab@suse.de>
2741
2742 * src/output.c (output_rule_data): Don't output NULL, it might
2743 not be defined yet.
2744
4162fa07 27452002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 2746
4162fa07
RA
2747 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2748 (Copyright notice): Update.
b418ecd8 2749
bd16a5dc
AD
27502002-02-11 Akim Demaille <akim@epita.fr>
2751
2752 * tests/regression.at (%nonassoc and eof): Don't include
2753 nonportable headers.
2754
8d69a1a3
RA
27552002-02-08 Robert Anisko <robert@lrde.epita.fr>
2756
2757 * data/bison.c++: Correct error recovery. Make the user able to
2758 initialize the starting location.
2759
9b2d0677
AD
27602002-02-07 Akim Demaille <akim@epita.fr>
2761
2762 * tests/input.at: New.
2763
69e2658b
RA
27642002-02-07 Robert Anisko <robert@lrde.epita.fr>
2765
2766 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 2767 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
2768 directives around tables only needed for debugging.
2769
4aacc3a7
RA
27702002-02-07 Robert Anisko <robert@lrde.epita.fr>
2771
2772 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2773 C++ parsers.
2774 (yy::b4_name::parse): Use print_.
2775
762a801e
RA
27762002-02-07 Robert Anisko <robert@lrde.epita.fr>
2777
2778 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2779
4bb2bc3f
RA
27802002-02-07 Robert Anisko <robert@lrde.epita.fr>
2781
2782 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2783 C++ parsers.
2784 (yy::b4_name::parse): Build verbose error messages, and use error_.
2785
6b45a3ca
RA
27862002-02-06 Robert Anisko <robert@lrde.epita.fr>
2787
2788 * data/bison.c++: Fix m4 quoting in comments.
2789
50997c6e
RA
27902002-02-06 Robert Anisko <robert@lrde.epita.fr>
2791
2792 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2793 not expanded by m4.
2794
3f3eed27
AD
27952002-02-05 Akim Demaille <akim@epita.fr>
2796
2797 * data/bison.c++: Adjust to the M4 back end.
2798 More is certainly needed.
2799
be2a1a68
AD
28002002-02-05 Akim Demaille <akim@epita.fr>
2801
2802 Give a try to M4 as a back end.
2803
2804 * lib/readpipe.c: New, from wdiff.
2805 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2806 BISON_HAIRY.
2807 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2808 specific values. Now it is m4 that performs the lookup.
2809 * src/parse-skel.y: Remove.
2810 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2811 * src/output.c (actions_output, guards_output)
2812 (token_definitions_output): No longer keeps track of the output
2813 line number, hence remove the second argument.
2814 (guards_output): Check against the guard member of a rule, not the
2815 action member.
2816 Adjust callers.
2817 (output_skeleton): Don't look for the skeleton location, let m4 do
2818 that.
2819 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2820 file will be used.
2821 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2822 (prepare): Given that for the time being changesyntax is not
2823 usable in M4, rename the muscles using `-' to `_'.
2824 Define `defines_flag', `output_parser_name' and `output_header_name'.
2825 * src/output.h (actions_output, guards_output)
2826 (token_definitions_output): Adjust prototypes.
2827 * src/scan-skel.l: Instead of scanning the skeletons, it now
2828 processes the output of m4: `__oline__' and `#output'.
2829 * data/bison.simple: Adjust to be used by M4(sugar).
2830 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2831 to date.
2832 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2833 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2834 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2835 shamelessly stolen from CVS Autoconf.
2836
beda758b
AD
28372002-02-05 Akim Demaille <akim@epita.fr>
2838
2839 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2840 * configure.in: Check for the declarations of free and malloc.
2841 * src/muscle_tab.c: Adjust.
2842
5ece6d43
AD
28432002-02-05 Akim Demaille <akim@epita.fr>
2844
2845 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2846 which have no values.
2847
5bb18f9a
AD
28482002-02-05 Akim Demaille <akim@epita.fr>
2849
2850 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2851 * data/: here.
2852
894dd62e
PE
28532002-01-29 Paul Eggert <eggert@twinsun.com>
2854
2855 * src/bison.simple (YYSIZE_T): Do not define merely because
2856 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2857 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2858
82841af7
AD
28592002-01-27 Akim Demaille <akim@epita.fr>
2860
2861 Fix `%nonassoc and eof'.
2862
2863 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2864 which were not properly copied! Replace
2865 memcpy (res->errs, src->errs, src->nerrs);
2866 with
2867 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2868 !!!
2869 * tests/regression.at (%nonassoc and eof): Adjust to newest
2870 Autotest: `.' is not in the PATH.
2871
318b76e9
AD
28722002-01-27 Akim Demaille <akim@epita.fr>
2873
2874 * tests/sets.at (AT_EXTRACT_SETS): New.
2875 (Nullable): Use it.
2876 (Firsts): New.
2877
30d2f3d5
AD
28782002-01-26 Akim Demaille <akim@epita.fr>
2879
2880 * tests/actions.at, tests/calc.at, tests/headers.at,
2881 * tests/torture.at: Adjust to the newest Autotest which no longer
2882 forces `.' in the PATH.
2883
30f8c395
AD
28842002-01-25 Akim Demaille <akim@epita.fr>
2885
2886 * tests/regression.at (%nonassoc and eof): New.
2887 Suggested by Robert Anisko.
2888
29ae55f1
AD
28892002-01-24 Akim Demaille <akim@epita.fr>
2890
2891 Bison dumps core when trying to complain about broken input files.
2892 Reported by Cris van Pelt.
2893
2894 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2895 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2896 into...
2897 (Invalid inputs): Strengthen: exercise parse_percent_token.
2898
2b548aa6
RA
28992002-01-24 Robert Anisko <robert.anisko@epita.fr>
2900
2901 * src/Makefile.am: Add bison.c++.
2902 * src/bison.c++: New skeleton.
2903
bb0146c2
AD
29042002-01-21 Paolo Bonzini <bonzini@gnu.org>
2905
2906 * po/it.po: New.
2907
bec30531
AD
29082002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2909
2910 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2911
fc6edc45
MA
29122002-01-20 Marc Autret <marc@gnu.org>
2913
2914 * src/files.c (compute_output_file_names): Fix
2915
5e5d5415
MA
29162002-01-20 Marc Autret <marc@gnu.org>
2917
2918 * tests/output.at: New test.
2919 * src/files.c (compute_base_names): Don't map extensions when
2920 the YACC flag is set, use defaults.
2921 Reported by Evgeny Stambulchik.
2922
44ea3fbd
MA
29232002-01-20 Marc Autret <marc@gnu.org>
2924
bb0146c2 2925 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2926 compilers as well (i.e. the vendor C compiler).
2927 Suggested by Albert Chin-A-Young.
2928
338963d1
TVH
29292002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2930
2931 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2932 canonical definition.
2933 * src/system.h: Use the canonical definition for PARAMS (avoids
2934 a conflict with the macro from lib/hash.h).
2935
c57b2479
AD
29362002-01-11 Akim Demaille <akim@epita.fr>
2937
2938 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2939 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2940
b85810ae
AD
29412002-01-09 Akim Demaille <akim@epita.fr>
2942
2943 * src/files.c, src/files.h (output_infix): New.
2944 (tab_extension): Remove.
2945 (compute_base_names): Compute the former, drop the latter.
2946 * src/output.c (prepare): Insert the muscles `output-infix', and
2947 `output-suffix'.
2948 * src/parse-skel.y (string, string.1): New.
2949 (section.header): Use it.
2950 (section.yacc): Remove.
2951 (prefix): Remove too.
2952 * src/scan-skel.l: Adjust.
2953 * src/bison.simple, src/bison.hairy: Adjust.
2954
cae60122
AD
29552002-01-09 Akim Demaille <akim@epita.fr>
2956
2957 * configure.in (WERROR_CFLAGS): Compute it.
2958 * src/Makefile.am (CFLAGS): Pass it.
2959 * tests/atlocal.in (CFLAGS): Idem.
2960 * src/files.c: Fix a few warnings.
2961 (get_extension_index): Remove, unused.
2962
ae404801
AD
29632002-01-08 Akim Demaille <akim@epita.fr>
2964
2965 * src/getargs.c (AS_FILE_NAME): New.
2966 (getargs): Use it to convert DOSish file names.
2967 * src/files.c (base_name): Rename as full_base_name to avoid
2968 clashes with `base_name ()'.
2969 (filename_split): New.
2970 (compute_base_names): N-th rewrite, using filename_split.
2971
22312b71
AD
29722002-01-08 Akim Demaille <akim@epita.fr>
2973
2974 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2975 New, stolen from the Fileutils 4.1.
2976 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2977 * configure.in: Check for the presence of memrchr, and of its
2978 prototype.
2979
a67cef01
TVH
29802002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2981
2982 * lib/hash.h (__P): Added definition for this macro.
2983 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2984 BUILT_SOURCES, to ensure they are generated first.
2985 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2986 %error-verbose to allow bootstrapping with bison 1.30x.
2987
2b25d624
AD
29882002-01-06 Akim Demaille <akim@epita.fr>
2989
2990 * src/reader.c (parse_braces): Don't fetch the next char, the
2991 convention is to fetch on entry.
2992 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2993 'switch' without a following semicolon.
2994 * tests/regression.at (braces parsing): New.
2995
3460813b
AD
29962002-01-06 Akim Demaille <akim@epita.fr>
2997
2998 Bison is dead wrong in its RR conflict reports.
2999
3000 * tests/torture.at (GNU Cim Grammar): New.
3001 * src/conflicts.c (count_rr_conflicts): Fix.
3002
73784c64
AD
30032002-01-06 Akim Demaille <akim@epita.fr>
3004
3005 Creating package.m4 from configure.ac causes too many problems.
3006
3007 * tests/Makefile.am (package.m4): Create it by hand,
3008 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
3009
25d81090
AD
30102002-01-06 Akim Demaille <akim@epita.fr>
3011
3012 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
3013 skeleton.h.
3014
a9b8959e
PE
30152002-01-04 Paul Eggert <eggert@twinsun.com>
3016
3017 * doc/bison.texinfo (Debugging):
3018 Remove YYSTDERR; it's no longer defined or used.
3019 Also, s/cstdio.h/cstdio/.
3020
25d81090
AD
30212002-01-03 Akim Demaille <akim@epita.fr>
3022
3023 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
3024
1109455c
AD
30252002-01-03 Akim Demaille <akim@epita.fr>
3026
3027 * src/parse-skel.y (process_skeleton): Don't bind the parser's
3028 tracing code to --trace, wait for a better --trace option, with
3029 args.
3030
7ea5e977
AD
30312002-01-03 Akim Demaille <akim@epita.fr>
3032
3033 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
3034 The ISO C++ standard is extremely clear about it: stderr is
3035 considered a macro, not a regular symbol (see table 94 `Header
3036 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
3037 Therefore std:: does not apply to it. It still does with fprintf.
3038 Also, s/cstdio.h/cstdio/.
3039
fab5b110
AD
30402002-01-03 Akim Demaille <akim@epita.fr>
3041
3042 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
3043 for non system headers.
3044
aed7fd9b
AD
30452002-01-02 Akim Demaille <akim@epita.fr>
3046
3047 Equip the skeleton chain with location tracking, runtime trace,
3048 pure parser and scanner.
3049
3050 * src/parse-skel.y: Request a pure parser, locations, and prefix
3051 renaming.
3052 (%union): Having several members with the same type does not help
3053 type mismatches, simplify.
3054 (YYPRINT, yyprint): New.
3055 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
3056 (skel_error): this.
3057 Handle locations.
3058 * src/scan-skel.l: Adjust to these changes.
3059 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
3060 (LOCATION_PRINT, skel_control_t): New.
3061
24fad99e
AD
30622001-12-30 Akim Demaille <akim@epita.fr>
3063
3064 * src/parse-skel.y: Get rid of the shift/reduce conflict:
3065 replace `gb' with BLANKS.
3066 * src/scan-skel.l: Adjust.
3067
a4b36db4
AD
30682001-12-30 Akim Demaille <akim@epita.fr>
3069
3070 * src/system.h: We don't need nor want bcopy.
3071 Throw away MS-DOS crap: we don't need getpid.
3072 * configure.in: We don't need strndup. It was even causing
3073 problems: because Flex includes the headers *before* us,
3074 _GNU_SOURCE is not defined by config.h, and therefore strndup was
3075 not visible.
3076 * lib/xstrndup.c: New.
3077 * src/scan-skel.l: Use it.
3078 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
3079 * src/parse-skel.y: Use %directives instead of #defines.
3080
1239777d
AD
30812001-12-30 Akim Demaille <akim@epita.fr>
3082
3083 * src/skeleton.h: New.
3084 * src/output.c (output_parser, output_master_parser): Remove, dead
3085 code.
3086 * src/output.h (get_lines_number, actions_output, guards_output)
3087 (token_definitions_output): Prototype them.
3088 * src/parse-skel.y: Add the license notice.
3089 Include output.h and skeleton.h.
3090 (process_skeleton): Returns void, and takes a single parameter.
3091 * src/scan-skel.l: Add the license notice.
3092 Include skeleton.h.
3093 Don't use %option yylineno: it seems that then Flex imagines
3094 REJECT has been used, and therefore it won't reallocate its
3095 buffers (which makes no other sense to me than a bug). It results
3096 in warnings for `unused: yy_flex_realloc'.
3097
9b3add5b
RA
30982001-12-30 Robert Anisko <robert.anisko@epita.fr>
3099
3100 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3101 (MUSCLE_INSERT_PREFIX): ...to there.
3102 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3103 (MUSCLE_INSERT_PREFIX): Move from here...
3104
3105 * src/bison.hairy: Add a section directive. Put braces around muscle
3106 names. This parser skeleton is still broken, but Bison should not
3107 choke on a bad muscle 'syntax'.
3108 * src/bison.simple: Add a section directive. Put braces around muscle
3109 names.
3110
3111 * src/files.h (strsuffix, stringappend): Add declarations.
3112 (tab_extension): Add declaration.
3113 (short_base_name): Add declaration.
3114
3115 * src/files.c (strsuffix, stringappend): No longer static. These
3116 functions are used in the skeleton parser.
3117 (tab_extension): New.
3118 (compute_base_names): Use the computations done in this function
fab5b110 3119 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
3120 names.
3121 (short_base_name): No longer static.
3122
3123 * src/output.c (output_skeleton): New.
3124 (output): Disable call to output_master_parser, and give a try to
3125 a new skeleton handling system.
3126 (guards_output, actions_output): No longer static.
3127 (token_definitions_output, get_lines_number): No longer static.
3128
3129 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
3130
fab5b110 3131 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
3132 parse-skel.y.
3133
3134 * src/parse-skel.y: New file.
3135 * src/scan-skel.l: New file.
3136
b5b61c61
AD
31372001-12-29 Akim Demaille <akim@epita.fr>
3138
3139 %name-prefix is broken.
3140
3141 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
3142 Adjust all dependencies.
3143 * tests/headers.at (export YYLTYPE): Strengthen this test: use
3144 %name-prefix.
3145
3146 Renaming yylval but not yylloc is not consistent. Now we do.
3147
3148 * src/bison.simple: Prefix yylloc if used.
3149 * doc/bison.texinfo (Decl Summary): Document that.
3150
8c9a50be
AD
31512001-12-29 Akim Demaille <akim@epita.fr>
3152
3153 * doc/bison.texinfo: Promote `%long-directive' over
3154 `%long_directive'.
3155 Remove all references to fixed-output-files, yacc is enough.
3156
d99361e6
AD
31572001-12-29 Akim Demaille <akim@epita.fr>
3158
3159 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
3160 user prologue. These are defaults.
3161 * tests/actions.at (Mid-rule actions): Make sure the user can
3162 define YYDEBUG and YYERROR_VERBOSE.
3163
b9cecb91
AD
31642001-12-29 Akim Demaille <akim@epita.fr>
3165
3166 * src/output.c (header_output): Don't forget to export YYLTYPE and
3167 yylloc.
3168 * tests/headers.at (export YYLTYPE): New, make sure it does.
3169 * tests/regression.at (%union and --defines, Invalid CPP headers):
3170 Move to...
3171 * tests/headers.at: here.
3172
aea13e97
AD
31732001-12-29 Akim Demaille <akim@epita.fr>
3174
3175 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
3176
931394cb
AD
31772001-12-29 Akim Demaille <akim@epita.fr>
3178
3179 * tests/actions.at (Mid-rule actions): Output on a single line
3180 instead of several.
3181
704a47c4
AD
31822001-12-29 Akim Demaille <akim@epita.fr>
3183
3184 * doc/bison.texinfo: Formatting changes.
3185
091e20bb
AD
31862001-12-29 Akim Demaille <akim@epita.fr>
3187
3188 Don't store the token defs in a muscle, just be ready to output it
3189 on command. Now possible via `symbols'. Fixes a memory leak.
3190
3191 * src/output.c (token_definitions_output): New.
3192 (output_parser, header_output): Use it.
3193 * src/reader.c (symbols_save): Remove.
3194
cce71710
AD
31952001-12-29 Akim Demaille <akim@epita.fr>
3196
3197 * src/bison.simple: Do not provide a default for YYSTYPE and
3198 YYLTYPE before the user's prologue. Otherwise it's hardly... a
3199 default.
3200
82c035a8
AD
32012001-12-29 Akim Demaille <akim@epita.fr>
3202
3203 Mid-rule actions are simply... ignored!
3204
3205 * src/reader.c (readgram): Be sure to attach mid-rule actions to
3206 the empty-rule associated to the dummy symbol, not to the host
3207 rule.
3208 * tests/actions.at (Mid-rule actions): New.
3209
8419d367
AD
32102001-12-29 Akim Demaille <akim@epita.fr>
3211
3212 Memory leak.
3213
3214 * src/reader.c (reader): Free grammar.
3215
375d5806
AD
32162001-12-29 Akim Demaille <akim@epita.fr>
3217
3218 Memory leak.
3219
3220 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
3221 since it allocates it for each state, although only one is needed.
3222 (allocate_storage): Do it here.
3223
f51cb8ff
AD
32242001-12-29 Akim Demaille <akim@epita.fr>
3225
3226 * src/options.h, src/options.c (create_long_option_table): Rename
3227 as...
3228 (long_option_table_new): this, with a clearer prototype.
3229 (percent_table): Remove, unused,
3230 * src/getargs.c (getargs): Adjust.
3231
29e88316
AD
32322001-12-29 Akim Demaille <akim@epita.fr>
3233
3234 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
3235 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
3236 as states.
3237
b9f71f19
AD
32382001-12-29 Akim Demaille <akim@epita.fr>
3239
3240 * src/lalr.c (build_relations): Rename `states' as `states1'.
3241 Sorry, I don't understand exactly what it is, no better name...
3242
1a2b5d37
AD
32432001-12-29 Akim Demaille <akim@epita.fr>
3244
3245 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
3246 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
3247 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
3248 as rules.
3249
1cca533e
AD
32502001-12-29 Akim Demaille <akim@epita.fr>
3251
3252 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
3253 ago.
3254
c03ae966
AD
32552001-12-29 Akim Demaille <akim@epita.fr>
3256
3257 * src/reader.c, src/reader.h (user_toknums): Remove.
3258 Adjust all users to use symbols[i]->user_token_number.
3259
5a670b1e
AD
32602001-12-29 Akim Demaille <akim@epita.fr>
3261
3262 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
3263 Adjust all users to use symbols[i]->prec or ->assoc.
3264
ad949da9
AD
32652001-12-29 Akim Demaille <akim@epita.fr>
3266
3267 * src/reader.c, src/reader.h (tags): Remove.
3268 Adjust all users to use symbols[i]->tag.
3269
0e78e603
AD
32702001-12-29 Akim Demaille <akim@epita.fr>
3271
3272 * src/gram.h, src/gram.c (symbols): New, similar to state_table
3273 and rule_table.
3274 * src/reader.c (packsymbols): Fill this table.
3275 Drop sprec.
3276 * src/conflicts.c (resolve_sr_conflict): Adjust.
3277 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
3278 single table.
3279 Use symbols[i]->tag instead of tags[i].
3280
213e640e
AD
32812001-12-29 Akim Demaille <akim@epita.fr>
3282
3283 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
3284 In addition, put a comment in there, to replace...
3285 * tests/regression.at (%union and C comments): Remove.
3286
e7b8bef1
AD
32872001-12-29 Akim Demaille <akim@epita.fr>
3288
3289 * tests/regression.at (Web2c Actions): Blindly move the actual
3290 output as expected output. The contents *seem* right to me, but I
3291 can't pretend reading perfectly parser tables... Nonetheless, all
3292 the other tests pass correctly, the table look OK, even though the
3293 presence of `$axiom' is to be noted: AFAICS it is useless (but
3294 harmless).
3295
b68e7744
AD
32962001-12-29 Akim Demaille <akim@epita.fr>
3297
3298 * src/reader.c (readgram): Don't add the rule 0 if there were no
3299 rules read. In other words, add it _after_ having performed
3300 grammar sanity checks.
3301 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
3302
78d5bae9
AD
33032001-12-29 Akim Demaille <akim@epita.fr>
3304
3305 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
3306 visible, and some states have now a different number.
3307
ff442794
AD
33082001-12-29 Akim Demaille <akim@epita.fr>
3309
3310 * src/reader.c (readgram): Bind the initial rule's lineno to that
3311 of the first rule.
3312 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
3313 (Solved SR Conflicts): Adjust rule 0's line number.
3314
610ab194
AD
33152001-12-29 Akim Demaille <akim@epita.fr>
3316
3317 Fix the `GAWK Grammar' failure.
3318
3319 * src/LR0.c (final_state): Initialize to -1 so that we do compute
3320 the reductions of the first state which was mistakenly confused
3321 with the final state because precisely final_state was initialized
3322 to 0.
3323 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
3324 now noticed by Bison.
3325 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
3326 have a reduction on $default.
3327
29d29c8f
AD
33282001-12-29 Akim Demaille <akim@epita.fr>
3329
3330 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
3331 rule line numbers.
3332 * src/closure.c (print_closure): Likewise.
3333 * src/derives.c (print_derives): Likewise.
3334 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
3335 now.
3336
7c6b64d0
AD
33372001-12-29 Akim Demaille <akim@epita.fr>
3338
3339 * src/lalr.c (lookaheads_print): New.
3340 (lalr): Call it when --trace-flag.
3341 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
3342 are dumped.
3343
3d4daee3
AD
33442001-12-29 Akim Demaille <akim@epita.fr>
3345
3346 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
3347 when walking through ritem, even via rule->rhs.
3348 * src/reduce.c (dump_grammar, useful_production, reduce_output)
3349 (useful_production, useless_nonterminals): Likewise.
3350 (reduce_grammar_tables): Likewise, plus update nritems.
3351 * src/nullable.c (set_nullable): Likewise.
3352 * src/lalr.c (build_relations): Likewise.
3353 * tests/sets.at (Nullable): Adjust.
3354 Fortunately, now, the $axiom is no longer nullable.
3355
9e7f6bbd
AD
33562001-12-29 Akim Demaille <akim@epita.fr>
3357
3358 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
3359 the 0-sentinel.
3360 * src/gram.c (ritem_longest_rhs): Likewise.
3361 * src/reduce.c (nonterminals_reduce): Likewise.
3362 * src/print_graph.c (print_graph): Likewise.
3363 * src/output.c (output_rule_data): Likewise.
3364 * src/nullable.c (set_nullable): Likewise.
3365
255ef638
AD
33662001-12-29 Akim Demaille <akim@epita.fr>
3367
3368 * src/output.c: Comment changes.
3369
0d8a7363
AD
33702001-12-27 Paul Eggert <eggert@twinsun.com>
3371
3372 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
3373 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
3374 Sparc, as they were causing more porting problems than the
3375 (minor) performance improvement was worth.
3376
3377 Also, catch up with 1.31's YYSTD.
3378
3db472b9
AD
33792001-12-27 Akim Demaille <akim@epita.fr>
3380
3381 * src/output.c (output_gram): Rely on nritems, not the
3382 0-sentinel. See below.
3383 Use -1 as separator, not 0.
3384 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
3385 Rely on -1 as separator in yyrhs, instead of 0.
3386 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
3387 twice `Now at end of input', therefore there are two lines less to
3388 expect.
3389
b365aa05
AD
33902001-12-27 Akim Demaille <akim@epita.fr>
3391
3392 * tests/regression.at (Unresolved SR Conflicts):
3393 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
3394 below.
3395
30171f79
AD
33962001-12-27 Akim Demaille <akim@epita.fr>
3397
3398 * src/LR0.c (new_state): Recognize the final state by the fact it
3399 is reached by eoftoken.
3400 (insert_start_shifting_state, insert_eof_shifting_state)
3401 (insert_accepting_state, augment_automaton): Remove, since now
3402 these states are automatically computed from the initial state.
3403 (generate_states): Adjust.
3404 * src/print.c: When reporting a rule number to the user, substract
3405 1, so that the axiom rule is rule 0, and the first user rule is 1.
3406 * src/reduce.c: Likewise.
3407 * src/print_graph.c (print_core): For the time being, just as for
3408 the report, depend upon --trace-flags to dump the full set of
3409 items.
3410 * src/reader.c (readgram): Once the grammar read, insert the rule
3411 0: `$axiom: START-SYMBOL $'.
3412 * tests/set.at: Adjust: rule 0 is now displayed, and since the
3413 number of the states has changed (the final state is no longer
3414 necessarily the last), catch up.
3415
75142d45
AD
34162001-12-27 Akim Demaille <akim@epita.fr>
3417
3418 Try to make the use of the eoftoken valid. Given that its value
3419 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
3420 is used instead of > 0 where appropriate, (ii), depend upon nritems
3421 instead of the 0-sentinel.
3422
3423 * src/gram.h, src/gram.c (nritems): New.
3424 Expected to be duplication of nitems, but for the time being...
3425 * src/reader.c (packgram): Assert nritems and nitems are equal.
3426 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
3427 * src/closure.c (print_closure, print_fderives): Likewise.
3428 * src/gram.c (ritem_print): Likewise.
3429 * src/print.c (print_core, print_grammar): Likewise.
3430 * src/print_graph.c: Likewise.
3431
b7c49edf
AD
34322001-12-27 Akim Demaille <akim@epita.fr>
3433
3434 * src/main.c (main): If there are complains after grammar
3435 reductions, then output the report anyway if requested, then die.
3436 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
3437 * src/reader.c (eoftoken): New.
3438 (parse_token_decl): If the token being defined has value `0', it
3439 is the eoftoken.
3440 (packsymbols): No longer hack `tags' to insert `$' by hand.
3441 Be sure to preserve the value of the eoftoken.
3442 (reader): Make sure eoftoken is defined.
3443 Initialize nsyms to 0: now eoftoken is created just like the others.
3444 * src/print.c (print_grammar): Don't special case the eof token.
3445 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
3446 lie anyway, albeit pleasant.
3447 * tests/calc.at: Exercise error messages with eoftoken.
3448 Change the grammar so that empty input is invalid.
3449 Adjust expectations.
3450 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
3451
ec2da99f
AD
34522001-12-27 Akim Demaille <akim@epita.fr>
3453
3454 * configure.in: Check the protos of strchr ans strspn.
3455 Replace strchr if needed.
3456 * src/system.h: Provide the protos of strchr, strspn and memchr if
3457 missing.
3458 * lib/strchr.c: New.
3459 * src/reader.c (symbols_save): Use strchr.
3460
8adfa272
AD
34612001-12-27 Akim Demaille <akim@epita.fr>
3462
3463 * src/print.c, src/print_graph.c (escape): New.
3464 Use it to quote the TAGS outputs.
3465 * src/print_graph.c (print_state): Now errors are in red, and
3466 reductions in green.
3467 Prefer high to wide: output the state number on a line of its own.
3468
80dac38c
AD
34692001-12-27 Akim Demaille <akim@epita.fr>
3470
3471 * src/state.h, src/state.c (reductions_new): New.
3472 * src/LR0.c (set_state_table): Let all the states have a
3473 `reductions', even if reduced to 0.
3474 (save_reductions): Adjust.
3475 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
3476 * src/print.c (print_reductions, print_actions): Adjust.
3477 * src/output.c (action_row): Adjust.
3478
2cec70b9
AD
34792001-12-27 Akim Demaille <akim@epita.fr>
3480
3481 * src/state.h, src/state.c (errs_new, errs_dup): New.
3482 * src/LR0.c (set_state_table): Let all the states have an errs,
3483 even if reduced to 0.
3484 * src/print.c (print_errs, print_reductions): Adjust.
3485 * src/output.c (output_actions, action_row): Adjust.
3486 * src/conflicts.c (resolve_sr_conflict): Adjust.
3487
13ca549a
AD
34882001-12-27 Akim Demaille <akim@epita.fr>
3489
3490 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
3491
5092aba5
AD
34922001-12-27 Akim Demaille <akim@epita.fr>
3493
3494 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
3495 * src/print.c: here.
3496 (lookaheadset, shiftset): New, used as additional storage by
3497 print_reductions.
3498 (print_results): Adjust.
3499 (print_shifts, print_gotos, print_errs): New, extracted from...
3500 (print_actions): here.
3501 * src/print_graph.c (print_actions): Remove dead code.
3502
11e2beca
AD
35032001-12-27 Akim Demaille <akim@epita.fr>
3504
3505 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
3506 `$n' and `@n'.
3507
dac3c910
AD
35082001-12-27 Akim Demaille <akim@epita.fr>
3509
3510 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
3511 (build_relations): Adjust.
3512
d0b0fefa
AD
35132001-12-27 Akim Demaille <akim@epita.fr>
3514
3515 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
3516 duplication.
3517
adc8c848
AD
35182001-12-27 Akim Demaille <akim@epita.fr>
3519
3520 * src/reader.c (packgram): Catch nitems overflows.
3521
14d293ac
AD
35222001-12-27 Akim Demaille <akim@epita.fr>
3523
3524 * src/files.c, src/files.h (guard_obstack): Remove.
3525 * src/output.c (output): Adjust.
3526 * src/reader.c (parse_braces): New, factoring...
3527 (copy_action, copy_guard): these two which are renamed as...
3528 (parse_action, parse_guard): these.
3529 As a voluntary consequence, using braces around guards is now
3530 mandatory.
3531
f499b062
AD
35322001-12-27 Akim Demaille <akim@epita.fr>
3533
3534 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
3535 * src/reader.c (symbol_list): `guard' and `guard_line' are new
3536 members.
3537 (symbol_list_new): Adjust.
3538 (copy_action): action_line is the first line, not the last.
3539 (copy_guard): Just as for actions, store the `action' only, not
3540 the switch/case/break flesh.
3541 Don't parse the user action that might follow the guard, let...
3542 (readgram): do it, i.e., now, there can be an action after a
3543 guard.
3544 In other words the guard is just explicitly optional.
3545 (packgram): Adjust.
3546 * src/output.c (guards_output): New.
3547 (output_parser): Call it when needed.
3548 (output): Also free the guard and attrs obstacks.
3549 * src/files.c, src/files.h (obstack_save): Remove.
3550 (output_files): Remove.
3551 As a result, if one needs the former `.act' file, using an
3552 appropriate skeleton which requires actions and guards is now
3553 required.
3554 * src/main.c (main): Adjust.
3555 * tests/semantic.at: New.
3556 * tests/regression.at: Use `input.y' as input file name.
3557 Avoid 8+3 problems by requiring input.c when the test needs the
3558 parser.
3559
d945f5cd
AD
35602001-12-27 Akim Demaille <akim@epita.fr>
3561
3562 * src/reader.c (symbol_list_new): Be sure to initialize all the
3563 fields.
3564
d200e455
AD
35652001-12-27 Akim Demaille <akim@epita.fr>
3566
3567 All the hacks using a final pseudo state are now useless.
3568
3569 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3570 * src/lalr.c (nLA): New.
3571 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3572 instead of lookaheadsp from the pseudo state (nstate + 1).
3573
f9507c28
AD
35742001-12-27 Akim Demaille <akim@epita.fr>
3575
3576 * src/output.c (action_row, token_actions): Use a state_t instead
3577 of a integer, and nlookaheads instead of the following state's
3578 lookaheadsp.
3579
065fbd27
AD
35802001-12-27 Akim Demaille <akim@epita.fr>
3581
3582 * src/conflicts.c (log_resolution, flush_shift)
3583 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3584 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3585 (conflicts_print, print_reductions): Use a state_t instead of an
3586 integer when referring to a state.
3587 As much as possible, depend upon nlookaheads, instead of the
3588 `lookaheadsp' member of the following state (since lookaheads of
3589 successive states are successive, the difference between state n + 1
3590 and n served as the number of lookaheads for state n).
3591 * src/lalr.c (add_lookback_edge): Likewise.
3592 * src/print.c (print_core, print_actions, print_state)
3593 (print_results): Likewise.
3594 * src/print_graph.c (print_core, print_actions, print_state)
3595 (print_graph): Likewise.
3596 * src/conflicts.h: Adjust.
3597
1b177bd7
AD
35982001-12-27 Akim Demaille <akim@epita.fr>
3599
3600 * src/bison.hairy: Formatting/comment changes.
3601 ANSIfy.
3602 Remove `register' indications.
3603 Add plenty of `static'.
3604
7742ddeb
AD
36052001-12-27 Akim Demaille <akim@epita.fr>
3606
3607 * src/output.c (prepare): Drop the muscle `ntbase' which
3608 duplicates ntokens.
3609 * src/bison.simple: Formatting/comment changes.
3610 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3611 is an undocumented synonym.
3612
1fa14068
AD
36132001-12-22 Akim Demaille <akim@epita.fr>
3614
3615 * src/output.c (output_table_data): Change the prototype to use
3616 `int' for array ranges: some invocations do pass an int, not a
3617 short.
3618 Reported by Wayne Green.
3619
b9752825
AD
36202001-12-22 Akim Demaille <akim@epita.fr>
3621
3622 Some actions of web2c.y are improperly triggered.
3623 Reported by Mike Castle.
3624
3625 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3626 * tests/regression.at (Web2c): Rename as...
3627 (Web2c Report): this.
3628 (Web2c Actions): New.
3629
776209d6
AD
36302001-12-22 Akim Demaille <akim@epita.fr>
3631
3632 Reductions in web2c.y are improperly reported.
3633 Reported by Mike Castle.
3634
3635 * src/conflicts.c (print_reductions): Fix.
3636 * tests/regression.at (Web2c): New.
3637
275fc3ad
AD
36382001-12-18 Akim Demaille <akim@epita.fr>
3639
3640 Some host fail on `assert (!"foo")', which expands to
3641 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3642 Reported by Nelson Beebee.
3643
3644 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3645 `#define it_succeeded 0' and `assert (it_succeeded)'.
3646
897668ee
MA
36472001-12-17 Marc Autret <autret_m@epita.fr>
3648
3649 * src/bison.simple: Don't hard code the skeleton line and filename.
3650 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3651 New line counter 'skeleton_line' (skeleton-line muscle).
3652
ab3399e0
PE
36532001-12-17 Paul Eggert <eggert@twinsun.com>
3654
3655 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3656 YYDEBUG must be defined to a nonzero value.
3657
3658 * src/bison.simple (yytname): Do not assume that the user defines
3659 YYDEBUG to a properly parenthesized expression.
3660
3877f72b
AD
36612001-12-17 Akim Demaille <akim@epita.fr>
3662
3663 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3664 nlookaheads is a new member.
3665 Adjust all users.
3666 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3667 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3668 state.
776209d6 3669
331dbc1b
AD
36702001-12-17 Akim Demaille <akim@epita.fr>
3671
3672 * src/files.h, src/files.c (open_files, close_files): Remove.
3673 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3674 let...
3675 * src/reader.c (reader): Do it.
776209d6 3676
be750e4c
AD
36772001-12-17 Akim Demaille <akim@epita.fr>
3678
3679 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 3680
709ae8c6
AD
36812001-12-17 Akim Demaille <akim@epita.fr>
3682
3683 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3684 (flush_reduce): New.
3685 (resolve_sr_conflict): Adjust.
776209d6 3686
f87685c3
AD
36872001-12-17 Akim Demaille <akim@epita.fr>
3688
3689 * src/output.c (output_obstack): Be static and rename as...
3690 (format_obstack): this, to avoid any confusion with files.c's
3691 output_obstack.
3692 * src/reader.h (muscle_obstack): Move to...
3693 * src/output.h: here, since it's defined in output.c.
3694
837491d8
AD
36952001-12-17 Akim Demaille <akim@epita.fr>
3696
3697 * src/output.c (action_row, save_column, default_goto)
3698 (sort_actions, matching_state, pack_vector): Better variable
3699 locality.
3700
796d61fb
AD
37012001-12-17 Akim Demaille <akim@epita.fr>
3702
3703 * src/output.c: Various formatting changes.
776209d6 3704
64d15509
AD
37052001-12-17 Akim Demaille <akim@epita.fr>
3706
3707 * src/files.c (output_files): Free the output_obstack.
3708 * src/main.c (main): Call print and print_graph conditionally.
3709 * src/print.c (print): Work unconditionally.
3710 * src/print_graph.c (print_graph): Work unconditionally.
3711 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3712
fbc8ecb7
MA
37132001-12-16 Marc Autret <autret_m@epita.fr>
3714
3715 * src/output.c (actions_output): Fix. When we use %no-lines,
3716 there is one less line per action.
3717
f0440388
MA
37182001-12-16 Marc Autret <autret_m@epita.fr>
3719
3720 * src/bison.simple: Remove a useless #line directive.
3721 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3722 * src/output.c (get_lines_number): New.
776209d6 3723 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
3724 output muscles.
3725 Fix line numbering.
3726 (actions_output): Computes the number of lines taken by actions.
3727 (output_master_parser): Insert new skeleton which is the name of
3728 the output parser file name.
3729
a79986b8
MA
37302001-12-15 Marc Autret <autret_m@epita.fr>
3731
3732 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3733
4ec8e00f
MA
37342001-12-15 Marc Autret <autret_m@epita.fr>
3735
3736 * src/output.c (output_gram): Keep track of the hairy one.
3737
1a4648ff
AD
37382001-12-15 Akim Demaille <akim@epita.fr>
3739
3740 Make `make distcheck' work.
3741
3742 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3743 system.h which uses libgettext.h.
3744
9c2c67e6
AD
37452001-12-15 Akim Demaille <akim@epita.fr>
3746
3747 * src/nullable.c (set_nullable): Useless rules must be skipped,
3748 otherwise, since we range over their symbols, we might look at a
3749 nonterminal which no longer ``exists'', i.e., it is not counted in
3750 `nvars', hence we overflow our arrays.
3751
93ede233
AD
37522001-12-15 Akim Demaille <akim@epita.fr>
3753
3754 The header can also be produced directly, without any obstack!
3755 Yahoo!
3756
3757 * src/files.c, src/files.h (defines_obstack): Remove.
3758 (compute_header_macro): Global.
3759 (defines_obstack_save): Remove.
3760 * src/reader.c (parse_union_decl): No longer output to
3761 defines_obstack: its content can be found in the `stype' muscle
3762 anyway.
3763 (output_token_translations): Merge into...
3764 (symbols_output): this.
3765 Rename as...
3766 (symbols_save): this.
3767 (reader): Adjust.
3768 * src/output.c (header_output): New.
3769 (output): Call it.
3770
2666f928
AD
37712001-12-15 Akim Demaille <akim@epita.fr>
3772
3773 * src/reader.c (parse_union_decl): Instead of handling two obstack
3774 simultaneously, use one to define the `stype' muscle, and use the
3775 value of the latter to fill defines_obstack.
3776 (copy_comment): Remove.
3777 (copy_comment2): Work for a single obstack.
3778 Rename as...
3779 (copy_comment): this.
3780
428046f8
AD
37812001-12-15 Akim Demaille <akim@epita.fr>
3782
3783 * src/lex.c, src/lex.h (xgetc): No longer static.
3784 * src/reader.c (parse_union_decl): Revamp.
3785
ea52d706
AD
37862001-12-15 Akim Demaille <akim@epita.fr>
3787
3788 Still making progress in separating Bison into (i) input, (ii)
3789 process, (iii) output: now we can directly output the parser file
3790 without using table_obstack at all.
3791
3792 * src/files.c, src/files.h (table_obstack): Bye bye.
3793 (parser_file_name): New.
3794 * src/files.c (compute_output_file_names): Compute it.
3795 * src/output.c (actions_output, output_parser)
3796 (output_master_parser): To a file instead of an obstack.
3797
3f96f4dc
AD
37982001-12-15 Akim Demaille <akim@epita.fr>
3799
3800 Attach actions to rules, instead of pre-outputting them to
3801 actions_obstack.
3802
3803 * src/gram.h (rule_t): action and action_line are new members.
3804 * src/reader.c (symbol_list): Likewise.
3805 (copy_action): Save the actions within the rule.
3806 (packgram): Save them in rule_table.
3807 * src/output.c (actions_output): New.
3808 (output_parser): Use it on `%%actions'.
3809 (output_rule_data): Don't free rule_table.
3810 (output): Do it.
3811 (prepare): Don't save the `action' muscle.
3812 * src/bison.simple: s/%%action/%%actions/.
3813
51576fb3
AD
38142001-12-15 Akim Demaille <akim@epita.fr>
3815
3816 * src/reader.c (copy_action): When --yacc, don't append a `;'
3817 to the user action: let it fail if lacking.
dee049eb 3818 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 3819
2648a72d
AD
38202001-12-14 Akim Demaille <akim@epita.fr>
3821
3822 * src/lex.c (literalchar): Simply return the char you decoded, non
3823 longer mess around with obstacks and int pointers.
3824 Adjust all callers.
3825
92790e5b
AD
38262001-12-14 Akim Demaille <akim@epita.fr>
3827
3828 * src/lex.c (literalchar): Don't escape the special characters,
3829 just decode them, and keep them as char (before, eol was output as
3830 the 2 char string `\n' etc.).
3831 * src/output.c (output_rule_data): Use quotearg to output the
3832 token strings.
3833
927c1557
PE
38342001-12-13 Paul Eggert <eggert@twinsun.com>
3835
3836 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3837 Do not infringe on the global user namespace when using C++.
3838 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3839 All uses of `fprintf' and `stderr' changed.
3840
3841 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3842
ed8e1f68
AD
38432001-12-13 Akim Demaille <akim@epita.fr>
3844
3845 The computation of nullable is broken: it doesn't handle empty
3846 RHS's properly.
3847
3848 * tests/torture.at (GNU AWK Grammar): New.
3849 * tests/sets.at (Nullable): New.
3850 * src/nullable.c (set_nullable): Instead of blindly looping over
3851 `ritems', loop over the rules, and then over their rhs's.
3852
3853 Work around Autotest bugs.
3854
3855 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3856 frame, because Autotest understand lines starting with a `+' as
3857 traces from the shell. Then, they are not processed properly.
3858 Admittedly an Autotest bug, but we don't have time to wait for
3859 Autotest to catch up.
3860 * tests/regression.at (Broken Closure): Adjust to the new table
3861 frames.
3862 Move to...
3863 * tests/sets.at: here.
3864
cb581495
AD
38652001-12-13 Akim Demaille <akim@epita.fr>
3866
3867 * src/closure.c (closure): Use nrules instead of playing tricks
3868 with BITS_PER_WORD.
3869
2e729273
AD
38702001-12-13 Akim Demaille <akim@epita.fr>
3871
3872 * src/print.c (print_actions): Output the handling of `$' as the
3873 traces do: shifting the token EOF. Before EOF was treated as a
3874 nonterminal.
3875 * tests/regression.at: Adjust some tests.
3876 * src/print_graph.c (print_core): Complete the set of items via
3877 closure. The next-to-final and final states are still unsatisfying,
3878 but that's to be addressed elsewhere.
3879 No longer output the rule numbers, but do output the state number.
3880 A single loop for the shifts + gotos is enough, but picked a
3881 distinct color for each.
3882 (print_graph): Initialize and finalize closure.
3883
107f7dfb
AD
38842001-12-13 Akim Demaille <akim@epita.fr>
3885
3886 * src/reader.c (readgram): Remove dead code, an strip useless
3887 braces.
3888 (get_type): Remove, unused.
3889
9b53a24f
AD
38902001-12-12 Akim Demaille <akim@epita.fr>
3891
3892 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3893 on that of lib/error.c.
3894
dbfb6dcd
AD
38952001-12-12 Akim Demaille <akim@epita.fr>
3896
3897 Some hosts don't like `/' in includes.
3898
3899 * src/system.h: Include libgettext.h without qualifying the path.
3900 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3901 $(top_srcdir).
3902
c25fb648
MA
39032001-12-11 Marc Autret <autret_m@epita.fr>
3904
3905 * src/output.c (output_parser): Remove useless muscle.
3906
710ddc4f
MA
39072001-12-11 Marc Autret <autret_m@epita.fr>
3908
3909 * src/bison.simple: Remove #line just before %%epilogue. It
3910 is now handled in ...
3911 * src/reader.c (read_additionnal_code): Add the output of a
3912 #line for the epilogue.
3913
e83d80b8
MA
39142001-12-10 Marc Autret <autret_m@epita.fr>
3915
927c1557 3916 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3917 replace precedent remove.
3918 * src/bison.simple: Remove #line before %%prologue because
3919 %%input-line is wrong at this time.
3920
971d5158
MA
39212001-12-10 Marc Autret <autret_m@epita.fr>
3922
3923 * src/reader.c (symbols_output): Clean up.
927c1557 3924 * src/output.c (output_gram, output): Clean up.
971d5158 3925
5edafffd
AD
39262001-12-10 Akim Demaille <akim@epita.fr>
3927
3928 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3929 * src/LR0.c (set_state_table): here.
3930 * src/lalr.c (lalr): Call it.
3931
0279f8e9
AD
39322001-12-10 Akim Demaille <akim@epita.fr>
3933
3934 * src/state.h (shifts): Remove the `number' member: shifts are
3935 attached to state, hence no longer need to be labelled with a
3936 state number.
3937
190c4f5f
AD
39382001-12-10 Akim Demaille <akim@epita.fr>
3939
3940 Now that states have a complete set of members, the linked list of
3941 shifts is useless: just fill directly the state's shifts member.
3942
3943 * src/state.h (shifts): Remove the `next' member.
3944 * src/LR0.c (first_state, last_state): Remove.
3945 Adjust the callers.
3946 (augment_automaton): Don't look for the shifts that must be added
3947 a shift on EOF: it is those of the state we looked for! But now,
3948 since shifts are attached, it is no longer needed to looking
3949 merely by its id: its number.
3950
2a73b93d
AD
39512001-12-10 Akim Demaille <akim@epita.fr>
3952
3953 * src/LR0.c (augment_automaton): Better variable locality.
3954 Remove an impossible branch: if there is a state corresponding to
3955 the start symbol being shifted, then there is shift for the start
3956 symbol from the initial state.
3957
74392f6a
AD
39582001-12-10 Akim Demaille <akim@epita.fr>
3959
3960 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3961 only when appropriate: when insert_start_shifting_state' is not
3962 invoked.
3963 * tests/regression.at (Rule Line Numbers): Adjust.
3964
37c82725
AD
39652001-12-10 Akim Demaille <akim@epita.fr>
3966
3967 * src/LR0.c (augment_automaton): Now that all states have shifts,
3968 merge the two cases addition shifts to the initial state.
3969
6a164e0c
AD
39702001-12-10 Akim Demaille <akim@epita.fr>
3971
3972 * src/lalr.c (set_state_table): Move to...
3973 * src/LR0.c: here.
3974 * src/lalr.c (lalr): Don't call it...
3975 * src/LR0.c (generate_states): do it.
3976 * src/LR0.h (first_state): Remove, only the table is used.
3977
7215de24
AD
39782001-12-10 Akim Demaille <akim@epita.fr>
3979
3980 * src/LR0.h (first_shift, first_reduction): Remove.
3981 * src/lalr.c: Don't use first_shift: find shifts through the
3982 states.
3983
80e25d4d
AD
39842001-12-10 Akim Demaille <akim@epita.fr>
3985
3986 * src/LR0.c: Attach shifts to states as soon as they are
3987 computed.
3988 * src/lalr.c (set_state_table): Instead of assigning shifts to
3989 state, just assert that the mapping was properly done.
3990
0ab3728b
AD
39912001-12-10 Akim Demaille <akim@epita.fr>
3992
3993 * src/LR0.c (insert_start_shift): Rename as...
3994 (insert_start_shifting_state): this.
3995 (insert_eof_shifting_state, insert_accepting_state): New.
3996 (augment_automaton): Adjust.
3997 Better locality of the variables.
3998 When looking if the start_symbol is shifted from the initial
3999 state, using `while (... symbol != start_symbol ...)' sounds
4000 better than `while (... symbol < start_symbol ...)': If fail
4001 to see how the order between symbols could be relevant!
4002
78af9bbc
AD
40032001-12-10 Akim Demaille <akim@epita.fr>
4004
4005 * src/getargs.h: Don't declare `spec_name_prefix' and
4006 `spec_file_prefix', declared by src/files.h.
4007 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
4008 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
4009 * src/output.c (prepare): Adjust.
4010 * src/reader.c (symbols_output): Likewise.
4011 * src/vmsgetargs.c: Vaguely adjust, but who cares?
4012
bdef2a41
AD
40132001-12-10 Akim Demaille <akim@epita.fr>
4014
4015 * src/muscle_tab.c (muscle_init): NULL is a better default than
4016 `"0"'.
4017
3735969c
AD
40182001-12-10 Akim Demaille <akim@epita.fr>
4019
4020 * src/reader.c (reader): Calling symbols_output once is enough.
4021
49701457
AD
40222001-12-10 Akim Demaille <akim@epita.fr>
4023
4024 Now that states have a complete set of members, the linked list of
4025 reductions is useless: just fill directly the state's reductions
4026 member.
4027
4028 * src/state.h (struct reductions): Remove member `number' and
4029 `next'.
4030 * src/LR0.c (first_reduction, last_reduction): Remove.
4031 (save_reductions): Don't link the new reductions, store them in
4032 this_state.
4033 * src/lalr.c (set_state_table): No need to attach reductions to
4034 states, it's already done.
4035 * src/output.c (output_actions): No longer free the shifts, then
4036 the reductions, then the states: free all the states and their
4037 members.
4038
0edad749
AD
40392001-12-10 Akim Demaille <akim@epita.fr>
4040
4041 * src/options.c (OPTN, DRTV, BOTH): New.
4042 (option_table): Use them.
4043
0edad749
AD
4044 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
4045 the job of system.h.
4046 * src/options.c: Don't include stdio.h and xalloc.h for the same
4047 reasons.
4048
5449dd0f
AD
40492001-12-10 Akim Demaille <akim@epita.fr>
4050
4051 * src/output.c (output, prepare): Make sure the values of the
4052 muscles `action' and `prologue' are 0-terminated.
4053
a870c567
AD
40542001-12-10 Akim Demaille <akim@epita.fr>
4055
4056 Clean up GCC warnings.
4057
4058 * src/reader.c (copy_action): `buf' is not used.
4059 (parse_skel_decl): Be static.
4060 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
4061 * src/options.h (create_long_option_table): Have a real prototype.
4062 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
4063 (hash_delete_at): Return const void *.
4064 Adjust casts to preserve the const.
4065
80df8768
AD
40662001-12-10 Akim Demaille <akim@epita.fr>
4067
4068 * configure.in: Require 2.52g.
4069 M4 is not needed, but AUTOM4TE is.
4070 * m4/m4.m4: Remove.
4071 * tests/Makefile.am: Adjust.
4072
f693ad14
AD
40732001-12-10 Akim Demaille <akim@epita.fr>
4074
4075 One structure for states is enough, even though theoretically
4076 there are LR(0) states and LALR(1) states.
4077
4078 * src/lalr.h (state_t): Remove.
4079 (state_table): Be state_t **, not state_t *.
4080 * src/state.h (core, CORE_ALLOC): Rename as...
4081 (state_t, STATE_ALLOC): this.
4082 Add the LALR(1) members: shifts, reductions, errs.
4083 * src/LR0.c (state_table): Rename as...
4084 (state_hash): this, to avoid name clashes with the global
4085 `state_table'.
4086 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
4087 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
4088
74ffbcb6
AD
40892001-12-10 Akim Demaille <akim@epita.fr>
4090
4091 Bison dumps core on bash.y.
4092 Reported by Pascal Bart.
4093
4094 * src/warshall.c (bitmatrix_print): New.
4095 (TC): Use it.
4096 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
4097 j must be the outer loop.
4098 * tests/regression.at (Broken Closure): New.
4099
07708e19
AD
41002001-12-05 Akim Demaille <akim@epita.fr>
4101
4102 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
4103 its argument.
4104