]> git.saurik.com Git - bison.git/blob - ChangeLog
* doc/bison.texinfo: Correct typos in previous fix.
[bison.git] / ChangeLog
1 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
2
3 * doc/bison.texinfo: Don't use "filename", as per GNU coding
4 standards. Use "file name" or "file" or "name", depending on
5 the context.
6 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
7 not to hack/foo.tab.c.
8 (Calc++ Top Level): 2nd arg of main is not const.
9 * data/glr.c: b4_filename -> b4_file_name.
10 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11 All uses changed.
12 (class position): filename -> file_name. All uses changed.
13 * data/yacc.c: b4_filename -> b4_file_name.
14 * lib/bitset.h: filename -> file_name in local vars.
15 * lib/bitset_stats.c: Likewise.
16 * src/files.c: Likewise.
17 * src/scan-skel.l ("@output ".*\n): Likewise.
18 * src/files.c (file_name_split): Renamed from filename_split.
19 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
20
21 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
22
23 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
24 to accommodate latest gnulib.
25
26 * tests/glr-regression.at (Duplicate representation of merged trees):
27 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
28
29 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
30 needed.
31
32 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
33
34 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
35 All uses changed. Invoke user destructor after an error during a
36 split parse (trivial change from Joel E. Denny).
37
38 * tests/glr-regression.at
39 (User destructor after an error during a split parse): New test case.
40 Problem reported by Joel E. Denny in:
41 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
42
43 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
44
45 * README-cvs: Give URLs for recommended tools.
46 Mention Gzip version problem, and bootstrapping issues.
47 Remove troubleshooting section, as it's somewhat obsolete.
48
49 * bootstrap (no_cache): New var, to accommodate different wget
50 variants. Use it instead of '-C off'. Problem reported by
51 twlevo@xs4all.nl.
52
53 * data/glr.c (yydestroyStackItem): New function.
54 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
55 debugging information. Problem reported by Joel E. Denny.
56
57 2005-08-25 Akim Demaille <akim@epita.fr>
58
59 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
60
61 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
62
63 * data/glr.c (yyrecoverSyntaxError, yyreturn):
64 Don't invoke destructor on unresolved entries.
65 * tests/glr-regression.at
66 (User destructor for unresolved GLR semantic value): New test case.
67 Problem reported by Joel E. Denny in:
68 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
69
70 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
71
72 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
73 Add strnlen.c.
74 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
75 lib-prefix.m4, po.m4.
76
77 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
78 in yydestruct diagnostic, since it might not be an error.
79 Problem reported by Joel Denny near end of
80 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
81 * data/lalr1.cc (yyerturn): Likewise.
82 * data/yacc.c (yyreturn): Likewise.
83 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
84
85 * src/files.c: Remove obsolete FIXME comment.
86
87 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
88 with the other templates, and to fix bogus run-on messages such
89 as the one reported at the end of
90 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
91 All callers changed to avoid the newline.
92 (yyprocessOneStack): Output two lines rather than one, to accommodate
93 the above change. This changes the debug output format slightly.
94
95 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
96 reported by Joel E. Denny in
97 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
98 (trivial change).
99 * tests/glr-regression.at (Duplicate representation of merged trees):
100 New test, from Joel E. Denny in:
101 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
102 * THANKS: Add Joel E. Denny.
103
104 * configure.ac (AC_INIT): Bump to 2.0c.
105
106 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
107
108 * NEWS: Version 2.0b.
109
110 * Makefile.am (SUBDIRS): Put examples before tests, so that
111 "make check" doesn't finish with "All 1 tests passed".
112
113 * tests/regression.at (Token definitions): Don't rely on
114 AT_PARSER_CHECK for data that contains backslashes. It currently
115 uses 'echo', and 'echo' isn't portable if its argument contains
116 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
117 that the byte '\0xff' is not printable in the C locale; it is,
118 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
119 not printable, so use '\0x81' to test.
120
121 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
122 version of GCC, since the macro is used with non-GCC compilers.
123
124 Fix core dump reported by Pablo De Napoli in
125 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
126 * tests/regression.at (Invalid inputs with {}): New test.
127 * src/parse-gram.y (token_name): Translate type before using
128 it as an index.
129
130 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
131 the user's name space. All uses changed to __attribute__
132 ((__unused__)).
133 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
134 Add __attribute__ ((__noreturn__)).
135
136 * etc/clcommit: Remove. We weren't using it, and it failed
137 "make maintainer-distcheck".
138 * Makefile.maint: Merge from coreutils.
139 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
140 (syntax-check-rules): Change list of rules as described below.
141 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
142 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
143 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
144 (sc_trailing_space): New rules.
145 (sc_xalloc_h_in_src): Remove.
146 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
147 (sc_space_tab, sc_error_exit_success, sc_changelog):
148 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
149 (makefile-check, po-check, author_mark_check):
150 (makefile_path_separator_check, copyright-check):
151 Use grep -n, to make it easier to find violations.
152 Use CVS_LIST and CVS_LIST_EXCEPT.
153 (header_regexp, h_re): Remove.
154 (dd_c): New macro.
155 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
156 (my-distcheck): Use more-modern GCC flags.
157 (signatures, %.asc): Remove.
158 (rel-files, announcement): Remove signatures.
159 Restore old updating code, even though we don't use it, so
160 that we're the same as coreutils.
161 (alpha, beta, major): Depend on news-date-check.
162 Make the upload commands.
163
164 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
165 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
166 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
167 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
168 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
169 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
170 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
171 * tests/sets.at: Likewise.
172
173 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
174 we comment out the Autoconf version number.
175 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
176 it's error-prone and "make maintainer-distcheck" rejects it.
177
178 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
179 Indent calls to "error" to pacify "make maintainer-distcheck",
180 when the calls are not intended to be translated.
181 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
182
183 * src/Makefile.am (DEFS): Use +=, to pacify
184 "make maintainer-distcheck".
185 (bison_SOURCES): Add scan-skel.h.
186 (sc_tight_scope): New rule, from coreutils.
187
188 * src/files.c (src_extension, header_extension):
189 Now static, not extern.
190 * src/getargs.c (short_options): Likewise.
191 * src/muscle_tab.c (muscle_table): Likewise.
192 * src/parse-gram.y (current_class, current_type, current_prec):
193 Likewise.
194 * src/reader.c (grammar_end, previous_rule_end): Likewise.
195 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
196 * src/main.c (main): Cast bindtextdomain and textdomain calls to
197 void, to avoid warning when NLS is disabled.
198 * src/output.c: Include scan-skel.h.
199 (scan_skel): Remove decl, since scan-skel.h does this.
200 (output_skeleton):
201 Indent calls to "error" to pacify "make maintainer-distcheck".
202 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
203 * src/reader.h (gram_end, gram_lineno): New decls to pacify
204 "make maintainer-distcheck".
205 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
206 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
207 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
208 (skel_lex_destroy, scan_skel): Move these decls to...
209 * src/scan-skel.h: New file.
210 * src/uniqstr.c (uniqstr_assert):
211 Indent calls to "error" to pacify "make maintainer-distcheck".
212
213 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
214 not @VAR@.
215
216 * tests/torture.at: Revamp to avoid misuse of atoi that
217 "make maintainer-distcheck" complained about.
218
219 * examples/extexi (message): Don't print a message more than once,
220 and omit line-number decoration that makes Emacs compile think
221 that informative messages are worth worrying about.
222
223 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
224
225 * configure.ac: Update version number.
226
227 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
228 accidentally.
229 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
230 autogenerated by the maintainer.
231 * examples/calc++/.cvsignore: Add *.yy.
232
233 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
234 * lib/bitset_stats.c (bitset_stats_init): Likewise.
235 * lib/bitsetv.c (bitsetv_alloc): Likewise.
236
237 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
238
239 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
240 from maintainer-distcheck about casting the argument of 'free'.
241
242 * NEWS: Mention recent yytname changes.
243 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
244
245 * bootstrap: For translations that have not yet been upgraded to
246 the new runtime-po domain, prime the pump by extracting the
247 relevant strings from the obsolete translations. This code can be
248 removed once the bison-runtime domain has been translated by each
249 team.
250
251 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
252 now that token names are already quoted.
253
254 Fix problem reported by Anthony Heading.
255 * data/glr.c (YYTOKEN_TABLE): New macro.
256 (yytname): Define if YYTOKEN_TABLE.
257 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
258 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
259 (YYERROR_VERBOSE): Define the same way the other skeletons do.
260 * src/output.c (prepare_symbols): Output token_table_flag.
261
262 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
263
264 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
265 again if the first call fails.
266
267 * data/glr.c (yytnamerr): New function.
268 (yyreportSyntaxError): Use it to dequote most string literals.
269 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
270 with other skeletons. All uses changed.
271 (yytnameerr_): New function.
272 (yyreport_syntax_error): Use it to dequote most string literals.
273 * data/yacc.c (yytnamerr): New function.
274 (yyerrlab): Use it to decode most string literals.
275 * doc/bison.texinfo (Decl Summary, Calling Convention):
276 Clarify quoting convention of yytname.
277 * src/output.c (prepare_symbols): Quote all names. This undoes
278 the 2005-04-17 change, which is now accomplished (mostly) via
279 changes in the parsers as described above.
280 * tests/regression.at (Token definitions, Web2c Actions):
281 Undo most 2005-04-17 change here, too.
282
283 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
284
285 Fix more problems reported by twlevo@xs4all.nl.
286 * tests/cxx-type.at: Don't pipe output of ./types through sed to
287 remove trailing spaces. This loses the exit status of ./types,
288 and isn't needed since ./types shouldn't be emitting trailing
289 spaces.
290 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
291 as the stack isn't valid in that case.
292
293 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
294 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
295 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
296 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
297 is used.
298 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
299 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
300 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
301 Likewise.
302
303 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
304 overly-picky compilers that reject 'char *foo = "bar";'.
305
306 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
307 to FILE * parameter, not to stderr. This fixes a typo introduced
308 in the 2005-07-12 change.
309
310 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
311 warnings from GCC 4.
312
313 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
314 (yyglrShiftDefer, yysplitStack):
315 Remove unused parameters b4_pure_formals. All uses changed.
316 (yyglrShift): Remove unused parameters b4_user_formals.
317 All uses changed.
318 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
319
320 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
321
322 Destructor cleanups and regularization among the three skeletons.
323 * NEWS: Document the behavior changes.
324 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
325 stack before failing, as the cleanup code will do it for us now.
326 * data/lalr1.cc (yyerrlab): Likewise.
327 * data/glr.c (yyparse): Pop everything off the stack before
328 freeing it, so that destructors get called properly.
329 * data/lalr1.cc (yyreturn): Likewise.
330 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
331 This is more consistent.
332 * doc/bison.texinfo (Destructor Decl): Mention more reasons
333 why destructors might be called. 1.875 -> 2.1.
334 (Destructor Decl, Decl Summary, Table of Symbols):
335 Some English-language cleanups for %destructor.
336 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
337 Add output line for destructor of start symbol.
338 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
339 because of that same extra output line.
340
341 * NEWS: Document minor wording changes in diagnostics of
342 Bison-generated parsers.
343 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
344 Remove unused formals. All uses changed.
345 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
346 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
347 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
348 Rename yyoverflowab to yyexhaustedlab.
349 When memory exhaustion occurs during syntax-error reporting,
350 report it separately rather than in a single diagnostic; this
351 eases translation.
352 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
353 (Memory Exhausted): Renamed from Parser Stack Overflow.
354 Revamp wording slightly to prefer "memory exhaustion".
355 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
356
357 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
358
359 Add i18n support to the GLR skeleton. Partially fix the C++
360 skeleton; a C++ expert needs to finish this. Remove debugging
361 msgids; there's little point to having them translated, since they
362 can be understood only by someone who can read the
363 (English-language) source code.
364
365 Generate runtime-po/bison-runtime.pot automatically, so that we
366 don't have to worry about garbage getting in that file. We'll
367 make sure after the next official release that old msgids don't
368 get lost. See
369 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
370
371 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
372 Now auto-generated.
373 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
374 Fix typos in explanations of the runtime file.
375 * bootstrap: Change gettext keyword from YYI18N to YY_.
376 Use standard Makefile.in.in in runtime-po, since we'll arrange
377 for backward-compatible bison-runtime.po files in a different way.
378 * data/glr.c (YY_): New macro, from yacc.c.
379 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
380 Translate messages intended for users.
381 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
382 the wording in the other skeletons. We don't know that the memory
383 is virtual.
384 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
385 Use same method that yacc.c uses.
386 Don't translate debugging messages.
387 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
388 it doesn't work (yet), and requires C++ expertise to fix.
389 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
390 Move defn to a more logical place, to be consistent with other
391 skeletons.
392 Don't translate debugging messages.
393 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
394 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
395 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
396 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
397
398 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
399 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
400 void, not int.
401 * tests/glr-regression.at (Badly Collapsed GLR States):
402 Likewise.
403 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
404 yylex should return 0 at EOF rather than aborting.
405
406 Improve tests for stack overflow in GLR parser.
407 Problem reported by twlevo@xs4all.nl.
408 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
409 All uses removed.
410 (yyStackOverflow): Just longjmp, but with value 2 so that caller
411 can handle the problem.
412 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
413 (yyparse): New local variable yyresult to record the result.
414 Use result of setjmp to set it, rather than storing itinto
415 struct.
416 (yyDone): Remove label.
417 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
418 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
419 if YYABORT is used).
420 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
421 yyparse status; put status > 1 into diagnostic.
422 Check that status==2 works.
423 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
424 Use exit status 3 for failure to open (which shouldn't happen).
425
426 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
427
428 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
429 1 on syntax error; just let yyparse do its thing.
430 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
431 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
432 (Exploding the Stack Size with Alloca):
433 (Exploding the Stack Size with Malloc):
434 Expect exit status 2, not 1, since the parser is supposed to blow
435 its stack. Problem reported by twlevo@xs4all.nl.
436
437 * data/glr.c (yyparse): Don't assume that the initial calls
438 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
439 Print a stack-overflow message and fail instead.
440 Initialize the line-number information before creating the stack,
441 so that the stack-overflow message can report line zero safely.
442
443 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
444
445 Fix problems reported by twlevo@xs4all.nl.
446 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
447 (yyuserMerge): Provide a default case if b4_mergers is empty.
448 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
449 * tests/glr-regression.at
450 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
451 Add casts to pacify C++ compilers.
452 * tests/glr-regression.at (Improper merging of GLR delayed action
453 sets): Declare yylex before using it.
454 * tests/Makefile.am (maintainer-check-g++): Fix a stray
455 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
456 test for valgrind; valgrind is independent of g++.
457 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
458 for compatibility with POSIX 1003.1-2001 (if running coreutils).
459 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
460 Use a destructor, so that we can expand the stack. Change
461 YYSTYPE to char * so that we can free it. Cast result of malloc.
462
463 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
464
465 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
466 a valgrind failure. Problem reported by twlevo@xs4all.nl.
467
468 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
469
470 * PACKAGING: New file, suggested by Bruno Haible and taken from
471 similar wording in gettext's PACKAGING file.
472 * NEWS: Mention PACKAGING.
473 * Makefile.am (EXTRA_DIST): Add PACKAGING.
474
475 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
476
477 * NEWS: Document recent i18n improvements.
478 * bootstrap: Get runtime translations into runtime-po.
479 Create runtime-po files automatically, if possible.
480 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
481 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
482 does not infringe on the user's name space.
483 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
484 * doc/bison.texinfo (Internationalization): Revamp the English
485 and Texinfo syntax a bit, to try to make it clearer.
486 (Bison Options, Option Cross Key): Mention --print-localedir.
487 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
488 YYENABLE_NLS. Quote a bit more.
489 * runtime-po/.cvsignore: New file.
490 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
491 * runtime-po/Rules-quot: Remove; now created by bootstrap.
492 * runtime-po/quot.sed: Likewise.
493 * runtime-po/boldquot.sed: Likewise.
494 * runtime-po/en@quot.header: Likewise.
495 * runtime-po/en@boldquot.header: Likewise.
496 * runtime-po/insert-header.sin: Likewise.
497 * runtime-po/remove-potcdate.sin: Likewise.
498 * runtime-po/Makevars: Likewise.
499 * runtime-po/LINGUAS: Likewise.
500 * runtime-po/de.po: Likewise; we will rely on the translation project
501 to maintain this, so "bootstrap" should get it.
502 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
503 its value.
504 * src/main.c (main): Bind the bison-runtime domain, too.
505
506 2005-07-12 Bruno Haible <bruno@clisp.org>
507
508 * data/yacc.c: Include <libintl.h> when NLS is enabled.
509 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
510 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
511 * runtime-po: New directory.
512 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
513 $(DOMAIN).pot-update rule, so that old messages are never dropped.
514 * runtime-po/Rules-quot: New file, copied from po/.
515 * runtime-po/quot.sed: Likewise.
516 * runtime-po/boldquot.sed: Likewise.
517 * runtime-po/en@quot.header: Likewise.
518 * runtime-po/en@boldquot.header: Likewise.
519 * runtime-po/insert-header.sin: Likewise.
520 * runtime-po/remove-potcdate.sin: Likewise.
521 * runtime-po/Makevars: New file.
522 * runtime-po/POTFILES.in: New file.
523 * runtime-po/LINGUAS: New file.
524 * runtime-po/bison-runtime.pot: New file.
525 * runtime-po/de.po: New file.
526 * m4/bison.m4: New file.
527 * Makefile.am (SUBDIRS): Add runtime-po.
528 (aclocaldir, aclocal_DATA): New variables.
529 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
530 Define aclocaldir.
531 * src/getargs.c (usage): Document --print-localedir option.
532 (PRINT_LOCALEDIR_OPTION): New enum item.
533 (long_options): Add --print-localedir option.
534 (getargs): Handle --print-localedir option.
535 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
536 (Internationalization): New section.
537
538 2005-07-12 Akim Demaille <akim@epita.fr>
539
540 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
541 for consistency with the rest of the code.
542 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
543 Add separators.
544
545 2005-07-12 Akim Demaille <akim@epita.fr>
546
547 * src/parse-gram.y: Use %printer instead of YYPRINT.
548
549 2005-07-12 Akim Demaille <akim@epita.fr>
550
551 * src/symtab.h, src/symtab.c (symbol_print): New.
552 * src/symlist.h, src/symlist.c (symbol_list_print): New.
553 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
554
555 2005-07-12 Akim Demaille <akim@epita.fr>
556
557 * data/glr.c (b4_syncline): Fix (swap) the definitions of
558 b4_at_dollar and b4_dollar_dollar.
559
560 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
561
562 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
563 and Pennello's paper.
564
565 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
566
567 * data/yacc.c (yyparse): Undo previous patch. Instead,
568 set yylsp[0] and yyvsp[0] only if the initial action
569 sets yylloc and yylval, respectively.
570
571 * data/yacc.c (yyparse): In the initial action, set
572 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
573 This avoids the use of undefined variables if the initial
574 action does not set yylloc and/or yylval.
575
576 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
577
578 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
579 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
580 Remove from CVS. These files are automatically generated.
581 * examples/extexi: Clarify that this file is now part of Bison,
582 not GNU M4, and that it works with any POSIX-compatible Awk.
583 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
584 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
585 so that we also get calc++-parser.yy. Geneate it.
586 Use $(AWK), not gawk, since any conforming Awk will do.
587 Put comment before action, since older 'make' can't handle comment
588 in action.
589 $(BUILT_SOURCES): List all built sources, not just some of them.
590 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
591 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
592 $($(calc_sources_generated)): Remove unnecessary test for existence
593 of target. (This had a shell syntax error anyway; a stray "x".)
594 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
595 calc++-parser.yy.
596 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
597
598 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
599 implied by the other modules.
600
601 2005-07-06 Akim Demaille <akim@epita.fr>
602
603 Bind examples/calc++ to the package.
604 * examples/calc++/Makefile: Remove, replaced by...
605 * examples/calc++/Makefile.am: ... this new file.
606 * examples/calc++/test: Remove input.
607 * examples/calc++/compile: Remove.
608 * examples/Makefile.am: New.
609 * configure.ac, Makefile.am: Adjust.
610 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
611
612 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
613
614 * data/glr.c (yyFail): Drastically simplify; since the format argument
615 never had any % directives, we can simply pass it to yyerror.
616 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
617 be modified later, as that is the usual style in glr.c.
618 Problems reported by Paul Hilfinger.
619
620 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
621 and size overflow errors.
622 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
623 in case the user prolog sets feature-test macros like _GNU_SOURCE.
624 (YYSIZEMAX): New macro.
625 (yystpcpy): New function, taken from yacc.c.
626 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
627 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
628 so that we don't have to maintain their signatures.
629 (yyFail): Check for buffer overflow, by using vsnprintf rather
630 than vsprintf. Allocate a bigger buffer if possible.
631 Report an error if buffer allocation fails.
632 (yyStackOverflow): New function.
633 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
634 the initialization was successful. It might fail if storage was
635 exhausted.
636 (yyexpandGLRStack): Add more checks for storage allocation failure.
637 Use yyStackOverflow to report failures.
638 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
639 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
640 Don't assume stack number fits in int.
641 (yysplitStack): Check for storage allocation failure.
642 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
643 can print diagnostics on storage allocation failure. All callers
644 changed.
645 (yyresolveValue): Use yybool for boolean.
646 (yyreportSyntaxError): Check for size-calculation overflow.
647 This code is taken from yacc.c.
648 (yyparse): Check for storage allocation errors when allocating
649 the initial stack.
650
651 2005-07-05 Akim Demaille <akim@epita.fr>
652
653 Extract calc++ from the documentation.
654 * doc/bison.texinfo (Calc++): Add the extraction marks.
655 * examples/extexi: New, from the aborted GNU Programming 2E.
656 Separate the different paragraph of a file with empty lines.
657 * examples/Makefile: Use it to extract the whole calc++ example.
658
659 2005-06-24 Akim Demaille <akim@epita.fr>
660
661 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
662 class typedefs.
663
664 2005-06-22 Akim Demaille <akim@epita.fr>
665
666 * doc/bison.texinfo (C++ Language Interface): First stab.
667 (C++ Parsers): Remove.
668
669 2005-06-22 Akim Demaille <akim@epita.fr>
670
671 * data/lalr1.cc (yylex_): Honor %lex-param.
672
673 2005-06-22 Akim Demaille <akim@epita.fr>
674
675 Start a set of simple examples.
676 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
677 * examples/calc++/calc++-driver.hh,
678 * examples/calc++/calc++-parser.yy,
679 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
680 * examples/calc++/compile, examples/calc++/test: New.
681
682 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
683
684 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
685 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
686 which stems from the 2005-05-27 patch.
687
688 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
689
690 * data/glr.c: Modify treatment of unused parameters to permit use
691 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
692
693 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
694
695 Fix infringement on user name space reported by Janos Zoltan Szabo.
696 * data/yacc.c (yyparse): strlen -> yystrlen.
697
698 2005-05-30 Akim Demaille <akim@epita.fr>
699
700 * data/lalr1.cc (_): New.
701 Translate the various messages.
702
703 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
704
705 Fix infringement on user name space reported by Bruno Haible.
706 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
707 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
708 the user's name space.
709 (alloca): Include <stdlib.h> to get it, if it's not built in.
710 (YYMALLOC, YYFREE): Define only if needed.
711 (malloc, free): Declare, but only if needed, as this infringes on
712 the user name space.
713
714 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
715
716 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
717 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
718 with %d format.
719 * lib/ebitset.c (min, max): Undef before defining.
720 * lib/vbitset.c (min, max): Likewise.
721 * lib/subpipe.c (create_subpipe): Save local variables in case
722 vfork clobbers them.
723
724 2005-05-24 Bruno Haible <bruno@clisp.org>
725
726 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
727 error message syntax used by gcc-4.0.
728
729 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
730
731 * README: Mention m4 1.4.3. Remove obsolete advice about
732 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
733
734 * bootstrap: Remove workaround for problem I encountered with
735 gettext 0.14.1; it seems to be fixed now.
736
737 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
738
739 * NEWS: Version 2.0a.
740
741 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
742 the previous change.
743
744 Various maintainer cleanups.
745 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
746 conftest*, for benefit of CVS commands run at the same time as
747 "configure". Add build-aux, since "bootstrap" now creates it and
748 its subfiles.
749 * Makefile.cfg (move_if_change): Remove.
750 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
751 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
752 (po_repo, do-po-update, po-update, wget_files, get-targets):
753 (config.guess-url_prefix, config.sub-url_prefix):
754 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
755 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
756 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
757 Remove.
758 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
759 this is now the recommended name.
760 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
761 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
762 ylwrap. These files now go into build-aux.
763 * config/move-if-change: Remove.
764 * config/prev-version.txt: Bump from 1.75 to 2.0.
765
766 * bootstrap: Add stdio-safer, unistd-safer modules.
767 Remove m4/glibc2.m4 (introduced by latest gnulib, but
768 we don't need it).
769 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
770 fopen-safer.c, stdio-safer.h, unistd-safer.h.
771 * lib/subpipe.c: Include "unistd-safer.h".
772 (create_subpipe): Make sure all the newly-created
773 file descriptors are > 2, so that diagnostics don't
774 get sent down them (which might cause Bison to hang, in theory).
775 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
776 * src/files.c (xfopen): Use fopen_safer, not fopen.
777
778 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
779 yesterday's yacc.c fix.
780
781 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
782
783 * data/glr.c, data/lalr1.cc: Update copyright date.
784
785 Fix a destructor bug reported by Wolfgang Spraul in
786 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
787 * data/yacc.c (yyabortlab): Don't call destructor, and
788 don't set yychar to EMPTY.
789 (yyoverflowlab): Don't call destructor.
790 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
791 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
792 since we no longer output the message "discarding lookahead token
793 end of input ()".
794
795 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
796
797 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
798 fix a small glitch in debugging output.
799 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
800 after YY_SYMBOL_PRINT where needed.
801
802 (struct yyGLRState): Add some comments.
803 (struct yySemanticOption): Add some comments.
804 (union yyGLRStackItem): Add comment.
805
806 (yymergeOptionSets): Correct this to properly perform the union,
807 avoiding infinite reported by Michael Rosien.
808 Update comment.
809
810 * tests/glr-regression.at: Add test for GLR merging error reported
811 by M. Rosien.
812
813 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
814
815 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
816 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
817 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
818 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
819 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
820 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
821 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
822 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
823 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
824 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
825 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
826 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
827 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
828 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
829 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
830 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
831 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
832 src/derives.h, src/files.c, src/files.h, src/getargs.c,
833 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
834 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
835 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
836 src/output.h, src/parse-gram.c, src/parse-gram.h,
837 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
838 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
839 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
840 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
841 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
842 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
843 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
844 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
845 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
846 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
847 tests/reduce.at, tests/regression.at, tests/sets.at,
848 tests/synclines.at, tests/testsuite.at, tests/torture.at:
849 Update FSF postal mail address.
850
851 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
852
853 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
854 Problem reported by Ralf Menzel.
855
856 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
857
858 * tests/actions.at: Test that stack overflow invokes destructors.
859 From Marcus Holland-Moritz.
860 * data/yacc.c (yyerrlab): Move the code that destroys the stack
861 from here....
862 (yyreturn): to here. That way, destructors are called properly
863 even if the stack overflows, or the user calls YYACCEPT or
864 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
865 (yyoverflowlab): Destroy the lookahead.
866
867 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
868
869 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
870
871 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
872
873 * NEWS: Bison-generated C parsers no longer quote literal strings
874 associated with tokens.
875 * src/output.c (prepare_symbols): Don't escape strings,
876 since users don't want to see C escapes.
877 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
878 in diagnostics.
879 * tests/input.at (Torturing the Scanner): Likewise.
880 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
881
882 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
883
884 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
885 the data size is known to be too small and we can't increase it.
886 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
887
888 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
889
890 * src/parse-gram.y: Include quotearg.h.
891 (string_as_id): Quote $1 before using it as a key, since the
892 lexer no longer quotes it for us.
893 (string_content): Don't strip quotes, since lexer no longer
894 quotes it for us.
895 * src/scan-gram.l: Include quotearg.h.
896 ("\""): Omit quote.
897 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
898 a key, since the rest of the lexer doesn't quote it.
899 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
900 * tests/regression.at (Token definitions): Check for backslashes
901 in token strings.
902
903 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
904 (YYSIZE_T): Define to unsigned long int when using an older compiler.
905 (yyparse): Revamp code to generate long syntax error message, to
906 make it easier to translate, and to avoid problems with arithmetic
907 overflow. Change "virtual memory" to "memory" in diagnostic, since
908 we don't know whether the memory is virtual.
909
910 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
911
912 * NEWS: Bison-generated C parsers now use the _ macro to
913 translate strings.
914 * data/yacc.c (_) [!defined _]: New macro.
915 All English strings wrapped inside this macro.
916 * doc/bison.texinfo (Bison Parser): Document _.
917 * po/POTFILES.in: Include src/parse-gram.c, since it now
918 includes translateable strings that parse-gram.y doesn't.
919
920 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
921
922 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
923 reverting the 2004-10-11 change to this function.
924 (symbol_check_alias_consistency): Don't call symbol_type_set
925 if the type name is already correct.
926 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
927
928 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
929
930 * tests/regression.at (Token definitions): Don't use a token named
931 c, as that generates a "#define c ..." that runs afoul of buggy
932 stdlib.h that uses the identifier c as a member of struct
933 drand48_data. Problem reported by Horst Wente.
934
935 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
936
937 * bootstrap: Change translation URL from
938 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
939 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
940 redirection glitches. Problem reported by twlevo@xs4all.nl.
941
942 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
943
944 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
945 after operands; POSIX says this isn't portable for the c99 command.
946
947 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
948
949 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
950 immediately if a data overrun has occurred; this may help us track
951 down what may be a spurious failure on MacOS.
952
953 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
954
955 Respond to problems reported by twlevo@xs4all.nl.
956
957 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
958
959 * src/vcg.h: Comment fix.
960 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
961 (G_CMAX): Change to -1 instead of INT_MAX.
962
963 * data/yacc.c (yyparse): Omit spaces before #line.
964
965 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
966
967 * src/tables.c (state_number_to_vector_number): Put it inside an
968 "#if 0", since it's not currently used. Problem reported by
969 Roland McGrath.
970
971 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
972
973 * src/output.c (escaped_output): Renamed from
974 escaped_file_name_output, since we now use it for symbol tags as
975 well. All uses changed.
976 (symbol_destructors_output, symbol_printers_output):
977 Escape symbol tags too.
978 Problem reported by Matyas Forstner in
979 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
980
981 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
982 not needed.
983 * src/output.c (user_actions_output, token_definitions_output,
984 symbol_destructors_output, symbol_printers_output): Likewise.
985 * src/reader.c (prologue_augment): Likewise.
986 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
987
988 * src/vcg.c (output_edge): Don't quote linestyle arg.
989 Problem reported by twlevo@xs4all.nl.
990
991 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
992
993 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
994 example, reported by Derek M Jones. Also, make the example even
995 more outrageous, to better illustrate how bad the problem is.
996
997 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
998
999 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
1000 putsym. Typo reported by Sebastian Piping.
1001
1002 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
1003
1004 * doc/bison.texinfo (Language and Grammar): some -> same
1005 (Epilogue): int he -> in the
1006 Typos reported by Sebastian Piping via Justin Pence.
1007
1008 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
1009
1010 * tests/glr-regression.at (Improper handling of embedded actions
1011 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
1012 embedded actions and $-N in GLR parsers", work around an Autoconf bug
1013 with dollar signs in test names.
1014 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
1015 for a similar reason.
1016
1017 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
1018
1019 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
1020 wants to redefine G_VIEW.
1021
1022 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
1023
1024 * src/vcg.c (get_view_str): Remove case for normal_view.
1025 Problem reported by twlevo@xs4all.nl.
1026
1027 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
1028
1029 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
1030 Problem reported by twlevo@xs4all.nl.
1031
1032 * doc/bison.texinfo: Change @dircategory from "GNU programming
1033 tools" to "Software development". Requested by Richard Stallman
1034 via Karl Berry.
1035
1036 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
1037
1038 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
1039 Problem reported by twlevo@xs4all.nl.
1040
1041 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
1042
1043 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
1044 keyword; it's not needed with modern compilers, and it doesn't
1045 affect correctness with older compilers. Suggested by
1046 twlevo@xs4all.nl.
1047
1048 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
1049
1050 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
1051 gcc -Wswitch-default.
1052 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
1053 * data/yacc.c (yyparse): Likewise.
1054
1055 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
1056
1057 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
1058 already. Let config.h define any nonstandard values.
1059
1060 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
1061
1062 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
1063 for the benefit of slower hosts. Problem reported by
1064 Nelson H. F. Beebe.
1065
1066 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
1067
1068 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
1069 being defined and not used.
1070 * data/lalr1.cc (yyparse): Likewise.
1071 Use "if (false)" rather than "if (0)".
1072
1073 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
1074
1075 * TODO: Mention that we should allow NUL bytes in tokens.
1076
1077 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
1078
1079 * src/scan-skel.l (<<EOF>>): Don't close standard output.
1080 Problem reported by Hans Aberg.
1081
1082 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
1083
1084 * src/getargs.c (version): Happy new year; update overall
1085 program copyright date from 2004 to 2005.
1086
1087 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
1088 Problem reported by Hans Aberg.
1089 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
1090 (Output file names.): Add a test for the case when standard output
1091 is closed.
1092
1093 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
1094
1095 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
1096 to fix an oversight in the Bison 2.0 manual.
1097
1098 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
1099
1100 * NEWS: Version 2.0. Reformat the existing news items since
1101 1.875, so that related items are grouped together.
1102 * configure.ac (AC_INIT): Bump version to 2.0.
1103 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
1104
1105 * tests/torture.at (Exploding the Stack Size with Alloca): Set
1106 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
1107 otherwise, we're not testing alloca. Unfortunately there's no
1108 simple way to consult HAVE_ALLOCA here.
1109
1110 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
1111 for yymsg, too.
1112
1113 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
1114 hand. This avoids a warning about comparing int to size_t when
1115 GCC warnings are enabled.
1116
1117 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
1118
1119 * NEWS: Bison-generated parsers no longer default to using the
1120 alloca function (when available) to extend the parser stack, due
1121 to widespread problems in unchecked stack-overflow detection.
1122 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
1123 responsibility to set it to a positive value. This lets the user
1124 specify a value that is not a preprocessor constant.
1125 * data/yacc.c (YYMAXDEPTH): Likewise.
1126 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
1127 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
1128 to be a compile-time constant. However, explain the constraints on it.
1129 Also, explain the constraints on YYINITDEPTH.
1130 (Table of Symbols): Explain that alloca is no longer the default.
1131 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
1132 to 1.
1133
1134 * doc/bison.texinfo (Location Default Action): Mention that n must
1135 be zero when k is zero. Suggested by Frank Heckenbach.
1136
1137 2004-12-22 Akim Demaille <akim@epita.fr>
1138
1139 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
1140 (parser::state_type, parser::semantic_type, parser::location_type):
1141 Private, not public.
1142 (parser::parse): Return ints, not bool.
1143 Returning a bool introduces a problem: 0 corresponds to false, and
1144 it seems weird to return false on success. Returning true changes
1145 the conventions for yyparse.
1146 Alternatively we could return void and send an exception.
1147 There is no clear consensus (yet?).
1148 (state_stack, semantic_stack, location_stack): Rename as...
1149 (state_stack_type, semantic_stack_type, location_stack_type): these.
1150 Private, not public.
1151 * tests/c++.at: New.
1152 * tests/testsuite.at, tests/Makefile.am: Adjust.
1153
1154 2004-12-21 Akim Demaille <akim@epita.fr>
1155
1156 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
1157
1158 2004-12-21 Akim Demaille <akim@epita.fr>
1159
1160 Don't impose std::string for filenames.
1161
1162 * data/lalr1.cc (b4_filename_type): New.
1163 (position::filename): Use it.
1164 (parser.hh): Move the inclusion of stack.hh and location.hh below
1165 the user code, so that needed headers for the filename type can be
1166 included first.
1167 Forward declare them before the user code.
1168 * tests/Makefile.am (check-local, installcheck-local): Pass
1169 TESTSUITEFLAGS to the TESTSUITE.
1170
1171 2004-12-20 Akim Demaille <akim@epita.fr>
1172
1173 Use more STL like names: my_class instead of MyClass.
1174
1175 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
1176 (SemanticStack, SemanticType, StateStack, StateType)
1177 (TokenNumberType, Stack, Slice, Traits, Parser::location)
1178 (Parser::value): Rename as...
1179 (location_stack, location_type, rhs_number_type, semantic_stack)
1180 (semantic_type, state_stack, state_type, token_number_type, stack)
1181 (slice, traits, parser::yylloc, parser::yylval): these.
1182
1183 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
1184
1185 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1186
1187 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
1188 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
1189
1190 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
1191
1192 Remove uses of 'short int' and 'unsigned short int'. This raises
1193 some arbitrary limits. It uses more memory but nowadays that's
1194 not much of an issue.
1195
1196 This change does not affect the generated parsers; that's a different
1197 task, as some users will want to conserve memory there.
1198
1199 Ideally we should use size_t to represent all object counts, and
1200 something like ptrdiff_t to represent signed differences of object
1201 counts; but that will require more code-cleanup than I have the
1202 time to do right now.
1203
1204 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
1205 Use size_t, not int or short int, to count objects.
1206 * src/closure.c (nritemset, closure): Likewise.
1207 * src/closure.h (nritemset, closure): Likewise.
1208 * src/nullable.c (nullable_compute): Likewise.
1209 * src/print.c (print_core): Likewise.
1210 * src/print_graph.c (print_core): Likewise.
1211 * src/state.c (state_compare, state_hash): Likewise.
1212 * src/state.h (struct state): Likewise.
1213 * src/tables.c (default_goto, goto_actions): Likewise.
1214
1215 * src/gram.h (rule_number, rule): Use int, not short int.
1216 * src/output.c (prepare_rules): Likewise.
1217 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
1218 errs, reductions): Likewise.
1219 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
1220 Likewise.
1221 * src/tables.c (vector_number, tally, action_number,
1222 ACTION_NUMBER_MINIMUM): Likewise.
1223 * src/output.c (muscle_insert_short_int_table): Remove.
1224
1225 2004-12-17 Akim Demaille <akim@epita.fr>
1226
1227 * data/lalr1.cc: Extensive Doxygenation.
1228 (error_): Rename as...
1229 (error): this, since it is visible to the user.
1230 Adjust callers.
1231 (Parser::message): Now an automatic variable from...
1232 (Parser::yyreport_syntax_error_): here.
1233 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
1234 Parser::error.
1235 * tests/input.at: Escape $.
1236
1237 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
1238
1239 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
1240 Parenthesize rhs to avoid obscure problems with mistakes like
1241 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
1242 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
1243 b4_rhs_location): Likewise.
1244 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
1245 b4_rhs_location): Likewise.
1246
1247 2004-12-16 Akim Demaille <akim@epita.fr>
1248
1249 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
1250 yacc.c: be sure to stay within yycheck_.
1251 * tests/actions.at: Re-enable C++ tests.
1252
1253 2004-12-16 Akim Demaille <akim@epita.fr>
1254
1255 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
1256 real.
1257
1258 2004-12-16 Akim Demaille <akim@epita.fr>
1259
1260 Use #define to handle the %name-prefix.
1261
1262 * data/glr.c, data/yacc.c: Comment changes.
1263 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
1264 so that one can refer to yylex in the parser file, and have it
1265 renamed, as is the case with other skeletons.
1266
1267 2004-12-16 Akim Demaille <akim@epita.fr>
1268
1269 Move lalr1.cc internals into yy*.
1270
1271 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
1272 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
1273 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
1274 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
1275 (empty_, final_, terror_, errcode_, ntokens_)
1276 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
1277 (looka_, ilooka_, error_range_, nerrs_):
1278 Rename as...
1279 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
1280 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
1281 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
1282 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
1283 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
1284 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
1285 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
1286 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
1287 these.
1288
1289 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
1290
1291 Fix some problems reported by twlevo at xs4all.
1292 * src/symtab.c (symbol_new): Report an error if the input grammar
1293 contains too many symbols. This is better than calling abort() later.
1294 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
1295 (struct node, struct graph):
1296 Rename member expand to stretch. All uses changed.
1297 (struct graph): Remove member layoutalgorithm. All uses removed.
1298 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
1299 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
1300 All uses changed.
1301 (N_STRETCH): Rename from N_EXPAND. All uses changed.
1302
1303 2004-12-15 Akim Demaille <akim@epita.fr>
1304
1305 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
1306 Add more Doxygen comments.
1307 (symprint_, stack_print_, reduce_print_, destruct_, pop)
1308 (report_syntax_error_, translate_): Rename as...
1309 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
1310 (yypop_, yyreport_syntax_error_, yytranslate_): this.
1311
1312 2004-12-15 Akim Demaille <akim@epita.fr>
1313
1314 * data/lalr1.cc (lex_): Rename as...
1315 (yylex_): this.
1316 Move the trace here.
1317 Take the %name-prefix into account.
1318 Reported by Alexandre Duret-Lutz.
1319
1320 2004-12-15 Akim Demaille <akim@epita.fr>
1321
1322 Simplify the C++ parser constructor.
1323
1324 * data/lalr1.cc (debug_): Rename as...
1325 (yydebug_): so that the parser's internals are always in the yy*
1326 pseudo namespace.
1327 Adjust uses.
1328 (b4_parse_param_decl): Remove the leading comma as it is now only
1329 called as unique argument list.
1330 (Parser::Parser): Remove the constructor accepting a location and
1331 an initial debugging level.
1332 Remove from the other ctor the argument for the debugging level.
1333 (debug_level_type, debug_level, set_debug_level): New.
1334
1335 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
1336 constructor calls.
1337
1338 2004-12-15 Akim Demaille <akim@epita.fr>
1339
1340 Remove b4_root related material: failure experiment
1341 (which goal was to allow to derive from a class).
1342
1343 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
1344 definitions and uses.
1345
1346 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
1347
1348 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
1349 not 2, since it's not portable to subtract 1 from the start of an
1350 array. The new item 0 is never set or used. All uses changed.
1351
1352 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
1353 the default definition of YYLLOC_DEFAULT. Problem reported
1354 by Frank Heckenbach.
1355
1356 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
1357
1358 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
1359 the normal case and one for the error case. Just use the
1360 first one uniformly. Problem reported by Frank Heckenbach.
1361 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
1362 use exactly the same macro in both places.
1363 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
1364 so that the normal-case YYRHSLOC works for the error case too.
1365 All uses changed.
1366 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
1367 (YYLLOC_DEFAULT): Use the same macro as glr.c.
1368 * doc/bison.texinfo (Location Default Action): Don't claim that
1369 we have an array of locations. Use the same macro for both glr
1370 and lalr parsers. Mention YYRHSLOC. Mention what happens when
1371 the index is 0.
1372
1373 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
1374
1375 * HACKING: Update email addresses to send announcements to.
1376
1377 * configure.ac (AC_INIT): Bump version to 1.875f.
1378
1379 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
1380
1381 * NEWS: Version 1.875e.
1382 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
1383
1384 * src/scan-skel.l: Include "complain.h", for "fatal".
1385
1386 * src/relation.h (relation_print, relation_digraph):
1387 Relation sizes are of type relation_node, not size_t (this is
1388 merely a doc fix, since the two types are equivalent).
1389 (relation_transpose): Relation sizes are of type relation_node,
1390 not int.
1391 * src/relation.c: Likewise.
1392 (top, infinity): Now of type relation_node, not int.
1393 (traverse, relation_transpose): Use relation_node, not int.
1394
1395 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
1396 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
1397 (yyparse): Remove unused local introduced in 2004-10-25 patch.
1398
1399 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
1400 specifying whether the test should be skipped. Use it tp
1401 specify that the [%defines %skeleton "lalr1.cc"] tests currently
1402 fail on some hosts, and should be skipped.
1403
1404 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
1405
1406 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
1407 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
1408 unless otherwise specified below.
1409
1410 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
1411 to allocate kernel_base, kernel_items, kernel_size, since
1412 they needn't be initialized to 0.
1413 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
1414 * src/closure.c (new_closure): Likewise, for itemset.
1415 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
1416 * src/lalr.c (set_goto_map): Likewise, for temp_map.
1417 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
1418 (build_relations): Likewise for edge, states1, includes.
1419 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
1420 * src/reader.c (packgram): Likewise, for ritem, rules.
1421 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
1422 * src/relation.c (relation_digraph): Likewise for VERTICES.
1423 (relation_transpose): Likewise for new_R, end_R.
1424 * src/symtab.c (symbols_token_translations_init): Likewise for
1425 token_translations.
1426 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
1427 (token_actions): Likewise for yydefact, actrow, conflrow,
1428 conflict_list.
1429 (save_column): Likewise for froms[symno], tos[symno].
1430 (goto_actions): Likewise for state_count.
1431 (pack_table): Likewise for base, pos, check.
1432 (tables_generate): Likewise for width.
1433
1434 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
1435 for initial core. Just have a separate core, so we needn't worry
1436 about whether kernel_size and kernel_base are initialized.
1437
1438 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
1439 kernel_size, kernel_items): Remove unnecessary initialization.
1440 * src/conflicts.c (conflicts): Likewise.
1441 * src/derives.c (derives): Likewise.
1442 * src/muscle_tablc (muscle_insert): Likewise.
1443 * src/relation.c (relation_digraph): Likewise.
1444 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
1445 conflrow, conflict_table, conflict_list, table, check):
1446 Likewise.
1447
1448 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
1449 This is because all callers pass unsigned int.
1450 * src/closure.h (new_closure): Likewise.
1451
1452 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
1453 (build_relations): Initialize includes[i] in all cases.
1454 * src/reader.c (packgram): Always initialize rules[ruleno].prec
1455 and rules[ruleno].precsym. Initialize members in order.
1456 * src/relation.c (relation_transpose): Always initialize new_R[i]
1457 and end_R[i].
1458 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
1459
1460 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
1461 conflict_list[0] was always 0, but now it isn't initialized.
1462
1463 * src/table.c (table_grow): When conflict_table grew, the grown
1464 area wasn't cleared. Fix this.
1465
1466 * lib/.cvsignore: Add strdup.c, strdup.h.
1467 * m4/.cvsignore: Add strdup.m4.
1468
1469 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
1470
1471 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
1472 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
1473 GOTO_NUMBER_MAXIMUM, since we occasionally compute
1474 ngotos + 1 without checking for overflow.
1475 (build_relations): Use END_NODE, not -1, to denote end of edges.
1476 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
1477 build_relations): Use goto_number, not int, for goto numbers.
1478 * src/tables.c (save_column, default_goto): Likewise.
1479
1480 2004-11-23 Akim Demaille <akim@epita.fr>
1481
1482 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
1483 of #defining from yystype.
1484 Don't typedef yystype, C++ does not need it.
1485 This lets it possible to forward declare it as union.
1486
1487 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1488
1489 * bootstrap (gnulib_modules): Add extensions.
1490 Problem reported by Jim Meyering.
1491
1492 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
1493
1494 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
1495 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
1496 src/system.h, src/tables.c: XFREE -> free, to accommodate
1497 recent change to gnulib xalloc.h.
1498 Problem reported by Jim Meyering.
1499
1500 2004-11-17 Akim Demaille <akim@epita.fr>
1501
1502 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
1503
1504 2004-10-28 Akim Demaille <akim@epita.fr>,
1505 Alexandre Duret-Lutz <adl@gnu.org>
1506
1507 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
1508 changes.
1509 (YYCDEBUG): Adjust.
1510 Use it instead of cdebug_.
1511 (Parser::debug_stream, Parser::set_debug_stream): New.
1512 (Parser::symprint_): Define cdebug_ for temporary backward
1513 compatibility.
1514 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
1515 debug_stream ().
1516
1517 2004-11-17 Akim Demaille <akim@epita.fr>
1518
1519 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
1520 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
1521 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
1522 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
1523
1524 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
1525
1526 * data/glr.c (yyloc_default): Remove; not used.
1527 Problem reported by Frank Heckenbach.
1528
1529 2004-10-25 Akim Demaille <akim@epita.fr>
1530
1531 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
1532 Introduce another definition to address simple location arrays.
1533 (yyGLRStack): New member: yyerror_range.
1534 (yyrecoverSyntaxError, yyparse): Update it.
1535 (yyrecoverSyntaxError): Use it when shifting the error token to
1536 have an accurate range, equivalent to the one computed by both
1537 yacc.c and lalr1.cc.
1538 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
1539 that column numbers start at column 0, as per GNU Coding
1540 Standards, the others tests, and the doc.
1541 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
1542 Adjust to the above change (first column is 0).
1543 And adjust the location of the "<error>", now covering the whole
1544 line.
1545
1546 2004-10-22 Akim Demaille <akim@epita.fr>
1547 and Paul Eggert <eggert@cs.ucla.edu>
1548
1549 Remove some arbitrary limits on goto numbers and relations.
1550 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
1551 initial values, since they're never used.
1552 (set_goto_map): ngotos is now unsigned, so test for overflow
1553 by seeing whether it wraps around to zero.
1554 * src/lalr.h (goto_number): Now size_t, not short int.
1555 (GOTO_NUMBER_MAXIMUM): Remove.
1556 * src/relation.c (relation_print, traverse, relation_transpose):
1557 Check for END_NODE rather than looking at sign.
1558 * src/relation.h (END_NODE): New macro.
1559 (relation_node): Now size_t, not short int.
1560
1561 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
1562
1563 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
1564 keyword, not an identifier. Problem reported by Baron Schwartz in
1565 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
1566
1567 2004-10-11 Akim Demaille <akim@epita.fr>
1568
1569 * src/symtab.c (symbol_check_alias_consistency): Also check
1570 type names, destructors, and printers.
1571 Reported by Alexandre Duret-Lutz.
1572 Recode the handling of associativity and precedence in terms
1573 of symbol_precedence_set.
1574 Accept no redeclaration at all, not even equal to the previous
1575 value.
1576 (redeclaration): New.
1577 Use it to factor redeclaration complaints.
1578 (symbol_make_alias): Don't set the type of the alias, let
1579 symbol_check_alias_consistency do it as for other features.
1580 * src/symtab.h (symbol): Add new member prec_location, and
1581 type_location.
1582 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
1583 * tests/input.at (Incompatible Aliases): New.
1584
1585 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
1586
1587 .cvsignore fixes to accommodate gnulib changes,
1588 and the practice of naming build directories "_build".
1589 * .cvsignore: Add "_*". Sort.
1590 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
1591 * m4/.cvsignore: Add "*_gl.m4".
1592
1593 2004-10-06 Akim Demaille <akim@epita.fr>
1594
1595 * src/parse-gram.y (add_param): Fix the truncation of trailing
1596 spaces.
1597
1598 2004-10-05 Akim Demaille <akim@epita.fr>
1599
1600 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
1601 whether the reducion was empty or not. This leaves room to
1602 improve the use of YYLLOC_DEFAULT in such a case.
1603 lalr1.cc is still experimental, so changing this is acceptable.
1604 And finally, there are probably not many users who changed the
1605 handling of locations in GLR, so changing is admissible too.
1606
1607 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
1608 empty reduction, set @$ to an empty location ending the previously
1609 stacked symbol.
1610 Adjust uses to make sure the code is triggered on empty
1611 reductions.
1612 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
1613 expected output: empty reductions have empty locations.
1614
1615 2004-09-29 Akim Demaille <akim@epita.fr>
1616
1617 * data/lalr1.cc: Move towards a more standard C++ coding style
1618 for templates: Class < T > -> Class<T>.
1619
1620 2004-09-29 Akim Demaille <akim@epita.fr>
1621
1622 * data/lalr1.cc: Reinstall the former ctor, for sake of
1623 compatibility, but warn it will be removed.
1624 Move towards a more standard C++ coding style (i.e., type *var ->
1625 type* var).
1626
1627 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
1628
1629 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
1630 since it's less likely to work if NULs are involved in the future.
1631
1632 2004-09-27 Akim Demaille <akim@epita.fr>
1633
1634 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
1635
1636 2004-09-27 Akim Demaille <akim@epita.fr>
1637
1638 * data/lalr1.cc (b4_parse_param_decl_1): New.
1639 (b4_parse_param_decl): Use it to have different names between attribute
1640 and argument names.
1641 (b4_cc_constructor_call): Likewise.
1642
1643 2004-09-24 Akim Demaille <akim@epita.fr>
1644
1645 * src/parse-gram.y (add_param): Strip the leading and trailing
1646 blanks from a formal argument declaration.
1647 (YY_LOCATION_PRINT): New.
1648
1649 2004-09-24 Akim Demaille <akim@epita.fr>
1650
1651 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
1652 after the location.
1653
1654 2004-09-24 Akim Demaille <akim@epita.fr>
1655
1656 * doc/bison.texinfo (Table of Symbols): Sort.
1657
1658 2004-09-21 Akim Demaille <akim@epita.fr>
1659
1660 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
1661 the useless parentheses.
1662 Suggested by Paul Eggert.
1663
1664 2004-09-20 Akim Demaille <akim@epita.fr>
1665
1666 Let the initial-action act on the look-ahead, and use it for the
1667 "initial push" (corresponding to an hypothetical beginning-of-file).
1668 And let lalr1.cc honor %initial-action.
1669
1670 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
1671 example.
1672 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
1673 (Parser::Parser): Remove the ctor that used to initialize it.
1674 (Parser::parse): Like in the other skeletons, issue the "starting
1675 parse" message before any action.
1676 Honor %initial-action.
1677 Initialize the stacks with the lookahead.
1678 * data/yacc.c: Let $$ and @$ in %initial-action designate the
1679 look-ahead.
1680 Push them in the stacks.
1681 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
1682
1683 2004-09-20 Akim Demaille <akim@epita.fr>
1684
1685 * doc/bison.texinfo (Initial Action Decl): New.
1686
1687 2004-09-20 Akim Demaille <akim@epita.fr>
1688
1689 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
1690 clearer criterion to define it.
1691 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
1692 When reducing on an empty RHS, use the latest stacked location as
1693 location.
1694 yylloc is not always available.
1695 * data/glr.c: Likewise.
1696 Also, honor initial-actions.
1697
1698 2004-09-20 Akim Demaille <akim@epita.fr>
1699
1700 * data/yacc.c (YY_LOCATION_PRINT): New.
1701 Define when we know YYLTYPE's structure, i.e., when the default
1702 YYLLOC_DEFAULT is used.
1703 * data/c.m4 (b4_yysymprint_generate): Use it.
1704 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
1705 value of the result.
1706 (error_start_): Replace with...
1707 (error_range_): this location array.
1708 This allows to replace code relying on the implementation of
1709 locations by portable code.
1710 * data/yacc.c (yylerrsp): Replace with...
1711 (yyerror_range): this.
1712 Every time a token is popped, update yyerror_range[0], to have an
1713 accurate location for the error token.
1714 * data/glr.c (YY_LOCATION_PRINT): New.
1715 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
1716 deference a pointer.
1717 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
1718 report the location in %printers.
1719
1720 * src/scan-skel.l: Instead of abort, report error messages to ease
1721 understanding skeleton scanning failures.
1722
1723 2004-09-16 Akim Demaille <akim@epita.fr>
1724
1725 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
1726 (iterator, const_iterator): these, to be more in the C++ spirit.
1727 Also, return reverse iterators so that when displaying the stack
1728 we display its bottom first.
1729 (Parser::stack_print_, Parser::reduce_print_): Match the messages
1730 from yacc.c.
1731 We should probably use vector here though.
1732
1733 2004-09-16 Akim Demaille <akim@epita.fr>
1734
1735 Have more complete shift traces.
1736
1737 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
1738 to report Shifts instead of ad hoc YYDPRINTF invocations,
1739 including for the error token.
1740 * data/lalr1.cc (symprint_): Output the location.
1741 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
1742 output the location within the %printer.
1743 Activate GLR tests, at least to make sure they compile properly.
1744 They still don't pass though.
1745 * tests/calc.at: Adjust expect verbose output, since now "Entering
1746 state..." is on a different line than the "Shifting" message.
1747
1748 2004-09-08 Akim Demaille <akim@epita.fr>
1749
1750 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
1751 Bison directive from the Bison file to the invocation of this
1752 macro, so that these directives are passed to
1753 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
1754 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
1755 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
1756 the extra Bison directives instead of the whole series.
1757 Change the grammar so that there are recoverable errors, and
1758 unrecoverable errors. Now we can have the parser give up before
1759 consuming the whole input. As a result we now can observe that
1760 the lookahead is freed when needed.
1761 Change the parser source to parse argv[1] instead of a hard coded
1762 string.
1763 Simplify yylex, and give a value and location to EOF.
1764 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
1765 passed directives already coded in the file.
1766 Add some tests to check the location of "error".
1767 For some tests, the C++ parser is correct, and not yacc.c.
1768 For other tests, they provide different, but unsatisfying, values,
1769 so keep the C++ value so that at least one parser is "correct"
1770 according to the test suite.
1771 (Actions after errors): Remove, this is subsumed by the
1772 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
1773
1774 2004-09-06 Akim Demaille <akim@epita.fr>
1775
1776 * data/lalr1.cc: Adjust the indentation of the labels.
1777 (Parser::pop): New.
1778 Use it.
1779
1780 2004-09-06 Akim Demaille <akim@epita.fr>
1781
1782 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
1783 argument, an informative message.
1784 Call YY_SYMBOL_PRINT.
1785 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
1786 * data/lalr1.cc (destruct_): Likewise.
1787 In addition, no longer depend on b4_yysymprint_generate and
1788 b4_yydestruct_generate to generate these functions, do it "by
1789 hand".
1790
1791 2004-09-03 Akim Demaille <akim@epita.fr>
1792
1793 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
1794 invoked, yydestruct the lookahead.
1795 * tests/calc.at (Calculator $1): Update the expected lengths of
1796 traces: there is an added line for the discarded lookahead.
1797 * doc/bison.texinfo (Destructor Decl): Some rewording.
1798 Define "discarded" symbols.
1799
1800 2004-09-02 Akim Demaille <akim@epita.fr>
1801
1802 * data/lalr1.cc (translate_, destruct_): No reason to be static.
1803
1804 2004-09-02 Akim Demaille <akim@epita.fr>
1805
1806 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
1807 (YYDSYMPRINTF): Rename as...
1808 (YY_SYMBOL_PRINT): this.
1809 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
1810 two.
1811 Use it instead of direct symprint_ calls.
1812 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
1813 one.
1814
1815 2004-09-02 Akim Demaille <akim@epita.fr>
1816
1817 * data/lalr1.cc (b4_yysymprint_generate): New.
1818 (symprint_): New member function, defined when YYDEBUG.
1819 Use it consistently instead of token/nterm debugging output by
1820 hand.
1821 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
1822 %printer calls to use cdebug_ when using lalr1.cc.
1823
1824 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
1825
1826 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
1827 with #ifdef YYDEBUG.
1828
1829 2004-08-26 Akim Demaille <akim@epita.fr>
1830
1831 * doc/bison.texinfo (Implementing Loops): Rename as...
1832 (Implementing Gotos/Loops): this.
1833
1834 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
1835
1836 Adjust to latest gnulib.
1837 * bootstrap (gnulib_modules): Add xalloc-die.
1838 Set LC_ALL=C so that file names sort consistently.
1839 Prefer the gnulib copies of gettext.m4, glibc21.m4,
1840 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
1841 uintmax_t.m4, ulonglong.m4.
1842 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
1843 po.m4 since we are now using _gl.m4 instead.
1844
1845 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
1846
1847 * src/scan-action.l: Remove. Scanning of semantic actions is
1848 handled in scan-gram.l.
1849
1850 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
1851
1852 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
1853
1854 * src/location.h (struct): The file member is a uniqstr.
1855 (equal_boundaries): Use UNIQSTR_EQ for comparison.
1856
1857 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
1858
1859 Fix bug with non-%union parsers that have printers or destructors,
1860 which led to a Bison core dump. Reported by Peter Fales in
1861 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
1862
1863 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
1864 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
1865 not to our own type.
1866 * src/output.c (symbol_destructors_output, symbol_printers_output):
1867 Don't assume %union.
1868 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
1869 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
1870 UNION-FLAG. All callers changed.
1871 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
1872 Use type char, not unsigned int, when declaring an array of char;
1873 this lets us remove a cast.
1874 (Printers and Destructors): Add non-%union test cases.
1875
1876 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
1877
1878 * doc/bison.texinfo: Minor editorial changes, mostly to the new
1879 GLR writeups. E.g., avoid frenchspacing and the future tense,
1880 change "lookahead" to "look-ahead", and change "wrt" to "with
1881 respect to".
1882
1883 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
1884
1885 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
1886 New sections, split off from the GLR Parsers section. Put the new
1887 Simple GLR Parser near the start of the GLR section, for clarity.
1888 Rewrite connective text.
1889
1890 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
1891
1892 * doc/bison.texinfo (Simple GLR Parsers): New section.
1893
1894 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
1895
1896 * NEWS, TODO, doc/bison.texinfo:
1897 Use "look-ahead" instead of "lookahead", to be consistent.
1898 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
1899 while we're fixing "look-ahead".
1900 * src/conflicts.c (shift_set): Renamed from shiftset.
1901 (look_ahead_set): Renamed from lookaheadset.
1902 * src/print.c: Likewise.
1903 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
1904 name for "lookahead".
1905 (report_types, usage): Likewise.
1906 * src/getargs.h (report_look_ahead_tokens): Renamed from
1907 report_lookaheads.
1908 * src/lalr.c (compute_look_ahead_tokens): Renamed from
1909 compute_lookaheads.
1910 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
1911 (look_ahead_tokens_print): Renamed from lookaheads_print.
1912 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
1913 state_rule_lookaheads_print.
1914 * src/state.h: Likewise.
1915 (reductions.look_ahead_tokens): Renamed from lookaheads.
1916 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
1917 AT_DATA_LOOKAHEADS_GRAMMAR.
1918
1919 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
1920
1921 * README: Update location of patched M4 distribution.
1922
1923 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
1924
1925 Don't assume the C++ compiler takes the same arguments as the C compiler
1926 (trivial change).
1927 * configure.ac (O0CXXFLAGS): New var.
1928 * tests/atlocal.in (CXXFLAGS): Use it.
1929
1930 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
1931
1932 Fix some "make check" problems with C++ reported by
1933 Albert Chin-A-Young for Tru64 C++ in this thread:
1934 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
1935
1936 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
1937 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1938 Output to a .cc file for C++, not to a .c file.
1939 * tests/calc.at (AT_CHECK_CALC): Likewise.
1940 * tests/regression.at (AT_CHECK_DANCER): Likewise.
1941 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
1942
1943 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
1944
1945 * tests/calc.at, tests/actions.at: Workaround for SGI
1946 C++ compiler. (trivial change)
1947
1948 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
1949
1950 Spent a few hours checking out which prerequisite versions the
1951 current sources actually require. I went all the way back to
1952 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
1953 a seemingly endless set of combinations of versions more recent
1954 than that. The bottom line is that the current sources require
1955 fairly recent versions of the build tools, and it'll be some work
1956 to change this.
1957 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
1958 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
1959 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
1960 Add comments explaining why those particular versions are
1961 currently needed.
1962
1963 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
1964 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
1965 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
1966
1967 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
1968 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
1969
1970 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
1971
1972 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
1973 0.11.5. Suggested by Bruno Haible.
1974 * bootstrap: Remove gettext version checking.
1975
1976 * doc/bison.texinfo (Decl Summary): Also mention that %union
1977 can depend on prerequisite types. Problem reported by Tim
1978 Van Holder.
1979
1980 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
1981
1982 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
1983 * README-alpha: Don't tell people not to package this.
1984
1985 * bootstrap: Don't assume $(...) works; use `...` instead.
1986 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
1987 gettext better.
1988
1989 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
1990 put into the -d output file, and mention what to do if YYSTYPE is
1991 defined as a macro.
1992
1993 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
1994
1995 Undo change made earlier today: it caused autopoint to not bring
1996 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
1997 autopoint's.
1998
1999 * bootstrap: Check that gettext version matches what's in
2000 configure.ac. Warn users to ignore robots.txt ERROR 404.
2001 * bootstrap: Undo today's earlier change (logged below).
2002 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
2003
2004 The gettext version checking is causing more trouble than it's
2005 curing; remove it. Problem reported by Paul Hilfinger.
2006
2007 * bootstrap: Issue a warning that one can expect a message
2008 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
2009 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
2010
2011 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
2012
2013 Ensure that the C++ compiler used for testing actually works on a
2014 simple test program; if not, skip the C++-related tests. Problem
2015 reported by Vin Shelton in:
2016 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
2017
2018 * m4/cxx.m4: New file.
2019 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
2020 * tests/atlocal.in (BISON_CXX_WORKS): Add.
2021 * tests/local.at (AT_COMPILE_CXX): Use it.
2022
2023 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
2024
2025 * data/glr.c (yylloc): Output this macro even if locations are not
2026 being generated, as the GLR parser needs it even in that case.
2027 Problem reported by Troy A. Johnson
2028 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
2029
2030 * configure.ac (AC_INIT): Update to 1.875e.
2031
2032 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
2033
2034 * NEWS: Version 1.875d.
2035 * configure.ac (AC_INIT): Likewise.
2036 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
2037
2038 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
2039 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
2040 lalr1.cc runs afoul of the first, and the last two are no longer
2041 supported by GCC 3.4.0.
2042 * README: Mention GNU m4 1.4 or later; mention m4 patches.
2043 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
2044
2045 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
2046
2047 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
2048 unsigned int, for compatibility with latest gnulib hash module.
2049 * src/state.c (state_hash, state_hasher): Likewise.
2050 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
2051 * src/uniqstr.c (hash_uniqstr): Likewise.
2052
2053 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
2054
2055 * NEWS: Unescaped newlines are no longer allowed in char & strings.
2056
2057 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
2058 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
2059 character and string literals.
2060 (unexpected_end): New function.
2061 (unexpected_eof): Use it.
2062 (unexpected_newline): New function.
2063 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
2064 actions.
2065
2066 * NEWS: Document %expect-rr.
2067
2068 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
2069 Fix typo by replacing $1 with $option.
2070 Remove more 'intl'-related files.
2071 Don't DEFUN AM_INTL_SUBDIR twice.
2072
2073 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
2074 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
2075 strtoul.c.
2076 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
2077 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
2078 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
2079 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
2080 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
2081 * src/.cvsignore: Add *.output.
2082
2083 * src/parse-gram.y: Put copyright notice inside %{ %} so it
2084 gets copied to the output file.
2085
2086 2004-04-28 Paul Eggert <eggert@twinsun.com>
2087
2088 Get files from the gnulib and po repositories, instead of relying
2089 on them being in our CVS. Upgrade to latest versions of gnulib
2090 and Automake.
2091
2092 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
2093 * bootstrap: Bootstrap from gnulib and po repositories.
2094 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
2095 * README-cvs: Document these changes. Remove version numbers from
2096 mentions of build tools, since they change so often. Mention Flex.
2097
2098 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
2099 (gl_USE_SYSTEM_EXTENSIONS): Add.
2100 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
2101 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
2102 does this for us.
2103 (AC_ISC_POSIX): Remove; we no longer support this
2104 ancient OS, as it gets in the way of latest Autoconf & gnulib.
2105 (AC_HEADER_STDC): Remove: we now assume C89 or better.
2106 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
2107 Do not check for C89 headers, except for locale.h which is used
2108 by the Yacc library and must port to K&R hosts.
2109 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
2110 Do not check for C89 functions, except for setlocale which is
2111 used by the Yacc library.
2112 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
2113 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
2114 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
2115 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
2116 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
2117 AM_GNU_GETTEXT): Remove; now done by:
2118 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
2119 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
2120 for us.
2121
2122 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
2123 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
2124 Define to empty, as gnulib.mk will do the rest for us.
2125 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
2126 for us.
2127 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
2128 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
2129
2130 * src/files.c: Include gnulib's xstrndup.h.
2131
2132 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
2133 (REALLOC): Use xnrealloc, for likewise.
2134 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
2135 (strnlen, memrchr): Remove decls; functions no longer used.
2136 Include <stpcpy.h>.
2137
2138 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
2139 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
2140 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
2141 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
2142 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
2143 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
2144 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
2145 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
2146 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
2147 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
2148 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
2149 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
2150 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
2151 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
2152 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
2153 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
2154 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
2155 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
2156 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
2157 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
2158 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
2159 Remove, as these files are now generated automatically
2160 by bootstrap or automake.
2161
2162 * po/ChangeLog: Remove: all but one entry was a duplicate
2163 of this file, and I moved that 2000-11-02 entry here.
2164
2165 * config/.cvsignore: Add Makefile, depcomp, install-sh.
2166 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
2167 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
2168 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
2169 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
2170 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
2171 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
2172 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
2173 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
2174 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
2175 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
2176 xstrndup.h.
2177 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
2178 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
2179 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
2180 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
2181 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
2182 * src/.cvsignore: Remove *_.c.
2183
2184
2185 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
2186 support it. (The latest stable gzip doesn't.)
2187
2188 2004-04-27 Paul Eggert <eggert@twinsun.com>
2189
2190 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
2191 case, as stos_ is now used by destructors due to the 2004-02-09
2192 change.
2193
2194 Remove more K&R C support.
2195 * lib/libiberty.y (PARAMS): Remove. All uses removed.
2196 * lib/subpipe.c (errno): Remove decl.
2197 Include <stdlib.h> unconditionally.
2198 (EXIT_FAILURE): Remove macro.
2199 * src/complain.c (vfprintf, strerror): Remove.
2200 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
2201 unconditionally.
2202 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
2203 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
2204 (strchr, strspn, memchr): Remove decls.
2205 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
2206 unconditionally. Do not declare perror.
2207 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
2208 unconditionally.
2209
2210 * src/complain.c (_): Remove useless defn, as system.h defines this.
2211
2212 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
2213 with latest obstack.h.
2214 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
2215 to procedure types, as obstack.h now does that for us.
2216 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
2217
2218 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
2219 so that this include file can stand alone.
2220 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
2221 does this now. Include subpipe.h first after config.h, to
2222 test whether it can stand alone.
2223
2224 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
2225 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
2226 unused declaration.
2227
2228 * tests/synclines.at (%union synch line): Put a dummy member in
2229 the union, because empty unions aren't allowed in C. Caught
2230 by GCC 3.4.0.
2231
2232 2004-04-13 Jim Meyering <jim@meyering.net>
2233
2234 * src/conflicts.c (conflicts_print): Correct format string typo:
2235 use `%%' to produce literal `%'. (trivial change)
2236
2237 2004-03-30 Paul Eggert <eggert@twinsun.com>
2238
2239 * src/getargs.c (version): Update copyright year to 2004.
2240
2241 * data/c.m4 (b4_int_type): Use 'short int' rather than
2242 'short', and similarly for 'long', 'unsigned', etc.
2243 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
2244 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
2245 yy_yypstack, yydumpstack): Likewise.
2246 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
2247 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
2248 Likewise.
2249 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
2250 yy_stack_print, yyparse): Likewise.
2251 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
2252 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
2253 * lib/bitset.c (bitset_print): Likewise.
2254 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
2255 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
2256 * lib/bitsetv.c (bitsetv_dump): Likewise.
2257 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
2258 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
2259 Likewise.
2260 * src/LR0.c (allocate_itemsets): Likewise.
2261 * src/gram.h (rule_number, rule): Likewise.
2262 * src/lalr.h (goto_number): Likewise.
2263 * src/nullable.c (nullable_compute): Likewise.
2264 * src/output.c (prepare_rules): Likewise.
2265 * src/relation.c (relation_print, relation_digraph): Likewise.
2266 * src/relation.h (relation_node): Likewise.
2267 * src/state.h (state_number, transitions, errs, reductions,
2268 struct state): Likewise.
2269 * src/symtab.h (symbol_number, struct symbol): Likewise.
2270 * src/tables.c (vector_number, tally, action_number,
2271 default_goto, goto_actions): Likewise.
2272 * tests/existing.at (GNU Cim Grammar): Likewise.
2273 * tests/regression.at (Web2c Actions): Likewise.
2274
2275 * src/output.c (muscle_insert_short_int_table): Renamed from
2276 muscle_insert_short_table. All uses changed.
2277
2278 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2279
2280 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
2281 (declaration): Replace expected_conflicts with expected_sr_conflicts.
2282 Add %expect-rr rule.
2283
2284 * src/scan-gram.l: Recognize %expect-rr.
2285
2286 * src/conflicts.h (expected_sr_conflicts): Rename from
2287 expected_conflicts.
2288 (expected_rr_conflicts): Declare.
2289
2290 * src/conflicts.c (expected_sr_conflicts): Rename from
2291 expected_conflicts.
2292 (expected_rr_conflicts): Define.
2293 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
2294 for GLR parsers.
2295 Use expected_sr_conflicts in place of expected_conflicts.
2296 Warn if expected_rr_conflicts used in non-GLR parser.
2297
2298 * doc/bison.texinfo: Add documentation for %expect-rr.
2299
2300 2004-03-08 Paul Eggert <eggert@gnu.org>
2301
2302 Add support for hex token numbers. Suggested by Odd Arild Olsen in
2303 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
2304
2305 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
2306 in lalr1.cc.
2307 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
2308 * src/scan-gram.l (scan_integer): New function.
2309 ({int}): Use it.
2310 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
2311 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
2312 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
2313 Say "long int", not "long", for uniformity with GNU style.
2314
2315 2004-02-25 Paul Eggert <eggert@twinsun.com>
2316
2317 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
2318 compilers. This fixes a problem with Intel's C++ compiler being
2319 chatty, reported by Guido Trentalancia in
2320 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
2321
2322 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
2323
2324 Support %destructor and merge error locations in lalr1.cc.
2325
2326 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
2327 (Parser::stos_): Define unconditionally.
2328 (Parser::destruct_): New method. Generate its body with
2329 b4_yydestruct_generate.
2330 (Parser::error_start_): New attribute.
2331 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
2332 token which are discarded.
2333 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
2334 error_start_ when erroneous token are discarded.
2335 (Parser::parse) <yyerrlab1>: Compute the location of the error
2336 token so that it covers all the discarded tokens.
2337 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
2338 it can be called with `%skeleton "lalr1.cc"', and do that.
2339
2340 2004-02-02 Paul Eggert <eggert@twinsun.com>
2341
2342 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
2343 $(top_srcdir)/lib and ../lib. This fixes a bug reported
2344 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
2345 There's no need to mention top_builddir since Automake does that
2346 for us.
2347 (INCLUDES): Remove, as Automake says it's obsolescent.
2348 Contents migrated into AM_CPPFLAGS as described above.
2349 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
2350
2351 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
2352
2353 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
2354 (yyreportSyntaxError): Handle case where lookahead token is
2355 YYEMPTY.
2356
2357 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2358
2359 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
2360 resulting parsers are compilable with C++.
2361
2362 2003-12-23 Paul Eggert <eggert@twinsun.com>
2363
2364 * config/depcomp, config/install-sh: Sync with Automake 1.8.
2365 * src/output.c (output_skeleton): Rename local var.
2366 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
2367 Bison tokens, as this runs afoul of the 2003-10-07 change that
2368 disallowed NUL bytes in character constants or string literals.
2369
2370 * tests/local.at: Require Autoconf 2.59's Autotest.
2371 * tests/testsuite.at: Don't include local.at, since we now assume
2372 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
2373 including it.
2374 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
2375 multiple inclusion warnings.
2376
2377 2003-12-02 Akim Demaille <akim@epita.fr>
2378
2379 * doc/bison.texinfo (How Can I Reset the Parser): More about start
2380 conditions.
2381 From Bruno Haible.
2382
2383 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
2384
2385 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
2386
2387 2003-10-07 Paul Eggert <eggert@twinsun.com>
2388
2389 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
2390 if testsuite doesn't exist.
2391
2392 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
2393 literals, unfortunately.
2394 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
2395 Complain about NUL bytes in character constants or string literals.
2396
2397 2003-10-05 Paul Eggert <eggert@twinsun.com>
2398
2399 * NEWS: Don't document %no-default-prec, as it's still
2400 too experimental.
2401 * doc/bison.texinfo: Document %no-default-prec only if
2402 the defaultprec flag is set. Normally it's not.
2403
2404 2003-10-04 Paul Eggert <eggert@twinsun.com>
2405
2406 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
2407 non-modifiable lvalue, instead of a modifiable one.
2408 * doc/bison.texinfo (Actions): Document that $$ can
2409 be assigned to. Do not claim that $$ and $N are
2410 array element references: user code should not rely on this.
2411
2412 2003-10-01 Paul Eggert <eggert@twinsun.com>
2413
2414 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
2415 (grammar_declaration): Use it.
2416 * src/scan-gram.l: New token %no-default-prec.
2417 * tests/conflicts.at: Revamp tests to use %no-default-prec.
2418 * NEWS, doc/bison.texinfo: Document the above.
2419
2420 2003-10-01 Akim Demaille <akim@epita.fr>
2421
2422 VCG no longer supports long_straight_phase.
2423
2424 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
2425 * src/print_graph.c (print_graph): Adjust.
2426
2427 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
2428 and Paul Eggert <eggert@twinsun.com>
2429
2430 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
2431 Table of Symbols): Document %default-prec.
2432 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
2433 (grammar_declaration): Set default_prec on %default-prec.
2434 * src/scan-gram.l (%default-prec): New token.
2435 * src/reader.h (default_prec): New flag.
2436 * src/reader.c: Likewise.
2437 (packgram): Handle it.
2438 * tests/conflicts.at (%default-prec without %prec,
2439 %default-prec with %prec, %default-prec 1): New tests.
2440
2441 2003-09-30 Paul Eggert <eggert@twinsun.com>
2442
2443 * tests/testsuite.at: Include local.at, not input.at, fixing
2444 a typo in the 2003-08-25 patch.
2445
2446 2003-08-27 Akim Demaille <akim@epita.fr>
2447
2448 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
2449 GCC warnings.
2450
2451 2003-08-26 Akim Demaille <akim@epita.fr>
2452
2453 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
2454 "<\#" to avoid magic from Gnus when posting parts of this script.
2455
2456 2003-08-26 Akim Demaille <akim@epita.fr>
2457
2458 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
2459 (Parser::parse): here.
2460 Adjust: nerrs and errstatus is now replaced by...
2461 (Parser::nerrs_, Parser::errstatus_): New.
2462
2463 2003-08-25 Akim Demaille <akim@epita.fr>
2464
2465 * config/announce-gen, Makefile.cfg: New.
2466 * Makefile.am: Adjust.
2467 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
2468 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
2469
2470 2003-08-25 Akim Demaille <akim@epita.fr>
2471
2472 When reducing initial empty rules, Bison parser read an initial
2473 location that is not defined. This results in garbage, and that
2474 affects Bison's own parser. Therefore we need (i) to extend Bison
2475 to support a means to initialize this location, and (ii) to use
2476 this CVS Bison to fix CVS Bison's parser.
2477
2478 * src/reader.h, reader.c (epilogue_augment): Remove, replace
2479 with...
2480 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
2481 * src/parse-gram.y: Adjust.
2482 (%initial-action): New.
2483 (%error-verbose): Since we require CVS Bison, there is no reason
2484 not to use it.
2485 * src/scan-gram.l: Adjust.
2486 * src/Makefile.am (YACC): New, to make sure we use our own parser.
2487 * data/yacc.c (yyparse): Use b4_initial_action.
2488
2489 2003-08-25 Akim Demaille <akim@epita.fr>
2490
2491 * doc/bison.texinfo: Don't promote stdout for error messages.
2492
2493 2003-08-25 Akim Demaille <akim@epita.fr>
2494
2495 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
2496 From Alexandre Duret-Lutz.
2497
2498 2003-08-25 Akim Demaille <akim@epita.fr>
2499
2500 Version 1.875c.
2501
2502 2003-08-25 Akim Demaille <akim@epita.fr>
2503
2504 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
2505 Use them.
2506
2507 2003-08-25 Akim Demaille <akim@epita.fr>
2508
2509 * data/lalr1.cc (Parser::reduce_print_): New.
2510 Use it.
2511
2512 2003-08-25 Akim Demaille <akim@epita.fr>
2513
2514 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
2515 error recovery loops. This patch is based on
2516 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
2517 Also, augment the similarity between lalr1.cc and yacc.c.
2518 Note: the locations of error recovery rules are not correct yet.
2519
2520 * data/lalr1.cc: Comment changes to augment the similarity between
2521 lalr1.cc and yacc.c.
2522 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
2523 (yyerrlab1): Remove, but where it used to be (now the bottom part of
2524 yyerrlab), when hitting EOF, pop the whole stack here instead of
2525 merely falling thru the default error handling mechanism.
2526 (yyerrorlab): New label, with the old contents of YYERROR,
2527 plus the following change: pop the stack of rhs corresponding
2528 to the production that invoked YYERROR. That is how Yacc
2529 behaves (required by POSIX).
2530 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
2531 fail.
2532
2533 2003-08-25 Akim Demaille <akim@epita.fr>
2534
2535 Tune local.at so that people can "autom4te -l autotest calc.at -o
2536 calc" for instance, to extract a sub test suite.
2537
2538 * tests/testsuite.at: Move the initialization, Autotest version
2539 requirement, and AT_TESTED invocation into...
2540 * tests/local.at: here.
2541 * tests/testsuite.at: Include it for compatibility with Autoconf
2542 2.57.
2543 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
2544 be ignore.
2545
2546 2003-08-04 Paul Eggert <eggert@twinsun.com>
2547
2548 Rework code slightly to avoid gcc -Wtraditional warnings.
2549 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
2550 The returned value is now stored in *YY0. All callers changed.
2551 * src/output.c (merge_output): Adjust to the above change.
2552
2553 2003-07-26 Paul Eggert <eggert@twinsun.com>
2554
2555 * data/glr.c (YYASSERT): New macro.
2556 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
2557 yyresolveStates, yyprocessOneStack):
2558 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
2559 Derived from a suggestion by Frank Heckenbach.
2560
2561 2003-07-25 Paul Eggert <eggert@twinsun.com>
2562
2563 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
2564 for portability to K&R C (after ansi2knr, presumably). See
2565 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
2566 by Frank Heckenbach, though I have omitted the structure-initialization
2567 part of his glr-knr.diff patch since I recall that the Portable
2568 C Compiler didn't require that change.
2569
2570 Let the user specify how to allocate and free memory.
2571 Derived from a suggestion by Frank Heckenbach in
2572 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
2573 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
2574 All uses of free, malloc, realloc changed to use these macros,
2575 and unnecessary casts removed.
2576 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
2577
2578 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
2579
2580 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
2581 use s.empty() rather than s == "" to test for empty string; see
2582 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
2583 (trivial change)
2584
2585 2003-06-25 Akim Demaille <akim@epita.fr>
2586
2587 * config/depcomp, config/install-sh: Update from masters.
2588
2589 2003-06-20 Paul Eggert <eggert@twinsun.com>
2590
2591 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
2592 and return properly parenthesized result.
2593 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
2594 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
2595 Remove unnecessary parentheses from uses.
2596 * doc/bison.texinfo (Location Default Action): Describe the
2597 conventions for parentheses.
2598
2599 2003-06-19 Paul Eggert <eggert@twinsun.com>
2600
2601 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
2602 yyreportTree): Do not assume that size_t is the same width as int,
2603 when printing sizes. Print sizes using an unsigned format.
2604 Problem reported by Frank Heckenbach in
2605 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
2606
2607 Port to Forte Developer 7 C compiler.
2608 * data/glr.c (struct YYLTYPE): If locations are not being used,
2609 declare a single dummy member, as empty structs do not conform
2610 to the C standard.
2611 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
2612 the Forte Developer 7 C compiler complains that end-of-loop
2613 code is not reached.
2614
2615 2003-06-17 Paul Eggert <eggert@twinsun.com>
2616
2617 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
2618 avoid warnings from picky compilers about redefinition of PARAMS.
2619
2620 2003-06-17 Paul Eggert <eggert@twinsun.com>
2621
2622 Version 1.875b.
2623
2624 * NEWS: Document 1.875b.
2625
2626 * lib/bbitset.h: Do not include config.h; that's the includer's job.
2627 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
2628 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
2629 Don't use 'index' in comments, as it's a builtin fn on some hosts.
2630 * lib/bitset_stats.c: Include gettext.h unconditionally, as
2631 per recent gettext manual's suggestion.
2632 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
2633 Use prototypes, not old-style definitions.
2634 * lib/lbitset.c (lbitset_unused_clear): Likewise.
2635 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
2636 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
2637 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
2638 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
2639 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
2640 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
2641 vbitset_or_and_cmp, vbitset_copy): Likewise.
2642
2643 * lib/libiberty.h: Do not include config.h; that's the includer's job.
2644 Do not include <stdlib.h>.
2645 (PARAMS): Define unconditionally for C89.
2646 (ATTRIBUTE_NORETURN): Remove.
2647 (ATTRIBUTE_UNUSED): Define unconditionally.
2648
2649 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
2650 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
2651 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
2652 * lib/vbitset.c, lib/vbitset.h: New files.
2653 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
2654 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
2655 from libbitset.
2656
2657 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
2658 `How Can I Reset @code{yyparse}', since texinfo does not allow
2659 arbitrary @ in node names.
2660
2661 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
2662 shouldn't be needed according to the gettext 0.12.1 documentation
2663 but which seem to be needed anyway: codeset.m4 glibc21.m4
2664 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
2665 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
2666 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
2667
2668 * lib/.cvsignore: Add stdbool.h.
2669 * m4/.cvsignore: Add nls.m4, po.m4.
2670
2671 Upgrade to CVS gnulib.
2672 * stdbool_.h: File renamed from stdbool.h.in.
2673 * configure.ac (AM_STDBOOL_H): Invoke this instead of
2674 AC_HEADER_STDBOOL.
2675 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
2676 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
2677 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
2678 (MOSTLYCLEANFILES): New var.
2679 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
2680 (stdbool.h): New rule.
2681 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
2682 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
2683 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
2684 m4/quote.m4: Upgrade to today's gnulib.
2685
2686 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
2687 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
2688 the tests right now.
2689 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
2690 yyerror are declared before use; C99 requires this.
2691
2692 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2693
2694 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
2695 first.
2696 (yyrecoverSyntaxError): Correct the logic for setting and testing
2697 yyerrState.
2698 Correct comment on handling EOF.
2699 Allow states with only a default reduction, rather than failing
2700 (I can't quite reconstruct why these were not allowed before).
2701
2702 Fixes to avoid problem that $-N rules in GLR parsers can cause
2703 buffer overruns, corrupting state.
2704
2705 * src/output.c (prepare_rules): Output max_left_semantic_context
2706 definition.
2707 * src/reader.h (max_left_semantic_context): New variable declaration.
2708 * src/scan-gram.l (max_left_semantic_context): Define.
2709 (handle_action_dollar): Update max_left_semantic_context.
2710 * data/glr.c (YYMAXLEFT): New definition.
2711 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
2712 (yyresolveAction): Ditto.
2713
2714 Fixes to problems with location handling in GLR parsers reported by
2715 Frank Heckenbach (2003/06/05).
2716
2717 * data/glr.c (YYLTYPE): Make trivial if locations not used.
2718 (YYRHSLOC): Add parentheses, and define only if locations used.
2719 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
2720 locations not used.
2721 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
2722 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
2723
2724 * tests/cxx-type.at: Exercise location information; update tests
2725 to differentiate output with and without locations.
2726 Remove forward declarations of yylex and yyerror---caused errors
2727 because default YYLTYPE not yet defined.
2728 Change semantic actions to compute strings, rather than printing
2729 them directly (to test proper passing of semantics values). Change
2730 output to prefix notation and update test data and expected results.
2731 (yylex): Track locations.
2732 (stmtMerge): Return value rather than printing, and include arguments
2733 in value.
2734
2735 2003-06-03 Paul Eggert <eggert@twinsun.com>
2736
2737 Avoid warnings generated by GCC 2.95.4 when Bison is
2738 configured with --enable-gcc-warnings.
2739 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
2740 yy::]b4_parser_class_name[::translate_,
2741 yy::Stack::operator[] (unsigned),
2742 yy::Stack::operator[] (unsigned) const,
2743 yy::Slice::operator[] (unsigned),
2744 yy::Slice::operator[] (unsigned) const):
2745 Rename local vars to avoid warnings.
2746 * tests/glr-regression.at (Improper handling of embedded actions
2747 and $-N in GLR parsers): Remove unused local variable from yylex.
2748 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
2749 (void) as arg when not pure, since we now assume C89 when building
2750 Bison. Pacify GCC by using parameter.
2751
2752 2003-06-02 Paul Eggert <eggert@twinsun.com>
2753
2754 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
2755 yy::Location::lines, yy::Location::columns): Rename arguments
2756 to avoid shadowing; this removes a warning generated by GCC 3.3.
2757
2758 2003-06-01 Paul Eggert <eggert@twinsun.com>
2759
2760 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
2761 to g++, as GCC 3.3 complains if you do it.
2762 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
2763 everything that WARNING_CFLAGS has, except omit warnings
2764 not suitable for C++.
2765 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
2766 * tests/atlocal.in (CXXFLAGS): New var.
2767 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
2768
2769 Fix a GLR parser bug I reported in February; see
2770 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
2771 The problem was that GLR parsers did not conform to the C standard,
2772 because actions like { $1 = $2 + $3; } expanded to expressions
2773 that invoked YYFILL in separate subexpressions, and YYFILL assigned
2774 to a local variable. The C standard says that expressions
2775 like (var = f ()) + (var = f ()) have undefined behavior.
2776 Another problem was that GCC sometimes issues warnings that
2777 yyfill and its parameters are unused.
2778
2779 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
2780 as possibly unused.
2781 (yyfill): New function.
2782 (YYFILL): Use it.
2783 (yyuserAction): Change type of yynormal to bool, so that it matches
2784 the new yyfill signature. Mark it as possibly unused.
2785
2786
2787 Follow up on a bug I reported in February, where a Bison-generated
2788 parser can loop. Provide a test case and a fix for yacc.c. I
2789 don't have a fix for lalr1.cc or for glr.c, unfortunately.
2790 The original bug report is in:
2791 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
2792
2793 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
2794 macro's size was becoming unwieldy.
2795 (yyerrlab): Do not discard an empty lookahead symbol, as this
2796 might destroy garbage.
2797 (yyerrorlab): New label, with the old contents of YYERROR,
2798 plus the following change: pop the stack of rhs corresponding
2799 to the production that invoked YYERROR. That is how Yacc
2800 behaves, and POSIX requires this behavior.
2801 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
2802 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
2803 Define 'alarm' to do nothing if unistd.h is not available.
2804 Add a new rule "exp: '-' error;" to test the above change to
2805 data/yacc.c. Use 'alarm' to abort any test taking longer than
2806 10 seconds, as it's probably looping.
2807 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
2808 Also, the new yacc.c generates two fewer diagnostics for an
2809 existing test.
2810
2811 2003-05-24 Paul Eggert <eggert@twinsun.com>
2812
2813 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
2814 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
2815 This fixes a problem reported by John Bowman when the Compaq/HP
2816 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
2817 -ansi -Wall -gall).
2818 * data/yacc.c (union yyalloc): Likewise.
2819 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
2820
2821 Switch from 'int' to 'bool' where that makes sense.
2822
2823 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
2824 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
2825 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
2826 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
2827 Return or accept bool, not int. All callers changed.
2828 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
2829 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
2830 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
2831 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
2832 bitset_or_and_cmp_): Likewise.
2833 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
2834 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
2835 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
2836 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
2837 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
2838 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
2839 bitset_stats_or_and_cmp): Likewise.
2840 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
2841 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
2842 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
2843 ebitset_xor_cmp): Likewise.
2844 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
2845 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
2846 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
2847 lbitset_xor_cmp): Likewise.
2848 * lib/bbitset.h: Include <stdbool.h>.
2849 (struct bitset_vtable): The following members now return bool, not
2850 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
2851 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
2852 or_and_cmp).
2853 * src/conflicts.c (count_rr_conflicts): Likewise.
2854 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
2855 All uses changed.
2856 * lib/ebitset.c (ebitset_obstack_init): Likewise.
2857 * lib/lbitset.c (lbitset_obstack_init): Likewise.
2858 * src/getargs.c (debug_flag, defines_flag, locations_flag,
2859 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
2860 graph_flag): Likewise.
2861 * src/getargs.h (debug_flag, defines_flag, locations_flag,
2862 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
2863 graph_flag): Likewise.
2864 * src/output.c (error_verbose): Likewise.
2865 * src/output.h (error_verbose): Likewise.
2866 * src/reader.c (start_flag, typed): Likewise.
2867 * src/reader.h (typed): Likewise.
2868 * src/getargs.c (LOCATIONS_OPTION): New constant.
2869 (long_options, getargs): Use it.
2870 * src/lalr.c (build_relations): Use bool, not int.
2871 * src/nullable.c (nullable_compute): Likewise.
2872 * src/print.c (print_reductions): Likewise.
2873 * src/tables.c (action_row, pack_vector): Likewise.
2874 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
2875 * src/output.c (prepare): Use it.
2876 * src/output.c (token_definitions_output,
2877 symbol_destructors_output, symbol_destructors_output): Use string,
2878 not boolean integer, to keep track of whether to output separator.
2879 * src/print_graph.c (print_core): Likewise.
2880 * src/state.c (state_rule_lookaheads_print): Likewise.
2881
2882 * config/install-sh: Sync from automake 1.7.5.
2883
2884 2003-05-14 Paul Eggert <eggert@twinsun.com>
2885
2886 * src/parse-gram.y (rules_or_grammar_declaration): Require a
2887 semicolon after a grammar declaration, in the interest of possible
2888 future changes to the Bison input language.
2889 Do not allow a stray semicolon at the start of the grammar.
2890 (rhses.1): Allow one or more semicolons after any rule, including
2891 just before "|" as required by POSIX.
2892 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
2893 grammar.
2894
2895 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
2896
2897 %parse-param support for lalr1.cc.
2898
2899 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
2900 b4_cc_constructor_calls, b4_cc_constructor_call,
2901 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
2902 definitions.
2903 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
2904 parse-param arguments.
2905 (yy::b4_parser_class_name): Declare instance variables to
2906 hold parse-param arguments.
2907 * tests/calc.at: s/value/semantic_value/ because value clashes
2908 with a member of yy::b4_parser_class_name. Adjust C++ code
2909 to handle %parse-param. Enable %parse-param test in C++.
2910
2911 2003-05-12 Paul Eggert <eggert@twinsun.com>
2912
2913 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
2914 English a bit. Fix fclose typo. Change "const char" to "char
2915 const", and use ANSI C rather than K&R for "main". Suggest
2916 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
2917 and suggest yy_switch_to_buffer.
2918
2919 2003-05-05 Paul Eggert <eggert@twinsun.com>
2920
2921 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
2922 C89. This avoids a diagnostic on compilers that define __STDC__
2923 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
2924 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
2925
2926 2003-05-03 Paul Eggert <eggert@twinsun.com>
2927
2928 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
2929 Do not overrun array bounds.
2930 This should fix a bug reported today by Olatunji Oluwabukunmi in
2931 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
2932
2933 2003-04-29 Akim Demaille <akim@epita.fr>
2934
2935 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
2936 * src/getargs.c, src/getargs.h: here, as bool, not int.
2937 (nondeterministic_parser): New.
2938 * src/parse-gram.y, src/scan-gram.l: Support
2939 %nondeterministic-parser.
2940 * src/output.c (prepare): Use nondeterministic_parser instead
2941 of glr_parser where appropriate.
2942 * src/tables.c (conflict_row, action_row, save_row)
2943 (token_actions, token_actions, pack_vector): Ditto.
2944
2945 2003-04-29 Akim Demaille <akim@epita.fr>
2946
2947 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
2948
2949 2003-04-29 Akim Demaille <akim@epita.fr>
2950
2951 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
2952 with %pure-parser and %locations to exercise the patch from Yakov
2953 Markovitch below.
2954
2955 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
2956
2957 * data/yacc.c: (b4_lex_param): Corrected for the case where
2958 %lex-param is provided and %pure-parser isn't.
2959
2960 2003-04-27 Paul Eggert <eggert@twinsun.com>
2961
2962 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
2963 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
2964 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
2965 if it is not defined.
2966 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
2967
2968 2003-04-26 Paul Eggert <eggert@twinsun.com>
2969
2970 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
2971 Declare to be of type suitable for the ninf value itself, not of
2972 type suitable for the corresponding table, since the latter might
2973 be unsigned but the ninf value might be negative. This fixes a
2974 bug reported by Alexandre Duret-Lutz in
2975 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
2976
2977 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
2978 invokes it. We shouldn't invoke it twice because it will attempt
2979 to put error.o in the archive twice. This fixes a glitch reported
2980 by Martin Mokrejs in
2981 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
2982
2983 2003-04-21 Paul Eggert <eggert@twinsun.com>
2984
2985 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
2986 to gnulib.
2987
2988 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
2989
2990 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
2991 Fix obvious typo that results in uncompilable GLR parsers
2992 when both %pure-parser and %locations are used. (trivial change)
2993
2994 2003-04-17 Paul Eggert <eggert@twinsun.com>
2995
2996 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
2997 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
2998 Do not insert the expected token via unput, as this runs afoul
2999 of a POSIX-compatibility bug in flex 2.5.31.
3000 All uses changed to BEGIN the parent state,
3001 since we no longer insert the expected token via unput.
3002 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
3003 that is no longer emitted after the above change.
3004
3005 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
3006 the first one. This change is from Paul Hilfinger, and it fixes
3007 regression reported by Werner Lemberg in
3008 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3009
3010 (resolve_sr_conflict): Don't invoke state_errs_set
3011 unless one or more tokens have been explicitly made errors.
3012 Otherwise, the above change causes Bison to abort.
3013
3014 * tests/existing.at (GNU pic Grammar): New test case, taken from
3015 Lemberg's email.
3016
3017 2003-03-31 Akim Demaille <akim@epita.fr>
3018
3019 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
3020
3021 2003-03-31 Akim Demaille <akim@epita.fr>
3022
3023 * src/output.c (prepare_symbols): Avoid trailing spaces in the
3024 output.
3025
3026 2003-03-31 Akim Demaille <akim@epita.fr>
3027
3028 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
3029 From Paul Hilfinger.
3030
3031 2003-03-29 Akim Demaille <akim@epita.fr>
3032
3033 * m4/error.m4: Do not put under dynamic conditions some code which
3034 expansion is under static control.
3035
3036 2003-03-29 Akim Demaille <akim@epita.fr>
3037
3038 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
3039
3040 2003-03-29 Akim Demaille <akim@epita.fr>
3041
3042 * doc/bison.texinfo (Strings are Destroyed): New.
3043
3044 2003-03-13 Paul Eggert <eggert@twinsun.com>
3045
3046 * .cvsignore: Add configure.lineno.
3047 * src/.cvsignore: Add yacc.
3048 * tests/.cvsignore: Add testsuite.log.
3049 * doc/fdl.texi: Sync with latest FSF version.
3050
3051 2003-03-12 Paul Eggert <eggert@twinsun.com>
3052
3053 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
3054 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
3055 cursor, instead of leaving it undefined. This fixes a bug
3056 reported by Tim Van Holder in
3057 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
3058 * tests/input.at (Torturing the Scanner): Test the scanner on
3059 an empty input file, which was Tim Van Holder's test case.
3060
3061 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
3062 <sys/resource.h> can be included, include sys/time.h and
3063 sys/times.h first, if available. This works around the SunOS
3064 4.1.4 porting bug reported by Bruce Becker in
3065 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
3066
3067 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
3068 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
3069 AC_HEADER_SYS_WAIT.
3070
3071 Merge changes from gnulib. This was prompted because the CVS
3072 snapshot didn't build on Solaris 7 due to strnlen problems.
3073
3074 These changes need to be merged back into gnulib:
3075 * lib/hash.c: Include <stdbool.h> unconditionally.
3076 * m4/onceonly.m4 (m4_quote): New macro.
3077 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
3078 Quote AC_FOREACH variable-expansions properly.
3079 The 2003-01-03 obstack.h change also needs merging.
3080 {end of changes requiring merging}
3081
3082 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
3083 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
3084 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
3085 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
3086 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
3087 New files, imported from gnulib.
3088 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
3089 above.
3090
3091 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
3092 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
3093 gnulib sources.
3094
3095 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
3096 Add.
3097 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
3098 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
3099 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
3100 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
3101 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
3102 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
3103 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
3104 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
3105 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
3106 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
3107 (jm_PREREQ_ARGMATCH): Remove.
3108 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
3109 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
3110
3111 * src/system.h: Include <stdbool.h> unconditionally.
3112
3113 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
3114 assuming at least C89 in the bitset code for some time now.
3115
3116 2003-03-03 Akim Demaille <akim@epita.fr>
3117
3118 * ro.po: New.
3119
3120 2003-03-02 Akim Demaille <akim@epita.fr>
3121
3122 * doc/bison.texinfo (Table of Symbols): Reactivate the
3123 documentation for %lex-param, and %parse-param.
3124
3125 2003-03-02 Akim Demaille <akim@epita.fr>
3126
3127 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
3128 generate verbose error messages.
3129 Use the number of tokens as an upper bound in yytname, as it
3130 cannot be a non terminal.
3131
3132 2003-03-02 Akim Demaille <akim@epita.fr>
3133
3134 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
3135 message.
3136
3137 2003-03-02 Akim Demaille <akim@epita.fr>
3138
3139 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
3140 Use them to exercise yycheck overrun.
3141 Based on Andrew Suffield's grammar.
3142
3143 2003-03-02 Akim Demaille <akim@epita.fr>
3144
3145 Create tests/local.at for Bison generic testing macros.
3146
3147 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
3148 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
3149 This new file.
3150 * tests/calc.at (AT_CHECK_CALC): Adjust.
3151 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
3152 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
3153 * tests/local.at: here.
3154 (AT_COMPILE_CXX): Tags the tests using it as c++.
3155 Ignore the test if CXX is not functional.
3156
3157 2003-03-01 Paul Eggert <eggert@twinsun.com>
3158
3159 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
3160 not loc->end, since loc->end might contain garbage and this leads
3161 to undefined behavior on some platforms.
3162 (id_loc, token_start): Use (IF_LINTed) initial values that do not
3163 depend on *loc, so that the reader doesn't give the the false
3164 impression that *loc is initialized.
3165 (<INITIAL>"%%"): Do not bother setting code_start, since its value
3166 does not survive the return.
3167
3168 2003-03-01 Akim Demaille <akim@epita.fr>
3169
3170 * src/scan-gram.l (code_start): Always initialize it when entering
3171 into yylex, as SC_EPILOGUE is activated *before* the corresponding
3172 yylex invocation. An alternative would be making it static, but
3173 then it starts with the second %%'s beginning, instead of its end.
3174
3175 2003-02-28 Paul Eggert <eggert@twinsun.com>
3176
3177 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
3178 around a UnixWare 7.1.1 porting bug reported by John Hughes in
3179 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
3180
3181 2003-02-26 Paul Eggert <eggert@twinsun.com>
3182
3183 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
3184 Remove Sequent/Pyramid discussion (nobody uses them any more).
3185 Merge VMS and MS-DOS discussion; these ports may well be dead
3186 but let's keep mentioning them for now. Put <> around email
3187 addresses. Add copyright notice.
3188
3189 2003-02-24 Paul Eggert <eggert@twinsun.com>
3190
3191 * data/glr.c (yy_reduce_print): yylineno -> yylno,
3192 to avoid collision with flex use of yylineno.
3193 Problem reported by Bruce Lilly in
3194 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
3195 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
3196 * data/yacc.c (yy_reduce_print): Likewise.
3197
3198 * config/depcomp: Sync with Automake 1.7.3.
3199
3200 2003-02-21 Akim Demaille <akim@epita.fr>
3201
3202 * data/lalr1.cc: Use temporary variables instead of casts to
3203 change integer types.
3204 Suggested by Paul Eggert.
3205
3206 2003-02-21 Akim Demaille <akim@epita.fr>
3207
3208 * doc/bison.texinfo: Use "location" consistently to refer to @n,
3209 to avoid confusions with lalr1.cc's notion of Position.
3210 Suggested by Paul Eggert.
3211
3212 2003-02-20 Akim Demaille <akim@epita.fr>
3213
3214 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
3215 before initial_columns.
3216 (location.hh): Use consistent variable names when defining the
3217 operator<<.
3218 Use "last" so that we subtract from Positions, not from unsigned.
3219
3220 2003-02-20 Akim Demaille <akim@epita.fr>
3221
3222 * data/lalr1.cc (position.hh): New subfile, including the extended
3223 and Doxygen'ed documentation of class Position.
3224 (location.hh): Use it.
3225 Document a` la Doxygen.
3226 With the help of Benoit Perrot.
3227
3228 2003-02-20 Akim Demaille <akim@epita.fr>
3229
3230 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
3231 AT_YACC_IF.
3232 Redefine AT_YYERROR_SEES_LOC_IF using it.
3233 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
3234 not defined.
3235 Don't use the location in yy::Parser::error_ and
3236 yy::Parser::print_ when not %locations.
3237 Activate more lalr1.cc tests.
3238
3239 2003-02-19 Akim Demaille <akim@epita.fr>
3240
3241 * data/lalr1.cc: When displaying a line number, be sure to make it
3242 an int.
3243
3244 2003-02-19 Akim Demaille <akim@epita.fr>
3245
3246 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
3247 Remove, useless.
3248 (YYABORT, YYACCEPT, YYERROR): New.
3249 * tests/calc.at: Renable the lalr1.cc test.
3250
3251 2003-02-19 Akim Demaille <akim@epita.fr>
3252
3253 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
3254 error recovery, mixing with/without pops and discarding of the
3255 lookahead.
3256 Exercise YYERROR.
3257 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
3258
3259 2003-02-17 Paul Eggert <eggert@twinsun.com>
3260
3261 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
3262 * tests/testsuite.at (AT_COMPILE): Use them.
3263 This fixes the testsuite problem reported by Robert Lentz in
3264 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
3265
3266 2003-02-12 Paul Eggert <eggert@twinsun.com>
3267
3268 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
3269 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
3270 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
3271 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
3272 Check for malloc failure, for consistency with yacc.c.
3273 (yytname_size): Remove, for consistency with yacc.c.
3274
3275 The bug still remains in data/lalr1.cc, as I didn't have time
3276 to fix it there.
3277
3278 2003-02-06 Akim Demaille <akim@epita.fr>
3279
3280 * configure.ac (GXX): Rename as...
3281 (CXX): this, to keep the original Autoconf semantics.
3282 Require 2.57.
3283 * data/lalr1.cc: Fix b4_copyright invocations.
3284 If YYDEBUG is not defined, don't depend upon name_ being defined.
3285 (location.hh): Include string and iostream.
3286 (Position::filename): New member.
3287 (Position::Position ()): New.
3288 (operator<< (Position)): New.
3289 (operator- (Position, int)): New.
3290 (Location::first, Location::last): Rename as...
3291 (Location::begin, Location::end): these, to mock the conventional
3292 iterator names.
3293 (operator<< (Location)): New.
3294 * tests/atlocal.in (CXX): New.
3295 * tests/testsuite.at (AT_COMPILE_CXX): New.
3296 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
3297 locations in a more synthetic way.
3298 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
3299 lalr1.cc is used.
3300 Adjust the C locations to match those from Emacs: first column is
3301 column 0.
3302 Change all the expected results.
3303 Conform to the GCS: simplify the locations when applicable.
3304 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
3305 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
3306 these CPP macros with the m4 macros new defined by...
3307 (AT_CHECK_PUSHDEFS): this, i.e.:
3308 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
3309 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
3310 New macros.
3311 (AT_CHECK_POPDEFS): Undefine them.
3312 (AT_CHECK_CALC_LALR1_CC): New.
3313 Use it for the first lalr1.cc test.
3314
3315 2003-02-04 Akim Demaille <akim@epita.fr>
3316
3317 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
3318 Location as is defined.
3319
3320 2003-02-04 Akim Demaille <akim@epita.fr>
3321
3322 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
3323 name_ being defined.
3324
3325 2003-02-03 Paul Eggert <eggert@twinsun.com>
3326
3327 * src/gram.h (start_symbol): Remove unused decl.
3328
3329 Use more-consistent naming conventions for local vars.
3330
3331 * src/derives.c (derives_compute): Change type of local var from
3332 int to rule_number.
3333 * src/gram.c (grammar_rules_partial_print): Likewise.
3334 * src/print.c (print_core): Likewise.
3335 * src/reduce.c (reduce_grammar_tables): Likewise.
3336
3337 * src/gram.c (grammar_dump): Change name of item_number *
3338 local var from r to rp.
3339 * src/nullable.c (nullable_compute): Likewise.
3340
3341 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
3342
3343 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
3344 for symbol or symbol_number var.
3345 * src/reader.c (grammar_start_symbol_set): Likewise.
3346 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
3347 Likewise.
3348 * src/state.c (transitions_to): Likewise.
3349 * src/state.h: Likewise.
3350 * src/tables.c (symbol_number_to_vector_number): Likewise.
3351
3352 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
3353 char * var.
3354
3355 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
3356 var.
3357
3358 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
3359 var.
3360
3361 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
3362 Use str, not s, for char * var. Use ch, not c, for character var.
3363 Use size for size var.
3364
3365 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
3366 char * var.
3367 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
3368 uniqstr var.
3369 * src/uniqstr.h: Likewise.
3370
3371 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
3372 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
3373 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
3374 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
3375 param to have same name as that of enum, so that we don't use
3376 "s" to stand for a non-state.
3377
3378 2003-02-02 Akim Demaille <akim@epita.fr>
3379
3380 * src/scan-skel.l: Scan more than one inert character per yylex
3381 invocation.
3382
3383 2003-02-01 Paul Eggert <eggert@twinsun.com>
3384
3385 Version 1.875a.
3386
3387 * po/LINGUAS: Add ms.
3388
3389 2003-01-30 Akim Demaille <akim@epita.fr>
3390
3391 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
3392
3393 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3394
3395 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
3396 of $1.
3397
3398 Changes in response to error report by S. Eken: GLR mode does not
3399 handle negative $ indices or $ indices in embedded rules correctly.
3400 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
3401
3402 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
3403 (b4_rhs_location): Ditto.
3404 (yyfill): New function to copy from stack tree into array
3405 incrementally.
3406 (yyuserAction): Modify to allow incremental move of semantic values
3407 to rhs array when in GLR mode.
3408 Define YYFILL to use in user-defined actions to fill semantic array
3409 as needed.
3410 Remove dummy use of yystack, as there is now a guaranteed use.
3411 (yydoAction): Modify to allow incremental move of semantic values
3412 to rhs array when in GLR mode.
3413 (yyresolveAction): Ditto.
3414 (yyglrShiftDefer): Update comment.
3415 (yyresolveStates): Use X == NULL for pointers, not !X.
3416 (yyglrReduce): Ditto.
3417 (yydoAction): Ditto
3418
3419 * tests/glr-regr1.at: Rename to ...
3420 * tests/glr-regression.at: Add new regression test for the problems
3421 described above (adapted from S. Eken).
3422 Update copyright notice.
3423 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
3424 * tests/Makefile.am: Ditto.
3425
3426 2003-01-28 Paul Eggert <eggert@twinsun.com>
3427
3428 * data/lalr1.cc: Do not use @output_header_name@ unless
3429 b4_defines_flag is set. This fixes two bugs reported by
3430 Tim Van Holder in
3431 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
3432 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
3433
3434 2003-01-21 Paul Eggert <eggert@twinsun.com>
3435
3436 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
3437 we don't need to worry about yyerrlab1 being reported as an
3438 "unused label" by non-GCC C compilers. The downside is that if
3439 locations are used then a couple of statements are duplicated each
3440 time YYERROR is invoked, but the upside is that the warnings
3441 should vanish.
3442 (yyerrlab1): Move code to YERROR.
3443 (yyerrlab2): Remove. Change uses back to yyerrlab1.
3444 This reverts some of the 2002-12-27 change.
3445
3446 2003-01-17 Paul Eggert <eggert@twinsun.com>
3447
3448 * src/output.c (symbol_printers_output): Fix typo that led
3449 to core dump. Problem reported by Antonio Rus in
3450 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
3451
3452 2003-01-13 Akim Demaille <akim@epita.fr>,
3453 Quoc Peyrot <chojin@lrde.epita.fr>,
3454 Robert Anisko <anisko_r@lrde.epita.fr>
3455
3456 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
3457 when the stacks contain one element, as the loop would otherwise
3458 free the last state, and then use the top state (the one we just
3459 popped). This means that the initial elements will not be freed
3460 explicitly, as is the case in yacc.c; it is not a problem, as
3461 these elements have fake values.
3462
3463 2003-01-11 Paul Eggert <eggert@twinsun.com>
3464
3465 * NEWS: %expect-violations are now just warnings, reverting
3466 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
3467 bootstrapping problem reported by Matthias Klose; see
3468 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
3469 * src/conflicts.c (conflicts_print): Likewise.
3470 * tests/conflicts.at (%expect not enough, %expect too much,
3471 %expect with reduce conflicts): Likewise.
3472 * doc/bison.texinfo (Expect Decl): Document this. Also mention
3473 that the warning is enabled if the number of conflicts changes
3474 (not necessarily increases).
3475
3476 * src/getargs.c (version): Update copyright year.
3477
3478 2003-01-09 Akim Demaille <akim@epita.fr>
3479
3480 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
3481
3482 2003-01-08 Paul Eggert <eggert@twinsun.com>
3483
3484 * Makefile.maint (WGETFLAGS):
3485 New macro, containing "-C off" to disable proxy caches.
3486 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
3487 (rel-check): Use $(WGET) instead of wget.
3488
3489 2003-01-06 Paul Eggert <eggert@twinsun.com>
3490
3491 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
3492 the GLR paper of Scott, Johnstone and Hussain.
3493
3494 2003-01-04 Paul Eggert <eggert@twinsun.com>
3495
3496 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
3497 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
3498 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
3499 (EXTRA_LIBRARIES): New var, for liby.a.
3500 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
3501 (EXTRA_SCRIPTS): New var, for yacc.
3502
3503 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
3504 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
3505 Problem reported by Nelson H. F. Beebe.
3506
3507 2003-01-03 Paul Eggert <eggert@twinsun.com>
3508
3509 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
3510 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
3511 when compiling Bison 1.875's `bitset bset = obstack_alloc
3512 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
3513
3514 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
3515 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
3516 grow to a huge size with typical invocation.
3517
3518 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
3519 Use the pattern recommended by Autoconf 2.57, except also protect
3520 against double-definition.
3521 * src/system.h: Likewise.
3522 Portability issues reported by Nelson H. F. Beebe.
3523
3524 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
3525 All uses changed. Provide a definition in both C and C++.
3526 (yytrue, yyfalse): Define even if defined (__cplusplus).
3527
3528 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
3529 Reported by Nelson H. F. Beebe.
3530
3531 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
3532
3533 2003-01-02 Paul Eggert <eggert@twinsun.com>
3534
3535 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
3536 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
3537 Bug reported by Nelson H. F. Beebe.
3538
3539 2003-01-01 Paul Eggert <eggert@twinsun.com>
3540
3541 * Version 1.875.
3542
3543 2002-12-30 Paul Eggert <eggert@twinsun.com>
3544
3545 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
3546 Moved here from...
3547 (<INITIAL>","): Here. This causes stray "," to be treated
3548 more uniformly.
3549
3550 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
3551 last brace in braced code when not in Yacc mode, for compatibility
3552 with Bison 1.35. This resurrects the 2001-12-15 patch to
3553 src/reader.c.
3554
3555 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
3556 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
3557
3558 2002-12-28 Paul Eggert <eggert@twinsun.com>
3559
3560 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
3561 that of SYM's type. This fixes Debian bug 168069, reported by
3562 Thomas Olsson.
3563
3564 2002-12-28 Paul Eggert <eggert@twinsun.com>
3565
3566 Version 1.75f.
3567
3568 Switch back to the Yacc style of conflict reports, undoing some
3569 of the 2002-07-30 change.
3570 * doc/bison.texinfo (Understanding): Use Yacc style for
3571 conflict reports. Also, use new way of locating rules.
3572 * src/conflicts.c (conflict_report):
3573 Renamed from conflict_report_yacc, removing the old
3574 'conflict_report'. Translate the entire conflict report at once,
3575 so that we don't assume that "," has the same interpretation in
3576 all languages.
3577 (conflicts_output): Use Yacc-style conflict report for each state,
3578 instead of our more-complicated style.
3579 (conflicts_print): Use Yacc-style conflict report, except print
3580 the input file name when not emulating Yacc.
3581 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
3582 Conflicted Reduction, %expect not enough, %expect too much,
3583 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
3584 * tests/existing.at (GNU Cim Grammar): Likewise.
3585 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
3586
3587 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
3588 fatal): Don't invoke fflush; it's not needed and it might even be
3589 harmful for stdout, as stdout might not be open.
3590 * src/reduce.c (reduce_print): Likewise.
3591
3592 2002-12-27 Paul Eggert <eggert@twinsun.com>
3593
3594 Fix a bug where error locations were not being recorded correctly.
3595 This problem was originally reported by Paul Hilfinger in
3596 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
3597
3598 * data/yacc.c (yyparse): New local var yylerrsp, to record the
3599 top of the location stack's error locations.
3600 (yyerrlab): Set it. When discarding a token, push its location
3601 onto yylerrsp so that we don't lose track of the error's end.
3602 (yyerrlab1): Now is only the target of YYERROR, so that we can
3603 properly record the location of the action that failed. For GCC
3604 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
3605 GCC warning about yyerrlab1 being unused if YYERROR is unused.
3606 (yyerrlab2): New label, which yyerrlab now falls through to.
3607 Compute the error's location by applying YYLLOC_DEFAULT to
3608 the locations of all the symbols that went into the error.
3609 * doc/bison.texinfo (Location Default Action): Mention that
3610 YYLLOC_DEFAULT is also invoked for syntax errors.
3611 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
3612 Error locations include the locations of all the tokens that were
3613 discarded, not just the last token.
3614
3615 2002-12-26 Paul Eggert <eggert@twinsun.com>
3616
3617 * src/files.c: Include quote.h.
3618 (compute_output_file_names): Warn if we detect conflicting
3619 outputs to the same file. This should catch the misunderstanding
3620 exemplified by Debian Bug 165349, reported by Bruce Stephens..
3621
3622 * src/conflicts.c (conflicts_print): If the user specifies
3623 "%expect N", report an error if there are any reduce/reduce
3624 conflicts. This is what the manual says should happen.
3625 This fixes Debian bug 130890, reported by Anthony DeRobertis.
3626 * tests/conflicts.at (%expect with reduce conflicts): New test.
3627
3628 Don't use m4_include on relative file names, as it doesn't work as
3629 desired if there happens to be a file with that name under ".".
3630
3631 * m4sugar/version.m4: Remove; it was included but it wasn't used.
3632 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
3633 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
3634 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
3635 * src/output.c (output_skeleton): Use full path names when
3636 specifying a file to include; don't rely on include path, as
3637 it's unreliable when the working file contains a file with
3638 that name.
3639
3640 2002-12-25 Paul Eggert <eggert@twinsun.com>
3641
3642 Remove obsolete references to bison.simple and bison.hairy.
3643 Problem mentioned by Aubin Mahe in
3644 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
3645 * data/glr.c: Comment fix.
3646 * doc/bison.1: Remove references. Also, mention "yacc".
3647
3648 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
3649 with -g option.
3650
3651 * src/parse-gram.y (declaration): Use enum "report_states" rather
3652 than its numeric value 1.
3653
3654 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
3655 opening a new one. This fixes Debian bug 165349, reported by
3656 Bruce Stephens.
3657
3658 2002-12-24 Paul Eggert <eggert@twinsun.com>
3659
3660 Version 1.75e.
3661
3662 * Makefile.maint (cvs-update): Don't assume that the shell
3663 supports $(...), as Solaris sh doesn't.
3664
3665 * src/parse-gram.y (lloc_default): Remove test for empty
3666 nonterminals at the end, since it didn't change the result.
3667
3668 2002-12-24 Paul Eggert <eggert@twinsun.com>
3669
3670 If the user does not define YYSTYPE as a macro, Bison now declares it
3671 using typedef instead of defining it as a macro. POSIX requires this.
3672 For consistency, YYLTYPE is also declared instead of defined.
3673
3674 %union directives can now have a tag before the `{', e.g., the
3675 directive `%union foo {...}' now generates the C code
3676 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
3677 The default union tag is `YYSTYPE', for compatibility with Solaris 9
3678 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
3679 instead of `yyltype'.
3680
3681 `yystype' and `yyltype' are now obsolescent macros instead of being
3682 typedefs or tags; they are no longer documented and will be
3683 withdrawn in a future release.
3684
3685 * data/glr.c (b4_location_type): Remove.
3686 (YYSTYPE): Renamed from yystype.
3687 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
3688 (struct YYLTYPE): Renamed from struct yyltype.
3689 (YYLTYPE): Renamed from yyltype.
3690 (yyltype, yystype): New (and obsolescent) macros,
3691 for backward compatibility.
3692 * data/yacc.c: Likewise.
3693
3694 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
3695 does not specify a union tag. This is for compatibility with
3696 Solaris 9 yacc.
3697
3698 * src/parse-gram.y (add_param): 2nd arg is now char * not char
3699 const *, since it is now modified by stripping surrounding { }.
3700 (current_braced_code): Remove.
3701 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
3702 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
3703 trailing " {...}". Now of type <chars>.
3704 (grammar_declaration): Adjust to bundled tokens.
3705 (code_content): Remove; stripping is now done by add_param.
3706 (print_token_value): Print contents of bundled tokens.
3707 (token_name): New function.
3708
3709 * src/reader.h (braced_code, current_braced_code): Remove.
3710 (token_name): New decl.
3711
3712 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
3713 token_type, not braced_code code_kind. All uses changed.
3714 (SC_PRE_CODE): New state, for scanning after a keyword that
3715 has (or usually has) an immediately-following braced code.
3716 (token_type): New local var, to keep track of which token type
3717 to return when scanning braced code.
3718 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
3719 <INITIAL>"%parse-param", <INITIAL>"%printer",
3720 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
3721 instead of returning a token type immediately.
3722 (<INITIAL>"{"): Set token type.
3723 (<SC_BRACED_CODE>"}"): Use it.
3724 (handle_action_dollar, handle_action_at): Now returns bool
3725 indicating success. Fail if ! current_rule; this prevents a core dump.
3726 (handle_symbol_code_dollar, handle_symbol_code_at):
3727 Remove; merge body into caller.
3728 (handle_dollar, handle_at): Complain in invalid contexts.
3729
3730 * NEWS, doc/bison.texinfo: Document the above.
3731 * NEWS: Fix years and program names in copyright notice.
3732
3733 2002-12-17 Paul Eggert <eggert@twinsun.com>
3734
3735 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
3736 Reporting, Table of Symbols): Omit mentions of %lex-param and
3737 %parse-param from the documentation for now.
3738
3739 2002-12-15 Paul Eggert <eggert@twinsun.com>
3740
3741 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
3742 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
3743 lookahead symbol, and which sets yychar in parser actions) and it
3744 disagreed with the Bison documentation. Bug
3745 reported by Andrew Walrond.
3746
3747 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
3748 as the caller now does that.
3749 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
3750 (YYEMPTY): Parenthesize right hand side, since others use it.
3751 (yyparse): Don't assume that our generated code is the only code
3752 that sets yychar.
3753
3754 2002-12-13 Paul Eggert <eggert@twinsun.com>
3755
3756 Version 1.75d.
3757
3758 POSIX requires a "yacc" command.
3759 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
3760 (MOSTLYCLEANFILES): Add yacc.
3761 (yacc): New rule.
3762 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
3763 as an alias for bison y.
3764
3765 * po/LINGUAS: Add da.
3766
3767 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
3768 problem with latest <getopt.h>.
3769 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
3770
3771 * doc/fdl.texi: Upgrade to 1.2.
3772 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
3773 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
3774 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
3775 gnulib.
3776 * config/install-sh: Sync with autotools.
3777
3778 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
3779 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
3780 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
3781 locations are requested.
3782 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
3783 locations are requested.
3784
3785 2002-12-12 Paul Eggert <eggert@twinsun.com>
3786
3787 Remove unportable casts and storage allocation tricks.
3788 While we're at it, remove almost all casts, since they
3789 usually aren't needed and are a sign of trouble.
3790
3791 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
3792
3793 * src/derives.c (derives_compute): Do not subtract NTOKENS from
3794 the pointer DSET returned by malloc; this isn't portable.
3795 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
3796 Similarly for DERIVES.
3797 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
3798 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
3799 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
3800
3801 * src/derives.c (derives_compute): Do not bother invoking
3802 int_of_rule_number, since rule numbers are integers.
3803
3804 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
3805 rather than XMALLOC (char, N).
3806
3807 * src/files.c (filename_split): Rewrite to avoid cast.
3808
3809 * src/gram.h (symbol_number_as_item_number,
3810 item_number_as_symbol_number, rule_number_as_item_number,
3811 item_number_as_rule_number):
3812 Now inline functions rather than macros, to avoid casts.
3813 * src/state.h (state_number_as_int): Likewise.
3814 * src/tables.c (state_number_to_vector_number,
3815 symbol_number_to_vector_number): Likewise.
3816
3817 * src/gram.h (int_of_rule_number): Remove; no longer used.
3818
3819 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
3820 since the resulting storage is always stored into.
3821
3822 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
3823 where it's needed.
3824
3825 * src/muscle_tab.c (muscle_m4_output):
3826 Now inline. Return bool, not int.
3827 * src/state.c (state_compare): Likewise.
3828 * src/symtab.c (symbol_check_defined,
3829 symbol_check_alias_consistency, symbol_pack, symbol_translation,
3830 hash_compare_symbol, hash_symbol):
3831 Likewise.
3832 * src/uniqstr.c (uniqstr_print): Likewise.
3833 * src/muscle_tab.c (muscle_m4_output_processor):
3834 New function, to avoid casts.
3835 * src/state.c (state_comparator, stage_hasher): Likewise.
3836 * src/symtab.c (symbol_check_defined_processor,
3837 symbol_check_alias_consistency_processor, symbol_pack_processor,
3838 symbol_translation_processor, hash_symbol_comparator,
3839 hash_symbol_hasher): Likewise.
3840 * src/uniqstr.c (uniqstr_print_processor): Likewise.
3841 * src/muscle_tab.c (muscles_m4_output):
3842 Use new functions instead of casting old functions unportably.
3843 * src/state.c (state_hash_new): Likewise.
3844 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
3845 symbols_token_translations_init):
3846 Likewise.
3847 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
3848
3849 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
3850 var instead of casting to long, to avoid casts.
3851 (prepare_states): Use MALLOC rather than alloca, so that we don't
3852 have to worry about alloca.
3853 * src/state.c (state_hash_lookup): Likewise.
3854
3855 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
3856 local var instead of casting to unsigned char, to avoid casts.
3857
3858 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
3859 STATE_ALLOC): Remove.
3860 (transitions_new, errs_new, reductions_new, state_new): Use malloc
3861 rather than calloc, and use offsetof to avoid allocating slightly
3862 too much storage.
3863 (state_new): Initialize all members.
3864
3865 * src/state.c (state_hash): Use unsigned accumulator, not signed.
3866
3867 * src/symtab.c (symbol_free): Remove; unused.
3868 (symbol_get): Remove cast in lhs of assignment.
3869 (symbols_do): Now static. Accept generic arguments, not
3870 hashing-related ones.
3871
3872 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
3873 (symbol_processor): Remove.
3874 (symbols_do): Remove decl; now static.
3875
3876 * src/system.h (alloca): Remove; decl no longer needed.
3877 (<stddef.h>): Include, for offsetof.
3878 (<inttypes.>, <stdint.h>): Include if available.
3879 (uintptr_t): New type, if system lacks it.
3880 (CALLOC, MALLOC, REALLOC): New macros.
3881 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
3882 new macros.
3883
3884 * src/tables.c (table_size): Now int, to pacify GCC.
3885 (table_grow, table_ninf_remap): Use signed table size.
3886 (save_row): Don't bother initializing locals when not needed.
3887 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
3888 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
3889
3890 * src/vcg.h: Correct misspellings.
3891
3892 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
3893
3894
3895 * src/getargs.c (getargs): Don't assume EOF == -1.
3896
3897 2002-12-09 Paul Eggert <eggert@twinsun.com>
3898
3899 Change identifier spellings to avoid collisions with names
3900 that are reserved by POSIX.
3901
3902 Don't use names ending in _t, since POSIX reserves them.
3903 For consistency, remove _e and _s endings -- they're weren't
3904 needed to remove ambiguity. All uses changed.
3905 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
3906 turn was just renamed from struniq_t.
3907 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
3908 which in turn was just renamed from struniq_processor_t.
3909 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
3910 in turn was renamed from hash_compare_struniq_t.
3911 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
3912 (state_list): Renamed from state_list_t.
3913 * src/assoc.h (assoc): Renamed from assoc_t.
3914 * src/conflicts.c (enum conflict_resolution): Renamed from
3915 enum conflict_resolution_e.
3916 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
3917 (rule_list): Renamed from rule_list_t.
3918 * src/getargs.h (enum trace): Renamed from enum trace_e.
3919 (enum report): Renamed from enum report_e.
3920 * src/gram.h (item_number): Renamed from item_number_t.
3921 (rule_number): Renamed from rule_number_t.
3922 (struct rule_s): Remove the "rule_s" part; not used.
3923 (rule): Renamed from rule_t.
3924 (rule_filter): Renamed from rule_filter_t.
3925 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
3926 (goto_list): Renamed from goto_list_t.
3927 * src/lalr.h (goto_number): Renamed from goto_number_t.
3928 * src/location.h (location): Renamed from location_t.
3929 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
3930 and moved here from:
3931 * src/muscle_tab.h (muscle_entry_t): here.
3932 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
3933 (rule_list): Renamed from rule_list_t.
3934 * src/print_graph.c (static_graph): Renamed from graph.
3935 * src/reader.h (braced_code): Renamed from braced_code_t.
3936 Remove brace_code_e tag.
3937 * src/relation.h (relation_node): Renamed from relation_node_t.
3938 (relation_nodes): Renamed from relation_nodes_t.
3939 (relation): Renamed from relation_t.
3940 * src/state.h (state_number): Renamed from state_number_t.
3941 (struct state): Renamed from struct state_s.
3942 (state): Renamed from state_t.
3943 (transitions): Renamed from transitions_t. Unused (and
3944 misspelled) transtion_s tag removed.
3945 (errs): Renamed from errs_t. Unused errs_s tag removed.
3946 (reductions): Renamed from reductions_t. Unused tag
3947 reductions_s removed.
3948 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
3949 (struct symbol_list): Renamed from struct symbol_list_s.
3950 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
3951 (struct symbol): Renamed from struct symbol_s.
3952 (symbol): Renamed from symbol_t.
3953 * src/tables.c (vector_number): Renamed from vector_number_t.
3954 (action_number): Renamed from action_t.
3955 * src/tables.h (base_number): Renamed from base_t.
3956 * src/vcg.h (enum color): Renamed from enum color_e.
3957 (enum textmode): Renamed from enum textmode_e.
3958 (enum shape): Renamed from enum shape_e.
3959 (struct colorentry): Renamed from struct colorentry_s.
3960 (struct classname): Renamed from struct classname_s.
3961 (struct infoname): Renamed from struct infoname_s.
3962 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
3963 (enum decision): Renamed from enum decision_e.
3964 (enum orientation): Renamed from enum orientation_e.
3965 (enum alignment): Renamed from enum alignment_e.
3966 (enum arrow_mode): Renamed from enum arrow_mode_e.
3967 (enum crossing_type): Renamed from enum crossing_type_e.
3968 (enum view): Renamed from enum view_e.
3969 (struct node): Renamed from struct node_s.
3970 (node): Renamed from node_t.
3971 (enum linestyle): Renamed from enum linestyle_e.
3972 (enum arrowstyle): Renamed from enum arrowstyle_e.
3973 (struct edge): Renamed from struct edge.
3974 (edge): Renamed from edge_t.
3975 (struct graph): Renamed from struct graph_s.
3976 (graph): Renamed from graph_t.
3977 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
3978 Rename value_t -> value.
3979 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
3980 value_t_as_yystype -> value_as_yystype.
3981
3982 Don't include <errno.h> in the mainstream code, since it
3983 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
3984 * lib/get-errno.c, lib/get-errno.h: New files.
3985 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
3986 get-errno.c.
3987 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
3988 * src/output.c (output_skeleton): Likewise.
3989 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
3990 instead of errno.
3991 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
3992 Likewise.
3993 (handle_action_dollar, handle_action_at): Likewise.
3994 * src/system.h: Do not include <errno.h>.
3995 (TAB_EXT): Renamed from EXT_TAB.
3996 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
3997
3998 Avoid str[a-z]*, since <string.h> reserves that name space.
3999 Change all instances of "struniq" in names to "uniqstr", and
4000 likewise for "STRUNIQ" and "UNIQSTR".
4001 * src/uniqstr.c: Renamed from src/struniq.c.
4002 * src/uniqstr.h: Renamed from src/struniq.h.
4003 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
4004 * src/files.c (strsuffix): Remove; unused.
4005 (concat2): Renamed from stringappend. Now static.
4006 * src/files.h (strsuffix, stringappend): Remove; unused.
4007 * src/parse-gram.y (<chars>): Renamed from <string>.
4008 (<uniqstr>): Renamed from <struniq>.
4009 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
4010 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
4011 (struct graph_s.expand): Renamed from struct graph_s.stretch.
4012 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
4013 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
4014 (N_EXPAND): Renamed from N_STRETCH.
4015
4016 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
4017 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
4018 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
4019 Remove; unused.
4020 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
4021 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
4022 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
4023 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
4024 (BASE_MAXIMUM): Renamed from BASE_MAX.
4025 (BASE_MINIMUM): Renamed from BASE_MIN.
4026 (ACTION_MAX): Remove; unused.
4027 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
4028 Unnecessary casts removed from above defines.
4029
4030
4031 Fix misspelling in names.
4032 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
4033 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
4034 G_NODE_ALIGNEMENT.
4035
4036
4037 * lib/timevar.c (timevar_report): Renamed from time_report,
4038 for consistency with other names.
4039 * lib/timevar.h (timevar_report): New decl.
4040 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
4041
4042
4043 Sort include-file uses.
4044
4045 Reorder all include files under src to be in the order "system.h".
4046 then the ../lib include files in angle brackets (alphabetized),
4047 then the . include files in double-quotes (alphabetized). Fix
4048 dependency breakages encountered in this process, as follows:
4049 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
4050 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
4051 * src/state.h: Include "symtab.h".
4052
4053 2002-12-08 Paul Eggert <eggert@twinsun.com>
4054
4055 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
4056 since this causes problems when __file__ contains character
4057 sequences like "@" that are treated specially by src/scan-skel.l.
4058 Instead, just use the file's basename. This fixes the bug
4059 reported by Martin Mokrejs in
4060 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
4061
4062 2002-12-06 Paul Eggert <eggert@twinsun.com>
4063
4064 Add support for rules that do not have trailing semicolons, as
4065 POSIX requires. Improve the quality of locations in Bison
4066 diagnostics.
4067
4068 * src/location.c: Include <quotearg.h>.
4069 (empty_location): Now const.
4070 (location_print): New function. Follow the recommendation of the
4071 GNU Coding Standards for locations that span file boundaries.
4072 * src/location.h: Do not include <quotearg.h>; no longer needed.
4073 (boundary): New type.
4074 (location_t): Use it. This allows locations to span file boundaries.
4075 All member uses changed: file -> start.file or end.file (as needed),
4076 first_line -> start.line, first_column -> start.column,
4077 last_line -> end.line, last_column -> end.column.
4078 (equal_boundaries): New function.
4079 (LOCATION_RESET, LOCATION_STEP): Remove.
4080 (LOCATION_PRINT): Remove. All callers changed to use location_print.
4081 (empty_location): Now const.
4082 (location_print): New decl.
4083 * src/parse-gram.y (lloc_default): New function, which handles
4084 empty locations more accurately.
4085 (YYLLOC_DEFAULT): Use it.
4086 (%token COLON): Remove.
4087 (%token ID_COLON): New token.
4088 (rules): Use it.
4089 (declarations, rules): Remove trailing semicolon.
4090 (declaration, rules_or_grammar_declaration):
4091 Allow empty (";") declaration.
4092 (symbol_def): Remove empty actions; no longer needed.
4093 (rules_or_grammar_declaration): Remove trailing semicolon.
4094 (semi_colon.opt): Remove.
4095 * src/reader.h: Include location.h.
4096 (scanner_cursor): New decl.
4097 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
4098 rolling our own.
4099 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
4100 of *loc.
4101 (STEP): Remove. No longer needed, now that adjust_location does
4102 the work. All uses removed.
4103 (scanner_cursor): New var.
4104 (adjust_location): Renamed from extend_location. It now sets
4105 *loc and adjusts the scanner cursor. All uses changed.
4106 Don't bother testing for CR.
4107 (handle_syncline): Remove location arg; now updates scanner cursor.
4108 All callers changed.
4109 (unexpected_end_of_file): Now accepts start boundary of token or
4110 comment, not location. All callers changed. Update scanner cursor,
4111 not the location.
4112 (SC_AFTER_IDENTIFIER): New state.
4113 (context_state): Renamed from c_context. All uses changed.
4114 (id_loc, code_start, token_start): New local vars.
4115 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
4116 processing of Yacc white space and equivalents here.
4117 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
4118 instead of returning ID immediately, since we need to search for
4119 a subsequent colon.
4120 (<INITIAL>"'", "\""): Save token_start.
4121 (<INITIAL>"%{", "{", "%%"): Save code_start.
4122 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
4123 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
4124 BEGIN context_state at end, not INITIAL.
4125 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
4126 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
4127 Return correct token start.
4128 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
4129 the start of a character, string or multiline comment is found.
4130 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
4131 Reduction): Adjust reported locations to match the more-precise
4132 results now expected.
4133 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
4134 * tests/reduce.at (Useless Rules, Reduced Automaton,
4135 Underivable Rules): Likewise.
4136 * tests/regression.at (Invalid inputs): No longer `expecting ";"
4137 or "|"' now that so many other tokens are allowed by the new grammar.
4138
4139 * src/complain.h (current_file): Remove duplicate decl;
4140 current_file is now owned by files.h.
4141 * src/complain.c, src/scan-gram.l: Include files.h.
4142
4143 2002-12-06 Paul Eggert <eggert@twinsun.com>
4144
4145 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
4146 promotes to int; it might be unsigned int.
4147 * data/yacc.c (yy_reduce_print): Likewise.
4148
4149 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
4150 be #defined in the prologue, not in the Bison declarations.
4151 This fixes Debian Bug 102878, reported by Shaul Karl.
4152
4153 2002-12-02 Paul Eggert <eggert@twinsun.com>
4154
4155 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
4156 * lib/strtoul.c: New file, from gnulib.
4157 This fixes a porting bug reported by Peter Klein in
4158 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
4159
4160 2002-11-30 Paul Eggert <eggert@twinsun.com>
4161
4162 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
4163 and put only a forward declaration in the prologue. This is for
4164 consistency with the other scanner helper functions.
4165
4166 Type clashes now generate warnings, not errors, since it
4167 appears that POSIX may allow some grammars with type clashes.
4168 * src/reader.c (grammar_current_rule_check): Warn about
4169 type clashes instead of complaining.
4170 * tests/input.at (Type Clashes): Expect warnings, not complaints.
4171
4172 Add Yacc library, since POSIX requires it.
4173 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
4174 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
4175 * lib/main.c, lib/yyerror.c: New files.
4176
4177 gram_error can be static; it need not be extern.
4178 * src/reader.h (gram_error): Remove decl.
4179 * src/parse-gram.y (gram_error): Now static. Add static decl.
4180 (print_token_value): Omit parameter names from forward decl,
4181 for consistency.
4182
4183 2002-11-29 Paul Eggert <eggert@twinsun.com>
4184
4185 * doc/bison.texinfo: Emphasize that yylex and yyerror must
4186 be declared before being used. E.g., one should typically
4187 declare them in the prologue. Use GNU coding style in examples.
4188 Put "const" consistently after the type it modifies. Mention
4189 that C99 supports "inline". Mention that yyerror traditionally
4190 returns "int".
4191
4192 %parse-param and %lex-param now take just one argument, the
4193 declaration; the argument name is deduced from the declaration.
4194
4195 * doc/bison.texinfo (Parser Function, Pure Calling, Error
4196 Reporting, Table of Symbols): Document this.
4197 * src/parse-gram.y (add_param): New function.
4198 (COMMA): Remove.
4199 (declaration): Implement new rule for %parse-param and %lex-param.
4200 * src/scan-gram.l: "," now elicits a warning, rather than being
4201 a token; this is more compatible with byacc.
4202 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
4203
4204 2002-11-27 Paul Eggert <eggert@twinsun.com>
4205
4206 Rename identifiers to avoid real and potential collisions.
4207
4208 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
4209 to avoid collision with lex macro described by Bruce Lilly in
4210 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
4211 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
4212 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
4213 * src/parse-gram.y (print_token_value): Renamed from yyprint.
4214 All uses changed.
4215 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
4216 The name "yycontrol" violates the name space rules, and this stuff
4217 wasn't being used anyway.
4218 (input): Remove action; this stuff wasn't being used.
4219 (gram_error): Rename local variable yylloc -> loc.
4220 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
4221 (YY_DECL): Don't use "yy" at start of local variables.
4222 All uses changed, e.g., yylloc -> loc.
4223 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
4224 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
4225 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
4226 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
4227
4228 * src/parse-gram.y (gram_error): loc is now const *.
4229 * src/reader.h (gram_error): Likewise.
4230
4231 2002-11-24 Paul Eggert <eggert@twinsun.com>
4232
4233 Version 1.75c.
4234
4235 * tests/actions.at (Actions after errors): Use an output format
4236 more similar to that of the Printers and Destructors test.
4237 Test the position of the ';' token too.
4238 (Printers and Destructors): Likewise.
4239 (Printers and Destructors: %glr-parser): Remove for now, to avoid
4240 unnecessarily alarming people when the test fails.
4241
4242 * data/yacc.c (yyerrlab1): Move this label down, so that the
4243 parser does not discard the lookahead token if the user code
4244 invokes YYERROR. This change is required for POSIX conformance.
4245
4246 * lib/error.c: Sync with gnulib.
4247
4248 2002-11-22 Paul Eggert <eggert@twinsun.com>
4249
4250 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
4251 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
4252 * lib/xmalloc.c: Likewise.
4253
4254 2002-11-20 Paul Eggert <eggert@twinsun.com>
4255
4256 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
4257
4258 2002-11-20 Paul Eggert <eggert@twinsun.com>
4259
4260 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
4261 should use `if (! x) abort ();' rather than `assert (x);', and
4262 anyway it's one less thing to worry about configuring.
4263
4264 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
4265 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
4266 and replace all instances of assert with abort.
4267 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4268 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
4269
4270 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
4271 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
4272 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
4273 hash_find_entry, hash_rehash, hash_insert): Likewise.
4274 * src/conflicts.c (resolve_sr_conflict): Likewise.
4275 * src/lalr.c (set_goto_map, map_goto): Likewise.
4276 * src/nullable.c (nullable_compute): Likewise.
4277 * src/output.c (prepare_rules, token_definitions_output): Likewise.
4278 * src/reader.c (packgram, reader): Likewise.
4279 * src/state.c (state_new, state_free, state_transitions_set,
4280 state_reduction_find): Likewise.
4281 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
4282 symbol_pack): Likewise.
4283 * src/tables.c (conflict_row, pack_vector): Likewise.
4284 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
4285 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
4286 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
4287 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
4288
4289 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
4290 (ARGMATCH_CONSTRAINT): New macro.
4291 (ARGMATCH_ASSERT): Use it.
4292
4293 * src/system.h (verify): New macro.
4294 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
4295 rather than assert.
4296 * src/tables.c (tables_generate): Likewise.
4297
4298 * src/struniq.c (struniq_assert): Now returns void, and aborts
4299 if the assertion is false.
4300 (struniq_assert_p): Remove.
4301 * src/struniq.h: Likewise.
4302
4303 2002-11-18 Paul Eggert <eggert@twinsun.com>
4304
4305 * data/glr.c (yygetLRActions): Replace `yyindex' with
4306 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
4307 This fixes the regression with Sun ONE Studio 7 cc that I reported in
4308 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
4309
4310 2002-11-18 Akim Demaille <akim@epita.fr>
4311
4312 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
4313 space.
4314 From Tim Van Holder.
4315
4316 2002-11-17 Paul Eggert <eggert@twinsun.com>
4317
4318 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
4319 to "SyntaxError" for consistency with my 2002-11-15 change.
4320
4321 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
4322 not define to {}, since this breaks the common use of `YYDPRINTF
4323 ((...));' if a single statement is desired (e.g. before `else').
4324 Work around GCC warnings by surrounding corresponding calls with
4325 {} if needed.
4326 (yyhasResolvedValue): Remove unused function.
4327 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
4328 loop body.
4329 (yyreportSyntaxError): Renamed from yyreportParseError.
4330 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
4331 All uses changed.
4332 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
4333 extern when possible. Remove unused initializations.
4334
4335 2002-11-16 Akim Demaille <akim@epita.fr>
4336
4337 Augment the similarity between GLR and LALR traces.
4338
4339 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
4340 (YY_REDUCE_PRINT): New.
4341 (yyparse): Use them.
4342 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
4343 YYDPRINT here.
4344 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
4345 state reached after the reduction/recovery, since...
4346 (yyparse, yyprocessOneStack): Report the state we are entering in.
4347
4348 2002-11-16 Akim Demaille <akim@epita.fr>
4349
4350 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
4351 Add support for --trace=skeleton.
4352 * src/scan-skel.l: %option debug.
4353 Scan strings of non-@ or \n instead of character by character.
4354 (scan_skel): Handle trace_skeleton.
4355 (QPUTS): New.
4356 (@output_parser_name@, @output_header_name@): ``Restore'' their
4357 support (used to be M4 macros).
4358 * data/yacc.c: Quote larger chunks, a la glr.c.
4359 * data/lalr1.cc: Likewise.
4360 The header guards are no longer available, so use some other
4361 string than `YYLSP_NEEDED'.
4362
4363 2002-11-16 Akim Demaille <akim@epita.fr>
4364
4365 Make the ``Printers and Destructors'' test more verbose, taking
4366 `yacc.c''s behavior as (possibly wrong) reference.
4367
4368 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
4369 instead of fprint on stdout.
4370 Set and report the last_line of the symbols.
4371 Consistently display values and locations.
4372
4373 2002-11-16 Paul Eggert <eggert@twinsun.com>
4374
4375 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
4376
4377 2002-11-15 Paul Eggert <eggert@twinsun.com>
4378
4379 * tests/actions.at (Actions after errors): New test case.
4380
4381 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
4382 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
4383 tests/action.at, tests/calc.at, tests/conflicts.at,
4384 tests/cxx-type.at, tests/regression.at:
4385 "parse error" -> "syntax error" for POSIX compatibility.
4386 "parsing stack overflow..." -> "parser stack overflow" so
4387 that code matches Bison documentation.
4388
4389 2002-11-15 Akim Demaille <akim@epita.fr>
4390
4391 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
4392 take two BRACED_CODE, not two string_content.
4393 Free the scanner's obstack when we are done.
4394 (code_content): New.
4395 * tests/calc.at: Adjust.
4396 * doc/bison.texinfo: Adjust.
4397 Also, make sure to include the `,' for these declarations.
4398
4399 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
4400
4401 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
4402 definition; avoids potential autoreconf problems.
4403
4404 2002-11-15 Akim Demaille <akim@epita.fr>
4405
4406 Always check the value returned by yyparse.
4407
4408 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
4409 returned by yyparse.
4410 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
4411 Adjust calls.
4412 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
4413 returned by yyparse.
4414
4415 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4416
4417 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
4418 on input.at test.
4419
4420 2002-11-14 Paul Eggert <eggert@twinsun.com>
4421
4422 * src/output.c (output_skeleton): Call xfopen instead of
4423 duplicating xfopen's body.
4424
4425 Fix bugs reported by Nelson H. F. Beebe in
4426 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
4427
4428 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
4429 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
4430 Group compiler. Instead, use "$CC -E bar.c". Include the .h
4431 file twice in the grammar, as an extra check.
4432
4433 * tests/input.at (Torturing the Scanner): Surround the
4434 backslash-newline tests with "#if 0", to make it less likely that
4435 we'll run into compiler bugs. Bring back solitary \ inside
4436 comment, but add a closing comment to work around HP C bug. Don't
4437 test backslash-newline in C character constant.
4438
4439 2002-11-14 Akim Demaille <akim@epita.fr>
4440
4441 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
4442 status of the compiler.
4443 Calling `exit 1' is no longer needed.
4444 Reported by Nelson H. F. Beebe.
4445
4446 2002-11-14 Akim Demaille <akim@epita.fr>
4447
4448 * tests/atlocal.in (CPPFLAGS): We have config.h.
4449 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
4450 New.
4451 * tests/actions.at, tests/calc.at, tests/conflicts.at,
4452 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
4453 * tests/regression.at, tests/torture.at: Use them for all the
4454 grammars that are to be compiled.
4455 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
4456 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
4457 * doc/bison.texinfo (GLR Parsers): Document `inline'.
4458
4459 2002-11-14 Akim Demaille <akim@epita.fr>
4460
4461 * doc/bison.texinfo: Various formatting changes (alignments in
4462 samples, additional @group/@end group, GCS in samples.
4463 Use @deffn instead of simple @table to define the directives,
4464 macros, variables etc.
4465
4466 2002-11-13 Paul Eggert <eggert@twinsun.com>
4467
4468 Fix some bugs reported by Albert Chin-A-Young in
4469 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
4470
4471 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
4472 -o c"; the HP C compiler chatters during compilation.
4473 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
4474 * tests/headers.at (export YYLTYPE): Likewise.
4475
4476 * tests/input.at (Torturing the Scanner): Remove lines containing
4477 solitary backslashes, as they tickle a bug in the HP C compiler.
4478
4479 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
4480 comments, since they're not portable. Use GNU coding style.
4481
4482 2002-11-13 Akim Demaille <akim@epita.fr>
4483
4484 * data/yacc.c: Leave bigger chunks of quoted text.
4485 (YYDSYMPRINTF): New.
4486 Use it to report symbol activities.
4487 * data/glr.c (YYDSYMPRINTF): New.
4488 Use it.
4489
4490 2002-11-12 Paul Eggert <eggert@twinsun.com>
4491
4492 Version 1.75b.
4493
4494 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
4495 (yyglrReduce): Return yyok, not 0.
4496 This should avoid the enumerated-type warnings reported
4497 by Nelson H. F. Beebe in
4498 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
4499
4500 * lib/bbitset.h (BITSET_INLINE): Remove.
4501 * lib/bitset.h [! BITSET_INLINE]: Remove.
4502 (bitset_set, bitset_reset, bitset_test): Rename local vars
4503 to avoid shadowing warnings by GCC.
4504
4505 * data/glr.c (inline): Remove #define. It's the user's
4506 responsibility to #define it away, just like 'const'.
4507 This fixes one of the bugs reported by Nelson H. F. Beebe in
4508 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
4509
4510 * Makefile.maint (po-check): Scan .l and .y files instead of the
4511 .c and the .h files that they generate. This fixes the bug
4512 reported by Tim Van Holder in:
4513 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
4514 Look for N_ as well as for _. Try to avoid matching #define for
4515 N_ and _.
4516 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
4517 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
4518 * src/scan-gram.l: Revamp regular expressions so that " and '
4519 do not confuse xgettext.
4520
4521 * src/struniq.h (struniq_new): Do not declare the return type
4522 to be 'const'; this violates the C standard.
4523 * src/struniq.c (struniq_new): Likewise.
4524
4525 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
4526
4527 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
4528 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
4529 linker.
4530
4531 2002-11-12 Akim Demaille <akim@epita.fr>
4532
4533 * Makefile.maint: Sync with Autoconf:
4534 (local_updates): New.
4535
4536 2002-11-12 Akim Demaille <akim@epita.fr>
4537
4538 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
4539
4540 2002-11-12 Akim Demaille <akim@epita.fr>
4541
4542 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
4543 locations.
4544
4545 2002-11-12 Akim Demaille <akim@epita.fr>
4546
4547 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
4548 not yyvalue.
4549
4550 2002-11-12 Akim Demaille <akim@epita.fr>
4551
4552 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
4553 Use it to test the GLR parser.
4554
4555 2002-11-12 Akim Demaille <akim@epita.fr>
4556
4557 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
4558 defines it.
4559 * data/glr.c (yystos): New.
4560 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
4561 (YYDSYMPRINT): New.
4562 (yyval): Don't define it, it is handled via M4.
4563 (yyrecoverParseError): Free verbosely the discarded symbols.
4564 * data/yacc.c (yysymprint): Remove, rather...
4565 (b4_yysymprint_generate): invoke.
4566 * data/c.m4 (b4_yysymprint_generate): New.
4567 Accept pointers as arguments, as opposed to the version from
4568 yacc.c.
4569 (b4_yydestruct_generate): Likewise.
4570 * tests/cations.at (Printers and Destructors): Use Bison directives
4571 instead of CPP macros.
4572 Don't rely on internal details.
4573
4574 2002-11-12 Akim Demaille <akim@epita.fr>
4575
4576 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
4577 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
4578 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
4579 it against YYEMPTY and so forth), work on yytoken (i.e., set
4580 it to YYEMPTY etc.).
4581 (yydestruct): Replace with a b4_yydestruct_generate invocation.
4582 (b4_symbol_actions): Remove.
4583 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
4584 for 0, end-of-input.
4585
4586 2002-11-12 Akim Demaille <akim@epita.fr>
4587
4588 * doc/bison.texinfo (Destructor Decl): New.
4589
4590 2002-11-12 Akim Demaille <akim@epita.fr>
4591
4592 * src/tables.c (tables_generate): Use free for pointers that
4593 cannot be NULL, not XFREE.
4594 (pack_vector): Use assert, not fatal, for bound violations.
4595 * src/state.c (state_new): Likewise.
4596 * src/reader.c (reader): Likewise.
4597 * src/lalr.c (set_goto_map): Likewise.
4598 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
4599 the file name.
4600
4601 2002-11-12 Akim Demaille <akim@epita.fr>
4602
4603 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
4604 Restore.
4605 * src/scan-gram.l (last_string): Is global to the file, not to
4606 yylex.
4607 * src/parse-gram.y (input): Don't append the epilogue here,
4608 (epilogue.opt): do it here, and free the scanner's obstack.
4609 * src/reader.c (epilogue_set): Rename as...
4610 (epilogue_augment): this.
4611 * data/c.m4 (b4_epilogue): Defaults to empty.
4612
4613 2002-11-12 Akim Demaille <akim@epita.fr>
4614
4615 * src/getargs.c (long_options): Remove duplicates.
4616 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
4617 Remove.
4618 * doc/bison.rnh: Remove.
4619 * doc/bison.texinfo (VMS Invocation): Remove.
4620
4621 2002-11-12 Akim Demaille <akim@epita.fr>
4622
4623 * src/struniq.h, src/struniq.c (struniq_t): Is const.
4624 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
4625
4626 Use struniq for symbols.
4627
4628 * src/symtab.h (symbol_t): The tag member is a struniq.
4629 (symbol_type_set): Adjust.
4630 * src/symtab.c (symbol_new): Takes a struniq.
4631 (symbol_free): Don't free the tag member.
4632 (hash_compare_symbol_t, hash_symbol_t): Rename as...
4633 (hash_compare_symbol, hash_symbol): these.
4634 Use the fact that tags as struniqs.
4635 (symbol_get): Use struniq_new.
4636 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
4637 Returns a strniq.
4638 * src/reader.h (merger_list, grammar_currentmerge_set): The name
4639 and type members are struniqs.
4640 * src/reader.c (get_merge_function)
4641 (grammar_current_rule_merge_set): Adjust.
4642 (TYPE, current_type): Are struniq.
4643
4644 Use struniq for file names.
4645
4646 * src/files.h, src/files.c (infile): Split into...
4647 (grammar_file, current_file): these.
4648 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
4649 * src/reduce.c (reduce_print): Likewise.
4650 * src/getargs.c (getargs): Likewise.
4651 * src/complain.h, src/complain.c: Likewise.
4652 * src/main.c (main): Call struniqs_new early enough to use it for
4653 file names.
4654 Don't free the input file name.
4655
4656 2002-11-12 Akim Demaille <akim@epita.fr>
4657
4658 * src/symtab.c (symbol_free): Remove dead deactivated code:
4659 type_name are properly removed.
4660 Don't use XFREE to free items that cannot be NULL.
4661 * src/struniq.h, src/struniq.c: New.
4662 * src/main.c (main): Initialize/free struniqs.
4663 * src/parse-gram.y (%union): Add astruniq member.
4664 (yyprint): Adjust.
4665 * src/scan-gram.l (<{tag}>): Return a struniq.
4666 Free the obstack bit that used to store it.
4667 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
4668
4669 2002-11-11 Paul Eggert <eggert@twinsun.com>
4670
4671 Revamp to fix many (but not all) of the C- and M4-related quoting
4672 problems. Among other things, this fixes the Bison bug reported
4673 by Jan Hubicka when processing the Bash grammar; see:
4674 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
4675
4676 Use new @ escapes consistently. Represent brackets with @{ and @}
4677 rather than @<:@ and @:>@, since this works a bit better with dumb
4678 editors like vi. Represent @ with @@, since @ is now consistently
4679 an escape. Use @oline@ and @ofile@ rather than __oline__ and
4680 __ofile__, to avoid unexpected expansions. Similarly, use @output
4681 rather than #output.
4682
4683 * data/c.m4 (b4_copyright): Omit file name from comment, since
4684 the file name could contain "*/".
4685 (b4_synclines_flag): Don't quote the 2nd argument; it should already
4686 be quoted. All uses changed.
4687
4688 * data/glr.c: Use new @ escapes consistently.
4689 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
4690 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
4691 Remove, since they couldn't handle arbitrary characters in file
4692 names.
4693 * data/lalr1.cc: Likewise.
4694 * data/yacc.c: Likewise.
4695
4696 * src/files.c (output_infix): Remove; all uses removed.
4697 * src/files.h: Likewise.
4698
4699 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
4700 mishandled funny characters in file names, and anyway it isn't
4701 needed any more.
4702 * data/yacc.c: Likewise.
4703 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
4704
4705 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
4706 * data/yacc.c: Likewise.
4707
4708 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
4709 strings now.
4710 (muscle_init): Quote filename as a C string.
4711 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
4712 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
4713 * src/output.c (escaped_file_name_output): New function.
4714 (prepare_symbols): Quote tokens for M4.
4715 (prepare): Don't insert output_infix, output_prefix,
4716 output_parser_name, output_header_name; this is now down by scan-skel.
4717 Insert skeleton as a C string.
4718
4719 * src/output.c (user_actions_output, symbol_destructors_output,
4720 symbol_printers_output): Quote filenames for C and M4.
4721 * src/reader.c (prologue_augment, epilogue_set): Likewise.
4722
4723 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
4724 escapes other than \\ and \'; this simplifies the code.
4725 (<SC_STRING>): Likewise, for \\ and \".
4726 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
4727 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
4728 Use new escapes @{ and @} for [ and ].
4729
4730 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
4731 them with auto vars.
4732 Switch to new escape scheme, where @ is the escape character uniformly.
4733 Abort if a stray escape character is found. Avoid unbounded input
4734 buffer when parsing non-escaped text.
4735
4736 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
4737 __oline__, #output, $@, and @{ do not have unintended meanings.
4738
4739 2002-11-09 Paul Eggert <eggert@twinsun.com>
4740
4741 Fix the test failure due to GCC warnings described in
4742 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
4743 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
4744 evaluate to 0 if it's impossible for NINF to be in the respective
4745 table.
4746 (yygetLRActions, yyrecoverParseError): Use them.
4747
4748 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
4749 counted in the token inserted at end of file. Now takes
4750 location_t *, not location_t, so that the location can be
4751 adjusted. All uses changed.
4752
4753 * tests/regression.at (Invalid inputs): Adjust wording in
4754 diagnostic to match the new behavior.
4755
4756 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
4757 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
4758 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
4759 abort ();'. This reduces the runtime of the "Many lookaheads"
4760 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
4761 GCC 3.2.
4762
4763 2002-11-07 Paul Eggert <eggert@twinsun.com>
4764
4765 * src/parse-gram.y (CHARACTER): Remove unused token.
4766 All uses removed.
4767
4768 * src/scan-gram.l: Remove stack option. We no longer use the
4769 stack, since the stack was never deeper than 1; instead, use the
4770 new auto var c_context to record the stacked value.
4771
4772 Remove nounput option. At an unexpected end of file, we now unput
4773 the minimal input necessary to end cleanly; this simplifies the
4774 code.
4775
4776 Avoid unbounded token sizes where this is easy.
4777
4778 (unexpected_end_of_file): New function.
4779 Use it to systematize the error message on unexpected EOF.
4780 (last-string): Now auto, not static.
4781 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
4782 (scanner_last_string_free): Remove; not used.
4783 (percent_percent_count): Move decl to just before use.
4784 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
4785 not the (never otherwised-used) CHARACTER.
4786
4787 2002-11-07 Akim Demaille <akim@epita.fr>
4788
4789 Let yyerror always receive the msg as last argument, so that
4790 yyerror can be variadic.
4791
4792 * data/yacc.c (b4_yyerror_args): New.
4793 Use it when calling yyerror.
4794 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
4795 Use it when calling yyerror.
4796 * doc/bison.texinfo (Error Reporting): Adjust.
4797 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
4798 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
4799
4800 2002-11-06 Akim Demaille <akim@epita.fr>
4801
4802 #line should have quoted strings.
4803 Ideally, this should be done by m4_quotearg.
4804
4805 * src/scan-skel.l: Include quotearg.h.
4806 Quote __ofile__.
4807 * src/output.c (symbol_printers_output)
4808 (symbol_destructors_output): Quote the file name.
4809
4810 2002-11-06 Akim Demaille <akim@epita.fr>
4811
4812 * tests/regression.at (Invalid inputs): Adjust to the recent
4813 messages.
4814
4815 2002-11-06 Akim Demaille <akim@epita.fr>
4816
4817 Restore --no-lines.
4818 Reported by Jim Kent.
4819
4820 * data/c.m4 (b4_syncline): New.
4821 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
4822 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
4823 * src/output.c (user_actions_output): Likewise.
4824 (prepare): Define 'b4_synclines_flag'.
4825 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
4826
4827 2002-11-06 Akim Demaille <akim@epita.fr>
4828
4829 * src/main.c (main): Free `infile'.
4830 * src/scan-gram.l (handle_syncline): New.
4831 Recognize `#line'.
4832 * src/output.c (user_actions_output, symbol_destructors_output)
4833 (symbol_printers_output): Use the location's file name, not
4834 infile.
4835 * src/reader.c (prologue_augment, epilogue_set): Likewise.
4836
4837 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4838
4839 * src/tables.c (matching_state): Don't allow states to match if
4840 either has GLR conflict entries.
4841
4842 2002-11-05 Paul Eggert <eggert@twinsun.com>
4843
4844 * src/scan-gram.l: Use more accurate diagnostics, e.g.
4845 "integer out of range" rather than "invalid value".
4846 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
4847 accordingly.
4848
4849 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
4850 Also, remove one static variable in the scanner.
4851
4852 * src/scan-gram.l (braces_level): Now auto, not static.
4853 Initialize to zero if the compiler is being picky.
4854 (INITIAL): Clear braces_level instead of incrementing it.
4855 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
4856 as POSIX 1003.1-2001 requires.
4857 * src/system.h (IF_LINT): New macro, taken from coreutils.
4858 * configure.ac: Define "lint" if --enable-gcc-warnings.
4859
4860 2002-11-05 Akim Demaille <akim@epita.fr>
4861
4862 * src/scan-gram.l: When it starts with `%', complain about the
4863 whole directive, not just that `invalid character: %'.
4864
4865 2002-11-04 Akim Demaille <akim@epita.fr>
4866
4867 * Makefile.maint: Update from Autoconf.
4868 (update, cvs-update, po-update, do-po-update): New.
4869
4870 2002-11-04 Akim Demaille <akim@epita.fr>
4871
4872 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
4873 and yyerror.
4874 Have yyerror `use' its arguments.
4875 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
4876 returns true when location & yacc & pure & parse-param.
4877 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
4878
4879 2002-11-04 Akim Demaille <akim@epita.fr>
4880
4881 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
4882 clashes.
4883 * src/scan-gram.l: Use [\'] instead of ['] to pacify
4884 font-lock-mode.
4885 Use complain_at.
4886 Use quote, not quote_n since LOCATION_PRINT no longer uses the
4887 slot 0.
4888
4889 2002-11-03 Paul Eggert <eggert@twinsun.com>
4890
4891 * src/reader.c (get_merge_function, grammar_current_rule_check):
4892 Use consistent diagnostics for reporting type name clashes.
4893 Quote the types with <>, for consistency with Yacc.
4894 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
4895
4896 2002-11-03 Akim Demaille <akim@epita.fr>
4897
4898 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
4899 New.
4900 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
4901 (b4_parse_param): Remove.
4902 Use b4_identification.
4903 Propagate b4_pure_args where needed to pass them to yyerror.
4904 * data/glr.m4 (b4_parse_param): Remove.
4905 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
4906 (b4_lpure_formals): New.
4907 Use b4_identification.
4908 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
4909 b4_user_formals and b4_user_args.
4910 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
4911 (yyreportAmbiguity): When using a pure parser, also need
4912 the location, and the parse-params.
4913 Adjust callers.
4914 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
4915 When using a pure parser, also need the parse-params.
4916 Adjust callers.
4917 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
4918 (%pure-parser + %parse-param) LALR and GLR parsers.
4919 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
4920 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
4921 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
4922 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
4923 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
4924 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
4925 * doc/bison.texinfo: Untabify the whole file.
4926 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
4927 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
4928 (Error Reporting): Adjust to these new directives.
4929 Document %error-verbose, deprecate YYERROR_VERBOSE.
4930
4931 2002-11-03 Akim Demaille <akim@epita.fr>
4932
4933 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
4934 AT_CHECK_CALC_GLR invocations to use % directives, instead of
4935 command line options.
4936 * tests/cxx-type.at: Formatting changes.
4937
4938 2002-11-03 Paul Eggert <eggert@twinsun.com>
4939
4940 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
4941 to count columns correctly, and to check for invalid inputs.
4942
4943 Use mbsnwidth to count columns correctly. Account for tabs, too.
4944 Include mbswidth.h.
4945 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
4946 (extend_location): New function.
4947 (YY_LINES): Remove.
4948
4949 Handle CRLF in C code rather than in Lex code.
4950 (YY_INPUT): New macro.
4951 (no_cr_read): New function.
4952
4953 Scan UCNs, even though we don't fully handle them yet.
4954 (convert_ucn_to_byte): New function.
4955
4956 Handle backslash-newline correctly in C code.
4957 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
4958 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
4959 all uses changed.
4960 (tag, splice): New EREs. Do not allow NUL or newline in tags.
4961 Use {splice} wherever C allows backslash-newline.
4962 YY_STEP after space, newline, vertical-tab.
4963 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
4964
4965 (letter, id): Don't assume ASCII; e.g., spell out a-z.
4966
4967 ({int}, handle_action_dollar, handle_action_at): Check for integer
4968 overflow.
4969
4970 (YY_STEP): Omit trailing semicolon, so that it's more like C.
4971
4972 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
4973 as well as \000. Check for UCHAR_MAX, not 255.
4974 Allow \x with an arbitrary positive number of digits, as in C.
4975 Check for overflow here.
4976 Allow \? and UCNs, for compatibility with C.
4977
4978 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
4979 with quote slot used by complain_at.
4980
4981 * tests/input.at: Add tests for backslash-newline, m4 quotes
4982 in symbols, long literals, and funny escapes in strings.
4983
4984 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
4985 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
4986 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
4987 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
4988 * m4/mbswidth.m4: New file, from GNU coreutils.
4989
4990 * doc/bison.texinfo (Grammar Outline): Document // comments.
4991 (Symbols): Document that trigraphs have no special meaning in Bison,
4992 nor is backslash-newline allowed.
4993 (Actions): Document that trigraphs have no special meaning.
4994
4995 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
4996 no longer used.
4997
4998 2002-11-02 Paul Eggert <eggert@twinsun.com>
4999
5000 * src/reader.c: Don't include quote.h; not needed.
5001 (get_merge_function): Reword warning to be consistent with
5002 type clash diagnostic in grammar_current_rule_check.
5003
5004 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
5005 bug in trigraph handling.
5006
5007 * src/output.c (prepare_symbols): When printing token names,
5008 escape "[" as "@<:@" and likewise for "]".
5009
5010 * src/system.h (errno): Remove declaration, as we are now
5011 assuming C89 or better, and C89 guarantees errno.
5012
5013 2002-10-30 Paul Eggert <eggert@twinsun.com>
5014
5015 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
5016 Check for close failures.
5017 * src/files.h (xfclose): Return void, not int, since it always
5018 returned zero.
5019 * src/files.c (xfclose): Likewise. Report I/O error if ferror
5020 indicates one.
5021 * src/output.c (output_skeleton): Use xfclose rather than fclose
5022 and ferror. xfclose now checks ferror.
5023
5024 * data/glr.c (YYLEFTMOST_STATE): Remove.
5025 (yyreportTree): Use a stack-based leftmost state. This avoids
5026 our continuing battles with bogus warnings about initializers.
5027
5028 2002-10-30 Akim Demaille <akim@epita.fr>
5029
5030 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
5031 #if.
5032
5033 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5034
5035 * tests/glr-regr1.at: New test for reported regressions.
5036 * tests/testsuite.at: Add glr-regr1.at test.
5037 * tests/Makefile.am: Add glr-regr1.at test.
5038
5039 2002-10-24 Paul Eggert <eggert@twinsun.com>
5040
5041 Version 1.75a.
5042
5043 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
5044 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
5045 we use malloc. Don't assume 'A' through 'Z' are contiguous.
5046 Don't assume strdup exists; POSIX says its an XSI extension.
5047 Check for buffer overflow on input.
5048
5049 2002-10-24 Akim Demaille <akim@epita.fr>
5050
5051 * src/output.c (output_skeleton): Don't disable M4sugar comments
5052 too soon: it results in comments being expanded.
5053 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
5054 first output.
5055
5056 2002-10-24 Akim Demaille <akim@epita.fr>
5057
5058 * data/yacc.c (m4_int_type): New.
5059 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
5060 char' as only yacc.c wants K&R portability.
5061 * data/glr.c (yysigned_char): Remove.
5062 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
5063 Reported by Quoc Peyrot.
5064
5065 2002-10-23 Paul Eggert <eggert@twinsun.com>
5066
5067 * src/main.c (main): With --trace=time, report times even if a
5068 non-fatal error occurs. Formerly, the times were reported in some
5069 such cases but not in others.
5070 * src/reader.c (reader): Just return if a complaint has been issued,
5071 instead of exiting, so that 'main' can report times.
5072
5073 2002-10-22 Akim Demaille <akim@epita.fr>
5074
5075 * src/system.h: Include sys/types.
5076 Reported by Bert Deknuydt.
5077
5078 2002-10-23 Paul Eggert <eggert@twinsun.com>
5079
5080 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
5081 Suggested by Art Haas.
5082
5083 2002-10-22 Paul Eggert <eggert@twinsun.com>
5084
5085 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
5086 decl; not needed any more.
5087 * src/main.c (main): Use return to exit, undoing yesterday's change.
5088 The last OS that we could find where this wouldn't work is
5089 SunOS 3.5, and that's too old to worry about now.
5090
5091 * data/glr.c (struct yyltype): Define members even when not
5092 doing locations. This is more consistent with yacc.c, and it
5093 works around the following bug reports:
5094 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
5095 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
5096
5097 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
5098 @acronym consistently. Standardize on "Yacc" instead of "YACC",
5099 "Algol" instead of "ALGOL". Give a bit more history about BNF.
5100
5101 2002-10-22 Akim Demaille <akim@epita.fr>
5102
5103 * data/README: New.
5104
5105 2002-10-21 Paul Eggert <eggert@twinsun.com>
5106
5107 Be consistent about 'bool'; the old code used an enum in one
5108 module and an int in another, and this violates the C standard.
5109 * m4/stdbool.m4: New file, from coreutils 4.5.3.
5110 * configure.ac (AC_HEADER_STDBOOL): Add.
5111 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
5112 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
5113 * src/symtab.c (hash_compare_symbol_t): Likewise.
5114 * src/system.h (bool, false, true): Use a definition consistent
5115 with ../lib/hash.c. All uses changed.
5116
5117 * src/complain.c (warning_issued): Renamed from warn_message_count,
5118 so that we needn't worry about integer overflow (!).
5119 Now of type bool. All uses changed.
5120 (complaint_issued): Renamed from complain_message_count; likewise.
5121
5122 * src/main.c (main): Use exit to exit with failure.
5123
5124 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
5125 rather than 1 and 0.
5126 * src/main.c (main): Likewise.
5127 * src/getargs.c (getargs): Likewise.
5128 * src/reader.c (reader): Likewise.
5129
5130 * src/getarg.c (getargs): Remove duplicate code for
5131 "Try `bison --help'".
5132
5133 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
5134 What was that "2" for?
5135
5136 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
5137 * src/getargs.c (usage): Likewise.
5138
5139 * src/getargs.c (getargs): When there are too few operands, report
5140 the last one. When there are too many, report the first extra
5141 one. This is how diffutils does it.
5142
5143 2002-10-20 Paul Eggert <eggert@twinsun.com>
5144
5145 Remove K&R vestiges.
5146 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
5147 * src/complain.c (VA_START): Remove. Assume prototypes.
5148 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
5149 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
5150 fatal): Assume prototypes.
5151 * src/complain.h: Assume prototypes.
5152 * src/system.h (PARAMS): Remove.
5153 Include <limits.h> unconditionally, since it's guaranteeed even
5154 for a freestanding C89 compiler.
5155 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
5156 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
5157
5158 2002-10-20 Akim Demaille <akim@epita.fr>
5159
5160 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
5161 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
5162 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
5163 (yyresolveStates, yyresolveAction, yyresolveStack)
5164 (yyprocessOneStack): Use them.
5165 (yy_reduce_print): New.
5166 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
5167
5168 2002-10-20 Akim Demaille <akim@epita.fr>
5169
5170 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
5171 arguments and output `void'.
5172 (b4_c_function): Rename as...
5173 (b4_c_function_def): this.
5174 (b4_c_function_decl, b4_c_ansi_function_def)
5175 (b4_c_ansi_function_decl): New.
5176 Change the interpretation of the arguments: before `int, foo', now
5177 `int foo, foo'.
5178 * data/yacc.c (yyparse): Prototype and define thanks to these.
5179 Adjust b4_c_function_def uses.
5180 * data/glr.c (yyparse): Likewise, but ANSI only.
5181
5182 2002-10-20 Akim Demaille <akim@epita.fr>
5183
5184 * src/output.c (prepare): Move the definition of `tokens_number',
5185 `nterms_number', `undef_token_number', `user_token_number_max'
5186 to...
5187 (prepare_tokens): Here.
5188 (prepare_tokens): Rename as...
5189 (prepare_symbols): this.
5190 (prepare): Move the definition of `rules_number' to...
5191 (prepare_rules): here.
5192 (prepare): Move the definition of `last', `final_state_number',
5193 `states_number' to...
5194 (prepare_states): here.
5195 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
5196
5197 2002-10-20 Akim Demaille <akim@epita.fr>
5198
5199 * src/tables.h, src/tables.c, src/output.c: Comment changes.
5200
5201 2002-10-20 Akim Demaille <akim@epita.fr>
5202
5203 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
5204 * data/c.m4: here.
5205
5206 2002-10-20 Akim Demaille <akim@epita.fr>
5207
5208 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
5209 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
5210 `pair'.
5211 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
5212 `name' to...
5213 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
5214 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
5215 These.
5216
5217 2002-10-19 Paul Eggert <eggert@twinsun.com>
5218
5219 Do not create a temporary file, as that involves security and
5220 cleanup headaches. Instead, use a pair of pipes.
5221 Derived from a suggestion by Florian Krohm.
5222 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
5223 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
5224 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
5225 (BISON_PREREQ_SUBPIPE): Add.
5226 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
5227 Add subpipe.h, subpipe.c.
5228 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
5229 * po/POTFILES.in: Add lib/subpipe.c.
5230 * src/output.c: Include "subpipe.h".
5231 (m4_invoke): Remove decl.
5232 (scan_skel): New decl.
5233 (output_skeleton): Use pipe rather than temporary file for m4 input.
5234 Check that m4sugar.m4 is readable, to avoid deadlock.
5235 Check for pipe I/O error.
5236 * src/scan-skel.l (readpipe): Remove decl.
5237 (scan_skel): New function, to be used in place of m4_invoke.
5238 Read from stream rather than file.
5239
5240 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
5241 float, as this generates a warning on Solaris 8 + GCC 3.2 with
5242 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
5243 this generates a more-accurate value anyway.
5244
5245 * lib/timevar.c (timervar_accumulate): Rename locals to
5246 avoid confusion with similarly-named more-global.
5247 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
5248
5249 * src/output.c (prepare): Use xstrdup to convert char const *
5250 to char *, to avoid GCC warning.
5251
5252 2002-10-19 Akim Demaille <akim@epita.fr>
5253
5254 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
5255 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
5256 Use them to have `calc.y' ready for %pure-parser.
5257 * data/yacc.c (YYLEX): Pass a yylex return type to
5258 b4_c_function_call.
5259
5260 2002-10-19 Akim Demaille <akim@epita.fr>
5261
5262 Prototype support of %lex-param and %parse-param.
5263
5264 * src/parse-gram.y: Add the definition of the %lex-param and
5265 %parse-param tokens, plus their rules.
5266 Drop the `_' version of %glr-parser.
5267 Add the "," token.
5268 * src/scan-gram.l (INITIAL): Scan them.
5269 * src/muscle_tab.c: Comment changes.
5270 (muscle_insert, muscle_find): Rename `pair' as `probe'.
5271 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
5272 (muscle_entry_s): The `value' member is no longer const.
5273 Adjust all dependencies.
5274 * src/muscle_tab.c (muscle_init): Adjust: use
5275 MUSCLE_INSERT_STRING.
5276 Initialize the obstack earlier.
5277 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
5278 (muscle_pair_list_grow): New.
5279 * data/c.m4 (b4_c_function_call, b4_c_args): New.
5280 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
5281 * tests/calc.at: Use %locations, not --locations.
5282 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
5283
5284 2002-10-19 Akim Demaille <akim@epita.fr>
5285
5286 * src/getargs.c (usage): Take status as argument and exit
5287 accordingly.
5288 Report the traditional `Try ... --help' message when status != 0.
5289 (usage, version): Don't take a FILE * as arg, it is pointless.
5290 (getargs): When there is an incorrect number of arguments, make it
5291 an error, and report it GNUlically thanks to `usage ()'.
5292
5293 2002-10-18 Paul Eggert <eggert@twinsun.com>
5294
5295 * data/glr.c (yyreportParseError): Don't assume that sprintf
5296 yields the length of the printed string, as this is not true
5297 on SunOS 4.1.4. Reported by Peter Klein.
5298
5299 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
5300 * tests/conflicts.at (%nonassoc and eof): Likewise.
5301 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
5302
5303 2002-10-17 Akim Demaille <akim@epita.fr>
5304
5305 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
5306 * src/getargs.c (trace_types, trace_args): Adjust.
5307 * src/reader.c (grammar_current_rule_prec_set)
5308 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
5309 Standardize error messages.
5310 And s/@prec/%prec/!
5311 (reader): Use trace_flag to enable scanner/parser debugging,
5312 instead of an adhoc scheme.
5313 * src/scan-gram.l: Remove trailing debugging code.
5314
5315 2002-10-16 Paul Eggert <eggert@twinsun.com>
5316
5317 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
5318 MUSCLE_TAB_H.
5319
5320 * NEWS: Officially drop support for building Bison with K&R C,
5321 since it didn't work anyway and it's not worth worrying about.
5322 * Makefile.maint (wget_files): Remove ansi2knr.c.
5323 (ansi2knr.c-url_prefix): Remove.
5324 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
5325 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5326 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5327
5328 2002-10-15 Paul Eggert <eggert@twinsun.com>
5329
5330 Stop using the "enum_" trick for K&R-style function definitions;
5331 it confused me, and I was the author! Instead, assume that people
5332 who want to use K&R C compilers (when using these modules in GCC,
5333 perhaps?) will run ansi2knr.
5334
5335 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
5336 All uses of "enum_" changed to "enum ".
5337 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
5338 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
5339
5340 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
5341 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
5342 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
5343 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
5344 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
5345 abitset_not, abitset_ones, abitset_or, abitset_or_and,
5346 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
5347 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
5348 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
5349 Use function prototypes; this removes the need for declaring
5350 static functions simply to provide their prototypes.
5351 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
5352 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
5353 bitset_count_, bitset_create, bitset_dump, bitset_first,
5354 bitset_free, bitset_init, bitset_last, bitset_next,
5355 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
5356 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
5357 bitset_print, bitset_release_memory, bitset_toggle_,
5358 bitset_type_choose, bitset_type_get, bitset_type_name_get,
5359 debug_bitset): Likewise.
5360 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
5361 * lib/bitset_stats.c (bitset_log_histogram_print,
5362 bitset_percent_histogram_print, bitset_stats_and,
5363 bitset_stats_and_cmp, bitset_stats_and_or,
5364 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
5365 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
5366 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
5367 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
5368 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
5369 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
5370 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
5371 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
5372 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
5373 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
5374 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
5375 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
5376 bitset_stats_zero): Likewise.
5377 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
5378 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
5379 bitsetv_dump, debug_bitsetv): Likewise.
5380 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
5381 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
5382 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
5383 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
5384 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
5385 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
5386 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
5387 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
5388 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
5389 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
5390 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
5391 Likewise.
5392 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
5393 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
5394 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
5395 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
5396 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
5397 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
5398 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
5399 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
5400 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
5401 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
5402 lbitset_xor_cmp, lbitset_zero): Likewise.
5403
5404 2002-10-14 Akim Demaille <akim@epita.fr>
5405
5406 Version 1.75.
5407
5408 2002-10-14 Akim Demaille <akim@epita.fr>
5409
5410 * tests/Makefile.am (maintainer-check-posix): New.
5411
5412 2002-10-14 Akim Demaille <akim@epita.fr>
5413
5414 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
5415 member.
5416
5417 2002-10-14 Akim Demaille <akim@epita.fr>
5418
5419 * src/tables.c (table_ninf_remap): base -> tab.
5420 Reported by Matt Rosing.
5421
5422 2002-10-14 Paul Eggert <eggert@twinsun.com>
5423
5424 * tests/action.at, tests/calc.at, tests/conflicts.at,
5425 tests/cxx-type.at, tests/headers.at, tests/input.at,
5426 tests/regression.at, tests/synclines.at, tests/torture.at:
5427 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
5428 so that the tests still work even if POSIXLY_CORRECT is set.
5429 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
5430
5431 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
5432 for portability to K&R hosts. Fix typo: signed char is guaranteed
5433 only to 127, not to 128.
5434 * data/glr.c (yysigned_char): New type.
5435 * data/yacc.c (yysigned_char): Likewise.
5436 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
5437
5438 2002-10-13 Paul Eggert <eggert@twinsun.com>
5439
5440 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
5441 true due to limited range of data type" warning from GCC.
5442
5443 * data/c.m4 (b4_token_defines): Protect against double-inclusion
5444 by wrapping enum yytokentype's definition inside #ifndef
5445 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
5446
5447 2002-10-13 Akim Demaille <akim@epita.fr>
5448
5449 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
5450 Un yy- yyrhs to avoid the name clash with the global YYRHS.
5451
5452 2002-10-13 Akim Demaille <akim@epita.fr>
5453
5454 * Makefile.maint: Update from Autoconf 2.54.
5455 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
5456
5457 2002-10-13 Akim Demaille <akim@epita.fr>
5458
5459 * src/print.c (print_state): Separate the list of solved conflicts
5460 from the other items.
5461 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
5462
5463 2002-10-13 Akim Demaille <akim@epita.fr>
5464
5465 Let nondeterministic skeletons be usable with deterministic
5466 tables.
5467
5468 With the patch, GAWK compiled by GCC without -O2 passes its test
5469 suite using a GLR parser driven by LALR tables. It fails with -O2
5470 because `struct stat' gives two different answers on my machine:
5471 88 (definition of an auto var) and later 96 (memset on this var).
5472 Hence the stack is badly corrumpted. The headers inclusion is to
5473 blame: if I move the awk.h inclusion before GLR's system header
5474 inclusion, the two struct stat have the same size.
5475
5476 * src/tables.c (pack_table): Always create conflict_table.
5477 (token_actions): Always create conflict_list.
5478 * data/glr.c (YYFLAG): Remove, unused.
5479
5480 2002-10-13 Akim Demaille <akim@epita.fr>
5481
5482 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
5483 (O0FLAGS): New.
5484 (VALGRIND, GXX): New.
5485 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
5486 * tests/bison.in: Run $PREBISON a pre-command.
5487 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
5488 (maintainer-check-g++): New.
5489 * Makefile.am (maintainer-check): New.
5490
5491 2002-10-13 Akim Demaille <akim@epita.fr>
5492
5493 * data/glr.c: Formatting changes.
5494 Tweak some trace messages to match yacc.c's.
5495
5496 2002-10-13 Akim Demaille <akim@epita.fr>
5497
5498 GLR parsers sometimes raise parse errors instead of performing the
5499 default reduction.
5500 Reported by Charles-Henry de Boysson.
5501
5502 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
5503 check the length of the traces when %glr.
5504 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
5505 GLR's traces.
5506 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
5507 Test GLR parsers.
5508 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
5509 (yyltype): Remove the yy prefix from the member names.
5510 (yytable): Complete its comment.
5511 (yygetLRActions): Map error action number from YYTABLE from
5512 YYTABLE_NINF to 0.
5513 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
5514 (which was a bug: it should have been YYTABEL_NINF, and yet it was
5515 not satisfying as we could compare an YYACTION computed from
5516 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
5517 only value for error actions.
5518 (yyreportParseError): In verbose parse error messages, don't issue
5519 `error' in the list of expected tokens.
5520 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
5521 next action to perform to match glr.c's decoding.
5522 (yytable): Complete its comment.
5523
5524 2002-10-13 Paul Eggert <eggert@twinsun.com>
5525
5526 Fix problem reported by Henrik Grubbstroem in
5527 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
5528 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
5529 because the Bison parser reads the second action before reducing
5530 the first one.
5531 * src/scan-gram.l (rule_length): New static var.
5532 Use it to keep track of the rule length in the scanner, since
5533 we can't expect the parser to be in lock-step sync with the scanner.
5534 (handle_action_dollar, handle_action_at): Use this var.
5535 * tests/actions.at (Exotic Dollars): Test for the problem.
5536
5537 2002-10-12 Paul Eggert <eggert@twinsun.com>
5538
5539 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
5540 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
5541 Include <sys/time.h> when checking for clock_t and struct tms.
5542 Use same include order as source.
5543 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
5544 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
5545
5546 * lib/timevar.c: Update copyright date and clarify comments.
5547 (get_time) [IN_GCC]: Keep the GCC version for reference.
5548
5549 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
5550 GCC version as of today, then merge Bison's changes.
5551 Change "GCC" to "Bison" in copyright notice. timevar.def's
5552 author is Akim, so change that too.
5553
5554 * src/reader.c (grammar_current_rule_check):
5555 Don't worry about the default action if $$ is untyped.
5556 Prevents bogus warnings reported by Jim Gifford in
5557 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
5558
5559 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
5560 * data/glr.c, data/lalr1.cc, data/yacc.c:
5561 Output token definitions before the first part of user declarations.
5562 Fixes compatibility problem reported by Jim Gifford for kbd in
5563 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
5564
5565 2002-10-11 Paul Eggert <eggert@twinsun.com>
5566
5567 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
5568 (yyparse): here. This undoes some of the 2002-07-25 change.
5569 Compatibility problem reported by Ralf S. Engelschall with
5570 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
5571
5572 2002-10-11 Akim Demaille <akim@epita.fr>
5573
5574 * tests/regression.at Characters Escapes): New.
5575 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
5576 characters.
5577 Reported by Jan Nieuwenhuizen.
5578
5579 2002-10-11 Akim Demaille <akim@epita.fr>
5580
5581 * po/id.po: New.
5582
5583 2002-10-10 Paul Eggert <eggert@twinsun.com>
5584
5585 Portability fixes for bitsets; this also avoids several GCC
5586 warnings.
5587
5588 * lib/abitset.c: Include <stddef.h>, for offsetof.
5589 * lib/lbitset.c: Likewise.
5590
5591 * lib/abitset.c (abitset_bytes): Return a size that is aligned
5592 properly for vectors of objects. Do not assume that adding a
5593 header size to a multiple of a word size yields a value that is
5594 properly aligned for the whole union.
5595 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5596
5597 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
5598 unique names for structures.
5599 * lib/ebitset.c (ebitset_bytes): Likewise.
5600 * lib/lbitset.c (lbitset_bytes): Likewise.
5601
5602 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
5603 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
5604 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
5605 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
5606 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
5607 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
5608 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
5609 to improve the type-checking that GCC can do.
5610 * lib/bitset.c (bitset_op4_cmp): Likewise.
5611 * lib/bitset_stats.c (bitset_stats_count,
5612 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
5613 bitset_stats_copy, bitset_stats_disjoint_p,
5614 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
5615 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
5616 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
5617 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
5618 bitset_stats_and_or_cmp, bitset_stats_andn_or,
5619 bitset_stats_andn_or_cmp, bitset_stats_or_and,
5620 bitset_stats_or_and_cmp): Likewise.
5621 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
5622 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
5623 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
5624 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
5625
5626 * lib/abitset.h: Include bitset.h, not bbitset.h.
5627 * lib/ebitset.h: Likewise.
5628 * lib/lbitset.h: Likewise.
5629
5630 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
5631 All instances of parameters of type enum bitset_opts are now of
5632 type enum_bitset_opts, to conform to the C Standard, and similarly
5633 for enum_bitset_type.
5634 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
5635 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
5636
5637 Do not use "struct bitset_struct" to mean different things in
5638 different modules. Not only is this confusing, it violates
5639 the C Standard, which requires that structure types in different
5640 modules must be compatible if one is to be passed to the other.
5641 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
5642 All instances of "struct bitset_struct *" replaced with "bitset".
5643 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
5644 (union bitset_union, struct abitset_struct, struct ebitset_struct,
5645 struct lbitset_struct, struct bitset_stats_struct): New types.
5646 All uses of struct bitset_struct changed to union bitset_union,
5647 etc.
5648 * lib/abitset.c (struct abitset_struct, abitset,
5649 struct bitset_struct): Remove.
5650 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
5651 struct bitset_struct): Remove.
5652 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
5653 bitset_struct): Remove.
5654 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
5655 Likewise.
5656
5657 Do not call a function of type T using a call that assumes the
5658 function is of a different type U. Standard C requires that a
5659 function must be called with a type that is compatible with its
5660 definition.
5661 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
5662 New decls.
5663 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
5664 New functions.
5665 * lib/ebitset.c (PFV): Remove.
5666 * lib/lbitset.c (PFV): Likewise.
5667 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
5668 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
5669 decls.
5670 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
5671 (ebitset_vtable): Use them.
5672 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
5673 lbitset_xor): New functions.
5674 (lbitset_vtable): Use them.
5675
5676 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
5677 Declare.
5678
5679 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
5680 GCC warning.
5681 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
5682 Use offsetof, for simplicity.
5683
5684 2002-10-06 Paul Eggert <eggert@twinsun.com>
5685
5686 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
5687 the same width as int. This reapplies a hunk of the 2002-08-12 patch
5688 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
5689 which was inadvertently undone by the 2002-09-30 patch.
5690 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
5691 the same width as int.
5692
5693 2002-10-04 Paul Eggert <eggert@twinsun.com>
5694
5695 Version 1.50.
5696
5697 * configure.ac (AC_INIT), NEWS: Increment version number.
5698
5699 * doc/bison.texinfo: Minor spelling, grammar, and white space
5700 fixes.
5701 (Symbols): Mention that any negative value returned from yylex
5702 signifies end-of-input. Warn about negative chars. Mention
5703 the portable Standard C character set.
5704
5705 The GNU coding standard says CFLAGS and YFLAGS are reserved
5706 for the installer to set.
5707 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
5708 * src/Makefile.am (AM_CFLAGS): Likewise.
5709 (AM_YFLAGS): Renamed from YFLAGS.
5710
5711 Fix some MAX and MIN problems.
5712 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
5713 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
5714 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
5715 * src/reader.c (reader): Use it.
5716
5717 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
5718 POSIX 1003.1-2001 has removed fgrep.
5719
5720 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
5721
5722 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
5723 interpreted as signed.
5724 * lib/ebitset.c (ebitset_list): Fix bug.
5725
5726 2002-10-01 Paul Eggert <eggert@twinsun.com>
5727
5728 More fixes for 64-bit hosts and large bitsets.
5729
5730 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
5731 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
5732 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
5733 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
5734 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
5735 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
5736 bitset_count_): Likewise.
5737 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
5738 bitset_first, bitset_last): Likewise.
5739 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
5740 bitset_stats_list_reverse, bitset_stats_size,
5741 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
5742 Likewise.
5743 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
5744 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
5745 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
5746 bitsetv_reflexive_transitive_closure): Likewise.
5747 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
5748 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
5749 Likewise.
5750 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
5751 Likewise.
5752
5753 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
5754 Use size_t, not unsigned int, to count bytes.
5755 * lib/abitset.h (abitset_bytes): Likewise.
5756 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
5757 Likewise.
5758 * lib/bitset.h (bitset_bytes): Likewise.
5759 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
5760 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
5761 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5762 * lib/ebitset.c (ebitset_bytes): Likewise.
5763 * lib/ebitset.h (ebitset_bytes): Likewise.
5764 * lib/lbitset.c (lbitset_bytes): Likewise.
5765 * lib/lbitset.h (lbitset_bytes): Likewise.
5766
5767 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
5768 abitset_subset_p, abitset_disjoint_p, abitset_and,
5769 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
5770 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
5771 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
5772 abitset_or_and, abitset_or_and_cmp):
5773 Use bitset_windex instead of unsigned int.
5774 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
5775 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
5776 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
5777 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
5778 Likewise.
5779 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
5780
5781 * lib/bitset.c (bitset_print):
5782 Use proper printf formats for widths of integer types.
5783 * lib/bitset_stats.c (bitset_percent_histogram_print,
5784 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
5785 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
5786 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
5787 * lib/lbitset.c (lbitset_bytes): Likewise.
5788
5789 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
5790 BITSET_SIZE_MAX): New macros.
5791 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
5792 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
5793 to BITSET_WINDEX_MAX.
5794
5795 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
5796 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
5797 since we now return the bitset_bindex type (not int).
5798
5799 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
5800 when computing sizes.
5801 * lib/ebitset.c (ebitset_elts_grow): Likewise.
5802
5803 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
5804 and avoid cast to unsigned.
5805
5806 2002-09-30 Akim Demaille <akim@epita.fr>
5807
5808 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
5809 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
5810 Updates from Michael Hayes.
5811
5812 2002-09-30 Art Haas <ahaas@neosoft.com>
5813
5814 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
5815 invocations.
5816 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
5817 defined.
5818
5819 2002-09-27 Akim Demaille <akim@epita.fr>
5820
5821 Version 1.49c.
5822
5823 2002-09-27 Akim Demaille <akim@epita.fr>
5824
5825 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
5826 (Because of AC_LIBSOURCE).
5827
5828 2002-09-27 Akim Demaille <akim@epita.fr>
5829
5830 Playing with Autoscan.
5831
5832 * configure.ac: Remove the old LIBOBJ tweaks.
5833 (AC_REPLACE_FUNCS): Add strrchr and strtol.
5834 * lib/strrchr.c: New.
5835 * lib/strtol.c: New, from the Coreutils 4.5.1.
5836
5837 2002-09-27 Akim Demaille <akim@epita.fr>
5838
5839 Playing with Autoscan.
5840
5841 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
5842 * lib/Makefile.am (libbison_a_SOURCES): No longer include
5843 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
5844 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
5845 Coreutils 4.5.1.
5846
5847 2002-09-24 Akim Demaille <akim@epita.fr>
5848
5849 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
5850 (Frequently Asked Questions, Parser Stack Overflow): New.
5851
5852 2002-09-13 Akim Demaille <akim@epita.fr>
5853
5854 Playing with autoscan.
5855
5856 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
5857 * src/files.c (skeleton_find): Remove, unused.
5858 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
5859 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
5860
5861 2002-09-13 Akim Demaille <akim@epita.fr>
5862
5863 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
5864 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
5865
5866 2002-09-13 Akim Demaille <akim@epita.fr>
5867
5868 * configure.ac: Require 2.54.
5869 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
5870 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
5871 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
5872 Remove, provided by Autoconf macros.
5873
5874 2002-09-12 Akim Demaille <akim@epita.fr>
5875
5876 * m4/prereq.m4: Update, from Coreutils 4.5.1.
5877
5878 2002-09-12 Akim Demaille <akim@epita.fr>
5879
5880 * m4/prereq.m4: Update, from Fileutils 4.1.5.
5881 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
5882 Reported by Martin Mokrejs.
5883
5884 2002-09-10 Akim Demaille <akim@epita.fr>
5885
5886 * src/parse-gram.y: Associate a human readable string to each
5887 token type.
5888 * tests/regression.at (Invalid inputs): Adjust.
5889
5890 2002-09-10 Gary V. Vaughan <gary@gnu.org>
5891
5892 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
5893 with an Autoconf-2.5x style configure.ac.
5894
5895 2002-09-06 Paul Eggert <eggert@twinsun.com>
5896
5897 * doc/bison.texinfo (Conditions): Make explicit that the GPL
5898 exception applies only to yacc.c. This is a modification of a
5899 patch originally suggested by Akim Demaille.
5900
5901 2002-09-06 Akim Demaille <akim@epita.fr>
5902
5903 * data/c.m4 (b4_copyright): Move the GPL exception comment from
5904 here to...
5905 * data/yacc.c: here.
5906
5907 * data/lalr1.cc (struct yyltype): Don't define it, since we use
5908 LocationType.
5909 (b4_ltype): Default to yy::Location from location.hh.
5910
5911 2002-09-04 Jim Meyering <jim@meyering.net>
5912
5913 * data/yacc.c: Guard the declaration of yytoknum also with
5914 `#ifdef YYPRINT', so it is declared only when used.
5915
5916 2002-09-04 Akim Demaille <akim@epita.fr>
5917
5918 * configure.in: Rename as...
5919 * configure.ac: this.
5920 Bump to 1.49c.
5921
5922 2002-09-04 Akim Demaille <akim@epita.fr>
5923
5924 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
5925 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
5926 translate maintainer only messages.
5927
5928 2002-08-12 Paul Eggert <eggert@twinsun.com>
5929
5930 Version 1.49b.
5931
5932 * Makefile.am (SUBDIRS): Remove intl.
5933 (DISTCLEANFILES): Remove.
5934 * NEWS: Mention that GNU M4 is now required. Clarify what is
5935 meant by "larger grammars". Mention the pt_BR translation.
5936 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
5937 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
5938 Bump version from 0.11.2 to 0.11.5.
5939 (BISON_PREREQ_STAGE): Remove.
5940 (AM_GNU_GETTEXT): Use external gettext.
5941 (AC_OUTPUT): Remove intl/Makefile.
5942
5943 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
5944
5945 * data/glr.c: Include string.h, for strlen.
5946 (yyreportParseError): Use size_t for yysize.
5947 (yy_yypstack): No longer nested inside yypstates, as nested
5948 functions are not portable. Do not assume size_t is the
5949 same width as int.
5950 (yypstates): Do not assume that ptrdiff_t is the same width
5951 as int, and similarly for yyposn and YYINDEX.
5952
5953 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
5954
5955 * lib/Makefile.am (INCLUDES): Do not include from the intl
5956 directory, which has been removed.
5957 * src/Makefile.am (INCLUDES): Likewise.
5958
5959 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
5960 (bitsets_sources, additional_bitsets_sources, timevars_sources):
5961 New vars.
5962
5963 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
5964 * tests/Makefile.am (EXTRA_DIST): Likewise.
5965
5966 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
5967 Do not assume that bitset_windex is the same width as unsigned.
5968
5969 * lib/abitset.c (abitset_unused_clear): Do not assume that
5970 bitset_word is the same width as int.
5971 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
5972 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
5973 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
5974 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
5975 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
5976
5977 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
5978 portability to one's complement hosts!).
5979 * lib/ebitset.c (ebitset_op1): Likewise.
5980 * lib/lbitset.c (lbitset_op1): Likewise.
5981
5982 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
5983 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5984 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
5985 Sync with fileutils.
5986 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
5987 lib/gettext.h: Sync with diffutils.
5988
5989 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
5990 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
5991
5992 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
5993 PROTOTYPES to check for prototypes, and "defined __STDC__" to
5994 check for void *.
5995
5996 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
5997 size_t; the old version tried to do this but casted improperly.
5998 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
5999 (bitset_test): Now returns int, not unsigned long.
6000
6001 * lib/bitset_stats.c: Include "gettext.h".
6002 (_): New macro.
6003 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
6004 name locals "index", as it generates unnecessary warnings on some
6005 hosts that have an "index" function.
6006
6007 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
6008 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
6009 they need translation.
6010 * src/LR0.c (state_list_append, new_itemsets, get_state,
6011 append_states, generate_states): Likewise.
6012 * src/assoc.c (assoc_to_string): Likewise.
6013 * src/closure.c (print_closure, set_firsts, closure): Likewise.
6014 * src/gram.c (grammar_dump): Likewise.
6015 * src/injections.c (injections_compute): Likewise.
6016 * src/lalr.c (lookaheads_print): Likewise.
6017 * src/relation.c (relation_transpose): Likewise.
6018 * src/scan-gram.l: Likewise.
6019 * src/tables.c (table_grow, pack_vector): Likewise.
6020
6021 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
6022 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
6023 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
6024 * m4/mbstate_t.m4: Sync with fileutils.
6025 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
6026
6027 * po/LINGUAS: Add pt_BR.
6028 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
6029 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
6030 lib/timevar.c.
6031 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
6032 manual recommends.
6033 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
6034
6035 * src/complain.c (strerror_r): Remove decl; not needed.
6036 (strerror): Use same pattern as ../lib/error.c.
6037
6038 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
6039
6040 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
6041
6042 * src/main.c (main): Cast result of bindtextdomain and textdomain
6043 to void, to avoid a GCC warning when --disable-nls is in effect.
6044
6045 * src/scan-gram.l: Use strings rather than escapes when possible,
6046 to minimize the number of warnings from xgettext.
6047 (handle_action_dollar, handle_action_at): Don't use isdigit,
6048 as it mishandles negative chars and it may not work as expected
6049 outside the C locale.
6050
6051 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
6052 this is a GCC extension and is not portable to other compilers.
6053
6054 * src/system.h (alloca): Use same pattern as ../lib/error.c.
6055 Do not include <ctype.h>; no longer needed.
6056 Do not include <malloc.h>; no longer needed (and generates
6057 warnings on OpenBSD 3.0).
6058
6059 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
6060 it's not portable.
6061
6062 * tests/regression.at: Do not use 'cc -c input.c -o input';
6063 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
6064
6065 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
6066 exit status as failure, not just exit status 1. Sun C exits
6067 with status 2 sometimes.
6068
6069 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
6070 Use it for the two large tests.
6071
6072 2002-08-02 Akim Demaille <akim@epita.fr>
6073
6074 * src/conflicts.c (conflicts_output): Don't output rules never
6075 reduced here, since anyway that computation doesn't work.
6076 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
6077 (rule_useless_p, rule_never_reduced_p): New.
6078 (grammar_rules_partial_print): Use a filter instead of a range.
6079 Display the title only if needed.
6080 (grammar_rules_print): Adjust.
6081 (grammar_rules_never_reduced_report): New.
6082 * src/tables.c (action_row): Move the computation of rules never
6083 reduced to...
6084 (token_actions): here.
6085 * src/main.c (main): Make the parser before making the report, so
6086 that rules never reduced are computed.
6087 Call grammar_rules_never_reduced_report.
6088 * src/print.c (print_results): Report rules never reduced.
6089 * tests/conflicts.at, tests/reduce.at: Adjust.
6090
6091 2002-08-01 Akim Demaille <akim@epita.fr>
6092
6093 Instead of attaching lookaheads and duplicating the rules being
6094 reduced by a state, attach the lookaheads to the reductions.
6095
6096 * src/state.h (state_t): Remove the `lookaheads',
6097 `lookaheads_rule' member.
6098 (reductions_t): Add a `lookaheads' member.
6099 Use a regular array for the `rules'.
6100 * src/state.c (reductions_new): Initialize the lookaheads member
6101 to 0.
6102 (state_rule_lookaheads_print): Adjust.
6103 * src/state.h, src/state.c (state_reductions_find): New.
6104 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
6105 (count_rr_conflicts): Adjust.
6106 * src/lalr.c (LArule): Remove.
6107 (add_lookback_edge): Adjust.
6108 (state_lookaheads_count): New.
6109 (states_lookaheads_initialize): Merge into...
6110 (initialize_LA): this.
6111 (lalr_free): Adjust.
6112 * src/main.c (main): Don't free nullable and derives too early: it
6113 is used by --verbose.
6114 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
6115
6116 2002-08-01 Akim Demaille <akim@epita.fr>
6117
6118 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
6119 `rule_number_t**'.
6120 (set_derives, free_derives): Rename as...
6121 (derives_compute, derives_free): this.
6122 Adjust all dependencies.
6123 * src/nullable.c (set_nullable, free_nullable): Rename as...
6124 (nullable_compute, nullable_free): these.
6125 (rule_list_t): Store rule_t *, not rule_number_t.
6126 * src/state.c (state_rule_lookaheads_print): Directly compare rule
6127 pointers, instead of their numbers.
6128 * src/main.c (main): Call nullable_free, and derives_free earlier,
6129 as they were lo longer used.
6130
6131 2002-08-01 Akim Demaille <akim@epita.fr>
6132
6133 * lib/timevar.c (get_time): Include children time.
6134 * src/lalr.h (LA, LArule): Don't export them: used with the
6135 state_t.
6136 * src/lalr.c (LA, LArule): Static.
6137 * src/lalr.h, src/lalr.c (lalr_free): New.
6138 * src/main.c (main): Call it.
6139 * src/tables.c (pack_vector): Check whether loc is >= to the
6140 table_size, not >.
6141 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
6142 (tables_generate): do it, since that's also it which allocates
6143 them.
6144 Don't free LA and LArule, main does.
6145
6146 2002-07-31 Akim Demaille <akim@epita.fr>
6147
6148 Separate parser tables computation and output.
6149
6150 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
6151 (conflict_list, conflict_list_cnt, table, check, table_ninf)
6152 (yydefgoto, yydefact, high): Move to...
6153 * src/tables.h, src/tables.c: here.
6154 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
6155 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
6156 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
6157 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
6158 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
6159 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
6160 (action_row, save_row, token_actions, save_column, default_goto)
6161 (goto_actions, sort_actions, matching_state, pack_vector)
6162 (table_ninf_remap, pack_table, prepare_actions): Move to...
6163 * src/tables.c: here.
6164 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
6165 * src/output.c (token_actions, output_base, output_conflicts)
6166 (output_check): Merge into...
6167 (prepare_actions): this.
6168 (actions_output): Rename as...
6169 (user_actions_output): this.
6170 * src/main.c (main): Call tables_generate and tables_free.
6171
6172 2002-07-31 Akim Demaille <akim@epita.fr>
6173
6174 Steal GCC's --time-report support.
6175
6176 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
6177 stolen/adjusted from GCC.
6178 * m4/stage.m4: Remove time related checks.
6179 * m4/timevar.m4: New.
6180 * configure.in: Adjust.
6181 * src/system.h: Adjust to using timevar.h.
6182 * src/getargs.h, src/getargs.c: Support trace_time for
6183 --trace=time.
6184 * src/main.c (stage): Remove.
6185 (main): Replace `stage' invocations with timevar calls.
6186 * src/output.c: Insert pertinent timevar calls.
6187
6188 2002-07-31 Akim Demaille <akim@epita.fr>
6189
6190 Let --trace have arguments.
6191
6192 * src/getargs.h (enum trace_e): New.
6193 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
6194 (long_options, short_options): --trace/-T takes an optional
6195 argument.
6196 Change all the uses of trace_flag to reflect the new flags.
6197 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
6198
6199 Strengthen `stage' portability.
6200
6201 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
6202 * configure.in: Use it.
6203 Don't check for malloc.h and sys/times.h.
6204 * src/system.h: Include them when appropriate.
6205 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
6206 times and struct tms are available.
6207
6208 2002-07-30 Akim Demaille <akim@epita.fr>
6209
6210 In verbose parse error message, don't report `error' as an
6211 expected token.
6212 * tests/actions.at (Printers and Destructors): Adjust.
6213 * tests/calc.at (Calculator $1): Adjust.
6214 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
6215 error message, do not report the parser accepts the error token in
6216 that state.
6217
6218 2002-07-30 Akim Demaille <akim@epita.fr>
6219
6220 Normalize conflict related messages.
6221
6222 * src/complain.h, src/complain.c (warn, complain): New.
6223 * src/conflicts.c (conflicts_print): Use them.
6224 (conflict_report_yacc): New, extracted from...
6225 (conflicts_print): here.
6226 * tests/conflicts.at, tests/existing.at: Adjust.
6227
6228 2002-07-30 Akim Demaille <akim@epita.fr>
6229
6230 Report rules which are never reduced by the parser: those hidden
6231 by conflicts.
6232
6233 * src/LR0.c (save_reductions): Don't make the final state too
6234 different: save its reduction (accept) instead of having a state
6235 without any action (no shift or goto, no reduce).
6236 Note: the final state is now a ``regular'' state, i.e., the
6237 parsers now contain `reduce 0' as default reduction.
6238 Nevertheless, since they decide to `accept' when yystate =
6239 final_state, they still will not reduce rule 0.
6240 * src/print.c (print_actions, print_reduction): Adjust.
6241 * src/output.c (action_row): Track reduced rules.
6242 (token_actions): Report rules never reduced.
6243 * tests/conflicts.at, tests/regression.at: Adjust.
6244
6245 2002-07-30 Akim Demaille <akim@epita.fr>
6246
6247 `stage' was accidently included in a previous patch.
6248 Initiate its autoconfiscation.
6249
6250 * configure.in: Look for malloc.h and sys/times.h.
6251 * src/main.c (stage): Adjust.
6252 Report only when trace_flag.
6253
6254 2002-07-29 Akim Demaille <akim@epita.fr>
6255
6256 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
6257 state_number_t.
6258 (errs_t): symbol_t*, not symbol_number_t.
6259 (reductions_t): rule_t*, not rule_number_t.
6260 (FOR_EACH_SHIFT): New.
6261 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
6262 * src/print.c, src/print_graph.c: Adjust.
6263
6264 2002-07-29 Akim Demaille <akim@epita.fr>
6265
6266 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
6267
6268 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
6269 (endtoken, accept): these.
6270 * src/reader.c (reader): Set endtoken's default tag to "$end".
6271 Set undeftoken's tag to "$undefined" instead of "$undefined.".
6272 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
6273 Adjust.
6274
6275 2002-07-29 Akim Demaille <akim@epita.fr>
6276
6277 * src/reduce.c (reduce_grammar): When the language is empty,
6278 complain about the start symbol, not the axiom.
6279 Use its location.
6280 * tests/reduce.at (Empty Language): New.
6281
6282 2002-07-26 Akim Demaille <akim@epita.fr>
6283
6284 * src/reader.h, src/reader.c (gram_error): ... can't get
6285 yycontrol without making too strong assumptions on the parser
6286 itself.
6287 * src/output.c (prepare_tokens): Use the real 0th value of
6288 token_translations instead of `0'.
6289 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
6290 visible here.
6291 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
6292 for the time being: %locations ought to provide it to yyerror.
6293
6294 2002-07-25 Akim Demaille <akim@epita.fr>
6295
6296 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
6297 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
6298 * tests/regression.at (Web2c Actions): Adjust.
6299
6300 2002-07-25 Akim Demaille <akim@epita.fr>
6301
6302 Stop storing rules from 1 to nrules + 1.
6303
6304 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
6305 * src/nullable.c, src/output.c, src/print.c, src/reader.c
6306 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
6307 Iterate from 0 to nrules.
6308 Use rule_number_as_item_number and item_number_as_rule_number.
6309 Adjust to `derive' now containing possibly 0.
6310 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
6311 Handle the `- 1' part in rule numbers from/to item numbers.
6312 * src/conflicts.c (log_resolution): Fix the message which reversed
6313 shift and reduce.
6314 * src/output.c (action_row): Initialize default_rule to -1.
6315 (token_actions): Adjust.
6316 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
6317 expected output.
6318 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
6319
6320 2002-07-25 Akim Demaille <akim@epita.fr>
6321
6322 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
6323 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
6324 (b4_c_knr_arg_decl): New.
6325 * data/yacc.c: Use it to define yysymprint, yydestruct, and
6326 yyreport_parse_error.
6327
6328 2002-07-25 Akim Demaille <akim@epita.fr>
6329
6330 * data/yacc.c (yyreport_parse_error): New, extracted from...
6331 (yyparse): here.
6332 (yydestruct, yysymprint): Move above yyparse.
6333 Be K&R compliant.
6334
6335 2002-07-25 Akim Demaille <akim@epita.fr>
6336
6337 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
6338 replace...
6339 (b4_sint_type, b4_uint_type): these.
6340 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
6341 * tests/regression.at (Web2c Actions): Adjust.
6342
6343 2002-07-25 Akim Demaille <akim@epita.fr>
6344
6345 * src/gram.h (TIEM_NUMBER_MAX): New.
6346 (item_number_of_rule_number, rule_number_of_item_number): Rename
6347 as...
6348 (rule_number_as_item_number, item_number_as_rule_number): these.
6349 Adjust dependencies.
6350 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
6351 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
6352 (symbol_number_to_vector_number): New.
6353 (order): Of vector_number_t* type.
6354 (base_t, BASE_MAX, BASE_MIN): New.
6355 (froms, tos, width, pos, check): Of base_t type.
6356 (action_number_t, ACTION_MIN, ACTION_MAX): New.
6357 (actrow): Of action_number_t type.
6358 (conflrow): Of unsigned int type.
6359 (table_ninf, base_ninf): New.
6360 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
6361 (muscle_insert_int_table, muscle_insert_base_table)
6362 (muscle_insert_rule_number_table): New.
6363 (prepare_tokens): Output `toknum' as int_table.
6364 (action_row): Returns a rule_number_t.
6365 Use ACTION_MIN, not SHRT_MIN.
6366 (token_actions): yydefact is rule_number_t*.
6367 (table_ninf_remap): New.
6368 (pack_table): Use it for `base' and `table'.
6369 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
6370 replaced with...
6371 (YYPACT_NINF, YYTABLE_NINF): these.
6372 (yypact, yytable): Compute their types instead of hard-coded
6373 `short'.
6374 * tests/regression.at (Web2c Actions): Adjust.
6375
6376 2002-07-19 Akim Demaille <akim@epita.fr>
6377
6378 * src/scan-gram.l (id): Can start with an underscore.
6379
6380 2002-07-16 Akim Demaille <akim@epita.fr>
6381
6382 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
6383 Adjust all former `associativity' dependencies.
6384 * src/symtab.c (symbol_new): Default associativity is `undef', not
6385 `right'.
6386 (symbol_check_alias_consistence): Adjust.
6387
6388 2002-07-09 Akim Demaille <akim@epita.fr>
6389
6390 * doc/bison.texinfo: Properly set the ``header'' part.
6391 Use @dircategory ``GNU programming tools'' as per Texinfo's
6392 documentation.
6393 Use @copying.
6394
6395 2002-07-09 Akim Demaille <akim@epita.fr>
6396
6397 * lib/quotearg.h: Protect against multiple inclusions.
6398 * src/location.h (location_t): Add a `file' member.
6399 (LOCATION_RESET, LOCATION_PRINT): Adjust.
6400 * src/complain.c (warn_at, complain_at, fatal_at): Drop
6401 `error_one_per_line' support.
6402
6403 2002-07-09 Akim Demaille <akim@epita.fr>
6404
6405 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
6406 * src/reader.c (lineno): Remove.
6407 Adjust all dependencies.
6408 (get_merge_function): Take a location and use complain_at.
6409 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
6410 * tests/regression.at (Invalid inputs, Mixing %token styles):
6411 Adjust.
6412
6413 2002-07-09 Akim Demaille <akim@epita.fr>
6414
6415 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
6416 recovery rule, and forbid extensions when --yacc.
6417 (gram_error): Use complain_at.
6418 * src/reader.c (reader): Exit if there were parse errors.
6419
6420 2002-07-09 Akim Demaille <akim@epita.fr>
6421
6422 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
6423 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
6424 Reported by R Blake <blakers@mac.com>.
6425
6426 2002-07-09 Akim Demaille <akim@epita.fr>
6427
6428 * data/yacc.c: Output the copyright notive in the header.
6429
6430 2002-07-03 Akim Demaille <akim@epita.fr>
6431
6432 * src/output.c (froms, tos): Are state_number_t.
6433 (save_column): sp, sp1, and sp2 are state_number_t.
6434 (prepare): Rename `final' as `final_state_number', `nnts' as
6435 `nterms_number', `nrules' as `rules_number', `nstates' as
6436 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
6437 unused.
6438 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
6439 * data/lalr1.cc (nsym_): Remove, unused.
6440
6441 2002-07-03 Akim Demaille <akim@epita.fr>
6442
6443 * src/lalr.h, src/lalr.c (goto_number_t): New.
6444 * src/lalr.c (goto_list_t): New.
6445 Propagate them.
6446 * src/nullable.c (rule_list_t): New.
6447 Propagate.
6448 * src/types.h: Remove.
6449
6450 2002-07-03 Akim Demaille <akim@epita.fr>
6451
6452 * src/closure.c (print_fderives): Use rule_rhs_print.
6453 * src/derives.c (print_derives): Use rule_rhs_print.
6454 (rule_list_t): New, replaces `shorts'.
6455 (set_derives): Add comments.
6456 * tests/sets.at (Nullable, Firsts): Adjust.
6457
6458 2002-07-03 Akim Demaille <akim@epita.fr>
6459
6460 * src/output.c (prepare_actions): Free `tally' and `width'.
6461 (prepare_actions): Allocate and free `order'.
6462 * src/symtab.c (symbols_free): Free `symbols'.
6463 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
6464 * src/output.c (m4_invoke): Move to...
6465 * src/scan-skel.l: here.
6466 (<<EOF>>): Close yyout, and free its name.
6467
6468 2002-07-03 Akim Demaille <akim@epita.fr>
6469
6470 Fix some memory leaks, and fix a bug: state 0 was examined twice.
6471
6472 * src/LR0.c (new_state): Merge into...
6473 (state_list_append): this.
6474 (new_states): Merge into...
6475 (generate_states): here.
6476 (set_states): Don't ensure a proper `errs' state member here, do it...
6477 * src/conflicts.c (conflicts_solve): here.
6478 * src/state.h, src/state.c: Comment changes.
6479 (state_t): Rename member `shifts' as `transitions'.
6480 Adjust all dependencies.
6481 (errs_new): For consistency, also take the values as argument.
6482 (errs_dup): Remove.
6483 (state_errs_set): New.
6484 (state_reductions_set, state_transitions_set): Assert that no
6485 previous value was assigned.
6486 (state_free): New.
6487 (states_free): Use it.
6488 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
6489 temporary storage: use `errs' and `nerrs' as elsewhere.
6490 (set_conflicts): Allocate and free this `errs'.
6491
6492 2002-07-02 Akim Demaille <akim@epita.fr>
6493
6494 * lib/libiberty.h: New.
6495 * lib: Update the bitset implementation from upstream.
6496 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
6497 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
6498 * src/main.c: Adjust bitset stats calls.
6499
6500 2002-07-01 Paul Eggert <eggert@twinsun.com>
6501
6502 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
6503 char, so that negative chars don't collide with $.
6504
6505 2002-06-30 Akim Demaille <akim@epita.fr>
6506
6507 Have the GLR tests be `warning' checked, and fix the warnings.
6508
6509 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
6510 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
6511 (yyremoveDeletes): `yyi' and `yyj' are size_t.
6512 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
6513 (yyaddDeferredAction): static.
6514 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
6515 (yyreportParseError): yyprefix is const.
6516 yytokenp is used only when verbose.
6517 (yy__GNUC__): Replace with __GNUC__.
6518 (yypdumpstack): yyi is size_t.
6519 (yypreference): Un-yy local variables and arguments, to avoid
6520 clashes with `yyr1'. Anyway, we are not in the user name space.
6521 (yytname_size): be an int, as is compared with ints.
6522 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
6523 Use them.
6524 * tests/cxx-gram.at: Use quotation to protect $1.
6525 Use AT_COMPILE to enable warnings hunts.
6526 Prototype yylex and yyerror.
6527 `Use' argc.
6528 Include `string.h', not `strings.h'.
6529 Produce and prototype stmtMerge only when used.
6530 yylex takes a location.
6531
6532 2002-06-30 Akim Demaille <akim@epita.fr>
6533
6534 We spend a lot of time in quotearg, in particular when --verbose.
6535
6536 * src/symtab.c (symbol_get): Store a quoted version of the key.
6537 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
6538 Adjust all callers.
6539
6540 2002-06-30 Akim Demaille <akim@epita.fr>
6541
6542 * src/state.h (reductions_t): Rename member `nreds' as num.
6543 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
6544 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
6545
6546 2002-06-30 Akim Demaille <akim@epita.fr>
6547
6548 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
6549 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
6550 (shifts_to): Rename as...
6551 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
6552 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
6553 (TRANSITION_IS_DISABLED, transitions_to): these.
6554
6555 2002-06-30 Akim Demaille <akim@epita.fr>
6556
6557 * src/print.c (print_shifts, print_gotos): Merge into...
6558 (print_transitions): this.
6559 (print_transitions, print_errs, print_reductions): Align the
6560 lookaheads columns.
6561 (print_core, print_transitions, print_errs, print_state,
6562 print_grammar): Output empty lines separator before, not after.
6563 (state_default_rule_compute): Rename as...
6564 (state_default_rule): this.
6565 * tests/conflicts.at (Defaulted Conflicted Reduction),
6566 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
6567 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
6568
6569 2002-06-30 Akim Demaille <akim@epita.fr>
6570
6571 Display items as we display rules.
6572
6573 * src/gram.h, src/gram.c (rule_lhs_print): New.
6574 * src/gram.c (grammar_rules_partial_print): Use it.
6575 * src/print.c (print_core): Likewise.
6576 * tests/conflicts.at (Defaulted Conflicted Reduction),
6577 (Unresolved SR Conflicts): Adjust.
6578 (Unresolved SR Conflicts): Adjust and rename as...
6579 (Resolved SR Conflicts): this, as was meant.
6580 * tests/regression.at (Web2c Report): Adjust.
6581
6582 2002-06-30 Akim Demaille <akim@epita.fr>
6583
6584 * src/print.c (state_default_rule_compute): New, extracted from...
6585 (print_reductions): here.
6586 Pessimize, but clarify the code.
6587 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
6588
6589 2002-06-30 Akim Demaille <akim@epita.fr>
6590
6591 * src/output.c (action_row): Let default_rule be always a rule
6592 number.
6593
6594 2002-06-30 Akim Demaille <akim@epita.fr>
6595
6596 * src/closure.c (print_firsts, print_fderives, closure):
6597 Use BITSET_EXECUTE.
6598 * src/lalr.c (lookaheads_print): Likewise.
6599 * src/state.c (state_rule_lookaheads_print): Likewise.
6600 * src/print_graph.c (print_core): Likewise.
6601 * src/print.c (print_reductions): Likewise.
6602 * src/output.c (action_row): Likewise.
6603 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
6604
6605 2002-06-30 Akim Demaille <akim@epita.fr>
6606
6607 * src/print_graph.c: Use report_flag.
6608
6609 2002-06-30 Akim Demaille <akim@epita.fr>
6610
6611 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
6612 to...
6613 * src/relation.h, src/relation.c (traverse, relation_digraph)
6614 (relation_print, relation_transpose): New.
6615
6616 2002-06-30 Akim Demaille <akim@epita.fr>
6617
6618 * src/state.h, src/state.c (shifts_to): New.
6619 * src/lalr.c (build_relations): Use it.
6620
6621 2002-06-30 Akim Demaille <akim@epita.fr>
6622
6623 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
6624 (item_number_of_rule_number, rule_number_of_item_number): New.
6625 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
6626 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
6627 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
6628 Propagate their use.
6629 Much remains to be done, in particular wrt `shorts' from types.h.
6630
6631 2002-06-30 Akim Demaille <akim@epita.fr>
6632
6633 * src/symtab.c (symbol_new): Initialize the `printer' member.
6634
6635 2002-06-30 Akim Demaille <akim@epita.fr>
6636
6637 * src/LR0.c (save_reductions): Remove, replaced by...
6638 * src/state.h, src/state.c (state_reductions_set): New.
6639 (reductions, errs): Rename as...
6640 (reductions_t, errs_t): these.
6641 Adjust all dependencies.
6642
6643 2002-06-30 Akim Demaille <akim@epita.fr>
6644
6645 * src/LR0.c (state_list_t, state_list_append): New.
6646 (first_state, last_state): Now symbol_list_t.
6647 (this_state): Remove.
6648 (new_itemsets, append_states, save_reductions): Take a state_t as
6649 argument.
6650 (set_states, generate_states): Adjust.
6651 (save_shifts): Remove, replaced by...
6652 * src/state.h, src/state.c (state_shifts_set): New.
6653 (shifts): Rename as...
6654 (shifts_t): this.
6655 Adjust all dependencies.
6656 * src/state.h (state_t): Remove the `next' member.
6657
6658 2002-06-30 Akim Demaille <akim@epita.fr>
6659
6660 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
6661 escaped in slot 0.
6662
6663 2002-06-30 Akim Demaille <akim@epita.fr>
6664
6665 Use hash.h for the state hash table.
6666
6667 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
6668 (allocate_storage): Use state_hash_new.
6669 (free_storage): Use state_hash_free.
6670 (new_state, get_state): Adjust.
6671 * src/lalr.h, src/lalr.c (states): Move to...
6672 * src/states.h (state_t): Remove the `link' member, no longer
6673 used.
6674 * src/states.h, src/states.c: here.
6675 (state_hash_new, state_hash_free, state_hash_lookup)
6676 (state_hash_insert, states_free): New.
6677 * src/states.c (state_table, state_compare, state_hash): New.
6678 * src/output.c (output_actions): Do not free states now, since we
6679 still need to know the final_state number in `prepare', called
6680 afterwards. Do it...
6681 * src/main.c (main): here: call states_free after `output'.
6682
6683 2002-06-30 Akim Demaille <akim@epita.fr>
6684
6685 * src/state.h, src/state.c (state_new): New, extracted from...
6686 * src/LR0.c (new_state): here.
6687 * src/state.h (STATE_ALLOC): Move to...
6688 * src/state.c: here.
6689 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
6690 * src/state.h, src/state.c: here.
6691
6692 2002-06-30 Akim Demaille <akim@epita.fr>
6693
6694 * src/reader.c (gensym): Rename as...
6695 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
6696 (getsym): Rename as...
6697 (symbol_get): this.
6698
6699 2002-06-30 Akim Demaille <akim@epita.fr>
6700
6701 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
6702 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
6703 * src/output.c, src/print.c, src/print_graph.c: Propagate.
6704 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
6705
6706 2002-06-30 Akim Demaille <akim@epita.fr>
6707
6708 Make the test suite pass with warnings checked.
6709
6710 * tests/actions.at (Printers and Destructors): Improve.
6711 Avoid unsigned vs. signed issues.
6712 * tests/calc.at: Don't exercise the scanner here, do it...
6713 * tests/input.at (Torturing the Scanner): here.
6714
6715 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6716
6717 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
6718 reorganize first lines parallel to yacc.c.
6719
6720 2002-06-28 Akim Demaille <akim@epita.fr>
6721
6722 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
6723 (b4_token_enum, b4_token_defines): New, factored from...
6724 * data/lalr1.cc, data/yacc.c, glr.c: here.
6725
6726 2002-06-28 Akim Demaille <akim@epita.fr>
6727
6728 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
6729 unused variables.
6730 * src/output.c (merger_output): static.
6731
6732 2002-06-28 Akim Demaille <akim@epita.fr>
6733
6734 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
6735 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
6736 pacify GCC.
6737 * src/output.c (save_row): Initialize all the variables to pacify GCC.
6738
6739 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6740
6741 Accumulated changelog for new GLR parsing features.
6742
6743 * src/conflicts.c (count_total_conflicts): Change name to
6744 conflicts_total_count.
6745 * src/conflicts.h: Ditto.
6746 * src/output.c (token_actions): Use the new name.
6747 (output_conflicts): Change conflp => conflict_list_heads, and
6748 confl => conflict_list for better readability.
6749 * data/glr.c: Use the new names.
6750 * NEWS: Add self to GLR announcement.
6751
6752 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
6753
6754 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
6755 Akim Demaille.
6756
6757 * data/bison.glr: Change name to glr.c
6758 * data/glr.c: Renamed from bison.glr.
6759 * data/Makefile.am: Add glr.c
6760
6761 * src/getargs.c:
6762
6763 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
6764 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
6765
6766 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6767
6768 * data/bison.glr: Be sure to restore the
6769 current #line when returning to the skeleton contents after having
6770 exposed the input file's #line.
6771
6772 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6773
6774 * data/bison.glr: Bring up to date with changes to bison.simple.
6775
6776 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6777
6778 * data/bison.glr: Correct definitions that use b4_prefix.
6779 Various reformatting.
6780 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
6781 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
6782 yytokenp argument; now part of stack.
6783 (yychar): Define to behave as documented.
6784 (yyclearin): Ditto.
6785
6786 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6787
6788 * src/reader.h: Add declaration for free_merger_functions.
6789
6790 * src/reader.c (merge_functions): New variable.
6791 (get_merge_function): New function.
6792 (free_merger_functions): New function.
6793 (readgram): Check for %prec that is not followed by a symbol.
6794 Handle %dprec and %merge declarations.
6795 (packgram): Initialize dprec and merger fields in rules array.
6796
6797 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
6798 conflict_list_cnt, conflict_list_free): New variables.
6799 (table_grow): Also grow conflict_table.
6800 (prepare_rules): Output dprec and merger tables.
6801 (conflict_row): New function.
6802 (action_row): Output conflict lists for GLR parser. Don't use
6803 default reduction in conflicted states for GLR parser so that there
6804 are spaces for the conflict lists.
6805 (save_row): Also save conflict information.
6806 (token_actions): Allocate conflict list.
6807 (merger_output): New function.
6808 (pack_vector): Pack conflict table, too.
6809 (output_conflicts): New function to output yyconflp and yyconfl.
6810 (output_check): Allocate conflict_tos.
6811 (output_actions): Output conflict tables, also.
6812 (output_skeleton): Output b4_mergers definition.
6813 (prepare): Output b4_max_rhs_length definition.
6814 Use 'bison.glr' as default skeleton for GLR parsers.
6815
6816 * src/gram.c (glr_parser): New flag.
6817 (grammar_free): Call free_merger_functions.
6818
6819 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
6820 all pairs of conflicting reductions, rather than just all tokens
6821 causing conflicts. Needed to size conflict tables.
6822 (conflicts_output): Modify call to count_rr_conflicts for new
6823 interface.
6824 (conflicts_print): Ditto.
6825 (count_total_conflicts): New function.
6826
6827 * src/reader.h (merger_list): New type.
6828 (merge_functions): New variable.
6829
6830 * src/lex.h (tok_dprec, tok_merge): New token types.
6831
6832 * src/gram.h (rule_s): Add dprec and merger fields.
6833 (glr_parser): New flag.
6834
6835 * src/conflicts.h (count_total_conflicts): New function.
6836
6837 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
6838
6839 * doc/bison.texinfo (Generalized LR Parsing): New section.
6840 (GLR Parsers): New section.
6841 (Language and Grammar): Mention GLR parsing.
6842 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
6843 Correct typo ("tge" -> "the").
6844
6845 * data/bison.glr: New skeleton for GLR parsing.
6846
6847 * tests/cxx-gram.at: New tests for GLR parsing.
6848
6849 * tests/testsuite.at: Include cxx-gram.at.
6850
6851 * tests/Makefile.am: Add cxx-gram.at.
6852
6853 * src/parse-gram.y:
6854
6855 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
6856
6857 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
6858
6859 2002-06-27 Akim Demaille <akim@epita.fr>
6860
6861 * src/options.h, src/options.c: Remove.
6862 * src/getargs.c (short_options, long_options): New.
6863
6864 2002-06-27 Akim Demaille <akim@epita.fr>
6865
6866 * data/bison.simple, data/bison.c++: Rename as...
6867 * data/yacc.c, data/lalr1.cc: these.
6868 * doc/bison.texinfo (Environment Variables): Remove.
6869
6870 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
6871
6872 * src/getargs.c (report_argmatch): Initialize strtok().
6873
6874 2002-06-20 Akim Demaille <akim@epita.fr>
6875
6876 * data/bison.simple (b4_symbol_actions): New, replaces...
6877 (b4_symbol_destructor, b4_symbol_printer): these.
6878 (yysymprint): Be sure to call YYPRINT only for tokens, and using
6879 user token numbers.
6880
6881 2002-06-20 Akim Demaille <akim@epita.fr>
6882
6883 * data/bison.simple (yydestructor): Rename as...
6884 (yydestruct): this.
6885
6886 2002-06-20 Akim Demaille <akim@epita.fr>
6887
6888 * src/symtab.h, src/symtab.c (symbol_type_set)
6889 (symbol_destructor_set, symbol_precedence_set): The location is
6890 the last argument.
6891 Adjust all callers.
6892
6893 2002-06-20 Akim Demaille <akim@epita.fr>
6894
6895 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
6896 internals.
6897 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
6898 Takes a location.
6899 * src/symtab.h, src/symtab.c (symbol_class_set)
6900 (symbol_user_token_number_set): Likewise.
6901 Adjust all callers.
6902 Promote complain_at.
6903 * tests/input.at (Type Clashes): Adjust.
6904
6905 2002-06-20 Akim Demaille <akim@epita.fr>
6906
6907 * data/bison.simple (YYLEX): Fix the declaration when
6908 %pure-parser.
6909
6910 2002-06-20 Akim Demaille <akim@epita.fr>
6911
6912 * data/bison.simple (yysymprint): Don't print the token number,
6913 just its name.
6914 * tests/actions.at (Destructors): Rename as...
6915 (Printers and Destructors): this.
6916 Also exercise %printer.
6917
6918 2002-06-20 Akim Demaille <akim@epita.fr>
6919
6920 * data/bison.simple (YYDSYMPRINT): New.
6921 Use it to remove many of the #if YYDEBUG/if (yydebug).
6922
6923 2002-06-20 Akim Demaille <akim@epita.fr>
6924
6925 * src/symtab.h, src/symtab.c (symbol_t): printer and
6926 printer_location are new members.
6927 (symbol_printer_set): New.
6928 * src/parse-gram.y (PERCENT_PRINTER): New token.
6929 Handle its associated rule.
6930 * src/scan-gram.l: Adjust.
6931 (handle_destructor_at, handle_destructor_dollar): Rename as...
6932 (handle_symbol_code_at, handle_symbol_code_dollar): these.
6933 * src/output.c (symbol_printers_output): New.
6934 (output_skeleton): Call it.
6935 * data/bison.simple (yysymprint): New. Cannot be named yyprint
6936 since there are already many grammar files with a user `yyprint'.
6937 Replace the calls to YYPRINT to calls to yysymprint.
6938 * tests/calc.at: Adjust.
6939 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
6940 taking advantage of parser very internal details (stack size!).
6941
6942 2002-06-20 Akim Demaille <akim@epita.fr>
6943
6944 * src/scan-gram.l: Complete the scanner with the missing patterns
6945 to pacify Flex.
6946 Use `quote' and `symbol_tag_get' where appropriate.
6947
6948 2002-06-19 Akim Demaille <akim@epita.fr>
6949
6950 * tests/actions.at (Destructors): Augment to test locations.
6951 * data/bison.simple (yydestructor): Pass it the current location
6952 if locations are enabled.
6953 Prototype only when __STDC__ or C++.
6954 Change the argument names to move into the yy name space: there is
6955 user code here.
6956
6957 2002-06-19 Akim Demaille <akim@epita.fr>
6958
6959 * data/bison.simple (b4_pure_if): New.
6960 Use it instead of #ifdef YYPURE.
6961
6962 2002-06-19 Akim Demaille <akim@epita.fr>
6963
6964 * data/bison.simple (b4_location_if): New.
6965 Use it instead of #ifdef YYLSP_NEEDED.
6966
6967 2002-06-19 Akim Demaille <akim@epita.fr>
6968
6969 Prepare @$ in %destructor, but currently don't bind it in the
6970 skeleton, as %location use is not cleaned up yet.
6971
6972 * src/scan-gram.l (handle_dollar, handle_destructor_at)
6973 (handle_action_at): New.
6974 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
6975 a braced_code_t and a location as additional arguments.
6976 (handle_destructor_dollar): Instead of requiring `b4_eval', just
6977 unquote one when outputting `b4_dollar_dollar'.
6978 Adjust callers.
6979 * data/bison.simple (b4_eval): Remove.
6980 (b4_symbol_destructor): Adjust.
6981 * tests/input.at (Invalid @n): Adjust.
6982
6983 2002-06-19 Zack Weinberg <zack@codesourcery.com>
6984
6985 * doc/bison.texinfo: Document ability to have multiple
6986 prologue sections.
6987
6988 2002-06-18 Akim Demaille <akim@epita.fr>
6989
6990 * src/files.c (compute_base_names): When computing the output file
6991 names from the input file name, strip the directory part.
6992
6993 2002-06-18 Akim Demaille <akim@epita.fr>
6994
6995 * data/bison.simple.new: Comment changes.
6996 Reported by Andreas Schwab.
6997
6998 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
6999
7000 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
7001 there are no `label `yyoverflowlab' defined but not used' warnings
7002 when yyoverflow is defined.
7003
7004 2002-06-18 Akim Demaille <akim@epita.fr>
7005
7006 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
7007 new member.
7008 (symbol_destructor_set): Adjust.
7009 * src/output.c (symbol_destructors_output): Output the destructor
7010 locations.
7011 Output the symbol name.
7012 * data/bison.simple (b4_symbol_destructor): Adjust.
7013
7014 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
7015 and Akim Demaille <akim@epita.fr>
7016
7017 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
7018 what's left on the stack when the error recovery hits EOF.
7019 * tests/actions.at (Destructors): Complete to exercise this case.
7020
7021 2002-06-17 Akim Demaille <akim@epita.fr>
7022
7023 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
7024 arguments is really empty, not only equal to `[]'.
7025 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
7026 member.
7027 (symbol_destructor_set): New.
7028 * src/output.c (symbol_destructors_output): New.
7029 * src/reader.h (brace_code_t, current_braced_code): New.
7030 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
7031 (handle_dollar): Rename as...
7032 (handle_action_dollar): this.
7033 (handle_destructor_dollar): New.
7034 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
7035 (grammar_declaration): Use it.
7036 * data/bison.simple (yystos): Is always defined.
7037 (yydestructor): New.
7038 * tests/actions.at (Destructors): New.
7039 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
7040
7041 2002-06-17 Akim Demaille <akim@epita.fr>
7042
7043 * src/symlist.h, src/symlist.c (symbol_list_length): New.
7044 * src/scan-gram.l (handle_dollar, handle_at): Compute the
7045 rule_length only when needed.
7046 * src/output.c (actions_output, token_definitions_output): Output
7047 the full M4 block.
7048 * src/symtab.c: Don't access directly to the symbol tag, use
7049 symbol_tag_get.
7050 * src/parse-gram.y: Use symbol_list_free.
7051
7052 2002-06-17 Akim Demaille <akim@epita.fr>
7053
7054 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
7055 (symbol_list_prepend, get_type_name): Move to...
7056 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
7057 (symbol_list_prepend, symbol_list_n_type_name_get): here.
7058 Adjust all callers.
7059 (symbol_list_free): New.
7060 * src/scan-gram.l (handle_dollar): Takes a location.
7061 * tests/input.at (Invalid $n): Adjust.
7062
7063 2002-06-17 Akim Demaille <akim@epita.fr>
7064
7065 * src/reader.h, src/reader.c (symbol_list_new): Export it.
7066 (symbol_list_prepend): New.
7067 * src/parse-gram.y (%union): `list' is a new member.
7068 (symbols.1): New, replaces...
7069 (terms_to_prec.1, nterms_to_type.1): these.
7070 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
7071 Take a location as additional argument.
7072 Adjust all callers.
7073
7074 2002-06-15 Akim Demaille <akim@epita.fr>
7075
7076 * src/parse-gram.y: Move %token in the declaration section so that
7077 we don't depend upon CVS Bison.
7078
7079 2002-06-15 Akim Demaille <akim@epita.fr>
7080
7081 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
7082 * src/print.c (print_core): Use it.
7083
7084 2002-06-15 Akim Demaille <akim@epita.fr>
7085
7086 * src/conflicts.c (log_resolution): Accept the rule involved in
7087 the sr conflicts instead of the lookahead number that points to
7088 that rule.
7089 (flush_reduce): Accept the current lookahead vector as argument,
7090 instead of the index in LA.
7091 (resolve_sr_conflict): Accept the current number of lookahead
7092 bitset to consider for the STATE, instead of the index in LA.
7093 (set_conflicts): Adjust.
7094 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
7095
7096 2002-06-15 Akim Demaille <akim@epita.fr>
7097
7098 * src/state.h (state_t): Replace the `lookaheadsp' member, a
7099 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
7100 Adjust all dependencies.
7101 * src/lalr.c (initialize_lookaheads): Split into...
7102 (states_lookaheads_count, states_lookaheads_initialize): these.
7103 (lalr): Adjust.
7104
7105 2002-06-15 Akim Demaille <akim@epita.fr>
7106
7107 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
7108 out of...
7109 (grammar_rules_print): here.
7110 * src/reduce.c (reduce_output): Use it.
7111 * tests/reduce.at (Useless Rules, Reduced Automaton)
7112 (Underivable Rules): Adjust.
7113
7114 2002-06-15 Akim Demaille <akim@epita.fr>
7115
7116 Copy BYacc's nice way to report the grammar.
7117
7118 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
7119 New.
7120 Don't print the rules' location, it is confusing and useless.
7121 (rule_print): Use grammar_rhs_print.
7122 * src/print.c (print_grammar): Use grammar_rules_print.
7123
7124 2002-06-15 Akim Demaille <akim@epita.fr>
7125
7126 Complete and rationalize `useless thing' warnings.
7127
7128 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
7129 (symbol_tag_print): New.
7130 Use them everywhere in place of accessing directly the tag member.
7131 * src/gram.h, src/gram.c (rule_print): New.
7132 Use it where a rule used to be printed `by hand'.
7133 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
7134 (reduce_grammar_tables): Report the useless rules.
7135 (reduce_print): Useless things are a warning, not an error.
7136 Report it as such.
7137 * tests/reduce.at (Useless Nonterminals, Useless Rules):
7138 (Reduced Automaton, Underivable Rules): Adjust.
7139 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
7140 * tests/conflicts.at (Unresolved SR Conflicts)
7141 (Solved SR Conflicts): Adjust.
7142
7143 2002-06-15 Akim Demaille <akim@epita.fr>
7144
7145 Let symbols have a location.
7146
7147 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
7148 (getsym): Adjust.
7149 Adjust all callers.
7150 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
7151 Use location_t, not int.
7152 * src/symtab.c (symbol_check_defined): Take advantage of the
7153 location.
7154 * tests/regression.at (Invalid inputs): Adjust.
7155
7156 2002-06-15 Akim Demaille <akim@epita.fr>
7157
7158 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
7159 (input): Don't try to initialize yylloc here, do it in the
7160 scanner.
7161 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
7162 * src/gram.h (rule_t): Change line and action_line into location
7163 and action_location, of location_t type.
7164 Adjust all dependencies.
7165 * src/location.h, src/location.c (empty_location): New.
7166 * src/reader.h, src/reader.c (grammar_start_symbol_set)
7167 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
7168 (grammar_current_rule_symbol_append)
7169 (grammar_current_rule_action_append): Expect a location as argument.
7170 * src/reader.c (grammar_midrule_action): Adjust to attach an
7171 action's location as dummy symbol location.
7172 * src/symtab.h, src/symtab.c (startsymbol_location): New.
7173 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
7174 the line numbers.
7175
7176 2002-06-14 Akim Demaille <akim@epita.fr>
7177
7178 Grammar declarations may be found in the grammar section.
7179
7180 * src/parse-gram.y (rules_or_grammar_declaration): New.
7181 (declarations): Each declaration may end with a semicolon, not
7182 just...
7183 (grammar_declaration): `"%union"'.
7184 (grammar): Branch to rules_or_grammar_declaration.
7185
7186 2002-06-14 Akim Demaille <akim@epita.fr>
7187
7188 * src/main.c (main): Invoke scanner_free.
7189
7190 2002-06-14 Akim Demaille <akim@epita.fr>
7191
7192 * src/output.c (m4_invoke): Extracted from...
7193 (output_skeleton): here.
7194 Free tempfile.
7195
7196 2002-06-14 Akim Demaille <akim@epita.fr>
7197
7198 * src/parse-gram.y (directives, directive, gram)
7199 (grammar_directives, precedence_directives, precedence_directive):
7200 Rename as...
7201 (declarations, declaration, grammar, grammar_declaration)
7202 (precedence_declaration, precedence_declarator): these.
7203 (symbol_declaration): New.
7204
7205 2002-06-14 Akim Demaille <akim@epita.fr>
7206
7207 * src/files.c (action_obstack): Remove, unused.
7208 (output_obstack): Remove it, and all its dependencies, as it is no
7209 longer needed.
7210 * src/reader.c (epilogue_set): Build the epilogue in the
7211 muscle_obstack.
7212 * src/output.h, src/output.c (muscle_obstack): Move to...
7213 * src/muscle_tab.h, src/muscle_tab.h: here.
7214 (muscle_init): Initialize muscle_obstack.
7215 (muscle_free): New.
7216 * src/main.c (main): Call it.
7217
7218 2002-06-14 Akim Demaille <akim@epita.fr>
7219
7220 * src/location.h: New, extracted from...
7221 * src/reader.h: here.
7222 * src/Makefile.am (noinst_HEADERS): Merge into
7223 (bison_SOURCES): this.
7224 Add location.h.
7225 * src/parse-gram.y: Use location_t instead of Bison's.
7226 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
7227 Use location_t instead of ints.
7228
7229 2002-06-14 Akim Demaille <akim@epita.fr>
7230
7231 * data/bison.simple, data/bison.c++: Be sure to restore the
7232 current #line when returning to the skeleton contents after having
7233 exposed the input file's #line.
7234
7235 2002-06-12 Akim Demaille <akim@epita.fr>
7236
7237 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
7238 eager.
7239 * tests/actions.at (Exotic Dollars): New.
7240
7241 2002-06-12 Akim Demaille <akim@epita.fr>
7242
7243 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
7244 ['"/] too eagerly.
7245 * tests/input.at (Torturing the Scanner): New.
7246
7247 2002-06-11 Akim Demaille <akim@epita.fr>
7248
7249 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
7250 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
7251 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
7252 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
7253 * src/reader.c (reader): Use it.
7254
7255 2002-06-11 Akim Demaille <akim@epita.fr>
7256
7257 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
7258 Adjust all callers.
7259 (scanner_last_string_free): New.
7260
7261 2002-06-11 Akim Demaille <akim@epita.fr>
7262
7263 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
7264 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
7265 (last_string, YY_OBS_FREE): New.
7266 Use them when returning an ID.
7267
7268 2002-06-11 Akim Demaille <akim@epita.fr>
7269
7270 Have Bison grammars parsed by a Bison grammar.
7271
7272 * src/reader.c, src/reader.h (prologue_augment): New.
7273 * src/reader.c (copy_definition): Remove.
7274
7275 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
7276 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
7277 (grammar_current_rule_prec_set, grammar_current_rule_check)
7278 (grammar_current_rule_symbol_append)
7279 (grammar_current_rule_action_append): Export.
7280 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
7281 (symbol_list_action_append): Remove.
7282 Hook the routines from reader.
7283 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
7284 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
7285
7286 * src/reader.c (read_declarations): Remove, unused.
7287
7288 * src/parse-gram.y: Handle the epilogue.
7289 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
7290 (grammar_start_symbol_set): this.
7291 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
7292 * src/reader.c (readgram): Remove, unused.
7293 (reader): Adjust to insert eoftoken and axiom where appropriate.
7294
7295 * src/reader.c (copy_dollar): Replace with...
7296 * src/scan-gram.h (handle_dollar): this.
7297 * src/parse-gram.y: Remove `%thong'.
7298
7299 * src/reader.c (copy_at): Replace with...
7300 * src/scan-gram.h (handle_at): this.
7301
7302 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
7303 New.
7304
7305 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
7306 time being.
7307
7308 * src/reader.h, src/reader.c (grammar_rule_end): New.
7309
7310 * src/parse.y (current_type, current_class): New.
7311 Implement `%nterm', `%token' support.
7312 Merge `%term' into `%token'.
7313 (string_as_id): New.
7314 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
7315 type name.
7316
7317 * src/parse-gram.y: Be sure to handle properly the beginning of
7318 rules.
7319
7320 * src/parse-gram.y: Handle %type.
7321 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
7322
7323 * src/parse-gram.y: More directives support.
7324 * src/options.c: No longer handle source directives.
7325
7326 * src/parse-gram.y: Fix %output.
7327
7328 * src/parse-gram.y: Handle %union.
7329 Use the prologue locations.
7330 * src/reader.c (parse_union_decl): Remove.
7331
7332 * src/reader.h, src/reader.c (epilogue_set): New.
7333 * src/parse-gram.y: Use it.
7334
7335 * data/bison.simple, data/bison.c++: b4_stype is now either not
7336 defined, then default to int, or to the contents of %union,
7337 without `union' itself.
7338 Adjust.
7339 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
7340
7341 * src/output.c (actions_output): Don't output braces, as they are
7342 already handled by the scanner.
7343
7344 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
7345 characters to themselves.
7346
7347 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
7348 that the epilogue has a proper #line.
7349
7350 * src/parse-gram.y: Handle precedence/associativity.
7351
7352 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
7353 a terminal.
7354 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
7355 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
7356 at all to define terminals that cannot be emitted.
7357
7358 * src/scan-gram.l: Escape M4 characters.
7359
7360 * src/scan-gram.l: Working properly with escapes in user
7361 strings/characters.
7362
7363 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
7364 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
7365 grammar.
7366 Use more modest sizes, as for the time being the parser does not
7367 release memory, and therefore the process swallows a huge amount
7368 of memory.
7369
7370 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
7371 stricter %token grammar.
7372
7373 * src/symtab.h (associativity): Add `undef_assoc'.
7374 (symbol_precedence_set): Do nothing when passed an undef_assoc.
7375 * src/symtab.c (symbol_check_alias_consistence): Adjust.
7376
7377 * tests/regression.at (Invalid %directive): Remove, as it is now
7378 meaningless.
7379 (Invalid inputs): Adjust to the new error messages.
7380 (Token definitions): The new grammar doesn't allow too many
7381 eccentricities.
7382
7383 * src/lex.h, src/lex.c: Remove.
7384 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
7385 (copy_character, copy_string2, copy_string, copy_identifier)
7386 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
7387 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
7388 (parse_action): Remove.
7389 * po/POTFILES.in: Adjust.
7390
7391 2002-06-11 Akim Demaille <akim@epita.fr>
7392
7393 * src/reader.c (parse_action): Don't store directly into the
7394 rule's action member: return the action as a string.
7395 Don't require `rule_length' as an argument: compute it.
7396 (grammar_current_rule_symbol_append)
7397 (grammar_current_rule_action_append): New, eved out from
7398 (readgram): here.
7399 Remove `action_flag', `rulelength', unused now.
7400
7401 2002-06-11 Akim Demaille <akim@epita.fr>
7402
7403 * src/reader.c (grammar_current_rule_prec_set).
7404 (grammar_current_rule_check): New, eved out from...
7405 (readgram): here.
7406 Remove `xaction', `first_rhs': useless.
7407 * tests/input.at (Type clashes): New.
7408 * tests/existing.at (GNU Cim Grammar): Adjust.
7409
7410 2002-06-11 Akim Demaille <akim@epita.fr>
7411
7412 * src/reader.c (grammar_midrule_action): New, Eved out from
7413 (readgram): here.
7414
7415 2002-06-11 Akim Demaille <akim@epita.fr>
7416
7417 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
7418 New.
7419 (readgram): Use them as replacement of inlined code, crule and
7420 crule1.
7421
7422 2002-06-11 Akim Demaille <akim@epita.fr>
7423
7424 * src/reader.c (grammar_end, grammar_symbol_append): New.
7425 (readgram): Use them.
7426 Make the use of `p' as local as possible.
7427
7428 2002-06-10 Akim Demaille <akim@epita.fr>
7429
7430 GCJ's parser requires the tokens to be defined before the prologue.
7431
7432 * data/bison.simple: Output the token definition before the user's
7433 prologue.
7434 * tests/regression.at (Braces parsing, Duplicate string)
7435 (Mixing %token styles): Check the output from bison.
7436 (Early token definitions): New.
7437
7438 2002-06-10 Akim Demaille <akim@epita.fr>
7439
7440 * src/symtab.c (symbol_user_token_number_set): Don't complain when
7441 assigning twice the same user number to a token, so that we can
7442 use it in...
7443 * src/lex.c (lex): here.
7444 Also use `symbol_class_set' instead of hand written code.
7445 * src/reader.c (parse_assoc_decl): Likewise.
7446
7447 2002-06-10 Akim Demaille <akim@epita.fr>
7448
7449 * src/symtab.c, src/symtab.c (symbol_class_set)
7450 (symbol_user_token_number_set): New.
7451 * src/reader.c (parse_token_decl): Use them.
7452 Use a switch instead of ifs.
7453 Use a single argument.
7454
7455 2002-06-10 Akim Demaille <akim@epita.fr>
7456
7457 Remove `%thong' support as it is undocumented, unused, duplicates
7458 `%token's job, and creates useless e-mail traffic with people who
7459 want to know what it is, why it is undocumented, unused, and
7460 duplicates `%token's job.
7461
7462 * src/reader.c (parse_thong_decl): Remove.
7463 * src/options.c (option_table): Remove "thong".
7464 * src/lex.h (tok_thong): Remove.
7465
7466 2002-06-10 Akim Demaille <akim@epita.fr>
7467
7468 * src/symtab.c, src/symtab.c (symbol_type_set)
7469 (symbol_precedence_set): New.
7470 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
7471 (value_components_used): Remove, unused.
7472
7473 2002-06-09 Akim Demaille <akim@epita.fr>
7474
7475 Move symbols handling code out of the reader.
7476
7477 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
7478 (axiom): Move to...
7479 * src/symtab.h, src/symtab.c: here.
7480
7481 * src/gram.c (start_symbol): Remove: use startsymbol->number.
7482 * src/reader.c (startval): Rename as...
7483 * src/symtab.h, src/symtab.c (startsymbol): this.
7484 * src/reader.c: Adjust.
7485
7486 * src/reader.c (symbol_check_defined, symbol_make_alias)
7487 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
7488 (token_translations_init)
7489 Move to...
7490 * src/symtab.c: here.
7491 * src/reader.c (packsymbols): Move to...
7492 * src/symtab.h, src/symtab.c (symbols_pack): here.
7493 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
7494 argument.
7495
7496 2002-06-03 Akim Demaille <akim@epita.fr>
7497
7498 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
7499 then statements.
7500
7501 2002-06-03 Akim Demaille <akim@epita.fr>
7502
7503 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
7504 structs with non literals.
7505 * src/scan-skel.l: never-interactive.
7506 * src/conflicts.c (enum conflict_resolution_e): No trailing
7507 comma.
7508 * src/getargs.c (usage): Split long literal strings.
7509 Reported by Hans Aberg.
7510
7511 2002-05-28 Akim Demaille <akim@epita.fr>
7512
7513 * data/bison.c++: Use C++ ostreams.
7514 (cdebug_): New member.
7515
7516 2002-05-28 Akim Demaille <akim@epita.fr>
7517
7518 * src/output.c (output_skeleton): Be sure to allocate enough room
7519 for `/' _and_ for `\0' in full_skeleton.
7520
7521 2002-05-28 Akim Demaille <akim@epita.fr>
7522
7523 * data/bison.c++: Catch up with bison.simple:
7524 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7525 and Paul Eggert <eggert@twinsun.com>: `error' handing.
7526 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
7527 and popping traces.
7528
7529 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7530
7531 * src/output.c (output_skeleton): Put an explicit path in front of
7532 the skeleton file name, rather than relying on the -I directory,
7533 to partially alleviate effects of having a skeleton file lying around
7534 in the current directory.
7535
7536 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7537
7538 * src/conflicts.c (log_resolution): Correct typo:
7539 obstack_printf should be obstack_fgrow1.
7540
7541 2002-05-26 Akim Demaille <akim@epita.fr>
7542
7543 * src/state.h (state_t): `solved_conflicts' is a new member.
7544 * src/LR0.c (new_state): Set it to 0.
7545 * src/conflicts.h, src/conflicts.c (print_conflicts)
7546 (free_conflicts, solve_conflicts): Rename as...
7547 (conflicts_print, conflicts_free, conflicts_solve): these.
7548 Adjust callers.
7549 * src/conflicts.c (enum conflict_resolution_e)
7550 (solved_conflicts_obstack): New, used by...
7551 (log_resolution): this.
7552 Adjust to attach the conflict resolution to each state.
7553 Complete the description with the precedence/associativity
7554 information.
7555 (resolve_sr_conflict): Adjust.
7556 * src/print.c (print_state): Output its solved_conflicts.
7557 * tests/conflicts.at (Unresolved SR Conflicts)
7558 (Solved SR Conflicts): Exercise --report=all.
7559
7560 2002-05-26 Akim Demaille <akim@epita.fr>
7561
7562 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
7563 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
7564 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
7565 (token_number_t, item_number_as_token_number)
7566 (token_number_as_item_number, muscle_insert_token_number_table):
7567 Rename as...
7568 (symbol_number_t, item_number_as_symbol_number)
7569 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
7570 these, since it is more appropriate.
7571
7572 2002-05-26 Akim Demaille <akim@epita.fr>
7573
7574 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
7575 `Error:' lines.
7576 * data/bison.simple (yystos) [YYDEBUG]: New.
7577 (yyparse) [YYDEBUG]: Display the symbols which are popped during
7578 error recovery.
7579 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
7580
7581 2002-05-25 Akim Demaille <akim@epita.fr>
7582
7583 * doc/bison.texinfo (Debugging): Split into...
7584 (Tracing): this new section, its former contents, and...
7585 (Understanding): this new section.
7586 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
7587 by...
7588 (report_flag): this.
7589 Adjust all dependencies.
7590 (report_args, report_types, report_argmatch): New.
7591 (usage, getargs): Report/support -r, --report.
7592 * src/options.h
7593 (struct option_table_struct): Rename as..,
7594 (struct option_table_s): this.
7595 Rename the `set_flag' member to `flag' to match with getopt_long's
7596 struct.
7597 * src/options.c (option_table): Split verbose into an entry for
7598 %verbose, and another for --verbose.
7599 Support --report/-r, so remove -r from the obsolete --raw.
7600 * src/print.c: Attach full item sets and lookaheads reports to
7601 report_flag instead of trace_flag.
7602 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
7603
7604 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7605 and Paul Eggert <eggert@twinsun.com>
7606
7607 * data/bison.simple (yyparse): Correct error handling to conform to
7608 POSIX and yacc. Specifically, after syntax error is discovered,
7609 do not reduce further before shifting the error token.
7610 Clean up the code a bit by removing the labels yyerrdefault,
7611 yyerrhandle, yyerrpop.
7612 * NEWS: Document the above.
7613
7614 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7615
7616 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
7617 type; it isn't always big enough, since it doesn't necessarily
7618 include non-terminals.
7619 (yytranslate): Expand definition of yy_token_number_type, so that
7620 the latter can be removed.
7621 (yy_token_number_type): Remove, only one use.
7622 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
7623 don't use TokenNumberType as element type.
7624
7625 * tests/regression.at: Modify expected output to agree with change
7626 to yyr1 and yytranslate.
7627
7628 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
7629
7630 * src/reader.c (parse_action): Use copy_character instead of
7631 obstack_1grow.
7632
7633 2002-05-13 Akim Demaille <akim@epita.fr>
7634
7635 * tests/regression.at (Token definitions): Prototype yylex and
7636 yyerror.
7637
7638 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7639
7640 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
7641 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
7642 32-bit arithmetic.
7643 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
7644
7645 2002-05-07 Akim Demaille <akim@epita.fr>
7646
7647 * tests/synclines.at: Be sure to prototype yylex and yyerror to
7648 avoid GCC warnings.
7649
7650 2002-05-07 Akim Demaille <akim@epita.fr>
7651
7652 Kill GCC warnings.
7653
7654 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
7655 over the RHS of each rule.
7656 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
7657 * src/state.h (state_t): Member `nitems' is unsigned short.
7658 * src/LR0.c (get_state): Adjust.
7659 * src/reader.c (packgram): Likewise.
7660 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
7661 `Type'.
7662 (muscle_insert_int_table): Remove, unused.
7663 (prepare_rules): Remove `max'.
7664
7665 2002-05-06 Akim Demaille <akim@epita.fr>
7666
7667 * src/closure.c (print_firsts): Display of the symbol tags.
7668 (bitmatrix_print): Move to...
7669 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
7670 here.
7671 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
7672
7673 2002-05-06 Akim Demaille <akim@epita.fr>
7674
7675 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
7676 hash_do_for_each.
7677
7678 2002-05-06 Akim Demaille <akim@epita.fr>
7679
7680 * src/LR0.c (new_state, get_state): Instead of using the global
7681 `kernel_size' and `kernel_base', have two new arguments:
7682 `core_size' and `core'.
7683 Adjust callers.
7684
7685 2002-05-06 Akim Demaille <akim@epita.fr>
7686
7687 * src/reader.c (packgram): No longer end `ritem' with a 0
7688 sentinel: it is not used.
7689
7690 2002-05-05 Akim Demaille <akim@epita.fr>
7691
7692 New experimental feature: display the lookaheads in the report and
7693 graph.
7694
7695 * src/print (print_core): When --trace-flag, display the rules
7696 lookaheads.
7697 * src/print_graph.c (print_core): Likewise.
7698 Swap the arguments.
7699 Adjust caller.
7700
7701 2002-05-05 Akim Demaille <akim@epita.fr>
7702
7703 * tests/torture.at (Many lookaheads): New test.
7704
7705 2002-05-05 Akim Demaille <akim@epita.fr>
7706
7707 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
7708 (GENERATE_MUSCLE_INSERT_TABLE): this.
7709 (output_int_table, output_unsigned_int_table, output_short_table)
7710 (output_token_number_table, output_item_number_table): Replace with...
7711 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
7712 (muscle_insert_short_table, muscle_insert_token_number_table)
7713 (muscle_insert_item_number_table): these.
7714 Adjust all callers.
7715 (prepare_tokens): Don't free `translations', since...
7716 * src/reader.h, src/reader.c (grammar_free): do it.
7717 Move to...
7718 * src/gram.h, src/gram.c (grammar_free): here.
7719 * data/bison.simple, data/bison.c++: b4_token_number_max is now
7720 b4_translate_max.
7721
7722 2002-05-05 Akim Demaille <akim@epita.fr>
7723
7724 * src/output.c (output_unsigned_int_table): New.
7725 (prepare_rules): `i' is unsigned.
7726 `prhs', `rline', `r2' are unsigned int.
7727 Rename muscle `rhs_number_max' as `rhs_max'.
7728 Output muscles `prhs_max', `rline_max', and `r2_max'.
7729 Free rline and r1.
7730 * data/bison.simple, data/bison.c++: Adjust to use these muscles
7731 to compute types instead of constant types.
7732 * tests/regression.at (Web2c Actions): Adjust.
7733
7734 2002-05-04 Akim Demaille <akim@epita.fr>
7735
7736 * src/symtab.h (SALIAS, SUNDEF): Rename as...
7737 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
7738 Adjust dependencies.
7739 * src/output.c (token_definitions_output): Be sure not to output a
7740 `#define 'a'' when fed with `%token 'a' "a"'.
7741 * tests/regression.at (Token definitions): New.
7742
7743 2002-05-03 Paul Eggert <eggert@twinsun.com>
7744
7745 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
7746 for K&R C.
7747
7748 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
7749
7750 * Makefile.am (SUBDIRS): Remove intl.
7751 (EXTRA_DIST): Add config/config.rpath.
7752
7753 2002-05-03 Akim Demaille <akim@epita.fr>
7754
7755 * data/bison.simple (m4_if): Don't output empty enums.
7756 And actually, output valid enum definitions :(.
7757
7758 2002-05-03 Akim Demaille <akim@epita.fr>
7759
7760 * configure.bat: Remove, completely obsolete.
7761 * Makefile.am (EXTRA_DIST): Adjust.
7762 Don't distribute config.rpath...
7763 * config/Makefile.am (EXTRA_DIST): Do it.
7764
7765 2002-05-03 Akim Demaille <akim@epita.fr>
7766
7767 * configure.in (GETTEXT_VERSION): New.
7768 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
7769
7770 2002-05-03 Akim Demaille <akim@epita.fr>
7771
7772 * data/bison.simple (b4_token_enum): New.
7773 (b4_token_defines): Use it to output tokens both as #define and
7774 enums.
7775 Suggested by Paul Eggert.
7776 * src/output.c (token_definitions_output): Don't output spurious
7777 white spaces.
7778
7779 2002-05-03 Akim Demaille <akim@epita.fr>
7780
7781 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
7782
7783 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
7784
7785 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
7786 Update the stack class, give a try to deque as the default container.
7787
7788 2002-05-02 Akim Demaille <akim@epita.fr>
7789
7790 * data/bison.simple (yyparse): Do not implement @$ = @1.
7791 (YYLLOC_DEFAULT): Adjust to do it.
7792 * doc/bison.texinfo (Location Default Action): Fix.
7793
7794 2002-05-02 Akim Demaille <akim@epita.fr>
7795
7796 * src/reader.c (parse_braces): Merge into...
7797 (parse_action): this.
7798
7799 2002-05-02 Akim Demaille <akim@epita.fr>
7800
7801 * configure.in (ALL_LINGUAS): Remove.
7802 * po/LINGUAS, hr.po: New.
7803
7804 2002-05-02 Akim Demaille <akim@epita.fr>
7805
7806 Remove the so called hairy (semantic) parsers.
7807
7808 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
7809 * src/gram.h, src/gram.c (semantic_parser): Remove.
7810 (rule_t): Remove the guard and guard_line members.
7811 * src/lex.h (token_t): remove tok_guard.
7812 * src/options.c (option_table): Remove %guard and %semantic_parser
7813 support.
7814 * src/output.c, src/output.h (guards_output): Remove.
7815 (prepare): Adjust.
7816 (token_definitions_output): Don't output the `T'
7817 tokens (???).
7818 (output_skeleton): Don't output the guards.
7819 * src/files.c, src/files.c (attrsfile): Remove.
7820 * src/reader.c (symbol_list): Remove the guard and guard_line
7821 members.
7822 Adjust dependencies.
7823 (parse_guard): Remove.
7824 * data/bison.hairy: Remove.
7825 * doc/bison.texinfo (Environment Variables): Remove occurrences of
7826 BISON_HAIRY.
7827
7828 2002-05-02 Akim Demaille <akim@epita.fr>
7829
7830 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
7831 (parse_guard): Rename the formal argument `stack_offset' as
7832 `rule_length', which is more readable.
7833 Adjust callers.
7834 (copy_at, copy_dollar): Instead of outputting the hard coded
7835 values of $$, $n and so forth, output invocation to b4_lhs_value,
7836 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
7837 Note: this patch partially drops `semantic-parser' support: it
7838 always does `rule_length - n', where semantic parsers ought to
7839 always use `-n'.
7840 * data/bison.simple, data/bison.c++ (b4_lhs_value)
7841 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
7842
7843 2002-05-02 Akim Demaille <akim@epita.fr>
7844
7845 * configure.in (AC_INIT): Bump to 1.49b.
7846 (AM_INIT_AUTOMAKE): Short invocation.
7847
7848 2002-05-02 Akim Demaille <akim@epita.fr>
7849
7850 Version 1.49a.
7851
7852 2002-05-01 Akim Demaille <akim@epita.fr>
7853
7854 * src/skeleton.h: Remove.
7855
7856 2002-05-01 Akim Demaille <akim@epita.fr>
7857
7858 * src/skeleton.h: Fix the #endif.
7859 Reported by Magnus Fromreide.
7860
7861 2002-04-26 Paul Eggert <eggert@twinsun.com>
7862
7863 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
7864 Define if we define YYSTYPE and YYLTYPE, respectively.
7865 (YYCOPY): Fix [] quoting problem in the non-GCC case.
7866
7867 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
7868
7869 * src/scan-skel.l: Postprocess quadrigraphs.
7870
7871 * src/reader.c (copy_character): New function, used to output
7872 single characters while replacing `[' and `]' with quadrigraphs, to
7873 avoid troubles with M4 quotes.
7874 (copy_comment): Output characters with copy_character.
7875 (read_additionnal_code): Likewise.
7876 (copy_string2): Likewise.
7877 (copy_definition): Likewise.
7878
7879 * tests/calc.at: Exercise M4 quoting.
7880
7881 2002-04-25 Akim Demaille <akim@epita.fr>
7882
7883 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
7884 between `!' and the command.
7885 Reported by Paul Eggert.
7886
7887 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
7888
7889 * tests/calc.at: Exercise prologue splitting.
7890
7891 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
7892 `b4_post_prologue' instead of `b4_prologue'.
7893
7894 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
7895 muscles.
7896 (output): Free pre_prologue_obstack and post_prologue_obstack.
7897 * src/files.h, src/files.c (attrs_obstack): Remove.
7898 (pre_prologue_obstack, post_prologue_obstack): New.
7899 * src/reader.c (copy_definition): Add a parameter to specify the
7900 obstack to fill, instead of using attrs_obstack unconditionally.
7901 (read_declarations): Pass pre_prologue_obstack to copy_definition if
7902 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
7903
7904 2002-04-23 Paul Eggert <eggert@twinsun.com>
7905
7906 * data/bison.simple: Remove unnecessary commentary and white
7907 space differences from 1_29-branch.
7908 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
7909
7910 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
7911 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
7912 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
7913 constructors or destructors.
7914
7915 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
7916
7917 2002-04-23 Akim Demaille <akim@epita.fr>
7918
7919 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
7920 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
7921 location with columns.
7922 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
7923 All reported by Paul Eggert.
7924
7925 2002-04-22 Akim Demaille <akim@epita.fr>
7926
7927 * src/reduce.c (dump_grammar): Move to...
7928 * src/gram.h, src/gram.c (grammar_dump): here.
7929 Be sure to separate long item numbers.
7930 Don't read the members of a rule's prec if its nil.
7931
7932 2002-04-22 Akim Demaille <akim@epita.fr>
7933
7934 * src/output.c (table_size, table_grow): New.
7935 (MAXTABLE): Remove, replace uses with table_size.
7936 (pack_vector): Instead of dying when the table is too big, grow it.
7937
7938 2002-04-22 Akim Demaille <akim@epita.fr>
7939
7940 * data/bison.simple (yyr1): Its type is that of a token number.
7941 * data/bison.c++ (r1_): Likewise.
7942 * tests/regression.at (Web2c Actions): Adjust.
7943
7944 2002-04-22 Akim Demaille <akim@epita.fr>
7945
7946 * src/reader.c (token_translations_init): 256 is now the default
7947 value for the error token, i.e., it will be assigned another
7948 number if the user assigned 256 to one of her tokens.
7949 (reader): Don't force 256 to error.
7950 * doc/bison.texinfo (Symbols): Adjust.
7951 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
7952 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
7953 etc. instead of 10, 20, 30 (which was used to `jump' over error
7954 (256) and undefined (2)).
7955
7956 2002-04-22 Akim Demaille <akim@epita.fr>
7957
7958 Propagate more token_number_t.
7959
7960 * src/gram.h (token_number_as_item_number)
7961 (item_number_as_token_number): New.
7962 * src/output.c (GENERATE_OUTPUT_TABLE): New.
7963 Use it to create output_item_number_table and
7964 output_token_number_table.
7965 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
7966 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
7967 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
7968 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
7969
7970 2002-04-22 Akim Demaille <akim@epita.fr>
7971
7972 * src/output.h, src/output.c (get_lines_number): Remove.
7973
7974 2002-04-19 Akim Demaille <akim@epita.fr>
7975
7976 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
7977 as Lex/Flex'.
7978 (Debugging): More details about enabling the debugging features.
7979 (Table of Symbols): Describe $$, $n, @$, and @n.
7980 Suggested by Tim Josling.
7981
7982 2002-04-19 Akim Demaille <akim@epita.fr>
7983
7984 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
7985
7986 2002-04-10 Akim Demaille <akim@epita.fr>
7987
7988 * src/system.h: Rely on HAVE_LIMITS_H.
7989 Suggested by Paul Eggert.
7990
7991 2002-04-09 Akim Demaille <akim@epita.fr>
7992
7993 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
7994 full stderr, and strip it according to the bison options, instead
7995 of composing the error message from different bits.
7996 This makes it easier to check for several error messages.
7997 Adjust all the invocations.
7998 Add an invocation exercising the error token.
7999 Add an invocation demonstrating a stupid error message.
8000 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
8001 Adjust the tests.
8002 Error message are for stderr, not stdout.
8003
8004 2002-04-09 Akim Demaille <akim@epita.fr>
8005
8006 * src/gram.h, src/gram.c (error_token_number): Remove, use
8007 errtoken->number.
8008 * src/reader.c (reader): Don't specify the user token number (2)
8009 for $undefined, as it uselessly prevents using it.
8010 * src/gram.h (token_number_t): Move to...
8011 * src/symtab.h: here.
8012 (state_t.number): Is a token_number_t.
8013 * src/print.c, src/reader.c: Use undeftoken->number instead of
8014 hard coded 2.
8015 (Even though this 2 is not the same as above: the number of the
8016 undeftoken remains being 2, it is its user token number which
8017 might not be 2).
8018 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
8019 `user_token_number_max'.
8020 Output `undef_token_number'.
8021 * data/bison.simple, data/bison.c++: Use them.
8022 Be sure to map invalid yylex return values to
8023 `undef_token_number'. This saves us from gratuitous SEGV.
8024
8025 * tests/conflicts.at (Solved SR Conflicts)
8026 (Unresolved SR Conflicts): Adjust.
8027 * tests/regression.at (Web2c Actions): Adjust.
8028
8029 2002-04-08 Akim Demaille <akim@epita.fr>
8030
8031 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
8032 Adding #line.
8033 Remove the duplicate `typedefs'.
8034 (RhsNumberType): Fix the declaration and various other typos.
8035 Use __ofile__.
8036 * data/bison.simple: Use __ofile__.
8037 * src/scan-skel.l: Handle __ofile__.
8038
8039 2002-04-08 Akim Demaille <akim@epita.fr>
8040
8041 * src/gram.h (item_number_t): New, the type of item numbers in
8042 RITEM. Note that it must be able to code symbol numbers as
8043 positive number, and the negation of rule numbers as negative
8044 numbers.
8045 Adjust all dependencies (pretty many).
8046 * src/reduce.c (rule): Remove this `short *' pointer: use
8047 item_number_t.
8048 * src/system.h (MINSHORT, MAXSHORT): Remove.
8049 Include `limits.h'.
8050 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
8051 (shortcpy): Remove.
8052 (MAXTABLE): Move to...
8053 * src/output.c (MAXTABLE): here.
8054 (prepare_rules): Use output_int_table to output rhs.
8055 * data/bison.simple, data/bison.c++: Adjust.
8056 * tests/torture.at (Big triangle): Move the limit from 254 to
8057 500.
8058 * tests/regression.at (Web2c Actions): Ajust.
8059
8060 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
8061 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
8062 passes, but produces negative #line number, once fixed, GCC is
8063 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
8064 C), it passes.
8065 * src/state.h (state_h): Code input lines on ints, not shorts.
8066
8067 2002-04-08 Akim Demaille <akim@epita.fr>
8068
8069 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
8070 and then the grammar.
8071
8072 2002-04-08 Akim Demaille <akim@epita.fr>
8073
8074 * src/system.h: No longer using strndup.
8075
8076 2002-04-07 Akim Demaille <akim@epita.fr>
8077
8078 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
8079 * src/output.c (output_table_data): Return the longest number.
8080 (prepare_tokens): Output `token_number_max').
8081 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
8082 New.
8083 Use them to define yy_token_number_type/TokenNumberType.
8084 Use this type for yytranslate.
8085 * tests/torture.at (Big triangle): Push the limit from 124 to
8086 253.
8087 * tests/regression.at (Web2c Actions): Adjust.
8088
8089 2002-04-07 Akim Demaille <akim@epita.fr>
8090
8091 * tests/torture.at (Big triangle): New.
8092 (GNU AWK Grammar, GNU Cim Grammar): Move to...
8093 * tests/existing.at: here.
8094
8095 2002-04-07 Akim Demaille <akim@epita.fr>
8096
8097 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
8098 nritems.
8099 Adjust dependencies.
8100
8101 2002-04-07 Akim Demaille <akim@epita.fr>
8102
8103 * src/reader.c: Normalize increments to prefix form.
8104
8105 2002-04-07 Akim Demaille <akim@epita.fr>
8106
8107 * src/reader.c, symtab.c: Remove debugging code.
8108
8109 2002-04-07 Akim Demaille <akim@epita.fr>
8110
8111 Rename all the `bucket's as `symbol_t'.
8112
8113 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
8114 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
8115 * src/symtab.c, src/symtab.h (bucket): Rename as...
8116 (symbol_t): this.
8117 (symbol_list_new, bucket_check_defined, bucket_make_alias)
8118 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
8119 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
8120 (buckets_new, buckets_free, buckets_do): Rename as...
8121 (symbol_list_new, symbol_check_defined, symbol_make_alias)
8122 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
8123 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
8124 (symbols_new, symbols_free, symbols_do): these.
8125
8126 2002-04-07 Akim Demaille <akim@epita.fr>
8127
8128 Use lib/hash for the symbol table.
8129
8130 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
8131 EOF.
8132 * src/lex.c (lex): Set the `number' member of new terminals.
8133 * src/reader.c (bucket_check_defined, bucket_make_alias)
8134 (bucket_check_alias_consistence, bucket_translation): New.
8135 (reader, grammar_free, readgram, token_translations_init)
8136 (packsymbols): Adjust.
8137 (reader): Number the predefined tokens.
8138 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
8139 for predefined tokens.
8140 * src/symtab.h (bucket): Remove all the hash table related
8141 members.
8142 * src/symtab.c (symtab): Replace by...
8143 (bucket_table): this.
8144 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
8145 (buckets_new, buckets_do): New.
8146
8147 2002-04-07 Akim Demaille <akim@epita.fr>
8148
8149 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
8150 (start_symbol, max_user_token_number, semantic_parser)
8151 (error_token_number): Initialize.
8152 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
8153 Initialize.
8154 (reader): Don't.
8155 (errtoken, eoftoken, undeftoken, axiom): Extern.
8156
8157 2002-04-07 Akim Demaille <akim@epita.fr>
8158
8159 * src/gram.h (rule_s): prec and precsym are now pointers
8160 to the bucket giving the priority/associativity.
8161 Member `associativity' removed: useless.
8162 * src/reduce.c, src/conflicts.c: Adjust.
8163
8164 2002-04-07 Akim Demaille <akim@epita.fr>
8165
8166 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
8167 Properly escape the symbols' TAG when outputting them.
8168
8169 2002-04-07 Akim Demaille <akim@epita.fr>
8170
8171 * src/lalr.h (LA): Is a bitsetv, not bitset*.
8172
8173 2002-04-07 Akim Demaille <akim@epita.fr>
8174
8175 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
8176 (LArule): this, which is an array to rule_t*.
8177 * src/print.c, src/conflicts.c: Adjust.
8178
8179 2002-04-07 Akim Demaille <akim@epita.fr>
8180
8181 * src/gram.h (rule_t): Rename `number' as `user_number'.
8182 `number' is a new member.
8183 Adjust dependencies.
8184 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
8185
8186 2002-04-07 Akim Demaille <akim@epita.fr>
8187
8188 As a result of the previous patch, it is no longer needed
8189 to reorder ritem itself.
8190
8191 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
8192
8193 2002-04-07 Akim Demaille <akim@epita.fr>
8194
8195 Be sure never to walk through RITEMS, but use only data related to
8196 the rules themselves. RITEMS should be banished.
8197
8198 * src/output.c (output_token_translations): Rename as...
8199 (prepare_tokens): this.
8200 In addition to `translate', prepare the muscles `tname' and
8201 `toknum', which were handled by...
8202 (output_rule_data): this.
8203 Remove, and move the remainder of its outputs into...
8204 (prepare_rules): this new routines, which also merges content from
8205 (output_gram): this.
8206 (prepare_rules): Be sure never to walk through RITEMS.
8207 (output_stos): Rename as...
8208 (prepare_stos): this.
8209 (output): Always invoke prepare_states, after all, just don't use it
8210 in the output if you don't need it.
8211
8212 2002-04-07 Akim Demaille <akim@epita.fr>
8213
8214 * src/LR0.c (new_state): Display `nstates' as the name of the
8215 newly created state.
8216 Adjust to initialize first_state and last_state if needed.
8217 Be sure to distinguish the initial from the final state.
8218 (new_states): Create the itemset of the initial state, and use
8219 new_state.
8220 * src/closure.c (closure): Now that the initial state has its
8221 items properly set, there is no need for a special case when
8222 creating `ruleset'.
8223
8224 As a result, now the rule 0, reducing to $axiom, is visible in the
8225 outputs. Adjust the test suite.
8226
8227 * tests/conflicts.at (Solved SR Conflicts)
8228 (Unresolved SR Conflicts): Adjust.
8229 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
8230 * tests/conflicts.at (S/R in initial): New.
8231
8232 2002-04-07 Akim Demaille <akim@epita.fr>
8233
8234 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
8235 the RHS of the rules.
8236 * src/output.c (output_gram): Likewise.
8237
8238 2002-04-07 Akim Demaille <akim@epita.fr>
8239
8240 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
8241 bucket.
8242 Adjust all dependencies.
8243 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
8244 `number' of the buckets too.
8245 * src/gram.h: Include `symtab.h'.
8246 (associativity): Move to...
8247 * src/symtab.h: here.
8248 No longer include `gram.h'.
8249
8250 2002-04-07 Akim Demaille <akim@epita.fr>
8251
8252 * src/gram.h, src/gram.c (rules_rhs_length): New.
8253 (ritem_longest_rhs): Use it.
8254 * src/gram.h (rule_t): `number' is a new member.
8255 * src/reader.c (packgram): Set it.
8256 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
8257 the end of `rules', and count them out of `nrules'.
8258 (reduce_output, dump_grammar): Adjust.
8259 * src/print.c (print_grammar): It is no longer needed to check for
8260 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
8261 * tests/reduce.at (Reduced Automaton): New test.
8262
8263 2002-04-07 Akim Demaille <akim@epita.fr>
8264
8265 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
8266 lacking `+ 1' to nrules, Bison reported as useless a token if it
8267 was used solely to set the precedence of the last rule...
8268
8269 2002-04-07 Akim Demaille <akim@epita.fr>
8270
8271 * data/bison.c++, data/bison.simple: Don't output the current file
8272 name in #line, to avoid useless diffs between two identical
8273 outputs under different names.
8274
8275 2002-04-07 Akim Demaille <akim@epita.fr>
8276
8277 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
8278 Normalize loops to using `< nrules + 1', not `<= nrules'.
8279
8280 2002-04-07 Akim Demaille <akim@epita.fr>
8281
8282 * TODO: Update.
8283
8284 2002-04-07 Akim Demaille <akim@epita.fr>
8285
8286 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
8287 bucket.value as bucket.number.
8288
8289 2002-04-07 Akim Demaille <akim@epita.fr>
8290
8291 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
8292 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
8293 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
8294 RHS, instead of being an index in RITEMS.
8295
8296 2002-04-04 Paul Eggert <eggert@twinsun.com>
8297
8298 * doc/bison.texinfo: Update copyright date.
8299 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
8300 (Symbols): Warn about running Bison in one character set,
8301 but compiling and/or running in an incompatible one.
8302 Warn about character code 256, too.
8303
8304 2002-04-03 Paul Eggert <eggert@twinsun.com>
8305
8306 * src/bison.data (YYSTACK_ALLOC): Depend on whether
8307 YYERROR_VERBOSE is nonzero, not whether it is defined.
8308
8309 Merge changes from bison-1_29-branch.
8310
8311 2002-03-20 Paul Eggert <eggert@twinsun.com>
8312
8313 Merge fixes from Debian bison_1.34-1.diff.
8314
8315 * configure.in (AC_PREREQ): 2.53.
8316
8317 2002-03-20 Akim Demaille <akim@epita.fr>
8318
8319 * src/conflicts.c (log_resolution): Argument `resolution' is const.
8320
8321 2002-03-19 Paul Eggert <eggert@twinsun.com>
8322
8323 * src/bison.simple (YYCOPY): New macro.
8324 (YYSTACK_RELOCATE): Use it.
8325 Remove Type arg; no longer needed. All callers changed.
8326 (yymemcpy): Remove; no longer needed.
8327
8328 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
8329 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8330
8331 2002-03-19 Akim Demaille <akim@epita.fr>
8332
8333 Test and fix the #line outputs.
8334
8335 * tests/atlocal.at (GCC): New.
8336 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
8337 (Prologue synch line, %union synch line, Postprologue synch line)
8338 (Action synch line, Epilogue synch line): New tests.
8339 * src/reader.c (parse_union_decl): Define the muscle stype_line.
8340 * data/bison.simple, data/bison.c++: Use it.
8341
8342 2002-03-19 Akim Demaille <akim@epita.fr>
8343
8344 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
8345 (Solved SR Conflicts, %expect not enough, %expect right)
8346 (%expect too much): Move to...
8347 * tests/conflicts.at: this new file.
8348
8349 2002-03-19 Akim Demaille <akim@epita.fr>
8350
8351 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
8352 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
8353 that we can move to enums for instance.
8354 * src/output.c (token_definitions_output): Output a list of
8355 `token-name, token-number' instead of the #define.
8356 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
8357
8358 2002-03-14 Akim Demaille <akim@epita.fr>
8359
8360 Use Gettext 0.11.1.
8361
8362 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
8363
8364 * data/bison.c++: Make the user able to add members to the generated
8365 parser by subclassing.
8366
8367 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
8368
8369 * src/reader.c (read_additionnal_code): `c' should be an integer, not
8370 a character.
8371 Reported by Nicolas Tisserand and Nicolas Burrus.
8372
8373 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
8374
8375 * src/reader.c: Warn about lacking semi-colons, do not complain.
8376
8377 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
8378
8379 * data/bison.c++: Remove a debug line.
8380
8381 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
8382
8383 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
8384 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
8385 provide a default implementation.
8386
8387 2002-03-04 Akim Demaille <akim@epita.fr>
8388
8389 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
8390 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
8391 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
8392 * tests/semantic.at (Parsing Guards): Similarly.
8393 * src/reader.at (readgram): Complain if the last rule is not ended
8394 with a semi-colon.
8395
8396 2002-03-04 Akim Demaille <akim@epita.fr>
8397
8398 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
8399 * src/closure.c: here.
8400 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
8401 RTC.
8402 * src/warshall.h, src/warshall.c: Remove.
8403 * tests/sets.at (Broken Closure): Adjust.
8404
8405 2002-03-04 Akim Demaille <akim@epita.fr>
8406
8407 * src/output.c (output_skeleton): tempdir is const.
8408 bytes_read is unused.
8409
8410 2002-03-04 Akim Demaille <akim@epita.fr>
8411
8412 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
8413 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
8414 Update.
8415 From Michael Hayes.
8416
8417 2002-03-04 Akim Demaille <akim@epita.fr>
8418
8419 * src/closure.c (closure): `r' is unused.
8420
8421 2002-03-04 Akim Demaille <akim@epita.fr>
8422
8423 * tests/sets.at (Broken Closure): Add the ending `;'.
8424 * src/reader.at (readgram): Complain if a rule is not ended with a
8425 semi-colon.
8426
8427 2002-03-04 Akim Demaille <akim@epita.fr>
8428
8429 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
8430 (count_sr_conflicts): Use bitset_count.
8431 * src/reduce.c (inaccessable_symbols): Ditto.
8432 (bits_size): Remove.
8433 * src/warshall.h, src/warshall.c: Convert to bitsetv.
8434
8435 2002-03-04 Akim Demaille <akim@epita.fr>
8436
8437 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
8438 * src/reduce.c: Remove the `bitset_zero's following the
8439 `bitset_create's, as now it is performed by the latter.
8440
8441 2002-03-04 Akim Demaille <akim@epita.fr>
8442
8443 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
8444 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
8445 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
8446 latest sources from Michael.
8447
8448 2002-03-04 Akim Demaille <akim@epita.fr>
8449
8450 * src/output.c (output): Don't free the grammar.
8451 * src/reader.c (grammar_free): New.
8452 * src/main.c (main): Call it and don't free symtab here.
8453
8454 2002-03-04 Akim Demaille <akim@epita.fr>
8455
8456 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
8457 before returning.
8458 Reported by Benoit Perrot.
8459
8460 2002-03-04 Akim Demaille <akim@epita.fr>
8461
8462 Use bitset operations when possible, not loops over bits.
8463
8464 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
8465 bitset_or.
8466 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
8467 * src/reduce.c (useless_nonterminals): Formatting changes.
8468 * src/warshall.c (TC): Use bitset_or.
8469
8470 2002-03-04 Akim Demaille <akim@epita.fr>
8471
8472 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
8473 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
8474 Ditto.
8475
8476 2002-03-04 Akim Demaille <akim@epita.fr>
8477
8478 * src/lalr.c (F): Now a bitset*.
8479 Adjust all dependencies.
8480
8481 2002-03-04 Akim Demaille <akim@epita.fr>
8482
8483 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
8484 Adjust all dependencies.
8485
8486 2002-03-04 Akim Demaille <akim@epita.fr>
8487
8488 * src/L0.c, src/LR0.h (nstates): Be size_t.
8489 Adjust comparisons (signed vs unsigned).
8490 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
8491 bitset*.
8492 Adjust all dependencies.
8493
8494 2002-03-04 Akim Demaille <akim@epita.fr>
8495
8496 * src/closure.c (firsts): Now, also a bitset.
8497 Adjust all dependencies.
8498 (varsetsize): Remove, now unused.
8499 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
8500
8501 2002-03-04 Akim Demaille <akim@epita.fr>
8502
8503 * src/print.c: Convert to use bitset.h, not hand coded iterations
8504 over ints.
8505
8506 2002-03-04 Akim Demaille <akim@epita.fr>
8507
8508 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
8509
8510 2002-03-04 Akim Demaille <akim@epita.fr>
8511
8512 * src/closure.c (ruleset): Be a bitset.
8513 (rulesetsize): Remove.
8514
8515 2002-03-04 Akim Demaille <akim@epita.fr>
8516
8517 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
8518 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
8519 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
8520 * src/closure.c (fderives): Be an array of bitsets.
8521
8522 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
8523
8524 * data/bison.c++: Merge the two generated headers. Insert a copyright
8525 notice in each output file.
8526
8527 2002-02-28 Akim Demaille <akim@epita.fr>
8528
8529 * data/bison.c++: Copy the prologue of bison.simple to fetch
8530 useful M4 definitions, such as b4_header_guard.
8531
8532 2002-02-25 Akim Demaille <akim@epita.fr>
8533
8534 * src/getargs.c (version): Give the name of the authors, and use a
8535 translator friendly scheme for the bgr
8536 copyright notice.
8537
8538 2002-02-25 Akim Demaille <akim@epita.fr>
8539
8540 * src/output.c (header_output): Remove, now handled completely via
8541 M4.
8542
8543 2002-02-25 Akim Demaille <akim@epita.fr>
8544
8545 * m4/m4.m4: New, from CVS Autoconf.
8546 * configure.in: Invoke it.
8547 * src/output.c (output_skeleton): Use its result instead of the
8548 hard coded name.
8549
8550 2002-02-25 Akim Demaille <akim@epita.fr>
8551
8552 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
8553 Fileutils 4.1.5.
8554 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
8555 * src/output.c (output_skeleton): Use mkstemp to create a real
8556 temporary file.
8557 Move the filling of `skeleton' and its muscle to...
8558 (prepare): here.
8559 (output): Move the definition of the prologue muscle to...
8560 (prepare): here.
8561 * src/system.h (DEFAULT_TMPDIR): New.
8562
8563 2002-02-14 Paul Eggert <eggert@twinsun.com>
8564
8565 Remove the support for C++ namespace cleanliness; it was
8566 causing more problems than it was curing, since it didn't work
8567 properly on some nonstandard C++ compilers. This can wait
8568 for a proper C++ parser.
8569
8570 * NEWS: Document this.
8571 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
8572 of C++, as it's treated like C now.
8573 * src/bison.simple (YYSTD): Remove.
8574 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
8575 Treat C++ just like Standard C instead of trying to support
8576 namespace cleanliness.
8577
8578 2002-02-14 Akim Demaille <akim@epita.fr>
8579
8580 * tests/regression.at (else): Adjust to Andreas' change.
8581
8582 2002-02-14 Akim Demaille <akim@epita.fr>
8583
8584 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
8585
8586 2002-02-13 Andreas Schwab <schwab@suse.de>
8587
8588 * src/output.c (output_rule_data): Don't output NULL, it might
8589 not be defined yet.
8590
8591 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
8592
8593 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
8594 (Copyright notice): Update.
8595
8596 2002-02-11 Akim Demaille <akim@epita.fr>
8597
8598 * tests/regression.at (%nonassoc and eof): Don't include
8599 nonportable headers.
8600
8601 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
8602
8603 * data/bison.c++: Correct error recovery. Make the user able to
8604 initialize the starting location.
8605
8606 2002-02-07 Akim Demaille <akim@epita.fr>
8607
8608 * tests/input.at: New.
8609
8610 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
8611
8612 * data/bison.c++: Replace some direct m4 expansions by constants. Be
8613 more consistent when naming methods and variables. Put preprocessor
8614 directives around tables only needed for debugging.
8615
8616 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
8617
8618 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
8619 C++ parsers.
8620 (yy::b4_name::parse): Use print_.
8621
8622 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
8623
8624 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
8625
8626 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
8627
8628 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
8629 C++ parsers.
8630 (yy::b4_name::parse): Build verbose error messages, and use error_.
8631
8632 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
8633
8634 * data/bison.c++: Fix m4 quoting in comments.
8635
8636 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
8637
8638 * data/bison.c++: Adjust the parser code. Fix some muscles that were
8639 not expanded by m4.
8640
8641 2002-02-05 Akim Demaille <akim@epita.fr>
8642
8643 * data/bison.c++: Adjust to the M4 back end.
8644 More is certainly needed.
8645
8646 2002-02-05 Akim Demaille <akim@epita.fr>
8647
8648 Give a try to M4 as a back end.
8649
8650 * lib/readpipe.c: New, from wdiff.
8651 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
8652 BISON_HAIRY.
8653 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
8654 specific values. Now it is m4 that performs the lookup.
8655 * src/parse-skel.y: Remove.
8656 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
8657 * src/output.c (actions_output, guards_output)
8658 (token_definitions_output): No longer keeps track of the output
8659 line number, hence remove the second argument.
8660 (guards_output): Check against the guard member of a rule, not the
8661 action member.
8662 Adjust callers.
8663 (output_skeleton): Don't look for the skeleton location, let m4 do
8664 that.
8665 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
8666 file will be used.
8667 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
8668 (prepare): Given that for the time being changesyntax is not
8669 usable in M4, rename the muscles using `-' to `_'.
8670 Define `defines_flag', `output_parser_name' and `output_header_name'.
8671 * src/output.h (actions_output, guards_output)
8672 (token_definitions_output): Adjust prototypes.
8673 * src/scan-skel.l: Instead of scanning the skeletons, it now
8674 processes the output of m4: `__oline__' and `#output'.
8675 * data/bison.simple: Adjust to be used by M4(sugar).
8676 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
8677 to date.
8678 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
8679 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
8680 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
8681 shamelessly stolen from CVS Autoconf.
8682
8683 2002-02-05 Akim Demaille <akim@epita.fr>
8684
8685 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
8686 * configure.in: Check for the declarations of free and malloc.
8687 * src/muscle_tab.c: Adjust.
8688
8689 2002-02-05 Akim Demaille <akim@epita.fr>
8690
8691 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
8692 which have no values.
8693
8694 2002-02-05 Akim Demaille <akim@epita.fr>
8695
8696 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
8697 * data/: here.
8698
8699 2002-01-29 Paul Eggert <eggert@twinsun.com>
8700
8701 * src/bison.simple (YYSIZE_T): Do not define merely because
8702 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
8703 On some platforms, <alloca.h> does not declare YYSTD (size_t).
8704
8705 2002-01-27 Akim Demaille <akim@epita.fr>
8706
8707 Fix `%nonassoc and eof'.
8708
8709 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
8710 which were not properly copied! Replace
8711 memcpy (res->errs, src->errs, src->nerrs);
8712 with
8713 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
8714 !!!
8715 * tests/regression.at (%nonassoc and eof): Adjust to newest
8716 Autotest: `.' is not in the PATH.
8717
8718 2002-01-27 Akim Demaille <akim@epita.fr>
8719
8720 * tests/sets.at (AT_EXTRACT_SETS): New.
8721 (Nullable): Use it.
8722 (Firsts): New.
8723
8724 2002-01-26 Akim Demaille <akim@epita.fr>
8725
8726 * tests/actions.at, tests/calc.at, tests/headers.at,
8727 * tests/torture.at: Adjust to the newest Autotest which no longer
8728 forces `.' in the PATH.
8729
8730 2002-01-25 Akim Demaille <akim@epita.fr>
8731
8732 * tests/regression.at (%nonassoc and eof): New.
8733 Suggested by Robert Anisko.
8734
8735 2002-01-24 Akim Demaille <akim@epita.fr>
8736
8737 Bison dumps core when trying to complain about broken input files.
8738 Reported by Cris van Pelt.
8739
8740 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
8741 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
8742 into...
8743 (Invalid inputs): Strengthen: exercise parse_percent_token.
8744
8745 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
8746
8747 * src/Makefile.am: Add bison.c++.
8748 * src/bison.c++: New skeleton.
8749
8750 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
8751
8752 * po/it.po: New.
8753
8754 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
8755
8756 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
8757
8758 2002-01-20 Marc Autret <marc@gnu.org>
8759
8760 * src/files.c (compute_output_file_names): Fix
8761
8762 2002-01-20 Marc Autret <marc@gnu.org>
8763
8764 * tests/output.at: New test.
8765 * src/files.c (compute_base_names): Don't map extensions when
8766 the YACC flag is set, use defaults.
8767 Reported by Evgeny Stambulchik.
8768
8769 2002-01-20 Marc Autret <marc@gnu.org>
8770
8771 * src/system.h: Need to define __attribute__ away for non-GCC
8772 compilers as well (i.e. the vendor C compiler).
8773 Suggested by Albert Chin-A-Young.
8774
8775 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
8776
8777 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
8778 canonical definition.
8779 * src/system.h: Use the canonical definition for PARAMS (avoids
8780 a conflict with the macro from lib/hash.h).
8781
8782 2002-01-11 Akim Demaille <akim@epita.fr>
8783
8784 * configure.in: Use AC_FUNC_STRNLEN.
8785 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
8786
8787 2002-01-09 Akim Demaille <akim@epita.fr>
8788
8789 * src/files.c, src/files.h (output_infix): New.
8790 (tab_extension): Remove.
8791 (compute_base_names): Compute the former, drop the latter.
8792 * src/output.c (prepare): Insert the muscles `output-infix', and
8793 `output-suffix'.
8794 * src/parse-skel.y (string, string.1): New.
8795 (section.header): Use it.
8796 (section.yacc): Remove.
8797 (prefix): Remove too.
8798 * src/scan-skel.l: Adjust.
8799 * src/bison.simple, src/bison.hairy: Adjust.
8800
8801 2002-01-09 Akim Demaille <akim@epita.fr>
8802
8803 * configure.in (WERROR_CFLAGS): Compute it.
8804 * src/Makefile.am (CFLAGS): Pass it.
8805 * tests/atlocal.in (CFLAGS): Idem.
8806 * src/files.c: Fix a few warnings.
8807 (get_extension_index): Remove, unused.
8808
8809 2002-01-08 Akim Demaille <akim@epita.fr>
8810
8811 * src/getargs.c (AS_FILE_NAME): New.
8812 (getargs): Use it to convert DOSish file names.
8813 * src/files.c (base_name): Rename as full_base_name to avoid
8814 clashes with `base_name ()'.
8815 (filename_split): New.
8816 (compute_base_names): N-th rewrite, using filename_split.
8817
8818 2002-01-08 Akim Demaille <akim@epita.fr>
8819
8820 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
8821 New, stolen from the Fileutils 4.1.
8822 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
8823 * configure.in: Check for the presence of memrchr, and of its
8824 prototype.
8825
8826 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
8827
8828 * lib/hash.h (__P): Added definition for this macro.
8829 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
8830 BUILT_SOURCES, to ensure they are generated first.
8831 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
8832 %error-verbose to allow bootstrapping with bison 1.30x.
8833
8834 2002-01-06 Akim Demaille <akim@epita.fr>
8835
8836 * src/reader.c (parse_braces): Don't fetch the next char, the
8837 convention is to fetch on entry.
8838 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
8839 'switch' without a following semicolon.
8840 * tests/regression.at (braces parsing): New.
8841
8842 2002-01-06 Akim Demaille <akim@epita.fr>
8843
8844 Bison is dead wrong in its RR conflict reports.
8845
8846 * tests/torture.at (GNU Cim Grammar): New.
8847 * src/conflicts.c (count_rr_conflicts): Fix.
8848
8849 2002-01-06 Akim Demaille <akim@epita.fr>
8850
8851 Creating package.m4 from configure.ac causes too many problems.
8852
8853 * tests/Makefile.am (package.m4): Create it by hand,
8854 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
8855
8856 2002-01-06 Akim Demaille <akim@epita.fr>
8857
8858 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
8859 skeleton.h.
8860
8861 2002-01-04 Paul Eggert <eggert@twinsun.com>
8862
8863 * doc/bison.texinfo (Debugging):
8864 Remove YYSTDERR; it's no longer defined or used.
8865 Also, s/cstdio.h/cstdio/.
8866
8867 2002-01-03 Akim Demaille <akim@epita.fr>
8868
8869 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
8870
8871 2002-01-03 Akim Demaille <akim@epita.fr>
8872
8873 * src/parse-skel.y (process_skeleton): Don't bind the parser's
8874 tracing code to --trace, wait for a better --trace option, with
8875 args.
8876
8877 2002-01-03 Akim Demaille <akim@epita.fr>
8878
8879 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
8880 The ISO C++ standard is extremely clear about it: stderr is
8881 considered a macro, not a regular symbol (see table 94 `Header
8882 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
8883 Therefore std:: does not apply to it. It still does with fprintf.
8884 Also, s/cstdio.h/cstdio/.
8885
8886 2002-01-03 Akim Demaille <akim@epita.fr>
8887
8888 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
8889 for non system headers.
8890
8891 2002-01-02 Akim Demaille <akim@epita.fr>
8892
8893 Equip the skeleton chain with location tracking, runtime trace,
8894 pure parser and scanner.
8895
8896 * src/parse-skel.y: Request a pure parser, locations, and prefix
8897 renaming.
8898 (%union): Having several members with the same type does not help
8899 type mismatches, simplify.
8900 (YYPRINT, yyprint): New.
8901 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
8902 (skel_error): this.
8903 Handle locations.
8904 * src/scan-skel.l: Adjust to these changes.
8905 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
8906 (LOCATION_PRINT, skel_control_t): New.
8907
8908 2001-12-30 Akim Demaille <akim@epita.fr>
8909
8910 * src/parse-skel.y: Get rid of the shift/reduce conflict:
8911 replace `gb' with BLANKS.
8912 * src/scan-skel.l: Adjust.
8913
8914 2001-12-30 Akim Demaille <akim@epita.fr>
8915
8916 * src/system.h: We don't need nor want bcopy.
8917 Throw away MS-DOS crap: we don't need getpid.
8918 * configure.in: We don't need strndup. It was even causing
8919 problems: because Flex includes the headers *before* us,
8920 _GNU_SOURCE is not defined by config.h, and therefore strndup was
8921 not visible.
8922 * lib/xstrndup.c: New.
8923 * src/scan-skel.l: Use it.
8924 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
8925 * src/parse-skel.y: Use %directives instead of #defines.
8926
8927 2001-12-30 Akim Demaille <akim@epita.fr>
8928
8929 * src/skeleton.h: New.
8930 * src/output.c (output_parser, output_master_parser): Remove, dead
8931 code.
8932 * src/output.h (get_lines_number, actions_output, guards_output)
8933 (token_definitions_output): Prototype them.
8934 * src/parse-skel.y: Add the license notice.
8935 Include output.h and skeleton.h.
8936 (process_skeleton): Returns void, and takes a single parameter.
8937 * src/scan-skel.l: Add the license notice.
8938 Include skeleton.h.
8939 Don't use %option yylineno: it seems that then Flex imagines
8940 REJECT has been used, and therefore it won't reallocate its
8941 buffers (which makes no other sense to me than a bug). It results
8942 in warnings for `unused: yy_flex_realloc'.
8943
8944 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
8945
8946 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
8947 (MUSCLE_INSERT_PREFIX): ...to there.
8948 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
8949 (MUSCLE_INSERT_PREFIX): Move from here...
8950
8951 * src/bison.hairy: Add a section directive. Put braces around muscle
8952 names. This parser skeleton is still broken, but Bison should not
8953 choke on a bad muscle 'syntax'.
8954 * src/bison.simple: Add a section directive. Put braces around muscle
8955 names.
8956
8957 * src/files.h (strsuffix, stringappend): Add declarations.
8958 (tab_extension): Add declaration.
8959 (short_base_name): Add declaration.
8960
8961 * src/files.c (strsuffix, stringappend): No longer static. These
8962 functions are used in the skeleton parser.
8963 (tab_extension): New.
8964 (compute_base_names): Use the computations done in this function
8965 to guess if the generated parsers should have '.tab' in their
8966 names.
8967 (short_base_name): No longer static.
8968
8969 * src/output.c (output_skeleton): New.
8970 (output): Disable call to output_master_parser, and give a try to
8971 a new skeleton handling system.
8972 (guards_output, actions_output): No longer static.
8973 (token_definitions_output, get_lines_number): No longer static.
8974
8975 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
8976
8977 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
8978 parse-skel.y.
8979
8980 * src/parse-skel.y: New file.
8981 * src/scan-skel.l: New file.
8982
8983 2001-12-29 Akim Demaille <akim@epita.fr>
8984
8985 %name-prefix is broken.
8986
8987 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
8988 Adjust all dependencies.
8989 * tests/headers.at (export YYLTYPE): Strengthen this test: use
8990 %name-prefix.
8991
8992 Renaming yylval but not yylloc is not consistent. Now we do.
8993
8994 * src/bison.simple: Prefix yylloc if used.
8995 * doc/bison.texinfo (Decl Summary): Document that.
8996
8997 2001-12-29 Akim Demaille <akim@epita.fr>
8998
8999 * doc/bison.texinfo: Promote `%long-directive' over
9000 `%long_directive'.
9001 Remove all references to fixed-output-files, yacc is enough.
9002
9003 2001-12-29 Akim Demaille <akim@epita.fr>
9004
9005 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
9006 user prologue. These are defaults.
9007 * tests/actions.at (Mid-rule actions): Make sure the user can
9008 define YYDEBUG and YYERROR_VERBOSE.
9009
9010 2001-12-29 Akim Demaille <akim@epita.fr>
9011
9012 * src/output.c (header_output): Don't forget to export YYLTYPE and
9013 yylloc.
9014 * tests/headers.at (export YYLTYPE): New, make sure it does.
9015 * tests/regression.at (%union and --defines, Invalid CPP headers):
9016 Move to...
9017 * tests/headers.at: here.
9018
9019 2001-12-29 Akim Demaille <akim@epita.fr>
9020
9021 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
9022
9023 2001-12-29 Akim Demaille <akim@epita.fr>
9024
9025 * tests/actions.at (Mid-rule actions): Output on a single line
9026 instead of several.
9027
9028 2001-12-29 Akim Demaille <akim@epita.fr>
9029
9030 * doc/bison.texinfo: Formatting changes.
9031
9032 2001-12-29 Akim Demaille <akim@epita.fr>
9033
9034 Don't store the token defs in a muscle, just be ready to output it
9035 on command. Now possible via `symbols'. Fixes a memory leak.
9036
9037 * src/output.c (token_definitions_output): New.
9038 (output_parser, header_output): Use it.
9039 * src/reader.c (symbols_save): Remove.
9040
9041 2001-12-29 Akim Demaille <akim@epita.fr>
9042
9043 * src/bison.simple: Do not provide a default for YYSTYPE and
9044 YYLTYPE before the user's prologue. Otherwise it's hardly... a
9045 default.
9046
9047 2001-12-29 Akim Demaille <akim@epita.fr>
9048
9049 Mid-rule actions are simply... ignored!
9050
9051 * src/reader.c (readgram): Be sure to attach mid-rule actions to
9052 the empty-rule associated to the dummy symbol, not to the host
9053 rule.
9054 * tests/actions.at (Mid-rule actions): New.
9055
9056 2001-12-29 Akim Demaille <akim@epita.fr>
9057
9058 Memory leak.
9059
9060 * src/reader.c (reader): Free grammar.
9061
9062 2001-12-29 Akim Demaille <akim@epita.fr>
9063
9064 Memory leak.
9065
9066 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
9067 since it allocates it for each state, although only one is needed.
9068 (allocate_storage): Do it here.
9069
9070 2001-12-29 Akim Demaille <akim@epita.fr>
9071
9072 * src/options.h, src/options.c (create_long_option_table): Rename
9073 as...
9074 (long_option_table_new): this, with a clearer prototype.
9075 (percent_table): Remove, unused,
9076 * src/getargs.c (getargs): Adjust.
9077
9078 2001-12-29 Akim Demaille <akim@epita.fr>
9079
9080 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
9081 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
9082 as states.
9083
9084 2001-12-29 Akim Demaille <akim@epita.fr>
9085
9086 * src/lalr.c (build_relations): Rename `states' as `states1'.
9087 Sorry, I don't understand exactly what it is, no better name...
9088
9089 2001-12-29 Akim Demaille <akim@epita.fr>
9090
9091 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
9092 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
9093 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
9094 as rules.
9095
9096 2001-12-29 Akim Demaille <akim@epita.fr>
9097
9098 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
9099 ago.
9100
9101 2001-12-29 Akim Demaille <akim@epita.fr>
9102
9103 * src/reader.c, src/reader.h (user_toknums): Remove.
9104 Adjust all users to use symbols[i]->user_token_number.
9105
9106 2001-12-29 Akim Demaille <akim@epita.fr>
9107
9108 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
9109 Adjust all users to use symbols[i]->prec or ->assoc.
9110
9111 2001-12-29 Akim Demaille <akim@epita.fr>
9112
9113 * src/reader.c, src/reader.h (tags): Remove.
9114 Adjust all users to use symbols[i]->tag.
9115
9116 2001-12-29 Akim Demaille <akim@epita.fr>
9117
9118 * src/gram.h, src/gram.c (symbols): New, similar to state_table
9119 and rule_table.
9120 * src/reader.c (packsymbols): Fill this table.
9121 Drop sprec.
9122 * src/conflicts.c (resolve_sr_conflict): Adjust.
9123 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
9124 single table.
9125 Use symbols[i]->tag instead of tags[i].
9126
9127 2001-12-29 Akim Demaille <akim@epita.fr>
9128
9129 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
9130 In addition, put a comment in there, to replace...
9131 * tests/regression.at (%union and C comments): Remove.
9132
9133 2001-12-29 Akim Demaille <akim@epita.fr>
9134
9135 * tests/regression.at (Web2c Actions): Blindly move the actual
9136 output as expected output. The contents *seem* right to me, but I
9137 can't pretend reading perfectly parser tables... Nonetheless, all
9138 the other tests pass correctly, the table look OK, even though the
9139 presence of `$axiom' is to be noted: AFAICS it is useless (but
9140 harmless).
9141
9142 2001-12-29 Akim Demaille <akim@epita.fr>
9143
9144 * src/reader.c (readgram): Don't add the rule 0 if there were no
9145 rules read. In other words, add it _after_ having performed
9146 grammar sanity checks.
9147 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
9148
9149 2001-12-29 Akim Demaille <akim@epita.fr>
9150
9151 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
9152 visible, and some states have now a different number.
9153
9154 2001-12-29 Akim Demaille <akim@epita.fr>
9155
9156 * src/reader.c (readgram): Bind the initial rule's lineno to that
9157 of the first rule.
9158 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
9159 (Solved SR Conflicts): Adjust rule 0's line number.
9160
9161 2001-12-29 Akim Demaille <akim@epita.fr>
9162
9163 Fix the `GAWK Grammar' failure.
9164
9165 * src/LR0.c (final_state): Initialize to -1 so that we do compute
9166 the reductions of the first state which was mistakenly confused
9167 with the final state because precisely final_state was initialized
9168 to 0.
9169 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
9170 now noticed by Bison.
9171 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
9172 have a reduction on $default.
9173
9174 2001-12-29 Akim Demaille <akim@epita.fr>
9175
9176 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
9177 rule line numbers.
9178 * src/closure.c (print_closure): Likewise.
9179 * src/derives.c (print_derives): Likewise.
9180 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
9181 now.
9182
9183 2001-12-29 Akim Demaille <akim@epita.fr>
9184
9185 * src/lalr.c (lookaheads_print): New.
9186 (lalr): Call it when --trace-flag.
9187 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
9188 are dumped.
9189
9190 2001-12-29 Akim Demaille <akim@epita.fr>
9191
9192 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
9193 when walking through ritem, even via rule->rhs.
9194 * src/reduce.c (dump_grammar, useful_production, reduce_output)
9195 (useful_production, useless_nonterminals): Likewise.
9196 (reduce_grammar_tables): Likewise, plus update nritems.
9197 * src/nullable.c (set_nullable): Likewise.
9198 * src/lalr.c (build_relations): Likewise.
9199 * tests/sets.at (Nullable): Adjust.
9200 Fortunately, now, the $axiom is no longer nullable.
9201
9202 2001-12-29 Akim Demaille <akim@epita.fr>
9203
9204 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
9205 the 0-sentinel.
9206 * src/gram.c (ritem_longest_rhs): Likewise.
9207 * src/reduce.c (nonterminals_reduce): Likewise.
9208 * src/print_graph.c (print_graph): Likewise.
9209 * src/output.c (output_rule_data): Likewise.
9210 * src/nullable.c (set_nullable): Likewise.
9211
9212 2001-12-29 Akim Demaille <akim@epita.fr>
9213
9214 * src/output.c: Comment changes.
9215
9216 2001-12-27 Paul Eggert <eggert@twinsun.com>
9217
9218 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
9219 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
9220 Sparc, as they were causing more porting problems than the
9221 (minor) performance improvement was worth.
9222
9223 Also, catch up with 1.31's YYSTD.
9224
9225 2001-12-27 Akim Demaille <akim@epita.fr>
9226
9227 * src/output.c (output_gram): Rely on nritems, not the
9228 0-sentinel. See below.
9229 Use -1 as separator, not 0.
9230 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
9231 Rely on -1 as separator in yyrhs, instead of 0.
9232 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
9233 twice `Now at end of input', therefore there are two lines less to
9234 expect.
9235
9236 2001-12-27 Akim Demaille <akim@epita.fr>
9237
9238 * tests/regression.at (Unresolved SR Conflicts):
9239 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
9240 below.
9241
9242 2001-12-27 Akim Demaille <akim@epita.fr>
9243
9244 * src/LR0.c (new_state): Recognize the final state by the fact it
9245 is reached by eoftoken.
9246 (insert_start_shifting_state, insert_eof_shifting_state)
9247 (insert_accepting_state, augment_automaton): Remove, since now
9248 these states are automatically computed from the initial state.
9249 (generate_states): Adjust.
9250 * src/print.c: When reporting a rule number to the user, substract
9251 1, so that the axiom rule is rule 0, and the first user rule is 1.
9252 * src/reduce.c: Likewise.
9253 * src/print_graph.c (print_core): For the time being, just as for
9254 the report, depend upon --trace-flags to dump the full set of
9255 items.
9256 * src/reader.c (readgram): Once the grammar read, insert the rule
9257 0: `$axiom: START-SYMBOL $'.
9258 * tests/set.at: Adjust: rule 0 is now displayed, and since the
9259 number of the states has changed (the final state is no longer
9260 necessarily the last), catch up.
9261
9262 2001-12-27 Akim Demaille <akim@epita.fr>
9263
9264 Try to make the use of the eoftoken valid. Given that its value
9265 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
9266 is used instead of > 0 where appropriate, (ii), depend upon nritems
9267 instead of the 0-sentinel.
9268
9269 * src/gram.h, src/gram.c (nritems): New.
9270 Expected to be duplication of nitems, but for the time being...
9271 * src/reader.c (packgram): Assert nritems and nitems are equal.
9272 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
9273 * src/closure.c (print_closure, print_fderives): Likewise.
9274 * src/gram.c (ritem_print): Likewise.
9275 * src/print.c (print_core, print_grammar): Likewise.
9276 * src/print_graph.c: Likewise.
9277
9278 2001-12-27 Akim Demaille <akim@epita.fr>
9279
9280 * src/main.c (main): If there are complains after grammar
9281 reductions, then output the report anyway if requested, then die.
9282 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
9283 * src/reader.c (eoftoken): New.
9284 (parse_token_decl): If the token being defined has value `0', it
9285 is the eoftoken.
9286 (packsymbols): No longer hack `tags' to insert `$' by hand.
9287 Be sure to preserve the value of the eoftoken.
9288 (reader): Make sure eoftoken is defined.
9289 Initialize nsyms to 0: now eoftoken is created just like the others.
9290 * src/print.c (print_grammar): Don't special case the eof token.
9291 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
9292 lie anyway, albeit pleasant.
9293 * tests/calc.at: Exercise error messages with eoftoken.
9294 Change the grammar so that empty input is invalid.
9295 Adjust expectations.
9296 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
9297
9298 2001-12-27 Akim Demaille <akim@epita.fr>
9299
9300 * configure.in: Check the protos of strchr ans strspn.
9301 Replace strchr if needed.
9302 * src/system.h: Provide the protos of strchr, strspn and memchr if
9303 missing.
9304 * lib/strchr.c: New.
9305 * src/reader.c (symbols_save): Use strchr.
9306
9307 2001-12-27 Akim Demaille <akim@epita.fr>
9308
9309 * src/print.c, src/print_graph.c (escape): New.
9310 Use it to quote the TAGS outputs.
9311 * src/print_graph.c (print_state): Now errors are in red, and
9312 reductions in green.
9313 Prefer high to wide: output the state number on a line of its own.
9314
9315 2001-12-27 Akim Demaille <akim@epita.fr>
9316
9317 * src/state.h, src/state.c (reductions_new): New.
9318 * src/LR0.c (set_state_table): Let all the states have a
9319 `reductions', even if reduced to 0.
9320 (save_reductions): Adjust.
9321 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
9322 * src/print.c (print_reductions, print_actions): Adjust.
9323 * src/output.c (action_row): Adjust.
9324
9325 2001-12-27 Akim Demaille <akim@epita.fr>
9326
9327 * src/state.h, src/state.c (errs_new, errs_dup): New.
9328 * src/LR0.c (set_state_table): Let all the states have an errs,
9329 even if reduced to 0.
9330 * src/print.c (print_errs, print_reductions): Adjust.
9331 * src/output.c (output_actions, action_row): Adjust.
9332 * src/conflicts.c (resolve_sr_conflict): Adjust.
9333
9334 2001-12-27 Akim Demaille <akim@epita.fr>
9335
9336 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
9337
9338 2001-12-27 Akim Demaille <akim@epita.fr>
9339
9340 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
9341 * src/print.c: here.
9342 (lookaheadset, shiftset): New, used as additional storage by
9343 print_reductions.
9344 (print_results): Adjust.
9345 (print_shifts, print_gotos, print_errs): New, extracted from...
9346 (print_actions): here.
9347 * src/print_graph.c (print_actions): Remove dead code.
9348
9349 2001-12-27 Akim Demaille <akim@epita.fr>
9350
9351 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
9352 `$n' and `@n'.
9353
9354 2001-12-27 Akim Demaille <akim@epita.fr>
9355
9356 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
9357 (build_relations): Adjust.
9358
9359 2001-12-27 Akim Demaille <akim@epita.fr>
9360
9361 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
9362 duplication.
9363
9364 2001-12-27 Akim Demaille <akim@epita.fr>
9365
9366 * src/reader.c (packgram): Catch nitems overflows.
9367
9368 2001-12-27 Akim Demaille <akim@epita.fr>
9369
9370 * src/files.c, src/files.h (guard_obstack): Remove.
9371 * src/output.c (output): Adjust.
9372 * src/reader.c (parse_braces): New, factoring...
9373 (copy_action, copy_guard): these two which are renamed as...
9374 (parse_action, parse_guard): these.
9375 As a voluntary consequence, using braces around guards is now
9376 mandatory.
9377
9378 2001-12-27 Akim Demaille <akim@epita.fr>
9379
9380 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
9381 * src/reader.c (symbol_list): `guard' and `guard_line' are new
9382 members.
9383 (symbol_list_new): Adjust.
9384 (copy_action): action_line is the first line, not the last.
9385 (copy_guard): Just as for actions, store the `action' only, not
9386 the switch/case/break flesh.
9387 Don't parse the user action that might follow the guard, let...
9388 (readgram): do it, i.e., now, there can be an action after a
9389 guard.
9390 In other words the guard is just explicitly optional.
9391 (packgram): Adjust.
9392 * src/output.c (guards_output): New.
9393 (output_parser): Call it when needed.
9394 (output): Also free the guard and attrs obstacks.
9395 * src/files.c, src/files.h (obstack_save): Remove.
9396 (output_files): Remove.
9397 As a result, if one needs the former `.act' file, using an
9398 appropriate skeleton which requires actions and guards is now
9399 required.
9400 * src/main.c (main): Adjust.
9401 * tests/semantic.at: New.
9402 * tests/regression.at: Use `input.y' as input file name.
9403 Avoid 8+3 problems by requiring input.c when the test needs the
9404 parser.
9405
9406 2001-12-27 Akim Demaille <akim@epita.fr>
9407
9408 * src/reader.c (symbol_list_new): Be sure to initialize all the
9409 fields.
9410
9411 2001-12-27 Akim Demaille <akim@epita.fr>
9412
9413 All the hacks using a final pseudo state are now useless.
9414
9415 * src/LR0.c (set_state_table): state_table holds exactly nstates.
9416 * src/lalr.c (nLA): New.
9417 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
9418 instead of lookaheadsp from the pseudo state (nstate + 1).
9419
9420 2001-12-27 Akim Demaille <akim@epita.fr>
9421
9422 * src/output.c (action_row, token_actions): Use a state_t instead
9423 of a integer, and nlookaheads instead of the following state's
9424 lookaheadsp.
9425
9426 2001-12-27 Akim Demaille <akim@epita.fr>
9427
9428 * src/conflicts.c (log_resolution, flush_shift)
9429 (resolve_sr_conflict, set_conflicts, solve_conflicts)
9430 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
9431 (conflicts_print, print_reductions): Use a state_t instead of an
9432 integer when referring to a state.
9433 As much as possible, depend upon nlookaheads, instead of the
9434 `lookaheadsp' member of the following state (since lookaheads of
9435 successive states are successive, the difference between state n + 1
9436 and n served as the number of lookaheads for state n).
9437 * src/lalr.c (add_lookback_edge): Likewise.
9438 * src/print.c (print_core, print_actions, print_state)
9439 (print_results): Likewise.
9440 * src/print_graph.c (print_core, print_actions, print_state)
9441 (print_graph): Likewise.
9442 * src/conflicts.h: Adjust.
9443
9444 2001-12-27 Akim Demaille <akim@epita.fr>
9445
9446 * src/bison.hairy: Formatting/comment changes.
9447 ANSIfy.
9448 Remove `register' indications.
9449 Add plenty of `static'.
9450
9451 2001-12-27 Akim Demaille <akim@epita.fr>
9452
9453 * src/output.c (prepare): Drop the muscle `ntbase' which
9454 duplicates ntokens.
9455 * src/bison.simple: Formatting/comment changes.
9456 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
9457 is an undocumented synonym.
9458
9459 2001-12-22 Akim Demaille <akim@epita.fr>
9460
9461 * src/output.c (output_table_data): Change the prototype to use
9462 `int' for array ranges: some invocations do pass an int, not a
9463 short.
9464 Reported by Wayne Green.
9465
9466 2001-12-22 Akim Demaille <akim@epita.fr>
9467
9468 Some actions of web2c.y are improperly triggered.
9469 Reported by Mike Castle.
9470
9471 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
9472 * tests/regression.at (Web2c): Rename as...
9473 (Web2c Report): this.
9474 (Web2c Actions): New.
9475
9476 2001-12-22 Akim Demaille <akim@epita.fr>
9477
9478 Reductions in web2c.y are improperly reported.
9479 Reported by Mike Castle.
9480
9481 * src/conflicts.c (print_reductions): Fix.
9482 * tests/regression.at (Web2c): New.
9483
9484 2001-12-18 Akim Demaille <akim@epita.fr>
9485
9486 Some host fail on `assert (!"foo")', which expands to
9487 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
9488 Reported by Nelson Beebee.
9489
9490 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
9491 `#define it_succeeded 0' and `assert (it_succeeded)'.
9492
9493 2001-12-17 Marc Autret <autret_m@epita.fr>
9494
9495 * src/bison.simple: Don't hard code the skeleton line and filename.
9496 * src/output.c (output_parser): Rename 'line' as 'output_line'.
9497 New line counter 'skeleton_line' (skeleton-line muscle).
9498
9499 2001-12-17 Paul Eggert <eggert@twinsun.com>
9500
9501 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
9502 YYDEBUG must be defined to a nonzero value.
9503
9504 * src/bison.simple (yytname): Do not assume that the user defines
9505 YYDEBUG to a properly parenthesized expression.
9506
9507 2001-12-17 Akim Demaille <akim@epita.fr>
9508
9509 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
9510 nlookaheads is a new member.
9511 Adjust all users.
9512 * src/lalr.h (nlookaheads): Remove this orphan declaration.
9513 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
9514 state.
9515
9516 2001-12-17 Akim Demaille <akim@epita.fr>
9517
9518 * src/files.h, src/files.c (open_files, close_files): Remove.
9519 * src/main.c (main): Don't open/close files, nor invoke lex_free,
9520 let...
9521 * src/reader.c (reader): Do it.
9522
9523 2001-12-17 Akim Demaille <akim@epita.fr>
9524
9525 * src/conflicts.c (print_reductions): Formatting changes.
9526
9527 2001-12-17 Akim Demaille <akim@epita.fr>
9528
9529 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
9530 (flush_reduce): New.
9531 (resolve_sr_conflict): Adjust.
9532
9533 2001-12-17 Akim Demaille <akim@epita.fr>
9534
9535 * src/output.c (output_obstack): Be static and rename as...
9536 (format_obstack): this, to avoid any confusion with files.c's
9537 output_obstack.
9538 * src/reader.h (muscle_obstack): Move to...
9539 * src/output.h: here, since it's defined in output.c.
9540
9541 2001-12-17 Akim Demaille <akim@epita.fr>
9542
9543 * src/output.c (action_row, save_column, default_goto)
9544 (sort_actions, matching_state, pack_vector): Better variable
9545 locality.
9546
9547 2001-12-17 Akim Demaille <akim@epita.fr>
9548
9549 * src/output.c: Various formatting changes.
9550
9551 2001-12-17 Akim Demaille <akim@epita.fr>
9552
9553 * src/files.c (output_files): Free the output_obstack.
9554 * src/main.c (main): Call print and print_graph conditionally.
9555 * src/print.c (print): Work unconditionally.
9556 * src/print_graph.c (print_graph): Work unconditionally.
9557 * src/conflicts.c (log_resolution): Output only if verbose_flag.
9558
9559 2001-12-16 Marc Autret <autret_m@epita.fr>
9560
9561 * src/output.c (actions_output): Fix. When we use %no-lines,
9562 there is one less line per action.
9563
9564 2001-12-16 Marc Autret <autret_m@epita.fr>
9565
9566 * src/bison.simple: Remove a useless #line directive.
9567 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
9568 * src/output.c (get_lines_number): New.
9569 (output_parser): Adjust, now takes care about the lines of a
9570 output muscles.
9571 Fix line numbering.
9572 (actions_output): Computes the number of lines taken by actions.
9573 (output_master_parser): Insert new skeleton which is the name of
9574 the output parser file name.
9575
9576 2001-12-15 Marc Autret <autret_m@epita.fr>
9577
9578 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
9579
9580 2001-12-15 Marc Autret <autret_m@epita.fr>
9581
9582 * src/output.c (output_gram): Keep track of the hairy one.
9583
9584 2001-12-15 Akim Demaille <akim@epita.fr>
9585
9586 Make `make distcheck' work.
9587
9588 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
9589 system.h which uses libgettext.h.
9590
9591 2001-12-15 Akim Demaille <akim@epita.fr>
9592
9593 * src/nullable.c (set_nullable): Useless rules must be skipped,
9594 otherwise, since we range over their symbols, we might look at a
9595 nonterminal which no longer ``exists'', i.e., it is not counted in
9596 `nvars', hence we overflow our arrays.
9597
9598 2001-12-15 Akim Demaille <akim@epita.fr>
9599
9600 The header can also be produced directly, without any obstack!
9601 Yahoo!
9602
9603 * src/files.c, src/files.h (defines_obstack): Remove.
9604 (compute_header_macro): Global.
9605 (defines_obstack_save): Remove.
9606 * src/reader.c (parse_union_decl): No longer output to
9607 defines_obstack: its content can be found in the `stype' muscle
9608 anyway.
9609 (output_token_translations): Merge into...
9610 (symbols_output): this.
9611 Rename as...
9612 (symbols_save): this.
9613 (reader): Adjust.
9614 * src/output.c (header_output): New.
9615 (output): Call it.
9616
9617 2001-12-15 Akim Demaille <akim@epita.fr>
9618
9619 * src/reader.c (parse_union_decl): Instead of handling two obstack
9620 simultaneously, use one to define the `stype' muscle, and use the
9621 value of the latter to fill defines_obstack.
9622 (copy_comment): Remove.
9623 (copy_comment2): Work for a single obstack.
9624 Rename as...
9625 (copy_comment): this.
9626
9627 2001-12-15 Akim Demaille <akim@epita.fr>
9628
9629 * src/lex.c, src/lex.h (xgetc): No longer static.
9630 * src/reader.c (parse_union_decl): Revamp.
9631
9632 2001-12-15 Akim Demaille <akim@epita.fr>
9633
9634 Still making progress in separating Bison into (i) input, (ii)
9635 process, (iii) output: now we can directly output the parser file
9636 without using table_obstack at all.
9637
9638 * src/files.c, src/files.h (table_obstack): Bye bye.
9639 (parser_file_name): New.
9640 * src/files.c (compute_output_file_names): Compute it.
9641 * src/output.c (actions_output, output_parser)
9642 (output_master_parser): To a file instead of an obstack.
9643
9644 2001-12-15 Akim Demaille <akim@epita.fr>
9645
9646 Attach actions to rules, instead of pre-outputting them to
9647 actions_obstack.
9648
9649 * src/gram.h (rule_t): action and action_line are new members.
9650 * src/reader.c (symbol_list): Likewise.
9651 (copy_action): Save the actions within the rule.
9652 (packgram): Save them in rule_table.
9653 * src/output.c (actions_output): New.
9654 (output_parser): Use it on `%%actions'.
9655 (output_rule_data): Don't free rule_table.
9656 (output): Do it.
9657 (prepare): Don't save the `action' muscle.
9658 * src/bison.simple: s/%%action/%%actions/.
9659
9660 2001-12-15 Akim Demaille <akim@epita.fr>
9661
9662 * src/reader.c (copy_action): When --yacc, don't append a `;'
9663 to the user action: let it fail if lacking.
9664 Suggested by Arnold Robbins and Tom Tromey.
9665
9666 2001-12-14 Akim Demaille <akim@epita.fr>
9667
9668 * src/lex.c (literalchar): Simply return the char you decoded, non
9669 longer mess around with obstacks and int pointers.
9670 Adjust all callers.
9671
9672 2001-12-14 Akim Demaille <akim@epita.fr>
9673
9674 * src/lex.c (literalchar): Don't escape the special characters,
9675 just decode them, and keep them as char (before, eol was output as
9676 the 2 char string `\n' etc.).
9677 * src/output.c (output_rule_data): Use quotearg to output the
9678 token strings.
9679
9680 2001-12-13 Paul Eggert <eggert@twinsun.com>
9681
9682 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
9683 Do not infringe on the global user namespace when using C++.
9684 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
9685 All uses of `fprintf' and `stderr' changed.
9686
9687 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
9688
9689 2001-12-13 Akim Demaille <akim@epita.fr>
9690
9691 The computation of nullable is broken: it doesn't handle empty
9692 RHS's properly.
9693
9694 * tests/torture.at (GNU AWK Grammar): New.
9695 * tests/sets.at (Nullable): New.
9696 * src/nullable.c (set_nullable): Instead of blindly looping over
9697 `ritems', loop over the rules, and then over their rhs's.
9698
9699 Work around Autotest bugs.
9700
9701 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
9702 frame, because Autotest understand lines starting with a `+' as
9703 traces from the shell. Then, they are not processed properly.
9704 Admittedly an Autotest bug, but we don't have time to wait for
9705 Autotest to catch up.
9706 * tests/regression.at (Broken Closure): Adjust to the new table
9707 frames.
9708 Move to...
9709 * tests/sets.at: here.
9710
9711 2001-12-13 Akim Demaille <akim@epita.fr>
9712
9713 * src/closure.c (closure): Use nrules instead of playing tricks
9714 with BITS_PER_WORD.
9715
9716 2001-12-13 Akim Demaille <akim@epita.fr>
9717
9718 * src/print.c (print_actions): Output the handling of `$' as the
9719 traces do: shifting the token EOF. Before EOF was treated as a
9720 nonterminal.
9721 * tests/regression.at: Adjust some tests.
9722 * src/print_graph.c (print_core): Complete the set of items via
9723 closure. The next-to-final and final states are still unsatisfying,
9724 but that's to be addressed elsewhere.
9725 No longer output the rule numbers, but do output the state number.
9726 A single loop for the shifts + gotos is enough, but picked a
9727 distinct color for each.
9728 (print_graph): Initialize and finalize closure.
9729
9730 2001-12-13 Akim Demaille <akim@epita.fr>
9731
9732 * src/reader.c (readgram): Remove dead code, an strip useless
9733 braces.
9734 (get_type): Remove, unused.
9735
9736 2001-12-12 Akim Demaille <akim@epita.fr>
9737
9738 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
9739 on that of lib/error.c.
9740
9741 2001-12-12 Akim Demaille <akim@epita.fr>
9742
9743 Some hosts don't like `/' in includes.
9744
9745 * src/system.h: Include libgettext.h without qualifying the path.
9746 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
9747 $(top_srcdir).
9748
9749 2001-12-11 Marc Autret <autret_m@epita.fr>
9750
9751 * src/output.c (output_parser): Remove useless muscle.
9752
9753 2001-12-11 Marc Autret <autret_m@epita.fr>
9754
9755 * src/bison.simple: Remove #line just before %%epilogue. It
9756 is now handled in ...
9757 * src/reader.c (read_additionnal_code): Add the output of a
9758 #line for the epilogue.
9759
9760 2001-12-10 Marc Autret <autret_m@epita.fr>
9761
9762 * src/reader.c (copy_definition): Re-use CPP-outed code which
9763 replace precedent remove.
9764 * src/bison.simple: Remove #line before %%prologue because
9765 %%input-line is wrong at this time.
9766
9767 2001-12-10 Marc Autret <autret_m@epita.fr>
9768
9769 * src/reader.c (symbols_output): Clean up.
9770 * src/output.c (output_gram, output): Clean up.
9771
9772 2001-12-10 Akim Demaille <akim@epita.fr>
9773
9774 * src/lalr.c (initialize_lookaheads): New. Extracted from...
9775 * src/LR0.c (set_state_table): here.
9776 * src/lalr.c (lalr): Call it.
9777
9778 2001-12-10 Akim Demaille <akim@epita.fr>
9779
9780 * src/state.h (shifts): Remove the `number' member: shifts are
9781 attached to state, hence no longer need to be labelled with a
9782 state number.
9783
9784 2001-12-10 Akim Demaille <akim@epita.fr>
9785
9786 Now that states have a complete set of members, the linked list of
9787 shifts is useless: just fill directly the state's shifts member.
9788
9789 * src/state.h (shifts): Remove the `next' member.
9790 * src/LR0.c (first_state, last_state): Remove.
9791 Adjust the callers.
9792 (augment_automaton): Don't look for the shifts that must be added
9793 a shift on EOF: it is those of the state we looked for! But now,
9794 since shifts are attached, it is no longer needed to looking
9795 merely by its id: its number.
9796
9797 2001-12-10 Akim Demaille <akim@epita.fr>
9798
9799 * src/LR0.c (augment_automaton): Better variable locality.
9800 Remove an impossible branch: if there is a state corresponding to
9801 the start symbol being shifted, then there is shift for the start
9802 symbol from the initial state.
9803
9804 2001-12-10 Akim Demaille <akim@epita.fr>
9805
9806 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
9807 only when appropriate: when insert_start_shifting_state' is not
9808 invoked.
9809 * tests/regression.at (Rule Line Numbers): Adjust.
9810
9811 2001-12-10 Akim Demaille <akim@epita.fr>
9812
9813 * src/LR0.c (augment_automaton): Now that all states have shifts,
9814 merge the two cases addition shifts to the initial state.
9815
9816 2001-12-10 Akim Demaille <akim@epita.fr>
9817
9818 * src/lalr.c (set_state_table): Move to...
9819 * src/LR0.c: here.
9820 * src/lalr.c (lalr): Don't call it...
9821 * src/LR0.c (generate_states): do it.
9822 * src/LR0.h (first_state): Remove, only the table is used.
9823
9824 2001-12-10 Akim Demaille <akim@epita.fr>
9825
9826 * src/LR0.h (first_shift, first_reduction): Remove.
9827 * src/lalr.c: Don't use first_shift: find shifts through the
9828 states.
9829
9830 2001-12-10 Akim Demaille <akim@epita.fr>
9831
9832 * src/LR0.c: Attach shifts to states as soon as they are
9833 computed.
9834 * src/lalr.c (set_state_table): Instead of assigning shifts to
9835 state, just assert that the mapping was properly done.
9836
9837 2001-12-10 Akim Demaille <akim@epita.fr>
9838
9839 * src/LR0.c (insert_start_shift): Rename as...
9840 (insert_start_shifting_state): this.
9841 (insert_eof_shifting_state, insert_accepting_state): New.
9842 (augment_automaton): Adjust.
9843 Better locality of the variables.
9844 When looking if the start_symbol is shifted from the initial
9845 state, using `while (... symbol != start_symbol ...)' sounds
9846 better than `while (... symbol < start_symbol ...)': If fail
9847 to see how the order between symbols could be relevant!
9848
9849 2001-12-10 Akim Demaille <akim@epita.fr>
9850
9851 * src/getargs.h: Don't declare `spec_name_prefix' and
9852 `spec_file_prefix', declared by src/files.h.
9853 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
9854 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
9855 * src/output.c (prepare): Adjust.
9856 * src/reader.c (symbols_output): Likewise.
9857 * src/vmsgetargs.c: Vaguely adjust, but who cares?
9858
9859 2001-12-10 Akim Demaille <akim@epita.fr>
9860
9861 * src/muscle_tab.c (muscle_init): NULL is a better default than
9862 `"0"'.
9863
9864 2001-12-10 Akim Demaille <akim@epita.fr>
9865
9866 * src/reader.c (reader): Calling symbols_output once is enough.
9867
9868 2001-12-10 Akim Demaille <akim@epita.fr>
9869
9870 Now that states have a complete set of members, the linked list of
9871 reductions is useless: just fill directly the state's reductions
9872 member.
9873
9874 * src/state.h (struct reductions): Remove member `number' and
9875 `next'.
9876 * src/LR0.c (first_reduction, last_reduction): Remove.
9877 (save_reductions): Don't link the new reductions, store them in
9878 this_state.
9879 * src/lalr.c (set_state_table): No need to attach reductions to
9880 states, it's already done.
9881 * src/output.c (output_actions): No longer free the shifts, then
9882 the reductions, then the states: free all the states and their
9883 members.
9884
9885 2001-12-10 Akim Demaille <akim@epita.fr>
9886
9887 * src/options.c (OPTN, DRTV, BOTH): New.
9888 (option_table): Use them.
9889
9890 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
9891 the job of system.h.
9892 * src/options.c: Don't include stdio.h and xalloc.h for the same
9893 reasons.
9894
9895 2001-12-10 Akim Demaille <akim@epita.fr>
9896
9897 * src/output.c (output, prepare): Make sure the values of the
9898 muscles `action' and `prologue' are 0-terminated.
9899
9900 2001-12-10 Akim Demaille <akim@epita.fr>
9901
9902 Clean up GCC warnings.
9903
9904 * src/reader.c (copy_action): `buf' is not used.
9905 (parse_skel_decl): Be static.
9906 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
9907 * src/options.h (create_long_option_table): Have a real prototype.
9908 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
9909 (hash_delete_at): Return const void *.
9910 Adjust casts to preserve the const.
9911
9912 2001-12-10 Akim Demaille <akim@epita.fr>
9913
9914 * configure.in: Require 2.52g.
9915 M4 is not needed, but AUTOM4TE is.
9916 * m4/m4.m4: Remove.
9917 * tests/Makefile.am: Adjust.
9918
9919 2001-12-10 Akim Demaille <akim@epita.fr>
9920
9921 One structure for states is enough, even though theoretically
9922 there are LR(0) states and LALR(1) states.
9923
9924 * src/lalr.h (state_t): Remove.
9925 (state_table): Be state_t **, not state_t *.
9926 * src/state.h (core, CORE_ALLOC): Rename as...
9927 (state_t, STATE_ALLOC): this.
9928 Add the LALR(1) members: shifts, reductions, errs.
9929 * src/LR0.c (state_table): Rename as...
9930 (state_hash): this, to avoid name clashes with the global
9931 `state_table'.
9932 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
9933 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
9934
9935 2001-12-10 Akim Demaille <akim@epita.fr>
9936
9937 Bison dumps core on bash.y.
9938 Reported by Pascal Bart.
9939
9940 * src/warshall.c (bitmatrix_print): New.
9941 (TC): Use it.
9942 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
9943 j must be the outer loop.
9944 * tests/regression.at (Broken Closure): New.
9945
9946 2001-12-05 Akim Demaille <akim@epita.fr>
9947
9948 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
9949 its argument.
9950 Reported by Peter Hamorsky.
9951
9952 2001-12-05 Akim Demaille <akim@epita.fr>
9953
9954 * src/conflicts.c (err_table): Remove.
9955 (resolve_sr_conflict): Adjust.
9956 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
9957 Rename as...
9958 (state_t.reductions, state_t.shifts): this.
9959
9960 2001-12-05 Akim Demaille <akim@epita.fr>
9961
9962 * src/reduce.c (reduce_grammar_tables): No longer disable the
9963 removal of useless rules via CPP but via `if (0)', so that the
9964 compiler still check the code is valid.
9965 For instance, it should have noticed `rline' no longer exists: use
9966 the `line' member of rule_t.
9967 * src/gram.c (dummy, rline): Remove, unused.
9968
9969 2001-12-05 Akim Demaille <akim@epita.fr>
9970
9971 * src/output.c (pack_vector): Use assert, not berror.
9972 * src/main.c (berror): Remove, unused.
9973
9974 2001-12-05 Akim Demaille <akim@epita.fr>
9975
9976 New experimental feature: if --verbose --trace output all the
9977 items of a state, not only its kernel.
9978
9979 * src/print.c (print_core): If `trace_flag', then invoke closure
9980 before outputting the items of the state (print_core is no longer
9981 a correct name them).
9982 (print_results): Invoke new_closure/free_closure if needed.
9983
9984 2001-12-05 Akim Demaille <akim@epita.fr>
9985
9986 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
9987 * src/closure.c, src/closure.h (itemsetsize): Rename as...
9988 (nitemset): for consistency with the rest of the project.
9989
9990 2001-12-05 Akim Demaille <akim@epita.fr>
9991
9992 * src/closure.c (print_closure): Improve.
9993 (closure): Use it for printing input and output.
9994
9995 2001-12-05 Akim Demaille <akim@epita.fr>
9996
9997 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
9998 indexed by nonterminals.
9999
10000 2001-12-05 Akim Demaille <akim@epita.fr>
10001
10002 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
10003 what it was!).
10004 * src/warshall.h: Remove accidental duplication of the content.
10005
10006 2001-12-05 Akim Demaille <akim@epita.fr>
10007
10008 * src/closure.c (set_fderives): De-obfuscate.
10009
10010 2001-12-05 Akim Demaille <akim@epita.fr>
10011
10012 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
10013
10014 2001-12-05 Akim Demaille <akim@epita.fr>
10015
10016 * src/closure.c (set_firsts): De-obfuscate.
10017
10018 2001-12-05 Akim Demaille <akim@epita.fr>
10019
10020 * src/output.c (action_row): De-obfuscate
10021 using the good o' techniques: arrays not pointers, variable
10022 locality, BITISSET, RESETBIT etc.
10023
10024 2001-12-05 Akim Demaille <akim@epita.fr>
10025
10026 Pessimize the code to simplify it: from now on, all the states
10027 have a valid SHIFTS, which NSHIFTS is possibly 0.
10028
10029 * src/LR0.c (shifts_new): Be global and move to..
10030 * src/state.c, src/state.h: here.
10031 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
10032 * src/print_graph: Adjust.
10033
10034 2001-12-05 Akim Demaille <akim@epita.fr>
10035
10036 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
10037 * src/conflicts.c: Use it.
10038 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
10039 incorrectly ``simplified''.
10040
10041 2001-12-05 Akim Demaille <akim@epita.fr>
10042
10043 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
10044 using the good o' techniques: arrays not pointers, variable
10045 locality, BITISSET, RESETBIT etc.
10046
10047 2001-12-05 Akim Demaille <akim@epita.fr>
10048
10049 * src/state.h (SHIFT_SYMBOL): New.
10050 * src/conflicts.c: Use it to deobfuscate.
10051
10052 2001-12-05 Akim Demaille <akim@epita.fr>
10053
10054 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
10055 (print_reductions): De-obfuscate using the good o' techniques:
10056 arrays not pointers, variable locality, BITISSET.
10057
10058 2001-12-05 Akim Demaille <akim@epita.fr>
10059
10060 * src/conflicts.c (print_reductions): Arrays, not pointers.
10061 Use BITISSET.
10062
10063 2001-12-05 Akim Demaille <akim@epita.fr>
10064
10065 * src/conflicts.c (print_reductions): Pessimize, but clarify.
10066
10067 2001-12-05 Akim Demaille <akim@epita.fr>
10068
10069 * src/conflicts.c (print_reductions): Improve variable locality.
10070
10071 2001-12-05 Akim Demaille <akim@epita.fr>
10072
10073 * src/conflicts.c (print_reductions): Pessimize, but clarify.
10074
10075 2001-12-05 Akim Demaille <akim@epita.fr>
10076
10077 * src/conflicts.c (print_reductions): Improve variable locality.
10078
10079 2001-12-05 Akim Demaille <akim@epita.fr>
10080
10081 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
10082 * src/lalr.c: Use them.
10083
10084 2001-12-05 Akim Demaille <akim@epita.fr>
10085
10086 * src/LR0.c (augment_automaton): Formatting changes.
10087 Better variable locality.
10088
10089 2001-12-05 Akim Demaille <akim@epita.fr>
10090
10091 * src/lalr.c (matrix_print): New.
10092 (transpose): Use it.
10093 Use arrays instead of pointers.
10094
10095 2001-12-05 Akim Demaille <akim@epita.fr>
10096
10097 * src/lalr.c (maxrhs): Move to...
10098 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
10099 * src/lalr.c (build_relations): Adjust.
10100
10101 2001-12-05 Akim Demaille <akim@epita.fr>
10102
10103 * src/lalr.c (transpose): Free the memory allocated to the
10104 argument, as it is replaced by the results by the unique caller.
10105 (build_relations): Merely invoke transpose: it handles the memory
10106 deallocation.
10107 Improve variable locality.
10108 Avoid variables used as mere abbreviations.
10109 (compute_lookaheads): Use arrays instead of pointers.
10110
10111 2001-12-05 Akim Demaille <akim@epita.fr>
10112
10113 * src/lalr.c (initialize_F): Improve variable locality.
10114 Avoid variables used as mere abbreviations.
10115
10116 2001-12-05 Akim Demaille <akim@epita.fr>
10117
10118 * src/derives.c (print_derives): Display the ruleno.
10119 * src/lalr.c (initialize_F, transpose): Better variable locality
10120 to improve readability.
10121 Avoid variables used as mere abbreviations.
10122
10123 2001-12-05 Akim Demaille <akim@epita.fr>
10124
10125 * src/lalr.c (traverse): Use arrays instead of pointers.
10126
10127 2001-12-05 Akim Demaille <akim@epita.fr>
10128
10129 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
10130 the handling of squeue.
10131 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
10132
10133 2001-12-05 Akim Demaille <akim@epita.fr>
10134
10135 Because useless nonterminals are now kept alive (instead of being
10136 `destroyed'), we now sometimes examine them, and store information
10137 related to them. Hence we need to know their number, and adjust
10138 memory allocations.
10139
10140 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
10141 static.
10142 * src/LR0.c (allocate_itemsets): The memory allocated to
10143 `symbol_count' was used for two different purpose: once to count
10144 the number of occurrences of each symbol, and later reassigned to
10145 `shift_symbol', containing the symbol that can be shifted from a
10146 given state.
10147 Deobfuscate, i.e., allocate, use and free `symbol_count' here
10148 only, and...
10149 (new_itemsets): Allocate `shift_symbol' here.
10150 (allocate_itemsets): symbol_count includes useless nonterminals.
10151 Make room for them.
10152 (free_storage): Use `free', not `XFREE', for pointers that cannot
10153 be null.
10154
10155 2001-12-05 Akim Demaille <akim@epita.fr>
10156
10157 * src/nullable.c (set_nullable): Deobfuscate the handling of
10158 ritem.
10159 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
10160
10161 2001-12-05 Akim Demaille <akim@epita.fr>
10162
10163 * src/gram.c, src/gram.h (ritem_print): New.
10164 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
10165 (This useless function was defined only to work around VMS linkers
10166 that can't handle compilation units with variables only).
10167 * src/reduce.c (dump_grammar): Use it to trace the construction of
10168 ritem.
10169
10170 2001-12-04 Paul Eggert <eggert@twinsun.com>
10171
10172 * src/bison.simple (union yyalloc): Change member names
10173 to be the same as the stack names.
10174 (yyparse): yyptr is now union yyalloc *, not char *.
10175 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
10176 and may generate better code on some machines.
10177 (yystpcpy): Use prototype if __STDC__ is defined, not just
10178 if __cplusplus is defined.
10179
10180 2001-11-30 Akim Demaille <akim@epita.fr>
10181
10182 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
10183 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
10184 Gettext doesn't compile cleanly, and dies with -Werror.
10185 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
10186 Include WARNING_CFLAGS here.
10187 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
10188 before being defined.
10189
10190 2001-11-27 Paul Eggert <eggert@twinsun.com>
10191
10192 * lib/quotearg.h (quotearg_n, quotearg_n_style):
10193 First arg is int, not unsigned.
10194 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
10195 (SIZE_MAX, UINT_MAX): New macros.
10196 (quotearg_n_options): Abort if N is negative.
10197 Avoid overflow check on hosts where size_t is 64 bits and int
10198 is 32 bits, as overflow is impossible there.
10199 Fix off-by-one typo that caused unnecessary reallocation.
10200
10201 2001-11-29 Paul Eggert <eggert@twinsun.com>
10202
10203 Name space cleanup in generated parser.
10204
10205 * doc/bison.texinfo (Bison Parser): Discuss system headers
10206 and their effect on the user name space.
10207
10208 * src/bison.simple:
10209 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
10210 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
10211 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
10212
10213 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
10214 on user names when possible.
10215
10216 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
10217 Simplify test for whather <alloca.h> exists.
10218
10219 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
10220
10221 (<stdio.h>): Include if YYDEBUG.
10222
10223 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
10224 ! defined (yyoverflow) && ! defined (yymemcpy).
10225
10226 (yymemcpy, yyparse): Rename local variables as needed so that
10227 they all begin with 'yy'.
10228
10229 (yystrlen, yystpcpy): New functions.
10230
10231 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
10232 All uses changed.
10233
10234 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
10235 instead of relying on string.h functions. Use YYSTACK_ALLOC
10236 and YYSTACK_FREE instead of malloc and free.
10237
10238 2001-11-30 Akim Demaille <akim@epita.fr>
10239
10240 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
10241 before their first uses.
10242 (YYBISON, YYPURE): Move to the top of the output.
10243
10244 2001-11-30 Akim Demaille <akim@epita.fr>
10245
10246 * tests/reduce.at (Useless Nonterminals): Fix.
10247
10248 2001-11-30 Akim Demaille <akim@epita.fr>
10249
10250 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
10251 if body instead of `;' to pacify GCC's warnings.
10252
10253 2001-11-30 Akim Demaille <akim@epita.fr>
10254
10255 Instead of mapping the LHS of unused rules to -1, keep the LHS
10256 valid, but flag the rules as invalid.
10257
10258 * src/gram.h (rule_t): `useful' is a new member.
10259 * src/print.c (print_grammar): Adjust.
10260 * src/derives.c (set_derives): Likewise.
10261 * src/reader.c (packgram, reduce_output): Likewise.
10262 * src/reduce.c (reduce_grammar_tables): Likewise.
10263 * tests/reduce.at (Underivable Rules, Useless Rules): New.
10264
10265 2001-11-30 Akim Demaille <akim@epita.fr>
10266
10267 * src/reduce.c (reduce_output): Formatting changes.
10268 * src/print.c (print_results, print_grammar): Likewise.
10269 * tests/regression.at (Rule Line Numbers)
10270 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
10271
10272 2001-11-30 Akim Demaille <akim@epita.fr>
10273
10274 * src/reduce.c (nonterminals_reduce): Instead of throwing away
10275 useless nonterminals, move them at the end of the symbol arrays.
10276 (reduce_output): Adjust.
10277 * tests/reduce.at (Useless Nonterminals): Adjust.
10278
10279 2001-11-30 Akim Demaille <akim@epita.fr>
10280
10281 * src/reduce.c: Various comment/formatting changes.
10282 (nonterminals_reduce): New, extracted from...
10283 (reduce_grammar_tables): here.
10284 (reduce_grammar): Call nonterminals_reduce.
10285
10286 2001-11-29 Paul Eggert <eggert@twinsun.com>
10287
10288 * src/bison.simple (YYSTACK_REALLOC): Remove.
10289 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
10290 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
10291 New macros.
10292 (union yyalloc): New type.
10293 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
10294 an arbitrary restriction on hosts where size_t is wider than int.
10295
10296 (yyparse): Don't dump core if alloca or malloc fails; instead, report
10297 a parser stack overflow. Allocate just one block of memory for all
10298 three stacks, instead of allocating three blocks; this typically is
10299 faster and reduces fragmentation.
10300
10301 Do not limit the number of items in the stack to a value that fits
10302 in 'int', as this is an arbitrary limit on hosts with 64-bit
10303 size_t and 32-bit int.
10304
10305 2001-11-29 Marc Autret <autret_m@epita.fr>
10306
10307 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
10308 of defining YYERROR_VERBOSE.
10309 [AT_DATA]: $4 is now out of C declarations in the prologue.
10310
10311 2001-11-28 Marc Autret <autret_m@epita.fr>
10312
10313 * src/reader.c (parse_dquoted_param): New.
10314 (parse_skel_decl): Use it.
10315 * src/lex.h: Add its prototype.
10316 * src/lex.c (literalchar): Become not static.
10317
10318 2001-11-28 Marc Autret <autret_m@epita.fr>
10319
10320 * src/output.h: And put its extern declaration here.
10321 * src/output.c (error_verbose): Define here.
10322 (prepare): Echo name modification.
10323 * src/getargs.h: Clean its extern declaration.
10324 * src/getargs.c (error_verbose_flag): Remove.
10325 (getargs): Remove case 'e'.
10326 * src/options.c (option_table): 'error-verbose' is now seen as simple
10327 percent option.
10328 Include output.h.
10329
10330 * src/reader.c (read_declarations): Remove case tok_include.
10331 (parse_include_decl): Remove.
10332 * src/lex.h (token_t): Remove tok_include.
10333 * src/options.c (option_table): 'include' is now a simple command line
10334 option.
10335
10336 2001-11-28 Marc Autret <autret_m@epita.fr>
10337
10338 * src/bison.simple: Adjust muscle names.
10339 * src/muscle_tab.c (muscle_init): Also rename the muscles.
10340 * src/output.c (prepare): s/_/-/ for the muscles names.
10341 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
10342
10343 2001-11-28 Marc Autret <autret_m@epita.fr>
10344
10345 * src/bison.simple: Fix debug.
10346 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
10347
10348 2001-11-28 Akim Demaille <akim@epita.fr>
10349
10350 * src/LR0.c (shifts_new): New.
10351 (save_shifts, insert_start_shift, augment_automaton): Use it.
10352
10353 2001-11-28 Akim Demaille <akim@epita.fr>
10354
10355 * src/closure.c (closure): `b' and `ruleno' denote the same value:
10356 keep ruleno only.
10357
10358 2001-11-28 Akim Demaille <akim@epita.fr>
10359
10360 * src/closure.c (closure): Instead of looping over word in array
10361 then bits in words, loop over bits in array.
10362
10363 2001-11-28 Akim Demaille <akim@epita.fr>
10364
10365 * src/closure.c (closure): No longer optimize the special case
10366 where all the bits of `ruleset[r]' are set to 0, to make the code
10367 clearer.
10368
10369 2001-11-28 Akim Demaille <akim@epita.fr>
10370
10371 * src/closure.c (closure): `r' and `c' are new variables, used to
10372 de-obfuscate accesses to RULESET and CORE.
10373
10374 2001-11-28 Akim Demaille <akim@epita.fr>
10375
10376 * src/reduce.c (reduce_print): Use ngettext.
10377 (dump_grammar): Improve the trace accuracy.
10378
10379 2001-11-28 Akim Demaille <akim@epita.fr>
10380
10381 * src/reduce.c (dump_grammar): Don't translate trace messages.
10382
10383 2001-11-28 Akim Demaille <akim@epita.fr>
10384
10385 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
10386 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
10387 as all tags are free'ed afterwards.
10388 From Enrico Scholz.
10389
10390 2001-11-27 Paul Eggert <eggert@twinsun.com>
10391
10392 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
10393 use alloca when we didn't want to, and vice versa.
10394
10395 2001-11-27 Marc Autret <autret_m@epita.fr>
10396
10397 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
10398 initialization.
10399 * src/output.c (prepare): Remove its update.
10400
10401 2001-11-27 Marc Autret <autret_m@epita.fr>
10402
10403 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
10404 Use %error-verbose.
10405
10406 2001-11-27 Marc Autret <autret_m@epita.fr>
10407
10408 * src/bison.simple: Remove YYERROR_VERBOSE using.
10409 Use %%error_verbose.
10410 (yyparse): Likewise.
10411 * src/output.c (prepare): Give its final value.
10412 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
10413 * src/getargs.h: Add its extern declaration.
10414 * src/getargs.c (error_verbose_flag): New int.
10415 (getargs): Update to catch new case.
10416 * src/options.c (option_table): 'error-verbose' is a new option.
10417 (shortopts): Update.
10418
10419 2001-11-27 Akim Demaille <akim@epita.fr>
10420
10421 * src/system.h: Use intl/libgettext.h.
10422 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
10423
10424 2001-11-27 Akim Demaille <akim@epita.fr>
10425
10426 * tests/torture.at (Exploding the Stack Size with Malloc):
10427 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
10428
10429 2001-11-27 Akim Demaille <akim@epita.fr>
10430
10431 * src/files.c: Include error.h.
10432 Reported by Hans Aberg.
10433
10434 2001-11-26 Marc Autret <autret_m@epita.fr>
10435
10436 * src/reader.c (parse_include_decl): New, not yet implemented.
10437 (read_declarations): Add case tok_include.
10438 * src/getargs.h (include): Add its extern definition.
10439 * src/getargs.c (include): New const char *.
10440 (getargs): Add case '-I'.
10441 * src/options.c (option_table): Add include as command line and
10442 percent option.
10443 * src/lex.h (token_t): Add tok_include.
10444
10445 2001-11-26 Akim Demaille <akim@epita.fr>
10446
10447 * src/reader.c (readgram): Make sure rules for mid-rule actions
10448 have a lineno equal to that of their host rule.
10449 Reported by Hans Aberg.
10450 * tests/regression.at (Rule Line Numbers): New.
10451
10452 2001-11-26 Akim Demaille <akim@epita.fr>
10453
10454 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
10455 size_ts.
10456
10457 2001-11-26 Akim Demaille <akim@epita.fr>
10458
10459 * src/complain.c, src/complain.h (error): Remove, provided by
10460 lib/error.[ch].
10461
10462 2001-11-26 Akim Demaille <akim@epita.fr>
10463
10464 * src/reader.c (read_declarations): Don't abort on tok_illegal,
10465 issue an error message.
10466 * tests/regression.at (Invalid %directive): New.
10467 Reported by Hans Aberg.
10468
10469 2001-11-26 Akim Demaille <akim@epita.fr>
10470
10471 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
10472 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
10473
10474 2001-11-26 Akim Demaille <akim@epita.fr>
10475
10476 * src/conflicts.c (conflicts_print): Don't complain at all when
10477 there are no reduce/reduce conflicts, and as many shift/reduce
10478 conflicts as expected.
10479 * tests/regression.at (%expect right): Adjust.
10480
10481 2001-11-23 Akim Demaille <akim@epita.fr>
10482
10483 * lib/alloca.c: Update, from fileutils.
10484
10485 2001-11-23 Akim Demaille <akim@epita.fr>
10486
10487 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
10488
10489 2001-11-23 Akim Demaille <akim@epita.fr>
10490
10491 * src/system.h: Include alloca.h.
10492 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
10493
10494 2001-11-23 Akim Demaille <akim@epita.fr>
10495
10496 * src/print_graph.c (print_actions): Remove `rule', unused.
10497 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
10498 pacify GCC's signed < unsigned warnings.
10499 * src/closure.c (itemsetsize): Likewise.
10500 * src/reader.c (symbol_list_new): Static.
10501
10502 2001-11-23 Akim Demaille <akim@epita.fr>
10503
10504 Attaching lineno to buckets is stupid, since only one copy of each
10505 symbol is kept, only the line of the first occurrence is kept too.
10506
10507 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
10508 * src/reader.c (rline_allocated): Remove, unused.
10509 (symbol_list): Have a `line' member.
10510 (symbol_list_new): New.
10511 (readgram): Use it.
10512 * src/print.c (print_grammar): Output the rule line numbers.
10513 * tests/regression.at (Solved SR Conflicts)
10514 (Unresolved SR Conflicts): Adjust.
10515 Reported by Hans Aberg.
10516
10517 2001-11-22 Marc Autret <autret_m@epita.fr>
10518
10519 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
10520
10521 2001-11-22 Marc Autret <autret_m@epita.fr>
10522
10523 * src/muscle_tab.c (muscle_init): Remove initialization of
10524 skeleton muscle.
10525 * src/output.c (output_master_parser): Do it here.
10526
10527 2001-11-20 Akim Demaille <akim@epita.fr>
10528
10529 * po/sv.po: New.
10530 * configure.in (ALL_LINGUAS): Adjust.
10531 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
10532 longer contains strings to translate.
10533
10534 2001-11-19 Akim Demaille <akim@epita.fr>
10535
10536 * src/conflicts.c (conflicts_print): Add a missing \n.
10537
10538 2001-11-19 Akim Demaille <akim@epita.fr>
10539
10540 * src/nullable.c (nullable_print): New.
10541 (set_nullable): Call it when tracing.
10542 Better locality of variables.
10543
10544 2001-11-19 Akim Demaille <akim@epita.fr>
10545
10546 * src/print.c (print_actions): Better locality of variables.
10547
10548 2001-11-19 Akim Demaille <akim@epita.fr>
10549
10550 * src/derives.c (print_derives): Fix and enrich.
10551 * src/closure.c (print_fderives): Likewise.
10552
10553 2001-11-19 Akim Demaille <akim@epita.fr>
10554
10555 * src/closure.c (itemsetend): Remove, replaced with...
10556 (itemsetsize): new.
10557
10558 2001-11-19 Akim Demaille <akim@epita.fr>
10559
10560 * src/LR0.c (kernel_end): Remove, replaced with...
10561 (kernel_size): new.
10562
10563 2001-11-19 Akim Demaille <akim@epita.fr>
10564
10565 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
10566 to clarify.
10567
10568 2001-11-19 Akim Demaille <akim@epita.fr>
10569
10570 * src/closure.c (closure): Use arrays instead of pointers to clarify.
10571
10572 2001-11-19 Akim Demaille <akim@epita.fr>
10573
10574 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
10575 trace messages.
10576 * src/LR0.c: Likewise.
10577 (allocate_itemsets): Use arrays instead of pointers to clarify.
10578
10579 2001-11-19 Akim Demaille <akim@epita.fr>
10580
10581 * src/getargs.c (statistics_flag): Replace with...
10582 (trace_flag): New.
10583 (longopts): Accept --trace instead of --statistics.
10584 * src/getargs.h, src/options.c: Adjust.
10585 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
10586 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
10587
10588 2001-11-19 Akim Demaille <akim@epita.fr>
10589
10590 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
10591 pointers to clarify the code.
10592 (save_reductions, save_shifts): Factor common parts of alternatives.
10593
10594 2001-11-19 Akim Demaille <akim@epita.fr>
10595
10596 * src/LR0.c (new_state, get_state): Complete TRACE code.
10597 * src/closure.c: Include `reader.h' to get `tags', needed by the
10598 trace code.
10599 Rename the conditional DEBUG as TRACE.
10600 Output consistently TRACEs to stderr, not stdout.
10601 * src/derives.c: Likewise.
10602 * src/reduce.c: (inaccessable_symbols): Using if is better style
10603 than goto.
10604 Use `#if TRACE' instead of `#if 0' for tracing code.
10605
10606 2001-11-19 Akim Demaille <akim@epita.fr>
10607
10608 * src/system.h (LIST_FREE, shortcpy): New.
10609 * src/LR0.c: Use them.
10610 * src/output.c (free_itemsets, free_reductions, free_shifts):
10611 Remove, replaced by LIST_FREE.
10612
10613 2001-11-19 Akim Demaille <akim@epita.fr>
10614
10615 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
10616 (REDUCTIONS_ALLOC): New.
10617 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
10618 allocation.
10619
10620 2001-11-19 Akim Demaille <akim@epita.fr>
10621
10622 * src/LR0.c (new_state): Complete trace code.
10623 * src/nullable.c (set_nullable): Don't translate traces.
10624
10625 2001-11-19 Akim Demaille <akim@epita.fr>
10626
10627 * src/print_graph.c (print_core): Better locality of variables.
10628 * src/print.c (print_core): Likewise.
10629
10630 2001-11-19 Akim Demaille <akim@epita.fr>
10631
10632 * src/vcg.c: You do the output, so you are responsible of the
10633 handling of VCG syntax, in particular: use quotearg.
10634 * src/print_graph.c: Don't.
10635 (print_actions): Don't output the actions as part of the nodes,
10636 since that's the job of the edges.
10637 (print_state): Don't output by hand: fill the node description,
10638 and ask for its output.
10639
10640 2001-11-19 Akim Demaille <akim@epita.fr>
10641
10642 * src/bison.simple (yyparse): When verbosely reporting an error,
10643 no longer put additional quotes around token names.
10644 * tests/calc.at: Adjust.
10645
10646 2001-11-19 Akim Demaille <akim@epita.fr>
10647
10648 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
10649 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
10650 * src/output.c: Adjust.
10651
10652 2001-11-19 Akim Demaille <akim@epita.fr>
10653
10654 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
10655 (rule_t): this.
10656 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
10657
10658 2001-11-19 Akim Demaille <akim@epita.fr>
10659
10660 * src/gram.h (rule_t): New.
10661 (rule_table): New.
10662 (rrhs, rlhs): Remove, part of state_t.
10663 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
10664 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10665 * src/reader.c, src/reduce.c: Adjust.
10666
10667 2001-11-19 Akim Demaille <akim@epita.fr>
10668
10669 * src/reader.c (symbols_output): New, extracted from...
10670 (packsymbols): Here.
10671 (reader): Call it.
10672
10673 2001-11-19 Akim Demaille <akim@epita.fr>
10674
10675 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
10676 (maxrhs): this new function.
10677
10678 2001-11-19 Akim Demaille <akim@epita.fr>
10679
10680 * src/lalr.c (F): New macro to access the variable F.
10681 Adjust.
10682
10683 2001-11-19 Akim Demaille <akim@epita.fr>
10684
10685 * src/lalr.h (LA): New macro to access the variable LA.
10686 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
10687 * src/lalr.c: Adjust.
10688
10689 2001-11-19 Akim Demaille <akim@epita.fr>
10690
10691 * src/lalr.c (initialize_LA): Only initialize LA. Let...
10692 (set_state_table): handle the `lookaheads' members.
10693
10694 2001-11-19 Akim Demaille <akim@epita.fr>
10695
10696 * src/lalr.h (lookaheads): Removed array, whose contents is now
10697 a member of...
10698 (state_t): this structure.
10699 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
10700 Adjust.
10701
10702 2001-11-19 Akim Demaille <akim@epita.fr>
10703
10704 * src/lalr.h (consistent): Removed array, whose contents is now
10705 a member of...
10706 (state_t): this structure.
10707 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
10708 Adjust.
10709
10710 2001-11-19 Akim Demaille <akim@epita.fr>
10711
10712 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
10713 contents are now members of...
10714 (state_t): this structure.
10715 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
10716 Adjust.
10717
10718 2001-11-19 Akim Demaille <akim@epita.fr>
10719
10720 * src/lalr.h (state_t): New.
10721 (state_table): Be a state_t * instead of a core **.
10722 (accessing_symbol): Remove, part of state_t.
10723 * src/lalr.c: Adjust.
10724 (set_accessing_symbol): Merge into...
10725 (set_state_table): this.
10726 * src/print_graph.c, src/conflicts.c: Adjust.
10727
10728 2001-11-14 Akim Demaille <akim@epita.fr>
10729
10730 * tests/calc.at, tests/output.at, tests/regression.at,
10731 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
10732 now the tests are run in private dirs, therefore AC_CLEANUP and
10733 family can be simplified to 0-ary.
10734 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
10735 use abs. path to find config.h.
10736 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
10737 stderr, there can be way too much random noise.
10738 Instead pass -Werror to GCC and rely on the exit status.
10739 Reported by Wolfram Wagner.
10740
10741 2001-11-14 Akim Demaille <akim@epita.fr>
10742
10743 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
10744 defined only if yyoverflow is defined, to avoid `warning: unused
10745 variable `yyvs1''.
10746 Reported by The Test Suite.
10747
10748 2001-11-14 Akim Demaille <akim@epita.fr>
10749
10750 * src/print.c: Include reduce.h.
10751 Reported by Hans Aberg.
10752
10753 2001-11-14 Akim Demaille <akim@epita.fr>
10754
10755 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
10756 Revert a previous patch: these are really const.
10757 * src/conflicts.c (conflict_report): Additional useless pair of
10758 braces to pacify GCC's warnings for `if () if () {} else {}'.
10759 * src/lex.c (parse_percent_token): Replace equal_offset with
10760 arg_offset.
10761 arg is const.
10762 Be sure to strdup `arg' when used, since there is no reason for
10763 token_buffer not to change.
10764
10765 2001-11-14 Akim Demaille <akim@epita.fr>
10766
10767 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
10768 definition.
10769 * src/main.c (main): Use them.
10770 Suggested by Hans Aberg.
10771
10772 2001-11-12 Akim Demaille <akim@epita.fr>
10773
10774 * src/system.h (ngettext): Now that we use ngettext, be sure to
10775 provide a default definition when NLS are not used.
10776
10777 2001-11-12 Akim Demaille <akim@epita.fr>
10778
10779 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
10780 Use @kbd to denote user input.
10781 (Language and Grammar): ANSIfy the example.
10782 Adjust its layout for info/notinfo.
10783 (Location Tracking Calc): Output error messages to stderr.
10784 Output locations in a more GNUtically correct way.
10785 Fix a couple of Englishos.
10786 Adjust @group/@end group pairs.
10787
10788 2001-11-12 Akim Demaille <akim@epita.fr>
10789
10790 %expect was not functioning at all.
10791
10792 * src/conflicts.c (expected_conflicts): Set to -1.
10793 (conflict_report): Use ngettext.
10794 (conflicts_print): Check %expect and make its violation an error.
10795 * doc/bison.texinfo (Expect Decl): Adjust.
10796 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
10797 * tests/regression.at (%expect not enough, %expect right)
10798 (%expect too much): New.
10799
10800 2001-11-12 Akim Demaille <akim@epita.fr>
10801
10802 * tests/regression.at (Conflicts): Rename as...
10803 (Unresolved SR Conflicts): this.
10804 (Solved SR Conflicts): New.
10805
10806 2001-11-12 Akim Demaille <akim@epita.fr>
10807
10808 * src/reduce.c (print_results): Rename as...
10809 (reduce_output): This.
10810 Output to OUT, passed as argument, instead of output_obstack.
10811 (dump_grammar): Likewise.
10812 (reduce_free): New.
10813 Also free V1.
10814 (reduce_grammar): No longer call reduce_output, since...
10815 * src/print.c (print_results): do it.
10816 * src/main.c (main): Call reduce_free;
10817
10818 2001-11-12 Akim Demaille <akim@epita.fr>
10819
10820 * src/conflicts.c (print_reductions): Accept OUT as argument.
10821 Output to it, not to output_obstack.
10822 * src/print.c (print_actions): Adjust.
10823
10824 2001-11-12 Akim Demaille <akim@epita.fr>
10825
10826 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
10827 the result instead of using...
10828 (src_total, rrc_total, src_count, rrc_count): Remove.
10829 (any_conflicts): Remove.
10830 (print_conflicts): Split into...
10831 (conflicts_print, conflicts_output): New.
10832 * src/conflicts.h: Adjust.
10833 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
10834 * src/print.c (print_grammar): Issue `\n' between two rules.
10835 * tests/regression.at (Conflicts): New.
10836 Reported by Tom Lane.
10837
10838 2001-11-12 Akim Demaille <akim@epita.fr>
10839
10840 * tests/regression.at (Invalid input): Remove, duplicate with
10841 ``Invalid input: 1''.
10842
10843 2001-11-12 Akim Demaille <akim@epita.fr>
10844
10845 * tests/torture.at (AT_DATA_STACK_TORTURE)
10846 (Exploding the Stack Size with Alloca)
10847 (Exploding the Stack Size with Malloc): New.
10848
10849 2001-11-12 Akim Demaille <akim@epita.fr>
10850
10851 * src/bison.simple (YYSTACK_REALLOC): New.
10852 (yyparse) [!yyoverflow]: Use it and free the old stack.
10853 Reported by Per Allansson.
10854
10855 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
10856
10857 * src/bison.simple: Define type yystype instead of YYSTYPE, and
10858 define CPP macro, which substitute YYSTYPE by yystype.
10859 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
10860 with yyltype/YYLTYPE. This allows inclusion of the generated
10861 header within the parser if the compiler, such as GGC, accepts
10862 multiple equivalent #defines.
10863 From Akim.
10864
10865 2001-11-05 Akim Demaille <akim@epita.fr>
10866
10867 * src/reader.c (symbols_output): New, extracted from...
10868 (packsymbols): here.
10869 (reader): Adjust.
10870
10871 2001-11-05 Akim Demaille <akim@epita.fr>
10872
10873 * src/lex.c (parse_percent_token): s/quotearg/quote/.
10874
10875 2001-11-05 Akim Demaille <akim@epita.fr>
10876
10877 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
10878 pattern.
10879
10880 2001-11-05 Akim Demaille <akim@epita.fr>
10881
10882 * src/options.h (struct option_table_struct): set_flags is void*.
10883 * src/options.c (longopts): Support `--output' and `%output'.
10884 (usage): Adjust.
10885 * src/lex.h (tok_setopt): Remove, replaced with...
10886 (tok_intopt, tok_stropt): these new guys.
10887 * src/lex.c (getopt.h): Not needed.
10888 (token_buffer, unlexed_token_buffer): Not const.
10889 (percent_table): Promote `-' over `_' in directive names.
10890 Active `%name-prefix', `file-prefix', and `output'.
10891 (parse_percent_token): Accept possible arguments to directives.
10892 Promote `-' over `_' in directive names.
10893
10894 2001-11-04 Akim Demaille <akim@epita.fr>
10895
10896 * doc/bison.texinfo (Decl Summary): Split the list into
10897 `directives for grammars' and `directives for bison'.
10898 Sort'em.
10899 Add description of `%name-prefix', `file-prefix', and `output'.
10900 Promote `-' over `_' in directive names.
10901 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
10902 Simplify the description of `--name-prefix'.
10903 Promote `-' over `_' in directive names.
10904 Promote `--output' over `--output-file'.
10905 Fix the description of `--defines'.
10906 * tests/output.at: Exercise %file-prefix and %output.
10907
10908 2001-11-02 Akim Demaille <akim@epita.fr>
10909
10910 * doc/refcard.tex: Update.
10911
10912 2001-11-02 Akim Demaille <akim@epita.fr>
10913
10914 * src/symtab.h (SUNDEF): New.
10915 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
10916 stand for `uninitialized', instead of 0.
10917 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
10918 * src/lex.c (lex): Adjust.
10919
10920 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
10921 Number it 0.
10922 Let yylex return it instead of a plain 0.
10923 Reported by Dick Streefland.
10924
10925 2001-11-02 Akim Demaille <akim@epita.fr>
10926
10927 * tests/regression.at (Mixing %token styles): New test.
10928
10929 2001-11-02 Akim Demaille <akim@epita.fr>
10930
10931 * src/reader.c (parse_thong_decl): Formatting changes.
10932 (token_translations_init): New, extracted from...
10933 (packsymbols): Here.
10934 Adjust.
10935
10936 2001-11-01 Akim Demaille <akim@epita.fr>
10937
10938 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
10939 Check that `9foo.y' produces correct cpp guards.
10940 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
10941 guards.
10942 Reported by Wwp.
10943
10944 2001-11-01 Akim Demaille <akim@epita.fr>
10945
10946 * tests/regression.at (Invalid input: 2): New.
10947 * src/lex.c (unlexed_token_buffer): New.
10948 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
10949 too.
10950 Reported by Wwp.
10951
10952 2001-11-01 Akim Demaille <akim@epita.fr>
10953
10954 * tests/calc.at: Catch up with 1.30.
10955 * configure.in: Bump to 1.49a.
10956 Adjust to newer Autotest.
10957
10958 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
10959
10960 * src/conflicts.c: Move global variables rrc_total and src_total ...
10961 (print_conflicts): here.
10962 * src/output.c (output): Free global variable user_toknums.
10963 * src/lex.c (token_obstack): Become static.
10964
10965 2001-10-18 Akim Demaille <akim@epita.fr>
10966
10967 * tests/atlocal.in (GCC): Add.
10968 * tests/calc.at: s/m4_match/m4_bmatch/.
10969 s/m4_patsubst/m4_bpatsubst/.
10970 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
10971 * configure.in: AC_SUBST(GCC).
10972
10973 2001-10-14 Marc Autret <autret_m@epita.fr>
10974
10975 * src/options.c (create_long_option_table): Fix.
10976
10977 2001-10-10 Akim Demaille <akim@epita.fr>
10978
10979 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
10980
10981 2001-10-04 Akim Demaille <akim@epita.fr>
10982
10983 * src/reader.c (parse_union_decl): Push the caracters in
10984 union_obstack, not attrs_obstack.
10985
10986 2001-10-04 Akim Demaille <akim@epita.fr>
10987
10988 Merge in the branch 1.29.
10989
10990 * src/reader.c (packsymbols): Use a temporary obstack for
10991 `%%tokendef', since output_stack is already used elsewhere.
10992
10993 2001-10-02 Akim Demaille <akim@epita.fr>
10994
10995 Bump 1.29d.
10996
10997 2001-10-02 Akim Demaille <akim@epita.fr>
10998
10999 Version 1.29c.
11000
11001 2001-10-02 Akim Demaille <akim@epita.fr>
11002
11003 * tests/regression.at (Invalid CPP headers): New.
11004 From Alexander Belopolsky.
11005 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
11006
11007 2001-10-02 Akim Demaille <akim@epita.fr>
11008
11009 * tests/regression.at (Invalid input): New.
11010 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
11011 Reported by Shura.
11012
11013 2001-10-02 Akim Demaille <akim@epita.fr>
11014
11015 * tests/calc.at: Now that --debug works, the tests must be adjusted.
11016
11017 2001-10-02 Akim Demaille <akim@epita.fr>
11018
11019 * src/output.c (output_parser): Assert `skeleton'.
11020 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
11021 systems.
11022 From Shura.
11023
11024 2001-10-01 Marc Autret <autret_m@epita.fr>
11025
11026 * src/lex.h: Echo modifications.
11027 * src/lex.c (unlex): Parameter is now token_t.
11028 From Hans Aberg.
11029
11030 2001-10-01 Marc Autret <autret_m@epita.fr>
11031
11032 * src/main.c: Include lex.h.
11033 From Hans Aberg.
11034
11035 2001-09-29 Akim Demaille <akim@epita.fr>
11036
11037 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
11038
11039 2001-09-28 Akim Demaille <akim@epita.fr>
11040
11041 * tests/testsuite.at: Update to newer Autotest.
11042 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
11043
11044 2001-09-27 Akim Demaille <akim@epita.fr>
11045
11046 Position independent wrapper.
11047
11048 * tests/bison: Remove.
11049 * tests/bison.in: New.
11050 * configure.in: Adjust.
11051
11052 2001-09-27 Paul Eggert <eggert@twinsun.com>
11053
11054 Port quotearg fixes from tar 1.13.24.
11055
11056 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
11057 tm to be declared.
11058 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
11059 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
11060
11061 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
11062 * m4/mbrtowc.m4: New file.
11063 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
11064 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
11065
11066 2001-09-27 Akim Demaille <akim@epita.fr>
11067
11068 Bump to 1.29c.
11069
11070 2001-09-27 Akim Demaille <akim@epita.fr>
11071
11072 Version 1.29b.
11073
11074 2001-09-25 Akim Demaille <akim@epita.fr>
11075
11076 * src/system.h: Include `xalloc.h'.
11077 Remove it from the C files.
11078 * src/files.c (output_files): Free the obstacks.
11079 * src/lex.c (init_lex): Rename as...
11080 (lex_init): this.
11081 (lex_free): New.
11082 * src/main.c (main): Use it.
11083
11084 2001-09-24 Marc Autret <autret_m@epita.fr>
11085
11086 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
11087 to output informations in fout (FILE*).
11088 (open_graph, close_graph): Likewise.
11089 (output_graph, output_edge, output_node): Likewise.
11090 * src/vcg.h: Update function prototypes.
11091 * src/print_graph.c (print_graph): Open output graph file.
11092 (print_actions): Adjust.
11093 * src/files.h: Remove extern declaration.
11094 * src/files.c: Remove graph_obstack declaration.
11095 (open_files): Remove graph_obstack initialization.
11096 (output_files): Remove graph_obstack saving.
11097
11098 2001-09-24 Marc Autret <autret_m@epita.fr>
11099
11100 * src/files.c (compute_output_file_names): Fix.
11101
11102 2001-09-24 Marc Autret <autret_m@epita.fr>,
11103 Akim Demaille <akim@epita.fr>
11104
11105 * src/reader.c (reader): Remove call to free_symtab ().
11106 * src/main.c (main): Call it here.
11107 Include symtab.h.
11108 * src/conflicts.c (initialize_conflicts): Rename as...
11109 (solve_conflicts): this.
11110 * src/print.c (print_core, print_actions, print_state)
11111 (print_grammar): Dump to a file instead a `output_obstack'.
11112 (print_results): Dump `output_obstack', and then proceed with the
11113 FILE *.
11114 * src/files.c (compute_output_file_names, close_files): New.
11115 (output_files): Adjust.
11116 * src/main.c (main): Adjust.
11117
11118 2001-09-23 Marc Autret <autret_m@epita.fr>
11119
11120 * src/files.c (compute_header_macro): Computes header macro name
11121 from spec_defines_file when given.
11122
11123 2001-09-23 Marc Autret <autret_m@epita.fr>
11124
11125 * src/files.c (output_files): Add default extensions.
11126
11127 2001-09-22 Akim Demaille <akim@epita.fr>
11128
11129 * src/conflicts.c (finalize_conflicts): Rename as...
11130 (free_conflicts): this.
11131
11132 2001-09-22 Akim Demaille <akim@epita.fr>
11133
11134 * src/gram.c (gram_free): Rename back as...
11135 (dummy): this.
11136 (output_token_translations): Free `token_translations'.
11137 * src/symtab.c (free_symtab): Free the tag field.
11138
11139 2001-09-22 Akim Demaille <akim@epita.fr>
11140
11141 Remove `translations' as it is always set to true.
11142
11143 * src/gram.h: Adjust.
11144 * src/reader.c (packsymbols, parse_token_decl): Adjust
11145 * src/print.c (print_grammar): Adjust.
11146 * src/output.c (output_token_translations): Adjust.
11147 * src/lex.c (lex): Adjust.
11148 * src/gram.c: Be sure the set pointers to NULL.
11149 (dummy): Rename as...
11150 (gram_free): this.
11151
11152 2001-09-22 Akim Demaille <akim@epita.fr>
11153
11154 * configure.in: Invoke AM_LIB_DMALLOC.
11155 * src/system.h: Use dmalloc.
11156 * src/LR0.c: Be sure to have pointers initialized to NULL.
11157 (allocate_itemsets): Allocate kernel_items only if needed.
11158
11159 2001-09-22 Akim Demaille <akim@epita.fr>
11160
11161 * configure.in: Bump to 1.29b.
11162 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
11163 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
11164 need xmalloc.c in calc.y.
11165 From Pascal Bart.
11166
11167 2001-09-21 Akim Demaille <akim@epita.fr>
11168
11169 Version 1.29a.
11170 * Makefile.maint, config/config.guess, config/config.sub,
11171 * config/missing: Update from masters.
11172 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
11173 upon package.m4.
11174 * configure.in (ALL_LINGUAS): Add `tr'.
11175
11176 2001-09-21 Akim Demaille <akim@epita.fr>
11177
11178 * tests/Makefile.am (package.m4): Move to...
11179 ($(srcdir)/$(TESTSUITE)): here.
11180
11181 2001-09-20 Akim Demaille <akim@epita.fr>
11182
11183 * src/complain.c: No longer try to be standalone: use system.h.
11184 Don't assume __STDC__ is defined to 1. Just test if it is defined.
11185 * src/complain.h: Likewise.
11186 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
11187 Remove the unused variable `n'.
11188 From Albert Chin-A-Young.
11189
11190 2001-09-18 Marc Autret <autret_m@epita.fr>
11191
11192 * doc/bison.1: Update.
11193 * doc/bison.texinfo (Bison Options): Update --defines and --graph
11194 descriptions.
11195 (Option Cross Key): Update.
11196 Add --graph.
11197
11198 2001-09-18 Marc Autret <autret_m@epita.fr>
11199
11200 * tests/regression.at: New test (comment in %union).
11201
11202 2001-09-18 Marc Autret <autret_m@epita.fr>
11203
11204 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
11205 do that.
11206 Reported by Keith Browne.
11207
11208 2001-09-18 Marc Autret <autret_m@epita.fr>
11209
11210 * tests/output.at: Add tests for --defines and --graph.
11211
11212 2001-09-18 Marc Autret <autret_m@epita.fr>
11213
11214 * tests/output.at: Removes tests of %{header,src}_extension features.
11215
11216 2001-09-18 Akim Demaille <akim@epita.fr>
11217
11218 * tests/Makefile.am (package.m4): New.
11219 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
11220 (_AT_CHECK_CALC_ERROR): Likewise.
11221 Factor the `, ' part of verbose error messages.
11222
11223 2001-09-18 Marc Autret <autret_m@epita.fr>
11224
11225 * src/getargs.c (longopts): Declare --defines and --graph as options
11226 with optional arguments.
11227 * src/files.h: Add extern declarations.
11228 * src/files.c (spec_graph_file, spec_defines_file): New.
11229 (output_files): Update.
11230 Remove CPP-outed code.
11231
11232 2001-09-18 Marc Autret <autret_m@epita.fr>
11233
11234 Turn off %{source,header}_extension feature.
11235
11236 * src/files.c (compute_exts_from_gf): Update.
11237 (compute_exts_from_src): Update.
11238 (output_files): CPP-out useless code.
11239 * src/files.h: Remove {header,source}_extension extern declarations.
11240 * src/reader.c (parse_dquoted_param): CPP-out.
11241 (parse_header_extension_decl): Remove.
11242 (parse_source_extension_decl): Remove.
11243 (read_declarations): Remove cases tok_{hdrext,srcext}.
11244 * src/lex.c (percent_table): Remove {header,source}_extension entries.
11245 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
11246
11247 2001-09-10 Akim Demaille <akim@epita.fr>
11248
11249 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
11250 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
11251 (AT_CHECK_OUTPUT): this.
11252 Merely check ls' exit status, its output is useless.
11253
11254 2001-09-10 Akim Demaille <akim@epita.fr>
11255
11256 * tests/calc.at: Use m4_match.
11257 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
11258
11259 2001-09-10 Marc Autret <autret_m@epita.fr>,
11260 Akim Demaille <akim@epita.fr>
11261
11262 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
11263 enum color_e.
11264 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
11265 to `normal'.
11266 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
11267 * src/lex.h: Adjust prototype.
11268 (token_t): Add `tok_undef'.
11269 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
11270 (parse_percent_token): Now returns token_t.
11271 Add default statement in switch.
11272 (lex): Separate `c' as an input variable, from the token_t result
11273 part.
11274 (unlexed): Is a token_t.
11275
11276 2001-09-10 Akim Demaille <akim@epita.fr>
11277
11278 * configure.in: Bump to 1.29a.
11279
11280 2001-09-07 Akim Demaille <akim@epita.fr>
11281
11282 Version 1.29.
11283
11284 2001-08-30 Akim Demaille <akim@epita.fr>
11285
11286 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
11287 * m4/atconfig.m4: Remove.
11288 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
11289 * tests/bison: New.
11290 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
11291 m4_if, m4_patsubst, and m4_regexp.
11292 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
11293 `input' file instead of echo.
11294
11295 2001-08-29 Akim Demaille <akim@epita.fr>
11296
11297 Bump to 1.28e.
11298
11299 2001-08-29 Akim Demaille <akim@epita.fr>
11300
11301 Version 1.28d.
11302
11303 2001-08-29 Paul Eggert <eggert@twinsun.com>
11304
11305 * src/bison.simple (yyparse): Don't take the address of an
11306 item before the start of an array, as that doesn't conform to
11307 the C Standard.
11308
11309 2001-08-29 Robert Anisko <anisko_r@epita.fr>
11310
11311 * doc/bison.texinfo (Location Tracking Calc): New node.
11312
11313 2001-08-29 Paul Eggert <eggert@twinsun.com>
11314
11315 * src/output.c (output): Do not define const, as this now
11316 causes more problems than it cures.
11317
11318 2001-08-29 Akim Demaille <akim@epita.fr>
11319
11320 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
11321 the nodes.
11322 Be sure to tag the `detailmenu'.
11323
11324 2001-08-29 Akim Demaille <akim@epita.fr>
11325
11326 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
11327 download in a tmp dir.
11328
11329 2001-08-28 Marc Autret <autret_m@epita.fr>
11330
11331 * config/depcomp: New file.
11332
11333 2001-08-28 Marc Autret <autret_m@epita.fr>
11334
11335 * doc/bison.1 (mandoc): Adjust.
11336 From Juan Manuel Guerrero.
11337
11338 2001-08-28 Marc Autret <autret_m@epita.fr>
11339
11340 * src/print_graph.c (print_state): Fix.
11341
11342 2001-08-27 Marc Autret <autret_m@epita.fr>
11343
11344 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
11345 char * members.
11346 Echo modifications to the functions prototypes.
11347 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
11348
11349 2001-08-27 Marc Autret <autret_m@epita.fr>
11350
11351 * src/vcg.c: Include `xalloc.h'.
11352 (add_colorentry): New.
11353 (add_classname): New.
11354 (add_infoname): New.
11355 * src/vcg.h: Add new prototypes.
11356
11357 2001-08-27 Akim Demaille <akim@epita.fr>
11358
11359 * Makefile.maint: Sync. again with CVS Autoconf.
11360
11361 2001-08-27 Akim Demaille <akim@epita.fr>
11362
11363 * Makefile.maint: Formatting changes.
11364 (po-update, cvs-update, update): New targets.
11365 (AMTAR): Remove.
11366
11367 2001-08-27 Akim Demaille <akim@epita.fr>
11368
11369 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
11370 * Makefile.maint: Sync. with CVS Autoconf.
11371
11372 2001-08-27 Marc Autret <autret_m@epita.fr>
11373
11374 * src/vcg.h (struct infoname_s): New.
11375 (struct colorentry_s): New.
11376 (graph_s): New fields {vertical,horizontal}_order in structure.
11377 Add `infoname' field.
11378 Add `colorentry' field;
11379 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
11380 (G_HORIZONTAL_ORDER): New.
11381 (G_INFONAME): New.
11382 (G_COLORENTRY): New.
11383 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
11384 Add output of `infoname'.
11385 Add output of `colorentry'.
11386
11387 2001-08-27 Marc Autret <autret_m@epita.fr>
11388
11389 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
11390 This one shadowed a global parameter.
11391
11392 2001-08-24 Marc Autret <autret_m@epita.fr>
11393
11394 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
11395 instead of `unsigned'.
11396 (print_state): Do not call obstack_object_size () in obstack_grow ()
11397 to avoid macro variables shadowing.
11398
11399 2001-08-23 Marc Autret <autret_m@epita.fr>
11400
11401 * src/lex.c (percent_table): Typo: s/naem/name/.
11402 Add graph option.
11403 Normalize new options declarations.
11404
11405 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
11406
11407 * tests/suite.at: Exercise %header_extension and %source_extension.
11408
11409 2001-08-16 Marc Autret <autret_m@epita.fr>
11410
11411 * src/reader.c (parse_dquoted_param): New.
11412 (parse_header_extension_decl): Use it.
11413 (parse_source_extension_decl): Likewise.
11414
11415 2001-08-16 Marc Autret <autret_m@epita.fr>
11416
11417 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
11418 (get_xxxx_str): Use assert () instead of complain ().
11419 Remove return invokations in default cases.
11420 (get_decision_str): Modify default behaviour. Remove second argument.
11421 Echo modifications on calls.
11422 (output_graph): Fix.
11423
11424 2001-08-16 Marc Autret <autret_m@epita.fr>
11425
11426 * src/getargs.c (usage): Update with ``-g, --graph''.
11427
11428 2001-08-16 Marc Autret <autret_m@epita.fr>
11429
11430 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
11431 (Option Cross Key): Likewise.
11432 * doc/bison.1: Update.
11433
11434 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
11435
11436 * src/output.c (output_master_parser): Don't finish action_obstack.
11437 (output_parser): Don't care about the muscle action, here.
11438 (prepare): Copy the action_obstack in the action muscle.
11439 (output): Free action_obstack.
11440
11441 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
11442
11443 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
11444 will contain `%union' declaration.
11445 (parse_union_decl): Delete #line directive output.
11446 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
11447 informations about %union.
11448 (parse_union_decl): Copy the union_obstack in the muscle stype.
11449 * src/bison.simple: Add new #line directive.
11450 Add typdef %%stype YYSTYPE.
11451
11452 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
11453
11454 * src/bison.simple: Add new `#line' directive.
11455
11456 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
11457
11458 * src/bison.simple: New `#line' directive.
11459 * src/output.c (output_parser): Support new dynamic muscle input_line.
11460
11461 2001-09-22 Marc Autret <autret_m@epita.fr>
11462
11463 * src/output.c (output_master_parser): New.
11464 (output_parser): Be more re-entrant.
11465
11466 2001-09-21 Marc Autret <autret_m@epita.fr>
11467
11468 * src/reader.c (copy_definition, parse_union_decl): Update and use
11469 `linef' muscle.
11470 (copy_action): Likewise.
11471 Use obstack_1grow ().
11472 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
11473
11474 2001-09-21 Marc Autret <autret_m@epita.fr>
11475
11476 * src/options.c (option_table): Adjust.
11477 * src/lex.c (parse_percent_token): Fix.
11478
11479 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
11480
11481 * src/options.c (symtab.h): Include it, need by lex.h.
11482
11483 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
11484
11485 * src/lex.c (parse_percent_token): Change type of variable `tx', which
11486 is now an option_table_struct*.
11487 (option_strcmp): New function option_strcmp.
11488 (parse_percent_token): Call option_strcmp.
11489 * src/getargs.c (xalloc.h, options.h): Include it.
11490 (getargs): Call create_long_option_table.
11491 (getargs): Free longopts at the end of the function.
11492 (shortopts): Move in options.c.
11493 * src/options.c (create_long_option_table): New function. Convert
11494 information from option_table to option structure.
11495 * src/reader.c (options.h): Include it.
11496
11497 * src/Makefile.am: Adjust.
11498 * src/options.c (option_table): Create from longopts and percent_table.
11499 * src/getargs.c (longopts): Delete.
11500 * src/lex.c (struct percent_table_struct): Delete.
11501 (percent_table): Delete.
11502 (options.h): Include it.
11503 * src/options.c: Create.
11504 * src/options.h: Create.
11505 Declare enum opt_access_e.
11506 Define struct option_table_struct.
11507
11508 2001-09-20 Marc Autret <autret_m@epita.fr>
11509
11510 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
11511 sections of Bison.
11512
11513 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
11514
11515 * src/bison.simple: s/%%filename/%%skeleton.
11516 * src/muscle_tab.c (getargs.h): Include it.
11517 (muscle_init): Insert new muscle skeleton.
11518
11519 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
11520
11521 * src/output.c (output_parser): Delete unused variable actions_dumped.
11522
11523 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
11524
11525 * src/output.c (output): Delete call to reader_output_yylsp.
11526 * src/reader.c (reader): Likewise.
11527 * src/reader.h: Delete declaration of reader_output_yylsp.
11528
11529 2001-09-02 Marc Autret <autret_m@epita.fr>
11530
11531 * src/reader.c: Include muscle_tab.h.
11532 (parse_union_decl): Update.
11533 (parse_macro_decl): Rename parse_muscle_decl.
11534 Update to use renamed functions and variable.
11535 (read_declarations, copy_action, read_additionnal_code, : Updated
11536 with correct variables and functions names.
11537 (packsymbols, reader): Likewise.
11538
11539 * src/reader.h (muscle_obstack): Extern declaration update.
11540
11541 * src/output.c: Include muscle_tab.h
11542 In all functions using macro_insert, change by using muscle_insert ().
11543 (macro_obstack): Rename muscle_obstack.
11544 Echo modifications in the whole file.
11545 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
11546 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
11547 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
11548
11549 * src/muscle_tab.h: Update double inclusion macros.
11550 (macro_entry_s): Rename muscle_entry_s.
11551 Update prototypes.
11552
11553 * src/muscle_tab.c: Include muscle_tab.h.
11554 Rename macro_tabble to muscle_table.
11555 (mhash1, mhash2, mcmp): Use muscle_entry.
11556 (macro_init): Rename muscle_init. Update.
11557 (macro_insert): Rename muscle_insert. Update.
11558 (macro_find): Rename muscle_find. Update.
11559
11560 * src/main.c: Include muscle_tab.h.
11561 (main): Call muscle_init ().
11562 * src/Makefile.am (bison_SOURCES): Echo modifications.
11563
11564 2001-09-02 Marc Autret <autret_m@epita.fr>
11565
11566 Now the files macro_tab.[ch] are named muscle_tab.[ch].
11567
11568 * src/muscle_tab.c, src/muscle_tab.h: Add files.
11569
11570 2001-09-02 Marc Autret <autret_m@epita.fr>
11571
11572 * src/macrotab.c, src/macrotab.h: Remove.
11573
11574 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
11575
11576 * src/reader.c (copy_guard): Use muscle to specify the `#line'
11577 filename.
11578
11579 2001-09-01 Marc Autret <autret_m@epita.fr>
11580
11581 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
11582 to an explicit value to activate the feature. We do it here.
11583
11584 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
11585
11586 * src/output.c (prepare): Delete the `filename' muscule insertion.
11587 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
11588 (parse_union_decl): Likewise.
11589 * src/macrotab.c (macro_init): Initialize filename by infile.
11590
11591 2001-08-31 Marc Autret <autret_m@epita.fr>
11592
11593 * src/bison.simple (YYLSP_NEEDED): New definition.
11594 * src/output.c (prepare): Add macro insertion of `locations_flag'
11595
11596 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
11597
11598 * src/output.c (prepare): Delete insertion of previous muscles,
11599 and insert the `prefix' muscles.
11600 * src/macrotab.c (macro_init): Likewise.
11601 (macro_init): Initialization prefix directive by `yy'.
11602 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
11603 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
11604 yylval, yydebug, yyerror, yynerrs and yyparse.
11605 New directive `#define' to substitute yydebug, ... with option
11606 name_prefix.
11607
11608 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
11609
11610 * src/main.c (main): Standardize.
11611 * src/output.c (output_table_data, output_parser): Likewise.
11612 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
11613
11614 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
11615
11616 * src/reader.c (read_additionnal_code): Rename %%user_code to
11617 %%epilogue.
11618 * src/output.c (output): Rename %%declarations to %%prologue.
11619 * src/bison.simple: Echo modifications.
11620
11621 2001-08-31 Marc Autret <autret_m@epita.fr>
11622
11623 * src/reader.c (readgram): CleanUp.
11624 (output_token_defines): Likewise.
11625 (packsymbols): Likewise.
11626 (reader): Likewise.
11627 * src/output.c (output): CPP-out useless code.
11628
11629 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
11630
11631 * src/reader.c (reader): Delete obsolete call to function
11632 output_trailers and output_headers.
11633 * src/output.h: Remove obsolete functions prototypes of output_headers
11634 and output_trailers.
11635
11636 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
11637
11638 * src/main.c: Include macrotab.h.
11639 * src/macrotab.h (macro_entry_s): Constify fields.
11640 Adjust functions prototypes.
11641 * src/macrotab.c (macro_insert): Constify key and value.
11642 (macro_find): Constify key.
11643 (macro_insert): Include 'xalloc.h'
11644 (macro_insert): Use XMALLOC.
11645 (macro_find): Constify return value.
11646 * src/output.c (output_table_data): Rename table to table_data.
11647 (output_parser): Constify macro_key, macro_value.
11648
11649 2001-08-30 Marc Autret <autret_m@epita.fr>
11650
11651 * src/reader.c (parse_skel_decl): New.
11652 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
11653 * src/lex.h (token_t): New token `tok_skel'.
11654 * src/lex.c (percent_table): Add skeleton option entry.
11655 Standardize.
11656
11657 2001-08-29 Marc Autret <autret_m@epita.fr>
11658
11659 * src/bison.simple: Add %%user_code directive at the end.
11660 * src/reader.c (read_additionnal_code): New.
11661 (reader): Use it.
11662 * src/output.c (output_program): Remove.
11663 (output): Update.
11664
11665 2001-08-28 Marc Autret <autret_m@epita.fr>
11666
11667 * src/output.c (output_actions): Clean up.
11668 (output_gram): CPP-out useless code.
11669 * src/reader.c (reader): Clean up, CPP-out useless code.
11670
11671 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
11672
11673 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
11674 directive.
11675 * src/bison.simple: Add `%%definitions'.
11676
11677 2001-08-28 Marc Autret <autret_m@epita.fr>
11678
11679 * config/depcomp: New file.
11680
11681 2001-08-27 Paul Eggert <eggert@twinsun.com>
11682
11683 * src/bison.simple (yyparse): Don't take the address of an
11684 item before the start of an array, as that doesn't conform to
11685 the C Standard.
11686
11687 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
11688
11689 * src/output.c (output): Remove the initialization of the macro
11690 obstack. It was done too late here.
11691
11692 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
11693 completely wrong.
11694 (reader): Initialize the macro obstack here, since we need it to grow
11695 '%define' directives.
11696
11697 * src/reader.h: Declare the macro obstack as extern.
11698
11699 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
11700
11701 * src/output.c (output_parser): Fix. Store single '%' characters in
11702 the output obstack instead of throwing them away.
11703
11704 2001-08-27 Akim Demaille <akim@epita.fr>
11705
11706 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
11707
11708 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
11709
11710 * lib/Makefile.am: Adjust.
11711
11712 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
11713
11714 * src/bison.simple: Update and add '%%' directives.
11715
11716 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
11717
11718 * src/reader.c (reader): Remove calls to 'output_headers' and
11719 'output_trailers'. Remove some C output.
11720 (readgram): Disable a piece of code that was writing a default
11721 definition for 'YYSTYPE'.
11722 (reader_output_yylsp): Remove.
11723 (packsymbols): Output token defintions to a macro.
11724 (copy_definition): Disable C output.
11725
11726 * src/reader.c (parse_macro_decl): New function used to parse macro
11727 declarations.
11728 (copy_string2): Put the body of copy_string into this new function.
11729 Add a parameter to let the caller choose whether he wants to copy the
11730 string delimiters or not.
11731 (copy_string): Be a simple call to copy_string2 with the last argument
11732 bound to true.
11733 (read_declarations): Add case for macro definition.
11734 (copy_identifier): New.
11735 (parse_macro_decl): Read macro identifiers using copy_identifier
11736 rather than lex.
11737
11738 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
11739
11740 * src/output.c (prepare): Add prefixed names.
11741 (output_parser): Output semantic actions.
11742 (output_parser): Fix bug on '%%line' directives.
11743
11744 * src/output.c (output_headers): Remove. The C code printed by this
11745 function should now be in the skeletons.
11746 (output_trailers): Remove.
11747 (output): Disable call to 'reader_output_yylsp'.
11748 (output_rule_data): Do not output tables to the table obstack.
11749
11750 * src/output.c: Remove some C dedicated output.
11751 Improve the use of macro and output obstacks.
11752 (output_defines): Remove.
11753
11754 * src/output.c (output_token_translations): Associate 'translate'
11755 table with a macro. No output to the table obstack.
11756 (output_gram): Same for 'rhs' and 'prhs'.
11757 (output_stos): Same for 'stos'.
11758 (output_rule_data): Same for 'r1' and 'r2'.
11759 (token_actions): Same for 'defact'.
11760 (goto_actions): Same for 'defgoto'.
11761 (output_base): Same for 'pact' and 'pgoto'.
11762 (output_table): Same for 'table'.
11763 (output_check): Same for 'check'.
11764
11765 * src/output.c (output_table_data): New function.
11766 (output_short_table): Remove.
11767 (output_short_or_char_table): Remove.
11768
11769 * src/output.c (output_parser): Replace most of the skeleton copy code
11770 with something new. Skeletons are now processed character by character
11771 rather than line by line, and Bison looks for '%%' macros. This is the
11772 first step in making Bison's output process (a lot) more flexible.
11773 (output_parser): Use the macro table.
11774
11775 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
11776
11777 * src/main.c (main): Initialize the macro table.
11778
11779 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
11780
11781 * src/lex.c (percent_table): Add tok_define.
11782 * src/lex.h: Add tok_define.
11783
11784 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
11785
11786 * src/macrotab.c: New file.
11787 * src/macrotab.h: New file.
11788 * src/Makefile.am: Update.
11789
11790 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
11791
11792 * lib/hash.c: New file.
11793 * lib/hash.h: New file.
11794 * lib/Makefile.am: Update.
11795
11796 2001-08-15 Akim Demaille <akim@epita.fr>
11797
11798 Version 1.28c.
11799
11800 2001-08-15 Marc Autret <autret_m@epita.fr>
11801
11802 * src/reader.c (readgram): Indent output macro YYSTYPE.
11803 (packsymbols): Likewise.
11804 (output_token_defines): Likewise.
11805 * src/files.c: Standardize.
11806 (compute_header_macro): New.
11807 (defines_obstack_save): New. Use compute_header_macro.
11808 (output_files): Update. Use defines_obstack_save.
11809
11810 2001-08-15 Akim Demaille <akim@epita.fr>
11811
11812 * doc/bison.texinfo (Table of Symbols): Document
11813 YYSTACK_USE_ALLOCA.
11814
11815 2001-08-15 Akim Demaille <akim@epita.fr>
11816
11817 * missing: Update from CVS Automake.
11818 * config/config.guess, config/config.sub, config/texinfo.tex:
11819 Update from gnu.org.
11820
11821 2001-08-15 Akim Demaille <akim@epita.fr>
11822
11823 * Makefile.maint: Sync with CVS Autoconf.
11824
11825 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
11826
11827 * doc/bison.texinfo: Include GNU Free Documentation License from
11828 `fdl.texi'.
11829 * doc/fdl.texi: Add to package.
11830
11831 2001-08-14 Marc Autret <autret_m@epita.fr>
11832
11833 Turn on %{source,header}_extension features.
11834
11835 * src/lex.c (percent_table): Un-CPP out header_extension and
11836 source_extension.
11837 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
11838 (compute_exts_from_src): Remove conditions. It restores priorities
11839 between options.
11840
11841 2001-08-14 Marc Autret <autret_m@epita.fr>
11842
11843 * src/files.c (compute_base_names): Add extensions computing when
11844 `--file-prefix' used.
11845 Standardize function calls.
11846
11847 2001-08-13 Marc Autret <autret_m@epita.fr>
11848
11849 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
11850 defining it (defined but null disables alloca).
11851
11852 2001-08-13 Marc Autret <autret_m@epita.fr>
11853
11854 * src/bison.simple (_yy_memcpy): CPP reformat.
11855
11856 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
11857
11858 * tests/atconfig.in (CPPFLAGS): Fix.
11859
11860 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
11861
11862 * doc/bison.texinfo: Include GNU General Public License from
11863 `gpl.texi'.
11864 * doc/gpl.texi: Add to package.
11865
11866 2001-08-10 Marc Autret <autret_m@epita.fr>
11867
11868 * src/print_graph.h: Fix.
11869 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
11870
11871 2001-08-10 Akim Demaille <akim@epita.fr>
11872
11873 * src/system.h: Provide default declarations for stpcpy, strndup,
11874 and strnlen.
11875
11876 2001-08-10 Robert Anisko <anisko_r@epita.fr>
11877
11878 * doc/bison.texinfo (Locations): Update @$ stuff.
11879
11880 2001-08-09 Robert Anisko <anisko_r@epita.fr>
11881
11882 * src/bison.simple (YYLLOC_DEFAULT): Update.
11883 (yyparse): Adjust.
11884
11885 2001-08-08 Marc Autret <autret_m@epita.fr>
11886
11887 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
11888 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
11889 Reported by Fabrice Bauzac.
11890
11891 2001-08-08 Marc Autret <autret_m@epita.fr>
11892
11893 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
11894 * src/vcg.c (output_node): Fix.
11895 * src/vcg.h: Cleanup.
11896 * src/print_graph.c: Add comments.
11897 (node_output_size): New global variable. Simplify the formatting of
11898 the VCG graph output.
11899 (print_actions): Unused code is now used. It notifies the final state
11900 and no action states in the VCG graph. It also give the reduce actions.
11901 The `shift and goto' edges are red and the `go to state' edges are
11902 blue.
11903 Get the current node name and node_obstack by argument.
11904 (node_obstack): New variable.
11905 (print_state): Manage node_obstack.
11906 (print_core): Use node_obstack given by argument.
11907 A node is not only computed here but in print_actions also.
11908 (print_graph): CPP out useless code instead of commenting it.
11909
11910 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
11911
11912 * tests/atconfig.in (CPPFLAGS): Fix.
11913
11914 2001-08-07 Akim Demaille <akim@epita.fr>
11915
11916 * src/print_graph.c (quote): New.
11917 (print_core): Use it.
11918
11919 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
11920
11921 * src/vcg.c (complain.h): Include it.
11922 Unepitaize `return' invocations.
11923 [NDEBUG] (main): Remove.
11924 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
11925 * src/files.c (open_files): Initialize graph_obstack.
11926 * src/print_graph.c (print_actions): CPP out useless code.
11927 (print_core): Don't output the last `\n' in labels.
11928 Use `quote'.
11929 * src/files.c (output_files): Output the VCG file.
11930 * src/main.c (main): Invoke print_graph ();
11931
11932 2001-08-06 Marc Autret <autret_m@epita.fr>
11933
11934 Automaton VCG graph output.
11935 Using option ``-g'' or long option ``--graph'', you can generate
11936 a gram_filename.vcg file containing a VCG description of the LALR (1)
11937 automaton of your grammar.
11938
11939 * src/main.c: Call to print_graph() function.
11940 * src/getargs.h: Update.
11941 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
11942 (graph_flag): New flag.
11943 (longopts): Update.
11944 (getargs): Add case `g'.
11945 * src/files.c (graph_obstack): New obstack struct.
11946 (open_files): Initialize new obstack.
11947 (output_files): Saves graph_obstack if required.
11948 * src/files.h (graph_obstack): New extern declaration.
11949 * src/Makefile.am: Add new source files.
11950
11951 2001-08-06 Marc Autret <autret_m@epita.fr>
11952
11953 * src/print_graph.c, src/print_graph.h (graph): New.
11954 * src/vcg.h: New file.
11955 * src/vcg.c: New file, VCG graph handling.
11956
11957 2001-08-06 Marc Autret <autret_m@epita.fr>
11958
11959 Add of %source_extension and %header_extension which specify
11960 the source or/and the header output file extension.
11961
11962 * src/files.c (compute_base_names): Remove initialisation of
11963 src_extension and header_extension.
11964 (compute_exts_from_gf): Update.
11965 (compute_exts_from_src): Update.
11966 (output_files): Update.
11967 * src/reader.c (parse_header_extension_decl): New.
11968 (parse_source_extension_decl): New.
11969 (read_declarations): New case statements for the new tokens.
11970 * src/lex.c (percent_table): Add entries for %source_extension
11971 and %header_extension.
11972 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
11973
11974 2001-08-06 Marc Autret <autret_m@epita.fr>
11975
11976 * configure.in: Bump to 1.28c.
11977 * doc/bison.texinfo: Texinfo thingies.
11978
11979 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
11980
11981 * tests/atconfig.in (CPPFLAGS): Add.
11982 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
11983
11984 2001-08-03 Akim Demaille <akim@epita.fr>
11985
11986 Version 1.28b.
11987
11988 2001-08-03 Akim Demaille <akim@epita.fr>
11989
11990 * tests/Makefile.am (check-local): Ship testsuite.
11991 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
11992 Include `string.h'.
11993
11994 2001-08-03 Akim Demaille <akim@epita.fr>
11995
11996 * configure.in: Try using -Wformat when compiling.
11997
11998 2001-08-03 Akim Demaille <akim@epita.fr>
11999
12000 * configure.in: Bump to 1.28b.
12001
12002 2001-08-03 Akim Demaille <akim@epita.fr>
12003
12004 * src/complain.c: Adjust strerror_r portability issues.
12005
12006 2001-08-03 Akim Demaille <akim@epita.fr>
12007
12008 Version 1.28a.
12009
12010 2001-08-03 Akim Demaille <akim@epita.fr>
12011
12012 * src/getargs.c, src/getarg.h (skeleton)): Constify.
12013 * src/lex.c (literalchar): Avoid name clashes on `buf'.
12014 * src/getargs.c: Include complain.h.
12015 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
12016 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
12017
12018 2001-08-03 Akim Demaille <akim@epita.fr>
12019
12020 * src/reader.c (readgram): Display hidden chars in error messages.
12021
12022 2001-08-03 Akim Demaille <akim@epita.fr>
12023
12024 Update to gettext 0.10.39.
12025
12026 2001-08-03 Akim Demaille <akim@epita.fr>
12027
12028 * lib/strspn.c: New.
12029
12030 2001-08-01 Marc Autret <autret_m@epita.fr>
12031
12032 * doc/bison.texinfo: Update.
12033 * doc/bison.1 (mandoc): Update.
12034 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
12035 * src/files.c: Support output files extensions computing.
12036 (src_extension): New static variable.
12037 (header_extension): New static variable.
12038 (tr): New function.
12039 (get_extension_index): New function, gets the index of an extension
12040 filename in a string.
12041 (compute_exts_from_gf): New function, computes extensions from the
12042 grammar file extension.
12043 (compute_exts_from_src): New functions, computes extensions from the
12044 C source file extension, file given by ``-o'' option.
12045 (compute_base_names): Update.
12046 (output_files): Update.
12047
12048 2001-08-01 Robert Anisko <anisko_r@epita.fr>
12049
12050 * doc/bison.texi: Document @$.
12051 (Locations): New section.
12052
12053 2001-07-18 Akim Demaille <akim@epita.fr>
12054
12055 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
12056 * config/prev-version.txt, config/move-if-change: New.
12057 * Makefile.am: Adjust.
12058
12059 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
12060
12061 * src/bison.simple (yyparse): Suppress warning `comparaison
12062 between signed and unsigned'.
12063
12064 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
12065
12066 * src/getargs.h (raw_flag): Remove.
12067 * src/getargs.c: Die on `-r'/`--raw'.
12068 * src/lex.c (parse_percent_token): Die on `%raw'.
12069 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
12070 * tests/calc.at: Suppress test with option `--raw'.
12071
12072 2001-07-14 Akim Demaille <akim@epita.fr>
12073
12074 * config/: New.
12075 * configure.in: Require Autoconf 2.50.
12076 Update to gettext 0.10.38.
12077
12078 2001-03-16 Akim Demaille <akim@epita.fr>
12079
12080 * doc/bison.texinfo: ANSIfy the examples.
12081
12082 2001-03-16 Akim Demaille <akim@epita.fr>
12083
12084 * getargs.c (skeleton): New variable.
12085 (longopts): --skeleton is a new option.
12086 (shortopts, getargs): -S is a new option.
12087 * getargs.h: Declare skeleton.
12088 * output.c (output_parser): Use it.
12089
12090 2001-03-16 Akim Demaille <akim@epita.fr>
12091
12092 * m4/strerror_r.m4: New.
12093 * m4/error.m4: Run AC_FUNC_STRERROR_R.
12094 * lib/error.h, lib/error.c: Update.
12095
12096 2001-03-16 Akim Demaille <akim@epita.fr>
12097
12098 * src/getargs.c (longopts): Clean up.
12099
12100 2001-02-21 Akim Demaille <akim@epita.fr>
12101
12102 * src/reader.c (gensym): `gensym_count' is your own.
12103 Use a static buf to create the symbol name, as token_buffer is no
12104 longer a buffer.
12105
12106 2001-02-08 Akim Demaille <akim@epita.fr>
12107
12108 * src/conflicts.c (conflict_report): Be sure not to append to res
12109 between two calls, which could happen if both first sprintf were
12110 skipped, but not the first cp += strlen.
12111
12112 2001-02-08 Akim Demaille <akim@epita.fr>
12113
12114 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
12115 New, from fileutils 4.0.37.
12116 * configure.in: Require Autoconf 2.49c. I took some time before
12117 making this decision. This is the only way out for portability
12118 issues in Bison, it would mean way too much duplicate effort to
12119 import in Bison features implemented in 2.49c since 2.13.
12120 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
12121
12122 2001-02-02 Akim Demaille <akim@epita.fr>
12123
12124 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
12125 * lib/xalloc.h, lib/xmalloc.c: Update.
12126
12127 2001-01-19 Akim Demaille <akim@epita.fr>
12128
12129 Get rid of the ad hoc handling of token_buffer in the scanner: use
12130 the obstacks.
12131
12132 * src/lex.c (token_obstack): New.
12133 (init_lex): Initialize it. No longer call...
12134 (grow_token_buffer): this. Remove it.
12135 Adjust all the places which used it to use the obstack.
12136
12137 2001-01-19 Akim Demaille <akim@epita.fr>
12138
12139 * src/lex.h: Rename all the tokens:
12140 s/\bENDFILE\b/tok_eof/g;
12141 s/\bIDENTIFIER\b/tok_identifier/g;
12142 etc.
12143 Let them be enums, not #define, to ease debugging.
12144 Adjust all the code.
12145
12146 2001-01-18 Akim Demaille <akim@epita.fr>
12147
12148 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
12149 * src/lex.c (maxtoken, grow_token_buffer): Static.
12150
12151 2001-01-18 Akim Demaille <akim@epita.fr>
12152
12153 Since we now use obstacks, more % directives can be enabled.
12154
12155 * src/lex.c (percent_table): Also accept `%yacc',
12156 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
12157 `%debug'.
12158 Handle the actions for `%semantic_parser' and `%pure_parser' here,
12159 instead of returning a token.
12160 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
12161 * src/reader.c (read_declarations): Adjust.
12162 * src/files.c (open_files): Don't call `compute_base_names', don't
12163 compute `attrsfile' since they depend upon data which might be
12164 *in* the input file now.
12165 (output_files): Do it here.
12166 * src/output.c (output_headers): Document the fact that this patch
12167 introduces a guaranteed SEGV for semantic parsers.
12168 * doc/bison.texinfo: Document them.
12169 * tests/suite.at: Exercise these %options.
12170
12171 2000-12-20 Akim Demaille <akim@epita.fr>
12172
12173 Also handle the output file (--verbose) with obstacks.
12174
12175 * files.c (foutput): Remove.
12176 (output_obstack): New.
12177 Adjust all dependencies.
12178 * src/conflicts.c: Return a string.
12179 * src/system.h (obstack_grow_string): Rename as...
12180 (obstack_sgrow): this. Be ready to work with non literals.
12181 (obstack_fgrow4): New.
12182
12183 2000-12-20 Akim Demaille <akim@epita.fr>
12184
12185 * src/files.c (open_files): Fix the computation of short_base_name
12186 in the case of `-o foo.tab.c'.
12187
12188 2000-12-20 Akim Demaille <akim@epita.fr>
12189
12190 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
12191 (copy_dollar): Now that everything uses obstacks, get rid of the
12192 FILE * parameters.
12193
12194 2000-12-20 Akim Demaille <akim@epita.fr>
12195
12196 * src/files.c (open_files): Actually the `.output' file is based
12197 on the short_base_name, not base_name.
12198 * tests/suite.at (Checking output file names): Adjust.
12199
12200 2000-12-20 Akim Demaille <akim@epita.fr>
12201
12202 * src/bison.s1: Remove, we now use directly...
12203 * src/bison.simple: this.
12204 * src/Makefile.am: Use pkgdata instead of data.
12205
12206 2000-12-20 Akim Demaille <akim@epita.fr>
12207
12208 * src/files.c (guard_obstack): New.
12209 (open_files): Initialize it.
12210 (output_files): Dump it...
12211 * src/files.h: Export it.
12212 * src/reader.c (copy_guard): Use it.
12213
12214 2000-12-19 Akim Demaille <akim@epita.fr>
12215
12216 * src/files.c (outfile, defsfile, actfile): Removed as global
12217 vars.
12218 (open_files): Don't compute them.
12219 (output_files): Adjust.
12220 (base_name, short_base_name): Be global.
12221 Adjust dependencies.
12222
12223 2000-12-19 Akim Demaille <akim@epita.fr>
12224
12225 * src/files.c (strsuffix): New.
12226 (stringappend): Be just like strcat but allocate.
12227 (base_names): Eve out from open_files.
12228 Try to simplify the rather hairy computation of base_name and
12229 short_base_name.
12230 (open_files): Use it.
12231 * tests/suite.at (Checking output file names): New test.
12232
12233 2000-12-19 Akim Demaille <akim@epita.fr>
12234
12235 * src/system.h (obstack_grow_literal_string): Rename as...
12236 (obstack_grow_string): this.
12237 * src/output.c (output_parser): Recognize `%% actions' instead of
12238 `$'.
12239 * src/bison.s1: s/$/%% actions/.
12240 * src/bison.hairy: Likewise.
12241
12242 2000-12-19 Akim Demaille <akim@epita.fr>
12243
12244 * src/output.c (output_parser): Compute the `#line' lines when
12245 there are.
12246 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
12247 Suggested by Hans Aberg.
12248
12249 2000-12-19 Akim Demaille <akim@epita.fr>
12250
12251 Let the handling of the skeleton files be local to the procedures
12252 that use it.
12253
12254 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
12255 longer static.
12256 (fparser, open_extra_files): Remove.
12257 (open_files, output_files): Don't take care of fparser.
12258 * src/files.h: Adjust.
12259 * src/output.c (output_parser): Open and close the file to the
12260 skeleton.
12261 * src/reader.c (read_declarations): When %semantic_parser, open
12262 fguard.
12263
12264 2000-12-19 Akim Demaille <akim@epita.fr>
12265
12266 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
12267 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
12268
12269 2000-12-19 Akim Demaille <akim@epita.fr>
12270
12271 * src/files.c (open_files): Yipee! We no longer need all the code
12272 looking for `/tmp' since we have no tmp file.
12273
12274 2000-12-19 Akim Demaille <akim@epita.fr>
12275
12276 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
12277 New macros.
12278 * src/files.c (open_files): Less dependency on MSDOS etc.
12279
12280 2000-12-14 Akim Demaille <akim@epita.fr>
12281
12282 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
12283 Provide a default definition.
12284 Use it when executing the default @ action.
12285 * src/reader.c (reader_output_yylsp): No longer include
12286 `timestamp' and `text' in the default YYLTYPE.
12287
12288 2000-12-12 Akim Demaille <akim@epita.fr>
12289
12290 * src/reader.c (copy_definition, parse_union_decl, copy_action)
12291 (copy_guard): Quote the file names.
12292 Reported by Laurent Mascherpa.
12293
12294 2000-12-12 Akim Demaille <akim@epita.fr>
12295
12296 * src/output.c (output_headers, output_program, output): Be sure
12297 to escape special characters when outputting filenames.
12298 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
12299 (output_headers): Don't depend on them, Use ACTSTR.
12300
12301 2000-11-17 Akim Demaille <akim@epita.fr>
12302
12303 * lib/obstack.h: Formatting changes.
12304 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
12305 prevents type checking.
12306 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
12307 cast the value to (void *): assigning a `foo *' to a `void *'
12308 variable is valid.
12309 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
12310 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
12311 append characters.
12312
12313 2000-11-17 Akim Demaille <akim@epita.fr>
12314
12315 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
12316 as...
12317 (suite.m4, regression.m4, calc.m4): these.
12318 * tests/atgeneral.m4: Update from CVS Autoconf.
12319
12320 2000-11-17 Akim Demaille <akim@epita.fr>
12321
12322 * tests/regression.m4 (%union and --defines): New test,
12323 demonstrating a current bug in the obstack implementation.
12324
12325 2000-11-17 Akim Demaille <akim@epita.fr>
12326
12327 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
12328 macros.
12329 Use them to declare the variables which are global or local to
12330 `yyparse'.
12331
12332 2000-11-17 Akim Demaille <akim@epita.fr>
12333
12334 * acconfig.h: Remove, no longer used.
12335
12336 2000-11-07 Akim Demaille <akim@epita.fr>
12337
12338 * src: s/Copyright (C)/Copyright/g.
12339
12340 2000-11-07 Akim Demaille <akim@epita.fr>
12341
12342 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
12343 defining.
12344 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
12345
12346 2000-11-07 Akim Demaille <akim@epita.fr>
12347
12348 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
12349 Merge in a single CPP if/else.
12350
12351 2000-11-07 Akim Demaille <akim@epita.fr>
12352
12353 * src/output.c (output): Remove useless variables.
12354 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
12355 argument `data' for consistency with the prototypes.
12356 Qualify it `const'.
12357 (obstack_copy, obstack_copy0): Rename the second argument as
12358 `address' for consistency. Qualify it `const'.
12359 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
12360 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
12361 `const' their input argument (`data' or `address').
12362 Adjust the corresponding macros to include `const' in casts.
12363
12364 2000-11-03 Akim Demaille <akim@epita.fr>
12365
12366 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
12367 s/PFILE1/BISON_HAIRY/.
12368 Adjust dependencies.
12369
12370 2000-11-03 Akim Demaille <akim@epita.fr>
12371
12372 For some reason, this was not applied.
12373
12374 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
12375 `unlink': it's no longer used.
12376
12377 2000-11-03 Akim Demaille <akim@epita.fr>
12378
12379 * src/files.c (skeleton_find): New function, eved out of...
12380 (open_files, open_extra_files): here.
12381
12382 2000-11-03 Akim Demaille <akim@epita.fr>
12383
12384 Don't use `atexit'.
12385
12386 * src/files.c (obstack_save): New function.
12387 (done): Rename as...
12388 (output_files): this.
12389 Use `obstack_save'.
12390 * src/main.c (main): Don't use `atexit' to register `done', since
12391 it no longer has to remove tmp files, just call `output_files'
12392 when there are no errors.
12393
12394 2000-11-02 Akim Demaille <akim@epita.fr>
12395
12396 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
12397 `unlink': it's no longer used.
12398 * src/files.h: Formatting changes.
12399
12400 2000-11-02 Akim Demaille <akim@epita.fr>
12401
12402 Remove the last uses of mktemp and unlink/delete.
12403
12404 * src/files.c (fdefines, ftable): Removed.
12405 (defines_ostack, table_obstack): New.
12406 Adjust dependencies of the former into uses of the latter.
12407 * src/output.c (output_short_or_char_table, output_short_table):
12408 Convert to using obstacks.
12409 * src/reader.c (copy_comment2): Accept one FILE * and two
12410 obstacks.
12411 (output_token_defines, reader_output_yylsp): Use obstacks.
12412 * src/system.h (obstack_fgrow3): New.
12413 * po/POTFILES.in: Adjust.
12414
12415 2000-11-01 Akim Demaille <akim@epita.fr>
12416
12417 Change each use of `fattrs' into a use of `attrs_obstack'.
12418
12419 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
12420 * src/files.c (fattrs): Remove.
12421 (attrs_obstack): New.
12422 Adjust all dependencies.
12423 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
12424
12425 2000-11-01 Akim Demaille <akim@epita.fr>
12426
12427 Introduce obstacks.
12428 Change each use of `faction' into a use of `action_obstack'.
12429
12430 * lib/obstack.h, lib/obstack.c: New files.
12431 * src/files.c (faction): Remove.
12432 (action_obstack): New.
12433 Adjust all dependencies.
12434
12435 2000-10-20 Akim Demaille <akim@epita.fr>
12436
12437 * lib/quote.h (PARAMS): New macro. Use it.
12438
12439 2000-10-16 Akim Demaille <akim@epita.fr>
12440
12441 * src/output.c (output_short_or_char_table): New function.
12442 (output_short_table, output_token_translations): Use it.
12443 (goto_actions): Use output_short_table.
12444
12445 2000-10-16 Akim Demaille <akim@epita.fr>
12446
12447 * src/symtab.c (bucket_new): New function.
12448 (getsym): Use it.
12449
12450 * src/output.c (output_short_table): New argument to display the
12451 comment associated with the table.
12452 Adjust dependencies.
12453 (output_gram): Use it.
12454 (output_rule_data): Nicer output layout for YYTNAME.
12455
12456 2000-10-16 Akim Demaille <akim@epita.fr>
12457
12458 * src/lex.c (read_typename): New function.
12459 (lex): Use it.
12460 * src/reader.c (copy_dollar): Likewise.
12461
12462 2000-10-16 Akim Demaille <akim@epita.fr>
12463
12464 * src/reader.c (copy_comment2): Expect the input stream to be on
12465 the `/' which is suspected to open a comment, instead of being
12466 called after `//' or `/*' was read.
12467 (copy_comment, copy_definition, parse_union_decl, copy_action)
12468 (copy_guard): Adjust.
12469
12470 2000-10-16 Akim Demaille <akim@epita.fr>
12471
12472 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
12473 `read_signed_integer'.
12474
12475 2000-10-16 Akim Demaille <akim@epita.fr>
12476
12477 * src/reader.c (copy_dollar): New function.
12478 (copy_guard, copy_action): Use it.
12479
12480 2000-10-16 Akim Demaille <akim@epita.fr>
12481
12482 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
12483 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
12484 New files, from Fileutils 4.0.27.
12485 * src/main.c (printable_version): Remove.
12486 * src/lex.c, src/reader.c: Use `quote'.
12487
12488 2000-10-04 Akim Demaille <akim@epita.fr>
12489
12490 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
12491
12492 2000-10-04 Akim Demaille <akim@epita.fr>
12493
12494 * doc/bison.texinfo: Various typos spotted by Neil Booth.
12495
12496 2000-10-04 Akim Demaille <akim@epita.fr>
12497
12498 When a literal string is used to define two different tokens,
12499 `bison -v' segfaults.
12500 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
12501
12502 * tests/regression.m4: New file.
12503 Include the core of the sample provided by Piotr Gackiewicz.
12504 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
12505 properly.
12506
12507 2000-10-04 Akim Demaille <akim@epita.fr>
12508
12509 * src/reader.c (parse_expect_decl): Keep `count' within the size
12510 of `buffer'.
12511 From Neil Booth.
12512
12513 2000-10-02 Paul Eggert <eggert@twinsun.com>
12514
12515 * bison.s1 (yyparse): Assign the default value
12516 unconditionally, to avoid a GCC warning and make the parser a
12517 tad smaller.
12518
12519 2000-10-02 Akim Demaille <akim@epita.fr>
12520
12521 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
12522 options.
12523
12524 2000-10-02 Akim Demaille <akim@epita.fr>
12525
12526 * src/derives.c, src/print.c, src/reduce.c: To ease the
12527 translation, move some `\n' out of the translated strings.
12528
12529 2000-10-02 Akim Demaille <akim@epita.fr>
12530
12531 The location tracking mechanism is precious for parse error
12532 messages. Nevertheless, it is enabled only when `@n' is used in
12533 the grammar, which is a different issue (you can use it in error
12534 message, but not in the grammar per se). Therefore, there should
12535 be another means to enable it.
12536
12537 * src/getargs.c (getargs): Support `--locations'.
12538 (usage): Report it.
12539 * src/getargs.h (locationsflag): Export it.
12540 * src/lex.c (percent_table): Support `%locations'.
12541 * src/reader.c (yylsp_needed): Remove this variable, now replaced
12542 with `locationsflag'.
12543 * doc/bison.texinfo: Document `--locations' and `%locations'.
12544 Sort the options.
12545 * tests/calc.m4: Test it.
12546
12547 For regularity of the names, replace each
12548 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
12549 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
12550 In addition replace each `flag' with `_flag'.
12551
12552 2000-10-02 Akim Demaille <akim@epita.fr>
12553
12554 Also test parse error messages, including with YYERROR_VERBOSE.
12555
12556 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
12557 associative).
12558 Use it to check the computations.
12559 Use it to check `nonassoc' is honored.
12560 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
12561 `--yyerror-verbose'.
12562 (_AT_CHECK_CALC): Adjust to this option.
12563 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
12564
12565 2000-10-02 Akim Demaille <akim@epita.fr>
12566
12567 Test also `--verbose', `--defines' and `--name-prefix'. Testing
12568 the latter demonstrates a flaw in the handling of non debugging
12569 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
12570 was used in order to simplify:
12571
12572 #if YYDEBUG
12573 if (yydebug)
12574 {
12575 ...
12576 }
12577 #endif
12578
12579 into
12580
12581 if (yydebug)
12582 {
12583 ...
12584 }
12585
12586 unfortunately this leads to a CPP conflict when
12587 `--name-prefix=foo' is used since it produces `#define yydebug
12588 foodebug'.
12589
12590 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
12591 (YYDPRINTF): New macro.
12592 Spread its use.
12593 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
12594 the bison options.
12595 Also test `--verbose', `--defines' and `--name-prefix'.
12596
12597 2000-10-02 Akim Demaille <akim@epita.fr>
12598
12599 Improve the readability of the produced parsers.
12600
12601 * src/bison.s1: Formatting changes.
12602 Improve the comment related to the `$' mark.
12603 (yydefault): Don't fall through to `yyresume': `goto' there.
12604 * src/output.c (output_parser): When the `$' is met, skip the end
12605 of its line.
12606 New variable, `number_of_dollar_signs', to check there's exactly
12607 one `$' in the parser skeleton.
12608
12609 2000-10-02 Akim Demaille <akim@epita.fr>
12610
12611 * lib/xstrdup.c: New file, from the fileutils.
12612 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
12613 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
12614 instead of strlen + xmalloc + strcpy.
12615 * src/symtab.c (copys): Remove, use xstrdup instead.
12616
12617 2000-10-02 Akim Demaille <akim@epita.fr>
12618
12619 * src/gram.h (associativity): New enum type which replaces the
12620 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
12621 `right_assoc', `left_assoc' and `non_assoc'.
12622 Adjust all dependencies.
12623 * src/reader.c: Formatting changes.
12624 (LTYPESTR): Don't define it, use it as a literal in
12625 `reader_output_yylsp'.
12626 * src/symtab.h (symbol_class): New enum type which replaces the
12627 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
12628 `sunknown', `stoken and `snterm'.
12629
12630 2000-10-02 Akim Demaille <akim@epita.fr>
12631
12632 * src/getargs.c (fixed_outfiles): Rename as...
12633 (yaccflag): for consistency and accuracy.
12634 Adjust dependencies.
12635
12636 2000-10-02 Akim Demaille <akim@epita.fr>
12637
12638 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
12639 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
12640 difficult and introduced a lot of core dump. It turns out that
12641 Bison used an implementation of `xmalloc' based on `calloc', and
12642 at various places it does depend upon the initialization to 0. I
12643 have not tried to isolate the pertinent places, and all the former
12644 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
12645 someone should address this issue.
12646
12647 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
12648 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
12649 files.
12650 Adjust dependencies.
12651 * src/warshall.h: New file.
12652 Propagate.
12653
12654 2000-10-02 Akim Demaille <akim@epita.fr>
12655
12656 Various anti-`extern in *.c' changes.
12657
12658 * src/system.h: Include `assert.h'.
12659
12660 2000-10-02 Akim Demaille <akim@epita.fr>
12661
12662 * src/state.h (nstates, final_state, first_state, first_shift)
12663 (first_reduction): Move their exportation from here...
12664 * src/LR0.h: to here.
12665 Adjust dependencies.
12666 * src/getargs.c (statisticsflag): New variable.
12667 Add support for `--statistics'.
12668 Adjust dependencies.
12669
12670 Remove a lot of now useless `extern' statements in most files.
12671
12672 2000-10-02 Akim Demaille <akim@epita.fr>
12673
12674 * src/LR0.h: New file.
12675 Propagate its use.
12676
12677 2000-10-02 Akim Demaille <akim@epita.fr>
12678
12679 * src/print.h: New file.
12680 Propagate its use.
12681 * src/print.c: Formatting and ordering changes.
12682 (verbose, terse): Replace with...
12683 (print_results): this new function.
12684 Adjust dependencies.
12685
12686 2000-10-02 Akim Demaille <akim@epita.fr>
12687
12688 * src/conflicts.c (conflict_report): New function.
12689 (conflict_log, verbose_conflict_log): Replace with...
12690 (print_conflicts): this function.
12691 Adjust dependencies.
12692 * src/conflicts.h: New file.
12693 Propagate its inclusion.
12694
12695 2000-10-02 Akim Demaille <akim@epita.fr>
12696
12697 * src/nullable.h: New file.
12698 Propagate its inclusion.
12699 * src/nullable.c: Formatting changes.
12700
12701 2000-10-02 Akim Demaille <akim@epita.fr>
12702
12703 * src/reduce.h: New file.
12704 Propagate its inclusion.
12705 * src/reduce.c: Topological sort and other formatting changes.
12706 (bool, TRUE, FALSE): Move their definition to...
12707 * src/system.h: here.
12708
12709 2000-10-02 Akim Demaille <akim@epita.fr>
12710
12711 * src/files.c: Formatting changes.
12712 (tryopen, tryclose, openfiles): Rename as...
12713 (xfopen, xfclose, open_files): this.
12714 (stringappend): static.
12715 * src/files.h: Complete the list of exported symbols.
12716 Propagate its use.
12717
12718 2000-10-02 Akim Demaille <akim@epita.fr>
12719
12720 * src/reader.h: New file.
12721 Propagate its use instead of tedious list of `extern' and
12722 prototypes.
12723 * src/reader.c: Formatting changes, topological sort,
12724 s/register//.
12725
12726 2000-10-02 Akim Demaille <akim@epita.fr>
12727
12728 * src/lex.h: Prototype `lex.c' exported functions.
12729 * src/reader.c: Adjust.
12730 * src/lex.c: Formatting changes.
12731 (safegetc): Rename as...
12732 (xgetc): this.
12733
12734 2000-10-02 Akim Demaille <akim@epita.fr>
12735
12736 * src/lalr.h: New file.
12737 Propagate its inclusion instead of prototypes and `extern'.
12738 * src/lalr.c: Formatting changes, topological sorting etc.
12739
12740 2000-10-02 Akim Demaille <akim@epita.fr>
12741
12742 * src/output.c (token_actions): Introduce a temporary array,
12743 YYDEFACT, that makes it possible for this function to use
12744 output_short_table.
12745
12746 2000-10-02 Akim Demaille <akim@epita.fr>
12747
12748 `user_toknums' is output as a `short[]' in `output.c', while it is
12749 defined as a `int[]' in `reader.c'. For consistency with the
12750 other output tables, `user_toknums' is now defined as a table of
12751 shorts.
12752
12753 * src/reader.c (user_toknums): Be a short table instead of an int
12754 table.
12755 Adjust dependencies.
12756
12757 Factor the short table outputs.
12758
12759 * src/output.c (output_short_table): New function.
12760 * src/output.c (output_gram, output_stos, output_rule_data)
12761 (output_base, output_table, output_check): Use it.
12762
12763 2000-10-02 Akim Demaille <akim@epita.fr>
12764
12765 * src/output.c (output): Topological sort of the functions, in
12766 order to get rid of the `static' prototypes.
12767 No longer use `register'.
12768 * src/output.h: New file.
12769 Propagate its inclusion in files explicitly prototyping functions
12770 from output.c.
12771
12772 2000-09-21 Akim Demaille <akim@epita.fr>
12773
12774 * src/atgeneral.m4: Update from Autoconf.
12775
12776 2000-09-21 Akim Demaille <akim@epita.fr>
12777
12778 * src/closure.h: New file.
12779 * src/closure.c: Formatting changes, topological sort over the
12780 functions, use of closure.h.
12781 (initialize_closure, finalize_closure): Rename as...
12782 (new_closure, free_closure): these. Adjust dependencies.
12783 * src/LR0.c: Formatting changes, topological sort, use of
12784 cloture.h.
12785 (initialize_states): Rename as...
12786 (new_states): this.
12787 * src/Makefile.am (noinst_HEADERS): Adjust.
12788
12789 2000-09-20 Akim Demaille <akim@epita.fr>
12790
12791 * src/acconfig.h: Don't protect config.h against multiple
12792 inclusion.
12793 Don't define PARAMS.
12794 * src/system.h: Define PARAMS.
12795 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
12796 purpose of config.h. system.h must not try to fix wrong
12797 definitions in config.h.
12798
12799 2000-09-20 Akim Demaille <akim@epita.fr>
12800
12801 * src/derives.h: New file.
12802 * src/main.c, src/derives.h: Use it.
12803 Formatting changes.
12804 * src/Makefile.am (noinst_HEADERS): Adjust.
12805
12806 2000-09-20 Akim Demaille <akim@epita.fr>
12807
12808 * tests/atgeneral.m4: Update from Autoconf.
12809 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
12810 (AT_CHECK_CALC): New macros.
12811 Use these macros to test bison with options `', `--raw',
12812 `--debug', `--yacc', `--yacc --debug'.
12813
12814 2000-09-19 Akim Demaille <akim@epita.fr>
12815
12816 * src/output.c: Formatting changes.
12817 * src/machine.h: Remove, leaving its contents in...
12818 * src/system.h: here.
12819 Include stdio.h.
12820 Adjust all dependencies on stdio.h and machine.h.
12821 * src/getargs.h: New file.
12822 Let all `extern' declarations about getargs.c be replaced with
12823 inclusion of `getargs.h'.
12824 * src/Makefile.am (noinst_HEADERS): Adjust.
12825
12826 * tests/calc.m4 (yyin): Be initialized in main, not on the global
12827 scope.
12828 (yyerror): Returns void, not int.
12829 * doc/bison.texinfo: Formatting changes.
12830
12831 2000-09-19 Akim Demaille <akim@epita.fr>
12832
12833 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
12834 portable.
12835
12836 2000-09-18 Akim Demaille <akim@epita.fr>
12837
12838 * configure.in: Append WARNING_CFLAGS to CFLAGS.
12839 * src/Makefile.am (INCLUDES): Don't.
12840 Be ready to fetch headers in lib/.
12841
12842 2000-09-18 Akim Demaille <akim@epita.fr>
12843
12844 * doc/bison.texinfo: Update the copyright.
12845 ANSIfy and GNUify the examples.
12846 Remove the old menu.
12847
12848 2000-09-18 Akim Demaille <akim@epita.fr>
12849
12850 First set of tests: use the `calc' example from the documentation.
12851
12852 * src/bison.s1 (yyparse): Condition the code using `yytname' which
12853 is defined only when YYDEBUG is.
12854 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
12855 * src/files.c (tryopen, tryclose): Formatting changes.
12856 Move to the top and be static.
12857 * src/reader.c (read_signed_integer): Likewise.
12858 * tests/calc.m4: New file.
12859 * Makefile.am, suite.m4: Adjust.
12860 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
12861
12862 2000-09-18 Akim Demaille <akim@epita.fr>
12863
12864 Add support for an Autotest test suite for Bison.
12865
12866 * m4/m4.m4, m4/atconfig.m4: New files.
12867 * m4/Makefile.am (EXTRA_DIST): Adjust.
12868 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
12869 files.
12870 * src/getargs.c: Display a more standard --version message.
12871 * src/reader.c (reader): Formatting changes.
12872 No longer depend upon VERSION_STRING.
12873 * configure.in: No longer use `dnl'.
12874 Set up the test suite and the new directory `tests/.
12875 (VERSION_STRING): Remove.
12876
12877 2000-04-14 Akim Demaille <akim@epita.fr>
12878
12879 * src/reader.c (copy_comment2): New function, same as former
12880 `copy_comment', but outputs into two FILE *.
12881 (copy_comment): Use it.
12882 (parse_union_decl): Use it.
12883 (get_type, parse_start_decl): Use the same `invalid' message.
12884 (parse_start_decl, parse_union_decl): Use the same `multiple'
12885 message.
12886 (parse_union_decl, copy_guard, copy_action): Use the same
12887 `unmatched' message.
12888 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
12889
12890 2000-03-31 Akim Demaille <akim@epita.fr>
12891
12892 * src/files.c (tryopen, tryclose): Move to the top.
12893 Be static.
12894
12895 2000-03-31 Akim Demaille <akim@epita.fr>
12896
12897 * src/main.c (main): Don't call `done', exit does it.
12898
12899 2000-03-31 Akim Demaille <akim@epita.fr>
12900
12901 * allocate.c: s/return (foo)/return foo/.
12902 * lalr.c: Likewise.
12903 * LR0.c: Likewise.
12904 * output.c: Likewise.
12905 * reader.c: Likewise.
12906 * symtab.c: Likewise.
12907 * vmsgetargs.c: Likewise.
12908
12909 2000-03-31 Akim Demaille <akim@epita.fr>
12910
12911 Clean up the error reporting functions.
12912
12913 * src/report.c: New file.
12914 * src/report.h: Likewise.
12915 * src/Makefile.am: Adjust.
12916 * m4/error.m4: New file.
12917 * m4/Makefile.am: Adjust.
12918 * configure.in (jm_PREREQ_ERROR): Call it.
12919 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
12920 Remove.
12921 (fatal, fatals): Remove. All callers use complain.c::fatal.
12922 (warn, warni, warns, warnss, warnss): Remove. All callers use
12923 complain.c::complain.
12924 (toomany): Remove, use fatal instead.
12925 * src/files.c (done): No argument, use complain_message_count.
12926 * src/main.c (main): Register `done' to `atexit'.
12927
12928 * src/getargs.c (usage): More `fputs', less `fprintf'.
12929
12930 2000-03-28 Akim Demaille <akim@epita.fr>
12931
12932 * lib/: New directory.
12933 * Makefile.am (SUBDIRS): Adjust.
12934 * configure.in: Adjust.
12935 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
12936 useless.
12937 * src/alloca.c: Moved to lib/.
12938 * src/getopt.c: Likewise.
12939 * src/getopt1.c: Likewise.
12940 * src/getopt.h: Likewise.
12941 * src/ansi2knr.c: Likewise.
12942 * src/ansi2knr.1: Likewise.
12943 * src/Makefile.am: Adjust.
12944 * lib/Makefile.am: New file.
12945
12946 2000-03-28 Akim Demaille <akim@epita.fr>
12947
12948 * src/getargs.c (usage): Refresh the help message.
12949
12950 2000-03-17 Akim Demaille <akim@epita.fr>
12951
12952 * src/getopt1.c: Updated from textutils 2.0e
12953 * src/getopt.c: Likewise.
12954 * src/getopt.h: Likewise.
12955
12956 2000-03-17 Akim Demaille <akim@epita.fr>
12957
12958 * src/Makefile.am (bison.simple): Fix the awk program: quote only
12959 the file name, not the whole `#line LINE FILE'.
12960
12961 2000-03-17 Akim Demaille <akim@epita.fr>
12962
12963 On syntax errors, report the token on which we choked.
12964
12965 * src/bison.s1 (yyparse): In the label yyerrlab, when
12966 YYERROR_VERBOSE, add yychar in msg.
12967
12968 2000-03-17 Akim Demaille <akim@epita.fr>
12969
12970 * src/reader.c (copy_at): New function.
12971 (copy_guard): Use it.
12972 (copy_action): Use it.
12973
12974 2000-03-17 Akim Demaille <akim@epita.fr>
12975
12976 Be kind to translators, save some useless translations.
12977
12978 * src/main.c (banner): New function.
12979 (fatal_banner): Use it.
12980 (warn_banner): Use it.
12981
12982 2000-03-17 Akim Demaille <akim@epita.fr>
12983
12984 * src/reader.c (copy_definition): Use copy_string and
12985 copy_comment. Removed now unused `match', `ended',
12986 `cplus_comment'.
12987 (copy_comment, copy_string): Moved, to be visible from
12988 copy_definition.
12989
12990 2000-03-17 Akim Demaille <akim@epita.fr>
12991
12992 * src/reader.c (copy_string): Declare `static inline'. No
12993 problems with inline, since it is checked by configure.
12994 (copy_comment): Likewise.
12995
12996 2000-03-17 Akim Demaille <akim@epita.fr>
12997
12998 * src/reader.c (packsymbols): Formatting changes.
12999
13000 2000-03-17 Akim Demaille <akim@epita.fr>
13001
13002 * src/reader.c (copy_comment): New function, factored out from:
13003 (copy_action): Use it. Removed now unused `match', `ended',
13004 `cplus_comment'.
13005 (copy_guard): Likewise.
13006
13007 2000-03-17 Akim Demaille <akim@epita.fr>
13008
13009 * src/reader.c (copy_string): New function, factored out from:
13010 (copy_action): Use it.
13011 (copy_guard): Likewise.
13012
13013 2000-03-17 Akim Demaille <akim@epita.fr>
13014
13015 Change the handling of @s so that they behave exactly like $s.
13016 There is now a pseudo variable @$ (readble and writable), location
13017 of the lhs of the rule (by default ranging from the location of
13018 the first symbol of the rhs, to the location of the last symbol,
13019 or, if the rhs is empty, YYLLOC).
13020
13021 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
13022 yyval.
13023 (yyparse): When providing a default semantic action, provide a
13024 default location action.
13025 (after the $): No longer change `*YYLSP', just stack YYLOC the
13026 same way you stack YYVAL.
13027 * src/reader.c (read_declarations): Use warns.
13028 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
13029 (copy_action, case '@'): Likewise.
13030 Use a standard error message, to save useless work from
13031 translators.
13032
13033 2000-03-17 Akim Demaille <akim@epita.fr>
13034
13035 * src/bison.s1: Formatting and cosmetics changes.
13036 * src/reader.c: Likewise.
13037 Update the Copyright notice.
13038
13039 2000-03-17 Akim Demaille <akim@epita.fr>
13040
13041 * src/bison.s1 (#line): All set to `#line' only, since the
13042 Makefile now handles them.
13043
13044 2000-03-16 Akim Demaille <akim@epita.fr>
13045
13046 * src/output.c (output_rule_data): Output the documentation of
13047 some of the tables.
13048 (Copyright notice): Update.
13049 Formatting changes.
13050
13051 2000-03-16 Akim Demaille <akim@epita.fr>
13052
13053 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
13054 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
13055 One `#if YYDEBUG' remains, since it uses variables which are
13056 defined only if `YYDEBUG != 0'.
13057
13058 2000-03-16 Akim Demaille <akim@epita.fr>
13059
13060 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
13061 and related variables so that the similarities are highlighted.
13062
13063 2000-03-16 Akim Demaille <akim@epita.fr>
13064
13065 * src/bison.s1: Properly indent CPP directives.
13066
13067 2000-03-16 Akim Demaille <akim@epita.fr>
13068
13069 * src/bison.s1: Properly indent the `alloca' CPP section.
13070
13071 2000-03-16 Akim Demaille <akim@epita.fr>
13072
13073 Do not hard code values of directories in `configure.in'.
13074 Update the `configure' tool chain.
13075
13076 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
13077 src/makefile.am.
13078 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
13079 (AC_OUTPUT): Add m4/Makefile.
13080 Bump to bison 1.28a, 1.29 has never been released.
13081 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
13082 handled via src/Makefile.am.
13083 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
13084 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
13085 autoheader.
13086 * Makefile.am (SUBDIRS): Add m4.
13087 (ACLOCAL_AM_FLAGS): New variable.
13088 (AUTOMAKE_OPTIONS): Add check-news.
13089 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
13090 the proper line number and file name.
13091 (DEFS): Propagate the location of bison library files and of the
13092 locale files.
13093 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
13094 builddir.
13095 * acinclude.m4: Remove, replaced by the directory m4.
13096 * m4/Makefile.am (EXTRA_DIST): New variable.
13097 * m4/gettext.m4: New file, from the fileutils.
13098 * m4/lcmessage.m4: Likewise
13099 * m4/progtest.m4: Likewise.
13100 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
13101
13102 2000-03-10 Akim Demaille <akim@epita.fr>
13103
13104 * src/closure.c:
13105 Formatting changes of various comments.
13106 Respect the GNU coding standards at various places.
13107 Don't use `_()' when no translation is needed.
13108
13109 1999-12-13 Jesse Thilo <jthilo@gnu.org>
13110
13111 * src/files.c:
13112 OS/2 honors TMPDIR environment variable.
13113
13114 1999-12-13 Jesse Thilo <jthilo@gnu.org>
13115
13116 * doc/bison.texinfo: Tweaked spelling and grammar.
13117 Updated ISBN.
13118 Removed reference to price of printed copy.
13119 Mention BISON_SIMPLE and BISON_HAIRY.
13120
13121 1999-12-13 Jesse Thilo <jthilo@gnu.org>
13122
13123 * configure.in, NEWS:
13124 Bison 1.29 released.
13125
13126 1999-10-27 Jesse Thilo <jthilo@gnu.org>
13127
13128 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
13129 Added reference card.
13130
13131 1999-07-26 Jesse Thilo <jthilo@gnu.org>
13132
13133 * po/ru.po: Added Russian translation.
13134
13135 1999-07-26 Jesse Thilo <jthilo@gnu.org>
13136
13137 * configure.in: Added Russian translation.
13138
13139 1999-07-06 Jesse Thilo <jthilo@gnu.org>
13140
13141 * configure.in, NEWS, README:
13142 Released version 1.28.
13143
13144 1999-06-14 Jesse Thilo <jthilo@gnu.org>
13145
13146 * src/system.h:
13147 Squashed redefinition warning on some systems.
13148
13149 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
13150 Have configure build version string instead of relying on ANSI string
13151 concatentation.
13152
13153 1999-06-14 Jesse Thilo <jthilo@gnu.org>
13154
13155 * po/POTFILES.in: Got rid of version.c.
13156
13157 1999-06-14 Jesse Thilo <jthilo@gnu.org>
13158
13159 * acconfig.h, configure.in:
13160 Have configure build version string instead of relying on ANSI string
13161 concatentation.
13162
13163 1999-06-08 Jesse Thilo <jthilo@gnu.org>
13164
13165 * doc/bison.1:
13166 Dropped mention of `+' for long-named options.
13167
13168 1999-05-30 Jesse Thilo <jthilo@gnu.org>
13169
13170 * src/files.c: Added <unistd.h> for unlink().
13171
13172 * src/Makefile.am, src/system.h:
13173 I18n fixes.
13174
13175 1999-05-30 Jesse Thilo <jthilo@gnu.org>
13176
13177 * README: Added a FAQ list.
13178
13179 * configure.in, acconfig.h:
13180 I18n fixes.
13181
13182 1999-05-30 Jesse Thilo <jthilo@gnu.org>
13183
13184 * doc/FAQ, doc/Makefile.am:
13185 Added a FAQ list.
13186
13187 1999-05-19 Jesse Thilo <jthilo@gnu.org>
13188
13189 * src/alloc.h, src/symtab.h, src/version.c:
13190 Protected inclusion of "config.h" with HAVE_CONFIG_H.
13191
13192 1999-04-18 Jesse Thilo <jthilo@gnu.org>
13193
13194 * src/.cvsignore, src/Makefile.am:
13195 Reorganized: sources in `src', documentation in `doc'.
13196
13197 * src/lex.c (literalchar):
13198 fixed the code for escaping double quotes (thanks
13199 Jonathan Czisny.)
13200
13201 1999-04-18 Jesse Thilo <jthilo@gnu.org>
13202
13203 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
13204 Adjusted paths to reflect directory reorganization.
13205
13206 1999-04-18 Jesse Thilo <jthilo@gnu.org>
13207
13208 * doc/.cvsignore, doc/Makefile.am:
13209 Reorganized: sources in `src', documentation in `doc'.
13210
13211 1999-04-18 Jesse Thilo <jthilo@gnu.org>
13212
13213 * configure.in:
13214 Updated AC_INIT file to reflect directory reorganization.
13215
13216 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
13217 Reorganized: sources in `src', documentation in `doc'.
13218
13219 1999-04-13 Jesse Thilo <jthilo@gnu.org>
13220
13221 * src/allocate.c:
13222 Don't declare calloc() and realloc() if not necessary.
13223
13224 1999-04-13 Jesse Thilo <jthilo@gnu.org>
13225
13226 * configure.in, acconfig.h, acinclude.m4:
13227 Don't declare calloc() and realloc() if not necessary.
13228
13229 1999-03-23 Jesse Thilo <jthilo@gnu.org>
13230
13231 * po/.cvsignore: Added i18n support.
13232
13233 1999-03-23 Jesse Thilo <jthilo@gnu.org>
13234
13235 * acconfig.h, configure.in, Makefile.am:
13236 Added i18n support.
13237
13238 1999-03-22 Jesse Thilo <jthilo@gnu.org>
13239
13240 * src/bison.s1: Fixed #line numbers.
13241
13242 1999-03-15 Jesse Thilo <jthilo@gnu.org>
13243
13244 * po/es.po, po/fr.po, po/nl.po, po/de.po:
13245 Added PO files from Translation Project.
13246
13247 1999-03-03 Jesse Thilo <jthilo@gnu.org>
13248
13249 * Makefile.am:
13250 Added support for non-ANSI compilers (ansi2knr).
13251
13252 1999-02-16 Jesse Thilo <jthilo@gnu.org>
13253
13254 * configure.in: Bumped version number to 1.27.
13255
13256 * Makefile.am:
13257 Added `bison.simple' to list of files removed by `make distclean'.
13258
13259 1999-02-12 Jesse Thilo <jthilo@gnu.org>
13260
13261 * src/files.c, src/files.h:
13262 Defined locations of parser files in config.h instead of Makefile.
13263
13264 1999-02-12 Jesse Thilo <jthilo@gnu.org>
13265
13266 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
13267 Defined locations of parser files in config.h instead of Makefile.
13268
13269 1999-02-09 Jesse Thilo <jthilo@gnu.org>
13270
13271 * Makefile.am:
13272 Removed inappropriate use of $< macro.
13273
13274 1999-02-05 Jesse Thilo <jthilo@gnu.org>
13275
13276 * po/Makefile.in.in, po/POTFILES.in:
13277 Add `po' directory skeleton.
13278
13279 1999-01-27 Jesse Thilo <jthilo@gnu.org>
13280
13281 * README: Document help-bison list.
13282
13283 * configure.in: Add check for mkstemp().
13284
13285 1999-01-20 Jesse Thilo <jthilo@gnu.org>
13286
13287 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
13288 Hush a few compiler warnings.
13289
13290 * src/files.c:
13291 Add tryclose(), which verifies that fclose was successful.
13292 Hush a couple of compiler warnings.
13293
13294 1999-01-20 Jesse Thilo <jthilo@gnu.org>
13295
13296 * Makefile.am, OChangeLog:
13297 ChangeLog is now automatically generated. Include the old version as
13298 OChangeLog.
13299
13300 1999-01-14 Jesse Thilo <jthilo@gnu.org>
13301
13302 * 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:
13303 Update FSF address.
13304
13305 1999-01-14 Jesse Thilo <jthilo@gnu.org>
13306
13307 * doc/bison.texinfo: Fix formatting glitch.
13308
13309 * doc/bison.texinfo: Update FSF address.
13310
13311 1999-01-14 Jesse Thilo <jthilo@gnu.org>
13312
13313 * acconfig.h: Update FSF address.
13314
13315 1999-01-08 Jesse Thilo <jthilo@gnu.org>
13316
13317 * src/system.h:
13318 Don't define PACKAGE here, since config.h defines it.
13319
13320 1998-12-30 Jesse Thilo <jthilo@gnu.org>
13321
13322 * src/reader.c: Update copyright date.
13323
13324 * src/main.c:
13325 Ditch sprintf to statically-sized buffers in fatal/warn functions in
13326 favor of output directly to stderr (avoids buffer overruns).
13327
13328 * src/reader.c: Some checks for premature EOF.
13329
13330 * 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:
13331 Use prototypes if the compiler understands them.
13332
13333 * src/files.c: Honor TMPDIR on Unix hosts.
13334 Use prototypes if the compiler understands them.
13335
13336 * src/reader.c:
13337 Fix a couple of buffer overrun bugs.
13338 Use prototypes if the compiler understands them.
13339
13340 * src/system.h: Include unistd.h and ctype.h.
13341 Use #ifdef instead of #if for NLS symbols.
13342
13343 1998-12-30 Jesse Thilo <jthilo@gnu.org>
13344
13345 * doc/bison.texinfo:
13346 Delete comment "consider using @set for edition number, etc..." since
13347 we now are doing so.
13348
13349 1998-12-30 Jesse Thilo <jthilo@gnu.org>
13350
13351 * configure.in:
13352 Use prototypes if the compiler understands them.
13353
13354 * NEWS: Document 1.26 highlights.
13355
13356 * Makefile.am: Require Automake 1.3 or later.
13357
13358 * acconfig.h:
13359 Use prototypes if the compiler understands them.
13360
13361 1998-12-29 Jesse Thilo <jthilo@gnu.org>
13362
13363 * src/version.c:
13364 Use VERSION symbol from automake for version number.
13365
13366 1998-12-29 Jesse Thilo <jthilo@gnu.org>
13367
13368 * acconfig.h, configure.in, version.cin:
13369 Use VERSION symbol from automake for version number.
13370
13371 1998-11-28 Jesse Thilo <jthilo@gnu.org>
13372
13373 * Makefile.am:
13374 Distribute original version of simple parser (bison.s1), not built
13375 version (bison.simple).
13376
13377 1998-11-28 Jesse Thilo <jthilo@gnu.org>
13378
13379 * doc/bison.texinfo: Add info dir entry.
13380
13381 * doc/bison.texinfo:
13382 Let automake put version number into documentation.
13383
13384 1998-11-26 Jesse Thilo <jthilo@gnu.org>
13385
13386 * src/bison.cld, src/build.com, src/vmshlp.mar:
13387 Add non-RCS files from /gd/gnu/bison.
13388
13389 1998-11-26 Jesse Thilo <jthilo@gnu.org>
13390
13391 * doc/bison.1:
13392 Document the BISON_HAIRY and BISON_SIMPLE variables.
13393
13394 1998-11-25 Jesse Thilo <jthilo@gnu.org>
13395
13396 * src/version.c: Build version.c automatically.
13397
13398 * src/reader.c:
13399 Fix token numbering (used to start at 258, not 257).
13400
13401 * src/system.h: Include config.h.
13402
13403 * src/getargs.c: Update bug report address.
13404
13405 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
13406 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
13407
13408 1998-11-25 Jesse Thilo <jthilo@gnu.org>
13409
13410 * Makefile.am:
13411 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
13412
13413 * configure.in, version.cin:
13414 Build version.c automatically.
13415
13416 * AUTHORS: Add AUTHORS file.
13417
13418 * README: Update bug report address.
13419
13420 * bison.simple:
13421 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
13422
13423 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
13424 Add automake stuff.
13425
13426 1998-11-25 Jesse Thilo <jthilo@gnu.org>
13427
13428 * doc/bison.texinfo: Clean up some formatting.
13429
13430 1998-05-05 Richard Stallman <rms@gnu.org>
13431
13432 * doc/bison.texinfo:
13433 Explain better why to make a pure parser.
13434
13435 1998-01-05 Richard Stallman <rms@gnu.org>
13436
13437 * src/files.c (openfiles):
13438 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
13439 find a temporary directory, if possible. Do not unlink files while
13440 they are open.
13441
13442 1997-08-25 Richard Stallman <rms@gnu.org>
13443
13444 * src/reader.c (stack_offset;):
13445 Change some warni to warns.
13446
13447 * src/lex.c (literalchar): Use warns, not warni.
13448
13449 1997-06-28 Richard Stallman <rms@gnu.org>
13450
13451 * src/bison.s1: Add a Bison version comment.
13452
13453 * src/main.c (fatal, warn, berror):
13454 Use program_name.
13455
13456 1997-06-28 Richard Stallman <rms@gnu.org>
13457
13458 * Makefile.in (bison_version): New variable.
13459 (dist): Use that variable.
13460 (bison.s1): Substitute the Bison version into bison.simple.
13461
13462 * bison.simple: Add a Bison version comment.
13463
13464 1997-06-18 Richard Stallman <rms@gnu.org>
13465
13466 * src/main.c (fatal, warn, berror):
13467 Make error messages standard.
13468 (toomany): Improve error message text.
13469
13470 * 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:
13471 new.h renamed to alloc.h.
13472
13473 1997-06-18 Richard Stallman <rms@gnu.org>
13474
13475 * Makefile.in: new.h renamed to alloc.h.
13476
13477 1997-05-24 Richard Stallman <rms@gnu.org>
13478
13479 * src/lex.c (literalchar):
13480 Fix the code for escaping \, " and '.
13481
13482 (lex): Avoid trouble when there are many chars
13483 to discard in a char literal with just several chars in it.
13484
13485 1997-05-17 Richard Stallman <rms@gnu.org>
13486
13487 * src/bison.s1:
13488 Use malloc, if using alloca is troublesome.
13489 (YYSTACK_USE_ALLOCA): New flag macro.
13490 Define it for some systems and compilers.
13491 (YYSTACK_ALLOC): New macro.
13492 (yyparse): Use YYSTACK_ALLOC to allocate stack.
13493 If it was malloc'd, free it.
13494
13495 1997-05-17 Richard Stallman <rms@gnu.org>
13496
13497 * bison.simple:
13498 Use malloc, if using alloca is troublesome.
13499 (YYSTACK_USE_ALLOCA): New flag macro.
13500 Define it for some systems and compilers.
13501 (YYSTACK_ALLOC): New macro.
13502 (yyparse): Use YYSTACK_ALLOC to allocate stack.
13503 If it was malloc'd, free it.
13504
13505 1997-04-23 Richard Stallman <rms@gnu.org>
13506
13507 * src/bison.s1:
13508 (alloca) [__hpux]: Always define as __builtin_alloca.
13509
13510 1997-04-23 Richard Stallman <rms@gnu.org>
13511
13512 * bison.simple:
13513 (alloca) [__hpux]: Always define as __builtin_alloca.
13514
13515 1997-04-22 Richard Stallman <rms@gnu.org>
13516
13517 * src/bison.s1:
13518 [__hpux]: Include alloca.h (right for HPUX 10)
13519 instead of declaring alloca (right for HPUX 9).
13520
13521 * src/bison.s1 (__yy_memcpy):
13522 Declare arg `count' as unsigned int.
13523 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
13524
13525 1997-04-22 Richard Stallman <rms@gnu.org>
13526
13527 * bison.simple:
13528 [__hpux]: Include alloca.h (right for HPUX 10)
13529 instead of declaring alloca (right for HPUX 9).
13530
13531 * bison.simple (__yy_memcpy):
13532 Declare arg `count' as unsigned int.
13533 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
13534
13535 1997-01-03 Richard Stallman <rms@gnu.org>
13536
13537 * src/allocate.c: [__STDC__ or _MSC_VER]:
13538 Declare calloc and realloc to return void *.
13539
13540 1997-01-02 Richard Stallman <rms@gnu.org>
13541
13542 * src/system.h:
13543 [_MSC_VER]: Include stdlib.h and process.h.
13544 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
13545
13546 * src/main.c (main): Return FAILURE as a value.
13547 (printable_version): Declare arg as int, not char.
13548
13549 1997-01-02 Richard Stallman <rms@gnu.org>
13550
13551 * Makefile.in (dist):
13552 Explicitly check for symlinks, and copy them.
13553
13554 1996-12-19 Richard Stallman <rms@gnu.org>
13555
13556 * src/files.c:
13557 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
13558
13559 1996-12-18 Paul Eggert <eggert@gnu.org>
13560
13561 * src/bison.s1 (yyparse):
13562 If __GNUC__ and YYPARSE_PARAM are both defined,
13563 declare yyparse to have a void * argument.
13564
13565 1996-12-18 Paul Eggert <eggert@gnu.org>
13566
13567 * bison.simple (yyparse):
13568 If __GNUC__ and YYPARSE_PARAM are both defined,
13569 declare yyparse to have a void * argument.
13570
13571 1996-12-17 Richard Stallman <rms@gnu.org>
13572
13573 * src/reduce.c (nbits): Add some casts.
13574
13575 1996-08-12 Richard Stallman <rms@gnu.org>
13576
13577 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
13578
13579 1996-08-12 Richard Stallman <rms@gnu.org>
13580
13581 * bison.simple: Test _MSDOS as well as _MSDOS_.
13582
13583 1996-07-31 Richard Stallman <rms@gnu.org>
13584
13585 * src/bison.s1:
13586 [__sun && __i386]: Include alloca.h.
13587
13588 1996-07-31 Richard Stallman <rms@gnu.org>
13589
13590 * bison.simple:
13591 [__sun && __i386]: Include alloca.h.
13592
13593 1996-07-30 Richard Stallman <rms@gnu.org>
13594
13595 * src/bison.s1: Comment change.
13596
13597 * src/bison.s1: Test _MSDOS_, not MSDOS.
13598
13599 1996-07-30 Richard Stallman <rms@gnu.org>
13600
13601 * bison.simple: Comment change.
13602
13603 * bison.simple: Test _MSDOS_, not MSDOS.
13604
13605 1996-06-01 Richard Stallman <rms@gnu.org>
13606
13607 * 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:
13608 Insert `_' macro around many string constants.
13609
13610 * src/main.c:
13611 Insert `_' macro around many string constants.
13612
13613 (main): Call setlocale, bindtextdomain and textdomain.
13614
13615 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
13616 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
13617 [ENABLE_NLS]: Include libintl.h.
13618 [ENABLE_NLS] (gettext): Define.
13619 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
13620 (N_, PACKAGE, LOCALEDIR): New macros.
13621
13622 1996-06-01 Richard Stallman <rms@gnu.org>
13623
13624 * POTFILES.in: New file.
13625
13626 * Makefile.in (allocate.o):
13627 Define target explicitly.
13628
13629 * Makefile.in (CFLAGS): Set to @CFLAGS@.
13630 (LDFLAGS): Set to @LDFLAGS@.
13631 (configure): Run autoconf only if preceding `cd' succeeds.
13632 (bison.s1): Redirect output to temporary file then move the
13633 temporary to the target, rather than redirecting directly to bison.s1.
13634 (clean): Remove config.status and config.log.
13635 (distclean): Don't remove config.status here.
13636
13637 1996-05-12 Richard Stallman <rms@gnu.org>
13638
13639 * src/bison.s1:
13640 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
13641
13642 1996-05-12 Richard Stallman <rms@gnu.org>
13643
13644 * bison.simple:
13645 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
13646
13647 1996-05-11 Richard Stallman <rms@gnu.org>
13648
13649 * src/bison.s1 (__yy_memcpy):
13650 Really reorder the args, as was supposedly done on Feb 14 1995.
13651 (yyparse): Calls changed accordingly.
13652
13653 1996-05-11 Richard Stallman <rms@gnu.org>
13654
13655 * Makefile.in (dist): Don't use $(srcdir).
13656
13657 * bison.simple (__yy_memcpy):
13658 Really reorder the args, as was supposedly done on Feb 14 1995.
13659 (yyparse): Calls changed accordingly.
13660
13661 1996-01-27 Richard Stallman <rms@gnu.org>
13662
13663 * src/output.c (output_rule_data):
13664 Test YYERROR_VERBOSE in the conditional
13665 around the definition of ttyname.
13666
13667 1995-12-29 Richard Stallman <rms@gnu.org>
13668
13669 * src/bison.s1:
13670 Fix line numbers in #line commands.
13671
13672 1995-12-29 Richard Stallman <rms@gnu.org>
13673
13674 * bison.simple:
13675 Fix line numbers in #line commands.
13676
13677 1995-12-27 Richard Stallman <rms@gnu.org>
13678
13679 * src/bison.s1 (YYPARSE_PARAM_DECL):
13680 In C++, make it always null.
13681 (YYPARSE_PARAM_ARG): New macro.
13682 (yyparse): Use YYPARSE_PARAM_ARG.
13683
13684 1995-12-27 Richard Stallman <rms@gnu.org>
13685
13686 * bison.simple (YYPARSE_PARAM_DECL):
13687 In C++, make it always null.
13688 (YYPARSE_PARAM_ARG): New macro.
13689 (yyparse): Use YYPARSE_PARAM_ARG.
13690
13691 1995-11-29 Richard Stallman <rms@gnu.org>
13692
13693 * doc/bison.texinfo:
13694 Describe literal string tokens, %raw, %no_lines, %token_table.
13695
13696 1995-11-29 Daniel Hagerty <hag@gnu.org>
13697
13698 * doc/bison.texinfo: Fixed update date
13699
13700 1995-10-16 Richard Stallman <rms@gnu.org>
13701
13702 * src/version.c: Version 1.25.
13703
13704 1995-10-16 Richard Stallman <rms@gnu.org>
13705
13706 * NEWS: *** empty log message ***
13707
13708 1995-10-16 Richard Stallman <rms@gnu.org>
13709
13710 * doc/bison.1, doc/bison.rnh:
13711 Add new options.
13712
13713 1995-10-15 Richard Stallman <rms@gnu.org>
13714
13715 * src/vmsgetargs.c, src/getargs.c:
13716 Added -n, -k, and -raw switches.
13717 (noparserflag, toknumflag, rawtoknumflag): New variables.
13718
13719 * src/symtab.h (SALIAS):
13720 New #define for adding aliases to %token.
13721 (struct bucket): Added `alias' field.
13722
13723 * src/reduce.c (reduce_grammar):
13724 Revise error message.
13725 (print_notices): Remove final `.' from error message.
13726
13727 * src/reader.c (reader_output_yylsp):
13728 New function.
13729 (readgram): Use `#if 0' around code that accepted %command
13730 inside grammar rules: The documentation doesn't allow it,
13731 and it will fail since the %command processors scan for the next %.
13732 (parse_token_decl): Extended the %token
13733 declaration to allow a multi-character symbol as an alias.
13734 (parse_thong_decl): New function.
13735 (read_declarations): Added %thong declarations.
13736 (read_declarations): Handle NOOP to deal with allowing
13737 % declarations as another means to specify the flags.
13738 (readgram): Allow %prec prior to semantics embedded in a rule.
13739 (skip_to_char, read_declarations, copy_definition)
13740 (parse_token_decl, parse_start_decl, parse_type_decl)
13741 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
13742 (get_type_name, copy_guard, copy_action, readgram)
13743 (get_type, packsymbols): Revised most error messages.
13744 Changed `fatal' to `warnxxx' to avoid aborting for error.
13745 Revised and use multiple warnxxx functions to avoid using VARARGS1.
13746 (read_declarations): Improve the error message for
13747 an invalid character. Do not abort.
13748 (read_declarations, copy_guard, copy_action): Use
13749 printable_version to avoid unprintable characters in printed output.
13750 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
13751 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
13752 Allow the type of a non-terminal can be given
13753 more than once, as long as all specifications give the same type.
13754
13755 * src/output.c:
13756 (output_headers, output_trailers, output, output_gram)
13757 (output_rule_data): Implement noparserflag variable.
13758 Implement toknumflag variable.
13759 (output): Call reader_output_yylsp to output LTYPESTR.
13760
13761 * src/main.c (main):
13762 If reader sees an error, don't process the grammar.
13763 (fatals): Updated to not use VARARGS1.
13764 (printable_version, int_to_string, warn, warni, warns, warnss)
13765 (warnsss): New error reporting functions. Avoid abort for error.
13766
13767 * src/lex.h:
13768 Added THONG and NOOP for alias processing.
13769 Added SETOPT for the new code that allows setting options with %flags.
13770
13771 * src/lex.c:
13772 Include getopt.h. Add some extern decls.
13773 (safegetc): New function to deal with EOF gracefully.
13774 (literalchar); new function to deal with reading \ escapes.
13775 (lex): Use literalchar.
13776 (lex): Implemented "..." tokens.
13777 (literalchar, lex, parse_percent_token): Made tokenbuffer
13778 always contain the token. This includes growing the token
13779 buffer while reading an integer.
13780 (parse_percent_token): Replaced if-else statement with percent_table.
13781 (parse_percent_token): Added % declarations as another
13782 way to specify the flags -n, -l, and -r. Also added hooks for
13783 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
13784 major changes to files.c.
13785 (lex) Retain in the incoming stream a character following
13786 an incorrect '/'.
13787 (skip_white_space, lex): Revised most error messages
13788 and changed fatal to warn to avoid aborting.
13789 (percent_table): Added %thong declarations.
13790
13791 * src/gram.h: Comment changes.
13792
13793 * src/files.c (openfiles, open_extra_files, done):
13794 Add faction flag
13795 and actfile file. Handle noparserflag. Both for -n switch.
13796
13797 * src/conflicts.c (resolve_sr_conflict):
13798 Remove use of alloca.
13799
13800 1995-06-01 Jim Meyering <meyering@gnu.org>
13801
13802 * doc/bison.texinfo: *** empty log message ***
13803
13804 1995-05-06 Richard Stallman <rms@gnu.org>
13805
13806 * src/bison.s1: Comment change.
13807
13808 1995-05-06 Richard Stallman <rms@gnu.org>
13809
13810 * bison.simple: Comment change.
13811
13812 1995-05-03 Richard Stallman <rms@gnu.org>
13813
13814 * src/version.c: Version now 1.24.
13815
13816 * src/bison.s1: Change distribution terms.
13817
13818 * src/version.c: Version now 1.23.
13819
13820 1995-05-03 Richard Stallman <rms@gnu.org>
13821
13822 * doc/bison.texinfo:
13823 Rewrite "Conditions for Using Bison".
13824 Update version to 1.24.
13825
13826 1995-05-03 Richard Stallman <rms@gnu.org>
13827
13828 * bison.simple: Change distribution terms.
13829
13830 1995-02-23 Richard Stallman <rms@gnu.org>
13831
13832 * src/files.c: Test __VMS_POSIX as well as VMS.
13833
13834 1995-02-14 Jim Meyering <meyering@gnu.org>
13835
13836 * src/bison.s1 (__yy_memcpy):
13837 Renamed from __yy_bcopy to avoid
13838 confusion. Reverse FROM and TO arguments to be consistent with
13839 those of memcpy.
13840
13841 1995-02-14 Jim Meyering <meyering@gnu.org>
13842
13843 * bison.simple (__yy_memcpy):
13844 Renamed from __yy_bcopy to avoid
13845 confusion. Reverse FROM and TO arguments to be consistent with
13846 those of memcpy.
13847
13848 1994-11-10 David J. MacKenzie <djm@gnu.org>
13849
13850 * NEWS: reformat
13851
13852 * NEWS: New file.
13853
13854 * Makefile.in (DISTFILES): Include NEWS.
13855
13856 * Makefile.in (DISTFILES):
13857 Include install-sh, not install.sh.
13858
13859 * configure.in: Update to Autoconf v2 macro names.
13860
13861 1994-10-05 David J. MacKenzie <djm@gnu.org>
13862
13863 * Makefile.in: fix typo
13864
13865 * Makefile.in (prefix, exec_prefix):
13866 Let configure set them.
13867
13868 1994-09-28 David J. MacKenzie <djm@gnu.org>
13869
13870 * Makefile.in: Set datadir to $(prefix)/share.
13871
13872 1994-09-15 Richard Stallman <rms@gnu.org>
13873
13874 * src/bison.s1:
13875 Update copyright notice and GPL version.
13876
13877 1994-09-15 Richard Stallman <rms@gnu.org>
13878
13879 * bison.simple:
13880 Update copyright notice and GPL version.
13881
13882 1994-07-12 Richard Stallman <rms@gnu.org>
13883
13884 * src/reduce.c, src/reader.c:
13885 entered into RCS
13886
13887 1994-05-05 David J. MacKenzie <djm@gnu.org>
13888
13889 * Makefile.in: entered into RCS
13890
13891 1994-03-26 Richard Stallman <rms@gnu.org>
13892
13893 * src/bison.s1: entered into RCS
13894
13895 1994-03-26 Richard Stallman <rms@gnu.org>
13896
13897 * bison.simple: entered into RCS
13898
13899 1994-03-25 Richard Stallman <rms@gnu.org>
13900
13901 * src/main.c: entered into RCS
13902
13903 1994-03-24 Richard Stallman <rms@gnu.org>
13904
13905 * src/conflicts.c: entered into RCS
13906
13907 1994-01-02 Richard Stallman <rms@gnu.org>
13908
13909 * Makefile.in: *** empty log message ***
13910
13911 1993-11-21 Richard Stallman <rms@gnu.org>
13912
13913 * src/bison.s1: *** empty log message ***
13914
13915 1993-11-21 Richard Stallman <rms@gnu.org>
13916
13917 * doc/bison.texinfo: entered into RCS
13918
13919 * doc/bison.texinfo: *** empty log message ***
13920
13921 1993-11-21 Richard Stallman <rms@gnu.org>
13922
13923 * bison.simple: *** empty log message ***
13924
13925 1993-10-25 David J. MacKenzie <djm@gnu.org>
13926
13927 * doc/bison.texinfo: *** empty log message ***
13928
13929 1993-10-19 Richard Stallman <rms@gnu.org>
13930
13931 * src/bison.s1: *** empty log message ***
13932
13933 1993-10-19 Richard Stallman <rms@gnu.org>
13934
13935 * bison.simple: *** empty log message ***
13936
13937 1993-10-14 Richard Stallman <rms@gnu.org>
13938
13939 * src/bison.s1: *** empty log message ***
13940
13941 1993-10-14 Richard Stallman <rms@gnu.org>
13942
13943 * bison.simple: *** empty log message ***
13944
13945 1993-09-14 David J. MacKenzie <djm@gnu.org>
13946
13947 * doc/bison.texinfo: *** empty log message ***
13948
13949 1993-09-13 Noah Friedman <friedman@gnu.org>
13950
13951 * Makefile.in: *** empty log message ***
13952
13953 1993-09-10 Richard Stallman <rms@gnu.org>
13954
13955 * src/conflicts.c: *** empty log message ***
13956
13957 * src/system.h: entered into RCS
13958
13959 1993-09-10 Richard Stallman <rms@gnu.org>
13960
13961 * doc/bison.1: entered into RCS
13962
13963 1993-09-06 Noah Friedman <friedman@gnu.org>
13964
13965 * src/version.c: entered into RCS
13966
13967 1993-09-06 Noah Friedman <friedman@gnu.org>
13968
13969 * Makefile.in: *** empty log message ***
13970
13971 1993-07-30 David J. MacKenzie <djm@gnu.org>
13972
13973 * Makefile.in: *** empty log message ***
13974
13975 1993-07-24 Richard Stallman <rms@gnu.org>
13976
13977 * src/bison.s1: *** empty log message ***
13978
13979 1993-07-24 Richard Stallman <rms@gnu.org>
13980
13981 * bison.simple: *** empty log message ***
13982
13983 1993-07-08 David J. MacKenzie <djm@gnu.org>
13984
13985 * Makefile.in: *** empty log message ***
13986
13987 1993-07-04 Richard Stallman <rms@gnu.org>
13988
13989 * src/bison.s1: *** empty log message ***
13990
13991 1993-07-04 Richard Stallman <rms@gnu.org>
13992
13993 * bison.simple: *** empty log message ***
13994
13995 1993-06-26 David J. MacKenzie <djm@gnu.org>
13996
13997 * src/getargs.c: entered into RCS
13998
13999 1993-06-26 David J. MacKenzie <djm@gnu.org>
14000
14001 * doc/bison.texinfo: *** empty log message ***
14002
14003 * doc/bison.1: New file.
14004
14005 1993-06-25 Richard Stallman <rms@gnu.org>
14006
14007 * src/getargs.c: New file.
14008
14009 1993-06-16 Richard Stallman <rms@gnu.org>
14010
14011 * src/bison.s1: *** empty log message ***
14012
14013 1993-06-16 Richard Stallman <rms@gnu.org>
14014
14015 * bison.simple: *** empty log message ***
14016
14017 1993-06-03 Richard Stallman <rms@gnu.org>
14018
14019 * src/bison.s1: New file.
14020
14021 1993-06-03 Richard Stallman <rms@gnu.org>
14022
14023 * doc/bison.texinfo: *** empty log message ***
14024
14025 1993-06-03 Richard Stallman <rms@gnu.org>
14026
14027 * bison.simple: New file.
14028
14029 1993-05-19 Richard Stallman <rms@gnu.org>
14030
14031 * doc/bison.texinfo: New file.
14032
14033 1993-05-07 Noah Friedman <friedman@gnu.org>
14034
14035 * Makefile.in: *** empty log message ***
14036
14037 1993-04-28 Noah Friedman <friedman@gnu.org>
14038
14039 * src/reader.c: *** empty log message ***
14040
14041 1993-04-23 Noah Friedman <friedman@gnu.org>
14042
14043 * src/alloc.h: entered into RCS
14044
14045 1993-04-20 David J. MacKenzie <djm@gnu.org>
14046
14047 * src/version.c: *** empty log message ***
14048
14049 * src/files.c, src/allocate.c:
14050 entered into RCS
14051
14052 * src/reader.c: *** empty log message ***
14053
14054 * src/lex.c: entered into RCS
14055
14056 * src/conflicts.c: New file.
14057
14058 * src/symtab.c: entered into RCS
14059
14060 * src/alloc.h: New file.
14061
14062 * src/LR0.c: entered into RCS
14063
14064 1993-04-18 Noah Friedman <friedman@gnu.org>
14065
14066 * src/reader.c: New file.
14067
14068 * src/version.c: *** empty log message ***
14069
14070 1993-04-18 Noah Friedman <friedman@gnu.org>
14071
14072 * Makefile.in: *** empty log message ***
14073
14074 1993-04-17 Noah Friedman <friedman@gnu.org>
14075
14076 * Makefile.in: *** empty log message ***
14077
14078 1993-04-15 Richard Stallman <rms@gnu.org>
14079
14080 * src/main.c, src/files.c:
14081 New file.
14082
14083 1993-04-15 Noah Friedman <friedman@gnu.org>
14084
14085 * configure.in: entered into RCS
14086
14087 * configure.in: *** empty log message ***
14088
14089 * configure.in: New file.
14090
14091 1993-04-14 Richard Stallman <rms@gnu.org>
14092
14093 * Makefile.in: New file.
14094
14095 1993-04-13 Richard Stallman <rms@gnu.org>
14096
14097 * src/version.c: New file.
14098
14099 1993-03-25 Richard Stallman <rms@gnu.org>
14100
14101 * src/output.c: entered into RCS
14102
14103 1992-09-25 Richard Stallman <rms@gnu.org>
14104
14105 * configure.bat: entered into RCS
14106
14107 1992-06-22 Richard Stallman <rms@gnu.org>
14108
14109 * src/vmsgetargs.c: entered into RCS
14110
14111 1992-06-22 Richard Stallman <rms@gnu.org>
14112
14113 * doc/bison.rnh: entered into RCS
14114
14115 1992-04-20 David J. MacKenzie <djm@gnu.org>
14116
14117 * README: entered into RCS
14118
14119 1992-01-22 Richard Stallman <rms@gnu.org>
14120
14121 * src/machine.h: entered into RCS
14122
14123 1991-12-21 Richard Stallman <rms@gnu.org>
14124
14125 * src/lalr.c, src/closure.c:
14126 entered into RCS
14127
14128 1991-12-20 Richard Stallman <rms@gnu.org>
14129
14130 * src/state.h: entered into RCS
14131
14132 1991-12-18 Richard Stallman <rms@gnu.org>
14133
14134 * src/print.c, src/nullable.c, src/derives.c:
14135 entered into RCS
14136
14137 1991-11-03 David J. MacKenzie <djm@gnu.org>
14138
14139 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
14140 entered into RCS
14141
14142 1988-09-09 Richard Stallman <rms@gnu.org>
14143
14144 * src/bison.hairy: entered into RCS
14145
14146 1987-12-16 Richard Stallman <rms@gnu.org>
14147
14148 * REFERENCES: entered into RCS
14149
14150
14151 -----
14152
14153 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
14154 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
14155 Foundation, Inc.
14156
14157 Copying and distribution of this file, with or without
14158 modification, are permitted provided the copyright notice and this
14159 notice are preserved.