]> git.saurik.com Git - bison.git/blob - ChangeLog
87f9f88177e019e014be3cce150bf087617ee0a2
[bison.git] / ChangeLog
1 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
2
3 Ensure that the C++ compiler used for testing actually works on a
4 simple test program; if not, skip the C++-related tests. Problem
5 reported by Vin Shelton in:
6 http://mail.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
7
8 * m4/cxx.m4: New file.
9 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11 * tests/local.at (AT_COMPILE_CXX): Use it.
12
13 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
14
15 * data/glr.c (yylloc): Output this macro even if locations are not
16 being generated, as the GLR parser needs it even in that case.
17 Problem reported by Troy A. Johnson
18 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
19
20 * configure.ac (AC_INIT): Update to 1.875e.
21
22 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
23
24 * NEWS: Version 1.875d.
25 * configure.ac (AC_INIT): Likewise.
26 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
27
28 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
29 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
30 lalr1.cc runs afoul of the first, and the last two are no longer
31 supported by GCC 3.4.0.
32 * README: Mention GNU m4 1.4 or later; mention m4 patches.
33 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
34
35 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
36
37 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
38 unsigned int, for compatibility with latest gnulib hash module.
39 * src/state.c (state_hash, state_hasher): Likewise.
40 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
41 * src/uniqstr.c (hash_uniqstr): Likewise.
42
43 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
44
45 * NEWS: Unescaped newlines are no longer allowed in char & strings.
46
47 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
48 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
49 character and string literals.
50 (unexpected_end): New function.
51 (unexpected_eof): Use it.
52 (unexpected_newline): New function.
53 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
54 actions.
55
56 * NEWS: Document %expect-rr.
57
58 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
59 Fix typo by replacing $1 with $option.
60 Remove more 'intl'-related files.
61 Don't DEFUN AM_INTL_SUBDIR twice.
62
63 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
64 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
65 strtoul.c.
66 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
67 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
68 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
69 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
70 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
71 * src/.cvsignore: Add *.output.
72
73 * src/parse-gram.y: Put copyright notice inside %{ %} so it
74 gets copied to the output file.
75
76 2004-04-28 Paul Eggert <eggert@twinsun.com>
77
78 Get files from the gnulib and po repositories, instead of relying
79 on them being in our CVS. Upgrade to latest versions of gnulib
80 and Automake.
81
82 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
83 * bootstrap: Bootstrap from gnulib and po repositories.
84 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
85 * README-cvs: Document these changes. Remove version numbers from
86 mentions of build tools, since they change so often. Mention Flex.
87
88 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
89 (gl_USE_SYSTEM_EXTENSIONS): Add.
90 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
91 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
92 does this for us.
93 (AC_ISC_POSIX): Remove; we no longer support this
94 ancient OS, as it gets in the way of latest Autoconf & gnulib.
95 (AC_HEADER_STDC): Remove: we now assume C89 or better.
96 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
97 Do not check for C89 headers, except for locale.h which is used
98 by the Yacc library and must port to K&R hosts.
99 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
100 Do not check for C89 functions, except for setlocale which is
101 used by the Yacc library.
102 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
103 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
104 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
105 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
106 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
107 AM_GNU_GETTEXT): Remove; now done by:
108 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
109 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
110 for us.
111
112 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
113 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
114 Define to empty, as gnulib.mk will do the rest for us.
115 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
116 for us.
117 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
118 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
119
120 * src/files.c: Include gnulib's xstrndup.h.
121
122 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
123 (REALLOC): Use xnrealloc, for likewise.
124 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
125 (strnlen, memrchr): Remove decls; functions no longer used.
126 Include <stpcpy.h>.
127
128 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
129 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
130 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
131 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
132 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
133 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
134 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
135 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
136 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
137 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
138 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
139 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
140 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
141 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
142 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
143 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
144 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
145 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
146 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
147 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
148 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
149 Remove, as these files are now generated automatically
150 by bootstrap or automake.
151
152 * po/ChangeLog: Remove: all but one entry was a duplicate
153 of this file, and I moved that 2000-11-02 entry here.
154
155 * config/.cvsignore: Add Makefile, depcomp, install-sh.
156 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
157 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
158 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
159 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
160 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
161 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
162 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
163 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
164 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
165 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
166 xstrndup.h.
167 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
168 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
169 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
170 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
171 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
172 * src/.cvsignore: Remove *_.c.
173
174
175 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
176 support it. (The latest stable gzip doesn't.)
177
178 2004-04-27 Paul Eggert <eggert@twinsun.com>
179
180 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
181 case, as stos_ is now used by destructors due to the 2004-02-09
182 change.
183
184 Remove more K&R C support.
185 * lib/libiberty.y (PARAMS): Remove. All uses removed.
186 * lib/subpipe.c (errno): Remove decl.
187 Include <stdlib.h> unconditionally.
188 (EXIT_FAILURE): Remove macro.
189 * src/complain.c (vfprintf, strerror): Remove.
190 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
191 unconditionally.
192 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
193 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
194 (strchr, strspn, memchr): Remove decls.
195 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
196 unconditionally. Do not declare perror.
197 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
198 unconditionally.
199
200 * src/complain.c (_): Remove useless defn, as system.h defines this.
201
202 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
203 with latest obstack.h.
204 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
205 to procedure types, as obstack.h now does that for us.
206 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
207
208 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
209 so that this include file can stand alone.
210 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
211 does this now. Include subpipe.h first after config.h, to
212 test whether it can stand alone.
213
214 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
215 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
216 unused declaration.
217
218 * tests/synclines.at (%union synch line): Put a dummy member in
219 the union, because empty unions aren't allowed in C. Caught
220 by GCC 3.4.0.
221
222 2004-04-13 Jim Meyering <jim@meyering.net>
223
224 * src/conflicts.c (conflicts_print): Correct format string typo:
225 use `%%' to produce literal `%'. (trivial change)
226
227 2004-03-30 Paul Eggert <eggert@twinsun.com>
228
229 * src/getargs.c (version): Update copyright year to 2004.
230
231 * data/c.m4 (b4_int_type): Use 'short int' rather than
232 'short', and similarly for 'long', 'unsigned', etc.
233 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
234 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
235 yy_yypstack, yydumpstack): Likewise.
236 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
237 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
238 Likewise.
239 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
240 yy_stack_print, yyparse): Likewise.
241 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
242 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
243 * lib/bitset.c (bitset_print): Likewise.
244 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
245 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
246 * lib/bitsetv.c (bitsetv_dump): Likewise.
247 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
248 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
249 Likewise.
250 * src/LR0.c (allocate_itemsets): Likewise.
251 * src/gram.h (rule_number, rule): Likewise.
252 * src/lalr.h (goto_number): Likewise.
253 * src/nullable.c (nullable_compute): Likewise.
254 * src/output.c (prepare_rules): Likewise.
255 * src/relation.c (relation_print, relation_digraph): Likewise.
256 * src/relation.h (relation_node): Likewise.
257 * src/state.h (state_number, transitions, errs, reductions,
258 struct state): Likewise.
259 * src/symtab.h (symbol_number, struct symbol): Likewise.
260 * src/tables.c (vector_number, tally, action_number,
261 default_goto, goto_actions): Likewise.
262 * tests/existing.at (GNU Cim Grammar): Likewise.
263 * tests/regression.at (Web2c Actions): Likewise.
264
265 * src/output.c (muscle_insert_short_int_table): Renamed from
266 muscle_insert_short_table. All uses changed.
267
268 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
269
270 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
271 (declaration): Replace expected_conflicts with expected_sr_conflicts.
272 Add %expect-rr rule.
273
274 * src/scan-gram.l: Recognize %expect-rr.
275
276 * src/conflicts.h (expected_sr_conflicts): Rename from
277 expected_conflicts.
278 (expected_rr_conflicts): Declare.
279
280 * src/conflicts.c (expected_sr_conflicts): Rename from
281 expected_conflicts.
282 (expected_rr_conflicts): Define.
283 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
284 for GLR parsers.
285 Use expected_sr_conflicts in place of expected_conflicts.
286 Warn if expected_rr_conflicts used in non-GLR parser.
287
288 * doc/bison.texinfo: Add documentation for %expect-rr.
289
290 2004-03-08 Paul Eggert <eggert@gnu.org>
291
292 Add support for hex token numbers. Suggested by Odd Arild Olsen in
293 <http://mail.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
294
295 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
296 in lalr1.cc.
297 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
298 * src/scan-gram.l (scan_integer): New function.
299 ({int}): Use it.
300 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
301 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
302 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
303 Say "long int", not "long", for uniformity with GNU style.
304
305 2004-02-25 Paul Eggert <eggert@twinsun.com>
306
307 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
308 compilers. This fixes a problem with Intel's C++ compiler being
309 chatty, reported by Guido Trentalancia in
310 <http://mail.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
311
312 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
313
314 Support %destructor and merge error locations in lalr1.cc.
315
316 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
317 (Parser::stos_): Define unconditionally.
318 (Parser::destruct_): New method. Generate its body with
319 b4_yydestruct_generate.
320 (Parser::error_start_): New attribute.
321 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
322 token which are discarded.
323 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
324 error_start_ when erroneous token are discarded.
325 (Parser::parse) <yyerrlab1>: Compute the location of the error
326 token so that it covers all the discarded tokens.
327 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
328 it can be called with `%skeleton "lalr1.cc"', and do that.
329
330 2004-02-02 Paul Eggert <eggert@twinsun.com>
331
332 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
333 $(top_srcdir)/lib and ../lib. This fixes a bug reported
334 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
335 There's no need to mention top_builddir since Automake does that
336 for us.
337 (INCLUDES): Remove, as Automake says it's obsolescent.
338 Contents migrated into AM_CPPFLAGS as described above.
339 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
340
341 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
342
343 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
344 (yyreportSyntaxError): Handle case where lookahead token is
345 YYEMPTY.
346
347 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
348
349 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
350 resulting parsers are compilable with C++.
351
352 2003-12-23 Paul Eggert <eggert@twinsun.com>
353
354 * config/depcomp, config/install-sh: Sync with Automake 1.8.
355 * src/output.c (output_skeleton): Rename local var.
356 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
357 Bison tokens, as this runs afoul of the 2003-10-07 change that
358 disallowed NUL bytes in character constants or string literals.
359
360 * tests/local.at: Require Autoconf 2.59's Autotest.
361 * tests/testsuite.at: Don't include local.at, since we now assume
362 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
363 including it.
364 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
365 multiple inclusion warnings.
366
367 2003-12-02 Akim Demaille <akim@epita.fr>
368
369 * doc/bison.texinfo (How Can I Reset the Parser): More about start
370 conditions.
371 From Bruno Haible.
372
373 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
374
375 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
376
377 2003-10-07 Paul Eggert <eggert@twinsun.com>
378
379 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
380 if testsuite doesn't exist.
381
382 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
383 literals, unfortunately.
384 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
385 Complain about NUL bytes in character constants or string literals.
386
387 2003-10-05 Paul Eggert <eggert@twinsun.com>
388
389 * NEWS: Don't document %no-default-prec, as it's still
390 too experimental.
391 * doc/bison.texinfo: Document %no-default-prec only if
392 the defaultprec flag is set. Normally it's not.
393
394 2003-10-04 Paul Eggert <eggert@twinsun.com>
395
396 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
397 non-modifiable lvalue, instead of a modifiable one.
398 * doc/bison.texinfo (Actions): Document that $$ can
399 be assigned to. Do not claim that $$ and $N are
400 array element references: user code should not rely on this.
401
402 2003-10-01 Paul Eggert <eggert@twinsun.com>
403
404 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
405 (grammar_declaration): Use it.
406 * src/scan-gram.l: New token %no-default-prec.
407 * tests/conflicts.at: Revamp tests to use %no-default-prec.
408 * NEWS, doc/bison.texinfo: Document the above.
409
410 2003-10-01 Akim Demaille <akim@epita.fr>
411
412 VCG no longer supports long_straight_phase.
413
414 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
415 * src/print_graph.c (print_graph): Adjust.
416
417 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
418 and Paul Eggert <eggert@twinsun.com>
419
420 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
421 Table of Symbols): Document %default-prec.
422 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
423 (grammar_declaration): Set default_prec on %default-prec.
424 * src/scan-gram.l (%default-prec): New token.
425 * src/reader.h (default_prec): New flag.
426 * src/reader.c: Likewise.
427 (packgram): Handle it.
428 * tests/conflicts.at (%default-prec without %prec,
429 %default-prec with %prec, %default-prec 1): New tests.
430
431 2003-09-30 Paul Eggert <eggert@twinsun.com>
432
433 * tests/testsuite.at: Include local.at, not input.at, fixing
434 a typo in the 2003-08-25 patch.
435
436 2003-08-27 Akim Demaille <akim@epita.fr>
437
438 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
439 GCC warnings.
440
441 2003-08-26 Akim Demaille <akim@epita.fr>
442
443 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
444 "<\#" to avoid magic from Gnus when posting parts of this script.
445
446 2003-08-26 Akim Demaille <akim@epita.fr>
447
448 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
449 (Parser::parse): here.
450 Adjust: nerrs and errstatus is now replaced by...
451 (Parser::nerrs_, Parser::errstatus_): New.
452
453 2003-08-25 Akim Demaille <akim@epita.fr>
454
455 * config/announce-gen, Makefile.cfg: New.
456 * Makefile.am: Adjust.
457 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
458 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
459
460 2003-08-25 Akim Demaille <akim@epita.fr>
461
462 When reducing initial empty rules, Bison parser read an initial
463 location that is not defined. This results in garbage, and that
464 affects Bison's own parser. Therefore we need (i) to extend Bison
465 to support a means to initialize this location, and (ii) to use
466 this CVS Bison to fix CVS Bison's parser.
467
468 * src/reader.h, reader.c (epilogue_augment): Remove, replace
469 with...
470 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
471 * src/parse-gram.y: Adjust.
472 (%initial-action): New.
473 (%error-verbose): Since we require CVS Bison, there is no reason
474 not to use it.
475 * src/scan-gram.l: Adjust.
476 * src/Makefile.am (YACC): New, to make sure we use our own parser.
477 * data/yacc.c (yyparse): Use b4_initial_action.
478
479 2003-08-25 Akim Demaille <akim@epita.fr>
480
481 * doc/bison.texinfo: Don't promote stdout for error messages.
482
483 2003-08-25 Akim Demaille <akim@epita.fr>
484
485 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
486 From Alexandre Duret-Lutz.
487
488 2003-08-25 Akim Demaille <akim@epita.fr>
489
490 Version 1.875c.
491
492 2003-08-25 Akim Demaille <akim@epita.fr>
493
494 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
495 Use them.
496
497 2003-08-25 Akim Demaille <akim@epita.fr>
498
499 * data/lalr1.cc (Parser::reduce_print_): New.
500 Use it.
501
502 2003-08-25 Akim Demaille <akim@epita.fr>
503
504 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
505 error recovery loops. This patch is based on
506 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
507 Also, augment the similarity between lalr1.cc and yacc.c.
508 Note: the locations of error recovery rules are not correct yet.
509
510 * data/lalr1.cc: Comment changes to augment the similarity between
511 lalr1.cc and yacc.c.
512 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
513 (yyerrlab1): Remove, but where it used to be (now the bottom part of
514 yyerrlab), when hitting EOF, pop the whole stack here instead of
515 merely falling thru the default error handling mechanism.
516 (yyerrorlab): New label, with the old contents of YYERROR,
517 plus the following change: pop the stack of rhs corresponding
518 to the production that invoked YYERROR. That is how Yacc
519 behaves (required by POSIX).
520 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
521 fail.
522
523 2003-08-25 Akim Demaille <akim@epita.fr>
524
525 Tune local.at so that people can "autom4te -l autotest calc.at -o
526 calc" for instance, to extract a sub test suite.
527
528 * tests/testsuite.at: Move the initialization, Autotest version
529 requirement, and AT_TESTED invocation into...
530 * tests/local.at: here.
531 * tests/testsuite.at: Include it for compatibility with Autoconf
532 2.57.
533 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
534 be ignore.
535
536 2003-08-04 Paul Eggert <eggert@twinsun.com>
537
538 Rework code slightly to avoid gcc -Wtraditional warnings.
539 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
540 The returned value is now stored in *YY0. All callers changed.
541 * src/output.c (merge_output): Adjust to the above change.
542
543 2003-07-26 Paul Eggert <eggert@twinsun.com>
544
545 * data/glr.c (YYASSERT): New macro.
546 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
547 yyresolveStates, yyprocessOneStack):
548 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
549 Derived from a suggestion by Frank Heckenbach.
550
551 2003-07-25 Paul Eggert <eggert@twinsun.com>
552
553 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
554 for portability to K&R C (after ansi2knr, presumably). See
555 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
556 by Frank Heckenbach, though I have omitted the structure-initialization
557 part of his glr-knr.diff patch since I recall that the Portable
558 C Compiler didn't require that change.
559
560 Let the user specify how to allocate and free memory.
561 Derived from a suggestion by Frank Heckenbach in
562 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
563 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
564 All uses of free, malloc, realloc changed to use these macros,
565 and unnecessary casts removed.
566 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
567
568 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
569
570 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
571 use s.empty() rather than s == "" to test for empty string; see
572 <http://mail.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
573 (trivial change)
574
575 2003-06-25 Akim Demaille <akim@epita.fr>
576
577 * config/depcomp, config/install-sh: Update from masters.
578
579 2003-06-20 Paul Eggert <eggert@twinsun.com>
580
581 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
582 and return properly parenthesized result.
583 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
584 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
585 Remove unnecessary parentheses from uses.
586 * doc/bison.texinfo (Location Default Action): Describe the
587 conventions for parentheses.
588
589 2003-06-19 Paul Eggert <eggert@twinsun.com>
590
591 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
592 yyreportTree): Do not assume that size_t is the same width as int,
593 when printing sizes. Print sizes using an unsigned format.
594 Problem reported by Frank Heckenbach in
595 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
596
597 Port to Forte Developer 7 C compiler.
598 * data/glr.c (struct YYLTYPE): If locations are not being used,
599 declare a single dummy member, as empty structs do not conform
600 to the C standard.
601 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
602 the Forte Developer 7 C compiler complains that end-of-loop
603 code is not reached.
604
605 2003-06-17 Paul Eggert <eggert@twinsun.com>
606
607 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
608 avoid warnings from picky compilers about redefinition of PARAMS.
609
610 2003-06-17 Paul Eggert <eggert@twinsun.com>
611
612 Version 1.875b.
613
614 * NEWS: Document 1.875b.
615
616 * lib/bbitset.h: Do not include config.h; that's the includer's job.
617 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
618 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
619 Don't use 'index' in comments, as it's a builtin fn on some hosts.
620 * lib/bitset_stats.c: Include gettext.h unconditionally, as
621 per recent gettext manual's suggestion.
622 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
623 Use prototypes, not old-style definitions.
624 * lib/lbitset.c (lbitset_unused_clear): Likewise.
625 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
626 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
627 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
628 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
629 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
630 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
631 vbitset_or_and_cmp, vbitset_copy): Likewise.
632
633 * lib/libiberty.h: Do not include config.h; that's the includer's job.
634 Do not include <stdlib.h>.
635 (PARAMS): Define unconditionally for C89.
636 (ATTRIBUTE_NORETURN): Remove.
637 (ATTRIBUTE_UNUSED): Define unconditionally.
638
639 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
640 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
641 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
642 * lib/vbitset.c, lib/vbitset.h: New files.
643 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
644 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
645 from libbitset.
646
647 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
648 `How Can I Reset @code{yyparse}', since texinfo does not allow
649 arbitrary @ in node names.
650
651 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
652 shouldn't be needed according to the gettext 0.12.1 documentation
653 but which seem to be needed anyway: codeset.m4 glibc21.m4
654 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
655 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
656 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
657
658 * lib/.cvsignore: Add stdbool.h.
659 * m4/.cvsignore: Add nls.m4, po.m4.
660
661 Upgrade to CVS gnulib.
662 * stdbool_.h: File renamed from stdbool.h.in.
663 * configure.ac (AM_STDBOOL_H): Invoke this instead of
664 AC_HEADER_STDBOOL.
665 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
666 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
667 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
668 (MOSTLYCLEANFILES): New var.
669 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
670 (stdbool.h): New rule.
671 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
672 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
673 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
674 m4/quote.m4: Upgrade to today's gnulib.
675
676 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
677 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
678 the tests right now.
679 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
680 yyerror are declared before use; C99 requires this.
681
682 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
683
684 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
685 first.
686 (yyrecoverSyntaxError): Correct the logic for setting and testing
687 yyerrState.
688 Correct comment on handling EOF.
689 Allow states with only a default reduction, rather than failing
690 (I can't quite reconstruct why these were not allowed before).
691
692 Fixes to avoid problem that $-N rules in GLR parsers can cause
693 buffer overruns, corrupting state.
694
695 * src/output.c (prepare_rules): Output max_left_semantic_context
696 definition.
697 * src/reader.h (max_left_semantic_context): New variable declaration.
698 * src/scan-gram.l (max_left_semantic_context): Define.
699 (handle_action_dollar): Update max_left_semantic_context.
700 * data/glr.c (YYMAXLEFT): New definition.
701 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
702 (yyresolveAction): Ditto.
703
704 Fixes to problems with location handling in GLR parsers reported by
705 Frank Heckenbach (2003/06/05).
706
707 * data/glr.c (YYLTYPE): Make trivial if locations not used.
708 (YYRHSLOC): Add parentheses, and define only if locations used.
709 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
710 locations not used.
711 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
712 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
713
714 * tests/cxx-type.at: Exercise location information; update tests
715 to differentiate output with and without locations.
716 Remove forward declarations of yylex and yyerror---caused errors
717 because default YYLTYPE not yet defined.
718 Change semantic actions to compute strings, rather than printing
719 them directly (to test proper passing of semantics values). Change
720 output to prefix notation and update test data and expected results.
721 (yylex): Track locations.
722 (stmtMerge): Return value rather than printing, and include arguments
723 in value.
724
725 2003-06-03 Paul Eggert <eggert@twinsun.com>
726
727 Avoid warnings generated by GCC 2.95.4 when Bison is
728 configured with --enable-gcc-warnings.
729 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
730 yy::]b4_parser_class_name[::translate_,
731 yy::Stack::operator[] (unsigned),
732 yy::Stack::operator[] (unsigned) const,
733 yy::Slice::operator[] (unsigned),
734 yy::Slice::operator[] (unsigned) const):
735 Rename local vars to avoid warnings.
736 * tests/glr-regression.at (Improper handling of embedded actions
737 and $-N in GLR parsers): Remove unused local variable from yylex.
738 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
739 (void) as arg when not pure, since we now assume C89 when building
740 Bison. Pacify GCC by using parameter.
741
742 2003-06-02 Paul Eggert <eggert@twinsun.com>
743
744 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
745 yy::Location::lines, yy::Location::columns): Rename arguments
746 to avoid shadowing; this removes a warning generated by GCC 3.3.
747
748 2003-06-01 Paul Eggert <eggert@twinsun.com>
749
750 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
751 to g++, as GCC 3.3 complains if you do it.
752 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
753 everything that WARNING_CFLAGS has, except omit warnings
754 not suitable for C++.
755 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
756 * tests/atlocal.in (CXXFLAGS): New var.
757 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
758
759 Fix a GLR parser bug I reported in February; see
760 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
761 The problem was that GLR parsers did not conform to the C standard,
762 because actions like { $1 = $2 + $3; } expanded to expressions
763 that invoked YYFILL in separate subexpressions, and YYFILL assigned
764 to a local variable. The C standard says that expressions
765 like (var = f ()) + (var = f ()) have undefined behavior.
766 Another problem was that GCC sometimes issues warnings that
767 yyfill and its parameters are unused.
768
769 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
770 as possibly unused.
771 (yyfill): New function.
772 (YYFILL): Use it.
773 (yyuserAction): Change type of yynormal to bool, so that it matches
774 the new yyfill signature. Mark it as possibly unused.
775
776
777 Follow up on a bug I reported in February, where a Bison-generated
778 parser can loop. Provide a test case and a fix for yacc.c. I
779 don't have a fix for lalr1.cc or for glr.c, unfortunately.
780 The original bug report is in:
781 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
782
783 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
784 macro's size was becoming unwieldy.
785 (yyerrlab): Do not discard an empty lookahead symbol, as this
786 might destroy garbage.
787 (yyerrorlab): New label, with the old contents of YYERROR,
788 plus the following change: pop the stack of rhs corresponding
789 to the production that invoked YYERROR. That is how Yacc
790 behaves, and POSIX requires this behavior.
791 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
792 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
793 Define 'alarm' to do nothing if unistd.h is not available.
794 Add a new rule "exp: '-' error;" to test the above change to
795 data/yacc.c. Use 'alarm' to abort any test taking longer than
796 10 seconds, as it's probably looping.
797 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
798 Also, the new yacc.c generates two fewer diagnostics for an
799 existing test.
800
801 2003-05-24 Paul Eggert <eggert@twinsun.com>
802
803 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
804 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
805 This fixes a problem reported by John Bowman when the Compaq/HP
806 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
807 -ansi -Wall -gall).
808 * data/yacc.c (union yyalloc): Likewise.
809 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
810
811 Switch from 'int' to 'bool' where that makes sense.
812
813 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
814 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
815 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
816 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
817 Return or accept bool, not int. All callers changed.
818 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
819 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
820 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
821 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
822 bitset_or_and_cmp_): Likewise.
823 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
824 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
825 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
826 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
827 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
828 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
829 bitset_stats_or_and_cmp): Likewise.
830 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
831 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
832 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
833 ebitset_xor_cmp): Likewise.
834 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
835 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
836 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
837 lbitset_xor_cmp): Likewise.
838 * lib/bbitset.h: Include <stdbool.h>.
839 (struct bitset_vtable): The following members now return bool, not
840 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
841 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
842 or_and_cmp).
843 * src/conflicts.c (count_rr_conflicts): Likewise.
844 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
845 All uses changed.
846 * lib/ebitset.c (ebitset_obstack_init): Likewise.
847 * lib/lbitset.c (lbitset_obstack_init): Likewise.
848 * src/getargs.c (debug_flag, defines_flag, locations_flag,
849 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
850 graph_flag): Likewise.
851 * src/getargs.h (debug_flag, defines_flag, locations_flag,
852 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
853 graph_flag): Likewise.
854 * src/output.c (error_verbose): Likewise.
855 * src/output.h (error_verbose): Likewise.
856 * src/reader.c (start_flag, typed): Likewise.
857 * src/reader.h (typed): Likewise.
858 * src/getargs.c (LOCATIONS_OPTION): New constant.
859 (long_options, getargs): Use it.
860 * src/lalr.c (build_relations): Use bool, not int.
861 * src/nullable.c (nullable_compute): Likewise.
862 * src/print.c (print_reductions): Likewise.
863 * src/tables.c (action_row, pack_vector): Likewise.
864 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
865 * src/output.c (prepare): Use it.
866 * src/output.c (token_definitions_output,
867 symbol_destructors_output, symbol_destructors_output): Use string,
868 not boolean integer, to keep track of whether to output separator.
869 * src/print_graph.c (print_core): Likewise.
870 * src/state.c (state_rule_lookaheads_print): Likewise.
871
872 * config/install-sh: Sync from automake 1.7.5.
873
874 2003-05-14 Paul Eggert <eggert@twinsun.com>
875
876 * src/parse-gram.y (rules_or_grammar_declaration): Require a
877 semicolon after a grammar declaration, in the interest of possible
878 future changes to the Bison input language.
879 Do not allow a stray semicolon at the start of the grammar.
880 (rhses.1): Allow one or more semicolons after any rule, including
881 just before "|" as required by POSIX.
882 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
883 grammar.
884
885 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
886
887 %parse-param support for lalr1.cc.
888
889 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
890 b4_cc_constructor_calls, b4_cc_constructor_call,
891 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
892 definitions.
893 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
894 parse-param arguments.
895 (yy::b4_parser_class_name): Declare instance variables to
896 hold parse-param arguments.
897 * tests/calc.at: s/value/semantic_value/ because value clashes
898 with a member of yy::b4_parser_class_name. Adjust C++ code
899 to handle %parse-param. Enable %parse-param test in C++.
900
901 2003-05-12 Paul Eggert <eggert@twinsun.com>
902
903 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
904 English a bit. Fix fclose typo. Change "const char" to "char
905 const", and use ANSI C rather than K&R for "main". Suggest
906 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
907 and suggest yy_switch_to_buffer.
908
909 2003-05-05 Paul Eggert <eggert@twinsun.com>
910
911 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
912 C89. This avoids a diagnostic on compilers that define __STDC__
913 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
914 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
915
916 2003-05-03 Paul Eggert <eggert@twinsun.com>
917
918 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
919 Do not overrun array bounds.
920 This should fix a bug reported today by Olatunji Oluwabukunmi in
921 <http://mail.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
922
923 2003-04-29 Akim Demaille <akim@epita.fr>
924
925 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
926 * src/getargs.c, src/getargs.h: here, as bool, not int.
927 (nondeterministic_parser): New.
928 * src/parse-gram.y, src/scan-gram.l: Support
929 %nondeterministic-parser.
930 * src/output.c (prepare): Use nondeterministic_parser instead
931 of glr_parser where appropriate.
932 * src/tables.c (conflict_row, action_row, save_row)
933 (token_actions, token_actions, pack_vector): Ditto.
934
935 2003-04-29 Akim Demaille <akim@epita.fr>
936
937 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
938
939 2003-04-29 Akim Demaille <akim@epita.fr>
940
941 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
942 with %pure-parser and %locations to exercise the patch from Yakov
943 Markovitch below.
944
945 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
946
947 * data/yacc.c: (b4_lex_param): Corrected for the case where
948 %lex-param is provided and %pure-parser isn't.
949
950 2003-04-27 Paul Eggert <eggert@twinsun.com>
951
952 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
953 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
954 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
955 if it is not defined.
956 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
957
958 2003-04-26 Paul Eggert <eggert@twinsun.com>
959
960 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
961 Declare to be of type suitable for the ninf value itself, not of
962 type suitable for the corresponding table, since the latter might
963 be unsigned but the ninf value might be negative. This fixes a
964 bug reported by Alexandre Duret-Lutz in
965 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
966
967 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
968 invokes it. We shouldn't invoke it twice because it will attempt
969 to put error.o in the archive twice. This fixes a glitch reported
970 by Martin Mokrejs in
971 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
972
973 2003-04-21 Paul Eggert <eggert@twinsun.com>
974
975 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
976 to gnulib.
977
978 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
979
980 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
981 Fix obvious typo that results in uncompilable GLR parsers
982 when both %pure-parser and %locations are used. (trivial change)
983
984 2003-04-17 Paul Eggert <eggert@twinsun.com>
985
986 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
987 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
988 Do not insert the expected token via unput, as this runs afoul
989 of a POSIX-compatibility bug in flex 2.5.31.
990 All uses changed to BEGIN the parent state,
991 since we no longer insert the expected token via unput.
992 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
993 that is no longer emitted after the above change.
994
995 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
996 the first one. This change is from Paul Hilfinger, and it fixes
997 regression reported by Werner Lemberg in
998 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
999
1000 (resolve_sr_conflict): Don't invoke state_errs_set
1001 unless one or more tokens have been explicitly made errors.
1002 Otherwise, the above change causes Bison to abort.
1003
1004 * tests/existing.at (GNU pic Grammar): New test case, taken from
1005 Lemberg's email.
1006
1007 2003-03-31 Akim Demaille <akim@epita.fr>
1008
1009 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
1010
1011 2003-03-31 Akim Demaille <akim@epita.fr>
1012
1013 * src/output.c (prepare_symbols): Avoid trailing spaces in the
1014 output.
1015
1016 2003-03-31 Akim Demaille <akim@epita.fr>
1017
1018 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
1019 From Paul Hilfinger.
1020
1021 2003-03-29 Akim Demaille <akim@epita.fr>
1022
1023 * m4/error.m4: Do not put under dynamic conditions some code which
1024 expansion is under static control.
1025
1026 2003-03-29 Akim Demaille <akim@epita.fr>
1027
1028 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
1029
1030 2003-03-29 Akim Demaille <akim@epita.fr>
1031
1032 * doc/bison.texinfo (Strings are Destroyed): New.
1033
1034 2003-03-13 Paul Eggert <eggert@twinsun.com>
1035
1036 * .cvsignore: Add configure.lineno.
1037 * src/.cvsignore: Add yacc.
1038 * tests/.cvsignore: Add testsuite.log.
1039 * doc/fdl.texi: Sync with latest FSF version.
1040
1041 2003-03-12 Paul Eggert <eggert@twinsun.com>
1042
1043 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
1044 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
1045 cursor, instead of leaving it undefined. This fixes a bug
1046 reported by Tim Van Holder in
1047 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
1048 * tests/input.at (Torturing the Scanner): Test the scanner on
1049 an empty input file, which was Tim Van Holder's test case.
1050
1051 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
1052 <sys/resource.h> can be included, include sys/time.h and
1053 sys/times.h first, if available. This works around the SunOS
1054 4.1.4 porting bug reported by Bruce Becker in
1055 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
1056
1057 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
1058 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
1059 AC_HEADER_SYS_WAIT.
1060
1061 Merge changes from gnulib. This was prompted because the CVS
1062 snapshot didn't build on Solaris 7 due to strnlen problems.
1063
1064 These changes need to be merged back into gnulib:
1065 * lib/hash.c: Include <stdbool.h> unconditionally.
1066 * m4/onceonly.m4 (m4_quote): New macro.
1067 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
1068 Quote AC_FOREACH variable-expansions properly.
1069 The 2003-01-03 obstack.h change also needs merging.
1070 {end of changes requiring merging}
1071
1072 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
1073 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
1074 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
1075 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
1076 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
1077 New files, imported from gnulib.
1078 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
1079 above.
1080
1081 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
1082 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
1083 gnulib sources.
1084
1085 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
1086 Add.
1087 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
1088 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
1089 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
1090 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
1091 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
1092 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
1093 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
1094 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
1095 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
1096 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
1097 (jm_PREREQ_ARGMATCH): Remove.
1098 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
1099 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
1100
1101 * src/system.h: Include <stdbool.h> unconditionally.
1102
1103 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
1104 assuming at least C89 in the bitset code for some time now.
1105
1106 2003-03-03 Akim Demaille <akim@epita.fr>
1107
1108 * ro.po: New.
1109
1110 2003-03-02 Akim Demaille <akim@epita.fr>
1111
1112 * doc/bison.texinfo (Table of Symbols): Reactivate the
1113 documentation for %lex-param, and %parse-param.
1114
1115 2003-03-02 Akim Demaille <akim@epita.fr>
1116
1117 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
1118 generate verbose error messages.
1119 Use the number of tokens as an upper bound in yytname, as it
1120 cannot be a non terminal.
1121
1122 2003-03-02 Akim Demaille <akim@epita.fr>
1123
1124 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
1125 message.
1126
1127 2003-03-02 Akim Demaille <akim@epita.fr>
1128
1129 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
1130 Use them to exercise yycheck overrun.
1131 Based on Andrew Suffield's grammar.
1132
1133 2003-03-02 Akim Demaille <akim@epita.fr>
1134
1135 Create tests/local.at for Bison generic testing macros.
1136
1137 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
1138 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
1139 This new file.
1140 * tests/calc.at (AT_CHECK_CALC): Adjust.
1141 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
1142 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
1143 * tests/local.at: here.
1144 (AT_COMPILE_CXX): Tags the tests using it as c++.
1145 Ignore the test if CXX is not functional.
1146
1147 2003-03-01 Paul Eggert <eggert@twinsun.com>
1148
1149 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
1150 not loc->end, since loc->end might contain garbage and this leads
1151 to undefined behavior on some platforms.
1152 (id_loc, token_start): Use (IF_LINTed) initial values that do not
1153 depend on *loc, so that the reader doesn't give the the false
1154 impression that *loc is initialized.
1155 (<INITIAL>"%%"): Do not bother setting code_start, since its value
1156 does not survive the return.
1157
1158 2003-03-01 Akim Demaille <akim@epita.fr>
1159
1160 * src/scan-gram.l (code_start): Always initialize it when entering
1161 into yylex, as SC_EPILOGUE is activated *before* the corresponding
1162 yylex invocation. An alternative would be making it static, but
1163 then it starts with the second %%'s beginning, instead of its end.
1164
1165 2003-02-28 Paul Eggert <eggert@twinsun.com>
1166
1167 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
1168 around a UnixWare 7.1.1 porting bug reported by John Hughes in
1169 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
1170
1171 2003-02-26 Paul Eggert <eggert@twinsun.com>
1172
1173 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
1174 Remove Sequent/Pyramid discussion (nobody uses them any more).
1175 Merge VMS and MS-DOS discussion; these ports may well be dead
1176 but let's keep mentioning them for now. Put <> around email
1177 addresses. Add copyright notice.
1178
1179 2003-02-24 Paul Eggert <eggert@twinsun.com>
1180
1181 * data/glr.c (yy_reduce_print): yylineno -> yylno,
1182 to avoid collision with flex use of yylineno.
1183 Problem reported by Bruce Lilly in
1184 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
1185 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
1186 * data/yacc.c (yy_reduce_print): Likewise.
1187
1188 * config/depcomp: Sync with Automake 1.7.3.
1189
1190 2003-02-21 Akim Demaille <akim@epita.fr>
1191
1192 * data/lalr1.cc: Use temporary variables instead of casts to
1193 change integer types.
1194 Suggested by Paul Eggert.
1195
1196 2003-02-21 Akim Demaille <akim@epita.fr>
1197
1198 * doc/bison.texinfo: Use "location" consistently to refer to @n,
1199 to avoid confusions with lalr1.cc's notion of Position.
1200 Suggested by Paul Eggert.
1201
1202 2003-02-20 Akim Demaille <akim@epita.fr>
1203
1204 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
1205 before initial_columns.
1206 (location.hh): Use consistent variable names when defining the
1207 operator<<.
1208 Use "last" so that we subtract from Positions, not from unsigned.
1209
1210 2003-02-20 Akim Demaille <akim@epita.fr>
1211
1212 * data/lalr1.cc (position.hh): New subfile, including the extended
1213 and Doxygen'ed documentation of class Position.
1214 (location.hh): Use it.
1215 Document a` la Doxygen.
1216 With the help of Benoit Perrot.
1217
1218 2003-02-20 Akim Demaille <akim@epita.fr>
1219
1220 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
1221 AT_YACC_IF.
1222 Redefine AT_YYERROR_SEES_LOC_IF using it.
1223 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
1224 not defined.
1225 Don't use the location in yy::Parser::error_ and
1226 yy::Parser::print_ when not %locations.
1227 Activate more lalr1.cc tests.
1228
1229 2003-02-19 Akim Demaille <akim@epita.fr>
1230
1231 * data/lalr1.cc: When displaying a line number, be sure to make it
1232 an int.
1233
1234 2003-02-19 Akim Demaille <akim@epita.fr>
1235
1236 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
1237 Remove, useless.
1238 (YYABORT, YYACCEPT, YYERROR): New.
1239 * tests/calc.at: Renable the lalr1.cc test.
1240
1241 2003-02-19 Akim Demaille <akim@epita.fr>
1242
1243 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
1244 error recovery, mixing with/without pops and discarding of the
1245 lookahead.
1246 Exercise YYERROR.
1247 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
1248
1249 2003-02-17 Paul Eggert <eggert@twinsun.com>
1250
1251 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
1252 * tests/testsuite.at (AT_COMPILE): Use them.
1253 This fixes the testsuite problem reported by Robert Lentz in
1254 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
1255
1256 2003-02-12 Paul Eggert <eggert@twinsun.com>
1257
1258 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
1259 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
1260 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
1261 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
1262 Check for malloc failure, for consistency with yacc.c.
1263 (yytname_size): Remove, for consistency with yacc.c.
1264
1265 The bug still remains in data/lalr1.cc, as I didn't have time
1266 to fix it there.
1267
1268 2003-02-06 Akim Demaille <akim@epita.fr>
1269
1270 * configure.ac (GXX): Rename as...
1271 (CXX): this, to keep the original Autoconf semantics.
1272 Require 2.57.
1273 * data/lalr1.cc: Fix b4_copyright invocations.
1274 If YYDEBUG is not defined, don't depend upon name_ being defined.
1275 (location.hh): Include string and iostream.
1276 (Position::filename): New member.
1277 (Position::Position ()): New.
1278 (operator<< (Position)): New.
1279 (operator- (Position, int)): New.
1280 (Location::first, Location::last): Rename as...
1281 (Location::begin, Location::end): these, to mock the conventional
1282 iterator names.
1283 (operator<< (Location)): New.
1284 * tests/atlocal.in (CXX): New.
1285 * tests/testsuite.at (AT_COMPILE_CXX): New.
1286 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
1287 locations in a more synthetic way.
1288 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
1289 lalr1.cc is used.
1290 Adjust the C locations to match those from Emacs: first column is
1291 column 0.
1292 Change all the expected results.
1293 Conform to the GCS: simplify the locations when applicable.
1294 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
1295 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
1296 these CPP macros with the m4 macros new defined by...
1297 (AT_CHECK_PUSHDEFS): this, i.e.:
1298 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
1299 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
1300 New macros.
1301 (AT_CHECK_POPDEFS): Undefine them.
1302 (AT_CHECK_CALC_LALR1_CC): New.
1303 Use it for the first lalr1.cc test.
1304
1305 2003-02-04 Akim Demaille <akim@epita.fr>
1306
1307 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
1308 Location as is defined.
1309
1310 2003-02-04 Akim Demaille <akim@epita.fr>
1311
1312 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
1313 name_ being defined.
1314
1315 2003-02-03 Paul Eggert <eggert@twinsun.com>
1316
1317 * src/gram.h (start_symbol): Remove unused decl.
1318
1319 Use more-consistent naming conventions for local vars.
1320
1321 * src/derives.c (derives_compute): Change type of local var from
1322 int to rule_number.
1323 * src/gram.c (grammar_rules_partial_print): Likewise.
1324 * src/print.c (print_core): Likewise.
1325 * src/reduce.c (reduce_grammar_tables): Likewise.
1326
1327 * src/gram.c (grammar_dump): Change name of item_number *
1328 local var from r to rp.
1329 * src/nullable.c (nullable_compute): Likewise.
1330
1331 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
1332
1333 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
1334 for symbol or symbol_number var.
1335 * src/reader.c (grammar_start_symbol_set): Likewise.
1336 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
1337 Likewise.
1338 * src/state.c (transitions_to): Likewise.
1339 * src/state.h: Likewise.
1340 * src/tables.c (symbol_number_to_vector_number): Likewise.
1341
1342 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
1343 char * var.
1344
1345 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
1346 var.
1347
1348 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
1349 var.
1350
1351 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
1352 Use str, not s, for char * var. Use ch, not c, for character var.
1353 Use size for size var.
1354
1355 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
1356 char * var.
1357 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
1358 uniqstr var.
1359 * src/uniqstr.h: Likewise.
1360
1361 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
1362 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
1363 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
1364 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
1365 param to have same name as that of enum, so that we don't use
1366 "s" to stand for a non-state.
1367
1368 2003-02-02 Akim Demaille <akim@epita.fr>
1369
1370 * src/scan-skel.l: Scan more than one inert character per yylex
1371 invocation.
1372
1373 2003-02-01 Paul Eggert <eggert@twinsun.com>
1374
1375 Version 1.875a.
1376
1377 * po/LINGUAS: Add ms.
1378
1379 2003-01-30 Akim Demaille <akim@epita.fr>
1380
1381 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
1382
1383 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1384
1385 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
1386 of $1.
1387
1388 Changes in response to error report by S. Eken: GLR mode does not
1389 handle negative $ indices or $ indices in embedded rules correctly.
1390 See <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
1391
1392 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
1393 (b4_rhs_location): Ditto.
1394 (yyfill): New function to copy from stack tree into array
1395 incrementally.
1396 (yyuserAction): Modify to allow incremental move of semantic values
1397 to rhs array when in GLR mode.
1398 Define YYFILL to use in user-defined actions to fill semantic array
1399 as needed.
1400 Remove dummy use of yystack, as there is now a guaranteed use.
1401 (yydoAction): Modify to allow incremental move of semantic values
1402 to rhs array when in GLR mode.
1403 (yyresolveAction): Ditto.
1404 (yyglrShiftDefer): Update comment.
1405 (yyresolveStates): Use X == NULL for pointers, not !X.
1406 (yyglrReduce): Ditto.
1407 (yydoAction): Ditto
1408
1409 * tests/glr-regr1.at: Rename to ...
1410 * tests/glr-regression.at: Add new regression test for the problems
1411 described above (adapted from S. Eken).
1412 Update copyright notice.
1413 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
1414 * tests/Makefile.am: Ditto.
1415
1416 2003-01-28 Paul Eggert <eggert@twinsun.com>
1417
1418 * data/lalr1.cc: Do not use @output_header_name@ unless
1419 b4_defines_flag is set. This fixes two bugs reported by
1420 Tim Van Holder in
1421 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
1422 and <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
1423
1424 2003-01-21 Paul Eggert <eggert@twinsun.com>
1425
1426 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
1427 we don't need to worry about yyerrlab1 being reported as an
1428 "unused label" by non-GCC C compilers. The downside is that if
1429 locations are used then a couple of statements are duplicated each
1430 time YYERROR is invoked, but the upside is that the warnings
1431 should vanish.
1432 (yyerrlab1): Move code to YERROR.
1433 (yyerrlab2): Remove. Change uses back to yyerrlab1.
1434 This reverts some of the 2002-12-27 change.
1435
1436 2003-01-17 Paul Eggert <eggert@twinsun.com>
1437
1438 * src/output.c (symbol_printers_output): Fix typo that led
1439 to core dump. Problem reported by Antonio Rus in
1440 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
1441
1442 2003-01-13 Akim Demaille <akim@epita.fr>,
1443 Quoc Peyrot <chojin@lrde.epita.fr>,
1444 Robert Anisko <anisko_r@lrde.epita.fr>
1445
1446 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
1447 when the stacks contain one element, as the loop would otherwise
1448 free the last state, and then use the top state (the one we just
1449 popped). This means that the initial elements will not be freed
1450 explicitly, as is the case in yacc.c; it is not a problem, as
1451 these elements have fake values.
1452
1453 2003-01-11 Paul Eggert <eggert@twinsun.com>
1454
1455 * NEWS: %expect-violations are now just warnings, reverting
1456 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
1457 bootstrapping problem reported by Matthias Klose; see
1458 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
1459 * src/conflicts.c (conflicts_print): Likewise.
1460 * tests/conflicts.at (%expect not enough, %expect too much,
1461 %expect with reduce conflicts): Likewise.
1462 * doc/bison.texinfo (Expect Decl): Document this. Also mention
1463 that the warning is enabled if the number of conflicts changes
1464 (not necessarily increases).
1465
1466 * src/getargs.c (version): Update copyright year.
1467
1468 2003-01-09 Akim Demaille <akim@epita.fr>
1469
1470 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
1471
1472 2003-01-08 Paul Eggert <eggert@twinsun.com>
1473
1474 * Makefile.maint (WGETFLAGS):
1475 New macro, containing "-C off" to disable proxy caches.
1476 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
1477 (rel-check): Use $(WGET) instead of wget.
1478
1479 2003-01-06 Paul Eggert <eggert@twinsun.com>
1480
1481 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
1482 the GLR paper of Scott, Johnstone and Hussain.
1483
1484 2003-01-04 Paul Eggert <eggert@twinsun.com>
1485
1486 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
1487 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
1488 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
1489 (EXTRA_LIBRARIES): New var, for liby.a.
1490 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
1491 (EXTRA_SCRIPTS): New var, for yacc.
1492
1493 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
1494 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
1495 Problem reported by Nelson H. F. Beebe.
1496
1497 2003-01-03 Paul Eggert <eggert@twinsun.com>
1498
1499 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
1500 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1501 when compiling Bison 1.875's `bitset bset = obstack_alloc
1502 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
1503
1504 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
1505 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
1506 grow to a huge size with typical invocation.
1507
1508 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
1509 Use the pattern recommended by Autoconf 2.57, except also protect
1510 against double-definition.
1511 * src/system.h: Likewise.
1512 Portability issues reported by Nelson H. F. Beebe.
1513
1514 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
1515 All uses changed. Provide a definition in both C and C++.
1516 (yytrue, yyfalse): Define even if defined (__cplusplus).
1517
1518 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
1519 Reported by Nelson H. F. Beebe.
1520
1521 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
1522
1523 2003-01-02 Paul Eggert <eggert@twinsun.com>
1524
1525 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
1526 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
1527 Bug reported by Nelson H. F. Beebe.
1528
1529 2003-01-01 Paul Eggert <eggert@twinsun.com>
1530
1531 * Version 1.875.
1532
1533 2002-12-30 Paul Eggert <eggert@twinsun.com>
1534
1535 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
1536 Moved here from...
1537 (<INITIAL>","): Here. This causes stray "," to be treated
1538 more uniformly.
1539
1540 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
1541 last brace in braced code when not in Yacc mode, for compatibility
1542 with Bison 1.35. This resurrects the 2001-12-15 patch to
1543 src/reader.c.
1544
1545 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
1546 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
1547
1548 2002-12-28 Paul Eggert <eggert@twinsun.com>
1549
1550 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
1551 that of SYM's type. This fixes Debian bug 168069, reported by
1552 Thomas Olsson.
1553
1554 2002-12-28 Paul Eggert <eggert@twinsun.com>
1555
1556 Version 1.75f.
1557
1558 Switch back to the Yacc style of conflict reports, undoing some
1559 of the 2002-07-30 change.
1560 * doc/bison.texinfo (Understanding): Use Yacc style for
1561 conflict reports. Also, use new way of locating rules.
1562 * src/conflicts.c (conflict_report):
1563 Renamed from conflict_report_yacc, removing the old
1564 'conflict_report'. Translate the entire conflict report at once,
1565 so that we don't assume that "," has the same interpretation in
1566 all languages.
1567 (conflicts_output): Use Yacc-style conflict report for each state,
1568 instead of our more-complicated style.
1569 (conflicts_print): Use Yacc-style conflict report, except print
1570 the input file name when not emulating Yacc.
1571 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
1572 Conflicted Reduction, %expect not enough, %expect too much,
1573 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
1574 * tests/existing.at (GNU Cim Grammar): Likewise.
1575 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
1576
1577 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
1578 fatal): Don't invoke fflush; it's not needed and it might even be
1579 harmful for stdout, as stdout might not be open.
1580 * src/reduce.c (reduce_print): Likewise.
1581
1582 2002-12-27 Paul Eggert <eggert@twinsun.com>
1583
1584 Fix a bug where error locations were not being recorded correctly.
1585 This problem was originally reported by Paul Hilfinger in
1586 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
1587
1588 * data/yacc.c (yyparse): New local var yylerrsp, to record the
1589 top of the location stack's error locations.
1590 (yyerrlab): Set it. When discarding a token, push its location
1591 onto yylerrsp so that we don't lose track of the error's end.
1592 (yyerrlab1): Now is only the target of YYERROR, so that we can
1593 properly record the location of the action that failed. For GCC
1594 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
1595 GCC warning about yyerrlab1 being unused if YYERROR is unused.
1596 (yyerrlab2): New label, which yyerrlab now falls through to.
1597 Compute the error's location by applying YYLLOC_DEFAULT to
1598 the locations of all the symbols that went into the error.
1599 * doc/bison.texinfo (Location Default Action): Mention that
1600 YYLLOC_DEFAULT is also invoked for syntax errors.
1601 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1602 Error locations include the locations of all the tokens that were
1603 discarded, not just the last token.
1604
1605 2002-12-26 Paul Eggert <eggert@twinsun.com>
1606
1607 * src/files.c: Include quote.h.
1608 (compute_output_file_names): Warn if we detect conflicting
1609 outputs to the same file. This should catch the misunderstanding
1610 exemplified by Debian Bug 165349, reported by Bruce Stephens..
1611
1612 * src/conflicts.c (conflicts_print): If the user specifies
1613 "%expect N", report an error if there are any reduce/reduce
1614 conflicts. This is what the manual says should happen.
1615 This fixes Debian bug 130890, reported by Anthony DeRobertis.
1616 * tests/conflicts.at (%expect with reduce conflicts): New test.
1617
1618 Don't use m4_include on relative file names, as it doesn't work as
1619 desired if there happens to be a file with that name under ".".
1620
1621 * m4sugar/version.m4: Remove; it was included but it wasn't used.
1622 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
1623 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
1624 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
1625 * src/output.c (output_skeleton): Use full path names when
1626 specifying a file to include; don't rely on include path, as
1627 it's unreliable when the working file contains a file with
1628 that name.
1629
1630 2002-12-25 Paul Eggert <eggert@twinsun.com>
1631
1632 Remove obsolete references to bison.simple and bison.hairy.
1633 Problem mentioned by Aubin Mahe in
1634 <http://mail.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
1635 * data/glr.c: Comment fix.
1636 * doc/bison.1: Remove references. Also, mention "yacc".
1637
1638 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
1639 with -g option.
1640
1641 * src/parse-gram.y (declaration): Use enum "report_states" rather
1642 than its numeric value 1.
1643
1644 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
1645 opening a new one. This fixes Debian bug 165349, reported by
1646 Bruce Stephens.
1647
1648 2002-12-24 Paul Eggert <eggert@twinsun.com>
1649
1650 Version 1.75e.
1651
1652 * Makefile.maint (cvs-update): Don't assume that the shell
1653 supports $(...), as Solaris sh doesn't.
1654
1655 * src/parse-gram.y (lloc_default): Remove test for empty
1656 nonterminals at the end, since it didn't change the result.
1657
1658 2002-12-24 Paul Eggert <eggert@twinsun.com>
1659
1660 If the user does not define YYSTYPE as a macro, Bison now declares it
1661 using typedef instead of defining it as a macro. POSIX requires this.
1662 For consistency, YYLTYPE is also declared instead of defined.
1663
1664 %union directives can now have a tag before the `{', e.g., the
1665 directive `%union foo {...}' now generates the C code
1666 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
1667 The default union tag is `YYSTYPE', for compatibility with Solaris 9
1668 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
1669 instead of `yyltype'.
1670
1671 `yystype' and `yyltype' are now obsolescent macros instead of being
1672 typedefs or tags; they are no longer documented and will be
1673 withdrawn in a future release.
1674
1675 * data/glr.c (b4_location_type): Remove.
1676 (YYSTYPE): Renamed from yystype.
1677 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
1678 (struct YYLTYPE): Renamed from struct yyltype.
1679 (YYLTYPE): Renamed from yyltype.
1680 (yyltype, yystype): New (and obsolescent) macros,
1681 for backward compatibility.
1682 * data/yacc.c: Likewise.
1683
1684 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
1685 does not specify a union tag. This is for compatibility with
1686 Solaris 9 yacc.
1687
1688 * src/parse-gram.y (add_param): 2nd arg is now char * not char
1689 const *, since it is now modified by stripping surrounding { }.
1690 (current_braced_code): Remove.
1691 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
1692 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
1693 trailing " {...}". Now of type <chars>.
1694 (grammar_declaration): Adjust to bundled tokens.
1695 (code_content): Remove; stripping is now done by add_param.
1696 (print_token_value): Print contents of bundled tokens.
1697 (token_name): New function.
1698
1699 * src/reader.h (braced_code, current_braced_code): Remove.
1700 (token_name): New decl.
1701
1702 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
1703 token_type, not braced_code code_kind. All uses changed.
1704 (SC_PRE_CODE): New state, for scanning after a keyword that
1705 has (or usually has) an immediately-following braced code.
1706 (token_type): New local var, to keep track of which token type
1707 to return when scanning braced code.
1708 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
1709 <INITIAL>"%parse-param", <INITIAL>"%printer",
1710 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
1711 instead of returning a token type immediately.
1712 (<INITIAL>"{"): Set token type.
1713 (<SC_BRACED_CODE>"}"): Use it.
1714 (handle_action_dollar, handle_action_at): Now returns bool
1715 indicating success. Fail if ! current_rule; this prevents a core dump.
1716 (handle_symbol_code_dollar, handle_symbol_code_at):
1717 Remove; merge body into caller.
1718 (handle_dollar, handle_at): Complain in invalid contexts.
1719
1720 * NEWS, doc/bison.texinfo: Document the above.
1721 * NEWS: Fix years and program names in copyright notice.
1722
1723 2002-12-17 Paul Eggert <eggert@twinsun.com>
1724
1725 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
1726 Reporting, Table of Symbols): Omit mentions of %lex-param and
1727 %parse-param from the documentation for now.
1728
1729 2002-12-15 Paul Eggert <eggert@twinsun.com>
1730
1731 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
1732 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
1733 lookahead symbol, and which sets yychar in parser actions) and it
1734 disagreed with the Bison documentation. Bug
1735 reported by Andrew Walrond.
1736
1737 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
1738 as the caller now does that.
1739 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
1740 (YYEMPTY): Parenthesize right hand side, since others use it.
1741 (yyparse): Don't assume that our generated code is the only code
1742 that sets yychar.
1743
1744 2002-12-13 Paul Eggert <eggert@twinsun.com>
1745
1746 Version 1.75d.
1747
1748 POSIX requires a "yacc" command.
1749 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
1750 (MOSTLYCLEANFILES): Add yacc.
1751 (yacc): New rule.
1752 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
1753 as an alias for bison y.
1754
1755 * po/LINGUAS: Add da.
1756
1757 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
1758 problem with latest <getopt.h>.
1759 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
1760
1761 * doc/fdl.texi: Upgrade to 1.2.
1762 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
1763 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
1764 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
1765 gnulib.
1766 * config/install-sh: Sync with autotools.
1767
1768 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
1769 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
1770 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
1771 locations are requested.
1772 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
1773 locations are requested.
1774
1775 2002-12-12 Paul Eggert <eggert@twinsun.com>
1776
1777 Remove unportable casts and storage allocation tricks.
1778 While we're at it, remove almost all casts, since they
1779 usually aren't needed and are a sign of trouble.
1780
1781 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
1782
1783 * src/derives.c (derives_compute): Do not subtract NTOKENS from
1784 the pointer DSET returned by malloc; this isn't portable.
1785 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
1786 Similarly for DERIVES.
1787 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
1788 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
1789 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
1790
1791 * src/derives.c (derives_compute): Do not bother invoking
1792 int_of_rule_number, since rule numbers are integers.
1793
1794 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
1795 rather than XMALLOC (char, N).
1796
1797 * src/files.c (filename_split): Rewrite to avoid cast.
1798
1799 * src/gram.h (symbol_number_as_item_number,
1800 item_number_as_symbol_number, rule_number_as_item_number,
1801 item_number_as_rule_number):
1802 Now inline functions rather than macros, to avoid casts.
1803 * src/state.h (state_number_as_int): Likewise.
1804 * src/tables.c (state_number_to_vector_number,
1805 symbol_number_to_vector_number): Likewise.
1806
1807 * src/gram.h (int_of_rule_number): Remove; no longer used.
1808
1809 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
1810 since the resulting storage is always stored into.
1811
1812 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
1813 where it's needed.
1814
1815 * src/muscle_tab.c (muscle_m4_output):
1816 Now inline. Return bool, not int.
1817 * src/state.c (state_compare): Likewise.
1818 * src/symtab.c (symbol_check_defined,
1819 symbol_check_alias_consistency, symbol_pack, symbol_translation,
1820 hash_compare_symbol, hash_symbol):
1821 Likewise.
1822 * src/uniqstr.c (uniqstr_print): Likewise.
1823 * src/muscle_tab.c (muscle_m4_output_processor):
1824 New function, to avoid casts.
1825 * src/state.c (state_comparator, stage_hasher): Likewise.
1826 * src/symtab.c (symbol_check_defined_processor,
1827 symbol_check_alias_consistency_processor, symbol_pack_processor,
1828 symbol_translation_processor, hash_symbol_comparator,
1829 hash_symbol_hasher): Likewise.
1830 * src/uniqstr.c (uniqstr_print_processor): Likewise.
1831 * src/muscle_tab.c (muscles_m4_output):
1832 Use new functions instead of casting old functions unportably.
1833 * src/state.c (state_hash_new): Likewise.
1834 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
1835 symbols_token_translations_init):
1836 Likewise.
1837 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
1838
1839 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
1840 var instead of casting to long, to avoid casts.
1841 (prepare_states): Use MALLOC rather than alloca, so that we don't
1842 have to worry about alloca.
1843 * src/state.c (state_hash_lookup): Likewise.
1844
1845 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
1846 local var instead of casting to unsigned char, to avoid casts.
1847
1848 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
1849 STATE_ALLOC): Remove.
1850 (transitions_new, errs_new, reductions_new, state_new): Use malloc
1851 rather than calloc, and use offsetof to avoid allocating slightly
1852 too much storage.
1853 (state_new): Initialize all members.
1854
1855 * src/state.c (state_hash): Use unsigned accumulator, not signed.
1856
1857 * src/symtab.c (symbol_free): Remove; unused.
1858 (symbol_get): Remove cast in lhs of assignment.
1859 (symbols_do): Now static. Accept generic arguments, not
1860 hashing-related ones.
1861
1862 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
1863 (symbol_processor): Remove.
1864 (symbols_do): Remove decl; now static.
1865
1866 * src/system.h (alloca): Remove; decl no longer needed.
1867 (<stddef.h>): Include, for offsetof.
1868 (<inttypes.>, <stdint.h>): Include if available.
1869 (uintptr_t): New type, if system lacks it.
1870 (CALLOC, MALLOC, REALLOC): New macros.
1871 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
1872 new macros.
1873
1874 * src/tables.c (table_size): Now int, to pacify GCC.
1875 (table_grow, table_ninf_remap): Use signed table size.
1876 (save_row): Don't bother initializing locals when not needed.
1877 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
1878 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
1879
1880 * src/vcg.h: Correct misspellings.
1881
1882 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
1883
1884
1885 * src/getargs.c (getargs): Don't assume EOF == -1.
1886
1887 2002-12-09 Paul Eggert <eggert@twinsun.com>
1888
1889 Change identifier spellings to avoid collisions with names
1890 that are reserved by POSIX.
1891
1892 Don't use names ending in _t, since POSIX reserves them.
1893 For consistency, remove _e and _s endings -- they're weren't
1894 needed to remove ambiguity. All uses changed.
1895 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
1896 turn was just renamed from struniq_t.
1897 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
1898 which in turn was just renamed from struniq_processor_t.
1899 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
1900 in turn was renamed from hash_compare_struniq_t.
1901 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
1902 (state_list): Renamed from state_list_t.
1903 * src/assoc.h (assoc): Renamed from assoc_t.
1904 * src/conflicts.c (enum conflict_resolution): Renamed from
1905 enum conflict_resolution_e.
1906 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
1907 (rule_list): Renamed from rule_list_t.
1908 * src/getargs.h (enum trace): Renamed from enum trace_e.
1909 (enum report): Renamed from enum report_e.
1910 * src/gram.h (item_number): Renamed from item_number_t.
1911 (rule_number): Renamed from rule_number_t.
1912 (struct rule_s): Remove the "rule_s" part; not used.
1913 (rule): Renamed from rule_t.
1914 (rule_filter): Renamed from rule_filter_t.
1915 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
1916 (goto_list): Renamed from goto_list_t.
1917 * src/lalr.h (goto_number): Renamed from goto_number_t.
1918 * src/location.h (location): Renamed from location_t.
1919 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
1920 and moved here from:
1921 * src/muscle_tab.h (muscle_entry_t): here.
1922 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
1923 (rule_list): Renamed from rule_list_t.
1924 * src/print_graph.c (static_graph): Renamed from graph.
1925 * src/reader.h (braced_code): Renamed from braced_code_t.
1926 Remove brace_code_e tag.
1927 * src/relation.h (relation_node): Renamed from relation_node_t.
1928 (relation_nodes): Renamed from relation_nodes_t.
1929 (relation): Renamed from relation_t.
1930 * src/state.h (state_number): Renamed from state_number_t.
1931 (struct state): Renamed from struct state_s.
1932 (state): Renamed from state_t.
1933 (transitions): Renamed from transitions_t. Unused (and
1934 misspelled) transtion_s tag removed.
1935 (errs): Renamed from errs_t. Unused errs_s tag removed.
1936 (reductions): Renamed from reductions_t. Unused tag
1937 reductions_s removed.
1938 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
1939 (struct symbol_list): Renamed from struct symbol_list_s.
1940 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
1941 (struct symbol): Renamed from struct symbol_s.
1942 (symbol): Renamed from symbol_t.
1943 * src/tables.c (vector_number): Renamed from vector_number_t.
1944 (action_number): Renamed from action_t.
1945 * src/tables.h (base_number): Renamed from base_t.
1946 * src/vcg.h (enum color): Renamed from enum color_e.
1947 (enum textmode): Renamed from enum textmode_e.
1948 (enum shape): Renamed from enum shape_e.
1949 (struct colorentry): Renamed from struct colorentry_s.
1950 (struct classname): Renamed from struct classname_s.
1951 (struct infoname): Renamed from struct infoname_s.
1952 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
1953 (enum decision): Renamed from enum decision_e.
1954 (enum orientation): Renamed from enum orientation_e.
1955 (enum alignment): Renamed from enum alignment_e.
1956 (enum arrow_mode): Renamed from enum arrow_mode_e.
1957 (enum crossing_type): Renamed from enum crossing_type_e.
1958 (enum view): Renamed from enum view_e.
1959 (struct node): Renamed from struct node_s.
1960 (node): Renamed from node_t.
1961 (enum linestyle): Renamed from enum linestyle_e.
1962 (enum arrowstyle): Renamed from enum arrowstyle_e.
1963 (struct edge): Renamed from struct edge.
1964 (edge): Renamed from edge_t.
1965 (struct graph): Renamed from struct graph_s.
1966 (graph): Renamed from graph_t.
1967 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
1968 Rename value_t -> value.
1969 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
1970 value_t_as_yystype -> value_as_yystype.
1971
1972 Don't include <errno.h> in the mainstream code, since it
1973 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
1974 * lib/get-errno.c, lib/get-errno.h: New files.
1975 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
1976 get-errno.c.
1977 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
1978 * src/output.c (output_skeleton): Likewise.
1979 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
1980 instead of errno.
1981 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
1982 Likewise.
1983 (handle_action_dollar, handle_action_at): Likewise.
1984 * src/system.h: Do not include <errno.h>.
1985 (TAB_EXT): Renamed from EXT_TAB.
1986 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
1987
1988 Avoid str[a-z]*, since <string.h> reserves that name space.
1989 Change all instances of "struniq" in names to "uniqstr", and
1990 likewise for "STRUNIQ" and "UNIQSTR".
1991 * src/uniqstr.c: Renamed from src/struniq.c.
1992 * src/uniqstr.h: Renamed from src/struniq.h.
1993 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
1994 * src/files.c (strsuffix): Remove; unused.
1995 (concat2): Renamed from stringappend. Now static.
1996 * src/files.h (strsuffix, stringappend): Remove; unused.
1997 * src/parse-gram.y (<chars>): Renamed from <string>.
1998 (<uniqstr>): Renamed from <struniq>.
1999 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
2000 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
2001 (struct graph_s.expand): Renamed from struct graph_s.stretch.
2002 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
2003 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
2004 (N_EXPAND): Renamed from N_STRETCH.
2005
2006 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
2007 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
2008 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
2009 Remove; unused.
2010 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
2011 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
2012 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
2013 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
2014 (BASE_MAXIMUM): Renamed from BASE_MAX.
2015 (BASE_MINIMUM): Renamed from BASE_MIN.
2016 (ACTION_MAX): Remove; unused.
2017 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
2018 Unnecessary casts removed from above defines.
2019
2020
2021 Fix misspelling in names.
2022 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
2023 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
2024 G_NODE_ALIGNEMENT.
2025
2026
2027 * lib/timevar.c (timevar_report): Renamed from time_report,
2028 for consistency with other names.
2029 * lib/timevar.h (timevar_report): New decl.
2030 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
2031
2032
2033 Sort include-file uses.
2034
2035 Reorder all include files under src to be in the order "system.h".
2036 then the ../lib include files in angle brackets (alphabetized),
2037 then the . include files in double-quotes (alphabetized). Fix
2038 dependency breakages encountered in this process, as follows:
2039 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
2040 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
2041 * src/state.h: Include "symtab.h".
2042
2043 2002-12-08 Paul Eggert <eggert@twinsun.com>
2044
2045 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
2046 since this causes problems when __file__ contains character
2047 sequences like "@" that are treated specially by src/scan-skel.l.
2048 Instead, just use the file's basename. This fixes the bug
2049 reported by Martin Mokrejs in
2050 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
2051
2052 2002-12-06 Paul Eggert <eggert@twinsun.com>
2053
2054 Add support for rules that do not have trailing semicolons, as
2055 POSIX requires. Improve the quality of locations in Bison
2056 diagnostics.
2057
2058 * src/location.c: Include <quotearg.h>.
2059 (empty_location): Now const.
2060 (location_print): New function. Follow the recommendation of the
2061 GNU Coding Standards for locations that span file boundaries.
2062 * src/location.h: Do not include <quotearg.h>; no longer needed.
2063 (boundary): New type.
2064 (location_t): Use it. This allows locations to span file boundaries.
2065 All member uses changed: file -> start.file or end.file (as needed),
2066 first_line -> start.line, first_column -> start.column,
2067 last_line -> end.line, last_column -> end.column.
2068 (equal_boundaries): New function.
2069 (LOCATION_RESET, LOCATION_STEP): Remove.
2070 (LOCATION_PRINT): Remove. All callers changed to use location_print.
2071 (empty_location): Now const.
2072 (location_print): New decl.
2073 * src/parse-gram.y (lloc_default): New function, which handles
2074 empty locations more accurately.
2075 (YYLLOC_DEFAULT): Use it.
2076 (%token COLON): Remove.
2077 (%token ID_COLON): New token.
2078 (rules): Use it.
2079 (declarations, rules): Remove trailing semicolon.
2080 (declaration, rules_or_grammar_declaration):
2081 Allow empty (";") declaration.
2082 (symbol_def): Remove empty actions; no longer needed.
2083 (rules_or_grammar_declaration): Remove trailing semicolon.
2084 (semi_colon.opt): Remove.
2085 * src/reader.h: Include location.h.
2086 (scanner_cursor): New decl.
2087 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
2088 rolling our own.
2089 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
2090 of *loc.
2091 (STEP): Remove. No longer needed, now that adjust_location does
2092 the work. All uses removed.
2093 (scanner_cursor): New var.
2094 (adjust_location): Renamed from extend_location. It now sets
2095 *loc and adjusts the scanner cursor. All uses changed.
2096 Don't bother testing for CR.
2097 (handle_syncline): Remove location arg; now updates scanner cursor.
2098 All callers changed.
2099 (unexpected_end_of_file): Now accepts start boundary of token or
2100 comment, not location. All callers changed. Update scanner cursor,
2101 not the location.
2102 (SC_AFTER_IDENTIFIER): New state.
2103 (context_state): Renamed from c_context. All uses changed.
2104 (id_loc, code_start, token_start): New local vars.
2105 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
2106 processing of Yacc white space and equivalents here.
2107 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
2108 instead of returning ID immediately, since we need to search for
2109 a subsequent colon.
2110 (<INITIAL>"'", "\""): Save token_start.
2111 (<INITIAL>"%{", "{", "%%"): Save code_start.
2112 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
2113 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
2114 BEGIN context_state at end, not INITIAL.
2115 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
2116 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
2117 Return correct token start.
2118 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
2119 the start of a character, string or multiline comment is found.
2120 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
2121 Reduction): Adjust reported locations to match the more-precise
2122 results now expected.
2123 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
2124 * tests/reduce.at (Useless Rules, Reduced Automaton,
2125 Underivable Rules): Likewise.
2126 * tests/regression.at (Invalid inputs): No longer `expecting ";"
2127 or "|"' now that so many other tokens are allowed by the new grammar.
2128
2129 * src/complain.h (current_file): Remove duplicate decl;
2130 current_file is now owned by files.h.
2131 * src/complain.c, src/scan-gram.l: Include files.h.
2132
2133 2002-12-06 Paul Eggert <eggert@twinsun.com>
2134
2135 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
2136 promotes to int; it might be unsigned int.
2137 * data/yacc.c (yy_reduce_print): Likewise.
2138
2139 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
2140 be #defined in the prologue, not in the Bison declarations.
2141 This fixes Debian Bug 102878, reported by Shaul Karl.
2142
2143 2002-12-02 Paul Eggert <eggert@twinsun.com>
2144
2145 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
2146 * lib/strtoul.c: New file, from gnulib.
2147 This fixes a porting bug reported by Peter Klein in
2148 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
2149
2150 2002-11-30 Paul Eggert <eggert@twinsun.com>
2151
2152 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
2153 and put only a forward declaration in the prologue. This is for
2154 consistency with the other scanner helper functions.
2155
2156 Type clashes now generate warnings, not errors, since it
2157 appears that POSIX may allow some grammars with type clashes.
2158 * src/reader.c (grammar_current_rule_check): Warn about
2159 type clashes instead of complaining.
2160 * tests/input.at (Type Clashes): Expect warnings, not complaints.
2161
2162 Add Yacc library, since POSIX requires it.
2163 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
2164 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
2165 * lib/main.c, lib/yyerror.c: New files.
2166
2167 gram_error can be static; it need not be extern.
2168 * src/reader.h (gram_error): Remove decl.
2169 * src/parse-gram.y (gram_error): Now static. Add static decl.
2170 (print_token_value): Omit parameter names from forward decl,
2171 for consistency.
2172
2173 2002-11-29 Paul Eggert <eggert@twinsun.com>
2174
2175 * doc/bison.texinfo: Emphasize that yylex and yyerror must
2176 be declared before being used. E.g., one should typically
2177 declare them in the prologue. Use GNU coding style in examples.
2178 Put "const" consistently after the type it modifies. Mention
2179 that C99 supports "inline". Mention that yyerror traditionally
2180 returns "int".
2181
2182 %parse-param and %lex-param now take just one argument, the
2183 declaration; the argument name is deduced from the declaration.
2184
2185 * doc/bison.texinfo (Parser Function, Pure Calling, Error
2186 Reporting, Table of Symbols): Document this.
2187 * src/parse-gram.y (add_param): New function.
2188 (COMMA): Remove.
2189 (declaration): Implement new rule for %parse-param and %lex-param.
2190 * src/scan-gram.l: "," now elicits a warning, rather than being
2191 a token; this is more compatible with byacc.
2192 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
2193
2194 2002-11-27 Paul Eggert <eggert@twinsun.com>
2195
2196 Rename identifiers to avoid real and potential collisions.
2197
2198 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
2199 to avoid collision with lex macro described by Bruce Lilly in
2200 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
2201 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
2202 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
2203 * src/parse-gram.y (print_token_value): Renamed from yyprint.
2204 All uses changed.
2205 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
2206 The name "yycontrol" violates the name space rules, and this stuff
2207 wasn't being used anyway.
2208 (input): Remove action; this stuff wasn't being used.
2209 (gram_error): Rename local variable yylloc -> loc.
2210 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
2211 (YY_DECL): Don't use "yy" at start of local variables.
2212 All uses changed, e.g., yylloc -> loc.
2213 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
2214 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
2215 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
2216 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
2217
2218 * src/parse-gram.y (gram_error): loc is now const *.
2219 * src/reader.h (gram_error): Likewise.
2220
2221 2002-11-24 Paul Eggert <eggert@twinsun.com>
2222
2223 Version 1.75c.
2224
2225 * tests/actions.at (Actions after errors): Use an output format
2226 more similar to that of the Printers and Destructors test.
2227 Test the position of the ';' token too.
2228 (Printers and Destructors): Likewise.
2229 (Printers and Destructors: %glr-parser): Remove for now, to avoid
2230 unnecessarily alarming people when the test fails.
2231
2232 * data/yacc.c (yyerrlab1): Move this label down, so that the
2233 parser does not discard the lookahead token if the user code
2234 invokes YYERROR. This change is required for POSIX conformance.
2235
2236 * lib/error.c: Sync with gnulib.
2237
2238 2002-11-22 Paul Eggert <eggert@twinsun.com>
2239
2240 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
2241 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
2242 * lib/xmalloc.c: Likewise.
2243
2244 2002-11-20 Paul Eggert <eggert@twinsun.com>
2245
2246 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
2247
2248 2002-11-20 Paul Eggert <eggert@twinsun.com>
2249
2250 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
2251 should use `if (! x) abort ();' rather than `assert (x);', and
2252 anyway it's one less thing to worry about configuring.
2253
2254 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
2255 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
2256 and replace all instances of assert with abort.
2257 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
2258 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
2259
2260 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
2261 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
2262 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
2263 hash_find_entry, hash_rehash, hash_insert): Likewise.
2264 * src/conflicts.c (resolve_sr_conflict): Likewise.
2265 * src/lalr.c (set_goto_map, map_goto): Likewise.
2266 * src/nullable.c (nullable_compute): Likewise.
2267 * src/output.c (prepare_rules, token_definitions_output): Likewise.
2268 * src/reader.c (packgram, reader): Likewise.
2269 * src/state.c (state_new, state_free, state_transitions_set,
2270 state_reduction_find): Likewise.
2271 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
2272 symbol_pack): Likewise.
2273 * src/tables.c (conflict_row, pack_vector): Likewise.
2274 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
2275 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
2276 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
2277 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
2278
2279 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
2280 (ARGMATCH_CONSTRAINT): New macro.
2281 (ARGMATCH_ASSERT): Use it.
2282
2283 * src/system.h (verify): New macro.
2284 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
2285 rather than assert.
2286 * src/tables.c (tables_generate): Likewise.
2287
2288 * src/struniq.c (struniq_assert): Now returns void, and aborts
2289 if the assertion is false.
2290 (struniq_assert_p): Remove.
2291 * src/struniq.h: Likewise.
2292
2293 2002-11-18 Paul Eggert <eggert@twinsun.com>
2294
2295 * data/glr.c (yygetLRActions): Replace `yyindex' with
2296 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
2297 This fixes the regression with Sun ONE Studio 7 cc that I reported in
2298 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
2299
2300 2002-11-18 Akim Demaille <akim@epita.fr>
2301
2302 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
2303 space.
2304 From Tim Van Holder.
2305
2306 2002-11-17 Paul Eggert <eggert@twinsun.com>
2307
2308 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
2309 to "SyntaxError" for consistency with my 2002-11-15 change.
2310
2311 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
2312 not define to {}, since this breaks the common use of `YYDPRINTF
2313 ((...));' if a single statement is desired (e.g. before `else').
2314 Work around GCC warnings by surrounding corresponding calls with
2315 {} if needed.
2316 (yyhasResolvedValue): Remove unused function.
2317 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
2318 loop body.
2319 (yyreportSyntaxError): Renamed from yyreportParseError.
2320 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
2321 All uses changed.
2322 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
2323 extern when possible. Remove unused initializations.
2324
2325 2002-11-16 Akim Demaille <akim@epita.fr>
2326
2327 Augment the similarity between GLR and LALR traces.
2328
2329 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
2330 (YY_REDUCE_PRINT): New.
2331 (yyparse): Use them.
2332 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
2333 YYDPRINT here.
2334 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
2335 state reached after the reduction/recovery, since...
2336 (yyparse, yyprocessOneStack): Report the state we are entering in.
2337
2338 2002-11-16 Akim Demaille <akim@epita.fr>
2339
2340 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
2341 Add support for --trace=skeleton.
2342 * src/scan-skel.l: %option debug.
2343 Scan strings of non-@ or \n instead of character by character.
2344 (scan_skel): Handle trace_skeleton.
2345 (QPUTS): New.
2346 (@output_parser_name@, @output_header_name@): ``Restore'' their
2347 support (used to be M4 macros).
2348 * data/yacc.c: Quote larger chunks, a la glr.c.
2349 * data/lalr1.cc: Likewise.
2350 The header guards are no longer available, so use some other
2351 string than `YYLSP_NEEDED'.
2352
2353 2002-11-16 Akim Demaille <akim@epita.fr>
2354
2355 Make the ``Printers and Destructors'' test more verbose, taking
2356 `yacc.c''s behavior as (possibly wrong) reference.
2357
2358 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
2359 instead of fprint on stdout.
2360 Set and report the last_line of the symbols.
2361 Consistently display values and locations.
2362
2363 2002-11-16 Paul Eggert <eggert@twinsun.com>
2364
2365 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
2366
2367 2002-11-15 Paul Eggert <eggert@twinsun.com>
2368
2369 * tests/actions.at (Actions after errors): New test case.
2370
2371 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
2372 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
2373 tests/action.at, tests/calc.at, tests/conflicts.at,
2374 tests/cxx-type.at, tests/regression.at:
2375 "parse error" -> "syntax error" for POSIX compatibility.
2376 "parsing stack overflow..." -> "parser stack overflow" so
2377 that code matches Bison documentation.
2378
2379 2002-11-15 Akim Demaille <akim@epita.fr>
2380
2381 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
2382 take two BRACED_CODE, not two string_content.
2383 Free the scanner's obstack when we are done.
2384 (code_content): New.
2385 * tests/calc.at: Adjust.
2386 * doc/bison.texinfo: Adjust.
2387 Also, make sure to include the `,' for these declarations.
2388
2389 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
2390
2391 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
2392 definition; avoids potential autoreconf problems.
2393
2394 2002-11-15 Akim Demaille <akim@epita.fr>
2395
2396 Always check the value returned by yyparse.
2397
2398 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
2399 returned by yyparse.
2400 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
2401 Adjust calls.
2402 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
2403 returned by yyparse.
2404
2405 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2406
2407 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
2408 on input.at test.
2409
2410 2002-11-14 Paul Eggert <eggert@twinsun.com>
2411
2412 * src/output.c (output_skeleton): Call xfopen instead of
2413 duplicating xfopen's body.
2414
2415 Fix bugs reported by Nelson H. F. Beebe in
2416 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
2417
2418 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
2419 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
2420 Group compiler. Instead, use "$CC -E bar.c". Include the .h
2421 file twice in the grammar, as an extra check.
2422
2423 * tests/input.at (Torturing the Scanner): Surround the
2424 backslash-newline tests with "#if 0", to make it less likely that
2425 we'll run into compiler bugs. Bring back solitary \ inside
2426 comment, but add a closing comment to work around HP C bug. Don't
2427 test backslash-newline in C character constant.
2428
2429 2002-11-14 Akim Demaille <akim@epita.fr>
2430
2431 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
2432 status of the compiler.
2433 Calling `exit 1' is no longer needed.
2434 Reported by Nelson H. F. Beebe.
2435
2436 2002-11-14 Akim Demaille <akim@epita.fr>
2437
2438 * tests/atlocal.in (CPPFLAGS): We have config.h.
2439 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
2440 New.
2441 * tests/actions.at, tests/calc.at, tests/conflicts.at,
2442 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
2443 * tests/regression.at, tests/torture.at: Use them for all the
2444 grammars that are to be compiled.
2445 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
2446 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
2447 * doc/bison.texinfo (GLR Parsers): Document `inline'.
2448
2449 2002-11-14 Akim Demaille <akim@epita.fr>
2450
2451 * doc/bison.texinfo: Various formatting changes (alignments in
2452 samples, additional @group/@end group, GCS in samples.
2453 Use @deffn instead of simple @table to define the directives,
2454 macros, variables etc.
2455
2456 2002-11-13 Paul Eggert <eggert@twinsun.com>
2457
2458 Fix some bugs reported by Albert Chin-A-Young in
2459 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
2460
2461 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
2462 -o c"; the HP C compiler chatters during compilation.
2463 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2464 * tests/headers.at (export YYLTYPE): Likewise.
2465
2466 * tests/input.at (Torturing the Scanner): Remove lines containing
2467 solitary backslashes, as they tickle a bug in the HP C compiler.
2468
2469 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
2470 comments, since they're not portable. Use GNU coding style.
2471
2472 2002-11-13 Akim Demaille <akim@epita.fr>
2473
2474 * data/yacc.c: Leave bigger chunks of quoted text.
2475 (YYDSYMPRINTF): New.
2476 Use it to report symbol activities.
2477 * data/glr.c (YYDSYMPRINTF): New.
2478 Use it.
2479
2480 2002-11-12 Paul Eggert <eggert@twinsun.com>
2481
2482 Version 1.75b.
2483
2484 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
2485 (yyglrReduce): Return yyok, not 0.
2486 This should avoid the enumerated-type warnings reported
2487 by Nelson H. F. Beebe in
2488 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
2489
2490 * lib/bbitset.h (BITSET_INLINE): Remove.
2491 * lib/bitset.h [! BITSET_INLINE]: Remove.
2492 (bitset_set, bitset_reset, bitset_test): Rename local vars
2493 to avoid shadowing warnings by GCC.
2494
2495 * data/glr.c (inline): Remove #define. It's the user's
2496 responsibility to #define it away, just like 'const'.
2497 This fixes one of the bugs reported by Nelson H. F. Beebe in
2498 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
2499
2500 * Makefile.maint (po-check): Scan .l and .y files instead of the
2501 .c and the .h files that they generate. This fixes the bug
2502 reported by Tim Van Holder in:
2503 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
2504 Look for N_ as well as for _. Try to avoid matching #define for
2505 N_ and _.
2506 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
2507 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
2508 * src/scan-gram.l: Revamp regular expressions so that " and '
2509 do not confuse xgettext.
2510
2511 * src/struniq.h (struniq_new): Do not declare the return type
2512 to be 'const'; this violates the C standard.
2513 * src/struniq.c (struniq_new): Likewise.
2514
2515 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
2516
2517 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
2518 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
2519 linker.
2520
2521 2002-11-12 Akim Demaille <akim@epita.fr>
2522
2523 * Makefile.maint: Sync with Autoconf:
2524 (local_updates): New.
2525
2526 2002-11-12 Akim Demaille <akim@epita.fr>
2527
2528 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
2529
2530 2002-11-12 Akim Demaille <akim@epita.fr>
2531
2532 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
2533 locations.
2534
2535 2002-11-12 Akim Demaille <akim@epita.fr>
2536
2537 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
2538 not yyvalue.
2539
2540 2002-11-12 Akim Demaille <akim@epita.fr>
2541
2542 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
2543 Use it to test the GLR parser.
2544
2545 2002-11-12 Akim Demaille <akim@epita.fr>
2546
2547 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
2548 defines it.
2549 * data/glr.c (yystos): New.
2550 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
2551 (YYDSYMPRINT): New.
2552 (yyval): Don't define it, it is handled via M4.
2553 (yyrecoverParseError): Free verbosely the discarded symbols.
2554 * data/yacc.c (yysymprint): Remove, rather...
2555 (b4_yysymprint_generate): invoke.
2556 * data/c.m4 (b4_yysymprint_generate): New.
2557 Accept pointers as arguments, as opposed to the version from
2558 yacc.c.
2559 (b4_yydestruct_generate): Likewise.
2560 * tests/cations.at (Printers and Destructors): Use Bison directives
2561 instead of CPP macros.
2562 Don't rely on internal details.
2563
2564 2002-11-12 Akim Demaille <akim@epita.fr>
2565
2566 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
2567 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
2568 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
2569 it against YYEMPTY and so forth), work on yytoken (i.e., set
2570 it to YYEMPTY etc.).
2571 (yydestruct): Replace with a b4_yydestruct_generate invocation.
2572 (b4_symbol_actions): Remove.
2573 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
2574 for 0, end-of-input.
2575
2576 2002-11-12 Akim Demaille <akim@epita.fr>
2577
2578 * doc/bison.texinfo (Destructor Decl): New.
2579
2580 2002-11-12 Akim Demaille <akim@epita.fr>
2581
2582 * src/tables.c (tables_generate): Use free for pointers that
2583 cannot be NULL, not XFREE.
2584 (pack_vector): Use assert, not fatal, for bound violations.
2585 * src/state.c (state_new): Likewise.
2586 * src/reader.c (reader): Likewise.
2587 * src/lalr.c (set_goto_map): Likewise.
2588 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
2589 the file name.
2590
2591 2002-11-12 Akim Demaille <akim@epita.fr>
2592
2593 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
2594 Restore.
2595 * src/scan-gram.l (last_string): Is global to the file, not to
2596 yylex.
2597 * src/parse-gram.y (input): Don't append the epilogue here,
2598 (epilogue.opt): do it here, and free the scanner's obstack.
2599 * src/reader.c (epilogue_set): Rename as...
2600 (epilogue_augment): this.
2601 * data/c.m4 (b4_epilogue): Defaults to empty.
2602
2603 2002-11-12 Akim Demaille <akim@epita.fr>
2604
2605 * src/getargs.c (long_options): Remove duplicates.
2606 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
2607 Remove.
2608 * doc/bison.rnh: Remove.
2609 * doc/bison.texinfo (VMS Invocation): Remove.
2610
2611 2002-11-12 Akim Demaille <akim@epita.fr>
2612
2613 * src/struniq.h, src/struniq.c (struniq_t): Is const.
2614 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
2615
2616 Use struniq for symbols.
2617
2618 * src/symtab.h (symbol_t): The tag member is a struniq.
2619 (symbol_type_set): Adjust.
2620 * src/symtab.c (symbol_new): Takes a struniq.
2621 (symbol_free): Don't free the tag member.
2622 (hash_compare_symbol_t, hash_symbol_t): Rename as...
2623 (hash_compare_symbol, hash_symbol): these.
2624 Use the fact that tags as struniqs.
2625 (symbol_get): Use struniq_new.
2626 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
2627 Returns a strniq.
2628 * src/reader.h (merger_list, grammar_currentmerge_set): The name
2629 and type members are struniqs.
2630 * src/reader.c (get_merge_function)
2631 (grammar_current_rule_merge_set): Adjust.
2632 (TYPE, current_type): Are struniq.
2633
2634 Use struniq for file names.
2635
2636 * src/files.h, src/files.c (infile): Split into...
2637 (grammar_file, current_file): these.
2638 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
2639 * src/reduce.c (reduce_print): Likewise.
2640 * src/getargs.c (getargs): Likewise.
2641 * src/complain.h, src/complain.c: Likewise.
2642 * src/main.c (main): Call struniqs_new early enough to use it for
2643 file names.
2644 Don't free the input file name.
2645
2646 2002-11-12 Akim Demaille <akim@epita.fr>
2647
2648 * src/symtab.c (symbol_free): Remove dead deactivated code:
2649 type_name are properly removed.
2650 Don't use XFREE to free items that cannot be NULL.
2651 * src/struniq.h, src/struniq.c: New.
2652 * src/main.c (main): Initialize/free struniqs.
2653 * src/parse-gram.y (%union): Add astruniq member.
2654 (yyprint): Adjust.
2655 * src/scan-gram.l (<{tag}>): Return a struniq.
2656 Free the obstack bit that used to store it.
2657 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
2658
2659 2002-11-11 Paul Eggert <eggert@twinsun.com>
2660
2661 Revamp to fix many (but not all) of the C- and M4-related quoting
2662 problems. Among other things, this fixes the Bison bug reported
2663 by Jan Hubicka when processing the Bash grammar; see:
2664 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
2665
2666 Use new @ escapes consistently. Represent brackets with @{ and @}
2667 rather than @<:@ and @:>@, since this works a bit better with dumb
2668 editors like vi. Represent @ with @@, since @ is now consistently
2669 an escape. Use @oline@ and @ofile@ rather than __oline__ and
2670 __ofile__, to avoid unexpected expansions. Similarly, use @output
2671 rather than #output.
2672
2673 * data/c.m4 (b4_copyright): Omit file name from comment, since
2674 the file name could contain "*/".
2675 (b4_synclines_flag): Don't quote the 2nd argument; it should already
2676 be quoted. All uses changed.
2677
2678 * data/glr.c: Use new @ escapes consistently.
2679 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
2680 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
2681 Remove, since they couldn't handle arbitrary characters in file
2682 names.
2683 * data/lalr1.cc: Likewise.
2684 * data/yacc.c: Likewise.
2685
2686 * src/files.c (output_infix): Remove; all uses removed.
2687 * src/files.h: Likewise.
2688
2689 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
2690 mishandled funny characters in file names, and anyway it isn't
2691 needed any more.
2692 * data/yacc.c: Likewise.
2693 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
2694
2695 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
2696 * data/yacc.c: Likewise.
2697
2698 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
2699 strings now.
2700 (muscle_init): Quote filename as a C string.
2701 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
2702 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
2703 * src/output.c (escaped_file_name_output): New function.
2704 (prepare_symbols): Quote tokens for M4.
2705 (prepare): Don't insert output_infix, output_prefix,
2706 output_parser_name, output_header_name; this is now down by scan-skel.
2707 Insert skeleton as a C string.
2708
2709 * src/output.c (user_actions_output, symbol_destructors_output,
2710 symbol_printers_output): Quote filenames for C and M4.
2711 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2712
2713 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
2714 escapes other than \\ and \'; this simplifies the code.
2715 (<SC_STRING>): Likewise, for \\ and \".
2716 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
2717 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
2718 Use new escapes @{ and @} for [ and ].
2719
2720 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
2721 them with auto vars.
2722 Switch to new escape scheme, where @ is the escape character uniformly.
2723 Abort if a stray escape character is found. Avoid unbounded input
2724 buffer when parsing non-escaped text.
2725
2726 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
2727 __oline__, #output, $@, and @{ do not have unintended meanings.
2728
2729 2002-11-09 Paul Eggert <eggert@twinsun.com>
2730
2731 Fix the test failure due to GCC warnings described in
2732 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
2733 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
2734 evaluate to 0 if it's impossible for NINF to be in the respective
2735 table.
2736 (yygetLRActions, yyrecoverParseError): Use them.
2737
2738 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
2739 counted in the token inserted at end of file. Now takes
2740 location_t *, not location_t, so that the location can be
2741 adjusted. All uses changed.
2742
2743 * tests/regression.at (Invalid inputs): Adjust wording in
2744 diagnostic to match the new behavior.
2745
2746 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
2747 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
2748 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
2749 abort ();'. This reduces the runtime of the "Many lookaheads"
2750 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
2751 GCC 3.2.
2752
2753 2002-11-07 Paul Eggert <eggert@twinsun.com>
2754
2755 * src/parse-gram.y (CHARACTER): Remove unused token.
2756 All uses removed.
2757
2758 * src/scan-gram.l: Remove stack option. We no longer use the
2759 stack, since the stack was never deeper than 1; instead, use the
2760 new auto var c_context to record the stacked value.
2761
2762 Remove nounput option. At an unexpected end of file, we now unput
2763 the minimal input necessary to end cleanly; this simplifies the
2764 code.
2765
2766 Avoid unbounded token sizes where this is easy.
2767
2768 (unexpected_end_of_file): New function.
2769 Use it to systematize the error message on unexpected EOF.
2770 (last-string): Now auto, not static.
2771 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
2772 (scanner_last_string_free): Remove; not used.
2773 (percent_percent_count): Move decl to just before use.
2774 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
2775 not the (never otherwised-used) CHARACTER.
2776
2777 2002-11-07 Akim Demaille <akim@epita.fr>
2778
2779 Let yyerror always receive the msg as last argument, so that
2780 yyerror can be variadic.
2781
2782 * data/yacc.c (b4_yyerror_args): New.
2783 Use it when calling yyerror.
2784 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
2785 Use it when calling yyerror.
2786 * doc/bison.texinfo (Error Reporting): Adjust.
2787 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
2788 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
2789
2790 2002-11-06 Akim Demaille <akim@epita.fr>
2791
2792 #line should have quoted strings.
2793 Ideally, this should be done by m4_quotearg.
2794
2795 * src/scan-skel.l: Include quotearg.h.
2796 Quote __ofile__.
2797 * src/output.c (symbol_printers_output)
2798 (symbol_destructors_output): Quote the file name.
2799
2800 2002-11-06 Akim Demaille <akim@epita.fr>
2801
2802 * tests/regression.at (Invalid inputs): Adjust to the recent
2803 messages.
2804
2805 2002-11-06 Akim Demaille <akim@epita.fr>
2806
2807 Restore --no-lines.
2808 Reported by Jim Kent.
2809
2810 * data/c.m4 (b4_syncline): New.
2811 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
2812 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
2813 * src/output.c (user_actions_output): Likewise.
2814 (prepare): Define 'b4_synclines_flag'.
2815 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
2816
2817 2002-11-06 Akim Demaille <akim@epita.fr>
2818
2819 * src/main.c (main): Free `infile'.
2820 * src/scan-gram.l (handle_syncline): New.
2821 Recognize `#line'.
2822 * src/output.c (user_actions_output, symbol_destructors_output)
2823 (symbol_printers_output): Use the location's file name, not
2824 infile.
2825 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2826
2827 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2828
2829 * src/tables.c (matching_state): Don't allow states to match if
2830 either has GLR conflict entries.
2831
2832 2002-11-05 Paul Eggert <eggert@twinsun.com>
2833
2834 * src/scan-gram.l: Use more accurate diagnostics, e.g.
2835 "integer out of range" rather than "invalid value".
2836 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
2837 accordingly.
2838
2839 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
2840 Also, remove one static variable in the scanner.
2841
2842 * src/scan-gram.l (braces_level): Now auto, not static.
2843 Initialize to zero if the compiler is being picky.
2844 (INITIAL): Clear braces_level instead of incrementing it.
2845 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
2846 as POSIX 1003.1-2001 requires.
2847 * src/system.h (IF_LINT): New macro, taken from coreutils.
2848 * configure.ac: Define "lint" if --enable-gcc-warnings.
2849
2850 2002-11-05 Akim Demaille <akim@epita.fr>
2851
2852 * src/scan-gram.l: When it starts with `%', complain about the
2853 whole directive, not just that `invalid character: %'.
2854
2855 2002-11-04 Akim Demaille <akim@epita.fr>
2856
2857 * Makefile.maint: Update from Autoconf.
2858 (update, cvs-update, po-update, do-po-update): New.
2859
2860 2002-11-04 Akim Demaille <akim@epita.fr>
2861
2862 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
2863 and yyerror.
2864 Have yyerror `use' its arguments.
2865 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
2866 returns true when location & yacc & pure & parse-param.
2867 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
2868
2869 2002-11-04 Akim Demaille <akim@epita.fr>
2870
2871 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
2872 clashes.
2873 * src/scan-gram.l: Use [\'] instead of ['] to pacify
2874 font-lock-mode.
2875 Use complain_at.
2876 Use quote, not quote_n since LOCATION_PRINT no longer uses the
2877 slot 0.
2878
2879 2002-11-03 Paul Eggert <eggert@twinsun.com>
2880
2881 * src/reader.c (get_merge_function, grammar_current_rule_check):
2882 Use consistent diagnostics for reporting type name clashes.
2883 Quote the types with <>, for consistency with Yacc.
2884 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
2885
2886 2002-11-03 Akim Demaille <akim@epita.fr>
2887
2888 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
2889 New.
2890 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
2891 (b4_parse_param): Remove.
2892 Use b4_identification.
2893 Propagate b4_pure_args where needed to pass them to yyerror.
2894 * data/glr.m4 (b4_parse_param): Remove.
2895 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
2896 (b4_lpure_formals): New.
2897 Use b4_identification.
2898 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
2899 b4_user_formals and b4_user_args.
2900 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
2901 (yyreportAmbiguity): When using a pure parser, also need
2902 the location, and the parse-params.
2903 Adjust callers.
2904 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
2905 When using a pure parser, also need the parse-params.
2906 Adjust callers.
2907 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
2908 (%pure-parser + %parse-param) LALR and GLR parsers.
2909 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
2910 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
2911 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
2912 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
2913 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
2914 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
2915 * doc/bison.texinfo: Untabify the whole file.
2916 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
2917 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
2918 (Error Reporting): Adjust to these new directives.
2919 Document %error-verbose, deprecate YYERROR_VERBOSE.
2920
2921 2002-11-03 Akim Demaille <akim@epita.fr>
2922
2923 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
2924 AT_CHECK_CALC_GLR invocations to use % directives, instead of
2925 command line options.
2926 * tests/cxx-type.at: Formatting changes.
2927
2928 2002-11-03 Paul Eggert <eggert@twinsun.com>
2929
2930 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
2931 to count columns correctly, and to check for invalid inputs.
2932
2933 Use mbsnwidth to count columns correctly. Account for tabs, too.
2934 Include mbswidth.h.
2935 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
2936 (extend_location): New function.
2937 (YY_LINES): Remove.
2938
2939 Handle CRLF in C code rather than in Lex code.
2940 (YY_INPUT): New macro.
2941 (no_cr_read): New function.
2942
2943 Scan UCNs, even though we don't fully handle them yet.
2944 (convert_ucn_to_byte): New function.
2945
2946 Handle backslash-newline correctly in C code.
2947 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
2948 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
2949 all uses changed.
2950 (tag, splice): New EREs. Do not allow NUL or newline in tags.
2951 Use {splice} wherever C allows backslash-newline.
2952 YY_STEP after space, newline, vertical-tab.
2953 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
2954
2955 (letter, id): Don't assume ASCII; e.g., spell out a-z.
2956
2957 ({int}, handle_action_dollar, handle_action_at): Check for integer
2958 overflow.
2959
2960 (YY_STEP): Omit trailing semicolon, so that it's more like C.
2961
2962 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
2963 as well as \000. Check for UCHAR_MAX, not 255.
2964 Allow \x with an arbitrary positive number of digits, as in C.
2965 Check for overflow here.
2966 Allow \? and UCNs, for compatibility with C.
2967
2968 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
2969 with quote slot used by complain_at.
2970
2971 * tests/input.at: Add tests for backslash-newline, m4 quotes
2972 in symbols, long literals, and funny escapes in strings.
2973
2974 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
2975 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
2976 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
2977 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
2978 * m4/mbswidth.m4: New file, from GNU coreutils.
2979
2980 * doc/bison.texinfo (Grammar Outline): Document // comments.
2981 (Symbols): Document that trigraphs have no special meaning in Bison,
2982 nor is backslash-newline allowed.
2983 (Actions): Document that trigraphs have no special meaning.
2984
2985 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
2986 no longer used.
2987
2988 2002-11-02 Paul Eggert <eggert@twinsun.com>
2989
2990 * src/reader.c: Don't include quote.h; not needed.
2991 (get_merge_function): Reword warning to be consistent with
2992 type clash diagnostic in grammar_current_rule_check.
2993
2994 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
2995 bug in trigraph handling.
2996
2997 * src/output.c (prepare_symbols): When printing token names,
2998 escape "[" as "@<:@" and likewise for "]".
2999
3000 * src/system.h (errno): Remove declaration, as we are now
3001 assuming C89 or better, and C89 guarantees errno.
3002
3003 2002-10-30 Paul Eggert <eggert@twinsun.com>
3004
3005 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
3006 Check for close failures.
3007 * src/files.h (xfclose): Return void, not int, since it always
3008 returned zero.
3009 * src/files.c (xfclose): Likewise. Report I/O error if ferror
3010 indicates one.
3011 * src/output.c (output_skeleton): Use xfclose rather than fclose
3012 and ferror. xfclose now checks ferror.
3013
3014 * data/glr.c (YYLEFTMOST_STATE): Remove.
3015 (yyreportTree): Use a stack-based leftmost state. This avoids
3016 our continuing battles with bogus warnings about initializers.
3017
3018 2002-10-30 Akim Demaille <akim@epita.fr>
3019
3020 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
3021 #if.
3022
3023 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3024
3025 * tests/glr-regr1.at: New test for reported regressions.
3026 * tests/testsuite.at: Add glr-regr1.at test.
3027 * tests/Makefile.am: Add glr-regr1.at test.
3028
3029 2002-10-24 Paul Eggert <eggert@twinsun.com>
3030
3031 Version 1.75a.
3032
3033 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
3034 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
3035 we use malloc. Don't assume 'A' through 'Z' are contiguous.
3036 Don't assume strdup exists; POSIX says its an XSI extension.
3037 Check for buffer overflow on input.
3038
3039 2002-10-24 Akim Demaille <akim@epita.fr>
3040
3041 * src/output.c (output_skeleton): Don't disable M4sugar comments
3042 too soon: it results in comments being expanded.
3043 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
3044 first output.
3045
3046 2002-10-24 Akim Demaille <akim@epita.fr>
3047
3048 * data/yacc.c (m4_int_type): New.
3049 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
3050 char' as only yacc.c wants K&R portability.
3051 * data/glr.c (yysigned_char): Remove.
3052 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
3053 Reported by Quoc Peyrot.
3054
3055 2002-10-23 Paul Eggert <eggert@twinsun.com>
3056
3057 * src/main.c (main): With --trace=time, report times even if a
3058 non-fatal error occurs. Formerly, the times were reported in some
3059 such cases but not in others.
3060 * src/reader.c (reader): Just return if a complaint has been issued,
3061 instead of exiting, so that 'main' can report times.
3062
3063 2002-10-22 Akim Demaille <akim@epita.fr>
3064
3065 * src/system.h: Include sys/types.
3066 Reported by Bert Deknuydt.
3067
3068 2002-10-23 Paul Eggert <eggert@twinsun.com>
3069
3070 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
3071 Suggested by Art Haas.
3072
3073 2002-10-22 Paul Eggert <eggert@twinsun.com>
3074
3075 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
3076 decl; not needed any more.
3077 * src/main.c (main): Use return to exit, undoing yesterday's change.
3078 The last OS that we could find where this wouldn't work is
3079 SunOS 3.5, and that's too old to worry about now.
3080
3081 * data/glr.c (struct yyltype): Define members even when not
3082 doing locations. This is more consistent with yacc.c, and it
3083 works around the following bug reports:
3084 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
3085 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
3086
3087 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
3088 @acronym consistently. Standardize on "Yacc" instead of "YACC",
3089 "Algol" instead of "ALGOL". Give a bit more history about BNF.
3090
3091 2002-10-22 Akim Demaille <akim@epita.fr>
3092
3093 * data/README: New.
3094
3095 2002-10-21 Paul Eggert <eggert@twinsun.com>
3096
3097 Be consistent about 'bool'; the old code used an enum in one
3098 module and an int in another, and this violates the C standard.
3099 * m4/stdbool.m4: New file, from coreutils 4.5.3.
3100 * configure.ac (AC_HEADER_STDBOOL): Add.
3101 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
3102 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
3103 * src/symtab.c (hash_compare_symbol_t): Likewise.
3104 * src/system.h (bool, false, true): Use a definition consistent
3105 with ../lib/hash.c. All uses changed.
3106
3107 * src/complain.c (warning_issued): Renamed from warn_message_count,
3108 so that we needn't worry about integer overflow (!).
3109 Now of type bool. All uses changed.
3110 (complaint_issued): Renamed from complain_message_count; likewise.
3111
3112 * src/main.c (main): Use exit to exit with failure.
3113
3114 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
3115 rather than 1 and 0.
3116 * src/main.c (main): Likewise.
3117 * src/getargs.c (getargs): Likewise.
3118 * src/reader.c (reader): Likewise.
3119
3120 * src/getarg.c (getargs): Remove duplicate code for
3121 "Try `bison --help'".
3122
3123 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
3124 What was that "2" for?
3125
3126 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
3127 * src/getargs.c (usage): Likewise.
3128
3129 * src/getargs.c (getargs): When there are too few operands, report
3130 the last one. When there are too many, report the first extra
3131 one. This is how diffutils does it.
3132
3133 2002-10-20 Paul Eggert <eggert@twinsun.com>
3134
3135 Remove K&R vestiges.
3136 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
3137 * src/complain.c (VA_START): Remove. Assume prototypes.
3138 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
3139 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
3140 fatal): Assume prototypes.
3141 * src/complain.h: Assume prototypes.
3142 * src/system.h (PARAMS): Remove.
3143 Include <limits.h> unconditionally, since it's guaranteeed even
3144 for a freestanding C89 compiler.
3145 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
3146 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
3147
3148 2002-10-20 Akim Demaille <akim@epita.fr>
3149
3150 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
3151 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
3152 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
3153 (yyresolveStates, yyresolveAction, yyresolveStack)
3154 (yyprocessOneStack): Use them.
3155 (yy_reduce_print): New.
3156 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
3157
3158 2002-10-20 Akim Demaille <akim@epita.fr>
3159
3160 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
3161 arguments and output `void'.
3162 (b4_c_function): Rename as...
3163 (b4_c_function_def): this.
3164 (b4_c_function_decl, b4_c_ansi_function_def)
3165 (b4_c_ansi_function_decl): New.
3166 Change the interpretation of the arguments: before `int, foo', now
3167 `int foo, foo'.
3168 * data/yacc.c (yyparse): Prototype and define thanks to these.
3169 Adjust b4_c_function_def uses.
3170 * data/glr.c (yyparse): Likewise, but ANSI only.
3171
3172 2002-10-20 Akim Demaille <akim@epita.fr>
3173
3174 * src/output.c (prepare): Move the definition of `tokens_number',
3175 `nterms_number', `undef_token_number', `user_token_number_max'
3176 to...
3177 (prepare_tokens): Here.
3178 (prepare_tokens): Rename as...
3179 (prepare_symbols): this.
3180 (prepare): Move the definition of `rules_number' to...
3181 (prepare_rules): here.
3182 (prepare): Move the definition of `last', `final_state_number',
3183 `states_number' to...
3184 (prepare_states): here.
3185 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
3186
3187 2002-10-20 Akim Demaille <akim@epita.fr>
3188
3189 * src/tables.h, src/tables.c, src/output.c: Comment changes.
3190
3191 2002-10-20 Akim Demaille <akim@epita.fr>
3192
3193 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
3194 * data/c.m4: here.
3195
3196 2002-10-20 Akim Demaille <akim@epita.fr>
3197
3198 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
3199 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
3200 `pair'.
3201 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
3202 `name' to...
3203 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
3204 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
3205 These.
3206
3207 2002-10-19 Paul Eggert <eggert@twinsun.com>
3208
3209 Do not create a temporary file, as that involves security and
3210 cleanup headaches. Instead, use a pair of pipes.
3211 Derived from a suggestion by Florian Krohm.
3212 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
3213 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
3214 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
3215 (BISON_PREREQ_SUBPIPE): Add.
3216 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
3217 Add subpipe.h, subpipe.c.
3218 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
3219 * po/POTFILES.in: Add lib/subpipe.c.
3220 * src/output.c: Include "subpipe.h".
3221 (m4_invoke): Remove decl.
3222 (scan_skel): New decl.
3223 (output_skeleton): Use pipe rather than temporary file for m4 input.
3224 Check that m4sugar.m4 is readable, to avoid deadlock.
3225 Check for pipe I/O error.
3226 * src/scan-skel.l (readpipe): Remove decl.
3227 (scan_skel): New function, to be used in place of m4_invoke.
3228 Read from stream rather than file.
3229
3230 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
3231 float, as this generates a warning on Solaris 8 + GCC 3.2 with
3232 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
3233 this generates a more-accurate value anyway.
3234
3235 * lib/timevar.c (timervar_accumulate): Rename locals to
3236 avoid confusion with similarly-named more-global.
3237 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
3238
3239 * src/output.c (prepare): Use xstrdup to convert char const *
3240 to char *, to avoid GCC warning.
3241
3242 2002-10-19 Akim Demaille <akim@epita.fr>
3243
3244 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
3245 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
3246 Use them to have `calc.y' ready for %pure-parser.
3247 * data/yacc.c (YYLEX): Pass a yylex return type to
3248 b4_c_function_call.
3249
3250 2002-10-19 Akim Demaille <akim@epita.fr>
3251
3252 Prototype support of %lex-param and %parse-param.
3253
3254 * src/parse-gram.y: Add the definition of the %lex-param and
3255 %parse-param tokens, plus their rules.
3256 Drop the `_' version of %glr-parser.
3257 Add the "," token.
3258 * src/scan-gram.l (INITIAL): Scan them.
3259 * src/muscle_tab.c: Comment changes.
3260 (muscle_insert, muscle_find): Rename `pair' as `probe'.
3261 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
3262 (muscle_entry_s): The `value' member is no longer const.
3263 Adjust all dependencies.
3264 * src/muscle_tab.c (muscle_init): Adjust: use
3265 MUSCLE_INSERT_STRING.
3266 Initialize the obstack earlier.
3267 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
3268 (muscle_pair_list_grow): New.
3269 * data/c.m4 (b4_c_function_call, b4_c_args): New.
3270 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
3271 * tests/calc.at: Use %locations, not --locations.
3272 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
3273
3274 2002-10-19 Akim Demaille <akim@epita.fr>
3275
3276 * src/getargs.c (usage): Take status as argument and exit
3277 accordingly.
3278 Report the traditional `Try ... --help' message when status != 0.
3279 (usage, version): Don't take a FILE * as arg, it is pointless.
3280 (getargs): When there is an incorrect number of arguments, make it
3281 an error, and report it GNUlically thanks to `usage ()'.
3282
3283 2002-10-18 Paul Eggert <eggert@twinsun.com>
3284
3285 * data/glr.c (yyreportParseError): Don't assume that sprintf
3286 yields the length of the printed string, as this is not true
3287 on SunOS 4.1.4. Reported by Peter Klein.
3288
3289 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
3290 * tests/conflicts.at (%nonassoc and eof): Likewise.
3291 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
3292
3293 2002-10-17 Akim Demaille <akim@epita.fr>
3294
3295 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
3296 * src/getargs.c (trace_types, trace_args): Adjust.
3297 * src/reader.c (grammar_current_rule_prec_set)
3298 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
3299 Standardize error messages.
3300 And s/@prec/%prec/!
3301 (reader): Use trace_flag to enable scanner/parser debugging,
3302 instead of an adhoc scheme.
3303 * src/scan-gram.l: Remove trailing debugging code.
3304
3305 2002-10-16 Paul Eggert <eggert@twinsun.com>
3306
3307 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
3308 MUSCLE_TAB_H.
3309
3310 * NEWS: Officially drop support for building Bison with K&R C,
3311 since it didn't work anyway and it's not worth worrying about.
3312 * Makefile.maint (wget_files): Remove ansi2knr.c.
3313 (ansi2knr.c-url_prefix): Remove.
3314 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
3315 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3316 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3317
3318 2002-10-15 Paul Eggert <eggert@twinsun.com>
3319
3320 Stop using the "enum_" trick for K&R-style function definitions;
3321 it confused me, and I was the author! Instead, assume that people
3322 who want to use K&R C compilers (when using these modules in GCC,
3323 perhaps?) will run ansi2knr.
3324
3325 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
3326 All uses of "enum_" changed to "enum ".
3327 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3328 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3329
3330 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
3331 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
3332 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
3333 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
3334 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
3335 abitset_not, abitset_ones, abitset_or, abitset_or_and,
3336 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
3337 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
3338 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
3339 Use function prototypes; this removes the need for declaring
3340 static functions simply to provide their prototypes.
3341 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
3342 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
3343 bitset_count_, bitset_create, bitset_dump, bitset_first,
3344 bitset_free, bitset_init, bitset_last, bitset_next,
3345 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
3346 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
3347 bitset_print, bitset_release_memory, bitset_toggle_,
3348 bitset_type_choose, bitset_type_get, bitset_type_name_get,
3349 debug_bitset): Likewise.
3350 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
3351 * lib/bitset_stats.c (bitset_log_histogram_print,
3352 bitset_percent_histogram_print, bitset_stats_and,
3353 bitset_stats_and_cmp, bitset_stats_and_or,
3354 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
3355 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
3356 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
3357 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
3358 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
3359 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
3360 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
3361 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
3362 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
3363 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
3364 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
3365 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
3366 bitset_stats_zero): Likewise.
3367 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3368 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3369 bitsetv_dump, debug_bitsetv): Likewise.
3370 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
3371 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
3372 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
3373 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
3374 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
3375 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
3376 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
3377 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
3378 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
3379 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
3380 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
3381 Likewise.
3382 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
3383 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
3384 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
3385 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
3386 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
3387 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
3388 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
3389 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
3390 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
3391 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
3392 lbitset_xor_cmp, lbitset_zero): Likewise.
3393
3394 2002-10-14 Akim Demaille <akim@epita.fr>
3395
3396 Version 1.75.
3397
3398 2002-10-14 Akim Demaille <akim@epita.fr>
3399
3400 * tests/Makefile.am (maintainer-check-posix): New.
3401
3402 2002-10-14 Akim Demaille <akim@epita.fr>
3403
3404 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
3405 member.
3406
3407 2002-10-14 Akim Demaille <akim@epita.fr>
3408
3409 * src/tables.c (table_ninf_remap): base -> tab.
3410 Reported by Matt Rosing.
3411
3412 2002-10-14 Paul Eggert <eggert@twinsun.com>
3413
3414 * tests/action.at, tests/calc.at, tests/conflicts.at,
3415 tests/cxx-type.at, tests/headers.at, tests/input.at,
3416 tests/regression.at, tests/synclines.at, tests/torture.at:
3417 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
3418 so that the tests still work even if POSIXLY_CORRECT is set.
3419 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
3420
3421 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
3422 for portability to K&R hosts. Fix typo: signed char is guaranteed
3423 only to 127, not to 128.
3424 * data/glr.c (yysigned_char): New type.
3425 * data/yacc.c (yysigned_char): Likewise.
3426 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
3427
3428 2002-10-13 Paul Eggert <eggert@twinsun.com>
3429
3430 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
3431 true due to limited range of data type" warning from GCC.
3432
3433 * data/c.m4 (b4_token_defines): Protect against double-inclusion
3434 by wrapping enum yytokentype's definition inside #ifndef
3435 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
3436
3437 2002-10-13 Akim Demaille <akim@epita.fr>
3438
3439 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
3440 Un yy- yyrhs to avoid the name clash with the global YYRHS.
3441
3442 2002-10-13 Akim Demaille <akim@epita.fr>
3443
3444 * Makefile.maint: Update from Autoconf 2.54.
3445 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
3446
3447 2002-10-13 Akim Demaille <akim@epita.fr>
3448
3449 * src/print.c (print_state): Separate the list of solved conflicts
3450 from the other items.
3451 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
3452
3453 2002-10-13 Akim Demaille <akim@epita.fr>
3454
3455 Let nondeterministic skeletons be usable with deterministic
3456 tables.
3457
3458 With the patch, GAWK compiled by GCC without -O2 passes its test
3459 suite using a GLR parser driven by LALR tables. It fails with -O2
3460 because `struct stat' gives two different answers on my machine:
3461 88 (definition of an auto var) and later 96 (memset on this var).
3462 Hence the stack is badly corrumpted. The headers inclusion is to
3463 blame: if I move the awk.h inclusion before GLR's system header
3464 inclusion, the two struct stat have the same size.
3465
3466 * src/tables.c (pack_table): Always create conflict_table.
3467 (token_actions): Always create conflict_list.
3468 * data/glr.c (YYFLAG): Remove, unused.
3469
3470 2002-10-13 Akim Demaille <akim@epita.fr>
3471
3472 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
3473 (O0FLAGS): New.
3474 (VALGRIND, GXX): New.
3475 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
3476 * tests/bison.in: Run $PREBISON a pre-command.
3477 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
3478 (maintainer-check-g++): New.
3479 * Makefile.am (maintainer-check): New.
3480
3481 2002-10-13 Akim Demaille <akim@epita.fr>
3482
3483 * data/glr.c: Formatting changes.
3484 Tweak some trace messages to match yacc.c's.
3485
3486 2002-10-13 Akim Demaille <akim@epita.fr>
3487
3488 GLR parsers sometimes raise parse errors instead of performing the
3489 default reduction.
3490 Reported by Charles-Henry de Boysson.
3491
3492 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
3493 check the length of the traces when %glr.
3494 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
3495 GLR's traces.
3496 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
3497 Test GLR parsers.
3498 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
3499 (yyltype): Remove the yy prefix from the member names.
3500 (yytable): Complete its comment.
3501 (yygetLRActions): Map error action number from YYTABLE from
3502 YYTABLE_NINF to 0.
3503 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
3504 (which was a bug: it should have been YYTABEL_NINF, and yet it was
3505 not satisfying as we could compare an YYACTION computed from
3506 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
3507 only value for error actions.
3508 (yyreportParseError): In verbose parse error messages, don't issue
3509 `error' in the list of expected tokens.
3510 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
3511 next action to perform to match glr.c's decoding.
3512 (yytable): Complete its comment.
3513
3514 2002-10-13 Paul Eggert <eggert@twinsun.com>
3515
3516 Fix problem reported by Henrik Grubbstroem in
3517 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
3518 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
3519 because the Bison parser reads the second action before reducing
3520 the first one.
3521 * src/scan-gram.l (rule_length): New static var.
3522 Use it to keep track of the rule length in the scanner, since
3523 we can't expect the parser to be in lock-step sync with the scanner.
3524 (handle_action_dollar, handle_action_at): Use this var.
3525 * tests/actions.at (Exotic Dollars): Test for the problem.
3526
3527 2002-10-12 Paul Eggert <eggert@twinsun.com>
3528
3529 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
3530 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
3531 Include <sys/time.h> when checking for clock_t and struct tms.
3532 Use same include order as source.
3533 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
3534 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
3535
3536 * lib/timevar.c: Update copyright date and clarify comments.
3537 (get_time) [IN_GCC]: Keep the GCC version for reference.
3538
3539 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
3540 GCC version as of today, then merge Bison's changes.
3541 Change "GCC" to "Bison" in copyright notice. timevar.def's
3542 author is Akim, so change that too.
3543
3544 * src/reader.c (grammar_current_rule_check):
3545 Don't worry about the default action if $$ is untyped.
3546 Prevents bogus warnings reported by Jim Gifford in
3547 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
3548
3549 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
3550 * data/glr.c, data/lalr1.cc, data/yacc.c:
3551 Output token definitions before the first part of user declarations.
3552 Fixes compatibility problem reported by Jim Gifford for kbd in
3553 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
3554
3555 2002-10-11 Paul Eggert <eggert@twinsun.com>
3556
3557 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
3558 (yyparse): here. This undoes some of the 2002-07-25 change.
3559 Compatibility problem reported by Ralf S. Engelschall with
3560 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
3561
3562 2002-10-11 Akim Demaille <akim@epita.fr>
3563
3564 * tests/regression.at Characters Escapes): New.
3565 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
3566 characters.
3567 Reported by Jan Nieuwenhuizen.
3568
3569 2002-10-11 Akim Demaille <akim@epita.fr>
3570
3571 * po/id.po: New.
3572
3573 2002-10-10 Paul Eggert <eggert@twinsun.com>
3574
3575 Portability fixes for bitsets; this also avoids several GCC
3576 warnings.
3577
3578 * lib/abitset.c: Include <stddef.h>, for offsetof.
3579 * lib/lbitset.c: Likewise.
3580
3581 * lib/abitset.c (abitset_bytes): Return a size that is aligned
3582 properly for vectors of objects. Do not assume that adding a
3583 header size to a multiple of a word size yields a value that is
3584 properly aligned for the whole union.
3585 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3586
3587 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
3588 unique names for structures.
3589 * lib/ebitset.c (ebitset_bytes): Likewise.
3590 * lib/lbitset.c (lbitset_bytes): Likewise.
3591
3592 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
3593 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
3594 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
3595 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
3596 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
3597 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
3598 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
3599 to improve the type-checking that GCC can do.
3600 * lib/bitset.c (bitset_op4_cmp): Likewise.
3601 * lib/bitset_stats.c (bitset_stats_count,
3602 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
3603 bitset_stats_copy, bitset_stats_disjoint_p,
3604 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
3605 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
3606 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
3607 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
3608 bitset_stats_and_or_cmp, bitset_stats_andn_or,
3609 bitset_stats_andn_or_cmp, bitset_stats_or_and,
3610 bitset_stats_or_and_cmp): Likewise.
3611 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
3612 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
3613 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
3614 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
3615
3616 * lib/abitset.h: Include bitset.h, not bbitset.h.
3617 * lib/ebitset.h: Likewise.
3618 * lib/lbitset.h: Likewise.
3619
3620 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
3621 All instances of parameters of type enum bitset_opts are now of
3622 type enum_bitset_opts, to conform to the C Standard, and similarly
3623 for enum_bitset_type.
3624 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3625 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3626
3627 Do not use "struct bitset_struct" to mean different things in
3628 different modules. Not only is this confusing, it violates
3629 the C Standard, which requires that structure types in different
3630 modules must be compatible if one is to be passed to the other.
3631 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
3632 All instances of "struct bitset_struct *" replaced with "bitset".
3633 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
3634 (union bitset_union, struct abitset_struct, struct ebitset_struct,
3635 struct lbitset_struct, struct bitset_stats_struct): New types.
3636 All uses of struct bitset_struct changed to union bitset_union,
3637 etc.
3638 * lib/abitset.c (struct abitset_struct, abitset,
3639 struct bitset_struct): Remove.
3640 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
3641 struct bitset_struct): Remove.
3642 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
3643 bitset_struct): Remove.
3644 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
3645 Likewise.
3646
3647 Do not call a function of type T using a call that assumes the
3648 function is of a different type U. Standard C requires that a
3649 function must be called with a type that is compatible with its
3650 definition.
3651 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3652 New decls.
3653 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3654 New functions.
3655 * lib/ebitset.c (PFV): Remove.
3656 * lib/lbitset.c (PFV): Likewise.
3657 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
3658 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
3659 decls.
3660 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
3661 (ebitset_vtable): Use them.
3662 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
3663 lbitset_xor): New functions.
3664 (lbitset_vtable): Use them.
3665
3666 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
3667 Declare.
3668
3669 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
3670 GCC warning.
3671 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
3672 Use offsetof, for simplicity.
3673
3674 2002-10-06 Paul Eggert <eggert@twinsun.com>
3675
3676 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
3677 the same width as int. This reapplies a hunk of the 2002-08-12 patch
3678 <http://mail.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
3679 which was inadvertently undone by the 2002-09-30 patch.
3680 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
3681 the same width as int.
3682
3683 2002-10-04 Paul Eggert <eggert@twinsun.com>
3684
3685 Version 1.50.
3686
3687 * configure.ac (AC_INIT), NEWS: Increment version number.
3688
3689 * doc/bison.texinfo: Minor spelling, grammar, and white space
3690 fixes.
3691 (Symbols): Mention that any negative value returned from yylex
3692 signifies end-of-input. Warn about negative chars. Mention
3693 the portable Standard C character set.
3694
3695 The GNU coding standard says CFLAGS and YFLAGS are reserved
3696 for the installer to set.
3697 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
3698 * src/Makefile.am (AM_CFLAGS): Likewise.
3699 (AM_YFLAGS): Renamed from YFLAGS.
3700
3701 Fix some MAX and MIN problems.
3702 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
3703 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
3704 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
3705 * src/reader.c (reader): Use it.
3706
3707 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
3708 POSIX 1003.1-2001 has removed fgrep.
3709
3710 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
3711
3712 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
3713 interpreted as signed.
3714 * lib/ebitset.c (ebitset_list): Fix bug.
3715
3716 2002-10-01 Paul Eggert <eggert@twinsun.com>
3717
3718 More fixes for 64-bit hosts and large bitsets.
3719
3720 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
3721 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
3722 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
3723 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
3724 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
3725 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
3726 bitset_count_): Likewise.
3727 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
3728 bitset_first, bitset_last): Likewise.
3729 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
3730 bitset_stats_list_reverse, bitset_stats_size,
3731 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
3732 Likewise.
3733 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3734 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3735 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3736 bitsetv_reflexive_transitive_closure): Likewise.
3737 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
3738 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
3739 Likewise.
3740 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
3741 Likewise.
3742
3743 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
3744 Use size_t, not unsigned int, to count bytes.
3745 * lib/abitset.h (abitset_bytes): Likewise.
3746 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
3747 Likewise.
3748 * lib/bitset.h (bitset_bytes): Likewise.
3749 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
3750 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
3751 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3752 * lib/ebitset.c (ebitset_bytes): Likewise.
3753 * lib/ebitset.h (ebitset_bytes): Likewise.
3754 * lib/lbitset.c (lbitset_bytes): Likewise.
3755 * lib/lbitset.h (lbitset_bytes): Likewise.
3756
3757 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
3758 abitset_subset_p, abitset_disjoint_p, abitset_and,
3759 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
3760 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
3761 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
3762 abitset_or_and, abitset_or_and_cmp):
3763 Use bitset_windex instead of unsigned int.
3764 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3765 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
3766 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
3767 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
3768 Likewise.
3769 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
3770
3771 * lib/bitset.c (bitset_print):
3772 Use proper printf formats for widths of integer types.
3773 * lib/bitset_stats.c (bitset_percent_histogram_print,
3774 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
3775 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3776 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3777 * lib/lbitset.c (lbitset_bytes): Likewise.
3778
3779 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
3780 BITSET_SIZE_MAX): New macros.
3781 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
3782 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
3783 to BITSET_WINDEX_MAX.
3784
3785 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
3786 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
3787 since we now return the bitset_bindex type (not int).
3788
3789 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
3790 when computing sizes.
3791 * lib/ebitset.c (ebitset_elts_grow): Likewise.
3792
3793 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
3794 and avoid cast to unsigned.
3795
3796 2002-09-30 Akim Demaille <akim@epita.fr>
3797
3798 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
3799 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
3800 Updates from Michael Hayes.
3801
3802 2002-09-30 Art Haas <ahaas@neosoft.com>
3803
3804 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
3805 invocations.
3806 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
3807 defined.
3808
3809 2002-09-27 Akim Demaille <akim@epita.fr>
3810
3811 Version 1.49c.
3812
3813 2002-09-27 Akim Demaille <akim@epita.fr>
3814
3815 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
3816 (Because of AC_LIBSOURCE).
3817
3818 2002-09-27 Akim Demaille <akim@epita.fr>
3819
3820 Playing with Autoscan.
3821
3822 * configure.ac: Remove the old LIBOBJ tweaks.
3823 (AC_REPLACE_FUNCS): Add strrchr and strtol.
3824 * lib/strrchr.c: New.
3825 * lib/strtol.c: New, from the Coreutils 4.5.1.
3826
3827 2002-09-27 Akim Demaille <akim@epita.fr>
3828
3829 Playing with Autoscan.
3830
3831 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
3832 * lib/Makefile.am (libbison_a_SOURCES): No longer include
3833 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
3834 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
3835 Coreutils 4.5.1.
3836
3837 2002-09-24 Akim Demaille <akim@epita.fr>
3838
3839 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
3840 (Frequently Asked Questions, Parser Stack Overflow): New.
3841
3842 2002-09-13 Akim Demaille <akim@epita.fr>
3843
3844 Playing with autoscan.
3845
3846 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
3847 * src/files.c (skeleton_find): Remove, unused.
3848 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
3849 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
3850
3851 2002-09-13 Akim Demaille <akim@epita.fr>
3852
3853 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
3854 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
3855
3856 2002-09-13 Akim Demaille <akim@epita.fr>
3857
3858 * configure.ac: Require 2.54.
3859 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
3860 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
3861 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
3862 Remove, provided by Autoconf macros.
3863
3864 2002-09-12 Akim Demaille <akim@epita.fr>
3865
3866 * m4/prereq.m4: Update, from Coreutils 4.5.1.
3867
3868 2002-09-12 Akim Demaille <akim@epita.fr>
3869
3870 * m4/prereq.m4: Update, from Fileutils 4.1.5.
3871 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
3872 Reported by Martin Mokrejs.
3873
3874 2002-09-10 Akim Demaille <akim@epita.fr>
3875
3876 * src/parse-gram.y: Associate a human readable string to each
3877 token type.
3878 * tests/regression.at (Invalid inputs): Adjust.
3879
3880 2002-09-10 Gary V. Vaughan <gary@gnu.org>
3881
3882 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
3883 with an Autoconf-2.5x style configure.ac.
3884
3885 2002-09-06 Paul Eggert <eggert@twinsun.com>
3886
3887 * doc/bison.texinfo (Conditions): Make explicit that the GPL
3888 exception applies only to yacc.c. This is a modification of a
3889 patch originally suggested by Akim Demaille.
3890
3891 2002-09-06 Akim Demaille <akim@epita.fr>
3892
3893 * data/c.m4 (b4_copyright): Move the GPL exception comment from
3894 here to...
3895 * data/yacc.c: here.
3896
3897 * data/lalr1.cc (struct yyltype): Don't define it, since we use
3898 LocationType.
3899 (b4_ltype): Default to yy::Location from location.hh.
3900
3901 2002-09-04 Jim Meyering <jim@meyering.net>
3902
3903 * data/yacc.c: Guard the declaration of yytoknum also with
3904 `#ifdef YYPRINT', so it is declared only when used.
3905
3906 2002-09-04 Akim Demaille <akim@epita.fr>
3907
3908 * configure.in: Rename as...
3909 * configure.ac: this.
3910 Bump to 1.49c.
3911
3912 2002-09-04 Akim Demaille <akim@epita.fr>
3913
3914 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
3915 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
3916 translate maintainer only messages.
3917
3918 2002-08-12 Paul Eggert <eggert@twinsun.com>
3919
3920 Version 1.49b.
3921
3922 * Makefile.am (SUBDIRS): Remove intl.
3923 (DISTCLEANFILES): Remove.
3924 * NEWS: Mention that GNU M4 is now required. Clarify what is
3925 meant by "larger grammars". Mention the pt_BR translation.
3926 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
3927 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
3928 Bump version from 0.11.2 to 0.11.5.
3929 (BISON_PREREQ_STAGE): Remove.
3930 (AM_GNU_GETTEXT): Use external gettext.
3931 (AC_OUTPUT): Remove intl/Makefile.
3932
3933 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
3934
3935 * data/glr.c: Include string.h, for strlen.
3936 (yyreportParseError): Use size_t for yysize.
3937 (yy_yypstack): No longer nested inside yypstates, as nested
3938 functions are not portable. Do not assume size_t is the
3939 same width as int.
3940 (yypstates): Do not assume that ptrdiff_t is the same width
3941 as int, and similarly for yyposn and YYINDEX.
3942
3943 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
3944
3945 * lib/Makefile.am (INCLUDES): Do not include from the intl
3946 directory, which has been removed.
3947 * src/Makefile.am (INCLUDES): Likewise.
3948
3949 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
3950 (bitsets_sources, additional_bitsets_sources, timevars_sources):
3951 New vars.
3952
3953 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
3954 * tests/Makefile.am (EXTRA_DIST): Likewise.
3955
3956 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
3957 Do not assume that bitset_windex is the same width as unsigned.
3958
3959 * lib/abitset.c (abitset_unused_clear): Do not assume that
3960 bitset_word is the same width as int.
3961 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
3962 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
3963 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
3964 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
3965 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
3966
3967 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
3968 portability to one's complement hosts!).
3969 * lib/ebitset.c (ebitset_op1): Likewise.
3970 * lib/lbitset.c (lbitset_op1): Likewise.
3971
3972 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
3973 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
3974 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
3975 Sync with fileutils.
3976 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
3977 lib/gettext.h: Sync with diffutils.
3978
3979 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
3980 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
3981
3982 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
3983 PROTOTYPES to check for prototypes, and "defined __STDC__" to
3984 check for void *.
3985
3986 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
3987 size_t; the old version tried to do this but casted improperly.
3988 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
3989 (bitset_test): Now returns int, not unsigned long.
3990
3991 * lib/bitset_stats.c: Include "gettext.h".
3992 (_): New macro.
3993 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
3994 name locals "index", as it generates unnecessary warnings on some
3995 hosts that have an "index" function.
3996
3997 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
3998 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
3999 they need translation.
4000 * src/LR0.c (state_list_append, new_itemsets, get_state,
4001 append_states, generate_states): Likewise.
4002 * src/assoc.c (assoc_to_string): Likewise.
4003 * src/closure.c (print_closure, set_firsts, closure): Likewise.
4004 * src/gram.c (grammar_dump): Likewise.
4005 * src/injections.c (injections_compute): Likewise.
4006 * src/lalr.c (lookaheads_print): Likewise.
4007 * src/relation.c (relation_transpose): Likewise.
4008 * src/scan-gram.l: Likewise.
4009 * src/tables.c (table_grow, pack_vector): Likewise.
4010
4011 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
4012 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
4013 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
4014 * m4/mbstate_t.m4: Sync with fileutils.
4015 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
4016
4017 * po/LINGUAS: Add pt_BR.
4018 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
4019 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
4020 lib/timevar.c.
4021 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
4022 manual recommends.
4023 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
4024
4025 * src/complain.c (strerror_r): Remove decl; not needed.
4026 (strerror): Use same pattern as ../lib/error.c.
4027
4028 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
4029
4030 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
4031
4032 * src/main.c (main): Cast result of bindtextdomain and textdomain
4033 to void, to avoid a GCC warning when --disable-nls is in effect.
4034
4035 * src/scan-gram.l: Use strings rather than escapes when possible,
4036 to minimize the number of warnings from xgettext.
4037 (handle_action_dollar, handle_action_at): Don't use isdigit,
4038 as it mishandles negative chars and it may not work as expected
4039 outside the C locale.
4040
4041 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
4042 this is a GCC extension and is not portable to other compilers.
4043
4044 * src/system.h (alloca): Use same pattern as ../lib/error.c.
4045 Do not include <ctype.h>; no longer needed.
4046 Do not include <malloc.h>; no longer needed (and generates
4047 warnings on OpenBSD 3.0).
4048
4049 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
4050 it's not portable.
4051
4052 * tests/regression.at: Do not use 'cc -c input.c -o input';
4053 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
4054
4055 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
4056 exit status as failure, not just exit status 1. Sun C exits
4057 with status 2 sometimes.
4058
4059 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
4060 Use it for the two large tests.
4061
4062 2002-08-02 Akim Demaille <akim@epita.fr>
4063
4064 * src/conflicts.c (conflicts_output): Don't output rules never
4065 reduced here, since anyway that computation doesn't work.
4066 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
4067 (rule_useless_p, rule_never_reduced_p): New.
4068 (grammar_rules_partial_print): Use a filter instead of a range.
4069 Display the title only if needed.
4070 (grammar_rules_print): Adjust.
4071 (grammar_rules_never_reduced_report): New.
4072 * src/tables.c (action_row): Move the computation of rules never
4073 reduced to...
4074 (token_actions): here.
4075 * src/main.c (main): Make the parser before making the report, so
4076 that rules never reduced are computed.
4077 Call grammar_rules_never_reduced_report.
4078 * src/print.c (print_results): Report rules never reduced.
4079 * tests/conflicts.at, tests/reduce.at: Adjust.
4080
4081 2002-08-01 Akim Demaille <akim@epita.fr>
4082
4083 Instead of attaching lookaheads and duplicating the rules being
4084 reduced by a state, attach the lookaheads to the reductions.
4085
4086 * src/state.h (state_t): Remove the `lookaheads',
4087 `lookaheads_rule' member.
4088 (reductions_t): Add a `lookaheads' member.
4089 Use a regular array for the `rules'.
4090 * src/state.c (reductions_new): Initialize the lookaheads member
4091 to 0.
4092 (state_rule_lookaheads_print): Adjust.
4093 * src/state.h, src/state.c (state_reductions_find): New.
4094 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
4095 (count_rr_conflicts): Adjust.
4096 * src/lalr.c (LArule): Remove.
4097 (add_lookback_edge): Adjust.
4098 (state_lookaheads_count): New.
4099 (states_lookaheads_initialize): Merge into...
4100 (initialize_LA): this.
4101 (lalr_free): Adjust.
4102 * src/main.c (main): Don't free nullable and derives too early: it
4103 is used by --verbose.
4104 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
4105
4106 2002-08-01 Akim Demaille <akim@epita.fr>
4107
4108 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
4109 `rule_number_t**'.
4110 (set_derives, free_derives): Rename as...
4111 (derives_compute, derives_free): this.
4112 Adjust all dependencies.
4113 * src/nullable.c (set_nullable, free_nullable): Rename as...
4114 (nullable_compute, nullable_free): these.
4115 (rule_list_t): Store rule_t *, not rule_number_t.
4116 * src/state.c (state_rule_lookaheads_print): Directly compare rule
4117 pointers, instead of their numbers.
4118 * src/main.c (main): Call nullable_free, and derives_free earlier,
4119 as they were lo longer used.
4120
4121 2002-08-01 Akim Demaille <akim@epita.fr>
4122
4123 * lib/timevar.c (get_time): Include children time.
4124 * src/lalr.h (LA, LArule): Don't export them: used with the
4125 state_t.
4126 * src/lalr.c (LA, LArule): Static.
4127 * src/lalr.h, src/lalr.c (lalr_free): New.
4128 * src/main.c (main): Call it.
4129 * src/tables.c (pack_vector): Check whether loc is >= to the
4130 table_size, not >.
4131 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
4132 (tables_generate): do it, since that's also it which allocates
4133 them.
4134 Don't free LA and LArule, main does.
4135
4136 2002-07-31 Akim Demaille <akim@epita.fr>
4137
4138 Separate parser tables computation and output.
4139
4140 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
4141 (conflict_list, conflict_list_cnt, table, check, table_ninf)
4142 (yydefgoto, yydefact, high): Move to...
4143 * src/tables.h, src/tables.c: here.
4144 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
4145 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
4146 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
4147 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
4148 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
4149 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
4150 (action_row, save_row, token_actions, save_column, default_goto)
4151 (goto_actions, sort_actions, matching_state, pack_vector)
4152 (table_ninf_remap, pack_table, prepare_actions): Move to...
4153 * src/tables.c: here.
4154 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
4155 * src/output.c (token_actions, output_base, output_conflicts)
4156 (output_check): Merge into...
4157 (prepare_actions): this.
4158 (actions_output): Rename as...
4159 (user_actions_output): this.
4160 * src/main.c (main): Call tables_generate and tables_free.
4161
4162 2002-07-31 Akim Demaille <akim@epita.fr>
4163
4164 Steal GCC's --time-report support.
4165
4166 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
4167 stolen/adjusted from GCC.
4168 * m4/stage.m4: Remove time related checks.
4169 * m4/timevar.m4: New.
4170 * configure.in: Adjust.
4171 * src/system.h: Adjust to using timevar.h.
4172 * src/getargs.h, src/getargs.c: Support trace_time for
4173 --trace=time.
4174 * src/main.c (stage): Remove.
4175 (main): Replace `stage' invocations with timevar calls.
4176 * src/output.c: Insert pertinent timevar calls.
4177
4178 2002-07-31 Akim Demaille <akim@epita.fr>
4179
4180 Let --trace have arguments.
4181
4182 * src/getargs.h (enum trace_e): New.
4183 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
4184 (long_options, short_options): --trace/-T takes an optional
4185 argument.
4186 Change all the uses of trace_flag to reflect the new flags.
4187 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
4188
4189 Strengthen `stage' portability.
4190
4191 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
4192 * configure.in: Use it.
4193 Don't check for malloc.h and sys/times.h.
4194 * src/system.h: Include them when appropriate.
4195 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
4196 times and struct tms are available.
4197
4198 2002-07-30 Akim Demaille <akim@epita.fr>
4199
4200 In verbose parse error message, don't report `error' as an
4201 expected token.
4202 * tests/actions.at (Printers and Destructors): Adjust.
4203 * tests/calc.at (Calculator $1): Adjust.
4204 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
4205 error message, do not report the parser accepts the error token in
4206 that state.
4207
4208 2002-07-30 Akim Demaille <akim@epita.fr>
4209
4210 Normalize conflict related messages.
4211
4212 * src/complain.h, src/complain.c (warn, complain): New.
4213 * src/conflicts.c (conflicts_print): Use them.
4214 (conflict_report_yacc): New, extracted from...
4215 (conflicts_print): here.
4216 * tests/conflicts.at, tests/existing.at: Adjust.
4217
4218 2002-07-30 Akim Demaille <akim@epita.fr>
4219
4220 Report rules which are never reduced by the parser: those hidden
4221 by conflicts.
4222
4223 * src/LR0.c (save_reductions): Don't make the final state too
4224 different: save its reduction (accept) instead of having a state
4225 without any action (no shift or goto, no reduce).
4226 Note: the final state is now a ``regular'' state, i.e., the
4227 parsers now contain `reduce 0' as default reduction.
4228 Nevertheless, since they decide to `accept' when yystate =
4229 final_state, they still will not reduce rule 0.
4230 * src/print.c (print_actions, print_reduction): Adjust.
4231 * src/output.c (action_row): Track reduced rules.
4232 (token_actions): Report rules never reduced.
4233 * tests/conflicts.at, tests/regression.at: Adjust.
4234
4235 2002-07-30 Akim Demaille <akim@epita.fr>
4236
4237 `stage' was accidently included in a previous patch.
4238 Initiate its autoconfiscation.
4239
4240 * configure.in: Look for malloc.h and sys/times.h.
4241 * src/main.c (stage): Adjust.
4242 Report only when trace_flag.
4243
4244 2002-07-29 Akim Demaille <akim@epita.fr>
4245
4246 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
4247 state_number_t.
4248 (errs_t): symbol_t*, not symbol_number_t.
4249 (reductions_t): rule_t*, not rule_number_t.
4250 (FOR_EACH_SHIFT): New.
4251 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
4252 * src/print.c, src/print_graph.c: Adjust.
4253
4254 2002-07-29 Akim Demaille <akim@epita.fr>
4255
4256 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
4257
4258 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
4259 (endtoken, accept): these.
4260 * src/reader.c (reader): Set endtoken's default tag to "$end".
4261 Set undeftoken's tag to "$undefined" instead of "$undefined.".
4262 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
4263 Adjust.
4264
4265 2002-07-29 Akim Demaille <akim@epita.fr>
4266
4267 * src/reduce.c (reduce_grammar): When the language is empty,
4268 complain about the start symbol, not the axiom.
4269 Use its location.
4270 * tests/reduce.at (Empty Language): New.
4271
4272 2002-07-26 Akim Demaille <akim@epita.fr>
4273
4274 * src/reader.h, src/reader.c (gram_error): ... can't get
4275 yycontrol without making too strong assumptions on the parser
4276 itself.
4277 * src/output.c (prepare_tokens): Use the real 0th value of
4278 token_translations instead of `0'.
4279 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
4280 visible here.
4281 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
4282 for the time being: %locations ought to provide it to yyerror.
4283
4284 2002-07-25 Akim Demaille <akim@epita.fr>
4285
4286 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
4287 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
4288 * tests/regression.at (Web2c Actions): Adjust.
4289
4290 2002-07-25 Akim Demaille <akim@epita.fr>
4291
4292 Stop storing rules from 1 to nrules + 1.
4293
4294 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
4295 * src/nullable.c, src/output.c, src/print.c, src/reader.c
4296 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
4297 Iterate from 0 to nrules.
4298 Use rule_number_as_item_number and item_number_as_rule_number.
4299 Adjust to `derive' now containing possibly 0.
4300 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
4301 Handle the `- 1' part in rule numbers from/to item numbers.
4302 * src/conflicts.c (log_resolution): Fix the message which reversed
4303 shift and reduce.
4304 * src/output.c (action_row): Initialize default_rule to -1.
4305 (token_actions): Adjust.
4306 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
4307 expected output.
4308 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
4309
4310 2002-07-25 Akim Demaille <akim@epita.fr>
4311
4312 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
4313 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
4314 (b4_c_knr_arg_decl): New.
4315 * data/yacc.c: Use it to define yysymprint, yydestruct, and
4316 yyreport_parse_error.
4317
4318 2002-07-25 Akim Demaille <akim@epita.fr>
4319
4320 * data/yacc.c (yyreport_parse_error): New, extracted from...
4321 (yyparse): here.
4322 (yydestruct, yysymprint): Move above yyparse.
4323 Be K&R compliant.
4324
4325 2002-07-25 Akim Demaille <akim@epita.fr>
4326
4327 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
4328 replace...
4329 (b4_sint_type, b4_uint_type): these.
4330 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
4331 * tests/regression.at (Web2c Actions): Adjust.
4332
4333 2002-07-25 Akim Demaille <akim@epita.fr>
4334
4335 * src/gram.h (TIEM_NUMBER_MAX): New.
4336 (item_number_of_rule_number, rule_number_of_item_number): Rename
4337 as...
4338 (rule_number_as_item_number, item_number_as_rule_number): these.
4339 Adjust dependencies.
4340 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
4341 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
4342 (symbol_number_to_vector_number): New.
4343 (order): Of vector_number_t* type.
4344 (base_t, BASE_MAX, BASE_MIN): New.
4345 (froms, tos, width, pos, check): Of base_t type.
4346 (action_number_t, ACTION_MIN, ACTION_MAX): New.
4347 (actrow): Of action_number_t type.
4348 (conflrow): Of unsigned int type.
4349 (table_ninf, base_ninf): New.
4350 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
4351 (muscle_insert_int_table, muscle_insert_base_table)
4352 (muscle_insert_rule_number_table): New.
4353 (prepare_tokens): Output `toknum' as int_table.
4354 (action_row): Returns a rule_number_t.
4355 Use ACTION_MIN, not SHRT_MIN.
4356 (token_actions): yydefact is rule_number_t*.
4357 (table_ninf_remap): New.
4358 (pack_table): Use it for `base' and `table'.
4359 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
4360 replaced with...
4361 (YYPACT_NINF, YYTABLE_NINF): these.
4362 (yypact, yytable): Compute their types instead of hard-coded
4363 `short'.
4364 * tests/regression.at (Web2c Actions): Adjust.
4365
4366 2002-07-19 Akim Demaille <akim@epita.fr>
4367
4368 * src/scan-gram.l (id): Can start with an underscore.
4369
4370 2002-07-16 Akim Demaille <akim@epita.fr>
4371
4372 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
4373 Adjust all former `associativity' dependencies.
4374 * src/symtab.c (symbol_new): Default associativity is `undef', not
4375 `right'.
4376 (symbol_check_alias_consistence): Adjust.
4377
4378 2002-07-09 Akim Demaille <akim@epita.fr>
4379
4380 * doc/bison.texinfo: Properly set the ``header'' part.
4381 Use @dircategory ``GNU programming tools'' as per Texinfo's
4382 documentation.
4383 Use @copying.
4384
4385 2002-07-09 Akim Demaille <akim@epita.fr>
4386
4387 * lib/quotearg.h: Protect against multiple inclusions.
4388 * src/location.h (location_t): Add a `file' member.
4389 (LOCATION_RESET, LOCATION_PRINT): Adjust.
4390 * src/complain.c (warn_at, complain_at, fatal_at): Drop
4391 `error_one_per_line' support.
4392
4393 2002-07-09 Akim Demaille <akim@epita.fr>
4394
4395 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
4396 * src/reader.c (lineno): Remove.
4397 Adjust all dependencies.
4398 (get_merge_function): Take a location and use complain_at.
4399 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
4400 * tests/regression.at (Invalid inputs, Mixing %token styles):
4401 Adjust.
4402
4403 2002-07-09 Akim Demaille <akim@epita.fr>
4404
4405 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
4406 recovery rule, and forbid extensions when --yacc.
4407 (gram_error): Use complain_at.
4408 * src/reader.c (reader): Exit if there were parse errors.
4409
4410 2002-07-09 Akim Demaille <akim@epita.fr>
4411
4412 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
4413 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
4414 Reported by R Blake <blakers@mac.com>.
4415
4416 2002-07-09 Akim Demaille <akim@epita.fr>
4417
4418 * data/yacc.c: Output the copyright notive in the header.
4419
4420 2002-07-03 Akim Demaille <akim@epita.fr>
4421
4422 * src/output.c (froms, tos): Are state_number_t.
4423 (save_column): sp, sp1, and sp2 are state_number_t.
4424 (prepare): Rename `final' as `final_state_number', `nnts' as
4425 `nterms_number', `nrules' as `rules_number', `nstates' as
4426 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
4427 unused.
4428 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
4429 * data/lalr1.cc (nsym_): Remove, unused.
4430
4431 2002-07-03 Akim Demaille <akim@epita.fr>
4432
4433 * src/lalr.h, src/lalr.c (goto_number_t): New.
4434 * src/lalr.c (goto_list_t): New.
4435 Propagate them.
4436 * src/nullable.c (rule_list_t): New.
4437 Propagate.
4438 * src/types.h: Remove.
4439
4440 2002-07-03 Akim Demaille <akim@epita.fr>
4441
4442 * src/closure.c (print_fderives): Use rule_rhs_print.
4443 * src/derives.c (print_derives): Use rule_rhs_print.
4444 (rule_list_t): New, replaces `shorts'.
4445 (set_derives): Add comments.
4446 * tests/sets.at (Nullable, Firsts): Adjust.
4447
4448 2002-07-03 Akim Demaille <akim@epita.fr>
4449
4450 * src/output.c (prepare_actions): Free `tally' and `width'.
4451 (prepare_actions): Allocate and free `order'.
4452 * src/symtab.c (symbols_free): Free `symbols'.
4453 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
4454 * src/output.c (m4_invoke): Move to...
4455 * src/scan-skel.l: here.
4456 (<<EOF>>): Close yyout, and free its name.
4457
4458 2002-07-03 Akim Demaille <akim@epita.fr>
4459
4460 Fix some memory leaks, and fix a bug: state 0 was examined twice.
4461
4462 * src/LR0.c (new_state): Merge into...
4463 (state_list_append): this.
4464 (new_states): Merge into...
4465 (generate_states): here.
4466 (set_states): Don't ensure a proper `errs' state member here, do it...
4467 * src/conflicts.c (conflicts_solve): here.
4468 * src/state.h, src/state.c: Comment changes.
4469 (state_t): Rename member `shifts' as `transitions'.
4470 Adjust all dependencies.
4471 (errs_new): For consistency, also take the values as argument.
4472 (errs_dup): Remove.
4473 (state_errs_set): New.
4474 (state_reductions_set, state_transitions_set): Assert that no
4475 previous value was assigned.
4476 (state_free): New.
4477 (states_free): Use it.
4478 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
4479 temporary storage: use `errs' and `nerrs' as elsewhere.
4480 (set_conflicts): Allocate and free this `errs'.
4481
4482 2002-07-02 Akim Demaille <akim@epita.fr>
4483
4484 * lib/libiberty.h: New.
4485 * lib: Update the bitset implementation from upstream.
4486 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
4487 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
4488 * src/main.c: Adjust bitset stats calls.
4489
4490 2002-07-01 Paul Eggert <eggert@twinsun.com>
4491
4492 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
4493 char, so that negative chars don't collide with $.
4494
4495 2002-06-30 Akim Demaille <akim@epita.fr>
4496
4497 Have the GLR tests be `warning' checked, and fix the warnings.
4498
4499 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
4500 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
4501 (yyremoveDeletes): `yyi' and `yyj' are size_t.
4502 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
4503 (yyaddDeferredAction): static.
4504 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
4505 (yyreportParseError): yyprefix is const.
4506 yytokenp is used only when verbose.
4507 (yy__GNUC__): Replace with __GNUC__.
4508 (yypdumpstack): yyi is size_t.
4509 (yypreference): Un-yy local variables and arguments, to avoid
4510 clashes with `yyr1'. Anyway, we are not in the user name space.
4511 (yytname_size): be an int, as is compared with ints.
4512 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
4513 Use them.
4514 * tests/cxx-gram.at: Use quotation to protect $1.
4515 Use AT_COMPILE to enable warnings hunts.
4516 Prototype yylex and yyerror.
4517 `Use' argc.
4518 Include `string.h', not `strings.h'.
4519 Produce and prototype stmtMerge only when used.
4520 yylex takes a location.
4521
4522 2002-06-30 Akim Demaille <akim@epita.fr>
4523
4524 We spend a lot of time in quotearg, in particular when --verbose.
4525
4526 * src/symtab.c (symbol_get): Store a quoted version of the key.
4527 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
4528 Adjust all callers.
4529
4530 2002-06-30 Akim Demaille <akim@epita.fr>
4531
4532 * src/state.h (reductions_t): Rename member `nreds' as num.
4533 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
4534 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
4535
4536 2002-06-30 Akim Demaille <akim@epita.fr>
4537
4538 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
4539 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
4540 (shifts_to): Rename as...
4541 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
4542 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
4543 (TRANSITION_IS_DISABLED, transitions_to): these.
4544
4545 2002-06-30 Akim Demaille <akim@epita.fr>
4546
4547 * src/print.c (print_shifts, print_gotos): Merge into...
4548 (print_transitions): this.
4549 (print_transitions, print_errs, print_reductions): Align the
4550 lookaheads columns.
4551 (print_core, print_transitions, print_errs, print_state,
4552 print_grammar): Output empty lines separator before, not after.
4553 (state_default_rule_compute): Rename as...
4554 (state_default_rule): this.
4555 * tests/conflicts.at (Defaulted Conflicted Reduction),
4556 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
4557 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
4558
4559 2002-06-30 Akim Demaille <akim@epita.fr>
4560
4561 Display items as we display rules.
4562
4563 * src/gram.h, src/gram.c (rule_lhs_print): New.
4564 * src/gram.c (grammar_rules_partial_print): Use it.
4565 * src/print.c (print_core): Likewise.
4566 * tests/conflicts.at (Defaulted Conflicted Reduction),
4567 (Unresolved SR Conflicts): Adjust.
4568 (Unresolved SR Conflicts): Adjust and rename as...
4569 (Resolved SR Conflicts): this, as was meant.
4570 * tests/regression.at (Web2c Report): Adjust.
4571
4572 2002-06-30 Akim Demaille <akim@epita.fr>
4573
4574 * src/print.c (state_default_rule_compute): New, extracted from...
4575 (print_reductions): here.
4576 Pessimize, but clarify the code.
4577 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
4578
4579 2002-06-30 Akim Demaille <akim@epita.fr>
4580
4581 * src/output.c (action_row): Let default_rule be always a rule
4582 number.
4583
4584 2002-06-30 Akim Demaille <akim@epita.fr>
4585
4586 * src/closure.c (print_firsts, print_fderives, closure):
4587 Use BITSET_EXECUTE.
4588 * src/lalr.c (lookaheads_print): Likewise.
4589 * src/state.c (state_rule_lookaheads_print): Likewise.
4590 * src/print_graph.c (print_core): Likewise.
4591 * src/print.c (print_reductions): Likewise.
4592 * src/output.c (action_row): Likewise.
4593 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
4594
4595 2002-06-30 Akim Demaille <akim@epita.fr>
4596
4597 * src/print_graph.c: Use report_flag.
4598
4599 2002-06-30 Akim Demaille <akim@epita.fr>
4600
4601 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
4602 to...
4603 * src/relation.h, src/relation.c (traverse, relation_digraph)
4604 (relation_print, relation_transpose): New.
4605
4606 2002-06-30 Akim Demaille <akim@epita.fr>
4607
4608 * src/state.h, src/state.c (shifts_to): New.
4609 * src/lalr.c (build_relations): Use it.
4610
4611 2002-06-30 Akim Demaille <akim@epita.fr>
4612
4613 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
4614 (item_number_of_rule_number, rule_number_of_item_number): New.
4615 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
4616 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
4617 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
4618 Propagate their use.
4619 Much remains to be done, in particular wrt `shorts' from types.h.
4620
4621 2002-06-30 Akim Demaille <akim@epita.fr>
4622
4623 * src/symtab.c (symbol_new): Initialize the `printer' member.
4624
4625 2002-06-30 Akim Demaille <akim@epita.fr>
4626
4627 * src/LR0.c (save_reductions): Remove, replaced by...
4628 * src/state.h, src/state.c (state_reductions_set): New.
4629 (reductions, errs): Rename as...
4630 (reductions_t, errs_t): these.
4631 Adjust all dependencies.
4632
4633 2002-06-30 Akim Demaille <akim@epita.fr>
4634
4635 * src/LR0.c (state_list_t, state_list_append): New.
4636 (first_state, last_state): Now symbol_list_t.
4637 (this_state): Remove.
4638 (new_itemsets, append_states, save_reductions): Take a state_t as
4639 argument.
4640 (set_states, generate_states): Adjust.
4641 (save_shifts): Remove, replaced by...
4642 * src/state.h, src/state.c (state_shifts_set): New.
4643 (shifts): Rename as...
4644 (shifts_t): this.
4645 Adjust all dependencies.
4646 * src/state.h (state_t): Remove the `next' member.
4647
4648 2002-06-30 Akim Demaille <akim@epita.fr>
4649
4650 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
4651 escaped in slot 0.
4652
4653 2002-06-30 Akim Demaille <akim@epita.fr>
4654
4655 Use hash.h for the state hash table.
4656
4657 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
4658 (allocate_storage): Use state_hash_new.
4659 (free_storage): Use state_hash_free.
4660 (new_state, get_state): Adjust.
4661 * src/lalr.h, src/lalr.c (states): Move to...
4662 * src/states.h (state_t): Remove the `link' member, no longer
4663 used.
4664 * src/states.h, src/states.c: here.
4665 (state_hash_new, state_hash_free, state_hash_lookup)
4666 (state_hash_insert, states_free): New.
4667 * src/states.c (state_table, state_compare, state_hash): New.
4668 * src/output.c (output_actions): Do not free states now, since we
4669 still need to know the final_state number in `prepare', called
4670 afterwards. Do it...
4671 * src/main.c (main): here: call states_free after `output'.
4672
4673 2002-06-30 Akim Demaille <akim@epita.fr>
4674
4675 * src/state.h, src/state.c (state_new): New, extracted from...
4676 * src/LR0.c (new_state): here.
4677 * src/state.h (STATE_ALLOC): Move to...
4678 * src/state.c: here.
4679 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
4680 * src/state.h, src/state.c: here.
4681
4682 2002-06-30 Akim Demaille <akim@epita.fr>
4683
4684 * src/reader.c (gensym): Rename as...
4685 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
4686 (getsym): Rename as...
4687 (symbol_get): this.
4688
4689 2002-06-30 Akim Demaille <akim@epita.fr>
4690
4691 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
4692 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
4693 * src/output.c, src/print.c, src/print_graph.c: Propagate.
4694 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
4695
4696 2002-06-30 Akim Demaille <akim@epita.fr>
4697
4698 Make the test suite pass with warnings checked.
4699
4700 * tests/actions.at (Printers and Destructors): Improve.
4701 Avoid unsigned vs. signed issues.
4702 * tests/calc.at: Don't exercise the scanner here, do it...
4703 * tests/input.at (Torturing the Scanner): here.
4704
4705 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4706
4707 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
4708 reorganize first lines parallel to yacc.c.
4709
4710 2002-06-28 Akim Demaille <akim@epita.fr>
4711
4712 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
4713 (b4_token_enum, b4_token_defines): New, factored from...
4714 * data/lalr1.cc, data/yacc.c, glr.c: here.
4715
4716 2002-06-28 Akim Demaille <akim@epita.fr>
4717
4718 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
4719 unused variables.
4720 * src/output.c (merger_output): static.
4721
4722 2002-06-28 Akim Demaille <akim@epita.fr>
4723
4724 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
4725 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
4726 pacify GCC.
4727 * src/output.c (save_row): Initialize all the variables to pacify GCC.
4728
4729 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4730
4731 Accumulated changelog for new GLR parsing features.
4732
4733 * src/conflicts.c (count_total_conflicts): Change name to
4734 conflicts_total_count.
4735 * src/conflicts.h: Ditto.
4736 * src/output.c (token_actions): Use the new name.
4737 (output_conflicts): Change conflp => conflict_list_heads, and
4738 confl => conflict_list for better readability.
4739 * data/glr.c: Use the new names.
4740 * NEWS: Add self to GLR announcement.
4741
4742 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
4743
4744 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
4745 Akim Demaille.
4746
4747 * data/bison.glr: Change name to glr.c
4748 * data/glr.c: Renamed from bison.glr.
4749 * data/Makefile.am: Add glr.c
4750
4751 * src/getargs.c:
4752
4753 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
4754 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
4755
4756 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4757
4758 * data/bison.glr: Be sure to restore the
4759 current #line when returning to the skeleton contents after having
4760 exposed the input file's #line.
4761
4762 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4763
4764 * data/bison.glr: Bring up to date with changes to bison.simple.
4765
4766 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4767
4768 * data/bison.glr: Correct definitions that use b4_prefix.
4769 Various reformatting.
4770 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
4771 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
4772 yytokenp argument; now part of stack.
4773 (yychar): Define to behave as documented.
4774 (yyclearin): Ditto.
4775
4776 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4777
4778 * src/reader.h: Add declaration for free_merger_functions.
4779
4780 * src/reader.c (merge_functions): New variable.
4781 (get_merge_function): New function.
4782 (free_merger_functions): New function.
4783 (readgram): Check for %prec that is not followed by a symbol.
4784 Handle %dprec and %merge declarations.
4785 (packgram): Initialize dprec and merger fields in rules array.
4786
4787 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
4788 conflict_list_cnt, conflict_list_free): New variables.
4789 (table_grow): Also grow conflict_table.
4790 (prepare_rules): Output dprec and merger tables.
4791 (conflict_row): New function.
4792 (action_row): Output conflict lists for GLR parser. Don't use
4793 default reduction in conflicted states for GLR parser so that there
4794 are spaces for the conflict lists.
4795 (save_row): Also save conflict information.
4796 (token_actions): Allocate conflict list.
4797 (merger_output): New function.
4798 (pack_vector): Pack conflict table, too.
4799 (output_conflicts): New function to output yyconflp and yyconfl.
4800 (output_check): Allocate conflict_tos.
4801 (output_actions): Output conflict tables, also.
4802 (output_skeleton): Output b4_mergers definition.
4803 (prepare): Output b4_max_rhs_length definition.
4804 Use 'bison.glr' as default skeleton for GLR parsers.
4805
4806 * src/gram.c (glr_parser): New flag.
4807 (grammar_free): Call free_merger_functions.
4808
4809 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
4810 all pairs of conflicting reductions, rather than just all tokens
4811 causing conflicts. Needed to size conflict tables.
4812 (conflicts_output): Modify call to count_rr_conflicts for new
4813 interface.
4814 (conflicts_print): Ditto.
4815 (count_total_conflicts): New function.
4816
4817 * src/reader.h (merger_list): New type.
4818 (merge_functions): New variable.
4819
4820 * src/lex.h (tok_dprec, tok_merge): New token types.
4821
4822 * src/gram.h (rule_s): Add dprec and merger fields.
4823 (glr_parser): New flag.
4824
4825 * src/conflicts.h (count_total_conflicts): New function.
4826
4827 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
4828
4829 * doc/bison.texinfo (Generalized LR Parsing): New section.
4830 (GLR Parsers): New section.
4831 (Language and Grammar): Mention GLR parsing.
4832 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
4833 Correct typo ("tge" -> "the").
4834
4835 * data/bison.glr: New skeleton for GLR parsing.
4836
4837 * tests/cxx-gram.at: New tests for GLR parsing.
4838
4839 * tests/testsuite.at: Include cxx-gram.at.
4840
4841 * tests/Makefile.am: Add cxx-gram.at.
4842
4843 * src/parse-gram.y:
4844
4845 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
4846
4847 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
4848
4849 2002-06-27 Akim Demaille <akim@epita.fr>
4850
4851 * src/options.h, src/options.c: Remove.
4852 * src/getargs.c (short_options, long_options): New.
4853
4854 2002-06-27 Akim Demaille <akim@epita.fr>
4855
4856 * data/bison.simple, data/bison.c++: Rename as...
4857 * data/yacc.c, data/lalr1.cc: these.
4858 * doc/bison.texinfo (Environment Variables): Remove.
4859
4860 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
4861
4862 * src/getargs.c (report_argmatch): Initialize strtok().
4863
4864 2002-06-20 Akim Demaille <akim@epita.fr>
4865
4866 * data/bison.simple (b4_symbol_actions): New, replaces...
4867 (b4_symbol_destructor, b4_symbol_printer): these.
4868 (yysymprint): Be sure to call YYPRINT only for tokens, and using
4869 user token numbers.
4870
4871 2002-06-20 Akim Demaille <akim@epita.fr>
4872
4873 * data/bison.simple (yydestructor): Rename as...
4874 (yydestruct): this.
4875
4876 2002-06-20 Akim Demaille <akim@epita.fr>
4877
4878 * src/symtab.h, src/symtab.c (symbol_type_set)
4879 (symbol_destructor_set, symbol_precedence_set): The location is
4880 the last argument.
4881 Adjust all callers.
4882
4883 2002-06-20 Akim Demaille <akim@epita.fr>
4884
4885 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
4886 internals.
4887 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
4888 Takes a location.
4889 * src/symtab.h, src/symtab.c (symbol_class_set)
4890 (symbol_user_token_number_set): Likewise.
4891 Adjust all callers.
4892 Promote complain_at.
4893 * tests/input.at (Type Clashes): Adjust.
4894
4895 2002-06-20 Akim Demaille <akim@epita.fr>
4896
4897 * data/bison.simple (YYLEX): Fix the declaration when
4898 %pure-parser.
4899
4900 2002-06-20 Akim Demaille <akim@epita.fr>
4901
4902 * data/bison.simple (yysymprint): Don't print the token number,
4903 just its name.
4904 * tests/actions.at (Destructors): Rename as...
4905 (Printers and Destructors): this.
4906 Also exercise %printer.
4907
4908 2002-06-20 Akim Demaille <akim@epita.fr>
4909
4910 * data/bison.simple (YYDSYMPRINT): New.
4911 Use it to remove many of the #if YYDEBUG/if (yydebug).
4912
4913 2002-06-20 Akim Demaille <akim@epita.fr>
4914
4915 * src/symtab.h, src/symtab.c (symbol_t): printer and
4916 printer_location are new members.
4917 (symbol_printer_set): New.
4918 * src/parse-gram.y (PERCENT_PRINTER): New token.
4919 Handle its associated rule.
4920 * src/scan-gram.l: Adjust.
4921 (handle_destructor_at, handle_destructor_dollar): Rename as...
4922 (handle_symbol_code_at, handle_symbol_code_dollar): these.
4923 * src/output.c (symbol_printers_output): New.
4924 (output_skeleton): Call it.
4925 * data/bison.simple (yysymprint): New. Cannot be named yyprint
4926 since there are already many grammar files with a user `yyprint'.
4927 Replace the calls to YYPRINT to calls to yysymprint.
4928 * tests/calc.at: Adjust.
4929 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
4930 taking advantage of parser very internal details (stack size!).
4931
4932 2002-06-20 Akim Demaille <akim@epita.fr>
4933
4934 * src/scan-gram.l: Complete the scanner with the missing patterns
4935 to pacify Flex.
4936 Use `quote' and `symbol_tag_get' where appropriate.
4937
4938 2002-06-19 Akim Demaille <akim@epita.fr>
4939
4940 * tests/actions.at (Destructors): Augment to test locations.
4941 * data/bison.simple (yydestructor): Pass it the current location
4942 if locations are enabled.
4943 Prototype only when __STDC__ or C++.
4944 Change the argument names to move into the yy name space: there is
4945 user code here.
4946
4947 2002-06-19 Akim Demaille <akim@epita.fr>
4948
4949 * data/bison.simple (b4_pure_if): New.
4950 Use it instead of #ifdef YYPURE.
4951
4952 2002-06-19 Akim Demaille <akim@epita.fr>
4953
4954 * data/bison.simple (b4_location_if): New.
4955 Use it instead of #ifdef YYLSP_NEEDED.
4956
4957 2002-06-19 Akim Demaille <akim@epita.fr>
4958
4959 Prepare @$ in %destructor, but currently don't bind it in the
4960 skeleton, as %location use is not cleaned up yet.
4961
4962 * src/scan-gram.l (handle_dollar, handle_destructor_at)
4963 (handle_action_at): New.
4964 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
4965 a braced_code_t and a location as additional arguments.
4966 (handle_destructor_dollar): Instead of requiring `b4_eval', just
4967 unquote one when outputting `b4_dollar_dollar'.
4968 Adjust callers.
4969 * data/bison.simple (b4_eval): Remove.
4970 (b4_symbol_destructor): Adjust.
4971 * tests/input.at (Invalid @n): Adjust.
4972
4973 2002-06-19 Zack Weinberg <zack@codesourcery.com>
4974
4975 * doc/bison.texinfo: Document ability to have multiple
4976 prologue sections.
4977
4978 2002-06-18 Akim Demaille <akim@epita.fr>
4979
4980 * src/files.c (compute_base_names): When computing the output file
4981 names from the input file name, strip the directory part.
4982
4983 2002-06-18 Akim Demaille <akim@epita.fr>
4984
4985 * data/bison.simple.new: Comment changes.
4986 Reported by Andreas Schwab.
4987
4988 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
4989
4990 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
4991 there are no `label `yyoverflowlab' defined but not used' warnings
4992 when yyoverflow is defined.
4993
4994 2002-06-18 Akim Demaille <akim@epita.fr>
4995
4996 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
4997 new member.
4998 (symbol_destructor_set): Adjust.
4999 * src/output.c (symbol_destructors_output): Output the destructor
5000 locations.
5001 Output the symbol name.
5002 * data/bison.simple (b4_symbol_destructor): Adjust.
5003
5004 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
5005 and Akim Demaille <akim@epita.fr>
5006
5007 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
5008 what's left on the stack when the error recovery hits EOF.
5009 * tests/actions.at (Destructors): Complete to exercise this case.
5010
5011 2002-06-17 Akim Demaille <akim@epita.fr>
5012
5013 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
5014 arguments is really empty, not only equal to `[]'.
5015 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
5016 member.
5017 (symbol_destructor_set): New.
5018 * src/output.c (symbol_destructors_output): New.
5019 * src/reader.h (brace_code_t, current_braced_code): New.
5020 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
5021 (handle_dollar): Rename as...
5022 (handle_action_dollar): this.
5023 (handle_destructor_dollar): New.
5024 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
5025 (grammar_declaration): Use it.
5026 * data/bison.simple (yystos): Is always defined.
5027 (yydestructor): New.
5028 * tests/actions.at (Destructors): New.
5029 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
5030
5031 2002-06-17 Akim Demaille <akim@epita.fr>
5032
5033 * src/symlist.h, src/symlist.c (symbol_list_length): New.
5034 * src/scan-gram.l (handle_dollar, handle_at): Compute the
5035 rule_length only when needed.
5036 * src/output.c (actions_output, token_definitions_output): Output
5037 the full M4 block.
5038 * src/symtab.c: Don't access directly to the symbol tag, use
5039 symbol_tag_get.
5040 * src/parse-gram.y: Use symbol_list_free.
5041
5042 2002-06-17 Akim Demaille <akim@epita.fr>
5043
5044 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
5045 (symbol_list_prepend, get_type_name): Move to...
5046 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
5047 (symbol_list_prepend, symbol_list_n_type_name_get): here.
5048 Adjust all callers.
5049 (symbol_list_free): New.
5050 * src/scan-gram.l (handle_dollar): Takes a location.
5051 * tests/input.at (Invalid $n): Adjust.
5052
5053 2002-06-17 Akim Demaille <akim@epita.fr>
5054
5055 * src/reader.h, src/reader.c (symbol_list_new): Export it.
5056 (symbol_list_prepend): New.
5057 * src/parse-gram.y (%union): `list' is a new member.
5058 (symbols.1): New, replaces...
5059 (terms_to_prec.1, nterms_to_type.1): these.
5060 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
5061 Take a location as additional argument.
5062 Adjust all callers.
5063
5064 2002-06-15 Akim Demaille <akim@epita.fr>
5065
5066 * src/parse-gram.y: Move %token in the declaration section so that
5067 we don't depend upon CVS Bison.
5068
5069 2002-06-15 Akim Demaille <akim@epita.fr>
5070
5071 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
5072 * src/print.c (print_core): Use it.
5073
5074 2002-06-15 Akim Demaille <akim@epita.fr>
5075
5076 * src/conflicts.c (log_resolution): Accept the rule involved in
5077 the sr conflicts instead of the lookahead number that points to
5078 that rule.
5079 (flush_reduce): Accept the current lookahead vector as argument,
5080 instead of the index in LA.
5081 (resolve_sr_conflict): Accept the current number of lookahead
5082 bitset to consider for the STATE, instead of the index in LA.
5083 (set_conflicts): Adjust.
5084 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
5085
5086 2002-06-15 Akim Demaille <akim@epita.fr>
5087
5088 * src/state.h (state_t): Replace the `lookaheadsp' member, a
5089 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
5090 Adjust all dependencies.
5091 * src/lalr.c (initialize_lookaheads): Split into...
5092 (states_lookaheads_count, states_lookaheads_initialize): these.
5093 (lalr): Adjust.
5094
5095 2002-06-15 Akim Demaille <akim@epita.fr>
5096
5097 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
5098 out of...
5099 (grammar_rules_print): here.
5100 * src/reduce.c (reduce_output): Use it.
5101 * tests/reduce.at (Useless Rules, Reduced Automaton)
5102 (Underivable Rules): Adjust.
5103
5104 2002-06-15 Akim Demaille <akim@epita.fr>
5105
5106 Copy BYacc's nice way to report the grammar.
5107
5108 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
5109 New.
5110 Don't print the rules' location, it is confusing and useless.
5111 (rule_print): Use grammar_rhs_print.
5112 * src/print.c (print_grammar): Use grammar_rules_print.
5113
5114 2002-06-15 Akim Demaille <akim@epita.fr>
5115
5116 Complete and rationalize `useless thing' warnings.
5117
5118 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
5119 (symbol_tag_print): New.
5120 Use them everywhere in place of accessing directly the tag member.
5121 * src/gram.h, src/gram.c (rule_print): New.
5122 Use it where a rule used to be printed `by hand'.
5123 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
5124 (reduce_grammar_tables): Report the useless rules.
5125 (reduce_print): Useless things are a warning, not an error.
5126 Report it as such.
5127 * tests/reduce.at (Useless Nonterminals, Useless Rules):
5128 (Reduced Automaton, Underivable Rules): Adjust.
5129 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
5130 * tests/conflicts.at (Unresolved SR Conflicts)
5131 (Solved SR Conflicts): Adjust.
5132
5133 2002-06-15 Akim Demaille <akim@epita.fr>
5134
5135 Let symbols have a location.
5136
5137 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
5138 (getsym): Adjust.
5139 Adjust all callers.
5140 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
5141 Use location_t, not int.
5142 * src/symtab.c (symbol_check_defined): Take advantage of the
5143 location.
5144 * tests/regression.at (Invalid inputs): Adjust.
5145
5146 2002-06-15 Akim Demaille <akim@epita.fr>
5147
5148 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
5149 (input): Don't try to initialize yylloc here, do it in the
5150 scanner.
5151 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
5152 * src/gram.h (rule_t): Change line and action_line into location
5153 and action_location, of location_t type.
5154 Adjust all dependencies.
5155 * src/location.h, src/location.c (empty_location): New.
5156 * src/reader.h, src/reader.c (grammar_start_symbol_set)
5157 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
5158 (grammar_current_rule_symbol_append)
5159 (grammar_current_rule_action_append): Expect a location as argument.
5160 * src/reader.c (grammar_midrule_action): Adjust to attach an
5161 action's location as dummy symbol location.
5162 * src/symtab.h, src/symtab.c (startsymbol_location): New.
5163 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
5164 the line numbers.
5165
5166 2002-06-14 Akim Demaille <akim@epita.fr>
5167
5168 Grammar declarations may be found in the grammar section.
5169
5170 * src/parse-gram.y (rules_or_grammar_declaration): New.
5171 (declarations): Each declaration may end with a semicolon, not
5172 just...
5173 (grammar_declaration): `"%union"'.
5174 (grammar): Branch to rules_or_grammar_declaration.
5175
5176 2002-06-14 Akim Demaille <akim@epita.fr>
5177
5178 * src/main.c (main): Invoke scanner_free.
5179
5180 2002-06-14 Akim Demaille <akim@epita.fr>
5181
5182 * src/output.c (m4_invoke): Extracted from...
5183 (output_skeleton): here.
5184 Free tempfile.
5185
5186 2002-06-14 Akim Demaille <akim@epita.fr>
5187
5188 * src/parse-gram.y (directives, directive, gram)
5189 (grammar_directives, precedence_directives, precedence_directive):
5190 Rename as...
5191 (declarations, declaration, grammar, grammar_declaration)
5192 (precedence_declaration, precedence_declarator): these.
5193 (symbol_declaration): New.
5194
5195 2002-06-14 Akim Demaille <akim@epita.fr>
5196
5197 * src/files.c (action_obstack): Remove, unused.
5198 (output_obstack): Remove it, and all its dependencies, as it is no
5199 longer needed.
5200 * src/reader.c (epilogue_set): Build the epilogue in the
5201 muscle_obstack.
5202 * src/output.h, src/output.c (muscle_obstack): Move to...
5203 * src/muscle_tab.h, src/muscle_tab.h: here.
5204 (muscle_init): Initialize muscle_obstack.
5205 (muscle_free): New.
5206 * src/main.c (main): Call it.
5207
5208 2002-06-14 Akim Demaille <akim@epita.fr>
5209
5210 * src/location.h: New, extracted from...
5211 * src/reader.h: here.
5212 * src/Makefile.am (noinst_HEADERS): Merge into
5213 (bison_SOURCES): this.
5214 Add location.h.
5215 * src/parse-gram.y: Use location_t instead of Bison's.
5216 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
5217 Use location_t instead of ints.
5218
5219 2002-06-14 Akim Demaille <akim@epita.fr>
5220
5221 * data/bison.simple, data/bison.c++: Be sure to restore the
5222 current #line when returning to the skeleton contents after having
5223 exposed the input file's #line.
5224
5225 2002-06-12 Akim Demaille <akim@epita.fr>
5226
5227 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
5228 eager.
5229 * tests/actions.at (Exotic Dollars): New.
5230
5231 2002-06-12 Akim Demaille <akim@epita.fr>
5232
5233 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
5234 ['"/] too eagerly.
5235 * tests/input.at (Torturing the Scanner): New.
5236
5237 2002-06-11 Akim Demaille <akim@epita.fr>
5238
5239 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
5240 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
5241 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
5242 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
5243 * src/reader.c (reader): Use it.
5244
5245 2002-06-11 Akim Demaille <akim@epita.fr>
5246
5247 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
5248 Adjust all callers.
5249 (scanner_last_string_free): New.
5250
5251 2002-06-11 Akim Demaille <akim@epita.fr>
5252
5253 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
5254 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
5255 (last_string, YY_OBS_FREE): New.
5256 Use them when returning an ID.
5257
5258 2002-06-11 Akim Demaille <akim@epita.fr>
5259
5260 Have Bison grammars parsed by a Bison grammar.
5261
5262 * src/reader.c, src/reader.h (prologue_augment): New.
5263 * src/reader.c (copy_definition): Remove.
5264
5265 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
5266 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
5267 (grammar_current_rule_prec_set, grammar_current_rule_check)
5268 (grammar_current_rule_symbol_append)
5269 (grammar_current_rule_action_append): Export.
5270 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
5271 (symbol_list_action_append): Remove.
5272 Hook the routines from reader.
5273 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
5274 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
5275
5276 * src/reader.c (read_declarations): Remove, unused.
5277
5278 * src/parse-gram.y: Handle the epilogue.
5279 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
5280 (grammar_start_symbol_set): this.
5281 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
5282 * src/reader.c (readgram): Remove, unused.
5283 (reader): Adjust to insert eoftoken and axiom where appropriate.
5284
5285 * src/reader.c (copy_dollar): Replace with...
5286 * src/scan-gram.h (handle_dollar): this.
5287 * src/parse-gram.y: Remove `%thong'.
5288
5289 * src/reader.c (copy_at): Replace with...
5290 * src/scan-gram.h (handle_at): this.
5291
5292 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
5293 New.
5294
5295 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
5296 time being.
5297
5298 * src/reader.h, src/reader.c (grammar_rule_end): New.
5299
5300 * src/parse.y (current_type, current_class): New.
5301 Implement `%nterm', `%token' support.
5302 Merge `%term' into `%token'.
5303 (string_as_id): New.
5304 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
5305 type name.
5306
5307 * src/parse-gram.y: Be sure to handle properly the beginning of
5308 rules.
5309
5310 * src/parse-gram.y: Handle %type.
5311 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
5312
5313 * src/parse-gram.y: More directives support.
5314 * src/options.c: No longer handle source directives.
5315
5316 * src/parse-gram.y: Fix %output.
5317
5318 * src/parse-gram.y: Handle %union.
5319 Use the prologue locations.
5320 * src/reader.c (parse_union_decl): Remove.
5321
5322 * src/reader.h, src/reader.c (epilogue_set): New.
5323 * src/parse-gram.y: Use it.
5324
5325 * data/bison.simple, data/bison.c++: b4_stype is now either not
5326 defined, then default to int, or to the contents of %union,
5327 without `union' itself.
5328 Adjust.
5329 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
5330
5331 * src/output.c (actions_output): Don't output braces, as they are
5332 already handled by the scanner.
5333
5334 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
5335 characters to themselves.
5336
5337 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
5338 that the epilogue has a proper #line.
5339
5340 * src/parse-gram.y: Handle precedence/associativity.
5341
5342 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
5343 a terminal.
5344 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
5345 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
5346 at all to define terminals that cannot be emitted.
5347
5348 * src/scan-gram.l: Escape M4 characters.
5349
5350 * src/scan-gram.l: Working properly with escapes in user
5351 strings/characters.
5352
5353 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
5354 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
5355 grammar.
5356 Use more modest sizes, as for the time being the parser does not
5357 release memory, and therefore the process swallows a huge amount
5358 of memory.
5359
5360 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
5361 stricter %token grammar.
5362
5363 * src/symtab.h (associativity): Add `undef_assoc'.
5364 (symbol_precedence_set): Do nothing when passed an undef_assoc.
5365 * src/symtab.c (symbol_check_alias_consistence): Adjust.
5366
5367 * tests/regression.at (Invalid %directive): Remove, as it is now
5368 meaningless.
5369 (Invalid inputs): Adjust to the new error messages.
5370 (Token definitions): The new grammar doesn't allow too many
5371 eccentricities.
5372
5373 * src/lex.h, src/lex.c: Remove.
5374 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
5375 (copy_character, copy_string2, copy_string, copy_identifier)
5376 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
5377 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
5378 (parse_action): Remove.
5379 * po/POTFILES.in: Adjust.
5380
5381 2002-06-11 Akim Demaille <akim@epita.fr>
5382
5383 * src/reader.c (parse_action): Don't store directly into the
5384 rule's action member: return the action as a string.
5385 Don't require `rule_length' as an argument: compute it.
5386 (grammar_current_rule_symbol_append)
5387 (grammar_current_rule_action_append): New, eved out from
5388 (readgram): here.
5389 Remove `action_flag', `rulelength', unused now.
5390
5391 2002-06-11 Akim Demaille <akim@epita.fr>
5392
5393 * src/reader.c (grammar_current_rule_prec_set).
5394 (grammar_current_rule_check): New, eved out from...
5395 (readgram): here.
5396 Remove `xaction', `first_rhs': useless.
5397 * tests/input.at (Type clashes): New.
5398 * tests/existing.at (GNU Cim Grammar): Adjust.
5399
5400 2002-06-11 Akim Demaille <akim@epita.fr>
5401
5402 * src/reader.c (grammar_midrule_action): New, Eved out from
5403 (readgram): here.
5404
5405 2002-06-11 Akim Demaille <akim@epita.fr>
5406
5407 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
5408 New.
5409 (readgram): Use them as replacement of inlined code, crule and
5410 crule1.
5411
5412 2002-06-11 Akim Demaille <akim@epita.fr>
5413
5414 * src/reader.c (grammar_end, grammar_symbol_append): New.
5415 (readgram): Use them.
5416 Make the use of `p' as local as possible.
5417
5418 2002-06-10 Akim Demaille <akim@epita.fr>
5419
5420 GCJ's parser requires the tokens to be defined before the prologue.
5421
5422 * data/bison.simple: Output the token definition before the user's
5423 prologue.
5424 * tests/regression.at (Braces parsing, Duplicate string)
5425 (Mixing %token styles): Check the output from bison.
5426 (Early token definitions): New.
5427
5428 2002-06-10 Akim Demaille <akim@epita.fr>
5429
5430 * src/symtab.c (symbol_user_token_number_set): Don't complain when
5431 assigning twice the same user number to a token, so that we can
5432 use it in...
5433 * src/lex.c (lex): here.
5434 Also use `symbol_class_set' instead of hand written code.
5435 * src/reader.c (parse_assoc_decl): Likewise.
5436
5437 2002-06-10 Akim Demaille <akim@epita.fr>
5438
5439 * src/symtab.c, src/symtab.c (symbol_class_set)
5440 (symbol_user_token_number_set): New.
5441 * src/reader.c (parse_token_decl): Use them.
5442 Use a switch instead of ifs.
5443 Use a single argument.
5444
5445 2002-06-10 Akim Demaille <akim@epita.fr>
5446
5447 Remove `%thong' support as it is undocumented, unused, duplicates
5448 `%token's job, and creates useless e-mail traffic with people who
5449 want to know what it is, why it is undocumented, unused, and
5450 duplicates `%token's job.
5451
5452 * src/reader.c (parse_thong_decl): Remove.
5453 * src/options.c (option_table): Remove "thong".
5454 * src/lex.h (tok_thong): Remove.
5455
5456 2002-06-10 Akim Demaille <akim@epita.fr>
5457
5458 * src/symtab.c, src/symtab.c (symbol_type_set)
5459 (symbol_precedence_set): New.
5460 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
5461 (value_components_used): Remove, unused.
5462
5463 2002-06-09 Akim Demaille <akim@epita.fr>
5464
5465 Move symbols handling code out of the reader.
5466
5467 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
5468 (axiom): Move to...
5469 * src/symtab.h, src/symtab.c: here.
5470
5471 * src/gram.c (start_symbol): Remove: use startsymbol->number.
5472 * src/reader.c (startval): Rename as...
5473 * src/symtab.h, src/symtab.c (startsymbol): this.
5474 * src/reader.c: Adjust.
5475
5476 * src/reader.c (symbol_check_defined, symbol_make_alias)
5477 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5478 (token_translations_init)
5479 Move to...
5480 * src/symtab.c: here.
5481 * src/reader.c (packsymbols): Move to...
5482 * src/symtab.h, src/symtab.c (symbols_pack): here.
5483 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
5484 argument.
5485
5486 2002-06-03 Akim Demaille <akim@epita.fr>
5487
5488 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
5489 then statements.
5490
5491 2002-06-03 Akim Demaille <akim@epita.fr>
5492
5493 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
5494 structs with non literals.
5495 * src/scan-skel.l: never-interactive.
5496 * src/conflicts.c (enum conflict_resolution_e): No trailing
5497 comma.
5498 * src/getargs.c (usage): Split long literal strings.
5499 Reported by Hans Aberg.
5500
5501 2002-05-28 Akim Demaille <akim@epita.fr>
5502
5503 * data/bison.c++: Use C++ ostreams.
5504 (cdebug_): New member.
5505
5506 2002-05-28 Akim Demaille <akim@epita.fr>
5507
5508 * src/output.c (output_skeleton): Be sure to allocate enough room
5509 for `/' _and_ for `\0' in full_skeleton.
5510
5511 2002-05-28 Akim Demaille <akim@epita.fr>
5512
5513 * data/bison.c++: Catch up with bison.simple:
5514 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5515 and Paul Eggert <eggert@twinsun.com>: `error' handing.
5516 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
5517 and popping traces.
5518
5519 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5520
5521 * src/output.c (output_skeleton): Put an explicit path in front of
5522 the skeleton file name, rather than relying on the -I directory,
5523 to partially alleviate effects of having a skeleton file lying around
5524 in the current directory.
5525
5526 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5527
5528 * src/conflicts.c (log_resolution): Correct typo:
5529 obstack_printf should be obstack_fgrow1.
5530
5531 2002-05-26 Akim Demaille <akim@epita.fr>
5532
5533 * src/state.h (state_t): `solved_conflicts' is a new member.
5534 * src/LR0.c (new_state): Set it to 0.
5535 * src/conflicts.h, src/conflicts.c (print_conflicts)
5536 (free_conflicts, solve_conflicts): Rename as...
5537 (conflicts_print, conflicts_free, conflicts_solve): these.
5538 Adjust callers.
5539 * src/conflicts.c (enum conflict_resolution_e)
5540 (solved_conflicts_obstack): New, used by...
5541 (log_resolution): this.
5542 Adjust to attach the conflict resolution to each state.
5543 Complete the description with the precedence/associativity
5544 information.
5545 (resolve_sr_conflict): Adjust.
5546 * src/print.c (print_state): Output its solved_conflicts.
5547 * tests/conflicts.at (Unresolved SR Conflicts)
5548 (Solved SR Conflicts): Exercise --report=all.
5549
5550 2002-05-26 Akim Demaille <akim@epita.fr>
5551
5552 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5553 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5554 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
5555 (token_number_t, item_number_as_token_number)
5556 (token_number_as_item_number, muscle_insert_token_number_table):
5557 Rename as...
5558 (symbol_number_t, item_number_as_symbol_number)
5559 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
5560 these, since it is more appropriate.
5561
5562 2002-05-26 Akim Demaille <akim@epita.fr>
5563
5564 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
5565 `Error:' lines.
5566 * data/bison.simple (yystos) [YYDEBUG]: New.
5567 (yyparse) [YYDEBUG]: Display the symbols which are popped during
5568 error recovery.
5569 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
5570
5571 2002-05-25 Akim Demaille <akim@epita.fr>
5572
5573 * doc/bison.texinfo (Debugging): Split into...
5574 (Tracing): this new section, its former contents, and...
5575 (Understanding): this new section.
5576 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
5577 by...
5578 (report_flag): this.
5579 Adjust all dependencies.
5580 (report_args, report_types, report_argmatch): New.
5581 (usage, getargs): Report/support -r, --report.
5582 * src/options.h
5583 (struct option_table_struct): Rename as..,
5584 (struct option_table_s): this.
5585 Rename the `set_flag' member to `flag' to match with getopt_long's
5586 struct.
5587 * src/options.c (option_table): Split verbose into an entry for
5588 %verbose, and another for --verbose.
5589 Support --report/-r, so remove -r from the obsolete --raw.
5590 * src/print.c: Attach full item sets and lookaheads reports to
5591 report_flag instead of trace_flag.
5592 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
5593
5594 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5595 and Paul Eggert <eggert@twinsun.com>
5596
5597 * data/bison.simple (yyparse): Correct error handling to conform to
5598 POSIX and yacc. Specifically, after syntax error is discovered,
5599 do not reduce further before shifting the error token.
5600 Clean up the code a bit by removing the labels yyerrdefault,
5601 yyerrhandle, yyerrpop.
5602 * NEWS: Document the above.
5603
5604 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5605
5606 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
5607 type; it isn't always big enough, since it doesn't necessarily
5608 include non-terminals.
5609 (yytranslate): Expand definition of yy_token_number_type, so that
5610 the latter can be removed.
5611 (yy_token_number_type): Remove, only one use.
5612 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
5613 don't use TokenNumberType as element type.
5614
5615 * tests/regression.at: Modify expected output to agree with change
5616 to yyr1 and yytranslate.
5617
5618 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
5619
5620 * src/reader.c (parse_action): Use copy_character instead of
5621 obstack_1grow.
5622
5623 2002-05-13 Akim Demaille <akim@epita.fr>
5624
5625 * tests/regression.at (Token definitions): Prototype yylex and
5626 yyerror.
5627
5628 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5629
5630 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
5631 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
5632 32-bit arithmetic.
5633 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
5634
5635 2002-05-07 Akim Demaille <akim@epita.fr>
5636
5637 * tests/synclines.at: Be sure to prototype yylex and yyerror to
5638 avoid GCC warnings.
5639
5640 2002-05-07 Akim Demaille <akim@epita.fr>
5641
5642 Kill GCC warnings.
5643
5644 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
5645 over the RHS of each rule.
5646 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
5647 * src/state.h (state_t): Member `nitems' is unsigned short.
5648 * src/LR0.c (get_state): Adjust.
5649 * src/reader.c (packgram): Likewise.
5650 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
5651 `Type'.
5652 (muscle_insert_int_table): Remove, unused.
5653 (prepare_rules): Remove `max'.
5654
5655 2002-05-06 Akim Demaille <akim@epita.fr>
5656
5657 * src/closure.c (print_firsts): Display of the symbol tags.
5658 (bitmatrix_print): Move to...
5659 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
5660 here.
5661 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
5662
5663 2002-05-06 Akim Demaille <akim@epita.fr>
5664
5665 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
5666 hash_do_for_each.
5667
5668 2002-05-06 Akim Demaille <akim@epita.fr>
5669
5670 * src/LR0.c (new_state, get_state): Instead of using the global
5671 `kernel_size' and `kernel_base', have two new arguments:
5672 `core_size' and `core'.
5673 Adjust callers.
5674
5675 2002-05-06 Akim Demaille <akim@epita.fr>
5676
5677 * src/reader.c (packgram): No longer end `ritem' with a 0
5678 sentinel: it is not used.
5679
5680 2002-05-05 Akim Demaille <akim@epita.fr>
5681
5682 New experimental feature: display the lookaheads in the report and
5683 graph.
5684
5685 * src/print (print_core): When --trace-flag, display the rules
5686 lookaheads.
5687 * src/print_graph.c (print_core): Likewise.
5688 Swap the arguments.
5689 Adjust caller.
5690
5691 2002-05-05 Akim Demaille <akim@epita.fr>
5692
5693 * tests/torture.at (Many lookaheads): New test.
5694
5695 2002-05-05 Akim Demaille <akim@epita.fr>
5696
5697 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
5698 (GENERATE_MUSCLE_INSERT_TABLE): this.
5699 (output_int_table, output_unsigned_int_table, output_short_table)
5700 (output_token_number_table, output_item_number_table): Replace with...
5701 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
5702 (muscle_insert_short_table, muscle_insert_token_number_table)
5703 (muscle_insert_item_number_table): these.
5704 Adjust all callers.
5705 (prepare_tokens): Don't free `translations', since...
5706 * src/reader.h, src/reader.c (grammar_free): do it.
5707 Move to...
5708 * src/gram.h, src/gram.c (grammar_free): here.
5709 * data/bison.simple, data/bison.c++: b4_token_number_max is now
5710 b4_translate_max.
5711
5712 2002-05-05 Akim Demaille <akim@epita.fr>
5713
5714 * src/output.c (output_unsigned_int_table): New.
5715 (prepare_rules): `i' is unsigned.
5716 `prhs', `rline', `r2' are unsigned int.
5717 Rename muscle `rhs_number_max' as `rhs_max'.
5718 Output muscles `prhs_max', `rline_max', and `r2_max'.
5719 Free rline and r1.
5720 * data/bison.simple, data/bison.c++: Adjust to use these muscles
5721 to compute types instead of constant types.
5722 * tests/regression.at (Web2c Actions): Adjust.
5723
5724 2002-05-04 Akim Demaille <akim@epita.fr>
5725
5726 * src/symtab.h (SALIAS, SUNDEF): Rename as...
5727 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
5728 Adjust dependencies.
5729 * src/output.c (token_definitions_output): Be sure not to output a
5730 `#define 'a'' when fed with `%token 'a' "a"'.
5731 * tests/regression.at (Token definitions): New.
5732
5733 2002-05-03 Paul Eggert <eggert@twinsun.com>
5734
5735 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
5736 for K&R C.
5737
5738 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
5739
5740 * Makefile.am (SUBDIRS): Remove intl.
5741 (EXTRA_DIST): Add config/config.rpath.
5742
5743 2002-05-03 Akim Demaille <akim@epita.fr>
5744
5745 * data/bison.simple (m4_if): Don't output empty enums.
5746 And actually, output valid enum definitions :(.
5747
5748 2002-05-03 Akim Demaille <akim@epita.fr>
5749
5750 * configure.bat: Remove, completely obsolete.
5751 * Makefile.am (EXTRA_DIST): Adjust.
5752 Don't distribute config.rpath...
5753 * config/Makefile.am (EXTRA_DIST): Do it.
5754
5755 2002-05-03 Akim Demaille <akim@epita.fr>
5756
5757 * configure.in (GETTEXT_VERSION): New.
5758 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
5759
5760 2002-05-03 Akim Demaille <akim@epita.fr>
5761
5762 * data/bison.simple (b4_token_enum): New.
5763 (b4_token_defines): Use it to output tokens both as #define and
5764 enums.
5765 Suggested by Paul Eggert.
5766 * src/output.c (token_definitions_output): Don't output spurious
5767 white spaces.
5768
5769 2002-05-03 Akim Demaille <akim@epita.fr>
5770
5771 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5772
5773 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
5774
5775 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
5776 Update the stack class, give a try to deque as the default container.
5777
5778 2002-05-02 Akim Demaille <akim@epita.fr>
5779
5780 * data/bison.simple (yyparse): Do not implement @$ = @1.
5781 (YYLLOC_DEFAULT): Adjust to do it.
5782 * doc/bison.texinfo (Location Default Action): Fix.
5783
5784 2002-05-02 Akim Demaille <akim@epita.fr>
5785
5786 * src/reader.c (parse_braces): Merge into...
5787 (parse_action): this.
5788
5789 2002-05-02 Akim Demaille <akim@epita.fr>
5790
5791 * configure.in (ALL_LINGUAS): Remove.
5792 * po/LINGUAS, hr.po: New.
5793
5794 2002-05-02 Akim Demaille <akim@epita.fr>
5795
5796 Remove the so called hairy (semantic) parsers.
5797
5798 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
5799 * src/gram.h, src/gram.c (semantic_parser): Remove.
5800 (rule_t): Remove the guard and guard_line members.
5801 * src/lex.h (token_t): remove tok_guard.
5802 * src/options.c (option_table): Remove %guard and %semantic_parser
5803 support.
5804 * src/output.c, src/output.h (guards_output): Remove.
5805 (prepare): Adjust.
5806 (token_definitions_output): Don't output the `T'
5807 tokens (???).
5808 (output_skeleton): Don't output the guards.
5809 * src/files.c, src/files.c (attrsfile): Remove.
5810 * src/reader.c (symbol_list): Remove the guard and guard_line
5811 members.
5812 Adjust dependencies.
5813 (parse_guard): Remove.
5814 * data/bison.hairy: Remove.
5815 * doc/bison.texinfo (Environment Variables): Remove occurrences of
5816 BISON_HAIRY.
5817
5818 2002-05-02 Akim Demaille <akim@epita.fr>
5819
5820 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
5821 (parse_guard): Rename the formal argument `stack_offset' as
5822 `rule_length', which is more readable.
5823 Adjust callers.
5824 (copy_at, copy_dollar): Instead of outputting the hard coded
5825 values of $$, $n and so forth, output invocation to b4_lhs_value,
5826 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
5827 Note: this patch partially drops `semantic-parser' support: it
5828 always does `rule_length - n', where semantic parsers ought to
5829 always use `-n'.
5830 * data/bison.simple, data/bison.c++ (b4_lhs_value)
5831 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
5832
5833 2002-05-02 Akim Demaille <akim@epita.fr>
5834
5835 * configure.in (AC_INIT): Bump to 1.49b.
5836 (AM_INIT_AUTOMAKE): Short invocation.
5837
5838 2002-05-02 Akim Demaille <akim@epita.fr>
5839
5840 Version 1.49a.
5841
5842 2002-05-01 Akim Demaille <akim@epita.fr>
5843
5844 * src/skeleton.h: Remove.
5845
5846 2002-05-01 Akim Demaille <akim@epita.fr>
5847
5848 * src/skeleton.h: Fix the #endif.
5849 Reported by Magnus Fromreide.
5850
5851 2002-04-26 Paul Eggert <eggert@twinsun.com>
5852
5853 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
5854 Define if we define YYSTYPE and YYLTYPE, respectively.
5855 (YYCOPY): Fix [] quoting problem in the non-GCC case.
5856
5857 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
5858
5859 * src/scan-skel.l: Postprocess quadrigraphs.
5860
5861 * src/reader.c (copy_character): New function, used to output
5862 single characters while replacing `[' and `]' with quadrigraphs, to
5863 avoid troubles with M4 quotes.
5864 (copy_comment): Output characters with copy_character.
5865 (read_additionnal_code): Likewise.
5866 (copy_string2): Likewise.
5867 (copy_definition): Likewise.
5868
5869 * tests/calc.at: Exercise M4 quoting.
5870
5871 2002-04-25 Akim Demaille <akim@epita.fr>
5872
5873 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
5874 between `!' and the command.
5875 Reported by Paul Eggert.
5876
5877 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
5878
5879 * tests/calc.at: Exercise prologue splitting.
5880
5881 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
5882 `b4_post_prologue' instead of `b4_prologue'.
5883
5884 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
5885 muscles.
5886 (output): Free pre_prologue_obstack and post_prologue_obstack.
5887 * src/files.h, src/files.c (attrs_obstack): Remove.
5888 (pre_prologue_obstack, post_prologue_obstack): New.
5889 * src/reader.c (copy_definition): Add a parameter to specify the
5890 obstack to fill, instead of using attrs_obstack unconditionally.
5891 (read_declarations): Pass pre_prologue_obstack to copy_definition if
5892 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
5893
5894 2002-04-23 Paul Eggert <eggert@twinsun.com>
5895
5896 * data/bison.simple: Remove unnecessary commentary and white
5897 space differences from 1_29-branch.
5898 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
5899
5900 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
5901 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
5902 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
5903 constructors or destructors.
5904
5905 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
5906
5907 2002-04-23 Akim Demaille <akim@epita.fr>
5908
5909 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
5910 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
5911 location with columns.
5912 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
5913 All reported by Paul Eggert.
5914
5915 2002-04-22 Akim Demaille <akim@epita.fr>
5916
5917 * src/reduce.c (dump_grammar): Move to...
5918 * src/gram.h, src/gram.c (grammar_dump): here.
5919 Be sure to separate long item numbers.
5920 Don't read the members of a rule's prec if its nil.
5921
5922 2002-04-22 Akim Demaille <akim@epita.fr>
5923
5924 * src/output.c (table_size, table_grow): New.
5925 (MAXTABLE): Remove, replace uses with table_size.
5926 (pack_vector): Instead of dying when the table is too big, grow it.
5927
5928 2002-04-22 Akim Demaille <akim@epita.fr>
5929
5930 * data/bison.simple (yyr1): Its type is that of a token number.
5931 * data/bison.c++ (r1_): Likewise.
5932 * tests/regression.at (Web2c Actions): Adjust.
5933
5934 2002-04-22 Akim Demaille <akim@epita.fr>
5935
5936 * src/reader.c (token_translations_init): 256 is now the default
5937 value for the error token, i.e., it will be assigned another
5938 number if the user assigned 256 to one of her tokens.
5939 (reader): Don't force 256 to error.
5940 * doc/bison.texinfo (Symbols): Adjust.
5941 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
5942 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
5943 etc. instead of 10, 20, 30 (which was used to `jump' over error
5944 (256) and undefined (2)).
5945
5946 2002-04-22 Akim Demaille <akim@epita.fr>
5947
5948 Propagate more token_number_t.
5949
5950 * src/gram.h (token_number_as_item_number)
5951 (item_number_as_token_number): New.
5952 * src/output.c (GENERATE_OUTPUT_TABLE): New.
5953 Use it to create output_item_number_table and
5954 output_token_number_table.
5955 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5956 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
5957 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
5958 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
5959
5960 2002-04-22 Akim Demaille <akim@epita.fr>
5961
5962 * src/output.h, src/output.c (get_lines_number): Remove.
5963
5964 2002-04-19 Akim Demaille <akim@epita.fr>
5965
5966 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
5967 as Lex/Flex'.
5968 (Debugging): More details about enabling the debugging features.
5969 (Table of Symbols): Describe $$, $n, @$, and @n.
5970 Suggested by Tim Josling.
5971
5972 2002-04-19 Akim Demaille <akim@epita.fr>
5973
5974 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
5975
5976 2002-04-10 Akim Demaille <akim@epita.fr>
5977
5978 * src/system.h: Rely on HAVE_LIMITS_H.
5979 Suggested by Paul Eggert.
5980
5981 2002-04-09 Akim Demaille <akim@epita.fr>
5982
5983 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
5984 full stderr, and strip it according to the bison options, instead
5985 of composing the error message from different bits.
5986 This makes it easier to check for several error messages.
5987 Adjust all the invocations.
5988 Add an invocation exercising the error token.
5989 Add an invocation demonstrating a stupid error message.
5990 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
5991 Adjust the tests.
5992 Error message are for stderr, not stdout.
5993
5994 2002-04-09 Akim Demaille <akim@epita.fr>
5995
5996 * src/gram.h, src/gram.c (error_token_number): Remove, use
5997 errtoken->number.
5998 * src/reader.c (reader): Don't specify the user token number (2)
5999 for $undefined, as it uselessly prevents using it.
6000 * src/gram.h (token_number_t): Move to...
6001 * src/symtab.h: here.
6002 (state_t.number): Is a token_number_t.
6003 * src/print.c, src/reader.c: Use undeftoken->number instead of
6004 hard coded 2.
6005 (Even though this 2 is not the same as above: the number of the
6006 undeftoken remains being 2, it is its user token number which
6007 might not be 2).
6008 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
6009 `user_token_number_max'.
6010 Output `undef_token_number'.
6011 * data/bison.simple, data/bison.c++: Use them.
6012 Be sure to map invalid yylex return values to
6013 `undef_token_number'. This saves us from gratuitous SEGV.
6014
6015 * tests/conflicts.at (Solved SR Conflicts)
6016 (Unresolved SR Conflicts): Adjust.
6017 * tests/regression.at (Web2c Actions): Adjust.
6018
6019 2002-04-08 Akim Demaille <akim@epita.fr>
6020
6021 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
6022 Adding #line.
6023 Remove the duplicate `typedefs'.
6024 (RhsNumberType): Fix the declaration and various other typos.
6025 Use __ofile__.
6026 * data/bison.simple: Use __ofile__.
6027 * src/scan-skel.l: Handle __ofile__.
6028
6029 2002-04-08 Akim Demaille <akim@epita.fr>
6030
6031 * src/gram.h (item_number_t): New, the type of item numbers in
6032 RITEM. Note that it must be able to code symbol numbers as
6033 positive number, and the negation of rule numbers as negative
6034 numbers.
6035 Adjust all dependencies (pretty many).
6036 * src/reduce.c (rule): Remove this `short *' pointer: use
6037 item_number_t.
6038 * src/system.h (MINSHORT, MAXSHORT): Remove.
6039 Include `limits.h'.
6040 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
6041 (shortcpy): Remove.
6042 (MAXTABLE): Move to...
6043 * src/output.c (MAXTABLE): here.
6044 (prepare_rules): Use output_int_table to output rhs.
6045 * data/bison.simple, data/bison.c++: Adjust.
6046 * tests/torture.at (Big triangle): Move the limit from 254 to
6047 500.
6048 * tests/regression.at (Web2c Actions): Ajust.
6049
6050 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
6051 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
6052 passes, but produces negative #line number, once fixed, GCC is
6053 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
6054 C), it passes.
6055 * src/state.h (state_h): Code input lines on ints, not shorts.
6056
6057 2002-04-08 Akim Demaille <akim@epita.fr>
6058
6059 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
6060 and then the grammar.
6061
6062 2002-04-08 Akim Demaille <akim@epita.fr>
6063
6064 * src/system.h: No longer using strndup.
6065
6066 2002-04-07 Akim Demaille <akim@epita.fr>
6067
6068 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
6069 * src/output.c (output_table_data): Return the longest number.
6070 (prepare_tokens): Output `token_number_max').
6071 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
6072 New.
6073 Use them to define yy_token_number_type/TokenNumberType.
6074 Use this type for yytranslate.
6075 * tests/torture.at (Big triangle): Push the limit from 124 to
6076 253.
6077 * tests/regression.at (Web2c Actions): Adjust.
6078
6079 2002-04-07 Akim Demaille <akim@epita.fr>
6080
6081 * tests/torture.at (Big triangle): New.
6082 (GNU AWK Grammar, GNU Cim Grammar): Move to...
6083 * tests/existing.at: here.
6084
6085 2002-04-07 Akim Demaille <akim@epita.fr>
6086
6087 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
6088 nritems.
6089 Adjust dependencies.
6090
6091 2002-04-07 Akim Demaille <akim@epita.fr>
6092
6093 * src/reader.c: Normalize increments to prefix form.
6094
6095 2002-04-07 Akim Demaille <akim@epita.fr>
6096
6097 * src/reader.c, symtab.c: Remove debugging code.
6098
6099 2002-04-07 Akim Demaille <akim@epita.fr>
6100
6101 Rename all the `bucket's as `symbol_t'.
6102
6103 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
6104 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
6105 * src/symtab.c, src/symtab.h (bucket): Rename as...
6106 (symbol_t): this.
6107 (symbol_list_new, bucket_check_defined, bucket_make_alias)
6108 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
6109 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
6110 (buckets_new, buckets_free, buckets_do): Rename as...
6111 (symbol_list_new, symbol_check_defined, symbol_make_alias)
6112 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
6113 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
6114 (symbols_new, symbols_free, symbols_do): these.
6115
6116 2002-04-07 Akim Demaille <akim@epita.fr>
6117
6118 Use lib/hash for the symbol table.
6119
6120 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
6121 EOF.
6122 * src/lex.c (lex): Set the `number' member of new terminals.
6123 * src/reader.c (bucket_check_defined, bucket_make_alias)
6124 (bucket_check_alias_consistence, bucket_translation): New.
6125 (reader, grammar_free, readgram, token_translations_init)
6126 (packsymbols): Adjust.
6127 (reader): Number the predefined tokens.
6128 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
6129 for predefined tokens.
6130 * src/symtab.h (bucket): Remove all the hash table related
6131 members.
6132 * src/symtab.c (symtab): Replace by...
6133 (bucket_table): this.
6134 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
6135 (buckets_new, buckets_do): New.
6136
6137 2002-04-07 Akim Demaille <akim@epita.fr>
6138
6139 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
6140 (start_symbol, max_user_token_number, semantic_parser)
6141 (error_token_number): Initialize.
6142 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
6143 Initialize.
6144 (reader): Don't.
6145 (errtoken, eoftoken, undeftoken, axiom): Extern.
6146
6147 2002-04-07 Akim Demaille <akim@epita.fr>
6148
6149 * src/gram.h (rule_s): prec and precsym are now pointers
6150 to the bucket giving the priority/associativity.
6151 Member `associativity' removed: useless.
6152 * src/reduce.c, src/conflicts.c: Adjust.
6153
6154 2002-04-07 Akim Demaille <akim@epita.fr>
6155
6156 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
6157 Properly escape the symbols' TAG when outputting them.
6158
6159 2002-04-07 Akim Demaille <akim@epita.fr>
6160
6161 * src/lalr.h (LA): Is a bitsetv, not bitset*.
6162
6163 2002-04-07 Akim Demaille <akim@epita.fr>
6164
6165 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
6166 (LArule): this, which is an array to rule_t*.
6167 * src/print.c, src/conflicts.c: Adjust.
6168
6169 2002-04-07 Akim Demaille <akim@epita.fr>
6170
6171 * src/gram.h (rule_t): Rename `number' as `user_number'.
6172 `number' is a new member.
6173 Adjust dependencies.
6174 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
6175
6176 2002-04-07 Akim Demaille <akim@epita.fr>
6177
6178 As a result of the previous patch, it is no longer needed
6179 to reorder ritem itself.
6180
6181 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
6182
6183 2002-04-07 Akim Demaille <akim@epita.fr>
6184
6185 Be sure never to walk through RITEMS, but use only data related to
6186 the rules themselves. RITEMS should be banished.
6187
6188 * src/output.c (output_token_translations): Rename as...
6189 (prepare_tokens): this.
6190 In addition to `translate', prepare the muscles `tname' and
6191 `toknum', which were handled by...
6192 (output_rule_data): this.
6193 Remove, and move the remainder of its outputs into...
6194 (prepare_rules): this new routines, which also merges content from
6195 (output_gram): this.
6196 (prepare_rules): Be sure never to walk through RITEMS.
6197 (output_stos): Rename as...
6198 (prepare_stos): this.
6199 (output): Always invoke prepare_states, after all, just don't use it
6200 in the output if you don't need it.
6201
6202 2002-04-07 Akim Demaille <akim@epita.fr>
6203
6204 * src/LR0.c (new_state): Display `nstates' as the name of the
6205 newly created state.
6206 Adjust to initialize first_state and last_state if needed.
6207 Be sure to distinguish the initial from the final state.
6208 (new_states): Create the itemset of the initial state, and use
6209 new_state.
6210 * src/closure.c (closure): Now that the initial state has its
6211 items properly set, there is no need for a special case when
6212 creating `ruleset'.
6213
6214 As a result, now the rule 0, reducing to $axiom, is visible in the
6215 outputs. Adjust the test suite.
6216
6217 * tests/conflicts.at (Solved SR Conflicts)
6218 (Unresolved SR Conflicts): Adjust.
6219 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
6220 * tests/conflicts.at (S/R in initial): New.
6221
6222 2002-04-07 Akim Demaille <akim@epita.fr>
6223
6224 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
6225 the RHS of the rules.
6226 * src/output.c (output_gram): Likewise.
6227
6228 2002-04-07 Akim Demaille <akim@epita.fr>
6229
6230 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
6231 bucket.
6232 Adjust all dependencies.
6233 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
6234 `number' of the buckets too.
6235 * src/gram.h: Include `symtab.h'.
6236 (associativity): Move to...
6237 * src/symtab.h: here.
6238 No longer include `gram.h'.
6239
6240 2002-04-07 Akim Demaille <akim@epita.fr>
6241
6242 * src/gram.h, src/gram.c (rules_rhs_length): New.
6243 (ritem_longest_rhs): Use it.
6244 * src/gram.h (rule_t): `number' is a new member.
6245 * src/reader.c (packgram): Set it.
6246 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
6247 the end of `rules', and count them out of `nrules'.
6248 (reduce_output, dump_grammar): Adjust.
6249 * src/print.c (print_grammar): It is no longer needed to check for
6250 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
6251 * tests/reduce.at (Reduced Automaton): New test.
6252
6253 2002-04-07 Akim Demaille <akim@epita.fr>
6254
6255 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
6256 lacking `+ 1' to nrules, Bison reported as useless a token if it
6257 was used solely to set the precedence of the last rule...
6258
6259 2002-04-07 Akim Demaille <akim@epita.fr>
6260
6261 * data/bison.c++, data/bison.simple: Don't output the current file
6262 name in #line, to avoid useless diffs between two identical
6263 outputs under different names.
6264
6265 2002-04-07 Akim Demaille <akim@epita.fr>
6266
6267 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
6268 Normalize loops to using `< nrules + 1', not `<= nrules'.
6269
6270 2002-04-07 Akim Demaille <akim@epita.fr>
6271
6272 * TODO: Update.
6273
6274 2002-04-07 Akim Demaille <akim@epita.fr>
6275
6276 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
6277 bucket.value as bucket.number.
6278
6279 2002-04-07 Akim Demaille <akim@epita.fr>
6280
6281 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
6282 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
6283 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
6284 RHS, instead of being an index in RITEMS.
6285
6286 2002-04-04 Paul Eggert <eggert@twinsun.com>
6287
6288 * doc/bison.texinfo: Update copyright date.
6289 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
6290 (Symbols): Warn about running Bison in one character set,
6291 but compiling and/or running in an incompatible one.
6292 Warn about character code 256, too.
6293
6294 2002-04-03 Paul Eggert <eggert@twinsun.com>
6295
6296 * src/bison.data (YYSTACK_ALLOC): Depend on whether
6297 YYERROR_VERBOSE is nonzero, not whether it is defined.
6298
6299 Merge changes from bison-1_29-branch.
6300
6301 2002-03-20 Paul Eggert <eggert@twinsun.com>
6302
6303 Merge fixes from Debian bison_1.34-1.diff.
6304
6305 * configure.in (AC_PREREQ): 2.53.
6306
6307 2002-03-20 Akim Demaille <akim@epita.fr>
6308
6309 * src/conflicts.c (log_resolution): Argument `resolution' is const.
6310
6311 2002-03-19 Paul Eggert <eggert@twinsun.com>
6312
6313 * src/bison.simple (YYCOPY): New macro.
6314 (YYSTACK_RELOCATE): Use it.
6315 Remove Type arg; no longer needed. All callers changed.
6316 (yymemcpy): Remove; no longer needed.
6317
6318 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
6319 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
6320
6321 2002-03-19 Akim Demaille <akim@epita.fr>
6322
6323 Test and fix the #line outputs.
6324
6325 * tests/atlocal.at (GCC): New.
6326 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
6327 (Prologue synch line, ,%union synch line, Postprologue synch line)
6328 (Action synch line, Epilogue synch line): New tests.
6329 * src/reader.c (parse_union_decl): Define the muscle stype_line.
6330 * data/bison.simple, data/bison.c++: Use it.
6331
6332 2002-03-19 Akim Demaille <akim@epita.fr>
6333
6334 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
6335 (Solved SR Conflicts, %expect not enough, %expect right)
6336 (%expect too much): Move to...
6337 * tests/conflicts.at: this new file.
6338
6339 2002-03-19 Akim Demaille <akim@epita.fr>
6340
6341 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
6342 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
6343 that we can move to enums for instance.
6344 * src/output.c (token_definitions_output): Output a list of
6345 `token-name, token-number' instead of the #define.
6346 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
6347
6348 2002-03-14 Akim Demaille <akim@epita.fr>
6349
6350 Use Gettext 0.11.1.
6351
6352 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
6353
6354 * data/bison.c++: Make the user able to add members to the generated
6355 parser by subclassing.
6356
6357 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
6358
6359 * src/reader.c (read_additionnal_code): `c' should be an integer, not
6360 a character.
6361 Reported by Nicolas Tisserand and Nicolas Burrus.
6362
6363 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
6364
6365 * src/reader.c: Warn about lacking semi-colons, do not complain.
6366
6367 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
6368
6369 * data/bison.c++: Remove a debug line.
6370
6371 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
6372
6373 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
6374 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
6375 provide a default implementation.
6376
6377 2002-03-04 Akim Demaille <akim@epita.fr>
6378
6379 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
6380 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
6381 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
6382 * tests/semantic.at (Parsing Guards): Similarly.
6383 * src/reader.at (readgram): Complain if the last rule is not ended
6384 with a semi-colon.
6385
6386 2002-03-04 Akim Demaille <akim@epita.fr>
6387
6388 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
6389 * src/closure.c: here.
6390 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
6391 RTC.
6392 * src/warshall.h, src/warshall.c: Remove.
6393 * tests/sets.at (Broken Closure): Adjust.
6394
6395 2002-03-04 Akim Demaille <akim@epita.fr>
6396
6397 * src/output.c (output_skeleton): tempdir is const.
6398 bytes_read is unused.
6399
6400 2002-03-04 Akim Demaille <akim@epita.fr>
6401
6402 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6403 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
6404 Update.
6405 From Michael Hayes.
6406
6407 2002-03-04 Akim Demaille <akim@epita.fr>
6408
6409 * src/closure.c (closure): `r' is unused.
6410
6411 2002-03-04 Akim Demaille <akim@epita.fr>
6412
6413 * tests/sets.at (Broken Closure): Add the ending `;'.
6414 * src/reader.at (readgram): Complain if a rule is not ended with a
6415 semi-colon.
6416
6417 2002-03-04 Akim Demaille <akim@epita.fr>
6418
6419 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
6420 (count_sr_conflicts): Use bitset_count.
6421 * src/reduce.c (inaccessable_symbols): Ditto.
6422 (bits_size): Remove.
6423 * src/warshall.h, src/warshall.c: Convert to bitsetv.
6424
6425 2002-03-04 Akim Demaille <akim@epita.fr>
6426
6427 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
6428 * src/reduce.c: Remove the `bitset_zero's following the
6429 `bitset_create's, as now it is performed by the latter.
6430
6431 2002-03-04 Akim Demaille <akim@epita.fr>
6432
6433 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
6434 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
6435 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
6436 latest sources from Michael.
6437
6438 2002-03-04 Akim Demaille <akim@epita.fr>
6439
6440 * src/output.c (output): Don't free the grammar.
6441 * src/reader.c (grammar_free): New.
6442 * src/main.c (main): Call it and don't free symtab here.
6443
6444 2002-03-04 Akim Demaille <akim@epita.fr>
6445
6446 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
6447 before returning.
6448 Reported by Benoit Perrot.
6449
6450 2002-03-04 Akim Demaille <akim@epita.fr>
6451
6452 Use bitset operations when possible, not loops over bits.
6453
6454 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
6455 bitset_or.
6456 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
6457 * src/reduce.c (useless_nonterminals): Formatting changes.
6458 * src/warshall.c (TC): Use bitset_or.
6459
6460 2002-03-04 Akim Demaille <akim@epita.fr>
6461
6462 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
6463 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
6464 Ditto.
6465
6466 2002-03-04 Akim Demaille <akim@epita.fr>
6467
6468 * src/lalr.c (F): Now a bitset*.
6469 Adjust all dependencies.
6470
6471 2002-03-04 Akim Demaille <akim@epita.fr>
6472
6473 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
6474 Adjust all dependencies.
6475
6476 2002-03-04 Akim Demaille <akim@epita.fr>
6477
6478 * src/L0.c, src/LR0.h (nstates): Be size_t.
6479 Adjust comparisons (signed vs unsigned).
6480 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
6481 bitset*.
6482 Adjust all dependencies.
6483
6484 2002-03-04 Akim Demaille <akim@epita.fr>
6485
6486 * src/closure.c (firsts): Now, also a bitset.
6487 Adjust all dependencies.
6488 (varsetsize): Remove, now unused.
6489 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
6490
6491 2002-03-04 Akim Demaille <akim@epita.fr>
6492
6493 * src/print.c: Convert to use bitset.h, not hand coded iterations
6494 over ints.
6495
6496 2002-03-04 Akim Demaille <akim@epita.fr>
6497
6498 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
6499
6500 2002-03-04 Akim Demaille <akim@epita.fr>
6501
6502 * src/closure.c (ruleset): Be a bitset.
6503 (rulesetsize): Remove.
6504
6505 2002-03-04 Akim Demaille <akim@epita.fr>
6506
6507 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6508 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
6509 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
6510 * src/closure.c (fderives): Be an array of bitsets.
6511
6512 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
6513
6514 * data/bison.c++: Merge the two generated headers. Insert a copyright
6515 notice in each output file.
6516
6517 2002-02-28 Akim Demaille <akim@epita.fr>
6518
6519 * data/bison.c++: Copy the prologue of bison.simple to fetch
6520 useful M4 definitions, such as b4_header_guard.
6521
6522 2002-02-25 Akim Demaille <akim@epita.fr>
6523
6524 * src/getargs.c (version): Give the name of the authors, and use a
6525 translator friendly scheme for the bgr
6526 copyright notice.
6527
6528 2002-02-25 Akim Demaille <akim@epita.fr>
6529
6530 * src/output.c (header_output): Remove, now handled completely via
6531 M4.
6532
6533 2002-02-25 Akim Demaille <akim@epita.fr>
6534
6535 * m4/m4.m4: New, from CVS Autoconf.
6536 * configure.in: Invoke it.
6537 * src/output.c (output_skeleton): Use its result instead of the
6538 hard coded name.
6539
6540 2002-02-25 Akim Demaille <akim@epita.fr>
6541
6542 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
6543 Fileutils 4.1.5.
6544 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
6545 * src/output.c (output_skeleton): Use mkstemp to create a real
6546 temporary file.
6547 Move the filling of `skeleton' and its muscle to...
6548 (prepare): here.
6549 (output): Move the definition of the prologue muscle to...
6550 (prepare): here.
6551 * src/system.h (DEFAULT_TMPDIR): New.
6552
6553 2002-02-14 Paul Eggert <eggert@twinsun.com>
6554
6555 Remove the support for C++ namespace cleanliness; it was
6556 causing more problems than it was curing, since it didn't work
6557 properly on some nonstandard C++ compilers. This can wait
6558 for a proper C++ parser.
6559
6560 * NEWS: Document this.
6561 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
6562 of C++, as it's treated like C now.
6563 * src/bison.simple (YYSTD): Remove.
6564 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
6565 Treat C++ just like Standard C instead of trying to support
6566 namespace cleanliness.
6567
6568 2002-02-14 Akim Demaille <akim@epita.fr>
6569
6570 * tests/regression.at (else): Adjust to Andreas' change.
6571
6572 2002-02-14 Akim Demaille <akim@epita.fr>
6573
6574 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
6575
6576 2002-02-13 Andreas Schwab <schwab@suse.de>
6577
6578 * src/output.c (output_rule_data): Don't output NULL, it might
6579 not be defined yet.
6580
6581 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
6582
6583 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
6584 (Copyright notice): Update.
6585
6586 2002-02-11 Akim Demaille <akim@epita.fr>
6587
6588 * tests/regression.at (%nonassoc and eof): Don't include
6589 nonportable headers.
6590
6591 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
6592
6593 * data/bison.c++: Correct error recovery. Make the user able to
6594 initialize the starting location.
6595
6596 2002-02-07 Akim Demaille <akim@epita.fr>
6597
6598 * tests/input.at: New.
6599
6600 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6601
6602 * data/bison.c++: Replace some direct m4 expansions by constants. Be
6603 more consistent when naming methods and variables. Put preprocessor
6604 directives around tables only needed for debugging.
6605
6606 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6607
6608 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
6609 C++ parsers.
6610 (yy::b4_name::parse): Use print_.
6611
6612 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6613
6614 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
6615
6616 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6617
6618 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
6619 C++ parsers.
6620 (yy::b4_name::parse): Build verbose error messages, and use error_.
6621
6622 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
6623
6624 * data/bison.c++: Fix m4 quoting in comments.
6625
6626 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
6627
6628 * data/bison.c++: Adjust the parser code. Fix some muscles that were
6629 not expanded by m4.
6630
6631 2002-02-05 Akim Demaille <akim@epita.fr>
6632
6633 * data/bison.c++: Adjust to the M4 back end.
6634 More is certainly needed.
6635
6636 2002-02-05 Akim Demaille <akim@epita.fr>
6637
6638 Give a try to M4 as a back end.
6639
6640 * lib/readpipe.c: New, from wdiff.
6641 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
6642 BISON_HAIRY.
6643 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
6644 specific values. Now it is m4 that performs the lookup.
6645 * src/parse-skel.y: Remove.
6646 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
6647 * src/output.c (actions_output, guards_output)
6648 (token_definitions_output): No longer keeps track of the output
6649 line number, hence remove the second argument.
6650 (guards_output): Check against the guard member of a rule, not the
6651 action member.
6652 Adjust callers.
6653 (output_skeleton): Don't look for the skeleton location, let m4 do
6654 that.
6655 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
6656 file will be used.
6657 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
6658 (prepare): Given that for the time being changesyntax is not
6659 usable in M4, rename the muscles using `-' to `_'.
6660 Define `defines_flag', `output_parser_name' and `output_header_name'.
6661 * src/output.h (actions_output, guards_output)
6662 (token_definitions_output): Adjust prototypes.
6663 * src/scan-skel.l: Instead of scanning the skeletons, it now
6664 processes the output of m4: `__oline__' and `#output'.
6665 * data/bison.simple: Adjust to be used by M4(sugar).
6666 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
6667 to date.
6668 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
6669 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
6670 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
6671 shamelessly stolen from CVS Autoconf.
6672
6673 2002-02-05 Akim Demaille <akim@epita.fr>
6674
6675 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
6676 * configure.in: Check for the declarations of free and malloc.
6677 * src/muscle_tab.c: Adjust.
6678
6679 2002-02-05 Akim Demaille <akim@epita.fr>
6680
6681 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
6682 which have no values.
6683
6684 2002-02-05 Akim Demaille <akim@epita.fr>
6685
6686 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
6687 * data/: here.
6688
6689 2002-01-29 Paul Eggert <eggert@twinsun.com>
6690
6691 * src/bison.simple (YYSIZE_T): Do not define merely because
6692 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
6693 On some platforms, <alloca.h> does not declare YYSTD (size_t).
6694
6695 2002-01-27 Akim Demaille <akim@epita.fr>
6696
6697 Fix `%nonassoc and eof'.
6698
6699 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
6700 which were not properly copied! Replace
6701 memcpy (res->errs, src->errs, src->nerrs);
6702 with
6703 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
6704 !!!
6705 * tests/regression.at (%nonassoc and eof): Adjust to newest
6706 Autotest: `.' is not in the PATH.
6707
6708 2002-01-27 Akim Demaille <akim@epita.fr>
6709
6710 * tests/sets.at (AT_EXTRACT_SETS): New.
6711 (Nullable): Use it.
6712 (Firsts): New.
6713
6714 2002-01-26 Akim Demaille <akim@epita.fr>
6715
6716 * tests/actions.at, tests/calc.at, tests/headers.at,
6717 * tests/torture.at: Adjust to the newest Autotest which no longer
6718 forces `.' in the PATH.
6719
6720 2002-01-25 Akim Demaille <akim@epita.fr>
6721
6722 * tests/regression.at (%nonassoc and eof): New.
6723 Suggested by Robert Anisko.
6724
6725 2002-01-24 Akim Demaille <akim@epita.fr>
6726
6727 Bison dumps core when trying to complain about broken input files.
6728 Reported by Cris van Pelt.
6729
6730 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
6731 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
6732 into...
6733 (Invalid inputs): Strengthen: exercise parse_percent_token.
6734
6735 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
6736
6737 * src/Makefile.am: Add bison.c++.
6738 * src/bison.c++: New skeleton.
6739
6740 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
6741
6742 * po/it.po: New.
6743
6744 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
6745
6746 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
6747
6748 2002-01-20 Marc Autret <marc@gnu.org>
6749
6750 * src/files.c (compute_output_file_names): Fix
6751
6752 2002-01-20 Marc Autret <marc@gnu.org>
6753
6754 * tests/output.at: New test.
6755 * src/files.c (compute_base_names): Don't map extensions when
6756 the YACC flag is set, use defaults.
6757 Reported by Evgeny Stambulchik.
6758
6759 2002-01-20 Marc Autret <marc@gnu.org>
6760
6761 * src/system.h: Need to define __attribute__ away for non-GCC
6762 compilers as well (i.e. the vendor C compiler).
6763 Suggested by Albert Chin-A-Young.
6764
6765 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
6766
6767 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
6768 canonical definition.
6769 * src/system.h: Use the canonical definition for PARAMS (avoids
6770 a conflict with the macro from lib/hash.h).
6771
6772 2002-01-11 Akim Demaille <akim@epita.fr>
6773
6774 * configure.in: Use AC_FUNC_STRNLEN.
6775 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
6776
6777 2002-01-09 Akim Demaille <akim@epita.fr>
6778
6779 * src/files.c, src/files.h (output_infix): New.
6780 (tab_extension): Remove.
6781 (compute_base_names): Compute the former, drop the latter.
6782 * src/output.c (prepare): Insert the muscles `output-infix', and
6783 `output-suffix'.
6784 * src/parse-skel.y (string, string.1): New.
6785 (section.header): Use it.
6786 (section.yacc): Remove.
6787 (prefix): Remove too.
6788 * src/scan-skel.l: Adjust.
6789 * src/bison.simple, src/bison.hairy: Adjust.
6790
6791 2002-01-09 Akim Demaille <akim@epita.fr>
6792
6793 * configure.in (WERROR_CFLAGS): Compute it.
6794 * src/Makefile.am (CFLAGS): Pass it.
6795 * tests/atlocal.in (CFLAGS): Idem.
6796 * src/files.c: Fix a few warnings.
6797 (get_extension_index): Remove, unused.
6798
6799 2002-01-08 Akim Demaille <akim@epita.fr>
6800
6801 * src/getargs.c (AS_FILE_NAME): New.
6802 (getargs): Use it to convert DOSish file names.
6803 * src/files.c (base_name): Rename as full_base_name to avoid
6804 clashes with `base_name ()'.
6805 (filename_split): New.
6806 (compute_base_names): N-th rewrite, using filename_split.
6807
6808 2002-01-08 Akim Demaille <akim@epita.fr>
6809
6810 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
6811 New, stolen from the Fileutils 4.1.
6812 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
6813 * configure.in: Check for the presence of memrchr, and of its
6814 prototype.
6815
6816 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
6817
6818 * lib/hash.h (__P): Added definition for this macro.
6819 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
6820 BUILT_SOURCES, to ensure they are generated first.
6821 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
6822 %error-verbose to allow bootstrapping with bison 1.30x.
6823
6824 2002-01-06 Akim Demaille <akim@epita.fr>
6825
6826 * src/reader.c (parse_braces): Don't fetch the next char, the
6827 convention is to fetch on entry.
6828 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
6829 'switch' without a following semicolon.
6830 * tests/regression.at (braces parsing): New.
6831
6832 2002-01-06 Akim Demaille <akim@epita.fr>
6833
6834 Bison is dead wrong in its RR conflict reports.
6835
6836 * tests/torture.at (GNU Cim Grammar): New.
6837 * src/conflicts.c (count_rr_conflicts): Fix.
6838
6839 2002-01-06 Akim Demaille <akim@epita.fr>
6840
6841 Creating package.m4 from configure.ac causes too many problems.
6842
6843 * tests/Makefile.am (package.m4): Create it by hand,
6844 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
6845
6846 2002-01-06 Akim Demaille <akim@epita.fr>
6847
6848 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
6849 skeleton.h.
6850
6851 2002-01-04 Paul Eggert <eggert@twinsun.com>
6852
6853 * doc/bison.texinfo (Debugging):
6854 Remove YYSTDERR; it's no longer defined or used.
6855 Also, s/cstdio.h/cstdio/.
6856
6857 2002-01-03 Akim Demaille <akim@epita.fr>
6858
6859 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
6860
6861 2002-01-03 Akim Demaille <akim@epita.fr>
6862
6863 * src/parse-skel.y (process_skeleton): Don't bind the parser's
6864 tracing code to --trace, wait for a better --trace option, with
6865 args.
6866
6867 2002-01-03 Akim Demaille <akim@epita.fr>
6868
6869 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
6870 The ISO C++ standard is extremely clear about it: stderr is
6871 considered a macro, not a regular symbol (see table 94 `Header
6872 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
6873 Therefore std:: does not apply to it. It still does with fprintf.
6874 Also, s/cstdio.h/cstdio/.
6875
6876 2002-01-03 Akim Demaille <akim@epita.fr>
6877
6878 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
6879 for non system headers.
6880
6881 2002-01-02 Akim Demaille <akim@epita.fr>
6882
6883 Equip the skeleton chain with location tracking, runtime trace,
6884 pure parser and scanner.
6885
6886 * src/parse-skel.y: Request a pure parser, locations, and prefix
6887 renaming.
6888 (%union): Having several members with the same type does not help
6889 type mismatches, simplify.
6890 (YYPRINT, yyprint): New.
6891 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
6892 (skel_error): this.
6893 Handle locations.
6894 * src/scan-skel.l: Adjust to these changes.
6895 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
6896 (LOCATION_PRINT, skel_control_t): New.
6897
6898 2001-12-30 Akim Demaille <akim@epita.fr>
6899
6900 * src/parse-skel.y: Get rid of the shift/reduce conflict:
6901 replace `gb' with BLANKS.
6902 * src/scan-skel.l: Adjust.
6903
6904 2001-12-30 Akim Demaille <akim@epita.fr>
6905
6906 * src/system.h: We don't need nor want bcopy.
6907 Throw away MS-DOS crap: we don't need getpid.
6908 * configure.in: We don't need strndup. It was even causing
6909 problems: because Flex includes the headers *before* us,
6910 _GNU_SOURCE is not defined by config.h, and therefore strndup was
6911 not visible.
6912 * lib/xstrndup.c: New.
6913 * src/scan-skel.l: Use it.
6914 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
6915 * src/parse-skel.y: Use %directives instead of #defines.
6916
6917 2001-12-30 Akim Demaille <akim@epita.fr>
6918
6919 * src/skeleton.h: New.
6920 * src/output.c (output_parser, output_master_parser): Remove, dead
6921 code.
6922 * src/output.h (get_lines_number, actions_output, guards_output)
6923 (token_definitions_output): Prototype them.
6924 * src/parse-skel.y: Add the license notice.
6925 Include output.h and skeleton.h.
6926 (process_skeleton): Returns void, and takes a single parameter.
6927 * src/scan-skel.l: Add the license notice.
6928 Include skeleton.h.
6929 Don't use %option yylineno: it seems that then Flex imagines
6930 REJECT has been used, and therefore it won't reallocate its
6931 buffers (which makes no other sense to me than a bug). It results
6932 in warnings for `unused: yy_flex_realloc'.
6933
6934 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
6935
6936 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6937 (MUSCLE_INSERT_PREFIX): ...to there.
6938 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6939 (MUSCLE_INSERT_PREFIX): Move from here...
6940
6941 * src/bison.hairy: Add a section directive. Put braces around muscle
6942 names. This parser skeleton is still broken, but Bison should not
6943 choke on a bad muscle 'syntax'.
6944 * src/bison.simple: Add a section directive. Put braces around muscle
6945 names.
6946
6947 * src/files.h (strsuffix, stringappend): Add declarations.
6948 (tab_extension): Add declaration.
6949 (short_base_name): Add declaration.
6950
6951 * src/files.c (strsuffix, stringappend): No longer static. These
6952 functions are used in the skeleton parser.
6953 (tab_extension): New.
6954 (compute_base_names): Use the computations done in this function
6955 to guess if the generated parsers should have '.tab' in their
6956 names.
6957 (short_base_name): No longer static.
6958
6959 * src/output.c (output_skeleton): New.
6960 (output): Disable call to output_master_parser, and give a try to
6961 a new skeleton handling system.
6962 (guards_output, actions_output): No longer static.
6963 (token_definitions_output, get_lines_number): No longer static.
6964
6965 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
6966
6967 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
6968 parse-skel.y.
6969
6970 * src/parse-skel.y: New file.
6971 * src/scan-skel.l: New file.
6972
6973 2001-12-29 Akim Demaille <akim@epita.fr>
6974
6975 %name-prefix is broken.
6976
6977 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
6978 Adjust all dependencies.
6979 * tests/headers.at (export YYLTYPE): Strengthen this test: use
6980 %name-prefix.
6981
6982 Renaming yylval but not yylloc is not consistent. Now we do.
6983
6984 * src/bison.simple: Prefix yylloc if used.
6985 * doc/bison.texinfo (Decl Summary): Document that.
6986
6987 2001-12-29 Akim Demaille <akim@epita.fr>
6988
6989 * doc/bison.texinfo: Promote `%long-directive' over
6990 `%long_directive'.
6991 Remove all references to fixed-output-files, yacc is enough.
6992
6993 2001-12-29 Akim Demaille <akim@epita.fr>
6994
6995 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
6996 user prologue. These are defaults.
6997 * tests/actions.at (Mid-rule actions): Make sure the user can
6998 define YYDEBUG and YYERROR_VERBOSE.
6999
7000 2001-12-29 Akim Demaille <akim@epita.fr>
7001
7002 * src/output.c (header_output): Don't forget to export YYLTYPE and
7003 yylloc.
7004 * tests/headers.at (export YYLTYPE): New, make sure it does.
7005 * tests/regression.at (%union and --defines, Invalid CPP headers):
7006 Move to...
7007 * tests/headers.at: here.
7008
7009 2001-12-29 Akim Demaille <akim@epita.fr>
7010
7011 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
7012
7013 2001-12-29 Akim Demaille <akim@epita.fr>
7014
7015 * tests/actions.at (Mid-rule actions): Output on a single line
7016 instead of several.
7017
7018 2001-12-29 Akim Demaille <akim@epita.fr>
7019
7020 * doc/bison.texinfo: Formatting changes.
7021
7022 2001-12-29 Akim Demaille <akim@epita.fr>
7023
7024 Don't store the token defs in a muscle, just be ready to output it
7025 on command. Now possible via `symbols'. Fixes a memory leak.
7026
7027 * src/output.c (token_definitions_output): New.
7028 (output_parser, header_output): Use it.
7029 * src/reader.c (symbols_save): Remove.
7030
7031 2001-12-29 Akim Demaille <akim@epita.fr>
7032
7033 * src/bison.simple: Do not provide a default for YYSTYPE and
7034 YYLTYPE before the user's prologue. Otherwise it's hardly... a
7035 default.
7036
7037 2001-12-29 Akim Demaille <akim@epita.fr>
7038
7039 Mid-rule actions are simply... ignored!
7040
7041 * src/reader.c (readgram): Be sure to attach mid-rule actions to
7042 the empty-rule associated to the dummy symbol, not to the host
7043 rule.
7044 * tests/actions.at (Mid-rule actions): New.
7045
7046 2001-12-29 Akim Demaille <akim@epita.fr>
7047
7048 Memory leak.
7049
7050 * src/reader.c (reader): Free grammar.
7051
7052 2001-12-29 Akim Demaille <akim@epita.fr>
7053
7054 Memory leak.
7055
7056 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
7057 since it allocates it for each state, although only one is needed.
7058 (allocate_storage): Do it here.
7059
7060 2001-12-29 Akim Demaille <akim@epita.fr>
7061
7062 * src/options.h, src/options.c (create_long_option_table): Rename
7063 as...
7064 (long_option_table_new): this, with a clearer prototype.
7065 (percent_table): Remove, unused,
7066 * src/getargs.c (getargs): Adjust.
7067
7068 2001-12-29 Akim Demaille <akim@epita.fr>
7069
7070 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
7071 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
7072 as states.
7073
7074 2001-12-29 Akim Demaille <akim@epita.fr>
7075
7076 * src/lalr.c (build_relations): Rename `states' as `states1'.
7077 Sorry, I don't understand exactly what it is, no better name...
7078
7079 2001-12-29 Akim Demaille <akim@epita.fr>
7080
7081 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
7082 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
7083 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
7084 as rules.
7085
7086 2001-12-29 Akim Demaille <akim@epita.fr>
7087
7088 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
7089 ago.
7090
7091 2001-12-29 Akim Demaille <akim@epita.fr>
7092
7093 * src/reader.c, src/reader.h (user_toknums): Remove.
7094 Adjust all users to use symbols[i]->user_token_number.
7095
7096 2001-12-29 Akim Demaille <akim@epita.fr>
7097
7098 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
7099 Adjust all users to use symbols[i]->prec or ->assoc.
7100
7101 2001-12-29 Akim Demaille <akim@epita.fr>
7102
7103 * src/reader.c, src/reader.h (tags): Remove.
7104 Adjust all users to use symbols[i]->tag.
7105
7106 2001-12-29 Akim Demaille <akim@epita.fr>
7107
7108 * src/gram.h, src/gram.c (symbols): New, similar to state_table
7109 and rule_table.
7110 * src/reader.c (packsymbols): Fill this table.
7111 Drop sprec.
7112 * src/conflicts.c (resolve_sr_conflict): Adjust.
7113 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
7114 single table.
7115 Use symbols[i]->tag instead of tags[i].
7116
7117 2001-12-29 Akim Demaille <akim@epita.fr>
7118
7119 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
7120 In addition, put a comment in there, to replace...
7121 * tests/regression.at (%union and C comments): Remove.
7122
7123 2001-12-29 Akim Demaille <akim@epita.fr>
7124
7125 * tests/regression.at (Web2c Actions): Blindly move the actual
7126 output as expected output. The contents *seem* right to me, but I
7127 can't pretend reading perfectly parser tables... Nonetheless, all
7128 the other tests pass correctly, the table look OK, even though the
7129 presence of `$axiom' is to be noted: AFAICS it is useless (but
7130 harmless).
7131
7132 2001-12-29 Akim Demaille <akim@epita.fr>
7133
7134 * src/reader.c (readgram): Don't add the rule 0 if there were no
7135 rules read. In other words, add it _after_ having performed
7136 grammar sanity checks.
7137 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
7138
7139 2001-12-29 Akim Demaille <akim@epita.fr>
7140
7141 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
7142 visible, and some states have now a different number.
7143
7144 2001-12-29 Akim Demaille <akim@epita.fr>
7145
7146 * src/reader.c (readgram): Bind the initial rule's lineno to that
7147 of the first rule.
7148 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
7149 (Solved SR Conflicts): Adjust rule 0's line number.
7150
7151 2001-12-29 Akim Demaille <akim@epita.fr>
7152
7153 Fix the `GAWK Grammar' failure.
7154
7155 * src/LR0.c (final_state): Initialize to -1 so that we do compute
7156 the reductions of the first state which was mistakenly confused
7157 with the final state because precisely final_state was initialized
7158 to 0.
7159 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
7160 now noticed by Bison.
7161 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
7162 have a reduction on $default.
7163
7164 2001-12-29 Akim Demaille <akim@epita.fr>
7165
7166 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
7167 rule line numbers.
7168 * src/closure.c (print_closure): Likewise.
7169 * src/derives.c (print_derives): Likewise.
7170 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
7171 now.
7172
7173 2001-12-29 Akim Demaille <akim@epita.fr>
7174
7175 * src/lalr.c (lookaheads_print): New.
7176 (lalr): Call it when --trace-flag.
7177 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
7178 are dumped.
7179
7180 2001-12-29 Akim Demaille <akim@epita.fr>
7181
7182 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
7183 when walking through ritem, even via rule->rhs.
7184 * src/reduce.c (dump_grammar, useful_production, reduce_output)
7185 (useful_production, useless_nonterminals): Likewise.
7186 (reduce_grammar_tables): Likewise, plus update nritems.
7187 * src/nullable.c (set_nullable): Likewise.
7188 * src/lalr.c (build_relations): Likewise.
7189 * tests/sets.at (Nullable): Adjust.
7190 Fortunately, now, the $axiom is no longer nullable.
7191
7192 2001-12-29 Akim Demaille <akim@epita.fr>
7193
7194 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
7195 the 0-sentinel.
7196 * src/gram.c (ritem_longest_rhs): Likewise.
7197 * src/reduce.c (nonterminals_reduce): Likewise.
7198 * src/print_graph.c (print_graph): Likewise.
7199 * src/output.c (output_rule_data): Likewise.
7200 * src/nullable.c (set_nullable): Likewise.
7201
7202 2001-12-29 Akim Demaille <akim@epita.fr>
7203
7204 * src/output.c: Comment changes.
7205
7206 2001-12-27 Paul Eggert <eggert@twinsun.com>
7207
7208 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
7209 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
7210 Sparc, as they were causing more porting problems than the
7211 (minor) performance improvement was worth.
7212
7213 Also, catch up with 1.31's YYSTD.
7214
7215 2001-12-27 Akim Demaille <akim@epita.fr>
7216
7217 * src/output.c (output_gram): Rely on nritems, not the
7218 0-sentinel. See below.
7219 Use -1 as separator, not 0.
7220 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
7221 Rely on -1 as separator in yyrhs, instead of 0.
7222 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
7223 twice `Now at end of input', therefore there are two lines less to
7224 expect.
7225
7226 2001-12-27 Akim Demaille <akim@epita.fr>
7227
7228 * tests/regression.at (Unresolved SR Conflicts):
7229 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
7230 below.
7231
7232 2001-12-27 Akim Demaille <akim@epita.fr>
7233
7234 * src/LR0.c (new_state): Recognize the final state by the fact it
7235 is reached by eoftoken.
7236 (insert_start_shifting_state, insert_eof_shifting_state)
7237 (insert_accepting_state, augment_automaton): Remove, since now
7238 these states are automatically computed from the initial state.
7239 (generate_states): Adjust.
7240 * src/print.c: When reporting a rule number to the user, substract
7241 1, so that the axiom rule is rule 0, and the first user rule is 1.
7242 * src/reduce.c: Likewise.
7243 * src/print_graph.c (print_core): For the time being, just as for
7244 the report, depend upon --trace-flags to dump the full set of
7245 items.
7246 * src/reader.c (readgram): Once the grammar read, insert the rule
7247 0: `$axiom: START-SYMBOL $'.
7248 * tests/set.at: Adjust: rule 0 is now displayed, and since the
7249 number of the states has changed (the final state is no longer
7250 necessarily the last), catch up.
7251
7252 2001-12-27 Akim Demaille <akim@epita.fr>
7253
7254 Try to make the use of the eoftoken valid. Given that its value
7255 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
7256 is used instead of > 0 where appropriate, (ii), depend upon nritems
7257 instead of the 0-sentinel.
7258
7259 * src/gram.h, src/gram.c (nritems): New.
7260 Expected to be duplication of nitems, but for the time being...
7261 * src/reader.c (packgram): Assert nritems and nitems are equal.
7262 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
7263 * src/closure.c (print_closure, print_fderives): Likewise.
7264 * src/gram.c (ritem_print): Likewise.
7265 * src/print.c (print_core, print_grammar): Likewise.
7266 * src/print_graph.c: Likewise.
7267
7268 2001-12-27 Akim Demaille <akim@epita.fr>
7269
7270 * src/main.c (main): If there are complains after grammar
7271 reductions, then output the report anyway if requested, then die.
7272 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
7273 * src/reader.c (eoftoken): New.
7274 (parse_token_decl): If the token being defined has value `0', it
7275 is the eoftoken.
7276 (packsymbols): No longer hack `tags' to insert `$' by hand.
7277 Be sure to preserve the value of the eoftoken.
7278 (reader): Make sure eoftoken is defined.
7279 Initialize nsyms to 0: now eoftoken is created just like the others.
7280 * src/print.c (print_grammar): Don't special case the eof token.
7281 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
7282 lie anyway, albeit pleasant.
7283 * tests/calc.at: Exercise error messages with eoftoken.
7284 Change the grammar so that empty input is invalid.
7285 Adjust expectations.
7286 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
7287
7288 2001-12-27 Akim Demaille <akim@epita.fr>
7289
7290 * configure.in: Check the protos of strchr ans strspn.
7291 Replace strchr if needed.
7292 * src/system.h: Provide the protos of strchr, strspn and memchr if
7293 missing.
7294 * lib/strchr.c: New.
7295 * src/reader.c (symbols_save): Use strchr.
7296
7297 2001-12-27 Akim Demaille <akim@epita.fr>
7298
7299 * src/print.c, src/print_graph.c (escape): New.
7300 Use it to quote the TAGS outputs.
7301 * src/print_graph.c (print_state): Now errors are in red, and
7302 reductions in green.
7303 Prefer high to wide: output the state number on a line of its own.
7304
7305 2001-12-27 Akim Demaille <akim@epita.fr>
7306
7307 * src/state.h, src/state.c (reductions_new): New.
7308 * src/LR0.c (set_state_table): Let all the states have a
7309 `reductions', even if reduced to 0.
7310 (save_reductions): Adjust.
7311 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
7312 * src/print.c (print_reductions, print_actions): Adjust.
7313 * src/output.c (action_row): Adjust.
7314
7315 2001-12-27 Akim Demaille <akim@epita.fr>
7316
7317 * src/state.h, src/state.c (errs_new, errs_dup): New.
7318 * src/LR0.c (set_state_table): Let all the states have an errs,
7319 even if reduced to 0.
7320 * src/print.c (print_errs, print_reductions): Adjust.
7321 * src/output.c (output_actions, action_row): Adjust.
7322 * src/conflicts.c (resolve_sr_conflict): Adjust.
7323
7324 2001-12-27 Akim Demaille <akim@epita.fr>
7325
7326 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
7327
7328 2001-12-27 Akim Demaille <akim@epita.fr>
7329
7330 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
7331 * src/print.c: here.
7332 (lookaheadset, shiftset): New, used as additional storage by
7333 print_reductions.
7334 (print_results): Adjust.
7335 (print_shifts, print_gotos, print_errs): New, extracted from...
7336 (print_actions): here.
7337 * src/print_graph.c (print_actions): Remove dead code.
7338
7339 2001-12-27 Akim Demaille <akim@epita.fr>
7340
7341 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
7342 `$n' and `@n'.
7343
7344 2001-12-27 Akim Demaille <akim@epita.fr>
7345
7346 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
7347 (build_relations): Adjust.
7348
7349 2001-12-27 Akim Demaille <akim@epita.fr>
7350
7351 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
7352 duplication.
7353
7354 2001-12-27 Akim Demaille <akim@epita.fr>
7355
7356 * src/reader.c (packgram): Catch nitems overflows.
7357
7358 2001-12-27 Akim Demaille <akim@epita.fr>
7359
7360 * src/files.c, src/files.h (guard_obstack): Remove.
7361 * src/output.c (output): Adjust.
7362 * src/reader.c (parse_braces): New, factoring...
7363 (copy_action, copy_guard): these two which are renamed as...
7364 (parse_action, parse_guard): these.
7365 As a voluntary consequence, using braces around guards is now
7366 mandatory.
7367
7368 2001-12-27 Akim Demaille <akim@epita.fr>
7369
7370 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
7371 * src/reader.c (symbol_list): `guard' and `guard_line' are new
7372 members.
7373 (symbol_list_new): Adjust.
7374 (copy_action): action_line is the first line, not the last.
7375 (copy_guard): Just as for actions, store the `action' only, not
7376 the switch/case/break flesh.
7377 Don't parse the user action that might follow the guard, let...
7378 (readgram): do it, i.e., now, there can be an action after a
7379 guard.
7380 In other words the guard is just explicitly optional.
7381 (packgram): Adjust.
7382 * src/output.c (guards_output): New.
7383 (output_parser): Call it when needed.
7384 (output): Also free the guard and attrs obstacks.
7385 * src/files.c, src/files.h (obstack_save): Remove.
7386 (output_files): Remove.
7387 As a result, if one needs the former `.act' file, using an
7388 appropriate skeleton which requires actions and guards is now
7389 required.
7390 * src/main.c (main): Adjust.
7391 * tests/semantic.at: New.
7392 * tests/regression.at: Use `input.y' as input file name.
7393 Avoid 8+3 problems by requiring input.c when the test needs the
7394 parser.
7395
7396 2001-12-27 Akim Demaille <akim@epita.fr>
7397
7398 * src/reader.c (symbol_list_new): Be sure to initialize all the
7399 fields.
7400
7401 2001-12-27 Akim Demaille <akim@epita.fr>
7402
7403 All the hacks using a final pseudo state are now useless.
7404
7405 * src/LR0.c (set_state_table): state_table holds exactly nstates.
7406 * src/lalr.c (nLA): New.
7407 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
7408 instead of lookaheadsp from the pseudo state (nstate + 1).
7409
7410 2001-12-27 Akim Demaille <akim@epita.fr>
7411
7412 * src/output.c (action_row, token_actions): Use a state_t instead
7413 of a integer, and nlookaheads instead of the following state's
7414 lookaheadsp.
7415
7416 2001-12-27 Akim Demaille <akim@epita.fr>
7417
7418 * src/conflicts.c (log_resolution, flush_shift)
7419 (resolve_sr_conflict, set_conflicts, solve_conflicts)
7420 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
7421 (conflicts_print, print_reductions): Use a state_t instead of an
7422 integer when referring to a state.
7423 As much as possible, depend upon nlookaheads, instead of the
7424 `lookaheadsp' member of the following state (since lookaheads of
7425 successive states are successive, the difference between state n + 1
7426 and n served as the number of lookaheads for state n).
7427 * src/lalr.c (add_lookback_edge): Likewise.
7428 * src/print.c (print_core, print_actions, print_state)
7429 (print_results): Likewise.
7430 * src/print_graph.c (print_core, print_actions, print_state)
7431 (print_graph): Likewise.
7432 * src/conflicts.h: Adjust.
7433
7434 2001-12-27 Akim Demaille <akim@epita.fr>
7435
7436 * src/bison.hairy: Formatting/comment changes.
7437 ANSIfy.
7438 Remove `register' indications.
7439 Add plenty of `static'.
7440
7441 2001-12-27 Akim Demaille <akim@epita.fr>
7442
7443 * src/output.c (prepare): Drop the muscle `ntbase' which
7444 duplicates ntokens.
7445 * src/bison.simple: Formatting/comment changes.
7446 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
7447 is an undocumented synonym.
7448
7449 2001-12-22 Akim Demaille <akim@epita.fr>
7450
7451 * src/output.c (output_table_data): Change the prototype to use
7452 `int' for array ranges: some invocations do pass an int, not a
7453 short.
7454 Reported by Wayne Green.
7455
7456 2001-12-22 Akim Demaille <akim@epita.fr>
7457
7458 Some actions of web2c.y are improperly triggered.
7459 Reported by Mike Castle.
7460
7461 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
7462 * tests/regression.at (Web2c): Rename as...
7463 (Web2c Report): this.
7464 (Web2c Actions): New.
7465
7466 2001-12-22 Akim Demaille <akim@epita.fr>
7467
7468 Reductions in web2c.y are improperly reported.
7469 Reported by Mike Castle.
7470
7471 * src/conflicts.c (print_reductions): Fix.
7472 * tests/regression.at (Web2c): New.
7473
7474 2001-12-18 Akim Demaille <akim@epita.fr>
7475
7476 Some host fail on `assert (!"foo")', which expands to
7477 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
7478 Reported by Nelson Beebee.
7479
7480 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
7481 `#define it_succeeded 0' and `assert (it_succeeded)'.
7482
7483 2001-12-17 Marc Autret <autret_m@epita.fr>
7484
7485 * src/bison.simple: Don't hard code the skeleton line and filename.
7486 * src/output.c (output_parser): Rename 'line' as 'output_line'.
7487 New line counter 'skeleton_line' (skeleton-line muscle).
7488
7489 2001-12-17 Paul Eggert <eggert@twinsun.com>
7490
7491 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
7492 YYDEBUG must be defined to a nonzero value.
7493
7494 * src/bison.simple (yytname): Do not assume that the user defines
7495 YYDEBUG to a properly parenthesized expression.
7496
7497 2001-12-17 Akim Demaille <akim@epita.fr>
7498
7499 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
7500 nlookaheads is a new member.
7501 Adjust all users.
7502 * src/lalr.h (nlookaheads): Remove this orphan declaration.
7503 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
7504 state.
7505
7506 2001-12-17 Akim Demaille <akim@epita.fr>
7507
7508 * src/files.h, src/files.c (open_files, close_files): Remove.
7509 * src/main.c (main): Don't open/close files, nor invoke lex_free,
7510 let...
7511 * src/reader.c (reader): Do it.
7512
7513 2001-12-17 Akim Demaille <akim@epita.fr>
7514
7515 * src/conflicts.c (print_reductions): Formatting changes.
7516
7517 2001-12-17 Akim Demaille <akim@epita.fr>
7518
7519 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
7520 (flush_reduce): New.
7521 (resolve_sr_conflict): Adjust.
7522
7523 2001-12-17 Akim Demaille <akim@epita.fr>
7524
7525 * src/output.c (output_obstack): Be static and rename as...
7526 (format_obstack): this, to avoid any confusion with files.c's
7527 output_obstack.
7528 * src/reader.h (muscle_obstack): Move to...
7529 * src/output.h: here, since it's defined in output.c.
7530
7531 2001-12-17 Akim Demaille <akim@epita.fr>
7532
7533 * src/output.c (action_row, save_column, default_goto)
7534 (sort_actions, matching_state, pack_vector): Better variable
7535 locality.
7536
7537 2001-12-17 Akim Demaille <akim@epita.fr>
7538
7539 * src/output.c: Various formatting changes.
7540
7541 2001-12-17 Akim Demaille <akim@epita.fr>
7542
7543 * src/files.c (output_files): Free the output_obstack.
7544 * src/main.c (main): Call print and print_graph conditionally.
7545 * src/print.c (print): Work unconditionally.
7546 * src/print_graph.c (print_graph): Work unconditionally.
7547 * src/conflicts.c (log_resolution): Output only if verbose_flag.
7548
7549 2001-12-16 Marc Autret <autret_m@epita.fr>
7550
7551 * src/output.c (actions_output): Fix. When we use %no-lines,
7552 there is one less line per action.
7553
7554 2001-12-16 Marc Autret <autret_m@epita.fr>
7555
7556 * src/bison.simple: Remove a useless #line directive.
7557 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
7558 * src/output.c (get_lines_number): New.
7559 (output_parser): Adjust, now takes care about the lines of a
7560 output muscles.
7561 Fix line numbering.
7562 (actions_output): Computes the number of lines taken by actions.
7563 (output_master_parser): Insert new skeleton which is the name of
7564 the output parser file name.
7565
7566 2001-12-15 Marc Autret <autret_m@epita.fr>
7567
7568 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
7569
7570 2001-12-15 Marc Autret <autret_m@epita.fr>
7571
7572 * src/output.c (output_gram): Keep track of the hairy one.
7573
7574 2001-12-15 Akim Demaille <akim@epita.fr>
7575
7576 Make `make distcheck' work.
7577
7578 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
7579 system.h which uses libgettext.h.
7580
7581 2001-12-15 Akim Demaille <akim@epita.fr>
7582
7583 * src/nullable.c (set_nullable): Useless rules must be skipped,
7584 otherwise, since we range over their symbols, we might look at a
7585 nonterminal which no longer ``exists'', i.e., it is not counted in
7586 `nvars', hence we overflow our arrays.
7587
7588 2001-12-15 Akim Demaille <akim@epita.fr>
7589
7590 The header can also be produced directly, without any obstack!
7591 Yahoo!
7592
7593 * src/files.c, src/files.h (defines_obstack): Remove.
7594 (compute_header_macro): Global.
7595 (defines_obstack_save): Remove.
7596 * src/reader.c (parse_union_decl): No longer output to
7597 defines_obstack: its content can be found in the `stype' muscle
7598 anyway.
7599 (output_token_translations): Merge into...
7600 (symbols_output): this.
7601 Rename as...
7602 (symbols_save): this.
7603 (reader): Adjust.
7604 * src/output.c (header_output): New.
7605 (output): Call it.
7606
7607 2001-12-15 Akim Demaille <akim@epita.fr>
7608
7609 * src/reader.c (parse_union_decl): Instead of handling two obstack
7610 simultaneously, use one to define the `stype' muscle, and use the
7611 value of the latter to fill defines_obstack.
7612 (copy_comment): Remove.
7613 (copy_comment2): Work for a single obstack.
7614 Rename as...
7615 (copy_comment): this.
7616
7617 2001-12-15 Akim Demaille <akim@epita.fr>
7618
7619 * src/lex.c, src/lex.h (xgetc): No longer static.
7620 * src/reader.c (parse_union_decl): Revamp.
7621
7622 2001-12-15 Akim Demaille <akim@epita.fr>
7623
7624 Still making progress in separating Bison into (i) input, (ii)
7625 process, (iii) output: now we can directly output the parser file
7626 without using table_obstack at all.
7627
7628 * src/files.c, src/files.h (table_obstack): Bye bye.
7629 (parser_file_name): New.
7630 * src/files.c (compute_output_file_names): Compute it.
7631 * src/output.c (actions_output, output_parser)
7632 (output_master_parser): To a file instead of an obstack.
7633
7634 2001-12-15 Akim Demaille <akim@epita.fr>
7635
7636 Attach actions to rules, instead of pre-outputting them to
7637 actions_obstack.
7638
7639 * src/gram.h (rule_t): action and action_line are new members.
7640 * src/reader.c (symbol_list): Likewise.
7641 (copy_action): Save the actions within the rule.
7642 (packgram): Save them in rule_table.
7643 * src/output.c (actions_output): New.
7644 (output_parser): Use it on `%%actions'.
7645 (output_rule_data): Don't free rule_table.
7646 (output): Do it.
7647 (prepare): Don't save the `action' muscle.
7648 * src/bison.simple: s/%%action/%%actions/.
7649
7650 2001-12-15 Akim Demaille <akim@epita.fr>
7651
7652 * src/reader.c (copy_action): When --yacc, don't append a `;'
7653 to the user action: let it fail if lacking.
7654 Suggested by Arnold Robbins and Tom Tromey.
7655
7656 2001-12-14 Akim Demaille <akim@epita.fr>
7657
7658 * src/lex.c (literalchar): Simply return the char you decoded, non
7659 longer mess around with obstacks and int pointers.
7660 Adjust all callers.
7661
7662 2001-12-14 Akim Demaille <akim@epita.fr>
7663
7664 * src/lex.c (literalchar): Don't escape the special characters,
7665 just decode them, and keep them as char (before, eol was output as
7666 the 2 char string `\n' etc.).
7667 * src/output.c (output_rule_data): Use quotearg to output the
7668 token strings.
7669
7670 2001-12-13 Paul Eggert <eggert@twinsun.com>
7671
7672 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
7673 Do not infringe on the global user namespace when using C++.
7674 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
7675 All uses of `fprintf' and `stderr' changed.
7676
7677 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
7678
7679 2001-12-13 Akim Demaille <akim@epita.fr>
7680
7681 The computation of nullable is broken: it doesn't handle empty
7682 RHS's properly.
7683
7684 * tests/torture.at (GNU AWK Grammar): New.
7685 * tests/sets.at (Nullable): New.
7686 * src/nullable.c (set_nullable): Instead of blindly looping over
7687 `ritems', loop over the rules, and then over their rhs's.
7688
7689 Work around Autotest bugs.
7690
7691 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
7692 frame, because Autotest understand lines starting with a `+' as
7693 traces from the shell. Then, they are not processed properly.
7694 Admittedly an Autotest bug, but we don't have time to wait for
7695 Autotest to catch up.
7696 * tests/regression.at (Broken Closure): Adjust to the new table
7697 frames.
7698 Move to...
7699 * tests/sets.at: here.
7700
7701 2001-12-13 Akim Demaille <akim@epita.fr>
7702
7703 * src/closure.c (closure): Use nrules instead of playing tricks
7704 with BITS_PER_WORD.
7705
7706 2001-12-13 Akim Demaille <akim@epita.fr>
7707
7708 * src/print.c (print_actions): Output the handling of `$' as the
7709 traces do: shifting the token EOF. Before EOF was treated as a
7710 nonterminal.
7711 * tests/regression.at: Adjust some tests.
7712 * src/print_graph.c (print_core): Complete the set of items via
7713 closure. The next-to-final and final states are still unsatisfying,
7714 but that's to be addressed elsewhere.
7715 No longer output the rule numbers, but do output the state number.
7716 A single loop for the shifts + gotos is enough, but picked a
7717 distinct color for each.
7718 (print_graph): Initialize and finalize closure.
7719
7720 2001-12-13 Akim Demaille <akim@epita.fr>
7721
7722 * src/reader.c (readgram): Remove dead code, an strip useless
7723 braces.
7724 (get_type): Remove, unused.
7725
7726 2001-12-12 Akim Demaille <akim@epita.fr>
7727
7728 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
7729 on that of lib/error.c.
7730
7731 2001-12-12 Akim Demaille <akim@epita.fr>
7732
7733 Some hosts don't like `/' in includes.
7734
7735 * src/system.h: Include libgettext.h without qualifying the path.
7736 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
7737 $(top_srcdir).
7738
7739 2001-12-11 Marc Autret <autret_m@epita.fr>
7740
7741 * src/output.c (output_parser): Remove useless muscle.
7742
7743 2001-12-11 Marc Autret <autret_m@epita.fr>
7744
7745 * src/bison.simple: Remove #line just before %%epilogue. It
7746 is now handled in ...
7747 * src/reader.c (read_additionnal_code): Add the output of a
7748 #line for the epilogue.
7749
7750 2001-12-10 Marc Autret <autret_m@epita.fr>
7751
7752 * src/reader.c (copy_definition): Re-use CPP-outed code which
7753 replace precedent remove.
7754 * src/bison.simple: Remove #line before %%prologue because
7755 %%input-line is wrong at this time.
7756
7757 2001-12-10 Marc Autret <autret_m@epita.fr>
7758
7759 * src/reader.c (symbols_output): Clean up.
7760 * src/output.c (output_gram, output): Clean up.
7761
7762 2001-12-10 Akim Demaille <akim@epita.fr>
7763
7764 * src/lalr.c (initialize_lookaheads): New. Extracted from...
7765 * src/LR0.c (set_state_table): here.
7766 * src/lalr.c (lalr): Call it.
7767
7768 2001-12-10 Akim Demaille <akim@epita.fr>
7769
7770 * src/state.h (shifts): Remove the `number' member: shifts are
7771 attached to state, hence no longer need to be labelled with a
7772 state number.
7773
7774 2001-12-10 Akim Demaille <akim@epita.fr>
7775
7776 Now that states have a complete set of members, the linked list of
7777 shifts is useless: just fill directly the state's shifts member.
7778
7779 * src/state.h (shifts): Remove the `next' member.
7780 * src/LR0.c (first_state, last_state): Remove.
7781 Adjust the callers.
7782 (augment_automaton): Don't look for the shifts that must be added
7783 a shift on EOF: it is those of the state we looked for! But now,
7784 since shifts are attached, it is no longer needed to looking
7785 merely by its id: its number.
7786
7787 2001-12-10 Akim Demaille <akim@epita.fr>
7788
7789 * src/LR0.c (augment_automaton): Better variable locality.
7790 Remove an impossible branch: if there is a state corresponding to
7791 the start symbol being shifted, then there is shift for the start
7792 symbol from the initial state.
7793
7794 2001-12-10 Akim Demaille <akim@epita.fr>
7795
7796 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
7797 only when appropriate: when insert_start_shifting_state' is not
7798 invoked.
7799 * tests/regression.at (Rule Line Numbers): Adjust.
7800
7801 2001-12-10 Akim Demaille <akim@epita.fr>
7802
7803 * src/LR0.c (augment_automaton): Now that all states have shifts,
7804 merge the two cases addition shifts to the initial state.
7805
7806 2001-12-10 Akim Demaille <akim@epita.fr>
7807
7808 * src/lalr.c (set_state_table): Move to...
7809 * src/LR0.c: here.
7810 * src/lalr.c (lalr): Don't call it...
7811 * src/LR0.c (generate_states): do it.
7812 * src/LR0.h (first_state): Remove, only the table is used.
7813
7814 2001-12-10 Akim Demaille <akim@epita.fr>
7815
7816 * src/LR0.h (first_shift, first_reduction): Remove.
7817 * src/lalr.c: Don't use first_shift: find shifts through the
7818 states.
7819
7820 2001-12-10 Akim Demaille <akim@epita.fr>
7821
7822 * src/LR0.c: Attach shifts to states as soon as they are
7823 computed.
7824 * src/lalr.c (set_state_table): Instead of assigning shifts to
7825 state, just assert that the mapping was properly done.
7826
7827 2001-12-10 Akim Demaille <akim@epita.fr>
7828
7829 * src/LR0.c (insert_start_shift): Rename as...
7830 (insert_start_shifting_state): this.
7831 (insert_eof_shifting_state, insert_accepting_state): New.
7832 (augment_automaton): Adjust.
7833 Better locality of the variables.
7834 When looking if the start_symbol is shifted from the initial
7835 state, using `while (... symbol != start_symbol ...)' sounds
7836 better than `while (... symbol < start_symbol ...)': If fail
7837 to see how the order between symbols could be relevant!
7838
7839 2001-12-10 Akim Demaille <akim@epita.fr>
7840
7841 * src/getargs.h: Don't declare `spec_name_prefix' and
7842 `spec_file_prefix', declared by src/files.h.
7843 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
7844 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
7845 * src/output.c (prepare): Adjust.
7846 * src/reader.c (symbols_output): Likewise.
7847 * src/vmsgetargs.c: Vaguely adjust, but who cares?
7848
7849 2001-12-10 Akim Demaille <akim@epita.fr>
7850
7851 * src/muscle_tab.c (muscle_init): NULL is a better default than
7852 `"0"'.
7853
7854 2001-12-10 Akim Demaille <akim@epita.fr>
7855
7856 * src/reader.c (reader): Calling symbols_output once is enough.
7857
7858 2001-12-10 Akim Demaille <akim@epita.fr>
7859
7860 Now that states have a complete set of members, the linked list of
7861 reductions is useless: just fill directly the state's reductions
7862 member.
7863
7864 * src/state.h (struct reductions): Remove member `number' and
7865 `next'.
7866 * src/LR0.c (first_reduction, last_reduction): Remove.
7867 (save_reductions): Don't link the new reductions, store them in
7868 this_state.
7869 * src/lalr.c (set_state_table): No need to attach reductions to
7870 states, it's already done.
7871 * src/output.c (output_actions): No longer free the shifts, then
7872 the reductions, then the states: free all the states and their
7873 members.
7874
7875 2001-12-10 Akim Demaille <akim@epita.fr>
7876
7877 * src/options.c (OPTN, DRTV, BOTH): New.
7878 (option_table): Use them.
7879
7880 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
7881 the job of system.h.
7882 * src/options.c: Don't include stdio.h and xalloc.h for the same
7883 reasons.
7884
7885 2001-12-10 Akim Demaille <akim@epita.fr>
7886
7887 * src/output.c (output, prepare): Make sure the values of the
7888 muscles `action' and `prologue' are 0-terminated.
7889
7890 2001-12-10 Akim Demaille <akim@epita.fr>
7891
7892 Clean up GCC warnings.
7893
7894 * src/reader.c (copy_action): `buf' is not used.
7895 (parse_skel_decl): Be static.
7896 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
7897 * src/options.h (create_long_option_table): Have a real prototype.
7898 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
7899 (hash_delete_at): Return const void *.
7900 Adjust casts to preserve the const.
7901
7902 2001-12-10 Akim Demaille <akim@epita.fr>
7903
7904 * configure.in: Require 2.52g.
7905 M4 is not needed, but AUTOM4TE is.
7906 * m4/m4.m4: Remove.
7907 * tests/Makefile.am: Adjust.
7908
7909 2001-12-10 Akim Demaille <akim@epita.fr>
7910
7911 One structure for states is enough, even though theoretically
7912 there are LR(0) states and LALR(1) states.
7913
7914 * src/lalr.h (state_t): Remove.
7915 (state_table): Be state_t **, not state_t *.
7916 * src/state.h (core, CORE_ALLOC): Rename as...
7917 (state_t, STATE_ALLOC): this.
7918 Add the LALR(1) members: shifts, reductions, errs.
7919 * src/LR0.c (state_table): Rename as...
7920 (state_hash): this, to avoid name clashes with the global
7921 `state_table'.
7922 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
7923 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
7924
7925 2001-12-10 Akim Demaille <akim@epita.fr>
7926
7927 Bison dumps core on bash.y.
7928 Reported by Pascal Bart.
7929
7930 * src/warshall.c (bitmatrix_print): New.
7931 (TC): Use it.
7932 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
7933 j must be the outer loop.
7934 * tests/regression.at (Broken Closure): New.
7935
7936 2001-12-05 Akim Demaille <akim@epita.fr>
7937
7938 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
7939 its argument.
7940 Reported by Peter Hamorsky.
7941
7942 2001-12-05 Akim Demaille <akim@epita.fr>
7943
7944 * src/conflicts.c (err_table): Remove.
7945 (resolve_sr_conflict): Adjust.
7946 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
7947 Rename as...
7948 (state_t.reductions, state_t.shifts): this.
7949
7950 2001-12-05 Akim Demaille <akim@epita.fr>
7951
7952 * src/reduce.c (reduce_grammar_tables): No longer disable the
7953 removal of useless rules via CPP but via `if (0)', so that the
7954 compiler still check the code is valid.
7955 For instance, it should have noticed `rline' no longer exists: use
7956 the `line' member of rule_t.
7957 * src/gram.c (dummy, rline): Remove, unused.
7958
7959 2001-12-05 Akim Demaille <akim@epita.fr>
7960
7961 * src/output.c (pack_vector): Use assert, not berror.
7962 * src/main.c (berror): Remove, unused.
7963
7964 2001-12-05 Akim Demaille <akim@epita.fr>
7965
7966 New experimental feature: if --verbose --trace output all the
7967 items of a state, not only its kernel.
7968
7969 * src/print.c (print_core): If `trace_flag', then invoke closure
7970 before outputting the items of the state (print_core is no longer
7971 a correct name them).
7972 (print_results): Invoke new_closure/free_closure if needed.
7973
7974 2001-12-05 Akim Demaille <akim@epita.fr>
7975
7976 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
7977 * src/closure.c, src/closure.h (itemsetsize): Rename as...
7978 (nitemset): for consistency with the rest of the project.
7979
7980 2001-12-05 Akim Demaille <akim@epita.fr>
7981
7982 * src/closure.c (print_closure): Improve.
7983 (closure): Use it for printing input and output.
7984
7985 2001-12-05 Akim Demaille <akim@epita.fr>
7986
7987 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
7988 indexed by nonterminals.
7989
7990 2001-12-05 Akim Demaille <akim@epita.fr>
7991
7992 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
7993 what it was!).
7994 * src/warshall.h: Remove accidental duplication of the content.
7995
7996 2001-12-05 Akim Demaille <akim@epita.fr>
7997
7998 * src/closure.c (set_fderives): De-obfuscate.
7999
8000 2001-12-05 Akim Demaille <akim@epita.fr>
8001
8002 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
8003
8004 2001-12-05 Akim Demaille <akim@epita.fr>
8005
8006 * src/closure.c (set_firsts): De-obfuscate.
8007
8008 2001-12-05 Akim Demaille <akim@epita.fr>
8009
8010 * src/output.c (action_row): De-obfuscate
8011 using the good o' techniques: arrays not pointers, variable
8012 locality, BITISSET, RESETBIT etc.
8013
8014 2001-12-05 Akim Demaille <akim@epita.fr>
8015
8016 Pessimize the code to simplify it: from now on, all the states
8017 have a valid SHIFTS, which NSHIFTS is possibly 0.
8018
8019 * src/LR0.c (shifts_new): Be global and move to..
8020 * src/state.c, src/state.h: here.
8021 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
8022 * src/print_graph: Adjust.
8023
8024 2001-12-05 Akim Demaille <akim@epita.fr>
8025
8026 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
8027 * src/conflicts.c: Use it.
8028 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
8029 incorrectly ``simplified''.
8030
8031 2001-12-05 Akim Demaille <akim@epita.fr>
8032
8033 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
8034 using the good o' techniques: arrays not pointers, variable
8035 locality, BITISSET, RESETBIT etc.
8036
8037 2001-12-05 Akim Demaille <akim@epita.fr>
8038
8039 * src/state.h (SHIFT_SYMBOL): New.
8040 * src/conflicts.c: Use it to deobfuscate.
8041
8042 2001-12-05 Akim Demaille <akim@epita.fr>
8043
8044 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
8045 (print_reductions): De-obfuscate using the good o' techniques:
8046 arrays not pointers, variable locality, BITISSET.
8047
8048 2001-12-05 Akim Demaille <akim@epita.fr>
8049
8050 * src/conflicts.c (print_reductions): Arrays, not pointers.
8051 Use BITISSET.
8052
8053 2001-12-05 Akim Demaille <akim@epita.fr>
8054
8055 * src/conflicts.c (print_reductions): Pessimize, but clarify.
8056
8057 2001-12-05 Akim Demaille <akim@epita.fr>
8058
8059 * src/conflicts.c (print_reductions): Improve variable locality.
8060
8061 2001-12-05 Akim Demaille <akim@epita.fr>
8062
8063 * src/conflicts.c (print_reductions): Pessimize, but clarify.
8064
8065 2001-12-05 Akim Demaille <akim@epita.fr>
8066
8067 * src/conflicts.c (print_reductions): Improve variable locality.
8068
8069 2001-12-05 Akim Demaille <akim@epita.fr>
8070
8071 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
8072 * src/lalr.c: Use them.
8073
8074 2001-12-05 Akim Demaille <akim@epita.fr>
8075
8076 * src/LR0.c (augment_automaton): Formatting changes.
8077 Better variable locality.
8078
8079 2001-12-05 Akim Demaille <akim@epita.fr>
8080
8081 * src/lalr.c (matrix_print): New.
8082 (transpose): Use it.
8083 Use arrays instead of pointers.
8084
8085 2001-12-05 Akim Demaille <akim@epita.fr>
8086
8087 * src/lalr.c (maxrhs): Move to...
8088 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
8089 * src/lalr.c (build_relations): Adjust.
8090
8091 2001-12-05 Akim Demaille <akim@epita.fr>
8092
8093 * src/lalr.c (transpose): Free the memory allocated to the
8094 argument, as it is replaced by the results by the unique caller.
8095 (build_relations): Merely invoke transpose: it handles the memory
8096 deallocation.
8097 Improve variable locality.
8098 Avoid variables used as mere abbreviations.
8099 (compute_lookaheads): Use arrays instead of pointers.
8100
8101 2001-12-05 Akim Demaille <akim@epita.fr>
8102
8103 * src/lalr.c (initialize_F): Improve variable locality.
8104 Avoid variables used as mere abbreviations.
8105
8106 2001-12-05 Akim Demaille <akim@epita.fr>
8107
8108 * src/derives.c (print_derives): Display the ruleno.
8109 * src/lalr.c (initialize_F, transpose): Better variable locality
8110 to improve readability.
8111 Avoid variables used as mere abbreviations.
8112
8113 2001-12-05 Akim Demaille <akim@epita.fr>
8114
8115 * src/lalr.c (traverse): Use arrays instead of pointers.
8116
8117 2001-12-05 Akim Demaille <akim@epita.fr>
8118
8119 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
8120 the handling of squeue.
8121 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
8122
8123 2001-12-05 Akim Demaille <akim@epita.fr>
8124
8125 Because useless nonterminals are now kept alive (instead of being
8126 `destroyed'), we now sometimes examine them, and store information
8127 related to them. Hence we need to know their number, and adjust
8128 memory allocations.
8129
8130 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
8131 static.
8132 * src/LR0.c (allocate_itemsets): The memory allocated to
8133 `symbol_count' was used for two different purpose: once to count
8134 the number of occurrences of each symbol, and later reassigned to
8135 `shift_symbol', containing the symbol that can be shifted from a
8136 given state.
8137 Deobfuscate, i.e., allocate, use and free `symbol_count' here
8138 only, and...
8139 (new_itemsets): Allocate `shift_symbol' here.
8140 (allocate_itemsets): symbol_count includes useless nonterminals.
8141 Make room for them.
8142 (free_storage): Use `free', not `XFREE', for pointers that cannot
8143 be null.
8144
8145 2001-12-05 Akim Demaille <akim@epita.fr>
8146
8147 * src/nullable.c (set_nullable): Deobfuscate the handling of
8148 ritem.
8149 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
8150
8151 2001-12-05 Akim Demaille <akim@epita.fr>
8152
8153 * src/gram.c, src/gram.h (ritem_print): New.
8154 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
8155 (This useless function was defined only to work around VMS linkers
8156 that can't handle compilation units with variables only).
8157 * src/reduce.c (dump_grammar): Use it to trace the construction of
8158 ritem.
8159
8160 2001-12-04 Paul Eggert <eggert@twinsun.com>
8161
8162 * src/bison.simple (union yyalloc): Change member names
8163 to be the same as the stack names.
8164 (yyparse): yyptr is now union yyalloc *, not char *.
8165 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
8166 and may generate better code on some machines.
8167 (yystpcpy): Use prototype if __STDC__ is defined, not just
8168 if __cplusplus is defined.
8169
8170 2001-11-30 Akim Demaille <akim@epita.fr>
8171
8172 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
8173 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
8174 Gettext doesn't compile cleanly, and dies with -Werror.
8175 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
8176 Include WARNING_CFLAGS here.
8177 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
8178 before being defined.
8179
8180 2001-11-27 Paul Eggert <eggert@twinsun.com>
8181
8182 * lib/quotearg.h (quotearg_n, quotearg_n_style):
8183 First arg is int, not unsigned.
8184 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8185 (SIZE_MAX, UINT_MAX): New macros.
8186 (quotearg_n_options): Abort if N is negative.
8187 Avoid overflow check on hosts where size_t is 64 bits and int
8188 is 32 bits, as overflow is impossible there.
8189 Fix off-by-one typo that caused unnecessary reallocation.
8190
8191 2001-11-29 Paul Eggert <eggert@twinsun.com>
8192
8193 Name space cleanup in generated parser.
8194
8195 * doc/bison.texinfo (Bison Parser): Discuss system headers
8196 and their effect on the user name space.
8197
8198 * src/bison.simple:
8199 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
8200 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
8201 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
8202
8203 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
8204 on user names when possible.
8205
8206 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
8207 Simplify test for whather <alloca.h> exists.
8208
8209 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
8210
8211 (<stdio.h>): Include if YYDEBUG.
8212
8213 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
8214 ! defined (yyoverflow) && ! defined (yymemcpy).
8215
8216 (yymemcpy, yyparse): Rename local variables as needed so that
8217 they all begin with 'yy'.
8218
8219 (yystrlen, yystpcpy): New functions.
8220
8221 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
8222 All uses changed.
8223
8224 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
8225 instead of relying on string.h functions. Use YYSTACK_ALLOC
8226 and YYSTACK_FREE instead of malloc and free.
8227
8228 2001-11-30 Akim Demaille <akim@epita.fr>
8229
8230 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
8231 before their first uses.
8232 (YYBISON, YYPURE): Move to the top of the output.
8233
8234 2001-11-30 Akim Demaille <akim@epita.fr>
8235
8236 * tests/reduce.at (Useless Nonterminals): Fix.
8237
8238 2001-11-30 Akim Demaille <akim@epita.fr>
8239
8240 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
8241 if body instead of `;' to pacify GCC's warnings.
8242
8243 2001-11-30 Akim Demaille <akim@epita.fr>
8244
8245 Instead of mapping the LHS of unused rules to -1, keep the LHS
8246 valid, but flag the rules as invalid.
8247
8248 * src/gram.h (rule_t): `useful' is a new member.
8249 * src/print.c (print_grammar): Adjust.
8250 * src/derives.c (set_derives): Likewise.
8251 * src/reader.c (packgram, reduce_output): Likewise.
8252 * src/reduce.c (reduce_grammar_tables): Likewise.
8253 * tests/reduce.at (Underivable Rules, Useless Rules): New.
8254
8255 2001-11-30 Akim Demaille <akim@epita.fr>
8256
8257 * src/reduce.c (reduce_output): Formatting changes.
8258 * src/print.c (print_results, print_grammar): Likewise.
8259 * tests/regression.at (Rule Line Numbers)
8260 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
8261
8262 2001-11-30 Akim Demaille <akim@epita.fr>
8263
8264 * src/reduce.c (nonterminals_reduce): Instead of throwing away
8265 useless nonterminals, move them at the end of the symbol arrays.
8266 (reduce_output): Adjust.
8267 * tests/reduce.at (Useless Nonterminals): Adjust.
8268
8269 2001-11-30 Akim Demaille <akim@epita.fr>
8270
8271 * src/reduce.c: Various comment/formatting changes.
8272 (nonterminals_reduce): New, extracted from...
8273 (reduce_grammar_tables): here.
8274 (reduce_grammar): Call nonterminals_reduce.
8275
8276 2001-11-29 Paul Eggert <eggert@twinsun.com>
8277
8278 * src/bison.simple (YYSTACK_REALLOC): Remove.
8279 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
8280 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
8281 New macros.
8282 (union yyalloc): New type.
8283 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
8284 an arbitrary restriction on hosts where size_t is wider than int.
8285
8286 (yyparse): Don't dump core if alloca or malloc fails; instead, report
8287 a parser stack overflow. Allocate just one block of memory for all
8288 three stacks, instead of allocating three blocks; this typically is
8289 faster and reduces fragmentation.
8290
8291 Do not limit the number of items in the stack to a value that fits
8292 in 'int', as this is an arbitrary limit on hosts with 64-bit
8293 size_t and 32-bit int.
8294
8295 2001-11-29 Marc Autret <autret_m@epita.fr>
8296
8297 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
8298 of defining YYERROR_VERBOSE.
8299 [AT_DATA]: $4 is now out of C declarations in the prologue.
8300
8301 2001-11-28 Marc Autret <autret_m@epita.fr>
8302
8303 * src/reader.c (parse_dquoted_param): New.
8304 (parse_skel_decl): Use it.
8305 * src/lex.h: Add its prototype.
8306 * src/lex.c (literalchar): Become not static.
8307
8308 2001-11-28 Marc Autret <autret_m@epita.fr>
8309
8310 * src/output.h: And put its extern declaration here.
8311 * src/output.c (error_verbose): Define here.
8312 (prepare): Echo name modification.
8313 * src/getargs.h: Clean its extern declaration.
8314 * src/getargs.c (error_verbose_flag): Remove.
8315 (getargs): Remove case 'e'.
8316 * src/options.c (option_table): 'error-verbose' is now seen as simple
8317 percent option.
8318 Include output.h.
8319
8320 * src/reader.c (read_declarations): Remove case tok_include.
8321 (parse_include_decl): Remove.
8322 * src/lex.h (token_t): Remove tok_include.
8323 * src/options.c (option_table): 'include' is now a simple command line
8324 option.
8325
8326 2001-11-28 Marc Autret <autret_m@epita.fr>
8327
8328 * src/bison.simple: Adjust muscle names.
8329 * src/muscle_tab.c (muscle_init): Also rename the muscles.
8330 * src/output.c (prepare): s/_/-/ for the muscles names.
8331 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
8332
8333 2001-11-28 Marc Autret <autret_m@epita.fr>
8334
8335 * src/bison.simple: Fix debug.
8336 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
8337
8338 2001-11-28 Akim Demaille <akim@epita.fr>
8339
8340 * src/LR0.c (shifts_new): New.
8341 (save_shifts, insert_start_shift, augment_automaton): Use it.
8342
8343 2001-11-28 Akim Demaille <akim@epita.fr>
8344
8345 * src/closure.c (closure): `b' and `ruleno' denote the same value:
8346 keep ruleno only.
8347
8348 2001-11-28 Akim Demaille <akim@epita.fr>
8349
8350 * src/closure.c (closure): Instead of looping over word in array
8351 then bits in words, loop over bits in array.
8352
8353 2001-11-28 Akim Demaille <akim@epita.fr>
8354
8355 * src/closure.c (closure): No longer optimize the special case
8356 where all the bits of `ruleset[r]' are set to 0, to make the code
8357 clearer.
8358
8359 2001-11-28 Akim Demaille <akim@epita.fr>
8360
8361 * src/closure.c (closure): `r' and `c' are new variables, used to
8362 de-obfuscate accesses to RULESET and CORE.
8363
8364 2001-11-28 Akim Demaille <akim@epita.fr>
8365
8366 * src/reduce.c (reduce_print): Use ngettext.
8367 (dump_grammar): Improve the trace accuracy.
8368
8369 2001-11-28 Akim Demaille <akim@epita.fr>
8370
8371 * src/reduce.c (dump_grammar): Don't translate trace messages.
8372
8373 2001-11-28 Akim Demaille <akim@epita.fr>
8374
8375 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
8376 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
8377 as all tags are free'ed afterwards.
8378 From Enrico Scholz.
8379
8380 2001-11-27 Paul Eggert <eggert@twinsun.com>
8381
8382 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
8383 use alloca when we didn't want to, and vice versa.
8384
8385 2001-11-27 Marc Autret <autret_m@epita.fr>
8386
8387 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
8388 initialization.
8389 * src/output.c (prepare): Remove its update.
8390
8391 2001-11-27 Marc Autret <autret_m@epita.fr>
8392
8393 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
8394 Use %error-verbose.
8395
8396 2001-11-27 Marc Autret <autret_m@epita.fr>
8397
8398 * src/bison.simple: Remove YYERROR_VERBOSE using.
8399 Use %%error_verbose.
8400 (yyparse): Likewise.
8401 * src/output.c (prepare): Give its final value.
8402 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
8403 * src/getargs.h: Add its extern declaration.
8404 * src/getargs.c (error_verbose_flag): New int.
8405 (getargs): Update to catch new case.
8406 * src/options.c (option_table): 'error-verbose' is a new option.
8407 (shortopts): Update.
8408
8409 2001-11-27 Akim Demaille <akim@epita.fr>
8410
8411 * src/system.h: Use intl/libgettext.h.
8412 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
8413
8414 2001-11-27 Akim Demaille <akim@epita.fr>
8415
8416 * tests/torture.at (Exploding the Stack Size with Malloc):
8417 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
8418
8419 2001-11-27 Akim Demaille <akim@epita.fr>
8420
8421 * src/files.c: Include error.h.
8422 Reported by Hans Aberg.
8423
8424 2001-11-26 Marc Autret <autret_m@epita.fr>
8425
8426 * src/reader.c (parse_include_decl): New, not yet implemented.
8427 (read_declarations): Add case tok_include.
8428 * src/getargs.h (include): Add its extern definition.
8429 * src/getargs.c (include): New const char *.
8430 (getargs): Add case '-I'.
8431 * src/options.c (option_table): Add include as command line and
8432 percent option.
8433 * src/lex.h (token_t): Add tok_include.
8434
8435 2001-11-26 Akim Demaille <akim@epita.fr>
8436
8437 * src/reader.c (readgram): Make sure rules for mid-rule actions
8438 have a lineno equal to that of their host rule.
8439 Reported by Hans Aberg.
8440 * tests/regression.at (Rule Line Numbers): New.
8441
8442 2001-11-26 Akim Demaille <akim@epita.fr>
8443
8444 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
8445 size_ts.
8446
8447 2001-11-26 Akim Demaille <akim@epita.fr>
8448
8449 * src/complain.c, src/complain.h (error): Remove, provided by
8450 lib/error.[ch].
8451
8452 2001-11-26 Akim Demaille <akim@epita.fr>
8453
8454 * src/reader.c (read_declarations): Don't abort on tok_illegal,
8455 issue an error message.
8456 * tests/regression.at (Invalid %directive): New.
8457 Reported by Hans Aberg.
8458
8459 2001-11-26 Akim Demaille <akim@epita.fr>
8460
8461 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
8462 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
8463
8464 2001-11-26 Akim Demaille <akim@epita.fr>
8465
8466 * src/conflicts.c (conflicts_print): Don't complain at all when
8467 there are no reduce/reduce conflicts, and as many shift/reduce
8468 conflicts as expected.
8469 * tests/regression.at (%expect right): Adjust.
8470
8471 2001-11-23 Akim Demaille <akim@epita.fr>
8472
8473 * lib/alloca.c: Update, from fileutils.
8474
8475 2001-11-23 Akim Demaille <akim@epita.fr>
8476
8477 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
8478
8479 2001-11-23 Akim Demaille <akim@epita.fr>
8480
8481 * src/system.h: Include alloca.h.
8482 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
8483
8484 2001-11-23 Akim Demaille <akim@epita.fr>
8485
8486 * src/print_graph.c (print_actions): Remove `rule', unused.
8487 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
8488 pacify GCC's signed < unsigned warnings.
8489 * src/closure.c (itemsetsize): Likewise.
8490 * src/reader.c (symbol_list_new): Static.
8491
8492 2001-11-23 Akim Demaille <akim@epita.fr>
8493
8494 Attaching lineno to buckets is stupid, since only one copy of each
8495 symbol is kept, only the line of the first occurrence is kept too.
8496
8497 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
8498 * src/reader.c (rline_allocated): Remove, unused.
8499 (symbol_list): Have a `line' member.
8500 (symbol_list_new): New.
8501 (readgram): Use it.
8502 * src/print.c (print_grammar): Output the rule line numbers.
8503 * tests/regression.at (Solved SR Conflicts)
8504 (Unresolved SR Conflicts): Adjust.
8505 Reported by Hans Aberg.
8506
8507 2001-11-22 Marc Autret <autret_m@epita.fr>
8508
8509 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
8510
8511 2001-11-22 Marc Autret <autret_m@epita.fr>
8512
8513 * src/muscle_tab.c (muscle_init): Remove initialization of
8514 skeleton muscle.
8515 * src/output.c (output_master_parser): Do it here.
8516
8517 2001-11-20 Akim Demaille <akim@epita.fr>
8518
8519 * po/sv.po: New.
8520 * configure.in (ALL_LINGUAS): Adjust.
8521 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
8522 longer contains strings to translate.
8523
8524 2001-11-19 Akim Demaille <akim@epita.fr>
8525
8526 * src/conflicts.c (conflicts_print): Add a missing \n.
8527
8528 2001-11-19 Akim Demaille <akim@epita.fr>
8529
8530 * src/nullable.c (nullable_print): New.
8531 (set_nullable): Call it when tracing.
8532 Better locality of variables.
8533
8534 2001-11-19 Akim Demaille <akim@epita.fr>
8535
8536 * src/print.c (print_actions): Better locality of variables.
8537
8538 2001-11-19 Akim Demaille <akim@epita.fr>
8539
8540 * src/derives.c (print_derives): Fix and enrich.
8541 * src/closure.c (print_fderives): Likewise.
8542
8543 2001-11-19 Akim Demaille <akim@epita.fr>
8544
8545 * src/closure.c (itemsetend): Remove, replaced with...
8546 (itemsetsize): new.
8547
8548 2001-11-19 Akim Demaille <akim@epita.fr>
8549
8550 * src/LR0.c (kernel_end): Remove, replaced with...
8551 (kernel_size): new.
8552
8553 2001-11-19 Akim Demaille <akim@epita.fr>
8554
8555 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
8556 to clarify.
8557
8558 2001-11-19 Akim Demaille <akim@epita.fr>
8559
8560 * src/closure.c (closure): Use arrays instead of pointers to clarify.
8561
8562 2001-11-19 Akim Demaille <akim@epita.fr>
8563
8564 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
8565 trace messages.
8566 * src/LR0.c: Likewise.
8567 (allocate_itemsets): Use arrays instead of pointers to clarify.
8568
8569 2001-11-19 Akim Demaille <akim@epita.fr>
8570
8571 * src/getargs.c (statistics_flag): Replace with...
8572 (trace_flag): New.
8573 (longopts): Accept --trace instead of --statistics.
8574 * src/getargs.h, src/options.c: Adjust.
8575 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
8576 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
8577
8578 2001-11-19 Akim Demaille <akim@epita.fr>
8579
8580 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
8581 pointers to clarify the code.
8582 (save_reductions, save_shifts): Factor common parts of alternatives.
8583
8584 2001-11-19 Akim Demaille <akim@epita.fr>
8585
8586 * src/LR0.c (new_state, get_state): Complete TRACE code.
8587 * src/closure.c: Include `reader.h' to get `tags', needed by the
8588 trace code.
8589 Rename the conditional DEBUG as TRACE.
8590 Output consistently TRACEs to stderr, not stdout.
8591 * src/derives.c: Likewise.
8592 * src/reduce.c: (inaccessable_symbols): Using if is better style
8593 than goto.
8594 Use `#if TRACE' instead of `#if 0' for tracing code.
8595
8596 2001-11-19 Akim Demaille <akim@epita.fr>
8597
8598 * src/system.h (LIST_FREE, shortcpy): New.
8599 * src/LR0.c: Use them.
8600 * src/output.c (free_itemsets, free_reductions, free_shifts):
8601 Remove, replaced by LIST_FREE.
8602
8603 2001-11-19 Akim Demaille <akim@epita.fr>
8604
8605 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
8606 (REDUCTIONS_ALLOC): New.
8607 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
8608 allocation.
8609
8610 2001-11-19 Akim Demaille <akim@epita.fr>
8611
8612 * src/LR0.c (new_state): Complete trace code.
8613 * src/nullable.c (set_nullable): Don't translate traces.
8614
8615 2001-11-19 Akim Demaille <akim@epita.fr>
8616
8617 * src/print_graph.c (print_core): Better locality of variables.
8618 * src/print.c (print_core): Likewise.
8619
8620 2001-11-19 Akim Demaille <akim@epita.fr>
8621
8622 * src/vcg.c: You do the output, so you are responsible of the
8623 handling of VCG syntax, in particular: use quotearg.
8624 * src/print_graph.c: Don't.
8625 (print_actions): Don't output the actions as part of the nodes,
8626 since that's the job of the edges.
8627 (print_state): Don't output by hand: fill the node description,
8628 and ask for its output.
8629
8630 2001-11-19 Akim Demaille <akim@epita.fr>
8631
8632 * src/bison.simple (yyparse): When verbosely reporting an error,
8633 no longer put additional quotes around token names.
8634 * tests/calc.at: Adjust.
8635
8636 2001-11-19 Akim Demaille <akim@epita.fr>
8637
8638 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
8639 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
8640 * src/output.c: Adjust.
8641
8642 2001-11-19 Akim Demaille <akim@epita.fr>
8643
8644 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
8645 (rule_t): this.
8646 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
8647
8648 2001-11-19 Akim Demaille <akim@epita.fr>
8649
8650 * src/gram.h (rule_t): New.
8651 (rule_table): New.
8652 (rrhs, rlhs): Remove, part of state_t.
8653 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
8654 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8655 * src/reader.c, src/reduce.c: Adjust.
8656
8657 2001-11-19 Akim Demaille <akim@epita.fr>
8658
8659 * src/reader.c (symbols_output): New, extracted from...
8660 (packsymbols): Here.
8661 (reader): Call it.
8662
8663 2001-11-19 Akim Demaille <akim@epita.fr>
8664
8665 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
8666 (maxrhs): this new function.
8667
8668 2001-11-19 Akim Demaille <akim@epita.fr>
8669
8670 * src/lalr.c (F): New macro to access the variable F.
8671 Adjust.
8672
8673 2001-11-19 Akim Demaille <akim@epita.fr>
8674
8675 * src/lalr.h (LA): New macro to access the variable LA.
8676 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8677 * src/lalr.c: Adjust.
8678
8679 2001-11-19 Akim Demaille <akim@epita.fr>
8680
8681 * src/lalr.c (initialize_LA): Only initialize LA. Let...
8682 (set_state_table): handle the `lookaheads' members.
8683
8684 2001-11-19 Akim Demaille <akim@epita.fr>
8685
8686 * src/lalr.h (lookaheads): Removed array, whose contents is now
8687 a member of...
8688 (state_t): this structure.
8689 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8690 Adjust.
8691
8692 2001-11-19 Akim Demaille <akim@epita.fr>
8693
8694 * src/lalr.h (consistent): Removed array, whose contents is now
8695 a member of...
8696 (state_t): this structure.
8697 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8698 Adjust.
8699
8700 2001-11-19 Akim Demaille <akim@epita.fr>
8701
8702 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
8703 contents are now members of...
8704 (state_t): this structure.
8705 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8706 Adjust.
8707
8708 2001-11-19 Akim Demaille <akim@epita.fr>
8709
8710 * src/lalr.h (state_t): New.
8711 (state_table): Be a state_t * instead of a core **.
8712 (accessing_symbol): Remove, part of state_t.
8713 * src/lalr.c: Adjust.
8714 (set_accessing_symbol): Merge into...
8715 (set_state_table): this.
8716 * src/print_graph.c, src/conflicts.c: Adjust.
8717
8718 2001-11-14 Akim Demaille <akim@epita.fr>
8719
8720 * tests/calc.at, tests/output.at, tests/regression.at,
8721 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
8722 now the tests are run in private dirs, therefore AC_CLEANUP and
8723 family can be simplified to 0-ary.
8724 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
8725 use abs. path to find config.h.
8726 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
8727 stderr, there can be way too much random noise.
8728 Instead pass -Werror to GCC and rely on the exit status.
8729 Reported by Wolfram Wagner.
8730
8731 2001-11-14 Akim Demaille <akim@epita.fr>
8732
8733 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
8734 defined only if yyoverflow is defined, to avoid `warning: unused
8735 variable `yyvs1''.
8736 Reported by The Test Suite.
8737
8738 2001-11-14 Akim Demaille <akim@epita.fr>
8739
8740 * src/print.c: Include reduce.h.
8741 Reported by Hans Aberg.
8742
8743 2001-11-14 Akim Demaille <akim@epita.fr>
8744
8745 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
8746 Revert a previous patch: these are really const.
8747 * src/conflicts.c (conflict_report): Additional useless pair of
8748 braces to pacify GCC's warnings for `if () if () {} else {}'.
8749 * src/lex.c (parse_percent_token): Replace equal_offset with
8750 arg_offset.
8751 arg is const.
8752 Be sure to strdup `arg' when used, since there is no reason for
8753 token_buffer not to change.
8754
8755 2001-11-14 Akim Demaille <akim@epita.fr>
8756
8757 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
8758 definition.
8759 * src/main.c (main): Use them.
8760 Suggested by Hans Aberg.
8761
8762 2001-11-12 Akim Demaille <akim@epita.fr>
8763
8764 * src/system.h (ngettext): Now that we use ngettext, be sure to
8765 provide a default definition when NLS are not used.
8766
8767 2001-11-12 Akim Demaille <akim@epita.fr>
8768
8769 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
8770 Use @kbd to denote user input.
8771 (Language and Grammar): ANSIfy the example.
8772 Adjust its layout for info/notinfo.
8773 (Location Tracking Calc): Output error messages to stderr.
8774 Output locations in a more GNUtically correct way.
8775 Fix a couple of Englishos.
8776 Adjust @group/@end group pairs.
8777
8778 2001-11-12 Akim Demaille <akim@epita.fr>
8779
8780 %expect was not functioning at all.
8781
8782 * src/conflicts.c (expected_conflicts): Set to -1.
8783 (conflict_report): Use ngettext.
8784 (conflicts_print): Check %expect and make its violation an error.
8785 * doc/bison.texinfo (Expect Decl): Adjust.
8786 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
8787 * tests/regression.at (%expect not enough, %expect right)
8788 (%expect too much): New.
8789
8790 2001-11-12 Akim Demaille <akim@epita.fr>
8791
8792 * tests/regression.at (Conflicts): Rename as...
8793 (Unresolved SR Conflicts): this.
8794 (Solved SR Conflicts): New.
8795
8796 2001-11-12 Akim Demaille <akim@epita.fr>
8797
8798 * src/reduce.c (print_results): Rename as...
8799 (reduce_output): This.
8800 Output to OUT, passed as argument, instead of output_obstack.
8801 (dump_grammar): Likewise.
8802 (reduce_free): New.
8803 Also free V1.
8804 (reduce_grammar): No longer call reduce_output, since...
8805 * src/print.c (print_results): do it.
8806 * src/main.c (main): Call reduce_free;
8807
8808 2001-11-12 Akim Demaille <akim@epita.fr>
8809
8810 * src/conflicts.c (print_reductions): Accept OUT as argument.
8811 Output to it, not to output_obstack.
8812 * src/print.c (print_actions): Adjust.
8813
8814 2001-11-12 Akim Demaille <akim@epita.fr>
8815
8816 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
8817 the result instead of using...
8818 (src_total, rrc_total, src_count, rrc_count): Remove.
8819 (any_conflicts): Remove.
8820 (print_conflicts): Split into...
8821 (conflicts_print, conflicts_output): New.
8822 * src/conflicts.h: Adjust.
8823 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
8824 * src/print.c (print_grammar): Issue `\n' between two rules.
8825 * tests/regression.at (Conflicts): New.
8826 Reported by Tom Lane.
8827
8828 2001-11-12 Akim Demaille <akim@epita.fr>
8829
8830 * tests/regression.at (Invalid input): Remove, duplicate with
8831 ``Invalid input: 1''.
8832
8833 2001-11-12 Akim Demaille <akim@epita.fr>
8834
8835 * tests/torture.at (AT_DATA_STACK_TORTURE)
8836 (Exploding the Stack Size with Alloca)
8837 (Exploding the Stack Size with Malloc): New.
8838
8839 2001-11-12 Akim Demaille <akim@epita.fr>
8840
8841 * src/bison.simple (YYSTACK_REALLOC): New.
8842 (yyparse) [!yyoverflow]: Use it and free the old stack.
8843 Reported by Per Allansson.
8844
8845 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
8846
8847 * src/bison.simple: Define type yystype instead of YYSTYPE, and
8848 define CPP macro, which substitute YYSTYPE by yystype.
8849 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
8850 with yyltype/YYLTYPE. This allows inclusion of the generated
8851 header within the parser if the compiler, such as GGC, accepts
8852 multiple equivalent #defines.
8853 From Akim.
8854
8855 2001-11-05 Akim Demaille <akim@epita.fr>
8856
8857 * src/reader.c (symbols_output): New, extracted from...
8858 (packsymbols): here.
8859 (reader): Adjust.
8860
8861 2001-11-05 Akim Demaille <akim@epita.fr>
8862
8863 * src/lex.c (parse_percent_token): s/quotearg/quote/.
8864
8865 2001-11-05 Akim Demaille <akim@epita.fr>
8866
8867 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
8868 pattern.
8869
8870 2001-11-05 Akim Demaille <akim@epita.fr>
8871
8872 * src/options.h (struct option_table_struct): set_flags is void*.
8873 * src/options.c (longopts): Support `--output' and `%output'.
8874 (usage): Adjust.
8875 * src/lex.h (tok_setopt): Remove, replaced with...
8876 (tok_intopt, tok_stropt): these new guys.
8877 * src/lex.c (getopt.h): Not needed.
8878 (token_buffer, unlexed_token_buffer): Not const.
8879 (percent_table): Promote `-' over `_' in directive names.
8880 Active `%name-prefix', `file-prefix', and `output'.
8881 (parse_percent_token): Accept possible arguments to directives.
8882 Promote `-' over `_' in directive names.
8883
8884 2001-11-04 Akim Demaille <akim@epita.fr>
8885
8886 * doc/bison.texinfo (Decl Summary): Split the list into
8887 `directives for grammars' and `directives for bison'.
8888 Sort'em.
8889 Add description of `%name-prefix', `file-prefix', and `output'.
8890 Promote `-' over `_' in directive names.
8891 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
8892 Simplify the description of `--name-prefix'.
8893 Promote `-' over `_' in directive names.
8894 Promote `--output' over `--output-file'.
8895 Fix the description of `--defines'.
8896 * tests/output.at: Exercise %file-prefix and %output.
8897
8898 2001-11-02 Akim Demaille <akim@epita.fr>
8899
8900 * doc/refcard.tex: Update.
8901
8902 2001-11-02 Akim Demaille <akim@epita.fr>
8903
8904 * src/symtab.h (SUNDEF): New.
8905 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
8906 stand for `uninitialized', instead of 0.
8907 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
8908 * src/lex.c (lex): Adjust.
8909
8910 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
8911 Number it 0.
8912 Let yylex return it instead of a plain 0.
8913 Reported by Dick Streefland.
8914
8915 2001-11-02 Akim Demaille <akim@epita.fr>
8916
8917 * tests/regression.at (Mixing %token styles): New test.
8918
8919 2001-11-02 Akim Demaille <akim@epita.fr>
8920
8921 * src/reader.c (parse_thong_decl): Formatting changes.
8922 (token_translations_init): New, extracted from...
8923 (packsymbols): Here.
8924 Adjust.
8925
8926 2001-11-01 Akim Demaille <akim@epita.fr>
8927
8928 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
8929 Check that `9foo.y' produces correct cpp guards.
8930 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
8931 guards.
8932 Reported by Wwp.
8933
8934 2001-11-01 Akim Demaille <akim@epita.fr>
8935
8936 * tests/regression.at (Invalid input: 2): New.
8937 * src/lex.c (unlexed_token_buffer): New.
8938 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
8939 too.
8940 Reported by Wwp.
8941
8942 2001-11-01 Akim Demaille <akim@epita.fr>
8943
8944 * tests/calc.at: Catch up with 1.30.
8945 * configure.in: Bump to 1.49a.
8946 Adjust to newer Autotest.
8947
8948 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
8949
8950 * src/conflicts.c: Move global variables rrc_total and src_total ...
8951 (print_conflicts): here.
8952 * src/output.c (output): Free global variable user_toknums.
8953 * src/lex.c (token_obstack): Become static.
8954
8955 2001-10-18 Akim Demaille <akim@epita.fr>
8956
8957 * tests/atlocal.in (GCC): Add.
8958 * tests/calc.at: s/m4_match/m4_bmatch/.
8959 s/m4_patsubst/m4_bpatsubst/.
8960 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
8961 * configure.in: AC_SUBST(GCC).
8962
8963 2001-10-14 Marc Autret <autret_m@epita.fr>
8964
8965 * src/options.c (create_long_option_table): Fix.
8966
8967 2001-10-10 Akim Demaille <akim@epita.fr>
8968
8969 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
8970
8971 2001-10-04 Akim Demaille <akim@epita.fr>
8972
8973 * src/reader.c (parse_union_decl): Push the caracters in
8974 union_obstack, not attrs_obstack.
8975
8976 2001-10-04 Akim Demaille <akim@epita.fr>
8977
8978 Merge in the branch 1.29.
8979
8980 * src/reader.c (packsymbols): Use a temporary obstack for
8981 `%%tokendef', since output_stack is already used elsewhere.
8982
8983 2001-10-02 Akim Demaille <akim@epita.fr>
8984
8985 Bump 1.29d.
8986
8987 2001-10-02 Akim Demaille <akim@epita.fr>
8988
8989 Version 1.29c.
8990
8991 2001-10-02 Akim Demaille <akim@epita.fr>
8992
8993 * tests/regression.at (Invalid CPP headers): New.
8994 From Alexander Belopolsky.
8995 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
8996
8997 2001-10-02 Akim Demaille <akim@epita.fr>
8998
8999 * tests/regression.at (Invalid input): New.
9000 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
9001 Reported by Shura.
9002
9003 2001-10-02 Akim Demaille <akim@epita.fr>
9004
9005 * tests/calc.at: Now that --debug works, the tests must be adjusted.
9006
9007 2001-10-02 Akim Demaille <akim@epita.fr>
9008
9009 * src/output.c (output_parser): Assert `skeleton'.
9010 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
9011 systems.
9012 From Shura.
9013
9014 2001-10-01 Marc Autret <autret_m@epita.fr>
9015
9016 * src/lex.h: Echo modifications.
9017 * src/lex.c (unlex): Parameter is now token_t.
9018 From Hans Aberg.
9019
9020 2001-10-01 Marc Autret <autret_m@epita.fr>
9021
9022 * src/main.c: Include lex.h.
9023 From Hans Aberg.
9024
9025 2001-09-29 Akim Demaille <akim@epita.fr>
9026
9027 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
9028
9029 2001-09-28 Akim Demaille <akim@epita.fr>
9030
9031 * tests/testsuite.at: Update to newer Autotest.
9032 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
9033
9034 2001-09-27 Akim Demaille <akim@epita.fr>
9035
9036 Position independent wrapper.
9037
9038 * tests/bison: Remove.
9039 * tests/bison.in: New.
9040 * configure.in: Adjust.
9041
9042 2001-09-27 Paul Eggert <eggert@twinsun.com>
9043
9044 Port quotearg fixes from tar 1.13.24.
9045
9046 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9047 tm to be declared.
9048 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
9049 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
9050
9051 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
9052 * m4/mbrtowc.m4: New file.
9053 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
9054 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
9055
9056 2001-09-27 Akim Demaille <akim@epita.fr>
9057
9058 Bump to 1.29c.
9059
9060 2001-09-27 Akim Demaille <akim@epita.fr>
9061
9062 Version 1.29b.
9063
9064 2001-09-25 Akim Demaille <akim@epita.fr>
9065
9066 * src/system.h: Include `xalloc.h'.
9067 Remove it from the C files.
9068 * src/files.c (output_files): Free the obstacks.
9069 * src/lex.c (init_lex): Rename as...
9070 (lex_init): this.
9071 (lex_free): New.
9072 * src/main.c (main): Use it.
9073
9074 2001-09-24 Marc Autret <autret_m@epita.fr>
9075
9076 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
9077 to output informations in fout (FILE*).
9078 (open_graph, close_graph): Likewise.
9079 (output_graph, output_edge, output_node): Likewise.
9080 * src/vcg.h: Update function prototypes.
9081 * src/print_graph.c (print_graph): Open output graph file.
9082 (print_actions): Adjust.
9083 * src/files.h: Remove extern declaration.
9084 * src/files.c: Remove graph_obstack declaration.
9085 (open_files): Remove graph_obstack initialization.
9086 (output_files): Remove graph_obstack saving.
9087
9088 2001-09-24 Marc Autret <autret_m@epita.fr>
9089
9090 * src/files.c (compute_output_file_names): Fix.
9091
9092 2001-09-24 Marc Autret <autret_m@epita.fr>,
9093 Akim Demaille <akim@epita.fr>
9094
9095 * src/reader.c (reader): Remove call to free_symtab ().
9096 * src/main.c (main): Call it here.
9097 Include symtab.h.
9098 * src/conflicts.c (initialize_conflicts): Rename as...
9099 (solve_conflicts): this.
9100 * src/print.c (print_core, print_actions, print_state)
9101 (print_grammar): Dump to a file instead a `output_obstack'.
9102 (print_results): Dump `output_obstack', and then proceed with the
9103 FILE *.
9104 * src/files.c (compute_output_file_names, close_files): New.
9105 (output_files): Adjust.
9106 * src/main.c (main): Adjust.
9107
9108 2001-09-23 Marc Autret <autret_m@epita.fr>
9109
9110 * src/files.c (compute_header_macro): Computes header macro name
9111 from spec_defines_file when given.
9112
9113 2001-09-23 Marc Autret <autret_m@epita.fr>
9114
9115 * src/files.c (output_files): Add default extensions.
9116
9117 2001-09-22 Akim Demaille <akim@epita.fr>
9118
9119 * src/conflicts.c (finalize_conflicts): Rename as...
9120 (free_conflicts): this.
9121
9122 2001-09-22 Akim Demaille <akim@epita.fr>
9123
9124 * src/gram.c (gram_free): Rename back as...
9125 (dummy): this.
9126 (output_token_translations): Free `token_translations'.
9127 * src/symtab.c (free_symtab): Free the tag field.
9128
9129 2001-09-22 Akim Demaille <akim@epita.fr>
9130
9131 Remove `translations' as it is always set to true.
9132
9133 * src/gram.h: Adjust.
9134 * src/reader.c (packsymbols, parse_token_decl): Adjust
9135 * src/print.c (print_grammar): Adjust.
9136 * src/output.c (output_token_translations): Adjust.
9137 * src/lex.c (lex): Adjust.
9138 * src/gram.c: Be sure the set pointers to NULL.
9139 (dummy): Rename as...
9140 (gram_free): this.
9141
9142 2001-09-22 Akim Demaille <akim@epita.fr>
9143
9144 * configure.in: Invoke AM_LIB_DMALLOC.
9145 * src/system.h: Use dmalloc.
9146 * src/LR0.c: Be sure to have pointers initialized to NULL.
9147 (allocate_itemsets): Allocate kernel_items only if needed.
9148
9149 2001-09-22 Akim Demaille <akim@epita.fr>
9150
9151 * configure.in: Bump to 1.29b.
9152 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
9153 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
9154 need xmalloc.c in calc.y.
9155 From Pascal Bart.
9156
9157 2001-09-21 Akim Demaille <akim@epita.fr>
9158
9159 Version 1.29a.
9160 * Makefile.maint, config/config.guess, config/config.sub,
9161 * config/missing: Update from masters.
9162 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
9163 upon package.m4.
9164 * configure.in (ALL_LINGUAS): Add `tr'.
9165
9166 2001-09-21 Akim Demaille <akim@epita.fr>
9167
9168 * tests/Makefile.am (package.m4): Move to...
9169 ($(srcdir)/$(TESTSUITE)): here.
9170
9171 2001-09-20 Akim Demaille <akim@epita.fr>
9172
9173 * src/complain.c: No longer try to be standalone: use system.h.
9174 Don't assume __STDC__ is defined to 1. Just test if it is defined.
9175 * src/complain.h: Likewise.
9176 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
9177 Remove the unused variable `n'.
9178 From Albert Chin-A-Young.
9179
9180 2001-09-18 Marc Autret <autret_m@epita.fr>
9181
9182 * doc/bison.1: Update.
9183 * doc/bison.texinfo (Bison Options): Update --defines and --graph
9184 descriptions.
9185 (Option Cross Key): Update.
9186 Add --graph.
9187
9188 2001-09-18 Marc Autret <autret_m@epita.fr>
9189
9190 * tests/regression.at: New test (comment in %union).
9191
9192 2001-09-18 Marc Autret <autret_m@epita.fr>
9193
9194 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
9195 do that.
9196 Reported by Keith Browne.
9197
9198 2001-09-18 Marc Autret <autret_m@epita.fr>
9199
9200 * tests/output.at: Add tests for --defines and --graph.
9201
9202 2001-09-18 Marc Autret <autret_m@epita.fr>
9203
9204 * tests/output.at: Removes tests of %{header,src}_extension features.
9205
9206 2001-09-18 Akim Demaille <akim@epita.fr>
9207
9208 * tests/Makefile.am (package.m4): New.
9209 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
9210 (_AT_CHECK_CALC_ERROR): Likewise.
9211 Factor the `, ' part of verbose error messages.
9212
9213 2001-09-18 Marc Autret <autret_m@epita.fr>
9214
9215 * src/getargs.c (longopts): Declare --defines and --graph as options
9216 with optional arguments.
9217 * src/files.h: Add extern declarations.
9218 * src/files.c (spec_graph_file, spec_defines_file): New.
9219 (output_files): Update.
9220 Remove CPP-outed code.
9221
9222 2001-09-18 Marc Autret <autret_m@epita.fr>
9223
9224 Turn off %{source,header}_extension feature.
9225
9226 * src/files.c (compute_exts_from_gf): Update.
9227 (compute_exts_from_src): Update.
9228 (output_files): CPP-out useless code.
9229 * src/files.h: Remove {header,source}_extension extern declarations.
9230 * src/reader.c (parse_dquoted_param): CPP-out.
9231 (parse_header_extension_decl): Remove.
9232 (parse_source_extension_decl): Remove.
9233 (read_declarations): Remove cases tok_{hdrext,srcext}.
9234 * src/lex.c (percent_table): Remove {header,source}_extension entries.
9235 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
9236
9237 2001-09-10 Akim Demaille <akim@epita.fr>
9238
9239 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
9240 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
9241 (AT_CHECK_OUTPUT): this.
9242 Merely check ls' exit status, its output is useless.
9243
9244 2001-09-10 Akim Demaille <akim@epita.fr>
9245
9246 * tests/calc.at: Use m4_match.
9247 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
9248
9249 2001-09-10 Marc Autret <autret_m@epita.fr>,
9250 Akim Demaille <akim@epita.fr>
9251
9252 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
9253 enum color_e.
9254 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
9255 to `normal'.
9256 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
9257 * src/lex.h: Adjust prototype.
9258 (token_t): Add `tok_undef'.
9259 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
9260 (parse_percent_token): Now returns token_t.
9261 Add default statement in switch.
9262 (lex): Separate `c' as an input variable, from the token_t result
9263 part.
9264 (unlexed): Is a token_t.
9265
9266 2001-09-10 Akim Demaille <akim@epita.fr>
9267
9268 * configure.in: Bump to 1.29a.
9269
9270 2001-09-07 Akim Demaille <akim@epita.fr>
9271
9272 Version 1.29.
9273
9274 2001-08-30 Akim Demaille <akim@epita.fr>
9275
9276 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
9277 * m4/atconfig.m4: Remove.
9278 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
9279 * tests/bison: New.
9280 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
9281 m4_if, m4_patsubst, and m4_regexp.
9282 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
9283 `input' file instead of echo.
9284
9285 2001-08-29 Akim Demaille <akim@epita.fr>
9286
9287 Bump to 1.28e.
9288
9289 2001-08-29 Akim Demaille <akim@epita.fr>
9290
9291 Version 1.28d.
9292
9293 2001-08-29 Paul Eggert <eggert@twinsun.com>
9294
9295 * src/bison.simple (yyparse): Don't take the address of an
9296 item before the start of an array, as that doesn't conform to
9297 the C Standard.
9298
9299 2001-08-29 Robert Anisko <anisko_r@epita.fr>
9300
9301 * doc/bison.texinfo (Location Tracking Calc): New node.
9302
9303 2001-08-29 Paul Eggert <eggert@twinsun.com>
9304
9305 * src/output.c (output): Do not define const, as this now
9306 causes more problems than it cures.
9307
9308 2001-08-29 Akim Demaille <akim@epita.fr>
9309
9310 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
9311 the nodes.
9312 Be sure to tag the `detailmenu'.
9313
9314 2001-08-29 Akim Demaille <akim@epita.fr>
9315
9316 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
9317 download in a tmp dir.
9318
9319 2001-08-28 Marc Autret <autret_m@epita.fr>
9320
9321 * config/depcomp: New file.
9322
9323 2001-08-28 Marc Autret <autret_m@epita.fr>
9324
9325 * doc/bison.1 (mandoc): Adjust.
9326 From Juan Manuel Guerrero.
9327
9328 2001-08-28 Marc Autret <autret_m@epita.fr>
9329
9330 * src/print_graph.c (print_state): Fix.
9331
9332 2001-08-27 Marc Autret <autret_m@epita.fr>
9333
9334 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
9335 char * members.
9336 Echo modifications to the functions prototypes.
9337 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
9338
9339 2001-08-27 Marc Autret <autret_m@epita.fr>
9340
9341 * src/vcg.c: Include `xalloc.h'.
9342 (add_colorentry): New.
9343 (add_classname): New.
9344 (add_infoname): New.
9345 * src/vcg.h: Add new prototypes.
9346
9347 2001-08-27 Akim Demaille <akim@epita.fr>
9348
9349 * Makefile.maint: Sync. again with CVS Autoconf.
9350
9351 2001-08-27 Akim Demaille <akim@epita.fr>
9352
9353 * Makefile.maint: Formatting changes.
9354 (po-update, cvs-update, update): New targets.
9355 (AMTAR): Remove.
9356
9357 2001-08-27 Akim Demaille <akim@epita.fr>
9358
9359 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9360 * Makefile.maint: Sync. with CVS Autoconf.
9361
9362 2001-08-27 Marc Autret <autret_m@epita.fr>
9363
9364 * src/vcg.h (struct infoname_s): New.
9365 (struct colorentry_s): New.
9366 (graph_s): New fields {vertical,horizontal}_order in structure.
9367 Add `infoname' field.
9368 Add `colorentry' field;
9369 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
9370 (G_HORIZONTAL_ORDER): New.
9371 (G_INFONAME): New.
9372 (G_COLORENTRY): New.
9373 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
9374 Add output of `infoname'.
9375 Add output of `colorentry'.
9376
9377 2001-08-27 Marc Autret <autret_m@epita.fr>
9378
9379 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
9380 This one shadowed a global parameter.
9381
9382 2001-08-24 Marc Autret <autret_m@epita.fr>
9383
9384 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
9385 instead of `unsigned'.
9386 (print_state): Do not call obstack_object_size () in obstack_grow ()
9387 to avoid macro variables shadowing.
9388
9389 2001-08-23 Marc Autret <autret_m@epita.fr>
9390
9391 * src/lex.c (percent_table): Typo: s/naem/name/.
9392 Add graph option.
9393 Normalize new options declarations.
9394
9395 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
9396
9397 * tests/suite.at: Exercise %header_extension and %source_extension.
9398
9399 2001-08-16 Marc Autret <autret_m@epita.fr>
9400
9401 * src/reader.c (parse_dquoted_param): New.
9402 (parse_header_extension_decl): Use it.
9403 (parse_source_extension_decl): Likewise.
9404
9405 2001-08-16 Marc Autret <autret_m@epita.fr>
9406
9407 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
9408 (get_xxxx_str): Use assert () instead of complain ().
9409 Remove return invokations in default cases.
9410 (get_decision_str): Modify default behaviour. Remove second argument.
9411 Echo modifications on calls.
9412 (output_graph): Fix.
9413
9414 2001-08-16 Marc Autret <autret_m@epita.fr>
9415
9416 * src/getargs.c (usage): Update with ``-g, --graph''.
9417
9418 2001-08-16 Marc Autret <autret_m@epita.fr>
9419
9420 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
9421 (Option Cross Key): Likewise.
9422 * doc/bison.1: Update.
9423
9424 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
9425
9426 * src/output.c (output_master_parser): Don't finish action_obstack.
9427 (output_parser): Don't care about the muscle action, here.
9428 (prepare): Copy the action_obstack in the action muscle.
9429 (output): Free action_obstack.
9430
9431 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
9432
9433 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
9434 will contain `%union' declaration.
9435 (parse_union_decl): Delete #line directive output.
9436 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
9437 informations about %union.
9438 (parse_union_decl): Copy the union_obstack in the muscle stype.
9439 * src/bison.simple: Add new #line directive.
9440 Add typdef %%stype YYSTYPE.
9441
9442 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
9443
9444 * src/bison.simple: Add new `#line' directive.
9445
9446 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
9447
9448 * src/bison.simple: New `#line' directive.
9449 * src/output.c (output_parser): Support new dynamic muscle input_line.
9450
9451 2001-09-22 Marc Autret <autret_m@epita.fr>
9452
9453 * src/output.c (output_master_parser): New.
9454 (output_parser): Be more re-entrant.
9455
9456 2001-09-21 Marc Autret <autret_m@epita.fr>
9457
9458 * src/reader.c (copy_definition, parse_union_decl): Update and use
9459 `linef' muscle.
9460 (copy_action): Likewise.
9461 Use obstack_1grow ().
9462 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
9463
9464 2001-09-21 Marc Autret <autret_m@epita.fr>
9465
9466 * src/options.c (option_table): Adjust.
9467 * src/lex.c (parse_percent_token): Fix.
9468
9469 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
9470
9471 * src/options.c (symtab.h): Include it, need by lex.h.
9472
9473 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
9474
9475 * src/lex.c (parse_percent_token): Change type of variable `tx', which
9476 is now an option_table_struct*.
9477 (option_strcmp): New function option_strcmp.
9478 (parse_percent_token): Call option_strcmp.
9479 * src/getargs.c (xalloc.h, options.h): Include it.
9480 (getargs): Call create_long_option_table.
9481 (getargs): Free longopts at the end of the function.
9482 (shortopts): Move in options.c.
9483 * src/options.c (create_long_option_table): New function. Convert
9484 information from option_table to option structure.
9485 * src/reader.c (options.h): Include it.
9486
9487 * src/Makefile.am: Adjust.
9488 * src/options.c (option_table): Create from longopts and percent_table.
9489 * src/getargs.c (longopts): Delete.
9490 * src/lex.c (struct percent_table_struct): Delete.
9491 (percent_table): Delete.
9492 (options.h): Include it.
9493 * src/options.c: Create.
9494 * src/options.h: Create.
9495 Declare enum opt_access_e.
9496 Define struct option_table_struct.
9497
9498 2001-09-20 Marc Autret <autret_m@epita.fr>
9499
9500 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
9501 sections of Bison.
9502
9503 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
9504
9505 * src/bison.simple: s/%%filename/%%skeleton.
9506 * src/muscle_tab.c (getargs.h): Include it.
9507 (muscle_init): Insert new muscle skeleton.
9508
9509 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
9510
9511 * src/output.c (output_parser): Delete unused variable actions_dumped.
9512
9513 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
9514
9515 * src/output.c (output): Delete call to reader_output_yylsp.
9516 * src/reader.c (reader): Likewise.
9517 * src/reader.h: Delete declaration of reader_output_yylsp.
9518
9519 2001-09-02 Marc Autret <autret_m@epita.fr>
9520
9521 * src/reader.c: Include muscle_tab.h.
9522 (parse_union_decl): Update.
9523 (parse_macro_decl): Rename parse_muscle_decl.
9524 Update to use renamed functions and variable.
9525 (read_declarations, copy_action, read_additionnal_code, : Updated
9526 with correct variables and functions names.
9527 (packsymbols, reader): Likewise.
9528
9529 * src/reader.h (muscle_obstack): Extern declaration update.
9530
9531 * src/output.c: Include muscle_tab.h
9532 In all functions using macro_insert, change by using muscle_insert ().
9533 (macro_obstack): Rename muscle_obstack.
9534 Echo modifications in the whole file.
9535 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
9536 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
9537 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
9538
9539 * src/muscle_tab.h: Update double inclusion macros.
9540 (macro_entry_s): Rename muscle_entry_s.
9541 Update prototypes.
9542
9543 * src/muscle_tab.c: Include muscle_tab.h.
9544 Rename macro_tabble to muscle_table.
9545 (mhash1, mhash2, mcmp): Use muscle_entry.
9546 (macro_init): Rename muscle_init. Update.
9547 (macro_insert): Rename muscle_insert. Update.
9548 (macro_find): Rename muscle_find. Update.
9549
9550 * src/main.c: Include muscle_tab.h.
9551 (main): Call muscle_init ().
9552 * src/Makefile.am (bison_SOURCES): Echo modifications.
9553
9554 2001-09-02 Marc Autret <autret_m@epita.fr>
9555
9556 Now the files macro_tab.[ch] are named muscle_tab.[ch].
9557
9558 * src/muscle_tab.c, src/muscle_tab.h: Add files.
9559
9560 2001-09-02 Marc Autret <autret_m@epita.fr>
9561
9562 * src/macrotab.c, src/macrotab.h: Remove.
9563
9564 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
9565
9566 * src/reader.c (copy_guard): Use muscle to specify the `#line'
9567 filename.
9568
9569 2001-09-01 Marc Autret <autret_m@epita.fr>
9570
9571 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
9572 to an explicit value to activate the feature. We do it here.
9573
9574 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9575
9576 * src/output.c (prepare): Delete the `filename' muscule insertion.
9577 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
9578 (parse_union_decl): Likewise.
9579 * src/macrotab.c (macro_init): Initialize filename by infile.
9580
9581 2001-08-31 Marc Autret <autret_m@epita.fr>
9582
9583 * src/bison.simple (YYLSP_NEEDED): New definition.
9584 * src/output.c (prepare): Add macro insertion of `locations_flag'
9585
9586 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9587
9588 * src/output.c (prepare): Delete insertion of previous muscles,
9589 and insert the `prefix' muscles.
9590 * src/macrotab.c (macro_init): Likewise.
9591 (macro_init): Initialization prefix directive by `yy'.
9592 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
9593 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
9594 yylval, yydebug, yyerror, yynerrs and yyparse.
9595 New directive `#define' to substitute yydebug, ... with option
9596 name_prefix.
9597
9598 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9599
9600 * src/main.c (main): Standardize.
9601 * src/output.c (output_table_data, output_parser): Likewise.
9602 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
9603
9604 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
9605
9606 * src/reader.c (read_additionnal_code): Rename %%user_code to
9607 %%epilogue.
9608 * src/output.c (output): Rename %%declarations to %%prologue.
9609 * src/bison.simple: Echo modifications.
9610
9611 2001-08-31 Marc Autret <autret_m@epita.fr>
9612
9613 * src/reader.c (readgram): CleanUp.
9614 (output_token_defines): Likewise.
9615 (packsymbols): Likewise.
9616 (reader): Likewise.
9617 * src/output.c (output): CPP-out useless code.
9618
9619 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9620
9621 * src/reader.c (reader): Delete obsolete call to function
9622 output_trailers and output_headers.
9623 * src/output.h: Remove obsolete functions prototypes of output_headers
9624 and output_trailers.
9625
9626 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
9627
9628 * src/main.c: Include macrotab.h.
9629 * src/macrotab.h (macro_entry_s): Constify fields.
9630 Adjust functions prototypes.
9631 * src/macrotab.c (macro_insert): Constify key and value.
9632 (macro_find): Constify key.
9633 (macro_insert): Include 'xalloc.h'
9634 (macro_insert): Use XMALLOC.
9635 (macro_find): Constify return value.
9636 * src/output.c (output_table_data): Rename table to table_data.
9637 (output_parser): Constify macro_key, macro_value.
9638
9639 2001-08-30 Marc Autret <autret_m@epita.fr>
9640
9641 * src/reader.c (parse_skel_decl): New.
9642 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
9643 * src/lex.h (token_t): New token `tok_skel'.
9644 * src/lex.c (percent_table): Add skeleton option entry.
9645 Standardize.
9646
9647 2001-08-29 Marc Autret <autret_m@epita.fr>
9648
9649 * src/bison.simple: Add %%user_code directive at the end.
9650 * src/reader.c (read_additionnal_code): New.
9651 (reader): Use it.
9652 * src/output.c (output_program): Remove.
9653 (output): Update.
9654
9655 2001-08-28 Marc Autret <autret_m@epita.fr>
9656
9657 * src/output.c (output_actions): Clean up.
9658 (output_gram): CPP-out useless code.
9659 * src/reader.c (reader): Clean up, CPP-out useless code.
9660
9661 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
9662
9663 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
9664 directive.
9665 * src/bison.simple: Add `%%definitions'.
9666
9667 2001-08-28 Marc Autret <autret_m@epita.fr>
9668
9669 * config/depcomp: New file.
9670
9671 2001-08-27 Paul Eggert <eggert@twinsun.com>
9672
9673 * src/bison.simple (yyparse): Don't take the address of an
9674 item before the start of an array, as that doesn't conform to
9675 the C Standard.
9676
9677 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
9678
9679 * src/output.c (output): Remove the initialization of the macro
9680 obstack. It was done too late here.
9681
9682 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
9683 completely wrong.
9684 (reader): Initialize the macro obstack here, since we need it to grow
9685 '%define' directives.
9686
9687 * src/reader.h: Declare the macro obstack as extern.
9688
9689 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
9690
9691 * src/output.c (output_parser): Fix. Store single '%' characters in
9692 the output obstack instead of throwing them away.
9693
9694 2001-08-27 Akim Demaille <akim@epita.fr>
9695
9696 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9697
9698 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9699
9700 * lib/Makefile.am: Adjust.
9701
9702 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9703
9704 * src/bison.simple: Update and add '%%' directives.
9705
9706 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9707
9708 * src/reader.c (reader): Remove calls to 'output_headers' and
9709 'output_trailers'. Remove some C output.
9710 (readgram): Disable a piece of code that was writing a default
9711 definition for 'YYSTYPE'.
9712 (reader_output_yylsp): Remove.
9713 (packsymbols): Output token defintions to a macro.
9714 (copy_definition): Disable C output.
9715
9716 * src/reader.c (parse_macro_decl): New function used to parse macro
9717 declarations.
9718 (copy_string2): Put the body of copy_string into this new function.
9719 Add a parameter to let the caller choose whether he wants to copy the
9720 string delimiters or not.
9721 (copy_string): Be a simple call to copy_string2 with the last argument
9722 bound to true.
9723 (read_declarations): Add case for macro definition.
9724 (copy_identifier): New.
9725 (parse_macro_decl): Read macro identifiers using copy_identifier
9726 rather than lex.
9727
9728 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9729
9730 * src/output.c (prepare): Add prefixed names.
9731 (output_parser): Output semantic actions.
9732 (output_parser): Fix bug on '%%line' directives.
9733
9734 * src/output.c (output_headers): Remove. The C code printed by this
9735 function should now be in the skeletons.
9736 (output_trailers): Remove.
9737 (output): Disable call to 'reader_output_yylsp'.
9738 (output_rule_data): Do not output tables to the table obstack.
9739
9740 * src/output.c: Remove some C dedicated output.
9741 Improve the use of macro and output obstacks.
9742 (output_defines): Remove.
9743
9744 * src/output.c (output_token_translations): Associate 'translate'
9745 table with a macro. No output to the table obstack.
9746 (output_gram): Same for 'rhs' and 'prhs'.
9747 (output_stos): Same for 'stos'.
9748 (output_rule_data): Same for 'r1' and 'r2'.
9749 (token_actions): Same for 'defact'.
9750 (goto_actions): Same for 'defgoto'.
9751 (output_base): Same for 'pact' and 'pgoto'.
9752 (output_table): Same for 'table'.
9753 (output_check): Same for 'check'.
9754
9755 * src/output.c (output_table_data): New function.
9756 (output_short_table): Remove.
9757 (output_short_or_char_table): Remove.
9758
9759 * src/output.c (output_parser): Replace most of the skeleton copy code
9760 with something new. Skeletons are now processed character by character
9761 rather than line by line, and Bison looks for '%%' macros. This is the
9762 first step in making Bison's output process (a lot) more flexible.
9763 (output_parser): Use the macro table.
9764
9765 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9766
9767 * src/main.c (main): Initialize the macro table.
9768
9769 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9770
9771 * src/lex.c (percent_table): Add tok_define.
9772 * src/lex.h: Add tok_define.
9773
9774 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9775
9776 * src/macrotab.c: New file.
9777 * src/macrotab.h: New file.
9778 * src/Makefile.am: Update.
9779
9780 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9781
9782 * lib/hash.c: New file.
9783 * lib/hash.h: New file.
9784 * lib/Makefile.am: Update.
9785
9786 2001-08-15 Akim Demaille <akim@epita.fr>
9787
9788 Version 1.28c.
9789
9790 2001-08-15 Marc Autret <autret_m@epita.fr>
9791
9792 * src/reader.c (readgram): Indent output macro YYSTYPE.
9793 (packsymbols): Likewise.
9794 (output_token_defines): Likewise.
9795 * src/files.c: Standardize.
9796 (compute_header_macro): New.
9797 (defines_obstack_save): New. Use compute_header_macro.
9798 (output_files): Update. Use defines_obstack_save.
9799
9800 2001-08-15 Akim Demaille <akim@epita.fr>
9801
9802 * doc/bison.texinfo (Table of Symbols): Document
9803 YYSTACK_USE_ALLOCA.
9804
9805 2001-08-15 Akim Demaille <akim@epita.fr>
9806
9807 * missing: Update from CVS Automake.
9808 * config/config.guess, config/config.sub, config/texinfo.tex:
9809 Update from gnu.org.
9810
9811 2001-08-15 Akim Demaille <akim@epita.fr>
9812
9813 * Makefile.maint: Sync with CVS Autoconf.
9814
9815 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
9816
9817 * doc/bison.texinfo: Include GNU Free Documentation License from
9818 `fdl.texi'.
9819 * doc/fdl.texi: Add to package.
9820
9821 2001-08-14 Marc Autret <autret_m@epita.fr>
9822
9823 Turn on %{source,header}_extension features.
9824
9825 * src/lex.c (percent_table): Un-CPP out header_extension and
9826 source_extension.
9827 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
9828 (compute_exts_from_src): Remove conditions. It restores priorities
9829 between options.
9830
9831 2001-08-14 Marc Autret <autret_m@epita.fr>
9832
9833 * src/files.c (compute_base_names): Add extensions computing when
9834 `--file-prefix' used.
9835 Standardize function calls.
9836
9837 2001-08-13 Marc Autret <autret_m@epita.fr>
9838
9839 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
9840 defining it (defined but null disables alloca).
9841
9842 2001-08-13 Marc Autret <autret_m@epita.fr>
9843
9844 * src/bison.simple (_yy_memcpy): CPP reformat.
9845
9846 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
9847
9848 * tests/atconfig.in (CPPFLAGS): Fix.
9849
9850 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
9851
9852 * doc/bison.texinfo: Include GNU General Public License from
9853 `gpl.texi'.
9854 * doc/gpl.texi: Add to package.
9855
9856 2001-08-10 Marc Autret <autret_m@epita.fr>
9857
9858 * src/print_graph.h: Fix.
9859 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
9860
9861 2001-08-10 Akim Demaille <akim@epita.fr>
9862
9863 * src/system.h: Provide default declarations for stpcpy, strndup,
9864 and strnlen.
9865
9866 2001-08-10 Robert Anisko <anisko_r@epita.fr>
9867
9868 * doc/bison.texinfo (Locations): Update @$ stuff.
9869
9870 2001-08-09 Robert Anisko <anisko_r@epita.fr>
9871
9872 * src/bison.simple (YYLLOC_DEFAULT): Update.
9873 (yyparse): Adjust.
9874
9875 2001-08-08 Marc Autret <autret_m@epita.fr>
9876
9877 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
9878 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
9879 Reported by Fabrice Bauzac.
9880
9881 2001-08-08 Marc Autret <autret_m@epita.fr>
9882
9883 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
9884 * src/vcg.c (output_node): Fix.
9885 * src/vcg.h: Cleanup.
9886 * src/print_graph.c: Add comments.
9887 (node_output_size): New global variable. Simplify the formatting of
9888 the VCG graph output.
9889 (print_actions): Unused code is now used. It notifies the final state
9890 and no action states in the VCG graph. It also give the reduce actions.
9891 The `shift and goto' edges are red and the `go to state' edges are
9892 blue.
9893 Get the current node name and node_obstack by argument.
9894 (node_obstack): New variable.
9895 (print_state): Manage node_obstack.
9896 (print_core): Use node_obstack given by argument.
9897 A node is not only computed here but in print_actions also.
9898 (print_graph): CPP out useless code instead of commenting it.
9899
9900 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
9901
9902 * tests/atconfig.in (CPPFLAGS): Fix.
9903
9904 2001-08-07 Akim Demaille <akim@epita.fr>
9905
9906 * src/print_graph.c (quote): New.
9907 (print_core): Use it.
9908
9909 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
9910
9911 * src/vcg.c (complain.h): Include it.
9912 Unepitaize `return' invocations.
9913 [NDEBUG] (main): Remove.
9914 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
9915 * src/files.c (open_files): Initialize graph_obstack.
9916 * src/print_graph.c (print_actions): CPP out useless code.
9917 (print_core): Don't output the last `\n' in labels.
9918 Use `quote'.
9919 * src/files.c (output_files): Output the VCG file.
9920 * src/main.c (main): Invoke print_graph ();
9921
9922 2001-08-06 Marc Autret <autret_m@epita.fr>
9923
9924 Automaton VCG graph output.
9925 Using option ``-g'' or long option ``--graph'', you can generate
9926 a gram_filename.vcg file containing a VCG description of the LALR (1)
9927 automaton of your grammar.
9928
9929 * src/main.c: Call to print_graph() function.
9930 * src/getargs.h: Update.
9931 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
9932 (graph_flag): New flag.
9933 (longopts): Update.
9934 (getargs): Add case `g'.
9935 * src/files.c (graph_obstack): New obstack struct.
9936 (open_files): Initialize new obstack.
9937 (output_files): Saves graph_obstack if required.
9938 * src/files.h (graph_obstack): New extern declaration.
9939 * src/Makefile.am: Add new source files.
9940
9941 2001-08-06 Marc Autret <autret_m@epita.fr>
9942
9943 * src/print_graph.c, src/print_graph.h (graph): New.
9944 * src/vcg.h: New file.
9945 * src/vcg.c: New file, VCG graph handling.
9946
9947 2001-08-06 Marc Autret <autret_m@epita.fr>
9948
9949 Add of %source_extension and %header_extension which specify
9950 the source or/and the header output file extension.
9951
9952 * src/files.c (compute_base_names): Remove initialisation of
9953 src_extension and header_extension.
9954 (compute_exts_from_gf): Update.
9955 (compute_exts_from_src): Update.
9956 (output_files): Update.
9957 * src/reader.c (parse_header_extension_decl): New.
9958 (parse_source_extension_decl): New.
9959 (read_declarations): New case statements for the new tokens.
9960 * src/lex.c (percent_table): Add entries for %source_extension
9961 and %header_extension.
9962 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
9963
9964 2001-08-06 Marc Autret <autret_m@epita.fr>
9965
9966 * configure.in: Bump to 1.28c.
9967 * doc/bison.texinfo: Texinfo thingies.
9968
9969 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
9970
9971 * tests/atconfig.in (CPPFLAGS): Add.
9972 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
9973
9974 2001-08-03 Akim Demaille <akim@epita.fr>
9975
9976 Version 1.28b.
9977
9978 2001-08-03 Akim Demaille <akim@epita.fr>
9979
9980 * tests/Makefile.am (check-local): Ship testsuite.
9981 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
9982 Include `string.h'.
9983
9984 2001-08-03 Akim Demaille <akim@epita.fr>
9985
9986 * configure.in: Try using -Wformat when compiling.
9987
9988 2001-08-03 Akim Demaille <akim@epita.fr>
9989
9990 * configure.in: Bump to 1.28b.
9991
9992 2001-08-03 Akim Demaille <akim@epita.fr>
9993
9994 * src/complain.c: Adjust strerror_r portability issues.
9995
9996 2001-08-03 Akim Demaille <akim@epita.fr>
9997
9998 Version 1.28a.
9999
10000 2001-08-03 Akim Demaille <akim@epita.fr>
10001
10002 * src/getargs.c, src/getarg.h (skeleton)): Constify.
10003 * src/lex.c (literalchar): Avoid name clashes on `buf'.
10004 * src/getargs.c: Include complain.h.
10005 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
10006 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
10007
10008 2001-08-03 Akim Demaille <akim@epita.fr>
10009
10010 * src/reader.c (readgram): Display hidden chars in error messages.
10011
10012 2001-08-03 Akim Demaille <akim@epita.fr>
10013
10014 Update to gettext 0.10.39.
10015
10016 2001-08-03 Akim Demaille <akim@epita.fr>
10017
10018 * lib/strspn.c: New.
10019
10020 2001-08-01 Marc Autret <autret_m@epita.fr>
10021
10022 * doc/bison.texinfo: Update.
10023 * doc/bison.1 (mandoc): Update.
10024 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
10025 * src/files.c: Support output files extensions computing.
10026 (src_extension): New static variable.
10027 (header_extension): New static variable.
10028 (tr): New function.
10029 (get_extension_index): New function, gets the index of an extension
10030 filename in a string.
10031 (compute_exts_from_gf): New function, computes extensions from the
10032 grammar file extension.
10033 (compute_exts_from_src): New functions, computes extensions from the
10034 C source file extension, file given by ``-o'' option.
10035 (compute_base_names): Update.
10036 (output_files): Update.
10037
10038 2001-08-01 Robert Anisko <anisko_r@epita.fr>
10039
10040 * doc/bison.texi: Document @$.
10041 (Locations): New section.
10042
10043 2001-07-18 Akim Demaille <akim@epita.fr>
10044
10045 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
10046 * config/prev-version.txt, config/move-if-change: New.
10047 * Makefile.am: Adjust.
10048
10049 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
10050
10051 * src/bison.simple (yyparse): Suppress warning `comparaison
10052 between signed and unsigned'.
10053
10054 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
10055
10056 * src/getargs.h (raw_flag): Remove.
10057 * src/getargs.c: Die on `-r'/`--raw'.
10058 * src/lex.c (parse_percent_token): Die on `%raw'.
10059 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
10060 * tests/calc.at: Suppress test with option `--raw'.
10061
10062 2001-07-14 Akim Demaille <akim@epita.fr>
10063
10064 * config/: New.
10065 * configure.in: Require Autoconf 2.50.
10066 Update to gettext 0.10.38.
10067
10068 2001-03-16 Akim Demaille <akim@epita.fr>
10069
10070 * doc/bison.texinfo: ANSIfy the examples.
10071
10072 2001-03-16 Akim Demaille <akim@epita.fr>
10073
10074 * getargs.c (skeleton): New variable.
10075 (longopts): --skeleton is a new option.
10076 (shortopts, getargs): -S is a new option.
10077 * getargs.h: Declare skeleton.
10078 * output.c (output_parser): Use it.
10079
10080 2001-03-16 Akim Demaille <akim@epita.fr>
10081
10082 * m4/strerror_r.m4: New.
10083 * m4/error.m4: Run AC_FUNC_STRERROR_R.
10084 * lib/error.h, lib/error.c: Update.
10085
10086 2001-03-16 Akim Demaille <akim@epita.fr>
10087
10088 * src/getargs.c (longopts): Clean up.
10089
10090 2001-02-21 Akim Demaille <akim@epita.fr>
10091
10092 * src/reader.c (gensym): `gensym_count' is your own.
10093 Use a static buf to create the symbol name, as token_buffer is no
10094 longer a buffer.
10095
10096 2001-02-08 Akim Demaille <akim@epita.fr>
10097
10098 * src/conflicts.c (conflict_report): Be sure not to append to res
10099 between two calls, which could happen if both first sprintf were
10100 skipped, but not the first cp += strlen.
10101
10102 2001-02-08 Akim Demaille <akim@epita.fr>
10103
10104 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
10105 New, from fileutils 4.0.37.
10106 * configure.in: Require Autoconf 2.49c. I took some time before
10107 making this decision. This is the only way out for portability
10108 issues in Bison, it would mean way too much duplicate effort to
10109 import in Bison features implemented in 2.49c since 2.13.
10110 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
10111
10112 2001-02-02 Akim Demaille <akim@epita.fr>
10113
10114 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
10115 * lib/xalloc.h, lib/xmalloc.c: Update.
10116
10117 2001-01-19 Akim Demaille <akim@epita.fr>
10118
10119 Get rid of the ad hoc handling of token_buffer in the scanner: use
10120 the obstacks.
10121
10122 * src/lex.c (token_obstack): New.
10123 (init_lex): Initialize it. No longer call...
10124 (grow_token_buffer): this. Remove it.
10125 Adjust all the places which used it to use the obstack.
10126
10127 2001-01-19 Akim Demaille <akim@epita.fr>
10128
10129 * src/lex.h: Rename all the tokens:
10130 s/\bENDFILE\b/tok_eof/g;
10131 s/\bIDENTIFIER\b/tok_identifier/g;
10132 etc.
10133 Let them be enums, not #define, to ease debugging.
10134 Adjust all the code.
10135
10136 2001-01-18 Akim Demaille <akim@epita.fr>
10137
10138 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
10139 * src/lex.c (maxtoken, grow_token_buffer): Static.
10140
10141 2001-01-18 Akim Demaille <akim@epita.fr>
10142
10143 Since we now use obstacks, more % directives can be enabled.
10144
10145 * src/lex.c (percent_table): Also accept `%yacc',
10146 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
10147 `%debug'.
10148 Handle the actions for `%semantic_parser' and `%pure_parser' here,
10149 instead of returning a token.
10150 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
10151 * src/reader.c (read_declarations): Adjust.
10152 * src/files.c (open_files): Don't call `compute_base_names', don't
10153 compute `attrsfile' since they depend upon data which might be
10154 *in* the input file now.
10155 (output_files): Do it here.
10156 * src/output.c (output_headers): Document the fact that this patch
10157 introduces a guaranteed SEGV for semantic parsers.
10158 * doc/bison.texinfo: Document them.
10159 * tests/suite.at: Exercise these %options.
10160
10161 2000-12-20 Akim Demaille <akim@epita.fr>
10162
10163 Also handle the output file (--verbose) with obstacks.
10164
10165 * files.c (foutput): Remove.
10166 (output_obstack): New.
10167 Adjust all dependencies.
10168 * src/conflicts.c: Return a string.
10169 * src/system.h (obstack_grow_string): Rename as...
10170 (obstack_sgrow): this. Be ready to work with non literals.
10171 (obstack_fgrow4): New.
10172
10173 2000-12-20 Akim Demaille <akim@epita.fr>
10174
10175 * src/files.c (open_files): Fix the computation of short_base_name
10176 in the case of `-o foo.tab.c'.
10177
10178 2000-12-20 Akim Demaille <akim@epita.fr>
10179
10180 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
10181 (copy_dollar): Now that everything uses obstacks, get rid of the
10182 FILE * parameters.
10183
10184 2000-12-20 Akim Demaille <akim@epita.fr>
10185
10186 * src/files.c (open_files): Actually the `.output' file is based
10187 on the short_base_name, not base_name.
10188 * tests/suite.at (Checking output file names): Adjust.
10189
10190 2000-12-20 Akim Demaille <akim@epita.fr>
10191
10192 * src/bison.s1: Remove, we now use directly...
10193 * src/bison.simple: this.
10194 * src/Makefile.am: Use pkgdata instead of data.
10195
10196 2000-12-20 Akim Demaille <akim@epita.fr>
10197
10198 * src/files.c (guard_obstack): New.
10199 (open_files): Initialize it.
10200 (output_files): Dump it...
10201 * src/files.h: Export it.
10202 * src/reader.c (copy_guard): Use it.
10203
10204 2000-12-19 Akim Demaille <akim@epita.fr>
10205
10206 * src/files.c (outfile, defsfile, actfile): Removed as global
10207 vars.
10208 (open_files): Don't compute them.
10209 (output_files): Adjust.
10210 (base_name, short_base_name): Be global.
10211 Adjust dependencies.
10212
10213 2000-12-19 Akim Demaille <akim@epita.fr>
10214
10215 * src/files.c (strsuffix): New.
10216 (stringappend): Be just like strcat but allocate.
10217 (base_names): Eve out from open_files.
10218 Try to simplify the rather hairy computation of base_name and
10219 short_base_name.
10220 (open_files): Use it.
10221 * tests/suite.at (Checking output file names): New test.
10222
10223 2000-12-19 Akim Demaille <akim@epita.fr>
10224
10225 * src/system.h (obstack_grow_literal_string): Rename as...
10226 (obstack_grow_string): this.
10227 * src/output.c (output_parser): Recognize `%% actions' instead of
10228 `$'.
10229 * src/bison.s1: s/$/%% actions/.
10230 * src/bison.hairy: Likewise.
10231
10232 2000-12-19 Akim Demaille <akim@epita.fr>
10233
10234 * src/output.c (output_parser): Compute the `#line' lines when
10235 there are.
10236 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
10237 Suggested by Hans Aberg.
10238
10239 2000-12-19 Akim Demaille <akim@epita.fr>
10240
10241 Let the handling of the skeleton files be local to the procedures
10242 that use it.
10243
10244 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
10245 longer static.
10246 (fparser, open_extra_files): Remove.
10247 (open_files, output_files): Don't take care of fparser.
10248 * src/files.h: Adjust.
10249 * src/output.c (output_parser): Open and close the file to the
10250 skeleton.
10251 * src/reader.c (read_declarations): When %semantic_parser, open
10252 fguard.
10253
10254 2000-12-19 Akim Demaille <akim@epita.fr>
10255
10256 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
10257 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
10258
10259 2000-12-19 Akim Demaille <akim@epita.fr>
10260
10261 * src/files.c (open_files): Yipee! We no longer need all the code
10262 looking for `/tmp' since we have no tmp file.
10263
10264 2000-12-19 Akim Demaille <akim@epita.fr>
10265
10266 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
10267 New macros.
10268 * src/files.c (open_files): Less dependency on MSDOS etc.
10269
10270 2000-12-14 Akim Demaille <akim@epita.fr>
10271
10272 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
10273 Provide a default definition.
10274 Use it when executing the default @ action.
10275 * src/reader.c (reader_output_yylsp): No longer include
10276 `timestamp' and `text' in the default YYLTYPE.
10277
10278 2000-12-12 Akim Demaille <akim@epita.fr>
10279
10280 * src/reader.c (copy_definition, parse_union_decl, copy_action)
10281 (copy_guard): Quote the file names.
10282 Reported by Laurent Mascherpa.
10283
10284 2000-12-12 Akim Demaille <akim@epita.fr>
10285
10286 * src/output.c (output_headers, output_program, output): Be sure
10287 to escape special characters when outputting filenames.
10288 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
10289 (output_headers): Don't depend on them, Use ACTSTR.
10290
10291 2000-11-17 Akim Demaille <akim@epita.fr>
10292
10293 * lib/obstack.h: Formatting changes.
10294 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
10295 prevents type checking.
10296 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10297 cast the value to (void *): assigning a `foo *' to a `void *'
10298 variable is valid.
10299 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10300 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
10301 append characters.
10302
10303 2000-11-17 Akim Demaille <akim@epita.fr>
10304
10305 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
10306 as...
10307 (suite.m4, regression.m4, calc.m4): these.
10308 * tests/atgeneral.m4: Update from CVS Autoconf.
10309
10310 2000-11-17 Akim Demaille <akim@epita.fr>
10311
10312 * tests/regression.m4 (%union and --defines): New test,
10313 demonstrating a current bug in the obstack implementation.
10314
10315 2000-11-17 Akim Demaille <akim@epita.fr>
10316
10317 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
10318 macros.
10319 Use them to declare the variables which are global or local to
10320 `yyparse'.
10321
10322 2000-11-17 Akim Demaille <akim@epita.fr>
10323
10324 * acconfig.h: Remove, no longer used.
10325
10326 2000-11-07 Akim Demaille <akim@epita.fr>
10327
10328 * src: s/Copyright (C)/Copyright/g.
10329
10330 2000-11-07 Akim Demaille <akim@epita.fr>
10331
10332 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
10333 defining.
10334 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
10335
10336 2000-11-07 Akim Demaille <akim@epita.fr>
10337
10338 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
10339 Merge in a single CPP if/else.
10340
10341 2000-11-07 Akim Demaille <akim@epita.fr>
10342
10343 * src/output.c (output): Remove useless variables.
10344 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
10345 argument `data' for consistency with the prototypes.
10346 Qualify it `const'.
10347 (obstack_copy, obstack_copy0): Rename the second argument as
10348 `address' for consistency. Qualify it `const'.
10349 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
10350 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
10351 `const' their input argument (`data' or `address').
10352 Adjust the corresponding macros to include `const' in casts.
10353
10354 2000-11-03 Akim Demaille <akim@epita.fr>
10355
10356 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
10357 s/PFILE1/BISON_HAIRY/.
10358 Adjust dependencies.
10359
10360 2000-11-03 Akim Demaille <akim@epita.fr>
10361
10362 For some reason, this was not applied.
10363
10364 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
10365 `unlink': it's no longer used.
10366
10367 2000-11-03 Akim Demaille <akim@epita.fr>
10368
10369 * src/files.c (skeleton_find): New function, eved out of...
10370 (open_files, open_extra_files): here.
10371
10372 2000-11-03 Akim Demaille <akim@epita.fr>
10373
10374 Don't use `atexit'.
10375
10376 * src/files.c (obstack_save): New function.
10377 (done): Rename as...
10378 (output_files): this.
10379 Use `obstack_save'.
10380 * src/main.c (main): Don't use `atexit' to register `done', since
10381 it no longer has to remove tmp files, just call `output_files'
10382 when there are no errors.
10383
10384 2000-11-02 Akim Demaille <akim@epita.fr>
10385
10386 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
10387 `unlink': it's no longer used.
10388 * src/files.h: Formatting changes.
10389
10390 2000-11-02 Akim Demaille <akim@epita.fr>
10391
10392 Remove the last uses of mktemp and unlink/delete.
10393
10394 * src/files.c (fdefines, ftable): Removed.
10395 (defines_ostack, table_obstack): New.
10396 Adjust dependencies of the former into uses of the latter.
10397 * src/output.c (output_short_or_char_table, output_short_table):
10398 Convert to using obstacks.
10399 * src/reader.c (copy_comment2): Accept one FILE * and two
10400 obstacks.
10401 (output_token_defines, reader_output_yylsp): Use obstacks.
10402 * src/system.h (obstack_fgrow3): New.
10403 * po/POTFILES.in: Adjust.
10404
10405 2000-11-01 Akim Demaille <akim@epita.fr>
10406
10407 Change each use of `fattrs' into a use of `attrs_obstack'.
10408
10409 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
10410 * src/files.c (fattrs): Remove.
10411 (attrs_obstack): New.
10412 Adjust all dependencies.
10413 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
10414
10415 2000-11-01 Akim Demaille <akim@epita.fr>
10416
10417 Introduce obstacks.
10418 Change each use of `faction' into a use of `action_obstack'.
10419
10420 * lib/obstack.h, lib/obstack.c: New files.
10421 * src/files.c (faction): Remove.
10422 (action_obstack): New.
10423 Adjust all dependencies.
10424
10425 2000-10-20 Akim Demaille <akim@epita.fr>
10426
10427 * lib/quote.h (PARAMS): New macro. Use it.
10428
10429 2000-10-16 Akim Demaille <akim@epita.fr>
10430
10431 * src/output.c (output_short_or_char_table): New function.
10432 (output_short_table, output_token_translations): Use it.
10433 (goto_actions): Use output_short_table.
10434
10435 2000-10-16 Akim Demaille <akim@epita.fr>
10436
10437 * src/symtab.c (bucket_new): New function.
10438 (getsym): Use it.
10439
10440 * src/output.c (output_short_table): New argument to display the
10441 comment associated with the table.
10442 Adjust dependencies.
10443 (output_gram): Use it.
10444 (output_rule_data): Nicer output layout for YYTNAME.
10445
10446 2000-10-16 Akim Demaille <akim@epita.fr>
10447
10448 * src/lex.c (read_typename): New function.
10449 (lex): Use it.
10450 * src/reader.c (copy_dollar): Likewise.
10451
10452 2000-10-16 Akim Demaille <akim@epita.fr>
10453
10454 * src/reader.c (copy_comment2): Expect the input stream to be on
10455 the `/' which is suspected to open a comment, instead of being
10456 called after `//' or `/*' was read.
10457 (copy_comment, copy_definition, parse_union_decl, copy_action)
10458 (copy_guard): Adjust.
10459
10460 2000-10-16 Akim Demaille <akim@epita.fr>
10461
10462 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
10463 `read_signed_integer'.
10464
10465 2000-10-16 Akim Demaille <akim@epita.fr>
10466
10467 * src/reader.c (copy_dollar): New function.
10468 (copy_guard, copy_action): Use it.
10469
10470 2000-10-16 Akim Demaille <akim@epita.fr>
10471
10472 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
10473 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
10474 New files, from Fileutils 4.0.27.
10475 * src/main.c (printable_version): Remove.
10476 * src/lex.c, src/reader.c: Use `quote'.
10477
10478 2000-10-04 Akim Demaille <akim@epita.fr>
10479
10480 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
10481
10482 2000-10-04 Akim Demaille <akim@epita.fr>
10483
10484 * doc/bison.texinfo: Various typos spotted by Neil Booth.
10485
10486 2000-10-04 Akim Demaille <akim@epita.fr>
10487
10488 When a literal string is used to define two different tokens,
10489 `bison -v' segfaults.
10490 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
10491
10492 * tests/regression.m4: New file.
10493 Include the core of the sample provided by Piotr Gackiewicz.
10494 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
10495 properly.
10496
10497 2000-10-04 Akim Demaille <akim@epita.fr>
10498
10499 * src/reader.c (parse_expect_decl): Keep `count' within the size
10500 of `buffer'.
10501 From Neil Booth.
10502
10503 2000-10-02 Paul Eggert <eggert@twinsun.com>
10504
10505 * bison.s1 (yyparse): Assign the default value
10506 unconditionally, to avoid a GCC warning and make the parser a
10507 tad smaller.
10508
10509 2000-10-02 Akim Demaille <akim@epita.fr>
10510
10511 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
10512 options.
10513
10514 2000-10-02 Akim Demaille <akim@epita.fr>
10515
10516 * src/derives.c, src/print.c, src/reduce.c: To ease the
10517 translation, move some `\n' out of the translated strings.
10518
10519 2000-10-02 Akim Demaille <akim@epita.fr>
10520
10521 The location tracking mechanism is precious for parse error
10522 messages. Nevertheless, it is enabled only when `@n' is used in
10523 the grammar, which is a different issue (you can use it in error
10524 message, but not in the grammar per se). Therefore, there should
10525 be another means to enable it.
10526
10527 * src/getargs.c (getargs): Support `--locations'.
10528 (usage): Report it.
10529 * src/getargs.h (locationsflag): Export it.
10530 * src/lex.c (percent_table): Support `%locations'.
10531 * src/reader.c (yylsp_needed): Remove this variable, now replaced
10532 with `locationsflag'.
10533 * doc/bison.texinfo: Document `--locations' and `%locations'.
10534 Sort the options.
10535 * tests/calc.m4: Test it.
10536
10537 For regularity of the names, replace each
10538 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
10539 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
10540 In addition replace each `flag' with `_flag'.
10541
10542 2000-10-02 Akim Demaille <akim@epita.fr>
10543
10544 Also test parse error messages, including with YYERROR_VERBOSE.
10545
10546 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
10547 associative).
10548 Use it to check the computations.
10549 Use it to check `nonassoc' is honored.
10550 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
10551 `--yyerror-verbose'.
10552 (_AT_CHECK_CALC): Adjust to this option.
10553 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
10554
10555 2000-10-02 Akim Demaille <akim@epita.fr>
10556
10557 Test also `--verbose', `--defines' and `--name-prefix'. Testing
10558 the latter demonstrates a flaw in the handling of non debugging
10559 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
10560 was used in order to simplify:
10561
10562 #if YYDEBUG
10563 if (yydebug)
10564 {
10565 ...
10566 }
10567 #endif
10568
10569 into
10570
10571 if (yydebug)
10572 {
10573 ...
10574 }
10575
10576 unfortunately this leads to a CPP conflict when
10577 `--name-prefix=foo' is used since it produces `#define yydebug
10578 foodebug'.
10579
10580 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
10581 (YYDPRINTF): New macro.
10582 Spread its use.
10583 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
10584 the bison options.
10585 Also test `--verbose', `--defines' and `--name-prefix'.
10586
10587 2000-10-02 Akim Demaille <akim@epita.fr>
10588
10589 Improve the readability of the produced parsers.
10590
10591 * src/bison.s1: Formatting changes.
10592 Improve the comment related to the `$' mark.
10593 (yydefault): Don't fall through to `yyresume': `goto' there.
10594 * src/output.c (output_parser): When the `$' is met, skip the end
10595 of its line.
10596 New variable, `number_of_dollar_signs', to check there's exactly
10597 one `$' in the parser skeleton.
10598
10599 2000-10-02 Akim Demaille <akim@epita.fr>
10600
10601 * lib/xstrdup.c: New file, from the fileutils.
10602 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
10603 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
10604 instead of strlen + xmalloc + strcpy.
10605 * src/symtab.c (copys): Remove, use xstrdup instead.
10606
10607 2000-10-02 Akim Demaille <akim@epita.fr>
10608
10609 * src/gram.h (associativity): New enum type which replaces the
10610 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
10611 `right_assoc', `left_assoc' and `non_assoc'.
10612 Adjust all dependencies.
10613 * src/reader.c: Formatting changes.
10614 (LTYPESTR): Don't define it, use it as a literal in
10615 `reader_output_yylsp'.
10616 * src/symtab.h (symbol_class): New enum type which replaces the
10617 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
10618 `sunknown', `stoken and `snterm'.
10619
10620 2000-10-02 Akim Demaille <akim@epita.fr>
10621
10622 * src/getargs.c (fixed_outfiles): Rename as...
10623 (yaccflag): for consistency and accuracy.
10624 Adjust dependencies.
10625
10626 2000-10-02 Akim Demaille <akim@epita.fr>
10627
10628 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
10629 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
10630 difficult and introduced a lot of core dump. It turns out that
10631 Bison used an implementation of `xmalloc' based on `calloc', and
10632 at various places it does depend upon the initialization to 0. I
10633 have not tried to isolate the pertinent places, and all the former
10634 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
10635 someone should address this issue.
10636
10637 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
10638 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
10639 files.
10640 Adjust dependencies.
10641 * src/warshall.h: New file.
10642 Propagate.
10643
10644 2000-10-02 Akim Demaille <akim@epita.fr>
10645
10646 Various anti-`extern in *.c' changes.
10647
10648 * src/system.h: Include `assert.h'.
10649
10650 2000-10-02 Akim Demaille <akim@epita.fr>
10651
10652 * src/state.h (nstates, final_state, first_state, first_shift)
10653 (first_reduction): Move their exportation from here...
10654 * src/LR0.h: to here.
10655 Adjust dependencies.
10656 * src/getargs.c (statisticsflag): New variable.
10657 Add support for `--statistics'.
10658 Adjust dependencies.
10659
10660 Remove a lot of now useless `extern' statements in most files.
10661
10662 2000-10-02 Akim Demaille <akim@epita.fr>
10663
10664 * src/LR0.h: New file.
10665 Propagate its use.
10666
10667 2000-10-02 Akim Demaille <akim@epita.fr>
10668
10669 * src/print.h: New file.
10670 Propagate its use.
10671 * src/print.c: Formatting and ordering changes.
10672 (verbose, terse): Replace with...
10673 (print_results): this new function.
10674 Adjust dependencies.
10675
10676 2000-10-02 Akim Demaille <akim@epita.fr>
10677
10678 * src/conflicts.c (conflict_report): New function.
10679 (conflict_log, verbose_conflict_log): Replace with...
10680 (print_conflicts): this function.
10681 Adjust dependencies.
10682 * src/conflicts.h: New file.
10683 Propagate its inclusion.
10684
10685 2000-10-02 Akim Demaille <akim@epita.fr>
10686
10687 * src/nullable.h: New file.
10688 Propagate its inclusion.
10689 * src/nullable.c: Formatting changes.
10690
10691 2000-10-02 Akim Demaille <akim@epita.fr>
10692
10693 * src/reduce.h: New file.
10694 Propagate its inclusion.
10695 * src/reduce.c: Topological sort and other formatting changes.
10696 (bool, TRUE, FALSE): Move their definition to...
10697 * src/system.h: here.
10698
10699 2000-10-02 Akim Demaille <akim@epita.fr>
10700
10701 * src/files.c: Formatting changes.
10702 (tryopen, tryclose, openfiles): Rename as...
10703 (xfopen, xfclose, open_files): this.
10704 (stringappend): static.
10705 * src/files.h: Complete the list of exported symbols.
10706 Propagate its use.
10707
10708 2000-10-02 Akim Demaille <akim@epita.fr>
10709
10710 * src/reader.h: New file.
10711 Propagate its use instead of tedious list of `extern' and
10712 prototypes.
10713 * src/reader.c: Formatting changes, topological sort,
10714 s/register//.
10715
10716 2000-10-02 Akim Demaille <akim@epita.fr>
10717
10718 * src/lex.h: Prototype `lex.c' exported functions.
10719 * src/reader.c: Adjust.
10720 * src/lex.c: Formatting changes.
10721 (safegetc): Rename as...
10722 (xgetc): this.
10723
10724 2000-10-02 Akim Demaille <akim@epita.fr>
10725
10726 * src/lalr.h: New file.
10727 Propagate its inclusion instead of prototypes and `extern'.
10728 * src/lalr.c: Formatting changes, topological sorting etc.
10729
10730 2000-10-02 Akim Demaille <akim@epita.fr>
10731
10732 * src/output.c (token_actions): Introduce a temporary array,
10733 YYDEFACT, that makes it possible for this function to use
10734 output_short_table.
10735
10736 2000-10-02 Akim Demaille <akim@epita.fr>
10737
10738 `user_toknums' is output as a `short[]' in `output.c', while it is
10739 defined as a `int[]' in `reader.c'. For consistency with the
10740 other output tables, `user_toknums' is now defined as a table of
10741 shorts.
10742
10743 * src/reader.c (user_toknums): Be a short table instead of an int
10744 table.
10745 Adjust dependencies.
10746
10747 Factor the short table outputs.
10748
10749 * src/output.c (output_short_table): New function.
10750 * src/output.c (output_gram, output_stos, output_rule_data)
10751 (output_base, output_table, output_check): Use it.
10752
10753 2000-10-02 Akim Demaille <akim@epita.fr>
10754
10755 * src/output.c (output): Topological sort of the functions, in
10756 order to get rid of the `static' prototypes.
10757 No longer use `register'.
10758 * src/output.h: New file.
10759 Propagate its inclusion in files explicitly prototyping functions
10760 from output.c.
10761
10762 2000-09-21 Akim Demaille <akim@epita.fr>
10763
10764 * src/atgeneral.m4: Update from Autoconf.
10765
10766 2000-09-21 Akim Demaille <akim@epita.fr>
10767
10768 * src/closure.h: New file.
10769 * src/closure.c: Formatting changes, topological sort over the
10770 functions, use of closure.h.
10771 (initialize_closure, finalize_closure): Rename as...
10772 (new_closure, free_closure): these. Adjust dependencies.
10773 * src/LR0.c: Formatting changes, topological sort, use of
10774 cloture.h.
10775 (initialize_states): Rename as...
10776 (new_states): this.
10777 * src/Makefile.am (noinst_HEADERS): Adjust.
10778
10779 2000-09-20 Akim Demaille <akim@epita.fr>
10780
10781 * src/acconfig.h: Don't protect config.h against multiple
10782 inclusion.
10783 Don't define PARAMS.
10784 * src/system.h: Define PARAMS.
10785 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
10786 purpose of config.h. system.h must not try to fix wrong
10787 definitions in config.h.
10788
10789 2000-09-20 Akim Demaille <akim@epita.fr>
10790
10791 * src/derives.h: New file.
10792 * src/main.c, src/derives.h: Use it.
10793 Formatting changes.
10794 * src/Makefile.am (noinst_HEADERS): Adjust.
10795
10796 2000-09-20 Akim Demaille <akim@epita.fr>
10797
10798 * tests/atgeneral.m4: Update from Autoconf.
10799 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
10800 (AT_CHECK_CALC): New macros.
10801 Use these macros to test bison with options `', `--raw',
10802 `--debug', `--yacc', `--yacc --debug'.
10803
10804 2000-09-19 Akim Demaille <akim@epita.fr>
10805
10806 * src/output.c: Formatting changes.
10807 * src/machine.h: Remove, leaving its contents in...
10808 * src/system.h: here.
10809 Include stdio.h.
10810 Adjust all dependencies on stdio.h and machine.h.
10811 * src/getargs.h: New file.
10812 Let all `extern' declarations about getargs.c be replaced with
10813 inclusion of `getargs.h'.
10814 * src/Makefile.am (noinst_HEADERS): Adjust.
10815
10816 * tests/calc.m4 (yyin): Be initialized in main, not on the global
10817 scope.
10818 (yyerror): Returns void, not int.
10819 * doc/bison.texinfo: Formatting changes.
10820
10821 2000-09-19 Akim Demaille <akim@epita.fr>
10822
10823 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
10824 portable.
10825
10826 2000-09-18 Akim Demaille <akim@epita.fr>
10827
10828 * configure.in: Append WARNING_CFLAGS to CFLAGS.
10829 * src/Makefile.am (INCLUDES): Don't.
10830 Be ready to fetch headers in lib/.
10831
10832 2000-09-18 Akim Demaille <akim@epita.fr>
10833
10834 * doc/bison.texinfo: Update the copyright.
10835 ANSIfy and GNUify the examples.
10836 Remove the old menu.
10837
10838 2000-09-18 Akim Demaille <akim@epita.fr>
10839
10840 First set of tests: use the `calc' example from the documentation.
10841
10842 * src/bison.s1 (yyparse): Condition the code using `yytname' which
10843 is defined only when YYDEBUG is.
10844 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
10845 * src/files.c (tryopen, tryclose): Formatting changes.
10846 Move to the top and be static.
10847 * src/reader.c (read_signed_integer): Likewise.
10848 * tests/calc.m4: New file.
10849 * Makefile.am, suite.m4: Adjust.
10850 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
10851
10852 2000-09-18 Akim Demaille <akim@epita.fr>
10853
10854 Add support for an Autotest test suite for Bison.
10855
10856 * m4/m4.m4, m4/atconfig.m4: New files.
10857 * m4/Makefile.am (EXTRA_DIST): Adjust.
10858 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
10859 files.
10860 * src/getargs.c: Display a more standard --version message.
10861 * src/reader.c (reader): Formatting changes.
10862 No longer depend upon VERSION_STRING.
10863 * configure.in: No longer use `dnl'.
10864 Set up the test suite and the new directory `tests/.
10865 (VERSION_STRING): Remove.
10866
10867 2000-04-14 Akim Demaille <akim@epita.fr>
10868
10869 * src/reader.c (copy_comment2): New function, same as former
10870 `copy_comment', but outputs into two FILE *.
10871 (copy_comment): Use it.
10872 (parse_union_decl): Use it.
10873 (get_type, parse_start_decl): Use the same `invalid' message.
10874 (parse_start_decl, parse_union_decl): Use the same `multiple'
10875 message.
10876 (parse_union_decl, copy_guard, copy_action): Use the same
10877 `unmatched' message.
10878 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
10879
10880 2000-03-31 Akim Demaille <akim@epita.fr>
10881
10882 * src/files.c (tryopen, tryclose): Move to the top.
10883 Be static.
10884
10885 2000-03-31 Akim Demaille <akim@epita.fr>
10886
10887 * src/main.c (main): Don't call `done', exit does it.
10888
10889 2000-03-31 Akim Demaille <akim@epita.fr>
10890
10891 * allocate.c: s/return (foo)/return foo/.
10892 * lalr.c: Likewise.
10893 * LR0.c: Likewise.
10894 * output.c: Likewise.
10895 * reader.c: Likewise.
10896 * symtab.c: Likewise.
10897 * vmsgetargs.c: Likewise.
10898
10899 2000-03-31 Akim Demaille <akim@epita.fr>
10900
10901 Clean up the error reporting functions.
10902
10903 * src/report.c: New file.
10904 * src/report.h: Likewise.
10905 * src/Makefile.am: Adjust.
10906 * m4/error.m4: New file.
10907 * m4/Makefile.am: Adjust.
10908 * configure.in (jm_PREREQ_ERROR): Call it.
10909 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
10910 Remove.
10911 (fatal, fatals): Remove. All callers use complain.c::fatal.
10912 (warn, warni, warns, warnss, warnss): Remove. All callers use
10913 complain.c::complain.
10914 (toomany): Remove, use fatal instead.
10915 * src/files.c (done): No argument, use complain_message_count.
10916 * src/main.c (main): Register `done' to `atexit'.
10917
10918 * src/getargs.c (usage): More `fputs', less `fprintf'.
10919
10920 2000-03-28 Akim Demaille <akim@epita.fr>
10921
10922 * lib/: New directory.
10923 * Makefile.am (SUBDIRS): Adjust.
10924 * configure.in: Adjust.
10925 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
10926 useless.
10927 * src/alloca.c: Moved to lib/.
10928 * src/getopt.c: Likewise.
10929 * src/getopt1.c: Likewise.
10930 * src/getopt.h: Likewise.
10931 * src/ansi2knr.c: Likewise.
10932 * src/ansi2knr.1: Likewise.
10933 * src/Makefile.am: Adjust.
10934 * lib/Makefile.am: New file.
10935
10936 2000-03-28 Akim Demaille <akim@epita.fr>
10937
10938 * src/getargs.c (usage): Refresh the help message.
10939
10940 2000-03-17 Akim Demaille <akim@epita.fr>
10941
10942 * src/getopt1.c: Updated from textutils 2.0e
10943 * src/getopt.c: Likewise.
10944 * src/getopt.h: Likewise.
10945
10946 2000-03-17 Akim Demaille <akim@epita.fr>
10947
10948 * src/Makefile.am (bison.simple): Fix the awk program: quote only
10949 the file name, not the whole `#line LINE FILE'.
10950
10951 2000-03-17 Akim Demaille <akim@epita.fr>
10952
10953 On syntax errors, report the token on which we choked.
10954
10955 * src/bison.s1 (yyparse): In the label yyerrlab, when
10956 YYERROR_VERBOSE, add yychar in msg.
10957
10958 2000-03-17 Akim Demaille <akim@epita.fr>
10959
10960 * src/reader.c (copy_at): New function.
10961 (copy_guard): Use it.
10962 (copy_action): Use it.
10963
10964 2000-03-17 Akim Demaille <akim@epita.fr>
10965
10966 Be kind to translators, save some useless translations.
10967
10968 * src/main.c (banner): New function.
10969 (fatal_banner): Use it.
10970 (warn_banner): Use it.
10971
10972 2000-03-17 Akim Demaille <akim@epita.fr>
10973
10974 * src/reader.c (copy_definition): Use copy_string and
10975 copy_comment. Removed now unused `match', `ended',
10976 `cplus_comment'.
10977 (copy_comment, copy_string): Moved, to be visible from
10978 copy_definition.
10979
10980 2000-03-17 Akim Demaille <akim@epita.fr>
10981
10982 * src/reader.c (copy_string): Declare `static inline'. No
10983 problems with inline, since it is checked by configure.
10984 (copy_comment): Likewise.
10985
10986 2000-03-17 Akim Demaille <akim@epita.fr>
10987
10988 * src/reader.c (packsymbols): Formatting changes.
10989
10990 2000-03-17 Akim Demaille <akim@epita.fr>
10991
10992 * src/reader.c (copy_comment): New function, factored out from:
10993 (copy_action): Use it. Removed now unused `match', `ended',
10994 `cplus_comment'.
10995 (copy_guard): Likewise.
10996
10997 2000-03-17 Akim Demaille <akim@epita.fr>
10998
10999 * src/reader.c (copy_string): New function, factored out from:
11000 (copy_action): Use it.
11001 (copy_guard): Likewise.
11002
11003 2000-03-17 Akim Demaille <akim@epita.fr>
11004
11005 Change the handling of @s so that they behave exactly like $s.
11006 There is now a pseudo variable @$ (readble and writable), location
11007 of the lhs of the rule (by default ranging from the location of
11008 the first symbol of the rhs, to the location of the last symbol,
11009 or, if the rhs is empty, YYLLOC).
11010
11011 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
11012 yyval.
11013 (yyparse): When providing a default semantic action, provide a
11014 default location action.
11015 (after the $): No longer change `*YYLSP', just stack YYLOC the
11016 same way you stack YYVAL.
11017 * src/reader.c (read_declarations): Use warns.
11018 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
11019 (copy_action, case '@'): Likewise.
11020 Use a standard error message, to save useless work from
11021 translators.
11022
11023 2000-03-17 Akim Demaille <akim@epita.fr>
11024
11025 * src/bison.s1: Formatting and cosmetics changes.
11026 * src/reader.c: Likewise.
11027 Update the Copyright notice.
11028
11029 2000-03-17 Akim Demaille <akim@epita.fr>
11030
11031 * src/bison.s1 (#line): All set to `#line' only, since the
11032 Makefile now handles them.
11033
11034 2000-03-16 Akim Demaille <akim@epita.fr>
11035
11036 * src/output.c (output_rule_data): Output the documentation of
11037 some of the tables.
11038 (Copyright notice): Update.
11039 Formatting changes.
11040
11041 2000-03-16 Akim Demaille <akim@epita.fr>
11042
11043 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
11044 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
11045 One `#if YYDEBUG' remains, since it uses variables which are
11046 defined only if `YYDEBUG != 0'.
11047
11048 2000-03-16 Akim Demaille <akim@epita.fr>
11049
11050 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
11051 and related variables so that the similarities are highlighted.
11052
11053 2000-03-16 Akim Demaille <akim@epita.fr>
11054
11055 * src/bison.s1: Properly indent CPP directives.
11056
11057 2000-03-16 Akim Demaille <akim@epita.fr>
11058
11059 * src/bison.s1: Properly indent the `alloca' CPP section.
11060
11061 2000-03-16 Akim Demaille <akim@epita.fr>
11062
11063 Do not hard code values of directories in `configure.in'.
11064 Update the `configure' tool chain.
11065
11066 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
11067 src/makefile.am.
11068 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
11069 (AC_OUTPUT): Add m4/Makefile.
11070 Bump to bison 1.28a, 1.29 has never been released.
11071 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
11072 handled via src/Makefile.am.
11073 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
11074 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
11075 autoheader.
11076 * Makefile.am (SUBDIRS): Add m4.
11077 (ACLOCAL_AM_FLAGS): New variable.
11078 (AUTOMAKE_OPTIONS): Add check-news.
11079 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
11080 the proper line number and file name.
11081 (DEFS): Propagate the location of bison library files and of the
11082 locale files.
11083 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
11084 builddir.
11085 * acinclude.m4: Remove, replaced by the directory m4.
11086 * m4/Makefile.am (EXTRA_DIST): New variable.
11087 * m4/gettext.m4: New file, from the fileutils.
11088 * m4/lcmessage.m4: Likewise
11089 * m4/progtest.m4: Likewise.
11090 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
11091
11092 2000-03-10 Akim Demaille <akim@epita.fr>
11093
11094 * src/closure.c:
11095 Formatting changes of various comments.
11096 Respect the GNU coding standards at various places.
11097 Don't use `_()' when no translation is needed.
11098
11099 1999-12-13 Jesse Thilo <jthilo@gnu.org>
11100
11101 * src/files.c:
11102 OS/2 honors TMPDIR environment variable.
11103
11104 1999-12-13 Jesse Thilo <jthilo@gnu.org>
11105
11106 * doc/bison.texinfo: Tweaked spelling and grammar.
11107 Updated ISBN.
11108 Removed reference to price of printed copy.
11109 Mention BISON_SIMPLE and BISON_HAIRY.
11110
11111 1999-12-13 Jesse Thilo <jthilo@gnu.org>
11112
11113 * configure.in, NEWS:
11114 Bison 1.29 released.
11115
11116 1999-10-27 Jesse Thilo <jthilo@gnu.org>
11117
11118 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
11119 Added reference card.
11120
11121 1999-07-26 Jesse Thilo <jthilo@gnu.org>
11122
11123 * po/ru.po: Added Russian translation.
11124
11125 1999-07-26 Jesse Thilo <jthilo@gnu.org>
11126
11127 * configure.in: Added Russian translation.
11128
11129 1999-07-06 Jesse Thilo <jthilo@gnu.org>
11130
11131 * configure.in, NEWS, README:
11132 Released version 1.28.
11133
11134 1999-06-14 Jesse Thilo <jthilo@gnu.org>
11135
11136 * src/system.h:
11137 Squashed redefinition warning on some systems.
11138
11139 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
11140 Have configure build version string instead of relying on ANSI string
11141 concatentation.
11142
11143 1999-06-14 Jesse Thilo <jthilo@gnu.org>
11144
11145 * po/POTFILES.in: Got rid of version.c.
11146
11147 1999-06-14 Jesse Thilo <jthilo@gnu.org>
11148
11149 * acconfig.h, configure.in:
11150 Have configure build version string instead of relying on ANSI string
11151 concatentation.
11152
11153 1999-06-08 Jesse Thilo <jthilo@gnu.org>
11154
11155 * doc/bison.1:
11156 Dropped mention of `+' for long-named options.
11157
11158 1999-05-30 Jesse Thilo <jthilo@gnu.org>
11159
11160 * src/files.c: Added <unistd.h> for unlink().
11161
11162 * src/Makefile.am, src/system.h:
11163 I18n fixes.
11164
11165 1999-05-30 Jesse Thilo <jthilo@gnu.org>
11166
11167 * README: Added a FAQ list.
11168
11169 * configure.in, acconfig.h:
11170 I18n fixes.
11171
11172 1999-05-30 Jesse Thilo <jthilo@gnu.org>
11173
11174 * doc/FAQ, doc/Makefile.am:
11175 Added a FAQ list.
11176
11177 1999-05-19 Jesse Thilo <jthilo@gnu.org>
11178
11179 * src/alloc.h, src/symtab.h, src/version.c:
11180 Protected inclusion of "config.h" with HAVE_CONFIG_H.
11181
11182 1999-04-18 Jesse Thilo <jthilo@gnu.org>
11183
11184 * src/.cvsignore, src/Makefile.am:
11185 Reorganized: sources in `src', documentation in `doc'.
11186
11187 * src/lex.c (literalchar):
11188 fixed the code for escaping double quotes (thanks
11189 Jonathan Czisny.)
11190
11191 1999-04-18 Jesse Thilo <jthilo@gnu.org>
11192
11193 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
11194 Adjusted paths to reflect directory reorganization.
11195
11196 1999-04-18 Jesse Thilo <jthilo@gnu.org>
11197
11198 * doc/.cvsignore, doc/Makefile.am:
11199 Reorganized: sources in `src', documentation in `doc'.
11200
11201 1999-04-18 Jesse Thilo <jthilo@gnu.org>
11202
11203 * configure.in:
11204 Updated AC_INIT file to reflect directory reorganization.
11205
11206 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
11207 Reorganized: sources in `src', documentation in `doc'.
11208
11209 1999-04-13 Jesse Thilo <jthilo@gnu.org>
11210
11211 * src/allocate.c:
11212 Don't declare calloc() and realloc() if not necessary.
11213
11214 1999-04-13 Jesse Thilo <jthilo@gnu.org>
11215
11216 * configure.in, acconfig.h, acinclude.m4:
11217 Don't declare calloc() and realloc() if not necessary.
11218
11219 1999-03-23 Jesse Thilo <jthilo@gnu.org>
11220
11221 * po/.cvsignore: Added i18n support.
11222
11223 1999-03-23 Jesse Thilo <jthilo@gnu.org>
11224
11225 * acconfig.h, configure.in, Makefile.am:
11226 Added i18n support.
11227
11228 1999-03-22 Jesse Thilo <jthilo@gnu.org>
11229
11230 * src/bison.s1: Fixed #line numbers.
11231
11232 1999-03-15 Jesse Thilo <jthilo@gnu.org>
11233
11234 * po/es.po, po/fr.po, po/nl.po, po/de.po:
11235 Added PO files from Translation Project.
11236
11237 1999-03-03 Jesse Thilo <jthilo@gnu.org>
11238
11239 * Makefile.am:
11240 Added support for non-ANSI compilers (ansi2knr).
11241
11242 1999-02-16 Jesse Thilo <jthilo@gnu.org>
11243
11244 * configure.in: Bumped version number to 1.27.
11245
11246 * Makefile.am:
11247 Added `bison.simple' to list of files removed by `make distclean'.
11248
11249 1999-02-12 Jesse Thilo <jthilo@gnu.org>
11250
11251 * src/files.c, src/files.h:
11252 Defined locations of parser files in config.h instead of Makefile.
11253
11254 1999-02-12 Jesse Thilo <jthilo@gnu.org>
11255
11256 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
11257 Defined locations of parser files in config.h instead of Makefile.
11258
11259 1999-02-09 Jesse Thilo <jthilo@gnu.org>
11260
11261 * Makefile.am:
11262 Removed inappropriate use of $< macro.
11263
11264 1999-02-05 Jesse Thilo <jthilo@gnu.org>
11265
11266 * po/Makefile.in.in, po/POTFILES.in:
11267 Add `po' directory skeleton.
11268
11269 1999-01-27 Jesse Thilo <jthilo@gnu.org>
11270
11271 * README: Document help-bison list.
11272
11273 * configure.in: Add check for mkstemp().
11274
11275 1999-01-20 Jesse Thilo <jthilo@gnu.org>
11276
11277 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
11278 Hush a few compiler warnings.
11279
11280 * src/files.c:
11281 Add tryclose(), which verifies that fclose was successful.
11282 Hush a couple of compiler warnings.
11283
11284 1999-01-20 Jesse Thilo <jthilo@gnu.org>
11285
11286 * Makefile.am, OChangeLog:
11287 ChangeLog is now automatically generated. Include the old version as
11288 OChangeLog.
11289
11290 1999-01-14 Jesse Thilo <jthilo@gnu.org>
11291
11292 * 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:
11293 Update FSF address.
11294
11295 1999-01-14 Jesse Thilo <jthilo@gnu.org>
11296
11297 * doc/bison.texinfo: Fix formatting glitch.
11298
11299 * doc/bison.texinfo: Update FSF address.
11300
11301 1999-01-14 Jesse Thilo <jthilo@gnu.org>
11302
11303 * acconfig.h: Update FSF address.
11304
11305 1999-01-08 Jesse Thilo <jthilo@gnu.org>
11306
11307 * src/system.h:
11308 Don't define PACKAGE here, since config.h defines it.
11309
11310 1998-12-30 Jesse Thilo <jthilo@gnu.org>
11311
11312 * src/reader.c: Update copyright date.
11313
11314 * src/main.c:
11315 Ditch sprintf to statically-sized buffers in fatal/warn functions in
11316 favor of output directly to stderr (avoids buffer overruns).
11317
11318 * src/reader.c: Some checks for premature EOF.
11319
11320 * 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:
11321 Use prototypes if the compiler understands them.
11322
11323 * src/files.c: Honor TMPDIR on Unix hosts.
11324 Use prototypes if the compiler understands them.
11325
11326 * src/reader.c:
11327 Fix a couple of buffer overrun bugs.
11328 Use prototypes if the compiler understands them.
11329
11330 * src/system.h: Include unistd.h and ctype.h.
11331 Use #ifdef instead of #if for NLS symbols.
11332
11333 1998-12-30 Jesse Thilo <jthilo@gnu.org>
11334
11335 * doc/bison.texinfo:
11336 Delete comment "consider using @set for edition number, etc..." since
11337 we now are doing so.
11338
11339 1998-12-30 Jesse Thilo <jthilo@gnu.org>
11340
11341 * configure.in:
11342 Use prototypes if the compiler understands them.
11343
11344 * NEWS: Document 1.26 highlights.
11345
11346 * Makefile.am: Require Automake 1.3 or later.
11347
11348 * acconfig.h:
11349 Use prototypes if the compiler understands them.
11350
11351 1998-12-29 Jesse Thilo <jthilo@gnu.org>
11352
11353 * src/version.c:
11354 Use VERSION symbol from automake for version number.
11355
11356 1998-12-29 Jesse Thilo <jthilo@gnu.org>
11357
11358 * acconfig.h, configure.in, version.cin:
11359 Use VERSION symbol from automake for version number.
11360
11361 1998-11-28 Jesse Thilo <jthilo@gnu.org>
11362
11363 * Makefile.am:
11364 Distribute original version of simple parser (bison.s1), not built
11365 version (bison.simple).
11366
11367 1998-11-28 Jesse Thilo <jthilo@gnu.org>
11368
11369 * doc/bison.texinfo: Add info dir entry.
11370
11371 * doc/bison.texinfo:
11372 Let automake put version number into documentation.
11373
11374 1998-11-26 Jesse Thilo <jthilo@gnu.org>
11375
11376 * src/bison.cld, src/build.com, src/vmshlp.mar:
11377 Add non-RCS files from /gd/gnu/bison.
11378
11379 1998-11-26 Jesse Thilo <jthilo@gnu.org>
11380
11381 * doc/bison.1:
11382 Document the BISON_HAIRY and BISON_SIMPLE variables.
11383
11384 1998-11-25 Jesse Thilo <jthilo@gnu.org>
11385
11386 * src/version.c: Build version.c automatically.
11387
11388 * src/reader.c:
11389 Fix token numbering (used to start at 258, not 257).
11390
11391 * src/system.h: Include config.h.
11392
11393 * src/getargs.c: Update bug report address.
11394
11395 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
11396 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
11397
11398 1998-11-25 Jesse Thilo <jthilo@gnu.org>
11399
11400 * Makefile.am:
11401 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
11402
11403 * configure.in, version.cin:
11404 Build version.c automatically.
11405
11406 * AUTHORS: Add AUTHORS file.
11407
11408 * README: Update bug report address.
11409
11410 * bison.simple:
11411 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
11412
11413 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
11414 Add automake stuff.
11415
11416 1998-11-25 Jesse Thilo <jthilo@gnu.org>
11417
11418 * doc/bison.texinfo: Clean up some formatting.
11419
11420 1998-05-05 Richard Stallman <rms@gnu.org>
11421
11422 * doc/bison.texinfo:
11423 Explain better why to make a pure parser.
11424
11425 1998-01-05 Richard Stallman <rms@gnu.org>
11426
11427 * src/files.c (openfiles):
11428 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
11429 find a temporary directory, if possible. Do not unlink files while
11430 they are open.
11431
11432 1997-08-25 Richard Stallman <rms@gnu.org>
11433
11434 * src/reader.c (stack_offset;):
11435 Change some warni to warns.
11436
11437 * src/lex.c (literalchar): Use warns, not warni.
11438
11439 1997-06-28 Richard Stallman <rms@gnu.org>
11440
11441 * src/bison.s1: Add a Bison version comment.
11442
11443 * src/main.c (fatal, warn, berror):
11444 Use program_name.
11445
11446 1997-06-28 Richard Stallman <rms@gnu.org>
11447
11448 * Makefile.in (bison_version): New variable.
11449 (dist): Use that variable.
11450 (bison.s1): Substitute the Bison version into bison.simple.
11451
11452 * bison.simple: Add a Bison version comment.
11453
11454 1997-06-18 Richard Stallman <rms@gnu.org>
11455
11456 * src/main.c (fatal, warn, berror):
11457 Make error messages standard.
11458 (toomany): Improve error message text.
11459
11460 * 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:
11461 new.h renamed to alloc.h.
11462
11463 1997-06-18 Richard Stallman <rms@gnu.org>
11464
11465 * Makefile.in: new.h renamed to alloc.h.
11466
11467 1997-05-24 Richard Stallman <rms@gnu.org>
11468
11469 * src/lex.c (literalchar):
11470 Fix the code for escaping \, " and '.
11471
11472 (lex): Avoid trouble when there are many chars
11473 to discard in a char literal with just several chars in it.
11474
11475 1997-05-17 Richard Stallman <rms@gnu.org>
11476
11477 * src/bison.s1:
11478 Use malloc, if using alloca is troublesome.
11479 (YYSTACK_USE_ALLOCA): New flag macro.
11480 Define it for some systems and compilers.
11481 (YYSTACK_ALLOC): New macro.
11482 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11483 If it was malloc'd, free it.
11484
11485 1997-05-17 Richard Stallman <rms@gnu.org>
11486
11487 * bison.simple:
11488 Use malloc, if using alloca is troublesome.
11489 (YYSTACK_USE_ALLOCA): New flag macro.
11490 Define it for some systems and compilers.
11491 (YYSTACK_ALLOC): New macro.
11492 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11493 If it was malloc'd, free it.
11494
11495 1997-04-23 Richard Stallman <rms@gnu.org>
11496
11497 * src/bison.s1:
11498 (alloca) [__hpux]: Always define as __builtin_alloca.
11499
11500 1997-04-23 Richard Stallman <rms@gnu.org>
11501
11502 * bison.simple:
11503 (alloca) [__hpux]: Always define as __builtin_alloca.
11504
11505 1997-04-22 Richard Stallman <rms@gnu.org>
11506
11507 * src/bison.s1:
11508 [__hpux]: Include alloca.h (right for HPUX 10)
11509 instead of declaring alloca (right for HPUX 9).
11510
11511 * src/bison.s1 (__yy_memcpy):
11512 Declare arg `count' as unsigned int.
11513 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11514
11515 1997-04-22 Richard Stallman <rms@gnu.org>
11516
11517 * bison.simple:
11518 [__hpux]: Include alloca.h (right for HPUX 10)
11519 instead of declaring alloca (right for HPUX 9).
11520
11521 * bison.simple (__yy_memcpy):
11522 Declare arg `count' as unsigned int.
11523 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11524
11525 1997-01-03 Richard Stallman <rms@gnu.org>
11526
11527 * src/allocate.c: [__STDC__ or _MSC_VER]:
11528 Declare calloc and realloc to return void *.
11529
11530 1997-01-02 Richard Stallman <rms@gnu.org>
11531
11532 * src/system.h:
11533 [_MSC_VER]: Include stdlib.h and process.h.
11534 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
11535
11536 * src/main.c (main): Return FAILURE as a value.
11537 (printable_version): Declare arg as int, not char.
11538
11539 1997-01-02 Richard Stallman <rms@gnu.org>
11540
11541 * Makefile.in (dist):
11542 Explicitly check for symlinks, and copy them.
11543
11544 1996-12-19 Richard Stallman <rms@gnu.org>
11545
11546 * src/files.c:
11547 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
11548
11549 1996-12-18 Paul Eggert <eggert@gnu.org>
11550
11551 * src/bison.s1 (yyparse):
11552 If __GNUC__ and YYPARSE_PARAM are both defined,
11553 declare yyparse to have a void * argument.
11554
11555 1996-12-18 Paul Eggert <eggert@gnu.org>
11556
11557 * bison.simple (yyparse):
11558 If __GNUC__ and YYPARSE_PARAM are both defined,
11559 declare yyparse to have a void * argument.
11560
11561 1996-12-17 Richard Stallman <rms@gnu.org>
11562
11563 * src/reduce.c (nbits): Add some casts.
11564
11565 1996-08-12 Richard Stallman <rms@gnu.org>
11566
11567 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
11568
11569 1996-08-12 Richard Stallman <rms@gnu.org>
11570
11571 * bison.simple: Test _MSDOS as well as _MSDOS_.
11572
11573 1996-07-31 Richard Stallman <rms@gnu.org>
11574
11575 * src/bison.s1:
11576 [__sun && __i386]: Include alloca.h.
11577
11578 1996-07-31 Richard Stallman <rms@gnu.org>
11579
11580 * bison.simple:
11581 [__sun && __i386]: Include alloca.h.
11582
11583 1996-07-30 Richard Stallman <rms@gnu.org>
11584
11585 * src/bison.s1: Comment change.
11586
11587 * src/bison.s1: Test _MSDOS_, not MSDOS.
11588
11589 1996-07-30 Richard Stallman <rms@gnu.org>
11590
11591 * bison.simple: Comment change.
11592
11593 * bison.simple: Test _MSDOS_, not MSDOS.
11594
11595 1996-06-01 Richard Stallman <rms@gnu.org>
11596
11597 * 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:
11598 Insert `_' macro around many string constants.
11599
11600 * src/main.c:
11601 Insert `_' macro around many string constants.
11602
11603 (main): Call setlocale, bindtextdomain and textdomain.
11604
11605 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
11606 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
11607 [ENABLE_NLS]: Include libintl.h.
11608 [ENABLE_NLS] (gettext): Define.
11609 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
11610 (N_, PACKAGE, LOCALEDIR): New macros.
11611
11612 1996-06-01 Richard Stallman <rms@gnu.org>
11613
11614 * POTFILES.in: New file.
11615
11616 * Makefile.in (allocate.o):
11617 Define target explicitly.
11618
11619 * Makefile.in (CFLAGS): Set to @CFLAGS@.
11620 (LDFLAGS): Set to @LDFLAGS@.
11621 (configure): Run autoconf only if preceding `cd' succeeds.
11622 (bison.s1): Redirect output to temporary file then move the
11623 temporary to the target, rather than redirecting directly to bison.s1.
11624 (clean): Remove config.status and config.log.
11625 (distclean): Don't remove config.status here.
11626
11627 1996-05-12 Richard Stallman <rms@gnu.org>
11628
11629 * src/bison.s1:
11630 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11631
11632 1996-05-12 Richard Stallman <rms@gnu.org>
11633
11634 * bison.simple:
11635 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11636
11637 1996-05-11 Richard Stallman <rms@gnu.org>
11638
11639 * src/bison.s1 (__yy_memcpy):
11640 Really reorder the args, as was supposedly done on Feb 14 1995.
11641 (yyparse): Calls changed accordingly.
11642
11643 1996-05-11 Richard Stallman <rms@gnu.org>
11644
11645 * Makefile.in (dist): Don't use $(srcdir).
11646
11647 * bison.simple (__yy_memcpy):
11648 Really reorder the args, as was supposedly done on Feb 14 1995.
11649 (yyparse): Calls changed accordingly.
11650
11651 1996-01-27 Richard Stallman <rms@gnu.org>
11652
11653 * src/output.c (output_rule_data):
11654 Test YYERROR_VERBOSE in the conditional
11655 around the definition of ttyname.
11656
11657 1995-12-29 Richard Stallman <rms@gnu.org>
11658
11659 * src/bison.s1:
11660 Fix line numbers in #line commands.
11661
11662 1995-12-29 Richard Stallman <rms@gnu.org>
11663
11664 * bison.simple:
11665 Fix line numbers in #line commands.
11666
11667 1995-12-27 Richard Stallman <rms@gnu.org>
11668
11669 * src/bison.s1 (YYPARSE_PARAM_DECL):
11670 In C++, make it always null.
11671 (YYPARSE_PARAM_ARG): New macro.
11672 (yyparse): Use YYPARSE_PARAM_ARG.
11673
11674 1995-12-27 Richard Stallman <rms@gnu.org>
11675
11676 * bison.simple (YYPARSE_PARAM_DECL):
11677 In C++, make it always null.
11678 (YYPARSE_PARAM_ARG): New macro.
11679 (yyparse): Use YYPARSE_PARAM_ARG.
11680
11681 1995-11-29 Richard Stallman <rms@gnu.org>
11682
11683 * doc/bison.texinfo:
11684 Describe literal string tokens, %raw, %no_lines, %token_table.
11685
11686 1995-11-29 Daniel Hagerty <hag@gnu.org>
11687
11688 * doc/bison.texinfo: Fixed update date
11689
11690 1995-10-16 Richard Stallman <rms@gnu.org>
11691
11692 * src/version.c: Version 1.25.
11693
11694 1995-10-16 Richard Stallman <rms@gnu.org>
11695
11696 * NEWS: *** empty log message ***
11697
11698 1995-10-16 Richard Stallman <rms@gnu.org>
11699
11700 * doc/bison.1, doc/bison.rnh:
11701 Add new options.
11702
11703 1995-10-15 Richard Stallman <rms@gnu.org>
11704
11705 * src/vmsgetargs.c, src/getargs.c:
11706 Added -n, -k, and -raw switches.
11707 (noparserflag, toknumflag, rawtoknumflag): New variables.
11708
11709 * src/symtab.h (SALIAS):
11710 New #define for adding aliases to %token.
11711 (struct bucket): Added `alias' field.
11712
11713 * src/reduce.c (reduce_grammar):
11714 Revise error message.
11715 (print_notices): Remove final `.' from error message.
11716
11717 * src/reader.c (reader_output_yylsp):
11718 New function.
11719 (readgram): Use `#if 0' around code that accepted %command
11720 inside grammar rules: The documentation doesn't allow it,
11721 and it will fail since the %command processors scan for the next %.
11722 (parse_token_decl): Extended the %token
11723 declaration to allow a multi-character symbol as an alias.
11724 (parse_thong_decl): New function.
11725 (read_declarations): Added %thong declarations.
11726 (read_declarations): Handle NOOP to deal with allowing
11727 % declarations as another means to specify the flags.
11728 (readgram): Allow %prec prior to semantics embedded in a rule.
11729 (skip_to_char, read_declarations, copy_definition)
11730 (parse_token_decl, parse_start_decl, parse_type_decl)
11731 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
11732 (get_type_name, copy_guard, copy_action, readgram)
11733 (get_type, packsymbols): Revised most error messages.
11734 Changed `fatal' to `warnxxx' to avoid aborting for error.
11735 Revised and use multiple warnxxx functions to avoid using VARARGS1.
11736 (read_declarations): Improve the error message for
11737 an invalid character. Do not abort.
11738 (read_declarations, copy_guard, copy_action): Use
11739 printable_version to avoid unprintable characters in printed output.
11740 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
11741 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
11742 Allow the type of a non-terminal can be given
11743 more than once, as long as all specifications give the same type.
11744
11745 * src/output.c:
11746 (output_headers, output_trailers, output, output_gram)
11747 (output_rule_data): Implement noparserflag variable.
11748 Implement toknumflag variable.
11749 (output): Call reader_output_yylsp to output LTYPESTR.
11750
11751 * src/main.c (main):
11752 If reader sees an error, don't process the grammar.
11753 (fatals): Updated to not use VARARGS1.
11754 (printable_version, int_to_string, warn, warni, warns, warnss)
11755 (warnsss): New error reporting functions. Avoid abort for error.
11756
11757 * src/lex.h:
11758 Added THONG and NOOP for alias processing.
11759 Added SETOPT for the new code that allows setting options with %flags.
11760
11761 * src/lex.c:
11762 Include getopt.h. Add some extern decls.
11763 (safegetc): New function to deal with EOF gracefully.
11764 (literalchar); new function to deal with reading \ escapes.
11765 (lex): Use literalchar.
11766 (lex): Implemented "..." tokens.
11767 (literalchar, lex, parse_percent_token): Made tokenbuffer
11768 always contain the token. This includes growing the token
11769 buffer while reading an integer.
11770 (parse_percent_token): Replaced if-else statement with percent_table.
11771 (parse_percent_token): Added % declarations as another
11772 way to specify the flags -n, -l, and -r. Also added hooks for
11773 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
11774 major changes to files.c.
11775 (lex) Retain in the incoming stream a character following
11776 an incorrect '/'.
11777 (skip_white_space, lex): Revised most error messages
11778 and changed fatal to warn to avoid aborting.
11779 (percent_table): Added %thong declarations.
11780
11781 * src/gram.h: Comment changes.
11782
11783 * src/files.c (openfiles, open_extra_files, done):
11784 Add faction flag
11785 and actfile file. Handle noparserflag. Both for -n switch.
11786
11787 * src/conflicts.c (resolve_sr_conflict):
11788 Remove use of alloca.
11789
11790 1995-06-01 Jim Meyering <meyering@gnu.org>
11791
11792 * doc/bison.texinfo: *** empty log message ***
11793
11794 1995-05-06 Richard Stallman <rms@gnu.org>
11795
11796 * src/bison.s1: Comment change.
11797
11798 1995-05-06 Richard Stallman <rms@gnu.org>
11799
11800 * bison.simple: Comment change.
11801
11802 1995-05-03 Richard Stallman <rms@gnu.org>
11803
11804 * src/version.c: Version now 1.24.
11805
11806 * src/bison.s1: Change distribution terms.
11807
11808 * src/version.c: Version now 1.23.
11809
11810 1995-05-03 Richard Stallman <rms@gnu.org>
11811
11812 * doc/bison.texinfo:
11813 Rewrite "Conditions for Using Bison".
11814 Update version to 1.24.
11815
11816 1995-05-03 Richard Stallman <rms@gnu.org>
11817
11818 * bison.simple: Change distribution terms.
11819
11820 1995-02-23 Richard Stallman <rms@gnu.org>
11821
11822 * src/files.c: Test __VMS_POSIX as well as VMS.
11823
11824 1995-02-14 Jim Meyering <meyering@gnu.org>
11825
11826 * src/bison.s1 (__yy_memcpy):
11827 Renamed from __yy_bcopy to avoid
11828 confusion. Reverse FROM and TO arguments to be consistent with
11829 those of memcpy.
11830
11831 1995-02-14 Jim Meyering <meyering@gnu.org>
11832
11833 * bison.simple (__yy_memcpy):
11834 Renamed from __yy_bcopy to avoid
11835 confusion. Reverse FROM and TO arguments to be consistent with
11836 those of memcpy.
11837
11838 1994-11-10 David J. MacKenzie <djm@gnu.org>
11839
11840 * NEWS: reformat
11841
11842 * NEWS: New file.
11843
11844 * Makefile.in (DISTFILES): Include NEWS.
11845
11846 * Makefile.in (DISTFILES):
11847 Include install-sh, not install.sh.
11848
11849 * configure.in: Update to Autoconf v2 macro names.
11850
11851 1994-10-05 David J. MacKenzie <djm@gnu.org>
11852
11853 * Makefile.in: fix typo
11854
11855 * Makefile.in (prefix, exec_prefix):
11856 Let configure set them.
11857
11858 1994-09-28 David J. MacKenzie <djm@gnu.org>
11859
11860 * Makefile.in: Set datadir to $(prefix)/share.
11861
11862 1994-09-15 Richard Stallman <rms@gnu.org>
11863
11864 * src/bison.s1:
11865 Update copyright notice and GPL version.
11866
11867 1994-09-15 Richard Stallman <rms@gnu.org>
11868
11869 * bison.simple:
11870 Update copyright notice and GPL version.
11871
11872 1994-07-12 Richard Stallman <rms@gnu.org>
11873
11874 * src/reduce.c, src/reader.c:
11875 entered into RCS
11876
11877 1994-05-05 David J. MacKenzie <djm@gnu.org>
11878
11879 * Makefile.in: entered into RCS
11880
11881 1994-03-26 Richard Stallman <rms@gnu.org>
11882
11883 * src/bison.s1: entered into RCS
11884
11885 1994-03-26 Richard Stallman <rms@gnu.org>
11886
11887 * bison.simple: entered into RCS
11888
11889 1994-03-25 Richard Stallman <rms@gnu.org>
11890
11891 * src/main.c: entered into RCS
11892
11893 1994-03-24 Richard Stallman <rms@gnu.org>
11894
11895 * src/conflicts.c: entered into RCS
11896
11897 1994-01-02 Richard Stallman <rms@gnu.org>
11898
11899 * Makefile.in: *** empty log message ***
11900
11901 1993-11-21 Richard Stallman <rms@gnu.org>
11902
11903 * src/bison.s1: *** empty log message ***
11904
11905 1993-11-21 Richard Stallman <rms@gnu.org>
11906
11907 * doc/bison.texinfo: entered into RCS
11908
11909 * doc/bison.texinfo: *** empty log message ***
11910
11911 1993-11-21 Richard Stallman <rms@gnu.org>
11912
11913 * bison.simple: *** empty log message ***
11914
11915 1993-10-25 David J. MacKenzie <djm@gnu.org>
11916
11917 * doc/bison.texinfo: *** empty log message ***
11918
11919 1993-10-19 Richard Stallman <rms@gnu.org>
11920
11921 * src/bison.s1: *** empty log message ***
11922
11923 1993-10-19 Richard Stallman <rms@gnu.org>
11924
11925 * bison.simple: *** empty log message ***
11926
11927 1993-10-14 Richard Stallman <rms@gnu.org>
11928
11929 * src/bison.s1: *** empty log message ***
11930
11931 1993-10-14 Richard Stallman <rms@gnu.org>
11932
11933 * bison.simple: *** empty log message ***
11934
11935 1993-09-14 David J. MacKenzie <djm@gnu.org>
11936
11937 * doc/bison.texinfo: *** empty log message ***
11938
11939 1993-09-13 Noah Friedman <friedman@gnu.org>
11940
11941 * Makefile.in: *** empty log message ***
11942
11943 1993-09-10 Richard Stallman <rms@gnu.org>
11944
11945 * src/conflicts.c: *** empty log message ***
11946
11947 * src/system.h: entered into RCS
11948
11949 1993-09-10 Richard Stallman <rms@gnu.org>
11950
11951 * doc/bison.1: entered into RCS
11952
11953 1993-09-06 Noah Friedman <friedman@gnu.org>
11954
11955 * src/version.c: entered into RCS
11956
11957 1993-09-06 Noah Friedman <friedman@gnu.org>
11958
11959 * Makefile.in: *** empty log message ***
11960
11961 1993-07-30 David J. MacKenzie <djm@gnu.org>
11962
11963 * Makefile.in: *** empty log message ***
11964
11965 1993-07-24 Richard Stallman <rms@gnu.org>
11966
11967 * src/bison.s1: *** empty log message ***
11968
11969 1993-07-24 Richard Stallman <rms@gnu.org>
11970
11971 * bison.simple: *** empty log message ***
11972
11973 1993-07-08 David J. MacKenzie <djm@gnu.org>
11974
11975 * Makefile.in: *** empty log message ***
11976
11977 1993-07-04 Richard Stallman <rms@gnu.org>
11978
11979 * src/bison.s1: *** empty log message ***
11980
11981 1993-07-04 Richard Stallman <rms@gnu.org>
11982
11983 * bison.simple: *** empty log message ***
11984
11985 1993-06-26 David J. MacKenzie <djm@gnu.org>
11986
11987 * src/getargs.c: entered into RCS
11988
11989 1993-06-26 David J. MacKenzie <djm@gnu.org>
11990
11991 * doc/bison.texinfo: *** empty log message ***
11992
11993 * doc/bison.1: New file.
11994
11995 1993-06-25 Richard Stallman <rms@gnu.org>
11996
11997 * src/getargs.c: New file.
11998
11999 1993-06-16 Richard Stallman <rms@gnu.org>
12000
12001 * src/bison.s1: *** empty log message ***
12002
12003 1993-06-16 Richard Stallman <rms@gnu.org>
12004
12005 * bison.simple: *** empty log message ***
12006
12007 1993-06-03 Richard Stallman <rms@gnu.org>
12008
12009 * src/bison.s1: New file.
12010
12011 1993-06-03 Richard Stallman <rms@gnu.org>
12012
12013 * doc/bison.texinfo: *** empty log message ***
12014
12015 1993-06-03 Richard Stallman <rms@gnu.org>
12016
12017 * bison.simple: New file.
12018
12019 1993-05-19 Richard Stallman <rms@gnu.org>
12020
12021 * doc/bison.texinfo: New file.
12022
12023 1993-05-07 Noah Friedman <friedman@gnu.org>
12024
12025 * Makefile.in: *** empty log message ***
12026
12027 1993-04-28 Noah Friedman <friedman@gnu.org>
12028
12029 * src/reader.c: *** empty log message ***
12030
12031 1993-04-23 Noah Friedman <friedman@gnu.org>
12032
12033 * src/alloc.h: entered into RCS
12034
12035 1993-04-20 David J. MacKenzie <djm@gnu.org>
12036
12037 * src/version.c: *** empty log message ***
12038
12039 * src/files.c, src/allocate.c:
12040 entered into RCS
12041
12042 * src/reader.c: *** empty log message ***
12043
12044 * src/lex.c: entered into RCS
12045
12046 * src/conflicts.c: New file.
12047
12048 * src/symtab.c: entered into RCS
12049
12050 * src/alloc.h: New file.
12051
12052 * src/LR0.c: entered into RCS
12053
12054 1993-04-18 Noah Friedman <friedman@gnu.org>
12055
12056 * src/reader.c: New file.
12057
12058 * src/version.c: *** empty log message ***
12059
12060 1993-04-18 Noah Friedman <friedman@gnu.org>
12061
12062 * Makefile.in: *** empty log message ***
12063
12064 1993-04-17 Noah Friedman <friedman@gnu.org>
12065
12066 * Makefile.in: *** empty log message ***
12067
12068 1993-04-15 Richard Stallman <rms@gnu.org>
12069
12070 * src/main.c, src/files.c:
12071 New file.
12072
12073 1993-04-15 Noah Friedman <friedman@gnu.org>
12074
12075 * configure.in: entered into RCS
12076
12077 * configure.in: *** empty log message ***
12078
12079 * configure.in: New file.
12080
12081 1993-04-14 Richard Stallman <rms@gnu.org>
12082
12083 * Makefile.in: New file.
12084
12085 1993-04-13 Richard Stallman <rms@gnu.org>
12086
12087 * src/version.c: New file.
12088
12089 1993-03-25 Richard Stallman <rms@gnu.org>
12090
12091 * src/output.c: entered into RCS
12092
12093 1992-09-25 Richard Stallman <rms@gnu.org>
12094
12095 * configure.bat: entered into RCS
12096
12097 1992-06-22 Richard Stallman <rms@gnu.org>
12098
12099 * src/vmsgetargs.c: entered into RCS
12100
12101 1992-06-22 Richard Stallman <rms@gnu.org>
12102
12103 * doc/bison.rnh: entered into RCS
12104
12105 1992-04-20 David J. MacKenzie <djm@gnu.org>
12106
12107 * README: entered into RCS
12108
12109 1992-01-22 Richard Stallman <rms@gnu.org>
12110
12111 * src/machine.h: entered into RCS
12112
12113 1991-12-21 Richard Stallman <rms@gnu.org>
12114
12115 * src/lalr.c, src/closure.c:
12116 entered into RCS
12117
12118 1991-12-20 Richard Stallman <rms@gnu.org>
12119
12120 * src/state.h: entered into RCS
12121
12122 1991-12-18 Richard Stallman <rms@gnu.org>
12123
12124 * src/print.c, src/nullable.c, src/derives.c:
12125 entered into RCS
12126
12127 1991-11-03 David J. MacKenzie <djm@gnu.org>
12128
12129 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
12130 entered into RCS
12131
12132 1988-09-09 Richard Stallman <rms@gnu.org>
12133
12134 * src/bison.hairy: entered into RCS
12135
12136 1987-12-16 Richard Stallman <rms@gnu.org>
12137
12138 * REFERENCES: entered into RCS
12139
12140 -----
12141
12142 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
12143 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
12144
12145 This file is part of Bison, the GNU Compiler Compiler.
12146
12147 Bison is free software; you can redistribute it and/or modify
12148 it under the terms of the GNU General Public License as published by
12149 the Free Software Foundation; either version 2, or (at your option)
12150 any later version.
12151
12152 Bison is distributed in the hope that it will be useful,
12153 but WITHOUT ANY WARRANTY; without even the implied warranty of
12154 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12155 GNU General Public License for more details.
12156
12157 You should have received a copy of the GNU General Public License
12158 along with Bison; see the file COPYING. If not, write to
12159 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
12160 Boston, MA 02111-1307, USA.