]> git.saurik.com Git - bison.git/blame - ChangeLog
Portability fixes for bitsets; this also avoids several GCC warnings.
[bison.git] / ChangeLog
CommitLineData
f28a0f2d
PE
12002-10-10 Paul Eggert <eggert@twinsun.com>
2
3 Portability fixes for bitsets; this also avoids several GCC
4 warnings.
5
6 * lib/abitset.c: Include <stddef.h>, for offsetof.
7 * lib/lbitset.c: Likewise.
8
9 * lib/abitset.c (abitset_bytes): Return a size that is aligned
10 properly for vectors of objects. Do not assume that adding a
11 header size to a multiple of a word size yields a value that is
12 properly aligned for the whole union.
13 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14
15 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16 unique names for structures.
17 * lib/ebitset.c (ebitset_bytes): Likewise.
18 * lib/lbitset.c (lbitset_bytes): Likewise.
19
20 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
21 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
22 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
23 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
24 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
25 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
26 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
27 to improve the type-checking that GCC can do.
28 * lib/bitset.c (bitset_op4_cmp): Likewise.
29 * lib/bitset_stats.c (bitset_stats_count,
30 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
31 bitset_stats_copy, bitset_stats_disjoint_p,
32 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
33 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
34 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
35 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
36 bitset_stats_and_or_cmp, bitset_stats_andn_or,
37 bitset_stats_andn_or_cmp, bitset_stats_or_and,
38 bitset_stats_or_and_cmp): Likewise.
39 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
40 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
41 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
42 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
43
44 * lib/abitset.h: Include bitset.h, not bbitset.h.
45 * lib/ebitset.h: Likewise.
46 * lib/lbitset.h: Likewise.
47
48 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
49 All instances of parameters of type enum bitset_opts are now of
50 type enum_bitset_opts, to conform to the C Standard, and similarly
51 for enum_bitset_type.
52 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
53 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
54
55 Do not use "struct bitset_struct" to mean different things in
56 different modules. Not only is this confusing, it violates
57 the C Standard, which requires that structure types in different
58 modules must be compatible if one is to be passed to the other.
59 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
60 All instances of "struct bitset_struct *" replaced with "bitset".
61 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
62 (union bitset_union, struct abitset_struct, struct ebitset_struct,
63 struct lbitset_struct, struct bitset_stats_struct): New types.
64 All uses of struct bitset_struct changed to union bitset_union,
65 etc.
66 * lib/abitset.c (struct abitset_struct, abitset,
67 struct bitset_struct): Remove.
68 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
69 struct bitset_struct): Remove.
70 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
71 bitset_struct): Remove.
72 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
73 Likewise.
74
75 Do not call a function of type T using a call that assumes the
76 function is of a different type U. Standard C requires that a
77 function must be called with a type that is compatible with its
78 definition.
79 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
80 New decls.
81 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
82 New functions.
83 * lib/ebitset.c (PFV): Remove.
84 * lib/lbitset.c (PFV): Likewise.
85 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
86 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
87 decls.
88 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
89 (ebitset_vtable): Use them.
90 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
91 lbitset_xor): New functions.
92 (lbitset_vtable): Use them.
93
94 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
95 Declare.
96
97 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
98 GCC warning.
99 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
100 Use offsetof, for simplicity.
101
6fbe4984
PE
1022002-10-06 Paul Eggert <eggert@twinsun.com>
103
104 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
105 the same width as int. This reapplies a hunk of the 2002-08-12 patch
106 <http://mail.gnu.org/pipermail/bison-patches/2002-August/001111.html>,
107 which was inadvertently undone by the 2002-09-30 patch.
108 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
109 the same width as int.
110
420f93c8
PE
1112002-10-04 Paul Eggert <eggert@twinsun.com>
112
113 Version 1.50.
114
115 * configure.ac (AC_INIT), NEWS: Increment version number.
116
117 * doc/bison.texinfo: Minor spelling, grammar, and white space
118 fixes.
119 (Symbols): Mention that any negative value returned from yylex
120 signifies end-of-input. Warn about negative chars. Mention
121 the portable Standard C character set.
122
123 The GNU coding standard says CFLAGS and YFLAGS are reserved
124 for the installer to set.
125 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
126 * src/Makefile.am (AM_CFLAGS): Likewise.
127 (AM_YFLAGS): Renamed from YFLAGS.
128
129 Fix some MAX and MIN problems.
130 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
131 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
132 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
133 * src/reader.c (reader): Use it.
134
135 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
136 POSIX 1003.1-2001 has removed fgrep.
137
1382002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
139
140 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
141 interpreted as signed.
142 * lib/ebitset.c (ebitset_list): Fix bug.
143
ff68026d
PE
1442002-10-01 Paul Eggert <eggert@twinsun.com>
145
146 More fixes for 64-bit hosts and large bitsets.
147
148 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
149 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
150 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
151 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
152 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
153 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
154 bitset_count_): Likewise.
155 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
156 bitset_first, bitset_last): Likewise.
157 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
158 bitset_stats_list_reverse, bitset_stats_size,
159 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
160 Likewise.
161 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
162 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
163 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
164 bitsetv_reflexive_transitive_closure): Likewise.
165 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
166 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
167 Likewise.
168 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
169 Likewise.
420f93c8 170
ff68026d
PE
171 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
172 Use size_t, not unsigned int, to count bytes.
173 * lib/abitset.h (abitset_bytes): Likewise.
174 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
175 Likewise.
176 * lib/bitset.h (bitset_bytes): Likewise.
177 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
178 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
179 * lib/bitsetv.c (bitsetv_alloc): Likewise.
180 * lib/ebitset.c (ebitset_bytes): Likewise.
181 * lib/ebitset.h (ebitset_bytes): Likewise.
182 * lib/lbitset.c (lbitset_bytes): Likewise.
183 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 184
ff68026d
PE
185 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
186 abitset_subset_p, abitset_disjoint_p, abitset_and,
187 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
188 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
189 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
190 abitset_or_and, abitset_or_and_cmp):
191 Use bitset_windex instead of unsigned int.
192 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
193 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
194 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
195 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
196 Likewise.
197 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 198
ff68026d
PE
199 * lib/bitset.c (bitset_print):
200 Use proper printf formats for widths of integer types.
201 * lib/bitset_stats.c (bitset_percent_histogram_print,
202 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
203 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
204 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
205 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 206
ff68026d
PE
207 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
208 BITSET_SIZE_MAX): New macros.
209 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
210 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
211 to BITSET_WINDEX_MAX.
212
213 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
214 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
215 since we now return the bitset_bindex type (not int).
216
217 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
218 when computing sizes.
219 * lib/ebitset.c (ebitset_elts_grow): Likewise.
220
221 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
222 and avoid cast to unsigned.
223
6aa452a6
AD
2242002-09-30 Akim Demaille <akim@epita.fr>
225
226 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
227 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
228 Updates from Michael Hayes.
229
927f7817
AD
2302002-09-30 Art Haas <ahaas@neosoft.com>
231
232 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
233 invocations.
234 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
235 defined.
236
9738f41e
AD
2372002-09-27 Akim Demaille <akim@epita.fr>
238
239 Version 1.49c.
240
a5c75d7f
AD
2412002-09-27 Akim Demaille <akim@epita.fr>
242
243 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
244 (Because of AC_LIBSOURCE).
245
8280e179
AD
2462002-09-27 Akim Demaille <akim@epita.fr>
247
248 Playing with Autoscan.
249
250 * configure.ac: Remove the old LIBOBJ tweaks.
251 (AC_REPLACE_FUNCS): Add strrchr and strtol.
252 * lib/strrchr.c: New.
253 * lib/strtol.c: New, from the Coreutils 4.5.1.
254
ae64af35
AD
2552002-09-27 Akim Demaille <akim@epita.fr>
256
257 Playing with Autoscan.
258
259 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
260 * lib/Makefile.am (libbison_a_SOURCES): No longer include
261 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
262 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
263 Coreutils 4.5.1.
264
d1a1114f
AD
2652002-09-24 Akim Demaille <akim@epita.fr>
266
267 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
268 (Frequently Asked Questions, Parser Stack Overflow): New.
269
b906441c
AD
2702002-09-13 Akim Demaille <akim@epita.fr>
271
272 Playing with autoscan.
273
274 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
275 * src/files.c (skeleton_find): Remove, unused.
276 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
277 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
278
bd701811
AD
2792002-09-13 Akim Demaille <akim@epita.fr>
280
281 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
282 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
283
e0a13e7b
AD
2842002-09-13 Akim Demaille <akim@epita.fr>
285
286 * configure.ac: Require 2.54.
287 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
288 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
289 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
290 Remove, provided by Autoconf macros.
291
c97011bf
AD
2922002-09-12 Akim Demaille <akim@epita.fr>
293
294 * m4/prereq.m4: Update, from Coreutils 4.5.1.
295
d862b1be
AD
2962002-09-12 Akim Demaille <akim@epita.fr>
297
298 * m4/prereq.m4: Update, from Fileutils 4.1.5.
299 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
300 Reported by Martin Mokrejs.
301
3d38c03a
AD
3022002-09-10 Akim Demaille <akim@epita.fr>
303
304 * src/parse-gram.y: Associate a human readable string to each
305 token type.
306 * tests/regression.at (Invalid inputs): Adjust.
307
b6347355
AD
3082002-09-10 Gary V. Vaughan <gary@gnu.org>
309
310 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
311 with an Autoconf-2.5x style configure.ac.
312
09ba4ab2
PE
3132002-09-06 Paul Eggert <eggert@twinsun.com>
314
315 * doc/bison.texinfo (Conditions): Make explicit that the GPL
316 exception applies only to yacc.c. This is a modification of a
317 patch originally suggested by Akim Demaille.
318
21846f69
AD
3192002-09-06 Akim Demaille <akim@epita.fr>
320
09ba4ab2
PE
321 * data/c.m4 (b4_copyright): Move the GPL exception comment from
322 here to...
323 * data/yacc.c: here.
324
21846f69
AD
325 * data/lalr1.cc (struct yyltype): Don't define it, since we use
326 LocationType.
327 (b4_ltype): Default to yy::Location from location.hh.
328
c0ad8bf3
AD
3292002-09-04 Jim Meyering <jim@meyering.net>
330
331 * data/yacc.c: Guard the declaration of yytoknum also with
332 `#ifdef YYPRINT', so it is declared only when used.
333
3a93251e
AD
3342002-09-04 Akim Demaille <akim@epita.fr>
335
336 * configure.in: Rename as...
337 * configure.ac: this.
338 Bump to 1.49c.
339
427c0dda
AD
3402002-09-04 Akim Demaille <akim@epita.fr>
341
342 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
343 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
344 translate maintainer only messages.
345
6a254321
PE
3462002-08-12 Paul Eggert <eggert@twinsun.com>
347
645e30d1
PE
348 Version 1.49b.
349
6a254321
PE
350 * Makefile.am (SUBDIRS): Remove intl.
351 (DISTCLEANFILES): Remove.
352 * NEWS: Mention that GNU M4 is now required. Clarify what is
353 meant by "larger grammars". Mention the pt_BR translation.
354 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
355 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
356 Bump version from 0.11.2 to 0.11.5.
357 (BISON_PREREQ_STAGE): Remove.
358 (AM_GNU_GETTEXT): Use external gettext.
359 (AC_OUTPUT): Remove intl/Makefile.
360
361 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
362
363 * data/glr.c: Include string.h, for strlen.
364 (yyreportParseError): Use size_t for yysize.
365 (yy_yypstack): No longer nested inside yypstates, as nested
366 functions are not portable. Do not assume size_t is the
367 same width as int.
368 (yypstates): Do not assume that ptrdiff_t is the same width
369 as int, and similarly for yyposn and YYINDEX.
370
371 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
372
373 * lib/Makefile.am (INCLUDES): Do not include from the intl
374 directory, which has been removed.
375 * src/Makefile.am (INCLUDES): Likewise.
376
377 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
378 (bitsets_sources, additional_bitsets_sources, timevars_sources):
379 New vars.
380
381 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
382 * tests/Makefile.am (EXTRA_DIST): Likewise.
383
384 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
385 Do not assume that bitset_windex is the same width as unsigned.
386
387 * lib/abitset.c (abitset_unused_clear): Do not assume that
388 bitset_word is the same width as int.
389 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
390 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
391 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
392 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
393 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
394
395 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
396 portability to one's complement hosts!).
397 * lib/ebitset.c (ebitset_op1): Likewise.
398 * lib/lbitset.c (lbitset_op1): Likewise.
399
400 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
401 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
402 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
403 Sync with fileutils.
404 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
405 lib/gettext.h: Sync with diffutils.
406
407 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
408 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
409
410 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
411 PROTOTYPES to check for prototypes, and "defined __STDC__" to
412 check for void *.
413
414 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
415 size_t; the old version tried to do this but casted improperly.
416 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
417 (bitset_test): Now returns int, not unsigned long.
418
419 * lib/bitset_stats.c: Include "gettext.h".
420 (_): New macro.
421 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
422 name locals "index", as it generates unnecessary warnings on some
423 hosts that have an "index" function.
424
425 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
426 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
427 they need translation.
428 * src/LR0.c (state_list_append, new_itemsets, get_state,
429 append_states, generate_states): Likewise.
430 * src/assoc.c (assoc_to_string): Likewise.
431 * src/closure.c (print_closure, set_firsts, closure): Likewise.
432 * src/gram.c (grammar_dump): Likewise.
433 * src/injections.c (injections_compute): Likewise.
434 * src/lalr.c (lookaheads_print): Likewise.
435 * src/relation.c (relation_transpose): Likewise.
436 * src/scan-gram.l: Likewise.
437 * src/tables.c (table_grow, pack_vector): Likewise.
438
439 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
440 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
441 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
442 * m4/mbstate_t.m4: Sync with fileutils.
443 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
444
445 * po/LINGUAS: Add pt_BR.
446 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
447 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
448 lib/timevar.c.
449 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
450 manual recommends.
451 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
452
453 * src/complain.c (strerror_r): Remove decl; not needed.
454 (strerror): Use same pattern as ../lib/error.c.
455
456 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
457
458 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
459
460 * src/main.c (main): Cast result of bindtextdomain and textdomain
461 to void, to avoid a GCC warning when --disable-nls is in effect.
462
463 * src/scan-gram.l: Use strings rather than escapes when possible,
464 to minimize the number of warnings from xgettext.
465 (handle_action_dollar, handle_action_at): Don't use isdigit,
466 as it mishandles negative chars and it may not work as expected
467 outside the C locale.
468
469 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
470 this is a GCC extension and is not portable to other compilers.
471
472 * src/system.h (alloca): Use same pattern as ../lib/error.c.
473 Do not include <ctype.h>; no longer needed.
474 Do not include <malloc.h>; no longer needed (and generates
475 warnings on OpenBSD 3.0).
476
477 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
478 it's not portable.
479
480 * tests/regression.at: Do not use 'cc -c input.c -o input';
481 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
482
483 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
484 exit status as failure, not just exit status 1. Sun C exits
485 with status 2 sometimes.
486
487 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
488 Use it for the two large tests.
489
c8f002c7
AD
4902002-08-02 Akim Demaille <akim@epita.fr>
491
492 * src/conflicts.c (conflicts_output): Don't output rules never
493 reduced here, since anyway that computation doesn't work.
494 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
495 (rule_useless_p, rule_never_reduced_p): New.
496 (grammar_rules_partial_print): Use a filter instead of a range.
497 Display the title only if needed.
498 (grammar_rules_print): Adjust.
499 (grammar_rules_never_reduced_report): New.
500 * src/tables.c (action_row): Move the computation of rules never
501 reduced to...
502 (token_actions): here.
503 * src/main.c (main): Make the parser before making the report, so
504 that rules never reduced are computed.
505 Call grammar_rules_never_reduced_report.
506 * src/print.c (print_results): Report rules never reduced.
507 * tests/conflicts.at, tests/reduce.at: Adjust.
508
cd08e51e
AD
5092002-08-01 Akim Demaille <akim@epita.fr>
510
511 Instead of attaching lookaheads and duplicating the rules being
512 reduced by a state, attach the lookaheads to the reductions.
513
514 * src/state.h (state_t): Remove the `lookaheads',
515 `lookaheads_rule' member.
516 (reductions_t): Add a `lookaheads' member.
517 Use a regular array for the `rules'.
518 * src/state.c (reductions_new): Initialize the lookaheads member
519 to 0.
520 (state_rule_lookaheads_print): Adjust.
521 * src/state.h, src/state.c (state_reductions_find): New.
522 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
523 (count_rr_conflicts): Adjust.
524 * src/lalr.c (LArule): Remove.
525 (add_lookback_edge): Adjust.
526 (state_lookaheads_count): New.
527 (states_lookaheads_initialize): Merge into...
528 (initialize_LA): this.
529 (lalr_free): Adjust.
530 * src/main.c (main): Don't free nullable and derives too early: it
531 is used by --verbose.
532 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
533
bb0027a9
AD
5342002-08-01 Akim Demaille <akim@epita.fr>
535
536 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
537 `rule_number_t**'.
538 (set_derives, free_derives): Rename as...
539 (derives_compute, derives_free): this.
540 Adjust all dependencies.
541 * src/nullable.c (set_nullable, free_nullable): Rename as...
542 (nullable_compute, nullable_free): these.
543 (rule_list_t): Store rule_t *, not rule_number_t.
544 * src/state.c (state_rule_lookaheads_print): Directly compare rule
545 pointers, instead of their numbers.
546 * src/main.c (main): Call nullable_free, and derives_free earlier,
547 as they were lo longer used.
548
3325ddc4
AD
5492002-08-01 Akim Demaille <akim@epita.fr>
550
551 * lib/timevar.c (get_time): Include children time.
552 * src/lalr.h (LA, LArule): Don't export them: used with the
553 state_t.
554 * src/lalr.c (LA, LArule): Static.
555 * src/lalr.h, src/lalr.c (lalr_free): New.
556 * src/main.c (main): Call it.
557 * src/tables.c (pack_vector): Check whether loc is >= to the
558 table_size, not >.
559 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
560 (tables_generate): do it, since that's also it which allocates
561 them.
562 Don't free LA and LArule, main does.
563
c6f1a33c
AD
5642002-07-31 Akim Demaille <akim@epita.fr>
565
566 Separate parser tables computation and output.
567
568 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
569 (conflict_list, conflict_list_cnt, table, check, table_ninf)
570 (yydefgoto, yydefact, high): Move to...
571 * src/tables.h, src/tables.c: here.
572 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
573 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
574 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
575 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
576 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
577 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
578 (action_row, save_row, token_actions, save_column, default_goto)
579 (goto_actions, sort_actions, matching_state, pack_vector)
580 (table_ninf_remap, pack_table, prepare_actions): Move to...
581 * src/tables.c: here.
582 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
583 * src/output.c (token_actions, output_base, output_conflicts)
584 (output_check): Merge into...
585 (prepare_actions): this.
586 (actions_output): Rename as...
587 (user_actions_output): this.
588 * src/main.c (main): Call tables_generate and tables_free.
589
1509d42f
AD
5902002-07-31 Akim Demaille <akim@epita.fr>
591
592 Steal GCC's --time-report support.
593
594 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
595 stolen/adjusted from GCC.
596 * m4/stage.m4: Remove time related checks.
597 * m4/timevar.m4: New.
598 * configure.in: Adjust.
599 * src/system.h: Adjust to using timevar.h.
600 * src/getargs.h, src/getargs.c: Support trace_time for
601 --trace=time.
602 * src/main.c (stage): Remove.
603 (main): Replace `stage' invocations with timevar calls.
604 * src/output.c: Insert pertinent timevar calls.
605
273a74fa
AD
6062002-07-31 Akim Demaille <akim@epita.fr>
607
608 Let --trace have arguments.
609
610 * src/getargs.h (enum trace_e): New.
611 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
612 (long_options, short_options): --trace/-T takes an optional
613 argument.
614 Change all the uses of trace_flag to reflect the new flags.
615 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
616
617 Strengthen `stage' portability.
618
619 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
620 * configure.in: Use it.
621 Don't check for malloc.h and sys/times.h.
622 * src/system.h: Include them when appropriate.
623 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
624 times and struct tms are available.
625
217598da
AD
6262002-07-30 Akim Demaille <akim@epita.fr>
627
628 In verbose parse error message, don't report `error' as an
629 expected token.
630 * tests/actions.at (Printers and Destructors): Adjust.
631 * tests/calc.at (Calculator $1): Adjust.
632 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
633 error message, do not report the parser accepts the error token in
634 that state.
635
52489d44
AD
6362002-07-30 Akim Demaille <akim@epita.fr>
637
638 Normalize conflict related messages.
639
640 * src/complain.h, src/complain.c (warn, complain): New.
641 * src/conflicts.c (conflicts_print): Use them.
642 (conflict_report_yacc): New, extracted from...
643 (conflicts_print): here.
644 * tests/conflicts.at, tests/existing.at: Adjust.
645
e8832397
AD
6462002-07-30 Akim Demaille <akim@epita.fr>
647
648 Report rules which are never reduced by the parser: those hidden
649 by conflicts.
650
651 * src/LR0.c (save_reductions): Don't make the final state too
652 different: save its reduction (accept) instead of having a state
653 without any action (no shift or goto, no reduce).
654 Note: the final state is now a ``regular'' state, i.e., the
655 parsers now contain `reduce 0' as default reduction.
656 Nevertheless, since they decide to `accept' when yystate =
657 final_state, they still will not reduce rule 0.
658 * src/print.c (print_actions, print_reduction): Adjust.
659 * src/output.c (action_row): Track reduced rules.
660 (token_actions): Report rules never reduced.
661 * tests/conflicts.at, tests/regression.at: Adjust.
662
caf23d24
AD
6632002-07-30 Akim Demaille <akim@epita.fr>
664
665 `stage' was accidently included in a previous patch.
666 Initiate its autoconfiscation.
667
668 * configure.in: Look for malloc.h and sys/times.h.
669 * src/main.c (stage): Adjust.
670 Report only when trace_flag.
671
640748ee
AD
6722002-07-29 Akim Demaille <akim@epita.fr>
673
674 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
675 state_number_t.
676 (errs_t): symbol_t*, not symbol_number_t.
677 (reductions_t): rule_t*, not rule_number_t.
678 (FOR_EACH_SHIFT): New.
679 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
680 * src/print.c, src/print_graph.c: Adjust.
681
88bce5a2
AD
6822002-07-29 Akim Demaille <akim@epita.fr>
683
684 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
685
686 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
687 (endtoken, accept): these.
688 * src/reader.c (reader): Set endtoken's default tag to "$end".
689 Set undeftoken's tag to "$undefined" instead of "$undefined.".
690 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
691 Adjust.
692
1bfb97db
AD
6932002-07-29 Akim Demaille <akim@epita.fr>
694
695 * src/reduce.c (reduce_grammar): When the language is empty,
696 complain about the start symbol, not the axiom.
697 Use its location.
698 * tests/reduce.at (Empty Language): New.
699
fc5734fe
AD
7002002-07-26 Akim Demaille <akim@epita.fr>
701
702 * src/reader.h, src/reader.c (gram_error): ... can't get
703 yycontrol without making too strong assumptions on the parser
704 itself.
705 * src/output.c (prepare_tokens): Use the real 0th value of
706 token_translations instead of `0'.
707 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
708 visible here.
709 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
710 for the time being: %locations ought to provide it to yyerror.
711
3650b4b8
AD
7122002-07-25 Akim Demaille <akim@epita.fr>
713
714 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
715 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
716 * tests/regression.at (Web2c Actions): Adjust.
717
4b3d3a8e
AD
7182002-07-25 Akim Demaille <akim@epita.fr>
719
720 Stop storing rules from 1 to nrules + 1.
721
722 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
723 * src/nullable.c, src/output.c, src/print.c, src/reader.c
724 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
725 Iterate from 0 to nrules.
726 Use rule_number_as_item_number and item_number_as_rule_number.
727 Adjust to `derive' now containing possibly 0.
728 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
729 Handle the `- 1' part in rule numbers from/to item numbers.
730 * src/conflicts.c (log_resolution): Fix the message which reversed
731 shift and reduce.
732 * src/output.c (action_row): Initialize default_rule to -1.
733 (token_actions): Adjust.
734 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
735 expected output.
736 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
737
4a2a22f4
AD
7382002-07-25 Akim Demaille <akim@epita.fr>
739
740 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
741 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
742 (b4_c_knr_arg_decl): New.
743 * data/yacc.c: Use it to define yysymprint, yydestruct, and
744 yyreport_parse_error.
745
b8df3223
AD
7462002-07-25 Akim Demaille <akim@epita.fr>
747
748 * data/yacc.c (yyreport_parse_error): New, extracted from...
749 (yyparse): here.
750 (yydestruct, yysymprint): Move above yyparse.
751 Be K&R compliant.
752
a762e609
AD
7532002-07-25 Akim Demaille <akim@epita.fr>
754
755 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
756 replace...
757 (b4_sint_type, b4_uint_type): these.
758 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
759 * tests/regression.at (Web2c Actions): Adjust.
760
12b0043a
AD
7612002-07-25 Akim Demaille <akim@epita.fr>
762
763 * src/gram.h (TIEM_NUMBER_MAX): New.
764 (item_number_of_rule_number, rule_number_of_item_number): Rename
765 as...
766 (rule_number_as_item_number, item_number_as_rule_number): these.
767 Adjust dependencies.
768 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
769 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
770 (symbol_number_to_vector_number): New.
771 (order): Of vector_number_t* type.
772 (base_t, BASE_MAX, BASE_MIN): New.
773 (froms, tos, width, pos, check): Of base_t type.
774 (action_number_t, ACTION_MIN, ACTION_MAX): New.
775 (actrow): Of action_number_t type.
776 (conflrow): Of unsigned int type.
777 (table_ninf, base_ninf): New.
778 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
779 (muscle_insert_int_table, muscle_insert_base_table)
780 (muscle_insert_rule_number_table): New.
781 (prepare_tokens): Output `toknum' as int_table.
782 (action_row): Returns a rule_number_t.
783 Use ACTION_MIN, not SHRT_MIN.
784 (token_actions): yydefact is rule_number_t*.
785 (table_ninf_remap): New.
786 (pack_table): Use it for `base' and `table'.
787 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
788 replaced with...
789 (YYPACT_NINF, YYTABLE_NINF): these.
790 (yypact, yytable): Compute their types instead of hard-coded
791 `short'.
792 * tests/regression.at (Web2c Actions): Adjust.
793
5dde258a
AD
7942002-07-19 Akim Demaille <akim@epita.fr>
795
796 * src/scan-gram.l (id): Can start with an underscore.
797
a945ec39
AD
7982002-07-16 Akim Demaille <akim@epita.fr>
799
800 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
801 Adjust all former `associativity' dependencies.
802 * src/symtab.c (symbol_new): Default associativity is `undef', not
803 `right'.
804 (symbol_check_alias_consistence): Adjust.
805
fae437e8
AD
8062002-07-09 Akim Demaille <akim@epita.fr>
807
808 * doc/bison.texinfo: Properly set the ``header'' part.
809 Use @dircategory ``GNU programming tools'' as per Texinfo's
810 documentation.
811 Use @copying.
812
1a715ef2
AD
8132002-07-09 Akim Demaille <akim@epita.fr>
814
815 * lib/quotearg.h: Protect against multiple inclusions.
816 * src/location.h (location_t): Add a `file' member.
817 (LOCATION_RESET, LOCATION_PRINT): Adjust.
818 * src/complain.c (warn_at, complain_at, fatal_at): Drop
819 `error_one_per_line' support.
820
a5d50994
AD
8212002-07-09 Akim Demaille <akim@epita.fr>
822
823 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
824 * src/reader.c (lineno): Remove.
825 Adjust all dependencies.
826 (get_merge_function): Take a location and use complain_at.
827 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
828 * tests/regression.at (Invalid inputs, Mixing %token styles):
829 Adjust.
830
b275314e
AD
8312002-07-09 Akim Demaille <akim@epita.fr>
832
833 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
834 recovery rule, and forbid extensions when --yacc.
835 (gram_error): Use complain_at.
836 * src/reader.c (reader): Exit if there were parse errors.
837
865b9df1
AD
8382002-07-09 Akim Demaille <akim@epita.fr>
839
840 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
841 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
842 Reported by R Blake <blakers@mac.com>.
843
c76e14da
AD
8442002-07-09 Akim Demaille <akim@epita.fr>
845
846 * data/yacc.c: Output the copyright notive in the header.
847
7db2ed2d
AD
8482002-07-03 Akim Demaille <akim@epita.fr>
849
850 * src/output.c (froms, tos): Are state_number_t.
851 (save_column): sp, sp1, and sp2 are state_number_t.
852 (prepare): Rename `final' as `final_state_number', `nnts' as
853 `nterms_number', `nrules' as `rules_number', `nstates' as
854 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
855 unused.
856 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
857 * data/lalr1.cc (nsym_): Remove, unused.
858
e68e0410
AD
8592002-07-03 Akim Demaille <akim@epita.fr>
860
861 * src/lalr.h, src/lalr.c (goto_number_t): New.
862 * src/lalr.c (goto_list_t): New.
863 Propagate them.
864 * src/nullable.c (rule_list_t): New.
865 Propagate.
866 * src/types.h: Remove.
867
e1a4f3a4
AD
8682002-07-03 Akim Demaille <akim@epita.fr>
869
870 * src/closure.c (print_fderives): Use rule_rhs_print.
871 * src/derives.c (print_derives): Use rule_rhs_print.
872 (rule_list_t): New, replaces `shorts'.
873 (set_derives): Add comments.
874 * tests/sets.at (Nullable, Firsts): Adjust.
875
536545f3
AD
8762002-07-03 Akim Demaille <akim@epita.fr>
877
878 * src/output.c (prepare_actions): Free `tally' and `width'.
879 (prepare_actions): Allocate and free `order'.
880 * src/symtab.c (symbols_free): Free `symbols'.
881 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
882 * src/output.c (m4_invoke): Move to...
883 * src/scan-skel.l: here.
884 (<<EOF>>): Close yyout, and free its name.
885
8b752b00
AD
8862002-07-03 Akim Demaille <akim@epita.fr>
887
888 Fix some memory leaks, and fix a bug: state 0 was examined twice.
889
890 * src/LR0.c (new_state): Merge into...
891 (state_list_append): this.
892 (new_states): Merge into...
893 (generate_states): here.
894 (set_states): Don't ensure a proper `errs' state member here, do it...
895 * src/conflicts.c (conflicts_solve): here.
896 * src/state.h, src/state.c: Comment changes.
897 (state_t): Rename member `shifts' as `transitions'.
898 Adjust all dependencies.
899 (errs_new): For consistency, also take the values as argument.
900 (errs_dup): Remove.
901 (state_errs_set): New.
902 (state_reductions_set, state_transitions_set): Assert that no
903 previous value was assigned.
904 (state_free): New.
905 (states_free): Use it.
906 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
907 temporary storage: use `errs' and `nerrs' as elsewhere.
908 (set_conflicts): Allocate and free this `errs'.
909
613f5e1a
AD
9102002-07-02 Akim Demaille <akim@epita.fr>
911
912 * lib/libiberty.h: New.
913 * lib: Update the bitset implementation from upstream.
914 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
915 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
916 * src/main.c: Adjust bitset stats calls.
917
26e0cadc
PE
9182002-07-01 Paul Eggert <eggert@twinsun.com>
919
920 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
921 char, so that negative chars don't collide with $.
922
1154cced
AD
9232002-06-30 Akim Demaille <akim@epita.fr>
924
925 Have the GLR tests be `warning' checked, and fix the warnings.
926
927 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
928 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
929 (yyremoveDeletes): `yyi' and `yyj' are size_t.
930 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
931 (yyaddDeferredAction): static.
932 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
933 (yyreportParseError): yyprefix is const.
934 yytokenp is used only when verbose.
935 (yy__GNUC__): Replace with __GNUC__.
936 (yypdumpstack): yyi is size_t.
937 (yypreference): Un-yy local variables and arguments, to avoid
938 clashes with `yyr1'. Anyway, we are not in the user name space.
939 (yytname_size): be an int, as is compared with ints.
940 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
941 Use them.
942 * tests/cxx-gram.at: Use quotation to protect $1.
943 Use AT_COMPILE to enable warnings hunts.
944 Prototype yylex and yyerror.
945 `Use' argc.
946 Include `string.h', not `strings.h'.
947 Produce and prototype stmtMerge only when used.
948 yylex takes a location.
949
97650f4e
AD
9502002-06-30 Akim Demaille <akim@epita.fr>
951
952 We spend a lot of time in quotearg, in particular when --verbose.
953
954 * src/symtab.c (symbol_get): Store a quoted version of the key.
955 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
956 Adjust all callers.
957
d2576365
AD
9582002-06-30 Akim Demaille <akim@epita.fr>
959
960 * src/state.h (reductions_t): Rename member `nreds' as num.
961 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
962 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
963
ccaf65bc
AD
9642002-06-30 Akim Demaille <akim@epita.fr>
965
966 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
967 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
968 (shifts_to): Rename as...
969 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
970 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
971 (TRANSITION_IS_DISABLED, transitions_to): these.
972
87675353
AD
9732002-06-30 Akim Demaille <akim@epita.fr>
974
975 * src/print.c (print_shifts, print_gotos): Merge into...
976 (print_transitions): this.
977 (print_transitions, print_errs, print_reductions): Align the
978 lookaheads columns.
979 (print_core, print_transitions, print_errs, print_state,
980 print_grammar): Output empty lines separator before, not after.
981 (state_default_rule_compute): Rename as...
982 (state_default_rule): this.
983 * tests/conflicts.at (Defaulted Conflicted Reduction),
984 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
985 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
986
ce4ccb4b
AD
9872002-06-30 Akim Demaille <akim@epita.fr>
988
989 Display items as we display rules.
990
991 * src/gram.h, src/gram.c (rule_lhs_print): New.
992 * src/gram.c (grammar_rules_partial_print): Use it.
993 * src/print.c (print_core): Likewise.
994 * tests/conflicts.at (Defaulted Conflicted Reduction),
995 (Unresolved SR Conflicts): Adjust.
996 (Unresolved SR Conflicts): Adjust and rename as...
997 (Resolved SR Conflicts): this, as was meant.
998 * tests/regression.at (Web2c Report): Adjust.
999
bc933ef1
AD
10002002-06-30 Akim Demaille <akim@epita.fr>
1001
1002 * src/print.c (state_default_rule_compute): New, extracted from...
1003 (print_reductions): here.
1004 Pessimize, but clarify the code.
1005 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
1006
53d4308d
AD
10072002-06-30 Akim Demaille <akim@epita.fr>
1008
1009 * src/output.c (action_row): Let default_rule be always a rule
1010 number.
1011
574fb2d5
AD
10122002-06-30 Akim Demaille <akim@epita.fr>
1013
1014 * src/closure.c (print_firsts, print_fderives, closure):
1015 Use BITSET_EXECUTE.
1016 * src/lalr.c (lookaheads_print): Likewise.
1017 * src/state.c (state_rule_lookaheads_print): Likewise.
1018 * src/print_graph.c (print_core): Likewise.
1019 * src/print.c (print_reductions): Likewise.
1020 * src/output.c (action_row): Likewise.
1021 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
1022
05811fd7
AD
10232002-06-30 Akim Demaille <akim@epita.fr>
1024
1025 * src/print_graph.c: Use report_flag.
1026
0e4d5753
AD
10272002-06-30 Akim Demaille <akim@epita.fr>
1028
1029 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
1030 to...
1031 * src/relation.h, src/relation.c (traverse, relation_digraph)
1032 (relation_print, relation_transpose): New.
1033
24c7d800
AD
10342002-06-30 Akim Demaille <akim@epita.fr>
1035
1036 * src/state.h, src/state.c (shifts_to): New.
1037 * src/lalr.c (build_relations): Use it.
1038
9222837b
AD
10392002-06-30 Akim Demaille <akim@epita.fr>
1040
1041 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
1042 (item_number_of_rule_number, rule_number_of_item_number): New.
1043 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
1044 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
1045 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
1046 Propagate their use.
1047 Much remains to be done, in particular wrt `shorts' from types.h.
1048
260008e5
AD
10492002-06-30 Akim Demaille <akim@epita.fr>
1050
1051 * src/symtab.c (symbol_new): Initialize the `printer' member.
1052
8a731ca8
AD
10532002-06-30 Akim Demaille <akim@epita.fr>
1054
1055 * src/LR0.c (save_reductions): Remove, replaced by...
1056 * src/state.h, src/state.c (state_reductions_set): New.
1057 (reductions, errs): Rename as...
1058 (reductions_t, errs_t): these.
1059 Adjust all dependencies.
1060
32e1e0a4
AD
10612002-06-30 Akim Demaille <akim@epita.fr>
1062
1063 * src/LR0.c (state_list_t, state_list_append): New.
1064 (first_state, last_state): Now symbol_list_t.
1065 (this_state): Remove.
1066 (new_itemsets, append_states, save_reductions): Take a state_t as
1067 argument.
1068 (set_states, generate_states): Adjust.
1069 (save_shifts): Remove, replaced by...
1070 * src/state.h, src/state.c (state_shifts_set): New.
1071 (shifts): Rename as...
1072 (shifts_t): this.
1073 Adjust all dependencies.
1074 * src/state.h (state_t): Remove the `next' member.
1075
e5fb6710
AD
10762002-06-30 Akim Demaille <akim@epita.fr>
1077
1078 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
1079 escaped in slot 0.
1080
c7ca99d4
AD
10812002-06-30 Akim Demaille <akim@epita.fr>
1082
1083 Use hash.h for the state hash table.
1084
1085 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
1086 (allocate_storage): Use state_hash_new.
1087 (free_storage): Use state_hash_free.
1088 (new_state, get_state): Adjust.
1089 * src/lalr.h, src/lalr.c (states): Move to...
1090 * src/states.h (state_t): Remove the `link' member, no longer
1091 used.
1092 * src/states.h, src/states.c: here.
1093 (state_hash_new, state_hash_free, state_hash_lookup)
1094 (state_hash_insert, states_free): New.
1095 * src/states.c (state_table, state_compare, state_hash): New.
1096 * src/output.c (output_actions): Do not free states now, since we
1097 still need to know the final_state number in `prepare', called
1098 afterwards. Do it...
1099 * src/main.c (main): here: call states_free after `output'.
1100
df0e7316
AD
11012002-06-30 Akim Demaille <akim@epita.fr>
1102
1103 * src/state.h, src/state.c (state_new): New, extracted from...
1104 * src/LR0.c (new_state): here.
1105 * src/state.h (STATE_ALLOC): Move to...
1106 * src/state.c: here.
1107 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
1108 * src/state.h, src/state.c: here.
1109
39f41916
AD
11102002-06-30 Akim Demaille <akim@epita.fr>
1111
1112 * src/reader.c (gensym): Rename as...
1113 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
1114 (getsym): Rename as...
1115 (symbol_get): this.
1116
d57650a5
AD
11172002-06-30 Akim Demaille <akim@epita.fr>
1118
1119 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
1120 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
1121 * src/output.c, src/print.c, src/print_graph.c: Propagate.
1122 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
1123
5a08f1ce
AD
11242002-06-30 Akim Demaille <akim@epita.fr>
1125
1126 Make the test suite pass with warnings checked.
1127
1128 * tests/actions.at (Printers and Destructors): Improve.
1129 Avoid unsigned vs. signed issues.
1130 * tests/calc.at: Don't exercise the scanner here, do it...
1131 * tests/input.at (Torturing the Scanner): here.
1132
720623af
PH
11332002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1134
88e7e941 1135 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
1136 reorganize first lines parallel to yacc.c.
1137
fb8135fa
AD
11382002-06-28 Akim Demaille <akim@epita.fr>
1139
1140 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
1141 (b4_token_enum, b4_token_defines): New, factored from...
1142 * data/lalr1.cc, data/yacc.c, glr.c: here.
1143
41442480
AD
11442002-06-28 Akim Demaille <akim@epita.fr>
1145
1146 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
1147 unused variables.
1148 * src/output.c (merger_output): static.
1149
e0e5bf84
AD
11502002-06-28 Akim Demaille <akim@epita.fr>
1151
1152 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
1153 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
1154 pacify GCC.
1155 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 1156
676385e2
PH
11572002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1158
1159 Accumulated changelog for new GLR parsing features.
1160
6a254321 1161 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
1162 conflicts_total_count.
1163 * src/conflicts.h: Ditto.
1164 * src/output.c (token_actions): Use the new name.
1165 (output_conflicts): Change conflp => conflict_list_heads, and
1166 confl => conflict_list for better readability.
1167 * data/glr.c: Use the new names.
1168 * NEWS: Add self to GLR announcement.
e0e5bf84 1169
676385e2
PH
1170 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
1171
1172 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
1173 Akim Demaille.
1174
1175 * data/bison.glr: Change name to glr.c
1176 * data/glr.c: Renamed from bison.glr.
1177 * data/Makefile.am: Add glr.c
e0e5bf84
AD
1178
1179 * src/getargs.c:
1180
676385e2
PH
1181 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
1182 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 1183
676385e2
PH
1184 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1185
1186 * data/bison.glr: Be sure to restore the
1187 current #line when returning to the skeleton contents after having
1188 exposed the input file's #line.
1189
1190 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1191
1192 * data/bison.glr: Bring up to date with changes to bison.simple.
1193
1194 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1195
1196 * data/bison.glr: Correct definitions that use b4_prefix.
1197 Various reformatting.
1198 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
1199 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
1200 yytokenp argument; now part of stack.
1201 (yychar): Define to behave as documented.
1202 (yyclearin): Ditto.
e0e5bf84 1203
676385e2
PH
1204 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1205
1206 * src/reader.h: Add declaration for free_merger_functions.
1207
1208 * src/reader.c (merge_functions): New variable.
1209 (get_merge_function): New function.
1210 (free_merger_functions): New function.
1211 (readgram): Check for %prec that is not followed by a symbol.
1212 Handle %dprec and %merge declarations.
1213 (packgram): Initialize dprec and merger fields in rules array.
1214
1215 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
1216 conflict_list_cnt, conflict_list_free): New variables.
1217 (table_grow): Also grow conflict_table.
e0e5bf84 1218 (prepare_rules): Output dprec and merger tables.
676385e2 1219 (conflict_row): New function.
e0e5bf84 1220 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
1221 default reduction in conflicted states for GLR parser so that there
1222 are spaces for the conflict lists.
1223 (save_row): Also save conflict information.
1224 (token_actions): Allocate conflict list.
1225 (merger_output): New function.
1226 (pack_vector): Pack conflict table, too.
1227 (output_conflicts): New function to output yyconflp and yyconfl.
1228 (output_check): Allocate conflict_tos.
1229 (output_actions): Output conflict tables, also.
1230 (output_skeleton): Output b4_mergers definition.
1231 (prepare): Output b4_max_rhs_length definition.
1232 Use 'bison.glr' as default skeleton for GLR parsers.
1233
1234 * src/gram.c (glr_parser): New flag.
1235 (grammar_free): Call free_merger_functions.
1236
1237 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
1238 all pairs of conflicting reductions, rather than just all tokens
1239 causing conflicts. Needed to size conflict tables.
e0e5bf84 1240 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
1241 interface.
1242 (conflicts_print): Ditto.
1243 (count_total_conflicts): New function.
1244
1245 * src/reader.h (merger_list): New type.
1246 (merge_functions): New variable.
1247
1248 * src/lex.h (tok_dprec, tok_merge): New token types.
1249
1250 * src/gram.h (rule_s): Add dprec and merger fields.
1251 (glr_parser): New flag.
1252
1253 * src/conflicts.h (count_total_conflicts): New function.
1254
1255 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
1256
1257 * doc/bison.texinfo (Generalized LR Parsing): New section.
1258 (GLR Parsers): New section.
1259 (Language and Grammar): Mention GLR parsing.
1260 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
1261 Correct typo ("tge" -> "the").
1262
1263 * data/bison.glr: New skeleton for GLR parsing.
1264
1265 * tests/cxx-gram.at: New tests for GLR parsing.
1266
1267 * tests/testsuite.at: Include cxx-gram.at.
1268
1269 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 1270
676385e2
PH
1271 * src/parse-gram.y:
1272
1273 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
1274
1275 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 1276
b5480d74 12772002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
1278
1279 * src/options.h, src/options.c: Remove.
1280 * src/getargs.c (short_options, long_options): New.
1281
60491a94
AD
12822002-06-27 Akim Demaille <akim@epita.fr>
1283
1284 * data/bison.simple, data/bison.c++: Rename as...
1285 * data/yacc.c, data/lalr1.cc: these.
1286 * doc/bison.texinfo (Environment Variables): Remove.
1287
9be0c25b
AD
12882002-06-25 Raja R Harinath <harinath@cs.umn.edu>
1289
1290 * src/getargs.c (report_argmatch): Initialize strtok().
1291
1ae72863
AD
12922002-06-20 Akim Demaille <akim@epita.fr>
1293
1294 * data/bison.simple (b4_symbol_actions): New, replaces...
1295 (b4_symbol_destructor, b4_symbol_printer): these.
1296 (yysymprint): Be sure to call YYPRINT only for tokens, and using
1297 user token numbers.
1298
87542d29
AD
12992002-06-20 Akim Demaille <akim@epita.fr>
1300
1301 * data/bison.simple (yydestructor): Rename as...
1302 (yydestruct): this.
1303
1a31ed21
AD
13042002-06-20 Akim Demaille <akim@epita.fr>
1305
1306 * src/symtab.h, src/symtab.c (symbol_type_set)
1307 (symbol_destructor_set, symbol_precedence_set): The location is
1308 the last argument.
1309 Adjust all callers.
1310
e776192e
AD
13112002-06-20 Akim Demaille <akim@epita.fr>
1312
1313 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
1314 internals.
1315 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
1316 Takes a location.
1317 * src/symtab.h, src/symtab.c (symbol_class_set)
1318 (symbol_user_token_number_set): Likewise.
1319 Adjust all callers.
1320 Promote complain_at.
1321 * tests/input.at (Type Clashes): Adjust.
1322
5c1180b3
AD
13232002-06-20 Akim Demaille <akim@epita.fr>
1324
1325 * data/bison.simple (YYLEX): Fix the declaration when
1326 %pure-parser.
1327
e3170060
AD
13282002-06-20 Akim Demaille <akim@epita.fr>
1329
1330 * data/bison.simple (yysymprint): Don't print the token number,
1331 just its name.
1332 * tests/actions.at (Destructors): Rename as...
1333 (Printers and Destructors): this.
1334 Also exercise %printer.
1335
253862fd
AD
13362002-06-20 Akim Demaille <akim@epita.fr>
1337
1338 * data/bison.simple (YYDSYMPRINT): New.
1339 Use it to remove many of the #if YYDEBUG/if (yydebug).
1340
366eea36
AD
13412002-06-20 Akim Demaille <akim@epita.fr>
1342
1343 * src/symtab.h, src/symtab.c (symbol_t): printer and
1344 printer_location are new members.
1345 (symbol_printer_set): New.
1346 * src/parse-gram.y (PERCENT_PRINTER): New token.
1347 Handle its associated rule.
1348 * src/scan-gram.l: Adjust.
1349 (handle_destructor_at, handle_destructor_dollar): Rename as...
1350 (handle_symbol_code_at, handle_symbol_code_dollar): these.
1351 * src/output.c (symbol_printers_output): New.
1352 (output_skeleton): Call it.
1353 * data/bison.simple (yysymprint): New. Cannot be named yyprint
1354 since there are already many grammar files with a user `yyprint'.
1355 Replace the calls to YYPRINT to calls to yysymprint.
1356 * tests/calc.at: Adjust.
1357 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
1358 taking advantage of parser very internal details (stack size!).
1359
4f25ebb0
AD
13602002-06-20 Akim Demaille <akim@epita.fr>
1361
1362 * src/scan-gram.l: Complete the scanner with the missing patterns
1363 to pacify Flex.
1364 Use `quote' and `symbol_tag_get' where appropriate.
1365
93b68a0e
AD
13662002-06-19 Akim Demaille <akim@epita.fr>
1367
1368 * tests/actions.at (Destructors): Augment to test locations.
1369 * data/bison.simple (yydestructor): Pass it the current location
1370 if locations are enabled.
1371 Prototype only when __STDC__ or C++.
1372 Change the argument names to move into the yy name space: there is
1373 user code here.
1374
58612f1d
AD
13752002-06-19 Akim Demaille <akim@epita.fr>
1376
74310291
AD
1377 * data/bison.simple (b4_pure_if): New.
1378 Use it instead of #ifdef YYPURE.
1379
13802002-06-19 Akim Demaille <akim@epita.fr>
1381
1382 * data/bison.simple (b4_location_if): New.
58612f1d
AD
1383 Use it instead of #ifdef YYLSP_NEEDED.
1384
f25bfb75
AD
13852002-06-19 Akim Demaille <akim@epita.fr>
1386
1387 Prepare @$ in %destructor, but currently don't bind it in the
1388 skeleton, as %location use is not cleaned up yet.
1389
1390 * src/scan-gram.l (handle_dollar, handle_destructor_at)
1391 (handle_action_at): New.
1392 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
1393 a braced_code_t and a location as additional arguments.
1394 (handle_destructor_dollar): Instead of requiring `b4_eval', just
1395 unquote one when outputting `b4_dollar_dollar'.
1396 Adjust callers.
1397 * data/bison.simple (b4_eval): Remove.
1398 (b4_symbol_destructor): Adjust.
1399 * tests/input.at (Invalid @n): Adjust.
1400
c732d2c6
AD
14012002-06-19 Zack Weinberg <zack@codesourcery.com>
1402
1403 * doc/bison.texinfo: Document ability to have multiple
1404 prologue sections.
1405
8c165d89
AD
14062002-06-18 Akim Demaille <akim@epita.fr>
1407
1408 * src/files.c (compute_base_names): When computing the output file
1409 names from the input file name, strip the directory part.
1410
ca98bf57
AD
14112002-06-18 Akim Demaille <akim@epita.fr>
1412
1413 * data/bison.simple.new: Comment changes.
1414 Reported by Andreas Schwab.
1415
0bfb02ff
AD
14162002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
1417
1418 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
1419 there are no `label `yyoverflowlab' defined but not used' warnings
1420 when yyoverflow is defined.
1421
24c0aad7
AD
14222002-06-18 Akim Demaille <akim@epita.fr>
1423
1424 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
1425 new member.
1426 (symbol_destructor_set): Adjust.
1427 * src/output.c (symbol_destructors_output): Output the destructor
1428 locations.
1429 Output the symbol name.
1430 * data/bison.simple (b4_symbol_destructor): Adjust.
1431
5719c109
AD
14322002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
1433 and Akim Demaille <akim@epita.fr>
1434
1435 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
1436 what's left on the stack when the error recovery hits EOF.
1437 * tests/actions.at (Destructors): Complete to exercise this case.
1438
9280d3ef
AD
14392002-06-17 Akim Demaille <akim@epita.fr>
1440
1441 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
1442 arguments is really empty, not only equal to `[]'.
1443 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
1444 member.
1445 (symbol_destructor_set): New.
1446 * src/output.c (symbol_destructors_output): New.
1447 * src/reader.h (brace_code_t, current_braced_code): New.
1448 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
1449 (handle_dollar): Rename as...
1450 (handle_action_dollar): this.
1451 (handle_destructor_dollar): New.
1452 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
1453 (grammar_declaration): Use it.
1454 * data/bison.simple (yystos): Is always defined.
1455 (yydestructor): New.
1456 * tests/actions.at (Destructors): New.
1457 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
1458
dafdc66f
AD
14592002-06-17 Akim Demaille <akim@epita.fr>
1460
1461 * src/symlist.h, src/symlist.c (symbol_list_length): New.
1462 * src/scan-gram.l (handle_dollar, handle_at): Compute the
1463 rule_length only when needed.
1464 * src/output.c (actions_output, token_definitions_output): Output
1465 the full M4 block.
1466 * src/symtab.c: Don't access directly to the symbol tag, use
1467 symbol_tag_get.
1468 * src/parse-gram.y: Use symbol_list_free.
1469
56c47203
AD
14702002-06-17 Akim Demaille <akim@epita.fr>
1471
1472 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
1473 (symbol_list_prepend, get_type_name): Move to...
1474 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
1475 (symbol_list_prepend, symbol_list_n_type_name_get): here.
1476 Adjust all callers.
1477 (symbol_list_free): New.
1478 * src/scan-gram.l (handle_dollar): Takes a location.
1479 * tests/input.at (Invalid $n): Adjust.
1480
1e0bab92
AD
14812002-06-17 Akim Demaille <akim@epita.fr>
1482
1483 * src/reader.h, src/reader.c (symbol_list_new): Export it.
1484 (symbol_list_prepend): New.
1485 * src/parse-gram.y (%union): `list' is a new member.
1486 (symbols.1): New, replaces...
1487 (terms_to_prec.1, nterms_to_type.1): these.
1488 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
1489 Take a location as additional argument.
1490 Adjust all callers.
1491
04e60654
AD
14922002-06-15 Akim Demaille <akim@epita.fr>
1493
1494 * src/parse-gram.y: Move %token in the declaration section so that
1495 we don't depend upon CVS Bison.
1496
10e5b8bd
AD
14972002-06-15 Akim Demaille <akim@epita.fr>
1498
1499 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
1500 * src/print.c (print_core): Use it.
1501
9801d40c
AD
15022002-06-15 Akim Demaille <akim@epita.fr>
1503
1504 * src/conflicts.c (log_resolution): Accept the rule involved in
1505 the sr conflicts instead of the lookahead number that points to
1506 that rule.
1507 (flush_reduce): Accept the current lookahead vector as argument,
1508 instead of the index in LA.
1509 (resolve_sr_conflict): Accept the current number of lookahead
1510 bitset to consider for the STATE, instead of the index in LA.
1511 (set_conflicts): Adjust.
1512 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
1513
c0263492
AD
15142002-06-15 Akim Demaille <akim@epita.fr>
1515
1516 * src/state.h (state_t): Replace the `lookaheadsp' member, a
1517 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
1518 Adjust all dependencies.
1519 * src/lalr.c (initialize_lookaheads): Split into...
1520 (states_lookaheads_count, states_lookaheads_initialize): these.
1521 (lalr): Adjust.
1522
9757c359
AD
15232002-06-15 Akim Demaille <akim@epita.fr>
1524
1525 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
1526 out of...
1527 (grammar_rules_print): here.
1528 * src/reduce.c (reduce_output): Use it.
1529 * tests/reduce.at (Useless Rules, Reduced Automaton)
1530 (Underivable Rules): Adjust.
1531
6b98e4b5
AD
15322002-06-15 Akim Demaille <akim@epita.fr>
1533
1534 Copy BYacc's nice way to report the grammar.
1535
1536 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
1537 New.
1538 Don't print the rules' location, it is confusing and useless.
1539 (rule_print): Use grammar_rhs_print.
1540 * src/print.c (print_grammar): Use grammar_rules_print.
1541
6b98e4b5
AD
15422002-06-15 Akim Demaille <akim@epita.fr>
1543
1544 Complete and rationalize `useless thing' warnings.
1545
1546 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
1547 (symbol_tag_print): New.
1548 Use them everywhere in place of accessing directly the tag member.
1549 * src/gram.h, src/gram.c (rule_print): New.
1550 Use it where a rule used to be printed `by hand'.
1551 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
1552 (reduce_grammar_tables): Report the useless rules.
1553 (reduce_print): Useless things are a warning, not an error.
1554 Report it as such.
1555 * tests/reduce.at (Useless Nonterminals, Useless Rules):
1556 (Reduced Automaton, Underivable Rules): Adjust.
1557 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
1558 * tests/conflicts.at (Unresolved SR Conflicts)
1559 (Solved SR Conflicts): Adjust.
1560
ee000ba4
AD
15612002-06-15 Akim Demaille <akim@epita.fr>
1562
1563 Let symbols have a location.
1564
1565 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
1566 (getsym): Adjust.
1567 Adjust all callers.
1568 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
1569 Use location_t, not int.
1570 * src/symtab.c (symbol_check_defined): Take advantage of the
1571 location.
1572 * tests/regression.at (Invalid inputs): Adjust.
1573
8efe435c
AD
15742002-06-15 Akim Demaille <akim@epita.fr>
1575
1576 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
1577 (input): Don't try to initialize yylloc here, do it in the
1578 scanner.
1579 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
1580 * src/gram.h (rule_t): Change line and action_line into location
1581 and action_location, of location_t type.
1582 Adjust all dependencies.
1583 * src/location.h, src/location.c (empty_location): New.
1584 * src/reader.h, src/reader.c (grammar_start_symbol_set)
1585 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
1586 (grammar_current_rule_symbol_append)
1587 (grammar_current_rule_action_append): Expect a location as argument.
1588 * src/reader.c (grammar_midrule_action): Adjust to attach an
1589 action's location as dummy symbol location.
1590 * src/symtab.h, src/symtab.c (startsymbol_location): New.
1591 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
1592 the line numbers.
1593
1921f1d7
AD
15942002-06-14 Akim Demaille <akim@epita.fr>
1595
1596 Grammar declarations may be found in the grammar section.
1597
1598 * src/parse-gram.y (rules_or_grammar_declaration): New.
1599 (declarations): Each declaration may end with a semicolon, not
1600 just...
1601 (grammar_declaration): `"%union"'.
1602 (grammar): Branch to rules_or_grammar_declaration.
1603
4515534c
AD
16042002-06-14 Akim Demaille <akim@epita.fr>
1605
1606 * src/main.c (main): Invoke scanner_free.
1607
f958596b
AD
16082002-06-14 Akim Demaille <akim@epita.fr>
1609
1610 * src/output.c (m4_invoke): Extracted from...
1611 (output_skeleton): here.
1612 Free tempfile.
1613
2c569025
AD
16142002-06-14 Akim Demaille <akim@epita.fr>
1615
1616 * src/parse-gram.y (directives, directive, gram)
1617 (grammar_directives, precedence_directives, precedence_directive):
1618 Rename as...
1619 (declarations, declaration, grammar, grammar_declaration)
1620 (precedence_declaration, precedence_declarator): these.
1621 (symbol_declaration): New.
1622
592e8d4d
AD
16232002-06-14 Akim Demaille <akim@epita.fr>
1624
1625 * src/files.c (action_obstack): Remove, unused.
1626 (output_obstack): Remove it, and all its dependencies, as it is no
1627 longer needed.
1628 * src/reader.c (epilogue_set): Build the epilogue in the
1629 muscle_obstack.
1630 * src/output.h, src/output.c (muscle_obstack): Move to...
1631 * src/muscle_tab.h, src/muscle_tab.h: here.
1632 (muscle_init): Initialize muscle_obstack.
1633 (muscle_free): New.
1634 * src/main.c (main): Call it.
1635
0c15323d
AD
16362002-06-14 Akim Demaille <akim@epita.fr>
1637
1638 * src/location.h: New, extracted from...
1639 * src/reader.h: here.
1640 * src/Makefile.am (noinst_HEADERS): Merge into
1641 (bison_SOURCES): this.
1642 Add location.h.
1643 * src/parse-gram.y: Use location_t instead of Bison's.
1644 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
1645 Use location_t instead of ints.
1646
e96c9728
AD
16472002-06-14 Akim Demaille <akim@epita.fr>
1648
1649 * data/bison.simple, data/bison.c++: Be sure to restore the
1650 current #line when returning to the skeleton contents after having
1651 exposed the input file's #line.
1652
75d1fe16
AD
16532002-06-12 Akim Demaille <akim@epita.fr>
1654
1655 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
1656 eager.
1657 * tests/actions.at (Exotic Dollars): New.
1658
6c35d22c
AD
16592002-06-12 Akim Demaille <akim@epita.fr>
1660
1661 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
1662 ['"/] too eagerly.
1663 * tests/input.at (Torturing the Scanner): New.
1664
1d6412ad
AD
16652002-06-11 Akim Demaille <akim@epita.fr>
1666
1667 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
1668 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
1669 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
1670 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
1671 * src/reader.c (reader): Use it.
1672
4cdb01db
AD
16732002-06-11 Akim Demaille <akim@epita.fr>
1674
1675 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
1676 Adjust all callers.
1677 (scanner_last_string_free): New.
1678
44995b2e
AD
16792002-06-11 Akim Demaille <akim@epita.fr>
1680
1681 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
1682 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
1683 (last_string, YY_OBS_FREE): New.
1684 Use them when returning an ID.
1685
e9955c83
AD
16862002-06-11 Akim Demaille <akim@epita.fr>
1687
1688 Have Bison grammars parsed by a Bison grammar.
1689
1690 * src/reader.c, src/reader.h (prologue_augment): New.
1691 * src/reader.c (copy_definition): Remove.
1692
1693 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
1694 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
1695 (grammar_current_rule_prec_set, grammar_current_rule_check)
1696 (grammar_current_rule_symbol_append)
1697 (grammar_current_rule_action_append): Export.
1698 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
1699 (symbol_list_action_append): Remove.
1700 Hook the routines from reader.
1701 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
1702 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
1703
1704 * src/reader.c (read_declarations): Remove, unused.
1705
1706 * src/parse-gram.y: Handle the epilogue.
1707 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
1708 (grammar_start_symbol_set): this.
1709 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
1710 * src/reader.c (readgram): Remove, unused.
1711 (reader): Adjust to insert eoftoken and axiom where appropriate.
1712
1713 * src/reader.c (copy_dollar): Replace with...
1714 * src/scan-gram.h (handle_dollar): this.
1715 * src/parse-gram.y: Remove `%thong'.
1716
1717 * src/reader.c (copy_at): Replace with...
1718 * src/scan-gram.h (handle_at): this.
1719
1720 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
1721 New.
1722
1723 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
1724 time being.
1725
1726 * src/reader.h, src/reader.c (grammar_rule_end): New.
1727
1728 * src/parse.y (current_type, current_class): New.
1729 Implement `%nterm', `%token' support.
1730 Merge `%term' into `%token'.
1731 (string_as_id): New.
1732 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
1733 type name.
1734
1735 * src/parse-gram.y: Be sure to handle properly the beginning of
1736 rules.
1737
1738 * src/parse-gram.y: Handle %type.
1739 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
1740
1741 * src/parse-gram.y: More directives support.
1742 * src/options.c: No longer handle source directives.
1743
1744 * src/parse-gram.y: Fix %output.
1745
1746 * src/parse-gram.y: Handle %union.
1747 Use the prologue locations.
1748 * src/reader.c (parse_union_decl): Remove.
1749
1750 * src/reader.h, src/reader.c (epilogue_set): New.
1751 * src/parse-gram.y: Use it.
1752
1753 * data/bison.simple, data/bison.c++: b4_stype is now either not
1754 defined, then default to int, or to the contents of %union,
1755 without `union' itself.
1756 Adjust.
1757 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
1758
1759 * src/output.c (actions_output): Don't output braces, as they are
1760 already handled by the scanner.
1761
1762 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
1763 characters to themselves.
1764
1765 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
1766 that the epilogue has a proper #line.
1767
1768 * src/parse-gram.y: Handle precedence/associativity.
1769
1770 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
1771 a terminal.
1772 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
1773 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
1774 at all to define terminals that cannot be emitted.
1775
1776 * src/scan-gram.l: Escape M4 characters.
1777
1778 * src/scan-gram.l: Working properly with escapes in user
1779 strings/characters.
1780
1781 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
1782 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
1783 grammar.
1784 Use more modest sizes, as for the time being the parser does not
1785 release memory, and therefore the process swallows a huge amount
1786 of memory.
1787
1788 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
1789 stricter %token grammar.
1790
1791 * src/symtab.h (associativity): Add `undef_assoc'.
1792 (symbol_precedence_set): Do nothing when passed an undef_assoc.
1793 * src/symtab.c (symbol_check_alias_consistence): Adjust.
1794
1795 * tests/regression.at (Invalid %directive): Remove, as it is now
1796 meaningless.
1797 (Invalid inputs): Adjust to the new error messages.
1798 (Token definitions): The new grammar doesn't allow too many
1799 eccentricities.
1800
1801 * src/lex.h, src/lex.c: Remove.
1802 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
1803 (copy_character, copy_string2, copy_string, copy_identifier)
1804 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
1805 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
1806 (parse_action): Remove.
1807 * po/POTFILES.in: Adjust.
1808
2e047461
AD
18092002-06-11 Akim Demaille <akim@epita.fr>
1810
1811 * src/reader.c (parse_action): Don't store directly into the
1812 rule's action member: return the action as a string.
1813 Don't require `rule_length' as an argument: compute it.
1814 (grammar_current_rule_symbol_append)
1815 (grammar_current_rule_action_append): New, eved out from
1816 (readgram): here.
1817 Remove `action_flag', `rulelength', unused now.
1818
9af3fbce
AD
18192002-06-11 Akim Demaille <akim@epita.fr>
1820
1821 * src/reader.c (grammar_current_rule_prec_set).
1822 (grammar_current_rule_check): New, eved out from...
1823 (readgram): here.
1824 Remove `xaction', `first_rhs': useless.
1825 * tests/input.at (Type clashes): New.
1826 * tests/existing.at (GNU Cim Grammar): Adjust.
1827
1485e106
AD
18282002-06-11 Akim Demaille <akim@epita.fr>
1829
1830 * src/reader.c (grammar_midrule_action): New, Eved out from
1831 (readgram): here.
1832
da4160c3
AD
18332002-06-11 Akim Demaille <akim@epita.fr>
1834
1835 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1836 New.
1837 (readgram): Use them as replacement of inlined code, crule and
1838 crule1.
1839
f6d0f937
AD
18402002-06-11 Akim Demaille <akim@epita.fr>
1841
1842 * src/reader.c (grammar_end, grammar_symbol_append): New.
1843 (readgram): Use them.
1844 Make the use of `p' as local as possible.
1845
69078d4b
AD
18462002-06-10 Akim Demaille <akim@epita.fr>
1847
1848 GCJ's parser requires the tokens to be defined before the prologue.
1849
1850 * data/bison.simple: Output the token definition before the user's
1851 prologue.
1852 * tests/regression.at (Braces parsing, Duplicate string)
1853 (Mixing %token styles): Check the output from bison.
1854 (Early token definitions): New.
1855
5e424082
AD
18562002-06-10 Akim Demaille <akim@epita.fr>
1857
1858 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1859 assigning twice the same user number to a token, so that we can
1860 use it in...
1861 * src/lex.c (lex): here.
1862 Also use `symbol_class_set' instead of hand written code.
1863 * src/reader.c (parse_assoc_decl): Likewise.
1864
44536b35
AD
18652002-06-10 Akim Demaille <akim@epita.fr>
1866
1867 * src/symtab.c, src/symtab.c (symbol_class_set)
1868 (symbol_user_token_number_set): New.
1869 * src/reader.c (parse_token_decl): Use them.
1870 Use a switch instead of ifs.
1871 Use a single argument.
1872
8b9f2372
AD
18732002-06-10 Akim Demaille <akim@epita.fr>
1874
1875 Remove `%thong' support as it is undocumented, unused, duplicates
1876 `%token's job, and creates useless e-mail traffic with people who
1877 want to know what it is, why it is undocumented, unused, and
1878 duplicates `%token's job.
1879
1880 * src/reader.c (parse_thong_decl): Remove.
1881 * src/options.c (option_table): Remove "thong".
1882 * src/lex.h (tok_thong): Remove.
1883
3ae2b51f
AD
18842002-06-10 Akim Demaille <akim@epita.fr>
1885
1886 * src/symtab.c, src/symtab.c (symbol_type_set)
1887 (symbol_precedence_set): New.
1888 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
1889 (value_components_used): Remove, unused.
1890
2f1afb73
AD
18912002-06-09 Akim Demaille <akim@epita.fr>
1892
1893 Move symbols handling code out of the reader.
1894
1895 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
1896 (axiom): Move to...
1897 * src/symtab.h, src/symtab.c: here.
1898
1899 * src/gram.c (start_symbol): Remove: use startsymbol->number.
1900 * src/reader.c (startval): Rename as...
1901 * src/symtab.h, src/symtab.c (startsymbol): this.
1902 * src/reader.c: Adjust.
1903
1904 * src/reader.c (symbol_check_defined, symbol_make_alias)
1905 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1906 (token_translations_init)
1907 Move to...
1908 * src/symtab.c: here.
1909 * src/reader.c (packsymbols): Move to...
1910 * src/symtab.h, src/symtab.c (symbols_pack): here.
1911 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
1912 argument.
1913
e9bca3ad
AD
19142002-06-03 Akim Demaille <akim@epita.fr>
1915
1916 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
1917 then statements.
1918
86eff183
AD
19192002-06-03 Akim Demaille <akim@epita.fr>
1920
1921 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1922 structs with non literals.
1923 * src/scan-skel.l: never-interactive.
1924 * src/conflicts.c (enum conflict_resolution_e): No trailing
1925 comma.
1926 * src/getargs.c (usage): Split long literal strings.
1927 Reported by Hans Aberg.
1928
717be197
AD
19292002-05-28 Akim Demaille <akim@epita.fr>
1930
1931 * data/bison.c++: Use C++ ostreams.
1932 (cdebug_): New member.
1933
670ddffd
AD
19342002-05-28 Akim Demaille <akim@epita.fr>
1935
1936 * src/output.c (output_skeleton): Be sure to allocate enough room
1937 for `/' _and_ for `\0' in full_skeleton.
1938
769b430f
AD
19392002-05-28 Akim Demaille <akim@epita.fr>
1940
1941 * data/bison.c++: Catch up with bison.simple:
1942 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1943 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1944 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1945 and popping traces.
1946
7067cb36
PH
19472002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1948
1949 * src/output.c (output_skeleton): Put an explicit path in front of
1950 the skeleton file name, rather than relying on the -I directory,
1951 to partially alleviate effects of having a skeleton file lying around
1952 in the current directory.
769b430f 1953
4a713ec2
PH
19542002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1955
769b430f 1956 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
1957 obstack_printf should be obstack_fgrow1.
1958
b408954b
AD
19592002-05-26 Akim Demaille <akim@epita.fr>
1960
1961 * src/state.h (state_t): `solved_conflicts' is a new member.
1962 * src/LR0.c (new_state): Set it to 0.
1963 * src/conflicts.h, src/conflicts.c (print_conflicts)
1964 (free_conflicts, solve_conflicts): Rename as...
1965 (conflicts_print, conflicts_free, conflicts_solve): these.
1966 Adjust callers.
1967 * src/conflicts.c (enum conflict_resolution_e)
1968 (solved_conflicts_obstack): New, used by...
1969 (log_resolution): this.
1970 Adjust to attach the conflict resolution to each state.
1971 Complete the description with the precedence/associativity
1972 information.
1973 (resolve_sr_conflict): Adjust.
1974 * src/print.c (print_state): Output its solved_conflicts.
1975 * tests/conflicts.at (Unresolved SR Conflicts)
1976 (Solved SR Conflicts): Exercise --report=all.
1977
a49aecd5
AD
19782002-05-26 Akim Demaille <akim@epita.fr>
1979
1980 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1981 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1982 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1983 (token_number_t, item_number_as_token_number)
1984 (token_number_as_item_number, muscle_insert_token_number_table):
1985 Rename as...
1986 (symbol_number_t, item_number_as_symbol_number)
1987 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1988 these, since it is more appropriate.
1989
5504898e
AD
19902002-05-26 Akim Demaille <akim@epita.fr>
1991
1992 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1993 `Error:' lines.
1994 * data/bison.simple (yystos) [YYDEBUG]: New.
1995 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1996 error recovery.
1997 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1998
ec3bc396
AD
19992002-05-25 Akim Demaille <akim@epita.fr>
2000
2001 * doc/bison.texinfo (Debugging): Split into...
2002 (Tracing): this new section, its former contents, and...
2003 (Understanding): this new section.
2004 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
2005 by...
2006 (report_flag): this.
2007 Adjust all dependencies.
2008 (report_args, report_types, report_argmatch): New.
2009 (usage, getargs): Report/support -r, --report.
2010 * src/options.h
2011 (struct option_table_struct): Rename as..,
2012 (struct option_table_s): this.
2013 Rename the `set_flag' member to `flag' to match with getopt_long's
2014 struct.
2015 * src/options.c (option_table): Split verbose into an entry for
2016 %verbose, and another for --verbose.
2017 Support --report/-r, so remove -r from the obsolete --raw.
2018 * src/print.c: Attach full item sets and lookaheads reports to
2019 report_flag instead of trace_flag.
2020 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2021
78df8250
PE
20222002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2023 and Paul Eggert <eggert@twinsun.com>
769b430f 2024
78df8250
PE
2025 * data/bison.simple (yyparse): Correct error handling to conform to
2026 POSIX and yacc. Specifically, after syntax error is discovered,
2027 do not reduce further before shifting the error token.
2028 Clean up the code a bit by removing the labels yyerrdefault,
2029 yyerrhandle, yyerrpop.
2030 * NEWS: Document the above.
2031
c0c9ea05
PH
20322002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2033
2034 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
2035 type; it isn't always big enough, since it doesn't necessarily
2036 include non-terminals.
769b430f 2037 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
2038 the latter can be removed.
2039 (yy_token_number_type): Remove, only one use.
2040 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
2041 don't use TokenNumberType as element type.
769b430f 2042
c0c9ea05
PH
2043 * tests/regression.at: Modify expected output to agree with change
2044 to yyr1 and yytranslate.
769b430f 2045
6390a83f
FK
20462002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
2047
2048 * src/reader.c (parse_action): Use copy_character instead of
2049 obstack_1grow.
2050
db7c8e9a
AD
20512002-05-13 Akim Demaille <akim@epita.fr>
2052
2053 * tests/regression.at (Token definitions): Prototype yylex and
2054 yyerror.
2055
fcc61800
PH
20562002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2057
158c687b 2058 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
2059 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
2060 32-bit arithmetic.
2061 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
2062
5683e9b2
AD
20632002-05-07 Akim Demaille <akim@epita.fr>
2064
2065 * tests/synclines.at: Be sure to prototype yylex and yyerror to
2066 avoid GCC warnings.
2067
0c2d3f4c
AD
20682002-05-07 Akim Demaille <akim@epita.fr>
2069
2070 Kill GCC warnings.
2071
2072 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
2073 over the RHS of each rule.
2074 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
2075 * src/state.h (state_t): Member `nitems' is unsigned short.
2076 * src/LR0.c (get_state): Adjust.
2077 * src/reader.c (packgram): Likewise.
2078 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
2079 `Type'.
2080 (muscle_insert_int_table): Remove, unused.
2081 (prepare_rules): Remove `max'.
2082
1565b720
AD
20832002-05-06 Akim Demaille <akim@epita.fr>
2084
2085 * src/closure.c (print_firsts): Display of the symbol tags.
2086 (bitmatrix_print): Move to...
2087 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
2088 here.
2089 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
2090
cfaee611
AD
20912002-05-06 Akim Demaille <akim@epita.fr>
2092
2093 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
2094 hash_do_for_each.
2095
458be8e0
AD
20962002-05-06 Akim Demaille <akim@epita.fr>
2097
2098 * src/LR0.c (new_state, get_state): Instead of using the global
2099 `kernel_size' and `kernel_base', have two new arguments:
2100 `core_size' and `core'.
2101 Adjust callers.
2102
a900a624
AD
21032002-05-06 Akim Demaille <akim@epita.fr>
2104
2105 * src/reader.c (packgram): No longer end `ritem' with a 0
2106 sentinel: it is not used.
2107
d4e7d3a1
AD
21082002-05-05 Akim Demaille <akim@epita.fr>
2109
2110 New experimental feature: display the lookaheads in the report and
2111 graph.
2112
2113 * src/print (print_core): When --trace-flag, display the rules
2114 lookaheads.
2115 * src/print_graph.c (print_core): Likewise.
2116 Swap the arguments.
2117 Adjust caller.
2118
39ceb25b
AD
21192002-05-05 Akim Demaille <akim@epita.fr>
2120
2121 * tests/torture.at (Many lookaheads): New test.
2122
5372019f
AD
21232002-05-05 Akim Demaille <akim@epita.fr>
2124
2125 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
2126 (GENERATE_MUSCLE_INSERT_TABLE): this.
2127 (output_int_table, output_unsigned_int_table, output_short_table)
2128 (output_token_number_table, output_item_number_table): Replace with...
2129 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
2130 (muscle_insert_short_table, muscle_insert_token_number_table)
2131 (muscle_insert_item_number_table): these.
2132 Adjust all callers.
2133 (prepare_tokens): Don't free `translations', since...
2134 * src/reader.h, src/reader.c (grammar_free): do it.
2135 Move to...
2136 * src/gram.h, src/gram.c (grammar_free): here.
2137 * data/bison.simple, data/bison.c++: b4_token_number_max is now
2138 b4_translate_max.
2139
5df5f6d5
AD
21402002-05-05 Akim Demaille <akim@epita.fr>
2141
2142 * src/output.c (output_unsigned_int_table): New.
2143 (prepare_rules): `i' is unsigned.
2144 `prhs', `rline', `r2' are unsigned int.
2145 Rename muscle `rhs_number_max' as `rhs_max'.
2146 Output muscles `prhs_max', `rline_max', and `r2_max'.
2147 Free rline and r1.
2148 * data/bison.simple, data/bison.c++: Adjust to use these muscles
2149 to compute types instead of constant types.
2150 * tests/regression.at (Web2c Actions): Adjust.
2151
b87f8b21
AD
21522002-05-04 Akim Demaille <akim@epita.fr>
2153
2154 * src/symtab.h (SALIAS, SUNDEF): Rename as...
2155 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
2156 Adjust dependencies.
2157 * src/output.c (token_definitions_output): Be sure not to output a
2158 `#define 'a'' when fed with `%token 'a' "a"'.
2159 * tests/regression.at (Token definitions): New.
2160
8bb936e4
PE
21612002-05-03 Paul Eggert <eggert@twinsun.com>
2162
2163 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
2164 for K&R C.
2165
21662002-05-03 gettextize <bug-gnu-gettext@gnu.org>
2167
2168 * Makefile.am (SUBDIRS): Remove intl.
2169 (EXTRA_DIST): Add config/config.rpath.
2170
53c71a12
AD
21712002-05-03 Akim Demaille <akim@epita.fr>
2172
2173 * data/bison.simple (m4_if): Don't output empty enums.
2174 And actually, output valid enum definitions :(.
2175
289dd0cf
AD
21762002-05-03 Akim Demaille <akim@epita.fr>
2177
2178 * configure.bat: Remove, completely obsolete.
2179 * Makefile.am (EXTRA_DIST): Adjust.
2180 Don't distribute config.rpath...
2181 * config/Makefile.am (EXTRA_DIST): Do it.
2182
db85e524
AD
21832002-05-03 Akim Demaille <akim@epita.fr>
2184
2185 * configure.in (GETTEXT_VERSION): New.
2186 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
2187
83ccf991
AD
21882002-05-03 Akim Demaille <akim@epita.fr>
2189
2190 * data/bison.simple (b4_token_enum): New.
2191 (b4_token_defines): Use it to output tokens both as #define and
2192 enums.
2193 Suggested by Paul Eggert.
2194 * src/output.c (token_definitions_output): Don't output spurious
2195 white spaces.
2196
1f418995
AD
21972002-05-03 Akim Demaille <akim@epita.fr>
2198
2199 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2200
45119f04
RA
22012002-05-02 Robert Anisko <robert@lrde.epita.fr>
2202
2203 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
2204 Update the stack class, give a try to deque as the default container.
2205
b2d52318
AD
22062002-05-02 Akim Demaille <akim@epita.fr>
2207
2208 * data/bison.simple (yyparse): Do not implement @$ = @1.
2209 (YYLLOC_DEFAULT): Adjust to do it.
2210 * doc/bison.texinfo (Location Default Action): Fix.
2211
3a8b4109
AD
22122002-05-02 Akim Demaille <akim@epita.fr>
2213
2214 * src/reader.c (parse_braces): Merge into...
2215 (parse_action): this.
2216
84614e13
AD
22172002-05-02 Akim Demaille <akim@epita.fr>
2218
2219 * configure.in (ALL_LINGUAS): Remove.
2220 * po/LINGUAS, hr.po: New.
2221
fdbcd8e2
AD
22222002-05-02 Akim Demaille <akim@epita.fr>
2223
2224 Remove the so called hairy (semantic) parsers.
2225
2226 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
2227 * src/gram.h, src/gram.c (semantic_parser): Remove.
2228 (rule_t): Remove the guard and guard_line members.
2229 * src/lex.h (token_t): remove tok_guard.
2230 * src/options.c (option_table): Remove %guard and %semantic_parser
2231 support.
2232 * src/output.c, src/output.h (guards_output): Remove.
2233 (prepare): Adjust.
2234 (token_definitions_output): Don't output the `T'
2235 tokens (???).
2236 (output_skeleton): Don't output the guards.
2237 * src/files.c, src/files.c (attrsfile): Remove.
2238 * src/reader.c (symbol_list): Remove the guard and guard_line
2239 members.
2240 Adjust dependencies.
2241 (parse_guard): Remove.
2242 * data/bison.hairy: Remove.
2243 * doc/bison.texinfo (Environment Variables): Remove occurrences of
2244 BISON_HAIRY.
2245
82b6cb3f
AD
22462002-05-02 Akim Demaille <akim@epita.fr>
2247
2248 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
2249 (parse_guard): Rename the formal argument `stack_offset' as
2250 `rule_length', which is more readable.
2251 Adjust callers.
2252 (copy_at, copy_dollar): Instead of outputting the hard coded
2253 values of $$, $n and so forth, output invocation to b4_lhs_value,
2254 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
2255 Note: this patch partially drops `semantic-parser' support: it
2256 always does `rule_length - n', where semantic parsers ought to
2257 always use `-n'.
82b6cb3f
AD
2258 * data/bison.simple, data/bison.c++ (b4_lhs_value)
2259 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
2260
6cbfbcc5
AD
22612002-05-02 Akim Demaille <akim@epita.fr>
2262
2263 * configure.in (AC_INIT): Bump to 1.49b.
2264 (AM_INIT_AUTOMAKE): Short invocation.
2265
b8548114
AD
22662002-05-02 Akim Demaille <akim@epita.fr>
2267
2268 Version 1.49a.
2269
c20cd1fa
AD
22702002-05-01 Akim Demaille <akim@epita.fr>
2271
2272 * src/skeleton.h: Remove.
2273
8a9566d4
AD
22742002-05-01 Akim Demaille <akim@epita.fr>
2275
2276 * src/skeleton.h: Fix the #endif.
2277 Reported by Magnus Fromreide.
2278
8c6d399a
PE
22792002-04-26 Paul Eggert <eggert@twinsun.com>
2280
2281 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
2282 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 2283 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 2284
2b7ed18a
RA
22852002-04-25 Robert Anisko <robert@lrde.epita.fr>
2286
2287 * src/scan-skel.l: Postprocess quadrigraphs.
2288
2289 * src/reader.c (copy_character): New function, used to output
2290 single characters while replacing `[' and `]' with quadrigraphs, to
2291 avoid troubles with M4 quotes.
2292 (copy_comment): Output characters with copy_character.
2293 (read_additionnal_code): Likewise.
2294 (copy_string2): Likewise.
2295 (copy_definition): Likewise.
2296
2297 * tests/calc.at: Exercise M4 quoting.
2298
34a89c50
AD
22992002-04-25 Akim Demaille <akim@epita.fr>
2300
2301 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
2302 between `!' and the command.
2303 Reported by Paul Eggert.
2304
0dd1580a
RA
23052002-04-24 Robert Anisko <robert@lrde.epita.fr>
2306
2307 * tests/calc.at: Exercise prologue splitting.
2308
2309 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
2310 `b4_post_prologue' instead of `b4_prologue'.
2311
2312 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
2313 muscles.
2314 (output): Free pre_prologue_obstack and post_prologue_obstack.
2315 * src/files.h, src/files.c (attrs_obstack): Remove.
2316 (pre_prologue_obstack, post_prologue_obstack): New.
2317 * src/reader.c (copy_definition): Add a parameter to specify the
2318 obstack to fill, instead of using attrs_obstack unconditionally.
2319 (read_declarations): Pass pre_prologue_obstack to copy_definition if
2320 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
2321
83c1796f
PE
23222002-04-23 Paul Eggert <eggert@twinsun.com>
2323
2324 * data/bison.simple: Remove unnecessary commentary and white
2325 space differences from 1_29-branch.
2326 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
2327
2328 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
2329 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
2330 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
2331 constructors or destructors.
2332
2333 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
2334
1207eeac
AD
23352002-04-23 Akim Demaille <akim@epita.fr>
2336
2337 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
2338 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
2339 location with columns.
2340 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
2341 All reported by Paul Eggert.
2342
78ab8f67
AD
23432002-04-22 Akim Demaille <akim@epita.fr>
2344
2345 * src/reduce.c (dump_grammar): Move to...
2346 * src/gram.h, src/gram.c (grammar_dump): here.
2347 Be sure to separate long item numbers.
2348 Don't read the members of a rule's prec if its nil.
2349
133c20e2
AD
23502002-04-22 Akim Demaille <akim@epita.fr>
2351
2352 * src/output.c (table_size, table_grow): New.
2353 (MAXTABLE): Remove, replace uses with table_size.
2354 (pack_vector): Instead of dying when the table is too big, grow it.
2355
9515e8a7
AD
23562002-04-22 Akim Demaille <akim@epita.fr>
2357
2358 * data/bison.simple (yyr1): Its type is that of a token number.
2359 * data/bison.c++ (r1_): Likewise.
2360 * tests/regression.at (Web2c Actions): Adjust.
2361
23c5a174
AD
23622002-04-22 Akim Demaille <akim@epita.fr>
2363
2364 * src/reader.c (token_translations_init): 256 is now the default
2365 value for the error token, i.e., it will be assigned another
2366 number if the user assigned 256 to one of her tokens.
2367 (reader): Don't force 256 to error.
2368 * doc/bison.texinfo (Symbols): Adjust.
2369 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
2370 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
2371 etc. instead of 10, 20, 30 (which was used to `jump' over error
2372 (256) and undefined (2)).
2373
5fbb0954
AD
23742002-04-22 Akim Demaille <akim@epita.fr>
2375
2376 Propagate more token_number_t.
2377
2378 * src/gram.h (token_number_as_item_number)
2379 (item_number_as_token_number): New.
2380 * src/output.c (GENERATE_OUTPUT_TABLE): New.
2381 Use it to create output_item_number_table and
2382 output_token_number_table.
2383 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2384 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
2385 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
2386 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
2387
4f940944
AD
23882002-04-22 Akim Demaille <akim@epita.fr>
2389
2390 * src/output.h, src/output.c (get_lines_number): Remove.
2391
3ded9a63
AD
23922002-04-19 Akim Demaille <akim@epita.fr>
2393
2394 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
2395 as Lex/Flex'.
2396 (Debugging): More details about enabling the debugging features.
2397 (Table of Symbols): Describe $$, $n, @$, and @n.
2398 Suggested by Tim Josling.
2399
e0c471a9
AD
24002002-04-19 Akim Demaille <akim@epita.fr>
2401
2402 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
2403
fecc10cd
AD
24042002-04-10 Akim Demaille <akim@epita.fr>
2405
2406 * src/system.h: Rely on HAVE_LIMITS_H.
2407 Suggested by Paul Eggert.
2408
51dec47b
AD
24092002-04-09 Akim Demaille <akim@epita.fr>
2410
2411 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
2412 full stderr, and strip it according to the bison options, instead
2413 of composing the error message from different bits.
2414 This makes it easier to check for several error messages.
2415 Adjust all the invocations.
2416 Add an invocation exercising the error token.
2417 Add an invocation demonstrating a stupid error message.
2418 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
2419 Adjust the tests.
2420 Error message are for stderr, not stdout.
2421
007a50a4
AD
24222002-04-09 Akim Demaille <akim@epita.fr>
2423
2424 * src/gram.h, src/gram.c (error_token_number): Remove, use
2425 errtoken->number.
2426 * src/reader.c (reader): Don't specify the user token number (2)
2427 for $undefined, as it uselessly prevents using it.
2428 * src/gram.h (token_number_t): Move to...
2429 * src/symtab.h: here.
2430 (state_t.number): Is a token_number_t.
2431 * src/print.c, src/reader.c: Use undeftoken->number instead of
2432 hard coded 2.
2433 (Even though this 2 is not the same as above: the number of the
2434 undeftoken remains being 2, it is its user token number which
2435 might not be 2).
2436 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
2437 `user_token_number_max'.
2438 Output `undef_token_number'.
2439 * data/bison.simple, data/bison.c++: Use them.
2440 Be sure to map invalid yylex return values to
2441 `undef_token_number'. This saves us from gratuitous SEGV.
2442
2443 * tests/conflicts.at (Solved SR Conflicts)
2444 (Unresolved SR Conflicts): Adjust.
2445 * tests/regression.at (Web2c Actions): Adjust.
2446
06446ccf
AD
24472002-04-08 Akim Demaille <akim@epita.fr>
2448
2449 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
2450 Adding #line.
2451 Remove the duplicate `typedefs'.
2452 (RhsNumberType): Fix the declaration and various other typos.
2453 Use __ofile__.
2454 * data/bison.simple: Use __ofile__.
2455 * src/scan-skel.l: Handle __ofile__.
2456
62a3e4f0
AD
24572002-04-08 Akim Demaille <akim@epita.fr>
2458
2459 * src/gram.h (item_number_t): New, the type of item numbers in
2460 RITEM. Note that it must be able to code symbol numbers as
2461 positive number, and the negation of rule numbers as negative
2462 numbers.
2463 Adjust all dependencies (pretty many).
2464 * src/reduce.c (rule): Remove this `short *' pointer: use
2465 item_number_t.
2466 * src/system.h (MINSHORT, MAXSHORT): Remove.
2467 Include `limits.h'.
2468 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
2469 (shortcpy): Remove.
2470 (MAXTABLE): Move to...
2471 * src/output.c (MAXTABLE): here.
2472 (prepare_rules): Use output_int_table to output rhs.
2473 * data/bison.simple, data/bison.c++: Adjust.
2474 * tests/torture.at (Big triangle): Move the limit from 254 to
2475 500.
2476 * tests/regression.at (Web2c Actions): Ajust.
2477
2478 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
2479 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
2480 passes, but produces negative #line number, once fixed, GCC is
2481 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
2482 C), it passes.
2483 * src/state.h (state_h): Code input lines on ints, not shorts.
2484
bb88b0fc
AD
24852002-04-08 Akim Demaille <akim@epita.fr>
2486
2487 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
2488 and then the grammar.
2489
9a636f47
AD
24902002-04-08 Akim Demaille <akim@epita.fr>
2491
2492 * src/system.h: No longer using strndup.
2493
680e8701
AD
24942002-04-07 Akim Demaille <akim@epita.fr>
2495
2496 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
2497 * src/output.c (output_table_data): Return the longest number.
2498 (prepare_tokens): Output `token_number_max').
2499 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
2500 New.
2501 Use them to define yy_token_number_type/TokenNumberType.
2502 Use this type for yytranslate.
2503 * tests/torture.at (Big triangle): Push the limit from 124 to
2504 253.
2505 * tests/regression.at (Web2c Actions): Adjust.
2506
817e9f41
AD
25072002-04-07 Akim Demaille <akim@epita.fr>
2508
2509 * tests/torture.at (Big triangle): New.
2510 (GNU AWK Grammar, GNU Cim Grammar): Move to...
2511 * tests/existing.at: here.
2512
5123689b
AD
25132002-04-07 Akim Demaille <akim@epita.fr>
2514
2515 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
2516 nritems.
2517 Adjust dependencies.
2518
f3849179
AD
25192002-04-07 Akim Demaille <akim@epita.fr>
2520
2521 * src/reader.c: Normalize increments to prefix form.
2522
bd02036a
AD
25232002-04-07 Akim Demaille <akim@epita.fr>
2524
2525 * src/reader.c, symtab.c: Remove debugging code.
2526
db8837cb
AD
25272002-04-07 Akim Demaille <akim@epita.fr>
2528
2529 Rename all the `bucket's as `symbol_t'.
2530
2531 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
2532 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
2533 * src/symtab.c, src/symtab.h (bucket): Rename as...
2534 (symbol_t): this.
2535 (symbol_list_new, bucket_check_defined, bucket_make_alias)
2536 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
2537 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2538 (buckets_new, buckets_free, buckets_do): Rename as...
2539 (symbol_list_new, symbol_check_defined, symbol_make_alias)
2540 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2541 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
2542 (symbols_new, symbols_free, symbols_do): these.
2543
72a23c97
AD
25442002-04-07 Akim Demaille <akim@epita.fr>
2545
2546 Use lib/hash for the symbol table.
2547
2548 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
2549 EOF.
2550 * src/lex.c (lex): Set the `number' member of new terminals.
2551 * src/reader.c (bucket_check_defined, bucket_make_alias)
2552 (bucket_check_alias_consistence, bucket_translation): New.
2553 (reader, grammar_free, readgram, token_translations_init)
2554 (packsymbols): Adjust.
2555 (reader): Number the predefined tokens.
2556 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
2557 for predefined tokens.
2558 * src/symtab.h (bucket): Remove all the hash table related
2559 members.
2560 * src/symtab.c (symtab): Replace by...
2561 (bucket_table): this.
2562 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2563 (buckets_new, buckets_do): New.
2564
280a38c3
AD
25652002-04-07 Akim Demaille <akim@epita.fr>
2566
2567 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
2568 (start_symbol, max_user_token_number, semantic_parser)
2569 (error_token_number): Initialize.
2570 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
2571 Initialize.
2572 (reader): Don't.
2573 (errtoken, eoftoken, undeftoken, axiom): Extern.
2574
03b31c0c
AD
25752002-04-07 Akim Demaille <akim@epita.fr>
2576
2577 * src/gram.h (rule_s): prec and precsym are now pointers
2578 to the bucket giving the priority/associativity.
2579 Member `associativity' removed: useless.
2580 * src/reduce.c, src/conflicts.c: Adjust.
2581
8b3df748
AD
25822002-04-07 Akim Demaille <akim@epita.fr>
2583
2584 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
2585 Properly escape the symbols' TAG when outputting them.
2586
e601aa1d
AD
25872002-04-07 Akim Demaille <akim@epita.fr>
2588
2589 * src/lalr.h (LA): Is a bitsetv, not bitset*.
2590
b0299a2e
AD
25912002-04-07 Akim Demaille <akim@epita.fr>
2592
2593 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
2594 (LArule): this, which is an array to rule_t*.
2595 * src/print.c, src/conflicts.c: Adjust.
2596
d7e1f00c
AD
25972002-04-07 Akim Demaille <akim@epita.fr>
2598
2599 * src/gram.h (rule_t): Rename `number' as `user_number'.
2600 `number' is a new member.
2601 Adjust dependencies.
2602 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
2603
cc9305dd
AD
26042002-04-07 Akim Demaille <akim@epita.fr>
2605
2606 As a result of the previous patch, it is no longer needed
2607 to reorder ritem itself.
2608
2609 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
2610
b0940840
AD
26112002-04-07 Akim Demaille <akim@epita.fr>
2612
2613 Be sure never to walk through RITEMS, but use only data related to
2614 the rules themselves. RITEMS should be banished.
2615
2616 * src/output.c (output_token_translations): Rename as...
2617 (prepare_tokens): this.
2618 In addition to `translate', prepare the muscles `tname' and
2619 `toknum', which were handled by...
2620 (output_rule_data): this.
2621 Remove, and move the remainder of its outputs into...
2622 (prepare_rules): this new routines, which also merges content from
2623 (output_gram): this.
2624 (prepare_rules): Be sure never to walk through RITEMS.
2625 (output_stos): Rename as...
2626 (prepare_stos): this.
2627 (output): Always invoke prepare_states, after all, just don't use it
2628 in the output if you don't need it.
2629
643a5994
AD
26302002-04-07 Akim Demaille <akim@epita.fr>
2631
2632 * src/LR0.c (new_state): Display `nstates' as the name of the
2633 newly created state.
2634 Adjust to initialize first_state and last_state if needed.
2635 Be sure to distinguish the initial from the final state.
2636 (new_states): Create the itemset of the initial state, and use
2637 new_state.
2638 * src/closure.c (closure): Now that the initial state has its
2639 items properly set, there is no need for a special case when
2640 creating `ruleset'.
2641
2642 As a result, now the rule 0, reducing to $axiom, is visible in the
2643 outputs. Adjust the test suite.
2644
2645 * tests/conflicts.at (Solved SR Conflicts)
2646 (Unresolved SR Conflicts): Adjust.
2647 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
2648 * tests/conflicts.at (S/R in initial): New.
2649
b4c4ccc2
AD
26502002-04-07 Akim Demaille <akim@epita.fr>
2651
2652 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
2653 the RHS of the rules.
2654 * src/output.c (output_gram): Likewise.
2655
bba97eb2
AD
26562002-04-07 Akim Demaille <akim@epita.fr>
2657
2658 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
2659 bucket.
2660 Adjust all dependencies.
2661 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
2662 `number' of the buckets too.
2663 * src/gram.h: Include `symtab.h'.
2664 (associativity): Move to...
2665 * src/symtab.h: here.
2666 No longer include `gram.h'.
2667
c3b407f4
AD
26682002-04-07 Akim Demaille <akim@epita.fr>
2669
2670 * src/gram.h, src/gram.c (rules_rhs_length): New.
2671 (ritem_longest_rhs): Use it.
2672 * src/gram.h (rule_t): `number' is a new member.
2673 * src/reader.c (packgram): Set it.
2674 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
2675 the end of `rules', and count them out of `nrules'.
2676 (reduce_output, dump_grammar): Adjust.
2677 * src/print.c (print_grammar): It is no longer needed to check for
2678 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
2679 * tests/reduce.at (Reduced Automaton): New test.
2680
11652ab3
AD
26812002-04-07 Akim Demaille <akim@epita.fr>
2682
2683 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
2684 lacking `+ 1' to nrules, Bison reported as useless a token if it
2685 was used solely to set the precedence of the last rule...
2686
26b23c1a
AD
26872002-04-07 Akim Demaille <akim@epita.fr>
2688
2689 * data/bison.c++, data/bison.simple: Don't output the current file
2690 name in #line, to avoid useless diffs between two identical
2691 outputs under different names.
2692
18bcecb0
AD
26932002-04-07 Akim Demaille <akim@epita.fr>
2694
2695 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
2696 Normalize loops to using `< nrules + 1', not `<= nrules'.
2697
fa770c86
AD
26982002-04-07 Akim Demaille <akim@epita.fr>
2699
2700 * TODO: Update.
2701
d9b739c3
AD
27022002-04-07 Akim Demaille <akim@epita.fr>
2703
2704 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
2705 bucket.value as bucket.number.
2706
99013900
AD
27072002-04-07 Akim Demaille <akim@epita.fr>
2708
2709 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
2710 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2711 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
2712 RHS, instead of being an index in RITEMS.
2713
e966383b
PE
27142002-04-04 Paul Eggert <eggert@twinsun.com>
2715
2716 * doc/bison.texinfo: Update copyright date.
2717 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
2718 (Symbols): Warn about running Bison in one character set,
2719 but compiling and/or running in an incompatible one.
2720 Warn about character code 256, too.
2721
27222002-04-03 Paul Eggert <eggert@twinsun.com>
2723
2724 * src/bison.data (YYSTACK_ALLOC): Depend on whether
2725 YYERROR_VERBOSE is nonzero, not whether it is defined.
2726
2727 Merge changes from bison-1_29-branch.
c307773e 2728
8d6c48b9
PE
27292002-03-20 Paul Eggert <eggert@twinsun.com>
2730
2731 Merge fixes from Debian bison_1.34-1.diff.
2732
2733 * configure.in (AC_PREREQ): 2.53.
2734
e53c6322
AD
27352002-03-20 Akim Demaille <akim@epita.fr>
2736
2737 * src/conflicts.c (log_resolution): Argument `resolution' is const.
2738
9ffbeca7
PE
27392002-03-19 Paul Eggert <eggert@twinsun.com>
2740
21db0b2a
PE
2741 * src/bison.simple (YYCOPY): New macro.
2742 (YYSTACK_RELOCATE): Use it.
2743 Remove Type arg; no longer needed. All callers changed.
2744 (yymemcpy): Remove; no longer needed.
2745
9ffbeca7
PE
2746 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
2747 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2748
642cb8f8
AD
27492002-03-19 Akim Demaille <akim@epita.fr>
2750
2751 Test and fix the #line outputs.
2752
2753 * tests/atlocal.at (GCC): New.
2754 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
2755 (Prologue synch line, ,%union synch line, Postprologue synch line)
2756 (Action synch line, Epilogue synch line): New tests.
2757 * src/reader.c (parse_union_decl): Define the muscle stype_line.
2758 * data/bison.simple, data/bison.c++: Use it.
2759
3c31a486
AD
27602002-03-19 Akim Demaille <akim@epita.fr>
2761
2762 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
2763 (Solved SR Conflicts, %expect not enough, %expect right)
2764 (%expect too much): Move to...
2765 * tests/conflicts.at: this new file.
2766
0d8bed56
AD
27672002-03-19 Akim Demaille <akim@epita.fr>
2768
2769 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2770 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
2771 that we can move to enums for instance.
2772 * src/output.c (token_definitions_output): Output a list of
2773 `token-name, token-number' instead of the #define.
2774 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
2775
9208d17f
AD
27762002-03-14 Akim Demaille <akim@epita.fr>
2777
2778 Use Gettext 0.11.1.
2779
af27eacb
RA
27802002-03-09 Robert Anisko <robert@lrde.epita.fr>
2781
2782 * data/bison.c++: Make the user able to add members to the generated
2783 parser by subclassing.
2784
9101a310
RA
27852002-03-05 Robert Anisko <robert@lrde.epita.fr>
2786
2787 * src/reader.c (read_additionnal_code): `c' should be an integer, not
2788 a character.
2789 Reported by Nicolas Tisserand and Nicolas Burrus.
2790
fff9bf0b
RA
27912002-03-04 Robert Anisko <robert@lrde.epita.fr>
2792
2793 * src/reader.c: Warn about lacking semi-colons, do not complain.
2794
64dba31e
RA
27952002-03-04 Robert Anisko <robert@lrde.epita.fr>
2796
2797 * data/bison.c++: Remove a debug line.
2798
374f5a14
RA
27992002-03-04 Robert Anisko <robert@lrde.epita.fr>
2800
2801 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
2802 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
2803 provide a default implementation.
2804
bfcf1f3a
AD
28052002-03-04 Akim Demaille <akim@epita.fr>
2806
2807 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
2808 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
2809 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
2810 * tests/semantic.at (Parsing Guards): Similarly.
2811 * src/reader.at (readgram): Complain if the last rule is not ended
2812 with a semi-colon.
2813
65ccf9fc
AD
28142002-03-04 Akim Demaille <akim@epita.fr>
2815
2816 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
2817 * src/closure.c: here.
2818 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
2819 RTC.
2820 * src/warshall.h, src/warshall.c: Remove.
2821 * tests/sets.at (Broken Closure): Adjust.
2822
d0039cbc
AD
28232002-03-04 Akim Demaille <akim@epita.fr>
2824
2825 * src/output.c (output_skeleton): tempdir is const.
2826 bytes_read is unused.
2827
345cea78
AD
28282002-03-04 Akim Demaille <akim@epita.fr>
2829
2830 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2831 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2832 Update.
2833 From Michael Hayes.
2834
564801f7
AD
28352002-03-04 Akim Demaille <akim@epita.fr>
2836
2837 * src/closure.c (closure): `r' is unused.
2838
e5352bc7
AD
28392002-03-04 Akim Demaille <akim@epita.fr>
2840
2841 * tests/sets.at (Broken Closure): Add the ending `;'.
2842 * src/reader.at (readgram): Complain if a rule is not ended with a
2843 semi-colon.
2844
914feea9
AD
28452002-03-04 Akim Demaille <akim@epita.fr>
2846
2847 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2848 (count_sr_conflicts): Use bitset_count.
2849 * src/reduce.c (inaccessable_symbols): Ditto.
2850 (bits_size): Remove.
2851 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2852
f0250de6
AD
28532002-03-04 Akim Demaille <akim@epita.fr>
2854
2855 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2856 * src/reduce.c: Remove the `bitset_zero's following the
2857 `bitset_create's, as now it is performed by the latter.
2858
ef017502
AD
28592002-03-04 Akim Demaille <akim@epita.fr>
2860
2861 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2862 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2863 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2864 latest sources from Michael.
2865
76514394
AD
28662002-03-04 Akim Demaille <akim@epita.fr>
2867
2868 * src/output.c (output): Don't free the grammar.
2869 * src/reader.c (grammar_free): New.
2870 * src/main.c (main): Call it and don't free symtab here.
2871
55024580
AD
28722002-03-04 Akim Demaille <akim@epita.fr>
2873
2874 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2875 before returning.
2876 Reported by Benoit Perrot.
2877
f9abaa2c
AD
28782002-03-04 Akim Demaille <akim@epita.fr>
2879
2880 Use bitset operations when possible, not loops over bits.
2881
2882 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
2883 bitset_or.
2884 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
2885 * src/reduce.c (useless_nonterminals): Formatting changes.
2886 * src/warshall.c (TC): Use bitset_or.
2887
0e721e75
AD
28882002-03-04 Akim Demaille <akim@epita.fr>
2889
2890 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
2891 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
2892 Ditto.
2893
0fb1ffb1
AD
28942002-03-04 Akim Demaille <akim@epita.fr>
2895
2896 * src/lalr.c (F): Now a bitset*.
2897 Adjust all dependencies.
2898
b86796bf
AD
28992002-03-04 Akim Demaille <akim@epita.fr>
2900
2901 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
2902 Adjust all dependencies.
2903
602bbf31
AD
29042002-03-04 Akim Demaille <akim@epita.fr>
2905
2906 * src/L0.c, src/LR0.h (nstates): Be size_t.
2907 Adjust comparisons (signed vs unsigned).
2908 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
2909 bitset*.
2910 Adjust all dependencies.
2911
d8a0245c
AD
29122002-03-04 Akim Demaille <akim@epita.fr>
2913
2914 * src/closure.c (firsts): Now, also a bitset.
2915 Adjust all dependencies.
2916 (varsetsize): Remove, now unused.
2917 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2918
34ba9743
AD
29192002-03-04 Akim Demaille <akim@epita.fr>
2920
2921 * src/print.c: Convert to use bitset.h, not hand coded iterations
2922 over ints.
2923
ed86e78c
AD
29242002-03-04 Akim Demaille <akim@epita.fr>
2925
2926 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2927
dfdb1797
AD
29282002-03-04 Akim Demaille <akim@epita.fr>
2929
2930 * src/closure.c (ruleset): Be a bitset.
2931 (rulesetsize): Remove.
2932
7086e707
AD
29332002-03-04 Akim Demaille <akim@epita.fr>
2934
2935 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2936 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2937 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2938 * src/closure.c (fderives): Be an array of bitsets.
2939
98254360
RA
29402002-02-28 Robert Anisko <robert@lrde.epita.fr>
2941
2942 * data/bison.c++: Merge the two generated headers. Insert a copyright
2943 notice in each output file.
2944
a75c057f
AD
29452002-02-28 Akim Demaille <akim@epita.fr>
2946
2947 * data/bison.c++: Copy the prologue of bison.simple to fetch
2948 useful M4 definitions, such as b4_header_guard.
2949
06b00abc
AD
29502002-02-25 Akim Demaille <akim@epita.fr>
2951
2952 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
2953 translator friendly scheme for the bgr
2954 copyright notice.
06b00abc 2955
70e7d534
AD
29562002-02-25 Akim Demaille <akim@epita.fr>
2957
2958 * src/output.c (header_output): Remove, now handled completely via
2959 M4.
2960
abe017f6
AD
29612002-02-25 Akim Demaille <akim@epita.fr>
2962
2963 * m4/m4.m4: New, from CVS Autoconf.
2964 * configure.in: Invoke it.
2965 * src/output.c (output_skeleton): Use its result instead of the
2966 hard coded name.
2967
381fb12e
AD
29682002-02-25 Akim Demaille <akim@epita.fr>
2969
2970 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2971 Fileutils 4.1.5.
2972 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2973 * src/output.c (output_skeleton): Use mkstemp to create a real
2974 temporary file.
2975 Move the filling of `skeleton' and its muscle to...
2976 (prepare): here.
2977 (output): Move the definition of the prologue muscle to...
2978 (prepare): here.
2979 * src/system.h (DEFAULT_TMPDIR): New.
2980
6f38107f
PE
29812002-02-14 Paul Eggert <eggert@twinsun.com>
2982
2983 Remove the support for C++ namespace cleanliness; it was
2984 causing more problems than it was curing, since it didn't work
2985 properly on some nonstandard C++ compilers. This can wait
2986 for a proper C++ parser.
2987
2988 * NEWS: Document this.
2989 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2990 of C++, as it's treated like C now.
2991 * src/bison.simple (YYSTD): Remove.
2992 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2993 Treat C++ just like Standard C instead of trying to support
2994 namespace cleanliness.
2995
80cce3da
AD
29962002-02-14 Akim Demaille <akim@epita.fr>
2997
2998 * tests/regression.at (else): Adjust to Andreas' change.
2999
842e8679
AD
30002002-02-14 Akim Demaille <akim@epita.fr>
3001
3002 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
3003
4bda3f10
AD
30042002-02-13 Andreas Schwab <schwab@suse.de>
3005
3006 * src/output.c (output_rule_data): Don't output NULL, it might
3007 not be defined yet.
3008
4162fa07 30092002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 3010
4162fa07
RA
3011 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
3012 (Copyright notice): Update.
b418ecd8 3013
bd16a5dc
AD
30142002-02-11 Akim Demaille <akim@epita.fr>
3015
3016 * tests/regression.at (%nonassoc and eof): Don't include
3017 nonportable headers.
3018
8d69a1a3
RA
30192002-02-08 Robert Anisko <robert@lrde.epita.fr>
3020
3021 * data/bison.c++: Correct error recovery. Make the user able to
3022 initialize the starting location.
3023
9b2d0677
AD
30242002-02-07 Akim Demaille <akim@epita.fr>
3025
3026 * tests/input.at: New.
3027
69e2658b
RA
30282002-02-07 Robert Anisko <robert@lrde.epita.fr>
3029
3030 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 3031 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
3032 directives around tables only needed for debugging.
3033
4aacc3a7
RA
30342002-02-07 Robert Anisko <robert@lrde.epita.fr>
3035
3036 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
3037 C++ parsers.
3038 (yy::b4_name::parse): Use print_.
3039
762a801e
RA
30402002-02-07 Robert Anisko <robert@lrde.epita.fr>
3041
3042 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
3043
4bb2bc3f
RA
30442002-02-07 Robert Anisko <robert@lrde.epita.fr>
3045
3046 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
3047 C++ parsers.
3048 (yy::b4_name::parse): Build verbose error messages, and use error_.
3049
6b45a3ca
RA
30502002-02-06 Robert Anisko <robert@lrde.epita.fr>
3051
3052 * data/bison.c++: Fix m4 quoting in comments.
3053
50997c6e
RA
30542002-02-06 Robert Anisko <robert@lrde.epita.fr>
3055
3056 * data/bison.c++: Adjust the parser code. Fix some muscles that were
3057 not expanded by m4.
3058
3f3eed27
AD
30592002-02-05 Akim Demaille <akim@epita.fr>
3060
3061 * data/bison.c++: Adjust to the M4 back end.
3062 More is certainly needed.
3063
be2a1a68
AD
30642002-02-05 Akim Demaille <akim@epita.fr>
3065
3066 Give a try to M4 as a back end.
3067
3068 * lib/readpipe.c: New, from wdiff.
3069 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
3070 BISON_HAIRY.
3071 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
3072 specific values. Now it is m4 that performs the lookup.
3073 * src/parse-skel.y: Remove.
3074 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
3075 * src/output.c (actions_output, guards_output)
3076 (token_definitions_output): No longer keeps track of the output
3077 line number, hence remove the second argument.
3078 (guards_output): Check against the guard member of a rule, not the
3079 action member.
3080 Adjust callers.
3081 (output_skeleton): Don't look for the skeleton location, let m4 do
3082 that.
3083 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
3084 file will be used.
3085 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
3086 (prepare): Given that for the time being changesyntax is not
3087 usable in M4, rename the muscles using `-' to `_'.
3088 Define `defines_flag', `output_parser_name' and `output_header_name'.
3089 * src/output.h (actions_output, guards_output)
3090 (token_definitions_output): Adjust prototypes.
3091 * src/scan-skel.l: Instead of scanning the skeletons, it now
3092 processes the output of m4: `__oline__' and `#output'.
3093 * data/bison.simple: Adjust to be used by M4(sugar).
3094 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
3095 to date.
3096 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
3097 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
3098 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
3099 shamelessly stolen from CVS Autoconf.
3100
beda758b
AD
31012002-02-05 Akim Demaille <akim@epita.fr>
3102
3103 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
3104 * configure.in: Check for the declarations of free and malloc.
3105 * src/muscle_tab.c: Adjust.
3106
5ece6d43
AD
31072002-02-05 Akim Demaille <akim@epita.fr>
3108
3109 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
3110 which have no values.
3111
5bb18f9a
AD
31122002-02-05 Akim Demaille <akim@epita.fr>
3113
3114 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
3115 * data/: here.
3116
894dd62e
PE
31172002-01-29 Paul Eggert <eggert@twinsun.com>
3118
3119 * src/bison.simple (YYSIZE_T): Do not define merely because
3120 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
3121 On some platforms, <alloca.h> does not declare YYSTD (size_t).
3122
82841af7
AD
31232002-01-27 Akim Demaille <akim@epita.fr>
3124
3125 Fix `%nonassoc and eof'.
3126
3127 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
3128 which were not properly copied! Replace
3129 memcpy (res->errs, src->errs, src->nerrs);
3130 with
3131 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
3132 !!!
3133 * tests/regression.at (%nonassoc and eof): Adjust to newest
3134 Autotest: `.' is not in the PATH.
3135
318b76e9
AD
31362002-01-27 Akim Demaille <akim@epita.fr>
3137
3138 * tests/sets.at (AT_EXTRACT_SETS): New.
3139 (Nullable): Use it.
3140 (Firsts): New.
3141
30d2f3d5
AD
31422002-01-26 Akim Demaille <akim@epita.fr>
3143
3144 * tests/actions.at, tests/calc.at, tests/headers.at,
3145 * tests/torture.at: Adjust to the newest Autotest which no longer
3146 forces `.' in the PATH.
3147
30f8c395
AD
31482002-01-25 Akim Demaille <akim@epita.fr>
3149
3150 * tests/regression.at (%nonassoc and eof): New.
3151 Suggested by Robert Anisko.
3152
29ae55f1
AD
31532002-01-24 Akim Demaille <akim@epita.fr>
3154
3155 Bison dumps core when trying to complain about broken input files.
3156 Reported by Cris van Pelt.
3157
3158 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
3159 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
3160 into...
3161 (Invalid inputs): Strengthen: exercise parse_percent_token.
3162
2b548aa6
RA
31632002-01-24 Robert Anisko <robert.anisko@epita.fr>
3164
3165 * src/Makefile.am: Add bison.c++.
3166 * src/bison.c++: New skeleton.
3167
bb0146c2
AD
31682002-01-21 Paolo Bonzini <bonzini@gnu.org>
3169
3170 * po/it.po: New.
3171
bec30531
AD
31722002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
3173
3174 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
3175
fc6edc45
MA
31762002-01-20 Marc Autret <marc@gnu.org>
3177
3178 * src/files.c (compute_output_file_names): Fix
3179
5e5d5415
MA
31802002-01-20 Marc Autret <marc@gnu.org>
3181
3182 * tests/output.at: New test.
3183 * src/files.c (compute_base_names): Don't map extensions when
3184 the YACC flag is set, use defaults.
3185 Reported by Evgeny Stambulchik.
3186
44ea3fbd
MA
31872002-01-20 Marc Autret <marc@gnu.org>
3188
bb0146c2 3189 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
3190 compilers as well (i.e. the vendor C compiler).
3191 Suggested by Albert Chin-A-Young.
3192
338963d1
TVH
31932002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
3194
3195 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
3196 canonical definition.
3197 * src/system.h: Use the canonical definition for PARAMS (avoids
3198 a conflict with the macro from lib/hash.h).
3199
c57b2479
AD
32002002-01-11 Akim Demaille <akim@epita.fr>
3201
3202 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 3203 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 3204
b85810ae
AD
32052002-01-09 Akim Demaille <akim@epita.fr>
3206
3207 * src/files.c, src/files.h (output_infix): New.
3208 (tab_extension): Remove.
3209 (compute_base_names): Compute the former, drop the latter.
3210 * src/output.c (prepare): Insert the muscles `output-infix', and
3211 `output-suffix'.
3212 * src/parse-skel.y (string, string.1): New.
3213 (section.header): Use it.
3214 (section.yacc): Remove.
3215 (prefix): Remove too.
3216 * src/scan-skel.l: Adjust.
3217 * src/bison.simple, src/bison.hairy: Adjust.
3218
cae60122
AD
32192002-01-09 Akim Demaille <akim@epita.fr>
3220
3221 * configure.in (WERROR_CFLAGS): Compute it.
3222 * src/Makefile.am (CFLAGS): Pass it.
3223 * tests/atlocal.in (CFLAGS): Idem.
3224 * src/files.c: Fix a few warnings.
3225 (get_extension_index): Remove, unused.
3226
ae404801
AD
32272002-01-08 Akim Demaille <akim@epita.fr>
3228
3229 * src/getargs.c (AS_FILE_NAME): New.
3230 (getargs): Use it to convert DOSish file names.
3231 * src/files.c (base_name): Rename as full_base_name to avoid
3232 clashes with `base_name ()'.
3233 (filename_split): New.
3234 (compute_base_names): N-th rewrite, using filename_split.
3235
22312b71
AD
32362002-01-08 Akim Demaille <akim@epita.fr>
3237
3238 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
3239 New, stolen from the Fileutils 4.1.
3240 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
3241 * configure.in: Check for the presence of memrchr, and of its
3242 prototype.
3243
a67cef01
TVH
32442002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
3245
3246 * lib/hash.h (__P): Added definition for this macro.
3247 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
3248 BUILT_SOURCES, to ensure they are generated first.
3249 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
3250 %error-verbose to allow bootstrapping with bison 1.30x.
3251
2b25d624
AD
32522002-01-06 Akim Demaille <akim@epita.fr>
3253
3254 * src/reader.c (parse_braces): Don't fetch the next char, the
3255 convention is to fetch on entry.
3256 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
3257 'switch' without a following semicolon.
3258 * tests/regression.at (braces parsing): New.
3259
3460813b
AD
32602002-01-06 Akim Demaille <akim@epita.fr>
3261
3262 Bison is dead wrong in its RR conflict reports.
3263
3264 * tests/torture.at (GNU Cim Grammar): New.
3265 * src/conflicts.c (count_rr_conflicts): Fix.
3266
73784c64
AD
32672002-01-06 Akim Demaille <akim@epita.fr>
3268
3269 Creating package.m4 from configure.ac causes too many problems.
3270
3271 * tests/Makefile.am (package.m4): Create it by hand,
3272 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
3273
25d81090
AD
32742002-01-06 Akim Demaille <akim@epita.fr>
3275
3276 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
3277 skeleton.h.
3278
a9b8959e
PE
32792002-01-04 Paul Eggert <eggert@twinsun.com>
3280
3281 * doc/bison.texinfo (Debugging):
3282 Remove YYSTDERR; it's no longer defined or used.
3283 Also, s/cstdio.h/cstdio/.
3284
25d81090
AD
32852002-01-03 Akim Demaille <akim@epita.fr>
3286
3287 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
3288
1109455c
AD
32892002-01-03 Akim Demaille <akim@epita.fr>
3290
3291 * src/parse-skel.y (process_skeleton): Don't bind the parser's
3292 tracing code to --trace, wait for a better --trace option, with
3293 args.
3294
7ea5e977
AD
32952002-01-03 Akim Demaille <akim@epita.fr>
3296
3297 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
3298 The ISO C++ standard is extremely clear about it: stderr is
3299 considered a macro, not a regular symbol (see table 94 `Header
3300 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
3301 Therefore std:: does not apply to it. It still does with fprintf.
3302 Also, s/cstdio.h/cstdio/.
3303
fab5b110
AD
33042002-01-03 Akim Demaille <akim@epita.fr>
3305
3306 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
3307 for non system headers.
3308
aed7fd9b
AD
33092002-01-02 Akim Demaille <akim@epita.fr>
3310
3311 Equip the skeleton chain with location tracking, runtime trace,
3312 pure parser and scanner.
3313
3314 * src/parse-skel.y: Request a pure parser, locations, and prefix
3315 renaming.
3316 (%union): Having several members with the same type does not help
3317 type mismatches, simplify.
3318 (YYPRINT, yyprint): New.
3319 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
3320 (skel_error): this.
3321 Handle locations.
3322 * src/scan-skel.l: Adjust to these changes.
3323 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
3324 (LOCATION_PRINT, skel_control_t): New.
3325
24fad99e
AD
33262001-12-30 Akim Demaille <akim@epita.fr>
3327
3328 * src/parse-skel.y: Get rid of the shift/reduce conflict:
3329 replace `gb' with BLANKS.
3330 * src/scan-skel.l: Adjust.
3331
a4b36db4
AD
33322001-12-30 Akim Demaille <akim@epita.fr>
3333
3334 * src/system.h: We don't need nor want bcopy.
3335 Throw away MS-DOS crap: we don't need getpid.
3336 * configure.in: We don't need strndup. It was even causing
3337 problems: because Flex includes the headers *before* us,
3338 _GNU_SOURCE is not defined by config.h, and therefore strndup was
3339 not visible.
3340 * lib/xstrndup.c: New.
3341 * src/scan-skel.l: Use it.
3342 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
3343 * src/parse-skel.y: Use %directives instead of #defines.
3344
1239777d
AD
33452001-12-30 Akim Demaille <akim@epita.fr>
3346
3347 * src/skeleton.h: New.
3348 * src/output.c (output_parser, output_master_parser): Remove, dead
3349 code.
3350 * src/output.h (get_lines_number, actions_output, guards_output)
3351 (token_definitions_output): Prototype them.
3352 * src/parse-skel.y: Add the license notice.
3353 Include output.h and skeleton.h.
3354 (process_skeleton): Returns void, and takes a single parameter.
3355 * src/scan-skel.l: Add the license notice.
3356 Include skeleton.h.
3357 Don't use %option yylineno: it seems that then Flex imagines
3358 REJECT has been used, and therefore it won't reallocate its
3359 buffers (which makes no other sense to me than a bug). It results
3360 in warnings for `unused: yy_flex_realloc'.
3361
9b3add5b
RA
33622001-12-30 Robert Anisko <robert.anisko@epita.fr>
3363
3364 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3365 (MUSCLE_INSERT_PREFIX): ...to there.
3366 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3367 (MUSCLE_INSERT_PREFIX): Move from here...
3368
3369 * src/bison.hairy: Add a section directive. Put braces around muscle
3370 names. This parser skeleton is still broken, but Bison should not
3371 choke on a bad muscle 'syntax'.
3372 * src/bison.simple: Add a section directive. Put braces around muscle
3373 names.
3374
3375 * src/files.h (strsuffix, stringappend): Add declarations.
3376 (tab_extension): Add declaration.
3377 (short_base_name): Add declaration.
3378
3379 * src/files.c (strsuffix, stringappend): No longer static. These
3380 functions are used in the skeleton parser.
3381 (tab_extension): New.
3382 (compute_base_names): Use the computations done in this function
fab5b110 3383 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
3384 names.
3385 (short_base_name): No longer static.
3386
3387 * src/output.c (output_skeleton): New.
3388 (output): Disable call to output_master_parser, and give a try to
3389 a new skeleton handling system.
3390 (guards_output, actions_output): No longer static.
3391 (token_definitions_output, get_lines_number): No longer static.
3392
3393 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
3394
fab5b110 3395 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
3396 parse-skel.y.
3397
3398 * src/parse-skel.y: New file.
3399 * src/scan-skel.l: New file.
3400
b5b61c61
AD
34012001-12-29 Akim Demaille <akim@epita.fr>
3402
3403 %name-prefix is broken.
3404
3405 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
3406 Adjust all dependencies.
3407 * tests/headers.at (export YYLTYPE): Strengthen this test: use
3408 %name-prefix.
3409
3410 Renaming yylval but not yylloc is not consistent. Now we do.
3411
3412 * src/bison.simple: Prefix yylloc if used.
3413 * doc/bison.texinfo (Decl Summary): Document that.
3414
8c9a50be
AD
34152001-12-29 Akim Demaille <akim@epita.fr>
3416
3417 * doc/bison.texinfo: Promote `%long-directive' over
3418 `%long_directive'.
3419 Remove all references to fixed-output-files, yacc is enough.
3420
d99361e6
AD
34212001-12-29 Akim Demaille <akim@epita.fr>
3422
3423 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
3424 user prologue. These are defaults.
3425 * tests/actions.at (Mid-rule actions): Make sure the user can
3426 define YYDEBUG and YYERROR_VERBOSE.
3427
b9cecb91
AD
34282001-12-29 Akim Demaille <akim@epita.fr>
3429
3430 * src/output.c (header_output): Don't forget to export YYLTYPE and
3431 yylloc.
3432 * tests/headers.at (export YYLTYPE): New, make sure it does.
3433 * tests/regression.at (%union and --defines, Invalid CPP headers):
3434 Move to...
3435 * tests/headers.at: here.
3436
aea13e97
AD
34372001-12-29 Akim Demaille <akim@epita.fr>
3438
3439 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
3440
931394cb
AD
34412001-12-29 Akim Demaille <akim@epita.fr>
3442
3443 * tests/actions.at (Mid-rule actions): Output on a single line
3444 instead of several.
3445
704a47c4
AD
34462001-12-29 Akim Demaille <akim@epita.fr>
3447
3448 * doc/bison.texinfo: Formatting changes.
3449
091e20bb
AD
34502001-12-29 Akim Demaille <akim@epita.fr>
3451
3452 Don't store the token defs in a muscle, just be ready to output it
3453 on command. Now possible via `symbols'. Fixes a memory leak.
3454
3455 * src/output.c (token_definitions_output): New.
3456 (output_parser, header_output): Use it.
3457 * src/reader.c (symbols_save): Remove.
3458
cce71710
AD
34592001-12-29 Akim Demaille <akim@epita.fr>
3460
3461 * src/bison.simple: Do not provide a default for YYSTYPE and
3462 YYLTYPE before the user's prologue. Otherwise it's hardly... a
3463 default.
3464
82c035a8
AD
34652001-12-29 Akim Demaille <akim@epita.fr>
3466
3467 Mid-rule actions are simply... ignored!
3468
3469 * src/reader.c (readgram): Be sure to attach mid-rule actions to
3470 the empty-rule associated to the dummy symbol, not to the host
3471 rule.
3472 * tests/actions.at (Mid-rule actions): New.
3473
8419d367
AD
34742001-12-29 Akim Demaille <akim@epita.fr>
3475
3476 Memory leak.
3477
3478 * src/reader.c (reader): Free grammar.
3479
375d5806
AD
34802001-12-29 Akim Demaille <akim@epita.fr>
3481
3482 Memory leak.
3483
3484 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
3485 since it allocates it for each state, although only one is needed.
3486 (allocate_storage): Do it here.
3487
f51cb8ff
AD
34882001-12-29 Akim Demaille <akim@epita.fr>
3489
3490 * src/options.h, src/options.c (create_long_option_table): Rename
3491 as...
3492 (long_option_table_new): this, with a clearer prototype.
3493 (percent_table): Remove, unused,
3494 * src/getargs.c (getargs): Adjust.
3495
29e88316
AD
34962001-12-29 Akim Demaille <akim@epita.fr>
3497
3498 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
3499 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
3500 as states.
3501
b9f71f19
AD
35022001-12-29 Akim Demaille <akim@epita.fr>
3503
3504 * src/lalr.c (build_relations): Rename `states' as `states1'.
3505 Sorry, I don't understand exactly what it is, no better name...
3506
1a2b5d37
AD
35072001-12-29 Akim Demaille <akim@epita.fr>
3508
3509 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
3510 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
3511 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
3512 as rules.
3513
1cca533e
AD
35142001-12-29 Akim Demaille <akim@epita.fr>
3515
3516 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
3517 ago.
3518
c03ae966
AD
35192001-12-29 Akim Demaille <akim@epita.fr>
3520
3521 * src/reader.c, src/reader.h (user_toknums): Remove.
3522 Adjust all users to use symbols[i]->user_token_number.
3523
5a670b1e
AD
35242001-12-29 Akim Demaille <akim@epita.fr>
3525
3526 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
3527 Adjust all users to use symbols[i]->prec or ->assoc.
3528
ad949da9
AD
35292001-12-29 Akim Demaille <akim@epita.fr>
3530
3531 * src/reader.c, src/reader.h (tags): Remove.
3532 Adjust all users to use symbols[i]->tag.
3533
0e78e603
AD
35342001-12-29 Akim Demaille <akim@epita.fr>
3535
3536 * src/gram.h, src/gram.c (symbols): New, similar to state_table
3537 and rule_table.
3538 * src/reader.c (packsymbols): Fill this table.
3539 Drop sprec.
3540 * src/conflicts.c (resolve_sr_conflict): Adjust.
3541 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
3542 single table.
3543 Use symbols[i]->tag instead of tags[i].
3544
213e640e
AD
35452001-12-29 Akim Demaille <akim@epita.fr>
3546
3547 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
3548 In addition, put a comment in there, to replace...
3549 * tests/regression.at (%union and C comments): Remove.
3550
e7b8bef1
AD
35512001-12-29 Akim Demaille <akim@epita.fr>
3552
3553 * tests/regression.at (Web2c Actions): Blindly move the actual
3554 output as expected output. The contents *seem* right to me, but I
3555 can't pretend reading perfectly parser tables... Nonetheless, all
3556 the other tests pass correctly, the table look OK, even though the
3557 presence of `$axiom' is to be noted: AFAICS it is useless (but
3558 harmless).
3559
b68e7744
AD
35602001-12-29 Akim Demaille <akim@epita.fr>
3561
3562 * src/reader.c (readgram): Don't add the rule 0 if there were no
3563 rules read. In other words, add it _after_ having performed
3564 grammar sanity checks.
3565 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
3566
78d5bae9
AD
35672001-12-29 Akim Demaille <akim@epita.fr>
3568
3569 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
3570 visible, and some states have now a different number.
3571
ff442794
AD
35722001-12-29 Akim Demaille <akim@epita.fr>
3573
3574 * src/reader.c (readgram): Bind the initial rule's lineno to that
3575 of the first rule.
3576 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
3577 (Solved SR Conflicts): Adjust rule 0's line number.
3578
610ab194
AD
35792001-12-29 Akim Demaille <akim@epita.fr>
3580
3581 Fix the `GAWK Grammar' failure.
3582
3583 * src/LR0.c (final_state): Initialize to -1 so that we do compute
3584 the reductions of the first state which was mistakenly confused
3585 with the final state because precisely final_state was initialized
3586 to 0.
3587 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
3588 now noticed by Bison.
3589 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
3590 have a reduction on $default.
3591
29d29c8f
AD
35922001-12-29 Akim Demaille <akim@epita.fr>
3593
3594 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
3595 rule line numbers.
3596 * src/closure.c (print_closure): Likewise.
3597 * src/derives.c (print_derives): Likewise.
3598 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
3599 now.
3600
7c6b64d0
AD
36012001-12-29 Akim Demaille <akim@epita.fr>
3602
3603 * src/lalr.c (lookaheads_print): New.
3604 (lalr): Call it when --trace-flag.
3605 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
3606 are dumped.
3607
3d4daee3
AD
36082001-12-29 Akim Demaille <akim@epita.fr>
3609
3610 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
3611 when walking through ritem, even via rule->rhs.
3612 * src/reduce.c (dump_grammar, useful_production, reduce_output)
3613 (useful_production, useless_nonterminals): Likewise.
3614 (reduce_grammar_tables): Likewise, plus update nritems.
3615 * src/nullable.c (set_nullable): Likewise.
3616 * src/lalr.c (build_relations): Likewise.
3617 * tests/sets.at (Nullable): Adjust.
3618 Fortunately, now, the $axiom is no longer nullable.
3619
9e7f6bbd
AD
36202001-12-29 Akim Demaille <akim@epita.fr>
3621
3622 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
3623 the 0-sentinel.
3624 * src/gram.c (ritem_longest_rhs): Likewise.
3625 * src/reduce.c (nonterminals_reduce): Likewise.
3626 * src/print_graph.c (print_graph): Likewise.
3627 * src/output.c (output_rule_data): Likewise.
3628 * src/nullable.c (set_nullable): Likewise.
3629
255ef638
AD
36302001-12-29 Akim Demaille <akim@epita.fr>
3631
3632 * src/output.c: Comment changes.
3633
0d8a7363
AD
36342001-12-27 Paul Eggert <eggert@twinsun.com>
3635
3636 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
3637 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
3638 Sparc, as they were causing more porting problems than the
3639 (minor) performance improvement was worth.
3640
3641 Also, catch up with 1.31's YYSTD.
3642
3db472b9
AD
36432001-12-27 Akim Demaille <akim@epita.fr>
3644
3645 * src/output.c (output_gram): Rely on nritems, not the
3646 0-sentinel. See below.
3647 Use -1 as separator, not 0.
3648 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
3649 Rely on -1 as separator in yyrhs, instead of 0.
3650 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
3651 twice `Now at end of input', therefore there are two lines less to
3652 expect.
3653
b365aa05
AD
36542001-12-27 Akim Demaille <akim@epita.fr>
3655
3656 * tests/regression.at (Unresolved SR Conflicts):
3657 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
3658 below.
3659
30171f79
AD
36602001-12-27 Akim Demaille <akim@epita.fr>
3661
3662 * src/LR0.c (new_state): Recognize the final state by the fact it
3663 is reached by eoftoken.
3664 (insert_start_shifting_state, insert_eof_shifting_state)
3665 (insert_accepting_state, augment_automaton): Remove, since now
3666 these states are automatically computed from the initial state.
3667 (generate_states): Adjust.
3668 * src/print.c: When reporting a rule number to the user, substract
3669 1, so that the axiom rule is rule 0, and the first user rule is 1.
3670 * src/reduce.c: Likewise.
3671 * src/print_graph.c (print_core): For the time being, just as for
3672 the report, depend upon --trace-flags to dump the full set of
3673 items.
3674 * src/reader.c (readgram): Once the grammar read, insert the rule
3675 0: `$axiom: START-SYMBOL $'.
3676 * tests/set.at: Adjust: rule 0 is now displayed, and since the
3677 number of the states has changed (the final state is no longer
3678 necessarily the last), catch up.
3679
75142d45
AD
36802001-12-27 Akim Demaille <akim@epita.fr>
3681
3682 Try to make the use of the eoftoken valid. Given that its value
3683 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
3684 is used instead of > 0 where appropriate, (ii), depend upon nritems
3685 instead of the 0-sentinel.
3686
3687 * src/gram.h, src/gram.c (nritems): New.
3688 Expected to be duplication of nitems, but for the time being...
3689 * src/reader.c (packgram): Assert nritems and nitems are equal.
3690 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
3691 * src/closure.c (print_closure, print_fderives): Likewise.
3692 * src/gram.c (ritem_print): Likewise.
3693 * src/print.c (print_core, print_grammar): Likewise.
3694 * src/print_graph.c: Likewise.
3695
b7c49edf
AD
36962001-12-27 Akim Demaille <akim@epita.fr>
3697
3698 * src/main.c (main): If there are complains after grammar
3699 reductions, then output the report anyway if requested, then die.
3700 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
3701 * src/reader.c (eoftoken): New.
3702 (parse_token_decl): If the token being defined has value `0', it
3703 is the eoftoken.
3704 (packsymbols): No longer hack `tags' to insert `$' by hand.
3705 Be sure to preserve the value of the eoftoken.
3706 (reader): Make sure eoftoken is defined.
3707 Initialize nsyms to 0: now eoftoken is created just like the others.
3708 * src/print.c (print_grammar): Don't special case the eof token.
3709 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
3710 lie anyway, albeit pleasant.
3711 * tests/calc.at: Exercise error messages with eoftoken.
3712 Change the grammar so that empty input is invalid.
3713 Adjust expectations.
3714 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
3715
ec2da99f
AD
37162001-12-27 Akim Demaille <akim@epita.fr>
3717
3718 * configure.in: Check the protos of strchr ans strspn.
3719 Replace strchr if needed.
3720 * src/system.h: Provide the protos of strchr, strspn and memchr if
3721 missing.
3722 * lib/strchr.c: New.
3723 * src/reader.c (symbols_save): Use strchr.
3724
8adfa272
AD
37252001-12-27 Akim Demaille <akim@epita.fr>
3726
3727 * src/print.c, src/print_graph.c (escape): New.
3728 Use it to quote the TAGS outputs.
3729 * src/print_graph.c (print_state): Now errors are in red, and
3730 reductions in green.
3731 Prefer high to wide: output the state number on a line of its own.
3732
80dac38c
AD
37332001-12-27 Akim Demaille <akim@epita.fr>
3734
3735 * src/state.h, src/state.c (reductions_new): New.
3736 * src/LR0.c (set_state_table): Let all the states have a
3737 `reductions', even if reduced to 0.
3738 (save_reductions): Adjust.
3739 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
3740 * src/print.c (print_reductions, print_actions): Adjust.
3741 * src/output.c (action_row): Adjust.
3742
2cec70b9
AD
37432001-12-27 Akim Demaille <akim@epita.fr>
3744
3745 * src/state.h, src/state.c (errs_new, errs_dup): New.
3746 * src/LR0.c (set_state_table): Let all the states have an errs,
3747 even if reduced to 0.
3748 * src/print.c (print_errs, print_reductions): Adjust.
3749 * src/output.c (output_actions, action_row): Adjust.
3750 * src/conflicts.c (resolve_sr_conflict): Adjust.
3751
13ca549a
AD
37522001-12-27 Akim Demaille <akim@epita.fr>
3753
3754 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
3755
5092aba5
AD
37562001-12-27 Akim Demaille <akim@epita.fr>
3757
3758 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
3759 * src/print.c: here.
3760 (lookaheadset, shiftset): New, used as additional storage by
3761 print_reductions.
3762 (print_results): Adjust.
3763 (print_shifts, print_gotos, print_errs): New, extracted from...
3764 (print_actions): here.
3765 * src/print_graph.c (print_actions): Remove dead code.
3766
11e2beca
AD
37672001-12-27 Akim Demaille <akim@epita.fr>
3768
3769 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
3770 `$n' and `@n'.
3771
dac3c910
AD
37722001-12-27 Akim Demaille <akim@epita.fr>
3773
3774 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
3775 (build_relations): Adjust.
3776
d0b0fefa
AD
37772001-12-27 Akim Demaille <akim@epita.fr>
3778
3779 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
3780 duplication.
3781
adc8c848
AD
37822001-12-27 Akim Demaille <akim@epita.fr>
3783
3784 * src/reader.c (packgram): Catch nitems overflows.
3785
14d293ac
AD
37862001-12-27 Akim Demaille <akim@epita.fr>
3787
3788 * src/files.c, src/files.h (guard_obstack): Remove.
3789 * src/output.c (output): Adjust.
3790 * src/reader.c (parse_braces): New, factoring...
3791 (copy_action, copy_guard): these two which are renamed as...
3792 (parse_action, parse_guard): these.
3793 As a voluntary consequence, using braces around guards is now
3794 mandatory.
3795
f499b062
AD
37962001-12-27 Akim Demaille <akim@epita.fr>
3797
3798 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
3799 * src/reader.c (symbol_list): `guard' and `guard_line' are new
3800 members.
3801 (symbol_list_new): Adjust.
3802 (copy_action): action_line is the first line, not the last.
3803 (copy_guard): Just as for actions, store the `action' only, not
3804 the switch/case/break flesh.
3805 Don't parse the user action that might follow the guard, let...
3806 (readgram): do it, i.e., now, there can be an action after a
3807 guard.
3808 In other words the guard is just explicitly optional.
3809 (packgram): Adjust.
3810 * src/output.c (guards_output): New.
3811 (output_parser): Call it when needed.
3812 (output): Also free the guard and attrs obstacks.
3813 * src/files.c, src/files.h (obstack_save): Remove.
3814 (output_files): Remove.
3815 As a result, if one needs the former `.act' file, using an
3816 appropriate skeleton which requires actions and guards is now
3817 required.
3818 * src/main.c (main): Adjust.
3819 * tests/semantic.at: New.
3820 * tests/regression.at: Use `input.y' as input file name.
3821 Avoid 8+3 problems by requiring input.c when the test needs the
3822 parser.
3823
d945f5cd
AD
38242001-12-27 Akim Demaille <akim@epita.fr>
3825
3826 * src/reader.c (symbol_list_new): Be sure to initialize all the
3827 fields.
3828
d200e455
AD
38292001-12-27 Akim Demaille <akim@epita.fr>
3830
3831 All the hacks using a final pseudo state are now useless.
3832
3833 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3834 * src/lalr.c (nLA): New.
3835 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3836 instead of lookaheadsp from the pseudo state (nstate + 1).
3837
f9507c28
AD
38382001-12-27 Akim Demaille <akim@epita.fr>
3839
3840 * src/output.c (action_row, token_actions): Use a state_t instead
3841 of a integer, and nlookaheads instead of the following state's
3842 lookaheadsp.
3843
065fbd27
AD
38442001-12-27 Akim Demaille <akim@epita.fr>
3845
3846 * src/conflicts.c (log_resolution, flush_shift)
3847 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3848 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3849 (conflicts_print, print_reductions): Use a state_t instead of an
3850 integer when referring to a state.
3851 As much as possible, depend upon nlookaheads, instead of the
3852 `lookaheadsp' member of the following state (since lookaheads of
3853 successive states are successive, the difference between state n + 1
3854 and n served as the number of lookaheads for state n).
3855 * src/lalr.c (add_lookback_edge): Likewise.
3856 * src/print.c (print_core, print_actions, print_state)
3857 (print_results): Likewise.
3858 * src/print_graph.c (print_core, print_actions, print_state)
3859 (print_graph): Likewise.
3860 * src/conflicts.h: Adjust.
3861
1b177bd7
AD
38622001-12-27 Akim Demaille <akim@epita.fr>
3863
3864 * src/bison.hairy: Formatting/comment changes.
3865 ANSIfy.
3866 Remove `register' indications.
3867 Add plenty of `static'.
3868
7742ddeb
AD
38692001-12-27 Akim Demaille <akim@epita.fr>
3870
3871 * src/output.c (prepare): Drop the muscle `ntbase' which
3872 duplicates ntokens.
3873 * src/bison.simple: Formatting/comment changes.
3874 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3875 is an undocumented synonym.
3876
1fa14068
AD
38772001-12-22 Akim Demaille <akim@epita.fr>
3878
3879 * src/output.c (output_table_data): Change the prototype to use
3880 `int' for array ranges: some invocations do pass an int, not a
3881 short.
3882 Reported by Wayne Green.
3883
b9752825
AD
38842001-12-22 Akim Demaille <akim@epita.fr>
3885
3886 Some actions of web2c.y are improperly triggered.
3887 Reported by Mike Castle.
3888
3889 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
3890 * tests/regression.at (Web2c): Rename as...
3891 (Web2c Report): this.
3892 (Web2c Actions): New.
3893
776209d6
AD
38942001-12-22 Akim Demaille <akim@epita.fr>
3895
3896 Reductions in web2c.y are improperly reported.
3897 Reported by Mike Castle.
3898
3899 * src/conflicts.c (print_reductions): Fix.
3900 * tests/regression.at (Web2c): New.
3901
275fc3ad
AD
39022001-12-18 Akim Demaille <akim@epita.fr>
3903
3904 Some host fail on `assert (!"foo")', which expands to
3905 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
3906 Reported by Nelson Beebee.
3907
3908 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
3909 `#define it_succeeded 0' and `assert (it_succeeded)'.
3910
897668ee
MA
39112001-12-17 Marc Autret <autret_m@epita.fr>
3912
3913 * src/bison.simple: Don't hard code the skeleton line and filename.
3914 * src/output.c (output_parser): Rename 'line' as 'output_line'.
3915 New line counter 'skeleton_line' (skeleton-line muscle).
3916
ab3399e0
PE
39172001-12-17 Paul Eggert <eggert@twinsun.com>
3918
3919 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
3920 YYDEBUG must be defined to a nonzero value.
3921
3922 * src/bison.simple (yytname): Do not assume that the user defines
3923 YYDEBUG to a properly parenthesized expression.
3924
3877f72b
AD
39252001-12-17 Akim Demaille <akim@epita.fr>
3926
3927 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3928 nlookaheads is a new member.
3929 Adjust all users.
3930 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3931 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3932 state.
776209d6 3933
331dbc1b
AD
39342001-12-17 Akim Demaille <akim@epita.fr>
3935
3936 * src/files.h, src/files.c (open_files, close_files): Remove.
3937 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3938 let...
3939 * src/reader.c (reader): Do it.
776209d6 3940
be750e4c
AD
39412001-12-17 Akim Demaille <akim@epita.fr>
3942
3943 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 3944
709ae8c6
AD
39452001-12-17 Akim Demaille <akim@epita.fr>
3946
3947 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3948 (flush_reduce): New.
3949 (resolve_sr_conflict): Adjust.
776209d6 3950
f87685c3
AD
39512001-12-17 Akim Demaille <akim@epita.fr>
3952
3953 * src/output.c (output_obstack): Be static and rename as...
3954 (format_obstack): this, to avoid any confusion with files.c's
3955 output_obstack.
3956 * src/reader.h (muscle_obstack): Move to...
3957 * src/output.h: here, since it's defined in output.c.
3958
837491d8
AD
39592001-12-17 Akim Demaille <akim@epita.fr>
3960
3961 * src/output.c (action_row, save_column, default_goto)
3962 (sort_actions, matching_state, pack_vector): Better variable
3963 locality.
3964
796d61fb
AD
39652001-12-17 Akim Demaille <akim@epita.fr>
3966
3967 * src/output.c: Various formatting changes.
776209d6 3968
64d15509
AD
39692001-12-17 Akim Demaille <akim@epita.fr>
3970
3971 * src/files.c (output_files): Free the output_obstack.
3972 * src/main.c (main): Call print and print_graph conditionally.
3973 * src/print.c (print): Work unconditionally.
3974 * src/print_graph.c (print_graph): Work unconditionally.
3975 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3976
fbc8ecb7
MA
39772001-12-16 Marc Autret <autret_m@epita.fr>
3978
3979 * src/output.c (actions_output): Fix. When we use %no-lines,
3980 there is one less line per action.
3981
f0440388
MA
39822001-12-16 Marc Autret <autret_m@epita.fr>
3983
3984 * src/bison.simple: Remove a useless #line directive.
3985 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3986 * src/output.c (get_lines_number): New.
776209d6 3987 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
3988 output muscles.
3989 Fix line numbering.
3990 (actions_output): Computes the number of lines taken by actions.
3991 (output_master_parser): Insert new skeleton which is the name of
3992 the output parser file name.
3993
a79986b8
MA
39942001-12-15 Marc Autret <autret_m@epita.fr>
3995
3996 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3997
4ec8e00f
MA
39982001-12-15 Marc Autret <autret_m@epita.fr>
3999
4000 * src/output.c (output_gram): Keep track of the hairy one.
4001
1a4648ff
AD
40022001-12-15 Akim Demaille <akim@epita.fr>
4003
4004 Make `make distcheck' work.
4005
4006 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
4007 system.h which uses libgettext.h.
4008
9c2c67e6
AD
40092001-12-15 Akim Demaille <akim@epita.fr>
4010
4011 * src/nullable.c (set_nullable): Useless rules must be skipped,
4012 otherwise, since we range over their symbols, we might look at a
4013 nonterminal which no longer ``exists'', i.e., it is not counted in
4014 `nvars', hence we overflow our arrays.
4015
93ede233
AD
40162001-12-15 Akim Demaille <akim@epita.fr>
4017
4018 The header can also be produced directly, without any obstack!
4019 Yahoo!
4020
4021 * src/files.c, src/files.h (defines_obstack): Remove.
4022 (compute_header_macro): Global.
4023 (defines_obstack_save): Remove.
4024 * src/reader.c (parse_union_decl): No longer output to
4025 defines_obstack: its content can be found in the `stype' muscle
4026 anyway.
4027 (output_token_translations): Merge into...
4028 (symbols_output): this.
4029 Rename as...
4030 (symbols_save): this.
4031 (reader): Adjust.
4032 * src/output.c (header_output): New.
4033 (output): Call it.
4034
2666f928
AD
40352001-12-15 Akim Demaille <akim@epita.fr>
4036
4037 * src/reader.c (parse_union_decl): Instead of handling two obstack
4038 simultaneously, use one to define the `stype' muscle, and use the
4039 value of the latter to fill defines_obstack.
4040 (copy_comment): Remove.
4041 (copy_comment2): Work for a single obstack.
4042 Rename as...
4043 (copy_comment): this.
4044
428046f8
AD
40452001-12-15 Akim Demaille <akim@epita.fr>
4046
4047 * src/lex.c, src/lex.h (xgetc): No longer static.
4048 * src/reader.c (parse_union_decl): Revamp.
4049
ea52d706
AD
40502001-12-15 Akim Demaille <akim@epita.fr>
4051
4052 Still making progress in separating Bison into (i) input, (ii)
4053 process, (iii) output: now we can directly output the parser file
4054 without using table_obstack at all.
4055
4056 * src/files.c, src/files.h (table_obstack): Bye bye.
4057 (parser_file_name): New.
4058 * src/files.c (compute_output_file_names): Compute it.
4059 * src/output.c (actions_output, output_parser)
4060 (output_master_parser): To a file instead of an obstack.
4061
3f96f4dc
AD
40622001-12-15 Akim Demaille <akim@epita.fr>
4063
4064 Attach actions to rules, instead of pre-outputting them to
4065 actions_obstack.
4066
4067 * src/gram.h (rule_t): action and action_line are new members.
4068 * src/reader.c (symbol_list): Likewise.
4069 (copy_action): Save the actions within the rule.
4070 (packgram): Save them in rule_table.
4071 * src/output.c (actions_output): New.
4072 (output_parser): Use it on `%%actions'.
4073 (output_rule_data): Don't free rule_table.
4074 (output): Do it.
4075 (prepare): Don't save the `action' muscle.
4076 * src/bison.simple: s/%%action/%%actions/.
4077
51576fb3
AD
40782001-12-15 Akim Demaille <akim@epita.fr>
4079
4080 * src/reader.c (copy_action): When --yacc, don't append a `;'
4081 to the user action: let it fail if lacking.
dee049eb 4082 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 4083
2648a72d
AD
40842001-12-14 Akim Demaille <akim@epita.fr>
4085
4086 * src/lex.c (literalchar): Simply return the char you decoded, non
4087 longer mess around with obstacks and int pointers.
4088 Adjust all callers.
4089
92790e5b
AD
40902001-12-14 Akim Demaille <akim@epita.fr>
4091
4092 * src/lex.c (literalchar): Don't escape the special characters,
4093 just decode them, and keep them as char (before, eol was output as
4094 the 2 char string `\n' etc.).
4095 * src/output.c (output_rule_data): Use quotearg to output the
4096 token strings.
4097
927c1557
PE
40982001-12-13 Paul Eggert <eggert@twinsun.com>
4099
4100 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
4101 Do not infringe on the global user namespace when using C++.
4102 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
4103 All uses of `fprintf' and `stderr' changed.
4104
4105 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
4106
ed8e1f68
AD
41072001-12-13 Akim Demaille <akim@epita.fr>
4108
4109 The computation of nullable is broken: it doesn't handle empty
4110 RHS's properly.
4111
4112 * tests/torture.at (GNU AWK Grammar): New.
4113 * tests/sets.at (Nullable): New.
4114 * src/nullable.c (set_nullable): Instead of blindly looping over
4115 `ritems', loop over the rules, and then over their rhs's.
4116
4117 Work around Autotest bugs.
4118
4119 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
4120 frame, because Autotest understand lines starting with a `+' as
4121 traces from the shell. Then, they are not processed properly.
4122 Admittedly an Autotest bug, but we don't have time to wait for
4123 Autotest to catch up.
4124 * tests/regression.at (Broken Closure): Adjust to the new table
4125 frames.
4126 Move to...
4127 * tests/sets.at: here.
4128
cb581495
AD
41292001-12-13 Akim Demaille <akim@epita.fr>
4130
4131 * src/closure.c (closure): Use nrules instead of playing tricks
4132 with BITS_PER_WORD.
4133
2e729273
AD
41342001-12-13 Akim Demaille <akim@epita.fr>
4135
4136 * src/print.c (print_actions): Output the handling of `$' as the
4137 traces do: shifting the token EOF. Before EOF was treated as a
4138 nonterminal.
4139 * tests/regression.at: Adjust some tests.
4140 * src/print_graph.c (print_core): Complete the set of items via
4141 closure. The next-to-final and final states are still unsatisfying,
4142 but that's to be addressed elsewhere.
4143 No longer output the rule numbers, but do output the state number.
4144 A single loop for the shifts + gotos is enough, but picked a
4145 distinct color for each.
4146 (print_graph): Initialize and finalize closure.
4147
107f7dfb
AD
41482001-12-13 Akim Demaille <akim@epita.fr>
4149
4150 * src/reader.c (readgram): Remove dead code, an strip useless
4151 braces.
4152 (get_type): Remove, unused.
4153
9b53a24f
AD
41542001-12-12 Akim Demaille <akim@epita.fr>
4155
4156 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
4157 on that of lib/error.c.
4158
dbfb6dcd
AD
41592001-12-12 Akim Demaille <akim@epita.fr>
4160
4161 Some hosts don't like `/' in includes.
4162
4163 * src/system.h: Include libgettext.h without qualifying the path.
4164 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
4165 $(top_srcdir).
4166
c25fb648
MA
41672001-12-11 Marc Autret <autret_m@epita.fr>
4168
4169 * src/output.c (output_parser): Remove useless muscle.
4170
710ddc4f
MA
41712001-12-11 Marc Autret <autret_m@epita.fr>
4172
4173 * src/bison.simple: Remove #line just before %%epilogue. It
4174 is now handled in ...
4175 * src/reader.c (read_additionnal_code): Add the output of a
4176 #line for the epilogue.
4177
e83d80b8
MA
41782001-12-10 Marc Autret <autret_m@epita.fr>
4179
927c1557 4180 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
4181 replace precedent remove.
4182 * src/bison.simple: Remove #line before %%prologue because
4183 %%input-line is wrong at this time.
4184
971d5158
MA
41852001-12-10 Marc Autret <autret_m@epita.fr>
4186
4187 * src/reader.c (symbols_output): Clean up.
927c1557 4188 * src/output.c (output_gram, output): Clean up.
971d5158 4189
5edafffd
AD
41902001-12-10 Akim Demaille <akim@epita.fr>
4191
4192 * src/lalr.c (initialize_lookaheads): New. Extracted from...
4193 * src/LR0.c (set_state_table): here.
4194 * src/lalr.c (lalr): Call it.
4195
0279f8e9
AD
41962001-12-10 Akim Demaille <akim@epita.fr>
4197
4198 * src/state.h (shifts): Remove the `number' member: shifts are
4199 attached to state, hence no longer need to be labelled with a
4200 state number.
4201
190c4f5f
AD
42022001-12-10 Akim Demaille <akim@epita.fr>
4203
4204 Now that states have a complete set of members, the linked list of
4205 shifts is useless: just fill directly the state's shifts member.
4206
4207 * src/state.h (shifts): Remove the `next' member.
4208 * src/LR0.c (first_state, last_state): Remove.
4209 Adjust the callers.
4210 (augment_automaton): Don't look for the shifts that must be added
4211 a shift on EOF: it is those of the state we looked for! But now,
4212 since shifts are attached, it is no longer needed to looking
4213 merely by its id: its number.
4214
2a73b93d
AD
42152001-12-10 Akim Demaille <akim@epita.fr>
4216
4217 * src/LR0.c (augment_automaton): Better variable locality.
4218 Remove an impossible branch: if there is a state corresponding to
4219 the start symbol being shifted, then there is shift for the start
4220 symbol from the initial state.
4221
74392f6a
AD
42222001-12-10 Akim Demaille <akim@epita.fr>
4223
4224 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
4225 only when appropriate: when insert_start_shifting_state' is not
4226 invoked.
4227 * tests/regression.at (Rule Line Numbers): Adjust.
4228
37c82725
AD
42292001-12-10 Akim Demaille <akim@epita.fr>
4230
4231 * src/LR0.c (augment_automaton): Now that all states have shifts,
4232 merge the two cases addition shifts to the initial state.
4233
6a164e0c
AD
42342001-12-10 Akim Demaille <akim@epita.fr>
4235
4236 * src/lalr.c (set_state_table): Move to...
4237 * src/LR0.c: here.
4238 * src/lalr.c (lalr): Don't call it...
4239 * src/LR0.c (generate_states): do it.
4240 * src/LR0.h (first_state): Remove, only the table is used.
4241
7215de24
AD
42422001-12-10 Akim Demaille <akim@epita.fr>
4243
4244 * src/LR0.h (first_shift, first_reduction): Remove.
4245 * src/lalr.c: Don't use first_shift: find shifts through the
4246 states.
4247
80e25d4d
AD
42482001-12-10 Akim Demaille <akim@epita.fr>
4249
4250 * src/LR0.c: Attach shifts to states as soon as they are
4251 computed.
4252 * src/lalr.c (set_state_table): Instead of assigning shifts to
4253 state, just assert that the mapping was properly done.
4254
0ab3728b
AD
42552001-12-10 Akim Demaille <akim@epita.fr>
4256
4257 * src/LR0.c (insert_start_shift): Rename as...
4258 (insert_start_shifting_state): this.
4259 (insert_eof_shifting_state, insert_accepting_state): New.
4260 (augment_automaton): Adjust.
4261 Better locality of the variables.
4262 When looking if the start_symbol is shifted from the initial
4263 state, using `while (... symbol != start_symbol ...)' sounds
4264 better than `while (... symbol < start_symbol ...)': If fail
4265 to see how the order between symbols could be relevant!
4266
78af9bbc
AD
42672001-12-10 Akim Demaille <akim@epita.fr>
4268
4269 * src/getargs.h: Don't declare `spec_name_prefix' and
4270 `spec_file_prefix', declared by src/files.h.
4271 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
4272 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
4273 * src/output.c (prepare): Adjust.
4274 * src/reader.c (symbols_output): Likewise.
4275 * src/vmsgetargs.c: Vaguely adjust, but who cares?
4276
bdef2a41
AD
42772001-12-10 Akim Demaille <akim@epita.fr>
4278
4279 * src/muscle_tab.c (muscle_init): NULL is a better default than
4280 `"0"'.
4281
3735969c
AD
42822001-12-10 Akim Demaille <akim@epita.fr>
4283
4284 * src/reader.c (reader): Calling symbols_output once is enough.
4285
49701457
AD
42862001-12-10 Akim Demaille <akim@epita.fr>
4287
4288 Now that states have a complete set of members, the linked list of
4289 reductions is useless: just fill directly the state's reductions
4290 member.
4291
4292 * src/state.h (struct reductions): Remove member `number' and
4293 `next'.
4294 * src/LR0.c (first_reduction, last_reduction): Remove.
4295 (save_reductions): Don't link the new reductions, store them in
4296 this_state.
4297 * src/lalr.c (set_state_table): No need to attach reductions to
4298 states, it's already done.
4299 * src/output.c (output_actions): No longer free the shifts, then
4300 the reductions, then the states: free all the states and their
4301 members.
4302
0edad749
AD
43032001-12-10 Akim Demaille <akim@epita.fr>
4304
4305 * src/options.c (OPTN, DRTV, BOTH): New.
4306 (option_table): Use them.
4307
0edad749
AD
4308 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
4309 the job of system.h.
4310 * src/options.c: Don't include stdio.h and xalloc.h for the same
4311 reasons.
4312
5449dd0f
AD
43132001-12-10 Akim Demaille <akim@epita.fr>
4314
4315 * src/output.c (output, prepare): Make sure the values of the
4316 muscles `action' and `prologue' are 0-terminated.
4317
a870c567
AD
43182001-12-10 Akim Demaille <akim@epita.fr>
4319
4320 Clean up GCC warnings.
4321
4322 * src/reader.c (copy_action): `buf' is not used.
4323 (parse_skel_decl): Be static.
4324 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
4325 * src/options.h (create_long_option_table): Have a real prototype.
4326 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
4327 (hash_delete_at): Return const void *.
4328 Adjust casts to preserve the const.
4329
80df8768
AD
43302001-12-10 Akim Demaille <akim@epita.fr>
4331
4332 * configure.in: Require 2.52g.
4333 M4 is not needed, but AUTOM4TE is.
4334 * m4/m4.m4: Remove.
4335 * tests/Makefile.am: Adjust.
4336
f693ad14
AD
43372001-12-10 Akim Demaille <akim@epita.fr>
4338
4339 One structure for states is enough, even though theoretically
4340 there are LR(0) states and LALR(1) states.
4341
4342 * src/lalr.h (state_t): Remove.
4343 (state_table): Be state_t **, not state_t *.
4344 * src/state.h (core, CORE_ALLOC): Rename as...
4345 (state_t, STATE_ALLOC): this.
4346 Add the LALR(1) members: shifts, reductions, errs.
4347 * src/LR0.c (state_table): Rename as...
4348 (state_hash): this, to avoid name clashes with the global
4349 `state_table'.
4350 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
4351 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
4352
74ffbcb6
AD
43532001-12-10 Akim Demaille <akim@epita.fr>
4354
4355 Bison dumps core on bash.y.
4356 Reported by Pascal Bart.
4357
4358 * src/warshall.c (bitmatrix_print): New.
4359 (TC): Use it.
4360 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
4361 j must be the outer loop.
4362 * tests/regression.at (Broken Closure): New.
4363
07708e19
AD
43642001-12-05 Akim Demaille <akim@epita.fr>
4365
4366 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
4367 its argument.
4368