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