]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Playing with Autoscan.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-09-27 Akim Demaille <akim@epita.fr>
2
3 Playing with Autoscan.
4
5 * configure.ac: Remove the old LIBOBJ tweaks.
6 (AC_REPLACE_FUNCS): Add strrchr and strtol.
7 * lib/strrchr.c: New.
8 * lib/strtol.c: New, from the Coreutils 4.5.1.
9
102002-09-27 Akim Demaille <akim@epita.fr>
11
12 Playing with Autoscan.
13
14 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
18 Coreutils 4.5.1.
19
202002-09-24 Akim Demaille <akim@epita.fr>
21
22 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
23 (Frequently Asked Questions, Parser Stack Overflow): New.
24
252002-09-13 Akim Demaille <akim@epita.fr>
26
27 Playing with autoscan.
28
29 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
30 * src/files.c (skeleton_find): Remove, unused.
31 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
32 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
33
342002-09-13 Akim Demaille <akim@epita.fr>
35
36 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
37 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
38
392002-09-13 Akim Demaille <akim@epita.fr>
40
41 * configure.ac: Require 2.54.
42 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
43 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
44 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
45 Remove, provided by Autoconf macros.
46
472002-09-12 Akim Demaille <akim@epita.fr>
48
49 * m4/prereq.m4: Update, from Coreutils 4.5.1.
50
512002-09-12 Akim Demaille <akim@epita.fr>
52
53 * m4/prereq.m4: Update, from Fileutils 4.1.5.
54 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
55 Reported by Martin Mokrejs.
56
572002-09-10 Akim Demaille <akim@epita.fr>
58
59 * src/parse-gram.y: Associate a human readable string to each
60 token type.
61 * tests/regression.at (Invalid inputs): Adjust.
62
632002-09-10 Gary V. Vaughan <gary@gnu.org>
64
65 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
66 with an Autoconf-2.5x style configure.ac.
67
682002-09-06 Paul Eggert <eggert@twinsun.com>
69
70 * doc/bison.texinfo (Conditions): Make explicit that the GPL
71 exception applies only to yacc.c. This is a modification of a
72 patch originally suggested by Akim Demaille.
73
742002-09-06 Akim Demaille <akim@epita.fr>
75
76 * data/c.m4 (b4_copyright): Move the GPL exception comment from
77 here to...
78 * data/yacc.c: here.
79
80 * data/lalr1.cc (struct yyltype): Don't define it, since we use
81 LocationType.
82 (b4_ltype): Default to yy::Location from location.hh.
83
842002-09-04 Jim Meyering <jim@meyering.net>
85
86 * data/yacc.c: Guard the declaration of yytoknum also with
87 `#ifdef YYPRINT', so it is declared only when used.
88
892002-09-04 Akim Demaille <akim@epita.fr>
90
91 * configure.in: Rename as...
92 * configure.ac: this.
93 Bump to 1.49c.
94
952002-09-04 Akim Demaille <akim@epita.fr>
96
97 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
98 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
99 translate maintainer only messages.
100
1012002-08-12 Paul Eggert <eggert@twinsun.com>
102
103 Version 1.49b.
104
105 * Makefile.am (SUBDIRS): Remove intl.
106 (DISTCLEANFILES): Remove.
107 * NEWS: Mention that GNU M4 is now required. Clarify what is
108 meant by "larger grammars". Mention the pt_BR translation.
109 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
110 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
111 Bump version from 0.11.2 to 0.11.5.
112 (BISON_PREREQ_STAGE): Remove.
113 (AM_GNU_GETTEXT): Use external gettext.
114 (AC_OUTPUT): Remove intl/Makefile.
115
116 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
117
118 * data/glr.c: Include string.h, for strlen.
119 (yyreportParseError): Use size_t for yysize.
120 (yy_yypstack): No longer nested inside yypstates, as nested
121 functions are not portable. Do not assume size_t is the
122 same width as int.
123 (yypstates): Do not assume that ptrdiff_t is the same width
124 as int, and similarly for yyposn and YYINDEX.
125
126 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
127
128 * lib/Makefile.am (INCLUDES): Do not include from the intl
129 directory, which has been removed.
130 * src/Makefile.am (INCLUDES): Likewise.
131
132 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
133 (bitsets_sources, additional_bitsets_sources, timevars_sources):
134 New vars.
135
136 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
137 * tests/Makefile.am (EXTRA_DIST): Likewise.
138
139 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
140 Do not assume that bitset_windex is the same width as unsigned.
141
142 * lib/abitset.c (abitset_unused_clear): Do not assume that
143 bitset_word is the same width as int.
144 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
145 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
146 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
147 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
148 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
149
150 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
151 portability to one's complement hosts!).
152 * lib/ebitset.c (ebitset_op1): Likewise.
153 * lib/lbitset.c (lbitset_op1): Likewise.
154
155 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
156 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
157 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
158 Sync with fileutils.
159 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
160 lib/gettext.h: Sync with diffutils.
161
162 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
163 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
164
165 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
166 PROTOTYPES to check for prototypes, and "defined __STDC__" to
167 check for void *.
168
169 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
170 size_t; the old version tried to do this but casted improperly.
171 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
172 (bitset_test): Now returns int, not unsigned long.
173
174 * lib/bitset_stats.c: Include "gettext.h".
175 (_): New macro.
176 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
177 name locals "index", as it generates unnecessary warnings on some
178 hosts that have an "index" function.
179
180 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
181 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
182 they need translation.
183 * src/LR0.c (state_list_append, new_itemsets, get_state,
184 append_states, generate_states): Likewise.
185 * src/assoc.c (assoc_to_string): Likewise.
186 * src/closure.c (print_closure, set_firsts, closure): Likewise.
187 * src/gram.c (grammar_dump): Likewise.
188 * src/injections.c (injections_compute): Likewise.
189 * src/lalr.c (lookaheads_print): Likewise.
190 * src/relation.c (relation_transpose): Likewise.
191 * src/scan-gram.l: Likewise.
192 * src/tables.c (table_grow, pack_vector): Likewise.
193
194 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
195 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
196 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
197 * m4/mbstate_t.m4: Sync with fileutils.
198 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
199
200 * po/LINGUAS: Add pt_BR.
201 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
202 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
203 lib/timevar.c.
204 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
205 manual recommends.
206 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
207
208 * src/complain.c (strerror_r): Remove decl; not needed.
209 (strerror): Use same pattern as ../lib/error.c.
210
211 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
212
213 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
214
215 * src/main.c (main): Cast result of bindtextdomain and textdomain
216 to void, to avoid a GCC warning when --disable-nls is in effect.
217
218 * src/scan-gram.l: Use strings rather than escapes when possible,
219 to minimize the number of warnings from xgettext.
220 (handle_action_dollar, handle_action_at): Don't use isdigit,
221 as it mishandles negative chars and it may not work as expected
222 outside the C locale.
223
224 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
225 this is a GCC extension and is not portable to other compilers.
226
227 * src/system.h (alloca): Use same pattern as ../lib/error.c.
228 Do not include <ctype.h>; no longer needed.
229 Do not include <malloc.h>; no longer needed (and generates
230 warnings on OpenBSD 3.0).
231
232 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
233 it's not portable.
234
235 * tests/regression.at: Do not use 'cc -c input.c -o input';
236 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
237
238 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
239 exit status as failure, not just exit status 1. Sun C exits
240 with status 2 sometimes.
241
242 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
243 Use it for the two large tests.
244
2452002-08-02 Akim Demaille <akim@epita.fr>
246
247 * src/conflicts.c (conflicts_output): Don't output rules never
248 reduced here, since anyway that computation doesn't work.
249 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
250 (rule_useless_p, rule_never_reduced_p): New.
251 (grammar_rules_partial_print): Use a filter instead of a range.
252 Display the title only if needed.
253 (grammar_rules_print): Adjust.
254 (grammar_rules_never_reduced_report): New.
255 * src/tables.c (action_row): Move the computation of rules never
256 reduced to...
257 (token_actions): here.
258 * src/main.c (main): Make the parser before making the report, so
259 that rules never reduced are computed.
260 Call grammar_rules_never_reduced_report.
261 * src/print.c (print_results): Report rules never reduced.
262 * tests/conflicts.at, tests/reduce.at: Adjust.
263
2642002-08-01 Akim Demaille <akim@epita.fr>
265
266 Instead of attaching lookaheads and duplicating the rules being
267 reduced by a state, attach the lookaheads to the reductions.
268
269 * src/state.h (state_t): Remove the `lookaheads',
270 `lookaheads_rule' member.
271 (reductions_t): Add a `lookaheads' member.
272 Use a regular array for the `rules'.
273 * src/state.c (reductions_new): Initialize the lookaheads member
274 to 0.
275 (state_rule_lookaheads_print): Adjust.
276 * src/state.h, src/state.c (state_reductions_find): New.
277 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
278 (count_rr_conflicts): Adjust.
279 * src/lalr.c (LArule): Remove.
280 (add_lookback_edge): Adjust.
281 (state_lookaheads_count): New.
282 (states_lookaheads_initialize): Merge into...
283 (initialize_LA): this.
284 (lalr_free): Adjust.
285 * src/main.c (main): Don't free nullable and derives too early: it
286 is used by --verbose.
287 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
288
2892002-08-01 Akim Demaille <akim@epita.fr>
290
291 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
292 `rule_number_t**'.
293 (set_derives, free_derives): Rename as...
294 (derives_compute, derives_free): this.
295 Adjust all dependencies.
296 * src/nullable.c (set_nullable, free_nullable): Rename as...
297 (nullable_compute, nullable_free): these.
298 (rule_list_t): Store rule_t *, not rule_number_t.
299 * src/state.c (state_rule_lookaheads_print): Directly compare rule
300 pointers, instead of their numbers.
301 * src/main.c (main): Call nullable_free, and derives_free earlier,
302 as they were lo longer used.
303
3042002-08-01 Akim Demaille <akim@epita.fr>
305
306 * lib/timevar.c (get_time): Include children time.
307 * src/lalr.h (LA, LArule): Don't export them: used with the
308 state_t.
309 * src/lalr.c (LA, LArule): Static.
310 * src/lalr.h, src/lalr.c (lalr_free): New.
311 * src/main.c (main): Call it.
312 * src/tables.c (pack_vector): Check whether loc is >= to the
313 table_size, not >.
314 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
315 (tables_generate): do it, since that's also it which allocates
316 them.
317 Don't free LA and LArule, main does.
318
3192002-07-31 Akim Demaille <akim@epita.fr>
320
321 Separate parser tables computation and output.
322
323 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
324 (conflict_list, conflict_list_cnt, table, check, table_ninf)
325 (yydefgoto, yydefact, high): Move to...
326 * src/tables.h, src/tables.c: here.
327 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
328 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
329 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
330 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
331 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
332 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
333 (action_row, save_row, token_actions, save_column, default_goto)
334 (goto_actions, sort_actions, matching_state, pack_vector)
335 (table_ninf_remap, pack_table, prepare_actions): Move to...
336 * src/tables.c: here.
337 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
338 * src/output.c (token_actions, output_base, output_conflicts)
339 (output_check): Merge into...
340 (prepare_actions): this.
341 (actions_output): Rename as...
342 (user_actions_output): this.
343 * src/main.c (main): Call tables_generate and tables_free.
344
3452002-07-31 Akim Demaille <akim@epita.fr>
346
347 Steal GCC's --time-report support.
348
349 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
350 stolen/adjusted from GCC.
351 * m4/stage.m4: Remove time related checks.
352 * m4/timevar.m4: New.
353 * configure.in: Adjust.
354 * src/system.h: Adjust to using timevar.h.
355 * src/getargs.h, src/getargs.c: Support trace_time for
356 --trace=time.
357 * src/main.c (stage): Remove.
358 (main): Replace `stage' invocations with timevar calls.
359 * src/output.c: Insert pertinent timevar calls.
360
3612002-07-31 Akim Demaille <akim@epita.fr>
362
363 Let --trace have arguments.
364
365 * src/getargs.h (enum trace_e): New.
366 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
367 (long_options, short_options): --trace/-T takes an optional
368 argument.
369 Change all the uses of trace_flag to reflect the new flags.
370 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
371
372 Strengthen `stage' portability.
373
374 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
375 * configure.in: Use it.
376 Don't check for malloc.h and sys/times.h.
377 * src/system.h: Include them when appropriate.
378 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
379 times and struct tms are available.
380
3812002-07-30 Akim Demaille <akim@epita.fr>
382
383 In verbose parse error message, don't report `error' as an
384 expected token.
385 * tests/actions.at (Printers and Destructors): Adjust.
386 * tests/calc.at (Calculator $1): Adjust.
387 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
388 error message, do not report the parser accepts the error token in
389 that state.
390
3912002-07-30 Akim Demaille <akim@epita.fr>
392
393 Normalize conflict related messages.
394
395 * src/complain.h, src/complain.c (warn, complain): New.
396 * src/conflicts.c (conflicts_print): Use them.
397 (conflict_report_yacc): New, extracted from...
398 (conflicts_print): here.
399 * tests/conflicts.at, tests/existing.at: Adjust.
400
4012002-07-30 Akim Demaille <akim@epita.fr>
402
403 Report rules which are never reduced by the parser: those hidden
404 by conflicts.
405
406 * src/LR0.c (save_reductions): Don't make the final state too
407 different: save its reduction (accept) instead of having a state
408 without any action (no shift or goto, no reduce).
409 Note: the final state is now a ``regular'' state, i.e., the
410 parsers now contain `reduce 0' as default reduction.
411 Nevertheless, since they decide to `accept' when yystate =
412 final_state, they still will not reduce rule 0.
413 * src/print.c (print_actions, print_reduction): Adjust.
414 * src/output.c (action_row): Track reduced rules.
415 (token_actions): Report rules never reduced.
416 * tests/conflicts.at, tests/regression.at: Adjust.
417
4182002-07-30 Akim Demaille <akim@epita.fr>
419
420 `stage' was accidently included in a previous patch.
421 Initiate its autoconfiscation.
422
423 * configure.in: Look for malloc.h and sys/times.h.
424 * src/main.c (stage): Adjust.
425 Report only when trace_flag.
426
4272002-07-29 Akim Demaille <akim@epita.fr>
428
429 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
430 state_number_t.
431 (errs_t): symbol_t*, not symbol_number_t.
432 (reductions_t): rule_t*, not rule_number_t.
433 (FOR_EACH_SHIFT): New.
434 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
435 * src/print.c, src/print_graph.c: Adjust.
436
4372002-07-29 Akim Demaille <akim@epita.fr>
438
439 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
440
441 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
442 (endtoken, accept): these.
443 * src/reader.c (reader): Set endtoken's default tag to "$end".
444 Set undeftoken's tag to "$undefined" instead of "$undefined.".
445 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
446 Adjust.
447
4482002-07-29 Akim Demaille <akim@epita.fr>
449
450 * src/reduce.c (reduce_grammar): When the language is empty,
451 complain about the start symbol, not the axiom.
452 Use its location.
453 * tests/reduce.at (Empty Language): New.
454
4552002-07-26 Akim Demaille <akim@epita.fr>
456
457 * src/reader.h, src/reader.c (gram_error): ... can't get
458 yycontrol without making too strong assumptions on the parser
459 itself.
460 * src/output.c (prepare_tokens): Use the real 0th value of
461 token_translations instead of `0'.
462 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
463 visible here.
464 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
465 for the time being: %locations ought to provide it to yyerror.
466
4672002-07-25 Akim Demaille <akim@epita.fr>
468
469 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
470 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
471 * tests/regression.at (Web2c Actions): Adjust.
472
4732002-07-25 Akim Demaille <akim@epita.fr>
474
475 Stop storing rules from 1 to nrules + 1.
476
477 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
478 * src/nullable.c, src/output.c, src/print.c, src/reader.c
479 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
480 Iterate from 0 to nrules.
481 Use rule_number_as_item_number and item_number_as_rule_number.
482 Adjust to `derive' now containing possibly 0.
483 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
484 Handle the `- 1' part in rule numbers from/to item numbers.
485 * src/conflicts.c (log_resolution): Fix the message which reversed
486 shift and reduce.
487 * src/output.c (action_row): Initialize default_rule to -1.
488 (token_actions): Adjust.
489 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
490 expected output.
491 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
492
4932002-07-25 Akim Demaille <akim@epita.fr>
494
495 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
496 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
497 (b4_c_knr_arg_decl): New.
498 * data/yacc.c: Use it to define yysymprint, yydestruct, and
499 yyreport_parse_error.
500
5012002-07-25 Akim Demaille <akim@epita.fr>
502
503 * data/yacc.c (yyreport_parse_error): New, extracted from...
504 (yyparse): here.
505 (yydestruct, yysymprint): Move above yyparse.
506 Be K&R compliant.
507
5082002-07-25 Akim Demaille <akim@epita.fr>
509
510 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
511 replace...
512 (b4_sint_type, b4_uint_type): these.
513 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
514 * tests/regression.at (Web2c Actions): Adjust.
515
5162002-07-25 Akim Demaille <akim@epita.fr>
517
518 * src/gram.h (TIEM_NUMBER_MAX): New.
519 (item_number_of_rule_number, rule_number_of_item_number): Rename
520 as...
521 (rule_number_as_item_number, item_number_as_rule_number): these.
522 Adjust dependencies.
523 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
524 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
525 (symbol_number_to_vector_number): New.
526 (order): Of vector_number_t* type.
527 (base_t, BASE_MAX, BASE_MIN): New.
528 (froms, tos, width, pos, check): Of base_t type.
529 (action_number_t, ACTION_MIN, ACTION_MAX): New.
530 (actrow): Of action_number_t type.
531 (conflrow): Of unsigned int type.
532 (table_ninf, base_ninf): New.
533 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
534 (muscle_insert_int_table, muscle_insert_base_table)
535 (muscle_insert_rule_number_table): New.
536 (prepare_tokens): Output `toknum' as int_table.
537 (action_row): Returns a rule_number_t.
538 Use ACTION_MIN, not SHRT_MIN.
539 (token_actions): yydefact is rule_number_t*.
540 (table_ninf_remap): New.
541 (pack_table): Use it for `base' and `table'.
542 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
543 replaced with...
544 (YYPACT_NINF, YYTABLE_NINF): these.
545 (yypact, yytable): Compute their types instead of hard-coded
546 `short'.
547 * tests/regression.at (Web2c Actions): Adjust.
548
5492002-07-19 Akim Demaille <akim@epita.fr>
550
551 * src/scan-gram.l (id): Can start with an underscore.
552
5532002-07-16 Akim Demaille <akim@epita.fr>
554
555 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
556 Adjust all former `associativity' dependencies.
557 * src/symtab.c (symbol_new): Default associativity is `undef', not
558 `right'.
559 (symbol_check_alias_consistence): Adjust.
560
5612002-07-09 Akim Demaille <akim@epita.fr>
562
563 * doc/bison.texinfo: Properly set the ``header'' part.
564 Use @dircategory ``GNU programming tools'' as per Texinfo's
565 documentation.
566 Use @copying.
567
5682002-07-09 Akim Demaille <akim@epita.fr>
569
570 * lib/quotearg.h: Protect against multiple inclusions.
571 * src/location.h (location_t): Add a `file' member.
572 (LOCATION_RESET, LOCATION_PRINT): Adjust.
573 * src/complain.c (warn_at, complain_at, fatal_at): Drop
574 `error_one_per_line' support.
575
5762002-07-09 Akim Demaille <akim@epita.fr>
577
578 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
579 * src/reader.c (lineno): Remove.
580 Adjust all dependencies.
581 (get_merge_function): Take a location and use complain_at.
582 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
583 * tests/regression.at (Invalid inputs, Mixing %token styles):
584 Adjust.
585
5862002-07-09 Akim Demaille <akim@epita.fr>
587
588 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
589 recovery rule, and forbid extensions when --yacc.
590 (gram_error): Use complain_at.
591 * src/reader.c (reader): Exit if there were parse errors.
592
5932002-07-09 Akim Demaille <akim@epita.fr>
594
595 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
596 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
597 Reported by R Blake <blakers@mac.com>.
598
5992002-07-09 Akim Demaille <akim@epita.fr>
600
601 * data/yacc.c: Output the copyright notive in the header.
602
6032002-07-03 Akim Demaille <akim@epita.fr>
604
605 * src/output.c (froms, tos): Are state_number_t.
606 (save_column): sp, sp1, and sp2 are state_number_t.
607 (prepare): Rename `final' as `final_state_number', `nnts' as
608 `nterms_number', `nrules' as `rules_number', `nstates' as
609 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
610 unused.
611 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
612 * data/lalr1.cc (nsym_): Remove, unused.
613
6142002-07-03 Akim Demaille <akim@epita.fr>
615
616 * src/lalr.h, src/lalr.c (goto_number_t): New.
617 * src/lalr.c (goto_list_t): New.
618 Propagate them.
619 * src/nullable.c (rule_list_t): New.
620 Propagate.
621 * src/types.h: Remove.
622
6232002-07-03 Akim Demaille <akim@epita.fr>
624
625 * src/closure.c (print_fderives): Use rule_rhs_print.
626 * src/derives.c (print_derives): Use rule_rhs_print.
627 (rule_list_t): New, replaces `shorts'.
628 (set_derives): Add comments.
629 * tests/sets.at (Nullable, Firsts): Adjust.
630
6312002-07-03 Akim Demaille <akim@epita.fr>
632
633 * src/output.c (prepare_actions): Free `tally' and `width'.
634 (prepare_actions): Allocate and free `order'.
635 * src/symtab.c (symbols_free): Free `symbols'.
636 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
637 * src/output.c (m4_invoke): Move to...
638 * src/scan-skel.l: here.
639 (<<EOF>>): Close yyout, and free its name.
640
6412002-07-03 Akim Demaille <akim@epita.fr>
642
643 Fix some memory leaks, and fix a bug: state 0 was examined twice.
644
645 * src/LR0.c (new_state): Merge into...
646 (state_list_append): this.
647 (new_states): Merge into...
648 (generate_states): here.
649 (set_states): Don't ensure a proper `errs' state member here, do it...
650 * src/conflicts.c (conflicts_solve): here.
651 * src/state.h, src/state.c: Comment changes.
652 (state_t): Rename member `shifts' as `transitions'.
653 Adjust all dependencies.
654 (errs_new): For consistency, also take the values as argument.
655 (errs_dup): Remove.
656 (state_errs_set): New.
657 (state_reductions_set, state_transitions_set): Assert that no
658 previous value was assigned.
659 (state_free): New.
660 (states_free): Use it.
661 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
662 temporary storage: use `errs' and `nerrs' as elsewhere.
663 (set_conflicts): Allocate and free this `errs'.
664
6652002-07-02 Akim Demaille <akim@epita.fr>
666
667 * lib/libiberty.h: New.
668 * lib: Update the bitset implementation from upstream.
669 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
670 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
671 * src/main.c: Adjust bitset stats calls.
672
6732002-07-01 Paul Eggert <eggert@twinsun.com>
674
675 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
676 char, so that negative chars don't collide with $.
677
6782002-06-30 Akim Demaille <akim@epita.fr>
679
680 Have the GLR tests be `warning' checked, and fix the warnings.
681
682 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
683 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
684 (yyremoveDeletes): `yyi' and `yyj' are size_t.
685 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
686 (yyaddDeferredAction): static.
687 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
688 (yyreportParseError): yyprefix is const.
689 yytokenp is used only when verbose.
690 (yy__GNUC__): Replace with __GNUC__.
691 (yypdumpstack): yyi is size_t.
692 (yypreference): Un-yy local variables and arguments, to avoid
693 clashes with `yyr1'. Anyway, we are not in the user name space.
694 (yytname_size): be an int, as is compared with ints.
695 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
696 Use them.
697 * tests/cxx-gram.at: Use quotation to protect $1.
698 Use AT_COMPILE to enable warnings hunts.
699 Prototype yylex and yyerror.
700 `Use' argc.
701 Include `string.h', not `strings.h'.
702 Produce and prototype stmtMerge only when used.
703 yylex takes a location.
704
7052002-06-30 Akim Demaille <akim@epita.fr>
706
707 We spend a lot of time in quotearg, in particular when --verbose.
708
709 * src/symtab.c (symbol_get): Store a quoted version of the key.
710 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
711 Adjust all callers.
712
7132002-06-30 Akim Demaille <akim@epita.fr>
714
715 * src/state.h (reductions_t): Rename member `nreds' as num.
716 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
717 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
718
7192002-06-30 Akim Demaille <akim@epita.fr>
720
721 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
722 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
723 (shifts_to): Rename as...
724 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
725 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
726 (TRANSITION_IS_DISABLED, transitions_to): these.
727
7282002-06-30 Akim Demaille <akim@epita.fr>
729
730 * src/print.c (print_shifts, print_gotos): Merge into...
731 (print_transitions): this.
732 (print_transitions, print_errs, print_reductions): Align the
733 lookaheads columns.
734 (print_core, print_transitions, print_errs, print_state,
735 print_grammar): Output empty lines separator before, not after.
736 (state_default_rule_compute): Rename as...
737 (state_default_rule): this.
738 * tests/conflicts.at (Defaulted Conflicted Reduction),
739 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
740 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
741
7422002-06-30 Akim Demaille <akim@epita.fr>
743
744 Display items as we display rules.
745
746 * src/gram.h, src/gram.c (rule_lhs_print): New.
747 * src/gram.c (grammar_rules_partial_print): Use it.
748 * src/print.c (print_core): Likewise.
749 * tests/conflicts.at (Defaulted Conflicted Reduction),
750 (Unresolved SR Conflicts): Adjust.
751 (Unresolved SR Conflicts): Adjust and rename as...
752 (Resolved SR Conflicts): this, as was meant.
753 * tests/regression.at (Web2c Report): Adjust.
754
7552002-06-30 Akim Demaille <akim@epita.fr>
756
757 * src/print.c (state_default_rule_compute): New, extracted from...
758 (print_reductions): here.
759 Pessimize, but clarify the code.
760 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
761
7622002-06-30 Akim Demaille <akim@epita.fr>
763
764 * src/output.c (action_row): Let default_rule be always a rule
765 number.
766
7672002-06-30 Akim Demaille <akim@epita.fr>
768
769 * src/closure.c (print_firsts, print_fderives, closure):
770 Use BITSET_EXECUTE.
771 * src/lalr.c (lookaheads_print): Likewise.
772 * src/state.c (state_rule_lookaheads_print): Likewise.
773 * src/print_graph.c (print_core): Likewise.
774 * src/print.c (print_reductions): Likewise.
775 * src/output.c (action_row): Likewise.
776 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
777
7782002-06-30 Akim Demaille <akim@epita.fr>
779
780 * src/print_graph.c: Use report_flag.
781
7822002-06-30 Akim Demaille <akim@epita.fr>
783
784 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
785 to...
786 * src/relation.h, src/relation.c (traverse, relation_digraph)
787 (relation_print, relation_transpose): New.
788
7892002-06-30 Akim Demaille <akim@epita.fr>
790
791 * src/state.h, src/state.c (shifts_to): New.
792 * src/lalr.c (build_relations): Use it.
793
7942002-06-30 Akim Demaille <akim@epita.fr>
795
796 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
797 (item_number_of_rule_number, rule_number_of_item_number): New.
798 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
799 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
800 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
801 Propagate their use.
802 Much remains to be done, in particular wrt `shorts' from types.h.
803
8042002-06-30 Akim Demaille <akim@epita.fr>
805
806 * src/symtab.c (symbol_new): Initialize the `printer' member.
807
8082002-06-30 Akim Demaille <akim@epita.fr>
809
810 * src/LR0.c (save_reductions): Remove, replaced by...
811 * src/state.h, src/state.c (state_reductions_set): New.
812 (reductions, errs): Rename as...
813 (reductions_t, errs_t): these.
814 Adjust all dependencies.
815
8162002-06-30 Akim Demaille <akim@epita.fr>
817
818 * src/LR0.c (state_list_t, state_list_append): New.
819 (first_state, last_state): Now symbol_list_t.
820 (this_state): Remove.
821 (new_itemsets, append_states, save_reductions): Take a state_t as
822 argument.
823 (set_states, generate_states): Adjust.
824 (save_shifts): Remove, replaced by...
825 * src/state.h, src/state.c (state_shifts_set): New.
826 (shifts): Rename as...
827 (shifts_t): this.
828 Adjust all dependencies.
829 * src/state.h (state_t): Remove the `next' member.
830
8312002-06-30 Akim Demaille <akim@epita.fr>
832
833 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
834 escaped in slot 0.
835
8362002-06-30 Akim Demaille <akim@epita.fr>
837
838 Use hash.h for the state hash table.
839
840 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
841 (allocate_storage): Use state_hash_new.
842 (free_storage): Use state_hash_free.
843 (new_state, get_state): Adjust.
844 * src/lalr.h, src/lalr.c (states): Move to...
845 * src/states.h (state_t): Remove the `link' member, no longer
846 used.
847 * src/states.h, src/states.c: here.
848 (state_hash_new, state_hash_free, state_hash_lookup)
849 (state_hash_insert, states_free): New.
850 * src/states.c (state_table, state_compare, state_hash): New.
851 * src/output.c (output_actions): Do not free states now, since we
852 still need to know the final_state number in `prepare', called
853 afterwards. Do it...
854 * src/main.c (main): here: call states_free after `output'.
855
8562002-06-30 Akim Demaille <akim@epita.fr>
857
858 * src/state.h, src/state.c (state_new): New, extracted from...
859 * src/LR0.c (new_state): here.
860 * src/state.h (STATE_ALLOC): Move to...
861 * src/state.c: here.
862 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
863 * src/state.h, src/state.c: here.
864
8652002-06-30 Akim Demaille <akim@epita.fr>
866
867 * src/reader.c (gensym): Rename as...
868 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
869 (getsym): Rename as...
870 (symbol_get): this.
871
8722002-06-30 Akim Demaille <akim@epita.fr>
873
874 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
875 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
876 * src/output.c, src/print.c, src/print_graph.c: Propagate.
877 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
878
8792002-06-30 Akim Demaille <akim@epita.fr>
880
881 Make the test suite pass with warnings checked.
882
883 * tests/actions.at (Printers and Destructors): Improve.
884 Avoid unsigned vs. signed issues.
885 * tests/calc.at: Don't exercise the scanner here, do it...
886 * tests/input.at (Torturing the Scanner): here.
887
8882002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
889
890 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
891 reorganize first lines parallel to yacc.c.
892
8932002-06-28 Akim Demaille <akim@epita.fr>
894
895 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
896 (b4_token_enum, b4_token_defines): New, factored from...
897 * data/lalr1.cc, data/yacc.c, glr.c: here.
898
8992002-06-28 Akim Demaille <akim@epita.fr>
900
901 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
902 unused variables.
903 * src/output.c (merger_output): static.
904
9052002-06-28 Akim Demaille <akim@epita.fr>
906
907 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
908 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
909 pacify GCC.
910 * src/output.c (save_row): Initialize all the variables to pacify GCC.
911
9122002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
913
914 Accumulated changelog for new GLR parsing features.
915
916 * src/conflicts.c (count_total_conflicts): Change name to
917 conflicts_total_count.
918 * src/conflicts.h: Ditto.
919 * src/output.c (token_actions): Use the new name.
920 (output_conflicts): Change conflp => conflict_list_heads, and
921 confl => conflict_list for better readability.
922 * data/glr.c: Use the new names.
923 * NEWS: Add self to GLR announcement.
924
925 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
926
927 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
928 Akim Demaille.
929
930 * data/bison.glr: Change name to glr.c
931 * data/glr.c: Renamed from bison.glr.
932 * data/Makefile.am: Add glr.c
933
934 * src/getargs.c:
935
936 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
937 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
938
939 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
940
941 * data/bison.glr: Be sure to restore the
942 current #line when returning to the skeleton contents after having
943 exposed the input file's #line.
944
945 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
946
947 * data/bison.glr: Bring up to date with changes to bison.simple.
948
949 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
950
951 * data/bison.glr: Correct definitions that use b4_prefix.
952 Various reformatting.
953 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
954 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
955 yytokenp argument; now part of stack.
956 (yychar): Define to behave as documented.
957 (yyclearin): Ditto.
958
959 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
960
961 * src/reader.h: Add declaration for free_merger_functions.
962
963 * src/reader.c (merge_functions): New variable.
964 (get_merge_function): New function.
965 (free_merger_functions): New function.
966 (readgram): Check for %prec that is not followed by a symbol.
967 Handle %dprec and %merge declarations.
968 (packgram): Initialize dprec and merger fields in rules array.
969
970 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
971 conflict_list_cnt, conflict_list_free): New variables.
972 (table_grow): Also grow conflict_table.
973 (prepare_rules): Output dprec and merger tables.
974 (conflict_row): New function.
975 (action_row): Output conflict lists for GLR parser. Don't use
976 default reduction in conflicted states for GLR parser so that there
977 are spaces for the conflict lists.
978 (save_row): Also save conflict information.
979 (token_actions): Allocate conflict list.
980 (merger_output): New function.
981 (pack_vector): Pack conflict table, too.
982 (output_conflicts): New function to output yyconflp and yyconfl.
983 (output_check): Allocate conflict_tos.
984 (output_actions): Output conflict tables, also.
985 (output_skeleton): Output b4_mergers definition.
986 (prepare): Output b4_max_rhs_length definition.
987 Use 'bison.glr' as default skeleton for GLR parsers.
988
989 * src/gram.c (glr_parser): New flag.
990 (grammar_free): Call free_merger_functions.
991
992 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
993 all pairs of conflicting reductions, rather than just all tokens
994 causing conflicts. Needed to size conflict tables.
995 (conflicts_output): Modify call to count_rr_conflicts for new
996 interface.
997 (conflicts_print): Ditto.
998 (count_total_conflicts): New function.
999
1000 * src/reader.h (merger_list): New type.
1001 (merge_functions): New variable.
1002
1003 * src/lex.h (tok_dprec, tok_merge): New token types.
1004
1005 * src/gram.h (rule_s): Add dprec and merger fields.
1006 (glr_parser): New flag.
1007
1008 * src/conflicts.h (count_total_conflicts): New function.
1009
1010 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
1011
1012 * doc/bison.texinfo (Generalized LR Parsing): New section.
1013 (GLR Parsers): New section.
1014 (Language and Grammar): Mention GLR parsing.
1015 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
1016 Correct typo ("tge" -> "the").
1017
1018 * data/bison.glr: New skeleton for GLR parsing.
1019
1020 * tests/cxx-gram.at: New tests for GLR parsing.
1021
1022 * tests/testsuite.at: Include cxx-gram.at.
1023
1024 * tests/Makefile.am: Add cxx-gram.at.
1025
1026 * src/parse-gram.y:
1027
1028 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
1029
1030 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
1031
10322002-06-27 Akim Demaille <akim@epita.fr>
1033
1034 * src/options.h, src/options.c: Remove.
1035 * src/getargs.c (short_options, long_options): New.
1036
10372002-06-27 Akim Demaille <akim@epita.fr>
1038
1039 * data/bison.simple, data/bison.c++: Rename as...
1040 * data/yacc.c, data/lalr1.cc: these.
1041 * doc/bison.texinfo (Environment Variables): Remove.
1042
10432002-06-25 Raja R Harinath <harinath@cs.umn.edu>
1044
1045 * src/getargs.c (report_argmatch): Initialize strtok().
1046
10472002-06-20 Akim Demaille <akim@epita.fr>
1048
1049 * data/bison.simple (b4_symbol_actions): New, replaces...
1050 (b4_symbol_destructor, b4_symbol_printer): these.
1051 (yysymprint): Be sure to call YYPRINT only for tokens, and using
1052 user token numbers.
1053
10542002-06-20 Akim Demaille <akim@epita.fr>
1055
1056 * data/bison.simple (yydestructor): Rename as...
1057 (yydestruct): this.
1058
10592002-06-20 Akim Demaille <akim@epita.fr>
1060
1061 * src/symtab.h, src/symtab.c (symbol_type_set)
1062 (symbol_destructor_set, symbol_precedence_set): The location is
1063 the last argument.
1064 Adjust all callers.
1065
10662002-06-20 Akim Demaille <akim@epita.fr>
1067
1068 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
1069 internals.
1070 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
1071 Takes a location.
1072 * src/symtab.h, src/symtab.c (symbol_class_set)
1073 (symbol_user_token_number_set): Likewise.
1074 Adjust all callers.
1075 Promote complain_at.
1076 * tests/input.at (Type Clashes): Adjust.
1077
10782002-06-20 Akim Demaille <akim@epita.fr>
1079
1080 * data/bison.simple (YYLEX): Fix the declaration when
1081 %pure-parser.
1082
10832002-06-20 Akim Demaille <akim@epita.fr>
1084
1085 * data/bison.simple (yysymprint): Don't print the token number,
1086 just its name.
1087 * tests/actions.at (Destructors): Rename as...
1088 (Printers and Destructors): this.
1089 Also exercise %printer.
1090
10912002-06-20 Akim Demaille <akim@epita.fr>
1092
1093 * data/bison.simple (YYDSYMPRINT): New.
1094 Use it to remove many of the #if YYDEBUG/if (yydebug).
1095
10962002-06-20 Akim Demaille <akim@epita.fr>
1097
1098 * src/symtab.h, src/symtab.c (symbol_t): printer and
1099 printer_location are new members.
1100 (symbol_printer_set): New.
1101 * src/parse-gram.y (PERCENT_PRINTER): New token.
1102 Handle its associated rule.
1103 * src/scan-gram.l: Adjust.
1104 (handle_destructor_at, handle_destructor_dollar): Rename as...
1105 (handle_symbol_code_at, handle_symbol_code_dollar): these.
1106 * src/output.c (symbol_printers_output): New.
1107 (output_skeleton): Call it.
1108 * data/bison.simple (yysymprint): New. Cannot be named yyprint
1109 since there are already many grammar files with a user `yyprint'.
1110 Replace the calls to YYPRINT to calls to yysymprint.
1111 * tests/calc.at: Adjust.
1112 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
1113 taking advantage of parser very internal details (stack size!).
1114
11152002-06-20 Akim Demaille <akim@epita.fr>
1116
1117 * src/scan-gram.l: Complete the scanner with the missing patterns
1118 to pacify Flex.
1119 Use `quote' and `symbol_tag_get' where appropriate.
1120
11212002-06-19 Akim Demaille <akim@epita.fr>
1122
1123 * tests/actions.at (Destructors): Augment to test locations.
1124 * data/bison.simple (yydestructor): Pass it the current location
1125 if locations are enabled.
1126 Prototype only when __STDC__ or C++.
1127 Change the argument names to move into the yy name space: there is
1128 user code here.
1129
11302002-06-19 Akim Demaille <akim@epita.fr>
1131
1132 * data/bison.simple (b4_pure_if): New.
1133 Use it instead of #ifdef YYPURE.
1134
11352002-06-19 Akim Demaille <akim@epita.fr>
1136
1137 * data/bison.simple (b4_location_if): New.
1138 Use it instead of #ifdef YYLSP_NEEDED.
1139
11402002-06-19 Akim Demaille <akim@epita.fr>
1141
1142 Prepare @$ in %destructor, but currently don't bind it in the
1143 skeleton, as %location use is not cleaned up yet.
1144
1145 * src/scan-gram.l (handle_dollar, handle_destructor_at)
1146 (handle_action_at): New.
1147 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
1148 a braced_code_t and a location as additional arguments.
1149 (handle_destructor_dollar): Instead of requiring `b4_eval', just
1150 unquote one when outputting `b4_dollar_dollar'.
1151 Adjust callers.
1152 * data/bison.simple (b4_eval): Remove.
1153 (b4_symbol_destructor): Adjust.
1154 * tests/input.at (Invalid @n): Adjust.
1155
11562002-06-19 Zack Weinberg <zack@codesourcery.com>
1157
1158 * doc/bison.texinfo: Document ability to have multiple
1159 prologue sections.
1160
11612002-06-18 Akim Demaille <akim@epita.fr>
1162
1163 * src/files.c (compute_base_names): When computing the output file
1164 names from the input file name, strip the directory part.
1165
11662002-06-18 Akim Demaille <akim@epita.fr>
1167
1168 * data/bison.simple.new: Comment changes.
1169 Reported by Andreas Schwab.
1170
11712002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
1172
1173 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
1174 there are no `label `yyoverflowlab' defined but not used' warnings
1175 when yyoverflow is defined.
1176
11772002-06-18 Akim Demaille <akim@epita.fr>
1178
1179 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
1180 new member.
1181 (symbol_destructor_set): Adjust.
1182 * src/output.c (symbol_destructors_output): Output the destructor
1183 locations.
1184 Output the symbol name.
1185 * data/bison.simple (b4_symbol_destructor): Adjust.
1186
11872002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
1188 and Akim Demaille <akim@epita.fr>
1189
1190 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
1191 what's left on the stack when the error recovery hits EOF.
1192 * tests/actions.at (Destructors): Complete to exercise this case.
1193
11942002-06-17 Akim Demaille <akim@epita.fr>
1195
1196 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
1197 arguments is really empty, not only equal to `[]'.
1198 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
1199 member.
1200 (symbol_destructor_set): New.
1201 * src/output.c (symbol_destructors_output): New.
1202 * src/reader.h (brace_code_t, current_braced_code): New.
1203 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
1204 (handle_dollar): Rename as...
1205 (handle_action_dollar): this.
1206 (handle_destructor_dollar): New.
1207 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
1208 (grammar_declaration): Use it.
1209 * data/bison.simple (yystos): Is always defined.
1210 (yydestructor): New.
1211 * tests/actions.at (Destructors): New.
1212 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
1213
12142002-06-17 Akim Demaille <akim@epita.fr>
1215
1216 * src/symlist.h, src/symlist.c (symbol_list_length): New.
1217 * src/scan-gram.l (handle_dollar, handle_at): Compute the
1218 rule_length only when needed.
1219 * src/output.c (actions_output, token_definitions_output): Output
1220 the full M4 block.
1221 * src/symtab.c: Don't access directly to the symbol tag, use
1222 symbol_tag_get.
1223 * src/parse-gram.y: Use symbol_list_free.
1224
12252002-06-17 Akim Demaille <akim@epita.fr>
1226
1227 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
1228 (symbol_list_prepend, get_type_name): Move to...
1229 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
1230 (symbol_list_prepend, symbol_list_n_type_name_get): here.
1231 Adjust all callers.
1232 (symbol_list_free): New.
1233 * src/scan-gram.l (handle_dollar): Takes a location.
1234 * tests/input.at (Invalid $n): Adjust.
1235
12362002-06-17 Akim Demaille <akim@epita.fr>
1237
1238 * src/reader.h, src/reader.c (symbol_list_new): Export it.
1239 (symbol_list_prepend): New.
1240 * src/parse-gram.y (%union): `list' is a new member.
1241 (symbols.1): New, replaces...
1242 (terms_to_prec.1, nterms_to_type.1): these.
1243 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
1244 Take a location as additional argument.
1245 Adjust all callers.
1246
12472002-06-15 Akim Demaille <akim@epita.fr>
1248
1249 * src/parse-gram.y: Move %token in the declaration section so that
1250 we don't depend upon CVS Bison.
1251
12522002-06-15 Akim Demaille <akim@epita.fr>
1253
1254 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
1255 * src/print.c (print_core): Use it.
1256
12572002-06-15 Akim Demaille <akim@epita.fr>
1258
1259 * src/conflicts.c (log_resolution): Accept the rule involved in
1260 the sr conflicts instead of the lookahead number that points to
1261 that rule.
1262 (flush_reduce): Accept the current lookahead vector as argument,
1263 instead of the index in LA.
1264 (resolve_sr_conflict): Accept the current number of lookahead
1265 bitset to consider for the STATE, instead of the index in LA.
1266 (set_conflicts): Adjust.
1267 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
1268
12692002-06-15 Akim Demaille <akim@epita.fr>
1270
1271 * src/state.h (state_t): Replace the `lookaheadsp' member, a
1272 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
1273 Adjust all dependencies.
1274 * src/lalr.c (initialize_lookaheads): Split into...
1275 (states_lookaheads_count, states_lookaheads_initialize): these.
1276 (lalr): Adjust.
1277
12782002-06-15 Akim Demaille <akim@epita.fr>
1279
1280 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
1281 out of...
1282 (grammar_rules_print): here.
1283 * src/reduce.c (reduce_output): Use it.
1284 * tests/reduce.at (Useless Rules, Reduced Automaton)
1285 (Underivable Rules): Adjust.
1286
12872002-06-15 Akim Demaille <akim@epita.fr>
1288
1289 Copy BYacc's nice way to report the grammar.
1290
1291 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
1292 New.
1293 Don't print the rules' location, it is confusing and useless.
1294 (rule_print): Use grammar_rhs_print.
1295 * src/print.c (print_grammar): Use grammar_rules_print.
1296
12972002-06-15 Akim Demaille <akim@epita.fr>
1298
1299 Complete and rationalize `useless thing' warnings.
1300
1301 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
1302 (symbol_tag_print): New.
1303 Use them everywhere in place of accessing directly the tag member.
1304 * src/gram.h, src/gram.c (rule_print): New.
1305 Use it where a rule used to be printed `by hand'.
1306 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
1307 (reduce_grammar_tables): Report the useless rules.
1308 (reduce_print): Useless things are a warning, not an error.
1309 Report it as such.
1310 * tests/reduce.at (Useless Nonterminals, Useless Rules):
1311 (Reduced Automaton, Underivable Rules): Adjust.
1312 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
1313 * tests/conflicts.at (Unresolved SR Conflicts)
1314 (Solved SR Conflicts): Adjust.
1315
13162002-06-15 Akim Demaille <akim@epita.fr>
1317
1318 Let symbols have a location.
1319
1320 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
1321 (getsym): Adjust.
1322 Adjust all callers.
1323 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
1324 Use location_t, not int.
1325 * src/symtab.c (symbol_check_defined): Take advantage of the
1326 location.
1327 * tests/regression.at (Invalid inputs): Adjust.
1328
13292002-06-15 Akim Demaille <akim@epita.fr>
1330
1331 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
1332 (input): Don't try to initialize yylloc here, do it in the
1333 scanner.
1334 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
1335 * src/gram.h (rule_t): Change line and action_line into location
1336 and action_location, of location_t type.
1337 Adjust all dependencies.
1338 * src/location.h, src/location.c (empty_location): New.
1339 * src/reader.h, src/reader.c (grammar_start_symbol_set)
1340 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
1341 (grammar_current_rule_symbol_append)
1342 (grammar_current_rule_action_append): Expect a location as argument.
1343 * src/reader.c (grammar_midrule_action): Adjust to attach an
1344 action's location as dummy symbol location.
1345 * src/symtab.h, src/symtab.c (startsymbol_location): New.
1346 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
1347 the line numbers.
1348
13492002-06-14 Akim Demaille <akim@epita.fr>
1350
1351 Grammar declarations may be found in the grammar section.
1352
1353 * src/parse-gram.y (rules_or_grammar_declaration): New.
1354 (declarations): Each declaration may end with a semicolon, not
1355 just...
1356 (grammar_declaration): `"%union"'.
1357 (grammar): Branch to rules_or_grammar_declaration.
1358
13592002-06-14 Akim Demaille <akim@epita.fr>
1360
1361 * src/main.c (main): Invoke scanner_free.
1362
13632002-06-14 Akim Demaille <akim@epita.fr>
1364
1365 * src/output.c (m4_invoke): Extracted from...
1366 (output_skeleton): here.
1367 Free tempfile.
1368
13692002-06-14 Akim Demaille <akim@epita.fr>
1370
1371 * src/parse-gram.y (directives, directive, gram)
1372 (grammar_directives, precedence_directives, precedence_directive):
1373 Rename as...
1374 (declarations, declaration, grammar, grammar_declaration)
1375 (precedence_declaration, precedence_declarator): these.
1376 (symbol_declaration): New.
1377
13782002-06-14 Akim Demaille <akim@epita.fr>
1379
1380 * src/files.c (action_obstack): Remove, unused.
1381 (output_obstack): Remove it, and all its dependencies, as it is no
1382 longer needed.
1383 * src/reader.c (epilogue_set): Build the epilogue in the
1384 muscle_obstack.
1385 * src/output.h, src/output.c (muscle_obstack): Move to...
1386 * src/muscle_tab.h, src/muscle_tab.h: here.
1387 (muscle_init): Initialize muscle_obstack.
1388 (muscle_free): New.
1389 * src/main.c (main): Call it.
1390
13912002-06-14 Akim Demaille <akim@epita.fr>
1392
1393 * src/location.h: New, extracted from...
1394 * src/reader.h: here.
1395 * src/Makefile.am (noinst_HEADERS): Merge into
1396 (bison_SOURCES): this.
1397 Add location.h.
1398 * src/parse-gram.y: Use location_t instead of Bison's.
1399 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
1400 Use location_t instead of ints.
1401
14022002-06-14 Akim Demaille <akim@epita.fr>
1403
1404 * data/bison.simple, data/bison.c++: Be sure to restore the
1405 current #line when returning to the skeleton contents after having
1406 exposed the input file's #line.
1407
14082002-06-12 Akim Demaille <akim@epita.fr>
1409
1410 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
1411 eager.
1412 * tests/actions.at (Exotic Dollars): New.
1413
14142002-06-12 Akim Demaille <akim@epita.fr>
1415
1416 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
1417 ['"/] too eagerly.
1418 * tests/input.at (Torturing the Scanner): New.
1419
14202002-06-11 Akim Demaille <akim@epita.fr>
1421
1422 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
1423 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
1424 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
1425 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
1426 * src/reader.c (reader): Use it.
1427
14282002-06-11 Akim Demaille <akim@epita.fr>
1429
1430 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
1431 Adjust all callers.
1432 (scanner_last_string_free): New.
1433
14342002-06-11 Akim Demaille <akim@epita.fr>
1435
1436 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
1437 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
1438 (last_string, YY_OBS_FREE): New.
1439 Use them when returning an ID.
1440
14412002-06-11 Akim Demaille <akim@epita.fr>
1442
1443 Have Bison grammars parsed by a Bison grammar.
1444
1445 * src/reader.c, src/reader.h (prologue_augment): New.
1446 * src/reader.c (copy_definition): Remove.
1447
1448 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
1449 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
1450 (grammar_current_rule_prec_set, grammar_current_rule_check)
1451 (grammar_current_rule_symbol_append)
1452 (grammar_current_rule_action_append): Export.
1453 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
1454 (symbol_list_action_append): Remove.
1455 Hook the routines from reader.
1456 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
1457 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
1458
1459 * src/reader.c (read_declarations): Remove, unused.
1460
1461 * src/parse-gram.y: Handle the epilogue.
1462 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
1463 (grammar_start_symbol_set): this.
1464 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
1465 * src/reader.c (readgram): Remove, unused.
1466 (reader): Adjust to insert eoftoken and axiom where appropriate.
1467
1468 * src/reader.c (copy_dollar): Replace with...
1469 * src/scan-gram.h (handle_dollar): this.
1470 * src/parse-gram.y: Remove `%thong'.
1471
1472 * src/reader.c (copy_at): Replace with...
1473 * src/scan-gram.h (handle_at): this.
1474
1475 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
1476 New.
1477
1478 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
1479 time being.
1480
1481 * src/reader.h, src/reader.c (grammar_rule_end): New.
1482
1483 * src/parse.y (current_type, current_class): New.
1484 Implement `%nterm', `%token' support.
1485 Merge `%term' into `%token'.
1486 (string_as_id): New.
1487 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
1488 type name.
1489
1490 * src/parse-gram.y: Be sure to handle properly the beginning of
1491 rules.
1492
1493 * src/parse-gram.y: Handle %type.
1494 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
1495
1496 * src/parse-gram.y: More directives support.
1497 * src/options.c: No longer handle source directives.
1498
1499 * src/parse-gram.y: Fix %output.
1500
1501 * src/parse-gram.y: Handle %union.
1502 Use the prologue locations.
1503 * src/reader.c (parse_union_decl): Remove.
1504
1505 * src/reader.h, src/reader.c (epilogue_set): New.
1506 * src/parse-gram.y: Use it.
1507
1508 * data/bison.simple, data/bison.c++: b4_stype is now either not
1509 defined, then default to int, or to the contents of %union,
1510 without `union' itself.
1511 Adjust.
1512 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
1513
1514 * src/output.c (actions_output): Don't output braces, as they are
1515 already handled by the scanner.
1516
1517 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
1518 characters to themselves.
1519
1520 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
1521 that the epilogue has a proper #line.
1522
1523 * src/parse-gram.y: Handle precedence/associativity.
1524
1525 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
1526 a terminal.
1527 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
1528 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
1529 at all to define terminals that cannot be emitted.
1530
1531 * src/scan-gram.l: Escape M4 characters.
1532
1533 * src/scan-gram.l: Working properly with escapes in user
1534 strings/characters.
1535
1536 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
1537 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
1538 grammar.
1539 Use more modest sizes, as for the time being the parser does not
1540 release memory, and therefore the process swallows a huge amount
1541 of memory.
1542
1543 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
1544 stricter %token grammar.
1545
1546 * src/symtab.h (associativity): Add `undef_assoc'.
1547 (symbol_precedence_set): Do nothing when passed an undef_assoc.
1548 * src/symtab.c (symbol_check_alias_consistence): Adjust.
1549
1550 * tests/regression.at (Invalid %directive): Remove, as it is now
1551 meaningless.
1552 (Invalid inputs): Adjust to the new error messages.
1553 (Token definitions): The new grammar doesn't allow too many
1554 eccentricities.
1555
1556 * src/lex.h, src/lex.c: Remove.
1557 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
1558 (copy_character, copy_string2, copy_string, copy_identifier)
1559 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
1560 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
1561 (parse_action): Remove.
1562 * po/POTFILES.in: Adjust.
1563
15642002-06-11 Akim Demaille <akim@epita.fr>
1565
1566 * src/reader.c (parse_action): Don't store directly into the
1567 rule's action member: return the action as a string.
1568 Don't require `rule_length' as an argument: compute it.
1569 (grammar_current_rule_symbol_append)
1570 (grammar_current_rule_action_append): New, eved out from
1571 (readgram): here.
1572 Remove `action_flag', `rulelength', unused now.
1573
15742002-06-11 Akim Demaille <akim@epita.fr>
1575
1576 * src/reader.c (grammar_current_rule_prec_set).
1577 (grammar_current_rule_check): New, eved out from...
1578 (readgram): here.
1579 Remove `xaction', `first_rhs': useless.
1580 * tests/input.at (Type clashes): New.
1581 * tests/existing.at (GNU Cim Grammar): Adjust.
1582
15832002-06-11 Akim Demaille <akim@epita.fr>
1584
1585 * src/reader.c (grammar_midrule_action): New, Eved out from
1586 (readgram): here.
1587
15882002-06-11 Akim Demaille <akim@epita.fr>
1589
1590 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1591 New.
1592 (readgram): Use them as replacement of inlined code, crule and
1593 crule1.
1594
15952002-06-11 Akim Demaille <akim@epita.fr>
1596
1597 * src/reader.c (grammar_end, grammar_symbol_append): New.
1598 (readgram): Use them.
1599 Make the use of `p' as local as possible.
1600
16012002-06-10 Akim Demaille <akim@epita.fr>
1602
1603 GCJ's parser requires the tokens to be defined before the prologue.
1604
1605 * data/bison.simple: Output the token definition before the user's
1606 prologue.
1607 * tests/regression.at (Braces parsing, Duplicate string)
1608 (Mixing %token styles): Check the output from bison.
1609 (Early token definitions): New.
1610
16112002-06-10 Akim Demaille <akim@epita.fr>
1612
1613 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1614 assigning twice the same user number to a token, so that we can
1615 use it in...
1616 * src/lex.c (lex): here.
1617 Also use `symbol_class_set' instead of hand written code.
1618 * src/reader.c (parse_assoc_decl): Likewise.
1619
16202002-06-10 Akim Demaille <akim@epita.fr>
1621
1622 * src/symtab.c, src/symtab.c (symbol_class_set)
1623 (symbol_user_token_number_set): New.
1624 * src/reader.c (parse_token_decl): Use them.
1625 Use a switch instead of ifs.
1626 Use a single argument.
1627
16282002-06-10 Akim Demaille <akim@epita.fr>
1629
1630 Remove `%thong' support as it is undocumented, unused, duplicates
1631 `%token's job, and creates useless e-mail traffic with people who
1632 want to know what it is, why it is undocumented, unused, and
1633 duplicates `%token's job.
1634
1635 * src/reader.c (parse_thong_decl): Remove.
1636 * src/options.c (option_table): Remove "thong".
1637 * src/lex.h (tok_thong): Remove.
1638
16392002-06-10 Akim Demaille <akim@epita.fr>
1640
1641 * src/symtab.c, src/symtab.c (symbol_type_set)
1642 (symbol_precedence_set): New.
1643 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1644 (value_components_used): Remove, unused.
1645
16462002-06-09 Akim Demaille <akim@epita.fr>
1647
1648 Move symbols handling code out of the reader.
1649
1650 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1651 (axiom): Move to...
1652 * src/symtab.h, src/symtab.c: here.
1653
1654 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1655 * src/reader.c (startval): Rename as...
1656 * src/symtab.h, src/symtab.c (startsymbol): this.
1657 * src/reader.c: Adjust.
1658
1659 * src/reader.c (symbol_check_defined, symbol_make_alias)
1660 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1661 (token_translations_init)
1662 Move to...
1663 * src/symtab.c: here.
1664 * src/reader.c (packsymbols): Move to...
1665 * src/symtab.h, src/symtab.c (symbols_pack): here.
1666 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1667 argument.
1668
16692002-06-03 Akim Demaille <akim@epita.fr>
1670
1671 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1672 then statements.
1673
16742002-06-03 Akim Demaille <akim@epita.fr>
1675
1676 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1677 structs with non literals.
1678 * src/scan-skel.l: never-interactive.
1679 * src/conflicts.c (enum conflict_resolution_e): No trailing
1680 comma.
1681 * src/getargs.c (usage): Split long literal strings.
1682 Reported by Hans Aberg.
1683
16842002-05-28 Akim Demaille <akim@epita.fr>
1685
1686 * data/bison.c++: Use C++ ostreams.
1687 (cdebug_): New member.
1688
16892002-05-28 Akim Demaille <akim@epita.fr>
1690
1691 * src/output.c (output_skeleton): Be sure to allocate enough room
1692 for `/' _and_ for `\0' in full_skeleton.
1693
16942002-05-28 Akim Demaille <akim@epita.fr>
1695
1696 * data/bison.c++: Catch up with bison.simple:
1697 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1698 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1699 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1700 and popping traces.
1701
17022002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1703
1704 * src/output.c (output_skeleton): Put an explicit path in front of
1705 the skeleton file name, rather than relying on the -I directory,
1706 to partially alleviate effects of having a skeleton file lying around
1707 in the current directory.
1708
17092002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1710
1711 * src/conflicts.c (log_resolution): Correct typo:
1712 obstack_printf should be obstack_fgrow1.
1713
17142002-05-26 Akim Demaille <akim@epita.fr>
1715
1716 * src/state.h (state_t): `solved_conflicts' is a new member.
1717 * src/LR0.c (new_state): Set it to 0.
1718 * src/conflicts.h, src/conflicts.c (print_conflicts)
1719 (free_conflicts, solve_conflicts): Rename as...
1720 (conflicts_print, conflicts_free, conflicts_solve): these.
1721 Adjust callers.
1722 * src/conflicts.c (enum conflict_resolution_e)
1723 (solved_conflicts_obstack): New, used by...
1724 (log_resolution): this.
1725 Adjust to attach the conflict resolution to each state.
1726 Complete the description with the precedence/associativity
1727 information.
1728 (resolve_sr_conflict): Adjust.
1729 * src/print.c (print_state): Output its solved_conflicts.
1730 * tests/conflicts.at (Unresolved SR Conflicts)
1731 (Solved SR Conflicts): Exercise --report=all.
1732
17332002-05-26 Akim Demaille <akim@epita.fr>
1734
1735 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1736 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1737 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1738 (token_number_t, item_number_as_token_number)
1739 (token_number_as_item_number, muscle_insert_token_number_table):
1740 Rename as...
1741 (symbol_number_t, item_number_as_symbol_number)
1742 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1743 these, since it is more appropriate.
1744
17452002-05-26 Akim Demaille <akim@epita.fr>
1746
1747 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1748 `Error:' lines.
1749 * data/bison.simple (yystos) [YYDEBUG]: New.
1750 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1751 error recovery.
1752 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1753
17542002-05-25 Akim Demaille <akim@epita.fr>
1755
1756 * doc/bison.texinfo (Debugging): Split into...
1757 (Tracing): this new section, its former contents, and...
1758 (Understanding): this new section.
1759 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1760 by...
1761 (report_flag): this.
1762 Adjust all dependencies.
1763 (report_args, report_types, report_argmatch): New.
1764 (usage, getargs): Report/support -r, --report.
1765 * src/options.h
1766 (struct option_table_struct): Rename as..,
1767 (struct option_table_s): this.
1768 Rename the `set_flag' member to `flag' to match with getopt_long's
1769 struct.
1770 * src/options.c (option_table): Split verbose into an entry for
1771 %verbose, and another for --verbose.
1772 Support --report/-r, so remove -r from the obsolete --raw.
1773 * src/print.c: Attach full item sets and lookaheads reports to
1774 report_flag instead of trace_flag.
1775 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1776
17772002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1778 and Paul Eggert <eggert@twinsun.com>
1779
1780 * data/bison.simple (yyparse): Correct error handling to conform to
1781 POSIX and yacc. Specifically, after syntax error is discovered,
1782 do not reduce further before shifting the error token.
1783 Clean up the code a bit by removing the labels yyerrdefault,
1784 yyerrhandle, yyerrpop.
1785 * NEWS: Document the above.
1786
17872002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1788
1789 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1790 type; it isn't always big enough, since it doesn't necessarily
1791 include non-terminals.
1792 (yytranslate): Expand definition of yy_token_number_type, so that
1793 the latter can be removed.
1794 (yy_token_number_type): Remove, only one use.
1795 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1796 don't use TokenNumberType as element type.
1797
1798 * tests/regression.at: Modify expected output to agree with change
1799 to yyr1 and yytranslate.
1800
18012002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1802
1803 * src/reader.c (parse_action): Use copy_character instead of
1804 obstack_1grow.
1805
18062002-05-13 Akim Demaille <akim@epita.fr>
1807
1808 * tests/regression.at (Token definitions): Prototype yylex and
1809 yyerror.
1810
18112002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1812
1813 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
1814 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1815 32-bit arithmetic.
1816 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1817
18182002-05-07 Akim Demaille <akim@epita.fr>
1819
1820 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1821 avoid GCC warnings.
1822
18232002-05-07 Akim Demaille <akim@epita.fr>
1824
1825 Kill GCC warnings.
1826
1827 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1828 over the RHS of each rule.
1829 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1830 * src/state.h (state_t): Member `nitems' is unsigned short.
1831 * src/LR0.c (get_state): Adjust.
1832 * src/reader.c (packgram): Likewise.
1833 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1834 `Type'.
1835 (muscle_insert_int_table): Remove, unused.
1836 (prepare_rules): Remove `max'.
1837
18382002-05-06 Akim Demaille <akim@epita.fr>
1839
1840 * src/closure.c (print_firsts): Display of the symbol tags.
1841 (bitmatrix_print): Move to...
1842 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1843 here.
1844 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1845
18462002-05-06 Akim Demaille <akim@epita.fr>
1847
1848 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1849 hash_do_for_each.
1850
18512002-05-06 Akim Demaille <akim@epita.fr>
1852
1853 * src/LR0.c (new_state, get_state): Instead of using the global
1854 `kernel_size' and `kernel_base', have two new arguments:
1855 `core_size' and `core'.
1856 Adjust callers.
1857
18582002-05-06 Akim Demaille <akim@epita.fr>
1859
1860 * src/reader.c (packgram): No longer end `ritem' with a 0
1861 sentinel: it is not used.
1862
18632002-05-05 Akim Demaille <akim@epita.fr>
1864
1865 New experimental feature: display the lookaheads in the report and
1866 graph.
1867
1868 * src/print (print_core): When --trace-flag, display the rules
1869 lookaheads.
1870 * src/print_graph.c (print_core): Likewise.
1871 Swap the arguments.
1872 Adjust caller.
1873
18742002-05-05 Akim Demaille <akim@epita.fr>
1875
1876 * tests/torture.at (Many lookaheads): New test.
1877
18782002-05-05 Akim Demaille <akim@epita.fr>
1879
1880 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1881 (GENERATE_MUSCLE_INSERT_TABLE): this.
1882 (output_int_table, output_unsigned_int_table, output_short_table)
1883 (output_token_number_table, output_item_number_table): Replace with...
1884 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1885 (muscle_insert_short_table, muscle_insert_token_number_table)
1886 (muscle_insert_item_number_table): these.
1887 Adjust all callers.
1888 (prepare_tokens): Don't free `translations', since...
1889 * src/reader.h, src/reader.c (grammar_free): do it.
1890 Move to...
1891 * src/gram.h, src/gram.c (grammar_free): here.
1892 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1893 b4_translate_max.
1894
18952002-05-05 Akim Demaille <akim@epita.fr>
1896
1897 * src/output.c (output_unsigned_int_table): New.
1898 (prepare_rules): `i' is unsigned.
1899 `prhs', `rline', `r2' are unsigned int.
1900 Rename muscle `rhs_number_max' as `rhs_max'.
1901 Output muscles `prhs_max', `rline_max', and `r2_max'.
1902 Free rline and r1.
1903 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1904 to compute types instead of constant types.
1905 * tests/regression.at (Web2c Actions): Adjust.
1906
19072002-05-04 Akim Demaille <akim@epita.fr>
1908
1909 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1910 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1911 Adjust dependencies.
1912 * src/output.c (token_definitions_output): Be sure not to output a
1913 `#define 'a'' when fed with `%token 'a' "a"'.
1914 * tests/regression.at (Token definitions): New.
1915
19162002-05-03 Paul Eggert <eggert@twinsun.com>
1917
1918 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1919 for K&R C.
1920
19212002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1922
1923 * Makefile.am (SUBDIRS): Remove intl.
1924 (EXTRA_DIST): Add config/config.rpath.
1925
19262002-05-03 Akim Demaille <akim@epita.fr>
1927
1928 * data/bison.simple (m4_if): Don't output empty enums.
1929 And actually, output valid enum definitions :(.
1930
19312002-05-03 Akim Demaille <akim@epita.fr>
1932
1933 * configure.bat: Remove, completely obsolete.
1934 * Makefile.am (EXTRA_DIST): Adjust.
1935 Don't distribute config.rpath...
1936 * config/Makefile.am (EXTRA_DIST): Do it.
1937
19382002-05-03 Akim Demaille <akim@epita.fr>
1939
1940 * configure.in (GETTEXT_VERSION): New.
1941 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1942
19432002-05-03 Akim Demaille <akim@epita.fr>
1944
1945 * data/bison.simple (b4_token_enum): New.
1946 (b4_token_defines): Use it to output tokens both as #define and
1947 enums.
1948 Suggested by Paul Eggert.
1949 * src/output.c (token_definitions_output): Don't output spurious
1950 white spaces.
1951
19522002-05-03 Akim Demaille <akim@epita.fr>
1953
1954 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1955
19562002-05-02 Robert Anisko <robert@lrde.epita.fr>
1957
1958 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1959 Update the stack class, give a try to deque as the default container.
1960
19612002-05-02 Akim Demaille <akim@epita.fr>
1962
1963 * data/bison.simple (yyparse): Do not implement @$ = @1.
1964 (YYLLOC_DEFAULT): Adjust to do it.
1965 * doc/bison.texinfo (Location Default Action): Fix.
1966
19672002-05-02 Akim Demaille <akim@epita.fr>
1968
1969 * src/reader.c (parse_braces): Merge into...
1970 (parse_action): this.
1971
19722002-05-02 Akim Demaille <akim@epita.fr>
1973
1974 * configure.in (ALL_LINGUAS): Remove.
1975 * po/LINGUAS, hr.po: New.
1976
19772002-05-02 Akim Demaille <akim@epita.fr>
1978
1979 Remove the so called hairy (semantic) parsers.
1980
1981 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1982 * src/gram.h, src/gram.c (semantic_parser): Remove.
1983 (rule_t): Remove the guard and guard_line members.
1984 * src/lex.h (token_t): remove tok_guard.
1985 * src/options.c (option_table): Remove %guard and %semantic_parser
1986 support.
1987 * src/output.c, src/output.h (guards_output): Remove.
1988 (prepare): Adjust.
1989 (token_definitions_output): Don't output the `T'
1990 tokens (???).
1991 (output_skeleton): Don't output the guards.
1992 * src/files.c, src/files.c (attrsfile): Remove.
1993 * src/reader.c (symbol_list): Remove the guard and guard_line
1994 members.
1995 Adjust dependencies.
1996 (parse_guard): Remove.
1997 * data/bison.hairy: Remove.
1998 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1999 BISON_HAIRY.
2000
20012002-05-02 Akim Demaille <akim@epita.fr>
2002
2003 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
2004 (parse_guard): Rename the formal argument `stack_offset' as
2005 `rule_length', which is more readable.
2006 Adjust callers.
2007 (copy_at, copy_dollar): Instead of outputting the hard coded
2008 values of $$, $n and so forth, output invocation to b4_lhs_value,
2009 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
2010 Note: this patch partially drops `semantic-parser' support: it
2011 always does `rule_length - n', where semantic parsers ought to
2012 always use `-n'.
2013 * data/bison.simple, data/bison.c++ (b4_lhs_value)
2014 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
2015
20162002-05-02 Akim Demaille <akim@epita.fr>
2017
2018 * configure.in (AC_INIT): Bump to 1.49b.
2019 (AM_INIT_AUTOMAKE): Short invocation.
2020
20212002-05-02 Akim Demaille <akim@epita.fr>
2022
2023 Version 1.49a.
2024
20252002-05-01 Akim Demaille <akim@epita.fr>
2026
2027 * src/skeleton.h: Remove.
2028
20292002-05-01 Akim Demaille <akim@epita.fr>
2030
2031 * src/skeleton.h: Fix the #endif.
2032 Reported by Magnus Fromreide.
2033
20342002-04-26 Paul Eggert <eggert@twinsun.com>
2035
2036 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
2037 Define if we define YYSTYPE and YYLTYPE, respectively.
2038 (YYCOPY): Fix [] quoting problem in the non-GCC case.
2039
20402002-04-25 Robert Anisko <robert@lrde.epita.fr>
2041
2042 * src/scan-skel.l: Postprocess quadrigraphs.
2043
2044 * src/reader.c (copy_character): New function, used to output
2045 single characters while replacing `[' and `]' with quadrigraphs, to
2046 avoid troubles with M4 quotes.
2047 (copy_comment): Output characters with copy_character.
2048 (read_additionnal_code): Likewise.
2049 (copy_string2): Likewise.
2050 (copy_definition): Likewise.
2051
2052 * tests/calc.at: Exercise M4 quoting.
2053
20542002-04-25 Akim Demaille <akim@epita.fr>
2055
2056 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
2057 between `!' and the command.
2058 Reported by Paul Eggert.
2059
20602002-04-24 Robert Anisko <robert@lrde.epita.fr>
2061
2062 * tests/calc.at: Exercise prologue splitting.
2063
2064 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
2065 `b4_post_prologue' instead of `b4_prologue'.
2066
2067 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
2068 muscles.
2069 (output): Free pre_prologue_obstack and post_prologue_obstack.
2070 * src/files.h, src/files.c (attrs_obstack): Remove.
2071 (pre_prologue_obstack, post_prologue_obstack): New.
2072 * src/reader.c (copy_definition): Add a parameter to specify the
2073 obstack to fill, instead of using attrs_obstack unconditionally.
2074 (read_declarations): Pass pre_prologue_obstack to copy_definition if
2075 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
2076
20772002-04-23 Paul Eggert <eggert@twinsun.com>
2078
2079 * data/bison.simple: Remove unnecessary commentary and white
2080 space differences from 1_29-branch.
2081 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
2082
2083 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
2084 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
2085 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
2086 constructors or destructors.
2087
2088 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
2089
20902002-04-23 Akim Demaille <akim@epita.fr>
2091
2092 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
2093 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
2094 location with columns.
2095 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
2096 All reported by Paul Eggert.
2097
20982002-04-22 Akim Demaille <akim@epita.fr>
2099
2100 * src/reduce.c (dump_grammar): Move to...
2101 * src/gram.h, src/gram.c (grammar_dump): here.
2102 Be sure to separate long item numbers.
2103 Don't read the members of a rule's prec if its nil.
2104
21052002-04-22 Akim Demaille <akim@epita.fr>
2106
2107 * src/output.c (table_size, table_grow): New.
2108 (MAXTABLE): Remove, replace uses with table_size.
2109 (pack_vector): Instead of dying when the table is too big, grow it.
2110
21112002-04-22 Akim Demaille <akim@epita.fr>
2112
2113 * data/bison.simple (yyr1): Its type is that of a token number.
2114 * data/bison.c++ (r1_): Likewise.
2115 * tests/regression.at (Web2c Actions): Adjust.
2116
21172002-04-22 Akim Demaille <akim@epita.fr>
2118
2119 * src/reader.c (token_translations_init): 256 is now the default
2120 value for the error token, i.e., it will be assigned another
2121 number if the user assigned 256 to one of her tokens.
2122 (reader): Don't force 256 to error.
2123 * doc/bison.texinfo (Symbols): Adjust.
2124 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
2125 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
2126 etc. instead of 10, 20, 30 (which was used to `jump' over error
2127 (256) and undefined (2)).
2128
21292002-04-22 Akim Demaille <akim@epita.fr>
2130
2131 Propagate more token_number_t.
2132
2133 * src/gram.h (token_number_as_item_number)
2134 (item_number_as_token_number): New.
2135 * src/output.c (GENERATE_OUTPUT_TABLE): New.
2136 Use it to create output_item_number_table and
2137 output_token_number_table.
2138 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2139 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
2140 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
2141 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
2142
21432002-04-22 Akim Demaille <akim@epita.fr>
2144
2145 * src/output.h, src/output.c (get_lines_number): Remove.
2146
21472002-04-19 Akim Demaille <akim@epita.fr>
2148
2149 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
2150 as Lex/Flex'.
2151 (Debugging): More details about enabling the debugging features.
2152 (Table of Symbols): Describe $$, $n, @$, and @n.
2153 Suggested by Tim Josling.
2154
21552002-04-19 Akim Demaille <akim@epita.fr>
2156
2157 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
2158
21592002-04-10 Akim Demaille <akim@epita.fr>
2160
2161 * src/system.h: Rely on HAVE_LIMITS_H.
2162 Suggested by Paul Eggert.
2163
21642002-04-09 Akim Demaille <akim@epita.fr>
2165
2166 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
2167 full stderr, and strip it according to the bison options, instead
2168 of composing the error message from different bits.
2169 This makes it easier to check for several error messages.
2170 Adjust all the invocations.
2171 Add an invocation exercising the error token.
2172 Add an invocation demonstrating a stupid error message.
2173 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
2174 Adjust the tests.
2175 Error message are for stderr, not stdout.
2176
21772002-04-09 Akim Demaille <akim@epita.fr>
2178
2179 * src/gram.h, src/gram.c (error_token_number): Remove, use
2180 errtoken->number.
2181 * src/reader.c (reader): Don't specify the user token number (2)
2182 for $undefined, as it uselessly prevents using it.
2183 * src/gram.h (token_number_t): Move to...
2184 * src/symtab.h: here.
2185 (state_t.number): Is a token_number_t.
2186 * src/print.c, src/reader.c: Use undeftoken->number instead of
2187 hard coded 2.
2188 (Even though this 2 is not the same as above: the number of the
2189 undeftoken remains being 2, it is its user token number which
2190 might not be 2).
2191 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
2192 `user_token_number_max'.
2193 Output `undef_token_number'.
2194 * data/bison.simple, data/bison.c++: Use them.
2195 Be sure to map invalid yylex return values to
2196 `undef_token_number'. This saves us from gratuitous SEGV.
2197
2198 * tests/conflicts.at (Solved SR Conflicts)
2199 (Unresolved SR Conflicts): Adjust.
2200 * tests/regression.at (Web2c Actions): Adjust.
2201
22022002-04-08 Akim Demaille <akim@epita.fr>
2203
2204 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
2205 Adding #line.
2206 Remove the duplicate `typedefs'.
2207 (RhsNumberType): Fix the declaration and various other typos.
2208 Use __ofile__.
2209 * data/bison.simple: Use __ofile__.
2210 * src/scan-skel.l: Handle __ofile__.
2211
22122002-04-08 Akim Demaille <akim@epita.fr>
2213
2214 * src/gram.h (item_number_t): New, the type of item numbers in
2215 RITEM. Note that it must be able to code symbol numbers as
2216 positive number, and the negation of rule numbers as negative
2217 numbers.
2218 Adjust all dependencies (pretty many).
2219 * src/reduce.c (rule): Remove this `short *' pointer: use
2220 item_number_t.
2221 * src/system.h (MINSHORT, MAXSHORT): Remove.
2222 Include `limits.h'.
2223 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
2224 (shortcpy): Remove.
2225 (MAXTABLE): Move to...
2226 * src/output.c (MAXTABLE): here.
2227 (prepare_rules): Use output_int_table to output rhs.
2228 * data/bison.simple, data/bison.c++: Adjust.
2229 * tests/torture.at (Big triangle): Move the limit from 254 to
2230 500.
2231 * tests/regression.at (Web2c Actions): Ajust.
2232
2233 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
2234 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
2235 passes, but produces negative #line number, once fixed, GCC is
2236 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
2237 C), it passes.
2238 * src/state.h (state_h): Code input lines on ints, not shorts.
2239
22402002-04-08 Akim Demaille <akim@epita.fr>
2241
2242 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
2243 and then the grammar.
2244
22452002-04-08 Akim Demaille <akim@epita.fr>
2246
2247 * src/system.h: No longer using strndup.
2248
22492002-04-07 Akim Demaille <akim@epita.fr>
2250
2251 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
2252 * src/output.c (output_table_data): Return the longest number.
2253 (prepare_tokens): Output `token_number_max').
2254 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
2255 New.
2256 Use them to define yy_token_number_type/TokenNumberType.
2257 Use this type for yytranslate.
2258 * tests/torture.at (Big triangle): Push the limit from 124 to
2259 253.
2260 * tests/regression.at (Web2c Actions): Adjust.
2261
22622002-04-07 Akim Demaille <akim@epita.fr>
2263
2264 * tests/torture.at (Big triangle): New.
2265 (GNU AWK Grammar, GNU Cim Grammar): Move to...
2266 * tests/existing.at: here.
2267
22682002-04-07 Akim Demaille <akim@epita.fr>
2269
2270 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
2271 nritems.
2272 Adjust dependencies.
2273
22742002-04-07 Akim Demaille <akim@epita.fr>
2275
2276 * src/reader.c: Normalize increments to prefix form.
2277
22782002-04-07 Akim Demaille <akim@epita.fr>
2279
2280 * src/reader.c, symtab.c: Remove debugging code.
2281
22822002-04-07 Akim Demaille <akim@epita.fr>
2283
2284 Rename all the `bucket's as `symbol_t'.
2285
2286 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
2287 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
2288 * src/symtab.c, src/symtab.h (bucket): Rename as...
2289 (symbol_t): this.
2290 (symbol_list_new, bucket_check_defined, bucket_make_alias)
2291 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
2292 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2293 (buckets_new, buckets_free, buckets_do): Rename as...
2294 (symbol_list_new, symbol_check_defined, symbol_make_alias)
2295 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2296 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
2297 (symbols_new, symbols_free, symbols_do): these.
2298
22992002-04-07 Akim Demaille <akim@epita.fr>
2300
2301 Use lib/hash for the symbol table.
2302
2303 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
2304 EOF.
2305 * src/lex.c (lex): Set the `number' member of new terminals.
2306 * src/reader.c (bucket_check_defined, bucket_make_alias)
2307 (bucket_check_alias_consistence, bucket_translation): New.
2308 (reader, grammar_free, readgram, token_translations_init)
2309 (packsymbols): Adjust.
2310 (reader): Number the predefined tokens.
2311 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
2312 for predefined tokens.
2313 * src/symtab.h (bucket): Remove all the hash table related
2314 members.
2315 * src/symtab.c (symtab): Replace by...
2316 (bucket_table): this.
2317 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2318 (buckets_new, buckets_do): New.
2319
23202002-04-07 Akim Demaille <akim@epita.fr>
2321
2322 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
2323 (start_symbol, max_user_token_number, semantic_parser)
2324 (error_token_number): Initialize.
2325 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
2326 Initialize.
2327 (reader): Don't.
2328 (errtoken, eoftoken, undeftoken, axiom): Extern.
2329
23302002-04-07 Akim Demaille <akim@epita.fr>
2331
2332 * src/gram.h (rule_s): prec and precsym are now pointers
2333 to the bucket giving the priority/associativity.
2334 Member `associativity' removed: useless.
2335 * src/reduce.c, src/conflicts.c: Adjust.
2336
23372002-04-07 Akim Demaille <akim@epita.fr>
2338
2339 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
2340 Properly escape the symbols' TAG when outputting them.
2341
23422002-04-07 Akim Demaille <akim@epita.fr>
2343
2344 * src/lalr.h (LA): Is a bitsetv, not bitset*.
2345
23462002-04-07 Akim Demaille <akim@epita.fr>
2347
2348 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
2349 (LArule): this, which is an array to rule_t*.
2350 * src/print.c, src/conflicts.c: Adjust.
2351
23522002-04-07 Akim Demaille <akim@epita.fr>
2353
2354 * src/gram.h (rule_t): Rename `number' as `user_number'.
2355 `number' is a new member.
2356 Adjust dependencies.
2357 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
2358
23592002-04-07 Akim Demaille <akim@epita.fr>
2360
2361 As a result of the previous patch, it is no longer needed
2362 to reorder ritem itself.
2363
2364 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
2365
23662002-04-07 Akim Demaille <akim@epita.fr>
2367
2368 Be sure never to walk through RITEMS, but use only data related to
2369 the rules themselves. RITEMS should be banished.
2370
2371 * src/output.c (output_token_translations): Rename as...
2372 (prepare_tokens): this.
2373 In addition to `translate', prepare the muscles `tname' and
2374 `toknum', which were handled by...
2375 (output_rule_data): this.
2376 Remove, and move the remainder of its outputs into...
2377 (prepare_rules): this new routines, which also merges content from
2378 (output_gram): this.
2379 (prepare_rules): Be sure never to walk through RITEMS.
2380 (output_stos): Rename as...
2381 (prepare_stos): this.
2382 (output): Always invoke prepare_states, after all, just don't use it
2383 in the output if you don't need it.
2384
23852002-04-07 Akim Demaille <akim@epita.fr>
2386
2387 * src/LR0.c (new_state): Display `nstates' as the name of the
2388 newly created state.
2389 Adjust to initialize first_state and last_state if needed.
2390 Be sure to distinguish the initial from the final state.
2391 (new_states): Create the itemset of the initial state, and use
2392 new_state.
2393 * src/closure.c (closure): Now that the initial state has its
2394 items properly set, there is no need for a special case when
2395 creating `ruleset'.
2396
2397 As a result, now the rule 0, reducing to $axiom, is visible in the
2398 outputs. Adjust the test suite.
2399
2400 * tests/conflicts.at (Solved SR Conflicts)
2401 (Unresolved SR Conflicts): Adjust.
2402 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
2403 * tests/conflicts.at (S/R in initial): New.
2404
24052002-04-07 Akim Demaille <akim@epita.fr>
2406
2407 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
2408 the RHS of the rules.
2409 * src/output.c (output_gram): Likewise.
2410
24112002-04-07 Akim Demaille <akim@epita.fr>
2412
2413 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
2414 bucket.
2415 Adjust all dependencies.
2416 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
2417 `number' of the buckets too.
2418 * src/gram.h: Include `symtab.h'.
2419 (associativity): Move to...
2420 * src/symtab.h: here.
2421 No longer include `gram.h'.
2422
24232002-04-07 Akim Demaille <akim@epita.fr>
2424
2425 * src/gram.h, src/gram.c (rules_rhs_length): New.
2426 (ritem_longest_rhs): Use it.
2427 * src/gram.h (rule_t): `number' is a new member.
2428 * src/reader.c (packgram): Set it.
2429 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
2430 the end of `rules', and count them out of `nrules'.
2431 (reduce_output, dump_grammar): Adjust.
2432 * src/print.c (print_grammar): It is no longer needed to check for
2433 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
2434 * tests/reduce.at (Reduced Automaton): New test.
2435
24362002-04-07 Akim Demaille <akim@epita.fr>
2437
2438 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
2439 lacking `+ 1' to nrules, Bison reported as useless a token if it
2440 was used solely to set the precedence of the last rule...
2441
24422002-04-07 Akim Demaille <akim@epita.fr>
2443
2444 * data/bison.c++, data/bison.simple: Don't output the current file
2445 name in #line, to avoid useless diffs between two identical
2446 outputs under different names.
2447
24482002-04-07 Akim Demaille <akim@epita.fr>
2449
2450 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
2451 Normalize loops to using `< nrules + 1', not `<= nrules'.
2452
24532002-04-07 Akim Demaille <akim@epita.fr>
2454
2455 * TODO: Update.
2456
24572002-04-07 Akim Demaille <akim@epita.fr>
2458
2459 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
2460 bucket.value as bucket.number.
2461
24622002-04-07 Akim Demaille <akim@epita.fr>
2463
2464 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
2465 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2466 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
2467 RHS, instead of being an index in RITEMS.
2468
24692002-04-04 Paul Eggert <eggert@twinsun.com>
2470
2471 * doc/bison.texinfo: Update copyright date.
2472 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
2473 (Symbols): Warn about running Bison in one character set,
2474 but compiling and/or running in an incompatible one.
2475 Warn about character code 256, too.
2476
24772002-04-03 Paul Eggert <eggert@twinsun.com>
2478
2479 * src/bison.data (YYSTACK_ALLOC): Depend on whether
2480 YYERROR_VERBOSE is nonzero, not whether it is defined.
2481
2482 Merge changes from bison-1_29-branch.
2483
24842002-03-20 Paul Eggert <eggert@twinsun.com>
2485
2486 Merge fixes from Debian bison_1.34-1.diff.
2487
2488 * configure.in (AC_PREREQ): 2.53.
2489
24902002-03-20 Akim Demaille <akim@epita.fr>
2491
2492 * src/conflicts.c (log_resolution): Argument `resolution' is const.
2493
24942002-03-19 Paul Eggert <eggert@twinsun.com>
2495
2496 * src/bison.simple (YYCOPY): New macro.
2497 (YYSTACK_RELOCATE): Use it.
2498 Remove Type arg; no longer needed. All callers changed.
2499 (yymemcpy): Remove; no longer needed.
2500
2501 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
2502 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2503
25042002-03-19 Akim Demaille <akim@epita.fr>
2505
2506 Test and fix the #line outputs.
2507
2508 * tests/atlocal.at (GCC): New.
2509 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
2510 (Prologue synch line, ,%union synch line, Postprologue synch line)
2511 (Action synch line, Epilogue synch line): New tests.
2512 * src/reader.c (parse_union_decl): Define the muscle stype_line.
2513 * data/bison.simple, data/bison.c++: Use it.
2514
25152002-03-19 Akim Demaille <akim@epita.fr>
2516
2517 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
2518 (Solved SR Conflicts, %expect not enough, %expect right)
2519 (%expect too much): Move to...
2520 * tests/conflicts.at: this new file.
2521
25222002-03-19 Akim Demaille <akim@epita.fr>
2523
2524 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2525 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
2526 that we can move to enums for instance.
2527 * src/output.c (token_definitions_output): Output a list of
2528 `token-name, token-number' instead of the #define.
2529 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
2530
25312002-03-14 Akim Demaille <akim@epita.fr>
2532
2533 Use Gettext 0.11.1.
2534
25352002-03-09 Robert Anisko <robert@lrde.epita.fr>
2536
2537 * data/bison.c++: Make the user able to add members to the generated
2538 parser by subclassing.
2539
25402002-03-05 Robert Anisko <robert@lrde.epita.fr>
2541
2542 * src/reader.c (read_additionnal_code): `c' should be an integer, not
2543 a character.
2544 Reported by Nicolas Tisserand and Nicolas Burrus.
2545
25462002-03-04 Robert Anisko <robert@lrde.epita.fr>
2547
2548 * src/reader.c: Warn about lacking semi-colons, do not complain.
2549
25502002-03-04 Robert Anisko <robert@lrde.epita.fr>
2551
2552 * data/bison.c++: Remove a debug line.
2553
25542002-03-04 Robert Anisko <robert@lrde.epita.fr>
2555
2556 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
2557 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
2558 provide a default implementation.
2559
25602002-03-04 Akim Demaille <akim@epita.fr>
2561
2562 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
2563 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
2564 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
2565 * tests/semantic.at (Parsing Guards): Similarly.
2566 * src/reader.at (readgram): Complain if the last rule is not ended
2567 with a semi-colon.
2568
25692002-03-04 Akim Demaille <akim@epita.fr>
2570
2571 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
2572 * src/closure.c: here.
2573 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
2574 RTC.
2575 * src/warshall.h, src/warshall.c: Remove.
2576 * tests/sets.at (Broken Closure): Adjust.
2577
25782002-03-04 Akim Demaille <akim@epita.fr>
2579
2580 * src/output.c (output_skeleton): tempdir is const.
2581 bytes_read is unused.
2582
25832002-03-04 Akim Demaille <akim@epita.fr>
2584
2585 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2586 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2587 Update.
2588 From Michael Hayes.
2589
25902002-03-04 Akim Demaille <akim@epita.fr>
2591
2592 * src/closure.c (closure): `r' is unused.
2593
25942002-03-04 Akim Demaille <akim@epita.fr>
2595
2596 * tests/sets.at (Broken Closure): Add the ending `;'.
2597 * src/reader.at (readgram): Complain if a rule is not ended with a
2598 semi-colon.
2599
26002002-03-04 Akim Demaille <akim@epita.fr>
2601
2602 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2603 (count_sr_conflicts): Use bitset_count.
2604 * src/reduce.c (inaccessable_symbols): Ditto.
2605 (bits_size): Remove.
2606 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2607
26082002-03-04 Akim Demaille <akim@epita.fr>
2609
2610 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2611 * src/reduce.c: Remove the `bitset_zero's following the
2612 `bitset_create's, as now it is performed by the latter.
2613
26142002-03-04 Akim Demaille <akim@epita.fr>
2615
2616 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2617 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2618 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2619 latest sources from Michael.
2620
26212002-03-04 Akim Demaille <akim@epita.fr>
2622
2623 * src/output.c (output): Don't free the grammar.
2624 * src/reader.c (grammar_free): New.
2625 * src/main.c (main): Call it and don't free symtab here.
2626
26272002-03-04 Akim Demaille <akim@epita.fr>
2628
2629 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2630 before returning.
2631 Reported by Benoit Perrot.
2632
26332002-03-04 Akim Demaille <akim@epita.fr>
2634
2635 Use bitset operations when possible, not loops over bits.
2636
2637 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2638 bitset_or.
2639 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2640 * src/reduce.c (useless_nonterminals): Formatting changes.
2641 * src/warshall.c (TC): Use bitset_or.
2642
26432002-03-04 Akim Demaille <akim@epita.fr>
2644
2645 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2646 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2647 Ditto.
2648
26492002-03-04 Akim Demaille <akim@epita.fr>
2650
2651 * src/lalr.c (F): Now a bitset*.
2652 Adjust all dependencies.
2653
26542002-03-04 Akim Demaille <akim@epita.fr>
2655
2656 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2657 Adjust all dependencies.
2658
26592002-03-04 Akim Demaille <akim@epita.fr>
2660
2661 * src/L0.c, src/LR0.h (nstates): Be size_t.
2662 Adjust comparisons (signed vs unsigned).
2663 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2664 bitset*.
2665 Adjust all dependencies.
2666
26672002-03-04 Akim Demaille <akim@epita.fr>
2668
2669 * src/closure.c (firsts): Now, also a bitset.
2670 Adjust all dependencies.
2671 (varsetsize): Remove, now unused.
2672 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2673
26742002-03-04 Akim Demaille <akim@epita.fr>
2675
2676 * src/print.c: Convert to use bitset.h, not hand coded iterations
2677 over ints.
2678
26792002-03-04 Akim Demaille <akim@epita.fr>
2680
2681 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2682
26832002-03-04 Akim Demaille <akim@epita.fr>
2684
2685 * src/closure.c (ruleset): Be a bitset.
2686 (rulesetsize): Remove.
2687
26882002-03-04 Akim Demaille <akim@epita.fr>
2689
2690 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2691 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2692 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2693 * src/closure.c (fderives): Be an array of bitsets.
2694
26952002-02-28 Robert Anisko <robert@lrde.epita.fr>
2696
2697 * data/bison.c++: Merge the two generated headers. Insert a copyright
2698 notice in each output file.
2699
27002002-02-28 Akim Demaille <akim@epita.fr>
2701
2702 * data/bison.c++: Copy the prologue of bison.simple to fetch
2703 useful M4 definitions, such as b4_header_guard.
2704
27052002-02-25 Akim Demaille <akim@epita.fr>
2706
2707 * src/getargs.c (version): Give the name of the authors, and use a
2708 translator friendly scheme for the bgr
2709 copyright notice.
2710
27112002-02-25 Akim Demaille <akim@epita.fr>
2712
2713 * src/output.c (header_output): Remove, now handled completely via
2714 M4.
2715
27162002-02-25 Akim Demaille <akim@epita.fr>
2717
2718 * m4/m4.m4: New, from CVS Autoconf.
2719 * configure.in: Invoke it.
2720 * src/output.c (output_skeleton): Use its result instead of the
2721 hard coded name.
2722
27232002-02-25 Akim Demaille <akim@epita.fr>
2724
2725 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2726 Fileutils 4.1.5.
2727 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2728 * src/output.c (output_skeleton): Use mkstemp to create a real
2729 temporary file.
2730 Move the filling of `skeleton' and its muscle to...
2731 (prepare): here.
2732 (output): Move the definition of the prologue muscle to...
2733 (prepare): here.
2734 * src/system.h (DEFAULT_TMPDIR): New.
2735
27362002-02-14 Paul Eggert <eggert@twinsun.com>
2737
2738 Remove the support for C++ namespace cleanliness; it was
2739 causing more problems than it was curing, since it didn't work
2740 properly on some nonstandard C++ compilers. This can wait
2741 for a proper C++ parser.
2742
2743 * NEWS: Document this.
2744 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2745 of C++, as it's treated like C now.
2746 * src/bison.simple (YYSTD): Remove.
2747 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2748 Treat C++ just like Standard C instead of trying to support
2749 namespace cleanliness.
2750
27512002-02-14 Akim Demaille <akim@epita.fr>
2752
2753 * tests/regression.at (else): Adjust to Andreas' change.
2754
27552002-02-14 Akim Demaille <akim@epita.fr>
2756
2757 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2758
27592002-02-13 Andreas Schwab <schwab@suse.de>
2760
2761 * src/output.c (output_rule_data): Don't output NULL, it might
2762 not be defined yet.
2763
27642002-02-11 Robert Anisko <robert@lrde.epita.fr>
2765
2766 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2767 (Copyright notice): Update.
2768
27692002-02-11 Akim Demaille <akim@epita.fr>
2770
2771 * tests/regression.at (%nonassoc and eof): Don't include
2772 nonportable headers.
2773
27742002-02-08 Robert Anisko <robert@lrde.epita.fr>
2775
2776 * data/bison.c++: Correct error recovery. Make the user able to
2777 initialize the starting location.
2778
27792002-02-07 Akim Demaille <akim@epita.fr>
2780
2781 * tests/input.at: New.
2782
27832002-02-07 Robert Anisko <robert@lrde.epita.fr>
2784
2785 * data/bison.c++: Replace some direct m4 expansions by constants. Be
2786 more consistent when naming methods and variables. Put preprocessor
2787 directives around tables only needed for debugging.
2788
27892002-02-07 Robert Anisko <robert@lrde.epita.fr>
2790
2791 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2792 C++ parsers.
2793 (yy::b4_name::parse): Use print_.
2794
27952002-02-07 Robert Anisko <robert@lrde.epita.fr>
2796
2797 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2798
27992002-02-07 Robert Anisko <robert@lrde.epita.fr>
2800
2801 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2802 C++ parsers.
2803 (yy::b4_name::parse): Build verbose error messages, and use error_.
2804
28052002-02-06 Robert Anisko <robert@lrde.epita.fr>
2806
2807 * data/bison.c++: Fix m4 quoting in comments.
2808
28092002-02-06 Robert Anisko <robert@lrde.epita.fr>
2810
2811 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2812 not expanded by m4.
2813
28142002-02-05 Akim Demaille <akim@epita.fr>
2815
2816 * data/bison.c++: Adjust to the M4 back end.
2817 More is certainly needed.
2818
28192002-02-05 Akim Demaille <akim@epita.fr>
2820
2821 Give a try to M4 as a back end.
2822
2823 * lib/readpipe.c: New, from wdiff.
2824 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2825 BISON_HAIRY.
2826 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2827 specific values. Now it is m4 that performs the lookup.
2828 * src/parse-skel.y: Remove.
2829 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2830 * src/output.c (actions_output, guards_output)
2831 (token_definitions_output): No longer keeps track of the output
2832 line number, hence remove the second argument.
2833 (guards_output): Check against the guard member of a rule, not the
2834 action member.
2835 Adjust callers.
2836 (output_skeleton): Don't look for the skeleton location, let m4 do
2837 that.
2838 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2839 file will be used.
2840 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2841 (prepare): Given that for the time being changesyntax is not
2842 usable in M4, rename the muscles using `-' to `_'.
2843 Define `defines_flag', `output_parser_name' and `output_header_name'.
2844 * src/output.h (actions_output, guards_output)
2845 (token_definitions_output): Adjust prototypes.
2846 * src/scan-skel.l: Instead of scanning the skeletons, it now
2847 processes the output of m4: `__oline__' and `#output'.
2848 * data/bison.simple: Adjust to be used by M4(sugar).
2849 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2850 to date.
2851 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2852 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2853 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2854 shamelessly stolen from CVS Autoconf.
2855
28562002-02-05 Akim Demaille <akim@epita.fr>
2857
2858 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2859 * configure.in: Check for the declarations of free and malloc.
2860 * src/muscle_tab.c: Adjust.
2861
28622002-02-05 Akim Demaille <akim@epita.fr>
2863
2864 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2865 which have no values.
2866
28672002-02-05 Akim Demaille <akim@epita.fr>
2868
2869 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2870 * data/: here.
2871
28722002-01-29 Paul Eggert <eggert@twinsun.com>
2873
2874 * src/bison.simple (YYSIZE_T): Do not define merely because
2875 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2876 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2877
28782002-01-27 Akim Demaille <akim@epita.fr>
2879
2880 Fix `%nonassoc and eof'.
2881
2882 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2883 which were not properly copied! Replace
2884 memcpy (res->errs, src->errs, src->nerrs);
2885 with
2886 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2887 !!!
2888 * tests/regression.at (%nonassoc and eof): Adjust to newest
2889 Autotest: `.' is not in the PATH.
2890
28912002-01-27 Akim Demaille <akim@epita.fr>
2892
2893 * tests/sets.at (AT_EXTRACT_SETS): New.
2894 (Nullable): Use it.
2895 (Firsts): New.
2896
28972002-01-26 Akim Demaille <akim@epita.fr>
2898
2899 * tests/actions.at, tests/calc.at, tests/headers.at,
2900 * tests/torture.at: Adjust to the newest Autotest which no longer
2901 forces `.' in the PATH.
2902
29032002-01-25 Akim Demaille <akim@epita.fr>
2904
2905 * tests/regression.at (%nonassoc and eof): New.
2906 Suggested by Robert Anisko.
2907
29082002-01-24 Akim Demaille <akim@epita.fr>
2909
2910 Bison dumps core when trying to complain about broken input files.
2911 Reported by Cris van Pelt.
2912
2913 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2914 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2915 into...
2916 (Invalid inputs): Strengthen: exercise parse_percent_token.
2917
29182002-01-24 Robert Anisko <robert.anisko@epita.fr>
2919
2920 * src/Makefile.am: Add bison.c++.
2921 * src/bison.c++: New skeleton.
2922
29232002-01-21 Paolo Bonzini <bonzini@gnu.org>
2924
2925 * po/it.po: New.
2926
29272002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2928
2929 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2930
29312002-01-20 Marc Autret <marc@gnu.org>
2932
2933 * src/files.c (compute_output_file_names): Fix
2934
29352002-01-20 Marc Autret <marc@gnu.org>
2936
2937 * tests/output.at: New test.
2938 * src/files.c (compute_base_names): Don't map extensions when
2939 the YACC flag is set, use defaults.
2940 Reported by Evgeny Stambulchik.
2941
29422002-01-20 Marc Autret <marc@gnu.org>
2943
2944 * src/system.h: Need to define __attribute__ away for non-GCC
2945 compilers as well (i.e. the vendor C compiler).
2946 Suggested by Albert Chin-A-Young.
2947
29482002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2949
2950 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2951 canonical definition.
2952 * src/system.h: Use the canonical definition for PARAMS (avoids
2953 a conflict with the macro from lib/hash.h).
2954
29552002-01-11 Akim Demaille <akim@epita.fr>
2956
2957 * configure.in: Use AC_FUNC_STRNLEN.
2958 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
2959
29602002-01-09 Akim Demaille <akim@epita.fr>
2961
2962 * src/files.c, src/files.h (output_infix): New.
2963 (tab_extension): Remove.
2964 (compute_base_names): Compute the former, drop the latter.
2965 * src/output.c (prepare): Insert the muscles `output-infix', and
2966 `output-suffix'.
2967 * src/parse-skel.y (string, string.1): New.
2968 (section.header): Use it.
2969 (section.yacc): Remove.
2970 (prefix): Remove too.
2971 * src/scan-skel.l: Adjust.
2972 * src/bison.simple, src/bison.hairy: Adjust.
2973
29742002-01-09 Akim Demaille <akim@epita.fr>
2975
2976 * configure.in (WERROR_CFLAGS): Compute it.
2977 * src/Makefile.am (CFLAGS): Pass it.
2978 * tests/atlocal.in (CFLAGS): Idem.
2979 * src/files.c: Fix a few warnings.
2980 (get_extension_index): Remove, unused.
2981
29822002-01-08 Akim Demaille <akim@epita.fr>
2983
2984 * src/getargs.c (AS_FILE_NAME): New.
2985 (getargs): Use it to convert DOSish file names.
2986 * src/files.c (base_name): Rename as full_base_name to avoid
2987 clashes with `base_name ()'.
2988 (filename_split): New.
2989 (compute_base_names): N-th rewrite, using filename_split.
2990
29912002-01-08 Akim Demaille <akim@epita.fr>
2992
2993 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2994 New, stolen from the Fileutils 4.1.
2995 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2996 * configure.in: Check for the presence of memrchr, and of its
2997 prototype.
2998
29992002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
3000
3001 * lib/hash.h (__P): Added definition for this macro.
3002 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
3003 BUILT_SOURCES, to ensure they are generated first.
3004 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
3005 %error-verbose to allow bootstrapping with bison 1.30x.
3006
30072002-01-06 Akim Demaille <akim@epita.fr>
3008
3009 * src/reader.c (parse_braces): Don't fetch the next char, the
3010 convention is to fetch on entry.
3011 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
3012 'switch' without a following semicolon.
3013 * tests/regression.at (braces parsing): New.
3014
30152002-01-06 Akim Demaille <akim@epita.fr>
3016
3017 Bison is dead wrong in its RR conflict reports.
3018
3019 * tests/torture.at (GNU Cim Grammar): New.
3020 * src/conflicts.c (count_rr_conflicts): Fix.
3021
30222002-01-06 Akim Demaille <akim@epita.fr>
3023
3024 Creating package.m4 from configure.ac causes too many problems.
3025
3026 * tests/Makefile.am (package.m4): Create it by hand,
3027 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
3028
30292002-01-06 Akim Demaille <akim@epita.fr>
3030
3031 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
3032 skeleton.h.
3033
30342002-01-04 Paul Eggert <eggert@twinsun.com>
3035
3036 * doc/bison.texinfo (Debugging):
3037 Remove YYSTDERR; it's no longer defined or used.
3038 Also, s/cstdio.h/cstdio/.
3039
30402002-01-03 Akim Demaille <akim@epita.fr>
3041
3042 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
3043
30442002-01-03 Akim Demaille <akim@epita.fr>
3045
3046 * src/parse-skel.y (process_skeleton): Don't bind the parser's
3047 tracing code to --trace, wait for a better --trace option, with
3048 args.
3049
30502002-01-03 Akim Demaille <akim@epita.fr>
3051
3052 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
3053 The ISO C++ standard is extremely clear about it: stderr is
3054 considered a macro, not a regular symbol (see table 94 `Header
3055 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
3056 Therefore std:: does not apply to it. It still does with fprintf.
3057 Also, s/cstdio.h/cstdio/.
3058
30592002-01-03 Akim Demaille <akim@epita.fr>
3060
3061 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
3062 for non system headers.
3063
30642002-01-02 Akim Demaille <akim@epita.fr>
3065
3066 Equip the skeleton chain with location tracking, runtime trace,
3067 pure parser and scanner.
3068
3069 * src/parse-skel.y: Request a pure parser, locations, and prefix
3070 renaming.
3071 (%union): Having several members with the same type does not help
3072 type mismatches, simplify.
3073 (YYPRINT, yyprint): New.
3074 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
3075 (skel_error): this.
3076 Handle locations.
3077 * src/scan-skel.l: Adjust to these changes.
3078 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
3079 (LOCATION_PRINT, skel_control_t): New.
3080
30812001-12-30 Akim Demaille <akim@epita.fr>
3082
3083 * src/parse-skel.y: Get rid of the shift/reduce conflict:
3084 replace `gb' with BLANKS.
3085 * src/scan-skel.l: Adjust.
3086
30872001-12-30 Akim Demaille <akim@epita.fr>
3088
3089 * src/system.h: We don't need nor want bcopy.
3090 Throw away MS-DOS crap: we don't need getpid.
3091 * configure.in: We don't need strndup. It was even causing
3092 problems: because Flex includes the headers *before* us,
3093 _GNU_SOURCE is not defined by config.h, and therefore strndup was
3094 not visible.
3095 * lib/xstrndup.c: New.
3096 * src/scan-skel.l: Use it.
3097 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
3098 * src/parse-skel.y: Use %directives instead of #defines.
3099
31002001-12-30 Akim Demaille <akim@epita.fr>
3101
3102 * src/skeleton.h: New.
3103 * src/output.c (output_parser, output_master_parser): Remove, dead
3104 code.
3105 * src/output.h (get_lines_number, actions_output, guards_output)
3106 (token_definitions_output): Prototype them.
3107 * src/parse-skel.y: Add the license notice.
3108 Include output.h and skeleton.h.
3109 (process_skeleton): Returns void, and takes a single parameter.
3110 * src/scan-skel.l: Add the license notice.
3111 Include skeleton.h.
3112 Don't use %option yylineno: it seems that then Flex imagines
3113 REJECT has been used, and therefore it won't reallocate its
3114 buffers (which makes no other sense to me than a bug). It results
3115 in warnings for `unused: yy_flex_realloc'.
3116
31172001-12-30 Robert Anisko <robert.anisko@epita.fr>
3118
3119 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3120 (MUSCLE_INSERT_PREFIX): ...to there.
3121 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3122 (MUSCLE_INSERT_PREFIX): Move from here...
3123
3124 * src/bison.hairy: Add a section directive. Put braces around muscle
3125 names. This parser skeleton is still broken, but Bison should not
3126 choke on a bad muscle 'syntax'.
3127 * src/bison.simple: Add a section directive. Put braces around muscle
3128 names.
3129
3130 * src/files.h (strsuffix, stringappend): Add declarations.
3131 (tab_extension): Add declaration.
3132 (short_base_name): Add declaration.
3133
3134 * src/files.c (strsuffix, stringappend): No longer static. These
3135 functions are used in the skeleton parser.
3136 (tab_extension): New.
3137 (compute_base_names): Use the computations done in this function
3138 to guess if the generated parsers should have '.tab' in their
3139 names.
3140 (short_base_name): No longer static.
3141
3142 * src/output.c (output_skeleton): New.
3143 (output): Disable call to output_master_parser, and give a try to
3144 a new skeleton handling system.
3145 (guards_output, actions_output): No longer static.
3146 (token_definitions_output, get_lines_number): No longer static.
3147
3148 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
3149
3150 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
3151 parse-skel.y.
3152
3153 * src/parse-skel.y: New file.
3154 * src/scan-skel.l: New file.
3155
31562001-12-29 Akim Demaille <akim@epita.fr>
3157
3158 %name-prefix is broken.
3159
3160 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
3161 Adjust all dependencies.
3162 * tests/headers.at (export YYLTYPE): Strengthen this test: use
3163 %name-prefix.
3164
3165 Renaming yylval but not yylloc is not consistent. Now we do.
3166
3167 * src/bison.simple: Prefix yylloc if used.
3168 * doc/bison.texinfo (Decl Summary): Document that.
3169
31702001-12-29 Akim Demaille <akim@epita.fr>
3171
3172 * doc/bison.texinfo: Promote `%long-directive' over
3173 `%long_directive'.
3174 Remove all references to fixed-output-files, yacc is enough.
3175
31762001-12-29 Akim Demaille <akim@epita.fr>
3177
3178 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
3179 user prologue. These are defaults.
3180 * tests/actions.at (Mid-rule actions): Make sure the user can
3181 define YYDEBUG and YYERROR_VERBOSE.
3182
31832001-12-29 Akim Demaille <akim@epita.fr>
3184
3185 * src/output.c (header_output): Don't forget to export YYLTYPE and
3186 yylloc.
3187 * tests/headers.at (export YYLTYPE): New, make sure it does.
3188 * tests/regression.at (%union and --defines, Invalid CPP headers):
3189 Move to...
3190 * tests/headers.at: here.
3191
31922001-12-29 Akim Demaille <akim@epita.fr>
3193
3194 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
3195
31962001-12-29 Akim Demaille <akim@epita.fr>
3197
3198 * tests/actions.at (Mid-rule actions): Output on a single line
3199 instead of several.
3200
32012001-12-29 Akim Demaille <akim@epita.fr>
3202
3203 * doc/bison.texinfo: Formatting changes.
3204
32052001-12-29 Akim Demaille <akim@epita.fr>
3206
3207 Don't store the token defs in a muscle, just be ready to output it
3208 on command. Now possible via `symbols'. Fixes a memory leak.
3209
3210 * src/output.c (token_definitions_output): New.
3211 (output_parser, header_output): Use it.
3212 * src/reader.c (symbols_save): Remove.
3213
32142001-12-29 Akim Demaille <akim@epita.fr>
3215
3216 * src/bison.simple: Do not provide a default for YYSTYPE and
3217 YYLTYPE before the user's prologue. Otherwise it's hardly... a
3218 default.
3219
32202001-12-29 Akim Demaille <akim@epita.fr>
3221
3222 Mid-rule actions are simply... ignored!
3223
3224 * src/reader.c (readgram): Be sure to attach mid-rule actions to
3225 the empty-rule associated to the dummy symbol, not to the host
3226 rule.
3227 * tests/actions.at (Mid-rule actions): New.
3228
32292001-12-29 Akim Demaille <akim@epita.fr>
3230
3231 Memory leak.
3232
3233 * src/reader.c (reader): Free grammar.
3234
32352001-12-29 Akim Demaille <akim@epita.fr>
3236
3237 Memory leak.
3238
3239 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
3240 since it allocates it for each state, although only one is needed.
3241 (allocate_storage): Do it here.
3242
32432001-12-29 Akim Demaille <akim@epita.fr>
3244
3245 * src/options.h, src/options.c (create_long_option_table): Rename
3246 as...
3247 (long_option_table_new): this, with a clearer prototype.
3248 (percent_table): Remove, unused,
3249 * src/getargs.c (getargs): Adjust.
3250
32512001-12-29 Akim Demaille <akim@epita.fr>
3252
3253 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
3254 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
3255 as states.
3256
32572001-12-29 Akim Demaille <akim@epita.fr>
3258
3259 * src/lalr.c (build_relations): Rename `states' as `states1'.
3260 Sorry, I don't understand exactly what it is, no better name...
3261
32622001-12-29 Akim Demaille <akim@epita.fr>
3263
3264 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
3265 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
3266 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
3267 as rules.
3268
32692001-12-29 Akim Demaille <akim@epita.fr>
3270
3271 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
3272 ago.
3273
32742001-12-29 Akim Demaille <akim@epita.fr>
3275
3276 * src/reader.c, src/reader.h (user_toknums): Remove.
3277 Adjust all users to use symbols[i]->user_token_number.
3278
32792001-12-29 Akim Demaille <akim@epita.fr>
3280
3281 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
3282 Adjust all users to use symbols[i]->prec or ->assoc.
3283
32842001-12-29 Akim Demaille <akim@epita.fr>
3285
3286 * src/reader.c, src/reader.h (tags): Remove.
3287 Adjust all users to use symbols[i]->tag.
3288
32892001-12-29 Akim Demaille <akim@epita.fr>
3290
3291 * src/gram.h, src/gram.c (symbols): New, similar to state_table
3292 and rule_table.
3293 * src/reader.c (packsymbols): Fill this table.
3294 Drop sprec.
3295 * src/conflicts.c (resolve_sr_conflict): Adjust.
3296 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
3297 single table.
3298 Use symbols[i]->tag instead of tags[i].
3299
33002001-12-29 Akim Demaille <akim@epita.fr>
3301
3302 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
3303 In addition, put a comment in there, to replace...
3304 * tests/regression.at (%union and C comments): Remove.
3305
33062001-12-29 Akim Demaille <akim@epita.fr>
3307
3308 * tests/regression.at (Web2c Actions): Blindly move the actual
3309 output as expected output. The contents *seem* right to me, but I
3310 can't pretend reading perfectly parser tables... Nonetheless, all
3311 the other tests pass correctly, the table look OK, even though the
3312 presence of `$axiom' is to be noted: AFAICS it is useless (but
3313 harmless).
3314
33152001-12-29 Akim Demaille <akim@epita.fr>
3316
3317 * src/reader.c (readgram): Don't add the rule 0 if there were no
3318 rules read. In other words, add it _after_ having performed
3319 grammar sanity checks.
3320 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
3321
33222001-12-29 Akim Demaille <akim@epita.fr>
3323
3324 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
3325 visible, and some states have now a different number.
3326
33272001-12-29 Akim Demaille <akim@epita.fr>
3328
3329 * src/reader.c (readgram): Bind the initial rule's lineno to that
3330 of the first rule.
3331 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
3332 (Solved SR Conflicts): Adjust rule 0's line number.
3333
33342001-12-29 Akim Demaille <akim@epita.fr>
3335
3336 Fix the `GAWK Grammar' failure.
3337
3338 * src/LR0.c (final_state): Initialize to -1 so that we do compute
3339 the reductions of the first state which was mistakenly confused
3340 with the final state because precisely final_state was initialized
3341 to 0.
3342 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
3343 now noticed by Bison.
3344 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
3345 have a reduction on $default.
3346
33472001-12-29 Akim Demaille <akim@epita.fr>
3348
3349 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
3350 rule line numbers.
3351 * src/closure.c (print_closure): Likewise.
3352 * src/derives.c (print_derives): Likewise.
3353 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
3354 now.
3355
33562001-12-29 Akim Demaille <akim@epita.fr>
3357
3358 * src/lalr.c (lookaheads_print): New.
3359 (lalr): Call it when --trace-flag.
3360 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
3361 are dumped.
3362
33632001-12-29 Akim Demaille <akim@epita.fr>
3364
3365 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
3366 when walking through ritem, even via rule->rhs.
3367 * src/reduce.c (dump_grammar, useful_production, reduce_output)
3368 (useful_production, useless_nonterminals): Likewise.
3369 (reduce_grammar_tables): Likewise, plus update nritems.
3370 * src/nullable.c (set_nullable): Likewise.
3371 * src/lalr.c (build_relations): Likewise.
3372 * tests/sets.at (Nullable): Adjust.
3373 Fortunately, now, the $axiom is no longer nullable.
3374
33752001-12-29 Akim Demaille <akim@epita.fr>
3376
3377 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
3378 the 0-sentinel.
3379 * src/gram.c (ritem_longest_rhs): Likewise.
3380 * src/reduce.c (nonterminals_reduce): Likewise.
3381 * src/print_graph.c (print_graph): Likewise.
3382 * src/output.c (output_rule_data): Likewise.
3383 * src/nullable.c (set_nullable): Likewise.
3384
33852001-12-29 Akim Demaille <akim@epita.fr>
3386
3387 * src/output.c: Comment changes.
3388
33892001-12-27 Paul Eggert <eggert@twinsun.com>
3390
3391 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
3392 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
3393 Sparc, as they were causing more porting problems than the
3394 (minor) performance improvement was worth.
3395
3396 Also, catch up with 1.31's YYSTD.
3397
33982001-12-27 Akim Demaille <akim@epita.fr>
3399
3400 * src/output.c (output_gram): Rely on nritems, not the
3401 0-sentinel. See below.
3402 Use -1 as separator, not 0.
3403 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
3404 Rely on -1 as separator in yyrhs, instead of 0.
3405 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
3406 twice `Now at end of input', therefore there are two lines less to
3407 expect.
3408
34092001-12-27 Akim Demaille <akim@epita.fr>
3410
3411 * tests/regression.at (Unresolved SR Conflicts):
3412 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
3413 below.
3414
34152001-12-27 Akim Demaille <akim@epita.fr>
3416
3417 * src/LR0.c (new_state): Recognize the final state by the fact it
3418 is reached by eoftoken.
3419 (insert_start_shifting_state, insert_eof_shifting_state)
3420 (insert_accepting_state, augment_automaton): Remove, since now
3421 these states are automatically computed from the initial state.
3422 (generate_states): Adjust.
3423 * src/print.c: When reporting a rule number to the user, substract
3424 1, so that the axiom rule is rule 0, and the first user rule is 1.
3425 * src/reduce.c: Likewise.
3426 * src/print_graph.c (print_core): For the time being, just as for
3427 the report, depend upon --trace-flags to dump the full set of
3428 items.
3429 * src/reader.c (readgram): Once the grammar read, insert the rule
3430 0: `$axiom: START-SYMBOL $'.
3431 * tests/set.at: Adjust: rule 0 is now displayed, and since the
3432 number of the states has changed (the final state is no longer
3433 necessarily the last), catch up.
3434
34352001-12-27 Akim Demaille <akim@epita.fr>
3436
3437 Try to make the use of the eoftoken valid. Given that its value
3438 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
3439 is used instead of > 0 where appropriate, (ii), depend upon nritems
3440 instead of the 0-sentinel.
3441
3442 * src/gram.h, src/gram.c (nritems): New.
3443 Expected to be duplication of nitems, but for the time being...
3444 * src/reader.c (packgram): Assert nritems and nitems are equal.
3445 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
3446 * src/closure.c (print_closure, print_fderives): Likewise.
3447 * src/gram.c (ritem_print): Likewise.
3448 * src/print.c (print_core, print_grammar): Likewise.
3449 * src/print_graph.c: Likewise.
3450
34512001-12-27 Akim Demaille <akim@epita.fr>
3452
3453 * src/main.c (main): If there are complains after grammar
3454 reductions, then output the report anyway if requested, then die.
3455 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
3456 * src/reader.c (eoftoken): New.
3457 (parse_token_decl): If the token being defined has value `0', it
3458 is the eoftoken.
3459 (packsymbols): No longer hack `tags' to insert `$' by hand.
3460 Be sure to preserve the value of the eoftoken.
3461 (reader): Make sure eoftoken is defined.
3462 Initialize nsyms to 0: now eoftoken is created just like the others.
3463 * src/print.c (print_grammar): Don't special case the eof token.
3464 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
3465 lie anyway, albeit pleasant.
3466 * tests/calc.at: Exercise error messages with eoftoken.
3467 Change the grammar so that empty input is invalid.
3468 Adjust expectations.
3469 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
3470
34712001-12-27 Akim Demaille <akim@epita.fr>
3472
3473 * configure.in: Check the protos of strchr ans strspn.
3474 Replace strchr if needed.
3475 * src/system.h: Provide the protos of strchr, strspn and memchr if
3476 missing.
3477 * lib/strchr.c: New.
3478 * src/reader.c (symbols_save): Use strchr.
3479
34802001-12-27 Akim Demaille <akim@epita.fr>
3481
3482 * src/print.c, src/print_graph.c (escape): New.
3483 Use it to quote the TAGS outputs.
3484 * src/print_graph.c (print_state): Now errors are in red, and
3485 reductions in green.
3486 Prefer high to wide: output the state number on a line of its own.
3487
34882001-12-27 Akim Demaille <akim@epita.fr>
3489
3490 * src/state.h, src/state.c (reductions_new): New.
3491 * src/LR0.c (set_state_table): Let all the states have a
3492 `reductions', even if reduced to 0.
3493 (save_reductions): Adjust.
3494 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
3495 * src/print.c (print_reductions, print_actions): Adjust.
3496 * src/output.c (action_row): Adjust.
3497
34982001-12-27 Akim Demaille <akim@epita.fr>
3499
3500 * src/state.h, src/state.c (errs_new, errs_dup): New.
3501 * src/LR0.c (set_state_table): Let all the states have an errs,
3502 even if reduced to 0.
3503 * src/print.c (print_errs, print_reductions): Adjust.
3504 * src/output.c (output_actions, action_row): Adjust.
3505 * src/conflicts.c (resolve_sr_conflict): Adjust.
3506
35072001-12-27 Akim Demaille <akim@epita.fr>
3508
3509 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
3510
35112001-12-27 Akim Demaille <akim@epita.fr>
3512
3513 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
3514 * src/print.c: here.
3515 (lookaheadset, shiftset): New, used as additional storage by
3516 print_reductions.
3517 (print_results): Adjust.
3518 (print_shifts, print_gotos, print_errs): New, extracted from...
3519 (print_actions): here.
3520 * src/print_graph.c (print_actions): Remove dead code.
3521
35222001-12-27 Akim Demaille <akim@epita.fr>
3523
3524 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
3525 `$n' and `@n'.
3526
35272001-12-27 Akim Demaille <akim@epita.fr>
3528
3529 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
3530 (build_relations): Adjust.
3531
35322001-12-27 Akim Demaille <akim@epita.fr>
3533
3534 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
3535 duplication.
3536
35372001-12-27 Akim Demaille <akim@epita.fr>
3538
3539 * src/reader.c (packgram): Catch nitems overflows.
3540
35412001-12-27 Akim Demaille <akim@epita.fr>
3542
3543 * src/files.c, src/files.h (guard_obstack): Remove.
3544 * src/output.c (output): Adjust.
3545 * src/reader.c (parse_braces): New, factoring...
3546 (copy_action, copy_guard): these two which are renamed as...
3547 (parse_action, parse_guard): these.
3548 As a voluntary consequence, using braces around guards is now
3549 mandatory.
3550
35512001-12-27 Akim Demaille <akim@epita.fr>
3552
3553 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
3554 * src/reader.c (symbol_list): `guard' and `guard_line' are new
3555 members.
3556 (symbol_list_new): Adjust.
3557 (copy_action): action_line is the first line, not the last.
3558 (copy_guard): Just as for actions, store the `action' only, not
3559 the switch/case/break flesh.
3560 Don't parse the user action that might follow the guard, let...
3561 (readgram): do it, i.e., now, there can be an action after a
3562 guard.
3563 In other words the guard is just explicitly optional.
3564 (packgram): Adjust.
3565 * src/output.c (guards_output): New.
3566 (output_parser): Call it when needed.
3567 (output): Also free the guard and attrs obstacks.
3568 * src/files.c, src/files.h (obstack_save): Remove.
3569 (output_files): Remove.
3570 As a result, if one needs the former `.act' file, using an
3571 appropriate skeleton which requires actions and guards is now
3572 required.
3573 * src/main.c (main): Adjust.
3574 * tests/semantic.at: New.
3575 * tests/regression.at: Use `input.y' as input file name.
3576 Avoid 8+3 problems by requiring input.c when the test needs the
3577 parser.
3578
35792001-12-27 Akim Demaille <akim@epita.fr>
3580
3581 * src/reader.c (symbol_list_new): Be sure to initialize all the
3582 fields.
3583
35842001-12-27 Akim Demaille <akim@epita.fr>
3585
3586 All the hacks using a final pseudo state are now useless.
3587
3588 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3589 * src/lalr.c (nLA): New.
3590 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3591 instead of lookaheadsp from the pseudo state (nstate + 1).
3592
35932001-12-27 Akim Demaille <akim@epita.fr>
3594
3595 * src/output.c (action_row, token_actions): Use a state_t instead
3596 of a integer, and nlookaheads instead of the following state's
3597 lookaheadsp.
3598
35992001-12-27 Akim Demaille <akim@epita.fr>
3600
3601 * src/conflicts.c (log_resolution, flush_shift)
3602 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3603 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3604 (conflicts_print, print_reductions): Use a state_t instead of an
3605 integer when referring to a state.
3606 As much as possible, depend upon nlookaheads, instead of the
3607 `lookaheadsp' member of the following state (since lookaheads of
3608 successive states are successive, the difference between state n + 1
3609 and n served as the number of lookaheads for state n).
3610 * src/lalr.c (add_lookback_edge): Likewise.
3611 * src/print.c (print_core, print_actions, print_state)
3612 (print_results): Likewise.
3613 * src/print_graph.c (print_core, print_actions, print_state)
3614 (print_graph): Likewise.
3615 * src/conflicts.h: Adjust.
3616
36172001-12-27 Akim Demaille <akim@epita.fr>
3618
3619 * src/bison.hairy: Formatting/comment changes.
3620 ANSIfy.
3621 Remove `register' indications.
3622 Add plenty of `static'.
3623
36242001-12-27 Akim Demaille <akim@epita.fr>
3625
3626 * src/output.c (prepare): Drop the muscle `ntbase' which
3627 duplicates ntokens.
3628 * src/bison.simple: Formatting/comment changes.
3629 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3630 is an undocumented synonym.
3631
36322001-12-22 Akim Demaille <akim@epita.fr>
3633
3634 * src/output.c (output_table_data): Change the prototype to use
3635 `int' for array ranges: some invocations do pass an int, not a
3636 short.
3637 Reported by Wayne Green.
3638
36392001-12-22 Akim Demaille <akim@epita.fr>
3640
3641 Some actions of web2c.y are improperly triggered.
3642 Reported by Mike Castle.
3643
3644 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3645 * tests/regression.at (Web2c): Rename as...
3646 (Web2c Report): this.
3647 (Web2c Actions): New.
3648
36492001-12-22 Akim Demaille <akim@epita.fr>
3650
3651 Reductions in web2c.y are improperly reported.
3652 Reported by Mike Castle.
3653
3654 * src/conflicts.c (print_reductions): Fix.
3655 * tests/regression.at (Web2c): New.
3656
36572001-12-18 Akim Demaille <akim@epita.fr>
3658
3659 Some host fail on `assert (!"foo")', which expands to
3660 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3661 Reported by Nelson Beebee.
3662
3663 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3664 `#define it_succeeded 0' and `assert (it_succeeded)'.
3665
36662001-12-17 Marc Autret <autret_m@epita.fr>
3667
3668 * src/bison.simple: Don't hard code the skeleton line and filename.
3669 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3670 New line counter 'skeleton_line' (skeleton-line muscle).
3671
36722001-12-17 Paul Eggert <eggert@twinsun.com>
3673
3674 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3675 YYDEBUG must be defined to a nonzero value.
3676
3677 * src/bison.simple (yytname): Do not assume that the user defines
3678 YYDEBUG to a properly parenthesized expression.
3679
36802001-12-17 Akim Demaille <akim@epita.fr>
3681
3682 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3683 nlookaheads is a new member.
3684 Adjust all users.
3685 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3686 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3687 state.
3688
36892001-12-17 Akim Demaille <akim@epita.fr>
3690
3691 * src/files.h, src/files.c (open_files, close_files): Remove.
3692 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3693 let...
3694 * src/reader.c (reader): Do it.
3695
36962001-12-17 Akim Demaille <akim@epita.fr>
3697
3698 * src/conflicts.c (print_reductions): Formatting changes.
3699
37002001-12-17 Akim Demaille <akim@epita.fr>
3701
3702 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3703 (flush_reduce): New.
3704 (resolve_sr_conflict): Adjust.
3705
37062001-12-17 Akim Demaille <akim@epita.fr>
3707
3708 * src/output.c (output_obstack): Be static and rename as...
3709 (format_obstack): this, to avoid any confusion with files.c's
3710 output_obstack.
3711 * src/reader.h (muscle_obstack): Move to...
3712 * src/output.h: here, since it's defined in output.c.
3713
37142001-12-17 Akim Demaille <akim@epita.fr>
3715
3716 * src/output.c (action_row, save_column, default_goto)
3717 (sort_actions, matching_state, pack_vector): Better variable
3718 locality.
3719
37202001-12-17 Akim Demaille <akim@epita.fr>
3721
3722 * src/output.c: Various formatting changes.
3723
37242001-12-17 Akim Demaille <akim@epita.fr>
3725
3726 * src/files.c (output_files): Free the output_obstack.
3727 * src/main.c (main): Call print and print_graph conditionally.
3728 * src/print.c (print): Work unconditionally.
3729 * src/print_graph.c (print_graph): Work unconditionally.
3730 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3731
37322001-12-16 Marc Autret <autret_m@epita.fr>
3733
3734 * src/output.c (actions_output): Fix. When we use %no-lines,
3735 there is one less line per action.
3736
37372001-12-16 Marc Autret <autret_m@epita.fr>
3738
3739 * src/bison.simple: Remove a useless #line directive.
3740 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3741 * src/output.c (get_lines_number): New.
3742 (output_parser): Adjust, now takes care about the lines of a
3743 output muscles.
3744 Fix line numbering.
3745 (actions_output): Computes the number of lines taken by actions.
3746 (output_master_parser): Insert new skeleton which is the name of
3747 the output parser file name.
3748
37492001-12-15 Marc Autret <autret_m@epita.fr>
3750
3751 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3752
37532001-12-15 Marc Autret <autret_m@epita.fr>
3754
3755 * src/output.c (output_gram): Keep track of the hairy one.
3756
37572001-12-15 Akim Demaille <akim@epita.fr>
3758
3759 Make `make distcheck' work.
3760
3761 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3762 system.h which uses libgettext.h.
3763
37642001-12-15 Akim Demaille <akim@epita.fr>
3765
3766 * src/nullable.c (set_nullable): Useless rules must be skipped,
3767 otherwise, since we range over their symbols, we might look at a
3768 nonterminal which no longer ``exists'', i.e., it is not counted in
3769 `nvars', hence we overflow our arrays.
3770
37712001-12-15 Akim Demaille <akim@epita.fr>
3772
3773 The header can also be produced directly, without any obstack!
3774 Yahoo!
3775
3776 * src/files.c, src/files.h (defines_obstack): Remove.
3777 (compute_header_macro): Global.
3778 (defines_obstack_save): Remove.
3779 * src/reader.c (parse_union_decl): No longer output to
3780 defines_obstack: its content can be found in the `stype' muscle
3781 anyway.
3782 (output_token_translations): Merge into...
3783 (symbols_output): this.
3784 Rename as...
3785 (symbols_save): this.
3786 (reader): Adjust.
3787 * src/output.c (header_output): New.
3788 (output): Call it.
3789
37902001-12-15 Akim Demaille <akim@epita.fr>
3791
3792 * src/reader.c (parse_union_decl): Instead of handling two obstack
3793 simultaneously, use one to define the `stype' muscle, and use the
3794 value of the latter to fill defines_obstack.
3795 (copy_comment): Remove.
3796 (copy_comment2): Work for a single obstack.
3797 Rename as...
3798 (copy_comment): this.
3799
38002001-12-15 Akim Demaille <akim@epita.fr>
3801
3802 * src/lex.c, src/lex.h (xgetc): No longer static.
3803 * src/reader.c (parse_union_decl): Revamp.
3804
38052001-12-15 Akim Demaille <akim@epita.fr>
3806
3807 Still making progress in separating Bison into (i) input, (ii)
3808 process, (iii) output: now we can directly output the parser file
3809 without using table_obstack at all.
3810
3811 * src/files.c, src/files.h (table_obstack): Bye bye.
3812 (parser_file_name): New.
3813 * src/files.c (compute_output_file_names): Compute it.
3814 * src/output.c (actions_output, output_parser)
3815 (output_master_parser): To a file instead of an obstack.
3816
38172001-12-15 Akim Demaille <akim@epita.fr>
3818
3819 Attach actions to rules, instead of pre-outputting them to
3820 actions_obstack.
3821
3822 * src/gram.h (rule_t): action and action_line are new members.
3823 * src/reader.c (symbol_list): Likewise.
3824 (copy_action): Save the actions within the rule.
3825 (packgram): Save them in rule_table.
3826 * src/output.c (actions_output): New.
3827 (output_parser): Use it on `%%actions'.
3828 (output_rule_data): Don't free rule_table.
3829 (output): Do it.
3830 (prepare): Don't save the `action' muscle.
3831 * src/bison.simple: s/%%action/%%actions/.
3832
38332001-12-15 Akim Demaille <akim@epita.fr>
3834
3835 * src/reader.c (copy_action): When --yacc, don't append a `;'
3836 to the user action: let it fail if lacking.
3837 Suggested by Arnold Robbins and Tom Tromey.
3838
38392001-12-14 Akim Demaille <akim@epita.fr>
3840
3841 * src/lex.c (literalchar): Simply return the char you decoded, non
3842 longer mess around with obstacks and int pointers.
3843 Adjust all callers.
3844
38452001-12-14 Akim Demaille <akim@epita.fr>
3846
3847 * src/lex.c (literalchar): Don't escape the special characters,
3848 just decode them, and keep them as char (before, eol was output as
3849 the 2 char string `\n' etc.).
3850 * src/output.c (output_rule_data): Use quotearg to output the
3851 token strings.
3852
38532001-12-13 Paul Eggert <eggert@twinsun.com>
3854
3855 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3856 Do not infringe on the global user namespace when using C++.
3857 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3858 All uses of `fprintf' and `stderr' changed.
3859
3860 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3861
38622001-12-13 Akim Demaille <akim@epita.fr>
3863
3864 The computation of nullable is broken: it doesn't handle empty
3865 RHS's properly.
3866
3867 * tests/torture.at (GNU AWK Grammar): New.
3868 * tests/sets.at (Nullable): New.
3869 * src/nullable.c (set_nullable): Instead of blindly looping over
3870 `ritems', loop over the rules, and then over their rhs's.
3871
3872 Work around Autotest bugs.
3873
3874 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3875 frame, because Autotest understand lines starting with a `+' as
3876 traces from the shell. Then, they are not processed properly.
3877 Admittedly an Autotest bug, but we don't have time to wait for
3878 Autotest to catch up.
3879 * tests/regression.at (Broken Closure): Adjust to the new table
3880 frames.
3881 Move to...
3882 * tests/sets.at: here.
3883
38842001-12-13 Akim Demaille <akim@epita.fr>
3885
3886 * src/closure.c (closure): Use nrules instead of playing tricks
3887 with BITS_PER_WORD.
3888
38892001-12-13 Akim Demaille <akim@epita.fr>
3890
3891 * src/print.c (print_actions): Output the handling of `$' as the
3892 traces do: shifting the token EOF. Before EOF was treated as a
3893 nonterminal.
3894 * tests/regression.at: Adjust some tests.
3895 * src/print_graph.c (print_core): Complete the set of items via
3896 closure. The next-to-final and final states are still unsatisfying,
3897 but that's to be addressed elsewhere.
3898 No longer output the rule numbers, but do output the state number.
3899 A single loop for the shifts + gotos is enough, but picked a
3900 distinct color for each.
3901 (print_graph): Initialize and finalize closure.
3902
39032001-12-13 Akim Demaille <akim@epita.fr>
3904
3905 * src/reader.c (readgram): Remove dead code, an strip useless
3906 braces.
3907 (get_type): Remove, unused.
3908
39092001-12-12 Akim Demaille <akim@epita.fr>
3910
3911 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3912 on that of lib/error.c.
3913
39142001-12-12 Akim Demaille <akim@epita.fr>
3915
3916 Some hosts don't like `/' in includes.
3917
3918 * src/system.h: Include libgettext.h without qualifying the path.
3919 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3920 $(top_srcdir).
3921
39222001-12-11 Marc Autret <autret_m@epita.fr>
3923
3924 * src/output.c (output_parser): Remove useless muscle.
3925
39262001-12-11 Marc Autret <autret_m@epita.fr>
3927
3928 * src/bison.simple: Remove #line just before %%epilogue. It
3929 is now handled in ...
3930 * src/reader.c (read_additionnal_code): Add the output of a
3931 #line for the epilogue.
3932
39332001-12-10 Marc Autret <autret_m@epita.fr>
3934
3935 * src/reader.c (copy_definition): Re-use CPP-outed code which
3936 replace precedent remove.
3937 * src/bison.simple: Remove #line before %%prologue because
3938 %%input-line is wrong at this time.
3939
39402001-12-10 Marc Autret <autret_m@epita.fr>
3941
3942 * src/reader.c (symbols_output): Clean up.
3943 * src/output.c (output_gram, output): Clean up.
3944
39452001-12-10 Akim Demaille <akim@epita.fr>
3946
3947 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3948 * src/LR0.c (set_state_table): here.
3949 * src/lalr.c (lalr): Call it.
3950
39512001-12-10 Akim Demaille <akim@epita.fr>
3952
3953 * src/state.h (shifts): Remove the `number' member: shifts are
3954 attached to state, hence no longer need to be labelled with a
3955 state number.
3956
39572001-12-10 Akim Demaille <akim@epita.fr>
3958
3959 Now that states have a complete set of members, the linked list of
3960 shifts is useless: just fill directly the state's shifts member.
3961
3962 * src/state.h (shifts): Remove the `next' member.
3963 * src/LR0.c (first_state, last_state): Remove.
3964 Adjust the callers.
3965 (augment_automaton): Don't look for the shifts that must be added
3966 a shift on EOF: it is those of the state we looked for! But now,
3967 since shifts are attached, it is no longer needed to looking
3968 merely by its id: its number.
3969
39702001-12-10 Akim Demaille <akim@epita.fr>
3971
3972 * src/LR0.c (augment_automaton): Better variable locality.
3973 Remove an impossible branch: if there is a state corresponding to
3974 the start symbol being shifted, then there is shift for the start
3975 symbol from the initial state.
3976
39772001-12-10 Akim Demaille <akim@epita.fr>
3978
3979 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3980 only when appropriate: when insert_start_shifting_state' is not
3981 invoked.
3982 * tests/regression.at (Rule Line Numbers): Adjust.
3983
39842001-12-10 Akim Demaille <akim@epita.fr>
3985
3986 * src/LR0.c (augment_automaton): Now that all states have shifts,
3987 merge the two cases addition shifts to the initial state.
3988
39892001-12-10 Akim Demaille <akim@epita.fr>
3990
3991 * src/lalr.c (set_state_table): Move to...
3992 * src/LR0.c: here.
3993 * src/lalr.c (lalr): Don't call it...
3994 * src/LR0.c (generate_states): do it.
3995 * src/LR0.h (first_state): Remove, only the table is used.
3996
39972001-12-10 Akim Demaille <akim@epita.fr>
3998
3999 * src/LR0.h (first_shift, first_reduction): Remove.
4000 * src/lalr.c: Don't use first_shift: find shifts through the
4001 states.
4002
40032001-12-10 Akim Demaille <akim@epita.fr>
4004
4005 * src/LR0.c: Attach shifts to states as soon as they are
4006 computed.
4007 * src/lalr.c (set_state_table): Instead of assigning shifts to
4008 state, just assert that the mapping was properly done.
4009
40102001-12-10 Akim Demaille <akim@epita.fr>
4011
4012 * src/LR0.c (insert_start_shift): Rename as...
4013 (insert_start_shifting_state): this.
4014 (insert_eof_shifting_state, insert_accepting_state): New.
4015 (augment_automaton): Adjust.
4016 Better locality of the variables.
4017 When looking if the start_symbol is shifted from the initial
4018 state, using `while (... symbol != start_symbol ...)' sounds
4019 better than `while (... symbol < start_symbol ...)': If fail
4020 to see how the order between symbols could be relevant!
4021
40222001-12-10 Akim Demaille <akim@epita.fr>
4023
4024 * src/getargs.h: Don't declare `spec_name_prefix' and
4025 `spec_file_prefix', declared by src/files.h.
4026 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
4027 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
4028 * src/output.c (prepare): Adjust.
4029 * src/reader.c (symbols_output): Likewise.
4030 * src/vmsgetargs.c: Vaguely adjust, but who cares?
4031
40322001-12-10 Akim Demaille <akim@epita.fr>
4033
4034 * src/muscle_tab.c (muscle_init): NULL is a better default than
4035 `"0"'.
4036
40372001-12-10 Akim Demaille <akim@epita.fr>
4038
4039 * src/reader.c (reader): Calling symbols_output once is enough.
4040
40412001-12-10 Akim Demaille <akim@epita.fr>
4042
4043 Now that states have a complete set of members, the linked list of
4044 reductions is useless: just fill directly the state's reductions
4045 member.
4046
4047 * src/state.h (struct reductions): Remove member `number' and
4048 `next'.
4049 * src/LR0.c (first_reduction, last_reduction): Remove.
4050 (save_reductions): Don't link the new reductions, store them in
4051 this_state.
4052 * src/lalr.c (set_state_table): No need to attach reductions to
4053 states, it's already done.
4054 * src/output.c (output_actions): No longer free the shifts, then
4055 the reductions, then the states: free all the states and their
4056 members.
4057
40582001-12-10 Akim Demaille <akim@epita.fr>
4059
4060 * src/options.c (OPTN, DRTV, BOTH): New.
4061 (option_table): Use them.
4062
4063 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
4064 the job of system.h.
4065 * src/options.c: Don't include stdio.h and xalloc.h for the same
4066 reasons.
4067
40682001-12-10 Akim Demaille <akim@epita.fr>
4069
4070 * src/output.c (output, prepare): Make sure the values of the
4071 muscles `action' and `prologue' are 0-terminated.
4072
40732001-12-10 Akim Demaille <akim@epita.fr>
4074
4075 Clean up GCC warnings.
4076
4077 * src/reader.c (copy_action): `buf' is not used.
4078 (parse_skel_decl): Be static.
4079 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
4080 * src/options.h (create_long_option_table): Have a real prototype.
4081 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
4082 (hash_delete_at): Return const void *.
4083 Adjust casts to preserve the const.
4084
40852001-12-10 Akim Demaille <akim@epita.fr>
4086
4087 * configure.in: Require 2.52g.
4088 M4 is not needed, but AUTOM4TE is.
4089 * m4/m4.m4: Remove.
4090 * tests/Makefile.am: Adjust.
4091
40922001-12-10 Akim Demaille <akim@epita.fr>
4093
4094 One structure for states is enough, even though theoretically
4095 there are LR(0) states and LALR(1) states.
4096
4097 * src/lalr.h (state_t): Remove.
4098 (state_table): Be state_t **, not state_t *.
4099 * src/state.h (core, CORE_ALLOC): Rename as...
4100 (state_t, STATE_ALLOC): this.
4101 Add the LALR(1) members: shifts, reductions, errs.
4102 * src/LR0.c (state_table): Rename as...
4103 (state_hash): this, to avoid name clashes with the global
4104 `state_table'.
4105 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
4106 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
4107
41082001-12-10 Akim Demaille <akim@epita.fr>
4109
4110 Bison dumps core on bash.y.
4111 Reported by Pascal Bart.
4112
4113 * src/warshall.c (bitmatrix_print): New.
4114 (TC): Use it.
4115 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
4116 j must be the outer loop.
4117 * tests/regression.at (Broken Closure): New.
4118
41192001-12-05 Akim Demaille <akim@epita.fr>
4120
4121 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
4122 its argument.
4123