]> git.saurik.com Git - bison.git/blame - ChangeLog
Workaround for SGI C++ compiler.
[bison.git] / ChangeLog
CommitLineData
29058652
PE
12004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
2
3 * tests/calc.at, tests/actions.at: Workaround for SGI
4 C++ compiler. (trivial change)
5
62cb8a99
PE
62004-05-27 Paul Eggert <eggert@cs.ucla.edu>
7
fd418816
PE
8 Spent a few hours checking out which prerequisite versions the
9 current sources actually require. I went all the way back to
10 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11 a seemingly endless set of combinations of versions more recent
12 than that. The bottom line is that the current sources require
13 fairly recent versions of the build tools, and it'll be some work
14 to change this.
15 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
16 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
17 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
18 Add comments explaining why those particular versions are
19 currently needed.
20
62cb8a99
PE
21 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
22 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
23 <http://mail.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
24
25 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
26 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
27
caa52c10
PE
282004-05-26 Paul Eggert <eggert@cs.ucla.edu>
29
30 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
31 0.11.5. Suggested by Bruno Haible.
32 * bootstrap: Remove gettext version checking.
33
34 * doc/bison.texinfo (Decl Summary): Also mention that %union
35 can depend on prerequisite types. Problem reported by Tim
36 Van Holder.
37
4bfd5e4e
PE
382004-05-25 Paul Eggert <eggert@cs.ucla.edu>
39
2cef3017
PE
40 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
41 * README-alpha: Don't tell people not to package this.
42
b9c85d5c
PE
43 * bootstrap: Don't assume $(...) works; use `...` instead.
44 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
45 gettext better.
46
4bfd5e4e
PE
47 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
48 put into the -d output file, and mention what to do if YYSTYPE is
49 defined as a macro.
50
6a36ff94
PE
512004-05-24 Paul Eggert <eggert@cs.ucla.edu>
52
6712933e
PE
53 Undo change made earlier today: it caused autopoint to not bring
54 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
55 autopoint's.
56
57 * bootstrap: Check that gettext version matches what's in
58 configure.ac. Warn users to ignore robots.txt ERROR 404.
59 * bootstrap: Undo today's earlier change (logged below).
60 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 61
6a36ff94
PE
62 The gettext version checking is causing more trouble than it's
63 curing; remove it. Problem reported by Paul Hilfinger.
64
65 * bootstrap: Issue a warning that one can expect a message
66 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
67 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
68
209ea708
PE
692004-05-23 Paul Eggert <eggert@cs.ucla.edu>
70
71 Ensure that the C++ compiler used for testing actually works on a
72 simple test program; if not, skip the C++-related tests. Problem
73 reported by Vin Shelton in:
74 http://mail.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
75
76 * m4/cxx.m4: New file.
77 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
78 * tests/atlocal.in (BISON_CXX_WORKS): Add.
79 * tests/local.at (AT_COMPILE_CXX): Use it.
80
41ca2549
PE
812004-05-21 Paul Eggert <eggert@cs.ucla.edu>
82
383e69dc
PE
83 * data/glr.c (yylloc): Output this macro even if locations are not
84 being generated, as the GLR parser needs it even in that case.
85 Problem reported by Troy A. Johnson
86 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
87
41ca2549
PE
88 * configure.ac (AC_INIT): Update to 1.875e.
89
e476c87d
PE
902004-05-21 Paul Eggert <eggert@cs.ucla.edu>
91
92 * NEWS: Version 1.875d.
93 * configure.ac (AC_INIT): Likewise.
94 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
95
96 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
97 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
98 lalr1.cc runs afoul of the first, and the last two are no longer
99 supported by GCC 3.4.0.
100 * README: Mention GNU m4 1.4 or later; mention m4 patches.
101 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
102
233a88ad
PE
1032004-05-06 Paul Eggert <eggert@cs.ucla.edu>
104
105 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
106 unsigned int, for compatibility with latest gnulib hash module.
107 * src/state.c (state_hash, state_hasher): Likewise.
108 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
109 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 110
12ffdd28
PE
1112004-05-03 Paul Eggert <eggert@cs.ucla.edu>
112
113 * NEWS: Unescaped newlines are no longer allowed in char & strings.
114
115 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
116 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
117 character and string literals.
118 (unexpected_end): New function.
119 (unexpected_eof): Use it.
120 (unexpected_newline): New function.
121 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
122 actions.
e476c87d 123
12ffdd28
PE
124 * NEWS: Document %expect-rr.
125
126 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
127 Fix typo by replacing $1 with $option.
128 Remove more 'intl'-related files.
9668e2be 129 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
130
131 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
132 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
133 strtoul.c.
134 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
135 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
136 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
137 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
138 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
139 * src/.cvsignore: Add *.output.
140
141 * src/parse-gram.y: Put copyright notice inside %{ %} so it
142 gets copied to the output file.
e476c87d 143
1f65350a
PE
1442004-04-28 Paul Eggert <eggert@twinsun.com>
145
146 Get files from the gnulib and po repositories, instead of relying
147 on them being in our CVS. Upgrade to latest versions of gnulib
148 and Automake.
149
150 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
151 * bootstrap: Bootstrap from gnulib and po repositories.
152 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
153 * README-cvs: Document these changes. Remove version numbers from
154 mentions of build tools, since they change so often. Mention Flex.
155
156 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
157 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
158 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
159 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 160 does this for us.
12ffdd28
PE
161 (AC_ISC_POSIX): Remove; we no longer support this
162 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
163 (AC_HEADER_STDC): Remove: we now assume C89 or better.
164 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
165 Do not check for C89 headers, except for locale.h which is used
166 by the Yacc library and must port to K&R hosts.
167 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
168 Do not check for C89 functions, except for setlocale which is
169 used by the Yacc library.
170 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
171 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
172 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
173 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
174 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
175 AM_GNU_GETTEXT): Remove; now done by:
176 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
177 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
178 for us.
179
180 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
181 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
182 Define to empty, as gnulib.mk will do the rest for us.
183 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
184 for us.
185 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
186 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
187
188 * src/files.c: Include gnulib's xstrndup.h.
189
190 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
191 (REALLOC): Use xnrealloc, for likewise.
192 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
193 (strnlen, memrchr): Remove decls; functions no longer used.
194 Include <stpcpy.h>.
195
196 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
197 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
198 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
199 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
200 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
201 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
202 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
203 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
204 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
205 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
206 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
207 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
208 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
209 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
210 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
211 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
212 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
213 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
214 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
215 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
216 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
217 Remove, as these files are now generated automatically
218 by bootstrap or automake.
219
220 * po/ChangeLog: Remove: all but one entry was a duplicate
221 of this file, and I moved that 2000-11-02 entry here.
222
223 * config/.cvsignore: Add Makefile, depcomp, install-sh.
224 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
225 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
226 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
227 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
228 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
229 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
230 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
231 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
232 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
233 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
234 xstrndup.h.
235 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
236 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
237 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
238 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
239 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
240 * src/.cvsignore: Remove *_.c.
241
242
243 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
244 support it. (The latest stable gzip doesn't.)
245
2462004-04-27 Paul Eggert <eggert@twinsun.com>
247
248 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
249 case, as stos_ is now used by destructors due to the 2004-02-09
250 change.
251
252 Remove more K&R C support.
253 * lib/libiberty.y (PARAMS): Remove. All uses removed.
254 * lib/subpipe.c (errno): Remove decl.
255 Include <stdlib.h> unconditionally.
256 (EXIT_FAILURE): Remove macro.
257 * src/complain.c (vfprintf, strerror): Remove.
258 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
259 unconditionally.
260 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
261 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
262 (strchr, strspn, memchr): Remove decls.
263 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
264 unconditionally. Do not declare perror.
265 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
266 unconditionally.
267
268 * src/complain.c (_): Remove useless defn, as system.h defines this.
269
270 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
271 with latest obstack.h.
272 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
273 to procedure types, as obstack.h now does that for us.
274 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
275
276 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
277 so that this include file can stand alone.
278 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
279 does this now. Include subpipe.h first after config.h, to
280 test whether it can stand alone.
281
282 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
283 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
284 unused declaration.
285
286 * tests/synclines.at (%union synch line): Put a dummy member in
287 the union, because empty unions aren't allowed in C. Caught
288 by GCC 3.4.0.
289
4f16766c
PE
2902004-04-13 Jim Meyering <jim@meyering.net>
291
292 * src/conflicts.c (conflicts_print): Correct format string typo:
293 use `%%' to produce literal `%'. (trivial change)
294
779e7ceb
PE
2952004-03-30 Paul Eggert <eggert@twinsun.com>
296
297 * src/getargs.c (version): Update copyright year to 2004.
298
299 * data/c.m4 (b4_int_type): Use 'short int' rather than
300 'short', and similarly for 'long', 'unsigned', etc.
301 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
302 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
303 yy_yypstack, yydumpstack): Likewise.
304 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
305 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
306 Likewise.
307 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
308 yy_stack_print, yyparse): Likewise.
309 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
310 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
311 * lib/bitset.c (bitset_print): Likewise.
312 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
313 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
314 * lib/bitsetv.c (bitsetv_dump): Likewise.
315 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
316 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
317 Likewise.
318 * src/LR0.c (allocate_itemsets): Likewise.
319 * src/gram.h (rule_number, rule): Likewise.
320 * src/lalr.h (goto_number): Likewise.
321 * src/nullable.c (nullable_compute): Likewise.
322 * src/output.c (prepare_rules): Likewise.
323 * src/relation.c (relation_print, relation_digraph): Likewise.
324 * src/relation.h (relation_node): Likewise.
325 * src/state.h (state_number, transitions, errs, reductions,
326 struct state): Likewise.
327 * src/symtab.h (symbol_number, struct symbol): Likewise.
328 * src/tables.c (vector_number, tally, action_number,
329 default_goto, goto_actions): Likewise.
330 * tests/existing.at (GNU Cim Grammar): Likewise.
331 * tests/regression.at (Web2c Actions): Likewise.
332
333 * src/output.c (muscle_insert_short_int_table): Renamed from
334 muscle_insert_short_table. All uses changed.
335
d6328241
PH
3362004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
337
338 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
339 (declaration): Replace expected_conflicts with expected_sr_conflicts.
340 Add %expect-rr rule.
4f16766c 341
d6328241
PH
342 * src/scan-gram.l: Recognize %expect-rr.
343
4f16766c 344 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 345 expected_conflicts.
4f16766c 346 (expected_rr_conflicts): Declare.
d6328241
PH
347
348 * src/conflicts.c (expected_sr_conflicts): Rename from
349 expected_conflicts.
350 (expected_rr_conflicts): Define.
351 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
352 for GLR parsers.
353 Use expected_sr_conflicts in place of expected_conflicts.
354 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 355
d6328241 356 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 357
1452af69
PE
3582004-03-08 Paul Eggert <eggert@gnu.org>
359
360 Add support for hex token numbers. Suggested by Odd Arild Olsen in
361 <http://mail.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
362
363 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
364 in lalr1.cc.
365 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
366 * src/scan-gram.l (scan_integer): New function.
367 ({int}): Use it.
368 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
369 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
370 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
371 Say "long int", not "long", for uniformity with GNU style.
372
006d217d
PE
3732004-02-25 Paul Eggert <eggert@twinsun.com>
374
375 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
376 compilers. This fixes a problem with Intel's C++ compiler being
377 chatty, reported by Guido Trentalancia in
378 <http://mail.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
379
c2729758
ADL
3802004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
381
382 Support %destructor and merge error locations in lalr1.cc.
383
384 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
385 (Parser::stos_): Define unconditionally.
386 (Parser::destruct_): New method. Generate its body with
387 b4_yydestruct_generate.
388 (Parser::error_start_): New attribute.
389 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
390 token which are discarded.
391 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
392 error_start_ when erroneous token are discarded.
393 (Parser::parse) <yyerrlab1>: Compute the location of the error
394 token so that it covers all the discarded tokens.
395 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
396 it can be called with `%skeleton "lalr1.cc"', and do that.
397
dd0e0635
PE
3982004-02-02 Paul Eggert <eggert@twinsun.com>
399
400 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
401 $(top_srcdir)/lib and ../lib. This fixes a bug reported
402 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
403 There's no need to mention top_builddir since Automake does that
404 for us.
405 (INCLUDES): Remove, as Automake says it's obsolescent.
406 Contents migrated into AM_CPPFLAGS as described above.
407 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
408
4092004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
410
411 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
412 (yyreportSyntaxError): Handle case where lookahead token is
413 YYEMPTY.
414
be16239b
PH
4152004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
416
417 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
418 resulting parsers are compilable with C++.
419
5fa90832
PE
4202003-12-23 Paul Eggert <eggert@twinsun.com>
421
422 * config/depcomp, config/install-sh: Sync with Automake 1.8.
423 * src/output.c (output_skeleton): Rename local var.
424 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
425 Bison tokens, as this runs afoul of the 2003-10-07 change that
426 disallowed NUL bytes in character constants or string literals.
427
428 * tests/local.at: Require Autoconf 2.59's Autotest.
429 * tests/testsuite.at: Don't include local.at, since we now assume
430 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
431 including it.
432 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
433 multiple inclusion warnings.
dd0e0635 434
b165c324
AD
4352003-12-02 Akim Demaille <akim@epita.fr>
436
437 * doc/bison.texinfo (How Can I Reset the Parser): More about start
438 conditions.
439 From Bruno Haible.
440
26e06a21
ADL
4412003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
442
443 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
444
92ac3705
PE
4452003-10-07 Paul Eggert <eggert@twinsun.com>
446
6a5ecb38
PE
447 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
448 if testsuite doesn't exist.
449
92ac3705
PE
450 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
451 literals, unfortunately.
452 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
453 Complain about NUL bytes in character constants or string literals.
454
91d2c560
PE
4552003-10-05 Paul Eggert <eggert@twinsun.com>
456
457 * NEWS: Don't document %no-default-prec, as it's still
458 too experimental.
459 * doc/bison.texinfo: Document %no-default-prec only if
460 the defaultprec flag is set. Normally it's not.
461
0cc3da3a
PE
4622003-10-04 Paul Eggert <eggert@twinsun.com>
463
464 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
465 non-modifiable lvalue, instead of a modifiable one.
466 * doc/bison.texinfo (Actions): Document that $$ can
467 be assigned to. Do not claim that $$ and $N are
468 array element references: user code should not rely on this.
469
22fccf95
PE
4702003-10-01 Paul Eggert <eggert@twinsun.com>
471
472 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
473 (grammar_declaration): Use it.
474 * src/scan-gram.l: New token %no-default-prec.
475 * tests/conflicts.at: Revamp tests to use %no-default-prec.
476 * NEWS, doc/bison.texinfo: Document the above.
477
fc8f2965
AD
4782003-10-01 Akim Demaille <akim@epita.fr>
479
480 VCG no longer supports long_straight_phase.
481
482 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
483 * src/print_graph.c (print_graph): Adjust.
484
39a06c25
PE
4852003-09-30 Frank Heckenbach <frank@g-n-u.de>
486 and Paul Eggert <eggert@twinsun.com>
487
488 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
489 Table of Symbols): Document %default-prec.
490 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
491 (grammar_declaration): Set default_prec on %default-prec.
492 * src/scan-gram.l (%default-prec): New token.
493 * src/reader.h (default_prec): New flag.
494 * src/reader.c: Likewise.
495 (packgram): Handle it.
496 * tests/conflicts.at (%default-prec without %prec,
497 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 498
39a06c25
PE
4992003-09-30 Paul Eggert <eggert@twinsun.com>
500
501 * tests/testsuite.at: Include local.at, not input.at, fixing
502 a typo in the 2003-08-25 patch.
503
62b6aef9
AD
5042003-08-27 Akim Demaille <akim@epita.fr>
505
506 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
507 GCC warnings.
508
89e1cc61
AD
5092003-08-26 Akim Demaille <akim@epita.fr>
510
511 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
512 "<\#" to avoid magic from Gnus when posting parts of this script.
513
a08460b0
AD
5142003-08-26 Akim Demaille <akim@epita.fr>
515
516 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
517 (Parser::parse): here.
518 Adjust: nerrs and errstatus is now replaced by...
519 (Parser::nerrs_, Parser::errstatus_): New.
520
603f1cfd
AD
5212003-08-25 Akim Demaille <akim@epita.fr>
522
523 * config/announce-gen, Makefile.cfg: New.
524 * Makefile.am: Adjust.
525 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
526 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
527
cd3684cf
AD
5282003-08-25 Akim Demaille <akim@epita.fr>
529
530 When reducing initial empty rules, Bison parser read an initial
531 location that is not defined. This results in garbage, and that
532 affects Bison's own parser. Therefore we need (i) to extend Bison
533 to support a means to initialize this location, and (ii) to use
534 this CVS Bison to fix CVS Bison's parser.
535
536 * src/reader.h, reader.c (epilogue_augment): Remove, replace
537 with...
538 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
539 * src/parse-gram.y: Adjust.
540 (%initial-action): New.
541 (%error-verbose): Since we require CVS Bison, there is no reason
542 not to use it.
543 * src/scan-gram.l: Adjust.
544 * src/Makefile.am (YACC): New, to make sure we use our own parser.
545 * data/yacc.c (yyparse): Use b4_initial_action.
546
4e03e201
AD
5472003-08-25 Akim Demaille <akim@epita.fr>
548
549 * doc/bison.texinfo: Don't promote stdout for error messages.
550
8c182d05
AD
5512003-08-25 Akim Demaille <akim@epita.fr>
552
553 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
554 From Alexandre Duret-Lutz.
555
6a60c4cf
PE
5562003-08-25 Akim Demaille <akim@epita.fr>
557
558 Version 1.875c.
559
25f66e1a
AD
5602003-08-25 Akim Demaille <akim@epita.fr>
561
562 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
563 Use them.
564
5348bfbe
AD
5652003-08-25 Akim Demaille <akim@epita.fr>
566
567 * data/lalr1.cc (Parser::reduce_print_): New.
568 Use it.
569
47301314
AD
5702003-08-25 Akim Demaille <akim@epita.fr>
571
572 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
573 error recovery loops. This patch is based on
574 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
575 Also, augment the similarity between lalr1.cc and yacc.c.
576 Note: the locations of error recovery rules are not correct yet.
577
578 * data/lalr1.cc: Comment changes to augment the similarity between
579 lalr1.cc and yacc.c.
580 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
581 (yyerrlab1): Remove, but where it used to be (now the bottom part of
582 yyerrlab), when hitting EOF, pop the whole stack here instead of
583 merely falling thru the default error handling mechanism.
584 (yyerrorlab): New label, with the old contents of YYERROR,
585 plus the following change: pop the stack of rhs corresponding
586 to the production that invoked YYERROR. That is how Yacc
587 behaves (required by POSIX).
588 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
589 fail.
590
1f7a61ff
AD
5912003-08-25 Akim Demaille <akim@epita.fr>
592
593 Tune local.at so that people can "autom4te -l autotest calc.at -o
594 calc" for instance, to extract a sub test suite.
595
596 * tests/testsuite.at: Move the initialization, Autotest version
597 requirement, and AT_TESTED invocation into...
598 * tests/local.at: here.
599 * tests/testsuite.at: Include it for compatibility with Autoconf
600 2.57.
601 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
602 be ignore.
603
327b5b56
PE
6042003-08-04 Paul Eggert <eggert@twinsun.com>
605
606 Rework code slightly to avoid gcc -Wtraditional warnings.
607 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
608 The returned value is now stored in *YY0. All callers changed.
609 * src/output.c (merge_output): Adjust to the above change.
610
0051e3ed
PE
6112003-07-26 Paul Eggert <eggert@twinsun.com>
612
613 * data/glr.c (YYASSERT): New macro.
614 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
615 yyresolveStates, yyprocessOneStack):
616 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
617 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 618
137437c6
PE
6192003-07-25 Paul Eggert <eggert@twinsun.com>
620
5b620e06
PE
621 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
622 for portability to K&R C (after ansi2knr, presumably). See
623 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
624 by Frank Heckenbach, though I have omitted the structure-initialization
625 part of his glr-knr.diff patch since I recall that the Portable
626 C Compiler didn't require that change.
627
137437c6
PE
628 Let the user specify how to allocate and free memory.
629 Derived from a suggestion by Frank Heckenbach in
630 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
631 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
632 All uses of free, malloc, realloc changed to use these macros,
633 and unnecessary casts removed.
634 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
635
ddb85ca5
PE
6362003-07-06 Matthias Mann <MatthiasMann@gmx.de>
637
638 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
639 use s.empty() rather than s == "" to test for empty string; see
640 <http://mail.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
641 (trivial change)
642
39910e09
AD
6432003-06-25 Akim Demaille <akim@epita.fr>
644
645 * config/depcomp, config/install-sh: Update from masters.
646
0ae99356
PE
6472003-06-20 Paul Eggert <eggert@twinsun.com>
648
649 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
650 and return properly parenthesized result.
651 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
652 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
653 Remove unnecessary parentheses from uses.
654 * doc/bison.texinfo (Location Default Action): Describe the
655 conventions for parentheses.
656
cd05d13c
PE
6572003-06-19 Paul Eggert <eggert@twinsun.com>
658
81fd08ca
PE
659 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
660 yyreportTree): Do not assume that size_t is the same width as int,
661 when printing sizes. Print sizes using an unsigned format.
662 Problem reported by Frank Heckenbach in
663 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 664
cd05d13c
PE
665 Port to Forte Developer 7 C compiler.
666 * data/glr.c (struct YYLTYPE): If locations are not being used,
667 declare a single dummy member, as empty structs do not conform
668 to the C standard.
669 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
670 the Forte Developer 7 C compiler complains that end-of-loop
671 code is not reached.
672
4dcf140b
PE
6732003-06-17 Paul Eggert <eggert@twinsun.com>
674
675 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
676 avoid warnings from picky compilers about redefinition of PARAMS.
677
8dd76bee
PE
6782003-06-17 Paul Eggert <eggert@twinsun.com>
679
680 Version 1.875b.
681
682 * NEWS: Document 1.875b.
683
684 * lib/bbitset.h: Do not include config.h; that's the includer's job.
685 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
686 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
687 Don't use 'index' in comments, as it's a builtin fn on some hosts.
688 * lib/bitset_stats.c: Include gettext.h unconditionally, as
689 per recent gettext manual's suggestion.
690 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
691 Use prototypes, not old-style definitions.
692 * lib/lbitset.c (lbitset_unused_clear): Likewise.
693 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
694 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
695 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
696 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
697 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
698 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
699 vbitset_or_and_cmp, vbitset_copy): Likewise.
700
701 * lib/libiberty.h: Do not include config.h; that's the includer's job.
702 Do not include <stdlib.h>.
703 (PARAMS): Define unconditionally for C89.
704 (ATTRIBUTE_NORETURN): Remove.
705 (ATTRIBUTE_UNUSED): Define unconditionally.
706
707 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
708 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
709 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
710 * lib/vbitset.c, lib/vbitset.h: New files.
711 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
712 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
713 from libbitset.
714
715 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
716 `How Can I Reset @code{yyparse}', since texinfo does not allow
717 arbitrary @ in node names.
718
719 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
720 shouldn't be needed according to the gettext 0.12.1 documentation
721 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 722 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 723 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 724 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 725
8dd76bee
PE
726 * lib/.cvsignore: Add stdbool.h.
727 * m4/.cvsignore: Add nls.m4, po.m4.
728
729 Upgrade to CVS gnulib.
730 * stdbool_.h: File renamed from stdbool.h.in.
731 * configure.ac (AM_STDBOOL_H): Invoke this instead of
732 AC_HEADER_STDBOOL.
733 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
734 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
735 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
736 (MOSTLYCLEANFILES): New var.
737 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
738 (stdbool.h): New rule.
739 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
740 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
741 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
742 m4/quote.m4: Upgrade to today's gnulib.
743
744 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
745 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
746 the tests right now.
747 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
748 yyerror are declared before use; C99 requires this.
749
25005f6a
PH
7502003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
751
752 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
753 first.
754 (yyrecoverSyntaxError): Correct the logic for setting and testing
755 yyerrState.
756 Correct comment on handling EOF.
757 Allow states with only a default reduction, rather than failing
8dd76bee 758 (I can't quite reconstruct why these were not allowed before).
25005f6a 759
137437c6 760 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 761 buffer overruns, corrupting state.
8dd76bee
PE
762
763 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
764 definition.
765 * src/reader.h (max_left_semantic_context): New variable declaration.
766 * src/scan-gram.l (max_left_semantic_context): Define.
767 (handle_action_dollar): Update max_left_semantic_context.
768 * data/glr.c (YYMAXLEFT): New definition.
769 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
770 (yyresolveAction): Ditto.
771
772 Fixes to problems with location handling in GLR parsers reported by
773 Frank Heckenbach (2003/06/05).
774
775 * data/glr.c (YYLTYPE): Make trivial if locations not used.
776 (YYRHSLOC): Add parentheses, and define only if locations used.
777 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
778 locations not used.
779 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
780 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 781
25005f6a
PH
782 * tests/cxx-type.at: Exercise location information; update tests
783 to differentiate output with and without locations.
8dd76bee 784 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
785 because default YYLTYPE not yet defined.
786 Change semantic actions to compute strings, rather than printing
787 them directly (to test proper passing of semantics values). Change
788 output to prefix notation and update test data and expected results.
789 (yylex): Track locations.
790 (stmtMerge): Return value rather than printing, and include arguments
791 in value.
8dd76bee 792
711f40b7
PE
7932003-06-03 Paul Eggert <eggert@twinsun.com>
794
795 Avoid warnings generated by GCC 2.95.4 when Bison is
796 configured with --enable-gcc-warnings.
797 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
798 yy::]b4_parser_class_name[::translate_,
799 yy::Stack::operator[] (unsigned),
800 yy::Stack::operator[] (unsigned) const,
801 yy::Slice::operator[] (unsigned),
802 yy::Slice::operator[] (unsigned) const):
803 Rename local vars to avoid warnings.
804 * tests/glr-regression.at (Improper handling of embedded actions
805 and $-N in GLR parsers): Remove unused local variable from yylex.
806 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
807 (void) as arg when not pure, since we now assume C89 when building
808 Bison. Pacify GCC by using parameter.
809
ac695f7d
PE
8102003-06-02 Paul Eggert <eggert@twinsun.com>
811
812 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
813 yy::Location::lines, yy::Location::columns): Rename arguments
814 to avoid shadowing; this removes a warning generated by GCC 3.3.
815
26ec81e0
PE
8162003-06-01 Paul Eggert <eggert@twinsun.com>
817
818 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
819 to g++, as GCC 3.3 complains if you do it.
820 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
821 everything that WARNING_CFLAGS has, except omit warnings
822 not suitable for C++.
823 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
824 * tests/atlocal.in (CXXFLAGS): New var.
825 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
826
827 Fix a GLR parser bug I reported in February; see
828 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
829 The problem was that GLR parsers did not conform to the C standard,
830 because actions like { $1 = $2 + $3; } expanded to expressions
831 that invoked YYFILL in separate subexpressions, and YYFILL assigned
832 to a local variable. The C standard says that expressions
833 like (var = f ()) + (var = f ()) have undefined behavior.
834 Another problem was that GCC sometimes issues warnings that
835 yyfill and its parameters are unused.
836
837 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
838 as possibly unused.
839 (yyfill): New function.
840 (YYFILL): Use it.
841 (yyuserAction): Change type of yynormal to bool, so that it matches
842 the new yyfill signature. Mark it as possibly unused.
843
844
845 Follow up on a bug I reported in February, where a Bison-generated
846 parser can loop. Provide a test case and a fix for yacc.c. I
847 don't have a fix for lalr1.cc or for glr.c, unfortunately.
848 The original bug report is in:
849 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
850
851 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
852 macro's size was becoming unwieldy.
853 (yyerrlab): Do not discard an empty lookahead symbol, as this
854 might destroy garbage.
855 (yyerrorlab): New label, with the old contents of YYERROR,
856 plus the following change: pop the stack of rhs corresponding
857 to the production that invoked YYERROR. That is how Yacc
858 behaves, and POSIX requires this behavior.
859 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
860 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
861 Define 'alarm' to do nothing if unistd.h is not available.
862 Add a new rule "exp: '-' error;" to test the above change to
863 data/yacc.c. Use 'alarm' to abort any test taking longer than
864 10 seconds, as it's probably looping.
865 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
866 Also, the new yacc.c generates two fewer diagnostics for an
867 existing test.
868
d0829076
PE
8692003-05-24 Paul Eggert <eggert@twinsun.com>
870
c6ae27df
PE
871 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
872 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
873 This fixes a problem reported by John Bowman when the Compaq/HP
874 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
875 -ansi -Wall -gall).
876 * data/yacc.c (union yyalloc): Likewise.
877 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 878
d0829076
PE
879 Switch from 'int' to 'bool' where that makes sense.
880
881 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
882 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
883 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
884 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
885 Return or accept bool, not int. All callers changed.
886 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
887 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
888 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
889 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
890 bitset_or_and_cmp_): Likewise.
891 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
892 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
893 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
894 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
895 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
896 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
897 bitset_stats_or_and_cmp): Likewise.
898 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
899 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
900 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
901 ebitset_xor_cmp): Likewise.
902 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
903 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
904 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
905 lbitset_xor_cmp): Likewise.
906 * lib/bbitset.h: Include <stdbool.h>.
907 (struct bitset_vtable): The following members now return bool, not
908 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
909 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
910 or_and_cmp).
911 * src/conflicts.c (count_rr_conflicts): Likewise.
912 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
913 All uses changed.
914 * lib/ebitset.c (ebitset_obstack_init): Likewise.
915 * lib/lbitset.c (lbitset_obstack_init): Likewise.
916 * src/getargs.c (debug_flag, defines_flag, locations_flag,
917 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
918 graph_flag): Likewise.
919 * src/getargs.h (debug_flag, defines_flag, locations_flag,
920 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
921 graph_flag): Likewise.
922 * src/output.c (error_verbose): Likewise.
923 * src/output.h (error_verbose): Likewise.
924 * src/reader.c (start_flag, typed): Likewise.
925 * src/reader.h (typed): Likewise.
926 * src/getargs.c (LOCATIONS_OPTION): New constant.
927 (long_options, getargs): Use it.
928 * src/lalr.c (build_relations): Use bool, not int.
929 * src/nullable.c (nullable_compute): Likewise.
930 * src/print.c (print_reductions): Likewise.
931 * src/tables.c (action_row, pack_vector): Likewise.
932 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
933 * src/output.c (prepare): Use it.
934 * src/output.c (token_definitions_output,
935 symbol_destructors_output, symbol_destructors_output): Use string,
936 not boolean integer, to keep track of whether to output separator.
937 * src/print_graph.c (print_core): Likewise.
938 * src/state.c (state_rule_lookaheads_print): Likewise.
939
940 * config/install-sh: Sync from automake 1.7.5.
941
6b2584b7
PE
9422003-05-14 Paul Eggert <eggert@twinsun.com>
943
944 * src/parse-gram.y (rules_or_grammar_declaration): Require a
945 semicolon after a grammar declaration, in the interest of possible
946 future changes to the Bison input language.
947 Do not allow a stray semicolon at the start of the grammar.
948 (rhses.1): Allow one or more semicolons after any rule, including
949 just before "|" as required by POSIX.
950 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
951 grammar.
952
caf37a36
ADL
9532003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
954
955 %parse-param support for lalr1.cc.
956
957 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
958 b4_cc_constructor_calls, b4_cc_constructor_call,
959 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
960 definitions.
961 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
962 parse-param arguments.
963 (yy::b4_parser_class_name): Declare instance variables to
964 hold parse-param arguments.
965 * tests/calc.at: s/value/semantic_value/ because value clashes
966 with a member of yy::b4_parser_class_name. Adjust C++ code
967 to handle %parse-param. Enable %parse-param test in C++.
968
3ab37077
PE
9692003-05-12 Paul Eggert <eggert@twinsun.com>
970
971 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
972 English a bit. Fix fclose typo. Change "const char" to "char
973 const", and use ANSI C rather than K&R for "main". Suggest
974 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
975 and suggest yy_switch_to_buffer.
976
9772003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
978
979 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
980 C89. This avoids a diagnostic on compilers that define __STDC__
981 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
982 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
983
e743727f
PE
9842003-05-03 Paul Eggert <eggert@twinsun.com>
985
986 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
987 Do not overrun array bounds.
988 This should fix a bug reported today by Olatunji Oluwabukunmi in
989 <http://mail.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
990
916708d5
AD
9912003-04-29 Akim Demaille <akim@epita.fr>
992
993 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
994 * src/getargs.c, src/getargs.h: here, as bool, not int.
995 (nondeterministic_parser): New.
996 * src/parse-gram.y, src/scan-gram.l: Support
997 %nondeterministic-parser.
998 * src/output.c (prepare): Use nondeterministic_parser instead
999 of glr_parser where appropriate.
1000 * src/tables.c (conflict_row, action_row, save_row)
1001 (token_actions, token_actions, pack_vector): Ditto.
1002
a06ea4aa
AD
10032003-04-29 Akim Demaille <akim@epita.fr>
1004
1005 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
1006
211074ca
AD
10072003-04-29 Akim Demaille <akim@epita.fr>
1008
1009 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
1010 with %pure-parser and %locations to exercise the patch from Yakov
1011 Markovitch below.
1012
6175ffe3
PE
10132003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
1014
1015 * data/yacc.c: (b4_lex_param): Corrected for the case where
1016 %lex-param is provided and %pure-parser isn't.
1017
b1e95857
PE
10182003-04-27 Paul Eggert <eggert@twinsun.com>
1019
1020 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
1021 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
1022 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
1023 if it is not defined.
1024 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
1025
acda9df6
PE
10262003-04-26 Paul Eggert <eggert@twinsun.com>
1027
3470c57b
PE
1028 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
1029 Declare to be of type suitable for the ninf value itself, not of
1030 type suitable for the corresponding table, since the latter might
1031 be unsigned but the ninf value might be negative. This fixes a
1032 bug reported by Alexandre Duret-Lutz in
1033 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
1034
acda9df6
PE
1035 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
1036 invokes it. We shouldn't invoke it twice because it will attempt
1037 to put error.o in the archive twice. This fixes a glitch reported
1038 by Martin Mokrejs in
1039 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
1040
b5250f26
PE
10412003-04-21 Paul Eggert <eggert@twinsun.com>
1042
1043 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
1044 to gnulib.
1045
089ac0f1
PE
10462003-04-21 Yakov Markovitch <Markovitch@iso.ru>
1047
1048 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
1049 Fix obvious typo that results in uncompilable GLR parsers
1050 when both %pure-parser and %locations are used. (trivial change)
1051
5ededac6
PE
10522003-04-17 Paul Eggert <eggert@twinsun.com>
1053
1b8f2fff
PE
1054 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
1055 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
1056 Do not insert the expected token via unput, as this runs afoul
1057 of a POSIX-compatibility bug in flex 2.5.31.
1058 All uses changed to BEGIN the parent state,
1059 since we no longer insert the expected token via unput.
1060 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
1061 that is no longer emitted after the above change.
1062
5ededac6
PE
1063 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
1064 the first one. This change is from Paul Hilfinger, and it fixes
1065 regression reported by Werner Lemberg in
1066 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1067
1068 (resolve_sr_conflict): Don't invoke state_errs_set
1069 unless one or more tokens have been explicitly made errors.
1070 Otherwise, the above change causes Bison to abort.
1071
1072 * tests/existing.at (GNU pic Grammar): New test case, taken from
1073 Lemberg's email.
1074
b8be9132
AD
10752003-03-31 Akim Demaille <akim@epita.fr>
1076
1077 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
1078
d423d460
AD
10792003-03-31 Akim Demaille <akim@epita.fr>
1080
1081 * src/output.c (prepare_symbols): Avoid trailing spaces in the
1082 output.
1083
c7e441b4
AD
10842003-03-31 Akim Demaille <akim@epita.fr>
1085
1086 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
1087 From Paul Hilfinger.
1088
231897ad
AD
10892003-03-29 Akim Demaille <akim@epita.fr>
1090
1091 * m4/error.m4: Do not put under dynamic conditions some code which
1092 expansion is under static control.
1093
5b066063
AD
10942003-03-29 Akim Demaille <akim@epita.fr>
1095
1096 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
1097
22a74fec
AD
10982003-03-29 Akim Demaille <akim@epita.fr>
1099
1100 * doc/bison.texinfo (Strings are Destroyed): New.
1101
0eee27e7
PE
11022003-03-13 Paul Eggert <eggert@twinsun.com>
1103
1104 * .cvsignore: Add configure.lineno.
1105 * src/.cvsignore: Add yacc.
1106 * tests/.cvsignore: Add testsuite.log.
1107 * doc/fdl.texi: Sync with latest FSF version.
1108
f61aad93
PE
11092003-03-12 Paul Eggert <eggert@twinsun.com>
1110
537636c7
PE
1111 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
1112 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
1113 cursor, instead of leaving it undefined. This fixes a bug
1114 reported by Tim Van Holder in
1115 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
1116 * tests/input.at (Torturing the Scanner): Test the scanner on
1117 an empty input file, which was Tim Van Holder's test case.
1118
1119 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
1120 <sys/resource.h> can be included, include sys/time.h and
1121 sys/times.h first, if available. This works around the SunOS
1122 4.1.4 porting bug reported by Bruce Becker in
1123 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
1124
1125 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
1126 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
1127 AC_HEADER_SYS_WAIT.
1128
f61aad93
PE
1129 Merge changes from gnulib. This was prompted because the CVS
1130 snapshot didn't build on Solaris 7 due to strnlen problems.
1131
1132 These changes need to be merged back into gnulib:
1133 * lib/hash.c: Include <stdbool.h> unconditionally.
1134 * m4/onceonly.m4 (m4_quote): New macro.
1135 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
1136 Quote AC_FOREACH variable-expansions properly.
1137 The 2003-01-03 obstack.h change also needs merging.
1138 {end of changes requiring merging}
5b066063 1139
f61aad93
PE
1140 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
1141 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
1142 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
1143 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
1144 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
1145 New files, imported from gnulib.
1146 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
1147 above.
1148
1149 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
1150 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
1151 gnulib sources.
1152
1153 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
1154 Add.
1155 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
1156 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
1157 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
1158 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
1159 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
1160 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
1161 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
1162 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
1163 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
1164 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
1165 (jm_PREREQ_ARGMATCH): Remove.
1166 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
1167 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
1168
1169 * src/system.h: Include <stdbool.h> unconditionally.
1170
1171 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
1172 assuming at least C89 in the bitset code for some time now.
1173
d2ffe116
AD
11742003-03-03 Akim Demaille <akim@epita.fr>
1175
1176 * ro.po: New.
1177
052826fd
AD
11782003-03-02 Akim Demaille <akim@epita.fr>
1179
1180 * doc/bison.texinfo (Table of Symbols): Reactivate the
1181 documentation for %lex-param, and %parse-param.
1182
c4749565
AD
11832003-03-02 Akim Demaille <akim@epita.fr>
1184
1185 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
1186 generate verbose error messages.
1187 Use the number of tokens as an upper bound in yytname, as it
1188 cannot be a non terminal.
1189
d5286af1
AD
11902003-03-02 Akim Demaille <akim@epita.fr>
1191
1192 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
1193 message.
1194
22e304a6
AD
11952003-03-02 Akim Demaille <akim@epita.fr>
1196
22e304a6
AD
1197 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
1198 Use them to exercise yycheck overrun.
1199 Based on Andrew Suffield's grammar.
1200
67a25fed
AD
12012003-03-02 Akim Demaille <akim@epita.fr>
1202
1203 Create tests/local.at for Bison generic testing macros.
1204
1205 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
1206 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
1207 This new file.
1208 * tests/calc.at (AT_CHECK_CALC): Adjust.
1209 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
1210 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
1211 * tests/local.at: here.
1212 (AT_COMPILE_CXX): Tags the tests using it as c++.
1213 Ignore the test if CXX is not functional.
1214
9c2b381f
PE
12152003-03-01 Paul Eggert <eggert@twinsun.com>
1216
1217 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
1218 not loc->end, since loc->end might contain garbage and this leads
1219 to undefined behavior on some platforms.
1220 (id_loc, token_start): Use (IF_LINTed) initial values that do not
1221 depend on *loc, so that the reader doesn't give the the false
1222 impression that *loc is initialized.
1223 (<INITIAL>"%%"): Do not bother setting code_start, since its value
1224 does not survive the return.
1225
0433ba88
AD
12262003-03-01 Akim Demaille <akim@epita.fr>
1227
1228 * src/scan-gram.l (code_start): Always initialize it when entering
1229 into yylex, as SC_EPILOGUE is activated *before* the corresponding
1230 yylex invocation. An alternative would be making it static, but
1231 then it starts with the second %%'s beginning, instead of its end.
1232
b305ea69
PE
12332003-02-28 Paul Eggert <eggert@twinsun.com>
1234
1235 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
1236 around a UnixWare 7.1.1 porting bug reported by John Hughes in
1237 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
1238
c3d25e01
PE
12392003-02-26 Paul Eggert <eggert@twinsun.com>
1240
1241 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
1242 Remove Sequent/Pyramid discussion (nobody uses them any more).
1243 Merge VMS and MS-DOS discussion; these ports may well be dead
1244 but let's keep mentioning them for now. Put <> around email
1245 addresses. Add copyright notice.
1246
c267ffbc
PE
12472003-02-24 Paul Eggert <eggert@twinsun.com>
1248
1249 * data/glr.c (yy_reduce_print): yylineno -> yylno,
1250 to avoid collision with flex use of yylineno.
1251 Problem reported by Bruce Lilly in
1252 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
1253 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
1254 * data/yacc.c (yy_reduce_print): Likewise.
1255
1256 * config/depcomp: Sync with Automake 1.7.3.
1257
f939fc12
AD
12582003-02-21 Akim Demaille <akim@epita.fr>
1259
1260 * data/lalr1.cc: Use temporary variables instead of casts to
1261 change integer types.
1262 Suggested by Paul Eggert.
1263
95923bd6
AD
12642003-02-21 Akim Demaille <akim@epita.fr>
1265
1266 * doc/bison.texinfo: Use "location" consistently to refer to @n,
1267 to avoid confusions with lalr1.cc's notion of Position.
1268 Suggested by Paul Eggert.
1269
2cdc240e
AD
12702003-02-20 Akim Demaille <akim@epita.fr>
1271
1272 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
1273 before initial_columns.
1274 (location.hh): Use consistent variable names when defining the
1275 operator<<.
1276 Use "last" so that we subtract from Positions, not from unsigned.
1277
5d003116
AD
12782003-02-20 Akim Demaille <akim@epita.fr>
1279
1280 * data/lalr1.cc (position.hh): New subfile, including the extended
1281 and Doxygen'ed documentation of class Position.
1282 (location.hh): Use it.
1283 Document a` la Doxygen.
ba1ecc07 1284 With the help of Benoit Perrot.
5d003116 1285
d02b25f9
AD
12862003-02-20 Akim Demaille <akim@epita.fr>
1287
1288 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
1289 AT_YACC_IF.
1290 Redefine AT_YYERROR_SEES_LOC_IF using it.
1291 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
1292 not defined.
1293 Don't use the location in yy::Parser::error_ and
1294 yy::Parser::print_ when not %locations.
1295 Activate more lalr1.cc tests.
1296
0d1c3a04
AD
12972003-02-19 Akim Demaille <akim@epita.fr>
1298
1299 * data/lalr1.cc: When displaying a line number, be sure to make it
1300 an int.
1301
60a777aa
AD
13022003-02-19 Akim Demaille <akim@epita.fr>
1303
1304 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
1305 Remove, useless.
1306 (YYABORT, YYACCEPT, YYERROR): New.
1307 * tests/calc.at: Renable the lalr1.cc test.
1308
0b86fc41
AD
13092003-02-19 Akim Demaille <akim@epita.fr>
1310
1311 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
1312 error recovery, mixing with/without pops and discarding of the
1313 lookahead.
1314 Exercise YYERROR.
1315 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
1316
da99a5dc
PE
13172003-02-17 Paul Eggert <eggert@twinsun.com>
1318
1319 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
1320 * tests/testsuite.at (AT_COMPILE): Use them.
1321 This fixes the testsuite problem reported by Robert Lentz in
1322 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
1323
93b8c255
PE
13242003-02-12 Paul Eggert <eggert@twinsun.com>
1325
1326 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
1327 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
1328 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
1329 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
1330 Check for malloc failure, for consistency with yacc.c.
1331 (yytname_size): Remove, for consistency with yacc.c.
1332
1333 The bug still remains in data/lalr1.cc, as I didn't have time
1334 to fix it there.
1335
7548fed2
AD
13362003-02-06 Akim Demaille <akim@epita.fr>
1337
1338 * configure.ac (GXX): Rename as...
1339 (CXX): this, to keep the original Autoconf semantics.
1340 Require 2.57.
1341 * data/lalr1.cc: Fix b4_copyright invocations.
1342 If YYDEBUG is not defined, don't depend upon name_ being defined.
1343 (location.hh): Include string and iostream.
1344 (Position::filename): New member.
1345 (Position::Position ()): New.
1346 (operator<< (Position)): New.
1347 (operator- (Position, int)): New.
1348 (Location::first, Location::last): Rename as...
1349 (Location::begin, Location::end): these, to mock the conventional
1350 iterator names.
1351 (operator<< (Location)): New.
1352 * tests/atlocal.in (CXX): New.
1353 * tests/testsuite.at (AT_COMPILE_CXX): New.
1354 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
1355 locations in a more synthetic way.
1356 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
1357 lalr1.cc is used.
1358 Adjust the C locations to match those from Emacs: first column is
1359 column 0.
1360 Change all the expected results.
1361 Conform to the GCS: simplify the locations when applicable.
1362 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
1363 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
1364 these CPP macros with the m4 macros new defined by...
1365 (AT_CHECK_PUSHDEFS): this, i.e.:
1366 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 1367 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
1368 New macros.
1369 (AT_CHECK_POPDEFS): Undefine them.
1370 (AT_CHECK_CALC_LALR1_CC): New.
1371 Use it for the first lalr1.cc test.
1372
43a176ef
AD
13732003-02-04 Akim Demaille <akim@epita.fr>
1374
1375 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
1376 Location as is defined.
1377
fc049e9c
AD
13782003-02-04 Akim Demaille <akim@epita.fr>
1379
1380 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
1381 name_ being defined.
1382
a737b216
PE
13832003-02-03 Paul Eggert <eggert@twinsun.com>
1384
1385 * src/gram.h (start_symbol): Remove unused decl.
1386
1387 Use more-consistent naming conventions for local vars.
1388
1389 * src/derives.c (derives_compute): Change type of local var from
1390 int to rule_number.
1391 * src/gram.c (grammar_rules_partial_print): Likewise.
1392 * src/print.c (print_core): Likewise.
1393 * src/reduce.c (reduce_grammar_tables): Likewise.
1394
1395 * src/gram.c (grammar_dump): Change name of item_number *
1396 local var from r to rp.
1397 * src/nullable.c (nullable_compute): Likewise.
1398
1399 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
1400
1401 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
1402 for symbol or symbol_number var.
1403 * src/reader.c (grammar_start_symbol_set): Likewise.
1404 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
1405 Likewise.
1406 * src/state.c (transitions_to): Likewise.
1407 * src/state.h: Likewise.
1408 * src/tables.c (symbol_number_to_vector_number): Likewise.
1409
1410 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
1411 char * var.
1412
1413 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
1414 var.
1415
1416 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
1417 var.
1418
1419 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
1420 Use str, not s, for char * var. Use ch, not c, for character var.
1421 Use size for size var.
1422
1423 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
1424 char * var.
1425 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
1426 uniqstr var.
1427 * src/uniqstr.h: Likewise.
1428
1429 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
1430 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
1431 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
1432 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
1433 param to have same name as that of enum, so that we don't use
1434 "s" to stand for a non-state.
1435
68e93ad5
AD
14362003-02-02 Akim Demaille <akim@epita.fr>
1437
1438 * src/scan-skel.l: Scan more than one inert character per yylex
1439 invocation.
1440
92898986
PE
14412003-02-01 Paul Eggert <eggert@twinsun.com>
1442
1443 Version 1.875a.
1444
1d9d5d71
PE
1445 * po/LINGUAS: Add ms.
1446
0435d061
AD
14472003-01-30 Akim Demaille <akim@epita.fr>
1448
1449 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
1450
6029a57f
PH
14512003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1452
1453 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
1454 of $1.
0435d061
AD
1455
1456 Changes in response to error report by S. Eken: GLR mode does not
6029a57f
PH
1457 handle negative $ indices or $ indices in embedded rules correctly.
1458 See <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 1459
6029a57f
PH
1460 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
1461 (b4_rhs_location): Ditto.
0435d061 1462 (yyfill): New function to copy from stack tree into array
6029a57f 1463 incrementally.
0435d061
AD
1464 (yyuserAction): Modify to allow incremental move of semantic values
1465 to rhs array when in GLR mode.
1466 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
1467 as needed.
1468 Remove dummy use of yystack, as there is now a guaranteed use.
1469 (yydoAction): Modify to allow incremental move of semantic values
1470 to rhs array when in GLR mode.
1471 (yyresolveAction): Ditto.
1472 (yyglrShiftDefer): Update comment.
0435d061 1473 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
1474 (yyglrReduce): Ditto.
1475 (yydoAction): Ditto
0435d061 1476
6029a57f
PH
1477 * tests/glr-regr1.at: Rename to ...
1478 * tests/glr-regression.at: Add new regression test for the problems
1479 described above (adapted from S. Eken).
1480 Update copyright notice.
1481 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
1482 * tests/Makefile.am: Ditto.
1483
6cee6297
PE
14842003-01-28 Paul Eggert <eggert@twinsun.com>
1485
1486 * data/lalr1.cc: Do not use @output_header_name@ unless
1487 b4_defines_flag is set. This fixes two bugs reported by
1488 Tim Van Holder in
1489 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
1490 and <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
1491
b2a836b5
PE
14922003-01-21 Paul Eggert <eggert@twinsun.com>
1493
1494 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
1495 we don't need to worry about yyerrlab1 being reported as an
1496 "unused label" by non-GCC C compilers. The downside is that if
1497 locations are used then a couple of statements are duplicated each
1498 time YYERROR is invoked, but the upside is that the warnings
1499 should vanish.
1500 (yyerrlab1): Move code to YERROR.
1501 (yyerrlab2): Remove. Change uses back to yyerrlab1.
1502 This reverts some of the 2002-12-27 change.
1503
4196b931
PE
15042003-01-17 Paul Eggert <eggert@twinsun.com>
1505
1506 * src/output.c (symbol_printers_output): Fix typo that led
1507 to core dump. Problem reported by Antonio Rus in
1508 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
1509
3ae831b4
AD
15102003-01-13 Akim Demaille <akim@epita.fr>,
1511 Quoc Peyrot <chojin@lrde.epita.fr>,
1512 Robert Anisko <anisko_r@lrde.epita.fr>
1513
1514 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
1515 when the stacks contain one element, as the loop would otherwise
1516 free the last state, and then use the top state (the one we just
1517 popped). This means that the initial elements will not be freed
1518 explicitly, as is the case in yacc.c; it is not a problem, as
1519 these elements have fake values.
1520
e3aa65c5
PE
15212003-01-11 Paul Eggert <eggert@twinsun.com>
1522
1523 * NEWS: %expect-violations are now just warnings, reverting
1524 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
1525 bootstrapping problem reported by Matthias Klose; see
1526 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
1527 * src/conflicts.c (conflicts_print): Likewise.
1528 * tests/conflicts.at (%expect not enough, %expect too much,
1529 %expect with reduce conflicts): Likewise.
1530 * doc/bison.texinfo (Expect Decl): Document this. Also mention
1531 that the warning is enabled if the number of conflicts changes
1532 (not necessarily increases).
1533
1534 * src/getargs.c (version): Update copyright year.
1535
f0057011
AD
15362003-01-09 Akim Demaille <akim@epita.fr>
1537
1538 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
1539
1ee6d2a0
PE
15402003-01-08 Paul Eggert <eggert@twinsun.com>
1541
1542 * Makefile.maint (WGETFLAGS):
1543 New macro, containing "-C off" to disable proxy caches.
1544 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
1545 (rel-check): Use $(WGET) instead of wget.
1546
d4fd77c4
PE
15472003-01-06 Paul Eggert <eggert@twinsun.com>
1548
1549 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
1550 the GLR paper of Scott, Johnstone and Hussain.
1551
464c6927
PE
15522003-01-04 Paul Eggert <eggert@twinsun.com>
1553
d600ee67
PE
1554 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
1555 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
1556 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
1557 (EXTRA_LIBRARIES): New var, for liby.a.
1558 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
1559 (EXTRA_SCRIPTS): New var, for yacc.
1560
464c6927
PE
1561 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
1562 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
1563 Problem reported by Nelson H. F. Beebe.
1564
15652003-01-03 Paul Eggert <eggert@twinsun.com>
1566
1567 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
1568 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1569 when compiling Bison 1.875's `bitset bset = obstack_alloc
1570 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
1571
1572 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
1573 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
1574 grow to a huge size with typical invocation.
d600ee67 1575
464c6927
PE
1576 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
1577 Use the pattern recommended by Autoconf 2.57, except also protect
1578 against double-definition.
1579 * src/system.h: Likewise.
1580 Portability issues reported by Nelson H. F. Beebe.
d600ee67 1581
464c6927
PE
1582 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
1583 All uses changed. Provide a definition in both C and C++.
1584 (yytrue, yyfalse): Define even if defined (__cplusplus).
1585
1586 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
1587 Reported by Nelson H. F. Beebe.
d600ee67 1588
464c6927
PE
1589 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
1590
0f42c7d5
PE
15912003-01-02 Paul Eggert <eggert@twinsun.com>
1592
1593 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
1594 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
1595 Bug reported by Nelson H. F. Beebe.
1596
dc546b0f
PE
15972003-01-01 Paul Eggert <eggert@twinsun.com>
1598
1599 * Version 1.875.
1600
2c09b6a7
PE
16012002-12-30 Paul Eggert <eggert@twinsun.com>
1602
1603 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
1604 Moved here from...
1605 (<INITIAL>","): Here. This causes stray "," to be treated
1606 more uniformly.
1607
dc546b0f 1608 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
1609 last brace in braced code when not in Yacc mode, for compatibility
1610 with Bison 1.35. This resurrects the 2001-12-15 patch to
1611 src/reader.c.
1612
1613 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
1614 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
1615
535c0f63
PE
16162002-12-28 Paul Eggert <eggert@twinsun.com>
1617
1618 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
1619 that of SYM's type. This fixes Debian bug 168069, reported by
1620 Thomas Olsson.
d600ee67 1621
963fcc17
PE
16222002-12-28 Paul Eggert <eggert@twinsun.com>
1623
1624 Version 1.75f.
1625
1626 Switch back to the Yacc style of conflict reports, undoing some
1627 of the 2002-07-30 change.
1628 * doc/bison.texinfo (Understanding): Use Yacc style for
1629 conflict reports. Also, use new way of locating rules.
1630 * src/conflicts.c (conflict_report):
1631 Renamed from conflict_report_yacc, removing the old
1632 'conflict_report'. Translate the entire conflict report at once,
1633 so that we don't assume that "," has the same interpretation in
1634 all languages.
1635 (conflicts_output): Use Yacc-style conflict report for each state,
1636 instead of our more-complicated style.
1637 (conflicts_print): Use Yacc-style conflict report, except print
1638 the input file name when not emulating Yacc.
1639 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
1640 Conflicted Reduction, %expect not enough, %expect too much,
1641 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
1642 * tests/existing.at (GNU Cim Grammar): Likewise.
1643 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
1644
1645 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
1646 fatal): Don't invoke fflush; it's not needed and it might even be
1647 harmful for stdout, as stdout might not be open.
1648 * src/reduce.c (reduce_print): Likewise.
1649
b1efe548
PE
16502002-12-27 Paul Eggert <eggert@twinsun.com>
1651
1652 Fix a bug where error locations were not being recorded correctly.
1653 This problem was originally reported by Paul Hilfinger in
e3aa65c5 1654 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
1655
1656 * data/yacc.c (yyparse): New local var yylerrsp, to record the
1657 top of the location stack's error locations.
1658 (yyerrlab): Set it. When discarding a token, push its location
1659 onto yylerrsp so that we don't lose track of the error's end.
1660 (yyerrlab1): Now is only the target of YYERROR, so that we can
1661 properly record the location of the action that failed. For GCC
1662 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
1663 GCC warning about yyerrlab1 being unused if YYERROR is unused.
1664 (yyerrlab2): New label, which yyerrlab now falls through to.
1665 Compute the error's location by applying YYLLOC_DEFAULT to
1666 the locations of all the symbols that went into the error.
1667 * doc/bison.texinfo (Location Default Action): Mention that
1668 YYLLOC_DEFAULT is also invoked for syntax errors.
1669 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1670 Error locations include the locations of all the tokens that were
1671 discarded, not just the last token.
d600ee67 1672
983c5c2c
PE
16732002-12-26 Paul Eggert <eggert@twinsun.com>
1674
b1efe548
PE
1675 * src/files.c: Include quote.h.
1676 (compute_output_file_names): Warn if we detect conflicting
1677 outputs to the same file. This should catch the misunderstanding
1678 exemplified by Debian Bug 165349, reported by Bruce Stephens..
1679
1680 * src/conflicts.c (conflicts_print): If the user specifies
1681 "%expect N", report an error if there are any reduce/reduce
1682 conflicts. This is what the manual says should happen.
1683 This fixes Debian bug 130890, reported by Anthony DeRobertis.
1684 * tests/conflicts.at (%expect with reduce conflicts): New test.
1685
983c5c2c
PE
1686 Don't use m4_include on relative file names, as it doesn't work as
1687 desired if there happens to be a file with that name under ".".
d600ee67 1688
983c5c2c
PE
1689 * m4sugar/version.m4: Remove; it was included but it wasn't used.
1690 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
1691 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
1692 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
1693 * src/output.c (output_skeleton): Use full path names when
1694 specifying a file to include; don't rely on include path, as
1695 it's unreliable when the working file contains a file with
1696 that name.
d600ee67 1697
983c5c2c
PE
16982002-12-25 Paul Eggert <eggert@twinsun.com>
1699
1700 Remove obsolete references to bison.simple and bison.hairy.
1701 Problem mentioned by Aubin Mahe in
e3aa65c5 1702 <http://mail.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
1703 * data/glr.c: Comment fix.
1704 * doc/bison.1: Remove references. Also, mention "yacc".
1705
1706 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
1707 with -g option.
1708
1709 * src/parse-gram.y (declaration): Use enum "report_states" rather
1710 than its numeric value 1.
1711
1712 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
1713 opening a new one. This fixes Debian bug 165349, reported by
1714 Bruce Stephens.
1715
23f2d9dc
PE
17162002-12-24 Paul Eggert <eggert@twinsun.com>
1717
1718 Version 1.75e.
1719
1720 * Makefile.maint (cvs-update): Don't assume that the shell
1721 supports $(...), as Solaris sh doesn't.
1722
1723 * src/parse-gram.y (lloc_default): Remove test for empty
1724 nonterminals at the end, since it didn't change the result.
1725
17262002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
1727
1728 If the user does not define YYSTYPE as a macro, Bison now declares it
1729 using typedef instead of defining it as a macro. POSIX requires this.
1730 For consistency, YYLTYPE is also declared instead of defined.
1731
1732 %union directives can now have a tag before the `{', e.g., the
1733 directive `%union foo {...}' now generates the C code
1734 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
1735 The default union tag is `YYSTYPE', for compatibility with Solaris 9
1736 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
1737 instead of `yyltype'.
1738
1739 `yystype' and `yyltype' are now obsolescent macros instead of being
1740 typedefs or tags; they are no longer documented and will be
1741 withdrawn in a future release.
1742
1743 * data/glr.c (b4_location_type): Remove.
1744 (YYSTYPE): Renamed from yystype.
1745 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
1746 (struct YYLTYPE): Renamed from struct yyltype.
1747 (YYLTYPE): Renamed from yyltype.
1748 (yyltype, yystype): New (and obsolescent) macros,
1749 for backward compatibility.
1750 * data/yacc.c: Likewise.
1751
1752 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
1753 does not specify a union tag. This is for compatibility with
1754 Solaris 9 yacc.
1755
1756 * src/parse-gram.y (add_param): 2nd arg is now char * not char
1757 const *, since it is now modified by stripping surrounding { }.
1758 (current_braced_code): Remove.
1759 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
1760 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
1761 trailing " {...}". Now of type <chars>.
1762 (grammar_declaration): Adjust to bundled tokens.
1763 (code_content): Remove; stripping is now done by add_param.
1764 (print_token_value): Print contents of bundled tokens.
1765 (token_name): New function.
1766
1767 * src/reader.h (braced_code, current_braced_code): Remove.
1768 (token_name): New decl.
1769
1770 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
1771 token_type, not braced_code code_kind. All uses changed.
1772 (SC_PRE_CODE): New state, for scanning after a keyword that
1773 has (or usually has) an immediately-following braced code.
1774 (token_type): New local var, to keep track of which token type
1775 to return when scanning braced code.
1776 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 1777 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
1778 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
1779 instead of returning a token type immediately.
1780 (<INITIAL>"{"): Set token type.
1781 (<SC_BRACED_CODE>"}"): Use it.
1782 (handle_action_dollar, handle_action_at): Now returns bool
1783 indicating success. Fail if ! current_rule; this prevents a core dump.
1784 (handle_symbol_code_dollar, handle_symbol_code_at):
1785 Remove; merge body into caller.
1786 (handle_dollar, handle_at): Complain in invalid contexts.
1787
1788 * NEWS, doc/bison.texinfo: Document the above.
1789 * NEWS: Fix years and program names in copyright notice.
1790
879ca4f8
PE
17912002-12-17 Paul Eggert <eggert@twinsun.com>
1792
1793 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
1794 Reporting, Table of Symbols): Omit mentions of %lex-param and
1795 %parse-param from the documentation for now.
1796
1c5fe69d
PE
17972002-12-15 Paul Eggert <eggert@twinsun.com>
1798
1799 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
1800 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
1801 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
1802 disagreed with the Bison documentation. Bug
1803 reported by Andrew Walrond.
d600ee67 1804
1c5fe69d
PE
1805 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
1806 as the caller now does that.
1807 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
1808 (YYEMPTY): Parenthesize right hand side, since others use it.
1809 (yyparse): Don't assume that our generated code is the only code
1810 that sets yychar.
1811
d1de5372
PE
18122002-12-13 Paul Eggert <eggert@twinsun.com>
1813
1814 Version 1.75d.
1815
1816 POSIX requires a "yacc" command.
1817 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
1818 (MOSTLYCLEANFILES): Add yacc.
1819 (yacc): New rule.
1c5fe69d 1820 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
1821 as an alias for bison y.
1822
1823 * po/LINGUAS: Add da.
d600ee67 1824
d1de5372
PE
1825 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
1826 problem with latest <getopt.h>.
1827 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
1828
1829 * doc/fdl.texi: Upgrade to 1.2.
1830 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
1831 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
1832 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
1833 gnulib.
1834 * config/install-sh: Sync with autotools.
1835
1836 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
e3aa65c5 1837 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
1838 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
1839 locations are requested.
1840 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
1841 locations are requested.
1842
d0f3fe23
PE
18432002-12-12 Paul Eggert <eggert@twinsun.com>
1844
1845 Remove unportable casts and storage allocation tricks.
1846 While we're at it, remove almost all casts, since they
1847 usually aren't needed and are a sign of trouble.
1848
1849 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
1850
1851 * src/derives.c (derives_compute): Do not subtract NTOKENS from
1852 the pointer DSET returned by malloc; this isn't portable.
1853 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
1854 Similarly for DERIVES.
1855 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
1856 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
1857 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
1858
1859 * src/derives.c (derives_compute): Do not bother invoking
1860 int_of_rule_number, since rule numbers are integers.
1861
1862 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
1863 rather than XMALLOC (char, N).
1864
1865 * src/files.c (filename_split): Rewrite to avoid cast.
1866
1867 * src/gram.h (symbol_number_as_item_number,
1868 item_number_as_symbol_number, rule_number_as_item_number,
1869 item_number_as_rule_number):
1870 Now inline functions rather than macros, to avoid casts.
1871 * src/state.h (state_number_as_int): Likewise.
1872 * src/tables.c (state_number_to_vector_number,
1873 symbol_number_to_vector_number): Likewise.
1874
1875 * src/gram.h (int_of_rule_number): Remove; no longer used.
1876
1877 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
1878 since the resulting storage is always stored into.
1879
1880 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
1881 where it's needed.
1882
1883 * src/muscle_tab.c (muscle_m4_output):
1884 Now inline. Return bool, not int.
1885 * src/state.c (state_compare): Likewise.
1886 * src/symtab.c (symbol_check_defined,
1887 symbol_check_alias_consistency, symbol_pack, symbol_translation,
1888 hash_compare_symbol, hash_symbol):
1889 Likewise.
1890 * src/uniqstr.c (uniqstr_print): Likewise.
1891 * src/muscle_tab.c (muscle_m4_output_processor):
1892 New function, to avoid casts.
1893 * src/state.c (state_comparator, stage_hasher): Likewise.
1894 * src/symtab.c (symbol_check_defined_processor,
1895 symbol_check_alias_consistency_processor, symbol_pack_processor,
1896 symbol_translation_processor, hash_symbol_comparator,
1897 hash_symbol_hasher): Likewise.
1898 * src/uniqstr.c (uniqstr_print_processor): Likewise.
1899 * src/muscle_tab.c (muscles_m4_output):
1900 Use new functions instead of casting old functions unportably.
1901 * src/state.c (state_hash_new): Likewise.
1902 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
1903 symbols_token_translations_init):
1904 Likewise.
1905 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
1906
1907 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
1908 var instead of casting to long, to avoid casts.
1909 (prepare_states): Use MALLOC rather than alloca, so that we don't
1910 have to worry about alloca.
1911 * src/state.c (state_hash_lookup): Likewise.
1912
1913 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
1914 local var instead of casting to unsigned char, to avoid casts.
1915
1916 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
1917 STATE_ALLOC): Remove.
1918 (transitions_new, errs_new, reductions_new, state_new): Use malloc
1919 rather than calloc, and use offsetof to avoid allocating slightly
1920 too much storage.
1921 (state_new): Initialize all members.
1922
1923 * src/state.c (state_hash): Use unsigned accumulator, not signed.
1924
1925 * src/symtab.c (symbol_free): Remove; unused.
1926 (symbol_get): Remove cast in lhs of assignment.
1927 (symbols_do): Now static. Accept generic arguments, not
1928 hashing-related ones.
1929
1930 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
1931 (symbol_processor): Remove.
1932 (symbols_do): Remove decl; now static.
1933
1934 * src/system.h (alloca): Remove; decl no longer needed.
1935 (<stddef.h>): Include, for offsetof.
1936 (<inttypes.>, <stdint.h>): Include if available.
1937 (uintptr_t): New type, if system lacks it.
1938 (CALLOC, MALLOC, REALLOC): New macros.
1939 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
1940 new macros.
1941
1942 * src/tables.c (table_size): Now int, to pacify GCC.
1943 (table_grow, table_ninf_remap): Use signed table size.
1944 (save_row): Don't bother initializing locals when not needed.
1945 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
1946 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
1947
1948 * src/vcg.h: Correct misspellings.
1949
1950 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
1951
1952
1953 * src/getargs.c (getargs): Don't assume EOF == -1.
1954
26b4a969
PE
19552002-12-09 Paul Eggert <eggert@twinsun.com>
1956
1957 Change identifier spellings to avoid collisions with names
1958 that are reserved by POSIX.
1959
1960 Don't use names ending in _t, since POSIX reserves them.
1961 For consistency, remove _e and _s endings -- they're weren't
1962 needed to remove ambiguity. All uses changed.
1963 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
1964 turn was just renamed from struniq_t.
1965 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
1966 which in turn was just renamed from struniq_processor_t.
1967 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
1968 in turn was renamed from hash_compare_struniq_t.
1969 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
1970 (state_list): Renamed from state_list_t.
1971 * src/assoc.h (assoc): Renamed from assoc_t.
1972 * src/conflicts.c (enum conflict_resolution): Renamed from
1973 enum conflict_resolution_e.
1974 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
1975 (rule_list): Renamed from rule_list_t.
1976 * src/getargs.h (enum trace): Renamed from enum trace_e.
1977 (enum report): Renamed from enum report_e.
1978 * src/gram.h (item_number): Renamed from item_number_t.
1979 (rule_number): Renamed from rule_number_t.
1980 (struct rule_s): Remove the "rule_s" part; not used.
1981 (rule): Renamed from rule_t.
1982 (rule_filter): Renamed from rule_filter_t.
1983 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
1984 (goto_list): Renamed from goto_list_t.
1985 * src/lalr.h (goto_number): Renamed from goto_number_t.
1986 * src/location.h (location): Renamed from location_t.
1987 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
1988 and moved here from:
1989 * src/muscle_tab.h (muscle_entry_t): here.
1990 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
1991 (rule_list): Renamed from rule_list_t.
1992 * src/print_graph.c (static_graph): Renamed from graph.
1993 * src/reader.h (braced_code): Renamed from braced_code_t.
1994 Remove brace_code_e tag.
1995 * src/relation.h (relation_node): Renamed from relation_node_t.
1996 (relation_nodes): Renamed from relation_nodes_t.
1997 (relation): Renamed from relation_t.
1998 * src/state.h (state_number): Renamed from state_number_t.
1999 (struct state): Renamed from struct state_s.
2000 (state): Renamed from state_t.
2001 (transitions): Renamed from transitions_t. Unused (and
2002 misspelled) transtion_s tag removed.
2003 (errs): Renamed from errs_t. Unused errs_s tag removed.
2004 (reductions): Renamed from reductions_t. Unused tag
2005 reductions_s removed.
2006 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
2007 (struct symbol_list): Renamed from struct symbol_list_s.
2008 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
2009 (struct symbol): Renamed from struct symbol_s.
2010 (symbol): Renamed from symbol_t.
2011 * src/tables.c (vector_number): Renamed from vector_number_t.
2012 (action_number): Renamed from action_t.
2013 * src/tables.h (base_number): Renamed from base_t.
2014 * src/vcg.h (enum color): Renamed from enum color_e.
2015 (enum textmode): Renamed from enum textmode_e.
2016 (enum shape): Renamed from enum shape_e.
2017 (struct colorentry): Renamed from struct colorentry_s.
2018 (struct classname): Renamed from struct classname_s.
2019 (struct infoname): Renamed from struct infoname_s.
2020 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
2021 (enum decision): Renamed from enum decision_e.
2022 (enum orientation): Renamed from enum orientation_e.
2023 (enum alignment): Renamed from enum alignment_e.
2024 (enum arrow_mode): Renamed from enum arrow_mode_e.
2025 (enum crossing_type): Renamed from enum crossing_type_e.
2026 (enum view): Renamed from enum view_e.
2027 (struct node): Renamed from struct node_s.
2028 (node): Renamed from node_t.
2029 (enum linestyle): Renamed from enum linestyle_e.
2030 (enum arrowstyle): Renamed from enum arrowstyle_e.
2031 (struct edge): Renamed from struct edge.
2032 (edge): Renamed from edge_t.
2033 (struct graph): Renamed from struct graph_s.
2034 (graph): Renamed from graph_t.
2035 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
2036 Rename value_t -> value.
2037 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
2038 value_t_as_yystype -> value_as_yystype.
2039
2040 Don't include <errno.h> in the mainstream code, since it
2041 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
2042 * lib/get-errno.c, lib/get-errno.h: New files.
2043 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
2044 get-errno.c.
2045 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
2046 * src/output.c (output_skeleton): Likewise.
2047 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
2048 instead of errno.
2049 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
2050 Likewise.
2051 (handle_action_dollar, handle_action_at): Likewise.
2052 * src/system.h: Do not include <errno.h>.
2053 (TAB_EXT): Renamed from EXT_TAB.
2054 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
2055
2056 Avoid str[a-z]*, since <string.h> reserves that name space.
2057 Change all instances of "struniq" in names to "uniqstr", and
2058 likewise for "STRUNIQ" and "UNIQSTR".
2059 * src/uniqstr.c: Renamed from src/struniq.c.
2060 * src/uniqstr.h: Renamed from src/struniq.h.
2061 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
2062 * src/files.c (strsuffix): Remove; unused.
2063 (concat2): Renamed from stringappend. Now static.
2064 * src/files.h (strsuffix, stringappend): Remove; unused.
2065 * src/parse-gram.y (<chars>): Renamed from <string>.
2066 (<uniqstr>): Renamed from <struniq>.
2067 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
2068 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
2069 (struct graph_s.expand): Renamed from struct graph_s.stretch.
2070 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
2071 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
2072 (N_EXPAND): Renamed from N_STRETCH.
2073
2074 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
2075 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
2076 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
2077 Remove; unused.
2078 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
2079 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
2080 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
2081 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
2082 (BASE_MAXIMUM): Renamed from BASE_MAX.
2083 (BASE_MINIMUM): Renamed from BASE_MIN.
2084 (ACTION_MAX): Remove; unused.
2085 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
2086 Unnecessary casts removed from above defines.
2087
2088
2089 Fix misspelling in names.
2090 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
2091 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
2092 G_NODE_ALIGNEMENT.
2093
2094
2095 * lib/timevar.c (timevar_report): Renamed from time_report,
2096 for consistency with other names.
2097 * lib/timevar.h (timevar_report): New decl.
2098 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
2099
2100
2101 Sort include-file uses.
2102
2103 Reorder all include files under src to be in the order "system.h".
2104 then the ../lib include files in angle brackets (alphabetized),
2105 then the . include files in double-quotes (alphabetized). Fix
2106 dependency breakages encountered in this process, as follows:
2107 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
2108 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
2109 * src/state.h: Include "symtab.h".
2110
996b1c7e
PE
21112002-12-08 Paul Eggert <eggert@twinsun.com>
2112
2113 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
2114 since this causes problems when __file__ contains character
2115 sequences like "@" that are treated specially by src/scan-skel.l.
2116 Instead, just use the file's basename. This fixes the bug
2117 reported by Martin Mokrejs in
e3aa65c5 2118 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 2119
e19c4e5d
PE
21202002-12-06 Paul Eggert <eggert@twinsun.com>
2121
2122 Add support for rules that do not have trailing semicolons, as
2123 POSIX requires. Improve the quality of locations in Bison
2124 diagnostics.
26b4a969 2125
e19c4e5d
PE
2126 * src/location.c: Include <quotearg.h>.
2127 (empty_location): Now const.
2128 (location_print): New function. Follow the recommendation of the
2129 GNU Coding Standards for locations that span file boundaries.
2130 * src/location.h: Do not include <quotearg.h>; no longer needed.
2131 (boundary): New type.
2132 (location_t): Use it. This allows locations to span file boundaries.
2133 All member uses changed: file -> start.file or end.file (as needed),
2134 first_line -> start.line, first_column -> start.column,
2135 last_line -> end.line, last_column -> end.column.
2136 (equal_boundaries): New function.
2137 (LOCATION_RESET, LOCATION_STEP): Remove.
2138 (LOCATION_PRINT): Remove. All callers changed to use location_print.
2139 (empty_location): Now const.
2140 (location_print): New decl.
2141 * src/parse-gram.y (lloc_default): New function, which handles
2142 empty locations more accurately.
2143 (YYLLOC_DEFAULT): Use it.
2144 (%token COLON): Remove.
2145 (%token ID_COLON): New token.
26b4a969 2146 (rules): Use it.
e19c4e5d
PE
2147 (declarations, rules): Remove trailing semicolon.
2148 (declaration, rules_or_grammar_declaration):
2149 Allow empty (";") declaration.
2150 (symbol_def): Remove empty actions; no longer needed.
2151 (rules_or_grammar_declaration): Remove trailing semicolon.
2152 (semi_colon.opt): Remove.
2153 * src/reader.h: Include location.h.
2154 (scanner_cursor): New decl.
2155 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
2156 rolling our own.
2157 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
2158 of *loc.
2159 (STEP): Remove. No longer needed, now that adjust_location does
2160 the work. All uses removed.
2161 (scanner_cursor): New var.
2162 (adjust_location): Renamed from extend_location. It now sets
2163 *loc and adjusts the scanner cursor. All uses changed.
2164 Don't bother testing for CR.
2165 (handle_syncline): Remove location arg; now updates scanner cursor.
2166 All callers changed.
2167 (unexpected_end_of_file): Now accepts start boundary of token or
2168 comment, not location. All callers changed. Update scanner cursor,
2169 not the location.
2170 (SC_AFTER_IDENTIFIER): New state.
2171 (context_state): Renamed from c_context. All uses changed.
2172 (id_loc, code_start, token_start): New local vars.
2173 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
2174 processing of Yacc white space and equivalents here.
2175 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
2176 instead of returning ID immediately, since we need to search for
2177 a subsequent colon.
2178 (<INITIAL>"'", "\""): Save token_start.
2179 (<INITIAL>"%{", "{", "%%"): Save code_start.
2180 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
2181 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
2182 BEGIN context_state at end, not INITIAL.
2183 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
2184 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
2185 Return correct token start.
2186 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
2187 the start of a character, string or multiline comment is found.
2188 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
2189 Reduction): Adjust reported locations to match the more-precise
2190 results now expected.
2191 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
2192 * tests/reduce.at (Useless Rules, Reduced Automaton,
2193 Underivable Rules): Likewise.
2194 * tests/regression.at (Invalid inputs): No longer `expecting ";"
2195 or "|"' now that so many other tokens are allowed by the new grammar.
2196
2197 * src/complain.h (current_file): Remove duplicate decl;
2198 current_file is now owned by files.h.
2199 * src/complain.c, src/scan-gram.l: Include files.h.
2200
22012002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 2202
e19c4e5d
PE
2203 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
2204 promotes to int; it might be unsigned int.
2205 * data/yacc.c (yy_reduce_print): Likewise.
2206
2207 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
2208 be #defined in the prologue, not in the Bison declarations.
2209 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 2210
b64755e3
PE
22112002-12-02 Paul Eggert <eggert@twinsun.com>
2212
2213 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
2214 * lib/strtoul.c: New file, from gnulib.
2215 This fixes a porting bug reported by Peter Klein in
e3aa65c5 2216 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 2217
6e746484
PE
22182002-11-30 Paul Eggert <eggert@twinsun.com>
2219
b64755e3
PE
2220 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
2221 and put only a forward declaration in the prologue. This is for
2222 consistency with the other scanner helper functions.
2223
6ba55592
PE
2224 Type clashes now generate warnings, not errors, since it
2225 appears that POSIX may allow some grammars with type clashes.
2226 * src/reader.c (grammar_current_rule_check): Warn about
2227 type clashes instead of complaining.
2228 * tests/input.at (Type Clashes): Expect warnings, not complaints.
2229
6e746484
PE
2230 Add Yacc library, since POSIX requires it.
2231 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
2232 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
2233 * lib/main.c, lib/yyerror.c: New files.
2234
2235 gram_error can be static; it need not be extern.
2236 * src/reader.h (gram_error): Remove decl.
2237 * src/parse-gram.y (gram_error): Now static. Add static decl.
2238 (print_token_value): Omit parameter names from forward decl,
2239 for consistency.
2240
88510f9c
PE
22412002-11-29 Paul Eggert <eggert@twinsun.com>
2242
6e746484
PE
2243 * doc/bison.texinfo: Emphasize that yylex and yyerror must
2244 be declared before being used. E.g., one should typically
2245 declare them in the prologue. Use GNU coding style in examples.
2246 Put "const" consistently after the type it modifies. Mention
2247 that C99 supports "inline". Mention that yyerror traditionally
2248 returns "int".
2249
88510f9c
PE
2250 %parse-param and %lex-param now take just one argument, the
2251 declaration; the argument name is deduced from the declaration.
2252
2253 * doc/bison.texinfo (Parser Function, Pure Calling, Error
2254 Reporting, Table of Symbols): Document this.
2255 * src/parse-gram.y (add_param): New function.
2256 (COMMA): Remove.
2257 (declaration): Implement new rule for %parse-param and %lex-param.
2258 * src/scan-gram.l: "," now elicits a warning, rather than being
2259 a token; this is more compatible with byacc.
2260 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
2261
bb92250c
PE
22622002-11-27 Paul Eggert <eggert@twinsun.com>
2263
2264 Rename identifiers to avoid real and potential collisions.
2265
2266 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
2267 to avoid collision with lex macro described by Bruce Lilly in
e3aa65c5 2268 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
2269 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
2270 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
2271 * src/parse-gram.y (print_token_value): Renamed from yyprint.
2272 All uses changed.
2273 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
2274 The name "yycontrol" violates the name space rules, and this stuff
2275 wasn't being used anyway.
2276 (input): Remove action; this stuff wasn't being used.
2277 (gram_error): Rename local variable yylloc -> loc.
2278 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
2279 (YY_DECL): Don't use "yy" at start of local variables.
2280 All uses changed, e.g., yylloc -> loc.
2281 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
2282 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
2283 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
2284 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
2285
2286 * src/parse-gram.y (gram_error): loc is now const *.
2287 * src/reader.h (gram_error): Likewise.
2288
3af4feb2
PE
22892002-11-24 Paul Eggert <eggert@twinsun.com>
2290
2291 Version 1.75c.
2292
2293 * tests/actions.at (Actions after errors): Use an output format
2294 more similar to that of the Printers and Destructors test.
2295 Test the position of the ';' token too.
2296 (Printers and Destructors): Likewise.
2297 (Printers and Destructors: %glr-parser): Remove for now, to avoid
2298 unnecessarily alarming people when the test fails.
2299
2300 * data/yacc.c (yyerrlab1): Move this label down, so that the
2301 parser does not discard the lookahead token if the user code
2302 invokes YYERROR. This change is required for POSIX conformance.
2303
2304 * lib/error.c: Sync with gnulib.
2305
23062002-11-22 Paul Eggert <eggert@twinsun.com>
2307
2308 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
2309 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
2310 * lib/xmalloc.c: Likewise.
26b4a969 2311
58004308
PE
23122002-11-20 Paul Eggert <eggert@twinsun.com>
2313
2314 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
2315
23162002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 2317
58004308
PE
2318 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
2319 should use `if (! x) abort ();' rather than `assert (x);', and
2320 anyway it's one less thing to worry about configuring.
2321
2322 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
2323 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
2324 and replace all instances of assert with abort.
2325 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
2326 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
2327
2328 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
2329 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
2330 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
2331 hash_find_entry, hash_rehash, hash_insert): Likewise.
2332 * src/conflicts.c (resolve_sr_conflict): Likewise.
2333 * src/lalr.c (set_goto_map, map_goto): Likewise.
2334 * src/nullable.c (nullable_compute): Likewise.
2335 * src/output.c (prepare_rules, token_definitions_output): Likewise.
2336 * src/reader.c (packgram, reader): Likewise.
2337 * src/state.c (state_new, state_free, state_transitions_set,
2338 state_reduction_find): Likewise.
2339 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
2340 symbol_pack): Likewise.
2341 * src/tables.c (conflict_row, pack_vector): Likewise.
2342 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
2343 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
2344 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
2345 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
2346
2347 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
2348 (ARGMATCH_CONSTRAINT): New macro.
2349 (ARGMATCH_ASSERT): Use it.
2350
2351 * src/system.h (verify): New macro.
2352 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
2353 rather than assert.
2354 * src/tables.c (tables_generate): Likewise.
2355
2356 * src/struniq.c (struniq_assert): Now returns void, and aborts
2357 if the assertion is false.
2358 (struniq_assert_p): Remove.
2359 * src/struniq.h: Likewise.
2360
76ae8198
PE
23612002-11-18 Paul Eggert <eggert@twinsun.com>
2362
2363 * data/glr.c (yygetLRActions): Replace `yyindex' with
2364 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
2365 This fixes the regression with Sun ONE Studio 7 cc that I reported in
e3aa65c5 2366 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 2367
d3c4e709
AD
23682002-11-18 Akim Demaille <akim@epita.fr>
2369
2370 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
2371 space.
2372 From Tim Van Holder.
2373
8d8a7238
PE
23742002-11-17 Paul Eggert <eggert@twinsun.com>
2375
2376 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
2377 to "SyntaxError" for consistency with my 2002-11-15 change.
2378
2379 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
2380 not define to {}, since this breaks the common use of `YYDPRINTF
2381 ((...));' if a single statement is desired (e.g. before `else').
2382 Work around GCC warnings by surrounding corresponding calls with
2383 {} if needed.
2384 (yyhasResolvedValue): Remove unused function.
2385 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
2386 loop body.
2387 (yyreportSyntaxError): Renamed from yyreportParseError.
2388 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
2389 All uses changed.
2390 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
2391 extern when possible. Remove unused initializations.
2392
b0937b22
AD
23932002-11-16 Akim Demaille <akim@epita.fr>
2394
2395 Augment the similarity between GLR and LALR traces.
2396
2397 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
2398 (YY_REDUCE_PRINT): New.
2399 (yyparse): Use them.
2400 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
2401 YYDPRINT here.
2402 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
2403 state reached after the reduction/recovery, since...
2404 (yyparse, yyprocessOneStack): Report the state we are entering in.
2405
c5e3e510
AD
24062002-11-16 Akim Demaille <akim@epita.fr>
2407
2408 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
2409 Add support for --trace=skeleton.
2410 * src/scan-skel.l: %option debug.
2411 Scan strings of non-@ or \n instead of character by character.
2412 (scan_skel): Handle trace_skeleton.
2413 (QPUTS): New.
2414 (@output_parser_name@, @output_header_name@): ``Restore'' their
2415 support (used to be M4 macros).
2416 * data/yacc.c: Quote larger chunks, a la glr.c.
2417 * data/lalr1.cc: Likewise.
2418 The header guards are no longer available, so use some other
2419 string than `YYLSP_NEEDED'.
2420
4c6cc1db
AD
24212002-11-16 Akim Demaille <akim@epita.fr>
2422
2423 Make the ``Printers and Destructors'' test more verbose, taking
2424 `yacc.c''s behavior as (possibly wrong) reference.
2425
2426 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
2427 instead of fprint on stdout.
2428 Set and report the last_line of the symbols.
2429 Consistently display values and locations.
2430
6d9e8019
PE
24312002-11-16 Paul Eggert <eggert@twinsun.com>
2432
2433 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
2434
6e649e65
PE
24352002-11-15 Paul Eggert <eggert@twinsun.com>
2436
b25d88f6
PE
2437 * tests/actions.at (Actions after errors): New test case.
2438
6e649e65
PE
2439 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
2440 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
2441 tests/action.at, tests/calc.at, tests/conflicts.at,
2442 tests/cxx-type.at, tests/regression.at:
2443 "parse error" -> "syntax error" for POSIX compatibility.
2444 "parsing stack overflow..." -> "parser stack overflow" so
2445 that code matches Bison documentation.
2446
0f39aab9
AD
24472002-11-15 Akim Demaille <akim@epita.fr>
2448
2449 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
2450 take two BRACED_CODE, not two string_content.
2451 Free the scanner's obstack when we are done.
2452 (code_content): New.
2453 * tests/calc.at: Adjust.
2454 * doc/bison.texinfo: Adjust.
2455 Also, make sure to include the `,' for these declarations.
2456
761c1926
AD
24572002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
2458
2459 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
2460 definition; avoids potential autoreconf problems.
2461
b0f98b10
AD
24622002-11-15 Akim Demaille <akim@epita.fr>
2463
2464 Always check the value returned by yyparse.
2465
2466 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
2467 returned by yyparse.
2468 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
2469 Adjust calls.
2470 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
2471 returned by yyparse.
2472
970785f1
PH
24732002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2474
2475 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
2476 on input.at test.
2477
8fcc7db1
PE
24782002-11-14 Paul Eggert <eggert@twinsun.com>
2479
7ec1b48e
PE
2480 * src/output.c (output_skeleton): Call xfopen instead of
2481 duplicating xfopen's body.
2482
cfff7583 2483 Fix bugs reported by Nelson H. F. Beebe in
e3aa65c5 2484 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 2485
8fcc7db1
PE
2486 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
2487 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
2488 Group compiler. Instead, use "$CC -E bar.c". Include the .h
2489 file twice in the grammar, as an extra check.
2490
2491 * tests/input.at (Torturing the Scanner): Surround the
2492 backslash-newline tests with "#if 0", to make it less likely that
2493 we'll run into compiler bugs. Bring back solitary \ inside
2494 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 2495 test backslash-newline in C character constant.
8fcc7db1 2496
4e8d992c
AD
24972002-11-14 Akim Demaille <akim@epita.fr>
2498
2499 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
2500 status of the compiler.
f32b346d 2501 Calling `exit 1' is no longer needed.
4e8d992c
AD
2502 Reported by Nelson H. F. Beebe.
2503
9501dc6e
AD
25042002-11-14 Akim Demaille <akim@epita.fr>
2505
2506 * tests/atlocal.in (CPPFLAGS): We have config.h.
2507 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
2508 New.
2509 * tests/actions.at, tests/calc.at, tests/conflicts.at,
2510 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
2511 * tests/regression.at, tests/torture.at: Use them for all the
2512 grammars that are to be compiled.
2513 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
2514 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
2515 * doc/bison.texinfo (GLR Parsers): Document `inline'.
2516
18b519c0
AD
25172002-11-14 Akim Demaille <akim@epita.fr>
2518
2519 * doc/bison.texinfo: Various formatting changes (alignments in
2520 samples, additional @group/@end group, GCS in samples.
2521 Use @deffn instead of simple @table to define the directives,
2522 macros, variables etc.
2523
9a86cdb9
PE
25242002-11-13 Paul Eggert <eggert@twinsun.com>
2525
daa33def 2526 Fix some bugs reported by Albert Chin-A-Young in
e3aa65c5 2527 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 2528
daa33def 2529 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 2530 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
2531 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2532 * tests/headers.at (export YYLTYPE): Likewise.
2533
2534 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 2535 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 2536
9a86cdb9
PE
2537 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
2538 comments, since they're not portable. Use GNU coding style.
2539
9c1e26bd
AD
25402002-11-13 Akim Demaille <akim@epita.fr>
2541
2542 * data/yacc.c: Leave bigger chunks of quoted text.
2543 (YYDSYMPRINTF): New.
2544 Use it to report symbol activities.
2545 * data/glr.c (YYDSYMPRINTF): New.
2546 Use it.
2547
87f721cc
PE
25482002-11-12 Paul Eggert <eggert@twinsun.com>
2549
2550 Version 1.75b.
2551
2552 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
2553 (yyglrReduce): Return yyok, not 0.
2554 This should avoid the enumerated-type warnings reported
464c6927 2555 by Nelson H. F. Beebe in
e3aa65c5 2556 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
2557
2558 * lib/bbitset.h (BITSET_INLINE): Remove.
2559 * lib/bitset.h [! BITSET_INLINE]: Remove.
2560 (bitset_set, bitset_reset, bitset_test): Rename local vars
2561 to avoid shadowing warnings by GCC.
2562
2563 * data/glr.c (inline): Remove #define. It's the user's
2564 responsibility to #define it away, just like 'const'.
464c6927 2565 This fixes one of the bugs reported by Nelson H. F. Beebe in
e3aa65c5 2566 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 2567
87f721cc
PE
2568 * Makefile.maint (po-check): Scan .l and .y files instead of the
2569 .c and the .h files that they generate. This fixes the bug
2570 reported by Tim Van Holder in:
e3aa65c5 2571 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
2572 Look for N_ as well as for _. Try to avoid matching #define for
2573 N_ and _.
2574 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
2575 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
2576 * src/scan-gram.l: Revamp regular expressions so that " and '
2577 do not confuse xgettext.
2578
2579 * src/struniq.h (struniq_new): Do not declare the return type
2580 to be 'const'; this violates the C standard.
2581 * src/struniq.c (struniq_new): Likewise.
2582
be14ade5
AD
25832002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
2584
2585 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
2586 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
2587 linker.
2588
05291fbc
AD
25892002-11-12 Akim Demaille <akim@epita.fr>
2590
2591 * Makefile.maint: Sync with Autoconf:
2592 (local_updates): New.
2593
1f5fd52e
AD
25942002-11-12 Akim Demaille <akim@epita.fr>
2595
2596 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
2597
283f1e64
AD
25982002-11-12 Akim Demaille <akim@epita.fr>
2599
2600 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
2601 locations.
2602
886b69d1
AD
26032002-11-12 Akim Demaille <akim@epita.fr>
2604
2605 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
2606 not yyvalue.
2607
3df37415
AD
26082002-11-12 Akim Demaille <akim@epita.fr>
2609
2610 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
2611 Use it to test the GLR parser.
2612
7bd6c77e
AD
26132002-11-12 Akim Demaille <akim@epita.fr>
2614
2615 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
2616 defines it.
2617 * data/glr.c (yystos): New.
2618 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
2619 (YYDSYMPRINT): New.
2620 (yyval): Don't define it, it is handled via M4.
2621 (yyrecoverParseError): Free verbosely the discarded symbols.
2622 * data/yacc.c (yysymprint): Remove, rather...
2623 (b4_yysymprint_generate): invoke.
2624 * data/c.m4 (b4_yysymprint_generate): New.
2625 Accept pointers as arguments, as opposed to the version from
2626 yacc.c.
2627 (b4_yydestruct_generate): Likewise.
2628 * tests/cations.at (Printers and Destructors): Use Bison directives
2629 instead of CPP macros.
2630 Don't rely on internal details.
2631
b0400cc6
AD
26322002-11-12 Akim Demaille <akim@epita.fr>
2633
2634 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
2635 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
2636 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
2637 it against YYEMPTY and so forth), work on yytoken (i.e., set
2638 it to YYEMPTY etc.).
2639 (yydestruct): Replace with a b4_yydestruct_generate invocation.
2640 (b4_symbol_actions): Remove.
2641 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
2642 for 0, end-of-input.
2643
72f889cc
AD
26442002-11-12 Akim Demaille <akim@epita.fr>
2645
2646 * doc/bison.texinfo (Destructor Decl): New.
2647
b1ae9233
AD
26482002-11-12 Akim Demaille <akim@epita.fr>
2649
2650 * src/tables.c (tables_generate): Use free for pointers that
2651 cannot be NULL, not XFREE.
2652 (pack_vector): Use assert, not fatal, for bound violations.
2653 * src/state.c (state_new): Likewise.
2654 * src/reader.c (reader): Likewise.
2655 * src/lalr.c (set_goto_map): Likewise.
72f889cc 2656 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
2657 the file name.
2658
7ec2d4cd
AD
26592002-11-12 Akim Demaille <akim@epita.fr>
2660
2661 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
2662 Restore.
2663 * src/scan-gram.l (last_string): Is global to the file, not to
2664 yylex.
2665 * src/parse-gram.y (input): Don't append the epilogue here,
2666 (epilogue.opt): do it here, and free the scanner's obstack.
2667 * src/reader.c (epilogue_set): Rename as...
2668 (epilogue_augment): this.
2669 * data/c.m4 (b4_epilogue): Defaults to empty.
2670
573a6cd3
AD
26712002-11-12 Akim Demaille <akim@epita.fr>
2672
2673 * src/getargs.c (long_options): Remove duplicates.
2674 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
2675 Remove.
2676 * doc/bison.rnh: Remove.
2677 * doc/bison.texinfo (VMS Invocation): Remove.
2678
95612cfa
AD
26792002-11-12 Akim Demaille <akim@epita.fr>
2680
2681 * src/struniq.h, src/struniq.c (struniq_t): Is const.
2682 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
2683
2684 Use struniq for symbols.
2685
2686 * src/symtab.h (symbol_t): The tag member is a struniq.
2687 (symbol_type_set): Adjust.
2688 * src/symtab.c (symbol_new): Takes a struniq.
2689 (symbol_free): Don't free the tag member.
2690 (hash_compare_symbol_t, hash_symbol_t): Rename as...
2691 (hash_compare_symbol, hash_symbol): these.
2692 Use the fact that tags as struniqs.
2693 (symbol_get): Use struniq_new.
2694 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
2695 Returns a strniq.
2696 * src/reader.h (merger_list, grammar_currentmerge_set): The name
2697 and type members are struniqs.
2698 * src/reader.c (get_merge_function)
2699 (grammar_current_rule_merge_set): Adjust.
2700 (TYPE, current_type): Are struniq.
2701
2702 Use struniq for file names.
2703
2704 * src/files.h, src/files.c (infile): Split into...
2705 (grammar_file, current_file): these.
2706 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
2707 * src/reduce.c (reduce_print): Likewise.
2708 * src/getargs.c (getargs): Likewise.
2709 * src/complain.h, src/complain.c: Likewise.
2710 * src/main.c (main): Call struniqs_new early enough to use it for
2711 file names.
2712 Don't free the input file name.
2713
3e6656f9
AD
27142002-11-12 Akim Demaille <akim@epita.fr>
2715
2716 * src/symtab.c (symbol_free): Remove dead deactivated code:
2717 type_name are properly removed.
2718 Don't use XFREE to free items that cannot be NULL.
2719 * src/struniq.h, src/struniq.c: New.
2720 * src/main.c (main): Initialize/free struniqs.
2721 * src/parse-gram.y (%union): Add astruniq member.
2722 (yyprint): Adjust.
2723 * src/scan-gram.l (<{tag}>): Return a struniq.
2724 Free the obstack bit that used to store it.
2725 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
2726
7672019c
PE
27272002-11-11 Paul Eggert <eggert@twinsun.com>
2728
2729 Revamp to fix many (but not all) of the C- and M4-related quoting
2730 problems. Among other things, this fixes the Bison bug reported
2731 by Jan Hubicka when processing the Bash grammar; see:
e3aa65c5 2732 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
2733
2734 Use new @ escapes consistently. Represent brackets with @{ and @}
2735 rather than @<:@ and @:>@, since this works a bit better with dumb
2736 editors like vi. Represent @ with @@, since @ is now consistently
2737 an escape. Use @oline@ and @ofile@ rather than __oline__ and
2738 __ofile__, to avoid unexpected expansions. Similarly, use @output
2739 rather than #output.
2740
2741 * data/c.m4 (b4_copyright): Omit file name from comment, since
2742 the file name could contain "*/".
2743 (b4_synclines_flag): Don't quote the 2nd argument; it should already
2744 be quoted. All uses changed.
2745
2746 * data/glr.c: Use new @ escapes consistently.
2747 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
2748 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
2749 Remove, since they couldn't handle arbitrary characters in file
2750 names.
2751 * data/lalr1.cc: Likewise.
2752 * data/yacc.c: Likewise.
2753
2754 * src/files.c (output_infix): Remove; all uses removed.
2755 * src/files.h: Likewise.
2756
2757 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
2758 mishandled funny characters in file names, and anyway it isn't
2759 needed any more.
2760 * data/yacc.c: Likewise.
2761 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
2762
2763 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
2764 * data/yacc.c: Likewise.
2765
2766 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
2767 strings now.
2768 (muscle_init): Quote filename as a C string.
2769 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
2770 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
2771 * src/output.c (escaped_file_name_output): New function.
2772 (prepare_symbols): Quote tokens for M4.
2773 (prepare): Don't insert output_infix, output_prefix,
2774 output_parser_name, output_header_name; this is now down by scan-skel.
2775 Insert skeleton as a C string.
2776
2777 * src/output.c (user_actions_output, symbol_destructors_output,
2778 symbol_printers_output): Quote filenames for C and M4.
2779 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2780
2781 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
2782 escapes other than \\ and \'; this simplifies the code.
2783 (<SC_STRING>): Likewise, for \\ and \".
2784 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
2785 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
2786 Use new escapes @{ and @} for [ and ].
2787
2788 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
2789 them with auto vars.
2790 Switch to new escape scheme, where @ is the escape character uniformly.
2791 Abort if a stray escape character is found. Avoid unbounded input
2792 buffer when parsing non-escaped text.
2793
2794 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
2795 __oline__, #output, $@, and @{ do not have unintended meanings.
2796
acea4f3b
PE
27972002-11-09 Paul Eggert <eggert@twinsun.com>
2798
2799 Fix the test failure due to GCC warnings described in
e3aa65c5 2800 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
2801 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
2802 evaluate to 0 if it's impossible for NINF to be in the respective
2803 table.
2804 (yygetLRActions, yyrecoverParseError): Use them.
2805
2806 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
2807 counted in the token inserted at end of file. Now takes
2808 location_t *, not location_t, so that the location can be
2809 adjusted. All uses changed.
2810
2811 * tests/regression.at (Invalid inputs): Adjust wording in
2812 diagnostic to match the new behavior.
2813
2814 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
2815 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
2816 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
2817 abort ();'. This reduces the runtime of the "Many lookaheads"
2818 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
2819 GCC 3.2.
2820
20ef1ad5
PE
28212002-11-07 Paul Eggert <eggert@twinsun.com>
2822
2823 * src/parse-gram.y (CHARACTER): Remove unused token.
2824 All uses removed.
2825
2826 * src/scan-gram.l: Remove stack option. We no longer use the
2827 stack, since the stack was never deeper than 1; instead, use the
2828 new auto var c_context to record the stacked value.
2829
2830 Remove nounput option. At an unexpected end of file, we now unput
2831 the minimal input necessary to end cleanly; this simplifies the
2832 code.
2833
2834 Avoid unbounded token sizes where this is easy.
2835
2836 (unexpected_end_of_file): New function.
2837 Use it to systematize the error message on unexpected EOF.
2838 (last-string): Now auto, not static.
2839 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
2840 (scanner_last_string_free): Remove; not used.
2841 (percent_percent_count): Move decl to just before use.
2842 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
2843 not the (never otherwised-used) CHARACTER.
2844
93724f13
AD
28452002-11-07 Akim Demaille <akim@epita.fr>
2846
2847 Let yyerror always receive the msg as last argument, so that
2848 yyerror can be variadic.
2849
2850 * data/yacc.c (b4_yyerror_args): New.
2851 Use it when calling yyerror.
2852 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
2853 Use it when calling yyerror.
2854 * doc/bison.texinfo (Error Reporting): Adjust.
2855 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
2856 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
2857
6e40b4eb
AD
28582002-11-06 Akim Demaille <akim@epita.fr>
2859
2860 #line should have quoted strings.
2861 Ideally, this should be done by m4_quotearg.
2862
2863 * src/scan-skel.l: Include quotearg.h.
2864 Quote __ofile__.
2865 * src/output.c (symbol_printers_output)
2866 (symbol_destructors_output): Quote the file name.
2867
2dfbfc12
AD
28682002-11-06 Akim Demaille <akim@epita.fr>
2869
2870 * tests/regression.at (Invalid inputs): Adjust to the recent
2871 messages.
2872
437c2d80
AD
28732002-11-06 Akim Demaille <akim@epita.fr>
2874
2875 Restore --no-lines.
2876 Reported by Jim Kent.
2877
2878 * data/c.m4 (b4_syncline): New.
2879 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
2880 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
2881 * src/output.c (user_actions_output): Likewise.
2882 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 2883 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 2884
900c5db5
AD
28852002-11-06 Akim Demaille <akim@epita.fr>
2886
2887 * src/main.c (main): Free `infile'.
2888 * src/scan-gram.l (handle_syncline): New.
2889 Recognize `#line'.
2890 * src/output.c (user_actions_output, symbol_destructors_output)
2891 (symbol_printers_output): Use the location's file name, not
2892 infile.
2893 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2894
e183b123 28952002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 2896
e183b123 2897 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 2898 either has GLR conflict entries.
e183b123 2899
193eb6b7
PE
29002002-11-05 Paul Eggert <eggert@twinsun.com>
2901
e183b123
PE
2902 * src/scan-gram.l: Use more accurate diagnostics, e.g.
2903 "integer out of range" rather than "invalid value".
2904 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
2905 accordingly.
2906
193eb6b7
PE
2907 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
2908 Also, remove one static variable in the scanner.
2909
2910 * src/scan-gram.l (braces_level): Now auto, not static.
2911 Initialize to zero if the compiler is being picky.
2912 (INITIAL): Clear braces_level instead of incrementing it.
2913 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
2914 as POSIX 1003.1-2001 requires.
2915 * src/system.h (IF_LINT): New macro, taken from coreutils.
2916 * configure.ac: Define "lint" if --enable-gcc-warnings.
2917
29c01725
AD
29182002-11-05 Akim Demaille <akim@epita.fr>
2919
2920 * src/scan-gram.l: When it starts with `%', complain about the
2921 whole directive, not just that `invalid character: %'.
2922
8aeac3ca
AD
29232002-11-04 Akim Demaille <akim@epita.fr>
2924
2925 * Makefile.maint: Update from Autoconf.
2926 (update, cvs-update, po-update, do-po-update): New.
2927
793a58bb
AD
29282002-11-04 Akim Demaille <akim@epita.fr>
2929
2930 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
2931 and yyerror.
2932 Have yyerror `use' its arguments.
2933 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
2934 returns true when location & yacc & pure & parse-param.
2935 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
2936
c4d720cd
AD
29372002-11-04 Akim Demaille <akim@epita.fr>
2938
2939 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
2940 clashes.
2941 * src/scan-gram.l: Use [\'] instead of ['] to pacify
2942 font-lock-mode.
2943 Use complain_at.
2944 Use quote, not quote_n since LOCATION_PRINT no longer uses the
2945 slot 0.
2946
613a0dc5
PE
29472002-11-03 Paul Eggert <eggert@twinsun.com>
2948
2949 * src/reader.c (get_merge_function, grammar_current_rule_check):
2950 Use consistent diagnostics for reporting type name clashes.
2951 Quote the types with <>, for consistency with Yacc.
2952 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
2953
2a8d363a
AD
29542002-11-03 Akim Demaille <akim@epita.fr>
2955
2956 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
2957 New.
2958 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
2959 (b4_parse_param): Remove.
2960 Use b4_identification.
2961 Propagate b4_pure_args where needed to pass them to yyerror.
2962 * data/glr.m4 (b4_parse_param): Remove.
2963 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
2964 (b4_lpure_formals): New.
2965 Use b4_identification.
2966 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
2967 b4_user_formals and b4_user_args.
2968 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
2969 (yyreportAmbiguity): When using a pure parser, also need
2970 the location, and the parse-params.
2971 Adjust callers.
2972 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
2973 When using a pure parser, also need the parse-params.
2974 Adjust callers.
2975 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
2976 (%pure-parser + %parse-param) LALR and GLR parsers.
2977 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
2978 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
2979 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
2980 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
2981 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
2982 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
2983 * doc/bison.texinfo: Untabify the whole file.
2984 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
2985 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
2986 (Error Reporting): Adjust to these new directives.
2987 Document %error-verbose, deprecate YYERROR_VERBOSE.
2988
9e32add8
AD
29892002-11-03 Akim Demaille <akim@epita.fr>
2990
2991 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
2992 AT_CHECK_CALC_GLR invocations to use % directives, instead of
2993 command line options.
2994 * tests/cxx-type.at: Formatting changes.
2995
b02d90a5
PE
29962002-11-03 Paul Eggert <eggert@twinsun.com>
2997
2998 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
2999 to count columns correctly, and to check for invalid inputs.
9e32add8 3000
b02d90a5
PE
3001 Use mbsnwidth to count columns correctly. Account for tabs, too.
3002 Include mbswidth.h.
3003 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
3004 (extend_location): New function.
3005 (YY_LINES): Remove.
3006
3007 Handle CRLF in C code rather than in Lex code.
3008 (YY_INPUT): New macro.
3009 (no_cr_read): New function.
3010
3011 Scan UCNs, even though we don't fully handle them yet.
3012 (convert_ucn_to_byte): New function.
3013
3014 Handle backslash-newline correctly in C code.
3015 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
3016 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
3017 all uses changed.
3018 (tag, splice): New EREs. Do not allow NUL or newline in tags.
3019 Use {splice} wherever C allows backslash-newline.
3020 YY_STEP after space, newline, vertical-tab.
3021 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 3022
b02d90a5
PE
3023 (letter, id): Don't assume ASCII; e.g., spell out a-z.
3024
3025 ({int}, handle_action_dollar, handle_action_at): Check for integer
3026 overflow.
9e32add8 3027
b02d90a5
PE
3028 (YY_STEP): Omit trailing semicolon, so that it's more like C.
3029
3030 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
3031 as well as \000. Check for UCHAR_MAX, not 255.
3032 Allow \x with an arbitrary positive number of digits, as in C.
3033 Check for overflow here.
3034 Allow \? and UCNs, for compatibility with C.
3035
3036 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
3037 with quote slot used by complain_at.
3038
3039 * tests/input.at: Add tests for backslash-newline, m4 quotes
3040 in symbols, long literals, and funny escapes in strings.
3041
3042 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
3043 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
3044 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
3045 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
3046 * m4/mbswidth.m4: New file, from GNU coreutils.
3047
3048 * doc/bison.texinfo (Grammar Outline): Document // comments.
3049 (Symbols): Document that trigraphs have no special meaning in Bison,
3050 nor is backslash-newline allowed.
3051 (Actions): Document that trigraphs have no special meaning.
3052
3053 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
3054 no longer used.
3055
30562002-11-02 Paul Eggert <eggert@twinsun.com>
3057
3058 * src/reader.c: Don't include quote.h; not needed.
3059 (get_merge_function): Reword warning to be consistent with
3060 type clash diagnostic in grammar_current_rule_check.
3061
3062 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
3063 bug in trigraph handling.
3064
3065 * src/output.c (prepare_symbols): When printing token names,
3066 escape "[" as "@<:@" and likewise for "]".
3067
3068 * src/system.h (errno): Remove declaration, as we are now
3069 assuming C89 or better, and C89 guarantees errno.
3070
762b212b
PE
30712002-10-30 Paul Eggert <eggert@twinsun.com>
3072
3073 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
3074 Check for close failures.
3075 * src/files.h (xfclose): Return void, not int, since it always
3076 returned zero.
3077 * src/files.c (xfclose): Likewise. Report I/O error if ferror
3078 indicates one.
3079 * src/output.c (output_skeleton): Use xfclose rather than fclose
3080 and ferror. xfclose now checks ferror.
3081
3082 * data/glr.c (YYLEFTMOST_STATE): Remove.
3083 (yyreportTree): Use a stack-based leftmost state. This avoids
3084 our continuing battles with bogus warnings about initializers.
3085
56100c60
AD
30862002-10-30 Akim Demaille <akim@epita.fr>
3087
3088 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
3089 #if.
3090
51b4a04c
PH
30912002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3092
3093 * tests/glr-regr1.at: New test for reported regressions.
3094 * tests/testsuite.at: Add glr-regr1.at test.
3095 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 3096
bf1ebda2
PE
30972002-10-24 Paul Eggert <eggert@twinsun.com>
3098
5c16c6b1
PE
3099 Version 1.75a.
3100
bf1ebda2
PE
3101 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
3102 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
3103 we use malloc. Don't assume 'A' through 'Z' are contiguous.
3104 Don't assume strdup exists; POSIX says its an XSI extension.
3105 Check for buffer overflow on input.
3106
b526ee61
AD
31072002-10-24 Akim Demaille <akim@epita.fr>
3108
3109 * src/output.c (output_skeleton): Don't disable M4sugar comments
3110 too soon: it results in comments being expanded.
3111 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
3112 first output.
3113
f1886bb2
AD
31142002-10-24 Akim Demaille <akim@epita.fr>
3115
3116 * data/yacc.c (m4_int_type): New.
3117 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
3118 char' as only yacc.c wants K&R portability.
3119 * data/glr.c (yysigned_char): Remove.
3120 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
3121 Reported by Quoc Peyrot.
3122
c5576256
PE
31232002-10-23 Paul Eggert <eggert@twinsun.com>
3124
3125 * src/main.c (main): With --trace=time, report times even if a
3126 non-fatal error occurs. Formerly, the times were reported in some
3127 such cases but not in others.
3128 * src/reader.c (reader): Just return if a complaint has been issued,
3129 instead of exiting, so that 'main' can report times.
3130
27b0ffea
AD
31312002-10-22 Akim Demaille <akim@epita.fr>
3132
3133 * src/system.h: Include sys/types.
3134 Reported by Bert Deknuydt.
3135
223a7883
PE
31362002-10-23 Paul Eggert <eggert@twinsun.com>
3137
3138 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
3139 Suggested by Art Haas.
3140
31412002-10-22 Paul Eggert <eggert@twinsun.com>
3142
3143 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
3144 decl; not needed any more.
3145 * src/main.c (main): Use return to exit, undoing yesterday's change.
3146 The last OS that we could find where this wouldn't work is
3147 SunOS 3.5, and that's too old to worry about now.
3148
3149 * data/glr.c (struct yyltype): Define members even when not
3150 doing locations. This is more consistent with yacc.c, and it
3151 works around the following bug reports:
e3aa65c5
PE
3152 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
3153 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 3154
223a7883
PE
3155 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
3156 @acronym consistently. Standardize on "Yacc" instead of "YACC",
3157 "Algol" instead of "ALGOL". Give a bit more history about BNF.
3158
8b76775a
AD
31592002-10-22 Akim Demaille <akim@epita.fr>
3160
3161 * data/README: New.
3162
6db10d14
PE
31632002-10-21 Paul Eggert <eggert@twinsun.com>
3164
3165 Be consistent about 'bool'; the old code used an enum in one
3166 module and an int in another, and this violates the C standard.
3167 * m4/stdbool.m4: New file, from coreutils 4.5.3.
3168 * configure.ac (AC_HEADER_STDBOOL): Add.
3169 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
3170 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
3171 * src/symtab.c (hash_compare_symbol_t): Likewise.
3172 * src/system.h (bool, false, true): Use a definition consistent
3173 with ../lib/hash.c. All uses changed.
3174
3175 * src/complain.c (warning_issued): Renamed from warn_message_count,
3176 so that we needn't worry about integer overflow (!).
3177 Now of type bool. All uses changed.
3178 (complaint_issued): Renamed from complain_message_count; likewise.
3179
3180 * src/main.c (main): Use exit to exit with failure.
27b0ffea 3181
6db10d14
PE
3182 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
3183 rather than 1 and 0.
3184 * src/main.c (main): Likewise.
3185 * src/getargs.c (getargs): Likewise.
3186 * src/reader.c (reader): Likewise.
3187
3188 * src/getarg.c (getargs): Remove duplicate code for
3189 "Try `bison --help'".
3190
3191 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
3192 What was that "2" for?
3193
3194 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
3195 * src/getargs.c (usage): Likewise.
3196
3197 * src/getargs.c (getargs): When there are too few operands, report
3198 the last one. When there are too many, report the first extra
3199 one. This is how diffutils does it.
3200
92a060fd
PE
32012002-10-20 Paul Eggert <eggert@twinsun.com>
3202
3203 Remove K&R vestiges.
3204 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
3205 * src/complain.c (VA_START): Remove. Assume prototypes.
3206 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
3207 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
3208 fatal): Assume prototypes.
3209 * src/complain.h: Assume prototypes.
3210 * src/system.h (PARAMS): Remove.
3211 Include <limits.h> unconditionally, since it's guaranteeed even
3212 for a freestanding C89 compiler.
3213 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
3214 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 3215
e7cb57c0
AD
32162002-10-20 Akim Demaille <akim@epita.fr>
3217
3218 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
3219 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
3220 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
3221 (yyresolveStates, yyresolveAction, yyresolveStack)
3222 (yyprocessOneStack): Use them.
3223 (yy_reduce_print): New.
3224 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
3225
0245f82d
AD
32262002-10-20 Akim Demaille <akim@epita.fr>
3227
3228 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
3229 arguments and output `void'.
3230 (b4_c_function): Rename as...
3231 (b4_c_function_def): this.
3232 (b4_c_function_decl, b4_c_ansi_function_def)
3233 (b4_c_ansi_function_decl): New.
3234 Change the interpretation of the arguments: before `int, foo', now
3235 `int foo, foo'.
3236 * data/yacc.c (yyparse): Prototype and define thanks to these.
3237 Adjust b4_c_function_def uses.
3238 * data/glr.c (yyparse): Likewise, but ANSI only.
3239
39912f52
AD
32402002-10-20 Akim Demaille <akim@epita.fr>
3241
3242 * src/output.c (prepare): Move the definition of `tokens_number',
3243 `nterms_number', `undef_token_number', `user_token_number_max'
3244 to...
3245 (prepare_tokens): Here.
3246 (prepare_tokens): Rename as...
3247 (prepare_symbols): this.
3248 (prepare): Move the definition of `rules_number' to...
3249 (prepare_rules): here.
3250 (prepare): Move the definition of `last', `final_state_number',
3251 `states_number' to...
3252 (prepare_states): here.
3253 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
3254
20c1e2ad
AD
32552002-10-20 Akim Demaille <akim@epita.fr>
3256
3257 * src/tables.h, src/tables.c, src/output.c: Comment changes.
3258
21964f43
AD
32592002-10-20 Akim Demaille <akim@epita.fr>
3260
3261 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
3262 * data/c.m4: here.
3263
66d30cd4
AD
32642002-10-20 Akim Demaille <akim@epita.fr>
3265
3266 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
3267 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
3268 `pair'.
3269 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
3270 `name' to...
3271 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
3272 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
3273 These.
3274
95f2c9fe
PE
32752002-10-19 Paul Eggert <eggert@twinsun.com>
3276
3277 Do not create a temporary file, as that involves security and
3278 cleanup headaches. Instead, use a pair of pipes.
3279 Derived from a suggestion by Florian Krohm.
3280 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
3281 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
3282 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
3283 (BISON_PREREQ_SUBPIPE): Add.
3284 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
3285 Add subpipe.h, subpipe.c.
3286 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
3287 * po/POTFILES.in: Add lib/subpipe.c.
3288 * src/output.c: Include "subpipe.h".
3289 (m4_invoke): Remove decl.
3290 (scan_skel): New decl.
3291 (output_skeleton): Use pipe rather than temporary file for m4 input.
3292 Check that m4sugar.m4 is readable, to avoid deadlock.
3293 Check for pipe I/O error.
3294 * src/scan-skel.l (readpipe): Remove decl.
3295 (scan_skel): New function, to be used in place of m4_invoke.
3296 Read from stream rather than file.
66d30cd4 3297
95f2c9fe
PE
3298 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
3299 float, as this generates a warning on Solaris 8 + GCC 3.2 with
3300 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
3301 this generates a more-accurate value anyway.
3302
3303 * lib/timevar.c (timervar_accumulate): Rename locals to
3304 avoid confusion with similarly-named more-global.
3305 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
3306
3307 * src/output.c (prepare): Use xstrdup to convert char const *
3308 to char *, to avoid GCC warning.
3309
c19988b7
AD
33102002-10-19 Akim Demaille <akim@epita.fr>
3311
3312 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
3313 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
3314 Use them to have `calc.y' ready for %pure-parser.
3315 * data/yacc.c (YYLEX): Pass a yylex return type to
3316 b4_c_function_call.
3317
ae7453f2
AD
33182002-10-19 Akim Demaille <akim@epita.fr>
3319
3320 Prototype support of %lex-param and %parse-param.
3321
3322 * src/parse-gram.y: Add the definition of the %lex-param and
3323 %parse-param tokens, plus their rules.
3324 Drop the `_' version of %glr-parser.
3325 Add the "," token.
3326 * src/scan-gram.l (INITIAL): Scan them.
3327 * src/muscle_tab.c: Comment changes.
3328 (muscle_insert, muscle_find): Rename `pair' as `probe'.
3329 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
3330 (muscle_entry_s): The `value' member is no longer const.
3331 Adjust all dependencies.
3332 * src/muscle_tab.c (muscle_init): Adjust: use
3333 MUSCLE_INSERT_STRING.
3334 Initialize the obstack earlier.
3335 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
3336 (muscle_pair_list_grow): New.
3337 * data/c.m4 (b4_c_function_call, b4_c_args): New.
3338 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
3339 * tests/calc.at: Use %locations, not --locations.
3340 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
3341
0e575721
AD
33422002-10-19 Akim Demaille <akim@epita.fr>
3343
3344 * src/getargs.c (usage): Take status as argument and exit
3345 accordingly.
3346 Report the traditional `Try ... --help' message when status != 0.
3347 (usage, version): Don't take a FILE * as arg, it is pointless.
3348 (getargs): When there is an incorrect number of arguments, make it
3349 an error, and report it GNUlically thanks to `usage ()'.
3350
724ce7f5
PE
33512002-10-18 Paul Eggert <eggert@twinsun.com>
3352
3a781eb2
PE
3353 * data/glr.c (yyreportParseError): Don't assume that sprintf
3354 yields the length of the printed string, as this is not true
3355 on SunOS 4.1.4. Reported by Peter Klein.
3356
724ce7f5
PE
3357 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
3358 * tests/conflicts.at (%nonassoc and eof): Likewise.
3359 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
3360
473d0a75
AD
33612002-10-17 Akim Demaille <akim@epita.fr>
3362
3363 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
3364 * src/getargs.c (trace_types, trace_args): Adjust.
3365 * src/reader.c (grammar_current_rule_prec_set)
3366 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
3367 Standardize error messages.
3368 And s/@prec/%prec/!
3369 (reader): Use trace_flag to enable scanner/parser debugging,
3370 instead of an adhoc scheme.
3371 * src/scan-gram.l: Remove trailing debugging code.
3372
e76d2469
PE
33732002-10-16 Paul Eggert <eggert@twinsun.com>
3374
93e2236a
PE
3375 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
3376 MUSCLE_TAB_H.
3377
e76d2469
PE
3378 * NEWS: Officially drop support for building Bison with K&R C,
3379 since it didn't work anyway and it's not worth worrying about.
3380 * Makefile.maint (wget_files): Remove ansi2knr.c.
3381 (ansi2knr.c-url_prefix): Remove.
3382 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
3383 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3384 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3385
5bd1c419
PE
33862002-10-15 Paul Eggert <eggert@twinsun.com>
3387
3388 Stop using the "enum_" trick for K&R-style function definitions;
3389 it confused me, and I was the author! Instead, assume that people
3390 who want to use K&R C compilers (when using these modules in GCC,
3391 perhaps?) will run ansi2knr.
3392
3393 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
3394 All uses of "enum_" changed to "enum ".
3395 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3396 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 3397
5bd1c419
PE
3398 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
3399 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
3400 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
3401 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
3402 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
3403 abitset_not, abitset_ones, abitset_or, abitset_or_and,
3404 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
3405 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
3406 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
3407 Use function prototypes; this removes the need for declaring
3408 static functions simply to provide their prototypes.
3409 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
3410 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
3411 bitset_count_, bitset_create, bitset_dump, bitset_first,
3412 bitset_free, bitset_init, bitset_last, bitset_next,
3413 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
3414 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
3415 bitset_print, bitset_release_memory, bitset_toggle_,
3416 bitset_type_choose, bitset_type_get, bitset_type_name_get,
3417 debug_bitset): Likewise.
3418 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
3419 * lib/bitset_stats.c (bitset_log_histogram_print,
3420 bitset_percent_histogram_print, bitset_stats_and,
3421 bitset_stats_and_cmp, bitset_stats_and_or,
3422 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
3423 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
3424 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
3425 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
3426 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
3427 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
3428 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
3429 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
3430 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
3431 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
3432 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
3433 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
3434 bitset_stats_zero): Likewise.
3435 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3436 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3437 bitsetv_dump, debug_bitsetv): Likewise.
3438 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
3439 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
3440 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
3441 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
3442 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
3443 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
3444 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
3445 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
3446 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
3447 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
3448 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
3449 Likewise.
3450 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
3451 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
3452 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
3453 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
3454 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
3455 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
3456 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
3457 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
3458 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
3459 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
3460 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 3461
ae26e1f0
AD
34622002-10-14 Akim Demaille <akim@epita.fr>
3463
3464 Version 1.75.
3465
d43baf71
AD
34662002-10-14 Akim Demaille <akim@epita.fr>
3467
3468 * tests/Makefile.am (maintainer-check-posix): New.
3469
7ebc83e3
AD
34702002-10-14 Akim Demaille <akim@epita.fr>
3471
3472 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
3473 member.
3474
05846dae
AD
34752002-10-14 Akim Demaille <akim@epita.fr>
3476
3477 * src/tables.c (table_ninf_remap): base -> tab.
3478 Reported by Matt Rosing.
3479
1318e37d
PE
34802002-10-14 Paul Eggert <eggert@twinsun.com>
3481
447fbb17
PE
3482 * tests/action.at, tests/calc.at, tests/conflicts.at,
3483 tests/cxx-type.at, tests/headers.at, tests/input.at,
3484 tests/regression.at, tests/synclines.at, tests/torture.at:
3485 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
3486 so that the tests still work even if POSIXLY_CORRECT is set.
3487 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 3488
1318e37d
PE
3489 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
3490 for portability to K&R hosts. Fix typo: signed char is guaranteed
3491 only to 127, not to 128.
3492 * data/glr.c (yysigned_char): New type.
3493 * data/yacc.c (yysigned_char): Likewise.
3494 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
3495
cc0f0794
PE
34962002-10-13 Paul Eggert <eggert@twinsun.com>
3497
5038f418
PE
3498 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
3499 true due to limited range of data type" warning from GCC.
3500
cc0f0794
PE
3501 * data/c.m4 (b4_token_defines): Protect against double-inclusion
3502 by wrapping enum yytokentype's definition inside #ifndef
3503 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
3504
6fed0802
AD
35052002-10-13 Akim Demaille <akim@epita.fr>
3506
3507 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
3508 Un yy- yyrhs to avoid the name clash with the global YYRHS.
3509
32f0598d
AD
35102002-10-13 Akim Demaille <akim@epita.fr>
3511
3512 * Makefile.maint: Update from Autoconf 2.54.
3513 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
3514
7ea9a33f
AD
35152002-10-13 Akim Demaille <akim@epita.fr>
3516
3517 * src/print.c (print_state): Separate the list of solved conflicts
3518 from the other items.
3519 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
3520
ea99527d
AD
35212002-10-13 Akim Demaille <akim@epita.fr>
3522
3523 Let nondeterministic skeletons be usable with deterministic
3524 tables.
3525
3526 With the patch, GAWK compiled by GCC without -O2 passes its test
3527 suite using a GLR parser driven by LALR tables. It fails with -O2
3528 because `struct stat' gives two different answers on my machine:
3529 88 (definition of an auto var) and later 96 (memset on this var).
3530 Hence the stack is badly corrumpted. The headers inclusion is to
3531 blame: if I move the awk.h inclusion before GLR's system header
3532 inclusion, the two struct stat have the same size.
3533
3534 * src/tables.c (pack_table): Always create conflict_table.
3535 (token_actions): Always create conflict_list.
3536 * data/glr.c (YYFLAG): Remove, unused.
3537
f377f69f
AD
35382002-10-13 Akim Demaille <akim@epita.fr>
3539
3540 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
3541 (O0FLAGS): New.
3542 (VALGRIND, GXX): New.
3543 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
3544 * tests/bison.in: Run $PREBISON a pre-command.
3545 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
3546 (maintainer-check-g++): New.
3547 * Makefile.am (maintainer-check): New.
3548
2a1fe6ed
AD
35492002-10-13 Akim Demaille <akim@epita.fr>
3550
3551 * data/glr.c: Formatting changes.
3552 Tweak some trace messages to match yacc.c's.
3553
f50adbbd
AD
35542002-10-13 Akim Demaille <akim@epita.fr>
3555
3556 GLR parsers sometimes raise parse errors instead of performing the
3557 default reduction.
3558 Reported by Charles-Henry de Boysson.
3559
3560 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
3561 check the length of the traces when %glr.
3562 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
3563 GLR's traces.
3564 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
3565 Test GLR parsers.
3566 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
3567 (yyltype): Remove the yy prefix from the member names.
3568 (yytable): Complete its comment.
3569 (yygetLRActions): Map error action number from YYTABLE from
3570 YYTABLE_NINF to 0.
3571 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
3572 (which was a bug: it should have been YYTABEL_NINF, and yet it was
3573 not satisfying as we could compare an YYACTION computed from
3574 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
3575 only value for error actions.
3576 (yyreportParseError): In verbose parse error messages, don't issue
3577 `error' in the list of expected tokens.
3578 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
3579 next action to perform to match glr.c's decoding.
3580 (yytable): Complete its comment.
3581
bcbad5b9
PE
35822002-10-13 Paul Eggert <eggert@twinsun.com>
3583
3584 Fix problem reported by Henrik Grubbstroem in
e3aa65c5 3585 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
3586 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
3587 because the Bison parser reads the second action before reducing
3588 the first one.
3589 * src/scan-gram.l (rule_length): New static var.
3590 Use it to keep track of the rule length in the scanner, since
3591 we can't expect the parser to be in lock-step sync with the scanner.
3592 (handle_action_dollar, handle_action_at): Use this var.
3593 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 3594
14904b89
PE
35952002-10-12 Paul Eggert <eggert@twinsun.com>
3596
1fe611e5
PE
3597 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
3598 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
3599 Include <sys/time.h> when checking for clock_t and struct tms.
3600 Use same include order as source.
3601 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
e3aa65c5 3602 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 3603
1fe611e5
PE
3604 * lib/timevar.c: Update copyright date and clarify comments.
3605 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 3606
1fe611e5
PE
3607 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
3608 GCC version as of today, then merge Bison's changes.
3609 Change "GCC" to "Bison" in copyright notice. timevar.def's
3610 author is Akim, so change that too.
3611
98194095
PE
3612 * src/reader.c (grammar_current_rule_check):
3613 Don't worry about the default action if $$ is untyped.
3614 Prevents bogus warnings reported by Jim Gifford in
e3aa65c5 3615 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 3616
14904b89
PE
3617 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
3618 * data/glr.c, data/lalr1.cc, data/yacc.c:
3619 Output token definitions before the first part of user declarations.
3620 Fixes compatibility problem reported by Jim Gifford for kbd in
e3aa65c5 3621 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 3622
ff6dca18
PE
36232002-10-11 Paul Eggert <eggert@twinsun.com>
3624
3625 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
3626 (yyparse): here. This undoes some of the 2002-07-25 change.
3627 Compatibility problem reported by Ralf S. Engelschall with
3628 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
3629
eb714592
AD
36302002-10-11 Akim Demaille <akim@epita.fr>
3631
3632 * tests/regression.at Characters Escapes): New.
3633 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
3634 characters.
3635 Reported by Jan Nieuwenhuizen.
3636
b7195100
AD
36372002-10-11 Akim Demaille <akim@epita.fr>
3638
3639 * po/id.po: New.
3640
f28a0f2d
PE
36412002-10-10 Paul Eggert <eggert@twinsun.com>
3642
3643 Portability fixes for bitsets; this also avoids several GCC
3644 warnings.
3645
3646 * lib/abitset.c: Include <stddef.h>, for offsetof.
3647 * lib/lbitset.c: Likewise.
3648
3649 * lib/abitset.c (abitset_bytes): Return a size that is aligned
3650 properly for vectors of objects. Do not assume that adding a
3651 header size to a multiple of a word size yields a value that is
3652 properly aligned for the whole union.
3653 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3654
3655 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
3656 unique names for structures.
3657 * lib/ebitset.c (ebitset_bytes): Likewise.
3658 * lib/lbitset.c (lbitset_bytes): Likewise.
3659
3660 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
3661 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
3662 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
3663 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
3664 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
3665 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
3666 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
3667 to improve the type-checking that GCC can do.
3668 * lib/bitset.c (bitset_op4_cmp): Likewise.
3669 * lib/bitset_stats.c (bitset_stats_count,
3670 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
3671 bitset_stats_copy, bitset_stats_disjoint_p,
3672 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
3673 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
3674 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
3675 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
3676 bitset_stats_and_or_cmp, bitset_stats_andn_or,
3677 bitset_stats_andn_or_cmp, bitset_stats_or_and,
3678 bitset_stats_or_and_cmp): Likewise.
3679 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
3680 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
3681 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
3682 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
3683
3684 * lib/abitset.h: Include bitset.h, not bbitset.h.
3685 * lib/ebitset.h: Likewise.
3686 * lib/lbitset.h: Likewise.
3687
3688 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
3689 All instances of parameters of type enum bitset_opts are now of
3690 type enum_bitset_opts, to conform to the C Standard, and similarly
3691 for enum_bitset_type.
3692 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3693 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3694
3695 Do not use "struct bitset_struct" to mean different things in
3696 different modules. Not only is this confusing, it violates
3697 the C Standard, which requires that structure types in different
3698 modules must be compatible if one is to be passed to the other.
3699 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
3700 All instances of "struct bitset_struct *" replaced with "bitset".
3701 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
3702 (union bitset_union, struct abitset_struct, struct ebitset_struct,
3703 struct lbitset_struct, struct bitset_stats_struct): New types.
3704 All uses of struct bitset_struct changed to union bitset_union,
3705 etc.
3706 * lib/abitset.c (struct abitset_struct, abitset,
3707 struct bitset_struct): Remove.
3708 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
3709 struct bitset_struct): Remove.
3710 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
3711 bitset_struct): Remove.
3712 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
3713 Likewise.
3714
3715 Do not call a function of type T using a call that assumes the
3716 function is of a different type U. Standard C requires that a
3717 function must be called with a type that is compatible with its
3718 definition.
3719 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3720 New decls.
3721 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3722 New functions.
3723 * lib/ebitset.c (PFV): Remove.
3724 * lib/lbitset.c (PFV): Likewise.
3725 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
3726 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
3727 decls.
3728 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
3729 (ebitset_vtable): Use them.
3730 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
3731 lbitset_xor): New functions.
3732 (lbitset_vtable): Use them.
3733
3734 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
3735 Declare.
3736
3737 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
3738 GCC warning.
3739 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
3740 Use offsetof, for simplicity.
3741
6fbe4984
PE
37422002-10-06 Paul Eggert <eggert@twinsun.com>
3743
3744 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
3745 the same width as int. This reapplies a hunk of the 2002-08-12 patch
e3aa65c5 3746 <http://mail.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
3747 which was inadvertently undone by the 2002-09-30 patch.
3748 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
3749 the same width as int.
3750
420f93c8
PE
37512002-10-04 Paul Eggert <eggert@twinsun.com>
3752
3753 Version 1.50.
3754
3755 * configure.ac (AC_INIT), NEWS: Increment version number.
3756
3757 * doc/bison.texinfo: Minor spelling, grammar, and white space
3758 fixes.
3759 (Symbols): Mention that any negative value returned from yylex
3760 signifies end-of-input. Warn about negative chars. Mention
3761 the portable Standard C character set.
3762
3763 The GNU coding standard says CFLAGS and YFLAGS are reserved
3764 for the installer to set.
3765 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
3766 * src/Makefile.am (AM_CFLAGS): Likewise.
3767 (AM_YFLAGS): Renamed from YFLAGS.
3768
3769 Fix some MAX and MIN problems.
3770 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
3771 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
3772 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
3773 * src/reader.c (reader): Use it.
3774
3775 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
3776 POSIX 1003.1-2001 has removed fgrep.
3777
37782002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
3779
3780 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
3781 interpreted as signed.
3782 * lib/ebitset.c (ebitset_list): Fix bug.
3783
ff68026d
PE
37842002-10-01 Paul Eggert <eggert@twinsun.com>
3785
3786 More fixes for 64-bit hosts and large bitsets.
3787
3788 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
3789 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
3790 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
3791 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
3792 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
3793 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
3794 bitset_count_): Likewise.
3795 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
3796 bitset_first, bitset_last): Likewise.
3797 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
3798 bitset_stats_list_reverse, bitset_stats_size,
3799 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
3800 Likewise.
3801 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3802 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3803 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3804 bitsetv_reflexive_transitive_closure): Likewise.
3805 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
3806 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
3807 Likewise.
3808 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
3809 Likewise.
420f93c8 3810
ff68026d
PE
3811 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
3812 Use size_t, not unsigned int, to count bytes.
3813 * lib/abitset.h (abitset_bytes): Likewise.
3814 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
3815 Likewise.
3816 * lib/bitset.h (bitset_bytes): Likewise.
3817 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
3818 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
3819 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3820 * lib/ebitset.c (ebitset_bytes): Likewise.
3821 * lib/ebitset.h (ebitset_bytes): Likewise.
3822 * lib/lbitset.c (lbitset_bytes): Likewise.
3823 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 3824
ff68026d
PE
3825 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
3826 abitset_subset_p, abitset_disjoint_p, abitset_and,
3827 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
3828 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
3829 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
3830 abitset_or_and, abitset_or_and_cmp):
3831 Use bitset_windex instead of unsigned int.
3832 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3833 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
3834 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
3835 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
3836 Likewise.
3837 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 3838
ff68026d
PE
3839 * lib/bitset.c (bitset_print):
3840 Use proper printf formats for widths of integer types.
3841 * lib/bitset_stats.c (bitset_percent_histogram_print,
3842 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
3843 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3844 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3845 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 3846
ff68026d
PE
3847 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
3848 BITSET_SIZE_MAX): New macros.
3849 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
3850 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
3851 to BITSET_WINDEX_MAX.
3852
3853 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
3854 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
3855 since we now return the bitset_bindex type (not int).
3856
3857 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
3858 when computing sizes.
3859 * lib/ebitset.c (ebitset_elts_grow): Likewise.
3860
3861 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
3862 and avoid cast to unsigned.
3863
6aa452a6
AD
38642002-09-30 Akim Demaille <akim@epita.fr>
3865
3866 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
3867 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
3868 Updates from Michael Hayes.
3869
927f7817
AD
38702002-09-30 Art Haas <ahaas@neosoft.com>
3871
3872 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
3873 invocations.
3874 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
3875 defined.
3876
9738f41e
AD
38772002-09-27 Akim Demaille <akim@epita.fr>
3878
3879 Version 1.49c.
3880
a5c75d7f
AD
38812002-09-27 Akim Demaille <akim@epita.fr>
3882
3883 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
3884 (Because of AC_LIBSOURCE).
3885
8280e179
AD
38862002-09-27 Akim Demaille <akim@epita.fr>
3887
3888 Playing with Autoscan.
3889
3890 * configure.ac: Remove the old LIBOBJ tweaks.
3891 (AC_REPLACE_FUNCS): Add strrchr and strtol.
3892 * lib/strrchr.c: New.
3893 * lib/strtol.c: New, from the Coreutils 4.5.1.
3894
ae64af35
AD
38952002-09-27 Akim Demaille <akim@epita.fr>
3896
3897 Playing with Autoscan.
3898
3899 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
3900 * lib/Makefile.am (libbison_a_SOURCES): No longer include
3901 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
3902 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
3903 Coreutils 4.5.1.
3904
d1a1114f
AD
39052002-09-24 Akim Demaille <akim@epita.fr>
3906
3907 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
3908 (Frequently Asked Questions, Parser Stack Overflow): New.
3909
b906441c
AD
39102002-09-13 Akim Demaille <akim@epita.fr>
3911
3912 Playing with autoscan.
3913
3914 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
3915 * src/files.c (skeleton_find): Remove, unused.
3916 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
3917 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
3918
bd701811
AD
39192002-09-13 Akim Demaille <akim@epita.fr>
3920
3921 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
3922 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
3923
e0a13e7b
AD
39242002-09-13 Akim Demaille <akim@epita.fr>
3925
3926 * configure.ac: Require 2.54.
3927 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
3928 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
3929 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
3930 Remove, provided by Autoconf macros.
3931
c97011bf
AD
39322002-09-12 Akim Demaille <akim@epita.fr>
3933
3934 * m4/prereq.m4: Update, from Coreutils 4.5.1.
3935
d862b1be
AD
39362002-09-12 Akim Demaille <akim@epita.fr>
3937
3938 * m4/prereq.m4: Update, from Fileutils 4.1.5.
3939 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
3940 Reported by Martin Mokrejs.
3941
3d38c03a
AD
39422002-09-10 Akim Demaille <akim@epita.fr>
3943
3944 * src/parse-gram.y: Associate a human readable string to each
3945 token type.
3946 * tests/regression.at (Invalid inputs): Adjust.
3947
b6347355
AD
39482002-09-10 Gary V. Vaughan <gary@gnu.org>
3949
3950 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
3951 with an Autoconf-2.5x style configure.ac.
3952
09ba4ab2
PE
39532002-09-06 Paul Eggert <eggert@twinsun.com>
3954
3955 * doc/bison.texinfo (Conditions): Make explicit that the GPL
3956 exception applies only to yacc.c. This is a modification of a
3957 patch originally suggested by Akim Demaille.
3958
21846f69
AD
39592002-09-06 Akim Demaille <akim@epita.fr>
3960
09ba4ab2
PE
3961 * data/c.m4 (b4_copyright): Move the GPL exception comment from
3962 here to...
3963 * data/yacc.c: here.
3964
21846f69
AD
3965 * data/lalr1.cc (struct yyltype): Don't define it, since we use
3966 LocationType.
3967 (b4_ltype): Default to yy::Location from location.hh.
3968
c0ad8bf3
AD
39692002-09-04 Jim Meyering <jim@meyering.net>
3970
3971 * data/yacc.c: Guard the declaration of yytoknum also with
3972 `#ifdef YYPRINT', so it is declared only when used.
3973
3a93251e
AD
39742002-09-04 Akim Demaille <akim@epita.fr>
3975
3976 * configure.in: Rename as...
3977 * configure.ac: this.
3978 Bump to 1.49c.
3979
427c0dda
AD
39802002-09-04 Akim Demaille <akim@epita.fr>
3981
3982 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
3983 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
3984 translate maintainer only messages.
3985
6a254321
PE
39862002-08-12 Paul Eggert <eggert@twinsun.com>
3987
645e30d1
PE
3988 Version 1.49b.
3989
6a254321
PE
3990 * Makefile.am (SUBDIRS): Remove intl.
3991 (DISTCLEANFILES): Remove.
3992 * NEWS: Mention that GNU M4 is now required. Clarify what is
3993 meant by "larger grammars". Mention the pt_BR translation.
3994 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
3995 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
3996 Bump version from 0.11.2 to 0.11.5.
3997 (BISON_PREREQ_STAGE): Remove.
3998 (AM_GNU_GETTEXT): Use external gettext.
3999 (AC_OUTPUT): Remove intl/Makefile.
4000
4001 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
4002
4003 * data/glr.c: Include string.h, for strlen.
4004 (yyreportParseError): Use size_t for yysize.
4005 (yy_yypstack): No longer nested inside yypstates, as nested
4006 functions are not portable. Do not assume size_t is the
4007 same width as int.
4008 (yypstates): Do not assume that ptrdiff_t is the same width
4009 as int, and similarly for yyposn and YYINDEX.
4010
4011 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
4012
4013 * lib/Makefile.am (INCLUDES): Do not include from the intl
4014 directory, which has been removed.
4015 * src/Makefile.am (INCLUDES): Likewise.
4016
4017 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
4018 (bitsets_sources, additional_bitsets_sources, timevars_sources):
4019 New vars.
4020
4021 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
4022 * tests/Makefile.am (EXTRA_DIST): Likewise.
4023
4024 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
4025 Do not assume that bitset_windex is the same width as unsigned.
4026
4027 * lib/abitset.c (abitset_unused_clear): Do not assume that
4028 bitset_word is the same width as int.
4029 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
4030 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
4031 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
4032 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
4033 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
4034
4035 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
4036 portability to one's complement hosts!).
4037 * lib/ebitset.c (ebitset_op1): Likewise.
4038 * lib/lbitset.c (lbitset_op1): Likewise.
4039
4040 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
4041 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
4042 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
4043 Sync with fileutils.
4044 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
4045 lib/gettext.h: Sync with diffutils.
4046
4047 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
4048 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
4049
4050 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
4051 PROTOTYPES to check for prototypes, and "defined __STDC__" to
4052 check for void *.
4053
4054 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
4055 size_t; the old version tried to do this but casted improperly.
4056 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
4057 (bitset_test): Now returns int, not unsigned long.
4058
4059 * lib/bitset_stats.c: Include "gettext.h".
4060 (_): New macro.
4061 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
4062 name locals "index", as it generates unnecessary warnings on some
4063 hosts that have an "index" function.
4064
4065 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
4066 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
4067 they need translation.
4068 * src/LR0.c (state_list_append, new_itemsets, get_state,
4069 append_states, generate_states): Likewise.
4070 * src/assoc.c (assoc_to_string): Likewise.
4071 * src/closure.c (print_closure, set_firsts, closure): Likewise.
4072 * src/gram.c (grammar_dump): Likewise.
4073 * src/injections.c (injections_compute): Likewise.
4074 * src/lalr.c (lookaheads_print): Likewise.
4075 * src/relation.c (relation_transpose): Likewise.
4076 * src/scan-gram.l: Likewise.
4077 * src/tables.c (table_grow, pack_vector): Likewise.
4078
4079 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
4080 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
4081 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
4082 * m4/mbstate_t.m4: Sync with fileutils.
4083 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
4084
4085 * po/LINGUAS: Add pt_BR.
4086 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
4087 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
4088 lib/timevar.c.
4089 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
4090 manual recommends.
4091 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
4092
4093 * src/complain.c (strerror_r): Remove decl; not needed.
4094 (strerror): Use same pattern as ../lib/error.c.
4095
4096 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
4097
4098 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
4099
4100 * src/main.c (main): Cast result of bindtextdomain and textdomain
4101 to void, to avoid a GCC warning when --disable-nls is in effect.
4102
4103 * src/scan-gram.l: Use strings rather than escapes when possible,
4104 to minimize the number of warnings from xgettext.
4105 (handle_action_dollar, handle_action_at): Don't use isdigit,
4106 as it mishandles negative chars and it may not work as expected
4107 outside the C locale.
4108
4109 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
4110 this is a GCC extension and is not portable to other compilers.
4111
4112 * src/system.h (alloca): Use same pattern as ../lib/error.c.
4113 Do not include <ctype.h>; no longer needed.
4114 Do not include <malloc.h>; no longer needed (and generates
4115 warnings on OpenBSD 3.0).
4116
4117 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
4118 it's not portable.
4119
4120 * tests/regression.at: Do not use 'cc -c input.c -o input';
4121 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
4122
4123 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
4124 exit status as failure, not just exit status 1. Sun C exits
4125 with status 2 sometimes.
4126
4127 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
4128 Use it for the two large tests.
4129
c8f002c7
AD
41302002-08-02 Akim Demaille <akim@epita.fr>
4131
4132 * src/conflicts.c (conflicts_output): Don't output rules never
4133 reduced here, since anyway that computation doesn't work.
4134 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
4135 (rule_useless_p, rule_never_reduced_p): New.
4136 (grammar_rules_partial_print): Use a filter instead of a range.
4137 Display the title only if needed.
4138 (grammar_rules_print): Adjust.
4139 (grammar_rules_never_reduced_report): New.
4140 * src/tables.c (action_row): Move the computation of rules never
4141 reduced to...
4142 (token_actions): here.
4143 * src/main.c (main): Make the parser before making the report, so
4144 that rules never reduced are computed.
4145 Call grammar_rules_never_reduced_report.
4146 * src/print.c (print_results): Report rules never reduced.
4147 * tests/conflicts.at, tests/reduce.at: Adjust.
4148
cd08e51e
AD
41492002-08-01 Akim Demaille <akim@epita.fr>
4150
4151 Instead of attaching lookaheads and duplicating the rules being
4152 reduced by a state, attach the lookaheads to the reductions.
4153
4154 * src/state.h (state_t): Remove the `lookaheads',
4155 `lookaheads_rule' member.
4156 (reductions_t): Add a `lookaheads' member.
4157 Use a regular array for the `rules'.
4158 * src/state.c (reductions_new): Initialize the lookaheads member
4159 to 0.
4160 (state_rule_lookaheads_print): Adjust.
4161 * src/state.h, src/state.c (state_reductions_find): New.
4162 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
4163 (count_rr_conflicts): Adjust.
4164 * src/lalr.c (LArule): Remove.
4165 (add_lookback_edge): Adjust.
4166 (state_lookaheads_count): New.
4167 (states_lookaheads_initialize): Merge into...
4168 (initialize_LA): this.
4169 (lalr_free): Adjust.
4170 * src/main.c (main): Don't free nullable and derives too early: it
4171 is used by --verbose.
4172 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
4173
bb0027a9
AD
41742002-08-01 Akim Demaille <akim@epita.fr>
4175
4176 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
4177 `rule_number_t**'.
4178 (set_derives, free_derives): Rename as...
4179 (derives_compute, derives_free): this.
4180 Adjust all dependencies.
4181 * src/nullable.c (set_nullable, free_nullable): Rename as...
4182 (nullable_compute, nullable_free): these.
4183 (rule_list_t): Store rule_t *, not rule_number_t.
4184 * src/state.c (state_rule_lookaheads_print): Directly compare rule
4185 pointers, instead of their numbers.
4186 * src/main.c (main): Call nullable_free, and derives_free earlier,
4187 as they were lo longer used.
4188
3325ddc4
AD
41892002-08-01 Akim Demaille <akim@epita.fr>
4190
4191 * lib/timevar.c (get_time): Include children time.
4192 * src/lalr.h (LA, LArule): Don't export them: used with the
4193 state_t.
4194 * src/lalr.c (LA, LArule): Static.
4195 * src/lalr.h, src/lalr.c (lalr_free): New.
4196 * src/main.c (main): Call it.
4197 * src/tables.c (pack_vector): Check whether loc is >= to the
4198 table_size, not >.
4199 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
4200 (tables_generate): do it, since that's also it which allocates
4201 them.
4202 Don't free LA and LArule, main does.
4203
c6f1a33c
AD
42042002-07-31 Akim Demaille <akim@epita.fr>
4205
4206 Separate parser tables computation and output.
4207
4208 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
4209 (conflict_list, conflict_list_cnt, table, check, table_ninf)
4210 (yydefgoto, yydefact, high): Move to...
4211 * src/tables.h, src/tables.c: here.
4212 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
4213 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
4214 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
4215 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
4216 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
4217 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
4218 (action_row, save_row, token_actions, save_column, default_goto)
4219 (goto_actions, sort_actions, matching_state, pack_vector)
4220 (table_ninf_remap, pack_table, prepare_actions): Move to...
4221 * src/tables.c: here.
4222 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
4223 * src/output.c (token_actions, output_base, output_conflicts)
4224 (output_check): Merge into...
4225 (prepare_actions): this.
4226 (actions_output): Rename as...
4227 (user_actions_output): this.
4228 * src/main.c (main): Call tables_generate and tables_free.
4229
1509d42f
AD
42302002-07-31 Akim Demaille <akim@epita.fr>
4231
4232 Steal GCC's --time-report support.
4233
4234 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
4235 stolen/adjusted from GCC.
4236 * m4/stage.m4: Remove time related checks.
4237 * m4/timevar.m4: New.
4238 * configure.in: Adjust.
4239 * src/system.h: Adjust to using timevar.h.
4240 * src/getargs.h, src/getargs.c: Support trace_time for
4241 --trace=time.
4242 * src/main.c (stage): Remove.
4243 (main): Replace `stage' invocations with timevar calls.
4244 * src/output.c: Insert pertinent timevar calls.
4245
273a74fa
AD
42462002-07-31 Akim Demaille <akim@epita.fr>
4247
4248 Let --trace have arguments.
4249
4250 * src/getargs.h (enum trace_e): New.
4251 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
4252 (long_options, short_options): --trace/-T takes an optional
4253 argument.
4254 Change all the uses of trace_flag to reflect the new flags.
4255 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
4256
4257 Strengthen `stage' portability.
4258
4259 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
4260 * configure.in: Use it.
4261 Don't check for malloc.h and sys/times.h.
4262 * src/system.h: Include them when appropriate.
4263 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
4264 times and struct tms are available.
4265
217598da
AD
42662002-07-30 Akim Demaille <akim@epita.fr>
4267
4268 In verbose parse error message, don't report `error' as an
4269 expected token.
4270 * tests/actions.at (Printers and Destructors): Adjust.
4271 * tests/calc.at (Calculator $1): Adjust.
4272 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
4273 error message, do not report the parser accepts the error token in
4274 that state.
4275
52489d44
AD
42762002-07-30 Akim Demaille <akim@epita.fr>
4277
4278 Normalize conflict related messages.
4279
4280 * src/complain.h, src/complain.c (warn, complain): New.
4281 * src/conflicts.c (conflicts_print): Use them.
4282 (conflict_report_yacc): New, extracted from...
4283 (conflicts_print): here.
4284 * tests/conflicts.at, tests/existing.at: Adjust.
4285
e8832397
AD
42862002-07-30 Akim Demaille <akim@epita.fr>
4287
4288 Report rules which are never reduced by the parser: those hidden
4289 by conflicts.
4290
4291 * src/LR0.c (save_reductions): Don't make the final state too
4292 different: save its reduction (accept) instead of having a state
4293 without any action (no shift or goto, no reduce).
4294 Note: the final state is now a ``regular'' state, i.e., the
4295 parsers now contain `reduce 0' as default reduction.
4296 Nevertheless, since they decide to `accept' when yystate =
4297 final_state, they still will not reduce rule 0.
4298 * src/print.c (print_actions, print_reduction): Adjust.
4299 * src/output.c (action_row): Track reduced rules.
4300 (token_actions): Report rules never reduced.
4301 * tests/conflicts.at, tests/regression.at: Adjust.
4302
caf23d24
AD
43032002-07-30 Akim Demaille <akim@epita.fr>
4304
4305 `stage' was accidently included in a previous patch.
4306 Initiate its autoconfiscation.
4307
4308 * configure.in: Look for malloc.h and sys/times.h.
4309 * src/main.c (stage): Adjust.
4310 Report only when trace_flag.
4311
640748ee
AD
43122002-07-29 Akim Demaille <akim@epita.fr>
4313
4314 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
4315 state_number_t.
4316 (errs_t): symbol_t*, not symbol_number_t.
4317 (reductions_t): rule_t*, not rule_number_t.
4318 (FOR_EACH_SHIFT): New.
4319 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
4320 * src/print.c, src/print_graph.c: Adjust.
4321
88bce5a2
AD
43222002-07-29 Akim Demaille <akim@epita.fr>
4323
4324 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
4325
4326 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
4327 (endtoken, accept): these.
4328 * src/reader.c (reader): Set endtoken's default tag to "$end".
4329 Set undeftoken's tag to "$undefined" instead of "$undefined.".
4330 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
4331 Adjust.
4332
1bfb97db
AD
43332002-07-29 Akim Demaille <akim@epita.fr>
4334
4335 * src/reduce.c (reduce_grammar): When the language is empty,
4336 complain about the start symbol, not the axiom.
4337 Use its location.
4338 * tests/reduce.at (Empty Language): New.
4339
fc5734fe
AD
43402002-07-26 Akim Demaille <akim@epita.fr>
4341
4342 * src/reader.h, src/reader.c (gram_error): ... can't get
4343 yycontrol without making too strong assumptions on the parser
4344 itself.
4345 * src/output.c (prepare_tokens): Use the real 0th value of
4346 token_translations instead of `0'.
4347 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
4348 visible here.
4349 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
4350 for the time being: %locations ought to provide it to yyerror.
4351
3650b4b8
AD
43522002-07-25 Akim Demaille <akim@epita.fr>
4353
4354 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
4355 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
4356 * tests/regression.at (Web2c Actions): Adjust.
4357
4b3d3a8e
AD
43582002-07-25 Akim Demaille <akim@epita.fr>
4359
4360 Stop storing rules from 1 to nrules + 1.
4361
4362 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
4363 * src/nullable.c, src/output.c, src/print.c, src/reader.c
4364 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
4365 Iterate from 0 to nrules.
4366 Use rule_number_as_item_number and item_number_as_rule_number.
4367 Adjust to `derive' now containing possibly 0.
4368 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
4369 Handle the `- 1' part in rule numbers from/to item numbers.
4370 * src/conflicts.c (log_resolution): Fix the message which reversed
4371 shift and reduce.
4372 * src/output.c (action_row): Initialize default_rule to -1.
4373 (token_actions): Adjust.
4374 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
4375 expected output.
4376 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
4377
4a2a22f4
AD
43782002-07-25 Akim Demaille <akim@epita.fr>
4379
4380 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
4381 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
4382 (b4_c_knr_arg_decl): New.
4383 * data/yacc.c: Use it to define yysymprint, yydestruct, and
4384 yyreport_parse_error.
4385
b8df3223
AD
43862002-07-25 Akim Demaille <akim@epita.fr>
4387
4388 * data/yacc.c (yyreport_parse_error): New, extracted from...
4389 (yyparse): here.
4390 (yydestruct, yysymprint): Move above yyparse.
4391 Be K&R compliant.
4392
a762e609
AD
43932002-07-25 Akim Demaille <akim@epita.fr>
4394
4395 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
4396 replace...
4397 (b4_sint_type, b4_uint_type): these.
4398 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
4399 * tests/regression.at (Web2c Actions): Adjust.
4400
12b0043a
AD
44012002-07-25 Akim Demaille <akim@epita.fr>
4402
4403 * src/gram.h (TIEM_NUMBER_MAX): New.
4404 (item_number_of_rule_number, rule_number_of_item_number): Rename
4405 as...
4406 (rule_number_as_item_number, item_number_as_rule_number): these.
4407 Adjust dependencies.
4408 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
4409 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
4410 (symbol_number_to_vector_number): New.
4411 (order): Of vector_number_t* type.
4412 (base_t, BASE_MAX, BASE_MIN): New.
4413 (froms, tos, width, pos, check): Of base_t type.
4414 (action_number_t, ACTION_MIN, ACTION_MAX): New.
4415 (actrow): Of action_number_t type.
4416 (conflrow): Of unsigned int type.
4417 (table_ninf, base_ninf): New.
4418 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
4419 (muscle_insert_int_table, muscle_insert_base_table)
4420 (muscle_insert_rule_number_table): New.
4421 (prepare_tokens): Output `toknum' as int_table.
4422 (action_row): Returns a rule_number_t.
4423 Use ACTION_MIN, not SHRT_MIN.
4424 (token_actions): yydefact is rule_number_t*.
4425 (table_ninf_remap): New.
4426 (pack_table): Use it for `base' and `table'.
4427 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
4428 replaced with...
4429 (YYPACT_NINF, YYTABLE_NINF): these.
4430 (yypact, yytable): Compute their types instead of hard-coded
4431 `short'.
4432 * tests/regression.at (Web2c Actions): Adjust.
4433
5dde258a
AD
44342002-07-19 Akim Demaille <akim@epita.fr>
4435
4436 * src/scan-gram.l (id): Can start with an underscore.
4437
a945ec39
AD
44382002-07-16 Akim Demaille <akim@epita.fr>
4439
4440 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
4441 Adjust all former `associativity' dependencies.
4442 * src/symtab.c (symbol_new): Default associativity is `undef', not
4443 `right'.
4444 (symbol_check_alias_consistence): Adjust.
4445
fae437e8
AD
44462002-07-09 Akim Demaille <akim@epita.fr>
4447
4448 * doc/bison.texinfo: Properly set the ``header'' part.
4449 Use @dircategory ``GNU programming tools'' as per Texinfo's
4450 documentation.
4451 Use @copying.
4452
1a715ef2
AD
44532002-07-09 Akim Demaille <akim@epita.fr>
4454
4455 * lib/quotearg.h: Protect against multiple inclusions.
4456 * src/location.h (location_t): Add a `file' member.
4457 (LOCATION_RESET, LOCATION_PRINT): Adjust.
4458 * src/complain.c (warn_at, complain_at, fatal_at): Drop
4459 `error_one_per_line' support.
4460
a5d50994
AD
44612002-07-09 Akim Demaille <akim@epita.fr>
4462
4463 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
4464 * src/reader.c (lineno): Remove.
4465 Adjust all dependencies.
4466 (get_merge_function): Take a location and use complain_at.
4467 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
4468 * tests/regression.at (Invalid inputs, Mixing %token styles):
4469 Adjust.
4470
b275314e
AD
44712002-07-09 Akim Demaille <akim@epita.fr>
4472
4473 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
4474 recovery rule, and forbid extensions when --yacc.
4475 (gram_error): Use complain_at.
4476 * src/reader.c (reader): Exit if there were parse errors.
4477
865b9df1
AD
44782002-07-09 Akim Demaille <akim@epita.fr>
4479
4480 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
4481 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
4482 Reported by R Blake <blakers@mac.com>.
4483
c76e14da
AD
44842002-07-09 Akim Demaille <akim@epita.fr>
4485
4486 * data/yacc.c: Output the copyright notive in the header.
4487
7db2ed2d
AD
44882002-07-03 Akim Demaille <akim@epita.fr>
4489
4490 * src/output.c (froms, tos): Are state_number_t.
4491 (save_column): sp, sp1, and sp2 are state_number_t.
4492 (prepare): Rename `final' as `final_state_number', `nnts' as
4493 `nterms_number', `nrules' as `rules_number', `nstates' as
4494 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
4495 unused.
4496 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
4497 * data/lalr1.cc (nsym_): Remove, unused.
4498
e68e0410
AD
44992002-07-03 Akim Demaille <akim@epita.fr>
4500
4501 * src/lalr.h, src/lalr.c (goto_number_t): New.
4502 * src/lalr.c (goto_list_t): New.
4503 Propagate them.
4504 * src/nullable.c (rule_list_t): New.
4505 Propagate.
4506 * src/types.h: Remove.
4507
e1a4f3a4
AD
45082002-07-03 Akim Demaille <akim@epita.fr>
4509
4510 * src/closure.c (print_fderives): Use rule_rhs_print.
4511 * src/derives.c (print_derives): Use rule_rhs_print.
4512 (rule_list_t): New, replaces `shorts'.
4513 (set_derives): Add comments.
4514 * tests/sets.at (Nullable, Firsts): Adjust.
4515
536545f3
AD
45162002-07-03 Akim Demaille <akim@epita.fr>
4517
4518 * src/output.c (prepare_actions): Free `tally' and `width'.
4519 (prepare_actions): Allocate and free `order'.
4520 * src/symtab.c (symbols_free): Free `symbols'.
4521 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
4522 * src/output.c (m4_invoke): Move to...
4523 * src/scan-skel.l: here.
4524 (<<EOF>>): Close yyout, and free its name.
4525
8b752b00
AD
45262002-07-03 Akim Demaille <akim@epita.fr>
4527
4528 Fix some memory leaks, and fix a bug: state 0 was examined twice.
4529
4530 * src/LR0.c (new_state): Merge into...
4531 (state_list_append): this.
4532 (new_states): Merge into...
4533 (generate_states): here.
4534 (set_states): Don't ensure a proper `errs' state member here, do it...
4535 * src/conflicts.c (conflicts_solve): here.
4536 * src/state.h, src/state.c: Comment changes.
4537 (state_t): Rename member `shifts' as `transitions'.
4538 Adjust all dependencies.
4539 (errs_new): For consistency, also take the values as argument.
4540 (errs_dup): Remove.
4541 (state_errs_set): New.
4542 (state_reductions_set, state_transitions_set): Assert that no
4543 previous value was assigned.
4544 (state_free): New.
4545 (states_free): Use it.
4546 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
4547 temporary storage: use `errs' and `nerrs' as elsewhere.
4548 (set_conflicts): Allocate and free this `errs'.
4549
613f5e1a
AD
45502002-07-02 Akim Demaille <akim@epita.fr>
4551
4552 * lib/libiberty.h: New.
4553 * lib: Update the bitset implementation from upstream.
4554 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
4555 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
4556 * src/main.c: Adjust bitset stats calls.
4557
26e0cadc
PE
45582002-07-01 Paul Eggert <eggert@twinsun.com>
4559
4560 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
4561 char, so that negative chars don't collide with $.
4562
1154cced
AD
45632002-06-30 Akim Demaille <akim@epita.fr>
4564
4565 Have the GLR tests be `warning' checked, and fix the warnings.
4566
4567 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
4568 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
4569 (yyremoveDeletes): `yyi' and `yyj' are size_t.
4570 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
4571 (yyaddDeferredAction): static.
4572 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
4573 (yyreportParseError): yyprefix is const.
4574 yytokenp is used only when verbose.
4575 (yy__GNUC__): Replace with __GNUC__.
4576 (yypdumpstack): yyi is size_t.
4577 (yypreference): Un-yy local variables and arguments, to avoid
4578 clashes with `yyr1'. Anyway, we are not in the user name space.
4579 (yytname_size): be an int, as is compared with ints.
4580 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
4581 Use them.
4582 * tests/cxx-gram.at: Use quotation to protect $1.
4583 Use AT_COMPILE to enable warnings hunts.
4584 Prototype yylex and yyerror.
4585 `Use' argc.
4586 Include `string.h', not `strings.h'.
4587 Produce and prototype stmtMerge only when used.
4588 yylex takes a location.
4589
97650f4e
AD
45902002-06-30 Akim Demaille <akim@epita.fr>
4591
4592 We spend a lot of time in quotearg, in particular when --verbose.
4593
4594 * src/symtab.c (symbol_get): Store a quoted version of the key.
4595 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
4596 Adjust all callers.
4597
d2576365
AD
45982002-06-30 Akim Demaille <akim@epita.fr>
4599
4600 * src/state.h (reductions_t): Rename member `nreds' as num.
4601 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
4602 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
4603
ccaf65bc
AD
46042002-06-30 Akim Demaille <akim@epita.fr>
4605
4606 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
4607 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
4608 (shifts_to): Rename as...
4609 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
4610 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
4611 (TRANSITION_IS_DISABLED, transitions_to): these.
4612
87675353
AD
46132002-06-30 Akim Demaille <akim@epita.fr>
4614
4615 * src/print.c (print_shifts, print_gotos): Merge into...
4616 (print_transitions): this.
4617 (print_transitions, print_errs, print_reductions): Align the
4618 lookaheads columns.
4619 (print_core, print_transitions, print_errs, print_state,
4620 print_grammar): Output empty lines separator before, not after.
4621 (state_default_rule_compute): Rename as...
4622 (state_default_rule): this.
4623 * tests/conflicts.at (Defaulted Conflicted Reduction),
4624 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
4625 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
4626
ce4ccb4b
AD
46272002-06-30 Akim Demaille <akim@epita.fr>
4628
4629 Display items as we display rules.
4630
4631 * src/gram.h, src/gram.c (rule_lhs_print): New.
4632 * src/gram.c (grammar_rules_partial_print): Use it.
4633 * src/print.c (print_core): Likewise.
4634 * tests/conflicts.at (Defaulted Conflicted Reduction),
4635 (Unresolved SR Conflicts): Adjust.
4636 (Unresolved SR Conflicts): Adjust and rename as...
4637 (Resolved SR Conflicts): this, as was meant.
4638 * tests/regression.at (Web2c Report): Adjust.
4639
bc933ef1
AD
46402002-06-30 Akim Demaille <akim@epita.fr>
4641
4642 * src/print.c (state_default_rule_compute): New, extracted from...
4643 (print_reductions): here.
4644 Pessimize, but clarify the code.
4645 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
4646
53d4308d
AD
46472002-06-30 Akim Demaille <akim@epita.fr>
4648
4649 * src/output.c (action_row): Let default_rule be always a rule
4650 number.
4651
574fb2d5
AD
46522002-06-30 Akim Demaille <akim@epita.fr>
4653
4654 * src/closure.c (print_firsts, print_fderives, closure):
4655 Use BITSET_EXECUTE.
4656 * src/lalr.c (lookaheads_print): Likewise.
4657 * src/state.c (state_rule_lookaheads_print): Likewise.
4658 * src/print_graph.c (print_core): Likewise.
4659 * src/print.c (print_reductions): Likewise.
4660 * src/output.c (action_row): Likewise.
4661 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
4662
05811fd7
AD
46632002-06-30 Akim Demaille <akim@epita.fr>
4664
4665 * src/print_graph.c: Use report_flag.
4666
0e4d5753
AD
46672002-06-30 Akim Demaille <akim@epita.fr>
4668
4669 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
4670 to...
4671 * src/relation.h, src/relation.c (traverse, relation_digraph)
4672 (relation_print, relation_transpose): New.
4673
24c7d800
AD
46742002-06-30 Akim Demaille <akim@epita.fr>
4675
4676 * src/state.h, src/state.c (shifts_to): New.
4677 * src/lalr.c (build_relations): Use it.
4678
9222837b
AD
46792002-06-30 Akim Demaille <akim@epita.fr>
4680
4681 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
4682 (item_number_of_rule_number, rule_number_of_item_number): New.
4683 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
4684 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
4685 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
4686 Propagate their use.
4687 Much remains to be done, in particular wrt `shorts' from types.h.
4688
260008e5
AD
46892002-06-30 Akim Demaille <akim@epita.fr>
4690
4691 * src/symtab.c (symbol_new): Initialize the `printer' member.
4692
8a731ca8
AD
46932002-06-30 Akim Demaille <akim@epita.fr>
4694
4695 * src/LR0.c (save_reductions): Remove, replaced by...
4696 * src/state.h, src/state.c (state_reductions_set): New.
4697 (reductions, errs): Rename as...
4698 (reductions_t, errs_t): these.
4699 Adjust all dependencies.
4700
32e1e0a4
AD
47012002-06-30 Akim Demaille <akim@epita.fr>
4702
4703 * src/LR0.c (state_list_t, state_list_append): New.
4704 (first_state, last_state): Now symbol_list_t.
4705 (this_state): Remove.
4706 (new_itemsets, append_states, save_reductions): Take a state_t as
4707 argument.
4708 (set_states, generate_states): Adjust.
4709 (save_shifts): Remove, replaced by...
4710 * src/state.h, src/state.c (state_shifts_set): New.
4711 (shifts): Rename as...
4712 (shifts_t): this.
4713 Adjust all dependencies.
4714 * src/state.h (state_t): Remove the `next' member.
4715
e5fb6710
AD
47162002-06-30 Akim Demaille <akim@epita.fr>
4717
4718 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
4719 escaped in slot 0.
4720
c7ca99d4
AD
47212002-06-30 Akim Demaille <akim@epita.fr>
4722
4723 Use hash.h for the state hash table.
4724
4725 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
4726 (allocate_storage): Use state_hash_new.
4727 (free_storage): Use state_hash_free.
4728 (new_state, get_state): Adjust.
4729 * src/lalr.h, src/lalr.c (states): Move to...
4730 * src/states.h (state_t): Remove the `link' member, no longer
4731 used.
4732 * src/states.h, src/states.c: here.
4733 (state_hash_new, state_hash_free, state_hash_lookup)
4734 (state_hash_insert, states_free): New.
4735 * src/states.c (state_table, state_compare, state_hash): New.
4736 * src/output.c (output_actions): Do not free states now, since we
4737 still need to know the final_state number in `prepare', called
4738 afterwards. Do it...
4739 * src/main.c (main): here: call states_free after `output'.
4740
df0e7316
AD
47412002-06-30 Akim Demaille <akim@epita.fr>
4742
4743 * src/state.h, src/state.c (state_new): New, extracted from...
4744 * src/LR0.c (new_state): here.
4745 * src/state.h (STATE_ALLOC): Move to...
4746 * src/state.c: here.
4747 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
4748 * src/state.h, src/state.c: here.
4749
39f41916
AD
47502002-06-30 Akim Demaille <akim@epita.fr>
4751
4752 * src/reader.c (gensym): Rename as...
4753 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
4754 (getsym): Rename as...
4755 (symbol_get): this.
4756
d57650a5
AD
47572002-06-30 Akim Demaille <akim@epita.fr>
4758
4759 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
4760 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
4761 * src/output.c, src/print.c, src/print_graph.c: Propagate.
4762 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
4763
5a08f1ce
AD
47642002-06-30 Akim Demaille <akim@epita.fr>
4765
4766 Make the test suite pass with warnings checked.
4767
4768 * tests/actions.at (Printers and Destructors): Improve.
4769 Avoid unsigned vs. signed issues.
4770 * tests/calc.at: Don't exercise the scanner here, do it...
4771 * tests/input.at (Torturing the Scanner): here.
4772
720623af
PH
47732002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4774
88e7e941 4775 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
4776 reorganize first lines parallel to yacc.c.
4777
fb8135fa
AD
47782002-06-28 Akim Demaille <akim@epita.fr>
4779
4780 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
4781 (b4_token_enum, b4_token_defines): New, factored from...
4782 * data/lalr1.cc, data/yacc.c, glr.c: here.
4783
41442480
AD
47842002-06-28 Akim Demaille <akim@epita.fr>
4785
4786 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
4787 unused variables.
4788 * src/output.c (merger_output): static.
4789
e0e5bf84
AD
47902002-06-28 Akim Demaille <akim@epita.fr>
4791
4792 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
4793 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
4794 pacify GCC.
4795 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 4796
676385e2
PH
47972002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4798
4799 Accumulated changelog for new GLR parsing features.
4800
6a254321 4801 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
4802 conflicts_total_count.
4803 * src/conflicts.h: Ditto.
4804 * src/output.c (token_actions): Use the new name.
4805 (output_conflicts): Change conflp => conflict_list_heads, and
4806 confl => conflict_list for better readability.
4807 * data/glr.c: Use the new names.
4808 * NEWS: Add self to GLR announcement.
e0e5bf84 4809
676385e2
PH
4810 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
4811
4812 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
4813 Akim Demaille.
4814
4815 * data/bison.glr: Change name to glr.c
4816 * data/glr.c: Renamed from bison.glr.
4817 * data/Makefile.am: Add glr.c
e0e5bf84
AD
4818
4819 * src/getargs.c:
4820
676385e2
PH
4821 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
4822 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 4823
676385e2
PH
4824 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4825
4826 * data/bison.glr: Be sure to restore the
4827 current #line when returning to the skeleton contents after having
4828 exposed the input file's #line.
4829
4830 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4831
4832 * data/bison.glr: Bring up to date with changes to bison.simple.
4833
4834 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4835
4836 * data/bison.glr: Correct definitions that use b4_prefix.
4837 Various reformatting.
4838 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
4839 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
4840 yytokenp argument; now part of stack.
4841 (yychar): Define to behave as documented.
4842 (yyclearin): Ditto.
e0e5bf84 4843
676385e2
PH
4844 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4845
4846 * src/reader.h: Add declaration for free_merger_functions.
4847
4848 * src/reader.c (merge_functions): New variable.
4849 (get_merge_function): New function.
4850 (free_merger_functions): New function.
4851 (readgram): Check for %prec that is not followed by a symbol.
4852 Handle %dprec and %merge declarations.
4853 (packgram): Initialize dprec and merger fields in rules array.
4854
4855 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
4856 conflict_list_cnt, conflict_list_free): New variables.
4857 (table_grow): Also grow conflict_table.
e0e5bf84 4858 (prepare_rules): Output dprec and merger tables.
676385e2 4859 (conflict_row): New function.
e0e5bf84 4860 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
4861 default reduction in conflicted states for GLR parser so that there
4862 are spaces for the conflict lists.
4863 (save_row): Also save conflict information.
4864 (token_actions): Allocate conflict list.
4865 (merger_output): New function.
4866 (pack_vector): Pack conflict table, too.
4867 (output_conflicts): New function to output yyconflp and yyconfl.
4868 (output_check): Allocate conflict_tos.
4869 (output_actions): Output conflict tables, also.
4870 (output_skeleton): Output b4_mergers definition.
4871 (prepare): Output b4_max_rhs_length definition.
4872 Use 'bison.glr' as default skeleton for GLR parsers.
4873
4874 * src/gram.c (glr_parser): New flag.
4875 (grammar_free): Call free_merger_functions.
4876
4877 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
4878 all pairs of conflicting reductions, rather than just all tokens
4879 causing conflicts. Needed to size conflict tables.
e0e5bf84 4880 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
4881 interface.
4882 (conflicts_print): Ditto.
4883 (count_total_conflicts): New function.
4884
4885 * src/reader.h (merger_list): New type.
4886 (merge_functions): New variable.
4887
4888 * src/lex.h (tok_dprec, tok_merge): New token types.
4889
4890 * src/gram.h (rule_s): Add dprec and merger fields.
4891 (glr_parser): New flag.
4892
4893 * src/conflicts.h (count_total_conflicts): New function.
4894
4895 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
4896
4897 * doc/bison.texinfo (Generalized LR Parsing): New section.
4898 (GLR Parsers): New section.
4899 (Language and Grammar): Mention GLR parsing.
4900 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
4901 Correct typo ("tge" -> "the").
4902
4903 * data/bison.glr: New skeleton for GLR parsing.
4904
4905 * tests/cxx-gram.at: New tests for GLR parsing.
4906
4907 * tests/testsuite.at: Include cxx-gram.at.
4908
4909 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 4910
676385e2
PH
4911 * src/parse-gram.y:
4912
4913 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
4914
4915 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 4916
b5480d74 49172002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
4918
4919 * src/options.h, src/options.c: Remove.
4920 * src/getargs.c (short_options, long_options): New.
4921
60491a94
AD
49222002-06-27 Akim Demaille <akim@epita.fr>
4923
4924 * data/bison.simple, data/bison.c++: Rename as...
4925 * data/yacc.c, data/lalr1.cc: these.
4926 * doc/bison.texinfo (Environment Variables): Remove.
4927
9be0c25b
AD
49282002-06-25 Raja R Harinath <harinath@cs.umn.edu>
4929
4930 * src/getargs.c (report_argmatch): Initialize strtok().
4931
1ae72863
AD
49322002-06-20 Akim Demaille <akim@epita.fr>
4933
4934 * data/bison.simple (b4_symbol_actions): New, replaces...
4935 (b4_symbol_destructor, b4_symbol_printer): these.
4936 (yysymprint): Be sure to call YYPRINT only for tokens, and using
4937 user token numbers.
4938
87542d29
AD
49392002-06-20 Akim Demaille <akim@epita.fr>
4940
4941 * data/bison.simple (yydestructor): Rename as...
4942 (yydestruct): this.
4943
1a31ed21
AD
49442002-06-20 Akim Demaille <akim@epita.fr>
4945
4946 * src/symtab.h, src/symtab.c (symbol_type_set)
4947 (symbol_destructor_set, symbol_precedence_set): The location is
4948 the last argument.
4949 Adjust all callers.
4950
e776192e
AD
49512002-06-20 Akim Demaille <akim@epita.fr>
4952
4953 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
4954 internals.
4955 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
4956 Takes a location.
4957 * src/symtab.h, src/symtab.c (symbol_class_set)
4958 (symbol_user_token_number_set): Likewise.
4959 Adjust all callers.
4960 Promote complain_at.
4961 * tests/input.at (Type Clashes): Adjust.
4962
5c1180b3
AD
49632002-06-20 Akim Demaille <akim@epita.fr>
4964
4965 * data/bison.simple (YYLEX): Fix the declaration when
4966 %pure-parser.
4967
e3170060
AD
49682002-06-20 Akim Demaille <akim@epita.fr>
4969
4970 * data/bison.simple (yysymprint): Don't print the token number,
4971 just its name.
4972 * tests/actions.at (Destructors): Rename as...
4973 (Printers and Destructors): this.
4974 Also exercise %printer.
4975
253862fd
AD
49762002-06-20 Akim Demaille <akim@epita.fr>
4977
4978 * data/bison.simple (YYDSYMPRINT): New.
4979 Use it to remove many of the #if YYDEBUG/if (yydebug).
4980
366eea36
AD
49812002-06-20 Akim Demaille <akim@epita.fr>
4982
4983 * src/symtab.h, src/symtab.c (symbol_t): printer and
4984 printer_location are new members.
4985 (symbol_printer_set): New.
4986 * src/parse-gram.y (PERCENT_PRINTER): New token.
4987 Handle its associated rule.
4988 * src/scan-gram.l: Adjust.
4989 (handle_destructor_at, handle_destructor_dollar): Rename as...
4990 (handle_symbol_code_at, handle_symbol_code_dollar): these.
4991 * src/output.c (symbol_printers_output): New.
4992 (output_skeleton): Call it.
4993 * data/bison.simple (yysymprint): New. Cannot be named yyprint
4994 since there are already many grammar files with a user `yyprint'.
4995 Replace the calls to YYPRINT to calls to yysymprint.
4996 * tests/calc.at: Adjust.
4997 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
4998 taking advantage of parser very internal details (stack size!).
4999
4f25ebb0
AD
50002002-06-20 Akim Demaille <akim@epita.fr>
5001
5002 * src/scan-gram.l: Complete the scanner with the missing patterns
5003 to pacify Flex.
5004 Use `quote' and `symbol_tag_get' where appropriate.
5005
93b68a0e
AD
50062002-06-19 Akim Demaille <akim@epita.fr>
5007
5008 * tests/actions.at (Destructors): Augment to test locations.
5009 * data/bison.simple (yydestructor): Pass it the current location
5010 if locations are enabled.
5011 Prototype only when __STDC__ or C++.
5012 Change the argument names to move into the yy name space: there is
5013 user code here.
5014
58612f1d
AD
50152002-06-19 Akim Demaille <akim@epita.fr>
5016
74310291
AD
5017 * data/bison.simple (b4_pure_if): New.
5018 Use it instead of #ifdef YYPURE.
5019
50202002-06-19 Akim Demaille <akim@epita.fr>
5021
5022 * data/bison.simple (b4_location_if): New.
58612f1d
AD
5023 Use it instead of #ifdef YYLSP_NEEDED.
5024
f25bfb75
AD
50252002-06-19 Akim Demaille <akim@epita.fr>
5026
5027 Prepare @$ in %destructor, but currently don't bind it in the
5028 skeleton, as %location use is not cleaned up yet.
5029
5030 * src/scan-gram.l (handle_dollar, handle_destructor_at)
5031 (handle_action_at): New.
5032 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
5033 a braced_code_t and a location as additional arguments.
5034 (handle_destructor_dollar): Instead of requiring `b4_eval', just
5035 unquote one when outputting `b4_dollar_dollar'.
5036 Adjust callers.
5037 * data/bison.simple (b4_eval): Remove.
5038 (b4_symbol_destructor): Adjust.
5039 * tests/input.at (Invalid @n): Adjust.
5040
c732d2c6
AD
50412002-06-19 Zack Weinberg <zack@codesourcery.com>
5042
5043 * doc/bison.texinfo: Document ability to have multiple
5044 prologue sections.
5045
8c165d89
AD
50462002-06-18 Akim Demaille <akim@epita.fr>
5047
5048 * src/files.c (compute_base_names): When computing the output file
5049 names from the input file name, strip the directory part.
5050
ca98bf57
AD
50512002-06-18 Akim Demaille <akim@epita.fr>
5052
5053 * data/bison.simple.new: Comment changes.
5054 Reported by Andreas Schwab.
5055
0bfb02ff
AD
50562002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
5057
5058 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
5059 there are no `label `yyoverflowlab' defined but not used' warnings
5060 when yyoverflow is defined.
5061
24c0aad7
AD
50622002-06-18 Akim Demaille <akim@epita.fr>
5063
5064 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
5065 new member.
5066 (symbol_destructor_set): Adjust.
5067 * src/output.c (symbol_destructors_output): Output the destructor
5068 locations.
5069 Output the symbol name.
5070 * data/bison.simple (b4_symbol_destructor): Adjust.
5071
5719c109
AD
50722002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
5073 and Akim Demaille <akim@epita.fr>
5074
5075 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
5076 what's left on the stack when the error recovery hits EOF.
5077 * tests/actions.at (Destructors): Complete to exercise this case.
5078
9280d3ef
AD
50792002-06-17 Akim Demaille <akim@epita.fr>
5080
5081 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
5082 arguments is really empty, not only equal to `[]'.
5083 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
5084 member.
5085 (symbol_destructor_set): New.
5086 * src/output.c (symbol_destructors_output): New.
5087 * src/reader.h (brace_code_t, current_braced_code): New.
5088 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
5089 (handle_dollar): Rename as...
5090 (handle_action_dollar): this.
5091 (handle_destructor_dollar): New.
5092 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
5093 (grammar_declaration): Use it.
5094 * data/bison.simple (yystos): Is always defined.
5095 (yydestructor): New.
5096 * tests/actions.at (Destructors): New.
5097 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
5098
dafdc66f
AD
50992002-06-17 Akim Demaille <akim@epita.fr>
5100
5101 * src/symlist.h, src/symlist.c (symbol_list_length): New.
5102 * src/scan-gram.l (handle_dollar, handle_at): Compute the
5103 rule_length only when needed.
5104 * src/output.c (actions_output, token_definitions_output): Output
5105 the full M4 block.
5106 * src/symtab.c: Don't access directly to the symbol tag, use
5107 symbol_tag_get.
5108 * src/parse-gram.y: Use symbol_list_free.
5109
56c47203
AD
51102002-06-17 Akim Demaille <akim@epita.fr>
5111
5112 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
5113 (symbol_list_prepend, get_type_name): Move to...
5114 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
5115 (symbol_list_prepend, symbol_list_n_type_name_get): here.
5116 Adjust all callers.
5117 (symbol_list_free): New.
5118 * src/scan-gram.l (handle_dollar): Takes a location.
5119 * tests/input.at (Invalid $n): Adjust.
5120
1e0bab92
AD
51212002-06-17 Akim Demaille <akim@epita.fr>
5122
5123 * src/reader.h, src/reader.c (symbol_list_new): Export it.
5124 (symbol_list_prepend): New.
5125 * src/parse-gram.y (%union): `list' is a new member.
5126 (symbols.1): New, replaces...
5127 (terms_to_prec.1, nterms_to_type.1): these.
5128 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
5129 Take a location as additional argument.
5130 Adjust all callers.
5131
04e60654
AD
51322002-06-15 Akim Demaille <akim@epita.fr>
5133
5134 * src/parse-gram.y: Move %token in the declaration section so that
5135 we don't depend upon CVS Bison.
5136
10e5b8bd
AD
51372002-06-15 Akim Demaille <akim@epita.fr>
5138
5139 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
5140 * src/print.c (print_core): Use it.
5141
9801d40c
AD
51422002-06-15 Akim Demaille <akim@epita.fr>
5143
5144 * src/conflicts.c (log_resolution): Accept the rule involved in
5145 the sr conflicts instead of the lookahead number that points to
5146 that rule.
5147 (flush_reduce): Accept the current lookahead vector as argument,
5148 instead of the index in LA.
5149 (resolve_sr_conflict): Accept the current number of lookahead
5150 bitset to consider for the STATE, instead of the index in LA.
5151 (set_conflicts): Adjust.
5152 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
5153
c0263492
AD
51542002-06-15 Akim Demaille <akim@epita.fr>
5155
5156 * src/state.h (state_t): Replace the `lookaheadsp' member, a
5157 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
5158 Adjust all dependencies.
5159 * src/lalr.c (initialize_lookaheads): Split into...
5160 (states_lookaheads_count, states_lookaheads_initialize): these.
5161 (lalr): Adjust.
5162
9757c359
AD
51632002-06-15 Akim Demaille <akim@epita.fr>
5164
5165 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
5166 out of...
5167 (grammar_rules_print): here.
5168 * src/reduce.c (reduce_output): Use it.
5169 * tests/reduce.at (Useless Rules, Reduced Automaton)
5170 (Underivable Rules): Adjust.
5171
6b98e4b5
AD
51722002-06-15 Akim Demaille <akim@epita.fr>
5173
5174 Copy BYacc's nice way to report the grammar.
5175
5176 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
5177 New.
5178 Don't print the rules' location, it is confusing and useless.
5179 (rule_print): Use grammar_rhs_print.
5180 * src/print.c (print_grammar): Use grammar_rules_print.
5181
6b98e4b5
AD
51822002-06-15 Akim Demaille <akim@epita.fr>
5183
5184 Complete and rationalize `useless thing' warnings.
5185
5186 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
5187 (symbol_tag_print): New.
5188 Use them everywhere in place of accessing directly the tag member.
5189 * src/gram.h, src/gram.c (rule_print): New.
5190 Use it where a rule used to be printed `by hand'.
5191 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
5192 (reduce_grammar_tables): Report the useless rules.
5193 (reduce_print): Useless things are a warning, not an error.
5194 Report it as such.
5195 * tests/reduce.at (Useless Nonterminals, Useless Rules):
5196 (Reduced Automaton, Underivable Rules): Adjust.
5197 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
5198 * tests/conflicts.at (Unresolved SR Conflicts)
5199 (Solved SR Conflicts): Adjust.
5200
ee000ba4
AD
52012002-06-15 Akim Demaille <akim@epita.fr>
5202
5203 Let symbols have a location.
5204
5205 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
5206 (getsym): Adjust.
5207 Adjust all callers.
5208 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
5209 Use location_t, not int.
5210 * src/symtab.c (symbol_check_defined): Take advantage of the
5211 location.
5212 * tests/regression.at (Invalid inputs): Adjust.
5213
8efe435c
AD
52142002-06-15 Akim Demaille <akim@epita.fr>
5215
5216 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
5217 (input): Don't try to initialize yylloc here, do it in the
5218 scanner.
5219 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
5220 * src/gram.h (rule_t): Change line and action_line into location
5221 and action_location, of location_t type.
5222 Adjust all dependencies.
5223 * src/location.h, src/location.c (empty_location): New.
5224 * src/reader.h, src/reader.c (grammar_start_symbol_set)
5225 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
5226 (grammar_current_rule_symbol_append)
5227 (grammar_current_rule_action_append): Expect a location as argument.
5228 * src/reader.c (grammar_midrule_action): Adjust to attach an
5229 action's location as dummy symbol location.
5230 * src/symtab.h, src/symtab.c (startsymbol_location): New.
5231 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
5232 the line numbers.
5233
1921f1d7
AD
52342002-06-14 Akim Demaille <akim@epita.fr>
5235
5236 Grammar declarations may be found in the grammar section.
5237
5238 * src/parse-gram.y (rules_or_grammar_declaration): New.
5239 (declarations): Each declaration may end with a semicolon, not
5240 just...
5241 (grammar_declaration): `"%union"'.
5242 (grammar): Branch to rules_or_grammar_declaration.
5243
4515534c
AD
52442002-06-14 Akim Demaille <akim@epita.fr>
5245
5246 * src/main.c (main): Invoke scanner_free.
5247
f958596b
AD
52482002-06-14 Akim Demaille <akim@epita.fr>
5249
5250 * src/output.c (m4_invoke): Extracted from...
5251 (output_skeleton): here.
5252 Free tempfile.
5253
2c569025
AD
52542002-06-14 Akim Demaille <akim@epita.fr>
5255
5256 * src/parse-gram.y (directives, directive, gram)
5257 (grammar_directives, precedence_directives, precedence_directive):
5258 Rename as...
5259 (declarations, declaration, grammar, grammar_declaration)
5260 (precedence_declaration, precedence_declarator): these.
5261 (symbol_declaration): New.
5262
592e8d4d
AD
52632002-06-14 Akim Demaille <akim@epita.fr>
5264
5265 * src/files.c (action_obstack): Remove, unused.
5266 (output_obstack): Remove it, and all its dependencies, as it is no
5267 longer needed.
5268 * src/reader.c (epilogue_set): Build the epilogue in the
5269 muscle_obstack.
5270 * src/output.h, src/output.c (muscle_obstack): Move to...
5271 * src/muscle_tab.h, src/muscle_tab.h: here.
5272 (muscle_init): Initialize muscle_obstack.
5273 (muscle_free): New.
5274 * src/main.c (main): Call it.
5275
0c15323d
AD
52762002-06-14 Akim Demaille <akim@epita.fr>
5277
5278 * src/location.h: New, extracted from...
5279 * src/reader.h: here.
5280 * src/Makefile.am (noinst_HEADERS): Merge into
5281 (bison_SOURCES): this.
5282 Add location.h.
5283 * src/parse-gram.y: Use location_t instead of Bison's.
5284 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
5285 Use location_t instead of ints.
5286
e96c9728
AD
52872002-06-14 Akim Demaille <akim@epita.fr>
5288
5289 * data/bison.simple, data/bison.c++: Be sure to restore the
5290 current #line when returning to the skeleton contents after having
5291 exposed the input file's #line.
5292
75d1fe16
AD
52932002-06-12 Akim Demaille <akim@epita.fr>
5294
5295 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
5296 eager.
5297 * tests/actions.at (Exotic Dollars): New.
5298
6c35d22c
AD
52992002-06-12 Akim Demaille <akim@epita.fr>
5300
5301 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
5302 ['"/] too eagerly.
5303 * tests/input.at (Torturing the Scanner): New.
5304
1d6412ad
AD
53052002-06-11 Akim Demaille <akim@epita.fr>
5306
5307 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
5308 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
5309 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
5310 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
5311 * src/reader.c (reader): Use it.
5312
4cdb01db
AD
53132002-06-11 Akim Demaille <akim@epita.fr>
5314
5315 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
5316 Adjust all callers.
5317 (scanner_last_string_free): New.
5318
44995b2e
AD
53192002-06-11 Akim Demaille <akim@epita.fr>
5320
5321 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
5322 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
5323 (last_string, YY_OBS_FREE): New.
5324 Use them when returning an ID.
5325
e9955c83
AD
53262002-06-11 Akim Demaille <akim@epita.fr>
5327
5328 Have Bison grammars parsed by a Bison grammar.
5329
5330 * src/reader.c, src/reader.h (prologue_augment): New.
5331 * src/reader.c (copy_definition): Remove.
5332
5333 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
5334 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
5335 (grammar_current_rule_prec_set, grammar_current_rule_check)
5336 (grammar_current_rule_symbol_append)
5337 (grammar_current_rule_action_append): Export.
5338 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
5339 (symbol_list_action_append): Remove.
5340 Hook the routines from reader.
5341 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
5342 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
5343
5344 * src/reader.c (read_declarations): Remove, unused.
5345
5346 * src/parse-gram.y: Handle the epilogue.
5347 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
5348 (grammar_start_symbol_set): this.
5349 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
5350 * src/reader.c (readgram): Remove, unused.
5351 (reader): Adjust to insert eoftoken and axiom where appropriate.
5352
5353 * src/reader.c (copy_dollar): Replace with...
5354 * src/scan-gram.h (handle_dollar): this.
5355 * src/parse-gram.y: Remove `%thong'.
5356
5357 * src/reader.c (copy_at): Replace with...
5358 * src/scan-gram.h (handle_at): this.
5359
5360 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
5361 New.
5362
5363 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
5364 time being.
5365
5366 * src/reader.h, src/reader.c (grammar_rule_end): New.
5367
5368 * src/parse.y (current_type, current_class): New.
5369 Implement `%nterm', `%token' support.
5370 Merge `%term' into `%token'.
5371 (string_as_id): New.
5372 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
5373 type name.
5374
5375 * src/parse-gram.y: Be sure to handle properly the beginning of
5376 rules.
5377
5378 * src/parse-gram.y: Handle %type.
5379 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
5380
5381 * src/parse-gram.y: More directives support.
5382 * src/options.c: No longer handle source directives.
5383
5384 * src/parse-gram.y: Fix %output.
5385
5386 * src/parse-gram.y: Handle %union.
5387 Use the prologue locations.
5388 * src/reader.c (parse_union_decl): Remove.
5389
5390 * src/reader.h, src/reader.c (epilogue_set): New.
5391 * src/parse-gram.y: Use it.
5392
5393 * data/bison.simple, data/bison.c++: b4_stype is now either not
5394 defined, then default to int, or to the contents of %union,
5395 without `union' itself.
5396 Adjust.
5397 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
5398
5399 * src/output.c (actions_output): Don't output braces, as they are
5400 already handled by the scanner.
5401
5402 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
5403 characters to themselves.
5404
5405 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
5406 that the epilogue has a proper #line.
5407
5408 * src/parse-gram.y: Handle precedence/associativity.
5409
5410 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
5411 a terminal.
5412 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
5413 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
5414 at all to define terminals that cannot be emitted.
5415
5416 * src/scan-gram.l: Escape M4 characters.
5417
5418 * src/scan-gram.l: Working properly with escapes in user
5419 strings/characters.
5420
5421 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
5422 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
5423 grammar.
5424 Use more modest sizes, as for the time being the parser does not
5425 release memory, and therefore the process swallows a huge amount
5426 of memory.
5427
5428 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
5429 stricter %token grammar.
5430
5431 * src/symtab.h (associativity): Add `undef_assoc'.
5432 (symbol_precedence_set): Do nothing when passed an undef_assoc.
5433 * src/symtab.c (symbol_check_alias_consistence): Adjust.
5434
5435 * tests/regression.at (Invalid %directive): Remove, as it is now
5436 meaningless.
5437 (Invalid inputs): Adjust to the new error messages.
5438 (Token definitions): The new grammar doesn't allow too many
5439 eccentricities.
5440
5441 * src/lex.h, src/lex.c: Remove.
5442 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
5443 (copy_character, copy_string2, copy_string, copy_identifier)
5444 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
5445 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
5446 (parse_action): Remove.
5447 * po/POTFILES.in: Adjust.
5448
2e047461
AD
54492002-06-11 Akim Demaille <akim@epita.fr>
5450
cd05d13c 5451 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
5452 rule's action member: return the action as a string.
5453 Don't require `rule_length' as an argument: compute it.
5454 (grammar_current_rule_symbol_append)
5455 (grammar_current_rule_action_append): New, eved out from
5456 (readgram): here.
5457 Remove `action_flag', `rulelength', unused now.
5458
9af3fbce
AD
54592002-06-11 Akim Demaille <akim@epita.fr>
5460
5461 * src/reader.c (grammar_current_rule_prec_set).
5462 (grammar_current_rule_check): New, eved out from...
5463 (readgram): here.
5464 Remove `xaction', `first_rhs': useless.
5465 * tests/input.at (Type clashes): New.
5466 * tests/existing.at (GNU Cim Grammar): Adjust.
5467
1485e106
AD
54682002-06-11 Akim Demaille <akim@epita.fr>
5469
5470 * src/reader.c (grammar_midrule_action): New, Eved out from
5471 (readgram): here.
5472
da4160c3
AD
54732002-06-11 Akim Demaille <akim@epita.fr>
5474
5475 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
5476 New.
5477 (readgram): Use them as replacement of inlined code, crule and
5478 crule1.
5479
f6d0f937
AD
54802002-06-11 Akim Demaille <akim@epita.fr>
5481
5482 * src/reader.c (grammar_end, grammar_symbol_append): New.
5483 (readgram): Use them.
5484 Make the use of `p' as local as possible.
5485
69078d4b
AD
54862002-06-10 Akim Demaille <akim@epita.fr>
5487
5488 GCJ's parser requires the tokens to be defined before the prologue.
5489
5490 * data/bison.simple: Output the token definition before the user's
5491 prologue.
5492 * tests/regression.at (Braces parsing, Duplicate string)
5493 (Mixing %token styles): Check the output from bison.
5494 (Early token definitions): New.
5495
5e424082
AD
54962002-06-10 Akim Demaille <akim@epita.fr>
5497
5498 * src/symtab.c (symbol_user_token_number_set): Don't complain when
5499 assigning twice the same user number to a token, so that we can
5500 use it in...
5501 * src/lex.c (lex): here.
5502 Also use `symbol_class_set' instead of hand written code.
5503 * src/reader.c (parse_assoc_decl): Likewise.
5504
44536b35
AD
55052002-06-10 Akim Demaille <akim@epita.fr>
5506
5507 * src/symtab.c, src/symtab.c (symbol_class_set)
5508 (symbol_user_token_number_set): New.
5509 * src/reader.c (parse_token_decl): Use them.
5510 Use a switch instead of ifs.
5511 Use a single argument.
5512
8b9f2372
AD
55132002-06-10 Akim Demaille <akim@epita.fr>
5514
5515 Remove `%thong' support as it is undocumented, unused, duplicates
5516 `%token's job, and creates useless e-mail traffic with people who
5517 want to know what it is, why it is undocumented, unused, and
5518 duplicates `%token's job.
5519
5520 * src/reader.c (parse_thong_decl): Remove.
5521 * src/options.c (option_table): Remove "thong".
5522 * src/lex.h (tok_thong): Remove.
5523
3ae2b51f
AD
55242002-06-10 Akim Demaille <akim@epita.fr>
5525
5526 * src/symtab.c, src/symtab.c (symbol_type_set)
5527 (symbol_precedence_set): New.
5528 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
5529 (value_components_used): Remove, unused.
5530
2f1afb73
AD
55312002-06-09 Akim Demaille <akim@epita.fr>
5532
5533 Move symbols handling code out of the reader.
5534
5535 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
5536 (axiom): Move to...
5537 * src/symtab.h, src/symtab.c: here.
5538
5539 * src/gram.c (start_symbol): Remove: use startsymbol->number.
5540 * src/reader.c (startval): Rename as...
5541 * src/symtab.h, src/symtab.c (startsymbol): this.
5542 * src/reader.c: Adjust.
5543
5544 * src/reader.c (symbol_check_defined, symbol_make_alias)
5545 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5546 (token_translations_init)
5547 Move to...
5548 * src/symtab.c: here.
5549 * src/reader.c (packsymbols): Move to...
5550 * src/symtab.h, src/symtab.c (symbols_pack): here.
5551 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
5552 argument.
5553
e9bca3ad
AD
55542002-06-03 Akim Demaille <akim@epita.fr>
5555
5556 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
5557 then statements.
5558
86eff183
AD
55592002-06-03 Akim Demaille <akim@epita.fr>
5560
5561 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
5562 structs with non literals.
5563 * src/scan-skel.l: never-interactive.
5564 * src/conflicts.c (enum conflict_resolution_e): No trailing
5565 comma.
5566 * src/getargs.c (usage): Split long literal strings.
5567 Reported by Hans Aberg.
5568
717be197
AD
55692002-05-28 Akim Demaille <akim@epita.fr>
5570
5571 * data/bison.c++: Use C++ ostreams.
5572 (cdebug_): New member.
5573
670ddffd
AD
55742002-05-28 Akim Demaille <akim@epita.fr>
5575
5576 * src/output.c (output_skeleton): Be sure to allocate enough room
5577 for `/' _and_ for `\0' in full_skeleton.
5578
769b430f
AD
55792002-05-28 Akim Demaille <akim@epita.fr>
5580
5581 * data/bison.c++: Catch up with bison.simple:
5582 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5583 and Paul Eggert <eggert@twinsun.com>: `error' handing.
5584 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
5585 and popping traces.
5586
7067cb36
PH
55872002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5588
5589 * src/output.c (output_skeleton): Put an explicit path in front of
5590 the skeleton file name, rather than relying on the -I directory,
5591 to partially alleviate effects of having a skeleton file lying around
5592 in the current directory.
769b430f 5593
4a713ec2
PH
55942002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5595
769b430f 5596 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
5597 obstack_printf should be obstack_fgrow1.
5598
b408954b
AD
55992002-05-26 Akim Demaille <akim@epita.fr>
5600
5601 * src/state.h (state_t): `solved_conflicts' is a new member.
5602 * src/LR0.c (new_state): Set it to 0.
5603 * src/conflicts.h, src/conflicts.c (print_conflicts)
5604 (free_conflicts, solve_conflicts): Rename as...
5605 (conflicts_print, conflicts_free, conflicts_solve): these.
5606 Adjust callers.
5607 * src/conflicts.c (enum conflict_resolution_e)
5608 (solved_conflicts_obstack): New, used by...
5609 (log_resolution): this.
5610 Adjust to attach the conflict resolution to each state.
5611 Complete the description with the precedence/associativity
5612 information.
5613 (resolve_sr_conflict): Adjust.
5614 * src/print.c (print_state): Output its solved_conflicts.
5615 * tests/conflicts.at (Unresolved SR Conflicts)
5616 (Solved SR Conflicts): Exercise --report=all.
5617
a49aecd5
AD
56182002-05-26 Akim Demaille <akim@epita.fr>
5619
5620 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5621 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5622 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
5623 (token_number_t, item_number_as_token_number)
5624 (token_number_as_item_number, muscle_insert_token_number_table):
5625 Rename as...
5626 (symbol_number_t, item_number_as_symbol_number)
5627 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
5628 these, since it is more appropriate.
5629
5504898e
AD
56302002-05-26 Akim Demaille <akim@epita.fr>
5631
5632 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
5633 `Error:' lines.
5634 * data/bison.simple (yystos) [YYDEBUG]: New.
5635 (yyparse) [YYDEBUG]: Display the symbols which are popped during
5636 error recovery.
5637 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
5638
ec3bc396
AD
56392002-05-25 Akim Demaille <akim@epita.fr>
5640
5641 * doc/bison.texinfo (Debugging): Split into...
5642 (Tracing): this new section, its former contents, and...
5643 (Understanding): this new section.
5644 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
5645 by...
5646 (report_flag): this.
5647 Adjust all dependencies.
5648 (report_args, report_types, report_argmatch): New.
5649 (usage, getargs): Report/support -r, --report.
5650 * src/options.h
5651 (struct option_table_struct): Rename as..,
5652 (struct option_table_s): this.
5653 Rename the `set_flag' member to `flag' to match with getopt_long's
5654 struct.
5655 * src/options.c (option_table): Split verbose into an entry for
5656 %verbose, and another for --verbose.
5657 Support --report/-r, so remove -r from the obsolete --raw.
5658 * src/print.c: Attach full item sets and lookaheads reports to
5659 report_flag instead of trace_flag.
5660 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
5661
78df8250
PE
56622002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5663 and Paul Eggert <eggert@twinsun.com>
769b430f 5664
78df8250
PE
5665 * data/bison.simple (yyparse): Correct error handling to conform to
5666 POSIX and yacc. Specifically, after syntax error is discovered,
5667 do not reduce further before shifting the error token.
5668 Clean up the code a bit by removing the labels yyerrdefault,
5669 yyerrhandle, yyerrpop.
5670 * NEWS: Document the above.
5671
c0c9ea05
PH
56722002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5673
5674 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
5675 type; it isn't always big enough, since it doesn't necessarily
5676 include non-terminals.
769b430f 5677 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
5678 the latter can be removed.
5679 (yy_token_number_type): Remove, only one use.
5680 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
5681 don't use TokenNumberType as element type.
769b430f 5682
c0c9ea05
PH
5683 * tests/regression.at: Modify expected output to agree with change
5684 to yyr1 and yytranslate.
769b430f 5685
6390a83f
FK
56862002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
5687
5688 * src/reader.c (parse_action): Use copy_character instead of
5689 obstack_1grow.
5690
db7c8e9a
AD
56912002-05-13 Akim Demaille <akim@epita.fr>
5692
5693 * tests/regression.at (Token definitions): Prototype yylex and
5694 yyerror.
5695
fcc61800
PH
56962002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5697
158c687b 5698 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
5699 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
5700 32-bit arithmetic.
5701 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
5702
5683e9b2
AD
57032002-05-07 Akim Demaille <akim@epita.fr>
5704
5705 * tests/synclines.at: Be sure to prototype yylex and yyerror to
5706 avoid GCC warnings.
5707
0c2d3f4c
AD
57082002-05-07 Akim Demaille <akim@epita.fr>
5709
5710 Kill GCC warnings.
5711
5712 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
5713 over the RHS of each rule.
5714 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
5715 * src/state.h (state_t): Member `nitems' is unsigned short.
5716 * src/LR0.c (get_state): Adjust.
5717 * src/reader.c (packgram): Likewise.
5718 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
5719 `Type'.
5720 (muscle_insert_int_table): Remove, unused.
5721 (prepare_rules): Remove `max'.
5722
1565b720
AD
57232002-05-06 Akim Demaille <akim@epita.fr>
5724
5725 * src/closure.c (print_firsts): Display of the symbol tags.
5726 (bitmatrix_print): Move to...
5727 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
5728 here.
5729 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
5730
cfaee611
AD
57312002-05-06 Akim Demaille <akim@epita.fr>
5732
5733 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
5734 hash_do_for_each.
5735
458be8e0
AD
57362002-05-06 Akim Demaille <akim@epita.fr>
5737
5738 * src/LR0.c (new_state, get_state): Instead of using the global
5739 `kernel_size' and `kernel_base', have two new arguments:
5740 `core_size' and `core'.
5741 Adjust callers.
5742
a900a624
AD
57432002-05-06 Akim Demaille <akim@epita.fr>
5744
5745 * src/reader.c (packgram): No longer end `ritem' with a 0
5746 sentinel: it is not used.
5747
d4e7d3a1
AD
57482002-05-05 Akim Demaille <akim@epita.fr>
5749
5750 New experimental feature: display the lookaheads in the report and
5751 graph.
5752
5753 * src/print (print_core): When --trace-flag, display the rules
5754 lookaheads.
5755 * src/print_graph.c (print_core): Likewise.
5756 Swap the arguments.
5757 Adjust caller.
5758
39ceb25b
AD
57592002-05-05 Akim Demaille <akim@epita.fr>
5760
5761 * tests/torture.at (Many lookaheads): New test.
5762
5372019f
AD
57632002-05-05 Akim Demaille <akim@epita.fr>
5764
5765 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
5766 (GENERATE_MUSCLE_INSERT_TABLE): this.
5767 (output_int_table, output_unsigned_int_table, output_short_table)
5768 (output_token_number_table, output_item_number_table): Replace with...
5769 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
5770 (muscle_insert_short_table, muscle_insert_token_number_table)
5771 (muscle_insert_item_number_table): these.
5772 Adjust all callers.
5773 (prepare_tokens): Don't free `translations', since...
5774 * src/reader.h, src/reader.c (grammar_free): do it.
5775 Move to...
5776 * src/gram.h, src/gram.c (grammar_free): here.
5777 * data/bison.simple, data/bison.c++: b4_token_number_max is now
5778 b4_translate_max.
5779
5df5f6d5
AD
57802002-05-05 Akim Demaille <akim@epita.fr>
5781
5782 * src/output.c (output_unsigned_int_table): New.
5783 (prepare_rules): `i' is unsigned.
5784 `prhs', `rline', `r2' are unsigned int.
5785 Rename muscle `rhs_number_max' as `rhs_max'.
5786 Output muscles `prhs_max', `rline_max', and `r2_max'.
5787 Free rline and r1.
5788 * data/bison.simple, data/bison.c++: Adjust to use these muscles
5789 to compute types instead of constant types.
5790 * tests/regression.at (Web2c Actions): Adjust.
5791
b87f8b21
AD
57922002-05-04 Akim Demaille <akim@epita.fr>
5793
5794 * src/symtab.h (SALIAS, SUNDEF): Rename as...
5795 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
5796 Adjust dependencies.
5797 * src/output.c (token_definitions_output): Be sure not to output a
5798 `#define 'a'' when fed with `%token 'a' "a"'.
5799 * tests/regression.at (Token definitions): New.
5800
8bb936e4
PE
58012002-05-03 Paul Eggert <eggert@twinsun.com>
5802
5803 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
5804 for K&R C.
5805
58062002-05-03 gettextize <bug-gnu-gettext@gnu.org>
5807
5808 * Makefile.am (SUBDIRS): Remove intl.
5809 (EXTRA_DIST): Add config/config.rpath.
5810
53c71a12
AD
58112002-05-03 Akim Demaille <akim@epita.fr>
5812
5813 * data/bison.simple (m4_if): Don't output empty enums.
5814 And actually, output valid enum definitions :(.
5815
289dd0cf
AD
58162002-05-03 Akim Demaille <akim@epita.fr>
5817
5818 * configure.bat: Remove, completely obsolete.
5819 * Makefile.am (EXTRA_DIST): Adjust.
5820 Don't distribute config.rpath...
5821 * config/Makefile.am (EXTRA_DIST): Do it.
5822
db85e524
AD
58232002-05-03 Akim Demaille <akim@epita.fr>
5824
5825 * configure.in (GETTEXT_VERSION): New.
5826 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
5827
83ccf991
AD
58282002-05-03 Akim Demaille <akim@epita.fr>
5829
5830 * data/bison.simple (b4_token_enum): New.
5831 (b4_token_defines): Use it to output tokens both as #define and
5832 enums.
5833 Suggested by Paul Eggert.
5834 * src/output.c (token_definitions_output): Don't output spurious
5835 white spaces.
5836
1f418995
AD
58372002-05-03 Akim Demaille <akim@epita.fr>
5838
5839 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5840
45119f04
RA
58412002-05-02 Robert Anisko <robert@lrde.epita.fr>
5842
5843 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
5844 Update the stack class, give a try to deque as the default container.
5845
b2d52318
AD
58462002-05-02 Akim Demaille <akim@epita.fr>
5847
5848 * data/bison.simple (yyparse): Do not implement @$ = @1.
5849 (YYLLOC_DEFAULT): Adjust to do it.
5850 * doc/bison.texinfo (Location Default Action): Fix.
5851
3a8b4109
AD
58522002-05-02 Akim Demaille <akim@epita.fr>
5853
5854 * src/reader.c (parse_braces): Merge into...
5855 (parse_action): this.
5856
84614e13
AD
58572002-05-02 Akim Demaille <akim@epita.fr>
5858
5859 * configure.in (ALL_LINGUAS): Remove.
5860 * po/LINGUAS, hr.po: New.
5861
fdbcd8e2
AD
58622002-05-02 Akim Demaille <akim@epita.fr>
5863
5864 Remove the so called hairy (semantic) parsers.
5865
5866 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
5867 * src/gram.h, src/gram.c (semantic_parser): Remove.
5868 (rule_t): Remove the guard and guard_line members.
5869 * src/lex.h (token_t): remove tok_guard.
5870 * src/options.c (option_table): Remove %guard and %semantic_parser
5871 support.
5872 * src/output.c, src/output.h (guards_output): Remove.
5873 (prepare): Adjust.
5874 (token_definitions_output): Don't output the `T'
5875 tokens (???).
5876 (output_skeleton): Don't output the guards.
5877 * src/files.c, src/files.c (attrsfile): Remove.
5878 * src/reader.c (symbol_list): Remove the guard and guard_line
5879 members.
5880 Adjust dependencies.
5881 (parse_guard): Remove.
5882 * data/bison.hairy: Remove.
5883 * doc/bison.texinfo (Environment Variables): Remove occurrences of
5884 BISON_HAIRY.
5885
82b6cb3f
AD
58862002-05-02 Akim Demaille <akim@epita.fr>
5887
5888 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
5889 (parse_guard): Rename the formal argument `stack_offset' as
5890 `rule_length', which is more readable.
5891 Adjust callers.
5892 (copy_at, copy_dollar): Instead of outputting the hard coded
5893 values of $$, $n and so forth, output invocation to b4_lhs_value,
5894 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
5895 Note: this patch partially drops `semantic-parser' support: it
5896 always does `rule_length - n', where semantic parsers ought to
5897 always use `-n'.
82b6cb3f
AD
5898 * data/bison.simple, data/bison.c++ (b4_lhs_value)
5899 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
5900
6cbfbcc5
AD
59012002-05-02 Akim Demaille <akim@epita.fr>
5902
5903 * configure.in (AC_INIT): Bump to 1.49b.
5904 (AM_INIT_AUTOMAKE): Short invocation.
5905
b8548114
AD
59062002-05-02 Akim Demaille <akim@epita.fr>
5907
5908 Version 1.49a.
5909
c20cd1fa
AD
59102002-05-01 Akim Demaille <akim@epita.fr>
5911
5912 * src/skeleton.h: Remove.
5913
8a9566d4
AD
59142002-05-01 Akim Demaille <akim@epita.fr>
5915
5916 * src/skeleton.h: Fix the #endif.
5917 Reported by Magnus Fromreide.
5918
8c6d399a
PE
59192002-04-26 Paul Eggert <eggert@twinsun.com>
5920
5921 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
5922 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 5923 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 5924
2b7ed18a
RA
59252002-04-25 Robert Anisko <robert@lrde.epita.fr>
5926
5927 * src/scan-skel.l: Postprocess quadrigraphs.
5928
5929 * src/reader.c (copy_character): New function, used to output
5930 single characters while replacing `[' and `]' with quadrigraphs, to
5931 avoid troubles with M4 quotes.
5932 (copy_comment): Output characters with copy_character.
5933 (read_additionnal_code): Likewise.
5934 (copy_string2): Likewise.
5935 (copy_definition): Likewise.
5936
5937 * tests/calc.at: Exercise M4 quoting.
5938
34a89c50
AD
59392002-04-25 Akim Demaille <akim@epita.fr>
5940
5941 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
5942 between `!' and the command.
5943 Reported by Paul Eggert.
5944
0dd1580a
RA
59452002-04-24 Robert Anisko <robert@lrde.epita.fr>
5946
5947 * tests/calc.at: Exercise prologue splitting.
5948
5949 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
5950 `b4_post_prologue' instead of `b4_prologue'.
5951
5952 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
5953 muscles.
5954 (output): Free pre_prologue_obstack and post_prologue_obstack.
5955 * src/files.h, src/files.c (attrs_obstack): Remove.
5956 (pre_prologue_obstack, post_prologue_obstack): New.
5957 * src/reader.c (copy_definition): Add a parameter to specify the
5958 obstack to fill, instead of using attrs_obstack unconditionally.
5959 (read_declarations): Pass pre_prologue_obstack to copy_definition if
5960 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
5961
83c1796f
PE
59622002-04-23 Paul Eggert <eggert@twinsun.com>
5963
5964 * data/bison.simple: Remove unnecessary commentary and white
5965 space differences from 1_29-branch.
5966 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
5967
5968 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
5969 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
5970 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
5971 constructors or destructors.
5972
5973 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
5974
1207eeac
AD
59752002-04-23 Akim Demaille <akim@epita.fr>
5976
5977 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
5978 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
5979 location with columns.
5980 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
5981 All reported by Paul Eggert.
5982
78ab8f67
AD
59832002-04-22 Akim Demaille <akim@epita.fr>
5984
5985 * src/reduce.c (dump_grammar): Move to...
5986 * src/gram.h, src/gram.c (grammar_dump): here.
5987 Be sure to separate long item numbers.
5988 Don't read the members of a rule's prec if its nil.
5989
133c20e2
AD
59902002-04-22 Akim Demaille <akim@epita.fr>
5991
5992 * src/output.c (table_size, table_grow): New.
5993 (MAXTABLE): Remove, replace uses with table_size.
5994 (pack_vector): Instead of dying when the table is too big, grow it.
5995
9515e8a7
AD
59962002-04-22 Akim Demaille <akim@epita.fr>
5997
5998 * data/bison.simple (yyr1): Its type is that of a token number.
5999 * data/bison.c++ (r1_): Likewise.
6000 * tests/regression.at (Web2c Actions): Adjust.
6001
23c5a174
AD
60022002-04-22 Akim Demaille <akim@epita.fr>
6003
6004 * src/reader.c (token_translations_init): 256 is now the default
6005 value for the error token, i.e., it will be assigned another
6006 number if the user assigned 256 to one of her tokens.
6007 (reader): Don't force 256 to error.
6008 * doc/bison.texinfo (Symbols): Adjust.
6009 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
6010 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
6011 etc. instead of 10, 20, 30 (which was used to `jump' over error
6012 (256) and undefined (2)).
6013
5fbb0954
AD
60142002-04-22 Akim Demaille <akim@epita.fr>
6015
6016 Propagate more token_number_t.
6017
6018 * src/gram.h (token_number_as_item_number)
6019 (item_number_as_token_number): New.
6020 * src/output.c (GENERATE_OUTPUT_TABLE): New.
6021 Use it to create output_item_number_table and
6022 output_token_number_table.
6023 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
6024 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
6025 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
6026 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
6027
4f940944
AD
60282002-04-22 Akim Demaille <akim@epita.fr>
6029
6030 * src/output.h, src/output.c (get_lines_number): Remove.
6031
3ded9a63
AD
60322002-04-19 Akim Demaille <akim@epita.fr>
6033
6034 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
6035 as Lex/Flex'.
6036 (Debugging): More details about enabling the debugging features.
6037 (Table of Symbols): Describe $$, $n, @$, and @n.
6038 Suggested by Tim Josling.
6039
e0c471a9
AD
60402002-04-19 Akim Demaille <akim@epita.fr>
6041
6042 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
6043
fecc10cd
AD
60442002-04-10 Akim Demaille <akim@epita.fr>
6045
6046 * src/system.h: Rely on HAVE_LIMITS_H.
6047 Suggested by Paul Eggert.
6048
51dec47b
AD
60492002-04-09 Akim Demaille <akim@epita.fr>
6050
6051 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
6052 full stderr, and strip it according to the bison options, instead
6053 of composing the error message from different bits.
6054 This makes it easier to check for several error messages.
6055 Adjust all the invocations.
6056 Add an invocation exercising the error token.
6057 Add an invocation demonstrating a stupid error message.
6058 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
6059 Adjust the tests.
6060 Error message are for stderr, not stdout.
6061
007a50a4
AD
60622002-04-09 Akim Demaille <akim@epita.fr>
6063
6064 * src/gram.h, src/gram.c (error_token_number): Remove, use
6065 errtoken->number.
6066 * src/reader.c (reader): Don't specify the user token number (2)
6067 for $undefined, as it uselessly prevents using it.
6068 * src/gram.h (token_number_t): Move to...
6069 * src/symtab.h: here.
6070 (state_t.number): Is a token_number_t.
6071 * src/print.c, src/reader.c: Use undeftoken->number instead of
6072 hard coded 2.
6073 (Even though this 2 is not the same as above: the number of the
6074 undeftoken remains being 2, it is its user token number which
6075 might not be 2).
6076 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
6077 `user_token_number_max'.
6078 Output `undef_token_number'.
6079 * data/bison.simple, data/bison.c++: Use them.
6080 Be sure to map invalid yylex return values to
6081 `undef_token_number'. This saves us from gratuitous SEGV.
6082
6083 * tests/conflicts.at (Solved SR Conflicts)
6084 (Unresolved SR Conflicts): Adjust.
6085 * tests/regression.at (Web2c Actions): Adjust.
6086
06446ccf
AD
60872002-04-08 Akim Demaille <akim@epita.fr>
6088
6089 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
6090 Adding #line.
6091 Remove the duplicate `typedefs'.
6092 (RhsNumberType): Fix the declaration and various other typos.
6093 Use __ofile__.
6094 * data/bison.simple: Use __ofile__.
6095 * src/scan-skel.l: Handle __ofile__.
6096
62a3e4f0
AD
60972002-04-08 Akim Demaille <akim@epita.fr>
6098
6099 * src/gram.h (item_number_t): New, the type of item numbers in
6100 RITEM. Note that it must be able to code symbol numbers as
6101 positive number, and the negation of rule numbers as negative
6102 numbers.
6103 Adjust all dependencies (pretty many).
6104 * src/reduce.c (rule): Remove this `short *' pointer: use
6105 item_number_t.
6106 * src/system.h (MINSHORT, MAXSHORT): Remove.
6107 Include `limits.h'.
6108 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
6109 (shortcpy): Remove.
6110 (MAXTABLE): Move to...
6111 * src/output.c (MAXTABLE): here.
6112 (prepare_rules): Use output_int_table to output rhs.
6113 * data/bison.simple, data/bison.c++: Adjust.
6114 * tests/torture.at (Big triangle): Move the limit from 254 to
6115 500.
6116 * tests/regression.at (Web2c Actions): Ajust.
6117
6118 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
6119 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
6120 passes, but produces negative #line number, once fixed, GCC is
6121 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
6122 C), it passes.
6123 * src/state.h (state_h): Code input lines on ints, not shorts.
6124
bb88b0fc
AD
61252002-04-08 Akim Demaille <akim@epita.fr>
6126
6127 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
6128 and then the grammar.
6129
9a636f47
AD
61302002-04-08 Akim Demaille <akim@epita.fr>
6131
6132 * src/system.h: No longer using strndup.
6133
680e8701
AD
61342002-04-07 Akim Demaille <akim@epita.fr>
6135
6136 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
6137 * src/output.c (output_table_data): Return the longest number.
6138 (prepare_tokens): Output `token_number_max').
6139 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
6140 New.
6141 Use them to define yy_token_number_type/TokenNumberType.
6142 Use this type for yytranslate.
6143 * tests/torture.at (Big triangle): Push the limit from 124 to
6144 253.
6145 * tests/regression.at (Web2c Actions): Adjust.
6146
817e9f41
AD
61472002-04-07 Akim Demaille <akim@epita.fr>
6148
6149 * tests/torture.at (Big triangle): New.
6150 (GNU AWK Grammar, GNU Cim Grammar): Move to...
6151 * tests/existing.at: here.
6152
5123689b
AD
61532002-04-07 Akim Demaille <akim@epita.fr>
6154
6155 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
6156 nritems.
6157 Adjust dependencies.
6158
f3849179
AD
61592002-04-07 Akim Demaille <akim@epita.fr>
6160
6161 * src/reader.c: Normalize increments to prefix form.
6162
bd02036a
AD
61632002-04-07 Akim Demaille <akim@epita.fr>
6164
6165 * src/reader.c, symtab.c: Remove debugging code.
6166
db8837cb
AD
61672002-04-07 Akim Demaille <akim@epita.fr>
6168
6169 Rename all the `bucket's as `symbol_t'.
6170
6171 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
6172 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
6173 * src/symtab.c, src/symtab.h (bucket): Rename as...
6174 (symbol_t): this.
6175 (symbol_list_new, bucket_check_defined, bucket_make_alias)
6176 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
6177 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
6178 (buckets_new, buckets_free, buckets_do): Rename as...
6179 (symbol_list_new, symbol_check_defined, symbol_make_alias)
6180 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
6181 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
6182 (symbols_new, symbols_free, symbols_do): these.
6183
72a23c97
AD
61842002-04-07 Akim Demaille <akim@epita.fr>
6185
6186 Use lib/hash for the symbol table.
6187
6188 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
6189 EOF.
6190 * src/lex.c (lex): Set the `number' member of new terminals.
6191 * src/reader.c (bucket_check_defined, bucket_make_alias)
6192 (bucket_check_alias_consistence, bucket_translation): New.
6193 (reader, grammar_free, readgram, token_translations_init)
6194 (packsymbols): Adjust.
6195 (reader): Number the predefined tokens.
6196 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
6197 for predefined tokens.
6198 * src/symtab.h (bucket): Remove all the hash table related
6199 members.
6200 * src/symtab.c (symtab): Replace by...
6201 (bucket_table): this.
6202 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
6203 (buckets_new, buckets_do): New.
6204
280a38c3
AD
62052002-04-07 Akim Demaille <akim@epita.fr>
6206
6207 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
6208 (start_symbol, max_user_token_number, semantic_parser)
6209 (error_token_number): Initialize.
6210 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
6211 Initialize.
6212 (reader): Don't.
6213 (errtoken, eoftoken, undeftoken, axiom): Extern.
6214
03b31c0c
AD
62152002-04-07 Akim Demaille <akim@epita.fr>
6216
6217 * src/gram.h (rule_s): prec and precsym are now pointers
6218 to the bucket giving the priority/associativity.
6219 Member `associativity' removed: useless.
6220 * src/reduce.c, src/conflicts.c: Adjust.
6221
8b3df748
AD
62222002-04-07 Akim Demaille <akim@epita.fr>
6223
6224 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
6225 Properly escape the symbols' TAG when outputting them.
6226
e601aa1d
AD
62272002-04-07 Akim Demaille <akim@epita.fr>
6228
6229 * src/lalr.h (LA): Is a bitsetv, not bitset*.
6230
b0299a2e
AD
62312002-04-07 Akim Demaille <akim@epita.fr>
6232
6233 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
6234 (LArule): this, which is an array to rule_t*.
6235 * src/print.c, src/conflicts.c: Adjust.
6236
d7e1f00c
AD
62372002-04-07 Akim Demaille <akim@epita.fr>
6238
6239 * src/gram.h (rule_t): Rename `number' as `user_number'.
6240 `number' is a new member.
6241 Adjust dependencies.
6242 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
6243
cc9305dd
AD
62442002-04-07 Akim Demaille <akim@epita.fr>
6245
6246 As a result of the previous patch, it is no longer needed
6247 to reorder ritem itself.
6248
6249 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
6250
b0940840
AD
62512002-04-07 Akim Demaille <akim@epita.fr>
6252
6253 Be sure never to walk through RITEMS, but use only data related to
6254 the rules themselves. RITEMS should be banished.
6255
6256 * src/output.c (output_token_translations): Rename as...
6257 (prepare_tokens): this.
6258 In addition to `translate', prepare the muscles `tname' and
6259 `toknum', which were handled by...
6260 (output_rule_data): this.
6261 Remove, and move the remainder of its outputs into...
6262 (prepare_rules): this new routines, which also merges content from
6263 (output_gram): this.
6264 (prepare_rules): Be sure never to walk through RITEMS.
6265 (output_stos): Rename as...
6266 (prepare_stos): this.
6267 (output): Always invoke prepare_states, after all, just don't use it
6268 in the output if you don't need it.
6269
643a5994
AD
62702002-04-07 Akim Demaille <akim@epita.fr>
6271
6272 * src/LR0.c (new_state): Display `nstates' as the name of the
6273 newly created state.
6274 Adjust to initialize first_state and last_state if needed.
6275 Be sure to distinguish the initial from the final state.
6276 (new_states): Create the itemset of the initial state, and use
6277 new_state.
6278 * src/closure.c (closure): Now that the initial state has its
6279 items properly set, there is no need for a special case when
6280 creating `ruleset'.
6281
6282 As a result, now the rule 0, reducing to $axiom, is visible in the
6283 outputs. Adjust the test suite.
6284
6285 * tests/conflicts.at (Solved SR Conflicts)
6286 (Unresolved SR Conflicts): Adjust.
6287 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
6288 * tests/conflicts.at (S/R in initial): New.
6289
b4c4ccc2
AD
62902002-04-07 Akim Demaille <akim@epita.fr>
6291
6292 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
6293 the RHS of the rules.
6294 * src/output.c (output_gram): Likewise.
6295
bba97eb2
AD
62962002-04-07 Akim Demaille <akim@epita.fr>
6297
6298 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
6299 bucket.
6300 Adjust all dependencies.
6301 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
6302 `number' of the buckets too.
6303 * src/gram.h: Include `symtab.h'.
6304 (associativity): Move to...
6305 * src/symtab.h: here.
6306 No longer include `gram.h'.
6307
c3b407f4
AD
63082002-04-07 Akim Demaille <akim@epita.fr>
6309
6310 * src/gram.h, src/gram.c (rules_rhs_length): New.
6311 (ritem_longest_rhs): Use it.
6312 * src/gram.h (rule_t): `number' is a new member.
6313 * src/reader.c (packgram): Set it.
6314 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
6315 the end of `rules', and count them out of `nrules'.
6316 (reduce_output, dump_grammar): Adjust.
6317 * src/print.c (print_grammar): It is no longer needed to check for
6318 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
6319 * tests/reduce.at (Reduced Automaton): New test.
6320
11652ab3
AD
63212002-04-07 Akim Demaille <akim@epita.fr>
6322
6323 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
6324 lacking `+ 1' to nrules, Bison reported as useless a token if it
6325 was used solely to set the precedence of the last rule...
6326
26b23c1a
AD
63272002-04-07 Akim Demaille <akim@epita.fr>
6328
6329 * data/bison.c++, data/bison.simple: Don't output the current file
6330 name in #line, to avoid useless diffs between two identical
6331 outputs under different names.
6332
18bcecb0
AD
63332002-04-07 Akim Demaille <akim@epita.fr>
6334
6335 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
6336 Normalize loops to using `< nrules + 1', not `<= nrules'.
6337
fa770c86
AD
63382002-04-07 Akim Demaille <akim@epita.fr>
6339
6340 * TODO: Update.
6341
d9b739c3
AD
63422002-04-07 Akim Demaille <akim@epita.fr>
6343
6344 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
6345 bucket.value as bucket.number.
6346
99013900
AD
63472002-04-07 Akim Demaille <akim@epita.fr>
6348
6349 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
6350 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
6351 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
6352 RHS, instead of being an index in RITEMS.
6353
e966383b
PE
63542002-04-04 Paul Eggert <eggert@twinsun.com>
6355
6356 * doc/bison.texinfo: Update copyright date.
6357 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
6358 (Symbols): Warn about running Bison in one character set,
6359 but compiling and/or running in an incompatible one.
6360 Warn about character code 256, too.
6361
63622002-04-03 Paul Eggert <eggert@twinsun.com>
6363
6364 * src/bison.data (YYSTACK_ALLOC): Depend on whether
6365 YYERROR_VERBOSE is nonzero, not whether it is defined.
6366
6367 Merge changes from bison-1_29-branch.
c307773e 6368
8d6c48b9
PE
63692002-03-20 Paul Eggert <eggert@twinsun.com>
6370
6371 Merge fixes from Debian bison_1.34-1.diff.
6372
6373 * configure.in (AC_PREREQ): 2.53.
6374
e53c6322
AD
63752002-03-20 Akim Demaille <akim@epita.fr>
6376
6377 * src/conflicts.c (log_resolution): Argument `resolution' is const.
6378
9ffbeca7
PE
63792002-03-19 Paul Eggert <eggert@twinsun.com>
6380
21db0b2a
PE
6381 * src/bison.simple (YYCOPY): New macro.
6382 (YYSTACK_RELOCATE): Use it.
6383 Remove Type arg; no longer needed. All callers changed.
6384 (yymemcpy): Remove; no longer needed.
6385
9ffbeca7
PE
6386 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
6387 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
6388
642cb8f8
AD
63892002-03-19 Akim Demaille <akim@epita.fr>
6390
6391 Test and fix the #line outputs.
6392
6393 * tests/atlocal.at (GCC): New.
6394 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
6395 (Prologue synch line, ,%union synch line, Postprologue synch line)
6396 (Action synch line, Epilogue synch line): New tests.
6397 * src/reader.c (parse_union_decl): Define the muscle stype_line.
6398 * data/bison.simple, data/bison.c++: Use it.
6399
3c31a486
AD
64002002-03-19 Akim Demaille <akim@epita.fr>
6401
6402 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
6403 (Solved SR Conflicts, %expect not enough, %expect right)
6404 (%expect too much): Move to...
6405 * tests/conflicts.at: this new file.
6406
0d8bed56
AD
64072002-03-19 Akim Demaille <akim@epita.fr>
6408
6409 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
6410 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
6411 that we can move to enums for instance.
6412 * src/output.c (token_definitions_output): Output a list of
6413 `token-name, token-number' instead of the #define.
6414 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
6415
9208d17f
AD
64162002-03-14 Akim Demaille <akim@epita.fr>
6417
6418 Use Gettext 0.11.1.
6419
af27eacb
RA
64202002-03-09 Robert Anisko <robert@lrde.epita.fr>
6421
6422 * data/bison.c++: Make the user able to add members to the generated
6423 parser by subclassing.
6424
9101a310
RA
64252002-03-05 Robert Anisko <robert@lrde.epita.fr>
6426
6427 * src/reader.c (read_additionnal_code): `c' should be an integer, not
6428 a character.
6429 Reported by Nicolas Tisserand and Nicolas Burrus.
6430
fff9bf0b
RA
64312002-03-04 Robert Anisko <robert@lrde.epita.fr>
6432
6433 * src/reader.c: Warn about lacking semi-colons, do not complain.
6434
64dba31e
RA
64352002-03-04 Robert Anisko <robert@lrde.epita.fr>
6436
6437 * data/bison.c++: Remove a debug line.
6438
374f5a14
RA
64392002-03-04 Robert Anisko <robert@lrde.epita.fr>
6440
6441 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
6442 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
6443 provide a default implementation.
6444
bfcf1f3a
AD
64452002-03-04 Akim Demaille <akim@epita.fr>
6446
6447 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
6448 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
6449 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
6450 * tests/semantic.at (Parsing Guards): Similarly.
6451 * src/reader.at (readgram): Complain if the last rule is not ended
6452 with a semi-colon.
6453
65ccf9fc
AD
64542002-03-04 Akim Demaille <akim@epita.fr>
6455
6456 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
6457 * src/closure.c: here.
6458 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
6459 RTC.
6460 * src/warshall.h, src/warshall.c: Remove.
6461 * tests/sets.at (Broken Closure): Adjust.
6462
d0039cbc
AD
64632002-03-04 Akim Demaille <akim@epita.fr>
6464
6465 * src/output.c (output_skeleton): tempdir is const.
6466 bytes_read is unused.
6467
345cea78
AD
64682002-03-04 Akim Demaille <akim@epita.fr>
6469
6470 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6471 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
6472 Update.
6473 From Michael Hayes.
6474
564801f7
AD
64752002-03-04 Akim Demaille <akim@epita.fr>
6476
6477 * src/closure.c (closure): `r' is unused.
6478
e5352bc7
AD
64792002-03-04 Akim Demaille <akim@epita.fr>
6480
6481 * tests/sets.at (Broken Closure): Add the ending `;'.
6482 * src/reader.at (readgram): Complain if a rule is not ended with a
6483 semi-colon.
6484
914feea9
AD
64852002-03-04 Akim Demaille <akim@epita.fr>
6486
6487 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
6488 (count_sr_conflicts): Use bitset_count.
6489 * src/reduce.c (inaccessable_symbols): Ditto.
6490 (bits_size): Remove.
6491 * src/warshall.h, src/warshall.c: Convert to bitsetv.
6492
f0250de6
AD
64932002-03-04 Akim Demaille <akim@epita.fr>
6494
6495 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
6496 * src/reduce.c: Remove the `bitset_zero's following the
6497 `bitset_create's, as now it is performed by the latter.
6498
ef017502
AD
64992002-03-04 Akim Demaille <akim@epita.fr>
6500
6501 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
6502 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
6503 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
6504 latest sources from Michael.
6505
76514394
AD
65062002-03-04 Akim Demaille <akim@epita.fr>
6507
6508 * src/output.c (output): Don't free the grammar.
6509 * src/reader.c (grammar_free): New.
6510 * src/main.c (main): Call it and don't free symtab here.
6511
55024580
AD
65122002-03-04 Akim Demaille <akim@epita.fr>
6513
6514 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
6515 before returning.
6516 Reported by Benoit Perrot.
6517
f9abaa2c
AD
65182002-03-04 Akim Demaille <akim@epita.fr>
6519
6520 Use bitset operations when possible, not loops over bits.
6521
6522 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
6523 bitset_or.
6524 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
6525 * src/reduce.c (useless_nonterminals): Formatting changes.
6526 * src/warshall.c (TC): Use bitset_or.
6527
0e721e75
AD
65282002-03-04 Akim Demaille <akim@epita.fr>
6529
6530 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
6531 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
6532 Ditto.
6533
0fb1ffb1
AD
65342002-03-04 Akim Demaille <akim@epita.fr>
6535
6536 * src/lalr.c (F): Now a bitset*.
6537 Adjust all dependencies.
6538
b86796bf
AD
65392002-03-04 Akim Demaille <akim@epita.fr>
6540
6541 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
6542 Adjust all dependencies.
6543
602bbf31
AD
65442002-03-04 Akim Demaille <akim@epita.fr>
6545
6546 * src/L0.c, src/LR0.h (nstates): Be size_t.
6547 Adjust comparisons (signed vs unsigned).
6548 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
6549 bitset*.
6550 Adjust all dependencies.
6551
d8a0245c
AD
65522002-03-04 Akim Demaille <akim@epita.fr>
6553
6554 * src/closure.c (firsts): Now, also a bitset.
6555 Adjust all dependencies.
6556 (varsetsize): Remove, now unused.
6557 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
6558
34ba9743
AD
65592002-03-04 Akim Demaille <akim@epita.fr>
6560
6561 * src/print.c: Convert to use bitset.h, not hand coded iterations
6562 over ints.
6563
ed86e78c
AD
65642002-03-04 Akim Demaille <akim@epita.fr>
6565
6566 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
6567
dfdb1797
AD
65682002-03-04 Akim Demaille <akim@epita.fr>
6569
6570 * src/closure.c (ruleset): Be a bitset.
6571 (rulesetsize): Remove.
6572
7086e707
AD
65732002-03-04 Akim Demaille <akim@epita.fr>
6574
6575 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6576 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
6577 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
6578 * src/closure.c (fderives): Be an array of bitsets.
6579
98254360
RA
65802002-02-28 Robert Anisko <robert@lrde.epita.fr>
6581
6582 * data/bison.c++: Merge the two generated headers. Insert a copyright
6583 notice in each output file.
6584
a75c057f
AD
65852002-02-28 Akim Demaille <akim@epita.fr>
6586
6587 * data/bison.c++: Copy the prologue of bison.simple to fetch
6588 useful M4 definitions, such as b4_header_guard.
6589
06b00abc
AD
65902002-02-25 Akim Demaille <akim@epita.fr>
6591
6592 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
6593 translator friendly scheme for the bgr
6594 copyright notice.
06b00abc 6595
70e7d534
AD
65962002-02-25 Akim Demaille <akim@epita.fr>
6597
6598 * src/output.c (header_output): Remove, now handled completely via
6599 M4.
6600
abe017f6
AD
66012002-02-25 Akim Demaille <akim@epita.fr>
6602
6603 * m4/m4.m4: New, from CVS Autoconf.
6604 * configure.in: Invoke it.
6605 * src/output.c (output_skeleton): Use its result instead of the
6606 hard coded name.
6607
381fb12e
AD
66082002-02-25 Akim Demaille <akim@epita.fr>
6609
6610 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
6611 Fileutils 4.1.5.
6612 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
6613 * src/output.c (output_skeleton): Use mkstemp to create a real
6614 temporary file.
6615 Move the filling of `skeleton' and its muscle to...
6616 (prepare): here.
6617 (output): Move the definition of the prologue muscle to...
6618 (prepare): here.
6619 * src/system.h (DEFAULT_TMPDIR): New.
6620
6f38107f
PE
66212002-02-14 Paul Eggert <eggert@twinsun.com>
6622
6623 Remove the support for C++ namespace cleanliness; it was
6624 causing more problems than it was curing, since it didn't work
6625 properly on some nonstandard C++ compilers. This can wait
6626 for a proper C++ parser.
6627
6628 * NEWS: Document this.
6629 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
6630 of C++, as it's treated like C now.
6631 * src/bison.simple (YYSTD): Remove.
6632 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
6633 Treat C++ just like Standard C instead of trying to support
6634 namespace cleanliness.
6635
80cce3da
AD
66362002-02-14 Akim Demaille <akim@epita.fr>
6637
6638 * tests/regression.at (else): Adjust to Andreas' change.
6639
842e8679
AD
66402002-02-14 Akim Demaille <akim@epita.fr>
6641
6642 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
6643
4bda3f10
AD
66442002-02-13 Andreas Schwab <schwab@suse.de>
6645
6646 * src/output.c (output_rule_data): Don't output NULL, it might
6647 not be defined yet.
6648
4162fa07 66492002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 6650
4162fa07
RA
6651 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
6652 (Copyright notice): Update.
b418ecd8 6653
bd16a5dc
AD
66542002-02-11 Akim Demaille <akim@epita.fr>
6655
6656 * tests/regression.at (%nonassoc and eof): Don't include
6657 nonportable headers.
6658
8d69a1a3
RA
66592002-02-08 Robert Anisko <robert@lrde.epita.fr>
6660
6661 * data/bison.c++: Correct error recovery. Make the user able to
6662 initialize the starting location.
6663
9b2d0677
AD
66642002-02-07 Akim Demaille <akim@epita.fr>
6665
6666 * tests/input.at: New.
6667
69e2658b
RA
66682002-02-07 Robert Anisko <robert@lrde.epita.fr>
6669
6670 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 6671 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
6672 directives around tables only needed for debugging.
6673
4aacc3a7
RA
66742002-02-07 Robert Anisko <robert@lrde.epita.fr>
6675
6676 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
6677 C++ parsers.
6678 (yy::b4_name::parse): Use print_.
6679
762a801e
RA
66802002-02-07 Robert Anisko <robert@lrde.epita.fr>
6681
6682 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
6683
4bb2bc3f
RA
66842002-02-07 Robert Anisko <robert@lrde.epita.fr>
6685
6686 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
6687 C++ parsers.
6688 (yy::b4_name::parse): Build verbose error messages, and use error_.
6689
6b45a3ca
RA
66902002-02-06 Robert Anisko <robert@lrde.epita.fr>
6691
6692 * data/bison.c++: Fix m4 quoting in comments.
6693
50997c6e
RA
66942002-02-06 Robert Anisko <robert@lrde.epita.fr>
6695
6696 * data/bison.c++: Adjust the parser code. Fix some muscles that were
6697 not expanded by m4.
6698
3f3eed27
AD
66992002-02-05 Akim Demaille <akim@epita.fr>
6700
6701 * data/bison.c++: Adjust to the M4 back end.
6702 More is certainly needed.
6703
be2a1a68
AD
67042002-02-05 Akim Demaille <akim@epita.fr>
6705
6706 Give a try to M4 as a back end.
6707
6708 * lib/readpipe.c: New, from wdiff.
6709 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
6710 BISON_HAIRY.
6711 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
6712 specific values. Now it is m4 that performs the lookup.
6713 * src/parse-skel.y: Remove.
6714 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
6715 * src/output.c (actions_output, guards_output)
6716 (token_definitions_output): No longer keeps track of the output
6717 line number, hence remove the second argument.
6718 (guards_output): Check against the guard member of a rule, not the
6719 action member.
6720 Adjust callers.
6721 (output_skeleton): Don't look for the skeleton location, let m4 do
6722 that.
6723 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
6724 file will be used.
6725 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
6726 (prepare): Given that for the time being changesyntax is not
6727 usable in M4, rename the muscles using `-' to `_'.
6728 Define `defines_flag', `output_parser_name' and `output_header_name'.
6729 * src/output.h (actions_output, guards_output)
6730 (token_definitions_output): Adjust prototypes.
6731 * src/scan-skel.l: Instead of scanning the skeletons, it now
6732 processes the output of m4: `__oline__' and `#output'.
6733 * data/bison.simple: Adjust to be used by M4(sugar).
6734 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
6735 to date.
6736 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
6737 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
6738 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
6739 shamelessly stolen from CVS Autoconf.
6740
beda758b
AD
67412002-02-05 Akim Demaille <akim@epita.fr>
6742
6743 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
6744 * configure.in: Check for the declarations of free and malloc.
6745 * src/muscle_tab.c: Adjust.
6746
5ece6d43
AD
67472002-02-05 Akim Demaille <akim@epita.fr>
6748
6749 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
6750 which have no values.
6751
5bb18f9a
AD
67522002-02-05 Akim Demaille <akim@epita.fr>
6753
6754 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
6755 * data/: here.
6756
894dd62e
PE
67572002-01-29 Paul Eggert <eggert@twinsun.com>
6758
6759 * src/bison.simple (YYSIZE_T): Do not define merely because
6760 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
6761 On some platforms, <alloca.h> does not declare YYSTD (size_t).
6762
82841af7
AD
67632002-01-27 Akim Demaille <akim@epita.fr>
6764
6765 Fix `%nonassoc and eof'.
6766
6767 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
6768 which were not properly copied! Replace
6769 memcpy (res->errs, src->errs, src->nerrs);
6770 with
6771 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
6772 !!!
6773 * tests/regression.at (%nonassoc and eof): Adjust to newest
6774 Autotest: `.' is not in the PATH.
6775
318b76e9
AD
67762002-01-27 Akim Demaille <akim@epita.fr>
6777
6778 * tests/sets.at (AT_EXTRACT_SETS): New.
6779 (Nullable): Use it.
6780 (Firsts): New.
6781
30d2f3d5
AD
67822002-01-26 Akim Demaille <akim@epita.fr>
6783
6784 * tests/actions.at, tests/calc.at, tests/headers.at,
6785 * tests/torture.at: Adjust to the newest Autotest which no longer
6786 forces `.' in the PATH.
6787
30f8c395
AD
67882002-01-25 Akim Demaille <akim@epita.fr>
6789
6790 * tests/regression.at (%nonassoc and eof): New.
6791 Suggested by Robert Anisko.
6792
29ae55f1
AD
67932002-01-24 Akim Demaille <akim@epita.fr>
6794
6795 Bison dumps core when trying to complain about broken input files.
6796 Reported by Cris van Pelt.
6797
6798 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
6799 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
6800 into...
6801 (Invalid inputs): Strengthen: exercise parse_percent_token.
6802
2b548aa6
RA
68032002-01-24 Robert Anisko <robert.anisko@epita.fr>
6804
6805 * src/Makefile.am: Add bison.c++.
6806 * src/bison.c++: New skeleton.
6807
bb0146c2
AD
68082002-01-21 Paolo Bonzini <bonzini@gnu.org>
6809
6810 * po/it.po: New.
6811
bec30531
AD
68122002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
6813
6814 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
6815
fc6edc45
MA
68162002-01-20 Marc Autret <marc@gnu.org>
6817
6818 * src/files.c (compute_output_file_names): Fix
6819
5e5d5415
MA
68202002-01-20 Marc Autret <marc@gnu.org>
6821
6822 * tests/output.at: New test.
6823 * src/files.c (compute_base_names): Don't map extensions when
6824 the YACC flag is set, use defaults.
6825 Reported by Evgeny Stambulchik.
6826
44ea3fbd
MA
68272002-01-20 Marc Autret <marc@gnu.org>
6828
bb0146c2 6829 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
6830 compilers as well (i.e. the vendor C compiler).
6831 Suggested by Albert Chin-A-Young.
6832
338963d1
TVH
68332002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
6834
6835 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
6836 canonical definition.
6837 * src/system.h: Use the canonical definition for PARAMS (avoids
6838 a conflict with the macro from lib/hash.h).
6839
c57b2479
AD
68402002-01-11 Akim Demaille <akim@epita.fr>
6841
6842 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 6843 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 6844
b85810ae
AD
68452002-01-09 Akim Demaille <akim@epita.fr>
6846
6847 * src/files.c, src/files.h (output_infix): New.
6848 (tab_extension): Remove.
6849 (compute_base_names): Compute the former, drop the latter.
6850 * src/output.c (prepare): Insert the muscles `output-infix', and
6851 `output-suffix'.
6852 * src/parse-skel.y (string, string.1): New.
6853 (section.header): Use it.
6854 (section.yacc): Remove.
6855 (prefix): Remove too.
6856 * src/scan-skel.l: Adjust.
6857 * src/bison.simple, src/bison.hairy: Adjust.
6858
cae60122
AD
68592002-01-09 Akim Demaille <akim@epita.fr>
6860
6861 * configure.in (WERROR_CFLAGS): Compute it.
6862 * src/Makefile.am (CFLAGS): Pass it.
6863 * tests/atlocal.in (CFLAGS): Idem.
6864 * src/files.c: Fix a few warnings.
6865 (get_extension_index): Remove, unused.
6866
ae404801
AD
68672002-01-08 Akim Demaille <akim@epita.fr>
6868
6869 * src/getargs.c (AS_FILE_NAME): New.
6870 (getargs): Use it to convert DOSish file names.
6871 * src/files.c (base_name): Rename as full_base_name to avoid
6872 clashes with `base_name ()'.
6873 (filename_split): New.
6874 (compute_base_names): N-th rewrite, using filename_split.
6875
22312b71
AD
68762002-01-08 Akim Demaille <akim@epita.fr>
6877
6878 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
6879 New, stolen from the Fileutils 4.1.
6880 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
6881 * configure.in: Check for the presence of memrchr, and of its
6882 prototype.
6883
a67cef01
TVH
68842002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
6885
6886 * lib/hash.h (__P): Added definition for this macro.
6887 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
6888 BUILT_SOURCES, to ensure they are generated first.
6889 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
6890 %error-verbose to allow bootstrapping with bison 1.30x.
6891
2b25d624
AD
68922002-01-06 Akim Demaille <akim@epita.fr>
6893
6894 * src/reader.c (parse_braces): Don't fetch the next char, the
6895 convention is to fetch on entry.
6896 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
6897 'switch' without a following semicolon.
6898 * tests/regression.at (braces parsing): New.
6899
3460813b
AD
69002002-01-06 Akim Demaille <akim@epita.fr>
6901
6902 Bison is dead wrong in its RR conflict reports.
6903
6904 * tests/torture.at (GNU Cim Grammar): New.
6905 * src/conflicts.c (count_rr_conflicts): Fix.
6906
73784c64
AD
69072002-01-06 Akim Demaille <akim@epita.fr>
6908
6909 Creating package.m4 from configure.ac causes too many problems.
6910
6911 * tests/Makefile.am (package.m4): Create it by hand,
6912 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
6913
25d81090
AD
69142002-01-06 Akim Demaille <akim@epita.fr>
6915
6916 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
6917 skeleton.h.
6918
a9b8959e
PE
69192002-01-04 Paul Eggert <eggert@twinsun.com>
6920
6921 * doc/bison.texinfo (Debugging):
6922 Remove YYSTDERR; it's no longer defined or used.
6923 Also, s/cstdio.h/cstdio/.
6924
25d81090
AD
69252002-01-03 Akim Demaille <akim@epita.fr>
6926
6927 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
6928
1109455c
AD
69292002-01-03 Akim Demaille <akim@epita.fr>
6930
6931 * src/parse-skel.y (process_skeleton): Don't bind the parser's
6932 tracing code to --trace, wait for a better --trace option, with
6933 args.
6934
7ea5e977
AD
69352002-01-03 Akim Demaille <akim@epita.fr>
6936
6937 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
6938 The ISO C++ standard is extremely clear about it: stderr is
6939 considered a macro, not a regular symbol (see table 94 `Header
6940 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
6941 Therefore std:: does not apply to it. It still does with fprintf.
6942 Also, s/cstdio.h/cstdio/.
6943
fab5b110
AD
69442002-01-03 Akim Demaille <akim@epita.fr>
6945
6946 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
6947 for non system headers.
6948
aed7fd9b
AD
69492002-01-02 Akim Demaille <akim@epita.fr>
6950
6951 Equip the skeleton chain with location tracking, runtime trace,
6952 pure parser and scanner.
6953
6954 * src/parse-skel.y: Request a pure parser, locations, and prefix
6955 renaming.
6956 (%union): Having several members with the same type does not help
6957 type mismatches, simplify.
6958 (YYPRINT, yyprint): New.
6959 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
6960 (skel_error): this.
6961 Handle locations.
6962 * src/scan-skel.l: Adjust to these changes.
6963 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
6964 (LOCATION_PRINT, skel_control_t): New.
6965
24fad99e
AD
69662001-12-30 Akim Demaille <akim@epita.fr>
6967
6968 * src/parse-skel.y: Get rid of the shift/reduce conflict:
6969 replace `gb' with BLANKS.
6970 * src/scan-skel.l: Adjust.
6971
a4b36db4
AD
69722001-12-30 Akim Demaille <akim@epita.fr>
6973
6974 * src/system.h: We don't need nor want bcopy.
6975 Throw away MS-DOS crap: we don't need getpid.
6976 * configure.in: We don't need strndup. It was even causing
6977 problems: because Flex includes the headers *before* us,
6978 _GNU_SOURCE is not defined by config.h, and therefore strndup was
6979 not visible.
6980 * lib/xstrndup.c: New.
6981 * src/scan-skel.l: Use it.
6982 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
6983 * src/parse-skel.y: Use %directives instead of #defines.
6984
1239777d
AD
69852001-12-30 Akim Demaille <akim@epita.fr>
6986
6987 * src/skeleton.h: New.
6988 * src/output.c (output_parser, output_master_parser): Remove, dead
6989 code.
6990 * src/output.h (get_lines_number, actions_output, guards_output)
6991 (token_definitions_output): Prototype them.
6992 * src/parse-skel.y: Add the license notice.
6993 Include output.h and skeleton.h.
6994 (process_skeleton): Returns void, and takes a single parameter.
6995 * src/scan-skel.l: Add the license notice.
6996 Include skeleton.h.
6997 Don't use %option yylineno: it seems that then Flex imagines
6998 REJECT has been used, and therefore it won't reallocate its
6999 buffers (which makes no other sense to me than a bug). It results
7000 in warnings for `unused: yy_flex_realloc'.
7001
9b3add5b
RA
70022001-12-30 Robert Anisko <robert.anisko@epita.fr>
7003
7004 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
7005 (MUSCLE_INSERT_PREFIX): ...to there.
7006 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
7007 (MUSCLE_INSERT_PREFIX): Move from here...
7008
7009 * src/bison.hairy: Add a section directive. Put braces around muscle
7010 names. This parser skeleton is still broken, but Bison should not
7011 choke on a bad muscle 'syntax'.
7012 * src/bison.simple: Add a section directive. Put braces around muscle
7013 names.
7014
7015 * src/files.h (strsuffix, stringappend): Add declarations.
7016 (tab_extension): Add declaration.
7017 (short_base_name): Add declaration.
7018
7019 * src/files.c (strsuffix, stringappend): No longer static. These
7020 functions are used in the skeleton parser.
7021 (tab_extension): New.
7022 (compute_base_names): Use the computations done in this function
fab5b110 7023 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
7024 names.
7025 (short_base_name): No longer static.
7026
7027 * src/output.c (output_skeleton): New.
7028 (output): Disable call to output_master_parser, and give a try to
7029 a new skeleton handling system.
7030 (guards_output, actions_output): No longer static.
7031 (token_definitions_output, get_lines_number): No longer static.
7032
7033 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
7034
fab5b110 7035 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
7036 parse-skel.y.
7037
7038 * src/parse-skel.y: New file.
7039 * src/scan-skel.l: New file.
7040
b5b61c61
AD
70412001-12-29 Akim Demaille <akim@epita.fr>
7042
7043 %name-prefix is broken.
7044
7045 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
7046 Adjust all dependencies.
7047 * tests/headers.at (export YYLTYPE): Strengthen this test: use
7048 %name-prefix.
7049
7050 Renaming yylval but not yylloc is not consistent. Now we do.
7051
7052 * src/bison.simple: Prefix yylloc if used.
7053 * doc/bison.texinfo (Decl Summary): Document that.
7054
8c9a50be
AD
70552001-12-29 Akim Demaille <akim@epita.fr>
7056
7057 * doc/bison.texinfo: Promote `%long-directive' over
7058 `%long_directive'.
7059 Remove all references to fixed-output-files, yacc is enough.
7060
d99361e6
AD
70612001-12-29 Akim Demaille <akim@epita.fr>
7062
7063 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
7064 user prologue. These are defaults.
7065 * tests/actions.at (Mid-rule actions): Make sure the user can
7066 define YYDEBUG and YYERROR_VERBOSE.
7067
b9cecb91
AD
70682001-12-29 Akim Demaille <akim@epita.fr>
7069
7070 * src/output.c (header_output): Don't forget to export YYLTYPE and
7071 yylloc.
7072 * tests/headers.at (export YYLTYPE): New, make sure it does.
7073 * tests/regression.at (%union and --defines, Invalid CPP headers):
7074 Move to...
7075 * tests/headers.at: here.
7076
aea13e97
AD
70772001-12-29 Akim Demaille <akim@epita.fr>
7078
7079 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
7080
931394cb
AD
70812001-12-29 Akim Demaille <akim@epita.fr>
7082
7083 * tests/actions.at (Mid-rule actions): Output on a single line
7084 instead of several.
7085
704a47c4
AD
70862001-12-29 Akim Demaille <akim@epita.fr>
7087
7088 * doc/bison.texinfo: Formatting changes.
7089
091e20bb
AD
70902001-12-29 Akim Demaille <akim@epita.fr>
7091
7092 Don't store the token defs in a muscle, just be ready to output it
7093 on command. Now possible via `symbols'. Fixes a memory leak.
7094
7095 * src/output.c (token_definitions_output): New.
7096 (output_parser, header_output): Use it.
7097 * src/reader.c (symbols_save): Remove.
7098
cce71710
AD
70992001-12-29 Akim Demaille <akim@epita.fr>
7100
7101 * src/bison.simple: Do not provide a default for YYSTYPE and
7102 YYLTYPE before the user's prologue. Otherwise it's hardly... a
7103 default.
7104
82c035a8
AD
71052001-12-29 Akim Demaille <akim@epita.fr>
7106
7107 Mid-rule actions are simply... ignored!
7108
7109 * src/reader.c (readgram): Be sure to attach mid-rule actions to
7110 the empty-rule associated to the dummy symbol, not to the host
7111 rule.
7112 * tests/actions.at (Mid-rule actions): New.
7113
8419d367
AD
71142001-12-29 Akim Demaille <akim@epita.fr>
7115
7116 Memory leak.
7117
7118 * src/reader.c (reader): Free grammar.
7119
375d5806
AD
71202001-12-29 Akim Demaille <akim@epita.fr>
7121
7122 Memory leak.
7123
7124 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
7125 since it allocates it for each state, although only one is needed.
7126 (allocate_storage): Do it here.
7127
f51cb8ff
AD
71282001-12-29 Akim Demaille <akim@epita.fr>
7129
7130 * src/options.h, src/options.c (create_long_option_table): Rename
7131 as...
7132 (long_option_table_new): this, with a clearer prototype.
7133 (percent_table): Remove, unused,
7134 * src/getargs.c (getargs): Adjust.
7135
29e88316
AD
71362001-12-29 Akim Demaille <akim@epita.fr>
7137
7138 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
7139 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
7140 as states.
7141
b9f71f19
AD
71422001-12-29 Akim Demaille <akim@epita.fr>
7143
7144 * src/lalr.c (build_relations): Rename `states' as `states1'.
7145 Sorry, I don't understand exactly what it is, no better name...
7146
1a2b5d37
AD
71472001-12-29 Akim Demaille <akim@epita.fr>
7148
7149 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
7150 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
7151 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
7152 as rules.
7153
1cca533e
AD
71542001-12-29 Akim Demaille <akim@epita.fr>
7155
7156 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
7157 ago.
7158
c03ae966
AD
71592001-12-29 Akim Demaille <akim@epita.fr>
7160
7161 * src/reader.c, src/reader.h (user_toknums): Remove.
7162 Adjust all users to use symbols[i]->user_token_number.
7163
5a670b1e
AD
71642001-12-29 Akim Demaille <akim@epita.fr>
7165
7166 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
7167 Adjust all users to use symbols[i]->prec or ->assoc.
7168
ad949da9
AD
71692001-12-29 Akim Demaille <akim@epita.fr>
7170
7171 * src/reader.c, src/reader.h (tags): Remove.
7172 Adjust all users to use symbols[i]->tag.
7173
0e78e603
AD
71742001-12-29 Akim Demaille <akim@epita.fr>
7175
7176 * src/gram.h, src/gram.c (symbols): New, similar to state_table
7177 and rule_table.
7178 * src/reader.c (packsymbols): Fill this table.
7179 Drop sprec.
7180 * src/conflicts.c (resolve_sr_conflict): Adjust.
7181 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
7182 single table.
7183 Use symbols[i]->tag instead of tags[i].
7184
213e640e
AD
71852001-12-29 Akim Demaille <akim@epita.fr>
7186
7187 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
7188 In addition, put a comment in there, to replace...
7189 * tests/regression.at (%union and C comments): Remove.
7190
e7b8bef1
AD
71912001-12-29 Akim Demaille <akim@epita.fr>
7192
7193 * tests/regression.at (Web2c Actions): Blindly move the actual
7194 output as expected output. The contents *seem* right to me, but I
7195 can't pretend reading perfectly parser tables... Nonetheless, all
7196 the other tests pass correctly, the table look OK, even though the
7197 presence of `$axiom' is to be noted: AFAICS it is useless (but
7198 harmless).
7199
b68e7744
AD
72002001-12-29 Akim Demaille <akim@epita.fr>
7201
7202 * src/reader.c (readgram): Don't add the rule 0 if there were no
7203 rules read. In other words, add it _after_ having performed
7204 grammar sanity checks.
7205 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
7206
78d5bae9
AD
72072001-12-29 Akim Demaille <akim@epita.fr>
7208
7209 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
7210 visible, and some states have now a different number.
7211
ff442794
AD
72122001-12-29 Akim Demaille <akim@epita.fr>
7213
7214 * src/reader.c (readgram): Bind the initial rule's lineno to that
7215 of the first rule.
7216 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
7217 (Solved SR Conflicts): Adjust rule 0's line number.
7218
610ab194
AD
72192001-12-29 Akim Demaille <akim@epita.fr>
7220
7221 Fix the `GAWK Grammar' failure.
7222
7223 * src/LR0.c (final_state): Initialize to -1 so that we do compute
7224 the reductions of the first state which was mistakenly confused
7225 with the final state because precisely final_state was initialized
7226 to 0.
7227 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
7228 now noticed by Bison.
7229 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
7230 have a reduction on $default.
7231
29d29c8f
AD
72322001-12-29 Akim Demaille <akim@epita.fr>
7233
7234 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
7235 rule line numbers.
7236 * src/closure.c (print_closure): Likewise.
7237 * src/derives.c (print_derives): Likewise.
7238 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
7239 now.
7240
7c6b64d0
AD
72412001-12-29 Akim Demaille <akim@epita.fr>
7242
7243 * src/lalr.c (lookaheads_print): New.
7244 (lalr): Call it when --trace-flag.
7245 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
7246 are dumped.
7247
3d4daee3
AD
72482001-12-29 Akim Demaille <akim@epita.fr>
7249
7250 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
7251 when walking through ritem, even via rule->rhs.
7252 * src/reduce.c (dump_grammar, useful_production, reduce_output)
7253 (useful_production, useless_nonterminals): Likewise.
7254 (reduce_grammar_tables): Likewise, plus update nritems.
7255 * src/nullable.c (set_nullable): Likewise.
7256 * src/lalr.c (build_relations): Likewise.
7257 * tests/sets.at (Nullable): Adjust.
7258 Fortunately, now, the $axiom is no longer nullable.
7259
9e7f6bbd
AD
72602001-12-29 Akim Demaille <akim@epita.fr>
7261
7262 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
7263 the 0-sentinel.
7264 * src/gram.c (ritem_longest_rhs): Likewise.
7265 * src/reduce.c (nonterminals_reduce): Likewise.
7266 * src/print_graph.c (print_graph): Likewise.
7267 * src/output.c (output_rule_data): Likewise.
7268 * src/nullable.c (set_nullable): Likewise.
7269
255ef638
AD
72702001-12-29 Akim Demaille <akim@epita.fr>
7271
7272 * src/output.c: Comment changes.
7273
0d8a7363
AD
72742001-12-27 Paul Eggert <eggert@twinsun.com>
7275
7276 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
7277 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
7278 Sparc, as they were causing more porting problems than the
7279 (minor) performance improvement was worth.
7280
7281 Also, catch up with 1.31's YYSTD.
7282
3db472b9
AD
72832001-12-27 Akim Demaille <akim@epita.fr>
7284
7285 * src/output.c (output_gram): Rely on nritems, not the
7286 0-sentinel. See below.
7287 Use -1 as separator, not 0.
7288 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
7289 Rely on -1 as separator in yyrhs, instead of 0.
7290 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
7291 twice `Now at end of input', therefore there are two lines less to
7292 expect.
7293
b365aa05
AD
72942001-12-27 Akim Demaille <akim@epita.fr>
7295
7296 * tests/regression.at (Unresolved SR Conflicts):
7297 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
7298 below.
7299
30171f79
AD
73002001-12-27 Akim Demaille <akim@epita.fr>
7301
7302 * src/LR0.c (new_state): Recognize the final state by the fact it
7303 is reached by eoftoken.
7304 (insert_start_shifting_state, insert_eof_shifting_state)
7305 (insert_accepting_state, augment_automaton): Remove, since now
7306 these states are automatically computed from the initial state.
7307 (generate_states): Adjust.
7308 * src/print.c: When reporting a rule number to the user, substract
7309 1, so that the axiom rule is rule 0, and the first user rule is 1.
7310 * src/reduce.c: Likewise.
7311 * src/print_graph.c (print_core): For the time being, just as for
7312 the report, depend upon --trace-flags to dump the full set of
7313 items.
7314 * src/reader.c (readgram): Once the grammar read, insert the rule
7315 0: `$axiom: START-SYMBOL $'.
7316 * tests/set.at: Adjust: rule 0 is now displayed, and since the
7317 number of the states has changed (the final state is no longer
7318 necessarily the last), catch up.
7319
75142d45
AD
73202001-12-27 Akim Demaille <akim@epita.fr>
7321
7322 Try to make the use of the eoftoken valid. Given that its value
7323 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
7324 is used instead of > 0 where appropriate, (ii), depend upon nritems
7325 instead of the 0-sentinel.
7326
7327 * src/gram.h, src/gram.c (nritems): New.
7328 Expected to be duplication of nitems, but for the time being...
7329 * src/reader.c (packgram): Assert nritems and nitems are equal.
7330 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
7331 * src/closure.c (print_closure, print_fderives): Likewise.
7332 * src/gram.c (ritem_print): Likewise.
7333 * src/print.c (print_core, print_grammar): Likewise.
7334 * src/print_graph.c: Likewise.
7335
b7c49edf
AD
73362001-12-27 Akim Demaille <akim@epita.fr>
7337
7338 * src/main.c (main): If there are complains after grammar
7339 reductions, then output the report anyway if requested, then die.
7340 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
7341 * src/reader.c (eoftoken): New.
7342 (parse_token_decl): If the token being defined has value `0', it
7343 is the eoftoken.
7344 (packsymbols): No longer hack `tags' to insert `$' by hand.
7345 Be sure to preserve the value of the eoftoken.
7346 (reader): Make sure eoftoken is defined.
7347 Initialize nsyms to 0: now eoftoken is created just like the others.
7348 * src/print.c (print_grammar): Don't special case the eof token.
7349 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
7350 lie anyway, albeit pleasant.
7351 * tests/calc.at: Exercise error messages with eoftoken.
7352 Change the grammar so that empty input is invalid.
7353 Adjust expectations.
7354 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
7355
ec2da99f
AD
73562001-12-27 Akim Demaille <akim@epita.fr>
7357
7358 * configure.in: Check the protos of strchr ans strspn.
7359 Replace strchr if needed.
7360 * src/system.h: Provide the protos of strchr, strspn and memchr if
7361 missing.
7362 * lib/strchr.c: New.
7363 * src/reader.c (symbols_save): Use strchr.
7364
8adfa272
AD
73652001-12-27 Akim Demaille <akim@epita.fr>
7366
7367 * src/print.c, src/print_graph.c (escape): New.
7368 Use it to quote the TAGS outputs.
7369 * src/print_graph.c (print_state): Now errors are in red, and
7370 reductions in green.
7371 Prefer high to wide: output the state number on a line of its own.
7372
80dac38c
AD
73732001-12-27 Akim Demaille <akim@epita.fr>
7374
7375 * src/state.h, src/state.c (reductions_new): New.
7376 * src/LR0.c (set_state_table): Let all the states have a
7377 `reductions', even if reduced to 0.
7378 (save_reductions): Adjust.
7379 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
7380 * src/print.c (print_reductions, print_actions): Adjust.
7381 * src/output.c (action_row): Adjust.
7382
2cec70b9
AD
73832001-12-27 Akim Demaille <akim@epita.fr>
7384
7385 * src/state.h, src/state.c (errs_new, errs_dup): New.
7386 * src/LR0.c (set_state_table): Let all the states have an errs,
7387 even if reduced to 0.
7388 * src/print.c (print_errs, print_reductions): Adjust.
7389 * src/output.c (output_actions, action_row): Adjust.
7390 * src/conflicts.c (resolve_sr_conflict): Adjust.
7391
13ca549a
AD
73922001-12-27 Akim Demaille <akim@epita.fr>
7393
7394 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
7395
5092aba5
AD
73962001-12-27 Akim Demaille <akim@epita.fr>
7397
7398 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
7399 * src/print.c: here.
7400 (lookaheadset, shiftset): New, used as additional storage by
7401 print_reductions.
7402 (print_results): Adjust.
7403 (print_shifts, print_gotos, print_errs): New, extracted from...
7404 (print_actions): here.
7405 * src/print_graph.c (print_actions): Remove dead code.
7406
11e2beca
AD
74072001-12-27 Akim Demaille <akim@epita.fr>
7408
7409 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
7410 `$n' and `@n'.
7411
dac3c910
AD
74122001-12-27 Akim Demaille <akim@epita.fr>
7413
7414 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
7415 (build_relations): Adjust.
7416
d0b0fefa
AD
74172001-12-27 Akim Demaille <akim@epita.fr>
7418
7419 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
7420 duplication.
7421
adc8c848
AD
74222001-12-27 Akim Demaille <akim@epita.fr>
7423
7424 * src/reader.c (packgram): Catch nitems overflows.
7425
14d293ac
AD
74262001-12-27 Akim Demaille <akim@epita.fr>
7427
7428 * src/files.c, src/files.h (guard_obstack): Remove.
7429 * src/output.c (output): Adjust.
7430 * src/reader.c (parse_braces): New, factoring...
7431 (copy_action, copy_guard): these two which are renamed as...
7432 (parse_action, parse_guard): these.
7433 As a voluntary consequence, using braces around guards is now
7434 mandatory.
7435
f499b062
AD
74362001-12-27 Akim Demaille <akim@epita.fr>
7437
7438 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
7439 * src/reader.c (symbol_list): `guard' and `guard_line' are new
7440 members.
7441 (symbol_list_new): Adjust.
7442 (copy_action): action_line is the first line, not the last.
7443 (copy_guard): Just as for actions, store the `action' only, not
7444 the switch/case/break flesh.
7445 Don't parse the user action that might follow the guard, let...
7446 (readgram): do it, i.e., now, there can be an action after a
7447 guard.
7448 In other words the guard is just explicitly optional.
7449 (packgram): Adjust.
7450 * src/output.c (guards_output): New.
7451 (output_parser): Call it when needed.
7452 (output): Also free the guard and attrs obstacks.
7453 * src/files.c, src/files.h (obstack_save): Remove.
7454 (output_files): Remove.
7455 As a result, if one needs the former `.act' file, using an
7456 appropriate skeleton which requires actions and guards is now
7457 required.
7458 * src/main.c (main): Adjust.
7459 * tests/semantic.at: New.
7460 * tests/regression.at: Use `input.y' as input file name.
7461 Avoid 8+3 problems by requiring input.c when the test needs the
7462 parser.
7463
d945f5cd
AD
74642001-12-27 Akim Demaille <akim@epita.fr>
7465
7466 * src/reader.c (symbol_list_new): Be sure to initialize all the
7467 fields.
7468
d200e455
AD
74692001-12-27 Akim Demaille <akim@epita.fr>
7470
7471 All the hacks using a final pseudo state are now useless.
7472
7473 * src/LR0.c (set_state_table): state_table holds exactly nstates.
7474 * src/lalr.c (nLA): New.
7475 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
7476 instead of lookaheadsp from the pseudo state (nstate + 1).
7477
f9507c28
AD
74782001-12-27 Akim Demaille <akim@epita.fr>
7479
7480 * src/output.c (action_row, token_actions): Use a state_t instead
7481 of a integer, and nlookaheads instead of the following state's
7482 lookaheadsp.
7483
065fbd27
AD
74842001-12-27 Akim Demaille <akim@epita.fr>
7485
7486 * src/conflicts.c (log_resolution, flush_shift)
7487 (resolve_sr_conflict, set_conflicts, solve_conflicts)
7488 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
7489 (conflicts_print, print_reductions): Use a state_t instead of an
7490 integer when referring to a state.
7491 As much as possible, depend upon nlookaheads, instead of the
7492 `lookaheadsp' member of the following state (since lookaheads of
7493 successive states are successive, the difference between state n + 1
7494 and n served as the number of lookaheads for state n).
7495 * src/lalr.c (add_lookback_edge): Likewise.
7496 * src/print.c (print_core, print_actions, print_state)
7497 (print_results): Likewise.
7498 * src/print_graph.c (print_core, print_actions, print_state)
7499 (print_graph): Likewise.
7500 * src/conflicts.h: Adjust.
7501
1b177bd7
AD
75022001-12-27 Akim Demaille <akim@epita.fr>
7503
7504 * src/bison.hairy: Formatting/comment changes.
7505 ANSIfy.
7506 Remove `register' indications.
7507 Add plenty of `static'.
7508
7742ddeb
AD
75092001-12-27 Akim Demaille <akim@epita.fr>
7510
7511 * src/output.c (prepare): Drop the muscle `ntbase' which
7512 duplicates ntokens.
7513 * src/bison.simple: Formatting/comment changes.
7514 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
7515 is an undocumented synonym.
7516
1fa14068
AD
75172001-12-22 Akim Demaille <akim@epita.fr>
7518
7519 * src/output.c (output_table_data): Change the prototype to use
7520 `int' for array ranges: some invocations do pass an int, not a
7521 short.
7522 Reported by Wayne Green.
7523
b9752825
AD
75242001-12-22 Akim Demaille <akim@epita.fr>
7525
7526 Some actions of web2c.y are improperly triggered.
7527 Reported by Mike Castle.
7528
7529 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
7530 * tests/regression.at (Web2c): Rename as...
7531 (Web2c Report): this.
7532 (Web2c Actions): New.
7533
776209d6
AD
75342001-12-22 Akim Demaille <akim@epita.fr>
7535
7536 Reductions in web2c.y are improperly reported.
7537 Reported by Mike Castle.
7538
7539 * src/conflicts.c (print_reductions): Fix.
7540 * tests/regression.at (Web2c): New.
7541
275fc3ad
AD
75422001-12-18 Akim Demaille <akim@epita.fr>
7543
7544 Some host fail on `assert (!"foo")', which expands to
7545 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
7546 Reported by Nelson Beebee.
7547
7548 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
7549 `#define it_succeeded 0' and `assert (it_succeeded)'.
7550
897668ee
MA
75512001-12-17 Marc Autret <autret_m@epita.fr>
7552
7553 * src/bison.simple: Don't hard code the skeleton line and filename.
7554 * src/output.c (output_parser): Rename 'line' as 'output_line'.
7555 New line counter 'skeleton_line' (skeleton-line muscle).
7556
ab3399e0
PE
75572001-12-17 Paul Eggert <eggert@twinsun.com>
7558
7559 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
7560 YYDEBUG must be defined to a nonzero value.
7561
7562 * src/bison.simple (yytname): Do not assume that the user defines
7563 YYDEBUG to a properly parenthesized expression.
7564
3877f72b
AD
75652001-12-17 Akim Demaille <akim@epita.fr>
7566
7567 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
7568 nlookaheads is a new member.
7569 Adjust all users.
7570 * src/lalr.h (nlookaheads): Remove this orphan declaration.
7571 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
7572 state.
776209d6 7573
331dbc1b
AD
75742001-12-17 Akim Demaille <akim@epita.fr>
7575
7576 * src/files.h, src/files.c (open_files, close_files): Remove.
7577 * src/main.c (main): Don't open/close files, nor invoke lex_free,
7578 let...
7579 * src/reader.c (reader): Do it.
776209d6 7580
be750e4c
AD
75812001-12-17 Akim Demaille <akim@epita.fr>
7582
7583 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 7584
709ae8c6
AD
75852001-12-17 Akim Demaille <akim@epita.fr>
7586
7587 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
7588 (flush_reduce): New.
7589 (resolve_sr_conflict): Adjust.
776209d6 7590
f87685c3
AD
75912001-12-17 Akim Demaille <akim@epita.fr>
7592
7593 * src/output.c (output_obstack): Be static and rename as...
7594 (format_obstack): this, to avoid any confusion with files.c's
7595 output_obstack.
7596 * src/reader.h (muscle_obstack): Move to...
7597 * src/output.h: here, since it's defined in output.c.
7598
837491d8
AD
75992001-12-17 Akim Demaille <akim@epita.fr>
7600
7601 * src/output.c (action_row, save_column, default_goto)
7602 (sort_actions, matching_state, pack_vector): Better variable
7603 locality.
7604
796d61fb
AD
76052001-12-17 Akim Demaille <akim@epita.fr>
7606
7607 * src/output.c: Various formatting changes.
776209d6 7608
64d15509
AD
76092001-12-17 Akim Demaille <akim@epita.fr>
7610
7611 * src/files.c (output_files): Free the output_obstack.
7612 * src/main.c (main): Call print and print_graph conditionally.
7613 * src/print.c (print): Work unconditionally.
7614 * src/print_graph.c (print_graph): Work unconditionally.
7615 * src/conflicts.c (log_resolution): Output only if verbose_flag.
7616
fbc8ecb7
MA
76172001-12-16 Marc Autret <autret_m@epita.fr>
7618
7619 * src/output.c (actions_output): Fix. When we use %no-lines,
7620 there is one less line per action.
7621
f0440388
MA
76222001-12-16 Marc Autret <autret_m@epita.fr>
7623
7624 * src/bison.simple: Remove a useless #line directive.
7625 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
7626 * src/output.c (get_lines_number): New.
776209d6 7627 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
7628 output muscles.
7629 Fix line numbering.
7630 (actions_output): Computes the number of lines taken by actions.
7631 (output_master_parser): Insert new skeleton which is the name of
7632 the output parser file name.
7633
a79986b8
MA
76342001-12-15 Marc Autret <autret_m@epita.fr>
7635
7636 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
7637
4ec8e00f
MA
76382001-12-15 Marc Autret <autret_m@epita.fr>
7639
7640 * src/output.c (output_gram): Keep track of the hairy one.
7641
1a4648ff
AD
76422001-12-15 Akim Demaille <akim@epita.fr>
7643
7644 Make `make distcheck' work.
7645
7646 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
7647 system.h which uses libgettext.h.
7648
9c2c67e6
AD
76492001-12-15 Akim Demaille <akim@epita.fr>
7650
7651 * src/nullable.c (set_nullable): Useless rules must be skipped,
7652 otherwise, since we range over their symbols, we might look at a
7653 nonterminal which no longer ``exists'', i.e., it is not counted in
7654 `nvars', hence we overflow our arrays.
7655
93ede233
AD
76562001-12-15 Akim Demaille <akim@epita.fr>
7657
7658 The header can also be produced directly, without any obstack!
7659 Yahoo!
7660
7661 * src/files.c, src/files.h (defines_obstack): Remove.
7662 (compute_header_macro): Global.
7663 (defines_obstack_save): Remove.
7664 * src/reader.c (parse_union_decl): No longer output to
7665 defines_obstack: its content can be found in the `stype' muscle
7666 anyway.
7667 (output_token_translations): Merge into...
7668 (symbols_output): this.
7669 Rename as...
7670 (symbols_save): this.
7671 (reader): Adjust.
7672 * src/output.c (header_output): New.
7673 (output): Call it.
7674
2666f928
AD
76752001-12-15 Akim Demaille <akim@epita.fr>
7676
7677 * src/reader.c (parse_union_decl): Instead of handling two obstack
7678 simultaneously, use one to define the `stype' muscle, and use the
7679 value of the latter to fill defines_obstack.
7680 (copy_comment): Remove.
7681 (copy_comment2): Work for a single obstack.
7682 Rename as...
7683 (copy_comment): this.
7684
428046f8
AD
76852001-12-15 Akim Demaille <akim@epita.fr>
7686
7687 * src/lex.c, src/lex.h (xgetc): No longer static.
7688 * src/reader.c (parse_union_decl): Revamp.
7689
ea52d706
AD
76902001-12-15 Akim Demaille <akim@epita.fr>
7691
7692 Still making progress in separating Bison into (i) input, (ii)
7693 process, (iii) output: now we can directly output the parser file
7694 without using table_obstack at all.
7695
7696 * src/files.c, src/files.h (table_obstack): Bye bye.
7697 (parser_file_name): New.
7698 * src/files.c (compute_output_file_names): Compute it.
7699 * src/output.c (actions_output, output_parser)
7700 (output_master_parser): To a file instead of an obstack.
7701
3f96f4dc
AD
77022001-12-15 Akim Demaille <akim@epita.fr>
7703
7704 Attach actions to rules, instead of pre-outputting them to
7705 actions_obstack.
7706
7707 * src/gram.h (rule_t): action and action_line are new members.
7708 * src/reader.c (symbol_list): Likewise.
7709 (copy_action): Save the actions within the rule.
7710 (packgram): Save them in rule_table.
7711 * src/output.c (actions_output): New.
7712 (output_parser): Use it on `%%actions'.
7713 (output_rule_data): Don't free rule_table.
7714 (output): Do it.
7715 (prepare): Don't save the `action' muscle.
7716 * src/bison.simple: s/%%action/%%actions/.
7717
51576fb3
AD
77182001-12-15 Akim Demaille <akim@epita.fr>
7719
7720 * src/reader.c (copy_action): When --yacc, don't append a `;'
7721 to the user action: let it fail if lacking.
dee049eb 7722 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 7723
2648a72d
AD
77242001-12-14 Akim Demaille <akim@epita.fr>
7725
7726 * src/lex.c (literalchar): Simply return the char you decoded, non
7727 longer mess around with obstacks and int pointers.
7728 Adjust all callers.
7729
92790e5b
AD
77302001-12-14 Akim Demaille <akim@epita.fr>
7731
7732 * src/lex.c (literalchar): Don't escape the special characters,
7733 just decode them, and keep them as char (before, eol was output as
7734 the 2 char string `\n' etc.).
7735 * src/output.c (output_rule_data): Use quotearg to output the
7736 token strings.
7737
927c1557
PE
77382001-12-13 Paul Eggert <eggert@twinsun.com>
7739
7740 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
7741 Do not infringe on the global user namespace when using C++.
7742 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
7743 All uses of `fprintf' and `stderr' changed.
7744
7745 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
7746
ed8e1f68
AD
77472001-12-13 Akim Demaille <akim@epita.fr>
7748
7749 The computation of nullable is broken: it doesn't handle empty
7750 RHS's properly.
7751
7752 * tests/torture.at (GNU AWK Grammar): New.
7753 * tests/sets.at (Nullable): New.
7754 * src/nullable.c (set_nullable): Instead of blindly looping over
7755 `ritems', loop over the rules, and then over their rhs's.
7756
7757 Work around Autotest bugs.
7758
7759 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
7760 frame, because Autotest understand lines starting with a `+' as
7761 traces from the shell. Then, they are not processed properly.
7762 Admittedly an Autotest bug, but we don't have time to wait for
7763 Autotest to catch up.
7764 * tests/regression.at (Broken Closure): Adjust to the new table
7765 frames.
7766 Move to...
7767 * tests/sets.at: here.
7768
cb581495
AD
77692001-12-13 Akim Demaille <akim@epita.fr>
7770
7771 * src/closure.c (closure): Use nrules instead of playing tricks
7772 with BITS_PER_WORD.
7773
2e729273
AD
77742001-12-13 Akim Demaille <akim@epita.fr>
7775
7776 * src/print.c (print_actions): Output the handling of `$' as the
7777 traces do: shifting the token EOF. Before EOF was treated as a
7778 nonterminal.
7779 * tests/regression.at: Adjust some tests.
7780 * src/print_graph.c (print_core): Complete the set of items via
7781 closure. The next-to-final and final states are still unsatisfying,
7782 but that's to be addressed elsewhere.
7783 No longer output the rule numbers, but do output the state number.
7784 A single loop for the shifts + gotos is enough, but picked a
7785 distinct color for each.
7786 (print_graph): Initialize and finalize closure.
7787
107f7dfb
AD
77882001-12-13 Akim Demaille <akim@epita.fr>
7789
7790 * src/reader.c (readgram): Remove dead code, an strip useless
7791 braces.
7792 (get_type): Remove, unused.
7793
9b53a24f
AD
77942001-12-12 Akim Demaille <akim@epita.fr>
7795
7796 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
7797 on that of lib/error.c.
7798
dbfb6dcd
AD
77992001-12-12 Akim Demaille <akim@epita.fr>
7800
7801 Some hosts don't like `/' in includes.
7802
7803 * src/system.h: Include libgettext.h without qualifying the path.
7804 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
7805 $(top_srcdir).
7806
c25fb648
MA
78072001-12-11 Marc Autret <autret_m@epita.fr>
7808
7809 * src/output.c (output_parser): Remove useless muscle.
7810
710ddc4f
MA
78112001-12-11 Marc Autret <autret_m@epita.fr>
7812
7813 * src/bison.simple: Remove #line just before %%epilogue. It
7814 is now handled in ...
7815 * src/reader.c (read_additionnal_code): Add the output of a
7816 #line for the epilogue.
7817
e83d80b8
MA
78182001-12-10 Marc Autret <autret_m@epita.fr>
7819
927c1557 7820 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
7821 replace precedent remove.
7822 * src/bison.simple: Remove #line before %%prologue because
7823 %%input-line is wrong at this time.
7824
971d5158
MA
78252001-12-10 Marc Autret <autret_m@epita.fr>
7826
7827 * src/reader.c (symbols_output): Clean up.
927c1557 7828 * src/output.c (output_gram, output): Clean up.
971d5158 7829
5edafffd
AD
78302001-12-10 Akim Demaille <akim@epita.fr>
7831
7832 * src/lalr.c (initialize_lookaheads): New. Extracted from...
7833 * src/LR0.c (set_state_table): here.
7834 * src/lalr.c (lalr): Call it.
7835
0279f8e9
AD
78362001-12-10 Akim Demaille <akim@epita.fr>
7837
7838 * src/state.h (shifts): Remove the `number' member: shifts are
7839 attached to state, hence no longer need to be labelled with a
7840 state number.
7841
190c4f5f
AD
78422001-12-10 Akim Demaille <akim@epita.fr>
7843
7844 Now that states have a complete set of members, the linked list of
7845 shifts is useless: just fill directly the state's shifts member.
7846
7847 * src/state.h (shifts): Remove the `next' member.
7848 * src/LR0.c (first_state, last_state): Remove.
7849 Adjust the callers.
7850 (augment_automaton): Don't look for the shifts that must be added
7851 a shift on EOF: it is those of the state we looked for! But now,
7852 since shifts are attached, it is no longer needed to looking
7853 merely by its id: its number.
7854
2a73b93d
AD
78552001-12-10 Akim Demaille <akim@epita.fr>
7856
7857 * src/LR0.c (augment_automaton): Better variable locality.
7858 Remove an impossible branch: if there is a state corresponding to
7859 the start symbol being shifted, then there is shift for the start
7860 symbol from the initial state.
7861
74392f6a
AD
78622001-12-10 Akim Demaille <akim@epita.fr>
7863
7864 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
7865 only when appropriate: when insert_start_shifting_state' is not
7866 invoked.
7867 * tests/regression.at (Rule Line Numbers): Adjust.
7868
37c82725
AD
78692001-12-10 Akim Demaille <akim@epita.fr>
7870
7871 * src/LR0.c (augment_automaton): Now that all states have shifts,
7872 merge the two cases addition shifts to the initial state.
7873
6a164e0c
AD
78742001-12-10 Akim Demaille <akim@epita.fr>
7875
7876 * src/lalr.c (set_state_table): Move to...
7877 * src/LR0.c: here.
7878 * src/lalr.c (lalr): Don't call it...
7879 * src/LR0.c (generate_states): do it.
7880 * src/LR0.h (first_state): Remove, only the table is used.
7881
7215de24
AD
78822001-12-10 Akim Demaille <akim@epita.fr>
7883
7884 * src/LR0.h (first_shift, first_reduction): Remove.
7885 * src/lalr.c: Don't use first_shift: find shifts through the
7886 states.
7887
80e25d4d
AD
78882001-12-10 Akim Demaille <akim@epita.fr>
7889
7890 * src/LR0.c: Attach shifts to states as soon as they are
7891 computed.
7892 * src/lalr.c (set_state_table): Instead of assigning shifts to
7893 state, just assert that the mapping was properly done.
7894
0ab3728b
AD
78952001-12-10 Akim Demaille <akim@epita.fr>
7896
7897 * src/LR0.c (insert_start_shift): Rename as...
7898 (insert_start_shifting_state): this.
7899 (insert_eof_shifting_state, insert_accepting_state): New.
7900 (augment_automaton): Adjust.
7901 Better locality of the variables.
7902 When looking if the start_symbol is shifted from the initial
7903 state, using `while (... symbol != start_symbol ...)' sounds
7904 better than `while (... symbol < start_symbol ...)': If fail
7905 to see how the order between symbols could be relevant!
7906
78af9bbc
AD
79072001-12-10 Akim Demaille <akim@epita.fr>
7908
7909 * src/getargs.h: Don't declare `spec_name_prefix' and
7910 `spec_file_prefix', declared by src/files.h.
7911 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
7912 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
7913 * src/output.c (prepare): Adjust.
7914 * src/reader.c (symbols_output): Likewise.
7915 * src/vmsgetargs.c: Vaguely adjust, but who cares?
7916
bdef2a41
AD
79172001-12-10 Akim Demaille <akim@epita.fr>
7918
7919 * src/muscle_tab.c (muscle_init): NULL is a better default than
7920 `"0"'.
7921
3735969c
AD
79222001-12-10 Akim Demaille <akim@epita.fr>
7923
7924 * src/reader.c (reader): Calling symbols_output once is enough.
7925
49701457
AD
79262001-12-10 Akim Demaille <akim@epita.fr>
7927
7928 Now that states have a complete set of members, the linked list of
7929 reductions is useless: just fill directly the state's reductions
7930 member.
7931
7932 * src/state.h (struct reductions): Remove member `number' and
7933 `next'.
7934 * src/LR0.c (first_reduction, last_reduction): Remove.
7935 (save_reductions): Don't link the new reductions, store them in
7936 this_state.
7937 * src/lalr.c (set_state_table): No need to attach reductions to
7938 states, it's already done.
7939 * src/output.c (output_actions): No longer free the shifts, then
7940 the reductions, then the states: free all the states and their
7941 members.
7942
0edad749
AD
79432001-12-10 Akim Demaille <akim@epita.fr>
7944
7945 * src/options.c (OPTN, DRTV, BOTH): New.
7946 (option_table): Use them.
7947
0edad749
AD
7948 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
7949 the job of system.h.
7950 * src/options.c: Don't include stdio.h and xalloc.h for the same
7951 reasons.
7952
5449dd0f
AD
79532001-12-10 Akim Demaille <akim@epita.fr>
7954
7955 * src/output.c (output, prepare): Make sure the values of the
7956 muscles `action' and `prologue' are 0-terminated.
7957
a870c567
AD
79582001-12-10 Akim Demaille <akim@epita.fr>
7959
7960 Clean up GCC warnings.
7961
7962 * src/reader.c (copy_action): `buf' is not used.
7963 (parse_skel_decl): Be static.
7964 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
7965 * src/options.h (create_long_option_table): Have a real prototype.
7966 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
7967 (hash_delete_at): Return const void *.
7968 Adjust casts to preserve the const.
7969
80df8768
AD
79702001-12-10 Akim Demaille <akim@epita.fr>
7971
7972 * configure.in: Require 2.52g.
7973 M4 is not needed, but AUTOM4TE is.
7974 * m4/m4.m4: Remove.
7975 * tests/Makefile.am: Adjust.
7976
f693ad14
AD
79772001-12-10 Akim Demaille <akim@epita.fr>
7978
7979 One structure for states is enough, even though theoretically
7980 there are LR(0) states and LALR(1) states.
7981
7982 * src/lalr.h (state_t): Remove.
7983 (state_table): Be state_t **, not state_t *.
7984 * src/state.h (core, CORE_ALLOC): Rename as...
7985 (state_t, STATE_ALLOC): this.
7986 Add the LALR(1) members: shifts, reductions, errs.
7987 * src/LR0.c (state_table): Rename as...
7988 (state_hash): this, to avoid name clashes with the global
7989 `state_table'.
7990 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
7991 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
7992
74ffbcb6
AD
79932001-12-10 Akim Demaille <akim@epita.fr>
7994
7995 Bison dumps core on bash.y.
7996 Reported by Pascal Bart.
7997
7998 * src/warshall.c (bitmatrix_print): New.
7999 (TC): Use it.
8000 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
8001 j must be the outer loop.
8002 * tests/regression.at (Broken Closure): New.
8003
07708e19
AD
80042001-12-05 Akim Demaille <akim@epita.fr>
8005
8006 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
8007 its argument.
ba1ecc07 8008 Reported by Peter Hamorsky.
07708e19 8009
92b16366
AD
80102001-12-05 Akim Demaille <akim@epita.fr>
8011
8012 * src/conflicts.c (err_table): Remove.
8013 (resolve_sr_conflict): Adjust.
8014 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
8015 Rename as...
8016 (state_t.reductions, state_t.shifts): this.
8017
076ab033
AD
80182001-12-05 Akim Demaille <akim@epita.fr>
8019
8020 * src/reduce.c (reduce_grammar_tables): No longer disable the
8021 removal of useless rules via CPP but via `if (0)', so that the
8022 compiler still check the code is valid.
8023 For instance, it should have noticed `rline' no longer exists: use
8024 the `line' member of rule_t.
8025 * src/gram.c (dummy, rline): Remove, unused.
8026
3843c413
AD
80272001-12-05 Akim Demaille <akim@epita.fr>
8028
8029 * src/output.c (pack_vector): Use assert, not berror.
8030 * src/main.c (berror): Remove, unused.
8031
43168960
AD
80322001-12-05 Akim Demaille <akim@epita.fr>
8033
8034 New experimental feature: if --verbose --trace output all the
8035 items of a state, not only its kernel.
8036
8037 * src/print.c (print_core): If `trace_flag', then invoke closure
8038 before outputting the items of the state (print_core is no longer
8039 a correct name them).
8040 (print_results): Invoke new_closure/free_closure if needed.
8041
b2872512
AD
80422001-12-05 Akim Demaille <akim@epita.fr>
8043
8044 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
8045 * src/closure.c, src/closure.h (itemsetsize): Rename as...
8046 (nitemset): for consistency with the rest of the project.
8047
23cbcc6c
AD
80482001-12-05 Akim Demaille <akim@epita.fr>
8049
8050 * src/closure.c (print_closure): Improve.
8051 (closure): Use it for printing input and output.
8052
03ec521c
AD
80532001-12-05 Akim Demaille <akim@epita.fr>
8054
8055 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
8056 indexed by nonterminals.
8057
3a7456dd
AD
80582001-12-05 Akim Demaille <akim@epita.fr>
8059
8060 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
8061 what it was!).
8062 * src/warshall.h: Remove accidental duplication of the content.
8063
1cbcf2e7
AD
80642001-12-05 Akim Demaille <akim@epita.fr>
8065
8066 * src/closure.c (set_fderives): De-obfuscate.
8067
84182270
AD
80682001-12-05 Akim Demaille <akim@epita.fr>
8069
8070 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
8071
3f6f053c
AD
80722001-12-05 Akim Demaille <akim@epita.fr>
8073
8074 * src/closure.c (set_firsts): De-obfuscate.
8075
7a5350ba
AD
80762001-12-05 Akim Demaille <akim@epita.fr>
8077
8078 * src/output.c (action_row): De-obfuscate
8079 using the good o' techniques: arrays not pointers, variable
8080 locality, BITISSET, RESETBIT etc.
8081
d954473d
AD
80822001-12-05 Akim Demaille <akim@epita.fr>
8083
8084 Pessimize the code to simplify it: from now on, all the states
8085 have a valid SHIFTS, which NSHIFTS is possibly 0.
8086
8087 * src/LR0.c (shifts_new): Be global and move to..
8088 * src/state.c, src/state.h: here.
8089 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
8090 * src/print_graph: Adjust.
8091
9839bbe5
AD
80922001-12-05 Akim Demaille <akim@epita.fr>
8093
8094 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
8095 * src/conflicts.c: Use it.
8096 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
8097 incorrectly ``simplified''.
8098
9f136c07
AD
80992001-12-05 Akim Demaille <akim@epita.fr>
8100
8101 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
8102 using the good o' techniques: arrays not pointers, variable
8103 locality, BITISSET, RESETBIT etc.
8104
b608206e
AD
81052001-12-05 Akim Demaille <akim@epita.fr>
8106
8107 * src/state.h (SHIFT_SYMBOL): New.
8108 * src/conflicts.c: Use it to deobfuscate.
8109
52afa962
AD
81102001-12-05 Akim Demaille <akim@epita.fr>
8111
8112 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
8113 (print_reductions): De-obfuscate using the good o' techniques:
8114 arrays not pointers, variable locality, BITISSET.
8115
e74dc321
AD
81162001-12-05 Akim Demaille <akim@epita.fr>
8117
8118 * src/conflicts.c (print_reductions): Arrays, not pointers.
8119 Use BITISSET.
8120
768fca83
AD
81212001-12-05 Akim Demaille <akim@epita.fr>
8122
8123 * src/conflicts.c (print_reductions): Pessimize, but clarify.
8124
a17e599f
AD
81252001-12-05 Akim Demaille <akim@epita.fr>
8126
8127 * src/conflicts.c (print_reductions): Improve variable locality.
8128
a04bc341
AD
81292001-12-05 Akim Demaille <akim@epita.fr>
8130
8131 * src/conflicts.c (print_reductions): Pessimize, but clarify.
8132
c8ea038e
AD
81332001-12-05 Akim Demaille <akim@epita.fr>
8134
8135 * src/conflicts.c (print_reductions): Improve variable locality.
8136
aa2aab3c
AD
81372001-12-05 Akim Demaille <akim@epita.fr>
8138
8139 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
8140 * src/lalr.c: Use them.
8141
b178c8cc
AD
81422001-12-05 Akim Demaille <akim@epita.fr>
8143
8144 * src/LR0.c (augment_automaton): Formatting changes.
8145 Better variable locality.
8146
f67d13aa
AD
81472001-12-05 Akim Demaille <akim@epita.fr>
8148
8149 * src/lalr.c (matrix_print): New.
8150 (transpose): Use it.
8151 Use arrays instead of pointers.
8152
c2713865
AD
81532001-12-05 Akim Demaille <akim@epita.fr>
8154
8155 * src/lalr.c (maxrhs): Move to...
8156 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
8157 * src/lalr.c (build_relations): Adjust.
8158
9887c18a
AD
81592001-12-05 Akim Demaille <akim@epita.fr>
8160
8161 * src/lalr.c (transpose): Free the memory allocated to the
8162 argument, as it is replaced by the results by the unique caller.
8163 (build_relations): Merely invoke transpose: it handles the memory
8164 deallocation.
8165 Improve variable locality.
8166 Avoid variables used as mere abbreviations.
8167 (compute_lookaheads): Use arrays instead of pointers.
8168
4d4f699c
AD
81692001-12-05 Akim Demaille <akim@epita.fr>
8170
8171 * src/lalr.c (initialize_F): Improve variable locality.
8172 Avoid variables used as mere abbreviations.
8173
80a69750
AD
81742001-12-05 Akim Demaille <akim@epita.fr>
8175
8176 * src/derives.c (print_derives): Display the ruleno.
8177 * src/lalr.c (initialize_F, transpose): Better variable locality
8178 to improve readability.
8179 Avoid variables used as mere abbreviations.
8180
fe961097
AD
81812001-12-05 Akim Demaille <akim@epita.fr>
8182
8183 * src/lalr.c (traverse): Use arrays instead of pointers.
8184
e3e4e814
AD
81852001-12-05 Akim Demaille <akim@epita.fr>
8186
8187 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
8188 the handling of squeue.
8189 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
8190
630e182b
AD
81912001-12-05 Akim Demaille <akim@epita.fr>
8192
8193 Because useless nonterminals are now kept alive (instead of being
8194 `destroyed'), we now sometimes examine them, and store information
8195 related to them. Hence we need to know their number, and adjust
8196 memory allocations.
8197
8198 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
8199 static.
8200 * src/LR0.c (allocate_itemsets): The memory allocated to
8201 `symbol_count' was used for two different purpose: once to count
8202 the number of occurrences of each symbol, and later reassigned to
8203 `shift_symbol', containing the symbol that can be shifted from a
8204 given state.
8205 Deobfuscate, i.e., allocate, use and free `symbol_count' here
8206 only, and...
8207 (new_itemsets): Allocate `shift_symbol' here.
8208 (allocate_itemsets): symbol_count includes useless nonterminals.
8209 Make room for them.
8210 (free_storage): Use `free', not `XFREE', for pointers that cannot
8211 be null.
8212
81b51460
AD
82132001-12-05 Akim Demaille <akim@epita.fr>
8214
8215 * src/nullable.c (set_nullable): Deobfuscate the handling of
8216 ritem.
8217 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
8218
3067fbef
AD
82192001-12-05 Akim Demaille <akim@epita.fr>
8220
8221 * src/gram.c, src/gram.h (ritem_print): New.
8222 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
8223 (This useless function was defined only to work around VMS linkers
8224 that can't handle compilation units with variables only).
8225 * src/reduce.c (dump_grammar): Use it to trace the construction of
8226 ritem.
8227
c2bea5f9
PE
82282001-12-04 Paul Eggert <eggert@twinsun.com>
8229
7d27c823
PE
8230 * src/bison.simple (union yyalloc): Change member names
8231 to be the same as the stack names.
8232 (yyparse): yyptr is now union yyalloc *, not char *.
8233 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
8234 and may generate better code on some machines.
c2bea5f9
PE
8235 (yystpcpy): Use prototype if __STDC__ is defined, not just
8236 if __cplusplus is defined.
35687a9d 8237
2c8a9dfa
AD
82382001-11-30 Akim Demaille <akim@epita.fr>
8239
8240 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
8241 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
8242 Gettext doesn't compile cleanly, and dies with -Werror.
8243 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
8244 Include WARNING_CFLAGS here.
8245 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
8246 before being defined.
8247
f4e421e6
AD
82482001-11-27 Paul Eggert <eggert@twinsun.com>
8249
8250 * lib/quotearg.h (quotearg_n, quotearg_n_style):
8251 First arg is int, not unsigned.
8252 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8253 (SIZE_MAX, UINT_MAX): New macros.
8254 (quotearg_n_options): Abort if N is negative.
8255 Avoid overflow check on hosts where size_t is 64 bits and int
8256 is 32 bits, as overflow is impossible there.
8257 Fix off-by-one typo that caused unnecessary reallocation.
8258
7093d0f5
AD
82592001-11-29 Paul Eggert <eggert@twinsun.com>
8260
8261 Name space cleanup in generated parser.
8262
8263 * doc/bison.texinfo (Bison Parser): Discuss system headers
8264 and their effect on the user name space.
8265
8266 * src/bison.simple:
8267 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
8268 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
8269 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
8270
8271 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
8272 on user names when possible.
8273
8274 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
8275 Simplify test for whather <alloca.h> exists.
8276
8277 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
8278
8279 (<stdio.h>): Include if YYDEBUG.
8280
8281 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
8282 ! defined (yyoverflow) && ! defined (yymemcpy).
8283
8284 (yymemcpy, yyparse): Rename local variables as needed so that
8285 they all begin with 'yy'.
8286
8287 (yystrlen, yystpcpy): New functions.
8288
8289 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
8290 All uses changed.
8291
8292 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
8293 instead of relying on string.h functions. Use YYSTACK_ALLOC
8294 and YYSTACK_FREE instead of malloc and free.
8295
fd51e5ff
AD
82962001-11-30 Akim Demaille <akim@epita.fr>
8297
8298 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
8299 before their first uses.
8300 (YYBISON, YYPURE): Move to the top of the output.
8301
7d13ff5f
AD
83022001-11-30 Akim Demaille <akim@epita.fr>
8303
8304 * tests/reduce.at (Useless Nonterminals): Fix.
8305
892a3995
AD
83062001-11-30 Akim Demaille <akim@epita.fr>
8307
8308 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
8309 if body instead of `;' to pacify GCC's warnings.
8310
68f1e3ed
AD
83112001-11-30 Akim Demaille <akim@epita.fr>
8312
8313 Instead of mapping the LHS of unused rules to -1, keep the LHS
8314 valid, but flag the rules as invalid.
8315
8316 * src/gram.h (rule_t): `useful' is a new member.
8317 * src/print.c (print_grammar): Adjust.
8318 * src/derives.c (set_derives): Likewise.
8319 * src/reader.c (packgram, reduce_output): Likewise.
8320 * src/reduce.c (reduce_grammar_tables): Likewise.
8321 * tests/reduce.at (Underivable Rules, Useless Rules): New.
8322
d2d1b42b
AD
83232001-11-30 Akim Demaille <akim@epita.fr>
8324
8325 * src/reduce.c (reduce_output): Formatting changes.
8326 * src/print.c (print_results, print_grammar): Likewise.
8327 * tests/regression.at (Rule Line Numbers)
8328 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
8329
760b53a8
AD
83302001-11-30 Akim Demaille <akim@epita.fr>
8331
8332 * src/reduce.c (nonterminals_reduce): Instead of throwing away
8333 useless nonterminals, move them at the end of the symbol arrays.
8334 (reduce_output): Adjust.
8335 * tests/reduce.at (Useless Nonterminals): Adjust.
8336
00238958
AD
83372001-11-30 Akim Demaille <akim@epita.fr>
8338
8339 * src/reduce.c: Various comment/formatting changes.
8340 (nonterminals_reduce): New, extracted from...
8341 (reduce_grammar_tables): here.
8342 (reduce_grammar): Call nonterminals_reduce.
8343
396452de
PE
83442001-11-29 Paul Eggert <eggert@twinsun.com>
8345
8346 * src/bison.simple (YYSTACK_REALLOC): Remove.
8347 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
8348 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
8349 New macros.
8350 (union yyalloc): New type.
8351 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
8352 an arbitrary restriction on hosts where size_t is wider than int.
8353
8354 (yyparse): Don't dump core if alloca or malloc fails; instead, report
8355 a parser stack overflow. Allocate just one block of memory for all
8356 three stacks, instead of allocating three blocks; this typically is
8357 faster and reduces fragmentation.
8358
8359 Do not limit the number of items in the stack to a value that fits
8360 in 'int', as this is an arbitrary limit on hosts with 64-bit
8361 size_t and 32-bit int.
8362
147e184c
MA
83632001-11-29 Marc Autret <autret_m@epita.fr>
8364
8365 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
8366 of defining YYERROR_VERBOSE.
8367 [AT_DATA]: $4 is now out of C declarations in the prologue.
8368
426cf563
MA
83692001-11-28 Marc Autret <autret_m@epita.fr>
8370
8371 * src/reader.c (parse_dquoted_param): New.
8372 (parse_skel_decl): Use it.
8373 * src/lex.h: Add its prototype.
8374 * src/lex.c (literalchar): Become not static.
8375
c7925b99
MA
83762001-11-28 Marc Autret <autret_m@epita.fr>
8377
8378 * src/output.h: And put its extern declaration here.
8379 * src/output.c (error_verbose): Define here.
8380 (prepare): Echo name modification.
8381 * src/getargs.h: Clean its extern declaration.
8382 * src/getargs.c (error_verbose_flag): Remove.
8383 (getargs): Remove case 'e'.
8384 * src/options.c (option_table): 'error-verbose' is now seen as simple
8385 percent option.
8386 Include output.h.
8387
8388 * src/reader.c (read_declarations): Remove case tok_include.
8389 (parse_include_decl): Remove.
8390 * src/lex.h (token_t): Remove tok_include.
8391 * src/options.c (option_table): 'include' is now a simple command line
8392 option.
8393
5b5d1929
MA
83942001-11-28 Marc Autret <autret_m@epita.fr>
8395
8396 * src/bison.simple: Adjust muscle names.
8397 * src/muscle_tab.c (muscle_init): Also rename the muscles.
8398 * src/output.c (prepare): s/_/-/ for the muscles names.
8399 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
8400
8850be4b
MA
84012001-11-28 Marc Autret <autret_m@epita.fr>
8402
8403 * src/bison.simple: Fix debug.
8404 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
8405
4a38e613
AD
84062001-11-28 Akim Demaille <akim@epita.fr>
8407
8408 * src/LR0.c (shifts_new): New.
8409 (save_shifts, insert_start_shift, augment_automaton): Use it.
8410
4b35e1c1
AD
84112001-11-28 Akim Demaille <akim@epita.fr>
8412
8413 * src/closure.c (closure): `b' and `ruleno' denote the same value:
8414 keep ruleno only.
8415
d2b04478
AD
84162001-11-28 Akim Demaille <akim@epita.fr>
8417
8418 * src/closure.c (closure): Instead of looping over word in array
8419 then bits in words, loop over bits in array.
8420
2c4c30aa
AD
84212001-11-28 Akim Demaille <akim@epita.fr>
8422
8423 * src/closure.c (closure): No longer optimize the special case
8424 where all the bits of `ruleset[r]' are set to 0, to make the code
8425 clearer.
8426
576890b7
AD
84272001-11-28 Akim Demaille <akim@epita.fr>
8428
8429 * src/closure.c (closure): `r' and `c' are new variables, used to
8430 de-obfuscate accesses to RULESET and CORE.
8431
cb487d7d
AD
84322001-11-28 Akim Demaille <akim@epita.fr>
8433
8434 * src/reduce.c (reduce_print): Use ngettext.
8435 (dump_grammar): Improve the trace accuracy.
8436
6013d43f
AD
84372001-11-28 Akim Demaille <akim@epita.fr>
8438
8439 * src/reduce.c (dump_grammar): Don't translate trace messages.
8440
cb4956ee
AD
84412001-11-28 Akim Demaille <akim@epita.fr>
8442
8443 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
8444 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
8445 as all tags are free'ed afterwards.
8446 From Enrico Scholz.
8447
648185ab
PE
84482001-11-27 Paul Eggert <eggert@twinsun.com>
8449
8450 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
8451 use alloca when we didn't want to, and vice versa.
8452
68254a03
MA
84532001-11-27 Marc Autret <autret_m@epita.fr>
8454
9113b58f
AD
8455 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
8456 initialization.
68254a03
MA
8457 * src/output.c (prepare): Remove its update.
8458
04d843a2
MA
84592001-11-27 Marc Autret <autret_m@epita.fr>
8460
8461 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
8462 Use %error-verbose.
8463
d2079671 84642001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
8465
8466 * src/bison.simple: Remove YYERROR_VERBOSE using.
8467 Use %%error_verbose.
8468 (yyparse): Likewise.
8469 * src/output.c (prepare): Give its final value.
8470 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
8471 * src/getargs.h: Add its extern declaration.
8472 * src/getargs.c (error_verbose_flag): New int.
8473 (getargs): Update to catch new case.
8474 * src/options.c (option_table): 'error-verbose' is a new option.
8475 (shortopts): Update.
8476
e0327bc8
AD
84772001-11-27 Akim Demaille <akim@epita.fr>
8478
8479 * src/system.h: Use intl/libgettext.h.
8480 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
8481
000f1a3c
AD
84822001-11-27 Akim Demaille <akim@epita.fr>
8483
8484 * tests/torture.at (Exploding the Stack Size with Malloc):
8485 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
8486
26cfe0be
AD
84872001-11-27 Akim Demaille <akim@epita.fr>
8488
8489 * src/files.c: Include error.h.
8490 Reported by Hans Aberg.
8491
f6bd5427
MA
84922001-11-26 Marc Autret <autret_m@epita.fr>
8493
d2079671 8494 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
8495 (read_declarations): Add case tok_include.
8496 * src/getargs.h (include): Add its extern definition.
8497 * src/getargs.c (include): New const char *.
8498 (getargs): Add case '-I'.
8499 * src/options.c (option_table): Add include as command line and
8500 percent option.
8501 * src/lex.h (token_t): Add tok_include.
8502
2ca209c1
AD
85032001-11-26 Akim Demaille <akim@epita.fr>
8504
8505 * src/reader.c (readgram): Make sure rules for mid-rule actions
8506 have a lineno equal to that of their host rule.
8507 Reported by Hans Aberg.
8508 * tests/regression.at (Rule Line Numbers): New.
8509
0e41b407
AD
85102001-11-26 Akim Demaille <akim@epita.fr>
8511
8512 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
8513 size_ts.
8514
85152001-11-26 Akim Demaille <akim@epita.fr>
8516
8517 * src/complain.c, src/complain.h (error): Remove, provided by
8518 lib/error.[ch].
8519
e0c40012
AD
85202001-11-26 Akim Demaille <akim@epita.fr>
8521
8522 * src/reader.c (read_declarations): Don't abort on tok_illegal,
8523 issue an error message.
8524 * tests/regression.at (Invalid %directive): New.
8525 Reported by Hans Aberg.
8526
5e147124
AD
85272001-11-26 Akim Demaille <akim@epita.fr>
8528
8529 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
8530 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
8531
a034c8b8
AD
85322001-11-26 Akim Demaille <akim@epita.fr>
8533
8534 * src/conflicts.c (conflicts_print): Don't complain at all when
8535 there are no reduce/reduce conflicts, and as many shift/reduce
8536 conflicts as expected.
8537 * tests/regression.at (%expect right): Adjust.
8538
c64a20f3
AD
85392001-11-23 Akim Demaille <akim@epita.fr>
8540
8541 * lib/alloca.c: Update, from fileutils.
8542
5b0d29bb
AD
85432001-11-23 Akim Demaille <akim@epita.fr>
8544
8545 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
8546
722c4bfe
AD
85472001-11-23 Akim Demaille <akim@epita.fr>
8548
8549 * src/system.h: Include alloca.h.
8550 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
8551
6255b435
AD
85522001-11-23 Akim Demaille <akim@epita.fr>
8553
8554 * src/print_graph.c (print_actions): Remove `rule', unused.
8555 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
8556 pacify GCC's signed < unsigned warnings.
8557 * src/closure.c (itemsetsize): Likewise.
8558 * src/reader.c (symbol_list_new): Static.
8559
b29b2ed5
AD
85602001-11-23 Akim Demaille <akim@epita.fr>
8561
8562 Attaching lineno to buckets is stupid, since only one copy of each
8563 symbol is kept, only the line of the first occurrence is kept too.
8564
8565 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
8566 * src/reader.c (rline_allocated): Remove, unused.
8567 (symbol_list): Have a `line' member.
8568 (symbol_list_new): New.
8569 (readgram): Use it.
8570 * src/print.c (print_grammar): Output the rule line numbers.
8571 * tests/regression.at (Solved SR Conflicts)
8572 (Unresolved SR Conflicts): Adjust.
8573 Reported by Hans Aberg.
8574
a81b1d4a
MA
85752001-11-22 Marc Autret <autret_m@epita.fr>
8576
8577 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
8578
c1ecb3c1
MA
85792001-11-22 Marc Autret <autret_m@epita.fr>
8580
8581 * src/muscle_tab.c (muscle_init): Remove initialization of
8582 skeleton muscle.
8583 * src/output.c (output_master_parser): Do it here.
8584
fbe01355
AD
85852001-11-20 Akim Demaille <akim@epita.fr>
8586
8587 * po/sv.po: New.
8588 * configure.in (ALL_LINGUAS): Adjust.
8589 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
8590 longer contains strings to translate.
8591
81e895c0
AD
85922001-11-19 Akim Demaille <akim@epita.fr>
8593
8594 * src/conflicts.c (conflicts_print): Add a missing \n.
8595
6bb1878b
AD
85962001-11-19 Akim Demaille <akim@epita.fr>
8597
8598 * src/nullable.c (nullable_print): New.
8599 (set_nullable): Call it when tracing.
8600 Better locality of variables.
8601
d9ec2d07
AD
86022001-11-19 Akim Demaille <akim@epita.fr>
8603
8604 * src/print.c (print_actions): Better locality of variables.
8605
720e5c1b
AD
86062001-11-19 Akim Demaille <akim@epita.fr>
8607
8608 * src/derives.c (print_derives): Fix and enrich.
8609 * src/closure.c (print_fderives): Likewise.
8610
fb908786
AD
86112001-11-19 Akim Demaille <akim@epita.fr>
8612
8613 * src/closure.c (itemsetend): Remove, replaced with...
8614 (itemsetsize): new.
8615
125ecb56
AD
86162001-11-19 Akim Demaille <akim@epita.fr>
8617
8618 * src/LR0.c (kernel_end): Remove, replaced with...
8619 (kernel_size): new.
8620
d8cf039f
AD
86212001-11-19 Akim Demaille <akim@epita.fr>
8622
8623 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
8624 to clarify.
8625
7bec0760
AD
86262001-11-19 Akim Demaille <akim@epita.fr>
8627
8628 * src/closure.c (closure): Use arrays instead of pointers to clarify.
8629
c87d4863
AD
86302001-11-19 Akim Demaille <akim@epita.fr>
8631
8632 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
8633 trace messages.
8634 * src/LR0.c: Likewise.
8635 (allocate_itemsets): Use arrays instead of pointers to clarify.
8636
9bfe901c
AD
86372001-11-19 Akim Demaille <akim@epita.fr>
8638
8639 * src/getargs.c (statistics_flag): Replace with...
8640 (trace_flag): New.
8641 (longopts): Accept --trace instead of --statistics.
8642 * src/getargs.h, src/options.c: Adjust.
8643 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
8644 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
8645
97db7bd4
AD
86462001-11-19 Akim Demaille <akim@epita.fr>
8647
cc72668c 8648 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
8649 pointers to clarify the code.
8650 (save_reductions, save_shifts): Factor common parts of alternatives.
8651
2c5f66ed
AD
86522001-11-19 Akim Demaille <akim@epita.fr>
8653
8654 * src/LR0.c (new_state, get_state): Complete TRACE code.
8655 * src/closure.c: Include `reader.h' to get `tags', needed by the
8656 trace code.
8657 Rename the conditional DEBUG as TRACE.
8658 Output consistently TRACEs to stderr, not stdout.
8659 * src/derives.c: Likewise.
8660 * src/reduce.c: (inaccessable_symbols): Using if is better style
8661 than goto.
8662 Use `#if TRACE' instead of `#if 0' for tracing code.
8663
300f275f
AD
86642001-11-19 Akim Demaille <akim@epita.fr>
8665
8666 * src/system.h (LIST_FREE, shortcpy): New.
8667 * src/LR0.c: Use them.
8668 * src/output.c (free_itemsets, free_reductions, free_shifts):
8669 Remove, replaced by LIST_FREE.
8670
f59c437a
AD
86712001-11-19 Akim Demaille <akim@epita.fr>
8672
8673 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
8674 (REDUCTIONS_ALLOC): New.
8675 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
8676 allocation.
8677
6986fd9e
AD
86782001-11-19 Akim Demaille <akim@epita.fr>
8679
8680 * src/LR0.c (new_state): Complete trace code.
8681 * src/nullable.c (set_nullable): Don't translate traces.
8682
4bc30f78
AD
86832001-11-19 Akim Demaille <akim@epita.fr>
8684
8685 * src/print_graph.c (print_core): Better locality of variables.
8686 * src/print.c (print_core): Likewise.
8687
08a946e0
AD
86882001-11-19 Akim Demaille <akim@epita.fr>
8689
8690 * src/vcg.c: You do the output, so you are responsible of the
8691 handling of VCG syntax, in particular: use quotearg.
8692 * src/print_graph.c: Don't.
8693 (print_actions): Don't output the actions as part of the nodes,
8694 since that's the job of the edges.
8695 (print_state): Don't output by hand: fill the node description,
9bfe901c 8696 and ask for its output.
08a946e0 8697
f0473484
AD
86982001-11-19 Akim Demaille <akim@epita.fr>
8699
cc72668c
AD
8700 * src/bison.simple (yyparse): When verbosely reporting an error,
8701 no longer put additional quotes around token names.
f0473484
AD
8702 * tests/calc.at: Adjust.
8703
e41dc700
AD
87042001-11-19 Akim Demaille <akim@epita.fr>
8705
8706 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
8707 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
8708 * src/output.c: Adjust.
8709
652a871c
AD
87102001-11-19 Akim Demaille <akim@epita.fr>
8711
8712 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
8713 (rule_t): this.
8714 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
8715
b2ed6e58
AD
87162001-11-19 Akim Demaille <akim@epita.fr>
8717
8718 * src/gram.h (rule_t): New.
8719 (rule_table): New.
8720 (rrhs, rlhs): Remove, part of state_t.
8721 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
8722 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8723 * src/reader.c, src/reduce.c: Adjust.
8724
edad7067
AD
87252001-11-19 Akim Demaille <akim@epita.fr>
8726
8727 * src/reader.c (symbols_output): New, extracted from...
8728 (packsymbols): Here.
8729 (reader): Call it.
8730
3feec034
AD
87312001-11-19 Akim Demaille <akim@epita.fr>
8732
8733 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
8734 (maxrhs): this new function.
8735
ddcd5fdf
AD
87362001-11-19 Akim Demaille <akim@epita.fr>
8737
cc72668c 8738 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
8739 Adjust.
8740
bb527fc2
AD
87412001-11-19 Akim Demaille <akim@epita.fr>
8742
cc72668c 8743 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
8744 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8745 * src/lalr.c: Adjust.
8746
a845a697
AD
87472001-11-19 Akim Demaille <akim@epita.fr>
8748
8749 * src/lalr.c (initialize_LA): Only initialize LA. Let...
8750 (set_state_table): handle the `lookaheads' members.
8751
f004bf6a
AD
87522001-11-19 Akim Demaille <akim@epita.fr>
8753
cc72668c
AD
8754 * src/lalr.h (lookaheads): Removed array, whose contents is now
8755 a member of...
f004bf6a
AD
8756 (state_t): this structure.
8757 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8758 Adjust.
8759
de326cc0
AD
87602001-11-19 Akim Demaille <akim@epita.fr>
8761
cc72668c
AD
8762 * src/lalr.h (consistent): Removed array, whose contents is now
8763 a member of...
de326cc0
AD
8764 (state_t): this structure.
8765 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8766 Adjust.
8767
90b4416b
AD
87682001-11-19 Akim Demaille <akim@epita.fr>
8769
cc72668c
AD
8770 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
8771 contents are now members of...
90b4416b
AD
8772 (state_t): this structure.
8773 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8774 Adjust.
8775
9703cc49
AD
87762001-11-19 Akim Demaille <akim@epita.fr>
8777
8778 * src/lalr.h (state_t): New.
8779 (state_table): Be a state_t * instead of a core **.
8780 (accessing_symbol): Remove, part of state_t.
8781 * src/lalr.c: Adjust.
8782 (set_accessing_symbol): Merge into...
8783 (set_state_table): this.
8784 * src/print_graph.c, src/conflicts.c: Adjust.
8785
d803322e
AD
87862001-11-14 Akim Demaille <akim@epita.fr>
8787
8788 * tests/calc.at, tests/output.at, tests/regression.at,
8789 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
8790 now the tests are run in private dirs, therefore AC_CLEANUP and
8791 family can be simplified to 0-ary.
8792 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
8793 use abs. path to find config.h.
8794 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
8795 stderr, there can be way too much random noise.
8796 Instead pass -Werror to GCC and rely on the exit status.
8797 Reported by Wolfram Wagner.
8798
3d76b07d
AD
87992001-11-14 Akim Demaille <akim@epita.fr>
8800
8801 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
8802 defined only if yyoverflow is defined, to avoid `warning: unused
8803 variable `yyvs1''.
8804 Reported by The Test Suite.
8805
09b503c8
AD
88062001-11-14 Akim Demaille <akim@epita.fr>
8807
8808 * src/print.c: Include reduce.h.
8809 Reported by Hans Aberg.
8810
88112001-11-14 Akim Demaille <akim@epita.fr>
8812
8813 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
8814 Revert a previous patch: these are really const.
8815 * src/conflicts.c (conflict_report): Additional useless pair of
8816 braces to pacify GCC's warnings for `if () if () {} else {}'.
8817 * src/lex.c (parse_percent_token): Replace equal_offset with
8818 arg_offset.
8819 arg is const.
8820 Be sure to strdup `arg' when used, since there is no reason for
8821 token_buffer not to change.
8822
0f37a994
AD
88232001-11-14 Akim Demaille <akim@epita.fr>
8824
8825 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
8826 definition.
8827 * src/main.c (main): Use them.
8828 Suggested by Hans Aberg.
8829
d39d93b8
AD
88302001-11-12 Akim Demaille <akim@epita.fr>
8831
8832 * src/system.h (ngettext): Now that we use ngettext, be sure to
8833 provide a default definition when NLS are not used.
8834
9edcd895
AD
88352001-11-12 Akim Demaille <akim@epita.fr>
8836
8837 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
8838 Use @kbd to denote user input.
8839 (Language and Grammar): ANSIfy the example.
8840 Adjust its layout for info/notinfo.
8841 (Location Tracking Calc): Output error messages to stderr.
8842 Output locations in a more GNUtically correct way.
8843 Fix a couple of Englishos.
8844 Adjust @group/@end group pairs.
8845
7da99ede
AD
88462001-11-12 Akim Demaille <akim@epita.fr>
8847
e3aa65c5 8848 %expect was not functioning at all.
7da99ede
AD
8849
8850 * src/conflicts.c (expected_conflicts): Set to -1.
8851 (conflict_report): Use ngettext.
8852 (conflicts_print): Check %expect and make its violation an error.
8853 * doc/bison.texinfo (Expect Decl): Adjust.
8854 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
8855 * tests/regression.at (%expect not enough, %expect right)
8856 (%expect too much): New.
8857
ba9dda1a
AD
88582001-11-12 Akim Demaille <akim@epita.fr>
8859
8860 * tests/regression.at (Conflicts): Rename as...
8861 (Unresolved SR Conflicts): this.
8862 (Solved SR Conflicts): New.
8863
337c5bd1
AD
88642001-11-12 Akim Demaille <akim@epita.fr>
8865
8866 * src/reduce.c (print_results): Rename as...
8867 (reduce_output): This.
8868 Output to OUT, passed as argument, instead of output_obstack.
8869 (dump_grammar): Likewise.
8870 (reduce_free): New.
8871 Also free V1.
8872 (reduce_grammar): No longer call reduce_output, since...
8873 * src/print.c (print_results): do it.
8874 * src/main.c (main): Call reduce_free;
8875
c73a41af
AD
88762001-11-12 Akim Demaille <akim@epita.fr>
8877
8878 * src/conflicts.c (print_reductions): Accept OUT as argument.
8879 Output to it, not to output_obstack.
8880 * src/print.c (print_actions): Adjust.
8881
0df87bb6
AD
88822001-11-12 Akim Demaille <akim@epita.fr>
8883
8884 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
8885 the result instead of using...
8886 (src_total, rrc_total, src_count, rrc_count): Remove.
8887 (any_conflicts): Remove.
8888 (print_conflicts): Split into...
8889 (conflicts_print, conflicts_output): New.
8890 * src/conflicts.h: Adjust.
8891 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 8892 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
8893 * tests/regression.at (Conflicts): New.
8894 Reported by Tom Lane.
8895
e4d3d4de
AD
88962001-11-12 Akim Demaille <akim@epita.fr>
8897
8898 * tests/regression.at (Invalid input): Remove, duplicate with
8899 ``Invalid input: 1''.
8900
6d7d248e
AD
89012001-11-12 Akim Demaille <akim@epita.fr>
8902
8903 * tests/torture.at (AT_DATA_STACK_TORTURE)
8904 (Exploding the Stack Size with Alloca)
8905 (Exploding the Stack Size with Malloc): New.
8906
e9e4c321
AD
89072001-11-12 Akim Demaille <akim@epita.fr>
8908
8909 * src/bison.simple (YYSTACK_REALLOC): New.
8910 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 8911 Reported by Per Allansson.
e9e4c321 8912
5f7e0832
AD
89132001-11-12 Pascal Bart <pascal.bart@epita.fr>
8914
8915 * src/bison.simple: Define type yystype instead of YYSTYPE, and
8916 define CPP macro, which substitute YYSTYPE by yystype.
8917 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
8918 with yyltype/YYLTYPE. This allows inclusion of the generated
8919 header within the parser if the compiler, such as GGC, accepts
8920 multiple equivalent #defines.
8921 From Akim.
8922
e3f1699f
AD
89232001-11-05 Akim Demaille <akim@epita.fr>
8924
8925 * src/reader.c (symbols_output): New, extracted from...
8926 (packsymbols): here.
8927 (reader): Adjust.
8928
65be0866
AD
89292001-11-05 Akim Demaille <akim@epita.fr>
8930
8931 * src/lex.c (parse_percent_token): s/quotearg/quote/.
8932
e4d910bf
AD
89332001-11-05 Akim Demaille <akim@epita.fr>
8934
8935 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
8936 pattern.
8937
951366c1
AD
89382001-11-05 Akim Demaille <akim@epita.fr>
8939
8940 * src/options.h (struct option_table_struct): set_flags is void*.
8941 * src/options.c (longopts): Support `--output' and `%output'.
8942 (usage): Adjust.
8943 * src/lex.h (tok_setopt): Remove, replaced with...
8944 (tok_intopt, tok_stropt): these new guys.
8945 * src/lex.c (getopt.h): Not needed.
8946 (token_buffer, unlexed_token_buffer): Not const.
8947 (percent_table): Promote `-' over `_' in directive names.
8948 Active `%name-prefix', `file-prefix', and `output'.
8949 (parse_percent_token): Accept possible arguments to directives.
8950 Promote `-' over `_' in directive names.
8951
d8988b2f
AD
89522001-11-04 Akim Demaille <akim@epita.fr>
8953
8954 * doc/bison.texinfo (Decl Summary): Split the list into
8955 `directives for grammars' and `directives for bison'.
8956 Sort'em.
8957 Add description of `%name-prefix', `file-prefix', and `output'.
8958 Promote `-' over `_' in directive names.
8959 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
8960 Simplify the description of `--name-prefix'.
8961 Promote `-' over `_' in directive names.
8962 Promote `--output' over `--output-file'.
8963 Fix the description of `--defines'.
8964 * tests/output.at: Exercise %file-prefix and %output.
8965
6468d18e
AD
89662001-11-02 Akim Demaille <akim@epita.fr>
8967
8968 * doc/refcard.tex: Update.
8969
6b7e85b9
AD
89702001-11-02 Akim Demaille <akim@epita.fr>
8971
8972 * src/symtab.h (SUNDEF): New.
8973 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
8974 stand for `uninitialized', instead of 0.
8975 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
8976 * src/lex.c (lex): Adjust.
8977
8978 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
8979 Number it 0.
8980 Let yylex return it instead of a plain 0.
8981 Reported by Dick Streefland.
8982
cd5aafcf
AD
89832001-11-02 Akim Demaille <akim@epita.fr>
8984
8985 * tests/regression.at (Mixing %token styles): New test.
8986
037ca2f1
AD
89872001-11-02 Akim Demaille <akim@epita.fr>
8988
8989 * src/reader.c (parse_thong_decl): Formatting changes.
8990 (token_translations_init): New, extracted from...
8991 (packsymbols): Here.
8992 Adjust.
8993
270a173c
AD
89942001-11-01 Akim Demaille <akim@epita.fr>
8995
8996 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
8997 Check that `9foo.y' produces correct cpp guards.
8998 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
8999 guards.
9000 Reported by Wwp.
9001
561f9a30
AD
90022001-11-01 Akim Demaille <akim@epita.fr>
9003
9004 * tests/regression.at (Invalid input: 2): New.
9005 * src/lex.c (unlexed_token_buffer): New.
9006 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
9007 too.
9008 Reported by Wwp.
9009
f987e9d2
AD
90102001-11-01 Akim Demaille <akim@epita.fr>
9011
9012 * tests/calc.at: Catch up with 1.30.
9013 * configure.in: Bump to 1.49a.
9014 Adjust to newer Autotest.
9015
0846f581
PB
90162001-10-19 Pascal Bart <pascal.bart@epita.fr>
9017
9018 * src/conflicts.c: Move global variables rrc_total and src_total ...
9019 (print_conflicts): here.
9020 * src/output.c (output): Free global variable user_toknums.
9021 * src/lex.c (token_obstack): Become static.
9022
3c1a79b3
AD
90232001-10-18 Akim Demaille <akim@epita.fr>
9024
9025 * tests/atlocal.in (GCC): Add.
9026 * tests/calc.at: s/m4_match/m4_bmatch/.
9027 s/m4_patsubst/m4_bpatsubst/.
9028 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
9029 * configure.in: AC_SUBST(GCC).
9030
5d52e7d0
MA
90312001-10-14 Marc Autret <autret_m@epita.fr>
9032
9033 * src/options.c (create_long_option_table): Fix.
9034
631aa1d3
AD
90352001-10-10 Akim Demaille <akim@epita.fr>
9036
9037 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
9038
f6ec6d13
AD
90392001-10-04 Akim Demaille <akim@epita.fr>
9040
9041 * src/reader.c (parse_union_decl): Push the caracters in
9042 union_obstack, not attrs_obstack.
9043
342b8b6e
AD
90442001-10-04 Akim Demaille <akim@epita.fr>
9045
9046 Merge in the branch 1.29.
9047
9048 * src/reader.c (packsymbols): Use a temporary obstack for
9049 `%%tokendef', since output_stack is already used elsewhere.
9050
9051 2001-10-02 Akim Demaille <akim@epita.fr>
9052
9053 Bump 1.29d.
9054
9055 2001-10-02 Akim Demaille <akim@epita.fr>
9056
9057 Version 1.29c.
9058
9059 2001-10-02 Akim Demaille <akim@epita.fr>
9060
9061 * tests/regression.at (Invalid CPP headers): New.
9062 From Alexander Belopolsky.
9063 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
9064
9065 2001-10-02 Akim Demaille <akim@epita.fr>
9066
9067 * tests/regression.at (Invalid input): New.
9068 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
9069 Reported by Shura.
9070
9071 2001-10-02 Akim Demaille <akim@epita.fr>
9072
9073 * tests/calc.at: Now that --debug works, the tests must be adjusted.
9074
9075 2001-10-02 Akim Demaille <akim@epita.fr>
9076
9077 * src/output.c (output_parser): Assert `skeleton'.
9078 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
9079 systems.
9080 From Shura.
9081
9082 2001-10-01 Marc Autret <autret_m@epita.fr>
9083
9084 * src/lex.h: Echo modifications.
9085 * src/lex.c (unlex): Parameter is now token_t.
9086 From Hans Aberg.
9087
9088 2001-10-01 Marc Autret <autret_m@epita.fr>
9089
9090 * src/main.c: Include lex.h.
9091 From Hans Aberg.
9092
9093 2001-09-29 Akim Demaille <akim@epita.fr>
9094
9095 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
9096
9097 2001-09-28 Akim Demaille <akim@epita.fr>
9098
9099 * tests/testsuite.at: Update to newer Autotest.
9100 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
9101
9102 2001-09-27 Akim Demaille <akim@epita.fr>
9103
9104 Position independent wrapper.
9105
9106 * tests/bison: Remove.
9107 * tests/bison.in: New.
9108 * configure.in: Adjust.
9109
9110 2001-09-27 Paul Eggert <eggert@twinsun.com>
9111
9112 Port quotearg fixes from tar 1.13.24.
9113
9114 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9115 tm to be declared.
9116 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
9117 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
9118
9119 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
9120 * m4/mbrtowc.m4: New file.
9121 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
9122 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
9123
9124 2001-09-27 Akim Demaille <akim@epita.fr>
9125
9126 Bump to 1.29c.
9127
9128 2001-09-27 Akim Demaille <akim@epita.fr>
9129
9130 Version 1.29b.
9131
9132 2001-09-25 Akim Demaille <akim@epita.fr>
9133
9134 * src/system.h: Include `xalloc.h'.
9135 Remove it from the C files.
9136 * src/files.c (output_files): Free the obstacks.
9137 * src/lex.c (init_lex): Rename as...
9138 (lex_init): this.
9139 (lex_free): New.
9140 * src/main.c (main): Use it.
9141
9142 2001-09-24 Marc Autret <autret_m@epita.fr>
9143
9144 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
9145 to output informations in fout (FILE*).
9146 (open_graph, close_graph): Likewise.
9147 (output_graph, output_edge, output_node): Likewise.
9148 * src/vcg.h: Update function prototypes.
9149 * src/print_graph.c (print_graph): Open output graph file.
9150 (print_actions): Adjust.
9151 * src/files.h: Remove extern declaration.
9152 * src/files.c: Remove graph_obstack declaration.
9153 (open_files): Remove graph_obstack initialization.
9154 (output_files): Remove graph_obstack saving.
9155
9156 2001-09-24 Marc Autret <autret_m@epita.fr>
9157
9158 * src/files.c (compute_output_file_names): Fix.
9159
9160 2001-09-24 Marc Autret <autret_m@epita.fr>,
9161 Akim Demaille <akim@epita.fr>
9162
9163 * src/reader.c (reader): Remove call to free_symtab ().
9164 * src/main.c (main): Call it here.
9165 Include symtab.h.
9166 * src/conflicts.c (initialize_conflicts): Rename as...
9167 (solve_conflicts): this.
9168 * src/print.c (print_core, print_actions, print_state)
9169 (print_grammar): Dump to a file instead a `output_obstack'.
9170 (print_results): Dump `output_obstack', and then proceed with the
9171 FILE *.
9172 * src/files.c (compute_output_file_names, close_files): New.
9173 (output_files): Adjust.
9174 * src/main.c (main): Adjust.
9175
9176 2001-09-23 Marc Autret <autret_m@epita.fr>
9177
9178 * src/files.c (compute_header_macro): Computes header macro name
9179 from spec_defines_file when given.
9180
9181 2001-09-23 Marc Autret <autret_m@epita.fr>
9182
9183 * src/files.c (output_files): Add default extensions.
9184
9185 2001-09-22 Akim Demaille <akim@epita.fr>
9186
9187 * src/conflicts.c (finalize_conflicts): Rename as...
9188 (free_conflicts): this.
9189
9190 2001-09-22 Akim Demaille <akim@epita.fr>
9191
9192 * src/gram.c (gram_free): Rename back as...
9193 (dummy): this.
9194 (output_token_translations): Free `token_translations'.
9195 * src/symtab.c (free_symtab): Free the tag field.
9196
9197 2001-09-22 Akim Demaille <akim@epita.fr>
9198
9199 Remove `translations' as it is always set to true.
9200
9201 * src/gram.h: Adjust.
9202 * src/reader.c (packsymbols, parse_token_decl): Adjust
9203 * src/print.c (print_grammar): Adjust.
9204 * src/output.c (output_token_translations): Adjust.
9205 * src/lex.c (lex): Adjust.
9206 * src/gram.c: Be sure the set pointers to NULL.
9207 (dummy): Rename as...
9208 (gram_free): this.
9209
9210 2001-09-22 Akim Demaille <akim@epita.fr>
9211
9212 * configure.in: Invoke AM_LIB_DMALLOC.
9213 * src/system.h: Use dmalloc.
9214 * src/LR0.c: Be sure to have pointers initialized to NULL.
9215 (allocate_itemsets): Allocate kernel_items only if needed.
9216
9217 2001-09-22 Akim Demaille <akim@epita.fr>
9218
9219 * configure.in: Bump to 1.29b.
9220 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
9221 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
9222 need xmalloc.c in calc.y.
9223 From Pascal Bart.
9224
9225 2001-09-21 Akim Demaille <akim@epita.fr>
9226
9227 Version 1.29a.
9228 * Makefile.maint, config/config.guess, config/config.sub,
9229 * config/missing: Update from masters.
9230 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
9231 upon package.m4.
9232 * configure.in (ALL_LINGUAS): Add `tr'.
9233
9234 2001-09-21 Akim Demaille <akim@epita.fr>
9235
9236 * tests/Makefile.am (package.m4): Move to...
9237 ($(srcdir)/$(TESTSUITE)): here.
9238
9239 2001-09-20 Akim Demaille <akim@epita.fr>
9240
9241 * src/complain.c: No longer try to be standalone: use system.h.
9242 Don't assume __STDC__ is defined to 1. Just test if it is defined.
9243 * src/complain.h: Likewise.
9244 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
9245 Remove the unused variable `n'.
9246 From Albert Chin-A-Young.
9247
9248 2001-09-18 Marc Autret <autret_m@epita.fr>
9249
9250 * doc/bison.1: Update.
9251 * doc/bison.texinfo (Bison Options): Update --defines and --graph
9252 descriptions.
9253 (Option Cross Key): Update.
9254 Add --graph.
9255
9256 2001-09-18 Marc Autret <autret_m@epita.fr>
9257
9258 * tests/regression.at: New test (comment in %union).
9259
9260 2001-09-18 Marc Autret <autret_m@epita.fr>
9261
9262 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
9263 do that.
9264 Reported by Keith Browne.
9265
9266 2001-09-18 Marc Autret <autret_m@epita.fr>
9267
9268 * tests/output.at: Add tests for --defines and --graph.
9269
9270 2001-09-18 Marc Autret <autret_m@epita.fr>
9271
9272 * tests/output.at: Removes tests of %{header,src}_extension features.
9273
9274 2001-09-18 Akim Demaille <akim@epita.fr>
9275
9276 * tests/Makefile.am (package.m4): New.
9277 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
9278 (_AT_CHECK_CALC_ERROR): Likewise.
9279 Factor the `, ' part of verbose error messages.
9280
9281 2001-09-18 Marc Autret <autret_m@epita.fr>
9282
9283 * src/getargs.c (longopts): Declare --defines and --graph as options
9284 with optional arguments.
9285 * src/files.h: Add extern declarations.
9286 * src/files.c (spec_graph_file, spec_defines_file): New.
9287 (output_files): Update.
9288 Remove CPP-outed code.
9289
9290 2001-09-18 Marc Autret <autret_m@epita.fr>
9291
9292 Turn off %{source,header}_extension feature.
9293
9294 * src/files.c (compute_exts_from_gf): Update.
9295 (compute_exts_from_src): Update.
9296 (output_files): CPP-out useless code.
9297 * src/files.h: Remove {header,source}_extension extern declarations.
9298 * src/reader.c (parse_dquoted_param): CPP-out.
9299 (parse_header_extension_decl): Remove.
9300 (parse_source_extension_decl): Remove.
9301 (read_declarations): Remove cases tok_{hdrext,srcext}.
9302 * src/lex.c (percent_table): Remove {header,source}_extension entries.
9303 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
9304
9305 2001-09-10 Akim Demaille <akim@epita.fr>
9306
9307 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
9308 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
9309 (AT_CHECK_OUTPUT): this.
9310 Merely check ls' exit status, its output is useless.
9311
9312 2001-09-10 Akim Demaille <akim@epita.fr>
9313
9314 * tests/calc.at: Use m4_match.
9315 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
9316
9317 2001-09-10 Marc Autret <autret_m@epita.fr>,
9318 Akim Demaille <akim@epita.fr>
9319
9320 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
9321 enum color_e.
9322 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
9323 to `normal'.
9324 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
9325 * src/lex.h: Adjust prototype.
9326 (token_t): Add `tok_undef'.
9327 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
9328 (parse_percent_token): Now returns token_t.
9329 Add default statement in switch.
9330 (lex): Separate `c' as an input variable, from the token_t result
9331 part.
9332 (unlexed): Is a token_t.
9333
9334 2001-09-10 Akim Demaille <akim@epita.fr>
9335
9336 * configure.in: Bump to 1.29a.
9337
9338 2001-09-07 Akim Demaille <akim@epita.fr>
9339
9340 Version 1.29.
9341
9342 2001-08-30 Akim Demaille <akim@epita.fr>
9343
9344 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
9345 * m4/atconfig.m4: Remove.
9346 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
9347 * tests/bison: New.
9348 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
9349 m4_if, m4_patsubst, and m4_regexp.
9350 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
9351 `input' file instead of echo.
9352
9353 2001-08-29 Akim Demaille <akim@epita.fr>
9354
9355 Bump to 1.28e.
9356
9357 2001-08-29 Akim Demaille <akim@epita.fr>
9358
9359 Version 1.28d.
9360
9361 2001-08-29 Paul Eggert <eggert@twinsun.com>
9362
9363 * src/bison.simple (yyparse): Don't take the address of an
9364 item before the start of an array, as that doesn't conform to
9365 the C Standard.
9366
9367 2001-08-29 Robert Anisko <anisko_r@epita.fr>
9368
9369 * doc/bison.texinfo (Location Tracking Calc): New node.
9370
9371 2001-08-29 Paul Eggert <eggert@twinsun.com>
9372
9373 * src/output.c (output): Do not define const, as this now
9374 causes more problems than it cures.
9375
9376 2001-08-29 Akim Demaille <akim@epita.fr>
9377
9378 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
9379 the nodes.
9380 Be sure to tag the `detailmenu'.
9381
9382 2001-08-29 Akim Demaille <akim@epita.fr>
9383
9384 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
9385 download in a tmp dir.
9386
9387 2001-08-28 Marc Autret <autret_m@epita.fr>
9388
9389 * config/depcomp: New file.
9390
9391 2001-08-28 Marc Autret <autret_m@epita.fr>
9392
9393 * doc/bison.1 (mandoc): Adjust.
9394 From Juan Manuel Guerrero.
9395
9396 2001-08-28 Marc Autret <autret_m@epita.fr>
9397
9398 * src/print_graph.c (print_state): Fix.
9399
9400 2001-08-27 Marc Autret <autret_m@epita.fr>
9401
9402 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
9403 char * members.
9404 Echo modifications to the functions prototypes.
9405 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
9406
9407 2001-08-27 Marc Autret <autret_m@epita.fr>
9408
9409 * src/vcg.c: Include `xalloc.h'.
9410 (add_colorentry): New.
9411 (add_classname): New.
9412 (add_infoname): New.
9413 * src/vcg.h: Add new prototypes.
9414
9415 2001-08-27 Akim Demaille <akim@epita.fr>
9416
9417 * Makefile.maint: Sync. again with CVS Autoconf.
9418
9419 2001-08-27 Akim Demaille <akim@epita.fr>
9420
9421 * Makefile.maint: Formatting changes.
9422 (po-update, cvs-update, update): New targets.
9423 (AMTAR): Remove.
9424
9425 2001-08-27 Akim Demaille <akim@epita.fr>
9426
9427 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9428 * Makefile.maint: Sync. with CVS Autoconf.
9429
9430 2001-08-27 Marc Autret <autret_m@epita.fr>
9431
9432 * src/vcg.h (struct infoname_s): New.
9433 (struct colorentry_s): New.
9434 (graph_s): New fields {vertical,horizontal}_order in structure.
9435 Add `infoname' field.
9436 Add `colorentry' field;
9437 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
9438 (G_HORIZONTAL_ORDER): New.
9439 (G_INFONAME): New.
9440 (G_COLORENTRY): New.
9441 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
9442 Add output of `infoname'.
9443 Add output of `colorentry'.
9444
9445 2001-08-27 Marc Autret <autret_m@epita.fr>
9446
9447 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
9448 This one shadowed a global parameter.
9449
9450 2001-08-24 Marc Autret <autret_m@epita.fr>
9451
9452 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
9453 instead of `unsigned'.
9454 (print_state): Do not call obstack_object_size () in obstack_grow ()
9455 to avoid macro variables shadowing.
9456
9457 2001-08-23 Marc Autret <autret_m@epita.fr>
9458
9459 * src/lex.c (percent_table): Typo: s/naem/name/.
9460 Add graph option.
9461 Normalize new options declarations.
9462
9463 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
9464
9465 * tests/suite.at: Exercise %header_extension and %source_extension.
9466
9467 2001-08-16 Marc Autret <autret_m@epita.fr>
9468
9469 * src/reader.c (parse_dquoted_param): New.
9470 (parse_header_extension_decl): Use it.
9471 (parse_source_extension_decl): Likewise.
9472
9473 2001-08-16 Marc Autret <autret_m@epita.fr>
9474
9475 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
9476 (get_xxxx_str): Use assert () instead of complain ().
9477 Remove return invokations in default cases.
9478 (get_decision_str): Modify default behaviour. Remove second argument.
9479 Echo modifications on calls.
9480 (output_graph): Fix.
9481
9482 2001-08-16 Marc Autret <autret_m@epita.fr>
9483
9484 * src/getargs.c (usage): Update with ``-g, --graph''.
9485
9486 2001-08-16 Marc Autret <autret_m@epita.fr>
9487
9488 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
9489 (Option Cross Key): Likewise.
9490 * doc/bison.1: Update.
9491
1c8c2190
PB
94922001-09-25 Pascal Bart <pascal.bart@epita.fr>
9493
9494 * src/output.c (output_master_parser): Don't finish action_obstack.
9495 (output_parser): Don't care about the muscle action, here.
9496 (prepare): Copy the action_obstack in the action muscle.
9497 (output): Free action_obstack.
9498
180d45ba
PB
94992001-09-23 Pascal Bart <pascal.bart@epita.fr>
9500
9501 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
9502 will contain `%union' declaration.
9503 (parse_union_decl): Delete #line directive output.
9504 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
9505 informations about %union.
9506 (parse_union_decl): Copy the union_obstack in the muscle stype.
9507 * src/bison.simple: Add new #line directive.
9508 Add typdef %%stype YYSTYPE.
9509
c51d1a19
PB
95102001-09-23 Pascal Bart <pascal.bart@epita.fr>
9511
9512 * src/bison.simple: Add new `#line' directive.
9513
6f9344da
PB
95142001-09-22 Pascal Bart <pascal.bart@epita.fr>
9515
9516 * src/bison.simple: New `#line' directive.
9517 * src/output.c (output_parser): Support new dynamic muscle input_line.
9518
652def80
MA
95192001-09-22 Marc Autret <autret_m@epita.fr>
9520
9521 * src/output.c (output_master_parser): New.
9522 (output_parser): Be more re-entrant.
9523
25b222fa
MA
95242001-09-21 Marc Autret <autret_m@epita.fr>
9525
9526 * src/reader.c (copy_definition, parse_union_decl): Update and use
9527 `linef' muscle.
9528 (copy_action): Likewise.
9529 Use obstack_1grow ().
9530 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
9531
6bc35ae5
MA
95322001-09-21 Marc Autret <autret_m@epita.fr>
9533
9534 * src/options.c (option_table): Adjust.
9535 * src/lex.c (parse_percent_token): Fix.
9536
c0629aa1
PB
95372001-09-20 Pascal Bart <pascal.bart@epita.fr>
9538
9539 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 9540
82b6d266
PB
95412001-09-20 Pascal Bart <pascal.bart@epita.fr>
9542
9543 * src/lex.c (parse_percent_token): Change type of variable `tx', which
9544 is now an option_table_struct*.
9545 (option_strcmp): New function option_strcmp.
9546 (parse_percent_token): Call option_strcmp.
9547 * src/getargs.c (xalloc.h, options.h): Include it.
9548 (getargs): Call create_long_option_table.
9549 (getargs): Free longopts at the end of the function.
9550 (shortopts): Move in options.c.
9551 * src/options.c (create_long_option_table): New function. Convert
9552 information from option_table to option structure.
9553 * src/reader.c (options.h): Include it.
9554
9555 * src/Makefile.am: Adjust.
9556 * src/options.c (option_table): Create from longopts and percent_table.
9557 * src/getargs.c (longopts): Delete.
9558 * src/lex.c (struct percent_table_struct): Delete.
9559 (percent_table): Delete.
9560 (options.h): Include it.
9561 * src/options.c: Create.
9562 * src/options.h: Create.
9563 Declare enum opt_access_e.
9564 Define struct option_table_struct.
9565
75f5aaea
MA
95662001-09-20 Marc Autret <autret_m@epita.fr>
9567
9568 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
9569 sections of Bison.
9570
f508cb0a
PB
95712001-09-19 Pascal Bart <pascal.bart@epita.fr>
9572
9573 * src/bison.simple: s/%%filename/%%skeleton.
9574 * src/muscle_tab.c (getargs.h): Include it.
9575 (muscle_init): Insert new muscle skeleton.
9576
13105fc1
PB
95772001-09-18 Pascal Bart <pascal.bart@epita.fr>
9578
9579 * src/output.c (output_parser): Delete unused variable actions_dumped.
9580
b0c4483e
PB
95812001-09-07 Pascal Bart <pascal.bart@epita.fr>
9582
9583 * src/output.c (output): Delete call to reader_output_yylsp.
9584 * src/reader.c (reader): Likewise.
9585 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 9586
11d82f03
MA
95872001-09-02 Marc Autret <autret_m@epita.fr>
9588
9589 * src/reader.c: Include muscle_tab.h.
9590 (parse_union_decl): Update.
9591 (parse_macro_decl): Rename parse_muscle_decl.
9592 Update to use renamed functions and variable.
9593 (read_declarations, copy_action, read_additionnal_code, : Updated
9594 with correct variables and functions names.
9595 (packsymbols, reader): Likewise.
342b8b6e 9596
11d82f03 9597 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 9598
11d82f03
MA
9599 * src/output.c: Include muscle_tab.h
9600 In all functions using macro_insert, change by using muscle_insert ().
9601 (macro_obstack): Rename muscle_obstack.
9602 Echo modifications in the whole file.
9603 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
9604 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
9605 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
9606
9607 * src/muscle_tab.h: Update double inclusion macros.
9608 (macro_entry_s): Rename muscle_entry_s.
9609 Update prototypes.
342b8b6e 9610
11d82f03
MA
9611 * src/muscle_tab.c: Include muscle_tab.h.
9612 Rename macro_tabble to muscle_table.
9613 (mhash1, mhash2, mcmp): Use muscle_entry.
9614 (macro_init): Rename muscle_init. Update.
9615 (macro_insert): Rename muscle_insert. Update.
9616 (macro_find): Rename muscle_find. Update.
9617
9618 * src/main.c: Include muscle_tab.h.
9619 (main): Call muscle_init ().
9620 * src/Makefile.am (bison_SOURCES): Echo modifications.
9621
93a37297
MA
96222001-09-02 Marc Autret <autret_m@epita.fr>
9623
f753cd62 9624 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 9625
f753cd62
MA
9626 * src/muscle_tab.c, src/muscle_tab.h: Add files.
9627
96282001-09-02 Marc Autret <autret_m@epita.fr>
9629
9630 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 9631
682d48cd
PB
96322001-09-01 Pascal Bart <pascal.bart@epita.fr>
9633
342b8b6e 9634 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
9635 filename.
9636
087c8fda
MA
96372001-09-01 Marc Autret <autret_m@epita.fr>
9638
9639 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
9640 to an explicit value to activate the feature. We do it here.
9641
dda680cb
PB
96422001-08-31 Pascal Bart <pascal.bart@epita.fr>
9643
9644 * src/output.c (prepare): Delete the `filename' muscule insertion.
9645 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
9646 (parse_union_decl): Likewise.
9647 * src/macrotab.c (macro_init): Initialize filename by infile.
9648
9e644e64
MA
96492001-08-31 Marc Autret <autret_m@epita.fr>
9650
9651 * src/bison.simple (YYLSP_NEEDED): New definition.
9652 * src/output.c (prepare): Add macro insertion of `locations_flag'
9653
17da6427
PB
96542001-08-31 Pascal Bart <pascal.bart@epita.fr>
9655
9656 * src/output.c (prepare): Delete insertion of previous muscles,
9657 and insert the `prefix' muscles.
9658 * src/macrotab.c (macro_init): Likewise.
9659 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 9660 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
9661 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
9662 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 9663 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
9664 name_prefix.
9665
e8cb70b9
PB
96662001-08-31 Pascal Bart <pascal.bart@epita.fr>
9667
9668 * src/main.c (main): Standardize.
9669 * src/output.c (output_table_data, output_parser): Likewise.
9670 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
9671
63c2d5de
MA
96722001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
9673
342b8b6e 9674 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
9675 %%epilogue.
9676 * src/output.c (output): Rename %%declarations to %%prologue.
9677 * src/bison.simple: Echo modifications.
342b8b6e 9678
d8cb5183
MA
96792001-08-31 Marc Autret <autret_m@epita.fr>
9680
9681 * src/reader.c (readgram): CleanUp.
9682 (output_token_defines): Likewise.
9683 (packsymbols): Likewise.
9684 (reader): Likewise.
9685 * src/output.c (output): CPP-out useless code.
9686
6c686258
PB
96872001-08-31 Pascal Bart <pascal.bart@epita.fr>
9688
342b8b6e 9689 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
9690 output_trailers and output_headers.
9691 * src/output.h: Remove obsolete functions prototypes of output_headers
9692 and output_trailers.
9693
8f451ef7
PB
96942001-08-30 Pascal Bart <pascal.bart@epita.fr>
9695
9696 * src/main.c: Include macrotab.h.
342b8b6e 9697 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
9698 Adjust functions prototypes.
9699 * src/macrotab.c (macro_insert): Constify key and value.
9700 (macro_find): Constify key.
9701 (macro_insert): Include 'xalloc.h'
9702 (macro_insert): Use XMALLOC.
9703 (macro_find): Constify return value.
9704 * src/output.c (output_table_data): Rename table to table_data.
9705 (output_parser): Constify macro_key, macro_value.
9706
997b6fd0 97072001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
9708
9709 * src/reader.c (parse_skel_decl): New.
342b8b6e 9710 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
9711 * src/lex.h (token_t): New token `tok_skel'.
9712 * src/lex.c (percent_table): Add skeleton option entry.
9713 Standardize.
9714
ff48177d
MA
97152001-08-29 Marc Autret <autret_m@epita.fr>
9716
9717 * src/bison.simple: Add %%user_code directive at the end.
9718 * src/reader.c (read_additionnal_code): New.
9719 (reader): Use it.
9720 * src/output.c (output_program): Remove.
9721 (output): Update.
9722
b33160bf
MA
97232001-08-28 Marc Autret <autret_m@epita.fr>
9724
9725 * src/output.c (output_actions): Clean up.
4e5caae2 9726 (output_gram): CPP-out useless code.
b33160bf
MA
9727 * src/reader.c (reader): Clean up, CPP-out useless code.
9728
d1a2daf7
PB
97292001-08-28 Pascal Bart <pascal.bart@epita.fr>
9730
342b8b6e 9731 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 9732 directive.
d1a2daf7
PB
9733 * src/bison.simple: Add `%%definitions'.
9734
2b763dfe
MA
97352001-08-28 Marc Autret <autret_m@epita.fr>
9736
9737 * config/depcomp: New file.
9738
f1a87ef6
PE
97392001-08-27 Paul Eggert <eggert@twinsun.com>
9740
9741 * src/bison.simple (yyparse): Don't take the address of an
9742 item before the start of an array, as that doesn't conform to
9743 the C Standard.
9744
82e236e2
RA
97452001-08-27 Robert Anisko <robert.anisko@epita.fr>
9746
f1a87ef6 9747 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
9748 obstack. It was done too late here.
9749
9750 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
9751 completely wrong.
9752 (reader): Initialize the macro obstack here, since we need it to grow
9753 '%define' directives.
9754
9755 * src/reader.h: Declare the macro obstack as extern.
9756
b0cfa28a
RA
97572001-08-27 Robert Anisko <robert.anisko@epita.fr>
9758
9759 * src/output.c (output_parser): Fix. Store single '%' characters in
9760 the output obstack instead of throwing them away.
9761
6fc74234
AD
97622001-08-27 Akim Demaille <akim@epita.fr>
9763
9764 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9765
9c76d118
RA
97662001-08-25 Robert Anisko <robert.anisko@epita.fr>
9767
9768 * lib/Makefile.am: Adjust.
9769
a8289c62
RA
97702001-08-25 Robert Anisko <robert.anisko@epita.fr>
9771
9772 * src/bison.simple: Update and add '%%' directives.
9773
b6610515
RA
97742001-08-25 Robert Anisko <robert.anisko@epita.fr>
9775
9776 * src/reader.c (reader): Remove calls to 'output_headers' and
9777 'output_trailers'. Remove some C output.
9778 (readgram): Disable a piece of code that was writing a default
9779 definition for 'YYSTYPE'.
9780 (reader_output_yylsp): Remove.
9781 (packsymbols): Output token defintions to a macro.
9782 (copy_definition): Disable C output.
6fc74234 9783
b6610515
RA
9784 * src/reader.c (parse_macro_decl): New function used to parse macro
9785 declarations.
9786 (copy_string2): Put the body of copy_string into this new function.
9787 Add a parameter to let the caller choose whether he wants to copy the
9788 string delimiters or not.
9789 (copy_string): Be a simple call to copy_string2 with the last argument
9790 bound to true.
9791 (read_declarations): Add case for macro definition.
9792 (copy_identifier): New.
6fc74234 9793 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
9794 rather than lex.
9795
26f609ff
RA
97962001-08-25 Robert Anisko <robert.anisko@epita.fr>
9797
9798 * src/output.c (prepare): Add prefixed names.
9799 (output_parser): Output semantic actions.
9800 (output_parser): Fix bug on '%%line' directives.
6fc74234 9801
26f609ff
RA
9802 * src/output.c (output_headers): Remove. The C code printed by this
9803 function should now be in the skeletons.
9804 (output_trailers): Remove.
9805 (output): Disable call to 'reader_output_yylsp'.
9806 (output_rule_data): Do not output tables to the table obstack.
9807
9808 * src/output.c: Remove some C dedicated output.
9809 Improve the use of macro and output obstacks.
9810 (output_defines): Remove.
6fc74234 9811
26f609ff
RA
9812 * src/output.c (output_token_translations): Associate 'translate'
9813 table with a macro. No output to the table obstack.
9814 (output_gram): Same for 'rhs' and 'prhs'.
9815 (output_stos): Same for 'stos'.
9816 (output_rule_data): Same for 'r1' and 'r2'.
9817 (token_actions): Same for 'defact'.
9818 (goto_actions): Same for 'defgoto'.
9819 (output_base): Same for 'pact' and 'pgoto'.
9820 (output_table): Same for 'table'.
9821 (output_check): Same for 'check'.
6fc74234 9822
26f609ff
RA
9823 * src/output.c (output_table_data): New function.
9824 (output_short_table): Remove.
9825 (output_short_or_char_table): Remove.
6fc74234 9826
26f609ff
RA
9827 * src/output.c (output_parser): Replace most of the skeleton copy code
9828 with something new. Skeletons are now processed character by character
9829 rather than line by line, and Bison looks for '%%' macros. This is the
9830 first step in making Bison's output process (a lot) more flexible.
9831 (output_parser): Use the macro table.
9832
6f43b113
RA
98332001-08-25 Robert Anisko <robert.anisko@epita.fr>
9834
9835 * src/main.c (main): Initialize the macro table.
9836
dd3127cf
RA
98372001-08-25 Robert Anisko <robert.anisko@epita.fr>
9838
9839 * src/lex.c (percent_table): Add tok_define.
9840 * src/lex.h: Add tok_define.
9841
aa321494
RA
98422001-08-25 Robert Anisko <robert.anisko@epita.fr>
9843
9844 * src/macrotab.c: New file.
9845 * src/macrotab.h: New file.
9846 * src/Makefile.am: Update.
9847
68bd3b6b
RA
98482001-08-25 Robert Anisko <robert.anisko@epita.fr>
9849
9850 * lib/hash.c: New file.
9851 * lib/hash.h: New file.
9852 * lib/Makefile.am: Update.
9853
45f8dd1e
AD
98542001-08-15 Akim Demaille <akim@epita.fr>
9855
9856 Version 1.28c.
9857
40a64a7a 98582001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
9859
9860 * src/reader.c (readgram): Indent output macro YYSTYPE.
9861 (packsymbols): Likewise.
9862 (output_token_defines): Likewise.
9863 * src/files.c: Standardize.
9864 (compute_header_macro): New.
9865 (defines_obstack_save): New. Use compute_header_macro.
9866 (output_files): Update. Use defines_obstack_save.
9867
f9a8293a
AD
98682001-08-15 Akim Demaille <akim@epita.fr>
9869
9870 * doc/bison.texinfo (Table of Symbols): Document
9871 YYSTACK_USE_ALLOCA.
9872
150ca7a7
AD
98732001-08-15 Akim Demaille <akim@epita.fr>
9874
9875 * missing: Update from CVS Automake.
9876 * config/config.guess, config/config.sub, config/texinfo.tex:
9877 Update from gnu.org.
9878
69b5cec4
AD
98792001-08-15 Akim Demaille <akim@epita.fr>
9880
9881 * Makefile.maint: Sync with CVS Autoconf.
9882
f2b5126e
PB
98832001-08-14 Pascal Bart <pascal.bart@epita.fr>
9884
69b5cec4 9885 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
9886 `fdl.texi'.
9887 * doc/fdl.texi: Add to package.
9888
4ecbf796
MA
98892001-08-14 Marc Autret <autret_m@epita.fr>
9890
9891 Turn on %{source,header}_extension features.
9892
69b5cec4 9893 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
9894 source_extension.
9895 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 9896 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
9897 between options.
9898
95fb5662
MA
98992001-08-14 Marc Autret <autret_m@epita.fr>
9900
9901 * src/files.c (compute_base_names): Add extensions computing when
9902 `--file-prefix' used.
9903 Standardize function calls.
9904
78d09da9
MA
99052001-08-13 Marc Autret <autret_m@epita.fr>
9906
69b5cec4 9907 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
9908 defining it (defined but null disables alloca).
9909
5a009f2c
MA
99102001-08-13 Marc Autret <autret_m@epita.fr>
9911
9912 * src/bison.simple (_yy_memcpy): CPP reformat.
9913
1e41465a
PB
99142001-08-13 Pascal Bart <pascal.bart@epita.fr>
9915
9916 * tests/atconfig.in (CPPFLAGS): Fix.
9917
c67a198d
PB
99182001-08-10 Pascal Bart <pascal.bart@epita.fr>
9919
79282c6c 9920 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
9921 `gpl.texi'.
9922 * doc/gpl.texi: Add to package.
9923
09a6de7e
MA
99242001-08-10 Marc Autret <autret_m@epita.fr>
9925
9926 * src/print_graph.h: Fix.
9927 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
9928
b77b9ee0
AD
99292001-08-10 Akim Demaille <akim@epita.fr>
9930
9931 * src/system.h: Provide default declarations for stpcpy, strndup,
9932 and strnlen.
9933
3e259915
MA
99342001-08-10 Robert Anisko <anisko_r@epita.fr>
9935
9936 * doc/bison.texinfo (Locations): Update @$ stuff.
9937
ca96bc2d
MA
99382001-08-09 Robert Anisko <anisko_r@epita.fr>
9939
9940 * src/bison.simple (YYLLOC_DEFAULT): Update.
9941 (yyparse): Adjust.
9942
fdc6758b
MA
99432001-08-08 Marc Autret <autret_m@epita.fr>
9944
b77b9ee0 9945 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
9946 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
9947 Reported by Fabrice Bauzac.
957d4dbf 9948
600cad3b
MA
99492001-08-08 Marc Autret <autret_m@epita.fr>
9950
9951 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
9952 * src/vcg.c (output_node): Fix.
9953 * src/vcg.h: Cleanup.
9954 * src/print_graph.c: Add comments.
b77b9ee0 9955 (node_output_size): New global variable. Simplify the formatting of
600cad3b 9956 the VCG graph output.
b77b9ee0 9957 (print_actions): Unused code is now used. It notifies the final state
600cad3b 9958 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 9959 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
9960 blue.
9961 Get the current node name and node_obstack by argument.
9962 (node_obstack): New variable.
9963 (print_state): Manage node_obstack.
9964 (print_core): Use node_obstack given by argument.
9965 A node is not only computed here but in print_actions also.
9966 (print_graph): CPP out useless code instead of commenting it.
9967
976e528f
AD
99682001-08-07 Pascal Bart <pascal.bart@epita.fr>
9969
9970 * tests/atconfig.in (CPPFLAGS): Fix.
9971
20e8e5ca
AD
99722001-08-07 Akim Demaille <akim@epita.fr>
9973
9974 * src/print_graph.c (quote): New.
9975 (print_core): Use it.
9976
957d4dbf 99772001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 9978
3e3da797
AD
9979 * src/vcg.c (complain.h): Include it.
9980 Unepitaize `return' invocations.
c4b66126 9981 [NDEBUG] (main): Remove.
79282c6c 9982 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
9983 * src/files.c (open_files): Initialize graph_obstack.
9984 * src/print_graph.c (print_actions): CPP out useless code.
9985 (print_core): Don't output the last `\n' in labels.
9986 Use `quote'.
9987 * src/files.c (output_files): Output the VCG file.
9988 * src/main.c (main): Invoke print_graph ();
3e3da797 9989
957d4dbf 99902001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
9991
9992 Automaton VCG graph output.
9993 Using option ``-g'' or long option ``--graph'', you can generate
9994 a gram_filename.vcg file containing a VCG description of the LALR (1)
9995 automaton of your grammar.
9996
9997 * src/main.c: Call to print_graph() function.
9998 * src/getargs.h: Update.
9999 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
10000 (graph_flag): New flag.
10001 (longopts): Update.
10002 (getargs): Add case `g'.
10003 * src/files.c (graph_obstack): New obstack struct.
10004 (open_files): Initialize new obstack.
10005 (output_files): Saves graph_obstack if required.
10006 * src/files.h (graph_obstack): New extern declaration.
10007 * src/Makefile.am: Add new source files.
10008
927c1557 100092001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
10010
10011 * src/print_graph.c, src/print_graph.h (graph): New.
10012 * src/vcg.h: New file.
10013 * src/vcg.c: New file, VCG graph handling.
10014
7333d403
AD
100152001-08-06 Marc Autret <autret_m@epita.fr>
10016
10017 Add of %source_extension and %header_extension which specify
10018 the source or/and the header output file extension.
10019
10020 * src/files.c (compute_base_names): Remove initialisation of
10021 src_extension and header_extension.
10022 (compute_exts_from_gf): Update.
10023 (compute_exts_from_src): Update.
10024 (output_files): Update.
10025 * src/reader.c (parse_header_extension_decl): New.
10026 (parse_source_extension_decl): New.
10027 (read_declarations): New case statements for the new tokens.
10028 * src/lex.c (percent_table): Add entries for %source_extension
10029 and %header_extension.
10030 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
10031
84163231
AD
100322001-08-06 Marc Autret <autret_m@epita.fr>
10033
10034 * configure.in: Bump to 1.28c.
10035 * doc/bison.texinfo: Texinfo thingies.
10036
8303fc42
AD
100372001-08-04 Pascal Bart <pascal.bart@epita.fr>
10038
10039 * tests/atconfig.in (CPPFLAGS): Add.
10040 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
10041
70a84437
AD
100422001-08-03 Akim Demaille <akim@epita.fr>
10043
10044 Version 1.28b.
10045
2ce10144
AD
100462001-08-03 Akim Demaille <akim@epita.fr>
10047
10048 * tests/Makefile.am (check-local): Ship testsuite.
10049 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
10050 Include `string.h'.
10051
1e3e4bc1
AD
100522001-08-03 Akim Demaille <akim@epita.fr>
10053
10054 * configure.in: Try using -Wformat when compiling.
10055
42b45b7f
AD
100562001-08-03 Akim Demaille <akim@epita.fr>
10057
10058 * configure.in: Bump to 1.28b.
10059
8f13fe33
AD
100602001-08-03 Akim Demaille <akim@epita.fr>
10061
10062 * src/complain.c: Adjust strerror_r portability issues.
10063
b37ba92c
AD
100642001-08-03 Akim Demaille <akim@epita.fr>
10065
10066 Version 1.28a.
10067
b0ce6046
AD
100682001-08-03 Akim Demaille <akim@epita.fr>
10069
10070 * src/getargs.c, src/getarg.h (skeleton)): Constify.
10071 * src/lex.c (literalchar): Avoid name clashes on `buf'.
10072 * src/getargs.c: Include complain.h.
10073 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
10074 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
10075
d01c415b
AD
100762001-08-03 Akim Demaille <akim@epita.fr>
10077
10078 * src/reader.c (readgram): Display hidden chars in error messages.
10079
459dd1a6
AD
100802001-08-03 Akim Demaille <akim@epita.fr>
10081
10082 Update to gettext 0.10.39.
10083
53b74c0c
AD
100842001-08-03 Akim Demaille <akim@epita.fr>
10085
10086 * lib/strspn.c: New.
10087
234a3be3
AD
100882001-08-01 Marc Autret <autret_m@epita.fr>
10089
10090 * doc/bison.texinfo: Update.
10091 * doc/bison.1 (mandoc): Update.
10092 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
10093 * src/files.c: Support output files extensions computing.
10094 (src_extension): New static variable.
10095 (header_extension): New static variable.
10096 (tr): New function.
10097 (get_extension_index): New function, gets the index of an extension
10098 filename in a string.
10099 (compute_exts_from_gf): New function, computes extensions from the
10100 grammar file extension.
10101 (compute_exts_from_src): New functions, computes extensions from the
10102 C source file extension, file given by ``-o'' option.
10103 (compute_base_names): Update.
10104 (output_files): Update.
10105
847bf1f5
AD
101062001-08-01 Robert Anisko <anisko_r@epita.fr>
10107
d995fee7 10108 * doc/bison.texi: Document @$.
847bf1f5
AD
10109 (Locations): New section.
10110
d074a105
AD
101112001-07-18 Akim Demaille <akim@epita.fr>
10112
10113 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
10114 * config/prev-version.txt, config/move-if-change: New.
10115 * Makefile.am: Adjust.
10116
3419715d
AD
101172001-07-08 Pascal Bart <pascal.bart@epita.fr>
10118
10119 * src/bison.simple (yyparse): Suppress warning `comparaison
10120 between signed and unsigned'.
10121
62ab6972
AD
101222001-07-05 Pascal Bart <pascal.bart@epita.fr>
10123
10124 * src/getargs.h (raw_flag): Remove.
10125 * src/getargs.c: Die on `-r'/`--raw'.
10126 * src/lex.c (parse_percent_token): Die on `%raw'.
10127 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
10128 * tests/calc.at: Suppress test with option `--raw'.
10129
1e24cc5b
AD
101302001-07-14 Akim Demaille <akim@epita.fr>
10131
10132 * config/: New.
10133 * configure.in: Require Autoconf 2.50.
10134 Update to gettext 0.10.38.
10135
32dfccf8
AD
101362001-03-16 Akim Demaille <akim@epita.fr>
10137
10138 * doc/bison.texinfo: ANSIfy the examples.
10139
cd5bd6ac
AD
101402001-03-16 Akim Demaille <akim@epita.fr>
10141
10142 * getargs.c (skeleton): New variable.
10143 (longopts): --skeleton is a new option.
10144 (shortopts, getargs): -S is a new option.
10145 * getargs.h: Declare skeleton.
10146 * output.c (output_parser): Use it.
10147
5141b016
AD
101482001-03-16 Akim Demaille <akim@epita.fr>
10149
10150 * m4/strerror_r.m4: New.
10151 * m4/error.m4: Run AC_FUNC_STRERROR_R.
10152 * lib/error.h, lib/error.c: Update.
10153
447992b9
AD
101542001-03-16 Akim Demaille <akim@epita.fr>
10155
10156 * src/getargs.c (longopts): Clean up.
10157
274d42ce
AD
101582001-02-21 Akim Demaille <akim@epita.fr>
10159
10160 * src/reader.c (gensym): `gensym_count' is your own.
10161 Use a static buf to create the symbol name, as token_buffer is no
10162 longer a buffer.
10163
22c821f3
AD
101642001-02-08 Akim Demaille <akim@epita.fr>
10165
10166 * src/conflicts.c (conflict_report): Be sure not to append to res
10167 between two calls, which could happen if both first sprintf were
10168 skipped, but not the first cp += strlen.
10169
18569462
AD
101702001-02-08 Akim Demaille <akim@epita.fr>
10171
10172 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
10173 New, from fileutils 4.0.37.
10174 * configure.in: Require Autoconf 2.49c. I took some time before
10175 making this decision. This is the only way out for portability
10176 issues in Bison, it would mean way too much duplicate effort to
10177 import in Bison features implemented in 2.49c since 2.13.
10178 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
10179
0d8f3c8a
AD
101802001-02-02 Akim Demaille <akim@epita.fr>
10181
10182 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 10183 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 10184
f17bcd1f
AD
101852001-01-19 Akim Demaille <akim@epita.fr>
10186
10187 Get rid of the ad hoc handling of token_buffer in the scanner: use
10188 the obstacks.
10189
10190 * src/lex.c (token_obstack): New.
10191 (init_lex): Initialize it. No longer call...
10192 (grow_token_buffer): this. Remove it.
10193 Adjust all the places which used it to use the obstack.
10194
511e79b3
AD
101952001-01-19 Akim Demaille <akim@epita.fr>
10196
10197 * src/lex.h: Rename all the tokens:
10198 s/\bENDFILE\b/tok_eof/g;
10199 s/\bIDENTIFIER\b/tok_identifier/g;
10200 etc.
10201 Let them be enums, not #define, to ease debugging.
10202 Adjust all the code.
10203
0d6508ef
AD
102042001-01-18 Akim Demaille <akim@epita.fr>
10205
10206 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
10207 * src/lex.c (maxtoken, grow_token_buffer): Static.
10208
6deb4447
AD
102092001-01-18 Akim Demaille <akim@epita.fr>
10210
10211 Since we now use obstacks, more % directives can be enabled.
10212
10213 * src/lex.c (percent_table): Also accept `%yacc',
10214 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
10215 `%debug'.
10216 Handle the actions for `%semantic_parser' and `%pure_parser' here,
10217 instead of returning a token.
10218 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
10219 * src/reader.c (read_declarations): Adjust.
10220 * src/files.c (open_files): Don't call `compute_base_names', don't
10221 compute `attrsfile' since they depend upon data which might be
10222 *in* the input file now.
10223 (output_files): Do it here.
10224 * src/output.c (output_headers): Document the fact that this patch
10225 introduces a guaranteed SEGV for semantic parsers.
10226 * doc/bison.texinfo: Document them.
10227 * tests/suite.at: Exercise these %options.
10228
ff4423cc
AD
102292000-12-20 Akim Demaille <akim@epita.fr>
10230
10231 Also handle the output file (--verbose) with obstacks.
10232
10233 * files.c (foutput): Remove.
10234 (output_obstack): New.
10235 Adjust all dependencies.
10236 * src/conflicts.c: Return a string.
10237 * src/system.h (obstack_grow_string): Rename as...
10238 (obstack_sgrow): this. Be ready to work with non literals.
10239 (obstack_fgrow4): New.
10240
956dba3a
AD
102412000-12-20 Akim Demaille <akim@epita.fr>
10242
10243 * src/files.c (open_files): Fix the computation of short_base_name
10244 in the case of `-o foo.tab.c'.
10245
337bab46
AD
102462000-12-20 Akim Demaille <akim@epita.fr>
10247
10248 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
10249 (copy_dollar): Now that everything uses obstacks, get rid of the
10250 FILE * parameters.
10251
5d3214b8
AD
102522000-12-20 Akim Demaille <akim@epita.fr>
10253
10254 * src/files.c (open_files): Actually the `.output' file is based
10255 on the short_base_name, not base_name.
10256 * tests/suite.at (Checking output file names): Adjust.
10257
29092a57
AD
102582000-12-20 Akim Demaille <akim@epita.fr>
10259
10260 * src/bison.s1: Remove, we now use directly...
10261 * src/bison.simple: this.
10262 * src/Makefile.am: Use pkgdata instead of data.
10263
ea5607fd
AD
102642000-12-20 Akim Demaille <akim@epita.fr>
10265
10266 * src/files.c (guard_obstack): New.
10267 (open_files): Initialize it.
10268 (output_files): Dump it...
10269 * src/files.h: Export it.
10270 * src/reader.c (copy_guard): Use it.
10271
27110317
AD
102722000-12-19 Akim Demaille <akim@epita.fr>
10273
10274 * src/files.c (outfile, defsfile, actfile): Removed as global
10275 vars.
10276 (open_files): Don't compute them.
10277 (output_files): Adjust.
10278 (base_name, short_base_name): Be global.
10279 Adjust dependencies.
10280
19c50364
AD
102812000-12-19 Akim Demaille <akim@epita.fr>
10282
10283 * src/files.c (strsuffix): New.
10284 (stringappend): Be just like strcat but allocate.
10285 (base_names): Eve out from open_files.
10286 Try to simplify the rather hairy computation of base_name and
10287 short_base_name.
10288 (open_files): Use it.
10289 * tests/suite.at (Checking output file names): New test.
10290
573c1d9f
AD
102912000-12-19 Akim Demaille <akim@epita.fr>
10292
10293 * src/system.h (obstack_grow_literal_string): Rename as...
10294 (obstack_grow_string): this.
10295 * src/output.c (output_parser): Recognize `%% actions' instead of
10296 `$'.
10297 * src/bison.s1: s/$/%% actions/.
10298 * src/bison.hairy: Likewise.
10299
ef7ddedd
AD
103002000-12-19 Akim Demaille <akim@epita.fr>
10301
10302 * src/output.c (output_parser): Compute the `#line' lines when
10303 there are.
10304 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
10305 Suggested by Hans Aberg.
10306
ff61dabd
AD
103072000-12-19 Akim Demaille <akim@epita.fr>
10308
10309 Let the handling of the skeleton files be local to the procedures
10310 that use it.
10311
10312 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
10313 longer static.
10314 (fparser, open_extra_files): Remove.
10315 (open_files, output_files): Don't take care of fparser.
10316 * src/files.h: Adjust.
10317 * src/output.c (output_parser): Open and close the file to the
10318 skeleton.
10319 * src/reader.c (read_declarations): When %semantic_parser, open
10320 fguard.
10321
55b96341
AD
103222000-12-19 Akim Demaille <akim@epita.fr>
10323
10324 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
10325 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
10326
358c15b7
AD
103272000-12-19 Akim Demaille <akim@epita.fr>
10328
10329 * src/files.c (open_files): Yipee! We no longer need all the code
10330 looking for `/tmp' since we have no tmp file.
10331
7de3329e
AD
103322000-12-19 Akim Demaille <akim@epita.fr>
10333
10334 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
10335 New macros.
10336 * src/files.c (open_files): Less dependency on MSDOS etc.
10337
3abcd459
AD
103382000-12-14 Akim Demaille <akim@epita.fr>
10339
10340 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
10341 Provide a default definition.
10342 Use it when executing the default @ action.
10343 * src/reader.c (reader_output_yylsp): No longer include
10344 `timestamp' and `text' in the default YYLTYPE.
10345
2a91a95e
AD
103462000-12-12 Akim Demaille <akim@epita.fr>
10347
10348 * src/reader.c (copy_definition, parse_union_decl, copy_action)
10349 (copy_guard): Quote the file names.
10350 Reported by Laurent Mascherpa.
10351
14d3eb9b
AD
103522000-12-12 Akim Demaille <akim@epita.fr>
10353
10354 * src/output.c (output_headers, output_program, output): Be sure
10355 to escape special characters when outputting filenames.
10356 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
10357 (output_headers): Don't depend on them, Use ACTSTR.
10358
d7045ec6
AD
103592000-11-17 Akim Demaille <akim@epita.fr>
10360
10361 * lib/obstack.h: Formatting changes.
10362 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
10363 prevents type checking.
10364 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10365 cast the value to (void *): assigning a `foo *' to a `void *'
10366 variable is valid.
10367 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10368 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
10369 append characters.
10370
6fd54b73
AD
103712000-11-17 Akim Demaille <akim@epita.fr>
10372
10373 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
10374 as...
10375 (suite.m4, regression.m4, calc.m4): these.
10376 * tests/atgeneral.m4: Update from CVS Autoconf.
10377
4c50eae6
AD
103782000-11-17 Akim Demaille <akim@epita.fr>
10379
10380 * tests/regression.m4 (%union and --defines): New test,
10381 demonstrating a current bug in the obstack implementation.
10382
a35f64ea
AD
103832000-11-17 Akim Demaille <akim@epita.fr>
10384
10385 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
10386 macros.
10387 Use them to declare the variables which are global or local to
10388 `yyparse'.
10389
7de23534
AD
103902000-11-17 Akim Demaille <akim@epita.fr>
10391
10392 * acconfig.h: Remove, no longer used.
10393
aa7815f5
AD
103942000-11-07 Akim Demaille <akim@epita.fr>
10395
10396 * src: s/Copyright (C)/Copyright/g.
10397
5af1f549
AD
103982000-11-07 Akim Demaille <akim@epita.fr>
10399
10400 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
10401 defining.
10402 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
10403
553e2b22
AD
104042000-11-07 Akim Demaille <akim@epita.fr>
10405
10406 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
10407 Merge in a single CPP if/else.
10408
8a4f41d6
AD
104092000-11-07 Akim Demaille <akim@epita.fr>
10410
10411 * src/output.c (output): Remove useless variables.
10412 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
10413 argument `data' for consistency with the prototypes.
10414 Qualify it `const'.
10415 (obstack_copy, obstack_copy0): Rename the second argument as
10416 `address' for consistency. Qualify it `const'.
10417 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
10418 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
10419 `const' their input argument (`data' or `address').
10420 Adjust the corresponding macros to include `const' in casts.
10421
095a3fb5
AD
104222000-11-03 Akim Demaille <akim@epita.fr>
10423
10424 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
10425 s/PFILE1/BISON_HAIRY/.
10426 Adjust dependencies.
10427
d1cdce7c
AD
104282000-11-03 Akim Demaille <akim@epita.fr>
10429
090c5ebf 10430 For some reason, this was not applied.
d1cdce7c
AD
10431
10432 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
10433 `unlink': it's no longer used.
10434
9311529b
AD
104352000-11-03 Akim Demaille <akim@epita.fr>
10436
10437 * src/files.c (skeleton_find): New function, eved out of...
10438 (open_files, open_extra_files): here.
10439
d8880f69
AD
104402000-11-03 Akim Demaille <akim@epita.fr>
10441
10442 Don't use `atexit'.
10443
10444 * src/files.c (obstack_save): New function.
10445 (done): Rename as...
10446 (output_files): this.
10447 Use `obstack_save'.
10448 * src/main.c (main): Don't use `atexit' to register `done', since
10449 it no longer has to remove tmp files, just call `output_files'
10450 when there are no errors.
10451
0dbb648e
AD
104522000-11-02 Akim Demaille <akim@epita.fr>
10453
10454 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
10455 `unlink': it's no longer used.
10456 * src/files.h: Formatting changes.
10457
896fe5c1
AD
104582000-11-02 Akim Demaille <akim@epita.fr>
10459
10460 Remove the last uses of mktemp and unlink/delete.
10461
10462 * src/files.c (fdefines, ftable): Removed.
10463 (defines_ostack, table_obstack): New.
10464 Adjust dependencies of the former into uses of the latter.
10465 * src/output.c (output_short_or_char_table, output_short_table):
10466 Convert to using obstacks.
10467 * src/reader.c (copy_comment2): Accept one FILE * and two
10468 obstacks.
10469 (output_token_defines, reader_output_yylsp): Use obstacks.
10470 * src/system.h (obstack_fgrow3): New.
1f65350a 10471 * po/POTFILES.in: Adjust.
896fe5c1 10472
dd60faec
AD
104732000-11-01 Akim Demaille <akim@epita.fr>
10474
10475 Change each use of `fattrs' into a use of `attrs_obstack'.
10476
10477 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
10478 * src/files.c (fattrs): Remove.
10479 (attrs_obstack): New.
10480 Adjust all dependencies.
10481 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
10482
8c7ebe49
AD
104832000-11-01 Akim Demaille <akim@epita.fr>
10484
10485 Introduce obstacks.
10486 Change each use of `faction' into a use of `action_obstack'.
10487
10488 * lib/obstack.h, lib/obstack.c: New files.
10489 * src/files.c (faction): Remove.
10490 (action_obstack): New.
10491 Adjust all dependencies.
10492
77aee789
AD
104932000-10-20 Akim Demaille <akim@epita.fr>
10494
10495 * lib/quote.h (PARAMS): New macro. Use it.
10496
43591cec
AD
104972000-10-16 Akim Demaille <akim@epita.fr>
10498
10499 * src/output.c (output_short_or_char_table): New function.
10500 (output_short_table, output_token_translations): Use it.
10501 (goto_actions): Use output_short_table.
10502
1e9798d5
AD
105032000-10-16 Akim Demaille <akim@epita.fr>
10504
10505 * src/symtab.c (bucket_new): New function.
10506 (getsym): Use it.
10507
10508 * src/output.c (output_short_table): New argument to display the
10509 comment associated with the table.
10510 Adjust dependencies.
10511 (output_gram): Use it.
10512 (output_rule_data): Nicer output layout for YYTNAME.
10513
f282676b
AD
105142000-10-16 Akim Demaille <akim@epita.fr>
10515
10516 * src/lex.c (read_typename): New function.
10517 (lex): Use it.
10518 * src/reader.c (copy_dollar): Likewise.
10519
550a72a3
AD
105202000-10-16 Akim Demaille <akim@epita.fr>
10521
10522 * src/reader.c (copy_comment2): Expect the input stream to be on
10523 the `/' which is suspected to open a comment, instead of being
10524 called after `//' or `/*' was read.
10525 (copy_comment, copy_definition, parse_union_decl, copy_action)
10526 (copy_guard): Adjust.
10527
131e2fef
AD
105282000-10-16 Akim Demaille <akim@epita.fr>
10529
10530 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
10531 `read_signed_integer'.
10532
79282c5a
AD
105332000-10-16 Akim Demaille <akim@epita.fr>
10534
10535 * src/reader.c (copy_dollar): New function.
10536 (copy_guard, copy_action): Use it.
10537
ff4a34be
AD
105382000-10-16 Akim Demaille <akim@epita.fr>
10539
10540 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
10541 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
10542 New files, from Fileutils 4.0.27.
10543 * src/main.c (printable_version): Remove.
10544 * src/lex.c, src/reader.c: Use `quote'.
10545
105462000-10-04 Akim Demaille <akim@epita.fr>
10547
10548 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
10549
14ded682
AD
105502000-10-04 Akim Demaille <akim@epita.fr>
10551
10552 * doc/bison.texinfo: Various typos spotted by Neil Booth.
10553
8e03724b
AD
105542000-10-04 Akim Demaille <akim@epita.fr>
10555
10556 When a literal string is used to define two different tokens,
10557 `bison -v' segfaults.
10558 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
10559
10560 * tests/regression.m4: New file.
10561 Include the core of the sample provided by Piotr Gackiewicz.
10562 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
10563 properly.
10564
a9e64249
AD
105652000-10-04 Akim Demaille <akim@epita.fr>
10566
10567 * src/reader.c (parse_expect_decl): Keep `count' within the size
10568 of `buffer'.
10569 From Neil Booth.
10570
da9abf43
AD
105712000-10-02 Paul Eggert <eggert@twinsun.com>
10572
10573 * bison.s1 (yyparse): Assign the default value
10574 unconditionally, to avoid a GCC warning and make the parser a
10575 tad smaller.
10576
c33638bb
AD
105772000-10-02 Akim Demaille <akim@epita.fr>
10578
10579 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
10580 options.
10581
444c570a
AD
105822000-10-02 Akim Demaille <akim@epita.fr>
10583
10584 * src/derives.c, src/print.c, src/reduce.c: To ease the
10585 translation, move some `\n' out of the translated strings.
10586
89cab50d
AD
105872000-10-02 Akim Demaille <akim@epita.fr>
10588
10589 The location tracking mechanism is precious for parse error
10590 messages. Nevertheless, it is enabled only when `@n' is used in
10591 the grammar, which is a different issue (you can use it in error
10592 message, but not in the grammar per se). Therefore, there should
10593 be another means to enable it.
10594
10595 * src/getargs.c (getargs): Support `--locations'.
10596 (usage): Report it.
10597 * src/getargs.h (locationsflag): Export it.
10598 * src/lex.c (percent_table): Support `%locations'.
10599 * src/reader.c (yylsp_needed): Remove this variable, now replaced
10600 with `locationsflag'.
10601 * doc/bison.texinfo: Document `--locations' and `%locations'.
10602 Sort the options.
10603 * tests/calc.m4: Test it.
10604
10605 For regularity of the names, replace each
10606 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
10607 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
10608 In addition replace each `flag' with `_flag'.
10609
d6c2cba0
AD
106102000-10-02 Akim Demaille <akim@epita.fr>
10611
10612 Also test parse error messages, including with YYERROR_VERBOSE.
10613
10614 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
10615 associative).
10616 Use it to check the computations.
10617 Use it to check `nonassoc' is honored.
10618 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
10619 `--yyerror-verbose'.
10620 (_AT_CHECK_CALC): Adjust to this option.
10621 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
10622
5a35a6cb
AD
106232000-10-02 Akim Demaille <akim@epita.fr>
10624
10625 Test also `--verbose', `--defines' and `--name-prefix'. Testing
10626 the latter demonstrates a flaw in the handling of non debugging
10627 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
10628 was used in order to simplify:
10629
10630 #if YYDEBUG
10631 if (yydebug)
10632 {
10633 ...
10634 }
10635 #endif
10636
10637 into
10638
10639 if (yydebug)
10640 {
10641 ...
10642 }
10643
10644 unfortunately this leads to a CPP conflict when
10645 `--name-prefix=foo' is used since it produces `#define yydebug
10646 foodebug'.
10647
10648 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
10649 (YYDPRINTF): New macro.
10650 Spread its use.
10651 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
10652 the bison options.
10653 Also test `--verbose', `--defines' and `--name-prefix'.
10654
71da9eea
AD
106552000-10-02 Akim Demaille <akim@epita.fr>
10656
10657 Improve the readability of the produced parsers.
10658
10659 * src/bison.s1: Formatting changes.
10660 Improve the comment related to the `$' mark.
10661 (yydefault): Don't fall through to `yyresume': `goto' there.
10662 * src/output.c (output_parser): When the `$' is met, skip the end
10663 of its line.
10664 New variable, `number_of_dollar_signs', to check there's exactly
10665 one `$' in the parser skeleton.
10666
95e36146
AD
106672000-10-02 Akim Demaille <akim@epita.fr>
10668
10669 * lib/xstrdup.c: New file, from the fileutils.
10670 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
10671 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
10672 instead of strlen + xmalloc + strcpy.
10673 * src/symtab.c (copys): Remove, use xstrdup instead.
10674
d7020c20
AD
106752000-10-02 Akim Demaille <akim@epita.fr>
10676
10677 * src/gram.h (associativity): New enum type which replaces the
10678 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
10679 `right_assoc', `left_assoc' and `non_assoc'.
10680 Adjust all dependencies.
10681 * src/reader.c: Formatting changes.
10682 (LTYPESTR): Don't define it, use it as a literal in
10683 `reader_output_yylsp'.
10684 * src/symtab.h (symbol_class): New enum type which replaces the
10685 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
10686 `sunknown', `stoken and `snterm'.
10687
1916f98e
AD
106882000-10-02 Akim Demaille <akim@epita.fr>
10689
10690 * src/getargs.c (fixed_outfiles): Rename as...
10691 (yaccflag): for consistency and accuracy.
10692 Adjust dependencies.
10693
d7913476
AD
106942000-10-02 Akim Demaille <akim@epita.fr>
10695
10696 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
10697 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
10698 difficult and introduced a lot of core dump. It turns out that
10699 Bison used an implementation of `xmalloc' based on `calloc', and
10700 at various places it does depend upon the initialization to 0. I
10701 have not tried to isolate the pertinent places, and all the former
10702 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
10703 someone should address this issue.
10704
10705 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
10706 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
10707 files.
10708 Adjust dependencies.
10709 * src/warshall.h: New file.
10710 Propagate.
10711
340ef489
AD
107122000-10-02 Akim Demaille <akim@epita.fr>
10713
10714 Various anti-`extern in *.c' changes.
10715
10716 * src/system.h: Include `assert.h'.
10717
b2ca4022
AD
107182000-10-02 Akim Demaille <akim@epita.fr>
10719
10720 * src/state.h (nstates, final_state, first_state, first_shift)
10721 (first_reduction): Move their exportation from here...
10722 * src/LR0.h: to here.
10723 Adjust dependencies.
10724 * src/getargs.c (statisticsflag): New variable.
10725 Add support for `--statistics'.
10726 Adjust dependencies.
10727
10728 Remove a lot of now useless `extern' statements in most files.
10729
403b315b
AD
107302000-10-02 Akim Demaille <akim@epita.fr>
10731
10732 * src/LR0.h: New file.
10733 Propagate its use.
10734
07a58c13
AD
107352000-10-02 Akim Demaille <akim@epita.fr>
10736
10737 * src/print.h: New file.
10738 Propagate its use.
10739 * src/print.c: Formatting and ordering changes.
10740 (verbose, terse): Replace with...
10741 (print_results): this new function.
10742 Adjust dependencies.
10743
0619caf0
AD
107442000-10-02 Akim Demaille <akim@epita.fr>
10745
10746 * src/conflicts.c (conflict_report): New function.
10747 (conflict_log, verbose_conflict_log): Replace with...
10748 (print_conflicts): this function.
10749 Adjust dependencies.
10750 * src/conflicts.h: New file.
10751 Propagate its inclusion.
10752
3519ec76
AD
107532000-10-02 Akim Demaille <akim@epita.fr>
10754
10755 * src/nullable.h: New file.
10756 Propagate its inclusion.
10757 * src/nullable.c: Formatting changes.
10758
015acc48
AD
107592000-10-02 Akim Demaille <akim@epita.fr>
10760
10761 * src/reduce.h: New file.
10762 Propagate its inclusion.
10763 * src/reduce.c: Topological sort and other formatting changes.
10764 (bool, TRUE, FALSE): Move their definition to...
10765 * src/system.h: here.
10766
8963a27b
AD
107672000-10-02 Akim Demaille <akim@epita.fr>
10768
10769 * src/files.c: Formatting changes.
10770 (tryopen, tryclose, openfiles): Rename as...
10771 (xfopen, xfclose, open_files): this.
10772 (stringappend): static.
10773 * src/files.h: Complete the list of exported symbols.
10774 Propagate its use.
10775
a70083a3
AD
107762000-10-02 Akim Demaille <akim@epita.fr>
10777
10778 * src/reader.h: New file.
10779 Propagate its use instead of tedious list of `extern' and
10780 prototypes.
10781 * src/reader.c: Formatting changes, topological sort,
10782 s/register//.
10783
abadc117
AD
107842000-10-02 Akim Demaille <akim@epita.fr>
10785
10786 * src/lex.h: Prototype `lex.c' exported functions.
10787 * src/reader.c: Adjust.
10788 * src/lex.c: Formatting changes.
10789 (safegetc): Rename as...
10790 (xgetc): this.
10791
720d742f
AD
107922000-10-02 Akim Demaille <akim@epita.fr>
10793
10794 * src/lalr.h: New file.
10795 Propagate its inclusion instead of prototypes and `extern'.
10796 * src/lalr.c: Formatting changes, topological sorting etc.
10797
f2acea59
AD
107982000-10-02 Akim Demaille <akim@epita.fr>
10799
10800 * src/output.c (token_actions): Introduce a temporary array,
10801 YYDEFACT, that makes it possible for this function to use
10802 output_short_table.
10803
d019d655
AD
108042000-10-02 Akim Demaille <akim@epita.fr>
10805
10806 `user_toknums' is output as a `short[]' in `output.c', while it is
10807 defined as a `int[]' in `reader.c'. For consistency with the
10808 other output tables, `user_toknums' is now defined as a table of
10809 shorts.
10810
10811 * src/reader.c (user_toknums): Be a short table instead of an int
10812 table.
10813 Adjust dependencies.
10814
10815 Factor the short table outputs.
10816
10817 * src/output.c (output_short_table): New function.
10818 * src/output.c (output_gram, output_stos, output_rule_data)
10819 (output_base, output_table, output_check): Use it.
10820
6c89f1c1
AD
108212000-10-02 Akim Demaille <akim@epita.fr>
10822
10823 * src/output.c (output): Topological sort of the functions, in
10824 order to get rid of the `static' prototypes.
10825 No longer use `register'.
10826 * src/output.h: New file.
10827 Propagate its inclusion in files explicitly prototyping functions
10828 from output.c.
10829
d9efd181
AD
108302000-09-21 Akim Demaille <akim@epita.fr>
10831
10832 * src/atgeneral.m4: Update from Autoconf.
10833
c29240e7 108342000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
10835
10836 * src/closure.h: New file.
10837 * src/closure.c: Formatting changes, topological sort over the
10838 functions, use of closure.h.
10839 (initialize_closure, finalize_closure): Rename as...
10840 (new_closure, free_closure): these. Adjust dependencies.
10841 * src/LR0.c: Formatting changes, topological sort, use of
10842 cloture.h.
10843 (initialize_states): Rename as...
10844 (new_states): this.
10845 * src/Makefile.am (noinst_HEADERS): Adjust.
10846
499daa50
AD
108472000-09-20 Akim Demaille <akim@epita.fr>
10848
10849 * src/acconfig.h: Don't protect config.h against multiple
10850 inclusion.
10851 Don't define PARAMS.
10852 * src/system.h: Define PARAMS.
10853 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
10854 purpose of config.h. system.h must not try to fix wrong
10855 definitions in config.h.
10856
cc84fd5d
AD
108572000-09-20 Akim Demaille <akim@epita.fr>
10858
10859 * src/derives.h: New file.
10860 * src/main.c, src/derives.h: Use it.
10861 Formatting changes.
10862 * src/Makefile.am (noinst_HEADERS): Adjust.
10863
db5b3a89
AD
108642000-09-20 Akim Demaille <akim@epita.fr>
10865
10866 * tests/atgeneral.m4: Update from Autoconf.
10867 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
10868 (AT_CHECK_CALC): New macros.
10869 Use these macros to test bison with options `', `--raw',
10870 `--debug', `--yacc', `--yacc --debug'.
10871
ceed8467
AD
108722000-09-19 Akim Demaille <akim@epita.fr>
10873
10874 * src/output.c: Formatting changes.
10875 * src/machine.h: Remove, leaving its contents in...
10876 * src/system.h: here.
10877 Include stdio.h.
10878 Adjust all dependencies on stdio.h and machine.h.
10879 * src/getargs.h: New file.
10880 Let all `extern' declarations about getargs.c be replaced with
10881 inclusion of `getargs.h'.
10882 * src/Makefile.am (noinst_HEADERS): Adjust.
10883
10884 * tests/calc.m4 (yyin): Be initialized in main, not on the global
10885 scope.
10886 (yyerror): Returns void, not int.
10887 * doc/bison.texinfo: Formatting changes.
10888
05a1d24b
AD
108892000-09-19 Akim Demaille <akim@epita.fr>
10890
10891 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
10892 portable.
10893
cbd25751
AD
108942000-09-18 Akim Demaille <akim@epita.fr>
10895
10896 * configure.in: Append WARNING_CFLAGS to CFLAGS.
10897 * src/Makefile.am (INCLUDES): Don't.
10898 Be ready to fetch headers in lib/.
10899
13863333
AD
109002000-09-18 Akim Demaille <akim@epita.fr>
10901
10902 * doc/bison.texinfo: Update the copyright.
10903 ANSIfy and GNUify the examples.
10904 Remove the old menu.
10905
0d533154
AD
109062000-09-18 Akim Demaille <akim@epita.fr>
10907
10908 First set of tests: use the `calc' example from the documentation.
10909
10910 * src/bison.s1 (yyparse): Condition the code using `yytname' which
10911 is defined only when YYDEBUG is.
10912 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
10913 * src/files.c (tryopen, tryclose): Formatting changes.
10914 Move to the top and be static.
10915 * src/reader.c (read_signed_integer): Likewise.
10916 * tests/calc.m4: New file.
10917 * Makefile.am, suite.m4: Adjust.
10918 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
10919
e79137ac
AD
109202000-09-18 Akim Demaille <akim@epita.fr>
10921
10922 Add support for an Autotest test suite for Bison.
10923
10924 * m4/m4.m4, m4/atconfig.m4: New files.
10925 * m4/Makefile.am (EXTRA_DIST): Adjust.
10926 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
10927 files.
10928 * src/getargs.c: Display a more standard --version message.
10929 * src/reader.c (reader): Formatting changes.
10930 No longer depend upon VERSION_STRING.
10931 * configure.in: No longer use `dnl'.
10932 Set up the test suite and the new directory `tests/.
10933 (VERSION_STRING): Remove.
10934
27821bff
AD
109352000-04-14 Akim Demaille <akim@epita.fr>
10936
10937 * src/reader.c (copy_comment2): New function, same as former
10938 `copy_comment', but outputs into two FILE *.
10939 (copy_comment): Use it.
10940 (parse_union_decl): Use it.
10941 (get_type, parse_start_decl): Use the same `invalid' message.
10942 (parse_start_decl, parse_union_decl): Use the same `multiple'
10943 message.
10944 (parse_union_decl, copy_guard, copy_action): Use the same
10945 `unmatched' message.
10946 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
10947
cfe5fbc0
AD
109482000-03-31 Akim Demaille <akim@epita.fr>
10949
10950 * src/files.c (tryopen, tryclose): Move to the top.
10951 Be static.
10952
cb7db13e
AD
109532000-03-31 Akim Demaille <akim@epita.fr>
10954
10955 * src/main.c (main): Don't call `done', exit does it.
10956
a0f6b076
AD
109572000-03-31 Akim Demaille <akim@epita.fr>
10958
36281465
AD
10959 * allocate.c: s/return (foo)/return foo/.
10960 * lalr.c: Likewise.
10961 * LR0.c: Likewise.
10962 * output.c: Likewise.
10963 * reader.c: Likewise.
10964 * symtab.c: Likewise.
10965 * vmsgetargs.c: Likewise.
10966
109672000-03-31 Akim Demaille <akim@epita.fr>
10968
10969 Clean up the error reporting functions.
a0f6b076
AD
10970
10971 * src/report.c: New file.
10972 * src/report.h: Likewise.
10973 * src/Makefile.am: Adjust.
10974 * m4/error.m4: New file.
10975 * m4/Makefile.am: Adjust.
10976 * configure.in (jm_PREREQ_ERROR): Call it.
10977 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
10978 Remove.
10979 (fatal, fatals): Remove. All callers use complain.c::fatal.
10980 (warn, warni, warns, warnss, warnss): Remove. All callers use
10981 complain.c::complain.
10982 (toomany): Remove, use fatal instead.
10983 * src/files.c (done): No argument, use complain_message_count.
10984 * src/main.c (main): Register `done' to `atexit'.
10985
10986 * src/getargs.c (usage): More `fputs', less `fprintf'.
10987
18539825
AD
109882000-03-28 Akim Demaille <akim@epita.fr>
10989
10990 * lib/: New directory.
10991 * Makefile.am (SUBDIRS): Adjust.
10992 * configure.in: Adjust.
10993 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
10994 useless.
10995 * src/alloca.c: Moved to lib/.
10996 * src/getopt.c: Likewise.
10997 * src/getopt1.c: Likewise.
10998 * src/getopt.h: Likewise.
10999 * src/ansi2knr.c: Likewise.
11000 * src/ansi2knr.1: Likewise.
11001 * src/Makefile.am: Adjust.
11002 * lib/Makefile.am: New file.
11003
9f306f2a
AD
110042000-03-28 Akim Demaille <akim@epita.fr>
11005
11006 * src/getargs.c (usage): Refresh the help message.
11007
0ba347b6
AD
110082000-03-17 Akim Demaille <akim@epita.fr>
11009
11010 * src/getopt1.c: Updated from textutils 2.0e
11011 * src/getopt.c: Likewise.
11012 * src/getopt.h: Likewise.
11013
dbe7f271
AD
110142000-03-17 Akim Demaille <akim@epita.fr>
11015
11016 * src/Makefile.am (bison.simple): Fix the awk program: quote only
11017 the file name, not the whole `#line LINE FILE'.
11018
75bbe78d
AD
110192000-03-17 Akim Demaille <akim@epita.fr>
11020
11021 On syntax errors, report the token on which we choked.
11022
aa5fd0ee
AD
11023 * src/bison.s1 (yyparse): In the label yyerrlab, when
11024 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 11025
7b306f52
AD
110262000-03-17 Akim Demaille <akim@epita.fr>
11027
aa5fd0ee 11028 * src/reader.c (copy_at): New function.
7b306f52
AD
11029 (copy_guard): Use it.
11030 (copy_action): Use it.
11031
e87b5700
AD
110322000-03-17 Akim Demaille <akim@epita.fr>
11033
11034 Be kind to translators, save some useless translations.
11035
aa5fd0ee 11036 * src/main.c (banner): New function.
e87b5700
AD
11037 (fatal_banner): Use it.
11038 (warn_banner): Use it.
11039
ae3c3164
AD
110402000-03-17 Akim Demaille <akim@epita.fr>
11041
aa5fd0ee
AD
11042 * src/reader.c (copy_definition): Use copy_string and
11043 copy_comment. Removed now unused `match', `ended',
11044 `cplus_comment'.
ae3c3164
AD
11045 (copy_comment, copy_string): Moved, to be visible from
11046 copy_definition.
11047
4dc58e7c
AD
110482000-03-17 Akim Demaille <akim@epita.fr>
11049
aa5fd0ee
AD
11050 * src/reader.c (copy_string): Declare `static inline'. No
11051 problems with inline, since it is checked by configure.
4dc58e7c
AD
11052 (copy_comment): Likewise.
11053
0a6384c4
AD
110542000-03-17 Akim Demaille <akim@epita.fr>
11055
aa5fd0ee 11056 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 11057
3cef001a
AD
110582000-03-17 Akim Demaille <akim@epita.fr>
11059
aa5fd0ee 11060 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
11061 (copy_action): Use it. Removed now unused `match', `ended',
11062 `cplus_comment'.
11063 (copy_guard): Likewise.
11064
ca36d2ef
AD
110652000-03-17 Akim Demaille <akim@epita.fr>
11066
aa5fd0ee 11067 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
11068 (copy_action): Use it.
11069 (copy_guard): Likewise.
11070
6666f98f
AD
110712000-03-17 Akim Demaille <akim@epita.fr>
11072
11073 Change the handling of @s so that they behave exactly like $s.
11074 There is now a pseudo variable @$ (readble and writable), location
11075 of the lhs of the rule (by default ranging from the location of
11076 the first symbol of the rhs, to the location of the last symbol,
11077 or, if the rhs is empty, YYLLOC).
11078
11079 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
11080 yyval.
11081 (yyparse): When providing a default semantic action, provide a
11082 default location action.
11083 (after the $): No longer change `*YYLSP', just stack YYLOC the
11084 same way you stack YYVAL.
11085 * src/reader.c (read_declarations): Use warns.
11086 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
11087 (copy_action, case '@'): Likewise.
11088 Use a standard error message, to save useless work from
11089 translators.
11090
41aca2e0
AD
110912000-03-17 Akim Demaille <akim@epita.fr>
11092
aa5fd0ee
AD
11093 * src/bison.s1: Formatting and cosmetics changes.
11094 * src/reader.c: Likewise.
41aca2e0
AD
11095 Update the Copyright notice.
11096
dc08c1d5
AD
110972000-03-17 Akim Demaille <akim@epita.fr>
11098
aa5fd0ee
AD
11099 * src/bison.s1 (#line): All set to `#line' only, since the
11100 Makefile now handles them.
dc08c1d5 11101
9ee3c97b
AD
111022000-03-16 Akim Demaille <akim@epita.fr>
11103
11104 * src/output.c (output_rule_data): Output the documentation of
11105 some of the tables.
11106 (Copyright notice): Update.
11107 Formatting changes.
11108
0de741ca
AD
111092000-03-16 Akim Demaille <akim@epita.fr>
11110
11111 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
11112 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
11113 One `#if YYDEBUG' remains, since it uses variables which are
11114 defined only if `YYDEBUG != 0'.
11115
bb10be54
AD
111162000-03-16 Akim Demaille <akim@epita.fr>
11117
11118 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
11119 and related variables so that the similarities are highlighted.
11120
b07b484a
AD
111212000-03-16 Akim Demaille <akim@epita.fr>
11122
11123 * src/bison.s1: Properly indent CPP directives.
11124
361f60b3
AD
111252000-03-16 Akim Demaille <akim@epita.fr>
11126
11127 * src/bison.s1: Properly indent the `alloca' CPP section.
11128
8c44d3ec
AD
111292000-03-16 Akim Demaille <akim@epita.fr>
11130
11131 Do not hard code values of directories in `configure.in'.
11132 Update the `configure' tool chain.
11133
11134 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
11135 src/makefile.am.
11136 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
11137 (AC_OUTPUT): Add m4/Makefile.
11138 Bump to bison 1.28a, 1.29 has never been released.
11139 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
11140 handled via src/Makefile.am.
11141 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
11142 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
11143 autoheader.
11144 * Makefile.am (SUBDIRS): Add m4.
11145 (ACLOCAL_AM_FLAGS): New variable.
11146 (AUTOMAKE_OPTIONS): Add check-news.
11147 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
11148 the proper line number and file name.
11149 (DEFS): Propagate the location of bison library files and of the
11150 locale files.
11151 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
11152 builddir.
11153 * acinclude.m4: Remove, replaced by the directory m4.
11154 * m4/Makefile.am (EXTRA_DIST): New variable.
11155 * m4/gettext.m4: New file, from the fileutils.
11156 * m4/lcmessage.m4: Likewise
11157 * m4/progtest.m4: Likewise.
11158 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
11159
f95997e7
AD
111602000-03-10 Akim Demaille <akim@epita.fr>
11161
11162 * src/closure.c:
11163 Formatting changes of various comments.
11164 Respect the GNU coding standards at various places.
11165 Don't use `_()' when no translation is needed.
11166
111671999-12-13 Jesse Thilo <jthilo@gnu.org>
11168
11169 * src/files.c:
11170 OS/2 honors TMPDIR environment variable.
11171
111721999-12-13 Jesse Thilo <jthilo@gnu.org>
11173
11174 * doc/bison.texinfo: Tweaked spelling and grammar.
11175 Updated ISBN.
11176 Removed reference to price of printed copy.
11177 Mention BISON_SIMPLE and BISON_HAIRY.
11178
111791999-12-13 Jesse Thilo <jthilo@gnu.org>
11180
11181 * configure.in, NEWS:
11182 Bison 1.29 released.
11183
111841999-10-27 Jesse Thilo <jthilo@gnu.org>
11185
11186 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
11187 Added reference card.
11188
111891999-07-26 Jesse Thilo <jthilo@gnu.org>
11190
11191 * po/ru.po: Added Russian translation.
11192
111931999-07-26 Jesse Thilo <jthilo@gnu.org>
11194
11195 * configure.in: Added Russian translation.
11196
111971999-07-06 Jesse Thilo <jthilo@gnu.org>
11198
11199 * configure.in, NEWS, README:
11200 Released version 1.28.
11201
112021999-06-14 Jesse Thilo <jthilo@gnu.org>
11203
11204 * src/system.h:
11205 Squashed redefinition warning on some systems.
11206
11207 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
11208 Have configure build version string instead of relying on ANSI string
11209 concatentation.
11210
112111999-06-14 Jesse Thilo <jthilo@gnu.org>
11212
11213 * po/POTFILES.in: Got rid of version.c.
11214
112151999-06-14 Jesse Thilo <jthilo@gnu.org>
11216
11217 * acconfig.h, configure.in:
11218 Have configure build version string instead of relying on ANSI string
11219 concatentation.
11220
112211999-06-08 Jesse Thilo <jthilo@gnu.org>
11222
11223 * doc/bison.1:
11224 Dropped mention of `+' for long-named options.
11225
112261999-05-30 Jesse Thilo <jthilo@gnu.org>
11227
11228 * src/files.c: Added <unistd.h> for unlink().
11229
11230 * src/Makefile.am, src/system.h:
11231 I18n fixes.
11232
112331999-05-30 Jesse Thilo <jthilo@gnu.org>
11234
11235 * README: Added a FAQ list.
11236
11237 * configure.in, acconfig.h:
11238 I18n fixes.
11239
112401999-05-30 Jesse Thilo <jthilo@gnu.org>
11241
11242 * doc/FAQ, doc/Makefile.am:
11243 Added a FAQ list.
11244
112451999-05-19 Jesse Thilo <jthilo@gnu.org>
11246
11247 * src/alloc.h, src/symtab.h, src/version.c:
11248 Protected inclusion of "config.h" with HAVE_CONFIG_H.
11249
112501999-04-18 Jesse Thilo <jthilo@gnu.org>
11251
11252 * src/.cvsignore, src/Makefile.am:
11253 Reorganized: sources in `src', documentation in `doc'.
11254
11255 * src/lex.c (literalchar):
11256 fixed the code for escaping double quotes (thanks
11257 Jonathan Czisny.)
11258
112591999-04-18 Jesse Thilo <jthilo@gnu.org>
11260
11261 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
11262 Adjusted paths to reflect directory reorganization.
11263
112641999-04-18 Jesse Thilo <jthilo@gnu.org>
11265
11266 * doc/.cvsignore, doc/Makefile.am:
11267 Reorganized: sources in `src', documentation in `doc'.
11268
112691999-04-18 Jesse Thilo <jthilo@gnu.org>
11270
11271 * configure.in:
11272 Updated AC_INIT file to reflect directory reorganization.
11273
11274 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
11275 Reorganized: sources in `src', documentation in `doc'.
11276
112771999-04-13 Jesse Thilo <jthilo@gnu.org>
11278
11279 * src/allocate.c:
11280 Don't declare calloc() and realloc() if not necessary.
11281
112821999-04-13 Jesse Thilo <jthilo@gnu.org>
11283
11284 * configure.in, acconfig.h, acinclude.m4:
11285 Don't declare calloc() and realloc() if not necessary.
11286
112871999-03-23 Jesse Thilo <jthilo@gnu.org>
11288
11289 * po/.cvsignore: Added i18n support.
11290
112911999-03-23 Jesse Thilo <jthilo@gnu.org>
11292
11293 * acconfig.h, configure.in, Makefile.am:
11294 Added i18n support.
11295
112961999-03-22 Jesse Thilo <jthilo@gnu.org>
11297
11298 * src/bison.s1: Fixed #line numbers.
11299
113001999-03-15 Jesse Thilo <jthilo@gnu.org>
11301
11302 * po/es.po, po/fr.po, po/nl.po, po/de.po:
11303 Added PO files from Translation Project.
11304
113051999-03-03 Jesse Thilo <jthilo@gnu.org>
11306
11307 * Makefile.am:
11308 Added support for non-ANSI compilers (ansi2knr).
11309
113101999-02-16 Jesse Thilo <jthilo@gnu.org>
11311
11312 * configure.in: Bumped version number to 1.27.
11313
11314 * Makefile.am:
11315 Added `bison.simple' to list of files removed by `make distclean'.
11316
113171999-02-12 Jesse Thilo <jthilo@gnu.org>
11318
11319 * src/files.c, src/files.h:
11320 Defined locations of parser files in config.h instead of Makefile.
11321
113221999-02-12 Jesse Thilo <jthilo@gnu.org>
11323
11324 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
11325 Defined locations of parser files in config.h instead of Makefile.
11326
113271999-02-09 Jesse Thilo <jthilo@gnu.org>
11328
11329 * Makefile.am:
11330 Removed inappropriate use of $< macro.
11331
113321999-02-05 Jesse Thilo <jthilo@gnu.org>
11333
11334 * po/Makefile.in.in, po/POTFILES.in:
11335 Add `po' directory skeleton.
11336
113371999-01-27 Jesse Thilo <jthilo@gnu.org>
11338
11339 * README: Document help-bison list.
11340
11341 * configure.in: Add check for mkstemp().
11342
113431999-01-20 Jesse Thilo <jthilo@gnu.org>
11344
11345 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
11346 Hush a few compiler warnings.
11347
11348 * src/files.c:
11349 Add tryclose(), which verifies that fclose was successful.
11350 Hush a couple of compiler warnings.
11351
113521999-01-20 Jesse Thilo <jthilo@gnu.org>
11353
11354 * Makefile.am, OChangeLog:
11355 ChangeLog is now automatically generated. Include the old version as
11356 OChangeLog.
11357
113581999-01-14 Jesse Thilo <jthilo@gnu.org>
11359
11360 * 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:
11361 Update FSF address.
11362
113631999-01-14 Jesse Thilo <jthilo@gnu.org>
11364
11365 * doc/bison.texinfo: Fix formatting glitch.
11366
11367 * doc/bison.texinfo: Update FSF address.
11368
113691999-01-14 Jesse Thilo <jthilo@gnu.org>
11370
11371 * acconfig.h: Update FSF address.
11372
113731999-01-08 Jesse Thilo <jthilo@gnu.org>
11374
11375 * src/system.h:
11376 Don't define PACKAGE here, since config.h defines it.
11377
113781998-12-30 Jesse Thilo <jthilo@gnu.org>
11379
11380 * src/reader.c: Update copyright date.
11381
11382 * src/main.c:
11383 Ditch sprintf to statically-sized buffers in fatal/warn functions in
11384 favor of output directly to stderr (avoids buffer overruns).
11385
11386 * src/reader.c: Some checks for premature EOF.
11387
11388 * 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:
11389 Use prototypes if the compiler understands them.
11390
11391 * src/files.c: Honor TMPDIR on Unix hosts.
11392 Use prototypes if the compiler understands them.
11393
11394 * src/reader.c:
11395 Fix a couple of buffer overrun bugs.
11396 Use prototypes if the compiler understands them.
11397
11398 * src/system.h: Include unistd.h and ctype.h.
11399 Use #ifdef instead of #if for NLS symbols.
11400
114011998-12-30 Jesse Thilo <jthilo@gnu.org>
11402
11403 * doc/bison.texinfo:
11404 Delete comment "consider using @set for edition number, etc..." since
11405 we now are doing so.
11406
114071998-12-30 Jesse Thilo <jthilo@gnu.org>
11408
11409 * configure.in:
11410 Use prototypes if the compiler understands them.
11411
11412 * NEWS: Document 1.26 highlights.
11413
11414 * Makefile.am: Require Automake 1.3 or later.
11415
11416 * acconfig.h:
11417 Use prototypes if the compiler understands them.
11418
114191998-12-29 Jesse Thilo <jthilo@gnu.org>
11420
11421 * src/version.c:
11422 Use VERSION symbol from automake for version number.
11423
114241998-12-29 Jesse Thilo <jthilo@gnu.org>
11425
11426 * acconfig.h, configure.in, version.cin:
11427 Use VERSION symbol from automake for version number.
11428
114291998-11-28 Jesse Thilo <jthilo@gnu.org>
11430
11431 * Makefile.am:
11432 Distribute original version of simple parser (bison.s1), not built
11433 version (bison.simple).
11434
114351998-11-28 Jesse Thilo <jthilo@gnu.org>
11436
11437 * doc/bison.texinfo: Add info dir entry.
11438
11439 * doc/bison.texinfo:
11440 Let automake put version number into documentation.
11441
114421998-11-26 Jesse Thilo <jthilo@gnu.org>
11443
11444 * src/bison.cld, src/build.com, src/vmshlp.mar:
11445 Add non-RCS files from /gd/gnu/bison.
11446
114471998-11-26 Jesse Thilo <jthilo@gnu.org>
11448
11449 * doc/bison.1:
11450 Document the BISON_HAIRY and BISON_SIMPLE variables.
11451
114521998-11-25 Jesse Thilo <jthilo@gnu.org>
11453
11454 * src/version.c: Build version.c automatically.
11455
11456 * src/reader.c:
11457 Fix token numbering (used to start at 258, not 257).
11458
11459 * src/system.h: Include config.h.
11460
11461 * src/getargs.c: Update bug report address.
11462
11463 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
11464 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
11465
114661998-11-25 Jesse Thilo <jthilo@gnu.org>
11467
11468 * Makefile.am:
11469 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
11470
11471 * configure.in, version.cin:
11472 Build version.c automatically.
11473
11474 * AUTHORS: Add AUTHORS file.
11475
11476 * README: Update bug report address.
11477
11478 * bison.simple:
11479 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
11480
11481 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
11482 Add automake stuff.
11483
114841998-11-25 Jesse Thilo <jthilo@gnu.org>
11485
11486 * doc/bison.texinfo: Clean up some formatting.
11487
114881998-05-05 Richard Stallman <rms@gnu.org>
11489
11490 * doc/bison.texinfo:
11491 Explain better why to make a pure parser.
11492
114931998-01-05 Richard Stallman <rms@gnu.org>
11494
11495 * src/files.c (openfiles):
11496 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
11497 find a temporary directory, if possible. Do not unlink files while
11498 they are open.
11499
115001997-08-25 Richard Stallman <rms@gnu.org>
11501
11502 * src/reader.c (stack_offset;):
11503 Change some warni to warns.
11504
11505 * src/lex.c (literalchar): Use warns, not warni.
11506
115071997-06-28 Richard Stallman <rms@gnu.org>
11508
11509 * src/bison.s1: Add a Bison version comment.
11510
11511 * src/main.c (fatal, warn, berror):
11512 Use program_name.
11513
115141997-06-28 Richard Stallman <rms@gnu.org>
11515
11516 * Makefile.in (bison_version): New variable.
11517 (dist): Use that variable.
11518 (bison.s1): Substitute the Bison version into bison.simple.
11519
11520 * bison.simple: Add a Bison version comment.
11521
115221997-06-18 Richard Stallman <rms@gnu.org>
11523
11524 * src/main.c (fatal, warn, berror):
11525 Make error messages standard.
11526 (toomany): Improve error message text.
11527
11528 * 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:
11529 new.h renamed to alloc.h.
11530
115311997-06-18 Richard Stallman <rms@gnu.org>
11532
11533 * Makefile.in: new.h renamed to alloc.h.
11534
115351997-05-24 Richard Stallman <rms@gnu.org>
11536
11537 * src/lex.c (literalchar):
11538 Fix the code for escaping \, " and '.
11539
11540 (lex): Avoid trouble when there are many chars
11541 to discard in a char literal with just several chars in it.
11542
115431997-05-17 Richard Stallman <rms@gnu.org>
11544
11545 * src/bison.s1:
11546 Use malloc, if using alloca is troublesome.
11547 (YYSTACK_USE_ALLOCA): New flag macro.
11548 Define it for some systems and compilers.
11549 (YYSTACK_ALLOC): New macro.
11550 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11551 If it was malloc'd, free it.
11552
115531997-05-17 Richard Stallman <rms@gnu.org>
11554
11555 * bison.simple:
11556 Use malloc, if using alloca is troublesome.
11557 (YYSTACK_USE_ALLOCA): New flag macro.
11558 Define it for some systems and compilers.
11559 (YYSTACK_ALLOC): New macro.
11560 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11561 If it was malloc'd, free it.
11562
115631997-04-23 Richard Stallman <rms@gnu.org>
11564
11565 * src/bison.s1:
11566 (alloca) [__hpux]: Always define as __builtin_alloca.
11567
115681997-04-23 Richard Stallman <rms@gnu.org>
11569
11570 * bison.simple:
11571 (alloca) [__hpux]: Always define as __builtin_alloca.
11572
115731997-04-22 Richard Stallman <rms@gnu.org>
11574
11575 * src/bison.s1:
11576 [__hpux]: Include alloca.h (right for HPUX 10)
11577 instead of declaring alloca (right for HPUX 9).
11578
11579 * src/bison.s1 (__yy_memcpy):
11580 Declare arg `count' as unsigned int.
11581 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11582
115831997-04-22 Richard Stallman <rms@gnu.org>
11584
11585 * bison.simple:
11586 [__hpux]: Include alloca.h (right for HPUX 10)
11587 instead of declaring alloca (right for HPUX 9).
11588
11589 * bison.simple (__yy_memcpy):
11590 Declare arg `count' as unsigned int.
11591 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11592
115931997-01-03 Richard Stallman <rms@gnu.org>
11594
11595 * src/allocate.c: [__STDC__ or _MSC_VER]:
11596 Declare calloc and realloc to return void *.
11597
115981997-01-02 Richard Stallman <rms@gnu.org>
11599
11600 * src/system.h:
11601 [_MSC_VER]: Include stdlib.h and process.h.
11602 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
11603
11604 * src/main.c (main): Return FAILURE as a value.
11605 (printable_version): Declare arg as int, not char.
11606
116071997-01-02 Richard Stallman <rms@gnu.org>
11608
11609 * Makefile.in (dist):
11610 Explicitly check for symlinks, and copy them.
11611
116121996-12-19 Richard Stallman <rms@gnu.org>
11613
11614 * src/files.c:
11615 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
11616
116171996-12-18 Paul Eggert <eggert@gnu.org>
11618
11619 * src/bison.s1 (yyparse):
11620 If __GNUC__ and YYPARSE_PARAM are both defined,
11621 declare yyparse to have a void * argument.
11622
116231996-12-18 Paul Eggert <eggert@gnu.org>
11624
11625 * bison.simple (yyparse):
11626 If __GNUC__ and YYPARSE_PARAM are both defined,
11627 declare yyparse to have a void * argument.
11628
116291996-12-17 Richard Stallman <rms@gnu.org>
11630
11631 * src/reduce.c (nbits): Add some casts.
11632
116331996-08-12 Richard Stallman <rms@gnu.org>
11634
11635 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
11636
116371996-08-12 Richard Stallman <rms@gnu.org>
11638
11639 * bison.simple: Test _MSDOS as well as _MSDOS_.
11640
116411996-07-31 Richard Stallman <rms@gnu.org>
11642
11643 * src/bison.s1:
11644 [__sun && __i386]: Include alloca.h.
11645
116461996-07-31 Richard Stallman <rms@gnu.org>
11647
11648 * bison.simple:
11649 [__sun && __i386]: Include alloca.h.
11650
116511996-07-30 Richard Stallman <rms@gnu.org>
11652
11653 * src/bison.s1: Comment change.
11654
11655 * src/bison.s1: Test _MSDOS_, not MSDOS.
11656
116571996-07-30 Richard Stallman <rms@gnu.org>
11658
11659 * bison.simple: Comment change.
11660
11661 * bison.simple: Test _MSDOS_, not MSDOS.
11662
116631996-06-01 Richard Stallman <rms@gnu.org>
11664
11665 * 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:
11666 Insert `_' macro around many string constants.
11667
11668 * src/main.c:
11669 Insert `_' macro around many string constants.
11670
11671 (main): Call setlocale, bindtextdomain and textdomain.
11672
11673 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
11674 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
11675 [ENABLE_NLS]: Include libintl.h.
11676 [ENABLE_NLS] (gettext): Define.
11677 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
11678 (N_, PACKAGE, LOCALEDIR): New macros.
11679
116801996-06-01 Richard Stallman <rms@gnu.org>
11681
11682 * POTFILES.in: New file.
11683
11684 * Makefile.in (allocate.o):
11685 Define target explicitly.
11686
11687 * Makefile.in (CFLAGS): Set to @CFLAGS@.
11688 (LDFLAGS): Set to @LDFLAGS@.
11689 (configure): Run autoconf only if preceding `cd' succeeds.
11690 (bison.s1): Redirect output to temporary file then move the
11691 temporary to the target, rather than redirecting directly to bison.s1.
11692 (clean): Remove config.status and config.log.
11693 (distclean): Don't remove config.status here.
11694
116951996-05-12 Richard Stallman <rms@gnu.org>
11696
11697 * src/bison.s1:
11698 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11699
117001996-05-12 Richard Stallman <rms@gnu.org>
11701
11702 * bison.simple:
11703 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11704
117051996-05-11 Richard Stallman <rms@gnu.org>
11706
11707 * src/bison.s1 (__yy_memcpy):
11708 Really reorder the args, as was supposedly done on Feb 14 1995.
11709 (yyparse): Calls changed accordingly.
11710
117111996-05-11 Richard Stallman <rms@gnu.org>
11712
11713 * Makefile.in (dist): Don't use $(srcdir).
11714
11715 * bison.simple (__yy_memcpy):
11716 Really reorder the args, as was supposedly done on Feb 14 1995.
11717 (yyparse): Calls changed accordingly.
11718
117191996-01-27 Richard Stallman <rms@gnu.org>
11720
11721 * src/output.c (output_rule_data):
11722 Test YYERROR_VERBOSE in the conditional
11723 around the definition of ttyname.
11724
117251995-12-29 Richard Stallman <rms@gnu.org>
11726
11727 * src/bison.s1:
11728 Fix line numbers in #line commands.
11729
117301995-12-29 Richard Stallman <rms@gnu.org>
11731
11732 * bison.simple:
11733 Fix line numbers in #line commands.
11734
117351995-12-27 Richard Stallman <rms@gnu.org>
11736
11737 * src/bison.s1 (YYPARSE_PARAM_DECL):
11738 In C++, make it always null.
11739 (YYPARSE_PARAM_ARG): New macro.
11740 (yyparse): Use YYPARSE_PARAM_ARG.
11741
117421995-12-27 Richard Stallman <rms@gnu.org>
11743
11744 * bison.simple (YYPARSE_PARAM_DECL):
11745 In C++, make it always null.
11746 (YYPARSE_PARAM_ARG): New macro.
11747 (yyparse): Use YYPARSE_PARAM_ARG.
11748
117491995-11-29 Richard Stallman <rms@gnu.org>
11750
11751 * doc/bison.texinfo:
11752 Describe literal string tokens, %raw, %no_lines, %token_table.
11753
117541995-11-29 Daniel Hagerty <hag@gnu.org>
11755
11756 * doc/bison.texinfo: Fixed update date
11757
117581995-10-16 Richard Stallman <rms@gnu.org>
11759
11760 * src/version.c: Version 1.25.
11761
117621995-10-16 Richard Stallman <rms@gnu.org>
11763
11764 * NEWS: *** empty log message ***
11765
117661995-10-16 Richard Stallman <rms@gnu.org>
11767
11768 * doc/bison.1, doc/bison.rnh:
11769 Add new options.
11770
117711995-10-15 Richard Stallman <rms@gnu.org>
11772
11773 * src/vmsgetargs.c, src/getargs.c:
11774 Added -n, -k, and -raw switches.
11775 (noparserflag, toknumflag, rawtoknumflag): New variables.
11776
11777 * src/symtab.h (SALIAS):
11778 New #define for adding aliases to %token.
11779 (struct bucket): Added `alias' field.
11780
11781 * src/reduce.c (reduce_grammar):
11782 Revise error message.
11783 (print_notices): Remove final `.' from error message.
11784
11785 * src/reader.c (reader_output_yylsp):
11786 New function.
11787 (readgram): Use `#if 0' around code that accepted %command
11788 inside grammar rules: The documentation doesn't allow it,
11789 and it will fail since the %command processors scan for the next %.
11790 (parse_token_decl): Extended the %token
11791 declaration to allow a multi-character symbol as an alias.
11792 (parse_thong_decl): New function.
11793 (read_declarations): Added %thong declarations.
11794 (read_declarations): Handle NOOP to deal with allowing
11795 % declarations as another means to specify the flags.
11796 (readgram): Allow %prec prior to semantics embedded in a rule.
11797 (skip_to_char, read_declarations, copy_definition)
11798 (parse_token_decl, parse_start_decl, parse_type_decl)
11799 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
11800 (get_type_name, copy_guard, copy_action, readgram)
11801 (get_type, packsymbols): Revised most error messages.
11802 Changed `fatal' to `warnxxx' to avoid aborting for error.
11803 Revised and use multiple warnxxx functions to avoid using VARARGS1.
11804 (read_declarations): Improve the error message for
11805 an invalid character. Do not abort.
11806 (read_declarations, copy_guard, copy_action): Use
11807 printable_version to avoid unprintable characters in printed output.
11808 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
11809 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
11810 Allow the type of a non-terminal can be given
11811 more than once, as long as all specifications give the same type.
11812
11813 * src/output.c:
11814 (output_headers, output_trailers, output, output_gram)
11815 (output_rule_data): Implement noparserflag variable.
11816 Implement toknumflag variable.
11817 (output): Call reader_output_yylsp to output LTYPESTR.
11818
11819 * src/main.c (main):
11820 If reader sees an error, don't process the grammar.
11821 (fatals): Updated to not use VARARGS1.
11822 (printable_version, int_to_string, warn, warni, warns, warnss)
11823 (warnsss): New error reporting functions. Avoid abort for error.
11824
11825 * src/lex.h:
11826 Added THONG and NOOP for alias processing.
11827 Added SETOPT for the new code that allows setting options with %flags.
11828
11829 * src/lex.c:
11830 Include getopt.h. Add some extern decls.
11831 (safegetc): New function to deal with EOF gracefully.
11832 (literalchar); new function to deal with reading \ escapes.
11833 (lex): Use literalchar.
11834 (lex): Implemented "..." tokens.
11835 (literalchar, lex, parse_percent_token): Made tokenbuffer
11836 always contain the token. This includes growing the token
11837 buffer while reading an integer.
11838 (parse_percent_token): Replaced if-else statement with percent_table.
11839 (parse_percent_token): Added % declarations as another
11840 way to specify the flags -n, -l, and -r. Also added hooks for
11841 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
11842 major changes to files.c.
11843 (lex) Retain in the incoming stream a character following
11844 an incorrect '/'.
11845 (skip_white_space, lex): Revised most error messages
11846 and changed fatal to warn to avoid aborting.
11847 (percent_table): Added %thong declarations.
11848
11849 * src/gram.h: Comment changes.
11850
11851 * src/files.c (openfiles, open_extra_files, done):
11852 Add faction flag
11853 and actfile file. Handle noparserflag. Both for -n switch.
11854
11855 * src/conflicts.c (resolve_sr_conflict):
11856 Remove use of alloca.
11857
118581995-06-01 Jim Meyering <meyering@gnu.org>
11859
11860 * doc/bison.texinfo: *** empty log message ***
11861
118621995-05-06 Richard Stallman <rms@gnu.org>
11863
11864 * src/bison.s1: Comment change.
11865
118661995-05-06 Richard Stallman <rms@gnu.org>
11867
11868 * bison.simple: Comment change.
11869
118701995-05-03 Richard Stallman <rms@gnu.org>
11871
11872 * src/version.c: Version now 1.24.
11873
11874 * src/bison.s1: Change distribution terms.
11875
11876 * src/version.c: Version now 1.23.
11877
118781995-05-03 Richard Stallman <rms@gnu.org>
11879
11880 * doc/bison.texinfo:
11881 Rewrite "Conditions for Using Bison".
11882 Update version to 1.24.
11883
118841995-05-03 Richard Stallman <rms@gnu.org>
11885
11886 * bison.simple: Change distribution terms.
11887
118881995-02-23 Richard Stallman <rms@gnu.org>
11889
11890 * src/files.c: Test __VMS_POSIX as well as VMS.
11891
118921995-02-14 Jim Meyering <meyering@gnu.org>
11893
11894 * src/bison.s1 (__yy_memcpy):
11895 Renamed from __yy_bcopy to avoid
11896 confusion. Reverse FROM and TO arguments to be consistent with
11897 those of memcpy.
11898
118991995-02-14 Jim Meyering <meyering@gnu.org>
11900
11901 * bison.simple (__yy_memcpy):
11902 Renamed from __yy_bcopy to avoid
11903 confusion. Reverse FROM and TO arguments to be consistent with
11904 those of memcpy.
11905
119061994-11-10 David J. MacKenzie <djm@gnu.org>
11907
11908 * NEWS: reformat
11909
11910 * NEWS: New file.
11911
11912 * Makefile.in (DISTFILES): Include NEWS.
11913
11914 * Makefile.in (DISTFILES):
11915 Include install-sh, not install.sh.
11916
11917 * configure.in: Update to Autoconf v2 macro names.
11918
119191994-10-05 David J. MacKenzie <djm@gnu.org>
11920
11921 * Makefile.in: fix typo
11922
11923 * Makefile.in (prefix, exec_prefix):
11924 Let configure set them.
11925
119261994-09-28 David J. MacKenzie <djm@gnu.org>
11927
11928 * Makefile.in: Set datadir to $(prefix)/share.
11929
119301994-09-15 Richard Stallman <rms@gnu.org>
11931
11932 * src/bison.s1:
11933 Update copyright notice and GPL version.
11934
119351994-09-15 Richard Stallman <rms@gnu.org>
11936
11937 * bison.simple:
11938 Update copyright notice and GPL version.
11939
119401994-07-12 Richard Stallman <rms@gnu.org>
11941
11942 * src/reduce.c, src/reader.c:
11943 entered into RCS
11944
119451994-05-05 David J. MacKenzie <djm@gnu.org>
11946
11947 * Makefile.in: entered into RCS
11948
119491994-03-26 Richard Stallman <rms@gnu.org>
11950
11951 * src/bison.s1: entered into RCS
11952
119531994-03-26 Richard Stallman <rms@gnu.org>
11954
11955 * bison.simple: entered into RCS
11956
119571994-03-25 Richard Stallman <rms@gnu.org>
11958
11959 * src/main.c: entered into RCS
11960
119611994-03-24 Richard Stallman <rms@gnu.org>
11962
11963 * src/conflicts.c: entered into RCS
11964
119651994-01-02 Richard Stallman <rms@gnu.org>
11966
11967 * Makefile.in: *** empty log message ***
11968
119691993-11-21 Richard Stallman <rms@gnu.org>
11970
11971 * src/bison.s1: *** empty log message ***
11972
119731993-11-21 Richard Stallman <rms@gnu.org>
11974
11975 * doc/bison.texinfo: entered into RCS
11976
11977 * doc/bison.texinfo: *** empty log message ***
11978
119791993-11-21 Richard Stallman <rms@gnu.org>
11980
11981 * bison.simple: *** empty log message ***
11982
119831993-10-25 David J. MacKenzie <djm@gnu.org>
11984
11985 * doc/bison.texinfo: *** empty log message ***
11986
119871993-10-19 Richard Stallman <rms@gnu.org>
11988
11989 * src/bison.s1: *** empty log message ***
11990
119911993-10-19 Richard Stallman <rms@gnu.org>
11992
11993 * bison.simple: *** empty log message ***
11994
119951993-10-14 Richard Stallman <rms@gnu.org>
11996
11997 * src/bison.s1: *** empty log message ***
11998
119991993-10-14 Richard Stallman <rms@gnu.org>
12000
12001 * bison.simple: *** empty log message ***
12002
120031993-09-14 David J. MacKenzie <djm@gnu.org>
12004
12005 * doc/bison.texinfo: *** empty log message ***
12006
120071993-09-13 Noah Friedman <friedman@gnu.org>
12008
12009 * Makefile.in: *** empty log message ***
12010
120111993-09-10 Richard Stallman <rms@gnu.org>
12012
12013 * src/conflicts.c: *** empty log message ***
12014
12015 * src/system.h: entered into RCS
12016
120171993-09-10 Richard Stallman <rms@gnu.org>
12018
12019 * doc/bison.1: entered into RCS
12020
120211993-09-06 Noah Friedman <friedman@gnu.org>
12022
12023 * src/version.c: entered into RCS
12024
120251993-09-06 Noah Friedman <friedman@gnu.org>
12026
12027 * Makefile.in: *** empty log message ***
12028
120291993-07-30 David J. MacKenzie <djm@gnu.org>
12030
12031 * Makefile.in: *** empty log message ***
12032
120331993-07-24 Richard Stallman <rms@gnu.org>
12034
12035 * src/bison.s1: *** empty log message ***
12036
120371993-07-24 Richard Stallman <rms@gnu.org>
12038
12039 * bison.simple: *** empty log message ***
12040
120411993-07-08 David J. MacKenzie <djm@gnu.org>
12042
12043 * Makefile.in: *** empty log message ***
12044
120451993-07-04 Richard Stallman <rms@gnu.org>
12046
12047 * src/bison.s1: *** empty log message ***
12048
120491993-07-04 Richard Stallman <rms@gnu.org>
12050
12051 * bison.simple: *** empty log message ***
12052
120531993-06-26 David J. MacKenzie <djm@gnu.org>
12054
12055 * src/getargs.c: entered into RCS
12056
120571993-06-26 David J. MacKenzie <djm@gnu.org>
12058
12059 * doc/bison.texinfo: *** empty log message ***
12060
12061 * doc/bison.1: New file.
12062
120631993-06-25 Richard Stallman <rms@gnu.org>
12064
12065 * src/getargs.c: New file.
12066
120671993-06-16 Richard Stallman <rms@gnu.org>
12068
12069 * src/bison.s1: *** empty log message ***
12070
120711993-06-16 Richard Stallman <rms@gnu.org>
12072
12073 * bison.simple: *** empty log message ***
12074
120751993-06-03 Richard Stallman <rms@gnu.org>
12076
12077 * src/bison.s1: New file.
12078
120791993-06-03 Richard Stallman <rms@gnu.org>
12080
12081 * doc/bison.texinfo: *** empty log message ***
12082
120831993-06-03 Richard Stallman <rms@gnu.org>
12084
12085 * bison.simple: New file.
12086
120871993-05-19 Richard Stallman <rms@gnu.org>
12088
12089 * doc/bison.texinfo: New file.
12090
120911993-05-07 Noah Friedman <friedman@gnu.org>
12092
12093 * Makefile.in: *** empty log message ***
12094
120951993-04-28 Noah Friedman <friedman@gnu.org>
12096
12097 * src/reader.c: *** empty log message ***
12098
120991993-04-23 Noah Friedman <friedman@gnu.org>
12100
12101 * src/alloc.h: entered into RCS
12102
121031993-04-20 David J. MacKenzie <djm@gnu.org>
12104
12105 * src/version.c: *** empty log message ***
12106
12107 * src/files.c, src/allocate.c:
12108 entered into RCS
12109
12110 * src/reader.c: *** empty log message ***
12111
12112 * src/lex.c: entered into RCS
12113
12114 * src/conflicts.c: New file.
12115
12116 * src/symtab.c: entered into RCS
12117
12118 * src/alloc.h: New file.
12119
12120 * src/LR0.c: entered into RCS
12121
121221993-04-18 Noah Friedman <friedman@gnu.org>
12123
12124 * src/reader.c: New file.
12125
12126 * src/version.c: *** empty log message ***
12127
121281993-04-18 Noah Friedman <friedman@gnu.org>
12129
12130 * Makefile.in: *** empty log message ***
12131
121321993-04-17 Noah Friedman <friedman@gnu.org>
12133
12134 * Makefile.in: *** empty log message ***
12135
121361993-04-15 Richard Stallman <rms@gnu.org>
12137
12138 * src/main.c, src/files.c:
12139 New file.
12140
121411993-04-15 Noah Friedman <friedman@gnu.org>
12142
12143 * configure.in: entered into RCS
12144
12145 * configure.in: *** empty log message ***
12146
12147 * configure.in: New file.
12148
121491993-04-14 Richard Stallman <rms@gnu.org>
12150
12151 * Makefile.in: New file.
12152
121531993-04-13 Richard Stallman <rms@gnu.org>
12154
12155 * src/version.c: New file.
12156
121571993-03-25 Richard Stallman <rms@gnu.org>
12158
12159 * src/output.c: entered into RCS
12160
121611992-09-25 Richard Stallman <rms@gnu.org>
12162
12163 * configure.bat: entered into RCS
12164
121651992-06-22 Richard Stallman <rms@gnu.org>
12166
12167 * src/vmsgetargs.c: entered into RCS
12168
121691992-06-22 Richard Stallman <rms@gnu.org>
12170
12171 * doc/bison.rnh: entered into RCS
12172
121731992-04-20 David J. MacKenzie <djm@gnu.org>
12174
12175 * README: entered into RCS
12176
121771992-01-22 Richard Stallman <rms@gnu.org>
12178
12179 * src/machine.h: entered into RCS
12180
121811991-12-21 Richard Stallman <rms@gnu.org>
12182
12183 * src/lalr.c, src/closure.c:
12184 entered into RCS
12185
121861991-12-20 Richard Stallman <rms@gnu.org>
12187
12188 * src/state.h: entered into RCS
12189
121901991-12-18 Richard Stallman <rms@gnu.org>
12191
12192 * src/print.c, src/nullable.c, src/derives.c:
12193 entered into RCS
12194
121951991-11-03 David J. MacKenzie <djm@gnu.org>
12196
12197 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
12198 entered into RCS
12199
122001988-09-09 Richard Stallman <rms@gnu.org>
12201
12202 * src/bison.hairy: entered into RCS
12203
122041987-12-16 Richard Stallman <rms@gnu.org>
12205
12206 * REFERENCES: entered into RCS
dc546b0f 12207
f294a2c2
AD
12208-----
12209
33167b8b 12210Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
dd0e0635 122111998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
f294a2c2 12212
33167b8b 12213This file is part of Bison, the GNU Compiler Compiler.
f294a2c2 12214
33167b8b 12215Bison is free software; you can redistribute it and/or modify
f294a2c2
AD
12216it under the terms of the GNU General Public License as published by
12217the Free Software Foundation; either version 2, or (at your option)
12218any later version.
12219
33167b8b 12220Bison is distributed in the hope that it will be useful,
f294a2c2
AD
12221but WITHOUT ANY WARRANTY; without even the implied warranty of
12222MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12223GNU General Public License for more details.
12224
12225You should have received a copy of the GNU General Public License
33167b8b 12226along with Bison; see the file COPYING. If not, write to
f294a2c2
AD
12227the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
12228Boston, MA 02111-1307, USA.