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