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