1 2002-10-13 Akim Demaille <akim@epita.fr>
3 Let nondeterministic skeletons be usable with deterministic
6 With the patch, GAWK compiled by GCC without -O2 passes its test
7 suite using a GLR parser driven by LALR tables. It fails with -O2
8 because `struct stat' gives two different answers on my machine:
9 88 (definition of an auto var) and later 96 (memset on this var).
10 Hence the stack is badly corrumpted. The headers inclusion is to
11 blame: if I move the awk.h inclusion before GLR's system header
12 inclusion, the two struct stat have the same size.
14 * src/tables.c (pack_table): Always create conflict_table.
15 (token_actions): Always create conflict_list.
16 * data/glr.c (YYFLAG): Remove, unused.
18 2002-10-13 Akim Demaille <akim@epita.fr>
20 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
23 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
24 * tests/bison.in: Run $PREBISON a pre-command.
25 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
26 (maintainer-check-g++): New.
27 * Makefile.am (maintainer-check): New.
29 2002-10-13 Akim Demaille <akim@epita.fr>
31 * data/glr.c: Formatting changes.
32 Tweak some trace messages to match yacc.c's.
34 2002-10-13 Akim Demaille <akim@epita.fr>
36 GLR parsers sometimes raise parse errors instead of performing the
38 Reported by Charles-Henry de Boysson.
40 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
41 check the length of the traces when %glr.
42 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
44 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
46 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
47 (yyltype): Remove the yy prefix from the member names.
48 (yytable): Complete its comment.
49 (yygetLRActions): Map error action number from YYTABLE from
51 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
52 (which was a bug: it should have been YYTABEL_NINF, and yet it was
53 not satisfying as we could compare an YYACTION computed from
54 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
55 only value for error actions.
56 (yyreportParseError): In verbose parse error messages, don't issue
57 `error' in the list of expected tokens.
58 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
59 next action to perform to match glr.c's decoding.
60 (yytable): Complete its comment.
62 2002-10-13 Paul Eggert <eggert@twinsun.com>
64 Fix problem reported by Henrik Grubbstroem in
65 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001670.html>:
66 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
67 because the Bison parser reads the second action before reducing
69 * src/scan-gram.l (rule_length): New static var.
70 Use it to keep track of the rule length in the scanner, since
71 we can't expect the parser to be in lock-step sync with the scanner.
72 (handle_action_dollar, handle_action_at): Use this var.
73 * tests/actions.at (Exotic Dollars): Test for the problem.
75 2002-10-12 Paul Eggert <eggert@twinsun.com>
77 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
78 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
79 Include <sys/time.h> when checking for clock_t and struct tms.
80 Use same include order as source.
81 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
82 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001674.html>.
84 * lib/timevar.c: Update copyright date and clarify comments.
85 (get_time) [IN_GCC]: Keep the GCC version for reference.
87 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
88 GCC version as of today, then merge Bison's changes.
89 Change "GCC" to "Bison" in copyright notice. timevar.def's
90 author is Akim, so change that too.
92 * src/reader.c (grammar_current_rule_check):
93 Don't worry about the default action if $$ is untyped.
94 Prevents bogus warnings reported by Jim Gifford in
95 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001673.html>.
97 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
98 * data/glr.c, data/lalr1.cc, data/yacc.c:
99 Output token definitions before the first part of user declarations.
100 Fixes compatibility problem reported by Jim Gifford for kbd in
101 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001672.html>.
103 2002-10-11 Paul Eggert <eggert@twinsun.com>
105 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
106 (yyparse): here. This undoes some of the 2002-07-25 change.
107 Compatibility problem reported by Ralf S. Engelschall with
108 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
110 2002-10-11 Akim Demaille <akim@epita.fr>
112 * tests/regression.at Characters Escapes): New.
113 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
115 Reported by Jan Nieuwenhuizen.
117 2002-10-11 Akim Demaille <akim@epita.fr>
121 2002-10-10 Paul Eggert <eggert@twinsun.com>
123 Portability fixes for bitsets; this also avoids several GCC
126 * lib/abitset.c: Include <stddef.h>, for offsetof.
127 * lib/lbitset.c: Likewise.
129 * lib/abitset.c (abitset_bytes): Return a size that is aligned
130 properly for vectors of objects. Do not assume that adding a
131 header size to a multiple of a word size yields a value that is
132 properly aligned for the whole union.
133 * lib/bitsetv.c (bitsetv_alloc): Likewise.
135 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
136 unique names for structures.
137 * lib/ebitset.c (ebitset_bytes): Likewise.
138 * lib/lbitset.c (lbitset_bytes): Likewise.
140 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
141 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
142 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
143 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
144 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
145 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
146 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
147 to improve the type-checking that GCC can do.
148 * lib/bitset.c (bitset_op4_cmp): Likewise.
149 * lib/bitset_stats.c (bitset_stats_count,
150 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
151 bitset_stats_copy, bitset_stats_disjoint_p,
152 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
153 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
154 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
155 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
156 bitset_stats_and_or_cmp, bitset_stats_andn_or,
157 bitset_stats_andn_or_cmp, bitset_stats_or_and,
158 bitset_stats_or_and_cmp): Likewise.
159 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
160 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
161 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
162 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
164 * lib/abitset.h: Include bitset.h, not bbitset.h.
165 * lib/ebitset.h: Likewise.
166 * lib/lbitset.h: Likewise.
168 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
169 All instances of parameters of type enum bitset_opts are now of
170 type enum_bitset_opts, to conform to the C Standard, and similarly
171 for enum_bitset_type.
172 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
173 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
175 Do not use "struct bitset_struct" to mean different things in
176 different modules. Not only is this confusing, it violates
177 the C Standard, which requires that structure types in different
178 modules must be compatible if one is to be passed to the other.
179 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
180 All instances of "struct bitset_struct *" replaced with "bitset".
181 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
182 (union bitset_union, struct abitset_struct, struct ebitset_struct,
183 struct lbitset_struct, struct bitset_stats_struct): New types.
184 All uses of struct bitset_struct changed to union bitset_union,
186 * lib/abitset.c (struct abitset_struct, abitset,
187 struct bitset_struct): Remove.
188 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
189 struct bitset_struct): Remove.
190 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
191 bitset_struct): Remove.
192 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
195 Do not call a function of type T using a call that assumes the
196 function is of a different type U. Standard C requires that a
197 function must be called with a type that is compatible with its
199 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
201 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
203 * lib/ebitset.c (PFV): Remove.
204 * lib/lbitset.c (PFV): Likewise.
205 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
206 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
208 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
209 (ebitset_vtable): Use them.
210 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
211 lbitset_xor): New functions.
212 (lbitset_vtable): Use them.
214 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
217 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
219 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
220 Use offsetof, for simplicity.
222 2002-10-06 Paul Eggert <eggert@twinsun.com>
224 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
225 the same width as int. This reapplies a hunk of the 2002-08-12 patch
226 <http://mail.gnu.org/pipermail/bison-patches/2002-August/001111.html>,
227 which was inadvertently undone by the 2002-09-30 patch.
228 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
229 the same width as int.
231 2002-10-04 Paul Eggert <eggert@twinsun.com>
235 * configure.ac (AC_INIT), NEWS: Increment version number.
237 * doc/bison.texinfo: Minor spelling, grammar, and white space
239 (Symbols): Mention that any negative value returned from yylex
240 signifies end-of-input. Warn about negative chars. Mention
241 the portable Standard C character set.
243 The GNU coding standard says CFLAGS and YFLAGS are reserved
244 for the installer to set.
245 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
246 * src/Makefile.am (AM_CFLAGS): Likewise.
247 (AM_YFLAGS): Renamed from YFLAGS.
249 Fix some MAX and MIN problems.
250 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
251 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
252 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
253 * src/reader.c (reader): Use it.
255 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
256 POSIX 1003.1-2001 has removed fgrep.
258 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
260 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
261 interpreted as signed.
262 * lib/ebitset.c (ebitset_list): Fix bug.
264 2002-10-01 Paul Eggert <eggert@twinsun.com>
266 More fixes for 64-bit hosts and large bitsets.
268 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
269 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
270 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
271 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
272 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
273 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
274 bitset_count_): Likewise.
275 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
276 bitset_first, bitset_last): Likewise.
277 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
278 bitset_stats_list_reverse, bitset_stats_size,
279 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
281 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
282 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
283 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
284 bitsetv_reflexive_transitive_closure): Likewise.
285 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
286 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
288 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
291 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
292 Use size_t, not unsigned int, to count bytes.
293 * lib/abitset.h (abitset_bytes): Likewise.
294 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
296 * lib/bitset.h (bitset_bytes): Likewise.
297 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
298 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
299 * lib/bitsetv.c (bitsetv_alloc): Likewise.
300 * lib/ebitset.c (ebitset_bytes): Likewise.
301 * lib/ebitset.h (ebitset_bytes): Likewise.
302 * lib/lbitset.c (lbitset_bytes): Likewise.
303 * lib/lbitset.h (lbitset_bytes): Likewise.
305 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
306 abitset_subset_p, abitset_disjoint_p, abitset_and,
307 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
308 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
309 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
310 abitset_or_and, abitset_or_and_cmp):
311 Use bitset_windex instead of unsigned int.
312 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
313 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
314 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
315 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
317 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
319 * lib/bitset.c (bitset_print):
320 Use proper printf formats for widths of integer types.
321 * lib/bitset_stats.c (bitset_percent_histogram_print,
322 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
323 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
324 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
325 * lib/lbitset.c (lbitset_bytes): Likewise.
327 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
328 BITSET_SIZE_MAX): New macros.
329 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
330 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
331 to BITSET_WINDEX_MAX.
333 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
334 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
335 since we now return the bitset_bindex type (not int).
337 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
338 when computing sizes.
339 * lib/ebitset.c (ebitset_elts_grow): Likewise.
341 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
342 and avoid cast to unsigned.
344 2002-09-30 Akim Demaille <akim@epita.fr>
346 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
347 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
348 Updates from Michael Hayes.
350 2002-09-30 Art Haas <ahaas@neosoft.com>
352 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
354 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
357 2002-09-27 Akim Demaille <akim@epita.fr>
361 2002-09-27 Akim Demaille <akim@epita.fr>
363 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
364 (Because of AC_LIBSOURCE).
366 2002-09-27 Akim Demaille <akim@epita.fr>
368 Playing with Autoscan.
370 * configure.ac: Remove the old LIBOBJ tweaks.
371 (AC_REPLACE_FUNCS): Add strrchr and strtol.
372 * lib/strrchr.c: New.
373 * lib/strtol.c: New, from the Coreutils 4.5.1.
375 2002-09-27 Akim Demaille <akim@epita.fr>
377 Playing with Autoscan.
379 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
380 * lib/Makefile.am (libbison_a_SOURCES): No longer include
381 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
382 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
385 2002-09-24 Akim Demaille <akim@epita.fr>
387 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
388 (Frequently Asked Questions, Parser Stack Overflow): New.
390 2002-09-13 Akim Demaille <akim@epita.fr>
392 Playing with autoscan.
394 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
395 * src/files.c (skeleton_find): Remove, unused.
396 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
397 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
399 2002-09-13 Akim Demaille <akim@epita.fr>
401 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
402 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
404 2002-09-13 Akim Demaille <akim@epita.fr>
406 * configure.ac: Require 2.54.
407 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
408 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
409 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
410 Remove, provided by Autoconf macros.
412 2002-09-12 Akim Demaille <akim@epita.fr>
414 * m4/prereq.m4: Update, from Coreutils 4.5.1.
416 2002-09-12 Akim Demaille <akim@epita.fr>
418 * m4/prereq.m4: Update, from Fileutils 4.1.5.
419 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
420 Reported by Martin Mokrejs.
422 2002-09-10 Akim Demaille <akim@epita.fr>
424 * src/parse-gram.y: Associate a human readable string to each
426 * tests/regression.at (Invalid inputs): Adjust.
428 2002-09-10 Gary V. Vaughan <gary@gnu.org>
430 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
431 with an Autoconf-2.5x style configure.ac.
433 2002-09-06 Paul Eggert <eggert@twinsun.com>
435 * doc/bison.texinfo (Conditions): Make explicit that the GPL
436 exception applies only to yacc.c. This is a modification of a
437 patch originally suggested by Akim Demaille.
439 2002-09-06 Akim Demaille <akim@epita.fr>
441 * data/c.m4 (b4_copyright): Move the GPL exception comment from
445 * data/lalr1.cc (struct yyltype): Don't define it, since we use
447 (b4_ltype): Default to yy::Location from location.hh.
449 2002-09-04 Jim Meyering <jim@meyering.net>
451 * data/yacc.c: Guard the declaration of yytoknum also with
452 `#ifdef YYPRINT', so it is declared only when used.
454 2002-09-04 Akim Demaille <akim@epita.fr>
456 * configure.in: Rename as...
457 * configure.ac: this.
460 2002-09-04 Akim Demaille <akim@epita.fr>
462 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
463 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
464 translate maintainer only messages.
466 2002-08-12 Paul Eggert <eggert@twinsun.com>
470 * Makefile.am (SUBDIRS): Remove intl.
471 (DISTCLEANFILES): Remove.
472 * NEWS: Mention that GNU M4 is now required. Clarify what is
473 meant by "larger grammars". Mention the pt_BR translation.
474 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
475 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
476 Bump version from 0.11.2 to 0.11.5.
477 (BISON_PREREQ_STAGE): Remove.
478 (AM_GNU_GETTEXT): Use external gettext.
479 (AC_OUTPUT): Remove intl/Makefile.
481 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
483 * data/glr.c: Include string.h, for strlen.
484 (yyreportParseError): Use size_t for yysize.
485 (yy_yypstack): No longer nested inside yypstates, as nested
486 functions are not portable. Do not assume size_t is the
488 (yypstates): Do not assume that ptrdiff_t is the same width
489 as int, and similarly for yyposn and YYINDEX.
491 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
493 * lib/Makefile.am (INCLUDES): Do not include from the intl
494 directory, which has been removed.
495 * src/Makefile.am (INCLUDES): Likewise.
497 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
498 (bitsets_sources, additional_bitsets_sources, timevars_sources):
501 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
502 * tests/Makefile.am (EXTRA_DIST): Likewise.
504 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
505 Do not assume that bitset_windex is the same width as unsigned.
507 * lib/abitset.c (abitset_unused_clear): Do not assume that
508 bitset_word is the same width as int.
509 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
510 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
511 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
512 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
513 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
515 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
516 portability to one's complement hosts!).
517 * lib/ebitset.c (ebitset_op1): Likewise.
518 * lib/lbitset.c (lbitset_op1): Likewise.
520 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
521 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
522 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
524 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
525 lib/gettext.h: Sync with diffutils.
527 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
528 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
530 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
531 PROTOTYPES to check for prototypes, and "defined __STDC__" to
534 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
535 size_t; the old version tried to do this but casted improperly.
536 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
537 (bitset_test): Now returns int, not unsigned long.
539 * lib/bitset_stats.c: Include "gettext.h".
541 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
542 name locals "index", as it generates unnecessary warnings on some
543 hosts that have an "index" function.
545 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
546 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
547 they need translation.
548 * src/LR0.c (state_list_append, new_itemsets, get_state,
549 append_states, generate_states): Likewise.
550 * src/assoc.c (assoc_to_string): Likewise.
551 * src/closure.c (print_closure, set_firsts, closure): Likewise.
552 * src/gram.c (grammar_dump): Likewise.
553 * src/injections.c (injections_compute): Likewise.
554 * src/lalr.c (lookaheads_print): Likewise.
555 * src/relation.c (relation_transpose): Likewise.
556 * src/scan-gram.l: Likewise.
557 * src/tables.c (table_grow, pack_vector): Likewise.
559 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
560 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
561 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
562 * m4/mbstate_t.m4: Sync with fileutils.
563 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
565 * po/LINGUAS: Add pt_BR.
566 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
567 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
569 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
571 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
573 * src/complain.c (strerror_r): Remove decl; not needed.
574 (strerror): Use same pattern as ../lib/error.c.
576 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
578 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
580 * src/main.c (main): Cast result of bindtextdomain and textdomain
581 to void, to avoid a GCC warning when --disable-nls is in effect.
583 * src/scan-gram.l: Use strings rather than escapes when possible,
584 to minimize the number of warnings from xgettext.
585 (handle_action_dollar, handle_action_at): Don't use isdigit,
586 as it mishandles negative chars and it may not work as expected
587 outside the C locale.
589 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
590 this is a GCC extension and is not portable to other compilers.
592 * src/system.h (alloca): Use same pattern as ../lib/error.c.
593 Do not include <ctype.h>; no longer needed.
594 Do not include <malloc.h>; no longer needed (and generates
595 warnings on OpenBSD 3.0).
597 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
600 * tests/regression.at: Do not use 'cc -c input.c -o input';
601 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
603 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
604 exit status as failure, not just exit status 1. Sun C exits
605 with status 2 sometimes.
607 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
608 Use it for the two large tests.
610 2002-08-02 Akim Demaille <akim@epita.fr>
612 * src/conflicts.c (conflicts_output): Don't output rules never
613 reduced here, since anyway that computation doesn't work.
614 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
615 (rule_useless_p, rule_never_reduced_p): New.
616 (grammar_rules_partial_print): Use a filter instead of a range.
617 Display the title only if needed.
618 (grammar_rules_print): Adjust.
619 (grammar_rules_never_reduced_report): New.
620 * src/tables.c (action_row): Move the computation of rules never
622 (token_actions): here.
623 * src/main.c (main): Make the parser before making the report, so
624 that rules never reduced are computed.
625 Call grammar_rules_never_reduced_report.
626 * src/print.c (print_results): Report rules never reduced.
627 * tests/conflicts.at, tests/reduce.at: Adjust.
629 2002-08-01 Akim Demaille <akim@epita.fr>
631 Instead of attaching lookaheads and duplicating the rules being
632 reduced by a state, attach the lookaheads to the reductions.
634 * src/state.h (state_t): Remove the `lookaheads',
635 `lookaheads_rule' member.
636 (reductions_t): Add a `lookaheads' member.
637 Use a regular array for the `rules'.
638 * src/state.c (reductions_new): Initialize the lookaheads member
640 (state_rule_lookaheads_print): Adjust.
641 * src/state.h, src/state.c (state_reductions_find): New.
642 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
643 (count_rr_conflicts): Adjust.
644 * src/lalr.c (LArule): Remove.
645 (add_lookback_edge): Adjust.
646 (state_lookaheads_count): New.
647 (states_lookaheads_initialize): Merge into...
648 (initialize_LA): this.
650 * src/main.c (main): Don't free nullable and derives too early: it
651 is used by --verbose.
652 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
654 2002-08-01 Akim Demaille <akim@epita.fr>
656 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
658 (set_derives, free_derives): Rename as...
659 (derives_compute, derives_free): this.
660 Adjust all dependencies.
661 * src/nullable.c (set_nullable, free_nullable): Rename as...
662 (nullable_compute, nullable_free): these.
663 (rule_list_t): Store rule_t *, not rule_number_t.
664 * src/state.c (state_rule_lookaheads_print): Directly compare rule
665 pointers, instead of their numbers.
666 * src/main.c (main): Call nullable_free, and derives_free earlier,
667 as they were lo longer used.
669 2002-08-01 Akim Demaille <akim@epita.fr>
671 * lib/timevar.c (get_time): Include children time.
672 * src/lalr.h (LA, LArule): Don't export them: used with the
674 * src/lalr.c (LA, LArule): Static.
675 * src/lalr.h, src/lalr.c (lalr_free): New.
676 * src/main.c (main): Call it.
677 * src/tables.c (pack_vector): Check whether loc is >= to the
679 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
680 (tables_generate): do it, since that's also it which allocates
682 Don't free LA and LArule, main does.
684 2002-07-31 Akim Demaille <akim@epita.fr>
686 Separate parser tables computation and output.
688 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
689 (conflict_list, conflict_list_cnt, table, check, table_ninf)
690 (yydefgoto, yydefact, high): Move to...
691 * src/tables.h, src/tables.c: here.
692 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
693 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
694 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
695 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
696 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
697 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
698 (action_row, save_row, token_actions, save_column, default_goto)
699 (goto_actions, sort_actions, matching_state, pack_vector)
700 (table_ninf_remap, pack_table, prepare_actions): Move to...
701 * src/tables.c: here.
702 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
703 * src/output.c (token_actions, output_base, output_conflicts)
704 (output_check): Merge into...
705 (prepare_actions): this.
706 (actions_output): Rename as...
707 (user_actions_output): this.
708 * src/main.c (main): Call tables_generate and tables_free.
710 2002-07-31 Akim Demaille <akim@epita.fr>
712 Steal GCC's --time-report support.
714 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
715 stolen/adjusted from GCC.
716 * m4/stage.m4: Remove time related checks.
717 * m4/timevar.m4: New.
718 * configure.in: Adjust.
719 * src/system.h: Adjust to using timevar.h.
720 * src/getargs.h, src/getargs.c: Support trace_time for
722 * src/main.c (stage): Remove.
723 (main): Replace `stage' invocations with timevar calls.
724 * src/output.c: Insert pertinent timevar calls.
726 2002-07-31 Akim Demaille <akim@epita.fr>
728 Let --trace have arguments.
730 * src/getargs.h (enum trace_e): New.
731 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
732 (long_options, short_options): --trace/-T takes an optional
734 Change all the uses of trace_flag to reflect the new flags.
735 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
737 Strengthen `stage' portability.
739 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
740 * configure.in: Use it.
741 Don't check for malloc.h and sys/times.h.
742 * src/system.h: Include them when appropriate.
743 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
744 times and struct tms are available.
746 2002-07-30 Akim Demaille <akim@epita.fr>
748 In verbose parse error message, don't report `error' as an
750 * tests/actions.at (Printers and Destructors): Adjust.
751 * tests/calc.at (Calculator $1): Adjust.
752 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
753 error message, do not report the parser accepts the error token in
756 2002-07-30 Akim Demaille <akim@epita.fr>
758 Normalize conflict related messages.
760 * src/complain.h, src/complain.c (warn, complain): New.
761 * src/conflicts.c (conflicts_print): Use them.
762 (conflict_report_yacc): New, extracted from...
763 (conflicts_print): here.
764 * tests/conflicts.at, tests/existing.at: Adjust.
766 2002-07-30 Akim Demaille <akim@epita.fr>
768 Report rules which are never reduced by the parser: those hidden
771 * src/LR0.c (save_reductions): Don't make the final state too
772 different: save its reduction (accept) instead of having a state
773 without any action (no shift or goto, no reduce).
774 Note: the final state is now a ``regular'' state, i.e., the
775 parsers now contain `reduce 0' as default reduction.
776 Nevertheless, since they decide to `accept' when yystate =
777 final_state, they still will not reduce rule 0.
778 * src/print.c (print_actions, print_reduction): Adjust.
779 * src/output.c (action_row): Track reduced rules.
780 (token_actions): Report rules never reduced.
781 * tests/conflicts.at, tests/regression.at: Adjust.
783 2002-07-30 Akim Demaille <akim@epita.fr>
785 `stage' was accidently included in a previous patch.
786 Initiate its autoconfiscation.
788 * configure.in: Look for malloc.h and sys/times.h.
789 * src/main.c (stage): Adjust.
790 Report only when trace_flag.
792 2002-07-29 Akim Demaille <akim@epita.fr>
794 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
796 (errs_t): symbol_t*, not symbol_number_t.
797 (reductions_t): rule_t*, not rule_number_t.
798 (FOR_EACH_SHIFT): New.
799 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
800 * src/print.c, src/print_graph.c: Adjust.
802 2002-07-29 Akim Demaille <akim@epita.fr>
804 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
806 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
807 (endtoken, accept): these.
808 * src/reader.c (reader): Set endtoken's default tag to "$end".
809 Set undeftoken's tag to "$undefined" instead of "$undefined.".
810 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
813 2002-07-29 Akim Demaille <akim@epita.fr>
815 * src/reduce.c (reduce_grammar): When the language is empty,
816 complain about the start symbol, not the axiom.
818 * tests/reduce.at (Empty Language): New.
820 2002-07-26 Akim Demaille <akim@epita.fr>
822 * src/reader.h, src/reader.c (gram_error): ... can't get
823 yycontrol without making too strong assumptions on the parser
825 * src/output.c (prepare_tokens): Use the real 0th value of
826 token_translations instead of `0'.
827 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
829 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
830 for the time being: %locations ought to provide it to yyerror.
832 2002-07-25 Akim Demaille <akim@epita.fr>
834 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
835 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
836 * tests/regression.at (Web2c Actions): Adjust.
838 2002-07-25 Akim Demaille <akim@epita.fr>
840 Stop storing rules from 1 to nrules + 1.
842 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
843 * src/nullable.c, src/output.c, src/print.c, src/reader.c
844 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
845 Iterate from 0 to nrules.
846 Use rule_number_as_item_number and item_number_as_rule_number.
847 Adjust to `derive' now containing possibly 0.
848 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
849 Handle the `- 1' part in rule numbers from/to item numbers.
850 * src/conflicts.c (log_resolution): Fix the message which reversed
852 * src/output.c (action_row): Initialize default_rule to -1.
853 (token_actions): Adjust.
854 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
856 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
858 2002-07-25 Akim Demaille <akim@epita.fr>
860 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
861 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
862 (b4_c_knr_arg_decl): New.
863 * data/yacc.c: Use it to define yysymprint, yydestruct, and
864 yyreport_parse_error.
866 2002-07-25 Akim Demaille <akim@epita.fr>
868 * data/yacc.c (yyreport_parse_error): New, extracted from...
870 (yydestruct, yysymprint): Move above yyparse.
873 2002-07-25 Akim Demaille <akim@epita.fr>
875 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
877 (b4_sint_type, b4_uint_type): these.
878 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
879 * tests/regression.at (Web2c Actions): Adjust.
881 2002-07-25 Akim Demaille <akim@epita.fr>
883 * src/gram.h (TIEM_NUMBER_MAX): New.
884 (item_number_of_rule_number, rule_number_of_item_number): Rename
886 (rule_number_as_item_number, item_number_as_rule_number): these.
888 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
889 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
890 (symbol_number_to_vector_number): New.
891 (order): Of vector_number_t* type.
892 (base_t, BASE_MAX, BASE_MIN): New.
893 (froms, tos, width, pos, check): Of base_t type.
894 (action_number_t, ACTION_MIN, ACTION_MAX): New.
895 (actrow): Of action_number_t type.
896 (conflrow): Of unsigned int type.
897 (table_ninf, base_ninf): New.
898 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
899 (muscle_insert_int_table, muscle_insert_base_table)
900 (muscle_insert_rule_number_table): New.
901 (prepare_tokens): Output `toknum' as int_table.
902 (action_row): Returns a rule_number_t.
903 Use ACTION_MIN, not SHRT_MIN.
904 (token_actions): yydefact is rule_number_t*.
905 (table_ninf_remap): New.
906 (pack_table): Use it for `base' and `table'.
907 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
909 (YYPACT_NINF, YYTABLE_NINF): these.
910 (yypact, yytable): Compute their types instead of hard-coded
912 * tests/regression.at (Web2c Actions): Adjust.
914 2002-07-19 Akim Demaille <akim@epita.fr>
916 * src/scan-gram.l (id): Can start with an underscore.
918 2002-07-16 Akim Demaille <akim@epita.fr>
920 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
921 Adjust all former `associativity' dependencies.
922 * src/symtab.c (symbol_new): Default associativity is `undef', not
924 (symbol_check_alias_consistence): Adjust.
926 2002-07-09 Akim Demaille <akim@epita.fr>
928 * doc/bison.texinfo: Properly set the ``header'' part.
929 Use @dircategory ``GNU programming tools'' as per Texinfo's
933 2002-07-09 Akim Demaille <akim@epita.fr>
935 * lib/quotearg.h: Protect against multiple inclusions.
936 * src/location.h (location_t): Add a `file' member.
937 (LOCATION_RESET, LOCATION_PRINT): Adjust.
938 * src/complain.c (warn_at, complain_at, fatal_at): Drop
939 `error_one_per_line' support.
941 2002-07-09 Akim Demaille <akim@epita.fr>
943 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
944 * src/reader.c (lineno): Remove.
945 Adjust all dependencies.
946 (get_merge_function): Take a location and use complain_at.
947 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
948 * tests/regression.at (Invalid inputs, Mixing %token styles):
951 2002-07-09 Akim Demaille <akim@epita.fr>
953 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
954 recovery rule, and forbid extensions when --yacc.
955 (gram_error): Use complain_at.
956 * src/reader.c (reader): Exit if there were parse errors.
958 2002-07-09 Akim Demaille <akim@epita.fr>
960 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
961 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
962 Reported by R Blake <blakers@mac.com>.
964 2002-07-09 Akim Demaille <akim@epita.fr>
966 * data/yacc.c: Output the copyright notive in the header.
968 2002-07-03 Akim Demaille <akim@epita.fr>
970 * src/output.c (froms, tos): Are state_number_t.
971 (save_column): sp, sp1, and sp2 are state_number_t.
972 (prepare): Rename `final' as `final_state_number', `nnts' as
973 `nterms_number', `nrules' as `rules_number', `nstates' as
974 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
976 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
977 * data/lalr1.cc (nsym_): Remove, unused.
979 2002-07-03 Akim Demaille <akim@epita.fr>
981 * src/lalr.h, src/lalr.c (goto_number_t): New.
982 * src/lalr.c (goto_list_t): New.
984 * src/nullable.c (rule_list_t): New.
986 * src/types.h: Remove.
988 2002-07-03 Akim Demaille <akim@epita.fr>
990 * src/closure.c (print_fderives): Use rule_rhs_print.
991 * src/derives.c (print_derives): Use rule_rhs_print.
992 (rule_list_t): New, replaces `shorts'.
993 (set_derives): Add comments.
994 * tests/sets.at (Nullable, Firsts): Adjust.
996 2002-07-03 Akim Demaille <akim@epita.fr>
998 * src/output.c (prepare_actions): Free `tally' and `width'.
999 (prepare_actions): Allocate and free `order'.
1000 * src/symtab.c (symbols_free): Free `symbols'.
1001 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
1002 * src/output.c (m4_invoke): Move to...
1003 * src/scan-skel.l: here.
1004 (<<EOF>>): Close yyout, and free its name.
1006 2002-07-03 Akim Demaille <akim@epita.fr>
1008 Fix some memory leaks, and fix a bug: state 0 was examined twice.
1010 * src/LR0.c (new_state): Merge into...
1011 (state_list_append): this.
1012 (new_states): Merge into...
1013 (generate_states): here.
1014 (set_states): Don't ensure a proper `errs' state member here, do it...
1015 * src/conflicts.c (conflicts_solve): here.
1016 * src/state.h, src/state.c: Comment changes.
1017 (state_t): Rename member `shifts' as `transitions'.
1018 Adjust all dependencies.
1019 (errs_new): For consistency, also take the values as argument.
1021 (state_errs_set): New.
1022 (state_reductions_set, state_transitions_set): Assert that no
1023 previous value was assigned.
1025 (states_free): Use it.
1026 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
1027 temporary storage: use `errs' and `nerrs' as elsewhere.
1028 (set_conflicts): Allocate and free this `errs'.
1030 2002-07-02 Akim Demaille <akim@epita.fr>
1032 * lib/libiberty.h: New.
1033 * lib: Update the bitset implementation from upstream.
1034 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
1035 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
1036 * src/main.c: Adjust bitset stats calls.
1038 2002-07-01 Paul Eggert <eggert@twinsun.com>
1040 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
1041 char, so that negative chars don't collide with $.
1043 2002-06-30 Akim Demaille <akim@epita.fr>
1045 Have the GLR tests be `warning' checked, and fix the warnings.
1047 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
1048 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
1049 (yyremoveDeletes): `yyi' and `yyj' are size_t.
1050 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
1051 (yyaddDeferredAction): static.
1052 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
1053 (yyreportParseError): yyprefix is const.
1054 yytokenp is used only when verbose.
1055 (yy__GNUC__): Replace with __GNUC__.
1056 (yypdumpstack): yyi is size_t.
1057 (yypreference): Un-yy local variables and arguments, to avoid
1058 clashes with `yyr1'. Anyway, we are not in the user name space.
1059 (yytname_size): be an int, as is compared with ints.
1060 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
1062 * tests/cxx-gram.at: Use quotation to protect $1.
1063 Use AT_COMPILE to enable warnings hunts.
1064 Prototype yylex and yyerror.
1066 Include `string.h', not `strings.h'.
1067 Produce and prototype stmtMerge only when used.
1068 yylex takes a location.
1070 2002-06-30 Akim Demaille <akim@epita.fr>
1072 We spend a lot of time in quotearg, in particular when --verbose.
1074 * src/symtab.c (symbol_get): Store a quoted version of the key.
1075 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
1078 2002-06-30 Akim Demaille <akim@epita.fr>
1080 * src/state.h (reductions_t): Rename member `nreds' as num.
1081 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
1082 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
1084 2002-06-30 Akim Demaille <akim@epita.fr>
1086 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
1087 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
1088 (shifts_to): Rename as...
1089 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
1090 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
1091 (TRANSITION_IS_DISABLED, transitions_to): these.
1093 2002-06-30 Akim Demaille <akim@epita.fr>
1095 * src/print.c (print_shifts, print_gotos): Merge into...
1096 (print_transitions): this.
1097 (print_transitions, print_errs, print_reductions): Align the
1099 (print_core, print_transitions, print_errs, print_state,
1100 print_grammar): Output empty lines separator before, not after.
1101 (state_default_rule_compute): Rename as...
1102 (state_default_rule): this.
1103 * tests/conflicts.at (Defaulted Conflicted Reduction),
1104 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
1105 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
1107 2002-06-30 Akim Demaille <akim@epita.fr>
1109 Display items as we display rules.
1111 * src/gram.h, src/gram.c (rule_lhs_print): New.
1112 * src/gram.c (grammar_rules_partial_print): Use it.
1113 * src/print.c (print_core): Likewise.
1114 * tests/conflicts.at (Defaulted Conflicted Reduction),
1115 (Unresolved SR Conflicts): Adjust.
1116 (Unresolved SR Conflicts): Adjust and rename as...
1117 (Resolved SR Conflicts): this, as was meant.
1118 * tests/regression.at (Web2c Report): Adjust.
1120 2002-06-30 Akim Demaille <akim@epita.fr>
1122 * src/print.c (state_default_rule_compute): New, extracted from...
1123 (print_reductions): here.
1124 Pessimize, but clarify the code.
1125 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
1127 2002-06-30 Akim Demaille <akim@epita.fr>
1129 * src/output.c (action_row): Let default_rule be always a rule
1132 2002-06-30 Akim Demaille <akim@epita.fr>
1134 * src/closure.c (print_firsts, print_fderives, closure):
1136 * src/lalr.c (lookaheads_print): Likewise.
1137 * src/state.c (state_rule_lookaheads_print): Likewise.
1138 * src/print_graph.c (print_core): Likewise.
1139 * src/print.c (print_reductions): Likewise.
1140 * src/output.c (action_row): Likewise.
1141 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
1143 2002-06-30 Akim Demaille <akim@epita.fr>
1145 * src/print_graph.c: Use report_flag.
1147 2002-06-30 Akim Demaille <akim@epita.fr>
1149 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
1151 * src/relation.h, src/relation.c (traverse, relation_digraph)
1152 (relation_print, relation_transpose): New.
1154 2002-06-30 Akim Demaille <akim@epita.fr>
1156 * src/state.h, src/state.c (shifts_to): New.
1157 * src/lalr.c (build_relations): Use it.
1159 2002-06-30 Akim Demaille <akim@epita.fr>
1161 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
1162 (item_number_of_rule_number, rule_number_of_item_number): New.
1163 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
1164 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
1165 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
1166 Propagate their use.
1167 Much remains to be done, in particular wrt `shorts' from types.h.
1169 2002-06-30 Akim Demaille <akim@epita.fr>
1171 * src/symtab.c (symbol_new): Initialize the `printer' member.
1173 2002-06-30 Akim Demaille <akim@epita.fr>
1175 * src/LR0.c (save_reductions): Remove, replaced by...
1176 * src/state.h, src/state.c (state_reductions_set): New.
1177 (reductions, errs): Rename as...
1178 (reductions_t, errs_t): these.
1179 Adjust all dependencies.
1181 2002-06-30 Akim Demaille <akim@epita.fr>
1183 * src/LR0.c (state_list_t, state_list_append): New.
1184 (first_state, last_state): Now symbol_list_t.
1185 (this_state): Remove.
1186 (new_itemsets, append_states, save_reductions): Take a state_t as
1188 (set_states, generate_states): Adjust.
1189 (save_shifts): Remove, replaced by...
1190 * src/state.h, src/state.c (state_shifts_set): New.
1191 (shifts): Rename as...
1193 Adjust all dependencies.
1194 * src/state.h (state_t): Remove the `next' member.
1196 2002-06-30 Akim Demaille <akim@epita.fr>
1198 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
1201 2002-06-30 Akim Demaille <akim@epita.fr>
1203 Use hash.h for the state hash table.
1205 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
1206 (allocate_storage): Use state_hash_new.
1207 (free_storage): Use state_hash_free.
1208 (new_state, get_state): Adjust.
1209 * src/lalr.h, src/lalr.c (states): Move to...
1210 * src/states.h (state_t): Remove the `link' member, no longer
1212 * src/states.h, src/states.c: here.
1213 (state_hash_new, state_hash_free, state_hash_lookup)
1214 (state_hash_insert, states_free): New.
1215 * src/states.c (state_table, state_compare, state_hash): New.
1216 * src/output.c (output_actions): Do not free states now, since we
1217 still need to know the final_state number in `prepare', called
1218 afterwards. Do it...
1219 * src/main.c (main): here: call states_free after `output'.
1221 2002-06-30 Akim Demaille <akim@epita.fr>
1223 * src/state.h, src/state.c (state_new): New, extracted from...
1224 * src/LR0.c (new_state): here.
1225 * src/state.h (STATE_ALLOC): Move to...
1226 * src/state.c: here.
1227 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
1228 * src/state.h, src/state.c: here.
1230 2002-06-30 Akim Demaille <akim@epita.fr>
1232 * src/reader.c (gensym): Rename as...
1233 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
1234 (getsym): Rename as...
1237 2002-06-30 Akim Demaille <akim@epita.fr>
1239 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
1240 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
1241 * src/output.c, src/print.c, src/print_graph.c: Propagate.
1242 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
1244 2002-06-30 Akim Demaille <akim@epita.fr>
1246 Make the test suite pass with warnings checked.
1248 * tests/actions.at (Printers and Destructors): Improve.
1249 Avoid unsigned vs. signed issues.
1250 * tests/calc.at: Don't exercise the scanner here, do it...
1251 * tests/input.at (Torturing the Scanner): here.
1253 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1255 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
1256 reorganize first lines parallel to yacc.c.
1258 2002-06-28 Akim Demaille <akim@epita.fr>
1260 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
1261 (b4_token_enum, b4_token_defines): New, factored from...
1262 * data/lalr1.cc, data/yacc.c, glr.c: here.
1264 2002-06-28 Akim Demaille <akim@epita.fr>
1266 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
1268 * src/output.c (merger_output): static.
1270 2002-06-28 Akim Demaille <akim@epita.fr>
1272 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
1273 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
1275 * src/output.c (save_row): Initialize all the variables to pacify GCC.
1277 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1279 Accumulated changelog for new GLR parsing features.
1281 * src/conflicts.c (count_total_conflicts): Change name to
1282 conflicts_total_count.
1283 * src/conflicts.h: Ditto.
1284 * src/output.c (token_actions): Use the new name.
1285 (output_conflicts): Change conflp => conflict_list_heads, and
1286 confl => conflict_list for better readability.
1287 * data/glr.c: Use the new names.
1288 * NEWS: Add self to GLR announcement.
1290 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
1292 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
1295 * data/bison.glr: Change name to glr.c
1296 * data/glr.c: Renamed from bison.glr.
1297 * data/Makefile.am: Add glr.c
1301 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
1302 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
1304 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1306 * data/bison.glr: Be sure to restore the
1307 current #line when returning to the skeleton contents after having
1308 exposed the input file's #line.
1310 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1312 * data/bison.glr: Bring up to date with changes to bison.simple.
1314 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1316 * data/bison.glr: Correct definitions that use b4_prefix.
1317 Various reformatting.
1318 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
1319 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
1320 yytokenp argument; now part of stack.
1321 (yychar): Define to behave as documented.
1324 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1326 * src/reader.h: Add declaration for free_merger_functions.
1328 * src/reader.c (merge_functions): New variable.
1329 (get_merge_function): New function.
1330 (free_merger_functions): New function.
1331 (readgram): Check for %prec that is not followed by a symbol.
1332 Handle %dprec and %merge declarations.
1333 (packgram): Initialize dprec and merger fields in rules array.
1335 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
1336 conflict_list_cnt, conflict_list_free): New variables.
1337 (table_grow): Also grow conflict_table.
1338 (prepare_rules): Output dprec and merger tables.
1339 (conflict_row): New function.
1340 (action_row): Output conflict lists for GLR parser. Don't use
1341 default reduction in conflicted states for GLR parser so that there
1342 are spaces for the conflict lists.
1343 (save_row): Also save conflict information.
1344 (token_actions): Allocate conflict list.
1345 (merger_output): New function.
1346 (pack_vector): Pack conflict table, too.
1347 (output_conflicts): New function to output yyconflp and yyconfl.
1348 (output_check): Allocate conflict_tos.
1349 (output_actions): Output conflict tables, also.
1350 (output_skeleton): Output b4_mergers definition.
1351 (prepare): Output b4_max_rhs_length definition.
1352 Use 'bison.glr' as default skeleton for GLR parsers.
1354 * src/gram.c (glr_parser): New flag.
1355 (grammar_free): Call free_merger_functions.
1357 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
1358 all pairs of conflicting reductions, rather than just all tokens
1359 causing conflicts. Needed to size conflict tables.
1360 (conflicts_output): Modify call to count_rr_conflicts for new
1362 (conflicts_print): Ditto.
1363 (count_total_conflicts): New function.
1365 * src/reader.h (merger_list): New type.
1366 (merge_functions): New variable.
1368 * src/lex.h (tok_dprec, tok_merge): New token types.
1370 * src/gram.h (rule_s): Add dprec and merger fields.
1371 (glr_parser): New flag.
1373 * src/conflicts.h (count_total_conflicts): New function.
1375 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
1377 * doc/bison.texinfo (Generalized LR Parsing): New section.
1378 (GLR Parsers): New section.
1379 (Language and Grammar): Mention GLR parsing.
1380 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
1381 Correct typo ("tge" -> "the").
1383 * data/bison.glr: New skeleton for GLR parsing.
1385 * tests/cxx-gram.at: New tests for GLR parsing.
1387 * tests/testsuite.at: Include cxx-gram.at.
1389 * tests/Makefile.am: Add cxx-gram.at.
1393 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
1395 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
1397 2002-06-27 Akim Demaille <akim@epita.fr>
1399 * src/options.h, src/options.c: Remove.
1400 * src/getargs.c (short_options, long_options): New.
1402 2002-06-27 Akim Demaille <akim@epita.fr>
1404 * data/bison.simple, data/bison.c++: Rename as...
1405 * data/yacc.c, data/lalr1.cc: these.
1406 * doc/bison.texinfo (Environment Variables): Remove.
1408 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
1410 * src/getargs.c (report_argmatch): Initialize strtok().
1412 2002-06-20 Akim Demaille <akim@epita.fr>
1414 * data/bison.simple (b4_symbol_actions): New, replaces...
1415 (b4_symbol_destructor, b4_symbol_printer): these.
1416 (yysymprint): Be sure to call YYPRINT only for tokens, and using
1419 2002-06-20 Akim Demaille <akim@epita.fr>
1421 * data/bison.simple (yydestructor): Rename as...
1424 2002-06-20 Akim Demaille <akim@epita.fr>
1426 * src/symtab.h, src/symtab.c (symbol_type_set)
1427 (symbol_destructor_set, symbol_precedence_set): The location is
1431 2002-06-20 Akim Demaille <akim@epita.fr>
1433 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
1435 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
1437 * src/symtab.h, src/symtab.c (symbol_class_set)
1438 (symbol_user_token_number_set): Likewise.
1440 Promote complain_at.
1441 * tests/input.at (Type Clashes): Adjust.
1443 2002-06-20 Akim Demaille <akim@epita.fr>
1445 * data/bison.simple (YYLEX): Fix the declaration when
1448 2002-06-20 Akim Demaille <akim@epita.fr>
1450 * data/bison.simple (yysymprint): Don't print the token number,
1452 * tests/actions.at (Destructors): Rename as...
1453 (Printers and Destructors): this.
1454 Also exercise %printer.
1456 2002-06-20 Akim Demaille <akim@epita.fr>
1458 * data/bison.simple (YYDSYMPRINT): New.
1459 Use it to remove many of the #if YYDEBUG/if (yydebug).
1461 2002-06-20 Akim Demaille <akim@epita.fr>
1463 * src/symtab.h, src/symtab.c (symbol_t): printer and
1464 printer_location are new members.
1465 (symbol_printer_set): New.
1466 * src/parse-gram.y (PERCENT_PRINTER): New token.
1467 Handle its associated rule.
1468 * src/scan-gram.l: Adjust.
1469 (handle_destructor_at, handle_destructor_dollar): Rename as...
1470 (handle_symbol_code_at, handle_symbol_code_dollar): these.
1471 * src/output.c (symbol_printers_output): New.
1472 (output_skeleton): Call it.
1473 * data/bison.simple (yysymprint): New. Cannot be named yyprint
1474 since there are already many grammar files with a user `yyprint'.
1475 Replace the calls to YYPRINT to calls to yysymprint.
1476 * tests/calc.at: Adjust.
1477 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
1478 taking advantage of parser very internal details (stack size!).
1480 2002-06-20 Akim Demaille <akim@epita.fr>
1482 * src/scan-gram.l: Complete the scanner with the missing patterns
1484 Use `quote' and `symbol_tag_get' where appropriate.
1486 2002-06-19 Akim Demaille <akim@epita.fr>
1488 * tests/actions.at (Destructors): Augment to test locations.
1489 * data/bison.simple (yydestructor): Pass it the current location
1490 if locations are enabled.
1491 Prototype only when __STDC__ or C++.
1492 Change the argument names to move into the yy name space: there is
1495 2002-06-19 Akim Demaille <akim@epita.fr>
1497 * data/bison.simple (b4_pure_if): New.
1498 Use it instead of #ifdef YYPURE.
1500 2002-06-19 Akim Demaille <akim@epita.fr>
1502 * data/bison.simple (b4_location_if): New.
1503 Use it instead of #ifdef YYLSP_NEEDED.
1505 2002-06-19 Akim Demaille <akim@epita.fr>
1507 Prepare @$ in %destructor, but currently don't bind it in the
1508 skeleton, as %location use is not cleaned up yet.
1510 * src/scan-gram.l (handle_dollar, handle_destructor_at)
1511 (handle_action_at): New.
1512 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
1513 a braced_code_t and a location as additional arguments.
1514 (handle_destructor_dollar): Instead of requiring `b4_eval', just
1515 unquote one when outputting `b4_dollar_dollar'.
1517 * data/bison.simple (b4_eval): Remove.
1518 (b4_symbol_destructor): Adjust.
1519 * tests/input.at (Invalid @n): Adjust.
1521 2002-06-19 Zack Weinberg <zack@codesourcery.com>
1523 * doc/bison.texinfo: Document ability to have multiple
1526 2002-06-18 Akim Demaille <akim@epita.fr>
1528 * src/files.c (compute_base_names): When computing the output file
1529 names from the input file name, strip the directory part.
1531 2002-06-18 Akim Demaille <akim@epita.fr>
1533 * data/bison.simple.new: Comment changes.
1534 Reported by Andreas Schwab.
1536 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
1538 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
1539 there are no `label `yyoverflowlab' defined but not used' warnings
1540 when yyoverflow is defined.
1542 2002-06-18 Akim Demaille <akim@epita.fr>
1544 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
1546 (symbol_destructor_set): Adjust.
1547 * src/output.c (symbol_destructors_output): Output the destructor
1549 Output the symbol name.
1550 * data/bison.simple (b4_symbol_destructor): Adjust.
1552 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
1553 and Akim Demaille <akim@epita.fr>
1555 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
1556 what's left on the stack when the error recovery hits EOF.
1557 * tests/actions.at (Destructors): Complete to exercise this case.
1559 2002-06-17 Akim Demaille <akim@epita.fr>
1561 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
1562 arguments is really empty, not only equal to `[]'.
1563 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
1565 (symbol_destructor_set): New.
1566 * src/output.c (symbol_destructors_output): New.
1567 * src/reader.h (brace_code_t, current_braced_code): New.
1568 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
1569 (handle_dollar): Rename as...
1570 (handle_action_dollar): this.
1571 (handle_destructor_dollar): New.
1572 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
1573 (grammar_declaration): Use it.
1574 * data/bison.simple (yystos): Is always defined.
1575 (yydestructor): New.
1576 * tests/actions.at (Destructors): New.
1577 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
1579 2002-06-17 Akim Demaille <akim@epita.fr>
1581 * src/symlist.h, src/symlist.c (symbol_list_length): New.
1582 * src/scan-gram.l (handle_dollar, handle_at): Compute the
1583 rule_length only when needed.
1584 * src/output.c (actions_output, token_definitions_output): Output
1586 * src/symtab.c: Don't access directly to the symbol tag, use
1588 * src/parse-gram.y: Use symbol_list_free.
1590 2002-06-17 Akim Demaille <akim@epita.fr>
1592 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
1593 (symbol_list_prepend, get_type_name): Move to...
1594 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
1595 (symbol_list_prepend, symbol_list_n_type_name_get): here.
1597 (symbol_list_free): New.
1598 * src/scan-gram.l (handle_dollar): Takes a location.
1599 * tests/input.at (Invalid $n): Adjust.
1601 2002-06-17 Akim Demaille <akim@epita.fr>
1603 * src/reader.h, src/reader.c (symbol_list_new): Export it.
1604 (symbol_list_prepend): New.
1605 * src/parse-gram.y (%union): `list' is a new member.
1606 (symbols.1): New, replaces...
1607 (terms_to_prec.1, nterms_to_type.1): these.
1608 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
1609 Take a location as additional argument.
1612 2002-06-15 Akim Demaille <akim@epita.fr>
1614 * src/parse-gram.y: Move %token in the declaration section so that
1615 we don't depend upon CVS Bison.
1617 2002-06-15 Akim Demaille <akim@epita.fr>
1619 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
1620 * src/print.c (print_core): Use it.
1622 2002-06-15 Akim Demaille <akim@epita.fr>
1624 * src/conflicts.c (log_resolution): Accept the rule involved in
1625 the sr conflicts instead of the lookahead number that points to
1627 (flush_reduce): Accept the current lookahead vector as argument,
1628 instead of the index in LA.
1629 (resolve_sr_conflict): Accept the current number of lookahead
1630 bitset to consider for the STATE, instead of the index in LA.
1631 (set_conflicts): Adjust.
1632 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
1634 2002-06-15 Akim Demaille <akim@epita.fr>
1636 * src/state.h (state_t): Replace the `lookaheadsp' member, a
1637 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
1638 Adjust all dependencies.
1639 * src/lalr.c (initialize_lookaheads): Split into...
1640 (states_lookaheads_count, states_lookaheads_initialize): these.
1643 2002-06-15 Akim Demaille <akim@epita.fr>
1645 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
1647 (grammar_rules_print): here.
1648 * src/reduce.c (reduce_output): Use it.
1649 * tests/reduce.at (Useless Rules, Reduced Automaton)
1650 (Underivable Rules): Adjust.
1652 2002-06-15 Akim Demaille <akim@epita.fr>
1654 Copy BYacc's nice way to report the grammar.
1656 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
1658 Don't print the rules' location, it is confusing and useless.
1659 (rule_print): Use grammar_rhs_print.
1660 * src/print.c (print_grammar): Use grammar_rules_print.
1662 2002-06-15 Akim Demaille <akim@epita.fr>
1664 Complete and rationalize `useless thing' warnings.
1666 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
1667 (symbol_tag_print): New.
1668 Use them everywhere in place of accessing directly the tag member.
1669 * src/gram.h, src/gram.c (rule_print): New.
1670 Use it where a rule used to be printed `by hand'.
1671 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
1672 (reduce_grammar_tables): Report the useless rules.
1673 (reduce_print): Useless things are a warning, not an error.
1675 * tests/reduce.at (Useless Nonterminals, Useless Rules):
1676 (Reduced Automaton, Underivable Rules): Adjust.
1677 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
1678 * tests/conflicts.at (Unresolved SR Conflicts)
1679 (Solved SR Conflicts): Adjust.
1681 2002-06-15 Akim Demaille <akim@epita.fr>
1683 Let symbols have a location.
1685 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
1688 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
1689 Use location_t, not int.
1690 * src/symtab.c (symbol_check_defined): Take advantage of the
1692 * tests/regression.at (Invalid inputs): Adjust.
1694 2002-06-15 Akim Demaille <akim@epita.fr>
1696 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
1697 (input): Don't try to initialize yylloc here, do it in the
1699 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
1700 * src/gram.h (rule_t): Change line and action_line into location
1701 and action_location, of location_t type.
1702 Adjust all dependencies.
1703 * src/location.h, src/location.c (empty_location): New.
1704 * src/reader.h, src/reader.c (grammar_start_symbol_set)
1705 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
1706 (grammar_current_rule_symbol_append)
1707 (grammar_current_rule_action_append): Expect a location as argument.
1708 * src/reader.c (grammar_midrule_action): Adjust to attach an
1709 action's location as dummy symbol location.
1710 * src/symtab.h, src/symtab.c (startsymbol_location): New.
1711 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
1714 2002-06-14 Akim Demaille <akim@epita.fr>
1716 Grammar declarations may be found in the grammar section.
1718 * src/parse-gram.y (rules_or_grammar_declaration): New.
1719 (declarations): Each declaration may end with a semicolon, not
1721 (grammar_declaration): `"%union"'.
1722 (grammar): Branch to rules_or_grammar_declaration.
1724 2002-06-14 Akim Demaille <akim@epita.fr>
1726 * src/main.c (main): Invoke scanner_free.
1728 2002-06-14 Akim Demaille <akim@epita.fr>
1730 * src/output.c (m4_invoke): Extracted from...
1731 (output_skeleton): here.
1734 2002-06-14 Akim Demaille <akim@epita.fr>
1736 * src/parse-gram.y (directives, directive, gram)
1737 (grammar_directives, precedence_directives, precedence_directive):
1739 (declarations, declaration, grammar, grammar_declaration)
1740 (precedence_declaration, precedence_declarator): these.
1741 (symbol_declaration): New.
1743 2002-06-14 Akim Demaille <akim@epita.fr>
1745 * src/files.c (action_obstack): Remove, unused.
1746 (output_obstack): Remove it, and all its dependencies, as it is no
1748 * src/reader.c (epilogue_set): Build the epilogue in the
1750 * src/output.h, src/output.c (muscle_obstack): Move to...
1751 * src/muscle_tab.h, src/muscle_tab.h: here.
1752 (muscle_init): Initialize muscle_obstack.
1754 * src/main.c (main): Call it.
1756 2002-06-14 Akim Demaille <akim@epita.fr>
1758 * src/location.h: New, extracted from...
1759 * src/reader.h: here.
1760 * src/Makefile.am (noinst_HEADERS): Merge into
1761 (bison_SOURCES): this.
1763 * src/parse-gram.y: Use location_t instead of Bison's.
1764 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
1765 Use location_t instead of ints.
1767 2002-06-14 Akim Demaille <akim@epita.fr>
1769 * data/bison.simple, data/bison.c++: Be sure to restore the
1770 current #line when returning to the skeleton contents after having
1771 exposed the input file's #line.
1773 2002-06-12 Akim Demaille <akim@epita.fr>
1775 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
1777 * tests/actions.at (Exotic Dollars): New.
1779 2002-06-12 Akim Demaille <akim@epita.fr>
1781 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
1783 * tests/input.at (Torturing the Scanner): New.
1785 2002-06-11 Akim Demaille <akim@epita.fr>
1787 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
1788 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
1789 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
1790 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
1791 * src/reader.c (reader): Use it.
1793 2002-06-11 Akim Demaille <akim@epita.fr>
1795 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
1797 (scanner_last_string_free): New.
1799 2002-06-11 Akim Demaille <akim@epita.fr>
1801 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
1802 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
1803 (last_string, YY_OBS_FREE): New.
1804 Use them when returning an ID.
1806 2002-06-11 Akim Demaille <akim@epita.fr>
1808 Have Bison grammars parsed by a Bison grammar.
1810 * src/reader.c, src/reader.h (prologue_augment): New.
1811 * src/reader.c (copy_definition): Remove.
1813 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
1814 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
1815 (grammar_current_rule_prec_set, grammar_current_rule_check)
1816 (grammar_current_rule_symbol_append)
1817 (grammar_current_rule_action_append): Export.
1818 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
1819 (symbol_list_action_append): Remove.
1820 Hook the routines from reader.
1821 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
1822 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
1824 * src/reader.c (read_declarations): Remove, unused.
1826 * src/parse-gram.y: Handle the epilogue.
1827 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
1828 (grammar_start_symbol_set): this.
1829 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
1830 * src/reader.c (readgram): Remove, unused.
1831 (reader): Adjust to insert eoftoken and axiom where appropriate.
1833 * src/reader.c (copy_dollar): Replace with...
1834 * src/scan-gram.h (handle_dollar): this.
1835 * src/parse-gram.y: Remove `%thong'.
1837 * src/reader.c (copy_at): Replace with...
1838 * src/scan-gram.h (handle_at): this.
1840 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
1843 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
1846 * src/reader.h, src/reader.c (grammar_rule_end): New.
1848 * src/parse.y (current_type, current_class): New.
1849 Implement `%nterm', `%token' support.
1850 Merge `%term' into `%token'.
1851 (string_as_id): New.
1852 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
1855 * src/parse-gram.y: Be sure to handle properly the beginning of
1858 * src/parse-gram.y: Handle %type.
1859 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
1861 * src/parse-gram.y: More directives support.
1862 * src/options.c: No longer handle source directives.
1864 * src/parse-gram.y: Fix %output.
1866 * src/parse-gram.y: Handle %union.
1867 Use the prologue locations.
1868 * src/reader.c (parse_union_decl): Remove.
1870 * src/reader.h, src/reader.c (epilogue_set): New.
1871 * src/parse-gram.y: Use it.
1873 * data/bison.simple, data/bison.c++: b4_stype is now either not
1874 defined, then default to int, or to the contents of %union,
1875 without `union' itself.
1877 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
1879 * src/output.c (actions_output): Don't output braces, as they are
1880 already handled by the scanner.
1882 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
1883 characters to themselves.
1885 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
1886 that the epilogue has a proper #line.
1888 * src/parse-gram.y: Handle precedence/associativity.
1890 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
1892 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
1893 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
1894 at all to define terminals that cannot be emitted.
1896 * src/scan-gram.l: Escape M4 characters.
1898 * src/scan-gram.l: Working properly with escapes in user
1901 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
1902 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
1904 Use more modest sizes, as for the time being the parser does not
1905 release memory, and therefore the process swallows a huge amount
1908 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
1909 stricter %token grammar.
1911 * src/symtab.h (associativity): Add `undef_assoc'.
1912 (symbol_precedence_set): Do nothing when passed an undef_assoc.
1913 * src/symtab.c (symbol_check_alias_consistence): Adjust.
1915 * tests/regression.at (Invalid %directive): Remove, as it is now
1917 (Invalid inputs): Adjust to the new error messages.
1918 (Token definitions): The new grammar doesn't allow too many
1921 * src/lex.h, src/lex.c: Remove.
1922 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
1923 (copy_character, copy_string2, copy_string, copy_identifier)
1924 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
1925 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
1926 (parse_action): Remove.
1927 * po/POTFILES.in: Adjust.
1929 2002-06-11 Akim Demaille <akim@epita.fr>
1931 * src/reader.c (parse_action): Don't store directly into the
1932 rule's action member: return the action as a string.
1933 Don't require `rule_length' as an argument: compute it.
1934 (grammar_current_rule_symbol_append)
1935 (grammar_current_rule_action_append): New, eved out from
1937 Remove `action_flag', `rulelength', unused now.
1939 2002-06-11 Akim Demaille <akim@epita.fr>
1941 * src/reader.c (grammar_current_rule_prec_set).
1942 (grammar_current_rule_check): New, eved out from...
1944 Remove `xaction', `first_rhs': useless.
1945 * tests/input.at (Type clashes): New.
1946 * tests/existing.at (GNU Cim Grammar): Adjust.
1948 2002-06-11 Akim Demaille <akim@epita.fr>
1950 * src/reader.c (grammar_midrule_action): New, Eved out from
1953 2002-06-11 Akim Demaille <akim@epita.fr>
1955 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
1957 (readgram): Use them as replacement of inlined code, crule and
1960 2002-06-11 Akim Demaille <akim@epita.fr>
1962 * src/reader.c (grammar_end, grammar_symbol_append): New.
1963 (readgram): Use them.
1964 Make the use of `p' as local as possible.
1966 2002-06-10 Akim Demaille <akim@epita.fr>
1968 GCJ's parser requires the tokens to be defined before the prologue.
1970 * data/bison.simple: Output the token definition before the user's
1972 * tests/regression.at (Braces parsing, Duplicate string)
1973 (Mixing %token styles): Check the output from bison.
1974 (Early token definitions): New.
1976 2002-06-10 Akim Demaille <akim@epita.fr>
1978 * src/symtab.c (symbol_user_token_number_set): Don't complain when
1979 assigning twice the same user number to a token, so that we can
1981 * src/lex.c (lex): here.
1982 Also use `symbol_class_set' instead of hand written code.
1983 * src/reader.c (parse_assoc_decl): Likewise.
1985 2002-06-10 Akim Demaille <akim@epita.fr>
1987 * src/symtab.c, src/symtab.c (symbol_class_set)
1988 (symbol_user_token_number_set): New.
1989 * src/reader.c (parse_token_decl): Use them.
1990 Use a switch instead of ifs.
1991 Use a single argument.
1993 2002-06-10 Akim Demaille <akim@epita.fr>
1995 Remove `%thong' support as it is undocumented, unused, duplicates
1996 `%token's job, and creates useless e-mail traffic with people who
1997 want to know what it is, why it is undocumented, unused, and
1998 duplicates `%token's job.
2000 * src/reader.c (parse_thong_decl): Remove.
2001 * src/options.c (option_table): Remove "thong".
2002 * src/lex.h (tok_thong): Remove.
2004 2002-06-10 Akim Demaille <akim@epita.fr>
2006 * src/symtab.c, src/symtab.c (symbol_type_set)
2007 (symbol_precedence_set): New.
2008 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
2009 (value_components_used): Remove, unused.
2011 2002-06-09 Akim Demaille <akim@epita.fr>
2013 Move symbols handling code out of the reader.
2015 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
2017 * src/symtab.h, src/symtab.c: here.
2019 * src/gram.c (start_symbol): Remove: use startsymbol->number.
2020 * src/reader.c (startval): Rename as...
2021 * src/symtab.h, src/symtab.c (startsymbol): this.
2022 * src/reader.c: Adjust.
2024 * src/reader.c (symbol_check_defined, symbol_make_alias)
2025 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2026 (token_translations_init)
2028 * src/symtab.c: here.
2029 * src/reader.c (packsymbols): Move to...
2030 * src/symtab.h, src/symtab.c (symbols_pack): here.
2031 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
2034 2002-06-03 Akim Demaille <akim@epita.fr>
2036 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
2039 2002-06-03 Akim Demaille <akim@epita.fr>
2041 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
2042 structs with non literals.
2043 * src/scan-skel.l: never-interactive.
2044 * src/conflicts.c (enum conflict_resolution_e): No trailing
2046 * src/getargs.c (usage): Split long literal strings.
2047 Reported by Hans Aberg.
2049 2002-05-28 Akim Demaille <akim@epita.fr>
2051 * data/bison.c++: Use C++ ostreams.
2052 (cdebug_): New member.
2054 2002-05-28 Akim Demaille <akim@epita.fr>
2056 * src/output.c (output_skeleton): Be sure to allocate enough room
2057 for `/' _and_ for `\0' in full_skeleton.
2059 2002-05-28 Akim Demaille <akim@epita.fr>
2061 * data/bison.c++: Catch up with bison.simple:
2062 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2063 and Paul Eggert <eggert@twinsun.com>: `error' handing.
2064 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
2067 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2069 * src/output.c (output_skeleton): Put an explicit path in front of
2070 the skeleton file name, rather than relying on the -I directory,
2071 to partially alleviate effects of having a skeleton file lying around
2072 in the current directory.
2074 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2076 * src/conflicts.c (log_resolution): Correct typo:
2077 obstack_printf should be obstack_fgrow1.
2079 2002-05-26 Akim Demaille <akim@epita.fr>
2081 * src/state.h (state_t): `solved_conflicts' is a new member.
2082 * src/LR0.c (new_state): Set it to 0.
2083 * src/conflicts.h, src/conflicts.c (print_conflicts)
2084 (free_conflicts, solve_conflicts): Rename as...
2085 (conflicts_print, conflicts_free, conflicts_solve): these.
2087 * src/conflicts.c (enum conflict_resolution_e)
2088 (solved_conflicts_obstack): New, used by...
2089 (log_resolution): this.
2090 Adjust to attach the conflict resolution to each state.
2091 Complete the description with the precedence/associativity
2093 (resolve_sr_conflict): Adjust.
2094 * src/print.c (print_state): Output its solved_conflicts.
2095 * tests/conflicts.at (Unresolved SR Conflicts)
2096 (Solved SR Conflicts): Exercise --report=all.
2098 2002-05-26 Akim Demaille <akim@epita.fr>
2100 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2101 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2102 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
2103 (token_number_t, item_number_as_token_number)
2104 (token_number_as_item_number, muscle_insert_token_number_table):
2106 (symbol_number_t, item_number_as_symbol_number)
2107 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
2108 these, since it is more appropriate.
2110 2002-05-26 Akim Demaille <akim@epita.fr>
2112 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
2114 * data/bison.simple (yystos) [YYDEBUG]: New.
2115 (yyparse) [YYDEBUG]: Display the symbols which are popped during
2117 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
2119 2002-05-25 Akim Demaille <akim@epita.fr>
2121 * doc/bison.texinfo (Debugging): Split into...
2122 (Tracing): this new section, its former contents, and...
2123 (Understanding): this new section.
2124 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
2126 (report_flag): this.
2127 Adjust all dependencies.
2128 (report_args, report_types, report_argmatch): New.
2129 (usage, getargs): Report/support -r, --report.
2131 (struct option_table_struct): Rename as..,
2132 (struct option_table_s): this.
2133 Rename the `set_flag' member to `flag' to match with getopt_long's
2135 * src/options.c (option_table): Split verbose into an entry for
2136 %verbose, and another for --verbose.
2137 Support --report/-r, so remove -r from the obsolete --raw.
2138 * src/print.c: Attach full item sets and lookaheads reports to
2139 report_flag instead of trace_flag.
2140 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2142 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2143 and Paul Eggert <eggert@twinsun.com>
2145 * data/bison.simple (yyparse): Correct error handling to conform to
2146 POSIX and yacc. Specifically, after syntax error is discovered,
2147 do not reduce further before shifting the error token.
2148 Clean up the code a bit by removing the labels yyerrdefault,
2149 yyerrhandle, yyerrpop.
2150 * NEWS: Document the above.
2152 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2154 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
2155 type; it isn't always big enough, since it doesn't necessarily
2156 include non-terminals.
2157 (yytranslate): Expand definition of yy_token_number_type, so that
2158 the latter can be removed.
2159 (yy_token_number_type): Remove, only one use.
2160 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
2161 don't use TokenNumberType as element type.
2163 * tests/regression.at: Modify expected output to agree with change
2164 to yyr1 and yytranslate.
2166 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
2168 * src/reader.c (parse_action): Use copy_character instead of
2171 2002-05-13 Akim Demaille <akim@epita.fr>
2173 * tests/regression.at (Token definitions): Prototype yylex and
2176 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2178 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
2179 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
2181 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
2183 2002-05-07 Akim Demaille <akim@epita.fr>
2185 * tests/synclines.at: Be sure to prototype yylex and yyerror to
2188 2002-05-07 Akim Demaille <akim@epita.fr>
2192 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
2193 over the RHS of each rule.
2194 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
2195 * src/state.h (state_t): Member `nitems' is unsigned short.
2196 * src/LR0.c (get_state): Adjust.
2197 * src/reader.c (packgram): Likewise.
2198 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
2200 (muscle_insert_int_table): Remove, unused.
2201 (prepare_rules): Remove `max'.
2203 2002-05-06 Akim Demaille <akim@epita.fr>
2205 * src/closure.c (print_firsts): Display of the symbol tags.
2206 (bitmatrix_print): Move to...
2207 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
2209 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
2211 2002-05-06 Akim Demaille <akim@epita.fr>
2213 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
2216 2002-05-06 Akim Demaille <akim@epita.fr>
2218 * src/LR0.c (new_state, get_state): Instead of using the global
2219 `kernel_size' and `kernel_base', have two new arguments:
2220 `core_size' and `core'.
2223 2002-05-06 Akim Demaille <akim@epita.fr>
2225 * src/reader.c (packgram): No longer end `ritem' with a 0
2226 sentinel: it is not used.
2228 2002-05-05 Akim Demaille <akim@epita.fr>
2230 New experimental feature: display the lookaheads in the report and
2233 * src/print (print_core): When --trace-flag, display the rules
2235 * src/print_graph.c (print_core): Likewise.
2239 2002-05-05 Akim Demaille <akim@epita.fr>
2241 * tests/torture.at (Many lookaheads): New test.
2243 2002-05-05 Akim Demaille <akim@epita.fr>
2245 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
2246 (GENERATE_MUSCLE_INSERT_TABLE): this.
2247 (output_int_table, output_unsigned_int_table, output_short_table)
2248 (output_token_number_table, output_item_number_table): Replace with...
2249 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
2250 (muscle_insert_short_table, muscle_insert_token_number_table)
2251 (muscle_insert_item_number_table): these.
2253 (prepare_tokens): Don't free `translations', since...
2254 * src/reader.h, src/reader.c (grammar_free): do it.
2256 * src/gram.h, src/gram.c (grammar_free): here.
2257 * data/bison.simple, data/bison.c++: b4_token_number_max is now
2260 2002-05-05 Akim Demaille <akim@epita.fr>
2262 * src/output.c (output_unsigned_int_table): New.
2263 (prepare_rules): `i' is unsigned.
2264 `prhs', `rline', `r2' are unsigned int.
2265 Rename muscle `rhs_number_max' as `rhs_max'.
2266 Output muscles `prhs_max', `rline_max', and `r2_max'.
2268 * data/bison.simple, data/bison.c++: Adjust to use these muscles
2269 to compute types instead of constant types.
2270 * tests/regression.at (Web2c Actions): Adjust.
2272 2002-05-04 Akim Demaille <akim@epita.fr>
2274 * src/symtab.h (SALIAS, SUNDEF): Rename as...
2275 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
2276 Adjust dependencies.
2277 * src/output.c (token_definitions_output): Be sure not to output a
2278 `#define 'a'' when fed with `%token 'a' "a"'.
2279 * tests/regression.at (Token definitions): New.
2281 2002-05-03 Paul Eggert <eggert@twinsun.com>
2283 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
2286 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
2288 * Makefile.am (SUBDIRS): Remove intl.
2289 (EXTRA_DIST): Add config/config.rpath.
2291 2002-05-03 Akim Demaille <akim@epita.fr>
2293 * data/bison.simple (m4_if): Don't output empty enums.
2294 And actually, output valid enum definitions :(.
2296 2002-05-03 Akim Demaille <akim@epita.fr>
2298 * configure.bat: Remove, completely obsolete.
2299 * Makefile.am (EXTRA_DIST): Adjust.
2300 Don't distribute config.rpath...
2301 * config/Makefile.am (EXTRA_DIST): Do it.
2303 2002-05-03 Akim Demaille <akim@epita.fr>
2305 * configure.in (GETTEXT_VERSION): New.
2306 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
2308 2002-05-03 Akim Demaille <akim@epita.fr>
2310 * data/bison.simple (b4_token_enum): New.
2311 (b4_token_defines): Use it to output tokens both as #define and
2313 Suggested by Paul Eggert.
2314 * src/output.c (token_definitions_output): Don't output spurious
2317 2002-05-03 Akim Demaille <akim@epita.fr>
2319 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2321 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
2323 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
2324 Update the stack class, give a try to deque as the default container.
2326 2002-05-02 Akim Demaille <akim@epita.fr>
2328 * data/bison.simple (yyparse): Do not implement @$ = @1.
2329 (YYLLOC_DEFAULT): Adjust to do it.
2330 * doc/bison.texinfo (Location Default Action): Fix.
2332 2002-05-02 Akim Demaille <akim@epita.fr>
2334 * src/reader.c (parse_braces): Merge into...
2335 (parse_action): this.
2337 2002-05-02 Akim Demaille <akim@epita.fr>
2339 * configure.in (ALL_LINGUAS): Remove.
2340 * po/LINGUAS, hr.po: New.
2342 2002-05-02 Akim Demaille <akim@epita.fr>
2344 Remove the so called hairy (semantic) parsers.
2346 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
2347 * src/gram.h, src/gram.c (semantic_parser): Remove.
2348 (rule_t): Remove the guard and guard_line members.
2349 * src/lex.h (token_t): remove tok_guard.
2350 * src/options.c (option_table): Remove %guard and %semantic_parser
2352 * src/output.c, src/output.h (guards_output): Remove.
2354 (token_definitions_output): Don't output the `T'
2356 (output_skeleton): Don't output the guards.
2357 * src/files.c, src/files.c (attrsfile): Remove.
2358 * src/reader.c (symbol_list): Remove the guard and guard_line
2360 Adjust dependencies.
2361 (parse_guard): Remove.
2362 * data/bison.hairy: Remove.
2363 * doc/bison.texinfo (Environment Variables): Remove occurrences of
2366 2002-05-02 Akim Demaille <akim@epita.fr>
2368 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
2369 (parse_guard): Rename the formal argument `stack_offset' as
2370 `rule_length', which is more readable.
2372 (copy_at, copy_dollar): Instead of outputting the hard coded
2373 values of $$, $n and so forth, output invocation to b4_lhs_value,
2374 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
2375 Note: this patch partially drops `semantic-parser' support: it
2376 always does `rule_length - n', where semantic parsers ought to
2378 * data/bison.simple, data/bison.c++ (b4_lhs_value)
2379 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
2381 2002-05-02 Akim Demaille <akim@epita.fr>
2383 * configure.in (AC_INIT): Bump to 1.49b.
2384 (AM_INIT_AUTOMAKE): Short invocation.
2386 2002-05-02 Akim Demaille <akim@epita.fr>
2390 2002-05-01 Akim Demaille <akim@epita.fr>
2392 * src/skeleton.h: Remove.
2394 2002-05-01 Akim Demaille <akim@epita.fr>
2396 * src/skeleton.h: Fix the #endif.
2397 Reported by Magnus Fromreide.
2399 2002-04-26 Paul Eggert <eggert@twinsun.com>
2401 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
2402 Define if we define YYSTYPE and YYLTYPE, respectively.
2403 (YYCOPY): Fix [] quoting problem in the non-GCC case.
2405 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
2407 * src/scan-skel.l: Postprocess quadrigraphs.
2409 * src/reader.c (copy_character): New function, used to output
2410 single characters while replacing `[' and `]' with quadrigraphs, to
2411 avoid troubles with M4 quotes.
2412 (copy_comment): Output characters with copy_character.
2413 (read_additionnal_code): Likewise.
2414 (copy_string2): Likewise.
2415 (copy_definition): Likewise.
2417 * tests/calc.at: Exercise M4 quoting.
2419 2002-04-25 Akim Demaille <akim@epita.fr>
2421 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
2422 between `!' and the command.
2423 Reported by Paul Eggert.
2425 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
2427 * tests/calc.at: Exercise prologue splitting.
2429 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
2430 `b4_post_prologue' instead of `b4_prologue'.
2432 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
2434 (output): Free pre_prologue_obstack and post_prologue_obstack.
2435 * src/files.h, src/files.c (attrs_obstack): Remove.
2436 (pre_prologue_obstack, post_prologue_obstack): New.
2437 * src/reader.c (copy_definition): Add a parameter to specify the
2438 obstack to fill, instead of using attrs_obstack unconditionally.
2439 (read_declarations): Pass pre_prologue_obstack to copy_definition if
2440 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
2442 2002-04-23 Paul Eggert <eggert@twinsun.com>
2444 * data/bison.simple: Remove unnecessary commentary and white
2445 space differences from 1_29-branch.
2446 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
2448 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
2449 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
2450 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
2451 constructors or destructors.
2453 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
2455 2002-04-23 Akim Demaille <akim@epita.fr>
2457 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
2458 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
2459 location with columns.
2460 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
2461 All reported by Paul Eggert.
2463 2002-04-22 Akim Demaille <akim@epita.fr>
2465 * src/reduce.c (dump_grammar): Move to...
2466 * src/gram.h, src/gram.c (grammar_dump): here.
2467 Be sure to separate long item numbers.
2468 Don't read the members of a rule's prec if its nil.
2470 2002-04-22 Akim Demaille <akim@epita.fr>
2472 * src/output.c (table_size, table_grow): New.
2473 (MAXTABLE): Remove, replace uses with table_size.
2474 (pack_vector): Instead of dying when the table is too big, grow it.
2476 2002-04-22 Akim Demaille <akim@epita.fr>
2478 * data/bison.simple (yyr1): Its type is that of a token number.
2479 * data/bison.c++ (r1_): Likewise.
2480 * tests/regression.at (Web2c Actions): Adjust.
2482 2002-04-22 Akim Demaille <akim@epita.fr>
2484 * src/reader.c (token_translations_init): 256 is now the default
2485 value for the error token, i.e., it will be assigned another
2486 number if the user assigned 256 to one of her tokens.
2487 (reader): Don't force 256 to error.
2488 * doc/bison.texinfo (Symbols): Adjust.
2489 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
2490 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
2491 etc. instead of 10, 20, 30 (which was used to `jump' over error
2492 (256) and undefined (2)).
2494 2002-04-22 Akim Demaille <akim@epita.fr>
2496 Propagate more token_number_t.
2498 * src/gram.h (token_number_as_item_number)
2499 (item_number_as_token_number): New.
2500 * src/output.c (GENERATE_OUTPUT_TABLE): New.
2501 Use it to create output_item_number_table and
2502 output_token_number_table.
2503 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2504 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
2505 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
2506 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
2508 2002-04-22 Akim Demaille <akim@epita.fr>
2510 * src/output.h, src/output.c (get_lines_number): Remove.
2512 2002-04-19 Akim Demaille <akim@epita.fr>
2514 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
2516 (Debugging): More details about enabling the debugging features.
2517 (Table of Symbols): Describe $$, $n, @$, and @n.
2518 Suggested by Tim Josling.
2520 2002-04-19 Akim Demaille <akim@epita.fr>
2522 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
2524 2002-04-10 Akim Demaille <akim@epita.fr>
2526 * src/system.h: Rely on HAVE_LIMITS_H.
2527 Suggested by Paul Eggert.
2529 2002-04-09 Akim Demaille <akim@epita.fr>
2531 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
2532 full stderr, and strip it according to the bison options, instead
2533 of composing the error message from different bits.
2534 This makes it easier to check for several error messages.
2535 Adjust all the invocations.
2536 Add an invocation exercising the error token.
2537 Add an invocation demonstrating a stupid error message.
2538 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
2540 Error message are for stderr, not stdout.
2542 2002-04-09 Akim Demaille <akim@epita.fr>
2544 * src/gram.h, src/gram.c (error_token_number): Remove, use
2546 * src/reader.c (reader): Don't specify the user token number (2)
2547 for $undefined, as it uselessly prevents using it.
2548 * src/gram.h (token_number_t): Move to...
2549 * src/symtab.h: here.
2550 (state_t.number): Is a token_number_t.
2551 * src/print.c, src/reader.c: Use undeftoken->number instead of
2553 (Even though this 2 is not the same as above: the number of the
2554 undeftoken remains being 2, it is its user token number which
2556 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
2557 `user_token_number_max'.
2558 Output `undef_token_number'.
2559 * data/bison.simple, data/bison.c++: Use them.
2560 Be sure to map invalid yylex return values to
2561 `undef_token_number'. This saves us from gratuitous SEGV.
2563 * tests/conflicts.at (Solved SR Conflicts)
2564 (Unresolved SR Conflicts): Adjust.
2565 * tests/regression.at (Web2c Actions): Adjust.
2567 2002-04-08 Akim Demaille <akim@epita.fr>
2569 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
2571 Remove the duplicate `typedefs'.
2572 (RhsNumberType): Fix the declaration and various other typos.
2574 * data/bison.simple: Use __ofile__.
2575 * src/scan-skel.l: Handle __ofile__.
2577 2002-04-08 Akim Demaille <akim@epita.fr>
2579 * src/gram.h (item_number_t): New, the type of item numbers in
2580 RITEM. Note that it must be able to code symbol numbers as
2581 positive number, and the negation of rule numbers as negative
2583 Adjust all dependencies (pretty many).
2584 * src/reduce.c (rule): Remove this `short *' pointer: use
2586 * src/system.h (MINSHORT, MAXSHORT): Remove.
2588 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
2590 (MAXTABLE): Move to...
2591 * src/output.c (MAXTABLE): here.
2592 (prepare_rules): Use output_int_table to output rhs.
2593 * data/bison.simple, data/bison.c++: Adjust.
2594 * tests/torture.at (Big triangle): Move the limit from 254 to
2596 * tests/regression.at (Web2c Actions): Ajust.
2598 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
2599 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
2600 passes, but produces negative #line number, once fixed, GCC is
2601 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
2603 * src/state.h (state_h): Code input lines on ints, not shorts.
2605 2002-04-08 Akim Demaille <akim@epita.fr>
2607 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
2608 and then the grammar.
2610 2002-04-08 Akim Demaille <akim@epita.fr>
2612 * src/system.h: No longer using strndup.
2614 2002-04-07 Akim Demaille <akim@epita.fr>
2616 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
2617 * src/output.c (output_table_data): Return the longest number.
2618 (prepare_tokens): Output `token_number_max').
2619 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
2621 Use them to define yy_token_number_type/TokenNumberType.
2622 Use this type for yytranslate.
2623 * tests/torture.at (Big triangle): Push the limit from 124 to
2625 * tests/regression.at (Web2c Actions): Adjust.
2627 2002-04-07 Akim Demaille <akim@epita.fr>
2629 * tests/torture.at (Big triangle): New.
2630 (GNU AWK Grammar, GNU Cim Grammar): Move to...
2631 * tests/existing.at: here.
2633 2002-04-07 Akim Demaille <akim@epita.fr>
2635 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
2637 Adjust dependencies.
2639 2002-04-07 Akim Demaille <akim@epita.fr>
2641 * src/reader.c: Normalize increments to prefix form.
2643 2002-04-07 Akim Demaille <akim@epita.fr>
2645 * src/reader.c, symtab.c: Remove debugging code.
2647 2002-04-07 Akim Demaille <akim@epita.fr>
2649 Rename all the `bucket's as `symbol_t'.
2651 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
2652 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
2653 * src/symtab.c, src/symtab.h (bucket): Rename as...
2655 (symbol_list_new, bucket_check_defined, bucket_make_alias)
2656 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
2657 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2658 (buckets_new, buckets_free, buckets_do): Rename as...
2659 (symbol_list_new, symbol_check_defined, symbol_make_alias)
2660 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2661 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
2662 (symbols_new, symbols_free, symbols_do): these.
2664 2002-04-07 Akim Demaille <akim@epita.fr>
2666 Use lib/hash for the symbol table.
2668 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
2670 * src/lex.c (lex): Set the `number' member of new terminals.
2671 * src/reader.c (bucket_check_defined, bucket_make_alias)
2672 (bucket_check_alias_consistence, bucket_translation): New.
2673 (reader, grammar_free, readgram, token_translations_init)
2674 (packsymbols): Adjust.
2675 (reader): Number the predefined tokens.
2676 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
2677 for predefined tokens.
2678 * src/symtab.h (bucket): Remove all the hash table related
2680 * src/symtab.c (symtab): Replace by...
2681 (bucket_table): this.
2682 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
2683 (buckets_new, buckets_do): New.
2685 2002-04-07 Akim Demaille <akim@epita.fr>
2687 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
2688 (start_symbol, max_user_token_number, semantic_parser)
2689 (error_token_number): Initialize.
2690 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
2693 (errtoken, eoftoken, undeftoken, axiom): Extern.
2695 2002-04-07 Akim Demaille <akim@epita.fr>
2697 * src/gram.h (rule_s): prec and precsym are now pointers
2698 to the bucket giving the priority/associativity.
2699 Member `associativity' removed: useless.
2700 * src/reduce.c, src/conflicts.c: Adjust.
2702 2002-04-07 Akim Demaille <akim@epita.fr>
2704 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
2705 Properly escape the symbols' TAG when outputting them.
2707 2002-04-07 Akim Demaille <akim@epita.fr>
2709 * src/lalr.h (LA): Is a bitsetv, not bitset*.
2711 2002-04-07 Akim Demaille <akim@epita.fr>
2713 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
2714 (LArule): this, which is an array to rule_t*.
2715 * src/print.c, src/conflicts.c: Adjust.
2717 2002-04-07 Akim Demaille <akim@epita.fr>
2719 * src/gram.h (rule_t): Rename `number' as `user_number'.
2720 `number' is a new member.
2721 Adjust dependencies.
2722 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
2724 2002-04-07 Akim Demaille <akim@epita.fr>
2726 As a result of the previous patch, it is no longer needed
2727 to reorder ritem itself.
2729 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
2731 2002-04-07 Akim Demaille <akim@epita.fr>
2733 Be sure never to walk through RITEMS, but use only data related to
2734 the rules themselves. RITEMS should be banished.
2736 * src/output.c (output_token_translations): Rename as...
2737 (prepare_tokens): this.
2738 In addition to `translate', prepare the muscles `tname' and
2739 `toknum', which were handled by...
2740 (output_rule_data): this.
2741 Remove, and move the remainder of its outputs into...
2742 (prepare_rules): this new routines, which also merges content from
2743 (output_gram): this.
2744 (prepare_rules): Be sure never to walk through RITEMS.
2745 (output_stos): Rename as...
2746 (prepare_stos): this.
2747 (output): Always invoke prepare_states, after all, just don't use it
2748 in the output if you don't need it.
2750 2002-04-07 Akim Demaille <akim@epita.fr>
2752 * src/LR0.c (new_state): Display `nstates' as the name of the
2753 newly created state.
2754 Adjust to initialize first_state and last_state if needed.
2755 Be sure to distinguish the initial from the final state.
2756 (new_states): Create the itemset of the initial state, and use
2758 * src/closure.c (closure): Now that the initial state has its
2759 items properly set, there is no need for a special case when
2762 As a result, now the rule 0, reducing to $axiom, is visible in the
2763 outputs. Adjust the test suite.
2765 * tests/conflicts.at (Solved SR Conflicts)
2766 (Unresolved SR Conflicts): Adjust.
2767 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
2768 * tests/conflicts.at (S/R in initial): New.
2770 2002-04-07 Akim Demaille <akim@epita.fr>
2772 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
2773 the RHS of the rules.
2774 * src/output.c (output_gram): Likewise.
2776 2002-04-07 Akim Demaille <akim@epita.fr>
2778 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
2780 Adjust all dependencies.
2781 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
2782 `number' of the buckets too.
2783 * src/gram.h: Include `symtab.h'.
2784 (associativity): Move to...
2785 * src/symtab.h: here.
2786 No longer include `gram.h'.
2788 2002-04-07 Akim Demaille <akim@epita.fr>
2790 * src/gram.h, src/gram.c (rules_rhs_length): New.
2791 (ritem_longest_rhs): Use it.
2792 * src/gram.h (rule_t): `number' is a new member.
2793 * src/reader.c (packgram): Set it.
2794 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
2795 the end of `rules', and count them out of `nrules'.
2796 (reduce_output, dump_grammar): Adjust.
2797 * src/print.c (print_grammar): It is no longer needed to check for
2798 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
2799 * tests/reduce.at (Reduced Automaton): New test.
2801 2002-04-07 Akim Demaille <akim@epita.fr>
2803 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
2804 lacking `+ 1' to nrules, Bison reported as useless a token if it
2805 was used solely to set the precedence of the last rule...
2807 2002-04-07 Akim Demaille <akim@epita.fr>
2809 * data/bison.c++, data/bison.simple: Don't output the current file
2810 name in #line, to avoid useless diffs between two identical
2811 outputs under different names.
2813 2002-04-07 Akim Demaille <akim@epita.fr>
2815 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
2816 Normalize loops to using `< nrules + 1', not `<= nrules'.
2818 2002-04-07 Akim Demaille <akim@epita.fr>
2822 2002-04-07 Akim Demaille <akim@epita.fr>
2824 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
2825 bucket.value as bucket.number.
2827 2002-04-07 Akim Demaille <akim@epita.fr>
2829 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
2830 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2831 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
2832 RHS, instead of being an index in RITEMS.
2834 2002-04-04 Paul Eggert <eggert@twinsun.com>
2836 * doc/bison.texinfo: Update copyright date.
2837 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
2838 (Symbols): Warn about running Bison in one character set,
2839 but compiling and/or running in an incompatible one.
2840 Warn about character code 256, too.
2842 2002-04-03 Paul Eggert <eggert@twinsun.com>
2844 * src/bison.data (YYSTACK_ALLOC): Depend on whether
2845 YYERROR_VERBOSE is nonzero, not whether it is defined.
2847 Merge changes from bison-1_29-branch.
2849 2002-03-20 Paul Eggert <eggert@twinsun.com>
2851 Merge fixes from Debian bison_1.34-1.diff.
2853 * configure.in (AC_PREREQ): 2.53.
2855 2002-03-20 Akim Demaille <akim@epita.fr>
2857 * src/conflicts.c (log_resolution): Argument `resolution' is const.
2859 2002-03-19 Paul Eggert <eggert@twinsun.com>
2861 * src/bison.simple (YYCOPY): New macro.
2862 (YYSTACK_RELOCATE): Use it.
2863 Remove Type arg; no longer needed. All callers changed.
2864 (yymemcpy): Remove; no longer needed.
2866 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
2867 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2869 2002-03-19 Akim Demaille <akim@epita.fr>
2871 Test and fix the #line outputs.
2873 * tests/atlocal.at (GCC): New.
2874 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
2875 (Prologue synch line, ,%union synch line, Postprologue synch line)
2876 (Action synch line, Epilogue synch line): New tests.
2877 * src/reader.c (parse_union_decl): Define the muscle stype_line.
2878 * data/bison.simple, data/bison.c++: Use it.
2880 2002-03-19 Akim Demaille <akim@epita.fr>
2882 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
2883 (Solved SR Conflicts, %expect not enough, %expect right)
2884 (%expect too much): Move to...
2885 * tests/conflicts.at: this new file.
2887 2002-03-19 Akim Demaille <akim@epita.fr>
2889 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2890 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
2891 that we can move to enums for instance.
2892 * src/output.c (token_definitions_output): Output a list of
2893 `token-name, token-number' instead of the #define.
2894 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
2896 2002-03-14 Akim Demaille <akim@epita.fr>
2900 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
2902 * data/bison.c++: Make the user able to add members to the generated
2903 parser by subclassing.
2905 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
2907 * src/reader.c (read_additionnal_code): `c' should be an integer, not
2909 Reported by Nicolas Tisserand and Nicolas Burrus.
2911 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
2913 * src/reader.c: Warn about lacking semi-colons, do not complain.
2915 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
2917 * data/bison.c++: Remove a debug line.
2919 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
2921 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
2922 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
2923 provide a default implementation.
2925 2002-03-04 Akim Demaille <akim@epita.fr>
2927 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
2928 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
2929 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
2930 * tests/semantic.at (Parsing Guards): Similarly.
2931 * src/reader.at (readgram): Complain if the last rule is not ended
2934 2002-03-04 Akim Demaille <akim@epita.fr>
2936 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
2937 * src/closure.c: here.
2938 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
2940 * src/warshall.h, src/warshall.c: Remove.
2941 * tests/sets.at (Broken Closure): Adjust.
2943 2002-03-04 Akim Demaille <akim@epita.fr>
2945 * src/output.c (output_skeleton): tempdir is const.
2946 bytes_read is unused.
2948 2002-03-04 Akim Demaille <akim@epita.fr>
2950 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2951 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
2955 2002-03-04 Akim Demaille <akim@epita.fr>
2957 * src/closure.c (closure): `r' is unused.
2959 2002-03-04 Akim Demaille <akim@epita.fr>
2961 * tests/sets.at (Broken Closure): Add the ending `;'.
2962 * src/reader.at (readgram): Complain if a rule is not ended with a
2965 2002-03-04 Akim Demaille <akim@epita.fr>
2967 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
2968 (count_sr_conflicts): Use bitset_count.
2969 * src/reduce.c (inaccessable_symbols): Ditto.
2970 (bits_size): Remove.
2971 * src/warshall.h, src/warshall.c: Convert to bitsetv.
2973 2002-03-04 Akim Demaille <akim@epita.fr>
2975 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
2976 * src/reduce.c: Remove the `bitset_zero's following the
2977 `bitset_create's, as now it is performed by the latter.
2979 2002-03-04 Akim Demaille <akim@epita.fr>
2981 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
2982 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
2983 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
2984 latest sources from Michael.
2986 2002-03-04 Akim Demaille <akim@epita.fr>
2988 * src/output.c (output): Don't free the grammar.
2989 * src/reader.c (grammar_free): New.
2990 * src/main.c (main): Call it and don't free symtab here.
2992 2002-03-04 Akim Demaille <akim@epita.fr>
2994 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
2996 Reported by Benoit Perrot.
2998 2002-03-04 Akim Demaille <akim@epita.fr>
3000 Use bitset operations when possible, not loops over bits.
3002 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
3004 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
3005 * src/reduce.c (useless_nonterminals): Formatting changes.
3006 * src/warshall.c (TC): Use bitset_or.
3008 2002-03-04 Akim Demaille <akim@epita.fr>
3010 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
3011 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
3014 2002-03-04 Akim Demaille <akim@epita.fr>
3016 * src/lalr.c (F): Now a bitset*.
3017 Adjust all dependencies.
3019 2002-03-04 Akim Demaille <akim@epita.fr>
3021 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
3022 Adjust all dependencies.
3024 2002-03-04 Akim Demaille <akim@epita.fr>
3026 * src/L0.c, src/LR0.h (nstates): Be size_t.
3027 Adjust comparisons (signed vs unsigned).
3028 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
3030 Adjust all dependencies.
3032 2002-03-04 Akim Demaille <akim@epita.fr>
3034 * src/closure.c (firsts): Now, also a bitset.
3035 Adjust all dependencies.
3036 (varsetsize): Remove, now unused.
3037 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
3039 2002-03-04 Akim Demaille <akim@epita.fr>
3041 * src/print.c: Convert to use bitset.h, not hand coded iterations
3044 2002-03-04 Akim Demaille <akim@epita.fr>
3046 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
3048 2002-03-04 Akim Demaille <akim@epita.fr>
3050 * src/closure.c (ruleset): Be a bitset.
3051 (rulesetsize): Remove.
3053 2002-03-04 Akim Demaille <akim@epita.fr>
3055 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
3056 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
3057 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
3058 * src/closure.c (fderives): Be an array of bitsets.
3060 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
3062 * data/bison.c++: Merge the two generated headers. Insert a copyright
3063 notice in each output file.
3065 2002-02-28 Akim Demaille <akim@epita.fr>
3067 * data/bison.c++: Copy the prologue of bison.simple to fetch
3068 useful M4 definitions, such as b4_header_guard.
3070 2002-02-25 Akim Demaille <akim@epita.fr>
3072 * src/getargs.c (version): Give the name of the authors, and use a
3073 translator friendly scheme for the bgr
3076 2002-02-25 Akim Demaille <akim@epita.fr>
3078 * src/output.c (header_output): Remove, now handled completely via
3081 2002-02-25 Akim Demaille <akim@epita.fr>
3083 * m4/m4.m4: New, from CVS Autoconf.
3084 * configure.in: Invoke it.
3085 * src/output.c (output_skeleton): Use its result instead of the
3088 2002-02-25 Akim Demaille <akim@epita.fr>
3090 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
3092 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
3093 * src/output.c (output_skeleton): Use mkstemp to create a real
3095 Move the filling of `skeleton' and its muscle to...
3097 (output): Move the definition of the prologue muscle to...
3099 * src/system.h (DEFAULT_TMPDIR): New.
3101 2002-02-14 Paul Eggert <eggert@twinsun.com>
3103 Remove the support for C++ namespace cleanliness; it was
3104 causing more problems than it was curing, since it didn't work
3105 properly on some nonstandard C++ compilers. This can wait
3106 for a proper C++ parser.
3108 * NEWS: Document this.
3109 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
3110 of C++, as it's treated like C now.
3111 * src/bison.simple (YYSTD): Remove.
3112 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
3113 Treat C++ just like Standard C instead of trying to support
3114 namespace cleanliness.
3116 2002-02-14 Akim Demaille <akim@epita.fr>
3118 * tests/regression.at (else): Adjust to Andreas' change.
3120 2002-02-14 Akim Demaille <akim@epita.fr>
3122 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
3124 2002-02-13 Andreas Schwab <schwab@suse.de>
3126 * src/output.c (output_rule_data): Don't output NULL, it might
3129 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
3131 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
3132 (Copyright notice): Update.
3134 2002-02-11 Akim Demaille <akim@epita.fr>
3136 * tests/regression.at (%nonassoc and eof): Don't include
3137 nonportable headers.
3139 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
3141 * data/bison.c++: Correct error recovery. Make the user able to
3142 initialize the starting location.
3144 2002-02-07 Akim Demaille <akim@epita.fr>
3146 * tests/input.at: New.
3148 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
3150 * data/bison.c++: Replace some direct m4 expansions by constants. Be
3151 more consistent when naming methods and variables. Put preprocessor
3152 directives around tables only needed for debugging.
3154 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
3156 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
3158 (yy::b4_name::parse): Use print_.
3160 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
3162 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
3164 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
3166 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
3168 (yy::b4_name::parse): Build verbose error messages, and use error_.
3170 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
3172 * data/bison.c++: Fix m4 quoting in comments.
3174 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
3176 * data/bison.c++: Adjust the parser code. Fix some muscles that were
3179 2002-02-05 Akim Demaille <akim@epita.fr>
3181 * data/bison.c++: Adjust to the M4 back end.
3182 More is certainly needed.
3184 2002-02-05 Akim Demaille <akim@epita.fr>
3186 Give a try to M4 as a back end.
3188 * lib/readpipe.c: New, from wdiff.
3189 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
3191 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
3192 specific values. Now it is m4 that performs the lookup.
3193 * src/parse-skel.y: Remove.
3194 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
3195 * src/output.c (actions_output, guards_output)
3196 (token_definitions_output): No longer keeps track of the output
3197 line number, hence remove the second argument.
3198 (guards_output): Check against the guard member of a rule, not the
3201 (output_skeleton): Don't look for the skeleton location, let m4 do
3203 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
3205 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
3206 (prepare): Given that for the time being changesyntax is not
3207 usable in M4, rename the muscles using `-' to `_'.
3208 Define `defines_flag', `output_parser_name' and `output_header_name'.
3209 * src/output.h (actions_output, guards_output)
3210 (token_definitions_output): Adjust prototypes.
3211 * src/scan-skel.l: Instead of scanning the skeletons, it now
3212 processes the output of m4: `__oline__' and `#output'.
3213 * data/bison.simple: Adjust to be used by M4(sugar).
3214 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
3216 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
3217 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
3218 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
3219 shamelessly stolen from CVS Autoconf.
3221 2002-02-05 Akim Demaille <akim@epita.fr>
3223 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
3224 * configure.in: Check for the declarations of free and malloc.
3225 * src/muscle_tab.c: Adjust.
3227 2002-02-05 Akim Demaille <akim@epita.fr>
3229 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
3230 which have no values.
3232 2002-02-05 Akim Demaille <akim@epita.fr>
3234 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
3237 2002-01-29 Paul Eggert <eggert@twinsun.com>
3239 * src/bison.simple (YYSIZE_T): Do not define merely because
3240 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
3241 On some platforms, <alloca.h> does not declare YYSTD (size_t).
3243 2002-01-27 Akim Demaille <akim@epita.fr>
3245 Fix `%nonassoc and eof'.
3247 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
3248 which were not properly copied! Replace
3249 memcpy (res->errs, src->errs, src->nerrs);
3251 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
3253 * tests/regression.at (%nonassoc and eof): Adjust to newest
3254 Autotest: `.' is not in the PATH.
3256 2002-01-27 Akim Demaille <akim@epita.fr>
3258 * tests/sets.at (AT_EXTRACT_SETS): New.
3262 2002-01-26 Akim Demaille <akim@epita.fr>
3264 * tests/actions.at, tests/calc.at, tests/headers.at,
3265 * tests/torture.at: Adjust to the newest Autotest which no longer
3266 forces `.' in the PATH.
3268 2002-01-25 Akim Demaille <akim@epita.fr>
3270 * tests/regression.at (%nonassoc and eof): New.
3271 Suggested by Robert Anisko.
3273 2002-01-24 Akim Demaille <akim@epita.fr>
3275 Bison dumps core when trying to complain about broken input files.
3276 Reported by Cris van Pelt.
3278 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
3279 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
3281 (Invalid inputs): Strengthen: exercise parse_percent_token.
3283 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
3285 * src/Makefile.am: Add bison.c++.
3286 * src/bison.c++: New skeleton.
3288 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
3292 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
3294 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
3296 2002-01-20 Marc Autret <marc@gnu.org>
3298 * src/files.c (compute_output_file_names): Fix
3300 2002-01-20 Marc Autret <marc@gnu.org>
3302 * tests/output.at: New test.
3303 * src/files.c (compute_base_names): Don't map extensions when
3304 the YACC flag is set, use defaults.
3305 Reported by Evgeny Stambulchik.
3307 2002-01-20 Marc Autret <marc@gnu.org>
3309 * src/system.h: Need to define __attribute__ away for non-GCC
3310 compilers as well (i.e. the vendor C compiler).
3311 Suggested by Albert Chin-A-Young.
3313 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
3315 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
3316 canonical definition.
3317 * src/system.h: Use the canonical definition for PARAMS (avoids
3318 a conflict with the macro from lib/hash.h).
3320 2002-01-11 Akim Demaille <akim@epita.fr>
3322 * configure.in: Use AC_FUNC_STRNLEN.
3323 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
3325 2002-01-09 Akim Demaille <akim@epita.fr>
3327 * src/files.c, src/files.h (output_infix): New.
3328 (tab_extension): Remove.
3329 (compute_base_names): Compute the former, drop the latter.
3330 * src/output.c (prepare): Insert the muscles `output-infix', and
3332 * src/parse-skel.y (string, string.1): New.
3333 (section.header): Use it.
3334 (section.yacc): Remove.
3335 (prefix): Remove too.
3336 * src/scan-skel.l: Adjust.
3337 * src/bison.simple, src/bison.hairy: Adjust.
3339 2002-01-09 Akim Demaille <akim@epita.fr>
3341 * configure.in (WERROR_CFLAGS): Compute it.
3342 * src/Makefile.am (CFLAGS): Pass it.
3343 * tests/atlocal.in (CFLAGS): Idem.
3344 * src/files.c: Fix a few warnings.
3345 (get_extension_index): Remove, unused.
3347 2002-01-08 Akim Demaille <akim@epita.fr>
3349 * src/getargs.c (AS_FILE_NAME): New.
3350 (getargs): Use it to convert DOSish file names.
3351 * src/files.c (base_name): Rename as full_base_name to avoid
3352 clashes with `base_name ()'.
3353 (filename_split): New.
3354 (compute_base_names): N-th rewrite, using filename_split.
3356 2002-01-08 Akim Demaille <akim@epita.fr>
3358 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
3359 New, stolen from the Fileutils 4.1.
3360 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
3361 * configure.in: Check for the presence of memrchr, and of its
3364 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
3366 * lib/hash.h (__P): Added definition for this macro.
3367 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
3368 BUILT_SOURCES, to ensure they are generated first.
3369 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
3370 %error-verbose to allow bootstrapping with bison 1.30x.
3372 2002-01-06 Akim Demaille <akim@epita.fr>
3374 * src/reader.c (parse_braces): Don't fetch the next char, the
3375 convention is to fetch on entry.
3376 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
3377 'switch' without a following semicolon.
3378 * tests/regression.at (braces parsing): New.
3380 2002-01-06 Akim Demaille <akim@epita.fr>
3382 Bison is dead wrong in its RR conflict reports.
3384 * tests/torture.at (GNU Cim Grammar): New.
3385 * src/conflicts.c (count_rr_conflicts): Fix.
3387 2002-01-06 Akim Demaille <akim@epita.fr>
3389 Creating package.m4 from configure.ac causes too many problems.
3391 * tests/Makefile.am (package.m4): Create it by hand,
3392 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
3394 2002-01-06 Akim Demaille <akim@epita.fr>
3396 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
3399 2002-01-04 Paul Eggert <eggert@twinsun.com>
3401 * doc/bison.texinfo (Debugging):
3402 Remove YYSTDERR; it's no longer defined or used.
3403 Also, s/cstdio.h/cstdio/.
3405 2002-01-03 Akim Demaille <akim@epita.fr>
3407 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
3409 2002-01-03 Akim Demaille <akim@epita.fr>
3411 * src/parse-skel.y (process_skeleton): Don't bind the parser's
3412 tracing code to --trace, wait for a better --trace option, with
3415 2002-01-03 Akim Demaille <akim@epita.fr>
3417 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
3418 The ISO C++ standard is extremely clear about it: stderr is
3419 considered a macro, not a regular symbol (see table 94 `Header
3420 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
3421 Therefore std:: does not apply to it. It still does with fprintf.
3422 Also, s/cstdio.h/cstdio/.
3424 2002-01-03 Akim Demaille <akim@epita.fr>
3426 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
3427 for non system headers.
3429 2002-01-02 Akim Demaille <akim@epita.fr>
3431 Equip the skeleton chain with location tracking, runtime trace,
3432 pure parser and scanner.
3434 * src/parse-skel.y: Request a pure parser, locations, and prefix
3436 (%union): Having several members with the same type does not help
3437 type mismatches, simplify.
3438 (YYPRINT, yyprint): New.
3439 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
3442 * src/scan-skel.l: Adjust to these changes.
3443 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
3444 (LOCATION_PRINT, skel_control_t): New.
3446 2001-12-30 Akim Demaille <akim@epita.fr>
3448 * src/parse-skel.y: Get rid of the shift/reduce conflict:
3449 replace `gb' with BLANKS.
3450 * src/scan-skel.l: Adjust.
3452 2001-12-30 Akim Demaille <akim@epita.fr>
3454 * src/system.h: We don't need nor want bcopy.
3455 Throw away MS-DOS crap: we don't need getpid.
3456 * configure.in: We don't need strndup. It was even causing
3457 problems: because Flex includes the headers *before* us,
3458 _GNU_SOURCE is not defined by config.h, and therefore strndup was
3460 * lib/xstrndup.c: New.
3461 * src/scan-skel.l: Use it.
3462 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
3463 * src/parse-skel.y: Use %directives instead of #defines.
3465 2001-12-30 Akim Demaille <akim@epita.fr>
3467 * src/skeleton.h: New.
3468 * src/output.c (output_parser, output_master_parser): Remove, dead
3470 * src/output.h (get_lines_number, actions_output, guards_output)
3471 (token_definitions_output): Prototype them.
3472 * src/parse-skel.y: Add the license notice.
3473 Include output.h and skeleton.h.
3474 (process_skeleton): Returns void, and takes a single parameter.
3475 * src/scan-skel.l: Add the license notice.
3477 Don't use %option yylineno: it seems that then Flex imagines
3478 REJECT has been used, and therefore it won't reallocate its
3479 buffers (which makes no other sense to me than a bug). It results
3480 in warnings for `unused: yy_flex_realloc'.
3482 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
3484 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3485 (MUSCLE_INSERT_PREFIX): ...to there.
3486 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3487 (MUSCLE_INSERT_PREFIX): Move from here...
3489 * src/bison.hairy: Add a section directive. Put braces around muscle
3490 names. This parser skeleton is still broken, but Bison should not
3491 choke on a bad muscle 'syntax'.
3492 * src/bison.simple: Add a section directive. Put braces around muscle
3495 * src/files.h (strsuffix, stringappend): Add declarations.
3496 (tab_extension): Add declaration.
3497 (short_base_name): Add declaration.
3499 * src/files.c (strsuffix, stringappend): No longer static. These
3500 functions are used in the skeleton parser.
3501 (tab_extension): New.
3502 (compute_base_names): Use the computations done in this function
3503 to guess if the generated parsers should have '.tab' in their
3505 (short_base_name): No longer static.
3507 * src/output.c (output_skeleton): New.
3508 (output): Disable call to output_master_parser, and give a try to
3509 a new skeleton handling system.
3510 (guards_output, actions_output): No longer static.
3511 (token_definitions_output, get_lines_number): No longer static.
3513 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
3515 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
3518 * src/parse-skel.y: New file.
3519 * src/scan-skel.l: New file.
3521 2001-12-29 Akim Demaille <akim@epita.fr>
3523 %name-prefix is broken.
3525 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
3526 Adjust all dependencies.
3527 * tests/headers.at (export YYLTYPE): Strengthen this test: use
3530 Renaming yylval but not yylloc is not consistent. Now we do.
3532 * src/bison.simple: Prefix yylloc if used.
3533 * doc/bison.texinfo (Decl Summary): Document that.
3535 2001-12-29 Akim Demaille <akim@epita.fr>
3537 * doc/bison.texinfo: Promote `%long-directive' over
3539 Remove all references to fixed-output-files, yacc is enough.
3541 2001-12-29 Akim Demaille <akim@epita.fr>
3543 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
3544 user prologue. These are defaults.
3545 * tests/actions.at (Mid-rule actions): Make sure the user can
3546 define YYDEBUG and YYERROR_VERBOSE.
3548 2001-12-29 Akim Demaille <akim@epita.fr>
3550 * src/output.c (header_output): Don't forget to export YYLTYPE and
3552 * tests/headers.at (export YYLTYPE): New, make sure it does.
3553 * tests/regression.at (%union and --defines, Invalid CPP headers):
3555 * tests/headers.at: here.
3557 2001-12-29 Akim Demaille <akim@epita.fr>
3559 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
3561 2001-12-29 Akim Demaille <akim@epita.fr>
3563 * tests/actions.at (Mid-rule actions): Output on a single line
3566 2001-12-29 Akim Demaille <akim@epita.fr>
3568 * doc/bison.texinfo: Formatting changes.
3570 2001-12-29 Akim Demaille <akim@epita.fr>
3572 Don't store the token defs in a muscle, just be ready to output it
3573 on command. Now possible via `symbols'. Fixes a memory leak.
3575 * src/output.c (token_definitions_output): New.
3576 (output_parser, header_output): Use it.
3577 * src/reader.c (symbols_save): Remove.
3579 2001-12-29 Akim Demaille <akim@epita.fr>
3581 * src/bison.simple: Do not provide a default for YYSTYPE and
3582 YYLTYPE before the user's prologue. Otherwise it's hardly... a
3585 2001-12-29 Akim Demaille <akim@epita.fr>
3587 Mid-rule actions are simply... ignored!
3589 * src/reader.c (readgram): Be sure to attach mid-rule actions to
3590 the empty-rule associated to the dummy symbol, not to the host
3592 * tests/actions.at (Mid-rule actions): New.
3594 2001-12-29 Akim Demaille <akim@epita.fr>
3598 * src/reader.c (reader): Free grammar.
3600 2001-12-29 Akim Demaille <akim@epita.fr>
3604 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
3605 since it allocates it for each state, although only one is needed.
3606 (allocate_storage): Do it here.
3608 2001-12-29 Akim Demaille <akim@epita.fr>
3610 * src/options.h, src/options.c (create_long_option_table): Rename
3612 (long_option_table_new): this, with a clearer prototype.
3613 (percent_table): Remove, unused,
3614 * src/getargs.c (getargs): Adjust.
3616 2001-12-29 Akim Demaille <akim@epita.fr>
3618 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
3619 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
3622 2001-12-29 Akim Demaille <akim@epita.fr>
3624 * src/lalr.c (build_relations): Rename `states' as `states1'.
3625 Sorry, I don't understand exactly what it is, no better name...
3627 2001-12-29 Akim Demaille <akim@epita.fr>
3629 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
3630 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
3631 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
3634 2001-12-29 Akim Demaille <akim@epita.fr>
3636 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
3639 2001-12-29 Akim Demaille <akim@epita.fr>
3641 * src/reader.c, src/reader.h (user_toknums): Remove.
3642 Adjust all users to use symbols[i]->user_token_number.
3644 2001-12-29 Akim Demaille <akim@epita.fr>
3646 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
3647 Adjust all users to use symbols[i]->prec or ->assoc.
3649 2001-12-29 Akim Demaille <akim@epita.fr>
3651 * src/reader.c, src/reader.h (tags): Remove.
3652 Adjust all users to use symbols[i]->tag.
3654 2001-12-29 Akim Demaille <akim@epita.fr>
3656 * src/gram.h, src/gram.c (symbols): New, similar to state_table
3658 * src/reader.c (packsymbols): Fill this table.
3660 * src/conflicts.c (resolve_sr_conflict): Adjust.
3661 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
3663 Use symbols[i]->tag instead of tags[i].
3665 2001-12-29 Akim Demaille <akim@epita.fr>
3667 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
3668 In addition, put a comment in there, to replace...
3669 * tests/regression.at (%union and C comments): Remove.
3671 2001-12-29 Akim Demaille <akim@epita.fr>
3673 * tests/regression.at (Web2c Actions): Blindly move the actual
3674 output as expected output. The contents *seem* right to me, but I
3675 can't pretend reading perfectly parser tables... Nonetheless, all
3676 the other tests pass correctly, the table look OK, even though the
3677 presence of `$axiom' is to be noted: AFAICS it is useless (but
3680 2001-12-29 Akim Demaille <akim@epita.fr>
3682 * src/reader.c (readgram): Don't add the rule 0 if there were no
3683 rules read. In other words, add it _after_ having performed
3684 grammar sanity checks.
3685 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
3687 2001-12-29 Akim Demaille <akim@epita.fr>
3689 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
3690 visible, and some states have now a different number.
3692 2001-12-29 Akim Demaille <akim@epita.fr>
3694 * src/reader.c (readgram): Bind the initial rule's lineno to that
3696 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
3697 (Solved SR Conflicts): Adjust rule 0's line number.
3699 2001-12-29 Akim Demaille <akim@epita.fr>
3701 Fix the `GAWK Grammar' failure.
3703 * src/LR0.c (final_state): Initialize to -1 so that we do compute
3704 the reductions of the first state which was mistakenly confused
3705 with the final state because precisely final_state was initialized
3707 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
3708 now noticed by Bison.
3709 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
3710 have a reduction on $default.
3712 2001-12-29 Akim Demaille <akim@epita.fr>
3714 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
3716 * src/closure.c (print_closure): Likewise.
3717 * src/derives.c (print_derives): Likewise.
3718 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
3721 2001-12-29 Akim Demaille <akim@epita.fr>
3723 * src/lalr.c (lookaheads_print): New.
3724 (lalr): Call it when --trace-flag.
3725 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
3728 2001-12-29 Akim Demaille <akim@epita.fr>
3730 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
3731 when walking through ritem, even via rule->rhs.
3732 * src/reduce.c (dump_grammar, useful_production, reduce_output)
3733 (useful_production, useless_nonterminals): Likewise.
3734 (reduce_grammar_tables): Likewise, plus update nritems.
3735 * src/nullable.c (set_nullable): Likewise.
3736 * src/lalr.c (build_relations): Likewise.
3737 * tests/sets.at (Nullable): Adjust.
3738 Fortunately, now, the $axiom is no longer nullable.
3740 2001-12-29 Akim Demaille <akim@epita.fr>
3742 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
3744 * src/gram.c (ritem_longest_rhs): Likewise.
3745 * src/reduce.c (nonterminals_reduce): Likewise.
3746 * src/print_graph.c (print_graph): Likewise.
3747 * src/output.c (output_rule_data): Likewise.
3748 * src/nullable.c (set_nullable): Likewise.
3750 2001-12-29 Akim Demaille <akim@epita.fr>
3752 * src/output.c: Comment changes.
3754 2001-12-27 Paul Eggert <eggert@twinsun.com>
3756 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
3757 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
3758 Sparc, as they were causing more porting problems than the
3759 (minor) performance improvement was worth.
3761 Also, catch up with 1.31's YYSTD.
3763 2001-12-27 Akim Demaille <akim@epita.fr>
3765 * src/output.c (output_gram): Rely on nritems, not the
3766 0-sentinel. See below.
3767 Use -1 as separator, not 0.
3768 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
3769 Rely on -1 as separator in yyrhs, instead of 0.
3770 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
3771 twice `Now at end of input', therefore there are two lines less to
3774 2001-12-27 Akim Demaille <akim@epita.fr>
3776 * tests/regression.at (Unresolved SR Conflicts):
3777 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
3780 2001-12-27 Akim Demaille <akim@epita.fr>
3782 * src/LR0.c (new_state): Recognize the final state by the fact it
3783 is reached by eoftoken.
3784 (insert_start_shifting_state, insert_eof_shifting_state)
3785 (insert_accepting_state, augment_automaton): Remove, since now
3786 these states are automatically computed from the initial state.
3787 (generate_states): Adjust.
3788 * src/print.c: When reporting a rule number to the user, substract
3789 1, so that the axiom rule is rule 0, and the first user rule is 1.
3790 * src/reduce.c: Likewise.
3791 * src/print_graph.c (print_core): For the time being, just as for
3792 the report, depend upon --trace-flags to dump the full set of
3794 * src/reader.c (readgram): Once the grammar read, insert the rule
3795 0: `$axiom: START-SYMBOL $'.
3796 * tests/set.at: Adjust: rule 0 is now displayed, and since the
3797 number of the states has changed (the final state is no longer
3798 necessarily the last), catch up.
3800 2001-12-27 Akim Demaille <akim@epita.fr>
3802 Try to make the use of the eoftoken valid. Given that its value
3803 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
3804 is used instead of > 0 where appropriate, (ii), depend upon nritems
3805 instead of the 0-sentinel.
3807 * src/gram.h, src/gram.c (nritems): New.
3808 Expected to be duplication of nitems, but for the time being...
3809 * src/reader.c (packgram): Assert nritems and nitems are equal.
3810 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
3811 * src/closure.c (print_closure, print_fderives): Likewise.
3812 * src/gram.c (ritem_print): Likewise.
3813 * src/print.c (print_core, print_grammar): Likewise.
3814 * src/print_graph.c: Likewise.
3816 2001-12-27 Akim Demaille <akim@epita.fr>
3818 * src/main.c (main): If there are complains after grammar
3819 reductions, then output the report anyway if requested, then die.
3820 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
3821 * src/reader.c (eoftoken): New.
3822 (parse_token_decl): If the token being defined has value `0', it
3824 (packsymbols): No longer hack `tags' to insert `$' by hand.
3825 Be sure to preserve the value of the eoftoken.
3826 (reader): Make sure eoftoken is defined.
3827 Initialize nsyms to 0: now eoftoken is created just like the others.
3828 * src/print.c (print_grammar): Don't special case the eof token.
3829 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
3830 lie anyway, albeit pleasant.
3831 * tests/calc.at: Exercise error messages with eoftoken.
3832 Change the grammar so that empty input is invalid.
3833 Adjust expectations.
3834 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
3836 2001-12-27 Akim Demaille <akim@epita.fr>
3838 * configure.in: Check the protos of strchr ans strspn.
3839 Replace strchr if needed.
3840 * src/system.h: Provide the protos of strchr, strspn and memchr if
3842 * lib/strchr.c: New.
3843 * src/reader.c (symbols_save): Use strchr.
3845 2001-12-27 Akim Demaille <akim@epita.fr>
3847 * src/print.c, src/print_graph.c (escape): New.
3848 Use it to quote the TAGS outputs.
3849 * src/print_graph.c (print_state): Now errors are in red, and
3850 reductions in green.
3851 Prefer high to wide: output the state number on a line of its own.
3853 2001-12-27 Akim Demaille <akim@epita.fr>
3855 * src/state.h, src/state.c (reductions_new): New.
3856 * src/LR0.c (set_state_table): Let all the states have a
3857 `reductions', even if reduced to 0.
3858 (save_reductions): Adjust.
3859 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
3860 * src/print.c (print_reductions, print_actions): Adjust.
3861 * src/output.c (action_row): Adjust.
3863 2001-12-27 Akim Demaille <akim@epita.fr>
3865 * src/state.h, src/state.c (errs_new, errs_dup): New.
3866 * src/LR0.c (set_state_table): Let all the states have an errs,
3867 even if reduced to 0.
3868 * src/print.c (print_errs, print_reductions): Adjust.
3869 * src/output.c (output_actions, action_row): Adjust.
3870 * src/conflicts.c (resolve_sr_conflict): Adjust.
3872 2001-12-27 Akim Demaille <akim@epita.fr>
3874 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
3876 2001-12-27 Akim Demaille <akim@epita.fr>
3878 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
3879 * src/print.c: here.
3880 (lookaheadset, shiftset): New, used as additional storage by
3882 (print_results): Adjust.
3883 (print_shifts, print_gotos, print_errs): New, extracted from...
3884 (print_actions): here.
3885 * src/print_graph.c (print_actions): Remove dead code.
3887 2001-12-27 Akim Demaille <akim@epita.fr>
3889 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
3892 2001-12-27 Akim Demaille <akim@epita.fr>
3894 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
3895 (build_relations): Adjust.
3897 2001-12-27 Akim Demaille <akim@epita.fr>
3899 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
3902 2001-12-27 Akim Demaille <akim@epita.fr>
3904 * src/reader.c (packgram): Catch nitems overflows.
3906 2001-12-27 Akim Demaille <akim@epita.fr>
3908 * src/files.c, src/files.h (guard_obstack): Remove.
3909 * src/output.c (output): Adjust.
3910 * src/reader.c (parse_braces): New, factoring...
3911 (copy_action, copy_guard): these two which are renamed as...
3912 (parse_action, parse_guard): these.
3913 As a voluntary consequence, using braces around guards is now
3916 2001-12-27 Akim Demaille <akim@epita.fr>
3918 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
3919 * src/reader.c (symbol_list): `guard' and `guard_line' are new
3921 (symbol_list_new): Adjust.
3922 (copy_action): action_line is the first line, not the last.
3923 (copy_guard): Just as for actions, store the `action' only, not
3924 the switch/case/break flesh.
3925 Don't parse the user action that might follow the guard, let...
3926 (readgram): do it, i.e., now, there can be an action after a
3928 In other words the guard is just explicitly optional.
3930 * src/output.c (guards_output): New.
3931 (output_parser): Call it when needed.
3932 (output): Also free the guard and attrs obstacks.
3933 * src/files.c, src/files.h (obstack_save): Remove.
3934 (output_files): Remove.
3935 As a result, if one needs the former `.act' file, using an
3936 appropriate skeleton which requires actions and guards is now
3938 * src/main.c (main): Adjust.
3939 * tests/semantic.at: New.
3940 * tests/regression.at: Use `input.y' as input file name.
3941 Avoid 8+3 problems by requiring input.c when the test needs the
3944 2001-12-27 Akim Demaille <akim@epita.fr>
3946 * src/reader.c (symbol_list_new): Be sure to initialize all the
3949 2001-12-27 Akim Demaille <akim@epita.fr>
3951 All the hacks using a final pseudo state are now useless.
3953 * src/LR0.c (set_state_table): state_table holds exactly nstates.
3954 * src/lalr.c (nLA): New.
3955 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
3956 instead of lookaheadsp from the pseudo state (nstate + 1).
3958 2001-12-27 Akim Demaille <akim@epita.fr>
3960 * src/output.c (action_row, token_actions): Use a state_t instead
3961 of a integer, and nlookaheads instead of the following state's
3964 2001-12-27 Akim Demaille <akim@epita.fr>
3966 * src/conflicts.c (log_resolution, flush_shift)
3967 (resolve_sr_conflict, set_conflicts, solve_conflicts)
3968 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
3969 (conflicts_print, print_reductions): Use a state_t instead of an
3970 integer when referring to a state.
3971 As much as possible, depend upon nlookaheads, instead of the
3972 `lookaheadsp' member of the following state (since lookaheads of
3973 successive states are successive, the difference between state n + 1
3974 and n served as the number of lookaheads for state n).
3975 * src/lalr.c (add_lookback_edge): Likewise.
3976 * src/print.c (print_core, print_actions, print_state)
3977 (print_results): Likewise.
3978 * src/print_graph.c (print_core, print_actions, print_state)
3979 (print_graph): Likewise.
3980 * src/conflicts.h: Adjust.
3982 2001-12-27 Akim Demaille <akim@epita.fr>
3984 * src/bison.hairy: Formatting/comment changes.
3986 Remove `register' indications.
3987 Add plenty of `static'.
3989 2001-12-27 Akim Demaille <akim@epita.fr>
3991 * src/output.c (prepare): Drop the muscle `ntbase' which
3993 * src/bison.simple: Formatting/comment changes.
3994 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
3995 is an undocumented synonym.
3997 2001-12-22 Akim Demaille <akim@epita.fr>
3999 * src/output.c (output_table_data): Change the prototype to use
4000 `int' for array ranges: some invocations do pass an int, not a
4002 Reported by Wayne Green.
4004 2001-12-22 Akim Demaille <akim@epita.fr>
4006 Some actions of web2c.y are improperly triggered.
4007 Reported by Mike Castle.
4009 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
4010 * tests/regression.at (Web2c): Rename as...
4011 (Web2c Report): this.
4012 (Web2c Actions): New.
4014 2001-12-22 Akim Demaille <akim@epita.fr>
4016 Reductions in web2c.y are improperly reported.
4017 Reported by Mike Castle.
4019 * src/conflicts.c (print_reductions): Fix.
4020 * tests/regression.at (Web2c): New.
4022 2001-12-18 Akim Demaille <akim@epita.fr>
4024 Some host fail on `assert (!"foo")', which expands to
4025 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
4026 Reported by Nelson Beebee.
4028 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
4029 `#define it_succeeded 0' and `assert (it_succeeded)'.
4031 2001-12-17 Marc Autret <autret_m@epita.fr>
4033 * src/bison.simple: Don't hard code the skeleton line and filename.
4034 * src/output.c (output_parser): Rename 'line' as 'output_line'.
4035 New line counter 'skeleton_line' (skeleton-line muscle).
4037 2001-12-17 Paul Eggert <eggert@twinsun.com>
4039 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
4040 YYDEBUG must be defined to a nonzero value.
4042 * src/bison.simple (yytname): Do not assume that the user defines
4043 YYDEBUG to a properly parenthesized expression.
4045 2001-12-17 Akim Demaille <akim@epita.fr>
4047 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
4048 nlookaheads is a new member.
4050 * src/lalr.h (nlookaheads): Remove this orphan declaration.
4051 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
4054 2001-12-17 Akim Demaille <akim@epita.fr>
4056 * src/files.h, src/files.c (open_files, close_files): Remove.
4057 * src/main.c (main): Don't open/close files, nor invoke lex_free,
4059 * src/reader.c (reader): Do it.
4061 2001-12-17 Akim Demaille <akim@epita.fr>
4063 * src/conflicts.c (print_reductions): Formatting changes.
4065 2001-12-17 Akim Demaille <akim@epita.fr>
4067 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
4068 (flush_reduce): New.
4069 (resolve_sr_conflict): Adjust.
4071 2001-12-17 Akim Demaille <akim@epita.fr>
4073 * src/output.c (output_obstack): Be static and rename as...
4074 (format_obstack): this, to avoid any confusion with files.c's
4076 * src/reader.h (muscle_obstack): Move to...
4077 * src/output.h: here, since it's defined in output.c.
4079 2001-12-17 Akim Demaille <akim@epita.fr>
4081 * src/output.c (action_row, save_column, default_goto)
4082 (sort_actions, matching_state, pack_vector): Better variable
4085 2001-12-17 Akim Demaille <akim@epita.fr>
4087 * src/output.c: Various formatting changes.
4089 2001-12-17 Akim Demaille <akim@epita.fr>
4091 * src/files.c (output_files): Free the output_obstack.
4092 * src/main.c (main): Call print and print_graph conditionally.
4093 * src/print.c (print): Work unconditionally.
4094 * src/print_graph.c (print_graph): Work unconditionally.
4095 * src/conflicts.c (log_resolution): Output only if verbose_flag.
4097 2001-12-16 Marc Autret <autret_m@epita.fr>
4099 * src/output.c (actions_output): Fix. When we use %no-lines,
4100 there is one less line per action.
4102 2001-12-16 Marc Autret <autret_m@epita.fr>
4104 * src/bison.simple: Remove a useless #line directive.
4105 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
4106 * src/output.c (get_lines_number): New.
4107 (output_parser): Adjust, now takes care about the lines of a
4110 (actions_output): Computes the number of lines taken by actions.
4111 (output_master_parser): Insert new skeleton which is the name of
4112 the output parser file name.
4114 2001-12-15 Marc Autret <autret_m@epita.fr>
4116 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
4118 2001-12-15 Marc Autret <autret_m@epita.fr>
4120 * src/output.c (output_gram): Keep track of the hairy one.
4122 2001-12-15 Akim Demaille <akim@epita.fr>
4124 Make `make distcheck' work.
4126 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
4127 system.h which uses libgettext.h.
4129 2001-12-15 Akim Demaille <akim@epita.fr>
4131 * src/nullable.c (set_nullable): Useless rules must be skipped,
4132 otherwise, since we range over their symbols, we might look at a
4133 nonterminal which no longer ``exists'', i.e., it is not counted in
4134 `nvars', hence we overflow our arrays.
4136 2001-12-15 Akim Demaille <akim@epita.fr>
4138 The header can also be produced directly, without any obstack!
4141 * src/files.c, src/files.h (defines_obstack): Remove.
4142 (compute_header_macro): Global.
4143 (defines_obstack_save): Remove.
4144 * src/reader.c (parse_union_decl): No longer output to
4145 defines_obstack: its content can be found in the `stype' muscle
4147 (output_token_translations): Merge into...
4148 (symbols_output): this.
4150 (symbols_save): this.
4152 * src/output.c (header_output): New.
4155 2001-12-15 Akim Demaille <akim@epita.fr>
4157 * src/reader.c (parse_union_decl): Instead of handling two obstack
4158 simultaneously, use one to define the `stype' muscle, and use the
4159 value of the latter to fill defines_obstack.
4160 (copy_comment): Remove.
4161 (copy_comment2): Work for a single obstack.
4163 (copy_comment): this.
4165 2001-12-15 Akim Demaille <akim@epita.fr>
4167 * src/lex.c, src/lex.h (xgetc): No longer static.
4168 * src/reader.c (parse_union_decl): Revamp.
4170 2001-12-15 Akim Demaille <akim@epita.fr>
4172 Still making progress in separating Bison into (i) input, (ii)
4173 process, (iii) output: now we can directly output the parser file
4174 without using table_obstack at all.
4176 * src/files.c, src/files.h (table_obstack): Bye bye.
4177 (parser_file_name): New.
4178 * src/files.c (compute_output_file_names): Compute it.
4179 * src/output.c (actions_output, output_parser)
4180 (output_master_parser): To a file instead of an obstack.
4182 2001-12-15 Akim Demaille <akim@epita.fr>
4184 Attach actions to rules, instead of pre-outputting them to
4187 * src/gram.h (rule_t): action and action_line are new members.
4188 * src/reader.c (symbol_list): Likewise.
4189 (copy_action): Save the actions within the rule.
4190 (packgram): Save them in rule_table.
4191 * src/output.c (actions_output): New.
4192 (output_parser): Use it on `%%actions'.
4193 (output_rule_data): Don't free rule_table.
4195 (prepare): Don't save the `action' muscle.
4196 * src/bison.simple: s/%%action/%%actions/.
4198 2001-12-15 Akim Demaille <akim@epita.fr>
4200 * src/reader.c (copy_action): When --yacc, don't append a `;'
4201 to the user action: let it fail if lacking.
4202 Suggested by Arnold Robbins and Tom Tromey.
4204 2001-12-14 Akim Demaille <akim@epita.fr>
4206 * src/lex.c (literalchar): Simply return the char you decoded, non
4207 longer mess around with obstacks and int pointers.
4210 2001-12-14 Akim Demaille <akim@epita.fr>
4212 * src/lex.c (literalchar): Don't escape the special characters,
4213 just decode them, and keep them as char (before, eol was output as
4214 the 2 char string `\n' etc.).
4215 * src/output.c (output_rule_data): Use quotearg to output the
4218 2001-12-13 Paul Eggert <eggert@twinsun.com>
4220 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
4221 Do not infringe on the global user namespace when using C++.
4222 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
4223 All uses of `fprintf' and `stderr' changed.
4225 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
4227 2001-12-13 Akim Demaille <akim@epita.fr>
4229 The computation of nullable is broken: it doesn't handle empty
4232 * tests/torture.at (GNU AWK Grammar): New.
4233 * tests/sets.at (Nullable): New.
4234 * src/nullable.c (set_nullable): Instead of blindly looping over
4235 `ritems', loop over the rules, and then over their rhs's.
4237 Work around Autotest bugs.
4239 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
4240 frame, because Autotest understand lines starting with a `+' as
4241 traces from the shell. Then, they are not processed properly.
4242 Admittedly an Autotest bug, but we don't have time to wait for
4243 Autotest to catch up.
4244 * tests/regression.at (Broken Closure): Adjust to the new table
4247 * tests/sets.at: here.
4249 2001-12-13 Akim Demaille <akim@epita.fr>
4251 * src/closure.c (closure): Use nrules instead of playing tricks
4254 2001-12-13 Akim Demaille <akim@epita.fr>
4256 * src/print.c (print_actions): Output the handling of `$' as the
4257 traces do: shifting the token EOF. Before EOF was treated as a
4259 * tests/regression.at: Adjust some tests.
4260 * src/print_graph.c (print_core): Complete the set of items via
4261 closure. The next-to-final and final states are still unsatisfying,
4262 but that's to be addressed elsewhere.
4263 No longer output the rule numbers, but do output the state number.
4264 A single loop for the shifts + gotos is enough, but picked a
4265 distinct color for each.
4266 (print_graph): Initialize and finalize closure.
4268 2001-12-13 Akim Demaille <akim@epita.fr>
4270 * src/reader.c (readgram): Remove dead code, an strip useless
4272 (get_type): Remove, unused.
4274 2001-12-12 Akim Demaille <akim@epita.fr>
4276 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
4277 on that of lib/error.c.
4279 2001-12-12 Akim Demaille <akim@epita.fr>
4281 Some hosts don't like `/' in includes.
4283 * src/system.h: Include libgettext.h without qualifying the path.
4284 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
4287 2001-12-11 Marc Autret <autret_m@epita.fr>
4289 * src/output.c (output_parser): Remove useless muscle.
4291 2001-12-11 Marc Autret <autret_m@epita.fr>
4293 * src/bison.simple: Remove #line just before %%epilogue. It
4294 is now handled in ...
4295 * src/reader.c (read_additionnal_code): Add the output of a
4296 #line for the epilogue.
4298 2001-12-10 Marc Autret <autret_m@epita.fr>
4300 * src/reader.c (copy_definition): Re-use CPP-outed code which
4301 replace precedent remove.
4302 * src/bison.simple: Remove #line before %%prologue because
4303 %%input-line is wrong at this time.
4305 2001-12-10 Marc Autret <autret_m@epita.fr>
4307 * src/reader.c (symbols_output): Clean up.
4308 * src/output.c (output_gram, output): Clean up.
4310 2001-12-10 Akim Demaille <akim@epita.fr>
4312 * src/lalr.c (initialize_lookaheads): New. Extracted from...
4313 * src/LR0.c (set_state_table): here.
4314 * src/lalr.c (lalr): Call it.
4316 2001-12-10 Akim Demaille <akim@epita.fr>
4318 * src/state.h (shifts): Remove the `number' member: shifts are
4319 attached to state, hence no longer need to be labelled with a
4322 2001-12-10 Akim Demaille <akim@epita.fr>
4324 Now that states have a complete set of members, the linked list of
4325 shifts is useless: just fill directly the state's shifts member.
4327 * src/state.h (shifts): Remove the `next' member.
4328 * src/LR0.c (first_state, last_state): Remove.
4330 (augment_automaton): Don't look for the shifts that must be added
4331 a shift on EOF: it is those of the state we looked for! But now,
4332 since shifts are attached, it is no longer needed to looking
4333 merely by its id: its number.
4335 2001-12-10 Akim Demaille <akim@epita.fr>
4337 * src/LR0.c (augment_automaton): Better variable locality.
4338 Remove an impossible branch: if there is a state corresponding to
4339 the start symbol being shifted, then there is shift for the start
4340 symbol from the initial state.
4342 2001-12-10 Akim Demaille <akim@epita.fr>
4344 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
4345 only when appropriate: when insert_start_shifting_state' is not
4347 * tests/regression.at (Rule Line Numbers): Adjust.
4349 2001-12-10 Akim Demaille <akim@epita.fr>
4351 * src/LR0.c (augment_automaton): Now that all states have shifts,
4352 merge the two cases addition shifts to the initial state.
4354 2001-12-10 Akim Demaille <akim@epita.fr>
4356 * src/lalr.c (set_state_table): Move to...
4358 * src/lalr.c (lalr): Don't call it...
4359 * src/LR0.c (generate_states): do it.
4360 * src/LR0.h (first_state): Remove, only the table is used.
4362 2001-12-10 Akim Demaille <akim@epita.fr>
4364 * src/LR0.h (first_shift, first_reduction): Remove.
4365 * src/lalr.c: Don't use first_shift: find shifts through the
4368 2001-12-10 Akim Demaille <akim@epita.fr>
4370 * src/LR0.c: Attach shifts to states as soon as they are
4372 * src/lalr.c (set_state_table): Instead of assigning shifts to
4373 state, just assert that the mapping was properly done.
4375 2001-12-10 Akim Demaille <akim@epita.fr>
4377 * src/LR0.c (insert_start_shift): Rename as...
4378 (insert_start_shifting_state): this.
4379 (insert_eof_shifting_state, insert_accepting_state): New.
4380 (augment_automaton): Adjust.
4381 Better locality of the variables.
4382 When looking if the start_symbol is shifted from the initial
4383 state, using `while (... symbol != start_symbol ...)' sounds
4384 better than `while (... symbol < start_symbol ...)': If fail
4385 to see how the order between symbols could be relevant!
4387 2001-12-10 Akim Demaille <akim@epita.fr>
4389 * src/getargs.h: Don't declare `spec_name_prefix' and
4390 `spec_file_prefix', declared by src/files.h.
4391 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
4392 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
4393 * src/output.c (prepare): Adjust.
4394 * src/reader.c (symbols_output): Likewise.
4395 * src/vmsgetargs.c: Vaguely adjust, but who cares?
4397 2001-12-10 Akim Demaille <akim@epita.fr>
4399 * src/muscle_tab.c (muscle_init): NULL is a better default than
4402 2001-12-10 Akim Demaille <akim@epita.fr>
4404 * src/reader.c (reader): Calling symbols_output once is enough.
4406 2001-12-10 Akim Demaille <akim@epita.fr>
4408 Now that states have a complete set of members, the linked list of
4409 reductions is useless: just fill directly the state's reductions
4412 * src/state.h (struct reductions): Remove member `number' and
4414 * src/LR0.c (first_reduction, last_reduction): Remove.
4415 (save_reductions): Don't link the new reductions, store them in
4417 * src/lalr.c (set_state_table): No need to attach reductions to
4418 states, it's already done.
4419 * src/output.c (output_actions): No longer free the shifts, then
4420 the reductions, then the states: free all the states and their
4423 2001-12-10 Akim Demaille <akim@epita.fr>
4425 * src/options.c (OPTN, DRTV, BOTH): New.
4426 (option_table): Use them.
4428 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
4429 the job of system.h.
4430 * src/options.c: Don't include stdio.h and xalloc.h for the same
4433 2001-12-10 Akim Demaille <akim@epita.fr>
4435 * src/output.c (output, prepare): Make sure the values of the
4436 muscles `action' and `prologue' are 0-terminated.
4438 2001-12-10 Akim Demaille <akim@epita.fr>
4440 Clean up GCC warnings.
4442 * src/reader.c (copy_action): `buf' is not used.
4443 (parse_skel_decl): Be static.
4444 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
4445 * src/options.h (create_long_option_table): Have a real prototype.
4446 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
4447 (hash_delete_at): Return const void *.
4448 Adjust casts to preserve the const.
4450 2001-12-10 Akim Demaille <akim@epita.fr>
4452 * configure.in: Require 2.52g.
4453 M4 is not needed, but AUTOM4TE is.
4455 * tests/Makefile.am: Adjust.
4457 2001-12-10 Akim Demaille <akim@epita.fr>
4459 One structure for states is enough, even though theoretically
4460 there are LR(0) states and LALR(1) states.
4462 * src/lalr.h (state_t): Remove.
4463 (state_table): Be state_t **, not state_t *.
4464 * src/state.h (core, CORE_ALLOC): Rename as...
4465 (state_t, STATE_ALLOC): this.
4466 Add the LALR(1) members: shifts, reductions, errs.
4467 * src/LR0.c (state_table): Rename as...
4468 (state_hash): this, to avoid name clashes with the global
4470 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
4471 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
4473 2001-12-10 Akim Demaille <akim@epita.fr>
4475 Bison dumps core on bash.y.
4476 Reported by Pascal Bart.
4478 * src/warshall.c (bitmatrix_print): New.
4480 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
4481 j must be the outer loop.
4482 * tests/regression.at (Broken Closure): New.
4484 2001-12-05 Akim Demaille <akim@epita.fr>
4486 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
4488 Reported by Peter Hámorský.
4490 2001-12-05 Akim Demaille <akim@epita.fr>
4492 * src/conflicts.c (err_table): Remove.
4493 (resolve_sr_conflict): Adjust.
4494 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
4496 (state_t.reductions, state_t.shifts): this.
4498 2001-12-05 Akim Demaille <akim@epita.fr>
4500 * src/reduce.c (reduce_grammar_tables): No longer disable the
4501 removal of useless rules via CPP but via `if (0)', so that the
4502 compiler still check the code is valid.
4503 For instance, it should have noticed `rline' no longer exists: use
4504 the `line' member of rule_t.
4505 * src/gram.c (dummy, rline): Remove, unused.
4507 2001-12-05 Akim Demaille <akim@epita.fr>
4509 * src/output.c (pack_vector): Use assert, not berror.
4510 * src/main.c (berror): Remove, unused.
4512 2001-12-05 Akim Demaille <akim@epita.fr>
4514 New experimental feature: if --verbose --trace output all the
4515 items of a state, not only its kernel.
4517 * src/print.c (print_core): If `trace_flag', then invoke closure
4518 before outputting the items of the state (print_core is no longer
4519 a correct name them).
4520 (print_results): Invoke new_closure/free_closure if needed.
4522 2001-12-05 Akim Demaille <akim@epita.fr>
4524 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
4525 * src/closure.c, src/closure.h (itemsetsize): Rename as...
4526 (nitemset): for consistency with the rest of the project.
4528 2001-12-05 Akim Demaille <akim@epita.fr>
4530 * src/closure.c (print_closure): Improve.
4531 (closure): Use it for printing input and output.
4533 2001-12-05 Akim Demaille <akim@epita.fr>
4535 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
4536 indexed by nonterminals.
4538 2001-12-05 Akim Demaille <akim@epita.fr>
4540 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
4542 * src/warshall.h: Remove accidental duplication of the content.
4544 2001-12-05 Akim Demaille <akim@epita.fr>
4546 * src/closure.c (set_fderives): De-obfuscate.
4548 2001-12-05 Akim Demaille <akim@epita.fr>
4550 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
4552 2001-12-05 Akim Demaille <akim@epita.fr>
4554 * src/closure.c (set_firsts): De-obfuscate.
4556 2001-12-05 Akim Demaille <akim@epita.fr>
4558 * src/output.c (action_row): De-obfuscate
4559 using the good o' techniques: arrays not pointers, variable
4560 locality, BITISSET, RESETBIT etc.
4562 2001-12-05 Akim Demaille <akim@epita.fr>
4564 Pessimize the code to simplify it: from now on, all the states
4565 have a valid SHIFTS, which NSHIFTS is possibly 0.
4567 * src/LR0.c (shifts_new): Be global and move to..
4568 * src/state.c, src/state.h: here.
4569 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
4570 * src/print_graph: Adjust.
4572 2001-12-05 Akim Demaille <akim@epita.fr>
4574 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
4575 * src/conflicts.c: Use it.
4576 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
4577 incorrectly ``simplified''.
4579 2001-12-05 Akim Demaille <akim@epita.fr>
4581 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
4582 using the good o' techniques: arrays not pointers, variable
4583 locality, BITISSET, RESETBIT etc.
4585 2001-12-05 Akim Demaille <akim@epita.fr>
4587 * src/state.h (SHIFT_SYMBOL): New.
4588 * src/conflicts.c: Use it to deobfuscate.
4590 2001-12-05 Akim Demaille <akim@epita.fr>
4592 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
4593 (print_reductions): De-obfuscate using the good o' techniques:
4594 arrays not pointers, variable locality, BITISSET.
4596 2001-12-05 Akim Demaille <akim@epita.fr>
4598 * src/conflicts.c (print_reductions): Arrays, not pointers.
4601 2001-12-05 Akim Demaille <akim@epita.fr>
4603 * src/conflicts.c (print_reductions): Pessimize, but clarify.
4605 2001-12-05 Akim Demaille <akim@epita.fr>
4607 * src/conflicts.c (print_reductions): Improve variable locality.
4609 2001-12-05 Akim Demaille <akim@epita.fr>
4611 * src/conflicts.c (print_reductions): Pessimize, but clarify.
4613 2001-12-05 Akim Demaille <akim@epita.fr>
4615 * src/conflicts.c (print_reductions): Improve variable locality.
4617 2001-12-05 Akim Demaille <akim@epita.fr>
4619 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
4620 * src/lalr.c: Use them.
4622 2001-12-05 Akim Demaille <akim@epita.fr>
4624 * src/LR0.c (augment_automaton): Formatting changes.
4625 Better variable locality.
4627 2001-12-05 Akim Demaille <akim@epita.fr>
4629 * src/lalr.c (matrix_print): New.
4630 (transpose): Use it.
4631 Use arrays instead of pointers.
4633 2001-12-05 Akim Demaille <akim@epita.fr>
4635 * src/lalr.c (maxrhs): Move to...
4636 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
4637 * src/lalr.c (build_relations): Adjust.
4639 2001-12-05 Akim Demaille <akim@epita.fr>
4641 * src/lalr.c (transpose): Free the memory allocated to the
4642 argument, as it is replaced by the results by the unique caller.
4643 (build_relations): Merely invoke transpose: it handles the memory
4645 Improve variable locality.
4646 Avoid variables used as mere abbreviations.
4647 (compute_lookaheads): Use arrays instead of pointers.
4649 2001-12-05 Akim Demaille <akim@epita.fr>
4651 * src/lalr.c (initialize_F): Improve variable locality.
4652 Avoid variables used as mere abbreviations.
4654 2001-12-05 Akim Demaille <akim@epita.fr>
4656 * src/derives.c (print_derives): Display the ruleno.
4657 * src/lalr.c (initialize_F, transpose): Better variable locality
4658 to improve readability.
4659 Avoid variables used as mere abbreviations.
4661 2001-12-05 Akim Demaille <akim@epita.fr>
4663 * src/lalr.c (traverse): Use arrays instead of pointers.
4665 2001-12-05 Akim Demaille <akim@epita.fr>
4667 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
4668 the handling of squeue.
4669 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
4671 2001-12-05 Akim Demaille <akim@epita.fr>
4673 Because useless nonterminals are now kept alive (instead of being
4674 `destroyed'), we now sometimes examine them, and store information
4675 related to them. Hence we need to know their number, and adjust
4678 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
4680 * src/LR0.c (allocate_itemsets): The memory allocated to
4681 `symbol_count' was used for two different purpose: once to count
4682 the number of occurrences of each symbol, and later reassigned to
4683 `shift_symbol', containing the symbol that can be shifted from a
4685 Deobfuscate, i.e., allocate, use and free `symbol_count' here
4687 (new_itemsets): Allocate `shift_symbol' here.
4688 (allocate_itemsets): symbol_count includes useless nonterminals.
4690 (free_storage): Use `free', not `XFREE', for pointers that cannot
4693 2001-12-05 Akim Demaille <akim@epita.fr>
4695 * src/nullable.c (set_nullable): Deobfuscate the handling of
4697 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
4699 2001-12-05 Akim Demaille <akim@epita.fr>
4701 * src/gram.c, src/gram.h (ritem_print): New.
4702 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
4703 (This useless function was defined only to work around VMS linkers
4704 that can't handle compilation units with variables only).
4705 * src/reduce.c (dump_grammar): Use it to trace the construction of
4708 2001-12-04 Paul Eggert <eggert@twinsun.com>
4710 * src/bison.simple (union yyalloc): Change member names
4711 to be the same as the stack names.
4712 (yyparse): yyptr is now union yyalloc *, not char *.
4713 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
4714 and may generate better code on some machines.
4715 (yystpcpy): Use prototype if __STDC__ is defined, not just
4716 if __cplusplus is defined.
4718 2001-11-30 Akim Demaille <akim@epita.fr>
4720 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
4721 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
4722 Gettext doesn't compile cleanly, and dies with -Werror.
4723 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
4724 Include WARNING_CFLAGS here.
4725 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
4726 before being defined.
4728 2001-11-27 Paul Eggert <eggert@twinsun.com>
4730 * lib/quotearg.h (quotearg_n, quotearg_n_style):
4731 First arg is int, not unsigned.
4732 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
4733 (SIZE_MAX, UINT_MAX): New macros.
4734 (quotearg_n_options): Abort if N is negative.
4735 Avoid overflow check on hosts where size_t is 64 bits and int
4736 is 32 bits, as overflow is impossible there.
4737 Fix off-by-one typo that caused unnecessary reallocation.
4739 2001-11-29 Paul Eggert <eggert@twinsun.com>
4741 Name space cleanup in generated parser.
4743 * doc/bison.texinfo (Bison Parser): Discuss system headers
4744 and their effect on the user name space.
4747 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
4748 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
4749 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
4751 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
4752 on user names when possible.
4754 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
4755 Simplify test for whather <alloca.h> exists.
4757 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
4759 (<stdio.h>): Include if YYDEBUG.
4761 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
4762 ! defined (yyoverflow) && ! defined (yymemcpy).
4764 (yymemcpy, yyparse): Rename local variables as needed so that
4765 they all begin with 'yy'.
4767 (yystrlen, yystpcpy): New functions.
4769 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
4772 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
4773 instead of relying on string.h functions. Use YYSTACK_ALLOC
4774 and YYSTACK_FREE instead of malloc and free.
4776 2001-11-30 Akim Demaille <akim@epita.fr>
4778 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
4779 before their first uses.
4780 (YYBISON, YYPURE): Move to the top of the output.
4782 2001-11-30 Akim Demaille <akim@epita.fr>
4784 * tests/reduce.at (Useless Nonterminals): Fix.
4786 2001-11-30 Akim Demaille <akim@epita.fr>
4788 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
4789 if body instead of `;' to pacify GCC's warnings.
4791 2001-11-30 Akim Demaille <akim@epita.fr>
4793 Instead of mapping the LHS of unused rules to -1, keep the LHS
4794 valid, but flag the rules as invalid.
4796 * src/gram.h (rule_t): `useful' is a new member.
4797 * src/print.c (print_grammar): Adjust.
4798 * src/derives.c (set_derives): Likewise.
4799 * src/reader.c (packgram, reduce_output): Likewise.
4800 * src/reduce.c (reduce_grammar_tables): Likewise.
4801 * tests/reduce.at (Underivable Rules, Useless Rules): New.
4803 2001-11-30 Akim Demaille <akim@epita.fr>
4805 * src/reduce.c (reduce_output): Formatting changes.
4806 * src/print.c (print_results, print_grammar): Likewise.
4807 * tests/regression.at (Rule Line Numbers)
4808 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
4810 2001-11-30 Akim Demaille <akim@epita.fr>
4812 * src/reduce.c (nonterminals_reduce): Instead of throwing away
4813 useless nonterminals, move them at the end of the symbol arrays.
4814 (reduce_output): Adjust.
4815 * tests/reduce.at (Useless Nonterminals): Adjust.
4817 2001-11-30 Akim Demaille <akim@epita.fr>
4819 * src/reduce.c: Various comment/formatting changes.
4820 (nonterminals_reduce): New, extracted from...
4821 (reduce_grammar_tables): here.
4822 (reduce_grammar): Call nonterminals_reduce.
4824 2001-11-29 Paul Eggert <eggert@twinsun.com>
4826 * src/bison.simple (YYSTACK_REALLOC): Remove.
4827 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
4828 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
4830 (union yyalloc): New type.
4831 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
4832 an arbitrary restriction on hosts where size_t is wider than int.
4834 (yyparse): Don't dump core if alloca or malloc fails; instead, report
4835 a parser stack overflow. Allocate just one block of memory for all
4836 three stacks, instead of allocating three blocks; this typically is
4837 faster and reduces fragmentation.
4839 Do not limit the number of items in the stack to a value that fits
4840 in 'int', as this is an arbitrary limit on hosts with 64-bit
4841 size_t and 32-bit int.
4843 2001-11-29 Marc Autret <autret_m@epita.fr>
4845 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
4846 of defining YYERROR_VERBOSE.
4847 [AT_DATA]: $4 is now out of C declarations in the prologue.
4849 2001-11-28 Marc Autret <autret_m@epita.fr>
4851 * src/reader.c (parse_dquoted_param): New.
4852 (parse_skel_decl): Use it.
4853 * src/lex.h: Add its prototype.
4854 * src/lex.c (literalchar): Become not static.
4856 2001-11-28 Marc Autret <autret_m@epita.fr>
4858 * src/output.h: And put its extern declaration here.
4859 * src/output.c (error_verbose): Define here.
4860 (prepare): Echo name modification.
4861 * src/getargs.h: Clean its extern declaration.
4862 * src/getargs.c (error_verbose_flag): Remove.
4863 (getargs): Remove case 'e'.
4864 * src/options.c (option_table): 'error-verbose' is now seen as simple
4868 * src/reader.c (read_declarations): Remove case tok_include.
4869 (parse_include_decl): Remove.
4870 * src/lex.h (token_t): Remove tok_include.
4871 * src/options.c (option_table): 'include' is now a simple command line
4874 2001-11-28 Marc Autret <autret_m@epita.fr>
4876 * src/bison.simple: Adjust muscle names.
4877 * src/muscle_tab.c (muscle_init): Also rename the muscles.
4878 * src/output.c (prepare): s/_/-/ for the muscles names.
4879 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
4881 2001-11-28 Marc Autret <autret_m@epita.fr>
4883 * src/bison.simple: Fix debug.
4884 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
4886 2001-11-28 Akim Demaille <akim@epita.fr>
4888 * src/LR0.c (shifts_new): New.
4889 (save_shifts, insert_start_shift, augment_automaton): Use it.
4891 2001-11-28 Akim Demaille <akim@epita.fr>
4893 * src/closure.c (closure): `b' and `ruleno' denote the same value:
4896 2001-11-28 Akim Demaille <akim@epita.fr>
4898 * src/closure.c (closure): Instead of looping over word in array
4899 then bits in words, loop over bits in array.
4901 2001-11-28 Akim Demaille <akim@epita.fr>
4903 * src/closure.c (closure): No longer optimize the special case
4904 where all the bits of `ruleset[r]' are set to 0, to make the code
4907 2001-11-28 Akim Demaille <akim@epita.fr>
4909 * src/closure.c (closure): `r' and `c' are new variables, used to
4910 de-obfuscate accesses to RULESET and CORE.
4912 2001-11-28 Akim Demaille <akim@epita.fr>
4914 * src/reduce.c (reduce_print): Use ngettext.
4915 (dump_grammar): Improve the trace accuracy.
4917 2001-11-28 Akim Demaille <akim@epita.fr>
4919 * src/reduce.c (dump_grammar): Don't translate trace messages.
4921 2001-11-28 Akim Demaille <akim@epita.fr>
4923 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
4924 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
4925 as all tags are free'ed afterwards.
4928 2001-11-27 Paul Eggert <eggert@twinsun.com>
4930 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
4931 use alloca when we didn't want to, and vice versa.
4933 2001-11-27 Marc Autret <autret_m@epita.fr>
4935 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
4937 * src/output.c (prepare): Remove its update.
4939 2001-11-27 Marc Autret <autret_m@epita.fr>
4941 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
4944 2001-11-27 Marc Autret <autret_m@epita.fr>
4946 * src/bison.simple: Remove YYERROR_VERBOSE using.
4947 Use %%error_verbose.
4948 (yyparse): Likewise.
4949 * src/output.c (prepare): Give its final value.
4950 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
4951 * src/getargs.h: Add its extern declaration.
4952 * src/getargs.c (error_verbose_flag): New int.
4953 (getargs): Update to catch new case.
4954 * src/options.c (option_table): 'error-verbose' is a new option.
4955 (shortopts): Update.
4957 2001-11-27 Akim Demaille <akim@epita.fr>
4959 * src/system.h: Use intl/libgettext.h.
4960 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
4962 2001-11-27 Akim Demaille <akim@epita.fr>
4964 * tests/torture.at (Exploding the Stack Size with Malloc):
4965 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
4967 2001-11-27 Akim Demaille <akim@epita.fr>
4969 * src/files.c: Include error.h.
4970 Reported by Hans Aberg.
4972 2001-11-26 Marc Autret <autret_m@epita.fr>
4974 * src/reader.c (parse_include_decl): New, not yet implemented.
4975 (read_declarations): Add case tok_include.
4976 * src/getargs.h (include): Add its extern definition.
4977 * src/getargs.c (include): New const char *.
4978 (getargs): Add case '-I'.
4979 * src/options.c (option_table): Add include as command line and
4981 * src/lex.h (token_t): Add tok_include.
4983 2001-11-26 Akim Demaille <akim@epita.fr>
4985 * src/reader.c (readgram): Make sure rules for mid-rule actions
4986 have a lineno equal to that of their host rule.
4987 Reported by Hans Aberg.
4988 * tests/regression.at (Rule Line Numbers): New.
4990 2001-11-26 Akim Demaille <akim@epita.fr>
4992 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
4995 2001-11-26 Akim Demaille <akim@epita.fr>
4997 * src/complain.c, src/complain.h (error): Remove, provided by
5000 2001-11-26 Akim Demaille <akim@epita.fr>
5002 * src/reader.c (read_declarations): Don't abort on tok_illegal,
5003 issue an error message.
5004 * tests/regression.at (Invalid %directive): New.
5005 Reported by Hans Aberg.
5007 2001-11-26 Akim Demaille <akim@epita.fr>
5009 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
5010 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
5012 2001-11-26 Akim Demaille <akim@epita.fr>
5014 * src/conflicts.c (conflicts_print): Don't complain at all when
5015 there are no reduce/reduce conflicts, and as many shift/reduce
5016 conflicts as expected.
5017 * tests/regression.at (%expect right): Adjust.
5019 2001-11-23 Akim Demaille <akim@epita.fr>
5021 * lib/alloca.c: Update, from fileutils.
5023 2001-11-23 Akim Demaille <akim@epita.fr>
5025 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
5027 2001-11-23 Akim Demaille <akim@epita.fr>
5029 * src/system.h: Include alloca.h.
5030 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
5032 2001-11-23 Akim Demaille <akim@epita.fr>
5034 * src/print_graph.c (print_actions): Remove `rule', unused.
5035 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
5036 pacify GCC's signed < unsigned warnings.
5037 * src/closure.c (itemsetsize): Likewise.
5038 * src/reader.c (symbol_list_new): Static.
5040 2001-11-23 Akim Demaille <akim@epita.fr>
5042 Attaching lineno to buckets is stupid, since only one copy of each
5043 symbol is kept, only the line of the first occurrence is kept too.
5045 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
5046 * src/reader.c (rline_allocated): Remove, unused.
5047 (symbol_list): Have a `line' member.
5048 (symbol_list_new): New.
5050 * src/print.c (print_grammar): Output the rule line numbers.
5051 * tests/regression.at (Solved SR Conflicts)
5052 (Unresolved SR Conflicts): Adjust.
5053 Reported by Hans Aberg.
5055 2001-11-22 Marc Autret <autret_m@epita.fr>
5057 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
5059 2001-11-22 Marc Autret <autret_m@epita.fr>
5061 * src/muscle_tab.c (muscle_init): Remove initialization of
5063 * src/output.c (output_master_parser): Do it here.
5065 2001-11-20 Akim Demaille <akim@epita.fr>
5068 * configure.in (ALL_LINGUAS): Adjust.
5069 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
5070 longer contains strings to translate.
5072 2001-11-19 Akim Demaille <akim@epita.fr>
5074 * src/conflicts.c (conflicts_print): Add a missing \n.
5076 2001-11-19 Akim Demaille <akim@epita.fr>
5078 * src/nullable.c (nullable_print): New.
5079 (set_nullable): Call it when tracing.
5080 Better locality of variables.
5082 2001-11-19 Akim Demaille <akim@epita.fr>
5084 * src/print.c (print_actions): Better locality of variables.
5086 2001-11-19 Akim Demaille <akim@epita.fr>
5088 * src/derives.c (print_derives): Fix and enrich.
5089 * src/closure.c (print_fderives): Likewise.
5091 2001-11-19 Akim Demaille <akim@epita.fr>
5093 * src/closure.c (itemsetend): Remove, replaced with...
5096 2001-11-19 Akim Demaille <akim@epita.fr>
5098 * src/LR0.c (kernel_end): Remove, replaced with...
5101 2001-11-19 Akim Demaille <akim@epita.fr>
5103 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
5106 2001-11-19 Akim Demaille <akim@epita.fr>
5108 * src/closure.c (closure): Use arrays instead of pointers to clarify.
5110 2001-11-19 Akim Demaille <akim@epita.fr>
5112 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
5114 * src/LR0.c: Likewise.
5115 (allocate_itemsets): Use arrays instead of pointers to clarify.
5117 2001-11-19 Akim Demaille <akim@epita.fr>
5119 * src/getargs.c (statistics_flag): Replace with...
5121 (longopts): Accept --trace instead of --statistics.
5122 * src/getargs.h, src/options.c: Adjust.
5123 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
5124 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
5126 2001-11-19 Akim Demaille <akim@epita.fr>
5128 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
5129 pointers to clarify the code.
5130 (save_reductions, save_shifts): Factor common parts of alternatives.
5132 2001-11-19 Akim Demaille <akim@epita.fr>
5134 * src/LR0.c (new_state, get_state): Complete TRACE code.
5135 * src/closure.c: Include `reader.h' to get `tags', needed by the
5137 Rename the conditional DEBUG as TRACE.
5138 Output consistently TRACEs to stderr, not stdout.
5139 * src/derives.c: Likewise.
5140 * src/reduce.c: (inaccessable_symbols): Using if is better style
5142 Use `#if TRACE' instead of `#if 0' for tracing code.
5144 2001-11-19 Akim Demaille <akim@epita.fr>
5146 * src/system.h (LIST_FREE, shortcpy): New.
5147 * src/LR0.c: Use them.
5148 * src/output.c (free_itemsets, free_reductions, free_shifts):
5149 Remove, replaced by LIST_FREE.
5151 2001-11-19 Akim Demaille <akim@epita.fr>
5153 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
5154 (REDUCTIONS_ALLOC): New.
5155 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
5158 2001-11-19 Akim Demaille <akim@epita.fr>
5160 * src/LR0.c (new_state): Complete trace code.
5161 * src/nullable.c (set_nullable): Don't translate traces.
5163 2001-11-19 Akim Demaille <akim@epita.fr>
5165 * src/print_graph.c (print_core): Better locality of variables.
5166 * src/print.c (print_core): Likewise.
5168 2001-11-19 Akim Demaille <akim@epita.fr>
5170 * src/vcg.c: You do the output, so you are responsible of the
5171 handling of VCG syntax, in particular: use quotearg.
5172 * src/print_graph.c: Don't.
5173 (print_actions): Don't output the actions as part of the nodes,
5174 since that's the job of the edges.
5175 (print_state): Don't output by hand: fill the node description,
5176 and ask for its output.
5178 2001-11-19 Akim Demaille <akim@epita.fr>
5180 * src/bison.simple (yyparse): When verbosely reporting an error,
5181 no longer put additional quotes around token names.
5182 * tests/calc.at: Adjust.
5184 2001-11-19 Akim Demaille <akim@epita.fr>
5186 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
5187 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
5188 * src/output.c: Adjust.
5190 2001-11-19 Akim Demaille <akim@epita.fr>
5192 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
5194 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
5196 2001-11-19 Akim Demaille <akim@epita.fr>
5198 * src/gram.h (rule_t): New.
5200 (rrhs, rlhs): Remove, part of state_t.
5201 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
5202 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
5203 * src/reader.c, src/reduce.c: Adjust.
5205 2001-11-19 Akim Demaille <akim@epita.fr>
5207 * src/reader.c (symbols_output): New, extracted from...
5208 (packsymbols): Here.
5211 2001-11-19 Akim Demaille <akim@epita.fr>
5213 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
5214 (maxrhs): this new function.
5216 2001-11-19 Akim Demaille <akim@epita.fr>
5218 * src/lalr.c (F): New macro to access the variable F.
5221 2001-11-19 Akim Demaille <akim@epita.fr>
5223 * src/lalr.h (LA): New macro to access the variable LA.
5224 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
5225 * src/lalr.c: Adjust.
5227 2001-11-19 Akim Demaille <akim@epita.fr>
5229 * src/lalr.c (initialize_LA): Only initialize LA. Let...
5230 (set_state_table): handle the `lookaheads' members.
5232 2001-11-19 Akim Demaille <akim@epita.fr>
5234 * src/lalr.h (lookaheads): Removed array, whose contents is now
5236 (state_t): this structure.
5237 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
5240 2001-11-19 Akim Demaille <akim@epita.fr>
5242 * src/lalr.h (consistent): Removed array, whose contents is now
5244 (state_t): this structure.
5245 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
5248 2001-11-19 Akim Demaille <akim@epita.fr>
5250 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
5251 contents are now members of...
5252 (state_t): this structure.
5253 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
5256 2001-11-19 Akim Demaille <akim@epita.fr>
5258 * src/lalr.h (state_t): New.
5259 (state_table): Be a state_t * instead of a core **.
5260 (accessing_symbol): Remove, part of state_t.
5261 * src/lalr.c: Adjust.
5262 (set_accessing_symbol): Merge into...
5263 (set_state_table): this.
5264 * src/print_graph.c, src/conflicts.c: Adjust.
5266 2001-11-14 Akim Demaille <akim@epita.fr>
5268 * tests/calc.at, tests/output.at, tests/regression.at,
5269 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
5270 now the tests are run in private dirs, therefore AC_CLEANUP and
5271 family can be simplified to 0-ary.
5272 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
5273 use abs. path to find config.h.
5274 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
5275 stderr, there can be way too much random noise.
5276 Instead pass -Werror to GCC and rely on the exit status.
5277 Reported by Wolfram Wagner.
5279 2001-11-14 Akim Demaille <akim@epita.fr>
5281 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
5282 defined only if yyoverflow is defined, to avoid `warning: unused
5284 Reported by The Test Suite.
5286 2001-11-14 Akim Demaille <akim@epita.fr>
5288 * src/print.c: Include reduce.h.
5289 Reported by Hans Aberg.
5291 2001-11-14 Akim Demaille <akim@epita.fr>
5293 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
5294 Revert a previous patch: these are really const.
5295 * src/conflicts.c (conflict_report): Additional useless pair of
5296 braces to pacify GCC's warnings for `if () if () {} else {}'.
5297 * src/lex.c (parse_percent_token): Replace equal_offset with
5300 Be sure to strdup `arg' when used, since there is no reason for
5301 token_buffer not to change.
5303 2001-11-14 Akim Demaille <akim@epita.fr>
5305 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
5307 * src/main.c (main): Use them.
5308 Suggested by Hans Aberg.
5310 2001-11-12 Akim Demaille <akim@epita.fr>
5312 * src/system.h (ngettext): Now that we use ngettext, be sure to
5313 provide a default definition when NLS are not used.
5315 2001-11-12 Akim Demaille <akim@epita.fr>
5317 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
5318 Use @kbd to denote user input.
5319 (Language and Grammar): ANSIfy the example.
5320 Adjust its layout for info/notinfo.
5321 (Location Tracking Calc): Output error messages to stderr.
5322 Output locations in a more GNUtically correct way.
5323 Fix a couple of Englishos.
5324 Adjust @group/@end group pairs.
5326 2001-11-12 Akim Demaille <akim@epita.fr>
5328 %expext was not functioning at all.
5330 * src/conflicts.c (expected_conflicts): Set to -1.
5331 (conflict_report): Use ngettext.
5332 (conflicts_print): Check %expect and make its violation an error.
5333 * doc/bison.texinfo (Expect Decl): Adjust.
5334 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
5335 * tests/regression.at (%expect not enough, %expect right)
5336 (%expect too much): New.
5338 2001-11-12 Akim Demaille <akim@epita.fr>
5340 * tests/regression.at (Conflicts): Rename as...
5341 (Unresolved SR Conflicts): this.
5342 (Solved SR Conflicts): New.
5344 2001-11-12 Akim Demaille <akim@epita.fr>
5346 * src/reduce.c (print_results): Rename as...
5347 (reduce_output): This.
5348 Output to OUT, passed as argument, instead of output_obstack.
5349 (dump_grammar): Likewise.
5352 (reduce_grammar): No longer call reduce_output, since...
5353 * src/print.c (print_results): do it.
5354 * src/main.c (main): Call reduce_free;
5356 2001-11-12 Akim Demaille <akim@epita.fr>
5358 * src/conflicts.c (print_reductions): Accept OUT as argument.
5359 Output to it, not to output_obstack.
5360 * src/print.c (print_actions): Adjust.
5362 2001-11-12 Akim Demaille <akim@epita.fr>
5364 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
5365 the result instead of using...
5366 (src_total, rrc_total, src_count, rrc_count): Remove.
5367 (any_conflicts): Remove.
5368 (print_conflicts): Split into...
5369 (conflicts_print, conflicts_output): New.
5370 * src/conflicts.h: Adjust.
5371 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
5372 * src/print.c (print_grammar): Issue `\n' between two rules.
5373 * tests/regression.at (Conflicts): New.
5374 Reported by Tom Lane.
5376 2001-11-12 Akim Demaille <akim@epita.fr>
5378 * tests/regression.at (Invalid input): Remove, duplicate with
5379 ``Invalid input: 1''.
5381 2001-11-12 Akim Demaille <akim@epita.fr>
5383 * tests/torture.at (AT_DATA_STACK_TORTURE)
5384 (Exploding the Stack Size with Alloca)
5385 (Exploding the Stack Size with Malloc): New.
5387 2001-11-12 Akim Demaille <akim@epita.fr>
5389 * src/bison.simple (YYSTACK_REALLOC): New.
5390 (yyparse) [!yyoverflow]: Use it and free the old stack.
5391 Reported by Per Allansson.
5393 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
5395 * src/bison.simple: Define type yystype instead of YYSTYPE, and
5396 define CPP macro, which substitute YYSTYPE by yystype.
5397 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
5398 with yyltype/YYLTYPE. This allows inclusion of the generated
5399 header within the parser if the compiler, such as GGC, accepts
5400 multiple equivalent #defines.
5403 2001-11-05 Akim Demaille <akim@epita.fr>
5405 * src/reader.c (symbols_output): New, extracted from...
5406 (packsymbols): here.
5409 2001-11-05 Akim Demaille <akim@epita.fr>
5411 * src/lex.c (parse_percent_token): s/quotearg/quote/.
5413 2001-11-05 Akim Demaille <akim@epita.fr>
5415 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
5418 2001-11-05 Akim Demaille <akim@epita.fr>
5420 * src/options.h (struct option_table_struct): set_flags is void*.
5421 * src/options.c (longopts): Support `--output' and `%output'.
5423 * src/lex.h (tok_setopt): Remove, replaced with...
5424 (tok_intopt, tok_stropt): these new guys.
5425 * src/lex.c (getopt.h): Not needed.
5426 (token_buffer, unlexed_token_buffer): Not const.
5427 (percent_table): Promote `-' over `_' in directive names.
5428 Active `%name-prefix', `file-prefix', and `output'.
5429 (parse_percent_token): Accept possible arguments to directives.
5430 Promote `-' over `_' in directive names.
5432 2001-11-04 Akim Demaille <akim@epita.fr>
5434 * doc/bison.texinfo (Decl Summary): Split the list into
5435 `directives for grammars' and `directives for bison'.
5437 Add description of `%name-prefix', `file-prefix', and `output'.
5438 Promote `-' over `_' in directive names.
5439 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
5440 Simplify the description of `--name-prefix'.
5441 Promote `-' over `_' in directive names.
5442 Promote `--output' over `--output-file'.
5443 Fix the description of `--defines'.
5444 * tests/output.at: Exercise %file-prefix and %output.
5446 2001-11-02 Akim Demaille <akim@epita.fr>
5448 * doc/refcard.tex: Update.
5450 2001-11-02 Akim Demaille <akim@epita.fr>
5452 * src/symtab.h (SUNDEF): New.
5453 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
5454 stand for `uninitialized', instead of 0.
5455 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
5456 * src/lex.c (lex): Adjust.
5458 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
5460 Let yylex return it instead of a plain 0.
5461 Reported by Dick Streefland.
5463 2001-11-02 Akim Demaille <akim@epita.fr>
5465 * tests/regression.at (Mixing %token styles): New test.
5467 2001-11-02 Akim Demaille <akim@epita.fr>
5469 * src/reader.c (parse_thong_decl): Formatting changes.
5470 (token_translations_init): New, extracted from...
5471 (packsymbols): Here.
5474 2001-11-01 Akim Demaille <akim@epita.fr>
5476 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
5477 Check that `9foo.y' produces correct cpp guards.
5478 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
5482 2001-11-01 Akim Demaille <akim@epita.fr>
5484 * tests/regression.at (Invalid input: 2): New.
5485 * src/lex.c (unlexed_token_buffer): New.
5486 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
5490 2001-11-01 Akim Demaille <akim@epita.fr>
5492 * tests/calc.at: Catch up with 1.30.
5493 * configure.in: Bump to 1.49a.
5494 Adjust to newer Autotest.
5496 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
5498 * src/conflicts.c: Move global variables rrc_total and src_total ...
5499 (print_conflicts): here.
5500 * src/output.c (output): Free global variable user_toknums.
5501 * src/lex.c (token_obstack): Become static.
5503 2001-10-18 Akim Demaille <akim@epita.fr>
5505 * tests/atlocal.in (GCC): Add.
5506 * tests/calc.at: s/m4_match/m4_bmatch/.
5507 s/m4_patsubst/m4_bpatsubst/.
5508 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
5509 * configure.in: AC_SUBST(GCC).
5511 2001-10-14 Marc Autret <autret_m@epita.fr>
5513 * src/options.c (create_long_option_table): Fix.
5515 2001-10-10 Akim Demaille <akim@epita.fr>
5517 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
5519 2001-10-04 Akim Demaille <akim@epita.fr>
5521 * src/reader.c (parse_union_decl): Push the caracters in
5522 union_obstack, not attrs_obstack.
5524 2001-10-04 Akim Demaille <akim@epita.fr>
5526 Merge in the branch 1.29.
5528 * src/reader.c (packsymbols): Use a temporary obstack for
5529 `%%tokendef', since output_stack is already used elsewhere.
5531 2001-10-02 Akim Demaille <akim@epita.fr>
5535 2001-10-02 Akim Demaille <akim@epita.fr>
5539 2001-10-02 Akim Demaille <akim@epita.fr>
5541 * tests/regression.at (Invalid CPP headers): New.
5542 From Alexander Belopolsky.
5543 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
5545 2001-10-02 Akim Demaille <akim@epita.fr>
5547 * tests/regression.at (Invalid input): New.
5548 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
5551 2001-10-02 Akim Demaille <akim@epita.fr>
5553 * tests/calc.at: Now that --debug works, the tests must be adjusted.
5555 2001-10-02 Akim Demaille <akim@epita.fr>
5557 * src/output.c (output_parser): Assert `skeleton'.
5558 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
5562 2001-10-01 Marc Autret <autret_m@epita.fr>
5564 * src/lex.h: Echo modifications.
5565 * src/lex.c (unlex): Parameter is now token_t.
5568 2001-10-01 Marc Autret <autret_m@epita.fr>
5570 * src/main.c: Include lex.h.
5573 2001-09-29 Akim Demaille <akim@epita.fr>
5575 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
5577 2001-09-28 Akim Demaille <akim@epita.fr>
5579 * tests/testsuite.at: Update to newer Autotest.
5580 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
5582 2001-09-27 Akim Demaille <akim@epita.fr>
5584 Position independent wrapper.
5586 * tests/bison: Remove.
5587 * tests/bison.in: New.
5588 * configure.in: Adjust.
5590 2001-09-27 Paul Eggert <eggert@twinsun.com>
5592 Port quotearg fixes from tar 1.13.24.
5594 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5596 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
5597 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
5599 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
5600 * m4/mbrtowc.m4: New file.
5601 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
5602 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
5604 2001-09-27 Akim Demaille <akim@epita.fr>
5608 2001-09-27 Akim Demaille <akim@epita.fr>
5612 2001-09-25 Akim Demaille <akim@epita.fr>
5614 * src/system.h: Include `xalloc.h'.
5615 Remove it from the C files.
5616 * src/files.c (output_files): Free the obstacks.
5617 * src/lex.c (init_lex): Rename as...
5620 * src/main.c (main): Use it.
5622 2001-09-24 Marc Autret <autret_m@epita.fr>
5624 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
5625 to output informations in fout (FILE*).
5626 (open_graph, close_graph): Likewise.
5627 (output_graph, output_edge, output_node): Likewise.
5628 * src/vcg.h: Update function prototypes.
5629 * src/print_graph.c (print_graph): Open output graph file.
5630 (print_actions): Adjust.
5631 * src/files.h: Remove extern declaration.
5632 * src/files.c: Remove graph_obstack declaration.
5633 (open_files): Remove graph_obstack initialization.
5634 (output_files): Remove graph_obstack saving.
5636 2001-09-24 Marc Autret <autret_m@epita.fr>
5638 * src/files.c (compute_output_file_names): Fix.
5640 2001-09-24 Marc Autret <autret_m@epita.fr>,
5641 Akim Demaille <akim@epita.fr>
5643 * src/reader.c (reader): Remove call to free_symtab ().
5644 * src/main.c (main): Call it here.
5646 * src/conflicts.c (initialize_conflicts): Rename as...
5647 (solve_conflicts): this.
5648 * src/print.c (print_core, print_actions, print_state)
5649 (print_grammar): Dump to a file instead a `output_obstack'.
5650 (print_results): Dump `output_obstack', and then proceed with the
5652 * src/files.c (compute_output_file_names, close_files): New.
5653 (output_files): Adjust.
5654 * src/main.c (main): Adjust.
5656 2001-09-23 Marc Autret <autret_m@epita.fr>
5658 * src/files.c (compute_header_macro): Computes header macro name
5659 from spec_defines_file when given.
5661 2001-09-23 Marc Autret <autret_m@epita.fr>
5663 * src/files.c (output_files): Add default extensions.
5665 2001-09-22 Akim Demaille <akim@epita.fr>
5667 * src/conflicts.c (finalize_conflicts): Rename as...
5668 (free_conflicts): this.
5670 2001-09-22 Akim Demaille <akim@epita.fr>
5672 * src/gram.c (gram_free): Rename back as...
5674 (output_token_translations): Free `token_translations'.
5675 * src/symtab.c (free_symtab): Free the tag field.
5677 2001-09-22 Akim Demaille <akim@epita.fr>
5679 Remove `translations' as it is always set to true.
5681 * src/gram.h: Adjust.
5682 * src/reader.c (packsymbols, parse_token_decl): Adjust
5683 * src/print.c (print_grammar): Adjust.
5684 * src/output.c (output_token_translations): Adjust.
5685 * src/lex.c (lex): Adjust.
5686 * src/gram.c: Be sure the set pointers to NULL.
5687 (dummy): Rename as...
5690 2001-09-22 Akim Demaille <akim@epita.fr>
5692 * configure.in: Invoke AM_LIB_DMALLOC.
5693 * src/system.h: Use dmalloc.
5694 * src/LR0.c: Be sure to have pointers initialized to NULL.
5695 (allocate_itemsets): Allocate kernel_items only if needed.
5697 2001-09-22 Akim Demaille <akim@epita.fr>
5699 * configure.in: Bump to 1.29b.
5700 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
5701 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
5702 need xmalloc.c in calc.y.
5705 2001-09-21 Akim Demaille <akim@epita.fr>
5708 * Makefile.maint, config/config.guess, config/config.sub,
5709 * config/missing: Update from masters.
5710 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
5712 * configure.in (ALL_LINGUAS): Add `tr'.
5714 2001-09-21 Akim Demaille <akim@epita.fr>
5716 * tests/Makefile.am (package.m4): Move to...
5717 ($(srcdir)/$(TESTSUITE)): here.
5719 2001-09-20 Akim Demaille <akim@epita.fr>
5721 * src/complain.c: No longer try to be standalone: use system.h.
5722 Don't assume __STDC__ is defined to 1. Just test if it is defined.
5723 * src/complain.h: Likewise.
5724 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
5725 Remove the unused variable `n'.
5726 From Albert Chin-A-Young.
5728 2001-09-18 Marc Autret <autret_m@epita.fr>
5730 * doc/bison.1: Update.
5731 * doc/bison.texinfo (Bison Options): Update --defines and --graph
5733 (Option Cross Key): Update.
5736 2001-09-18 Marc Autret <autret_m@epita.fr>
5738 * tests/regression.at: New test (comment in %union).
5740 2001-09-18 Marc Autret <autret_m@epita.fr>
5742 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
5744 Reported by Keith Browne.
5746 2001-09-18 Marc Autret <autret_m@epita.fr>
5748 * tests/output.at: Add tests for --defines and --graph.
5750 2001-09-18 Marc Autret <autret_m@epita.fr>
5752 * tests/output.at: Removes tests of %{header,src}_extension features.
5754 2001-09-18 Akim Demaille <akim@epita.fr>
5756 * tests/Makefile.am (package.m4): New.
5757 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
5758 (_AT_CHECK_CALC_ERROR): Likewise.
5759 Factor the `, ' part of verbose error messages.
5761 2001-09-18 Marc Autret <autret_m@epita.fr>
5763 * src/getargs.c (longopts): Declare --defines and --graph as options
5764 with optional arguments.
5765 * src/files.h: Add extern declarations.
5766 * src/files.c (spec_graph_file, spec_defines_file): New.
5767 (output_files): Update.
5768 Remove CPP-outed code.
5770 2001-09-18 Marc Autret <autret_m@epita.fr>
5772 Turn off %{source,header}_extension feature.
5774 * src/files.c (compute_exts_from_gf): Update.
5775 (compute_exts_from_src): Update.
5776 (output_files): CPP-out useless code.
5777 * src/files.h: Remove {header,source}_extension extern declarations.
5778 * src/reader.c (parse_dquoted_param): CPP-out.
5779 (parse_header_extension_decl): Remove.
5780 (parse_source_extension_decl): Remove.
5781 (read_declarations): Remove cases tok_{hdrext,srcext}.
5782 * src/lex.c (percent_table): Remove {header,source}_extension entries.
5783 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
5785 2001-09-10 Akim Demaille <akim@epita.fr>
5787 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
5788 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
5789 (AT_CHECK_OUTPUT): this.
5790 Merely check ls' exit status, its output is useless.
5792 2001-09-10 Akim Demaille <akim@epita.fr>
5794 * tests/calc.at: Use m4_match.
5795 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
5797 2001-09-10 Marc Autret <autret_m@epita.fr>,
5798 Akim Demaille <akim@epita.fr>
5800 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
5802 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
5804 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
5805 * src/lex.h: Adjust prototype.
5806 (token_t): Add `tok_undef'.
5807 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
5808 (parse_percent_token): Now returns token_t.
5809 Add default statement in switch.
5810 (lex): Separate `c' as an input variable, from the token_t result
5812 (unlexed): Is a token_t.
5814 2001-09-10 Akim Demaille <akim@epita.fr>
5816 * configure.in: Bump to 1.29a.
5818 2001-09-07 Akim Demaille <akim@epita.fr>
5822 2001-08-30 Akim Demaille <akim@epita.fr>
5824 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
5825 * m4/atconfig.m4: Remove.
5826 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
5828 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
5829 m4_if, m4_patsubst, and m4_regexp.
5830 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
5831 `input' file instead of echo.
5833 2001-08-29 Akim Demaille <akim@epita.fr>
5837 2001-08-29 Akim Demaille <akim@epita.fr>
5841 2001-08-29 Paul Eggert <eggert@twinsun.com>
5843 * src/bison.simple (yyparse): Don't take the address of an
5844 item before the start of an array, as that doesn't conform to
5847 2001-08-29 Robert Anisko <anisko_r@epita.fr>
5849 * doc/bison.texinfo (Location Tracking Calc): New node.
5851 2001-08-29 Paul Eggert <eggert@twinsun.com>
5853 * src/output.c (output): Do not define const, as this now
5854 causes more problems than it cures.
5856 2001-08-29 Akim Demaille <akim@epita.fr>
5858 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
5860 Be sure to tag the `detailmenu'.
5862 2001-08-29 Akim Demaille <akim@epita.fr>
5864 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
5865 download in a tmp dir.
5867 2001-08-28 Marc Autret <autret_m@epita.fr>
5869 * config/depcomp: New file.
5871 2001-08-28 Marc Autret <autret_m@epita.fr>
5873 * doc/bison.1 (mandoc): Adjust.
5874 From Juan Manuel Guerrero.
5876 2001-08-28 Marc Autret <autret_m@epita.fr>
5878 * src/print_graph.c (print_state): Fix.
5880 2001-08-27 Marc Autret <autret_m@epita.fr>
5882 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
5884 Echo modifications to the functions prototypes.
5885 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
5887 2001-08-27 Marc Autret <autret_m@epita.fr>
5889 * src/vcg.c: Include `xalloc.h'.
5890 (add_colorentry): New.
5891 (add_classname): New.
5892 (add_infoname): New.
5893 * src/vcg.h: Add new prototypes.
5895 2001-08-27 Akim Demaille <akim@epita.fr>
5897 * Makefile.maint: Sync. again with CVS Autoconf.
5899 2001-08-27 Akim Demaille <akim@epita.fr>
5901 * Makefile.maint: Formatting changes.
5902 (po-update, cvs-update, update): New targets.
5905 2001-08-27 Akim Demaille <akim@epita.fr>
5907 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
5908 * Makefile.maint: Sync. with CVS Autoconf.
5910 2001-08-27 Marc Autret <autret_m@epita.fr>
5912 * src/vcg.h (struct infoname_s): New.
5913 (struct colorentry_s): New.
5914 (graph_s): New fields {vertical,horizontal}_order in structure.
5915 Add `infoname' field.
5916 Add `colorentry' field;
5917 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
5918 (G_HORIZONTAL_ORDER): New.
5920 (G_COLORENTRY): New.
5921 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
5922 Add output of `infoname'.
5923 Add output of `colorentry'.
5925 2001-08-27 Marc Autret <autret_m@epita.fr>
5927 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
5928 This one shadowed a global parameter.
5930 2001-08-24 Marc Autret <autret_m@epita.fr>
5932 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
5933 instead of `unsigned'.
5934 (print_state): Do not call obstack_object_size () in obstack_grow ()
5935 to avoid macro variables shadowing.
5937 2001-08-23 Marc Autret <autret_m@epita.fr>
5939 * src/lex.c (percent_table): Typo: s/naem/name/.
5941 Normalize new options declarations.
5943 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
5945 * tests/suite.at: Exercise %header_extension and %source_extension.
5947 2001-08-16 Marc Autret <autret_m@epita.fr>
5949 * src/reader.c (parse_dquoted_param): New.
5950 (parse_header_extension_decl): Use it.
5951 (parse_source_extension_decl): Likewise.
5953 2001-08-16 Marc Autret <autret_m@epita.fr>
5955 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
5956 (get_xxxx_str): Use assert () instead of complain ().
5957 Remove return invokations in default cases.
5958 (get_decision_str): Modify default behaviour. Remove second argument.
5959 Echo modifications on calls.
5960 (output_graph): Fix.
5962 2001-08-16 Marc Autret <autret_m@epita.fr>
5964 * src/getargs.c (usage): Update with ``-g, --graph''.
5966 2001-08-16 Marc Autret <autret_m@epita.fr>
5968 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
5969 (Option Cross Key): Likewise.
5970 * doc/bison.1: Update.
5972 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
5974 * src/output.c (output_master_parser): Don't finish action_obstack.
5975 (output_parser): Don't care about the muscle action, here.
5976 (prepare): Copy the action_obstack in the action muscle.
5977 (output): Free action_obstack.
5979 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
5981 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
5982 will contain `%union' declaration.
5983 (parse_union_decl): Delete #line directive output.
5984 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
5985 informations about %union.
5986 (parse_union_decl): Copy the union_obstack in the muscle stype.
5987 * src/bison.simple: Add new #line directive.
5988 Add typdef %%stype YYSTYPE.
5990 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
5992 * src/bison.simple: Add new `#line' directive.
5994 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
5996 * src/bison.simple: New `#line' directive.
5997 * src/output.c (output_parser): Support new dynamic muscle input_line.
5999 2001-09-22 Marc Autret <autret_m@epita.fr>
6001 * src/output.c (output_master_parser): New.
6002 (output_parser): Be more re-entrant.
6004 2001-09-21 Marc Autret <autret_m@epita.fr>
6006 * src/reader.c (copy_definition, parse_union_decl): Update and use
6008 (copy_action): Likewise.
6009 Use obstack_1grow ().
6010 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
6012 2001-09-21 Marc Autret <autret_m@epita.fr>
6014 * src/options.c (option_table): Adjust.
6015 * src/lex.c (parse_percent_token): Fix.
6017 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
6019 * src/options.c (symtab.h): Include it, need by lex.h.
6021 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
6023 * src/lex.c (parse_percent_token): Change type of variable `tx', which
6024 is now an option_table_struct*.
6025 (option_strcmp): New function option_strcmp.
6026 (parse_percent_token): Call option_strcmp.
6027 * src/getargs.c (xalloc.h, options.h): Include it.
6028 (getargs): Call create_long_option_table.
6029 (getargs): Free longopts at the end of the function.
6030 (shortopts): Move in options.c.
6031 * src/options.c (create_long_option_table): New function. Convert
6032 information from option_table to option structure.
6033 * src/reader.c (options.h): Include it.
6035 * src/Makefile.am: Adjust.
6036 * src/options.c (option_table): Create from longopts and percent_table.
6037 * src/getargs.c (longopts): Delete.
6038 * src/lex.c (struct percent_table_struct): Delete.
6039 (percent_table): Delete.
6040 (options.h): Include it.
6041 * src/options.c: Create.
6042 * src/options.h: Create.
6043 Declare enum opt_access_e.
6044 Define struct option_table_struct.
6046 2001-09-20 Marc Autret <autret_m@epita.fr>
6048 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
6051 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
6053 * src/bison.simple: s/%%filename/%%skeleton.
6054 * src/muscle_tab.c (getargs.h): Include it.
6055 (muscle_init): Insert new muscle skeleton.
6057 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
6059 * src/output.c (output_parser): Delete unused variable actions_dumped.
6061 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
6063 * src/output.c (output): Delete call to reader_output_yylsp.
6064 * src/reader.c (reader): Likewise.
6065 * src/reader.h: Delete declaration of reader_output_yylsp.
6067 2001-09-02 Marc Autret <autret_m@epita.fr>
6069 * src/reader.c: Include muscle_tab.h.
6070 (parse_union_decl): Update.
6071 (parse_macro_decl): Rename parse_muscle_decl.
6072 Update to use renamed functions and variable.
6073 (read_declarations, copy_action, read_additionnal_code, : Updated
6074 with correct variables and functions names.
6075 (packsymbols, reader): Likewise.
6077 * src/reader.h (muscle_obstack): Extern declaration update.
6079 * src/output.c: Include muscle_tab.h
6080 In all functions using macro_insert, change by using muscle_insert ().
6081 (macro_obstack): Rename muscle_obstack.
6082 Echo modifications in the whole file.
6083 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
6084 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
6085 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
6087 * src/muscle_tab.h: Update double inclusion macros.
6088 (macro_entry_s): Rename muscle_entry_s.
6091 * src/muscle_tab.c: Include muscle_tab.h.
6092 Rename macro_tabble to muscle_table.
6093 (mhash1, mhash2, mcmp): Use muscle_entry.
6094 (macro_init): Rename muscle_init. Update.
6095 (macro_insert): Rename muscle_insert. Update.
6096 (macro_find): Rename muscle_find. Update.
6098 * src/main.c: Include muscle_tab.h.
6099 (main): Call muscle_init ().
6100 * src/Makefile.am (bison_SOURCES): Echo modifications.
6102 2001-09-02 Marc Autret <autret_m@epita.fr>
6104 Now the files macro_tab.[ch] are named muscle_tab.[ch].
6106 * src/muscle_tab.c, src/muscle_tab.h: Add files.
6108 2001-09-02 Marc Autret <autret_m@epita.fr>
6110 * src/macrotab.c, src/macrotab.h: Remove.
6112 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
6114 * src/reader.c (copy_guard): Use muscle to specify the `#line'
6117 2001-09-01 Marc Autret <autret_m@epita.fr>
6119 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
6120 to an explicit value to activate the feature. We do it here.
6122 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
6124 * src/output.c (prepare): Delete the `filename' muscule insertion.
6125 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
6126 (parse_union_decl): Likewise.
6127 * src/macrotab.c (macro_init): Initialize filename by infile.
6129 2001-08-31 Marc Autret <autret_m@epita.fr>
6131 * src/bison.simple (YYLSP_NEEDED): New definition.
6132 * src/output.c (prepare): Add macro insertion of `locations_flag'
6134 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
6136 * src/output.c (prepare): Delete insertion of previous muscles,
6137 and insert the `prefix' muscles.
6138 * src/macrotab.c (macro_init): Likewise.
6139 (macro_init): Initialization prefix directive by `yy'.
6140 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
6141 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
6142 yylval, yydebug, yyerror, yynerrs and yyparse.
6143 New directive `#define' to substitute yydebug, ... with option
6146 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
6148 * src/main.c (main): Standardize.
6149 * src/output.c (output_table_data, output_parser): Likewise.
6150 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
6152 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
6154 * src/reader.c (read_additionnal_code): Rename %%user_code to
6156 * src/output.c (output): Rename %%declarations to %%prologue.
6157 * src/bison.simple: Echo modifications.
6159 2001-08-31 Marc Autret <autret_m@epita.fr>
6161 * src/reader.c (readgram): CleanUp.
6162 (output_token_defines): Likewise.
6163 (packsymbols): Likewise.
6165 * src/output.c (output): CPP-out useless code.
6167 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
6169 * src/reader.c (reader): Delete obsolete call to function
6170 output_trailers and output_headers.
6171 * src/output.h: Remove obsolete functions prototypes of output_headers
6172 and output_trailers.
6174 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
6176 * src/main.c: Include macrotab.h.
6177 * src/macrotab.h (macro_entry_s): Constify fields.
6178 Adjust functions prototypes.
6179 * src/macrotab.c (macro_insert): Constify key and value.
6180 (macro_find): Constify key.
6181 (macro_insert): Include 'xalloc.h'
6182 (macro_insert): Use XMALLOC.
6183 (macro_find): Constify return value.
6184 * src/output.c (output_table_data): Rename table to table_data.
6185 (output_parser): Constify macro_key, macro_value.
6187 2001-08-30 Marc Autret <autret_m@epita.fr>
6189 * src/reader.c (parse_skel_decl): New.
6190 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
6191 * src/lex.h (token_t): New token `tok_skel'.
6192 * src/lex.c (percent_table): Add skeleton option entry.
6195 2001-08-29 Marc Autret <autret_m@epita.fr>
6197 * src/bison.simple: Add %%user_code directive at the end.
6198 * src/reader.c (read_additionnal_code): New.
6200 * src/output.c (output_program): Remove.
6203 2001-08-28 Marc Autret <autret_m@epita.fr>
6205 * src/output.c (output_actions): Clean up.
6206 (output_gram): CPP-out useless code.
6207 * src/reader.c (reader): Clean up, CPP-out useless code.
6209 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
6211 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
6213 * src/bison.simple: Add `%%definitions'.
6215 2001-08-28 Marc Autret <autret_m@epita.fr>
6217 * config/depcomp: New file.
6219 2001-08-27 Paul Eggert <eggert@twinsun.com>
6221 * src/bison.simple (yyparse): Don't take the address of an
6222 item before the start of an array, as that doesn't conform to
6225 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
6227 * src/output.c (output): Remove the initialization of the macro
6228 obstack. It was done too late here.
6230 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
6232 (reader): Initialize the macro obstack here, since we need it to grow
6233 '%define' directives.
6235 * src/reader.h: Declare the macro obstack as extern.
6237 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
6239 * src/output.c (output_parser): Fix. Store single '%' characters in
6240 the output obstack instead of throwing them away.
6242 2001-08-27 Akim Demaille <akim@epita.fr>
6244 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
6246 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
6248 * lib/Makefile.am: Adjust.
6250 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
6252 * src/bison.simple: Update and add '%%' directives.
6254 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
6256 * src/reader.c (reader): Remove calls to 'output_headers' and
6257 'output_trailers'. Remove some C output.
6258 (readgram): Disable a piece of code that was writing a default
6259 definition for 'YYSTYPE'.
6260 (reader_output_yylsp): Remove.
6261 (packsymbols): Output token defintions to a macro.
6262 (copy_definition): Disable C output.
6264 * src/reader.c (parse_macro_decl): New function used to parse macro
6266 (copy_string2): Put the body of copy_string into this new function.
6267 Add a parameter to let the caller choose whether he wants to copy the
6268 string delimiters or not.
6269 (copy_string): Be a simple call to copy_string2 with the last argument
6271 (read_declarations): Add case for macro definition.
6272 (copy_identifier): New.
6273 (parse_macro_decl): Read macro identifiers using copy_identifier
6276 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
6278 * src/output.c (prepare): Add prefixed names.
6279 (output_parser): Output semantic actions.
6280 (output_parser): Fix bug on '%%line' directives.
6282 * src/output.c (output_headers): Remove. The C code printed by this
6283 function should now be in the skeletons.
6284 (output_trailers): Remove.
6285 (output): Disable call to 'reader_output_yylsp'.
6286 (output_rule_data): Do not output tables to the table obstack.
6288 * src/output.c: Remove some C dedicated output.
6289 Improve the use of macro and output obstacks.
6290 (output_defines): Remove.
6292 * src/output.c (output_token_translations): Associate 'translate'
6293 table with a macro. No output to the table obstack.
6294 (output_gram): Same for 'rhs' and 'prhs'.
6295 (output_stos): Same for 'stos'.
6296 (output_rule_data): Same for 'r1' and 'r2'.
6297 (token_actions): Same for 'defact'.
6298 (goto_actions): Same for 'defgoto'.
6299 (output_base): Same for 'pact' and 'pgoto'.
6300 (output_table): Same for 'table'.
6301 (output_check): Same for 'check'.
6303 * src/output.c (output_table_data): New function.
6304 (output_short_table): Remove.
6305 (output_short_or_char_table): Remove.
6307 * src/output.c (output_parser): Replace most of the skeleton copy code
6308 with something new. Skeletons are now processed character by character
6309 rather than line by line, and Bison looks for '%%' macros. This is the
6310 first step in making Bison's output process (a lot) more flexible.
6311 (output_parser): Use the macro table.
6313 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
6315 * src/main.c (main): Initialize the macro table.
6317 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
6319 * src/lex.c (percent_table): Add tok_define.
6320 * src/lex.h: Add tok_define.
6322 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
6324 * src/macrotab.c: New file.
6325 * src/macrotab.h: New file.
6326 * src/Makefile.am: Update.
6328 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
6330 * lib/hash.c: New file.
6331 * lib/hash.h: New file.
6332 * lib/Makefile.am: Update.
6334 2001-08-15 Akim Demaille <akim@epita.fr>
6338 2001-08-15 Marc Autret <autret_m@epita.fr>
6340 * src/reader.c (readgram): Indent output macro YYSTYPE.
6341 (packsymbols): Likewise.
6342 (output_token_defines): Likewise.
6343 * src/files.c: Standardize.
6344 (compute_header_macro): New.
6345 (defines_obstack_save): New. Use compute_header_macro.
6346 (output_files): Update. Use defines_obstack_save.
6348 2001-08-15 Akim Demaille <akim@epita.fr>
6350 * doc/bison.texinfo (Table of Symbols): Document
6353 2001-08-15 Akim Demaille <akim@epita.fr>
6355 * missing: Update from CVS Automake.
6356 * config/config.guess, config/config.sub, config/texinfo.tex:
6357 Update from gnu.org.
6359 2001-08-15 Akim Demaille <akim@epita.fr>
6361 * Makefile.maint: Sync with CVS Autoconf.
6363 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
6365 * doc/bison.texinfo: Include GNU Free Documentation License from
6367 * doc/fdl.texi: Add to package.
6369 2001-08-14 Marc Autret <autret_m@epita.fr>
6371 Turn on %{source,header}_extension features.
6373 * src/lex.c (percent_table): Un-CPP out header_extension and
6375 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
6376 (compute_exts_from_src): Remove conditions. It restores priorities
6379 2001-08-14 Marc Autret <autret_m@epita.fr>
6381 * src/files.c (compute_base_names): Add extensions computing when
6382 `--file-prefix' used.
6383 Standardize function calls.
6385 2001-08-13 Marc Autret <autret_m@epita.fr>
6387 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
6388 defining it (defined but null disables alloca).
6390 2001-08-13 Marc Autret <autret_m@epita.fr>
6392 * src/bison.simple (_yy_memcpy): CPP reformat.
6394 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
6396 * tests/atconfig.in (CPPFLAGS): Fix.
6398 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
6400 * doc/bison.texinfo: Include GNU General Public License from
6402 * doc/gpl.texi: Add to package.
6404 2001-08-10 Marc Autret <autret_m@epita.fr>
6406 * src/print_graph.h: Fix.
6407 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
6409 2001-08-10 Akim Demaille <akim@epita.fr>
6411 * src/system.h: Provide default declarations for stpcpy, strndup,
6414 2001-08-10 Robert Anisko <anisko_r@epita.fr>
6416 * doc/bison.texinfo (Locations): Update @$ stuff.
6418 2001-08-09 Robert Anisko <anisko_r@epita.fr>
6420 * src/bison.simple (YYLLOC_DEFAULT): Update.
6423 2001-08-08 Marc Autret <autret_m@epita.fr>
6425 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
6426 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
6427 Reported by Fabrice Bauzac.
6429 2001-08-08 Marc Autret <autret_m@epita.fr>
6431 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
6432 * src/vcg.c (output_node): Fix.
6433 * src/vcg.h: Cleanup.
6434 * src/print_graph.c: Add comments.
6435 (node_output_size): New global variable. Simplify the formatting of
6436 the VCG graph output.
6437 (print_actions): Unused code is now used. It notifies the final state
6438 and no action states in the VCG graph. It also give the reduce actions.
6439 The `shift and goto' edges are red and the `go to state' edges are
6441 Get the current node name and node_obstack by argument.
6442 (node_obstack): New variable.
6443 (print_state): Manage node_obstack.
6444 (print_core): Use node_obstack given by argument.
6445 A node is not only computed here but in print_actions also.
6446 (print_graph): CPP out useless code instead of commenting it.
6448 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
6450 * tests/atconfig.in (CPPFLAGS): Fix.
6452 2001-08-07 Akim Demaille <akim@epita.fr>
6454 * src/print_graph.c (quote): New.
6455 (print_core): Use it.
6457 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
6459 * src/vcg.c (complain.h): Include it.
6460 Unepitaize `return' invocations.
6461 [NDEBUG] (main): Remove.
6462 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
6463 * src/files.c (open_files): Initialize graph_obstack.
6464 * src/print_graph.c (print_actions): CPP out useless code.
6465 (print_core): Don't output the last `\n' in labels.
6467 * src/files.c (output_files): Output the VCG file.
6468 * src/main.c (main): Invoke print_graph ();
6470 2001-08-06 Marc Autret <autret_m@epita.fr>
6472 Automaton VCG graph output.
6473 Using option ``-g'' or long option ``--graph'', you can generate
6474 a gram_filename.vcg file containing a VCG description of the LALR (1)
6475 automaton of your grammar.
6477 * src/main.c: Call to print_graph() function.
6478 * src/getargs.h: Update.
6479 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
6480 (graph_flag): New flag.
6482 (getargs): Add case `g'.
6483 * src/files.c (graph_obstack): New obstack struct.
6484 (open_files): Initialize new obstack.
6485 (output_files): Saves graph_obstack if required.
6486 * src/files.h (graph_obstack): New extern declaration.
6487 * src/Makefile.am: Add new source files.
6489 2001-08-06 Marc Autret <autret_m@epita.fr>
6491 * src/print_graph.c, src/print_graph.h (graph): New.
6492 * src/vcg.h: New file.
6493 * src/vcg.c: New file, VCG graph handling.
6495 2001-08-06 Marc Autret <autret_m@epita.fr>
6497 Add of %source_extension and %header_extension which specify
6498 the source or/and the header output file extension.
6500 * src/files.c (compute_base_names): Remove initialisation of
6501 src_extension and header_extension.
6502 (compute_exts_from_gf): Update.
6503 (compute_exts_from_src): Update.
6504 (output_files): Update.
6505 * src/reader.c (parse_header_extension_decl): New.
6506 (parse_source_extension_decl): New.
6507 (read_declarations): New case statements for the new tokens.
6508 * src/lex.c (percent_table): Add entries for %source_extension
6509 and %header_extension.
6510 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
6512 2001-08-06 Marc Autret <autret_m@epita.fr>
6514 * configure.in: Bump to 1.28c.
6515 * doc/bison.texinfo: Texinfo thingies.
6517 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
6519 * tests/atconfig.in (CPPFLAGS): Add.
6520 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
6522 2001-08-03 Akim Demaille <akim@epita.fr>
6526 2001-08-03 Akim Demaille <akim@epita.fr>
6528 * tests/Makefile.am (check-local): Ship testsuite.
6529 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
6532 2001-08-03 Akim Demaille <akim@epita.fr>
6534 * configure.in: Try using -Wformat when compiling.
6536 2001-08-03 Akim Demaille <akim@epita.fr>
6538 * configure.in: Bump to 1.28b.
6540 2001-08-03 Akim Demaille <akim@epita.fr>
6542 * src/complain.c: Adjust strerror_r portability issues.
6544 2001-08-03 Akim Demaille <akim@epita.fr>
6548 2001-08-03 Akim Demaille <akim@epita.fr>
6550 * src/getargs.c, src/getarg.h (skeleton)): Constify.
6551 * src/lex.c (literalchar): Avoid name clashes on `buf'.
6552 * src/getargs.c: Include complain.h.
6553 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
6554 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
6556 2001-08-03 Akim Demaille <akim@epita.fr>
6558 * src/reader.c (readgram): Display hidden chars in error messages.
6560 2001-08-03 Akim Demaille <akim@epita.fr>
6562 Update to gettext 0.10.39.
6564 2001-08-03 Akim Demaille <akim@epita.fr>
6566 * lib/strspn.c: New.
6568 2001-08-01 Marc Autret <autret_m@epita.fr>
6570 * doc/bison.texinfo: Update.
6571 * doc/bison.1 (mandoc): Update.
6572 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
6573 * src/files.c: Support output files extensions computing.
6574 (src_extension): New static variable.
6575 (header_extension): New static variable.
6577 (get_extension_index): New function, gets the index of an extension
6578 filename in a string.
6579 (compute_exts_from_gf): New function, computes extensions from the
6580 grammar file extension.
6581 (compute_exts_from_src): New functions, computes extensions from the
6582 C source file extension, file given by ``-o'' option.
6583 (compute_base_names): Update.
6584 (output_files): Update.
6586 2001-08-01 Robert Anisko <anisko_r@epita.fr>
6588 * doc/bison.texi: Document @$.
6589 (Locations): New section.
6591 2001-07-18 Akim Demaille <akim@epita.fr>
6593 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
6594 * config/prev-version.txt, config/move-if-change: New.
6595 * Makefile.am: Adjust.
6597 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
6599 * src/bison.simple (yyparse): Suppress warning `comparaison
6600 between signed and unsigned'.
6602 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
6604 * src/getargs.h (raw_flag): Remove.
6605 * src/getargs.c: Die on `-r'/`--raw'.
6606 * src/lex.c (parse_percent_token): Die on `%raw'.
6607 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
6608 * tests/calc.at: Suppress test with option `--raw'.
6610 2001-07-14 Akim Demaille <akim@epita.fr>
6613 * configure.in: Require Autoconf 2.50.
6614 Update to gettext 0.10.38.
6616 2001-03-16 Akim Demaille <akim@epita.fr>
6618 * doc/bison.texinfo: ANSIfy the examples.
6620 2001-03-16 Akim Demaille <akim@epita.fr>
6622 * getargs.c (skeleton): New variable.
6623 (longopts): --skeleton is a new option.
6624 (shortopts, getargs): -S is a new option.
6625 * getargs.h: Declare skeleton.
6626 * output.c (output_parser): Use it.
6628 2001-03-16 Akim Demaille <akim@epita.fr>
6630 * m4/strerror_r.m4: New.
6631 * m4/error.m4: Run AC_FUNC_STRERROR_R.
6632 * lib/error.h, lib/error.c: Update.
6634 2001-03-16 Akim Demaille <akim@epita.fr>
6636 * src/getargs.c (longopts): Clean up.
6638 2001-02-21 Akim Demaille <akim@epita.fr>
6640 * src/reader.c (gensym): `gensym_count' is your own.
6641 Use a static buf to create the symbol name, as token_buffer is no
6644 2001-02-08 Akim Demaille <akim@epita.fr>
6646 * src/conflicts.c (conflict_report): Be sure not to append to res
6647 between two calls, which could happen if both first sprintf were
6648 skipped, but not the first cp += strlen.
6650 2001-02-08 Akim Demaille <akim@epita.fr>
6652 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
6653 New, from fileutils 4.0.37.
6654 * configure.in: Require Autoconf 2.49c. I took some time before
6655 making this decision. This is the only way out for portability
6656 issues in Bison, it would mean way too much duplicate effort to
6657 import in Bison features implemented in 2.49c since 2.13.
6658 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
6660 2001-02-02 Akim Demaille <akim@epita.fr>
6662 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
6663 * lib/xalloc.h, lib/xmalloc.c: Update.
6665 2001-01-19 Akim Demaille <akim@epita.fr>
6667 Get rid of the ad hoc handling of token_buffer in the scanner: use
6670 * src/lex.c (token_obstack): New.
6671 (init_lex): Initialize it. No longer call...
6672 (grow_token_buffer): this. Remove it.
6673 Adjust all the places which used it to use the obstack.
6675 2001-01-19 Akim Demaille <akim@epita.fr>
6677 * src/lex.h: Rename all the tokens:
6678 s/\bENDFILE\b/tok_eof/g;
6679 s/\bIDENTIFIER\b/tok_identifier/g;
6681 Let them be enums, not #define, to ease debugging.
6682 Adjust all the code.
6684 2001-01-18 Akim Demaille <akim@epita.fr>
6686 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
6687 * src/lex.c (maxtoken, grow_token_buffer): Static.
6689 2001-01-18 Akim Demaille <akim@epita.fr>
6691 Since we now use obstacks, more % directives can be enabled.
6693 * src/lex.c (percent_table): Also accept `%yacc',
6694 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
6696 Handle the actions for `%semantic_parser' and `%pure_parser' here,
6697 instead of returning a token.
6698 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
6699 * src/reader.c (read_declarations): Adjust.
6700 * src/files.c (open_files): Don't call `compute_base_names', don't
6701 compute `attrsfile' since they depend upon data which might be
6702 *in* the input file now.
6703 (output_files): Do it here.
6704 * src/output.c (output_headers): Document the fact that this patch
6705 introduces a guaranteed SEGV for semantic parsers.
6706 * doc/bison.texinfo: Document them.
6707 * tests/suite.at: Exercise these %options.
6709 2000-12-20 Akim Demaille <akim@epita.fr>
6711 Also handle the output file (--verbose) with obstacks.
6713 * files.c (foutput): Remove.
6714 (output_obstack): New.
6715 Adjust all dependencies.
6716 * src/conflicts.c: Return a string.
6717 * src/system.h (obstack_grow_string): Rename as...
6718 (obstack_sgrow): this. Be ready to work with non literals.
6719 (obstack_fgrow4): New.
6721 2000-12-20 Akim Demaille <akim@epita.fr>
6723 * src/files.c (open_files): Fix the computation of short_base_name
6724 in the case of `-o foo.tab.c'.
6726 2000-12-20 Akim Demaille <akim@epita.fr>
6728 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
6729 (copy_dollar): Now that everything uses obstacks, get rid of the
6732 2000-12-20 Akim Demaille <akim@epita.fr>
6734 * src/files.c (open_files): Actually the `.output' file is based
6735 on the short_base_name, not base_name.
6736 * tests/suite.at (Checking output file names): Adjust.
6738 2000-12-20 Akim Demaille <akim@epita.fr>
6740 * src/bison.s1: Remove, we now use directly...
6741 * src/bison.simple: this.
6742 * src/Makefile.am: Use pkgdata instead of data.
6744 2000-12-20 Akim Demaille <akim@epita.fr>
6746 * src/files.c (guard_obstack): New.
6747 (open_files): Initialize it.
6748 (output_files): Dump it...
6749 * src/files.h: Export it.
6750 * src/reader.c (copy_guard): Use it.
6752 2000-12-19 Akim Demaille <akim@epita.fr>
6754 * src/files.c (outfile, defsfile, actfile): Removed as global
6756 (open_files): Don't compute them.
6757 (output_files): Adjust.
6758 (base_name, short_base_name): Be global.
6759 Adjust dependencies.
6761 2000-12-19 Akim Demaille <akim@epita.fr>
6763 * src/files.c (strsuffix): New.
6764 (stringappend): Be just like strcat but allocate.
6765 (base_names): Eve out from open_files.
6766 Try to simplify the rather hairy computation of base_name and
6768 (open_files): Use it.
6769 * tests/suite.at (Checking output file names): New test.
6771 2000-12-19 Akim Demaille <akim@epita.fr>
6773 * src/system.h (obstack_grow_literal_string): Rename as...
6774 (obstack_grow_string): this.
6775 * src/output.c (output_parser): Recognize `%% actions' instead of
6777 * src/bison.s1: s/$/%% actions/.
6778 * src/bison.hairy: Likewise.
6780 2000-12-19 Akim Demaille <akim@epita.fr>
6782 * src/output.c (output_parser): Compute the `#line' lines when
6784 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
6785 Suggested by Hans Aberg.
6787 2000-12-19 Akim Demaille <akim@epita.fr>
6789 Let the handling of the skeleton files be local to the procedures
6792 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
6794 (fparser, open_extra_files): Remove.
6795 (open_files, output_files): Don't take care of fparser.
6796 * src/files.h: Adjust.
6797 * src/output.c (output_parser): Open and close the file to the
6799 * src/reader.c (read_declarations): When %semantic_parser, open
6802 2000-12-19 Akim Demaille <akim@epita.fr>
6804 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
6805 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
6807 2000-12-19 Akim Demaille <akim@epita.fr>
6809 * src/files.c (open_files): Yipee! We no longer need all the code
6810 looking for `/tmp' since we have no tmp file.
6812 2000-12-19 Akim Demaille <akim@epita.fr>
6814 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
6816 * src/files.c (open_files): Less dependency on MSDOS etc.
6818 2000-12-14 Akim Demaille <akim@epita.fr>
6820 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
6821 Provide a default definition.
6822 Use it when executing the default @ action.
6823 * src/reader.c (reader_output_yylsp): No longer include
6824 `timestamp' and `text' in the default YYLTYPE.
6826 2000-12-12 Akim Demaille <akim@epita.fr>
6828 * src/reader.c (copy_definition, parse_union_decl, copy_action)
6829 (copy_guard): Quote the file names.
6830 Reported by Laurent Mascherpa.
6832 2000-12-12 Akim Demaille <akim@epita.fr>
6834 * src/output.c (output_headers, output_program, output): Be sure
6835 to escape special characters when outputting filenames.
6836 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
6837 (output_headers): Don't depend on them, Use ACTSTR.
6839 2000-11-17 Akim Demaille <akim@epita.fr>
6841 * lib/obstack.h: Formatting changes.
6842 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
6843 prevents type checking.
6844 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
6845 cast the value to (void *): assigning a `foo *' to a `void *'
6847 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
6848 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
6851 2000-11-17 Akim Demaille <akim@epita.fr>
6853 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
6855 (suite.m4, regression.m4, calc.m4): these.
6856 * tests/atgeneral.m4: Update from CVS Autoconf.
6858 2000-11-17 Akim Demaille <akim@epita.fr>
6860 * tests/regression.m4 (%union and --defines): New test,
6861 demonstrating a current bug in the obstack implementation.
6863 2000-11-17 Akim Demaille <akim@epita.fr>
6865 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
6867 Use them to declare the variables which are global or local to
6870 2000-11-17 Akim Demaille <akim@epita.fr>
6872 * acconfig.h: Remove, no longer used.
6874 2000-11-07 Akim Demaille <akim@epita.fr>
6876 * src: s/Copyright (C)/Copyright/g.
6878 2000-11-07 Akim Demaille <akim@epita.fr>
6880 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
6882 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
6884 2000-11-07 Akim Demaille <akim@epita.fr>
6886 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
6887 Merge in a single CPP if/else.
6889 2000-11-07 Akim Demaille <akim@epita.fr>
6891 * src/output.c (output): Remove useless variables.
6892 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
6893 argument `data' for consistency with the prototypes.
6895 (obstack_copy, obstack_copy0): Rename the second argument as
6896 `address' for consistency. Qualify it `const'.
6897 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
6898 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
6899 `const' their input argument (`data' or `address').
6900 Adjust the corresponding macros to include `const' in casts.
6902 2000-11-03 Akim Demaille <akim@epita.fr>
6904 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
6905 s/PFILE1/BISON_HAIRY/.
6906 Adjust dependencies.
6908 2000-11-03 Akim Demaille <akim@epita.fr>
6910 For some reason, this was not applied.
6912 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
6913 `unlink': it's no longer used.
6915 2000-11-03 Akim Demaille <akim@epita.fr>
6917 * src/files.c (skeleton_find): New function, eved out of...
6918 (open_files, open_extra_files): here.
6920 2000-11-03 Akim Demaille <akim@epita.fr>
6924 * src/files.c (obstack_save): New function.
6925 (done): Rename as...
6926 (output_files): this.
6928 * src/main.c (main): Don't use `atexit' to register `done', since
6929 it no longer has to remove tmp files, just call `output_files'
6930 when there are no errors.
6932 2000-11-02 Akim Demaille <akim@epita.fr>
6934 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
6935 `unlink': it's no longer used.
6936 * src/files.h: Formatting changes.
6938 2000-11-02 Akim Demaille <akim@epita.fr>
6940 Remove the last uses of mktemp and unlink/delete.
6942 * src/files.c (fdefines, ftable): Removed.
6943 (defines_ostack, table_obstack): New.
6944 Adjust dependencies of the former into uses of the latter.
6945 * src/output.c (output_short_or_char_table, output_short_table):
6946 Convert to using obstacks.
6947 * src/reader.c (copy_comment2): Accept one FILE * and two
6949 (output_token_defines, reader_output_yylsp): Use obstacks.
6950 * src/system.h (obstack_fgrow3): New.
6952 2000-11-01 Akim Demaille <akim@epita.fr>
6954 Change each use of `fattrs' into a use of `attrs_obstack'.
6956 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
6957 * src/files.c (fattrs): Remove.
6958 (attrs_obstack): New.
6959 Adjust all dependencies.
6960 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
6962 2000-11-01 Akim Demaille <akim@epita.fr>
6965 Change each use of `faction' into a use of `action_obstack'.
6967 * lib/obstack.h, lib/obstack.c: New files.
6968 * src/files.c (faction): Remove.
6969 (action_obstack): New.
6970 Adjust all dependencies.
6972 2000-10-20 Akim Demaille <akim@epita.fr>
6974 * lib/quote.h (PARAMS): New macro. Use it.
6976 2000-10-16 Akim Demaille <akim@epita.fr>
6978 * src/output.c (output_short_or_char_table): New function.
6979 (output_short_table, output_token_translations): Use it.
6980 (goto_actions): Use output_short_table.
6982 2000-10-16 Akim Demaille <akim@epita.fr>
6984 * src/symtab.c (bucket_new): New function.
6987 * src/output.c (output_short_table): New argument to display the
6988 comment associated with the table.
6989 Adjust dependencies.
6990 (output_gram): Use it.
6991 (output_rule_data): Nicer output layout for YYTNAME.
6993 2000-10-16 Akim Demaille <akim@epita.fr>
6995 * src/lex.c (read_typename): New function.
6997 * src/reader.c (copy_dollar): Likewise.
6999 2000-10-16 Akim Demaille <akim@epita.fr>
7001 * src/reader.c (copy_comment2): Expect the input stream to be on
7002 the `/' which is suspected to open a comment, instead of being
7003 called after `//' or `/*' was read.
7004 (copy_comment, copy_definition, parse_union_decl, copy_action)
7005 (copy_guard): Adjust.
7007 2000-10-16 Akim Demaille <akim@epita.fr>
7009 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
7010 `read_signed_integer'.
7012 2000-10-16 Akim Demaille <akim@epita.fr>
7014 * src/reader.c (copy_dollar): New function.
7015 (copy_guard, copy_action): Use it.
7017 2000-10-16 Akim Demaille <akim@epita.fr>
7019 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
7020 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
7021 New files, from Fileutils 4.0.27.
7022 * src/main.c (printable_version): Remove.
7023 * src/lex.c, src/reader.c: Use `quote'.
7025 2000-10-04 Akim Demaille <akim@epita.fr>
7027 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
7029 2000-10-04 Akim Demaille <akim@epita.fr>
7031 * doc/bison.texinfo: Various typos spotted by Neil Booth.
7033 2000-10-04 Akim Demaille <akim@epita.fr>
7035 When a literal string is used to define two different tokens,
7036 `bison -v' segfaults.
7037 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
7039 * tests/regression.m4: New file.
7040 Include the core of the sample provided by Piotr Gackiewicz.
7041 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
7044 2000-10-04 Akim Demaille <akim@epita.fr>
7046 * src/reader.c (parse_expect_decl): Keep `count' within the size
7050 2000-10-02 Paul Eggert <eggert@twinsun.com>
7052 * bison.s1 (yyparse): Assign the default value
7053 unconditionally, to avoid a GCC warning and make the parser a
7056 2000-10-02 Akim Demaille <akim@epita.fr>
7058 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
7061 2000-10-02 Akim Demaille <akim@epita.fr>
7063 * src/derives.c, src/print.c, src/reduce.c: To ease the
7064 translation, move some `\n' out of the translated strings.
7066 2000-10-02 Akim Demaille <akim@epita.fr>
7068 The location tracking mechanism is precious for parse error
7069 messages. Nevertheless, it is enabled only when `@n' is used in
7070 the grammar, which is a different issue (you can use it in error
7071 message, but not in the grammar per se). Therefore, there should
7072 be another means to enable it.
7074 * src/getargs.c (getargs): Support `--locations'.
7076 * src/getargs.h (locationsflag): Export it.
7077 * src/lex.c (percent_table): Support `%locations'.
7078 * src/reader.c (yylsp_needed): Remove this variable, now replaced
7079 with `locationsflag'.
7080 * doc/bison.texinfo: Document `--locations' and `%locations'.
7082 * tests/calc.m4: Test it.
7084 For regularity of the names, replace each
7085 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
7086 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
7087 In addition replace each `flag' with `_flag'.
7089 2000-10-02 Akim Demaille <akim@epita.fr>
7091 Also test parse error messages, including with YYERROR_VERBOSE.
7093 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
7095 Use it to check the computations.
7096 Use it to check `nonassoc' is honored.
7097 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
7098 `--yyerror-verbose'.
7099 (_AT_CHECK_CALC): Adjust to this option.
7100 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
7102 2000-10-02 Akim Demaille <akim@epita.fr>
7104 Test also `--verbose', `--defines' and `--name-prefix'. Testing
7105 the latter demonstrates a flaw in the handling of non debugging
7106 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
7107 was used in order to simplify:
7123 unfortunately this leads to a CPP conflict when
7124 `--name-prefix=foo' is used since it produces `#define yydebug
7127 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
7128 (YYDPRINTF): New macro.
7130 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
7132 Also test `--verbose', `--defines' and `--name-prefix'.
7134 2000-10-02 Akim Demaille <akim@epita.fr>
7136 Improve the readability of the produced parsers.
7138 * src/bison.s1: Formatting changes.
7139 Improve the comment related to the `$' mark.
7140 (yydefault): Don't fall through to `yyresume': `goto' there.
7141 * src/output.c (output_parser): When the `$' is met, skip the end
7143 New variable, `number_of_dollar_signs', to check there's exactly
7144 one `$' in the parser skeleton.
7146 2000-10-02 Akim Demaille <akim@epita.fr>
7148 * lib/xstrdup.c: New file, from the fileutils.
7149 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
7150 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
7151 instead of strlen + xmalloc + strcpy.
7152 * src/symtab.c (copys): Remove, use xstrdup instead.
7154 2000-10-02 Akim Demaille <akim@epita.fr>
7156 * src/gram.h (associativity): New enum type which replaces the
7157 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
7158 `right_assoc', `left_assoc' and `non_assoc'.
7159 Adjust all dependencies.
7160 * src/reader.c: Formatting changes.
7161 (LTYPESTR): Don't define it, use it as a literal in
7162 `reader_output_yylsp'.
7163 * src/symtab.h (symbol_class): New enum type which replaces the
7164 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
7165 `sunknown', `stoken and `snterm'.
7167 2000-10-02 Akim Demaille <akim@epita.fr>
7169 * src/getargs.c (fixed_outfiles): Rename as...
7170 (yaccflag): for consistency and accuracy.
7171 Adjust dependencies.
7173 2000-10-02 Akim Demaille <akim@epita.fr>
7175 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
7176 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
7177 difficult and introduced a lot of core dump. It turns out that
7178 Bison used an implementation of `xmalloc' based on `calloc', and
7179 at various places it does depend upon the initialization to 0. I
7180 have not tried to isolate the pertinent places, and all the former
7181 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
7182 someone should address this issue.
7184 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
7185 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
7187 Adjust dependencies.
7188 * src/warshall.h: New file.
7191 2000-10-02 Akim Demaille <akim@epita.fr>
7193 Various anti-`extern in *.c' changes.
7195 * src/system.h: Include `assert.h'.
7197 2000-10-02 Akim Demaille <akim@epita.fr>
7199 * src/state.h (nstates, final_state, first_state, first_shift)
7200 (first_reduction): Move their exportation from here...
7201 * src/LR0.h: to here.
7202 Adjust dependencies.
7203 * src/getargs.c (statisticsflag): New variable.
7204 Add support for `--statistics'.
7205 Adjust dependencies.
7207 Remove a lot of now useless `extern' statements in most files.
7209 2000-10-02 Akim Demaille <akim@epita.fr>
7211 * src/LR0.h: New file.
7214 2000-10-02 Akim Demaille <akim@epita.fr>
7216 * src/print.h: New file.
7218 * src/print.c: Formatting and ordering changes.
7219 (verbose, terse): Replace with...
7220 (print_results): this new function.
7221 Adjust dependencies.
7223 2000-10-02 Akim Demaille <akim@epita.fr>
7225 * src/conflicts.c (conflict_report): New function.
7226 (conflict_log, verbose_conflict_log): Replace with...
7227 (print_conflicts): this function.
7228 Adjust dependencies.
7229 * src/conflicts.h: New file.
7230 Propagate its inclusion.
7232 2000-10-02 Akim Demaille <akim@epita.fr>
7234 * src/nullable.h: New file.
7235 Propagate its inclusion.
7236 * src/nullable.c: Formatting changes.
7238 2000-10-02 Akim Demaille <akim@epita.fr>
7240 * src/reduce.h: New file.
7241 Propagate its inclusion.
7242 * src/reduce.c: Topological sort and other formatting changes.
7243 (bool, TRUE, FALSE): Move their definition to...
7244 * src/system.h: here.
7246 2000-10-02 Akim Demaille <akim@epita.fr>
7248 * src/files.c: Formatting changes.
7249 (tryopen, tryclose, openfiles): Rename as...
7250 (xfopen, xfclose, open_files): this.
7251 (stringappend): static.
7252 * src/files.h: Complete the list of exported symbols.
7255 2000-10-02 Akim Demaille <akim@epita.fr>
7257 * src/reader.h: New file.
7258 Propagate its use instead of tedious list of `extern' and
7260 * src/reader.c: Formatting changes, topological sort,
7263 2000-10-02 Akim Demaille <akim@epita.fr>
7265 * src/lex.h: Prototype `lex.c' exported functions.
7266 * src/reader.c: Adjust.
7267 * src/lex.c: Formatting changes.
7268 (safegetc): Rename as...
7271 2000-10-02 Akim Demaille <akim@epita.fr>
7273 * src/lalr.h: New file.
7274 Propagate its inclusion instead of prototypes and `extern'.
7275 * src/lalr.c: Formatting changes, topological sorting etc.
7277 2000-10-02 Akim Demaille <akim@epita.fr>
7279 * src/output.c (token_actions): Introduce a temporary array,
7280 YYDEFACT, that makes it possible for this function to use
7283 2000-10-02 Akim Demaille <akim@epita.fr>
7285 `user_toknums' is output as a `short[]' in `output.c', while it is
7286 defined as a `int[]' in `reader.c'. For consistency with the
7287 other output tables, `user_toknums' is now defined as a table of
7290 * src/reader.c (user_toknums): Be a short table instead of an int
7292 Adjust dependencies.
7294 Factor the short table outputs.
7296 * src/output.c (output_short_table): New function.
7297 * src/output.c (output_gram, output_stos, output_rule_data)
7298 (output_base, output_table, output_check): Use it.
7300 2000-10-02 Akim Demaille <akim@epita.fr>
7302 * src/output.c (output): Topological sort of the functions, in
7303 order to get rid of the `static' prototypes.
7304 No longer use `register'.
7305 * src/output.h: New file.
7306 Propagate its inclusion in files explicitly prototyping functions
7309 2000-09-21 Akim Demaille <akim@epita.fr>
7311 * src/atgeneral.m4: Update from Autoconf.
7313 2000-09-21 Akim Demaille <akim@epita.fr>
7315 * src/closure.h: New file.
7316 * src/closure.c: Formatting changes, topological sort over the
7317 functions, use of closure.h.
7318 (initialize_closure, finalize_closure): Rename as...
7319 (new_closure, free_closure): these. Adjust dependencies.
7320 * src/LR0.c: Formatting changes, topological sort, use of
7322 (initialize_states): Rename as...
7324 * src/Makefile.am (noinst_HEADERS): Adjust.
7326 2000-09-20 Akim Demaille <akim@epita.fr>
7328 * src/acconfig.h: Don't protect config.h against multiple
7330 Don't define PARAMS.
7331 * src/system.h: Define PARAMS.
7332 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
7333 purpose of config.h. system.h must not try to fix wrong
7334 definitions in config.h.
7336 2000-09-20 Akim Demaille <akim@epita.fr>
7338 * src/derives.h: New file.
7339 * src/main.c, src/derives.h: Use it.
7341 * src/Makefile.am (noinst_HEADERS): Adjust.
7343 2000-09-20 Akim Demaille <akim@epita.fr>
7345 * tests/atgeneral.m4: Update from Autoconf.
7346 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
7347 (AT_CHECK_CALC): New macros.
7348 Use these macros to test bison with options `', `--raw',
7349 `--debug', `--yacc', `--yacc --debug'.
7351 2000-09-19 Akim Demaille <akim@epita.fr>
7353 * src/output.c: Formatting changes.
7354 * src/machine.h: Remove, leaving its contents in...
7355 * src/system.h: here.
7357 Adjust all dependencies on stdio.h and machine.h.
7358 * src/getargs.h: New file.
7359 Let all `extern' declarations about getargs.c be replaced with
7360 inclusion of `getargs.h'.
7361 * src/Makefile.am (noinst_HEADERS): Adjust.
7363 * tests/calc.m4 (yyin): Be initialized in main, not on the global
7365 (yyerror): Returns void, not int.
7366 * doc/bison.texinfo: Formatting changes.
7368 2000-09-19 Akim Demaille <akim@epita.fr>
7370 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
7373 2000-09-18 Akim Demaille <akim@epita.fr>
7375 * configure.in: Append WARNING_CFLAGS to CFLAGS.
7376 * src/Makefile.am (INCLUDES): Don't.
7377 Be ready to fetch headers in lib/.
7379 2000-09-18 Akim Demaille <akim@epita.fr>
7381 * doc/bison.texinfo: Update the copyright.
7382 ANSIfy and GNUify the examples.
7383 Remove the old menu.
7385 2000-09-18 Akim Demaille <akim@epita.fr>
7387 First set of tests: use the `calc' example from the documentation.
7389 * src/bison.s1 (yyparse): Condition the code using `yytname' which
7390 is defined only when YYDEBUG is.
7391 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
7392 * src/files.c (tryopen, tryclose): Formatting changes.
7393 Move to the top and be static.
7394 * src/reader.c (read_signed_integer): Likewise.
7395 * tests/calc.m4: New file.
7396 * Makefile.am, suite.m4: Adjust.
7397 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
7399 2000-09-18 Akim Demaille <akim@epita.fr>
7401 Add support for an Autotest test suite for Bison.
7403 * m4/m4.m4, m4/atconfig.m4: New files.
7404 * m4/Makefile.am (EXTRA_DIST): Adjust.
7405 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
7407 * src/getargs.c: Display a more standard --version message.
7408 * src/reader.c (reader): Formatting changes.
7409 No longer depend upon VERSION_STRING.
7410 * configure.in: No longer use `dnl'.
7411 Set up the test suite and the new directory `tests/.
7412 (VERSION_STRING): Remove.
7414 2000-04-14 Akim Demaille <akim@epita.fr>
7416 * src/reader.c (copy_comment2): New function, same as former
7417 `copy_comment', but outputs into two FILE *.
7418 (copy_comment): Use it.
7419 (parse_union_decl): Use it.
7420 (get_type, parse_start_decl): Use the same `invalid' message.
7421 (parse_start_decl, parse_union_decl): Use the same `multiple'
7423 (parse_union_decl, copy_guard, copy_action): Use the same
7424 `unmatched' message.
7425 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
7427 2000-03-31 Akim Demaille <akim@epita.fr>
7429 * src/files.c (tryopen, tryclose): Move to the top.
7432 2000-03-31 Akim Demaille <akim@epita.fr>
7434 * src/main.c (main): Don't call `done', exit does it.
7436 2000-03-31 Akim Demaille <akim@epita.fr>
7438 * allocate.c: s/return (foo)/return foo/.
7441 * output.c: Likewise.
7442 * reader.c: Likewise.
7443 * symtab.c: Likewise.
7444 * vmsgetargs.c: Likewise.
7446 2000-03-31 Akim Demaille <akim@epita.fr>
7448 Clean up the error reporting functions.
7450 * src/report.c: New file.
7451 * src/report.h: Likewise.
7452 * src/Makefile.am: Adjust.
7453 * m4/error.m4: New file.
7454 * m4/Makefile.am: Adjust.
7455 * configure.in (jm_PREREQ_ERROR): Call it.
7456 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
7458 (fatal, fatals): Remove. All callers use complain.c::fatal.
7459 (warn, warni, warns, warnss, warnss): Remove. All callers use
7460 complain.c::complain.
7461 (toomany): Remove, use fatal instead.
7462 * src/files.c (done): No argument, use complain_message_count.
7463 * src/main.c (main): Register `done' to `atexit'.
7465 * src/getargs.c (usage): More `fputs', less `fprintf'.
7467 2000-03-28 Akim Demaille <akim@epita.fr>
7469 * lib/: New directory.
7470 * Makefile.am (SUBDIRS): Adjust.
7471 * configure.in: Adjust.
7472 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
7474 * src/alloca.c: Moved to lib/.
7475 * src/getopt.c: Likewise.
7476 * src/getopt1.c: Likewise.
7477 * src/getopt.h: Likewise.
7478 * src/ansi2knr.c: Likewise.
7479 * src/ansi2knr.1: Likewise.
7480 * src/Makefile.am: Adjust.
7481 * lib/Makefile.am: New file.
7483 2000-03-28 Akim Demaille <akim@epita.fr>
7485 * src/getargs.c (usage): Refresh the help message.
7487 2000-03-17 Akim Demaille <akim@epita.fr>
7489 * src/getopt1.c: Updated from textutils 2.0e
7490 * src/getopt.c: Likewise.
7491 * src/getopt.h: Likewise.
7493 2000-03-17 Akim Demaille <akim@epita.fr>
7495 * src/Makefile.am (bison.simple): Fix the awk program: quote only
7496 the file name, not the whole `#line LINE FILE'.
7498 2000-03-17 Akim Demaille <akim@epita.fr>
7500 On syntax errors, report the token on which we choked.
7502 * src/bison.s1 (yyparse): In the label yyerrlab, when
7503 YYERROR_VERBOSE, add yychar in msg.
7505 2000-03-17 Akim Demaille <akim@epita.fr>
7507 * src/reader.c (copy_at): New function.
7508 (copy_guard): Use it.
7509 (copy_action): Use it.
7511 2000-03-17 Akim Demaille <akim@epita.fr>
7513 Be kind to translators, save some useless translations.
7515 * src/main.c (banner): New function.
7516 (fatal_banner): Use it.
7517 (warn_banner): Use it.
7519 2000-03-17 Akim Demaille <akim@epita.fr>
7521 * src/reader.c (copy_definition): Use copy_string and
7522 copy_comment. Removed now unused `match', `ended',
7524 (copy_comment, copy_string): Moved, to be visible from
7527 2000-03-17 Akim Demaille <akim@epita.fr>
7529 * src/reader.c (copy_string): Declare `static inline'. No
7530 problems with inline, since it is checked by configure.
7531 (copy_comment): Likewise.
7533 2000-03-17 Akim Demaille <akim@epita.fr>
7535 * src/reader.c (packsymbols): Formatting changes.
7537 2000-03-17 Akim Demaille <akim@epita.fr>
7539 * src/reader.c (copy_comment): New function, factored out from:
7540 (copy_action): Use it. Removed now unused `match', `ended',
7542 (copy_guard): Likewise.
7544 2000-03-17 Akim Demaille <akim@epita.fr>
7546 * src/reader.c (copy_string): New function, factored out from:
7547 (copy_action): Use it.
7548 (copy_guard): Likewise.
7550 2000-03-17 Akim Demaille <akim@epita.fr>
7552 Change the handling of @s so that they behave exactly like $s.
7553 There is now a pseudo variable @$ (readble and writable), location
7554 of the lhs of the rule (by default ranging from the location of
7555 the first symbol of the rhs, to the location of the last symbol,
7556 or, if the rhs is empty, YYLLOC).
7558 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
7560 (yyparse): When providing a default semantic action, provide a
7561 default location action.
7562 (after the $): No longer change `*YYLSP', just stack YYLOC the
7563 same way you stack YYVAL.
7564 * src/reader.c (read_declarations): Use warns.
7565 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
7566 (copy_action, case '@'): Likewise.
7567 Use a standard error message, to save useless work from
7570 2000-03-17 Akim Demaille <akim@epita.fr>
7572 * src/bison.s1: Formatting and cosmetics changes.
7573 * src/reader.c: Likewise.
7574 Update the Copyright notice.
7576 2000-03-17 Akim Demaille <akim@epita.fr>
7578 * src/bison.s1 (#line): All set to `#line' only, since the
7579 Makefile now handles them.
7581 2000-03-16 Akim Demaille <akim@epita.fr>
7583 * src/output.c (output_rule_data): Output the documentation of
7585 (Copyright notice): Update.
7588 2000-03-16 Akim Demaille <akim@epita.fr>
7590 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
7591 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
7592 One `#if YYDEBUG' remains, since it uses variables which are
7593 defined only if `YYDEBUG != 0'.
7595 2000-03-16 Akim Demaille <akim@epita.fr>
7597 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
7598 and related variables so that the similarities are highlighted.
7600 2000-03-16 Akim Demaille <akim@epita.fr>
7602 * src/bison.s1: Properly indent CPP directives.
7604 2000-03-16 Akim Demaille <akim@epita.fr>
7606 * src/bison.s1: Properly indent the `alloca' CPP section.
7608 2000-03-16 Akim Demaille <akim@epita.fr>
7610 Do not hard code values of directories in `configure.in'.
7611 Update the `configure' tool chain.
7613 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
7615 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
7616 (AC_OUTPUT): Add m4/Makefile.
7617 Bump to bison 1.28a, 1.29 has never been released.
7618 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
7619 handled via src/Makefile.am.
7620 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
7621 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
7623 * Makefile.am (SUBDIRS): Add m4.
7624 (ACLOCAL_AM_FLAGS): New variable.
7625 (AUTOMAKE_OPTIONS): Add check-news.
7626 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
7627 the proper line number and file name.
7628 (DEFS): Propagate the location of bison library files and of the
7630 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
7632 * acinclude.m4: Remove, replaced by the directory m4.
7633 * m4/Makefile.am (EXTRA_DIST): New variable.
7634 * m4/gettext.m4: New file, from the fileutils.
7635 * m4/lcmessage.m4: Likewise
7636 * m4/progtest.m4: Likewise.
7637 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
7639 2000-03-10 Akim Demaille <akim@epita.fr>
7642 Formatting changes of various comments.
7643 Respect the GNU coding standards at various places.
7644 Don't use `_()' when no translation is needed.
7646 1999-12-13 Jesse Thilo <jthilo@gnu.org>
7649 OS/2 honors TMPDIR environment variable.
7651 1999-12-13 Jesse Thilo <jthilo@gnu.org>
7653 * doc/bison.texinfo: Tweaked spelling and grammar.
7655 Removed reference to price of printed copy.
7656 Mention BISON_SIMPLE and BISON_HAIRY.
7658 1999-12-13 Jesse Thilo <jthilo@gnu.org>
7660 * configure.in, NEWS:
7661 Bison 1.29 released.
7663 1999-10-27 Jesse Thilo <jthilo@gnu.org>
7665 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
7666 Added reference card.
7668 1999-07-26 Jesse Thilo <jthilo@gnu.org>
7670 * po/ru.po: Added Russian translation.
7672 1999-07-26 Jesse Thilo <jthilo@gnu.org>
7674 * configure.in: Added Russian translation.
7676 1999-07-06 Jesse Thilo <jthilo@gnu.org>
7678 * configure.in, NEWS, README:
7679 Released version 1.28.
7681 1999-06-14 Jesse Thilo <jthilo@gnu.org>
7684 Squashed redefinition warning on some systems.
7686 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
7687 Have configure build version string instead of relying on ANSI string
7690 1999-06-14 Jesse Thilo <jthilo@gnu.org>
7692 * po/POTFILES.in: Got rid of version.c.
7694 1999-06-14 Jesse Thilo <jthilo@gnu.org>
7696 * acconfig.h, configure.in:
7697 Have configure build version string instead of relying on ANSI string
7700 1999-06-08 Jesse Thilo <jthilo@gnu.org>
7703 Dropped mention of `+' for long-named options.
7705 1999-05-30 Jesse Thilo <jthilo@gnu.org>
7707 * src/files.c: Added <unistd.h> for unlink().
7709 * src/Makefile.am, src/system.h:
7712 1999-05-30 Jesse Thilo <jthilo@gnu.org>
7714 * README: Added a FAQ list.
7716 * configure.in, acconfig.h:
7719 1999-05-30 Jesse Thilo <jthilo@gnu.org>
7721 * doc/FAQ, doc/Makefile.am:
7724 1999-05-19 Jesse Thilo <jthilo@gnu.org>
7726 * src/alloc.h, src/symtab.h, src/version.c:
7727 Protected inclusion of "config.h" with HAVE_CONFIG_H.
7729 1999-04-18 Jesse Thilo <jthilo@gnu.org>
7731 * src/.cvsignore, src/Makefile.am:
7732 Reorganized: sources in `src', documentation in `doc'.
7734 * src/lex.c (literalchar):
7735 fixed the code for escaping double quotes (thanks
7738 1999-04-18 Jesse Thilo <jthilo@gnu.org>
7740 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
7741 Adjusted paths to reflect directory reorganization.
7743 1999-04-18 Jesse Thilo <jthilo@gnu.org>
7745 * doc/.cvsignore, doc/Makefile.am:
7746 Reorganized: sources in `src', documentation in `doc'.
7748 1999-04-18 Jesse Thilo <jthilo@gnu.org>
7751 Updated AC_INIT file to reflect directory reorganization.
7753 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
7754 Reorganized: sources in `src', documentation in `doc'.
7756 1999-04-13 Jesse Thilo <jthilo@gnu.org>
7759 Don't declare calloc() and realloc() if not necessary.
7761 1999-04-13 Jesse Thilo <jthilo@gnu.org>
7763 * configure.in, acconfig.h, acinclude.m4:
7764 Don't declare calloc() and realloc() if not necessary.
7766 1999-03-23 Jesse Thilo <jthilo@gnu.org>
7768 * po/.cvsignore: Added i18n support.
7770 1999-03-23 Jesse Thilo <jthilo@gnu.org>
7772 * acconfig.h, configure.in, Makefile.am:
7775 1999-03-22 Jesse Thilo <jthilo@gnu.org>
7777 * src/bison.s1: Fixed #line numbers.
7779 1999-03-15 Jesse Thilo <jthilo@gnu.org>
7781 * po/es.po, po/fr.po, po/nl.po, po/de.po:
7782 Added PO files from Translation Project.
7784 1999-03-03 Jesse Thilo <jthilo@gnu.org>
7787 Added support for non-ANSI compilers (ansi2knr).
7789 1999-02-16 Jesse Thilo <jthilo@gnu.org>
7791 * configure.in: Bumped version number to 1.27.
7794 Added `bison.simple' to list of files removed by `make distclean'.
7796 1999-02-12 Jesse Thilo <jthilo@gnu.org>
7798 * src/files.c, src/files.h:
7799 Defined locations of parser files in config.h instead of Makefile.
7801 1999-02-12 Jesse Thilo <jthilo@gnu.org>
7803 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
7804 Defined locations of parser files in config.h instead of Makefile.
7806 1999-02-09 Jesse Thilo <jthilo@gnu.org>
7809 Removed inappropriate use of $< macro.
7811 1999-02-05 Jesse Thilo <jthilo@gnu.org>
7813 * po/Makefile.in.in, po/POTFILES.in:
7814 Add `po' directory skeleton.
7816 1999-01-27 Jesse Thilo <jthilo@gnu.org>
7818 * README: Document help-bison list.
7820 * configure.in: Add check for mkstemp().
7822 1999-01-20 Jesse Thilo <jthilo@gnu.org>
7824 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
7825 Hush a few compiler warnings.
7828 Add tryclose(), which verifies that fclose was successful.
7829 Hush a couple of compiler warnings.
7831 1999-01-20 Jesse Thilo <jthilo@gnu.org>
7833 * Makefile.am, OChangeLog:
7834 ChangeLog is now automatically generated. Include the old version as
7837 1999-01-14 Jesse Thilo <jthilo@gnu.org>
7839 * src/gram.h, src/lalr.c, src/lex.c, src/lex.h, src/machine.h, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/state.h, src/symtab.c, src/symtab.h, src/types.h, src/vmsgetargs.c, src/warshall.c, src/allocate.c, src/alloc.h, src/bison.s1, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/files.h, src/getargs.c, src/gram.c, src/LR0.c:
7842 1999-01-14 Jesse Thilo <jthilo@gnu.org>
7844 * doc/bison.texinfo: Fix formatting glitch.
7846 * doc/bison.texinfo: Update FSF address.
7848 1999-01-14 Jesse Thilo <jthilo@gnu.org>
7850 * acconfig.h: Update FSF address.
7852 1999-01-08 Jesse Thilo <jthilo@gnu.org>
7855 Don't define PACKAGE here, since config.h defines it.
7857 1998-12-30 Jesse Thilo <jthilo@gnu.org>
7859 * src/reader.c: Update copyright date.
7862 Ditch sprintf to statically-sized buffers in fatal/warn functions in
7863 favor of output directly to stderr (avoids buffer overruns).
7865 * src/reader.c: Some checks for premature EOF.
7867 * src/allocate.c, src/alloc.h, src/closure.c, src/conflicts.c, src/derives.c, src/getargs.c, src/gram.c, src/lalr.c, src/lex.c, src/LR0.c, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reduce.c, src/symtab.c, src/symtab.h, src/warshall.c:
7868 Use prototypes if the compiler understands them.
7870 * src/files.c: Honor TMPDIR on Unix hosts.
7871 Use prototypes if the compiler understands them.
7874 Fix a couple of buffer overrun bugs.
7875 Use prototypes if the compiler understands them.
7877 * src/system.h: Include unistd.h and ctype.h.
7878 Use #ifdef instead of #if for NLS symbols.
7880 1998-12-30 Jesse Thilo <jthilo@gnu.org>
7882 * doc/bison.texinfo:
7883 Delete comment "consider using @set for edition number, etc..." since
7884 we now are doing so.
7886 1998-12-30 Jesse Thilo <jthilo@gnu.org>
7889 Use prototypes if the compiler understands them.
7891 * NEWS: Document 1.26 highlights.
7893 * Makefile.am: Require Automake 1.3 or later.
7896 Use prototypes if the compiler understands them.
7898 1998-12-29 Jesse Thilo <jthilo@gnu.org>
7901 Use VERSION symbol from automake for version number.
7903 1998-12-29 Jesse Thilo <jthilo@gnu.org>
7905 * acconfig.h, configure.in, version.cin:
7906 Use VERSION symbol from automake for version number.
7908 1998-11-28 Jesse Thilo <jthilo@gnu.org>
7911 Distribute original version of simple parser (bison.s1), not built
7912 version (bison.simple).
7914 1998-11-28 Jesse Thilo <jthilo@gnu.org>
7916 * doc/bison.texinfo: Add info dir entry.
7918 * doc/bison.texinfo:
7919 Let automake put version number into documentation.
7921 1998-11-26 Jesse Thilo <jthilo@gnu.org>
7923 * src/bison.cld, src/build.com, src/vmshlp.mar:
7924 Add non-RCS files from /gd/gnu/bison.
7926 1998-11-26 Jesse Thilo <jthilo@gnu.org>
7929 Document the BISON_HAIRY and BISON_SIMPLE variables.
7931 1998-11-25 Jesse Thilo <jthilo@gnu.org>
7933 * src/version.c: Build version.c automatically.
7936 Fix token numbering (used to start at 258, not 257).
7938 * src/system.h: Include config.h.
7940 * src/getargs.c: Update bug report address.
7942 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
7943 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
7945 1998-11-25 Jesse Thilo <jthilo@gnu.org>
7948 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
7950 * configure.in, version.cin:
7951 Build version.c automatically.
7953 * AUTHORS: Add AUTHORS file.
7955 * README: Update bug report address.
7958 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
7960 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
7963 1998-11-25 Jesse Thilo <jthilo@gnu.org>
7965 * doc/bison.texinfo: Clean up some formatting.
7967 1998-05-05 Richard Stallman <rms@gnu.org>
7969 * doc/bison.texinfo:
7970 Explain better why to make a pure parser.
7972 1998-01-05 Richard Stallman <rms@gnu.org>
7974 * src/files.c (openfiles):
7975 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
7976 find a temporary directory, if possible. Do not unlink files while
7979 1997-08-25 Richard Stallman <rms@gnu.org>
7981 * src/reader.c (stack_offset;):
7982 Change some warni to warns.
7984 * src/lex.c (literalchar): Use warns, not warni.
7986 1997-06-28 Richard Stallman <rms@gnu.org>
7988 * src/bison.s1: Add a Bison version comment.
7990 * src/main.c (fatal, warn, berror):
7993 1997-06-28 Richard Stallman <rms@gnu.org>
7995 * Makefile.in (bison_version): New variable.
7996 (dist): Use that variable.
7997 (bison.s1): Substitute the Bison version into bison.simple.
7999 * bison.simple: Add a Bison version comment.
8001 1997-06-18 Richard Stallman <rms@gnu.org>
8003 * src/main.c (fatal, warn, berror):
8004 Make error messages standard.
8005 (toomany): Improve error message text.
8007 * src/LR0.c, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/lalr.c, src/lex.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/symtab.c:
8008 new.h renamed to alloc.h.
8010 1997-06-18 Richard Stallman <rms@gnu.org>
8012 * Makefile.in: new.h renamed to alloc.h.
8014 1997-05-24 Richard Stallman <rms@gnu.org>
8016 * src/lex.c (literalchar):
8017 Fix the code for escaping \, " and '.
8019 (lex): Avoid trouble when there are many chars
8020 to discard in a char literal with just several chars in it.
8022 1997-05-17 Richard Stallman <rms@gnu.org>
8025 Use malloc, if using alloca is troublesome.
8026 (YYSTACK_USE_ALLOCA): New flag macro.
8027 Define it for some systems and compilers.
8028 (YYSTACK_ALLOC): New macro.
8029 (yyparse): Use YYSTACK_ALLOC to allocate stack.
8030 If it was malloc'd, free it.
8032 1997-05-17 Richard Stallman <rms@gnu.org>
8035 Use malloc, if using alloca is troublesome.
8036 (YYSTACK_USE_ALLOCA): New flag macro.
8037 Define it for some systems and compilers.
8038 (YYSTACK_ALLOC): New macro.
8039 (yyparse): Use YYSTACK_ALLOC to allocate stack.
8040 If it was malloc'd, free it.
8042 1997-04-23 Richard Stallman <rms@gnu.org>
8045 (alloca) [__hpux]: Always define as __builtin_alloca.
8047 1997-04-23 Richard Stallman <rms@gnu.org>
8050 (alloca) [__hpux]: Always define as __builtin_alloca.
8052 1997-04-22 Richard Stallman <rms@gnu.org>
8055 [__hpux]: Include alloca.h (right for HPUX 10)
8056 instead of declaring alloca (right for HPUX 9).
8058 * src/bison.s1 (__yy_memcpy):
8059 Declare arg `count' as unsigned int.
8060 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
8062 1997-04-22 Richard Stallman <rms@gnu.org>
8065 [__hpux]: Include alloca.h (right for HPUX 10)
8066 instead of declaring alloca (right for HPUX 9).
8068 * bison.simple (__yy_memcpy):
8069 Declare arg `count' as unsigned int.
8070 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
8072 1997-01-03 Richard Stallman <rms@gnu.org>
8074 * src/allocate.c: [__STDC__ or _MSC_VER]:
8075 Declare calloc and realloc to return void *.
8077 1997-01-02 Richard Stallman <rms@gnu.org>
8080 [_MSC_VER]: Include stdlib.h and process.h.
8081 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
8083 * src/main.c (main): Return FAILURE as a value.
8084 (printable_version): Declare arg as int, not char.
8086 1997-01-02 Richard Stallman <rms@gnu.org>
8088 * Makefile.in (dist):
8089 Explicitly check for symlinks, and copy them.
8091 1996-12-19 Richard Stallman <rms@gnu.org>
8094 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
8096 1996-12-18 Paul Eggert <eggert@gnu.org>
8098 * src/bison.s1 (yyparse):
8099 If __GNUC__ and YYPARSE_PARAM are both defined,
8100 declare yyparse to have a void * argument.
8102 1996-12-18 Paul Eggert <eggert@gnu.org>
8104 * bison.simple (yyparse):
8105 If __GNUC__ and YYPARSE_PARAM are both defined,
8106 declare yyparse to have a void * argument.
8108 1996-12-17 Richard Stallman <rms@gnu.org>
8110 * src/reduce.c (nbits): Add some casts.
8112 1996-08-12 Richard Stallman <rms@gnu.org>
8114 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
8116 1996-08-12 Richard Stallman <rms@gnu.org>
8118 * bison.simple: Test _MSDOS as well as _MSDOS_.
8120 1996-07-31 Richard Stallman <rms@gnu.org>
8123 [__sun && __i386]: Include alloca.h.
8125 1996-07-31 Richard Stallman <rms@gnu.org>
8128 [__sun && __i386]: Include alloca.h.
8130 1996-07-30 Richard Stallman <rms@gnu.org>
8132 * src/bison.s1: Comment change.
8134 * src/bison.s1: Test _MSDOS_, not MSDOS.
8136 1996-07-30 Richard Stallman <rms@gnu.org>
8138 * bison.simple: Comment change.
8140 * bison.simple: Test _MSDOS_, not MSDOS.
8142 1996-06-01 Richard Stallman <rms@gnu.org>
8144 * src/reduce.c, src/reader.c, src/print.c, src/output.c, src/nullable.c, src/lex.c, src/lalr.c, src/getargs.c, src/derives.c, src/conflicts.c, src/closure.c, src/allocate.c:
8145 Insert `_' macro around many string constants.
8148 Insert `_' macro around many string constants.
8150 (main): Call setlocale, bindtextdomain and textdomain.
8152 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
8153 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
8154 [ENABLE_NLS]: Include libintl.h.
8155 [ENABLE_NLS] (gettext): Define.
8156 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
8157 (N_, PACKAGE, LOCALEDIR): New macros.
8159 1996-06-01 Richard Stallman <rms@gnu.org>
8161 * POTFILES.in: New file.
8163 * Makefile.in (allocate.o):
8164 Define target explicitly.
8166 * Makefile.in (CFLAGS): Set to @CFLAGS@.
8167 (LDFLAGS): Set to @LDFLAGS@.
8168 (configure): Run autoconf only if preceding `cd' succeeds.
8169 (bison.s1): Redirect output to temporary file then move the
8170 temporary to the target, rather than redirecting directly to bison.s1.
8171 (clean): Remove config.status and config.log.
8172 (distclean): Don't remove config.status here.
8174 1996-05-12 Richard Stallman <rms@gnu.org>
8177 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
8179 1996-05-12 Richard Stallman <rms@gnu.org>
8182 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
8184 1996-05-11 Richard Stallman <rms@gnu.org>
8186 * src/bison.s1 (__yy_memcpy):
8187 Really reorder the args, as was supposedly done on Feb 14 1995.
8188 (yyparse): Calls changed accordingly.
8190 1996-05-11 Richard Stallman <rms@gnu.org>
8192 * Makefile.in (dist): Don't use $(srcdir).
8194 * bison.simple (__yy_memcpy):
8195 Really reorder the args, as was supposedly done on Feb 14 1995.
8196 (yyparse): Calls changed accordingly.
8198 1996-01-27 Richard Stallman <rms@gnu.org>
8200 * src/output.c (output_rule_data):
8201 Test YYERROR_VERBOSE in the conditional
8202 around the definition of ttyname.
8204 1995-12-29 Richard Stallman <rms@gnu.org>
8207 Fix line numbers in #line commands.
8209 1995-12-29 Richard Stallman <rms@gnu.org>
8212 Fix line numbers in #line commands.
8214 1995-12-27 Richard Stallman <rms@gnu.org>
8216 * src/bison.s1 (YYPARSE_PARAM_DECL):
8217 In C++, make it always null.
8218 (YYPARSE_PARAM_ARG): New macro.
8219 (yyparse): Use YYPARSE_PARAM_ARG.
8221 1995-12-27 Richard Stallman <rms@gnu.org>
8223 * bison.simple (YYPARSE_PARAM_DECL):
8224 In C++, make it always null.
8225 (YYPARSE_PARAM_ARG): New macro.
8226 (yyparse): Use YYPARSE_PARAM_ARG.
8228 1995-11-29 Richard Stallman <rms@gnu.org>
8230 * doc/bison.texinfo:
8231 Describe literal string tokens, %raw, %no_lines, %token_table.
8233 1995-11-29 Daniel Hagerty <hag@gnu.org>
8235 * doc/bison.texinfo: Fixed update date
8237 1995-10-16 Richard Stallman <rms@gnu.org>
8239 * src/version.c: Version 1.25.
8241 1995-10-16 Richard Stallman <rms@gnu.org>
8243 * NEWS: *** empty log message ***
8245 1995-10-16 Richard Stallman <rms@gnu.org>
8247 * doc/bison.1, doc/bison.rnh:
8250 1995-10-15 Richard Stallman <rms@gnu.org>
8252 * src/vmsgetargs.c, src/getargs.c:
8253 Added -n, -k, and -raw switches.
8254 (noparserflag, toknumflag, rawtoknumflag): New variables.
8256 * src/symtab.h (SALIAS):
8257 New #define for adding aliases to %token.
8258 (struct bucket): Added `alias' field.
8260 * src/reduce.c (reduce_grammar):
8261 Revise error message.
8262 (print_notices): Remove final `.' from error message.
8264 * src/reader.c (reader_output_yylsp):
8266 (readgram): Use `#if 0' around code that accepted %command
8267 inside grammar rules: The documentation doesn't allow it,
8268 and it will fail since the %command processors scan for the next %.
8269 (parse_token_decl): Extended the %token
8270 declaration to allow a multi-character symbol as an alias.
8271 (parse_thong_decl): New function.
8272 (read_declarations): Added %thong declarations.
8273 (read_declarations): Handle NOOP to deal with allowing
8274 % declarations as another means to specify the flags.
8275 (readgram): Allow %prec prior to semantics embedded in a rule.
8276 (skip_to_char, read_declarations, copy_definition)
8277 (parse_token_decl, parse_start_decl, parse_type_decl)
8278 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
8279 (get_type_name, copy_guard, copy_action, readgram)
8280 (get_type, packsymbols): Revised most error messages.
8281 Changed `fatal' to `warnxxx' to avoid aborting for error.
8282 Revised and use multiple warnxxx functions to avoid using VARARGS1.
8283 (read_declarations): Improve the error message for
8284 an invalid character. Do not abort.
8285 (read_declarations, copy_guard, copy_action): Use
8286 printable_version to avoid unprintable characters in printed output.
8287 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
8288 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
8289 Allow the type of a non-terminal can be given
8290 more than once, as long as all specifications give the same type.
8293 (output_headers, output_trailers, output, output_gram)
8294 (output_rule_data): Implement noparserflag variable.
8295 Implement toknumflag variable.
8296 (output): Call reader_output_yylsp to output LTYPESTR.
8298 * src/main.c (main):
8299 If reader sees an error, don't process the grammar.
8300 (fatals): Updated to not use VARARGS1.
8301 (printable_version, int_to_string, warn, warni, warns, warnss)
8302 (warnsss): New error reporting functions. Avoid abort for error.
8305 Added THONG and NOOP for alias processing.
8306 Added SETOPT for the new code that allows setting options with %flags.
8309 Include getopt.h. Add some extern decls.
8310 (safegetc): New function to deal with EOF gracefully.
8311 (literalchar); new function to deal with reading \ escapes.
8312 (lex): Use literalchar.
8313 (lex): Implemented "..." tokens.
8314 (literalchar, lex, parse_percent_token): Made tokenbuffer
8315 always contain the token. This includes growing the token
8316 buffer while reading an integer.
8317 (parse_percent_token): Replaced if-else statement with percent_table.
8318 (parse_percent_token): Added % declarations as another
8319 way to specify the flags -n, -l, and -r. Also added hooks for
8320 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
8321 major changes to files.c.
8322 (lex) Retain in the incoming stream a character following
8324 (skip_white_space, lex): Revised most error messages
8325 and changed fatal to warn to avoid aborting.
8326 (percent_table): Added %thong declarations.
8328 * src/gram.h: Comment changes.
8330 * src/files.c (openfiles, open_extra_files, done):
8332 and actfile file. Handle noparserflag. Both for -n switch.
8334 * src/conflicts.c (resolve_sr_conflict):
8335 Remove use of alloca.
8337 1995-06-01 Jim Meyering <meyering@gnu.org>
8339 * doc/bison.texinfo: *** empty log message ***
8341 1995-05-06 Richard Stallman <rms@gnu.org>
8343 * src/bison.s1: Comment change.
8345 1995-05-06 Richard Stallman <rms@gnu.org>
8347 * bison.simple: Comment change.
8349 1995-05-03 Richard Stallman <rms@gnu.org>
8351 * src/version.c: Version now 1.24.
8353 * src/bison.s1: Change distribution terms.
8355 * src/version.c: Version now 1.23.
8357 1995-05-03 Richard Stallman <rms@gnu.org>
8359 * doc/bison.texinfo:
8360 Rewrite "Conditions for Using Bison".
8361 Update version to 1.24.
8363 1995-05-03 Richard Stallman <rms@gnu.org>
8365 * bison.simple: Change distribution terms.
8367 1995-02-23 Richard Stallman <rms@gnu.org>
8369 * src/files.c: Test __VMS_POSIX as well as VMS.
8371 1995-02-14 Jim Meyering <meyering@gnu.org>
8373 * src/bison.s1 (__yy_memcpy):
8374 Renamed from __yy_bcopy to avoid
8375 confusion. Reverse FROM and TO arguments to be consistent with
8378 1995-02-14 Jim Meyering <meyering@gnu.org>
8380 * bison.simple (__yy_memcpy):
8381 Renamed from __yy_bcopy to avoid
8382 confusion. Reverse FROM and TO arguments to be consistent with
8385 1994-11-10 David J. MacKenzie <djm@gnu.org>
8391 * Makefile.in (DISTFILES): Include NEWS.
8393 * Makefile.in (DISTFILES):
8394 Include install-sh, not install.sh.
8396 * configure.in: Update to Autoconf v2 macro names.
8398 1994-10-05 David J. MacKenzie <djm@gnu.org>
8400 * Makefile.in: fix typo
8402 * Makefile.in (prefix, exec_prefix):
8403 Let configure set them.
8405 1994-09-28 David J. MacKenzie <djm@gnu.org>
8407 * Makefile.in: Set datadir to $(prefix)/share.
8409 1994-09-15 Richard Stallman <rms@gnu.org>
8412 Update copyright notice and GPL version.
8414 1994-09-15 Richard Stallman <rms@gnu.org>
8417 Update copyright notice and GPL version.
8419 1994-07-12 Richard Stallman <rms@gnu.org>
8421 * src/reduce.c, src/reader.c:
8424 1994-05-05 David J. MacKenzie <djm@gnu.org>
8426 * Makefile.in: entered into RCS
8428 1994-03-26 Richard Stallman <rms@gnu.org>
8430 * src/bison.s1: entered into RCS
8432 1994-03-26 Richard Stallman <rms@gnu.org>
8434 * bison.simple: entered into RCS
8436 1994-03-25 Richard Stallman <rms@gnu.org>
8438 * src/main.c: entered into RCS
8440 1994-03-24 Richard Stallman <rms@gnu.org>
8442 * src/conflicts.c: entered into RCS
8444 1994-01-02 Richard Stallman <rms@gnu.org>
8446 * Makefile.in: *** empty log message ***
8448 1993-11-21 Richard Stallman <rms@gnu.org>
8450 * src/bison.s1: *** empty log message ***
8452 1993-11-21 Richard Stallman <rms@gnu.org>
8454 * doc/bison.texinfo: entered into RCS
8456 * doc/bison.texinfo: *** empty log message ***
8458 1993-11-21 Richard Stallman <rms@gnu.org>
8460 * bison.simple: *** empty log message ***
8462 1993-10-25 David J. MacKenzie <djm@gnu.org>
8464 * doc/bison.texinfo: *** empty log message ***
8466 1993-10-19 Richard Stallman <rms@gnu.org>
8468 * src/bison.s1: *** empty log message ***
8470 1993-10-19 Richard Stallman <rms@gnu.org>
8472 * bison.simple: *** empty log message ***
8474 1993-10-14 Richard Stallman <rms@gnu.org>
8476 * src/bison.s1: *** empty log message ***
8478 1993-10-14 Richard Stallman <rms@gnu.org>
8480 * bison.simple: *** empty log message ***
8482 1993-09-14 David J. MacKenzie <djm@gnu.org>
8484 * doc/bison.texinfo: *** empty log message ***
8486 1993-09-13 Noah Friedman <friedman@gnu.org>
8488 * Makefile.in: *** empty log message ***
8490 1993-09-10 Richard Stallman <rms@gnu.org>
8492 * src/conflicts.c: *** empty log message ***
8494 * src/system.h: entered into RCS
8496 1993-09-10 Richard Stallman <rms@gnu.org>
8498 * doc/bison.1: entered into RCS
8500 1993-09-06 Noah Friedman <friedman@gnu.org>
8502 * src/version.c: entered into RCS
8504 1993-09-06 Noah Friedman <friedman@gnu.org>
8506 * Makefile.in: *** empty log message ***
8508 1993-07-30 David J. MacKenzie <djm@gnu.org>
8510 * Makefile.in: *** empty log message ***
8512 1993-07-24 Richard Stallman <rms@gnu.org>
8514 * src/bison.s1: *** empty log message ***
8516 1993-07-24 Richard Stallman <rms@gnu.org>
8518 * bison.simple: *** empty log message ***
8520 1993-07-08 David J. MacKenzie <djm@gnu.org>
8522 * Makefile.in: *** empty log message ***
8524 1993-07-04 Richard Stallman <rms@gnu.org>
8526 * src/bison.s1: *** empty log message ***
8528 1993-07-04 Richard Stallman <rms@gnu.org>
8530 * bison.simple: *** empty log message ***
8532 1993-06-26 David J. MacKenzie <djm@gnu.org>
8534 * src/getargs.c: entered into RCS
8536 1993-06-26 David J. MacKenzie <djm@gnu.org>
8538 * doc/bison.texinfo: *** empty log message ***
8540 * doc/bison.1: New file.
8542 1993-06-25 Richard Stallman <rms@gnu.org>
8544 * src/getargs.c: New file.
8546 1993-06-16 Richard Stallman <rms@gnu.org>
8548 * src/bison.s1: *** empty log message ***
8550 1993-06-16 Richard Stallman <rms@gnu.org>
8552 * bison.simple: *** empty log message ***
8554 1993-06-03 Richard Stallman <rms@gnu.org>
8556 * src/bison.s1: New file.
8558 1993-06-03 Richard Stallman <rms@gnu.org>
8560 * doc/bison.texinfo: *** empty log message ***
8562 1993-06-03 Richard Stallman <rms@gnu.org>
8564 * bison.simple: New file.
8566 1993-05-19 Richard Stallman <rms@gnu.org>
8568 * doc/bison.texinfo: New file.
8570 1993-05-07 Noah Friedman <friedman@gnu.org>
8572 * Makefile.in: *** empty log message ***
8574 1993-04-28 Noah Friedman <friedman@gnu.org>
8576 * src/reader.c: *** empty log message ***
8578 1993-04-23 Noah Friedman <friedman@gnu.org>
8580 * src/alloc.h: entered into RCS
8582 1993-04-20 David J. MacKenzie <djm@gnu.org>
8584 * src/version.c: *** empty log message ***
8586 * src/files.c, src/allocate.c:
8589 * src/reader.c: *** empty log message ***
8591 * src/lex.c: entered into RCS
8593 * src/conflicts.c: New file.
8595 * src/symtab.c: entered into RCS
8597 * src/alloc.h: New file.
8599 * src/LR0.c: entered into RCS
8601 1993-04-18 Noah Friedman <friedman@gnu.org>
8603 * src/reader.c: New file.
8605 * src/version.c: *** empty log message ***
8607 1993-04-18 Noah Friedman <friedman@gnu.org>
8609 * Makefile.in: *** empty log message ***
8611 1993-04-17 Noah Friedman <friedman@gnu.org>
8613 * Makefile.in: *** empty log message ***
8615 1993-04-15 Richard Stallman <rms@gnu.org>
8617 * src/main.c, src/files.c:
8620 1993-04-15 Noah Friedman <friedman@gnu.org>
8622 * configure.in: entered into RCS
8624 * configure.in: *** empty log message ***
8626 * configure.in: New file.
8628 1993-04-14 Richard Stallman <rms@gnu.org>
8630 * Makefile.in: New file.
8632 1993-04-13 Richard Stallman <rms@gnu.org>
8634 * src/version.c: New file.
8636 1993-03-25 Richard Stallman <rms@gnu.org>
8638 * src/output.c: entered into RCS
8640 1992-09-25 Richard Stallman <rms@gnu.org>
8642 * configure.bat: entered into RCS
8644 1992-06-22 Richard Stallman <rms@gnu.org>
8646 * src/vmsgetargs.c: entered into RCS
8648 1992-06-22 Richard Stallman <rms@gnu.org>
8650 * doc/bison.rnh: entered into RCS
8652 1992-04-20 David J. MacKenzie <djm@gnu.org>
8654 * README: entered into RCS
8656 1992-01-22 Richard Stallman <rms@gnu.org>
8658 * src/machine.h: entered into RCS
8660 1991-12-21 Richard Stallman <rms@gnu.org>
8662 * src/lalr.c, src/closure.c:
8665 1991-12-20 Richard Stallman <rms@gnu.org>
8667 * src/state.h: entered into RCS
8669 1991-12-18 Richard Stallman <rms@gnu.org>
8671 * src/print.c, src/nullable.c, src/derives.c:
8674 1991-11-03 David J. MacKenzie <djm@gnu.org>
8676 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
8679 1988-09-09 Richard Stallman <rms@gnu.org>
8681 * src/bison.hairy: entered into RCS
8683 1987-12-16 Richard Stallman <rms@gnu.org>
8685 * REFERENCES: entered into RCS
8688 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
8690 This file is part of GNU Bison.
8692 GNU Bison is free software; you can redistribute it and/or modify
8693 it under the terms of the GNU General Public License as published by
8694 the Free Software Foundation; either version 2, or (at your option)
8697 GNU Bison is distributed in the hope that it will be useful,
8698 but WITHOUT ANY WARRANTY; without even the implied warranty of
8699 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8700 GNU General Public License for more details.
8702 You should have received a copy of the GNU General Public License
8703 along with GNU Bison; see the file COPYING. If not, write to
8704 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
8705 Boston, MA 02111-1307, USA.