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