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