]> git.saurik.com Git - bison.git/blame - ChangeLog
portability: fix for BSD make.
[bison.git] / ChangeLog
CommitLineData
b8675840
JD
12010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 portability: fix for BSD make.
4 Reported by Johan van Selst at
5 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
6 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
7 this dependency list as in package.m4's target rule.
8
8b9e021f
JD
92010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
10
11 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
12 Reported by Johan van Selst at
13 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
14 * NEWS (2.4.3): New.
15 * THANKS (Johan van Selst): Add.
16 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
17 targets so that gnulib's new c++defs.h is matched.
18 * gnulib: Update to latest.
19
96a381c5
JD
202010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
21
22 maint: update for changes to gnulib's announce-gen.
23 * HACKING (Announce): RELEASE_TYPE=major must now be written
24 RELEASE_TYPE=stable.
25
e19a049c
JD
262010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
27
28 Version 2.4.2.
29 * NEWS (2.4.2): Set version and date. For the recent test suite
30 portability fixes, don't be so optimistic about their success
31 given the lack of feedback on the affected platforms.
32
890aeb28
JD
332010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
34
35 tests: fix maintainer-xml-check for recent changes.
36 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
37 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
38 output file whose name conflicts with a previous output file
39 is now never generated.
40
f39ab286
JD
412010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
42
43 portability: fix several issues with M4 subprocess.
44
45 M4's output pipe was not being drained upon fatal errors during
46 scan_skel. As a result, broken-pipe messages from M4 were seen
47 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
48 failure in the test suite. The problem was that, on platforms
49 where the default disposition for SIGPIPE is ignore instead of
50 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
51 then reported it. However, there's some sort of race condition,
52 because the new test group occasionally succeeded.
53 Reported by Albert Chin at
54 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
55
56 There were also problems with the test suite livelocking on
57 Tru64 5.1b. Reported by Didier Godefroy at
58 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
59 Switching to create_pipe_bidi suggested by Akim Demaille.
60
61 To attempt to solve both of these problems, switch to gnulib's
62 create_pipe_bidi and register M4 process as a slave. Along the
63 way, clean up file name conflict handling, which was affected by
64 the broken-pipe problem before the switch.
65 * NEWS (2.4.2): Document.
66 * THANKS (Didier Godefroy): Add.
67 * bootstrap.conf (gnulib_modules): Add pipe.
68 * gnulib: Update to latest to make sure we have all the latest
69 fixes.
70 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
71 subpipe.c.
72 * po/POTFILES.in (lib/subpipe.c): Remove.
73 * src/files.c (compute_output_file_names): Update invocations
74 of output_file_name_check.
75 (output_file_name_check): In the case that the grammar file
76 would be overwritten, use complain instead of fatal, but replace
77 the output file name with /dev/null. Use the /dev/null solution
78 for the case of two conflicting output files as well because it
79 seems safer in case Bison one day tries to open both files at
80 the same time.
81 * src/files.h (output_file_name_check): Update prototype.
82 * src/output.c (output_skeleton): Use create_pipe_bidi and
83 wait_subprocess. Assert that scan_skel completely drains the
84 pipe.
85 * src/scan-skel.l (at_directive_perform): Update
86 output_file_name_check invocation.
87 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
88 grammar file actually isn't overwritten.
89 (Conflicting output files: -o foo.y): Update expected output.
90 * tests/skeletons.at (Fatal errors but M4 continues producing
91 output): New test group.
92
e32050b0
JD
932010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
94
95 Update POTFILES.
96 * HACKING (Release Procedure): Add reminder about keeping
97 POTFILES files up-to-date.
98 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
99
efc4ed4a
JD
1002010-02-01 Joel E. Denny <jdenny@clemson.edu>
101
102 Code cleanup.
103 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
104 which is already defined in atconfig.
105
95611b56
JD
1062010-01-22 Joel E. Denny <jdenny@clemson.edu>
107
108 tests: fix missing include caught by g++ 4.4.1.
109 Reported by Tys Lefering.
110 * HACKING (Release checks): Add note about trying a recent GCC.
111 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
112 cstdlib for abort.
113 (_AT_DATA_EXPECT2_Y): Likewise.
114
d6e40cba
JD
1152010-01-21 Joel E. Denny <jdenny@clemson.edu>
116
117 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
118
80b70223
JD
1192010-01-21 Joel E. Denny <jdenny@clemson.edu>
120
121 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
122 * HACKING (Release Procedure): Update notes on copyright years.
123 * Makefile.am (update-package-copyright-year): New target rule.
124 * build-aux/update-package-copyright-year: New file.
125 * cfg.mk (update-copyright): Add update-package-copyright-year
126 as a dependency.
127
3320a276
JD
1282010-01-19 Joel E. Denny <jdenny@clemson.edu>
129
130 * bootstrap: Import improvements from latest gnulib.
131
e30c0477
JD
1322010-01-19 Joel E. Denny <jdenny@clemson.edu>
133
134 build: require Automake 1.11.1 to avoid a security flaw.
135 * HACKING (Release Procedure): Don't document Automake security
136 flaw here.
137 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
138 why here.
139
a538eeb1
JD
1402010-01-19 Joel E. Denny <jdenny@clemson.edu>
141
142 gnulib: update to latest.
143
d6bdb90a
JD
1442010-01-19 Joel E. Denny <jdenny@clemson.edu>
145
146 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
147
326e5cf8
JD
1482010-01-15 Joel E. Denny <jdenny@clemson.edu>
149
150 Thank the developer of the initial push parser implementation.
151 This unfortunate oversight is several years old.
152 * THANKS (Odd Arild Olsen): Add.
153
fca9c5ef
JD
1542010-01-04 Joel E. Denny <jdenny@clemson.edu>
155
156 Fix some comments concerning LR(0) versus LALR(1).
157
158 Stop equating LR(0) with nondeterminism and LALR(1) with
159 determinism. That is, if all states are consistent, then LR(0)
160 tables are deterministic. On the other hand, LALR(1) tables
161 might be nondeterministic before conflict resolution, and GLR
162 permits LALR(1) tables to remain nondeterministic.
163 * src/LR0.c, src/LR0.h: Here.
164 * src/lalr.c, src/lalr.h: Here.
165 * src/main.c (main): Here.
166 * src/state.c, src/state.h: Here.
167
168 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
169 parser tables.
170
e141f4d4
JD
1712010-01-04 Joel E. Denny <jdenny@clemson.edu>
172
173 maint: run "make update-copyright"
174
882be728
JD
1752009-12-30 Joel E. Denny <jdenny@clemson.edu>
176
177 POSIX: complain if %prec's token was not defined.
178 * NEWS (2.5): Document.
179 * src/reader.c (grammar_rule_check): Convert warning to
180 complaint.
181 * tests/input.at (%prec's token must be defined): Update.
182
8bb3a2e7
JD
1832009-12-30 Joel E. Denny <jdenny@clemson.edu>
184
185 POSIX: warn if %prec's token was not defined.
186 Reported by Florian Krohm at
187 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
188 * NEWS (2.4.2): Document.
189 * src/reader.c (grammar_rule_check): Implement.
190 (grammar_current_rule_prec_set): Add comments explaining that we
191 here assume a %prec identifier is a token, but we still manage
192 to support POSIX.
193 * tests/input.at (%prec's token must be defined): New test
194 group.
195
505e1551
JD
1962009-12-31 Joel E. Denny <jdenny@clemson.edu>
197
198 * HACKING (Release Procedure): Recommend a secure automake.
199
b8d19cf8
JD
2002009-12-29 Joel E. Denny <jdenny@clemson.edu>
201
202 portability: `<' and `>' are not always defined on addresses.
203 Specifically, don't sort objects by their memory addresses when
204 they're not allocated in the same array or other object. Though
205 I haven't found a test case where that fails on my platform, C
206 says the behavior is undefined.
207 * src/AnnotationList.c (AnnotationList__insertInto): Remove
208 FIXME. Use new id field of InadequacyList nodes rather than
209 their memory addresses when sorting.
210 (AnnotationList__compute_from_inadequacies): Add
211 inadequacy_list_node_count argument to pass to
212 InadequacyList__new_conflict.
213 * src/AnnotationList.h
214 (AnnotationList__compute_from_inadequacies): Update prototype
215 and documentation for new argument.
216 * src/InadequacyList.c (InadequacyList__new_conflict): Add
217 node_count argument and use it to assign a unique ID.
218 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
219 (InadequacyList): Add id field.
220 (InadequacyList__new_conflict): Update prototype and
221 documentation for new argument.
222 * src/ielr.c (ielr_compute_annotation_lists): Update
223 AnnotationList__compute_from_inadequacies invocation.
224
df222dfa
JD
2252009-12-20 Joel E. Denny <jdenny@clemson.edu>
226
227 Fix handling of yychar manipulation in user semantic actions.
228 The problem was that yacc.c didn't always update the yychar
229 translation afterwards. However, other skeletons appear to be
230 fine. glr.c appears to already translate yychar before every
231 use. lalr1.cc does not define yychar and does not document its
232 replacement, yyla, for users. It does provide yyclearin, but
233 that does not manipulate yyla and thus requires no translation
234 update. In lalr1.java, yychar is out of scope during semantic
235 actions.
236 * NEWS (2.5): Document.
237 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
238 yytoken here.
239 (yyparse, yypush_parse): Instead, translate before every use of
240 yytoken, and add comments explaining this approach.
241 * tests/actions.at (Destroying lookahead assigned by semantic
242 action): New test group checking that translation happens before
243 lookahead destructor calls at parser return. Previously,
244 incorrect destructors were called.
245 * tests/conflicts.at (parse.error=verbose and consistent
246 errors): New test group checking that translation happens at
247 syntax error detection before the associated verbose error
248 message and the associated lookahead destructor calls. While
249 the destructor call is fixed by this patch, the verbose error
250 message is currently incorrect due to another bug (see
251 comments in test group), so this is an expected failure for now.
252
4395a9ff
JD
2532009-12-21 Joel E. Denny <jdenny@clemson.edu>
254
255 YYFAIL: warn about uses and remove from lalr1.java.
256 * NEWS (2.5): Document.
257 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
258 and make it private. Update all uses.
259 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
260
1625df5b
JD
2612009-12-21 Joel E. Denny <jdenny@clemson.edu>
262
263 YYFAIL: deprecate.
264 * NEWS (2.4.2): Document deprecation and the phase-out plan.
265 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
266 deprecation.
267 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
268 YYFAIL from GCC cpp's -Wunused-macros.
269 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
270 documentation.
271 (LocalWords): Remove YYFAIL.
272
5335b65a
JD
2732009-12-20 Joel E. Denny <jdenny@clemson.edu>
274
275 tests: cleanup.
276 * tests/c++.at (Syntax error discarding no lookahead): Don't
277 ignore stderr. Instead, eliminate remaining warnings.
278
d59beda0
JD
2792009-12-18 Joel E. Denny <jdenny@clemson.edu>
280
281 lalr1.cc: don't discard non-existent lookahead on syntax error.
282 * data/lalr1.cc (parser::parse): Check yyempty first.
283 * tests/c++.at (Syntax error discarding no lookahead): New test
284 group.
285
387b4d50
JD
2862009-12-17 Joel E. Denny <jdenny@clemson.edu>
287
288 Code cleanup.
289 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
290 function, which is no longer used.
291
a603c6e0
JD
2922009-12-16 Joel E. Denny <jdenny@clemson.edu>
293
294 Add gcc's -Wundef to test suite and fix another warning from it.
295 * NEWS (2.4.2): Update description of -Wundef fix.
296 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
297 (WARN_CFLAGS_TEST): New substitution.
298 * data/glr.c: Avoid warning about __STRICT_ANSI__.
299 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
300 WARN_CFLAGS.
301 (NO_WERROR_CFLAGS): Likewise.
302 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
303
19750d31
JD
3042009-12-16 Joel E. Denny <jdenny@clemson.edu>
305
306 * data/yacc.c: Reformat m4 a little.
307
c938d650
JD
3082009-12-16 Joel E. Denny <jdenny@clemson.edu>
309
310 Document gcc -Wundef fix.
311 * NEWS (2.4.2): Here.
312 * THANKS (Jonathan Nieder): Add.
313
fcd32abd
JN
3142009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
315
316 Simplify y.tab.c when location tracking is disabled.
317 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
318 tracking is not enabled. Instead, unconditionally define
319 YY_LOCATION_PRINT as a no-op for backward compatibility.
320
ae93128c
JN
3212009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
322
323 Avoid warnings from gcc -Wundef y.tab.c.
324 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
325 defined before using them.
326 * data/lalr1.cc: Likewise.
327 * data/yacc.c: Likewise.
328
c843aaab
JD
3292009-12-15 Joel E. Denny <jdenny@clemson.edu>
330
331 autoconf: update to latest for fix of M4 detection.
332 Reported by Eric Blake.
333 * submodules/autoconf: Update.
334
5c99151a
JD
3352009-12-15 Joel E. Denny <jdenny@clemson.edu>
336
337 portability: use -DGNULIB_POSIXCHECK.
338 Reported by Eric Blake. See discussions at
339 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
340 and
341 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
342 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
343 * bootstrap.conf (gnulib_modules): Add all the printf modules
344 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
345 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
346 (excluded_files): Remove m4/printf-posix.m4.
347 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
348 lib/libbison.a so gnulib libraries can be linked.
349
75f94c6d
JD
3502009-12-15 Joel E. Denny <jdenny@clemson.edu>
351
352 gnulib: update for fix of fprintf-posix, which we'll use soon.
353 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
354 targets so that gnulib's new arg-nonnull.h and link-warning.h
355 are matched.
356 * gnulib: Update.
357
ca01f454
JD
3582009-12-14 Joel E. Denny <jdenny@clemson.edu>
359
360 Enable assertion output and --disable-assert for configure.
361 * bootstrap.conf (gnulib_modules): Add assert module.
362 * src/system.h (aver): Define as assert, and summarize the
363 discussion on this issue.
364
9dc3ee6d
JD
3652009-12-14 Joel E. Denny <jdenny@clemson.edu>
366
367 Expand GLR acronym in summary of Bison.
368 Based on discussion with Akim Demaille starting at
369 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
370 * doc/bison.texinfo (Introduction): Here.
371 * src/getargs.c (usage): Here.
372
d013372c
AR
3732009-10-03 Alex Rozenman <rozenman@gmail.com>
374
375 Document named references.
376 * doc/bison.texinfo (Actions): Add new example and xref to
377 Using Named References node.
378 (Using Named References): New node.
379
5297ebb3
JD
3802009-10-16 Joel E. Denny <jdenny@clemson.edu>
381
382 cleanup.
383 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
384 of char*.
385 (Sbitset__isEmpty): Use Sbitset instead of char*.
386 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
387 instead of char. This helps to avoid casting errors.
388 (Sbitset__or): Use Sbitset instead of char*.
389
175620d3
JD
3902009-10-16 Joel E. Denny <jdenny@clemson.edu>
391
392 portability: don't assume 8-bit bytes.
393 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
394 * src/Sbitset.h (Sbitset__nbytes): Here.
395 (Sbitset__byteAddress): Here.
396 (Sbitset__bit_mask): Here.
397 (Sbitset__last_byte_mask): Here.
398 (Sbitset__ones): Here.
399 (SBITSET__FOR_EACH): Here.
400
786578e3
JD
4012009-10-11 Joel E. Denny <jdenny@clemson.edu>
402
403 portability: use va_start and va_end in the same function.
404 * src/complain.c (error_message): Move va_end from here...
405 (ERROR_MESSAGE): ... to here.
406
416a9da6
JD
4072009-10-08 Joel E. Denny <jdenny@clemson.edu>
408
409 * data/bison.m4: Update comments for rename to muscle-tab.h.
410
10659d0e
JD
4112009-10-07 Joel E. Denny <jdenny@clemson.edu>
412
413 Minor code cleanup.
414 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
415 replace all uses with UNIQSTR_CONCAT.
416 * src/uniqstr.c (uniqstr_vsprintf): New function.
417 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
418 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
419 macros.
420
3c5362b8
JD
4212009-10-06 Joel E. Denny <jdenny@clemson.edu>
422
423 * TODO (Complaint submessage indentation): New.
424
b143f404
JD
4252009-10-04 Joel E. Denny <jdenny@clemson.edu>
426
427 Minor code cleanup.
428 * src/parse-gram.y: Clean up sorting of declarations.
429 Use types to simplify %printer declarations where possible.
430 Provide %printer for BRACKETED_ID and symbol.prec.
431 * src/symtab.c: Whitespace change.
432
7439c5c0
JD
4332009-10-04 Joel E. Denny <jdenny@clemson.edu>
434
435 tests: skip tests of file names that platform does not support.
436 Reported by Michael Raskin at
437 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
438 * THANKS (Michael Raskin): Add.
439 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
440 to fail at least for file names containing ":" or "\".
441
45319f13
JD
4422009-09-23 Joel E. Denny <jdenny@clemson.edu>
443
444 yysyntax_error: avoid duplicate lookahead collection.
445 Except when memory reallocation is required, this change
446 eliminates the need to invoke yysyntax_error twice and thus to
447 repeat the collection of lookaheads. It also prepares for
448 future extensions that will make those repetitions more
449 expensive and that will require additional memory management in
450 yysyntax_error. Finally, it fixes an obscure bug already
451 exercised in the test suite.
452 * data/yacc.c (yysyntax_error): Add arguments for message
453 buffer variables stored in the parser. Instead of size, return
454 status similar to yyparse status but indicating success of
455 message creation. Other than the actual reallocation of the
456 message buffer, import and clean up memory management code
457 from...
458 (yyparse, yypush_parse): ... here.
459 * tests/regression.at (parse.error=verbose overflow): No longer
460 an expected failure.
461
52cea04a
JD
4622009-09-23 Joel E. Denny <jdenny@clemson.edu>
463
464 yysyntax_error: test memory management more.
465 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
466 * tests/regression.at (parse.error=verbose and
467 YYSTACK_USE_ALLOCA): New test group.
468 (parse.error=verbose overflow): New test group that reveals an
469 obscure bug. Expected fail for now.
470
37318e2f
JD
4712009-10-04 Joel E. Denny <jdenny@clemson.edu>
472
473 benchmarks: use %debug consistently among grammars.
474 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
475 %debug by default. It can affect the timings even if yydebug=0.
476 (generate_grammar_calc): For consistency with other grammars,
477 use YYDEBUG environment variable to set yydebug.
478
f74d6d25
JD
4792009-10-03 Joel E. Denny <jdenny@clemson.edu>
480
481 Remove dead code.
482 * src/symtab.c (symbol_pack): Here because every symbol's number
483 is always defined by this time.
484
5b1ff423
AR
4852009-10-03 Alex Rozenman <rozenman@gmail.com>
486
487 Add additional space after periods in NEWS.
488 * NEWS (2.5): here.
489
47eced30
JD
4902009-09-29 Joel E. Denny <jdenny@clemson.edu>
491
492 Use the correct conversion specifier for size_t.
493 Reported by Jim Meyering.
494 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
495 because Sbitset__Index is size_t.
496 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
497
d8f68fc2
JD
4982009-09-27 Joel E. Denny <jdenny@clemson.edu>
499
500 tests: don't abuse AT_BISON_CHECK.
501 * tests/regression.at (parse-gram.y: LALR = IELR): Move
502 additional shell commands outside of AT_BISON_CHECK.
503
43aabb70
JD
5042009-09-26 Joel E. Denny <jdenny@clemson.edu>
505
506 tests: check that parse-gram.y's IELR and LALR are identical.
507 * tests/atlocal.in (abs_top_srcdir): New shell variable.
508 * tests/regression.at (parse-gram.y: LALR = IELR): New test
509 group.
510
66381412
AR
5112009-09-19 Alex Rozenman <rozenman@gmail.com>
512
513 Keep sub-messages aligned. Fix strings for translation.
5b1ff423
AR
514 * src/location.h (location_print): Add return value.
515 * src/location.c (location_print): Return number of printed
66381412 516 characters.
5b1ff423
AR
517 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
518 new functions.
519 * src/complain.cpp (indent_ptr): New static variable.
520 (error_message, complain_at_indent, warn_at_indent): Implement
521 the alignment mechanism.
522 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
523 for translations. Use new alignment mechanism.
524 * tests/named-ref.at: Adjust test-cases.
66381412
AR
525 * NEWS (2.5): Add an announcement about named references.
526
a6ca4ce2
AD
5272009-09-17 Akim Demaille <demaille@gostai.com>
528
529 doc: fixes.
530 * doc/bison.texinfo: here.
531 Reported by Alex Rozenman.
532
3cdc21cf
AD
5332009-09-16 Akim Demaille <demaille@gostai.com>
534
535 doc: lalr1.cc and variants.
536 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
537 "variant" %define variables.
538 (C++ Semantic Values): Split into...
539 (C++ Unions, C++ Variants): these.
540 The latter is new.
541 (C++ Parser Interface): Fix type names.
542 Document parser::syntax_error.
543 Document the fact that locations are not mandatory.
544 (C++ Scanner Interface): Split into...
545 (Split Symbols, Complete Symbols): these.
546 The later is new.
547 (Calc++ Parsing Driver): Use variants.
548 Add more comments.
549 Adjust style.
550 (Calc++ Parser): Declare all the tokens, no
551 longer accept raw characters.
552 Remove %union.
553 Adjust types and printers.
554 Remove destructors.
555 (Calc++ Scanner): Use make_<SYMBOL> functions.
556 Use strerror in error message.
557
f50bfcd6
AD
5582009-09-16 Akim Demaille <demaille@gostai.com>
559
560 doc: spell checking.
561 * doc/bison.texinfo: here.
562
6b5a0de9
AD
5632009-09-16 Akim Demaille <demaille@gostai.com>
564
565 doc: comment changes.
566 * doc/bison.texinfo: Comment changes.
567
2b08bceb
AD
5682009-09-16 Akim Demaille <demaille@gostai.com>
569
570 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
571 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
572 constructor to take a token_type instead of the (internal) symbol
573 number.
574 Call yytranslate_.
575 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
576 don't call yytranslate_ here.
577
c981ce9b
AD
5782009-09-16 Akim Demaille <demaille@gostai.com>
579
580 TODO: statistics.
581 * TODO (Figures): New.
582
00d80a9c
JD
5832009-09-13 Joel E. Denny <jdenny@clemson.edu>
584
585 tests: clean up push.at test group titles.
586 * tests/push.at: Remove "Push Parsing: " from test group titles
587 because these are already under the banner "Push Parsing Tests".
588
f64e406b
AR
5892009-09-12 Alex Rozenman <rozenman@gmail.com>
590
591 Provide an additional sub-message for clarity.
592 Add "symbol not found in production" error message when
593 an "invalid reference" is detected in named references
594 resolution.
595 * src/scan-code.l: Update "invalid reference" case.
596 * tests/named-ref.at: Adjust test-cases.
597
bb31eb56
JD
5982009-09-10 Joel E. Denny <jdenny@clemson.edu>
599
600 Clean up yacc.c a little.
601 * data/yacc.c: Clean up M4 for readability, and make output
602 whitespace more consistent. For the main parse function
603 comment, instead of saying "yyparse or yypush_parse", say either
604 "yyparse" or "yypush_parse" depending on which it actually is.
605
2d399888
JD
6062009-09-10 Joel E. Denny <jdenny@clemson.edu>
607
608 Fix --enable-gcc-warnings.
609 * src/parse-gram.y (%printer <param>): Handle param_none.
610
ff601366
AD
6112009-09-09 Akim Demaille <demaille@gostai.com>
612
613 lalr1.cc: syntax_error as exceptions.
614 It is common to use sort of factories in the user actions. These
615 factories may check some "syntactic" constraints that are not
616 enforced by the grammar itself. This is possible using YYERROR
617 within the action itself. Provide the user with a means to throw
618 a syntax_error exception.
619
620 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
621 Declare and define yy::parser::syntax_error.
622 * data/lalr1.cc: Include stdexcept.
623 (yy::parser::parse): Wrap the user action within a try/catch.
624 * data/glr.cc: Include stdexcept.
625
29660062
AD
6262009-09-09 Akim Demaille <demaille@gostai.com>
627
628 lalr1.cc: add missing "inline".
629 * data/c++.m4 (b4_public_types_define): Add missing inline to
630 implementations provided in headers.
631
2055a44e
AD
6322009-09-09 Akim Demaille <demaille@gostai.com>
633
634 %param: documentation.
635 * NEWS (2.6): Document %param, %lex-param, and %parse-param
636 changes.
637 * doc/bison.texinfo: Document that %lex-param and %parse-param
638 are n-ary.
639 Changes some examples to demonstrate it.
640 (Calc++ Parser): Use %param.
641
dd875058
AD
6422009-09-09 Akim Demaille <demaille@gostai.com>
643
644 Regen.
645
f71db70b
AD
6462009-09-09 Akim Demaille <demaille@gostai.com>
647
648 style changes.
649 * src/parse-gram.y (add_param): Scope changes.
650
eaca4c11
AD
6512009-09-09 Akim Demaille <demaille@gostai.com>
652
653 %parse: support several arguments.
654 * src/parse-gram.y (current_param): New.
655 (param_type): Add param_none.
656 (params): New nonterminal.
657 Use it.
658
b18cdd91
AD
6592009-09-09 Akim Demaille <demaille@gostai.com>
660
661 Regen.
662
a7706735
AD
6632009-09-09 Akim Demaille <demaille@gostai.com>
664
665 %param.
666 Provide a means to factor lex-param and parse-param common
667 declarations.
668
669 * src/parse-gram.y (param_type): New.
670 Define a %printer for it.
671 (add_param): Use it.
672 (%parse-param, %lex-param): Merge into...
673 (%parse): this new token.
674 Adjust the grammar to use it.
675 * src/scan-gram.l (RETURN_VALUE): New.
676 (RETURN_PERCENT_FLAG): Use it.
677 (RETURN_PERCENT_PARAM): New.
678 Use it to support %parse-param, %lex-param and %param.
679
9789acf0
JD
6802009-09-03 Joel E. Denny <jdenny@clemson.edu>
681
682 Use aver not assert.
683 * src/output.c: Don't include assert.h.
684 (output_skeleton): Use aver not assert.
685 * src/system.h (aver): In documentation of why, add links to
686 Paul Eggert's explanations in the mailing lists.
687
61bc57e5
AR
6882009-09-05 Alex Rozenman <rozenman@gmail.com>
689
690 Use "Unresolved reference" error message when no symbols were found
691 in a symbolic reference resolution. Remove .expr and -expr from
692 the shown reference when the reference is unresolved.
693 * src/scan-code.l: Change the error message, adjust location columns,
694 rename variable "exact_mode" to "explicit_bracketing".
695 * tests/named-ref.at: Adjust existing tests and add a new one.
696
f4c75eaf
AD
6972009-09-04 Akim Demaille <demaille@gostai.com>
698
699 Adjust synclines in src/parse-gram.[ch].
700 * tests/bison.in: Do some magic (including working around issues
701 with ylwrap) when this wrapper is used to compile
702 src/parse-gram.y.
703
c6abeab1
JD
7042009-09-03 Joel E. Denny <jdenny@clemson.edu>
705
706 Complain about unused %define variables and %code qualifiers.
707 * NEWS (2.5): Document.
708 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
709 * doc/bison.texinfo (Decl Summary): Document complaint, and
710 improve %define documentation a little otherwise.
711 * tests/input.at (Reject unused %code qualifiers): Update.
712 (%define errors): Update.
713 (%define, --define, --force-define): Update.
714 (%define backward compatibility): Update.
715 (Unused %define api.pure): Update.
716 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
717
82db7cdb
JD
7182009-09-03 Joel E. Denny <jdenny@clemson.edu>
719
720 Don't suppress warnings about unused parse.error.
721 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
722 %define variable parse.error unless b4_error_verbose_flag is
723 actually expanded in a skeleton.
724
2755de8f
AD
7252009-09-03 Akim Demaille <demaille@gostai.com>
726
727 * NEWS (2.4.2): Add "Internationalization" item.
728
1deef26d
AD
7292009-09-03 Akim Demaille <demaille@gostai.com>
730
731 bootstrap: fix/improve find_tool.
732 * bootstrap (find_tool): Improve error messages.
733 Fix typo about find_tool_names.
734
2646cd54
JD
7352009-08-29 Joel E. Denny <jdenny@clemson.edu>
736
737 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
738 See
739 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
740 * src/scan-code.h (code_props_rule_action_init): Rename
741 named_ref arg to name so it doesn't shadow named_ref type. This
742 makes it consistent with the function definition in scan-code.l
743 anyway.
744
cf499cff
JD
7452009-08-28 Joel E. Denny <jdenny@clemson.edu>
746
747 %define: accept unquoted values.
748 * NEWS (2.5): Group all %define changes together, and document
749 this one. Remove quotes in IELR and canonical LR entry.
750 * doc/bison.texinfo: Remove quotes in most examples throughout.
751 (Decl Summary): Update %define documentation.
752 (Table of Symbols): Likewise.
753 * src/ielr.c (LrType): Update documentation.
754 * src/parse-gram.y (content.opt): Add production for ID.
755 * tests/actions.at: Remove quotes in most tests.
756 * tests/calc.at: Likewise.
757 * tests/existing.at: Likewise.
758 * tests/input.at: Likewise.
759 * tests/local.at: Likewise.
760 * tests/push.at: Likewise.
761 * tests/reduce.at: Likewise.
762 * tests/torture.at: Likewise.
763
6ba96404
JD
7642009-08-28 Joel E. Denny <jdenny@clemson.edu>
765
766 %define lr.type: make values lowercase IDs.
767 That is, "LALR" => "lalr", "IELR" => "ielr", and
768 "canonical LR" => "canonical-lr".
769 * NEWS (2.5): Update documentation.
770 * doc/bison.texinfo (Decl Summary): Likewise.
771 * src/ielr.c (ielr): Use new values.
772 * src/ielr.h (ielr): Update documentation.
773 * src/reader.c (prepare_percent_define_front_end_variables): Use
774 and validate new values.
775 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
776 grammars.
777 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
778
4413bbd3
EB
7792009-08-27 Eric Blake <ebb9@byu.net>
780
781 scan-gram: avoid portability trap with ctype usage.
782 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
783 Avoid compiler warning.
784
b70c7fb4
JD
7852009-08-27 Joel E. Denny <jdenny@clemson.edu>
786
787 tests: use perl for printing special sequences to files.
788 And skip tests if perl is not available. This is better than
789 playing tricks with shell portability. Suggested by Akim
790 Demaille.
791 * tests/input.at (Bad character literals): Use it here for
792 omitting final newlines.
793 (Bad escapes in literals): Use it here for special characters.
794
d1cc31c5
JD
7952009-08-26 Joel E. Denny <jdenny@clemson.edu>
796
797 tests: show a use of %define lr.default-reductions "consistent"
798 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
799 prevents the omission of expected tokens for %error-verbose.
800
3bed3a75
AD
8012009-08-26 Akim Demaille <demaille@gostai.com>
802
803 tests: portability fix.
804 * tests/input.at (Bad escapes in literals): Don't expect "echo
805 '\0'" to output \ then 0.
806
aa0cb40d
JD
8072009-08-26 Joel E. Denny <jdenny@clemson.edu>
808
809 Actually handle the yytable zero value correctly this time.
810 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
811 zero values in the YYTABLE comments.
812 * data/glr.c (yytable_value_is_error): Don't check for zero
813 value.
814 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
815 * data/yacc.c (yytable_value_is_error): Likewise.
816 * data/lalr1.java (yy_table_value_is_error_): Likewise.
817 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
818 * src/tables.h: In header comments, explain why it's useless to
819 check for a zero value in yytable.
820
f2b30bdf
JD
8212009-08-25 Joel E. Denny <jdenny@clemson.edu>
822
823 More fixes related to last two patches.
824 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
825 comments: zero indicates syntax error not default action.
826 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
827 defined.
828 * data/glr.c (yyis_pact_ninf): Rename to...
829 (yypact_value_is_default): ... this.
830 (yyisDefaultedState): Update for rename.
831 (yyis_table_ninf): Rename to...
832 (yytable_value_is_error): ... this, and check for value zero
833 besides just YYTABLE_NINF.
834 (yygetLRActions): Check for default value from yypact. It
835 appears that this check is always performed before this function
836 is invoked, and so adding the check here is probably redundant.
837 However, the code may evolve after this subtlety is forgotten.
838 Also, update for rename to yytable_value_is_error. Because that
839 macro now checks for zero, a different but equivalent branch of
840 the if-then-else here is evaluated.
841 (yyreportSyntaxError): Update for rename to
842 yytable_value_is_error. The zero condition was mishandled
843 before.
844 (yyrecoverSyntaxError): Update for renames. No behavioral
845 changes.
846 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
847 New function.
848 (yy_table_value_is_error_): New function.
849 (parse): Use new functions where possible. No behavioral
850 changes.
851 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
852 The zero condition was mishandled before.
853 * data/yacc.c (yyis_pact_ninf): Rename to...
854 (yypact_value_is_default): ... this.
855 (yyis_table_ninf): Rename to...
856 (yytable_value_is_error): ... this, and check for value zero
857 besides just YYTABLE_NINF.
858 (yysyntax_error): Update for rename to yytable_value_is_error.
859 The zero condition was mishandled before.
860 (yyparse): Update for renames. No behavioral changes.
861 * src/tables.h: Improve comments about yypact, yytable, etc.
862 more. Most importantly, say yytable value of zero means syntax
863 error not default action.
864
53f036ce
JD
8652009-08-25 Joel E. Denny <jdenny@clemson.edu>
866
867 Fix %error-verbose for conflicts resolved by %nonassoc.
868 * NEWS (2.5): Document.
869 * data/glr.c (yyreportSyntaxError): Fix this by checking
870 yyis_table_ninf.
871 * data/yacc.c (yysyntax_error): Likewise.
872 * data/lalr1.cc (yysyntax_error_): Fix this by checking
873 yytable_ninf_.
874 * data/lalr1.java (yysyntax_error): Likewise.
875 * tests/conflicts.at (%nonassoc and eof): Update expected output
876 and remove FIXME.
877
87412882
JD
8782009-08-25 Joel E. Denny <jdenny@clemson.edu>
879
880 Some code and documentation improvements.
881 * data/c.m4 (b4_table_value_equals): New macro to capture
882 some repeated code.
883 * data/glr.c (yyis_pact_ninf): Use it here.
884 (yyis_table_ninf): Likewise.
885 (yyreportSyntaxError): Improve internal comments.
886 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
887 Use it everywhere possible.
888 (yyis_table_ninf): Likewise.
889 (yysyntax_error): Improve internal comments.
890 * data/lalr1.cc (yysyntax_error_): Likewise.
891 * data/lalr1.java (yysyntax_error): Likewise.
892 * src/tables.h: Improve comments about yypact, yytable, etc.
893
e6c849d8
JD
8942009-08-21 Joel E. Denny <jdenny@clemson.edu>
895
896 Use locale when quoting.
897 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
898 quote rather than implementing quoting here.
899
d8911864
EB
9002009-08-20 Eric Blake <ebb9@byu.net>
901
b0778bdd
EB
902 Make previous patch more robust.
903 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
904 argmatch.h.
905 (output_skeleton): Use it.
906 Suggested by Akim Demaille.
907
d8911864
EB
908 Import latest m4/m4.m4.
909 * submodules/autoconf: Update to autoconf 2.64.
910 * configure.ac (M4_GNU_OPTION): New define.
911 * src/output.c (output_skeleton): Use it to resolve FIXME.
912 * NEWS: Mention this.
913
c2724603
JD
9142009-08-19 Joel E. Denny <jdenny@clemson.edu>
915
916 Fix complaints about escape sequences.
917 Discussed starting at
918 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
919 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
920 For a \0 and similar escape sequences meaning the null
921 character, report an invalid escape sequence instead of an
922 invalid null character because the latter does not actually
923 appear in the user's input.
924 In all escape sequence complaints, don't escape the initial
925 backslash, and don't quote when the sequence appears at the end
926 of the complaint line unless there's whitespace that quotearg
927 won't escape.
928 Consistently say "invalid" not "unrecognized".
929 Consistently prefer "empty character literal" over "extra
930 characters in character literal" warning for invalid escape
931 sequences; that is, consistently discard those sequences.
932 * tests/input.at (Bad escapes in literals): New.
933
17aed602
AD
9342009-08-19 Akim Demaille <demaille@gostai.com>
935
936 doc: fixes.
937 * doc/bison.texinfo: Fix minor Texinfo errors.
938
9142239a
AD
9392009-08-19 Akim Demaille <demaille@gostai.com>
940
941 tests: distcc compliance.
942 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
943 error messages from the output.
944
171ad99d
AD
9452009-08-19 Akim Demaille <demaille@gostai.com>
946
947 variables: simplify the upgrade of namespace into api.namespace.
948
949 This patch simplifies "variables: rename namespace as
950 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
951 Suggested by Joel E. Denny in
952 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
953
954 * src/muscle-tab.c (muscle_percent_variable_update): New.
955 (muscle_percent_define_insert): Use it in replacement of the
956 previous tr invocation.
957 Remove variable_tr, no longer needed.
958 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
959 Remove.
960 * data/c++.m4: No longer handle namespace -> api.namespace.
961 * tests/input.at (%define backward compatibility): Check that
962 namespace is treated as api.namespace.
963
d59e456d
AD
9642009-08-19 Akim Demaille <demaille@gostai.com>
965
966 doc: %initial-action to initialize yylloc.
967 Reported by Bill Allombert.
968 * doc/bison.texinfo: Set fill-column to 76.
969 (Location Type): Document the use of %initial-action to initialize
970 yylloc.
971
ceb8b8e6
AD
9722009-08-19 Akim Demaille <demaille@gostai.com>
973
974 lalr1.cc: use state_type.
975 * data/lalr1.cc (yysyntax_error_): Use state_type.
976 Move argument names into yy*.
977
7580c379
AD
9782009-08-19 Akim Demaille <demaille@gostai.com>
979
980 lalr1.cc: get rid of yyparse's yystate.
981 yystate and yystack_[0].state are equal, keep only the latter.
982 The former was also used as a temporary variable to compute the
983 post-reduction state. Move this computation into an auxiliary
984 function.
985
986 * data/glr.c (yyLRgotoState): Fuse variable definition and first
987 assignment.
988 * data/lalr1.cc (yy_lr_goto_state_): New.
989 (yyparse): Use it.
990 Replace remaining uses of yystate by yystate_[0].state.
991 Remove the former.
992
c4dc4c46
AD
9932009-08-19 Akim Demaille <demaille@gostai.com>
994
995 lalr1.cc: destroy $$ when YYERROR is called.
996 * data/lalr1.cc (yyreduce): Compute the resulting state before
997 running the user action so that yylhs is a valid symbol.
998 (yyerrorlab): Since yylhs is complete (it knows its type), we can
999 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1000 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1001
c67e466f
JD
10022009-08-18 Joel E. Denny <jdenny@clemson.edu>
1003
1004 maint: update for gnulib's recent update-copyright changes
1005 * gnulib: Update.
1006 * .x-update-copyright (COPYING): Add as it's no longer implied
1007 when .x-update-copyright is present.
1008 * cfg.mk (update-copyright-local): Remove, now ignored.
1009 (update-copyright): Declare update-b4-copyright as a dependency.
1010
af6d2358
AD
10112009-08-17 Akim Demaille <demaille@gostai.com>
1012
1013 build: require gettext 0.17.
1014
1015 Suggested by Bruno Haible.
1016 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1017 * configure.ac: require gettext 0.17 to ensure compatibility with
1018 gnulib.
1019
91a2b9b1
AD
10202009-08-17 Akim Demaille <demaille@gostai.com>
1021
1022 build: lower gettext requirements.
1023
1024 Bison was uselessly requiring the formatstring macros from
1025 gettext, which resulted in mo files not being installed on systems
1026 that perfectly supported Bison mo files. Lower the requirement.
1027 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1028
b0778bdd
EB
1029 * configure.ac: Require need-ngettext instead of
1030 need-formatstring-macros.
1031 Reported by Martin Jabocs.
1032 Suggested by Bruno Haible.
1033 * INSTALL: Restructure.
1034 (Internationalization): New.
91a2b9b1 1035
585935e8
JD
10362009-08-14 Joel E. Denny <jdenny@clemson.edu>
1037
1038 maint: fix use of copyright year intervals.
1039 * gnulib: Update.
1040 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1041 as now recommended in gnulib/NEWS.
1042 * build-aux/update-b4-copyright: Fix.
1043 * cfg.mk (update-copyright-env): Configure update-copyright.
1044
83b60c97
JD
10452009-08-13 Joel E. Denny <jdenny@clemson.edu>
1046
1047 Make it easier to write deterministic tests.
1048 Continues Akim's work from his 2009-06-10 commits.
1049 * src/reader.c (check_and_convert_grammar): Don't add any
1050 symbols after the first symbols_do invocation.
1051 * src/symtab.c (symbols_sorted): New static global.
1052 (user_token_number_redeclaration): Update comments.
1053 (symbol_from_uniqstr): If a new symbol is being created, assert
1054 that symbols_sorted hasn't been allocated yet.
1055 (symbols_free): Free symbols_sorted.
1056 (symbols_cmp, symbols_cmp_qsort): New functions.
1057 (symbols_do): Sort symbol_table into symbols_sorted on first
1058 invocation.
1059 * tests/input.at (Numbered tokens): Recombine tests now that the
1060 output should be deterministic across multiple numbers.
1061
28169bab
AD
10622009-08-12 Akim Demaille <demaille@gostai.com>
1063
1064 tests: GCC 4.5 compliance.
1065 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1066 messages about #error.
1067
9f14e187
AD
10682009-08-12 Akim Demaille <demaille@gostai.com>
1069
1070 build: fix the generation of the documentation.
1071 Some of our targets use "bison --help", but they can't depend on
1072 "bison" itself (to avoid additional requirements on the user), so
1073 they used to call "make src/bison" in the commands. Then
1074 concurrent builds may fail: one make might be aiming one of its
1075 jobs at compiling src/bison, and another job at generating the man
1076 page. If the latter is faster than the former, then we have two
1077 makes that concurrently try to compile src/bison.
1078
1079 This might also be a more convincing explanation for the failure
1080 described in the patch "build: fix paths".
1081
1082 * Makefile.am (SUFFIXES): Initialize.
1083 * build-aux/move-if-change: New, symlink to gnulib's.
1084 * build-aux/local.mk: Ship it.
1085 * doc/common.x: Remove, merged into...
1086 * doc/bison.x: here.
1087 * doc/local.mk (doc/bison.help): New.
1088 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1089 Use src/bison.
1090 (.x.1): Replace with...
1091 (doc/bison.1): this explicit, simpler, target.
1092 (common_dep): Remove, inlined where appropriate.
1093 (SUFFIXES, PREPATH): Remove, unused.
1094
d1b55e81
AD
10952009-08-12 Akim Demaille <demaille@gostai.com>
1096
1097 gnulib: improve prefixing.
1098 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1099 change the value of...
1100 (gl_LIBOBJS): this.
1101 Adjust more variables.
1102 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1103 gl_LIBOBJS.
1104 (prefix): Also transform rules whose targets have slashes.
1105 Use $prefix liberally.
1106 Map @MKDIR_P@ to $(MKDIR_P).
1107 Prefix directories that are mkdir'd.
1108
838205d5
AD
11092009-08-12 Akim Demaille <demaille@gostai.com>
1110
1111 build: fix paths.
1112 When using $(top_builddir) inconsistently, Make (including GNU
1113 Make) is sometimes confused. As a result it may want to build
1114 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1115 file, different names) concurrently, which, amusingly enough,
1116 might end with:
1117
1118 ranlib lib/libbison.a
1119 ranlib lib/libbison.a
1120 make[2]: *** [lib/libbison.a] Segmentation fault
1121
1122 on OS X.
1123
1124 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1125 needed.
1126
67af7198
AD
11272009-08-12 Akim Demaille <demaille@gostai.com>
1128
1129 distcheck: fix.
1130
b0778bdd 1131 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
67af7198 1132
c467dc42
JD
11332009-08-10 Joel E. Denny <jdenny@clemson.edu>
1134
1135 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1136
dfaa4860
JD
11372009-08-10 Joel E. Denny <jdenny@clemson.edu>
1138
1139 Miscellaneous code readability improvements.
1140
1141 * src/reader.c (reader): Move %define front-end variable
1142 defaults and checking into...
1143 (prepare_percent_define_front_end_variables): ... this new
1144 function.
1145
1146 * src/scan-gram.l (INITIAL): For consistency with string
1147 literals, don't store open quote on character literal. It's
1148 discarded before returning anyway.
1149 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1150 Make length test more readable, and make the character stored
1151 for an empty literal more obvious while consistent with the
1152 previous behavior.
1153
1154 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1155 USER_NUMBER_HAS_STRING_ALIAS throughout.
1156 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1157 that is repeated in symtab.h. Improve argument names to make it
1158 clear which side of the symbol-string alias pair is which.
1159 (symbol_check_alias_consistency): Improve local variable names
1160 for the same purpose.
1161 * src/symtab.h (struct symbol): Make comments about aliases
1162 clearer.
1163 (symbol_make_alias): Improve comments and argument name.
1164 * src/output.c (token_definitions_output): Update for rename to
1165 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1166
ce268795
AR
11672009-08-08 Alex Rozenman <rozenman@gmail.com>
1168
1169 Convert "misleading reference" messages to warnings.
1170 * src/scan-code.l: New function 'show_sub_messages', more
1171 factoring.
1172 * tests/named-ref.at: Adjust tests.
1173
401b73af
JD
11742009-08-06 Joel E. Denny <jdenny@clemson.edu>
1175
1176 maint: run "make update-copyright"
1177
a1a9422d
JD
11782009-08-06 Joel E. Denny <jdenny@clemson.edu>
1179
1180 maint: make update-b4-copyright easier to use
1181 * build-aux/update-b4-copyright: In warnings, report line
1182 numbers rather than character positions.
1183 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1184 that update-copyright runs it.
1185 * gnulib: Update.
1186
0b61a8ec
JD
11872009-08-05 Joel E. Denny <jdenny@clemson.edu>
1188
1189 maint: clean up update-b4-copyright code
1190 * build-aux/update-b4-copyright: Do not accept 2-digit
1191 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1192 Don't accept a `[' in a b4_copyright argument.
1193 Format code more consistently.
1194 Don't assume b4*copyright never occurs.
1195
269e222e
JD
11962009-08-04 Joel E. Denny <jdenny@clemson.edu>
1197
1198 maint: automate b4_copyright updates.
1199 * Makefile.am (update-b4-copyright): New target rule.
1200 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1201 * build-aux/update-b4-copyright: New.
1202 * data/yacc.c: Remove stray characters around b4_copyright
1203 invocations.
1204
35905f2b
JD
12052009-08-04 Joel E. Denny <jdenny@clemson.edu>
1206
1207 maint: automate annual package-wide copyright-year update.
1208 * .x-update-copyright: New.
1209 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1210 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1211 update-copyright. Remove gnumakefile, which is implied by
1212 maintainer-makefile.
1213 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1214 * gnulib: Update.
1215 * maint.mk: Remove, now copied from gnulib.
1216 * examples/extexi: Add missing "(C)" in copyright statement so
1217 update-copyright can recognize it.
1218 * src/LR0.h: Likewise.
1219 * src/print.h: Likewise.
1220 * src/print_graph.h: Likewise.
1221 * src/gram.c: Add missing comma in copyright statement.
1222 * src/gram.h: Likewise.
1223
b30e18dc
JD
12242009-08-04 Joel E. Denny <jdenny@clemson.edu>
1225
1226 Fix "make distcheck".
1227 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1228 of just calc.stamp.
1229
8d90395d
JD
12302009-08-01 Joel E. Denny <jdenny@clemson.edu>
1231
1232 Pacify "gcc -Wunused" for the input function from Flex.
1233 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1234 and later.
1235 * src/scan-code.l: Add "%option noinput", which I cannot find in
1236 the Flex manual, but which Flex has supported since at least as
1237 far back as 2.5.4. However, if any of our developers still use
1238 Flex 2.5.4, they'll need to stop configuring with
1239 --enable-gcc-warnings because "%option noinput" didn't work
1240 correctly until Flex 2.5.6.
1241 * src/scan-gram.l: Likewise.
1242 * src/scan-skel.l: Likewise.
1243
ba4184ec
AR
12442009-07-31 Alex Rozenman <rozenman@gmail.com>
1245
1246 Fix --enable-gcc-warnings problems.
1247 * src/reader.c: Adjust variable names.
1248 * src/scan-code.l: Fix prototypes and adjust names.
1249 * src/named-ref.c: Remove redundant "if".
1250
91a2af97
JD
12512009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1252
1253 Fix a --enable-gcc-warnings problem.
1254 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1255 variable.
1256
3208e3f4
JD
12572009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1258
1259 Warn about character literals not of length one.
1260 * NEWS (2.5): Document.
1261 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1262 the length.
1263 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1264 * tests/input.at (Bad character literals): New test group.
1265
5add20ab 12662009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
1267
1268 Fix some memory leaks.
1269 * src/named-ref.c: Add a pointer check (named_ref_free).
1270 * src/scan-code.l: New function (variant_table_free). Called in
1271 code_scanner_free.
1272 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1273
e459fb0e
JD
12742009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1275
1276 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1277
c4be5517
JD
12782009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1279
1280 Some M4 cleanup in the testsuite.
1281 Suggested by Eric Blake at
1282 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1283 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1284 complicate the code by distinguishing between a missing value
1285 and an empty string value for an optional argument. This fix is
1286 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1287 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1288 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1289 arguments are not needed because of the following changes.
1290 Fix stale comments.
1291 Bison developers should use GNU M4 and should not use
1292 POSIXLY_CORRECT when building the test suite, so do not
1293 complicate the code by avoiding $10 and above.
1294 Do not quote an empty string value for an optional argument, and
1295 do not distinguish between a missing value and an empty string
1296 value.
1297
feeb56cd
JD
12982009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1299
1300 Revert unnecessary column realignment in --help output.
1301 Reported by Akim Demaille at
1302 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1303 * src/getargs.c (usage): Here.
1304
5add20ab 13052009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
1306
1307 Alphabetical order in src/local.mk.
1308 * src/local.mk: Adjust.
1309
5add20ab 13102009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
1311
1312 Style changes and factoring.
1313 * src/named-ref.h: Add comments.
1314 * src/parse-gram.y: Readability and style changes.
1315 * src/reader.c: Factoring: assign_named_ref function.
1316 * src/scan-code.l: Factoring and style changes. Rename
1317 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1318 Use "unsigned" type for variant index. Improve readablity.
1319 * src/scan-gram.l: Change error messages and add comments.
1320 * src/symlist.h: symbol_list_null: New function decl.
1321 * src/symlist.c: symbol_list_null: Implement here.
1322 * tests/named-refs.at: Adjust for new error messages.
1323
83ea2423
EB
13242009-06-29 Eric Blake <ebb9@byu.net>
1325
1326 scan-code: avoid compiler warnings
1327 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1328
5ece73ea
AD
13292009-06-29 Akim Demaille <demaille@gostai.com>
1330
1331 build: avoid concurrent extraction of calc++.
1332 * examples/calc++/Makefile.am (calc.stamp): New.
1333 Depend on it to create the sources of calc++ so that concurrent
1334 builds don't launch several "extexi" in parallel.
1335 Not only this is inefficient, this also builds incorrect sources
1336 with several extractions mixed together.
1337
ad597a78
AD
13382009-06-29 Akim Demaille <demaille@gostai.com>
1339
1340 parse.error: fix.
1341 * data/bison.m4: Move code related to specific variables after the
1342 definition of the variable-maintaining macros so that we don't
1343 "invoke" b4_percent_define_check_values before it is defined.
1344
31b850d2
AD
13452009-06-29 Akim Demaille <demaille@gostai.com>
1346
1347 variables: parse.error
1348
1349 Implement, document, and test the replacement of %error-verbose
1350 by %define parse.error "verbose".
1351 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1352 values of the parse.error variable.
1353 Make "simple" its default value.
1354 Check the valid values.
1355 * src/parse-gram.y: Use %define parse.error.
1356 (PERCENT_ERROR_VERBOSE): New token.
1357 Support it.
1358 * src/scan-gram.l: Support %error-verbose.
1359
1360 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1361 %define error-verbose by that of %define parse.error.
1362 * NEWS: Document it.
1363
1364 * tests/actions.at, tests/calc.at: Use parse.error instead of
1365 %error-verbose.
1366
b9f1d9a4
AR
13672009-06-27 Alex Rozenman <rozenman@gmail.com>
1368
1369 Implement support for named symbol references.
1370 * src/parse-gram.y: Add new syntax (named_ref.opt).
1371 * src/reader.c: Store named refs in symbol lists.
1372 * src/reader.h: New argument for symbol_append and
1373 action_append functions.
1374 * src/scan-code.h: Add new field (named_ref) into
1375 code_props data structure. Keeps named ref of midrule
1376 actions.
1377 * src/scan-code.l: Support for named refs in semantic
1378 action code. New function 'parse_named_ref'.
1379 * src/scan-gram.l: Support bracketed id.
1380 * src/symlist.c: Store named refs in symbol lists.
1381 * src/symlist.h: New field in symbol list: named_ref.
1382 * src/named-ref.h: New file, a struct for named_ref.
1383 * src/named-ref.cp: New file, named_ref_new function.
1384 * src/local.mk: Add two new files.
1385 * tests/testsuite.at: Include new test group:
1386 * tests/named-refs.at: this new file.
1387
b5c212b6
AD
13882009-06-25 Akim Demaille <demaille@gostai.com>
1389
1390 hash: check insertion for memory exhaustion.
1391 * src/uniqstr.c (uniqstr_new): New.
1392
67501061
AD
13932009-06-24 Akim Demaille <demaille@gostai.com>
1394
1395 variables: rename namespace as api.namespace.
1396 Discussed in
1397 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1398
1399 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1400 New.
1401 (b4_percent_define_use): New.
1402 Use it where applicable.
1403 * data/c++.m4: Replace uses of the variable "namespace" by
1404 "api.namespace".
1405 Default the latter to the former.
1406 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1407 obsolete.
1408 Document api.namespace.
1409 Use @samp to document %define uses, keep @code for identifiers.
1410 * NEWS: Likewise.
1411 * tests/c++.at, tests/input.at: Test api.namespace instead of
1412 namespace. (The tests passed with namespace.)
1413
41976786
AD
14142009-06-11 Akim Demaille <demaille@gostai.com>
1415
1416 style changes.
1417 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1418 * src/print-xml.c: Style changes.
1419 * tests/conflicts.at: Comment changes.
1420
44bb9084
AD
14212009-06-11 Akim Demaille <demaille@gostai.com>
1422
1423 xml: beware of user strings used to give a %prec to rules.
1424 * tests/conflicts.at (%prec with user strings): New.
1425 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1426 XML output.
1427
04d1e39d
AD
14282009-06-11 Akim Demaille <demaille@gostai.com>
1429
1430 hash: check insertion for memory exhaustion.
1431 * src/muscle-tab.c (muscle_insert, muscle_grow)
1432 * src/state.c (state_hash_insert): Check the return value of
1433 hash_insert.
1434
a8873669
AD
14352009-06-11 Akim Demaille <demaille@gostai.com>
1436
1437 tests: honor TESTSUITEFLAGS in every check target.
1438 * tests/local.mk (RUN_TESTSUITE): New.
1439 (check-local, installcheck-local, maintainer-check-g++)
1440 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1441
8893145a
AD
14422009-06-10 Akim Demaille <demaille@gostai.com>
1443
1444 deterministic test suite.
1445 Some consistency checks on symbols are performed after all the
1446 symbols were read, by an iteration over the symbol table. This
1447 traversal is nondeterministic, which can be a problem for test
1448 cases.
1449 Avoid this.
1450 Addresses another form of nondeterminism reported by Joel E. Denny.
1451 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1452
1453 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1454 test in two.
1455 Use different file names for the three tests to make the
1456 maintenance easier.
1457
92d7a23a
AD
14582009-06-10 Akim Demaille <demaille@gostai.com>
1459
1460 gnulib: update.
b0778bdd
EB
1461 * gnulib: Update to latest.
1462 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1463 * m4/.gitignore: Regen.
1464 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1465 Call xalloc_die on hash_insert failures.
1466 Requested by the new __warn_unused_result__ attribute of
1467 hash_insert.
92d7a23a 1468
12cf133f
AD
14692009-06-10 Akim Demaille <demaille@gostai.com>
1470
1471 deterministic user-token-number redeclaration errors.
1472 Address nondeterminism reported by Joel E. Denny.
1473 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1474
1475 * src/uniqstr.h: Comment changes.
1476 * src/location.h (boundary_cmp, location_cmp): New.
1477 * src/symtab.c (user_token_number_redeclaration): New.
1478 (symbol_translation): Use it.
1479 * tests/input.at (Numbered tokens): Adjust the expected output.
1480
796a2b0a
AD
14812009-05-25 Akim Demaille <demaille@gostai.com>
1482
1483 build: avoid ignored errors.
1484 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1485 errors, they pollute the output.
1486
0b6d43c5
JD
14872009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1488
1489 Convert multiple variable definition warnings to complaints.
1490 * NEWS (2.5): Add a new entry for that change.
1491 * doc/bison.texinfo (Decl Summary): Update %define entry.
1492 (Bison Options): Update -D/--define/-F/--force-define entry.
1493 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1494 * src/muscle-tab.h (muscle_percent_define_insert): Update
1495 comments.
1496 * tests/input.at (`%define errors'): Update.
1497 (`%define, --define, --force-define'): Update.
1498
de5ab940
JD
14992009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1500
1501 -F/--force-define and relative %define/-D/--define priorities.
1502 * NEWS (2.5): Add documentation to -D/--define entry.
1503 * build-aux/cross-options.pl: Hard-code association of
1504 --force-define with %define.
1505 * doc/bison.texinfo (Decl Summary): In %define entry,
1506 cross-reference command-line options.
1507 (Bison Options): Add documentation to -D/--define entry.
1508 (Option Cross Key): Widen column for --force-define row.
1509 * src/getargs.c (usage): Document -F/--force-define. Realign
1510 options in output.
1511 (short_options, long_options, getargs): Parse -F/--force-define,
1512 and update muscle_percent_define_insert invocations.
1513 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1514 (muscle_percent_define_insert): Add argument with that type.
1515 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1516 -F/--force-define behavior and priorities.
1517 (muscle_percent_define_ensure): Update
1518 muscle_percent_define_insert invocation.
1519 * src/parse-gram.y (prologue_declaration): Update
1520 muscle_percent_define_insert invocations.
1521 * tests/input.at (`%define, --define'): Rename to...
1522 (`%define, --define, --force-define'): ... this and extend.
1523
f8e7258f
JD
15242009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1525
1526 Update some comments to make sense for -D.
1527 * data/bison.m4 (b4_check_user_names): In header comments, say
1528 "user occurrence" instead of "grammar occurrence".
1529 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1530 (muscle_percent_code_grow): Likewise just for consistency.
1531
b987342b
JD
15322009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1533
1534 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1535
4977e0a7
JD
15362009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1537
1538 Handle a trailing `:' in a user-supplied C++ namespace better.
1539 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1540 among the closing braces here. This fix might make the
1541 generated code easier to debug, but otherwise it should be
1542 insignificant because a trailing `:' is a C++ error already.
1543
9b04dad7
AD
15442009-05-19 Akim Demaille <demaille@gostai.com>
1545
1546 remove useless variable.
1547 * src/getargs.c (skeleton_arg): Remove now useless variable.
1548 Should help the compiler see that this printf-like call is sane.
1549
4c6622c2
AD
15502009-05-15 Akim Demaille <demaille@gostai.com>
1551
1552 Rename token.prefix as api.tokens.prefix.
1553 Discussed here.
1554 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1555
1556 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1557 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1558 (token.prefix): Rename as...
1559 (api.tokens.prefix): this.
1560
3c248d70
AD
15612009-05-11 Akim Demaille <demaille@gostai.com>
1562
1563 doc: use C++ headers.
1564 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1565 headers.
1566
99c08fb6
AD
15672009-05-11 Akim Demaille <demaille@gostai.com>
1568
1569 doc: token.prefix
1570 * doc/bison.simple (Decl Summary): Document token.prefix.
1571 (Calc++ Parser): Various fixes.
1572 Formatting changes.
1573 Use token.prefix.
1574 Introduce a macro TOKEN to shorten the code and make it more
1575 readable.
1576 (Calc++ Scanner): Adjust.
1577 * NEWS (Variable token.prefix): New.
1578
84a1cb5a
AD
15792009-05-04 Akim Demaille <demaille@gostai.com>
1580
1581 bison: catch bad symbol names.
1582 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1583 * tests/input.at: Adjust.
1584
cdf3f113
AD
15852009-05-04 Akim Demaille <demaille@gostai.com>
1586
1587 identifiers: dashes are letters.
1588 Dashes can now start identifiers (symbols and directives).
84a1cb5a 1589
cdf3f113
AD
1590 * src/scan-gram.l ({letter}): Add dash.
1591 ({id}): Remove it.
1592 * tests/input.at (Symbols): Adjust.
1593 Remove stray comment.
1594 * tests/regression.at (Invalid inputs): Adjust error message.
1595 * doc/bison.texinfo (Symbols): Update.
1596
98a345a2
JD
15972009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1598
1599 Declare %code to be a permanent feature.
1600 * NEWS (2.4.2): Here.
1601 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1602 experimental.
1603 (Decl Summary): Likewise.
1604
67212941
JD
16052009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1606
1607 Convert underscores to dashes in some %define variable names.
1608 For now, just api.push-pull and lr.keep-unreachable-states.
1609 Maintain old names for backward compatibility.
1610 * NEWS (2.5): Document.
1611 * data/c.m4 (b4_identification): Update comment.
1612 * data/yacc.c: Update access.
1613 * doc/bison.texinfo: Update.
1614 * etc/bench.pl.in (bench_push_parser): Update use.
1615 * src/files.c (tr): Move to...
1616 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1617 think of a better place to expose it. My logic is that, for all
1618 uses of tr so far, command-line arguments can be involved, and
1619 getargs.h is already included.
1620 * src/main.c (main): Update access.
1621 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1622 variable names to new variable names before assigning value.
1623 * src/reader.c (reader): Update setting default.
1624 * tests/calc.at: Update uses.
1625 * tests/conflicts.at (Unreachable States After Conflict
1626 Resolution): Update use.
1627 * tests/input.at (%define enum variables): Update use.
1628 (%define backward compatibility): New test group.
1629 * tests/push.at: Update uses.
1630 * tests/reduce.at: Update uses.
1631 * tests/torture.at: Update uses.
1632
ba5c6d94
JD
16332009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1634
1635 Set all front-end %define defaults in one place.
1636 * src/main.c (main): Move lr.keep_unreachable_states default...
1637 * src/reader.c (reader): ... to here.
1638
5bab9d08
JD
16392009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1640
1641 Rename lr.default_reductions to lr.default-reductions.
1642 * NEWS (2.5): Here.
1643 * doc/bison.texinfo: Here.
1644 * src/lalr.c (initialize_LA): Here.
1645 * src/print.c (print_reductions): Here.
1646 * src/reader.c (reader): Here.
1647 * src/tables.c (action_row): Here.
1648 * tests/input.at (%define enum variables): Here.
1649 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1650
d521ee19
JD
16512009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1652
1653 Pacify ./configure --enable-gcc-warnings.
1654 * tests/input.at (Symbols): Prototype yyerror and yylex.
1655
16562009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
1657
1658 Document how `%define "var" "value"' is not M4-friendly.
1659 * src/parse-gram.y (variable): In comments here.
1660
8f0d265e
JD
16612009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1662
1663 Clean up recent patches a little.
1664 Reported by Akim Demaille.
1665 * doc/bison.texinfo (Understanding): Fix typos.
1666 * src/print.c (print_reductions): Don't use negated variable.
1667
f4909773
JD
16682009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1669
1670 List accepted values for a %define enum variable with an invalid value.
1671 Suggested by Akim Demaille at
1672 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1673 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1674 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1675 * tests/input.at (%define lr.default_reductions invalid values): Merge
1676 into...
1677 (%define enum variables): ... here, and update output.
1678
110ef36a
JD
16792009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1680
1681 Rename "default rule" to "default reduction".
1682 This includes changing variable names in code, changing
1683 comments, and renaming %define lr.default_rules to %define
1684 lr.default_reductions.
1685 * NEWS (2.5): Update IELR documentation.
1686 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1687 documentation.
1688 * data/glr.c, data/lalr1.java: Sync copyright dates.
1689 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1690 and lr.type documentation. Make some other wording
1691 improvements.
1692 (Glossary): Adjust cross-references and Default Reduction
1693 definition.
1694 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1695 Remove a confusing comment pointed out by Akim Demaille.
1696 (initialize_LA): Adjust code.
1697 * src/print-xml.c (print_reductions): Adjust code.
1698 * src/print.c (print_reductions): Adjust code.
1699 * src/reader.c (reader): Adjust code.
1700 * src/tables.c (action_row): Adjust code.
1701 (token_actions): Adjust code.
1702 * src/tables.h: Adjust YYDEFACT documentation.
1703 * tests/input.at (%define lr.default_rules invalid values):
1704 Rename test group to...
1705 (%define lr.default_reductions invalid values): ... this, and
1706 update grammar file and expected output.
1707 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1708 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1709
746ee38c
AD
17102009-04-21 Akim Demaille <demaille@gostai.com>
1711
1712 tests: check the use of dashes and periods in symbols.
1713 * tests/input.at (Symbol): New test group.
1714
eb45ef3b
JD
17152009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1716
1717 Document %define lr.type and lr.default_rules.
1718 * NEWS (2.5): Add an entry.
1719 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1720 besides just LALR(1) and GLR(1).
1721 * doc/bison.texinfo (Introduction): Likewise.
1722 (Language and Grammar): Bison is no longer limited to LALR(1)
1723 restrictions.
1724 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1725 when trying to distinguish from GLR. Talk about LR(1) grammars
1726 rather than LALR(1) grammars.
1727 (Decl Summary): In %define api.push_pull entry, say it applies
1728 to deterministic parsers in C rather than LALR(1) parsers in C.
1729 Add lr.default_rules entry.
1730 Add lr.type entry.
1731 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1732 restrictions.
1733 (Generalized LR Parsing): Same changes as for the previous GLR
1734 section.
1735 (Memory Management): Say deterministic rather than LALR(1).
1736 (Understanding): Correct some bison output.
1737 Index discussion of "accepting state".
1738 Say deterministic rather than LALR(1).
1739 (Bison Options): In --yacc entry, say deterministic rather than
1740 LALR(1).
1741 In --report, --graph, and --xml entries, just don't mention
1742 LALR(1).
1743 (C++ Parsers): Say deterministic rather than LALR(1).
1744 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1745 (Glossary): Add Accepting State, Consistent State, Default Rule,
1746 and IELR(1) definitions.
1747 In Generalized LR (GLR) definition, make same changes as in
1748 previous GLR sections.
1749 In LALR(1) definition, say Bison uses LALR(1) by default rather
1750 than implying Bison is limited to LALR(1).
1751 (LocalWords): Add IELR.
1752
db34f798
JD
17532009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1754
1755 Finish implementing %define lr.type.
1756 Its value can be "LALR", "IELR", or "canonical LR".
1757 * lib/timevar.def (TV_IELR_PHASE1): New var.
1758 (TV_IELR_PHASE2): New var.
1759 (TV_IELR_PHASE3): New var.
1760 (TV_IELR_PHASE4): New var.
1761 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1762 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1763 Sbitset.h, ielr.h, and ielr.c.
1764 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1765 trace_types): Add trace_ielr.
1766 * src/lalr.h, src/lalr.c (ngotos): Export it.
1767 (F): Rename to...
1768 (goto_follows): ... this, update all uses, and export it.
1769 (set_goto_map): Export it.
1770 (map_goto): Export it.
1771 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1772 handled in ielr.
1773 (initialize_LA): Export it. Move lookback allocation to...
1774 (lalr): ... here because, for canonical LR, initialize_LA must
1775 be invoked but lookback and much of the rest of LALR isn't
1776 needed.
1777 * main.c (main): Instead of lalr, invoke ielr, which invokes
1778 lalr.
1779 * src/reader.c (reader): Default lr.type to "LALR".
1780 Default lr.default_rules to "accepting" if lr.type is "canonical
1781 LR". Leave the default as "all" otherwise.
1782 Check for a valid lr.type value.
1783 * src/state.h, src/state.c (struct state_list): Add state_list
1784 member.
1785 (state_new): Initialize state_list member to NULL.
1786 (state_new_isocore): New function, exported.
1787 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1788 exercises all values of lr.type.
1789 (GNU AWK Grammar): Rename test group to...
1790 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1791 AT_TEST_EXISTING_GRAMMAR.
1792 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1793 (GNU pic Grammar): Rename test group to...
1794 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1795 AT_TEST_EXISTING_GRAMMAR.
1796 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1797 all values of lr.type.
1798 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1799 (Lane Split): Likewise.
1800 (Complex Lane Split): Likewise.
1801 (Split During Added Lookahead Propagation): Likewise.
1802
7fe11bb5
JD
18032009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1804
1805 Add new files for IELR and canonical LR implementation.
1806 * src/AnnotationList.c: New.
1807 * src/AnnotationList.h: New.
1808 * src/InadequacyList.c: New.
1809 * src/InadequacyList.h: New.
1810 * src/Sbitset.c: New.
1811 * src/Sbitset.h: New.
1812 * src/ielr.c: New.
1813 * src/ielr.h: New.
1814
7254f6a8
JD
18152009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1816
1817 Implement %define lr.default_rules.
1818 Its value describes the states that are permitted to contain
1819 default rules: "all", "consistent", or "accepting".
1820 * src/reader.c (reader): Default lr.default_rules to "all".
1821 Check for a valid lr.default_rules value.
1822 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1823 is "accepting", then only mark the accepting state as
1824 consistent.
1825 (initialize_LA): Tell state_lookahead_tokens_count whether
1826 lr.default_rules is "accepting".
1827 * src/tables.c (action_row): If lr.default_rules is not "all",
1828 then disable default rules in inconsistent states.
1829 * src/print.c (print_reductions): Use this opportunity to
1830 perform some assertions about whether lr.default_rules was
1831 obeyed correctly.
1832 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1833 helps with checking the parser tables for a grammar.
1834 * tests/input.at (%define lr.default_rules invalid values): New
1835 test group.
1836 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1837 AT_TEST_TABLES_AND_PARSE.
1838 (`no %define lr.default_rules'): New test group generated by
1839 AT_TEST_LR_DEFAULT_RULES.
1840 (`%define lr.default_rules "all"'): Likewise.
1841 (`%define lr.default_rules "consistent"'): Likewise.
1842 (`%define lr.default_rules "accepting"'): Likewise.
1843
72e727f2
AD
18442009-04-20 Akim Demaille <demaille@gostai.com>
1845
1846 Formatting change.
1847
90462b8d
AD
18482009-04-20 Akim Demaille <demaille@gostai.com>
1849
1850 bison: factoring.
1851 * src/output.c (token_definitions_output): Use symbol_id_get
1852 instead of duplicating its logic.
1853 * TODO (YYERRCODE): Extend.
1854
4f646c37
AD
18552009-04-20 Akim Demaille <demaille@gostai.com>
1856
71b00ed8
AD
1857 variables: prefer error-verbose to error_verbose.
1858 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1859 instead of error_verbose.
1860 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1861 variable.
1862 * doc/bison.texinfo: Promote %define error-verbose instead of
1863 %error-verbose.
1864 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1865
18662009-04-15 Akim Demaille <demaille@gostai.com>
1867
4f646c37
AD
1868 variables: accept dashes.
1869 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1870 underscores.
1871 * src/scan-gram.l ({id}): Also accept dashes after the initial
1872 letter.
1873 ({directive}): Use {id}.
1874 * src/parse-gram.y: Comment and formatting changes.
1875 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1876 symbols.
1877 * src/complain.h, src/complain.c (yacc_at): New.
1878 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1879 symbol names.
1880 * src/output.c (token_definitions_output): Do not #define token
1881 names with dashes.
1882
184e3179
AD
18832009-04-20 Akim Demaille <demaille@gostai.com>
1884
1885 Consistently refer to Yacc, not YACC.
1886 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1887
41253c3a
JD
18882009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1889
1890 Pacify make maintainer-check-posix.
1891 * tests/input.at (%define, --define): Move bison command-line
1892 options before grammar file name.
1893
197b82ba
JD
18942009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1895
1896 Document semicolon warnings.
1897 * NEWS (2.5): Here.
1898
0c90a1f5
AD
18992009-04-14 Akim Demaille <demaille@gostai.com>
1900
1901 variables: use `parse.assert' instead of `assert'.
1902 * TODO (assert): Remove.
1903 * data/bison.m4 (b4_assert_if): Replace with...
1904 (b4_parse_assert_if): this.
1905 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1906 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1907
fa819509
AD
19082009-04-14 Akim Demaille <demaille@gostai.com>
1909
16dc0d90 1910 variables: use `parse.trace' instead of `debug'.
fa819509
AD
1911 * src/getargs.c (getargs): Map -t to %define trace.parse.
1912 * src/scan-gram.l (%debug): Map to %define trace.parse.
1913 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1914 names to `_' in macro names.
1915 (b4_debug_if): Replace with...
1916 (b4_parse_trace_if): this.
1917 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1918 * data/yacc.c: Adjust.
1919 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1920 Use @code to label the variable list.
1921 Document the variable parse.trace.
1922 (Tracing): Promote the parse.trace variable.
1923 * TODO: %printer is not documented.
1924
f7dae1ea
AD
19252009-04-14 Akim Demaille <demaille@gostai.com>
1926
1927 doc: minor fixes.
1928 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1929 (Table of Symbols): Remove duplicate entry for %debug.
1930
3535c071
EB
19312009-04-10 Eric Blake <ebb9@byu.net>
1932
1933 submodules: update to latest
1934 * submodules/autoconf: Use latest upstream Autoconf.
1935
cf48f675
EB
19362009-04-06 Eric Blake <ebb9@byu.net>
1937
1938 Work around autoconf 2.63b bug in testsuite.
1939 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1940 autoconf bug related to # in test.
1941
50cca368
JD
19422009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1943
1944 * NEWS (2.5): New section. Describe new -D/--define feature.
1945
3583d96b
AD
19462009-04-06 Akim Demaille <demaille@gostai.com>
1947
1948 Regen.
1949 * src/parse-gram.h, src/parse-gram.c: Regen.
1950
00f5d575
AD
19512009-04-06 Akim Demaille <demaille@gostai.com>
1952
1953 rename muscle_tab.* as muscle-tab.* for consistency.
1954 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
1955 * src/muscle-tab.h, src/muscle-tab.c: these.
1956 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
1957 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
1958
76bf5102
AD
19592009-04-06 Akim Demaille <demaille@gostai.com>
1960
1961 Makefile: introduce $(BISON).
1962 * src/local.mk (BISON): New.
1963 (YACC): Use it.
1964
bc0f5737
AD
19652009-04-06 Akim Demaille <demaille@gostai.com>
1966
1967 parser: handle %locations as %define locations.
1968 * src/getargs.h, src/getargs.c (locations_flag): Remove.
1969 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
1970 to set "locations" to true.
1971 * src/output.c (prepare): Don't output "locations".
1972 * src/scan-gram.l (%locations): Handle it as a %<flag>.
1973 * src/parse-gram.y: It's no longer a token.
1974 Don't handle it.
1975 * data/bison.m4 (b4_locations_if): Define it with
1976 b4_percent_define_if_define.
1977 * data/c.m4, data/glr.cc: Adjust.
1978
697c912f
AD
19792009-04-06 Akim Demaille <demaille@gostai.com>
1980
1981 Regen.
1982 * src/parse-gram.c: Regen.
1983
4920ae8b
AD
19842009-04-06 Akim Demaille <demaille@gostai.com>
1985
1986 muscle: factor the handling of obsolete of obsolete directives.
1987 Suggested by Joel E. Denny.
50cca368 1988
4920ae8b
AD
1989 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
1990 New, extracted from...
1991 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1992 Remove it.
1993 (prologue_declaration: "%<flag>"): Use
1994 muscle_percent_define_ensure.
1995 (%error-verbose, %pure-parser): No longer tokens.
1996 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1997
1d5b3c08
JD
19982009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1999
2000 Fix options documentation.
2001 * build-aux/cross-options.pl: As in --help output, write optional
2002 arguments as [=ARG] not =[ARG].
2003 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2004
62c99cf4
JD
20052009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2006
2007 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2008 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2009 requirements for a correct m4 are stricter.
2010 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2011 * configure.ac: Update to use AC_PROG_GNU_M4.
2012 Reported by Eric Blake.
2013
1c93f35b
JD
20142009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2015
2016 Help with updating web manual.
2017 * HACKING: Incorporate instructions from gnulib/doc/README.
2018 * bootstrap.conf (gnulib_modules): Add gendocs.
2019
86cfae0a
AD
20202009-04-03 Akim Demaille <demaille@gostai.com>
2021
2022 Regen.
2023 * src/parse-gram.h, src/parse-gram.c: Regen.
2024
ba061fa6
AD
20252009-04-03 Akim Demaille <demaille@gostai.com>
2026
2027 Factor %FLAG at scan level.
2028 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2029 definitions and associated rules, replaced by....
2030 (PERCENT_FLAG): this new token type, and rule.
2031 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2032 Use it for %debug and %error-verbose.
2033
b19ebeb3
AD
20342009-04-03 Akim Demaille <demaille@gostai.com>
2035
2036 Regen.
2037 * src/parse-gram.h, src/parse-gram.c: Regen.
2038
001a16a9
AD
20392009-04-03 Akim Demaille <demaille@gostai.com>
2040
2041 Treat %debug as %define debug.
2042 * data/bison.m4 (b4_debug_if): New.
2043 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2044 * data/lalr1.java: Use it instead of b4_debug_flag.
2045 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2046 * src/output.c (prepare): Don't output it.
2047 * src/parse-gram.y: Treat %debug as %define debug.
2048
20492009-04-03 Akim Demaille <demaille@gostai.com>
2050
2051 Treat %error-verbose as %define error_verbose.
2052 This allows to pass -Derror_verbose on the command line. Better
2053 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2054 ERROR_VERBOSE being defined as false or true.
2055 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2056 on b4_percent_define_ifdef, for does not check the defined value,
2057 but only whether the symbol is defined, rely on
2058 b4_percent_define_flag_if, so that a value of "false" is processed
2059 as a false.
2060 If not defined, define the flag to "false".
2061 (b4_error_verbose_if): New.
2062 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2063 b4_error_verbose_flag.
2064 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2065 * src/output.c (prepare): Don't output it.
2066 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2067
92822aff
JD
20682009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2069
2070 Fix strange %define locations for default values.
2071 Reported by Akim Demaille at
2072 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2073 and discussed again starting at
2074 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2075 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2076 because location information is bogus.
2077 Use angle brackets to delimit fake file name because square brackets
2078 look like underexpanded m4. Choose a better fake file name.
2079 Use negative line numbers.
2080 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2081 * src/location.c (location_print): If line for a boundary is negative,
2082 only print that boundary's file name.
2083 * src/location.h: Document that.
2084 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2085 defaults): Update output.
2086
e021191b
JD
20872009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2088
2089 Pacify ./configure --enable-gcc-warnings.
2090 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2091 in lib won't compile with it.
2092 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2093
78f65418
AD
20942009-03-31 Akim Demaille <demaille@gostai.com>
2095
2096 bootstrap: --help to stdout.
2097 * bootstrap (usage): Don't send --help to stderr.
2098 Use a here doc instead of a long string.
2099
f7e241f4
AD
21002009-03-31 Akim Demaille <demaille@gostai.com>
2101
2102 bootstrap: README-hacking no longer exists
2103 * bootstrap (checkout_only_file): Set to HACKING.
2104
31d3e510
AD
21052009-03-26 Akim Demaille <demaille@gostai.com>
2106
2107 doc: merge HACKING and README-hacking.
2108 Two files is confusing.
2109 Reported by Alexandre Duret-Lutz.
1f9d8248 2110
31d3e510
AD
2111 * README-hacking: Merge into...
2112 * HACKING (Working from the repository): here.
2113
81535bfa
AD
21142009-03-26 Akim Demaille <demaille@gostai.com>
2115
2116 doc: update README-hacking.
2117 * README-hacking: We now use git and git submodules.
2118 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2119
56f772e9
AD
21202009-03-26 Akim Demaille <demaille@gostai.com>
2121
2122 lalr1.cc: avoid GCC 4.3 warnings.
2123 GCC 4.3 now warns about "a || b && c" and asks for explicit
2124 parentheses.
2125 Reported by Alexandre Duret-Lutz.
2126 * data/location.cc: Update copyright years.
2127 (Position::operator==): Use parens to make precedence explicit.
2128 Compare lines and columns first, as they are more likely to be
2129 different, and they are faster to compare.
2130
11c073b7
AD
21312009-03-26 Akim Demaille <demaille@gostai.com>
2132
2133 gnulib: update.
2134 * gnulib: Update to latest.
2135 * src/local.mk (AM_CFLAGS): Move to...
2136 * Makefile.am: here.
2137 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2138 AM_CFLAGS.
2139
91be6b28
AD
21402009-03-02 Akim Demaille <demaille@gostai.com>
2141
2142 Comment changes.
2143
cbf25ce7
AD
21442009-03-02 Akim Demaille <demaille@gostai.com>
2145
2146 Share b4_yytranslate_define.
2147 * data/lalr1.cc (b4_yytranslate_define): Move to...
2148 * data/c++.m4: here.
2149
882f02ed
AD
21502009-03-02 Akim Demaille <demaille@gostai.com>
2151
2152 Use locations in the variant example.
1f9d8248
AD
2153 Yes, this obfuscates the point of this example, variants only.
2154 But glr.cc cannot work (yet?) without locations. This change
2155 makes it easier to use this example with glr.cc.
11c073b7 2156
882f02ed
AD
2157 * examples/variant.yy (assert): %define it.
2158 (locations): Request them.
2159 (yylex): Bind the location to the stage.
2160
0623bacc
AD
21612009-03-02 Akim Demaille <demaille@gostai.com>
2162
2163 Dub make_TOKEN as a public type interface.
2164 * data/c++.m4 (b4_symbol_constructor_declare)
2165 (b4_symbol_constructor_define): New empty stubs.
2166 (b4_public_types_declare, b4_public_types_define): Use them.
2167 * data/lalr1.cc (b4_symbol_constructor_declare)
2168 (b4_symbol_constructor_declare_)
2169 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2170 Move to...
2171 * data/variant.hh: here.
2172 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2173 needed.
2174 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2175 b4_symbol_constructor_declare, as it is now done by
2176 b4_public_types_define and b4_public_types_declare.
2177
5f5a90df
AD
21782009-03-02 Akim Demaille <demaille@gostai.com>
2179
2180 Coding style changes.
2181 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2182 (b4_symbol_constructor_declarations)
2183 (b4_symbol_constructor_definition_)
2184 (b4_symbol_constructor_definitions)
2185 (b4_yytranslate_definition): Rename as...
2186 (b4_symbol_constructor_declare_)
2187 (b4_symbol_constructor_declare)
2188 (b4_symbol_constructor_define_)
2189 (b4_symbol_constructor_define)
2190 (b4_yytranslate_define): these.
2191 * data/variant.hh (b4_variant_definition): Rename as...
2192 (b4_variant_define): this.
2193
b47b6ff7
AD
21942009-03-02 Akim Demaille <demaille@gostai.com>
2195
2196 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2197 * data/bison.m4 (b4_percent_define_if_define): New.
2198 * data/c++.m4 (b4_variant_if): Move to...
2199 * data/bison.m4: Here, using b4_percent_define_if_define.
2200 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2201 * data/bison.m4: Here, using b4_percent_define_if_define.
2202
1d6b689b
AD
22032009-03-02 Akim Demaille <demaille@gostai.com>
2204
2205 Dub symbol_type_base as a public type.
2206 * data/c++.m4 (b4_public_types_declare): Now define
2207 symbol_type_base and symbol_type.
2208 (b4_public_types_define): New.
2209 In both cases, the definitions are taken verbatim from lalr1.cc.
2210 * data/lalr1.cc: Adjust.
2211
4f84717d
AD
22122009-03-02 Akim Demaille <demaille@gostai.com>
2213
2214 b4_public_types_declare.
2215 * data/c++.m4 (b4_public_types_declare): New.
2216 * data/glr.cc, data/lalr1.cc: Use it.
2217
b9e4eb5b
AD
22182009-03-02 Akim Demaille <demaille@gostai.com>
2219
2220 b4_semantic_type_declare.
2221 * data/c++.m4 (b4_semantic_type_declare): New.
2222 Factors and generalizes what was in glr.cc and lalr1.cc.
2223 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2224 variants.
2225 * data/lalr1.cc, data/glr.cc: Use it.
2226
6a6e7f0c
AD
22272009-02-26 Akim Demaille <demaille@gostai.com>
2228
2229 Upgrade gnulib.
2230 * gnulib: Upgrade from master.
2231 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2232 Regen.
2233
e9e61b00
AD
22342009-02-25 Akim Demaille <demaille@gostai.com>
2235
2236 Remove useless arguments.
2237 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2238 relevant.
2239
3eead995
AD
22402009-02-25 Akim Demaille <demaille@gostai.com>
2241
2242 Comment changes.
2243 * data/lalr1.cc: here.
2244
87f28efe
AD
22452009-02-25 Akim Demaille <demaille@gostai.com>
2246
2247 Fix glr.cc's debug level handling.
2248 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2249 glr.c which is used.
2250 (debug_level, set_debug_level): Adjust.
2251
9be2a009
AD
22522009-02-25 Akim Demaille <demaille@gostai.com>
2253
2254 Copyright years.
2255 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2256
07a6e87d
AD
22572009-02-25 Akim Demaille <demaille@gostai.com>
2258
2259 Style changes.
2260 * etc/bench.pl.in (generate_grammar_list): Consitently use
2261 location_type, not yy::location.
2262
33c78bd2
AD
22632009-02-25 Akim Demaille <demaille@gostai.com>
2264
2265 Comment change.
2266 * data/lalr1.cc: here.
2267
49572920
AD
22682009-02-19 Akim Demaille <demaille@gostai.com>
2269
2270 Make yyparser::error public.
2271 * data/lalr1.cc: here.
2272 There is no good reason to keep it private (and it is convenient
2273 to use it from the scanner for instance). It is already public in
2274 glr.cc.
2275
88654b47
AD
22762009-02-19 Akim Demaille <demaille@gostai.com>
2277
2278 Comment changes.
2279 * data/glr.cc: here.
2280
4524c55b
AD
22812009-02-19 Akim Demaille <demaille@gostai.com>
2282
2283 Remove trailing blanks.
6a6e7f0c
AD
2284 The epilogue has its own ending \n, no need to add another.
2285
4524c55b
AD
2286 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2287 epilogue.
2288 * data/glr.cc: dnl when extending the epilogue.
2289 Remove stray "private:".
2290
6ceccee8
AD
22912009-02-19 Akim Demaille <demaille@gostai.com>
2292
2293 Use b4_c_modern.
2294 * data/c.m4 (b4_c_function_decl): Here.
2295
9c6a8966
AD
22962009-02-19 Akim Demaille <demaille@gostai.com>
2297
2298 Comment changes.
2299 * data/lalr1.cc: here.
2300
507aa0e2
AD
23012009-02-19 Akim Demaille <demaille@gostai.com>
2302
2303 Extract variant.hh
2304 * data/variant.hh: New, extracted from...
2305 * data/lalr1.cc: here.
2306 Adjust.
2307 * data/local.mk: Adjust.
2308
51bacae6
AD
23092009-02-19 Akim Demaille <demaille@gostai.com>
2310
2311 Extract stack.hh from lalr1.cc.
2312 * data/stack.hh: New.
2313 * data/lalr1.cc: Extract from here.
2314 * data/local.mk: Adjust.
2315
06c3084f
JD
23162009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2317
2318 Add reminder about uploading public key to keys.gnupg.net.
2319 * HACKING (Release Procedure): Here.
2320
0ea583d2
AD
23212009-01-28 Akim Demaille <demaille@gostai.com>
2322
2323 * NEWS: Update information about 2.4.1 and 2.4.2.
2324
402b123d
AD
23252008-11-04 Akim Demaille <demaille@gostai.com>
2326
2327 Reformat NEWS.
2328 * NEWS: Use more outline-mode markup.
2329 Suggested by Jim Meyering.
2330
74553c98
AD
23312009-01-08 Akim Demaille <demaille@gostai.com>
2332
2333 Fix grep portability issues.
2334 Grep on Solaris does not support -q.
2335 Reported by Summum Bonum.
2336
2337 * NEWS: Add a stub for 2.4.2.
2338 * THANKS: Add Summum Bonum.
2339 * tests/atlocal.in (EGREP): New.
2340 (CC, CXX, XSLTPROC): Make it possible to override them via
2341 envvars.
2342 * tests/java.at: Use $EGREP instead of egrep.
2343 Use AT_CHECK's ignore instead of grep's -q.
2344
84eedf86
AD
23452008-12-11 Akim Demaille <demaille@gostai.com>
2346
2347 Pass the token type to yysyntax_error.
2348 * data/yacc.c (yysyntax_error): Take the transated token instead
2349 of the raw number.
2350 Adjust callers.
2351 * TODO: Update.
2352
5860cc8c
AD
23532008-12-11 Akim Demaille <demaille@gostai.com>
2354
2355 Formatting changes.
2356 * data/glr.c: Formatting changes.
2357
2b008529
AD
23582008-12-11 Akim Demaille <demaille@gostai.com>
2359
2360 Propagate i18n changes into glr.c.
2361 * TODO: Update.
2362 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2363 building the error message format dynamically.
2364 * data/lalr1.java: Formatting changes.
2365
2cd1af95
AD
23662008-12-11 Akim Demaille <demaille@gostai.com>
2367
2368 Use testsuite -C.
2369 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2370 Solves problems when top_srcdir is an absolute path.
2371 Suggested by Eric Blake.
2372 * configure.ac: Require Autoconf 2.62.
2373
eeb29422
AD
23742008-12-11 Akim Demaille <demaille@gostai.com>
2375
2376 Simplify the i18n of the error messages.
2377 * data/lalr1.cc: Comment changes.
2378 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2379 lalr1.cc instead of building dynamically the format string.
2380
6617622c
AD
23812008-12-08 Akim Demaille <demaille@gostai.com>
2382
2383 Fix portability issue in the test suite.
2384 * tests/local.at (AT_MATCHES_CHECK): New.
2385 Based on Perl instead of Sed. Sed has too many portability
2386 pitfalls, not ever Sed is GNU Sed.
2387 * tests/actions.at (Fix user actions without a trailing semicolon):
2388 Use it.
2389
2ca1136c
AD
23902008-12-08 Akim Demaille <demaille@gostai.com>
2391
2392 Update data/README.
2393 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2394
6c63b895
AD
23952008-12-08 Akim Demaille <demaille@gostai.com>
2396
2397 Install autoconf as a submodule to get m4sugar.
2398 * .gitmodules: Add submodules/autoconf.
2399 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2400 submodules/autoconf.
2401
417e31d2
AD
24022008-12-08 Akim Demaille <demaille@gostai.com>
2403
2404 Test token.prefix in all the skeletons.
2405 * data/java.m4 (b4_token_enum): Use the token.prefix.
2406 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2407 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2408 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2409 * tests/java.at: Comment changes.
2410 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2411 (Java parser class and package names): Add token.prefix check.
2412
97abf544
AD
24132008-12-08 Akim Demaille <demaille@gostai.com>
2414
2415 Fix regeneration of atconfig.
2416 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2417 remove it: now that there is no tests/Makefile.am, the top-level
2418 Makefile properly updates atconfig when needed.
2419
e8cd1ad6
DJ
24202008-12-07 Di-an Jan <dianj@freeshell.org>
2421
2422 Implement the FIXME that ends an user action with a semicolon
2423 if it seems necessary.
2424 * src/scan-code.l (flex rules section): Flag cpp directive from
2425 any `#' to the first unescaped end-of-line. Semicolon is not
2426 needed after `;', `{', '}', or cpp directives and is needed after
2427 any other token (whitespaces and comments have no effect).
2428 * tests/actions.at (Fix user actions without a trailing semicolon):
2429 New test.
2430 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2431 to make user actions complete statements.
2432 Adjust column numbers in error messages.
2433 * tests/regression.at (Fix user actions without a trailing semicolon):
2434 Remove. Covered by new test.
2435
ce9447fc
AD
24362008-12-07 Akim Demaille <demaille@gostai.com>
2437
2438 Update gnulib.
2439 * gnulib: Update from master.
2440
d333175f
EB
24412008-12-05 Eric Blake <ebb9@byu.net>
2442
2443 Avoid compiler warning.
2444 * src/output.c (muscle_insert_item_number_table): Delete unused
2445 function.
2446
215b40ac
EB
24472008-12-02 Eric Blake <ebb9@byu.net>
2448
2449 Build testsuite with newer autoconf.
2450 * tests/output.at (m4_expand): Don't override in newer autoconf,
2451 where the underlying implementation changed.
2452 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2453 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2454 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2455 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2456 since some of them contain unbalanced ')'.
2457
3bb21113
AD
24582008-12-01 Akim Demaille <demaille@gostai.com>
2459
2460 Use b4_symbol for printers and destructors everywhere.
2461 * data/bison.m4 (b4_symbol_action_location): New.
2462 * data/c.m4 (b4_symbol_actions): Remove.
2463 Adjust all callers to use by b4_symbol_foreach and the corresponding
2464 b4_symbol_printer/destructor macro.
2465 * data/glr.cc: Adjust.
2466 * data/lalr1.java: Adjust the %destructor sanity check.
2467 * src/output.c (symbol_code_props_output): Remove, we no longer
2468 need the b4_symbol_printers/destructors tables.
2469
fb7c5b1f
AD
24702008-12-01 Akim Demaille <demaille@gostai.com>
2471
2472 Use b4_symbol_case_.
2473 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2474 b4_symbol_case_.
2475
cf6fb222
AD
24762008-12-01 Akim Demaille <demaille@gostai.com>
2477
2478 Move b4_symbol based macro to bison.m4.
2479 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2480 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2481 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2482 (b4_type_foreach): Move to...
2483 * data/bison.m4: Here.
2484 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2485 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 2486
e3c52a63
AD
24872008-12-01 Akim Demaille <demaille@gostai.com>
2488
2489 b4_symbol/type_foreach.
2490 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2491 Use them.
2492
2bde9113
AD
24932008-12-01 Akim Demaille <demaille@gostai.com>
2494
2495 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
2496 Instead of defining complex list of tuples to define various
2497 properties of the symbols, we now prefer to define symbols as
2498 "structs" in m4: using the symbol key (its number), and the
2499 property name, b4_symbol gives it value. Use this to handle
2500 destructors and printers.
2501
2bde9113
AD
2502 * src/output.c (CODE_PROP): New.
2503 (prepare_symbol_definitions): Use it to define the printer and
2504 destructor related attributes of the symbols.
2505 * data/lalr1.cc (b4_symbol_actions): Rename as...
2506 (b4_symbol_action): this.
2507 Use b4_symbol instead of 6 arguments.
2508 (b4_symbol_printer, b4_symbol_destructor): New.
2509 Use them instead of b4_symbol_actions.
2510
44494bf6
AD
25112008-12-01 Akim Demaille <demaille@gostai.com>
2512
2513 Avoid capturing variables too easily.
2514 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2515 v__ and p__ instead of v and p.
2516
fad814bd
AD
25172008-12-01 Akim Demaille <demaille@gostai.com>
2518
2519 Remove spurious empty line before syncline.
2520 * data/bison.m4 (b4_syncline): Don't output an empty line before
2521 the output.
2522
feda5527
AD
25232008-11-26 Akim Demaille <demaille@gostai.com>
2524
2525 Convert lib/Makefile.am into lib/local.mk.
2526 The real problem is rather gnulib.mk, which itself is extracted
2527 from a Makefile.am that gnulib expects to the "recursive". The
2528 tool prefix-gnulib-mk converts such a gnulib.mk to be
2529 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2530
2531 * etc/prefix-gnulib-mk: New.
2532 * bootstrap (slurp): Use it to convert further gnulib.mk.
2533 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2534 are deeper.
2535 * lib/Makefile.am: Rename as...
2536 * lib/local.mk: this.
2537 Adjust to be prefixed.
2538 * Makefile.am, configure.ac: Adjust.
2539 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2540
56ddee7f
AD
25412008-11-26 Akim Demaille <demaille@gostai.com>
2542
2543 s/_FLAGS/FLAGS/.
2544 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2545 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2546 Reported by Eric Blake.
2547
728e89a0
AD
25482008-11-26 Akim Demaille <demaille@gostai.com>
2549
2550 Use b4_parser_tables_define in glr.cc.
2551 * data/glr.c: Use b4_parser_tables_define instead of defining the
2552 (deterministic integral) tables by hand.
2553
2c1bf9bd
AD
25542008-11-26 Akim Demaille <demaille@gostai.com>
2555
2556 Use b4_parser_tables_define in Java.
2557 * data/java.m4 (b4_typed_parser_table): Rename as...
2558 (b4_typed_parser_table_define): this, for consistency.
2559 Accept a comment as $4.
2560 Move $2 into yy*_.
2561 (b4_integral_parser_table): Rename as...
2562 (b4_integral_parser_table_define): this.
2563 * data/lalr1.java: Adjust all uses.
2564 Use b4_parser_tables_define instead of generation by hand.
2565
ba206cf4
AD
25662008-11-26 Akim Demaille <demaille@gostai.com>
2567
2568 Prepare the convergence bw C style and Java table generation.
2569 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2570 (b4_tables_define): Rename as...
2571 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2572 (b4_parser_tables_define): these.
2573 * data/c.m4 (b4_table_define): Rename as...
2574 (b4_integral_parser_table_define): this.
2575 * data/lalr1.cc: Adjust.
2576 (b4_table_define, b4_table_declare): Rename as...
2577 (b4_integral_parser_table_define)
2578 (b4_integral_parser_table_declare): these.
2579 (yyrline_): Move the comment where it is actually used.
2580 * data/yacc.c: Adjust.
2581 (yyrline): Use b4_integral_parser_table_define.
2582
d12f8e49
AD
25832008-11-26 Akim Demaille <demaille@gostai.com>
2584
2585 Regen.
2586 * src/parse-gram.h, src/parse-gram.c: Regen.
2587
0991e29b
AD
25882008-11-26 Akim Demaille <demaille@gostai.com>
2589
2590 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2591 * data/lalr1.cc (b4_tables_map): Move to...
2592 * data/bison.m4: here.
2593 Update the comment for yytable during the flight.
2594 (b4_tables_declare, b4_tables_define): New.
2595 * data/lalr1.cc: Use them.
2596 * data/c.m4 (b4_table_define): New.
2597 * data/yacc.c: Use b4_tables_define instead of output the tables
2598 by hand.
2599 * tests/regression.at (Web2c Actions): Adjust the expected output,
2600 the order of the tables changed.
2601
3d3bc1fe
AD
26022008-11-26 Akim Demaille <demaille@gostai.com>
2603
2604 Get rid of (yy)rhs and (yy)prhs.
2605 These tables are no longer needed in the parsers, and they don't seem to
2606 be useful. They are not documented either.
feda5527 2607
3d3bc1fe
AD
2608 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2609 Adjust the computation of (yy)r2.
2610
08c81469
AD
26112008-11-26 Akim Demaille <demaille@gostai.com>
2612
2613 Rule length is unsigned.
2614 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2615
932b0c96
AD
26162008-11-26 Akim Demaille <demaille@gostai.com>
2617
2618 Get rid of lalr1-split.cc.
2619 It was no longer maintainer.
feda5527 2620
932b0c96
AD
2621 * data/lalr1-split.cc: Remove.
2622 * etc/bench.pl.in (bench_fusion_parser): Remove.
2623 Adjust.
2624
8452c667
AD
26252008-11-26 Akim Demaille <demaille@gostai.com>
2626
2627 Use yy* consistently.
2628 * data/glr.c: Now that yyrhs no longer exists as a global
2629 variable, rename local "rhs" variables into "yyrhs" for
2630 consistency.
2631
783aa653
AD
26322008-11-25 Akim Demaille <demaille@gostai.com>
2633
2634 Get rid of yyrhs and yyprhs in glr.c.
2635 * data/glr.c (yyrhs, yyprhs): Remove.
2636 Instead, use the state stack and yystos.
2637
6130b755
AD
26382008-11-25 Akim Demaille <demaille@gostai.com>
2639
2640 Flag glr tests.
2641 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2642 as an Autotest keyword.
2643
95a7b1c9
AD
26442008-11-25 Akim Demaille <demaille@gostai.com>
2645
2646 Prefer TESTSUITE_FLAGS.
2647 TESTSUITEFLAGS is barely readable.
feda5527 2648
95a7b1c9
AD
2649 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2650 for backward compatibility.
2651 Use the former instead of the latter.
2652
b4f18401
AD
26532008-11-25 Akim Demaille <demaille@gostai.com>
2654
2655 Get rid of yyrhs and yyprhs in larl1.java.
2656 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2657 (yy_reduce_print): Rather, use yystos_ and the state stack.
2658
c265fd6b
AD
26592008-11-25 Akim Demaille <demaille@gostai.com>
2660
2661 Formatting changes.
2662
68dbdee8
AD
26632008-11-25 Akim Demaille <demaille@gostai.com>
2664
2665 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
2666 They were used to get the symbol types, given a rule number, when
2667 displaying the top of the stack before a reduction. But the
2668 symbol type is available from the state stack. This has two be
2669 benefits: two tables less in the parser (making it smaller), and a
2670 more consistent use of the three stacks which will help to fuse
2671 them.
feda5527 2672
68dbdee8
AD
2673 * data/yacc.c (yyprhs, yyrhs): Remove.
2674 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2675 (yy_reduce_print): Take yyssp as argument.
2676 Use it, together with yystos, to get the symbol type.
2677 * tests/regression.at (Web2c Report): Remove these tables from the
2678 expected output.
2679
6ab1adbe
AD
26802008-11-25 Akim Demaille <demaille@gostai.com>
2681
2682 b4_tables_map.
2683 The point is to factor the generation of the tables across skeletons.
2684 This is language dependant.
feda5527 2685
6ab1adbe
AD
2686 * data/c.m4 (b4_comment_): New.
2687 Should be usable to define how to generate tables independently of
2688 the language.
2689 (b4_c_comment): New.
2690 (b4_comment): Bounce to b4_c_comment.
2691 Now support $2 = [PREFIX] for indentation.
2692 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2693 there is no comment.
2694 Indent it properly when there is one.
2695 Output the ending semicolon.
2696 (b4_table_define): Space changes.
2697 Output the ending semicolon.
2698 (b4_tables_map): New.
2699 Use it twice instead of declaring and defining the (integral)
2700 tables by hand.
2701
0fddb3d5
AD
27022008-11-25 Akim Demaille <demaille@gostai.com>
2703
2704 b4_table_declare.
2705 * data/lalr1.cc (b4_table_declare): New.
2706 Use it to declare the tables defined with b4_table_define.
2707 (b4_table_define): Declare a third arg to match b4_table_declare
2708 signature.
2709 Move all the comments around invocations of b4_table_define into
2710 the invocations itselves.
2711 Move things around to have the order for declarations and
2712 definitions.
2713
c4ddc0fb
AD
27142008-11-25 Akim Demaille <demaille@gostai.com>
2715
2716 Formatting changes.
2717 * data/lalr1.java: here.
2718
e0c653e7
AD
27192008-11-25 Akim Demaille <demaille@gostai.com>
2720
2721 b4_args is more general than only C++.
2722 * data/lalr1.cc (b4_args, _b4_args): Move to...
2723 * data/bison.m4: here.
2724
4182a0a1
DJ
27252008-11-21 Di-an Jan <dianj@freeshell.org>
2726
2727 Implement no-XXX arguments for --warnings, --report, --trace.
2728 * src/getargs.c (flags_argmatch): Handles no-XXX.
2729 Fix typo in doxygen comment.
2730
01466c3e
AD
27312008-11-21 Akim Demaille <demaille@gostai.com>
2732
2733 Display the changes in cross-options.texi.
2734 * build-aux/cross-options.pl ($sep): New, to separate items.
2735 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2736 changes.
2737
a7c09cba
DJ
27382008-11-20 Di-an Jan <dianj@freeshell.org>
2739
2740 Improves options in the manual.
2741 * doc/bison.texinfo (-g, -x): Add space before argument.
2742 (Option Cross Key): Implement FIXME: listing directives also.
2743 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2744 (Short Option): Special case -d. Put arguments inside @option.
feda5527 2745 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
2746 src/scan-gram.l (actual name passed as the first argument)
2747 with special case for %define.
2748 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2749 to build-aux/cross-options.pl.
2750 * src/getargs.c (usage): Document limitations of cross-options.pl.
2751 * src/scan-gram.l: Likewise.
2752
6c88b51e
JD
27532008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2754
2755 Fix unexpanded macros in GLR defines file.
2756 Reported by Csaba Raduly at
2757 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2758 * THANKS (Csaba Raduly): Add.
2759 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2760 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2761 lexer in a separate module that includes the defines file.
2762 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2763 source.
2764 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2765 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2766 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2767 (AT_DATA_SOURCE_PROLOGUE): New.
2768 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2769 (AT_DATA_SOURCE): New.
2770 (AT_FULL_COMPILE): Extend to support an additional source file.
2771
1e034807
AD
27722008-11-18 Akim Demaille <demaille@gostai.com>
2773
2774 More TODO.
2775 * TODO: More short term issues.
2776
e3dda35c
AD
27772008-11-18 Akim Demaille <demaille@gostai.com>
2778
2779 Regen.
2780 * src/parse-gram.h, src/parse-gram.c: Regen.
2781
bd187d7b
AD
27822008-11-18 Akim Demaille <demaille@gostai.com>
2783
2784 Use b4_subtract where possible.
2785 * data/lalr1.cc (b4_subtract): Move to...
2786 * data/bison.m4: here.
2787 * data/glr.c (b4_rhs_data): Use it.
2788 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2789
6085ab0d
AD
27902008-11-18 Akim Demaille <demaille@gostai.com>
2791
2792 Remove incorrect mode specification.
2793 * data/glr.cc: Don't pretend it's C code.
2794
9ce405ce
JD
27952008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2796
2797 Simplify last patch slightly.
2798 * src/getargs.c (getargs): Here.
2799
a8beef7e
JD
28002008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2801
2802 Fix last warning from --enable-gcc-warnings.
2803 * src/getargs.c (getargs): Don't assign const address to non-const
2804 pointer.
2805
d50eea6d
JD
28062008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2807
2808 Don't let maintainer-*-check targets force a version update.
2809 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2810 handled.
2811
f5f419de
DJ
28122008-11-17 Di-an Jan <dianj@freeshell.org>
2813
2814 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2815 Align menus. Adjust word wrapping. Use node names for menu names.
2816 (Examples): Don't abbreviate node names.
2817 (LocalWords): Remove abbreviations.
2818 (Copying): Make description a sentence.
d50eea6d 2819 (Java Action Features): Remove period to match the rest of menu.
f5f419de 2820
d73e55e0
DJ
28212008-11-17 Di-an Jan <dianj@freeshell.org>
2822
2823 Handles several --enable-gcc-warnings.
2824 * src/getargs.c (command_line_location): Set parameters to void.
2825 * src/output.c (symbol_type_name_cmp): Make static.
2826 (symbols_by_type_name): Set parameters to void.
2827 (symbol_definitions_output): Remove unused parameter. Rename as...
2828 (prepare_symbol_definitions): this.
2829 (muscles_output): Move symbol_definitions_output to...
2830 (output): here as prepare_symbol_definitions.
2831 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 2832 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 2833
68c989de
DJ
28342008-11-17 Di-an Jan <dianj@freeshell.org>
2835
2836 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2837 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2838
23ce6f4c
AD
28392008-11-16 Akim Demaille <demaille@gostai.com>
2840
2841 Add missing $(EXEEXT).
2842 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2843 "src/bison$(EXEEXT)".
2844 Reported by Di-an Jan.
2845
dd704c35
AD
28462008-11-15 Akim Demaille <demaille@gostai.com>
2847
2848 * TODO: Update.
2849
dab244d5
AD
28502008-11-15 Akim Demaille <demaille@gostai.com>
2851
2852 Formatting changes.
2853 * tests/input.at: here.
2854
4b4da9fb
AD
28552008-11-15 Akim Demaille <demaille@gostai.com>
2856
2857 Remove duplicate header inclusion.
2858 * src/LR0.c: here.
2859
4ea3f53d
AD
28602008-11-15 Akim Demaille <demaille@gostai.com>
2861
2862 * src/parse-gram.h, src/parse-gram.c: Regen.
2863
cb823b6f
AD
28642008-11-15 Akim Demaille <demaille@gostai.com>
2865
2866 Support parametric types.
b06df3c2
AD
2867
2868 There are two issues to handle: first scanning nested angle
2869 bracket pairs to support types such as std::pair< std::string,
2870 std::list<std::string> > >.
2871
2872 Another issue is to address idiosyncracies of C++: do not glue two
2873 closing angle brackets together (otherwise it's operator>>), and
2874 avoid sticking blindly a TYPE to the opening <, as it can result
2875 in '<:' which is a digraph for '['.
2876
cb823b6f
AD
2877 * src/scan-gram.l (brace_level): Rename as...
2878 (nesting): this.
2879 (SC_TAG): New.
2880 Implement support for complex tags.
b06df3c2 2881 (tag): Accept
cb823b6f
AD
2882 , but not <.
2883 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2884 (b4_symbol_variant): Leave space around types as parameters.
2885 * examples/variant.yy: Use nested template types and leading ::.
2886 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2887 Rename as...
2888 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2889 * tests/c++.at: Test parametric types.
2890
7b6e6753
AD
28912008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2892
2893 Test token.prefix.
2894 This is not sufficient, but we test at least that the make_SYMBOL
2895 interface is not affected by token.prefix. A more general test
2896 will be implemented when the support of token.prefix is generalized
2897 to more skeletons.
b06df3c2 2898
7b6e6753
AD
2899 * tests/c++.at: One more variant test, using token.prefix.
2900
dddec537
AD
29012008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2902
2903 Test the make_TOKEN interface.
2904 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2905 Factor the common code in yylex.
2906 Use it to test "%define lex_symbol".
2907
7d3e21ba
AD
29082008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2909
2910 Formatting change.
2911
4fc55348
AD
29122008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2913
2914 Simplify code for variants bench marks.
2915 * etc/bench.pl.in (&generate_grammar_list): Define and use
2916 location_type.
2917 Factor the common code in yylex.
2918
070e6509
AD
29192008-11-15 Akim Demaille <demaille@gostai.com>
2920
2921 Better error message.
2922 * bootstrap (find_tool): Fix the error message.
2923
0078681b
AD
29242008-11-15 Akim Demaille <demaille@gostai.com>
2925
2926 Update variant.yy to newest interface.
2927 * examples/variant.yy: Define lex_symbol.
2928 Adjust.
2929
ff084799
AD
29302008-11-15 Akim Demaille <demaille@gostai.com>
2931
2932 Don't use locations in variant.yy.
2933 * examples/variant.yy: Adjust to not using locations.
2934
b0d79ec6
AD
29352008-11-15 Akim Demaille <demaille@gostai.com>
2936
2937 Comment changes.
2938 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2939 comments for the license.
2940
d4977ce3
AD
29412008-11-15 Akim Demaille <demaille@gostai.com>
2942
2943 Remove tests/Makefile.am.
2944 * tests/Makefile.am: Rename as...
2945 * tests/local.mk: this.
2946 * Makefile.am, configure.ac: Adjust.
2947 * Makefile.am (DISTCLEANFILES): Define.
2948 (maintainer-check, maintainer-xml-check, maintainer-push-check):
2949 Remove, we no longer need to bounce to the real targets.
2950
87f1149a
AD
29512008-11-15 Akim Demaille <demaille@gostai.com>
2952
2953 Comment changes.
2954
36415906
AD
29552008-11-15 Akim Demaille <demaille@gostai.com>
2956
2957 djgpp/local.mk.
2958 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
2959 * djgpp/local.mk: this new file.
2960
e2c2f696
AD
29612008-11-15 Akim Demaille <demaille@gostai.com>
2962
2963 Remove doc/Makefile.am.
2964 * doc/Makefile.am: Rename as...
2965 * doc/local.mk: this.
2966 Adjust paths
2967 * Makefile.am, configure.ac: Adjust.
2968 * Makefile.am (MOSTLYCLEANFILES): New.
2969 * src/local.mk: Adjust.
2970
2ead32e6
AD
29712008-11-15 Akim Demaille <demaille@gostai.com>
2972
2973 Move sc_tight_scope into maint.mk.
b06df3c2
AD
2974 It does not work, and I don't know how it was supposed to work: it
2975 seems to be looking for sources in the build tree. I just moved
2976 it at a better place, fixing it is still required.
2977
2ead32e6
AD
2978 * src/local.mk (echo): Remove.
2979 (sc_tight_scope): Move to...
2980 * maint.mk: here.
2981
2df9ec37
AD
29822008-11-15 Akim Demaille <demaille@gostai.com>
2983
2984 Regen.
2985 * src/parse-gram.h, src/parse-gram.h: Regen.
2986
0305d25e
AD
29872008-11-15 Akim Demaille <demaille@gostai.com>
2988
2989 Remove src/Makefile.am.
2990 * src/Makefile.am: Rename as...
2991 * src/local.mk: this.
2992 Prefix all the paths with src/.
2993 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2994 (AM_CPPFLAGS): Find find in builddir/src.
2995 (YACC): Move the flags into...
2996 (AM_YFLAGS): here.
2997 * maint.mk (sc_tight_scope): Disable.
2998 It used to bounce to the version in src/Makefile.am which is now
2999 part of this very Makefile.
3000 * Makefile.am, configure.ac: Adjust.
3001 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3002 include "..." to find files "here": we are no longer in src/, so
3003 qualify the includes with src/.
3004 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3005 prefix.
3006 (.x.1): Adjust to be able to create src/foo from the top level
3007 Makefile, instead of going bounce to src/Makefile the creation of
3008 foo.
3009
5277c0a3
AD
30102008-11-15 Akim Demaille <demaille@gostai.com>
3011
3012 Remove useless variable.
3013 * doc/Makefile.am (srcsrcdir): Remove.
3014
6a5aa0cd
AD
30152008-11-15 Akim Demaille <demaille@gostai.com>
3016
3017 Remove data/Makefile.am.
3018 * data/Makefile.am: Rename as...
3019 * data/local.mk: this.
3020 Adjust paths.
3021 * Makefile.am, configure.ac: Adjust.
3022
7cb794dc
AD
30232008-11-15 Akim Demaille <demaille@gostai.com>
3024
3025 Remove etc/Makefile.am.
3026 * etc/Makefile.am: Rename as...
3027 * etc/local.mk: this.
3028 Adjust.
3029 * Makefile.am, configure.ac: Adjust.
3030
cd409e3b
AD
30312008-11-15 Akim Demaille <demaille@gostai.com>
3032
3033 Remove examples/local.mk.
3034 examples/calc++/Makefile.am might be interesting to keep as is, since
3035 it is an example in itself.
2df9ec37 3036
cd409e3b
AD
3037 * examples/Makefile.am: Rename as...
3038 * examples/local.mk: this.
3039 Adjust.
3040 * Makefile.am, configure.ac: Adjust.
3041
9a1e4214
AD
30422008-11-15 Akim Demaille <demaille@gostai.com>
3043
3044 Remove build-aux/Makefile.am.
3045 Recursive Makefiles are really way too slow, let's get rid of some of
3046 them.
2df9ec37 3047
9a1e4214
AD
3048 * build-aux/Makefile.am: Rename as...
3049 * build-aux/local.mk: this.
3050 Adjust paths.
3051 * Makefile.am, configure.ac: Adjust.
3052
0634493c
AD
30532008-11-15 Akim Demaille <demaille@gostai.com>
3054
3055 Provide convenience constructors for locations and positions.
3056 * data/location.cc (position::position): Accept file, line and
3057 column as arguments with default values.
3058 Always qualify initial line and column literals as unsigned.
3059 (location::location): Provide convenience constructors.
3060
fe1b448a
AD
30612008-11-15 Akim Demaille <demaille@gostai.com>
3062
b06df3c2
AD
3063 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3064 token type.
fe1b448a
AD
3065 Using template buys us nothing, and makes it uselessly complex to
3066 construct a symbol. Besides, it could not be generalized to other
3067 languages, while make_FOO would work in C/Java etc.
2df9ec37 3068
fe1b448a
AD
3069 * data/lalr1.cc (b4_symbol_): New.
3070 (b4_symbol): Use it.
3071 (b4_symbol_constructor_declaration_)
3072 (b4_symbol_constructor_definition_): Instead of generating
3073 specializations of an overloaded template function, just generate
3074 several functions whose names are forged from the token names
3075 without the token.prefix.
3076 (b4_symbol_constructor_declarations): Generate them for all the
3077 symbols, not just by class of symbol type, now that instead of
3078 specializing a function template by the token, we generate a
3079 function named after the token.
3080 (b4_symbol_constructor_specialization_)
3081 (b4_symbol_constructor_specializations): Remove.
3082 * etc/bench.pl.in: Adjust to this new API.
3083
5679f311
AD
30842008-11-13 Akim Demaille <demaille@gostai.com>
3085
3086 %define token.prefix.
b06df3c2
AD
3087 Provide a means to add a prefix to the name of the tokens as
3088 output in the generated files. Because of name clashes, it is
3089 good to have such a prefix such as TOK_ that protects from names
3090 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 3091
5679f311
AD
3092 * data/bison.m4 (token.prefix): Empty by default.
3093 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3094 * data/lalr1.cc (b4_symbol): Ditto.
3095
3204049e
AD
30962008-11-13 Akim Demaille <demaille@gostai.com>
3097
3098 Compute at M4 time some of the subtractions.
90290ce5 3099 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
3100 (b4_rhs_data): Use it.
3101
202598d3
AD
31022008-11-13 Akim Demaille <demaille@gostai.com>
3103
3104 symbol::token.
b06df3c2 3105 This allows the user to get the type of a token returned by yylex.
2df9ec37 3106
202598d3
AD
3107 * data/lalr1.cc (symbol::token): New.
3108 (yytoknum_): Define when %define lex_symbol, independently of
3109 %debug.
3110 (yytoken_number_): Move into...
3111 (symbol::token): here, since that's the only use.
3112 The other one is YYPRINT which was not officially supported
3113 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3114 array under a different name (yytoknum).
3115
fc2476c7
AD
31162008-11-13 Akim Demaille <demaille@gostai.com>
3117
3118 YYERRCODE.
3119 * TODO (YYERRCODE): Mention the case of $undef.
3120
865f1e9f
AD
31212008-11-13 Akim Demaille <demaille@gostai.com>
3122
3123 TODO: YYPRINT.
3124 * TODO (YYPRINT): New.
3125
cb0b136a
AD
31262008-11-13 Akim Demaille <demaille@gostai.com>
3127
3128 Comment changes.
3129 * data/lalr1.cc, data/yacc.c: Fix the description of the
3130 yytranslate and yytoknum tables.
3131
2c086d29
AD
31322008-11-13 Akim Demaille <demaille@gostai.com>
3133
3134 Define make_symbol in the header.
b06df3c2
AD
3135 To reach good performances these functions should be inlined (yet
3136 this is to measure precisely). To this end they must be available
3137 to the caller.
2df9ec37 3138
2c086d29
AD
3139 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3140 location_type with the class name.
3141 Since will now be output in the header, declare "inline".
3142 No longer use b4_symbol_constructor_specializations, but
3143 b4_symbol_constructor_definitions in the header.
3144 Don't call it in the *.cc file.
3145
1c4af381
AD
31462008-11-13 Akim Demaille <demaille@gostai.com>
3147
3148 Define yytranslate in the header for lex_symbol.
3149 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3150 into the header file when using %define lex_symbol.
3151 (yytranslate_): Declare inline.
3152
e51b0a82
AD
31532008-11-13 Akim Demaille <demaille@gostai.com>
3154
b06df3c2
AD
3155 Define the constructors of symbol_type in
3156 b4_symbol_constructor_definitions.
e51b0a82 3157 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
3158 forthcoming patch will move elsewhere. Hence the interest of
3159 putting them together.
2df9ec37 3160
b06df3c2
AD
3161 The stack_symbol_type does not need to be moved, it is used only
3162 by the parser.
2df9ec37 3163
e51b0a82
AD
3164 * data/lalr1.cc: Move symbol_type and symbol_base_type
3165 constructors into...
3166 (b4_symbol_constructor_definitions): here.
3167 Adjust.
3168
78835571
AD
31692008-11-13 Akim Demaille <demaille@gostai.com>
3170
3171 Make it easier to move the definition of yytranslate_.
3172 Forthcoming changes will make it possible to use yytranslate_
3173 from outside the parser implementation file.
2df9ec37 3174
78835571
AD
3175 * data/lalr1.cc (b4_yytranslate_definition): New.
3176 Use it.
3177
c1e6c88c
AD
31782008-11-13 Akim Demaille <demaille@gostai.com>
3179
3180 Remove useless class specification.
3181 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3182 to refer to the class name to use a type defined by the class for
3183 arguments of member functions.
3184
4654b0c0
AD
31852008-11-13 Akim Demaille <demaille@gostai.com>
3186
3187 Finer input type for yytranslate.
3188 This patch is debatable: the tradition expects yylex to return an int
3189 which happens to correspond to token_number (which is an enum). This
3190 allows for instance to return characters (such as '*' etc.). But this
3191 goes against the stronger typing I am trying to have with the new
3192 lex interface which return a symbol_type. So in this case, feed
3193 yytranslate_ with a token_type.
2df9ec37 3194
4654b0c0
AD
3195 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3196 expect a token_type.
3197
dd735e4e
AD
31982008-11-13 Akim Demaille <demaille@gostai.com>
3199
3200 Honor lex-params in %define lex_symbol mode.
3201 * data/lalr1.cc: Use b4_lex_param.
3202
6659366c
AD
32032008-11-13 Akim Demaille <demaille@gostai.com>
3204
3205 Simplify names.
3206 * src/output.c (symbol_definitions_output): Rename symbol
3207 attributes type_name and has_type_name as type and has_type.
3208 * data/lalr1.cc: Adjust uses.
3209
e9805e57
AD
32102008-11-13 Akim Demaille <demaille@gostai.com>
3211
3212 Use b4_type_names for the union type.
b06df3c2
AD
3213 The union used to compute the size of the variant used to iterate
3214 over the type of all the symbols, with a lot of redundancy. Now
3215 iterate over the lists of symbols having the same type-name.
2df9ec37 3216
e9805e57
AD
3217 * data/lalr1.cc (b4_char_sizeof_): New.
3218 (b4_char_sizeof): Use it.
3219 Adjust to be called with a list of numbers instead of a single
3220 number.
3221 Adjust its caller for new-line issues.
3222
aea10ef4
AD
32232008-11-13 Akim Demaille <demaille@gostai.com>
3224
3225 Define the "identifier" of a symbol.
b06df3c2
AD
3226 Symbols may have several string representations, for instance if
3227 they have an alias. What I call its "id" is a string that can be
3228 used as an identifier. May not exist.
2df9ec37 3229
b06df3c2
AD
3230 Currently the symbols which have the "tag_is_id" flag set are
3231 those that don't have an alias. Look harder for the id.
2df9ec37 3232
aea10ef4
AD
3233 * src/output.c (is_identifier): Move to...
3234 * src/symtab.c (is_identifier): here.
3235 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3236 * src/output.c (symbol_definitions_output): Use it to define "id"
3237 and "has_id".
3238 Remove the definition of "tag_is_id".
3239 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3240 "tag_is_id" were used to produce code.
3241 We still use "tag" for documentation.
3242
2ea7730c
AD
32432008-11-11 Akim Demaille <demaille@gostai.com>
3244
3245 Locations are no longer required by lalr1.cc.
3246 * data/lalr1.cc (_b4_args, b4_args): New.
3247 Adjust all uses of locations to make them optional.
3248 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3249 (AT_CHECK_NAMESPACE): Check the use of locations.
3250 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3251 without locations with lalr1.cc.
3252 Test these cases.
3253 * tests/output.at: Check lalr1.cc with and without location
3254 support.
3255 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3256 Don't use locations.
3257
7ca2266a
AD
32582008-11-11 Akim Demaille <demaille@gostai.com>
3259
3260 AT_FULL_COMPILE.
3261 * tests/local.at (AT_FULL_COMPILE): New.
3262 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3263
1a7a65f9
AD
32642008-11-11 Akim Demaille <demaille@gostai.com>
3265
3266 Support parens in calc++.
3267 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3268 * examples/calc++/test (run): Check the expected output.
3269 Adjust callers.
3270 Check parens too.
3271
c944f7f2
AD
32722008-11-11 Akim Demaille <demaille@gostai.com>
3273
3274 Simplify lalr1.cc since %defines is mandatory.
3275 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3276
dada3cd1
AD
32772008-11-11 Akim Demaille <demaille@gostai.com>
3278
3279 TODO: yyfmt.
3280 * TODO (yysyntax_error): New item.
3281
422c18f4
AD
32822008-11-11 Akim Demaille <demaille@gostai.com>
3283
3284 Prefer M4 to CPP.
3285 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3286 YYERROR_VERBOSE.
3287
a0ffc175
AD
32882008-11-11 Akim Demaille <demaille@gostai.com>
3289
3290 Support i18n of the parse error messages.
3291 * TODO (lalr1.cc/I18n): Remove.
3292 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3293 error messages, as done in yacc.c.
3294 Stay within the yy* pseudo namespace.
3295
00a8a083
AD
32962008-11-11 Akim Demaille <demaille@gostai.com>
3297
3298 More TODO.
3299 * TODO (single stack, yysyntax_error): New.
3300
09277875
AD
33012008-11-11 Akim Demaille <demaille@gostai.com>
3302
3303 Make it possible to return a symbol_type from yylex.
3304 * data/lalr1.cc (b4_lex_symbol_if): New.
3305 (parse): When lex_symbol is defined, expected yylex to return the
3306 complete lookahead.
3307 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3308 yylex interface.
3309 (bench_variant_parser): Exercise it.
3310
64c1b92a
AD
33112008-11-11 Akim Demaille <demaille@gostai.com>
3312
3313 Remove useless bench case.
3314 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3315 no longer used.
3316
2722aa42
AD
33172008-11-11 Akim Demaille <demaille@gostai.com>
3318
3319 Improve display of directives.
3320 * etc/bench.pl.in (parse_term): Don't add useless eol.
3321
918eb7c5
AD
33222008-11-11 Akim Demaille <demaille@gostai.com>
3323
3324 Use string_cast in the bench.
3325 * etc/bench.pl.in (generate_grammar_list): Define and use
3326 string_cast.
3327
39be9022
AD
33282008-11-11 Akim Demaille <demaille@gostai.com>
3329
3330 Replace yychar with a Boolean.
3331 * data/lalr1.cc (parse::yychar): Replace by...
3332 (parse::yyempty): this.
3333
a2e3fa77
AD
33342008-11-11 Akim Demaille <demaille@gostai.com>
3335
3336 Factor the tables.
3337 * TODO: New item.
3338
aba12ad1
AD
33392008-11-11 Akim Demaille <demaille@gostai.com>
3340
3341 Let yytranslate handle the eof case.
3342 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3343 Adjust callers.
3344 No longer expect yychar to be equal to yyeof_, rather, test the
3345 lookahead's (translated) kind.
3346
27cb5b59
AD
33472008-11-11 Akim Demaille <demaille@gostai.com>
3348
3349 yychar cannot be empty in yyerrlab.
3350 * TODO (yychar == yyempty_): New.
3351 * data/lalr1.cc: Remove the handling of this case.
3352 This eases forthcoming changes related to yychar and yytranslate.
3353
fce629c0
AD
33542008-11-11 Akim Demaille <demaille@gostai.com>
3355
3356 Bench: syntactic sugar for %define/#define.
3357 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3358 (&bench_push_parser, bench_variant_parser): Use this feature.
3359 (&eat): New.
3360 Use it.
3361
ce671960
AD
33622008-11-11 Akim Demaille <demaille@gostai.com>
3363
3364 Less memory pressure on the "list" bench.
3365 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3366 the values, to limit memory pressure.
3367
2873fdf8
AD
33682008-11-11 Akim Demaille <demaille@gostai.com>
3369
3370 Introduce make_symbol.
b06df3c2
AD
3371 make_symbol provides a means to construct a full symbol (kind,
3372 value, location) in a single shot. It is meant to be a Symbol
3373 constructor, parameterized by the symbol kind so that overloading
3374 would prevent incorrect kind/value pairs. Unfortunately
3375 parameterized constructors do not work well in C++ (unless the
3376 parameter also appears as an argument, which is not acceptable),
3377 hence the use of a function instead of a constructor.
2df9ec37 3378
2873fdf8
AD
3379 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3380 (b4_symbol_constructor_declarations)
3381 (b4_symbol_constructor_specialization_)
3382 (b4_symbol_constructor_specializations)
3383 (b4_symbol_constructor_definition_)
3384 (b4_symbol_constructor_definitions): New.
3385 Use them where appropriate to generate declaration, declaration of
3386 the specializations, and implementations of the templated
3387 overloaded function "make_symbol".
3388 (variant::variant): Always define a default ctor.
3389 Also provide a copy ctor.
3390 (symbol_base_type, symbol_type): New ctor overloads for value-less
3391 symbols.
3392 (symbol_type): Now public, so that functions such as yylex can use
3393 it.
3394
8be046d7
AD
33952008-11-11 Akim Demaille <demaille@gostai.com>
3396
3397 Inform m4 whether a tag is a valid id.
3398 * src/output.c (is_identifier): New.
3399 (symbol_definitions_output): Use it to define tag_is_id.
3400 But maybe this should be done at m4 level?
3401
de62edee
AD
34022008-11-11 Akim Demaille <demaille@gostai.com>
3403
3404 Test 214 was failing: it greps with a pattern containing [ ]*
3405 which obviously meant to catch spaces and tabs, but contained only
3406 spaces. Tabulations in sources are a nuisance, so to simplify the
3407 matter, get rid of all the tabulations in the Java sources. The
3408 other skeletons will be treated equally later.
3409
3410 * data/java.m4, data/lalr1.java: Untabify.
3411 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3412 tabulations are no longer generated.
3413
905f0697
PB
34142008-11-11 Paolo Bonzini <bonzini@gnu.org>
3415
3416 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3417 * configure.ac: Adjust usage.
3418 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3419 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3420 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3421
09ccae9b
DJ
34222008-11-10 Di-an Jan <dianj@freeshell.org>
3423
3424 Workaround Java's ``code too large'' problem for parser tables
3425 in most cases, by using one function per initialization.
3426 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3427 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3428 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3429 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3430 (yytname_): Use b4_typed_parser_table.
3431 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3432 ``code too large'' error.
3433
1979121c
DJ
34342008-11-10 Di-an Jan <dianj@freeshell.org>
3435
3436 * NEWS: Document them.
de62edee 3437
1979121c
DJ
3438 General Java skeleton improvements.
3439 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3440 using gcj < 4.3 in the testsuite, according to comments in
3441 gnulib/m4/javacomp.m4.
3442 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3443 location_type, position_type): Remove extraneous brackets from
3444 b4_percent_define_default.
3445 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3446 m4_define and m4_define_default.
3447 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3448 which marks the end of user code with appropriate syncline, like all
3449 the other skeletons.
3450 (b4_user_post_prologue): Add. Don't silently drop.
3451 (yylex): Remove.
3452 (parse): Inline yylex.
3453 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3454 (%{...%}): Fix typo of %code imports.
3455 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3456
3457 Support annotations on parser class with %define annotations.
3458 * data/lalr1.java (annotations): Add to parser class modifier.
3459 * doc/bison.texinfo (Java Parser Interface): Document
3460 %define annotations.
3461 (Java Declarations Summary): Document %define annotations.
3462 * tests/java.at (Java parser class modifiers): Test annotations.
3463
3464 Do not generate code for %error-verbose unless requested.
3465 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3466 Make private. Make conditional on %error-verbose.
3467 (getErrorVerbose, setErrorVerbose): New.
3468 (yytnamerr_): Make conditional on %error-verbose.
3469 (yysyntax_error): Make some code conditional on %error-verbose.
3470 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3471 about %error-verbose having no effect.
3472 (getErrorVerbose, setErrorVerbose): Document.
3473
3474 Move constants for token names to Lexer interface.
3475 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3476 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3477 (parse): Qualify EOF to Lexer.EOF.
3478 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3479 EOF and token names to Java Lexer Interface.
3480 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3481
3482 Make yyerror public.
3483 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3484 (yyerror): Change to public. Add Javadoc comments. Use longer
3485 parameter names. Make the body rather than the declarator
3486 conditional on %locations.
3487 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3488
3489 Allow user to add code to the constructor with %code init.
3490 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3491 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3492 Add %code init to the front of the constructor body.
3493 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3494 and %define init_throws.
3495 (Java Declarations Summary): Document %code init and
3496 %define init_throws.
3497 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3498 (Java constructor init and init_throws): Add tests.
de62edee 3499
42f832d6
AD
35002008-11-10 Akim Demaille <demaille@gostai.com>
3501
3502 Update TODO.
3503 * TODO (-D): is implemented.
3504 (associativity): Same precedence must have the same associativity.
3505 For instance, how can a * b / c be parsed if * is %left and / is
3506 %right?
3507 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3508
247efe34
AD
35092008-11-10 Akim Demaille <demaille@gostai.com>
3510
3511 Formatting changes.
3512
5d731440
AD
35132008-11-10 Akim Demaille <demaille@gostai.com>
3514
3515 More information about the symbols.
3516 * src/output.c (type_names_output): Document all the symbols,
3517 including those that don't have a type-name.
3518 (symbol_definitions_output): Define "is_token" and
3519 "has_type_name".
3520 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3521 type-name, now that they are defined too in b4_type_names.
3522
21db118b
AD
35232008-11-10 Akim Demaille <demaille@gostai.com>
3524
3525 Regen.
3526
6ed15cde
AD
35272008-11-10 Akim Demaille <demaille@gostai.com>
3528
3529 Make parser::yytranslate static.
b06df3c2
AD
3530 Small speedup (1%) on the list grammar. And makes yytranslate_
3531 available in non member functions.
de62edee 3532
6ed15cde
AD
3533 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3534 function.
3535
30bb2edc
AD
35362008-11-10 Akim Demaille <demaille@gostai.com>
3537
3538 Avoid trailing spaces.
3539 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3540 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3541 they can be empty, and anyway this incorrectly indents the first
3542 action.
3543
b3a28fd4
AD
35442008-11-10 Akim Demaille <demaille@gostai.com>
3545
3546 Comment changes.
3547
914202bd
AD
35482008-11-10 Akim Demaille <demaille@gostai.com>
3549
3550 Use "enum" for integral constants.
3551 This is just nicer to read, I observed no speedup.
de62edee 3552
914202bd
AD
3553 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3554 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3555 (yyuser_token_number_max_, yyundef_token_): Move into...
3556 (yytranslate_): here.
3557
c17f9a4a
AD
35582008-11-10 Akim Demaille <demaille@gostai.com>
3559
3560 Shortcuts in bench directives.
3561 * etc/bench.pl.in (parse_dirs): New.
3562 Use it.
3563 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3564 Create the benches in "benches/".
3565
b9855ea5
AD
35662008-11-10 Akim Demaille <demaille@gostai.com>
3567
3568 Formatting changes.
3569 * data/lalr1.cc: here.
3570
6e097787
AD
35712008-11-10 Akim Demaille <demaille@gostai.com>
3572
3573 Adjust verbose message to using emacs.
3574 * etc/bench.pl.in: Inform compilation-mode when we change the
3575 directory.
3576 (generate_grammar_list): Recognize %define "variant" in addition
3577 to %define variant.
3578
4c3cc7da
AD
35792008-11-10 Akim Demaille <demaille@gostai.com>
3580
3581 Classify symbols by type-name.
3582 * src/uniqstr.h (UNIQSTR_CMP): New.
3583 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3584 (type_names_output): New.
3585 (muscles_output): Use it.
3586 * data/lalr1.cc (b4_symbol_action_): Remove.
3587 (b4_symbol_case_, b4_type_action_): New.
3588 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3589
d69c9694
AD
35902008-11-10 Akim Demaille <demaille@gostai.com>
3591
3592 Change the handling of the symbols in the skeletons.
3593 Before we were using tables which lines were the symbols and which
3594 columns were things like number, tag, type-name etc. It is was
3595 difficult to extend: each time a column was added, all the numbers had
3596 to be updated (you asked for colon $2, not for "tag"). Also, it was
3597 hard to filter these tables when only a subset of the symbols (say the
3598 tokens, or the nterms, or the tokens that have and external number
3599 *and* a type-name) was of interest.
de62edee 3600
d69c9694
AD
3601 Now instead of monolithic tables, we define one macro per cell. For
3602 instance "b4_symbol(0, tag)" is a macro name which contents is
3603 self-decriptive. The macro "b4_symbol" provides easier access to
3604 these cells.
de62edee 3605
d69c9694
AD
3606 * src/output.c (type_names_output): Remove.
3607 (symbol_numbers_output, symbol_definitions_output): New.
3608 (muscles_output): Call them.
3609 (prepare_symbols): Define b4_symbols_number.
3610
5263bea9
AD
36112008-11-10 Akim Demaille <demaille@gostai.com>
3612
3613 --trace=muscles
3614 * src/getargs.h, src/getargs.c (trace_muscle): New.
3615 (trace_types, trace_args): Support it.
3616 * src/output.c (output_skeleton): Use it.
3617
4175f6bb
AD
36182008-11-10 Akim Demaille <demaille@gostai.com>
3619
3620 muscles_output.
3621 * src/output.c (muscles_output): New, extracted from...
3622 (output_skeleton): here.
3623 Adjust.
3624
1de69d6a
AD
36252008-11-10 Akim Demaille <demaille@gostai.com>
3626
3627 Formatting changes.
3628
36db78a7
AD
36292008-11-10 Akim Demaille <demaille@gostai.com>
3630
3631 Update the variant example.
3632 * examples/variant.yy: Formatting changes.
3633 One stage build.
3634
e5eb92e7
AD
36352008-11-10 Akim Demaille <demaille@gostai.com>
3636
3637 Support constructor with an argument.
3638 This improves the "list" bench by 2%.
de62edee 3639
e5eb92e7
AD
3640 * data/lalr1.cc (variant::build): Add an overloaded version with
3641 an argument.
3642 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3643
76307410
AD
36442008-11-10 Akim Demaille <demaille@gostai.com>
3645
3646 Test variants.
3647 * tests/c++.at (AT_CHECK_VARIANTS): New.
3648 Use it with and without %define assert.
3649
d78f0ac9
AD
36502008-11-10 Akim Demaille <demaille@gostai.com>
3651
3652 Add %precedence support.
3653 Unfortunately it is not possible to reuse the %prec directive. This
3654 is because to please POSIX, we do not require to end the rules with a
3655 semicolon. As a result,
de62edee 3656
d78f0ac9 3657 foo: bar %prec baz
de62edee 3658
d78f0ac9
AD
3659 is ambiguous: either a rule which precedence is that of baz, or a rule,
3660 and then a declaration of the precedence of the token baz.
de62edee 3661
d78f0ac9
AD
3662 * doc/bison.texinfo: Document %precedence.
3663 (Precedence Only): New.
3664 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3665 * src/conflicts.c (resolve_sr_conflict): Support it.
3666 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3667 Parse it.
3668 * tests/calc.at: Use %precedence for NEG.
3669 * tests/conflicts.at (%precedence does not suffice)
3670 (%precedence suffices): New tests.
3671
c85be41a
AD
36722008-11-09 Akim Demaille <demaille@gostai.com>
3673
3674 Make benches in a sub dirs.
3675 * etc/bench.pl.in ($dir): New.
3676 Use it.
3677 Check the use of constructors with an argument.
3678 (bench_variant_parser): Fix.
3679
db65ca1f
AD
36802008-11-09 Akim Demaille <demaille@gostai.com>
3681
3682 fix eof condition
3683
9b0efa5b
AD
36842008-11-09 Akim Demaille <demaille@gostai.com>
3685
3686 Fix --help.
3687
432ac57a
AD
36882008-11-09 Akim Demaille <demaille@gostai.com>
3689
3690 Require the generation of parse-gram.output.
3691 * src/Makefile.am (YACC): Pass --report=all.
3692
deef2a0a
AD
36932008-11-09 Akim Demaille <demaille@gostai.com>
3694
3695 Formatting changes.
3696
df72984a
AD
36972008-11-09 Akim Demaille <demaille@gostai.com>
3698
3699 Update TODO.
3700 * TODO: Remove obsolete items.
3701 Update others.
3702
f10e19fd
AD
37032008-11-09 Akim Demaille <demaille@gostai.com>
3704
3705 Enhance bench.pl.
3706 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3707 (@token, $grammar, $bench): New.
3708 (generate_grammar_variant): Rename as...
3709 (generate_grammar_list): this.
3710 (generate_grammar): Adjust.
3711 (bench_grammar): Rename as...
3712 (bench): this.
3713 Use it in the various bench-marking routines.
3714 (-b, -g): New options.
3715
5de9c593
AD
37162008-11-09 Akim Demaille <demaille@gostai.com>
3717
3718 Use a static hierarchy for symbols in the C++ parser.
3719 * data/lalr1.cc (symbol_base_type, symbol_type)
3720 (stack_symbol_type): Make it a static hierarchy.
3721 Adjust dependencies.
3722
757f8f98
AD
37232008-11-09 Akim Demaille <demaille@gostai.com>
3724
3725 bench.pl -d, --directive.
3726 * etc/bench.pl.in (@directive): New.
3727 (&bench_grammar): Use it.
3728 (&bench_list_grammar): New, to provide access to the "variant"
3729 grammar.
3730 Use it.
3731 (getopts): Support -d, --directive.
3732
d3be4f6d
AD
37332008-11-09 Akim Demaille <demaille@gostai.com>
3734
3735 Use inline for small operations.
3736 * data/lalr1.cc (symbol_base_type, symbol_type)
3737 (stack_symbol_type): Declare constructor and other operations as
3738 inline.
3739 (yy_destroy_): Inline.
3740
1f7d007b
AD
37412008-11-09 Akim Demaille <demaille@gostai.com>
3742
3743 Introduce a hierarchy for symbols.
3744 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3745 (data_type): Rename as...
3746 (stack_symbol_type): this.
3747 Derive from symbol_base_type.
3748 (yy_symbol_value_print_): Merge into...
3749 (yy_symbol_print_): this.
3750 Rename as...
3751 (yy_print_): this.
3752 (yydestruct_): Rename as...
3753 (yy_destroy_): this.
3754 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3755 (parser::parse): yyla is now of symbol_type.
3756 Use its type member instead of yytoken.
3757
bc0b0477
AD
37582008-11-09 Akim Demaille <demaille@gostai.com>
3759
3760 Rename data_type and stack_symbol_type.
3761 * data/lalr1.cc (data_type): Rename as...
3762 (stack_symbol_type): this.
3763
57295d14
AD
37642008-11-09 Akim Demaille <demaille@gostai.com>
3765
3766 Handle semantic value and location together.
3767 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3768 yydata.value and yydata.location.
3769 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3770 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3771 single arg.
3772 Adjust all callers.
3773 (yydestruct_): New overload for a stack symbol.
3774
e9b0834e
AD
37752008-11-09 Akim Demaille <demaille@gostai.com>
3776
3777 Push a complete symbol, not connected parts.
3778 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3779 state, value and location.
3780 Adjust callers.
3781
6082531a
AD
37822008-11-09 Akim Demaille <demaille@gostai.com>
3783
3784 Agregate yylval and yylloc.
3785 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3786 (parser::yyla): this.
3787
33c195cc
AD
37882008-11-09 Akim Demaille <demaille@gostai.com>
3789
3790 Rely on the state stack to display reduction traces.
b06df3c2
AD
3791 To display rhs symbols before a reduction, we used information
3792 about the rule reduced, which required the tables yyrhs and
3793 yyprhs. Now use rely only on the state stack to get the same
3794 information.
de62edee 3795
33c195cc
AD
3796 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3797 Use them.
3798 (parser::yyrhs_, parser::yyprhs_): Remove.
3799 (parser::yy_reduce_print_): Use the state stack.
3800
e1f93869
AD
38012008-11-09 Akim Demaille <demaille@gostai.com>
3802
3803 Fuse yyval and yyloc into yylhs.
3804 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3805 yylhs.
3806 (parse): Replace yyval and yyloc with yylhs.value and
3807 yylhs.location.
3808 After a user action, compute yylhs.state earlier.
3809 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3810 fresh error_token.
3811
2935744b
DJ
38122008-11-09 Di-an Jan <dianj@freeshell.org>
3813
3814 Remove unused variable.
3815 * src/output.c (type_names_output): Remove unused variable sep.
3816
bbf9ca37
PB
38172008-11-09 Paolo Bonzini <bonzini@gnu.org>
3818
3819 Change tests/output.at quoting.
3820 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3821 expanding arguments.
3822
d9a9b96b
JD
38232008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3824
3825 Don't add a semicolon to actions for %skeleton or %language.
3826 It breaks Java test cases as reported by Akim Demaille.
3827 * src/scan-code.l: Implement.
3828
51365192
JD
38292008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3830
3831 Clean up %skeleton and %language priority implementation.
3832 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3833 remove static qualifier because others will soon need to see it.
3834 (language_prio): Likewise.
3835 (getargs): Use command_line_prio rather than 0.
3836 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3837 enum fields.
3838 (skeleton_prio): Extern it.
3839 (language_prio): Extern it.
3840 * src/parse-gram.y: Use grammar_prio rather than 1.
3841
9380cfd0
AD
38422008-11-07 Akim Demaille <demaille@gostai.com>
3843
3844 Moving push traces into yypush_.
3845 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3846 Adjust all uses.
3847
8901f32e
AD
38482008-11-07 Akim Demaille <demaille@gostai.com>
3849
3850 The single-stack C++ parser is now the standard one.
3851 * data/lalr1.cc: Rename as...
3852 * data/lalr1-split.cc: this.
3853 * data/lalr1-fusion.cc: Rename as...
3854 * data/lalr1.cc: this.
3855 * etc/bench.pl.in: Adjust.
3856
8cdabf02
AD
38572008-11-07 Akim Demaille <demaille@gostai.com>
3858
3859 Avoid empty-if warnings.
3860 Reported by Quentin Hocquet.
de62edee 3861
8cdabf02
AD
3862 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3863 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3864
5a893c2b
AD
38652008-11-07 Akim Demaille <demaille@gostai.com>
3866
3867 Pass command line location to skeleton_arg and language_argmatch.
3868 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3869 The location argument is now mandatory.
3870 Adjust all dependencies.
3871 (getargs): Use command_line_location.
3872
58697c6d
AD
38732008-11-07 Akim Demaille <demaille@gostai.com>
3874
3875 -D, --define.
3876 * src/getargs.c (usage): Document -D.
3877 Fix help string for --locations.
3878 (command_line_location): New.
3879 (short_options, long_options, getargs): Support -D, --define.
3880 (getargs): Move -d support at the right place.
3881 * doc/bison.texinfo (Bison Options): Update.
3882 * tests/input.at (%define, --define): New.
3883
9fe5a457
AD
38842008-11-07 Akim Demaille <demaille@gostai.com>
3885
3886 Initialize the muscle table before parsing the command line.
3887 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3888 (getargs): Define file_name.
3889 * src/main.c (main): Initialize muscle_tab before calling
3890 getargs.
3891 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3892 its value is not available yet.
3893
56c5eca9
AD
38942008-11-07 Akim Demaille <demaille@gostai.com>
3895
3896 Locations without columns for command line arguments.
3897 * src/location.c (location_print): Don't display negative columns.
3898 * src/location.h: Document this.
3899
9b9e0a7d
AD
39002008-11-07 Akim Demaille <demaille@gostai.com>
3901
3902 Fix --help.
3903 * src/getargs.c (usage): Fix help string for -W.
3904
74eae918
AD
39052008-11-07 Akim Demaille <demaille@gostai.com>
3906
3907 Handle more general types of option arguments.
3908 * build-aux/cross-options.pl: The argument ends at the first
3909 space, not the first non-symbol character.
3910 Use @var for each word appearing the argument description.
3911
a3d4c6fb
AD
39122008-11-07 Akim Demaille <demaille@gostai.com>
3913
3914 Destroy the variants that remain on the stack in case of error.
3915 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3916 destructor.
3917 Display the value only if yymsg is nonnull.
3918 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3919
2d32fc9f
AD
39202008-11-07 Akim Demaille <demaille@gostai.com>
3921
3922 Add "%define assert" to variants.
3923 This is used to help the user catch cases where some value gets
3924 ovewritten by a new one. This should not happen, as this will
3925 probably leak.
de62edee 3926
2d32fc9f
AD
3927 Unfortunately this uncovered a bug in the C++ parser itself: the
3928 lookahead value was not destroyed between two calls to yylex. For
3929 instance if the previous lookahead was a std::string, and then an int,
3930 then the value of the std::string was correctly taken (i.e., the
3931 lookahead was now an empty string), but std::string structure itself
3932 was not reclaimed.
de62edee 3933
2d32fc9f
AD
3934 This is now done in variant::build(other&) (which is used to take the
3935 value of the lookahead): other is not only stolen from its value, it
3936 is also destroyed. This incurs a new performance penalty of a few
3937 percent, and union becomes faster again.
de62edee 3938
2d32fc9f
AD
3939 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3940 (b4_variant_if): New.
3941 (variant::built): New.
3942 Use it whereever the status of the variant changes.
3943 * etc/bench.pl.in: Check the penalty of %define assert.
3944
f6038cb8
AD
39452008-11-07 Akim Demaille <demaille@gostai.com>
3946
3947 Use "%define variant" in bench.pl.
3948 * etc/bench.pl.in: No longer use the pseudo directive %variants,
3949 just use %define variants.
3950
ccde1f98
AD
39512008-11-07 Akim Demaille <demaille@gostai.com>
3952
3953 Regen.
3954 * src/parse-gram.h, src/parse-gram.c: Regen.
3955
58bd33b7
JD
39562008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3957
3958 Fix user actions without a trailing semicolon.
3959 Reported by Sergei Steshenko at
3960 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3961 * THANKS (Sergei Steshenko): Add.
3962 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3963 * tests/regression.at (Fix user actions without a trailing semicolon):
3964 New test case.
3965
639867b5
AD
39662008-11-04 Akim Demaille <demaille@gostai.com>
3967
3968 Use b4_copyright_years.
3969 * data/yacc.c (b4_copyright_years): New.
3970 Fix its value according to the comments in the file.
3971 Use it and undefine it.
3972
3c262606
AD
39732008-11-04 Akim Demaille <demaille@gostai.com>
3974
3975 Formatting changes.
3976 * data/lalr1-fusion.cc, src/parse-gram.y: here.
3977
a2b93d52
AD
39782008-11-04 Akim Demaille <demaille@gostai.com>
3979
3980 Formatting changes.
3981 * data/lalr1-fusion.cc: here.
3982
3a2803df
AD
39832008-11-04 Akim Demaille <demaille@gostai.com>
3984
3985 Use strict on bench.pl.
3986 * etc/bench.pl.in (&run, &generate_grammar): New.
3987 Rename the grammar generating functions for consistency.
3988 Change the interface so that the list of benches to run is passed
3989 as (optionless) arguments.
3990 (&compile): Use &run.
3991
a0d4650a
AD
39922008-11-04 Akim Demaille <demaille@gostai.com>
3993
3994 Remove spurious initial empty lines.
3995 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3996 * data/yacc.c: End the @output lines with an @.
3997
cac9e09b
AD
39982008-11-04 Akim Demaille <demaille@gostai.com>
3999
4000 Improve the display of sizes.
4001 * etc/bench.p.in: Higher precision.
4002 Sort by decreasing size.
4003
4af4348a
AD
40042008-11-04 Akim Demaille <demaille@gostai.com>
4005
4006 Don't memcpy C++ structures.
4007 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4008 arguments.
4009 (variant::build): New overload for
4010 copy-construction-that-destroys.
4011 (variant::swap): New.
4012 (parser::yypush_): Use it in variant mode.
4013
ef05c4d6
AD
40142008-11-04 Akim Demaille <demaille@gostai.com>
4015
4016 Better defaults for bench.pl.
4017 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4018 default values.
4019 Adjust &verbose uses.
4020 (-q, --quiet): New.
4021
9718cfa9
AD
40222008-11-04 Akim Demaille <demaille@gostai.com>
4023
4024 Make variant.yy more complex.
4025 std::list cannot be copied via memcpy, they are more demanding than
4026 std::string. Use one std::list to strengthen the test.
de62edee 4027
9718cfa9
AD
4028 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4029 Adjust.
4030 Create a list of strings, instead of a single large string.
4031
a6df593d
AD
40322008-11-04 Akim Demaille <demaille@gostai.com>
4033
4034 bench.pl --bench.
4035 * etc/bench.pl.in (--bench, $bench): New.
4036
006a0303
AD
40372008-11-04 Akim Demaille <demaille@gostai.com>
4038
4039 Sort methods.
4040 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4041 Define it after as().
4042
faef3466
AD
40432008-11-04 Akim Demaille <demaille@gostai.com>
4044
4045 Useless parens.
4046 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4047
2141aded
AD
40482008-11-04 Akim Demaille <demaille@gostai.com>
4049
4050 Issue missing synclines after user actions.
4051 * data/c.m4 (b4_case): Issue synclines on the output file.
4052
e426d17b
AD
40532008-11-04 Akim Demaille <demaille@gostai.com>
4054
4055 Remove trailing empty line.
4056 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4057 epilogue.
4058
a9ce3f54
AD
40592008-11-04 Akim Demaille <demaille@gostai.com>
4060
4061 Fix output of copyright years.
4062 * data/bison.m4 (b4_copyright): Fix the indentation of the
4063 copyright year paragraph.
4064 Use b4_copyright_years when no years are given.
4065 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4066 (b4_copyright_years): New.
4067 Use it.
4068
59c544c2
AD
40692008-11-04 Akim Demaille <demaille@gostai.com>
4070
4071 Avoid the spurious initial empty line.
4072 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4073 the end of @output request to suppress the empty line that
4074 results.
4075
96b15448
AD
40762008-11-04 Akim Demaille <demaille@gostai.com>
4077
4078 Remove parser::rhs_number_type.
4079 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4080 (yyrhs_): Use b4_table_define.
4081
f0633174
AD
40822008-11-04 Akim Demaille <demaille@gostai.com>
4083
4084 Fix iteration type.
4085 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4086
417b8004
AD
40872008-11-04 Akim Demaille <demaille@gostai.com>
4088
4089 Factor the declaration of the integer tables.
4090 * data/lalr1-fusion.cc (b4_table_define): New.
4091 Use it.
4092
1a5246c6
AD
40932008-11-03 Akim Demaille <demaille@gostai.com>
4094
4095 Fix indentation of tables in lalr1.cc
4096 * data/lalr1-fusion.cc: Fix the indentation.
4097
f8a95c9c
AD
40982008-11-03 Akim Demaille <demaille@gostai.com>
4099
4100 Destroy the lhs symbols after reduction.
4101 * data/lalr1-fusion.cc (parse): After the user action, when in
4102 variant mode, destroy the lhs symbols.
4103
d7f4d823
AD
41042008-11-03 Akim Demaille <demaille@gostai.com>
4105
4106 Simplify yysyntax_error_ use.
4107 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4108 type, but make it unnamed in the declaration when it is not used.
4109
8b9c89fb
AD
41102008-11-03 Akim Demaille <demaille@gostai.com>
4111
4112 Let yy::variant::build return an lvalue.
4113 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4114 object.
4115
83243c24
AD
41162008-11-03 Akim Demaille <demaille@gostai.com>
4117
4118 Define yy::variant only when needed.
4119 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4120 used.
4121
429b4848
AD
41222008-11-03 Akim Demaille <demaille@gostai.com>
4123
4124 Bench the three-stack lalr1.cc.
4125 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4126 one-stack one.
4127
414c76a4
AD
41282008-11-03 Akim Demaille <demaille@gostai.com>
4129
4130 Fail on parse error in calc++.
4131 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4132 status.
4133 * examples/calc++/test ($me, $number, $exit, run): New.
4134 Use them to propagate errors to the exit status.
4135
8a5783fd
AD
41362008-11-03 Akim Demaille <demaille@gostai.com>
4137
4138 Don't specify the skeleton twice in the example.
4139 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4140 file does what is needed.
4141
0cc5bead
AD
41422008-11-03 Akim Demaille <demaille@gostai.com>
4143
4144 bench: Improve output.
4145 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4146
5b421a4e
AD
41472008-11-03 Akim Demaille <demaille@gostai.com>
4148
4149 bench: check impact of %debug on variants.
4150 * etc/bench.pl.in (variant_grammar): Fix the computation of
4151 $variant.
4152 Generate a grammar file that can work with or without %debug.
4153 Do use the @directive.
4154 (bench_variant_parser): Check impact of %debug.
4155 (@directives): Rename all the occurrences to...
4156 (@directive): this, for consistency.
4157
d11ee647
AD
41582008-11-03 Akim Demaille <demaille@gostai.com>
4159
4160 bench: report the size too.
4161 * etc/bench.pl.in ($iterations): Defaults to -3.
4162 (&bench_grammar): Require hireswallclock.
4163 Compute and display the size of the result.
4164 More comments.
4165
e1b74b92
AD
41662008-11-03 Akim Demaille <demaille@gostai.com>
4167
4168 bench: More use of the verbosity level.
4169 * etc/bench.pl.in ($verbose, &verbose): New.
4170 Use them.
4171 More POD documentation.
4172
7e5f9c54
AD
41732008-11-03 Akim Demaille <demaille@gostai.com>
4174
4175 bench.pl: a command line interface
4176 * etc/bench.pl.in: More doc.
4177 Some fixes in the documentation.
4178 ($cflags, $iterations, &help, &getopt): New.
4179 Use them.
4180 (&variant_grammar): Let the number of stages be 10 times what is
4181 specified.
4182
7109a18d
AD
41832008-11-03 Akim Demaille <demaille@gostai.com>
4184
4185 Bench the use of Boost.Variants.
4186 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4187 New.
4188 (&compile): Be ready to compile C++ parsers.
4189 (&bench_push_parser): Move debug information to the outermost
4190 level.
4191 * THANKS: Add Michiel De Wilde.
4192
922730fe
AD
41932008-11-03 Akim Demaille <demaille@gostai.com>
4194
4195 bench.pl: Pass directives as a list instead of as a string.
4196 * etc/bench.pl.in (&directives): New.
4197 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4198 directives.
4199 (&triangular_grammar): Do use the directives (were ignored).
4200 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4201 directives.
4202
7484f1d4
AD
42032008-11-03 Akim Demaille <demaille@gostai.com>
4204
4205 Improve genericity of bench.pl.
4206 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4207 argument.
4208 (&bench_push_parser): New.
4209 Call it.
4210
15129f25
AD
42112008-11-03 Akim Demaille <demaille@gostai.com>
4212
4213 Add documentation to bench.pl.
4214 * etc/bench.pl.in: Comment changes.
4215
0e0ed236
AD
42162008-11-03 Akim Demaille <demaille@gostai.com>
4217
4218 Fuse the three stacks into a single one.
de62edee 4219
b06df3c2
AD
4220 In order to make it easy to perform benchmarks to ensure that
4221 there are no performance loss, lalr1.cc is forked into
4222 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4223 lalr1.cc.
4224
4225 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4226 exercized by the test suite, the user must install a symbolic link
4227 from lalr1.cc to it.
de62edee 4228
b06df3c2
AD
4229 Instead of having three stacks (state, value, location), use a
4230 stack of triples. This considerably simplifies the code (and it
4231 will be easier not to require locations as currently does the C++
4232 parser), and also gives a 10% speedup according to
4233 etc/bench (probably mainly since memory allocation is done once
4234 instead of three times).
de62edee 4235
0e0ed236
AD
4236 Another motivation is to make it easier to destruct properly
4237 semantic values: now that they are bound to their state (hence
4238 symbol type) it will be easier to call the appropriate destructor.
de62edee 4239
0e0ed236 4240 These changes should probably benefit the C parser too.
de62edee 4241
b06df3c2
AD
4242 * data/lalr1.cc: Copy as...
4243 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
4244 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4245 from c++.m4.
4246 (state_stack_type, semantic_stack_type, location_stack_type)
4247 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4248 (data_type, stack_type, yystack_): New.
4249 (YYLLOC_DEFAULT, yypush_): Adjust.
4250 (yyerror_range): Now based on data_type, not location_type.
4251
7dedf26e
AD
42522008-11-03 Akim Demaille <demaille@gostai.com>
4253
4254 Push the state, value, and location at the same time.
4255 This is needed to prepare a forthcoming patch that fuses the three
4256 stacks into one.
de62edee 4257
7dedf26e
AD
4258 * data/lalr1.cc (parser::yypush_): New.
4259 (parser::yynewstate): Change the semantics: instead of arriving to
4260 this label when value and location have been pushed, but yystate
4261 is to be pushed on the state stack, now the three of them must
4262 have been pushed before. yystate still must be the new state.
4263 This allows to use yypush_ everywhere instead of individual
4264 handling of the stacks.
4265
c4585f1e
AD
42662008-11-03 Akim Demaille <demaille@gostai.com>
4267
4268 Prefer references to pointers.
4269 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4270 definition to use references instead of pointers.
4271 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4272 Take the value and location as references.
4273 Adjust callers.
4274
56017c17
AD
42752008-11-03 Akim Demaille <demaille@gostai.com>
4276
4277 stack::size instead of stack::height.
4278 * data/lalr1.cc (stack::height): Rename as...
4279 (stack::size): this.
4280 Fix the output type.
4281 Comment changes.
4282
5ab8c47b
AD
42832008-11-03 Akim Demaille <demaille@gostai.com>
4284
4285 Use variants to support objects as semantic values.
b06df3c2
AD
4286 This patch was inspired by work by Michiel De Wilde. But he used
4287 Boost variants which (i) requires Boost on the user side, (ii) is
4288 slow, and (iii) has useless overhead (the parser knows the type of
4289 the semantic value there is no reason to duplicate this
4290 information as Boost.Variants do).
4291
4292 This implementation reserves a buffer large enough to store the
4293 largest objects. yy::variant implements this buffer. It was
4294 implemented with Quentin Hocquet.
de62edee 4295
5ab8c47b
AD
4296 * src/output.c (type_names_output): New.
4297 (output_skeleton): Invoke it.
4298 * data/c++.m4 (b4_variant_if): New.
4299 (b4_symbol_value): If needed, provide a definition for variants.
4300 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4301 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4302 (b4_char_sizeof, yy::variant): New.
4303 (parser::parse): If variants are requested, define
4304 parser::union_type, parser::variant, change the definition of
4305 semantic_type, construct $$ before running the user action instead
4306 of performing a default $$ = $1.
4307 * examples/variant.yy: New.
4308 Based on an example by Michiel De Wilde.
4309
1fa5d8bb
AD
43102008-11-03 Akim Demaille <demaille@gostai.com>
4311
4312 Parameterize the extraction of semantic values.
4313 To make future changes easier, no longer rely on ".TYPE" being the
4314 way to get a semantic value.
de62edee 4315
1fa5d8bb
AD
4316 * data/c.m4 (b4_symbol_value): New.
4317 Use it.
4318 * data/c++.m4, data/yacc.c: Use it.
4319 * data/glr.c: Use b4_symbol_value.
4320 (b4_rhs_data): New.
4321 Use it.
4322
91ba8a55
AD
43232008-11-03 Akim Demaille <demaille@gostai.com>
4324
4325 Prepare easier M4 changes.
4326 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4327 future changes.
4328
c9ba9e59
JD
43292008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4330
4331 Initiate further development.
4332 * NEWS: Create an empty section for new entries.
4333 * gnulib: Update submodule to HEAD.
4334
bfb40910
JD
43352008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4336
4337 * NEWS: Version 2.4.
4338
241fda7a
JD
43392008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4340
4341 Prepare for next release.
4342 * NEWS: Briefly mention changes since 2.3b.
4343 * README: Say GNU m4 1.4.6, which we've been requiring in release
4344 announcements already, not 1.4.3, which breaks the build.
4345
ed4d67dc
JD
43462008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4347
4348 Say %language is experimental.
4349 We're thinking of extending it's effect on output file naming. See the
4350 thread at
4351 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4352 * NEWS: Say it's experimental.
4353 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4354 recommend it over %skeleton for now.
4355 (Bison Options): Likewise.
4356 (C++ Bison Interface): Use %skeleton not %language.
4357 (Calc++ Parser): Use %skeleton not %language.
4358 * src/getargs.c (usage): Say it's experimental.
4359
e254a580
DJ
43602008-11-01 Di-an Jan <dianj@freeshell.org>
4361 Paolo Bonzini <bonzini@gnu.org>
4362
4363 Support all Java parser class modifiers.
4364 * data/java.m4 (b4_percent_define_get3): New.
4365 (b4_final_if, b4_strictfp_if): New.
4366 * data/lalr1.java (final, strictfp, extends, implements): Support.
4367 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4368 documentation.
4369 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4370 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4371 (AT_CHECK_JAVA_GREP): New.
4372 (Java parser class modifiers): New test.
4373 (Java parser class extends and implements): New test.
4374
4375 Model exception propagation better with throws and lex_throws.
4376 * data/java.m4 (b4_list2): New.
4377 (throws): Change default.
4378 * data/lalr1.java (yyaction): Add throws.
4379 (parse): Add lex_throws in addition to throws.
4380 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4381 * tests/java.at (Java throws specifications): New test.
4382
4383 Improve documentation for Java parsers.
4384 * doc/bison.texinfo (Java Parsers): Add subsections.
4385 Don't quote first argument of %define.
4386 (Java Bison Interface): Document output files. Move documentation
4387 of parser class and merge into Java Parser Interface. Document
4388 features that error out. Document directives with no effect.
4389 Move note about Javadoc higher.
4390 (Java Semantic Values): Explicitly mention stype.
4391 Document that generic types cannot be used.
4392 (Java Location Values): Use @deftypeivar. Document constructors.
4393 Correct return value for toString.
4394 (Java Parser Interface): List undocumented constants/fields.
4395 Move documentation of fields added by %parse-param closer to list
4396 of members. Document that token names are added as fields.
4397 Document constructors accurately. Remove error method.
4398 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4399 Interface. Describe %code lexer and yylex accutately.
4400 Remove documentation that does not match the code.
4401 (Java Action Features): New.
4402 (Java Differences): Add reference. Add item on semantic values.
4403 Add note about @{ ... @}. Clarify %% epilogue placement.
4404 (Java Declarations Summary): New.
4405
4406 Fix Java skeleton.
4407 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4408 (b4_remove_comma): Quote test argument.
4409 (b4_identification): Remove "bison" field.
4410 * tests/java.at (Java parser class and package names): New test.
4411 (Java %parse-param and %lex-param): New test.
4412 (Java stype, position_class and location_class): New test.
4413
f259e4e6
PB
44142008-10-31 Di-an Jan <dianj@freeshell.org>
4415
4416 * data/lalr1.jave: Update copyright years.
4417 (YYParser): Correct name of "generated from" file in Javadoc:
4418 use b4_file_name instead of @ofile@.
4419 (Location constructor): Correct Javadoc parameter name.
4420 (yylloc): Add missing opening m4 quote after b4_location_if.
4421 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4422 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4423 (YYParser constructor): Correct Javadoc parameter name.
4424
cae5057f
JD
44252008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4426
4427 Always put auxiliary code files in the same dir as other output files.
4428 * src/files.c (compute_file_name_parts): When the user specifies
4429 --output but not --file-prefix, extract the directory prefix from the
4430 file prefix not from the grammar file name. This affects the location
4431 of files like location.hh generated by the C++ skeleton. The includes
4432 in the other output files require this fix.
4433 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4434 for expected output files.
4435 (Output files): Add a test for the above.
4436
4af432ba
JD
44372008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4438
4439 * gnulib: Update submodule to HEAD.
4440
e26d4e43
JD
44412008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4442
4443 Update copyright year.
4444 * src/files.c: Here.
4445
c0ee9e21
DJ
44462008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4447
4448 Don't overwrite the input file.
4449 * src/files.c (output_file_name_check): Fatal error if using input file
4450 for output.
4451 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4452 argument.
4453 (Conflicting output files): Add test.
4454
482dc52f
AD
44552008-10-28 Akim Demaille <demaille@gostai.com>
4456
4457 Space changes.
4458 * data/lalr1.cc: Formatting changes.
4459
52cbbe84
AD
44602008-10-28 Akim Demaille <demaille@gostai.com>
4461
4462 Don't define debugging functions when !YYDEBUG.
4463 * data/lalr1.cc (debug_stream, set_debug_stream)
4464 (debug_level_type, debug_level, set_debug_level): Don't
4465 declare them when YYDEBUG is not defined.
4466 The implementation are already YYDEBUG-aware.
4467
0925d5bf
AD
44682008-10-28 Akim Demaille <demaille@gostai.com>
4469
4470 Prefer "continue" for empty loop bodies.
4471 * etc/bench.pl.in: Use "continue" instead of {}.
4472
cf98343c
AD
44732008-10-28 Akim Demaille <demaille@gostai.com>
4474
4475 Space and comments changes.
4476 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4477 * data/c.m4, data/lalr1.cc: Space changes.
4478
9f467b7d
AD
44792008-10-28 Akim Demaille <demaille@gostai.com>
4480
4481 Make gnulib a submodule.
4482 * gnulib: New.
4483 * .gitmodules (gnulib): New.
4484
0f0e1ace
JD
44852008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4486
4487 Fix yyerror_range for user-defined location type in C++. Reported by
4488 Georg Sauthoff at
4489 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4490 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4491 * THANKS (Georg Sauthoff): Add.
4492
548e2104
JD
44932008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4494
4495 Update several administrative files mainly to facilitate releasing.
4496 * HACKING (Administrivia): Make the git-merge-changelog notes more
4497 helpful.
4498 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4499 (Release Procedure): Update for git and add numerous details that were
4500 previously missing.
4501 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4502 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4503 that announcements don't claim we bootstrapped with whatever bison
4504 happened to be in PATH. Add flex as a bootstrap tool.
4505 * Makefile.maint: Remove, previously replaced by maint.mk.
4506 * Makefile.cfg: Remove, and migrate settings to...
4507 * cfg.mk: ... here for the sake of `make announcement'.
4508 * bootstrap.conf (gnulib_modules): Add announce-gen.
4509 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4510 Berry.
4511
ddf17a6e
PB
45122008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4513
4514 Small but important bugfixes for the Java skeleton.
4515 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4516 (yy_symbol_print): Call toString on yyvaluep.
4517
e1145ad8
AD
45182008-08-29 Akim Demaille <demaille@gostai.com>
4519
4520 Clarify UPDATED use.
215b40ac 4521 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 4522 not to the release date of Bison.
215b40ac 4523 Reported by Joel E. Denny.
e1145ad8 4524
0df72d78
AD
45252008-08-29 Akim Demaille <demaille@gostai.com>
4526
4527 * README: Update FAQ pointer.
4528 Reported by Joel E. Denny.
4529
9a90b6bb
EB
45302008-08-27 Eric Blake <ebb9@byu.net>
4531
4532 Resync m4sugar from autoconf.
4533 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4534 (m4_init): Adjust to latest m4.git changes.
4535 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4536 effects.
4537 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4538 (_m4_list_cmp): Reduce side effects.
4539
65015668
AD
45402008-08-27 Akim Demaille <demaille@gostai.com>
4541
4542 Check yyerrok in calc.at.
215b40ac
EB
4543 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4544 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4545 expected.
65015668 4546
98e26a92
AD
45472008-08-27 Akim Demaille <demaille@gostai.com>
4548
4549 Support yyerrok in lalr1.cc.
4550 YYBACKUP is still to import back into lalr1.cc.
215b40ac 4551 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 4552
86c0e784
JD
45532008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4554
4555 For maintainer-check*, don't recompile for a $(VERSION) update.
4556 * cfg.mk: New file.
4557 (_is-dist-target): Override the one in GNUmakefile.
4558 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4559
88511166
JD
45602008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4561
4562 Update for recent change to gnulib.
4563 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4564 string.h now.
4565
6bbb2ed5
EB
45662008-08-15 Eric Blake <ebb9@byu.net>
4567
d67c52e8
EB
4568 Remaining m4sugar merge from autoconf.
4569 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4570 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4571 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4572 * src/output.c (output_skeleton): Tell m4 how to find it.
4573
6bbb2ed5
EB
4574 Partial m4sugar merge from autoconf: m4_map.
4575 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4576 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4577 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4578 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4579 for empty list.
4580 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4581 Likewise.
4582 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4583 declares it.
4584
8dce3875
JD
45852008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4586
4587 Keep .version and PACKAGE_VERSION in sync.
4588 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4589 dependency, and add comments justifying this in more detail. Discussed
4590 starting at
4591 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4592
882a1fbf
EB
45932008-08-06 Eric Blake <ebb9@byu.net>
4594
a3764451
EB
4595 Partial m4sugar merge from autoconf: m4_shiftn.
4596 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4597 (m4_shift2, m4_shift3): New macros.
4598 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4599 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4600 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4601 * data/java.m4 (b4_remove_comma): Likewise.
4602
882a1fbf
EB
4603 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4604 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4605 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4606 (m4_init): Consolidate wrapped text into single m4_wrap.
4607 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4608 in wrapped text.
4609
a30e920d
EB
46102008-08-05 Eric Blake <ebb9@byu.net>
4611
dfcc5959
EB
4612 Partial m4sugar merge from autoconf: builtins, version.m4.
4613 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4614 (m4_prepend): Remove, as it is unused and inherently quadratic,
4615 whereas m4_append is linear in newer m4.
4616 (m4_mkstemp): New builtin.
4617 (m4_symbols): Make rename conditional.
4618 (m4_version_prereq): Ensure fatal error if used in bison, which
4619 intentionally lacks version.m4.
4620
a30e920d
EB
4621 Fix comments in m4sugar.
4622 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4623
445b7470
JD
46242008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4625
4626 Update for recent .gitignore fix in Gnulib.
4627 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4628 anchored .gitignore entries.
4629
a1e50014
JD
46302008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4631
4632 Set gnu or gnits strictness.
4633 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4634 development and gnits strictness for releases. Based on Eric Blake's
4635 suggestion at
4636 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4637
d43f77e7
PB
46382008-07-31 Paolo Bonzini <bonzini@gnu.org>
4639
4640 * NEWS: Clarify documentation of %language.
4641
fee2ed87
PB
46422008-07-31 Paolo Bonzini <bonzini@gnu.org>
4643
4644 Support usage of git-merge-changelog.
4645 * .gitattributes: New.
4646 * HACKING: Document usage of git-merge-changelog.
4647 * bootstrap: Install git-merge-changelog entries in .git/config
4648 if appropriate.
4649
78029cd5
JD
46502008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4651
4652 Remove remaining dependence on CVS Id keyword.
4653 * ChangeLog: For the sake of people still using CVS, don't use dollars
4654 when mentioning Id.
4655 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4656 unusual anyway.
4657 * data/xslt/xml2dot.xsl: Likewise.
4658 * data/xslt/xml2text.xsl: Likewise.
4659 * data/xslt/xml2xhtml.xsl: Likewise.
4660 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4661 * doc/Makefile.am (neutralize): Remove, no longer needed.
4662 (.x.1): Don't use neutralize.
4663 (edit): Don't substitute for ID.
4664 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4665
c53d18b1
JD
46662008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4667
4668 Fix dependence on computed configure variables.
4669 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4670 $(top_srcdir)/configure.ac so that changes to computed variables, such
4671 as PACKAGE_VERSION, are seen.
4672 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4673
5523ac79
JD
46742008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4675
4676 Update copyright dates for recent changes.
4677 * Makefile.am: Here.
4678 * src/Makefile.am: Here.
4679 * src/reduce.c: Here.
4680 * tests/reduce.at: Here.
4681
8fa36911
JD
46822008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4683
4684 Use git-version-gen for version names between releases.
4685 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4686 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4687 * .prev-version: New.
4688 * .version.in: Remove.
78029cd5 4689 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
4690 revision.
4691 * GNUmakefile: Remove, now copied from Gnulib.
4692 * Makefile.am: Add code suggested by comments in
4693 build-aux/git-version-gen.
4694 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4695 .prev-version, and .version.
4696 * NEWS (2.3b+): Rename to...
4697 (?.?): ... this because we're dropping the "+" version naming scheme,
4698 but, in general, we still can't be sure of our next release name.
4699 * bootstrap: Add a quick hack to remove from .gitignore the
4700 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4701 entry. This should really be fixed in gnulib instead.
4702 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4703 * configure.ac (AC_INIT): Set version name by invoking
4704 build-aux/git-version-gen.
4705 (AC_CONFIG_FILES): Remove .version, now generated by
4706 build-aux/git-version-gen.
4707 * maint.mk: New, copied from coreutils.
4708 * doc/.cvsignore (bison.1): Add.
4709 * doc/.gitignore (/bison.1): Add.
4710 * doc/bison.1: Remove, generated.
4711 * src/.cvsignore (revision.c): Remove.
4712 * src/.gitignore (/revision.c): Remove.
4713 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4714 (BUILT_SOURCES): Remove revision.c.
4715 (revision.c): Remove.
4716 * src/getargs.c (version): Don't print revision after the VERSION.
4717 * src/revision.h: Remove.
4718
bcf07cb7
JD
47192008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4720
4721 Fix untranslatable composition of sentences. Reported by Goran
4722 Uddeborg at
4723 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4724 * THANKS (Goran Uddeborg): Add.
4725 * src/reduce.c (reduce_print): Report the number of nonterminals and
4726 rules useless in the grammar in separate sentences.
4727 * tests/reduce.at (Useless Rules): Update output.
4728 (Reduced Automaton): Likewise.
4729 (Underivable Rules): Likewise.
4730 (Empty Language): Likewise.
4731
9aacab9a
JD
47322008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4733
4734 Fix some .gitignore and .cvsignore problems.
4735 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4736 (insert_vc_ignore): ... this new function, which prepends `/' to all
4737 .gitignore entries before passing them to insert_sorted_if_absent.
4738 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4739 .cvsignore files are maintained even though Bison developers run
4740 bootstrap while using Git.
4741 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4742 unneeded by Bison.
4743 (gnulib): Add.
4744 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4745 unneeded. Reported by Eric Blake.
4746 * lib/.gitignore (/*~): Add.
4747 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4748 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4749 Blake.
4750 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4751
a9fc7990
JD
47522008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4753
4754 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4755 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4756 * bootstrap.conf (gnulib_modules): Add unsetenv.
4757 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4758 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4759 (/setenv.m4): Add.
4760 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4761 the first argument because it may become position-dependent, and unset
4762 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4763 Add comments explaining these issues in more detail.
4764
0f1d6f10
JD
47652008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4766
4767 Add .gitignore everywhere based on .cvsignore.
4768 * .gitignore: New.
4769 * build-aux/.gitignore: New.
4770 * data/.gitignore: New.
4771 * doc/.gitignore: New.
4772 * etc/.gitignore: New.
4773 * examples/.gitignore: New.
4774 * examples/calc++/.gitignore: New.
4775 * lib/.gitignore: New.
4776 * m4/.gitignore: New.
4777 * po/.gitignore: New.
4778 * runtime-po/.gitignore: New.
4779 * src/.gitignore: New.
4780 * tests/.gitignore: New.
4781
7bd1665a
JD
47822008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4783
4784 * NEWS (2.3b+): New section, empty for now.
4785 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4786
72c5b982
JD
47872008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4788
4789 * NEWS (2.3b): Update release date since there has been a delay in
4790 getting the announcements and tarballs out.
4791
bd02cd5d
JD
47922008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4793
4794 * NEWS: Version 2.3b.
4795 * configure.ac (AC_INIT): Likewise.
4796 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4797
9126263e
JD
47982008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4799
4800 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4801 been doing it for years.
4802 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4803 (Release Procedure): Add FIXME about make alpha being unmaintained.
4804
fa6aa7b3
JD
48052008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4806
4807 * data/yacc.c: Reformat m4 a little for readability.
4808 * src/lalr.c (build_relations): Correct comment.
4809
d30b312d
JMG
48102008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4811
4812 DJGPP specific issue.
4813 * djgpp/config.sed: Fixes required to run configure scripts generated
4814 by autoconf 2.62.
4815
138d4cd9
JD
48162008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4817
4818 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4819 coordinator@translationproject.org.
4820
8f7e2e1f
JD
48212008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4822
4823 * THANKS: Add Eric Blake.
4824
f55efa38
JD
48252008-04-23 Eric Blake <ebb9@byu.net>
4826
4827 Revert prior patch, by working around autoconf regression.
4828 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4829 ("Output file name: ("): Uncomment test.
4830 ("Output file name: )"): Likewise.
4831 Based on an idea from Noah Misch.
4832
096c9f9d
JD
48332008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4834
4835 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4836 2.61. Reported by Juan Manuel Guerrero at
4837 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4838 * tests/output.at ("Output file name: ("): Comment out test case for
4839 now.
4840 ("Output file name: )"): Likewise.
4841
0f664b89
JD
48422008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4843
4844 * GNUmakefile: Update git-version-gen invocation so make dist
4845 succeeds.
4846
1cfe6375
JD
48472008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4848
4849 Update to the current gnulib CVS repository, and fix trigraph handling
4850 in Bison.
4851 * bootstrap: Update gnulib CVS repository URL.
4852 (symlink_to_dir): Encapsulate the code that guarantees the destination
4853 directory exists into...
4854 (check_dst_dir): ... this new function, and...
4855 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4856 fail when copying files into lib/uniwidth/.
4857 * src/output.c (prepare_symbols): When writing yytname muscles, where
4858 symbol names will be encoded in C-string literals, tell quotearg to
4859 escape trigraphs. This used to be the default in gnulib.
4860 * tests/regression.at (Token definitions): Because of the change in
4861 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4862 escapes trigraphs in symbol names. Thus, yytname no longer has
4863 trigraphs unnecessarily doubly escaped. Update test case output.
4864 Extend test case to be sure Bison's own error messages will no longer
4865 have trigraphs in symbol names unnecessarily escaped once.
4866
74c52fc8
JD
48672008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4868
4869 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4870 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4871 * .cvsignore: Add .version.
4872 * .version.in: New.
4873 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4874 * configure.ac (AC_CONFIG_FILES): Add .version.
4875 * build-aux/.cvsignore: Add git-version-gen.
4876
8e55b3aa
JD
48772008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4878
4879 * NEWS (2.3a+): Mention that -g now takes an argument.
4880 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4881 consistency. Update the -g and -x entries now that they take
4882 arguments. Use brackets to indicate optional arguments.
4883 * src/getargs.c (usage): Explain the relationship between arguments of
4884 long and short options more completely. Document --defines and -d
4885 separately since the former takes an argument but, for POSIX Yacc, the
4886 latter does not.
4887 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 4888 (getargs): Sort cases.
8e55b3aa 4889
59c5ac72
AD
48902008-02-28 Akim Demaille <demaille@gostai.com>
4891
4892 * doc/bison.texinfo: Fix a few typos.
4893
118d4978
AD
48942008-02-28 Akim Demaille <akim@epita.fr>
4895
4896 * doc/bison.texinfo (Bison Options): Document -W.
4897 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4898
7020f1e9
AD
48992008-02-28 Akim Demaille <akim@epita.fr>
4900
4901 * src/getargs.c (short_options): Split and sort for readability.
4902 -g and -x take optional arguments, just like their long options.
4903 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4904 understand.
4905 Fix the handling of $opt which resulted in all the argument to be
4906 considered as optional.
4907
59da312b
JD
49082008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4909
4910 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4911 say its interface is experimental.
4912 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4913 Java.
4914 (Bison Options): In the -L and --language entry, mention Java.
4915 (Java Bison Interface): Say the interface is experimental.
4916 * src/getargs.c (usage): Mention -L and --language.
4917
4918 * NEWS (2.3a+): Say the push parsing interface is experimental.
4919 * doc/bison.texinfo (Push Decl): Likewise.
4920 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4921 (Push Parser Function): Likewise.
4922 (Pull Parser Function): Likewise.
4923 (Parser Create Function): Likewise.
4924 (Parser Delete Function): Likewise.
4925 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4926 yypull_parse, and yypush_parse entries.
4927
4928 * NEWS (2.3a+): Mention XML support, and say the schema is
4929 experimental.
4930 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4931 * src/getargs.c (usage): Say the XML schema is experimental.
4932
4933 * NEWS (2.3a+): Say option instead of flag.
4934
2bb3ebec
WP
49352008-02-21 Wojciech Polak <polak@gnu.org>
4936
4937 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4938 text.
4939
333e670c
JD
49402008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4941
4942 Fix impure push parser compile error reported by Bob Rossi at
4943 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4944 * data/yacc.c: Clean up whitespace in the output a little.
4945 (yypstate_allocated): Define for impure push parsers regardless of
4946 whether the pull interface is also requested.
4947 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
4948 check impure push parsers without the pull interface.
4949
4950 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
4951 yyerror takes arguments specified by %parse-param while yypstate_new
4952 does not.
4953 * doc/bison.texinfo (Parser Create Function): Document that
4954 yypstate_new returns 0 for multiple impure parser instances.
4955 * tests/push.at (Push Parsing: Multiple impure instances): Update
4956 expected stderr output.
4957
798096e1
JD
49582008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4959
4960 * runtime-po/POTFILES.in (push.c): Remove.
4961
9ca7f077
JD
49622008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4963
4964 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
4965 * data/push.c: Rename to...
4966 * data/yacc.c: ... this, overwriting it.
4967 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
4968 `%push-pull-parser' -> `%define api.push_pull "both"'.
4969 Remove old yacc.c tests, and update push.c tests to yacc.c.
4970
42ee26bb
JD
49712008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4972
4973 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
4974 `"%code top" blocks' instead of `%code "top" blocks'.
4975 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
4976 Clean up whitespace in the output a little.
4977
b1cc23c4
JD
49782008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4979
4980 Fix documentation problems reported by Tim Josling at
4981 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
4982 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
4983 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
4984 integers. Explain the effect of literal string aliases on error
4985 messages. Copy token 0 documentation from the C++ skeleton
4986 documentation.
4987
ab7f29f8
JD
49882008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4989
4990 Accept a token number in a %left, %right, or %nonassoc for POSIX
4991 conformance. Reported by Tim Josling at
4992 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4993 * NEWS (2.3a+): Mention.
4994 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4995 and code numbers are treated by precedence declarations.
4996 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4997 of symbols.1.
4998 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4999 of symbol.
5000 (symbol.prec): New, just like symbol but allows INT.
5001 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5002 longer holds.
5003 * tests/regression.at (Token number in precedence declaration): New
5004 test case.
5005
a924ef36
JMG
50062008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5007
5008 DJGPP specific issues.
5009 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5010 be changed. Copyright timestamp adjusted.
5011 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5012 be changed. Copyright timestamp adjusted.
5013 * djgpp/config.site: Copyright timestamp adjusted.
5014 * djgpp/config_h.sed: Copyright timestamp adjusted.
5015 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5016 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5017 filename translation list.
5018 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5019 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5020 files shall be created. Before trying to use the temp dir where the
5021 environment variable points to check that the dir really exists. If
5022 not default to the cwd as temp dir. Copyright timestamp adjusted.
5023 * djgpp/subpipe.h: Copyright timestamp adjusted.
5024 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5025
389c8cfd
PE
50262008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5027
5028 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5029
5d1cfef4
PE
50302008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5031
5032 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5033 Problem reported by Claudio Saavedra in
5034 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5035
e2dcf996
WP
50362008-01-05 Wojciech Polak <polak@gnu.org>
5037
5038 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5039 document's title with the input grammar file name.
5040
da730230
JD
50412007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5042
5043 Automate regression testing of the XML/XSLT implementation. Discussed
5044 starting at
5045 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5046 * configure.ac (XSLTPROC): New substitution.
5047 * Makefile.am (maintainer-xml-check): New phony target invoking...
5048 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5049 invoking make maintainer-check with BISON_TEST_XML=1.
5050 * tests/atlocal.in (XSLTPROC): New.
5051 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5052 not to report reachable memory when Bison is expected to have a
5053 non-zero exit status and (2) to compare XML/XSLT output with --graph
5054 and --report=all output for every working grammar when
5055 BISON_TEST_XML=1.
5056 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5057 (AT_BISON_CHECK_XML): New.
5058 (AT_QUELL_VALGRIND): New.
5059 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5060 (AT_CHECK): ... don't redefine this since this was the old way to
5061 quell Valgrind.
5062 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5063 AT_BISON_CHECK invocations.
5064 * tests/c++.at: Likewise.
5065 * tests/calc.at: Likewise.
5066 * tests/conflicts.at: Likewise.
5067 * tests/cxx-type.at: Likewise.
5068 * tests/existing.at: Likewise.
5069 * tests/glr-regression.at: Likewise.
5070 * tests/headers.at: Likewise.
5071 * tests/input.at: Likewise.
5072 * tests/java.at: Likewise.
5073 * tests/output.at: Likewise.
5074 * tests/push.at: Likewise.
5075 * tests/reduce.at: Likewise.
5076 * tests/regression.at: Likewise.
5077 * tests/sets.at: Likewise.
5078 * tests/skeletons.at: Likewise.
5079 * tests/synclines.at: Likewise.
5080 * tests/torture.at: Likewise.
5081 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5082 tends to hang xsltproc.
5083 (Big horizontal): Likewise.
5084
408476bc
JD
50852007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5086
5087 In XML output, remove redundant class attribute on symbol element.
5088 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5089 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5090 look up a symbol to determine whether it's a nonterminal or terminal.
5091 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5092 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5093
5094 Add prec/assoc information to XML output.
5095 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5096 %prec, add a percent_prec attribute.
5097 * src/print-xml.c (print_grammar): For each terminal that has a
5098 precedence or associativity, add a prec or assoc attribute.
5099 (xml_indent): New.
5100 (xml_puts): Use xml_indent.
5101 (xml_printf): Use xml_indent.
5102 * src/print-xml.h (xml_indent): Prototype.
5103
5104 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5105 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5106
d4a26c48
JD
51072007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5108
5109 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5110 (bison:ruleByNumber): ... this for clarity.
5111 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5112 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5113 (xsl:template match="reduction"): Update.
5114 (xsl:template match="item"): Update.
5115 (xsl:template match="reduction"): Update.
5116
5117 In the XML output, don't print the list of rules where symbols appear.
5118 Compute it in XSLT instead. Discussed at
5119 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5120 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5121 (bison:ruleByRhs): New.
5122 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5123 bison:ruleByRhs.
5124 (xsl:template match="terminal/rule"): Remove.
5125 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5126 bison:ruleByRhs.
5127 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5128 Remove.
5129 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5130 bison:ruleByRhs and mode="number-link" for rule template.
5131 (xsl:template match="terminal/rule"): Remove.
5132 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5133 bison:ruleByRhs and mode="number-link" for rule template.
5134 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5135 Rewrite as...
5136 (xsl:template match="rule" mode="number-link"): ... this.
5137 * src/print-xml.c (print_grammar): Don't print the list of rules.
5138
ef1b4273
JD
51392007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5140
5141 Don't let --report affect XML output; always print all information.
5142 Discussed at
5143 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5144 * src/conflicts.c (log_resolution): Implement.
5145 * src/print-xml.c (print_core): Implement.
5146 (print_state): Implement.
5147 (print_xml): Implement.
5148
5149 * NEWS (2.3a+): Fix quotes.
5150 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5151 don't let %verbose clear the list specified by --report.
5152
0f6cd9e3
AD
51532007-11-26 Akim Demaille <akim@epita.fr>
5154
5155 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5156
d80fb37a
JD
51572007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5158
5159 In the XML output, list useless and unused symbols and rules with the
5160 useful ones and add a "usefulness" attribute. Discussed starting at
5161 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5162 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5163 (grammar_rules_print_xml): Print all rules instead of just those
5164 useful in the grammar, and add a "usefulness" attribute.
5165 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5166 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5167 (print_grammar): Print all nonterminals instead of just useful ones,
5168 and add a "usefulness" attribute to nonterminals and terminals.
5169 (print_xml): Don't print a separate "reductions" or
5170 "rules-useless-in-parser" element.
5171 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5172 (reduce_xml): Remove.
5173 (reduce_token_unused_in_grammar): New.
5174 (reduce_nonterminal_useless_in_grammar): New.
5175 * src/reduce.h (reduce_xml): Remove prototype.
5176 (reduce_token_unused_in_grammar): Add prototype.
5177 (reduce_nonterminal_useless_in_grammar): Add prototype.
5178 * data/xslt/xml2text.xsl: Update for XML changes.
5179 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5180 * tests/reduce.at (Useless Terminals): Update output.
5181 (Useless Rules): Update output.
5182 (Reduced Automaton): Update output.
5183
5184 Say "Terminals unused in grammar" instead of "Unused terminals".
5185 * NEWS (2.3a+): Update.
5186 * doc/bison.texinfo (Understanding): Update example output.
5187 * src/reduce.c (reduce_output): Implement.
5188 * data/xslt/xml2text.xsl: Implement.
5189 * data/xslt/xml2xhtml.xsl: Implement.
5190
1bb2bd75
JD
51912007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5192
5193 Accept --report-file=FILE to override the default `.output' filename.
5194 * NEWS (2.3a+): Mention.
5195 * doc/bison.texinfo (Bison Options): Add an entry.
5196 * src/files.c (compute_output_file_names): Don't override
5197 spec_verbose_file if already set.
5198 * src/getargs.c (usage): Document --report-file.
5199 (REPORT_FILE_OPTION): New anonymous enum member.
5200 (long_options): Add entry for it.
5201 (getargs): Add case for it setting spec_verbose_file.
5202
5203 * build-aux/cross-options.pl: Don't record a short option just because
5204 there's an arg.
5205 * doc/.cvsignore: Add yacc.1.
5206
a005a9c4
AD
52072007-11-14 Akim Demaille <akim@epita.fr>
5208
5209 * doc/yacc.1.in: New.
5210 * configure.ac, doc/Makefile.am: Adjust.
5211 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5212 config.h symbol.
5213 Use AC_SUBST for assignments too.
5214 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5215
cff03fb2
JD
52162007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5217
5218 * src/gram.c: Remove comments that duplicate comments in gram.h.
5219
5220 When reporting useless rules and nonterminals, say "useless in grammar"
5221 instead of "useless", and say "useless in parser" instead of "never
5222 reduced". Discussed starting at
5223 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5224 * NEWS (2.3a+): Mention this change.
5225 * data/xslt/xml2text.xsl: Update output text and expected input XML
5226 element names to match changes below.
5227 * data/xslt/xml2xhtml.xsl: Likewise.
5228 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5229 Contents: "Rules useless in parser due to conflicts".
5230 * doc/bison.texinfo (Decl Summary): Reword a little.
5231 (Understanding): Update example output for changes below.
5232 * src/gram.c: (rule_useful_p): Rename to...
5233 (rule_useful_in_grammar_p): ... this.
5234 (rule_useless_p): Rename to...
5235 (rule_useless_in_grammar_p): ... this.
5236 (rule_never_reduced_p): Rename to...
5237 (rule_useless_in_parser_p): ... this.
5238 (grammar_rules_print): Update for renames.
5239 (grammar_rules_print_xml): Update for renames.
5240 (grammar_rules_never_reduced_report): Rename to...
5241 (grammar_rules_useless_report): ... this since it is used for either
5242 kind of useless rule.
5243 * src/gram.h: Reword comments and update function names in prototypes.
5244 * src/main.c (main): Say "rule useless in parser due to conflicts".
5245 * src/print-xml.c (print_rules_never_reduced): Rename to...
5246 (print_rules_useless_in_parser): ... this, and rename output XML
5247 element "rules-never-reduced" to "rules-useless-in-parser".
5248 (print_xml): Update for rename.
5249 * src/print.c (print_results): Say "Rules useless in parser due to
5250 conflicts".
5251 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5252 (nonterminals_reduce): Say "nonterminal useless in grammar".
5253 (reduce_output): Say "Nonterminals useless in grammar".
5254 Say "Rules useless in grammar".
5255 (reduce_xml): Rename output XML element "useless" to
5256 "useless-in-grammar".
5257 (reduce_print): Don't report the count of grammatically useless rules
5258 as "rules never reduced" just because %yacc is specified.
5259 In the correct report of this count, say nonterminal(s) and rule(s)
5260 "useless in grammar".
5261 * tests/conflicts.at (S/R in initial): Update expected output.
5262 (Defaulted Conflicted Reduction): Likewise.
5263 (Unreachable States After Conflict Resolution): Likewise.
5264 * tests/existing.at (GNU pic Grammar): Likewise.
5265 * tests/reduce.at (Useless Nonterminals): Likewise.
5266 (Useless Rules): Likewise.
5267 (Reduced Automaton): Likewise.
5268 (Underivable Rules): Likewise.
5269 (Empty Language): Likewise.
5270
66f0441d
JD
52712007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5272
5273 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5274 here document and before the EOF so that BSD's implementation of Bourne
5275 shell doesn't parse the delimiter as part of the here document.
5276 * doc/.cvsignore: Add cross-options.texi.
5277 * src/getargs.c (usage): Add a blank line after the warning categories.
5278
d0ee4105
PB
52792007-11-08 Paolo Bonzini <bonzini@gnu.org>
5280
5281 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5282
e8b1fb9b
AD
52832007-11-05 Akim Demaille <akim@epita.fr>
5284
5285 Remove Id: from bison.1.
5286 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5287 (perl -0777 -pi -e 's/\.PP\nId): New.
5288 (.x.1): Use it to ignore the version control revision.
5289
2f7a96b5
AD
52902007-11-05 Akim Demaille <demaille@gostai.com>
5291
5292 * build-aux/Makefile.am: Ship cross-options.pl.
5293 * doc/Makefile.am: Always refer to cross-options.texi with
5294 $(srcdir).
5295 (MAINTAINERCLEANFILES): Add it.
5296
f4101aa6
AD
52972007-11-04 Akim Demaille <demaille@gostai.com>
5298
5299 Generate the long/short option cross-table.
5300 * build-aux/cross-options.pl: New.
5301 * doc/Makefile.am (cross-options.texi): New.
5302 * doc/bison.texinfo: Use it.
5303
727a1401
AD
53042007-11-04 Akim Demaille <demaille@gostai.com>
5305
5306 Generate bison.1 using help2man.
5307 * doc/common.x, doc/bison.x: New.
5308 * doc/Makefile.am (bison.1, .x.1): New.
5309 The code is taken from autoconf-2.61/man/Makefile.am.
5310 * configure.ac: Look for help2man.
5311
6aeb9c57
AD
53122007-11-04 Akim Demaille <demaille@gostai.com>
5313
5314 Complete --help.
5315 * src/getargs.c (usage): Document -W, make it clear that -d,
5316 -g and -x have optional arguments.
5317
d7be4085
AD
53182007-11-04 Akim Demaille <demaille@gostai.com>
5319
5320 Find sha1sum when named gsha1sum.
5321 * bootstrap (find_tool): New.
5322 ($SHA1SUM): New.
5323
d9df47b6
JD
53242007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5325
5326 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5327 at
5328 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5329 * NEWS (2.3a+): Mention.
5330 * data/bison.m4 (b4_pure_if): Don't define it here.
5331 * data/c.m4 (b4_identification): Depend on individual skeletons to
5332 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5333 values of the %define variables api.pure or api.push_pull. Define
5334 YYPURE, YYPUSH, and YYPULL accordingly.
5335 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5336 glr.cc has already defined b4_pure_flag.
5337 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5338 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 5339 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
5340 * doc/bison.texinfo (Pure Decl): Update.
5341 (Push Decl): Update.
5342 (Decl Summary): Add api.pure to %define entry.
5343 In %pure-parser entry, say it's deprecated and reference %define.
5344 (Pure Calling): Update.
5345 (Error Reporting): Update.
5346 (C++ Scanner Interface): Update.
5347 (How Can I Reset the Parser): Update.
5348 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5349 reference %define.
5350 * src/getargs.c (pure_parser): Remove global variable.
5351 * src/getargs.h (pure_parser): Remove extern.
5352 * src/output.c (prepare): Don't define pure_flag muscle.
5353 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5354 wrapper around `%define api.pure'.
5355 * tests/calc.at (Simple LALR Calculator): Update.
5356 (Simple GLR Calculator): Update.
5357 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5358 Update.
5359 (GLR: Resolve ambiguity, pure, locations): Update.
5360 (GLR: Merge conflicting parses, pure, no locations): Update.
5361 (GLR: Merge conflicting parses, pure, locations): Update.
5362 * tests/glr-regression.at (Uninitialized location when reporting
5363 ambiguity): Update
5364 * tests/input.at (Unused %define api.pure): New test case.
5365 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5366 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5367 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5368
c373bf8b
JD
53692007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5370
5371 %define push_pull -> %define api.push_pull. Discussed starting at
5372 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5373 * data/push.c: Expect the new name.
5374 * data/yacc.c: Likewise.
5375 * doc/bison.texinfo (Push Decl): Update.
5376 (Decl Summary): Update %define entry.
5377 (Push Parser Function): Update.
5378 (Pull Parser Function): Update.
5379 (Parser Create Function): Update.
5380 (Parser Delete Function): Update.
5381 * tests/calc.at (Simple LALR Calculator): Update.
5382 * tests/input.at (%define enum variables): Update.
5383 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5384 (Push Parsing: Multiple impure instances): Update.
5385 (Push Parsing: Unsupported Skeletons): Update.
5386 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5387 (Exploding the Stack Size with Malloc): Update.
5388
5389 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5390 other entries some.
5391
32f19b6b
JD
53922007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5393
5394 For the XML output's terminal element, rename @number to @token-number,
5395 and add @symbol-number. In the nonterminal element, rename @number to
5396 @symbol-number. Discussed starting at
5397 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5398 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5399 renames.
5400 (xsl:template match="nonterminal"): Likewise.
5401 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5402 (xsl:template match="nonterminal"): Likewise.
5403 * src/print-xml.c (print_grammar): Implement.
5404
255a6b90
JD
54052007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5406
5407 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5408 2007-10-11 change, the child elements here are items not rules.
408476bc 5409 (xsl:template match="item"): New.
255a6b90
JD
5410 (xsl:template match="rule"): Update for new reduced itemset.
5411 (xsl:template match="point"): Remove.
5412 (xsl:template match="empty"): For consistency with --graph, don't
5413 output "/* empty */".
5414 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5415 line-wrap, don't pass a negative value as first-line-length since this
5416 won't work with the following changes.
5417 (xsl:template name="line-wrap"): Simplify slightly.
5418 (xsl:template name="ws-search"): Eliminate recursion.
5419 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5420 set next to an item whose dot is not at the end of the RHS even if it
5421 happens to be associated with the same rule.
5422
88c78747
JD
54232007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5424
31984206
JD
5425 Add %define lr.keep_unreachable_states.
5426 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5427 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5428 * src/main.c (main): Implement it.
5429 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5430 Extend to test it, and fix a typo.
5431
54322007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5433
5434 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
5435 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5436 the example .output text.
5437 * tests/regression.at (Extra lookahead sets in report): Improve wording
5438 of comments.
5439
b7a70162
WP
54402007-10-17 Wojciech Polak <polak@gnu.org>
5441
5442 * src/print-xml.c (print_grammar): Renamed
5443 <terminal> and <nonterminal> attributes:
5444 "type" to "number" and "symbol" to "name".
5445 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5446 Use new attribute names.
5447 (xsl:template match="nonterminal"): Likewise.
5448 * data/xslt/xml2xhtml.xsl: Likewise.
5449
a0de5091
JD
54502007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5451
5452 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5453 (Option Cross Key): Likewise.
5454
5455 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5456 next to an item whose dot is not at the end of the RHS even if it
5457 happens to be associated with the same rule.
5458 * src/print.c (print_core): Likewise.
5459 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5460 (Resolved SR Conflicts): Update output.
5461 * tests/regression.at (Extra lookahead sets in report): New test case.
5462
4c20d18d
WP
54632007-10-11 Wojciech Polak <polak@gnu.org>
5464
5465 * src/print-xml.c (print_core): Remove item set
5466 redundancy.
5467 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5468 Improve processing time. Suggested by Joel E. Denny.
5469 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5470 Write xsl:param "required" attribute as comment.
5471 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5472 (xsl:template match="rule"): Support new reduced itemset.
5473 (xsl:template match="point"): Remove.
5474 * data/xslt/xml2xhtml.xsl: Likewise.
5475
f506ad1c
JD
54762007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5477
5478 * src/getargs.c (version): Update copyright year.
5479
21f1b063
JD
54802007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5481
5482 Make xml2dot.xsl and --graph produce the same output.
5483 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5484 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5485 escaped later.
5486 (xsl:template name="output-node"): Use the new escape template instead
5487 of the string-replace template directly.
5488 (xsl:template name="output-edge"): Likewise.
5489 (xsl:template name="escape"): New, escapes backslashes and newlines in
5490 addition to quotation marks.
5491 * src/graphviz.c (start_graph, output_node, output_edge): Add
5492 whitespace to output for legibility.
5493
5494 Make xml2text.xsl and --report produce the same output, and remove the
5495 XML "conflicts" element since a conflict summary is easily extracted
5496 from the automaton.
5497 * data/xslt/bison.xsl: New.
5498 (xsl:template match="state" mode="bison:count-conflicts): New.
5499 * data/xslt/xml2text.xsl: Import bison.xsl.
5500 (xsl:template match="bison-xml-report"): Instead of styling the
5501 "conflicts" element, style the "automaton" element with mode
5502 "conflicts". Unlike the former, the latter lists S/R and R/R
5503 conflicts for a state on the same line.
5504 (xsl:template match="conflicts"): Remove.
5505 (xsl:template match="conflict"): Remove.
5506 (xsl:template match="terminal"): Line-wrap the list of rules in which
5507 the terminal is used.
5508 (xsl:template match="nonterminal"): Likewise for nonterminals.
5509 (xsl:template match="automaton" mode="conflicts"): New.
5510 (xsl:template match="state" mode="conflicts"): New.
5511 (xsl:template name="line-wrap"): New.
5512 (xsl:template name="ws-search"): New.
5513 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5514 (xsl:template match="bison-xml-report"): Instead of styling the
5515 "conflicts" element, style the "automaton" element with mode
5516 "conflicts."
5517 (xsl:template match="conflicts"): Remove.
5518 (xsl:template match="conflict"): Remove.
5519 (xsl:template match="automaton" mode="conflicts"): New.
5520 (xsl:template match="state" mode="conflicts): New.
5521 * src/conflicts.c (conflicts_output_xml): Remove.
5522 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5523 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5524 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5525 the corresponding XSLT is easier. Also, never wrap between a word and
5526 the comma that follows it.
5527
793fbca5
JD
55282007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5529
5530 Improve C++ namespace support. Discussed starting at
5531 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5532 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5533 b4_namespace_close): New macros that interpret the %define variable
5534 "namespace" so its value can contain "::" to indicate nested
5535 namespaces.
5536 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5537 the above macros.
5538 * data/lalr1.cc (b4_namespace): Likewise.
5539 * data/location.cc (b4_namespace): Likewise.
5540 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5541 inside a new table in the general %define entry. Document `%define
5542 namespace' there as well. Point the %name-prefix entry to it since it
5543 explains it more completely in the case of C++.
5544 (C++ Bison Interface): Mention `%define namespace' instead of
5545 %name-prefix.
5546 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5547 entry suffices.
5548 * tests/c++.at (Relative namespace references): New test case.
5549 (Absolute namespace references): New test case.
5550 (Syntactically invalid namespace references): New test case.
5551 * tests/input.at (C++ namespace reference errors): New test case.
5552
35b8730d
JD
55532007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5554
5555 Add syncline support and location accessor to internal %define
5556 interfaces.
5557 * data/bison.m4 (b4_percent_define_get_loc): New.
5558 (b4_percent_define_get_syncline): New.
5559 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5560 (b4_percent_define_default): Record defining location as line 1 rather
5561 than 0 for the sake of synchronizing #line's, and define
5562 b4_percent_define_syncline(VARIABLE).
5563 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5564 * src/muscle_tab.c (muscle_syncline_grow): New.
5565 (muscle_code_grow): Use muscle_syncline_grow.
5566 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5567 define b4_percent_define_syncline(VARIABLE).
5568 (muscle_percent_define_get_loc): New.
5569 (muscle_percent_define_get_syncline): New.
5570 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5571 remove some unused variables.
5572 (muscle_percent_define_default): Record defining location as line 1
5573 rather than 0 for the sake of synchronizing #line's, and define
5574 b4_percent_define_syncline(VARIABLE).
5575 (muscle_percent_define_check_values): Use
5576 muscle_percent_define_get_loc.
5577 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5578 (muscle_percent_define_get_syncline): Prototype.
5579 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5580 defaults): Update output for location change.
5581 (Complaining during macro argument expansion): Extend to test
5582 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5583
7dc4a694
JD
55842007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5585
5586 Fix some error-reporting macro bugs.
5587 * data/bison.m4 (b4_cat): New.
5588 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5589 to stdout so they don't become arguments to other macros. Update
5590 comments and add examples.
5591 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5592 add examples.
5593 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5594 after printing the error directive so that M4 doesn't report subsequent
5595 problems that are induced by this problem.
5596 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5597 instead of just in them. Recognize @\n in both places. Both expand to
5598 the empty string. Needed by b4_cat.
5599 * tests/skeletons.at (Complaining during macro argument expansion):
5600 New test case.
5601 (Fatal errors make M4 exit immediately): New test case.
5602
d4bd2295
JD
56032007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5604
5605 Implement --print-datadir.
5606 * src/getargs.c (usage): Mention.
5607 (PRINT_DATADIR_OPTION): New anonymous enum member.
5608 (long_options): Add entry for it.
5609 (getargs): Add case for it calling compute_pkgdatadir.
5610 * src/output.c (output_skeleton): Encapsulate data directory
5611 computation from here...
5612 (prepare): ... and from here...
5613 (compute_pkgdatadir): ... into this new function.
5614 * src/output.h (compute_pkgdatadir): Prototype.
5615
34cdeddf
JD
56162007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5617
5618 * src/print-xml.c (escape_bufs): New static global variable
5619 replacing...
5620 (xml_escape_n): ... the static local variable buf here.
5621 (print_xml): Free memory for escape_bufs.
5622 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5623
d782395d
JD
56242007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5625
5626 Replace `%push-parser' and `%push-pull-parser' with
5627 `%define push_pull "push"' and `%define push_pull "both"'.
5628 `%define push_pull "pull"' is the default.
5629 * doc/bison.texinfo (Push Decl, Push Parser Function,
5630 Pull Parser Function, Parser Create Function, Parser Delete Function):
5631 Update declarations.
5632 (Decl Summary, Table of Symbols): Replace %push-parser and
5633 %push-pull-parser entries with a %define push_pull entry.
5634 * data/bison.m4 (b4_percent_define_check_values): New macro.
5635 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5636 definitions...
5637 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5638 definitions...
5639 * data/push.c: ... to here and compute them from the value of the
5640 %define variable push_pull.
5641 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5642 parsing requests here...
5643 * data/yacc.c: ... hack this to switch to push.c any time
5644 b4_use_push_pull_flag or the %define variable push_pull is set. This
5645 will go away when we mv push.c yacc.c.
5646 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5647 push parsing is not supported since unused %define variables are
5648 reported anyway.
5649 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5650 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5651 comments for consistency with b4_percent_define_check_values.
5652 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5653 muscles.
5654 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5655 Remove.
5656 (prologue_declaration): Remove %push-parser and %push-pull-parser
5657 rules.
5658 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5659 * tests/calc.at: Update declarations.
5660 * tests/input.at (%define enum variables): New test case.
5661 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5662 declaration.
5663 (Push Parsing: Multiple impure instances): Update declaration.
5664 (Push Parsing: Unsupported Skeletons): New test case.
5665 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5666 declaration.
5667 (Exploding the Stack Size with Malloc): Update declaration.
5668
3f999f78
WP
56692007-09-24 Wojciech Polak <polak@gnu.org>
5670
5671 Add XSLT transformations.
5672
5673 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5674 * data/xslt/xml2text.xsl: Transform XML into plain text.
5675 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5676 * data/Makefile.am (xsltdir): New variable.
5677 (dist_xslt_DATA): Add xslt/*.xsl files.
5678
a4f75309
PE
56792007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5680
5681 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5682 Problem reported by Wojciech Polak.
5683 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5684 (xml_printf): Undo change I made on 21 September; that is,
5685 indent 2 spaces, not 1.
5686
ad5feac4
JD
56872007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5688
5689 Pacify ./configure --enable-gcc-warnings.
5690 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5691 `char const *' instead of `char *'.
5692 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5693 local variable `sep'.
5694
41d7a5f2
PE
56952007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5696
5697 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5698 elsewhere.
5699 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5700 (xml_printf): Indent just 1 space for level.
5701 (e_char, xlate_char): Remove.
5702 (xml_escape_string): Rewrite to avoid undefined behavior (used
5703 storage that was freed from the stack).
5704 (xml_escape_n): Don't bother checking for subscript error.
5705
3f999f78
WP
57062007-09-21 Wojciech Polak <polak@gnu.org>
5707
5708 Add Bison XML Automaton Report.
41d7a5f2
PE
5709
5710 Add support for an -x option to generate an XML report.
5711 It is not documented yet.
5712 * src/print-xml.c: New file.
5713 * src/print-xml.h: Likewise.
5714 * lib/timevar.def (TV_XML): New var.
5715 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5716 * src/conflicts.c: Include print-xml.h.
5717 (solved_conflicts_xml_obstack): New var.
5718 (log_resolution, conflicts_solve, conflicts_free):
5719 Add support for XML report.
5720 (conflicts_output_val): New function.
5721 * src/conflicts.h (conflicts_output_val): New decl.
5722 * src/files.c (spec_xml_file): New var.
5723 (compute_output_file_names, output_file_names_free): Add XML support.
5724 * src/files.h (spec_xml_file): New decl.
5725 * src/getargs.c (xml_flag): New var.
5726 (usage, short_options, long_options, getargs): Add XML support.
5727 * src/getargs.h (xml_flag): New decl.
5728 * src/gram.c: Include print-xml.h.
5729 (rule_lhs_print_xml, rule_rhs_print_xml):
5730 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5731 New functions.
5732 * src/gram.h: Declare external ones.
5733 * src/main.c: Include print-xml.h.
5734 (main): Add XML support.
5735 * src/reduce.c: Include print-xml.h.
5736 (reduce_xml): New function.
5737 * src/reduce.h: Declare it.
5738 * src/state.c: Include print-xml.h.
5739 (state_new): Add XML support.
5740 (state_rule_lookahead_tokens_print_xml): New function.
5741 * src/state.h: Declare it.
5742 (struct state): New member solved_conflicts_xml.
5743 * src/symtab.c (symbol_class_get_string): New function.
5744 * src/symtab.h: Declare it.
5745
6d8e724d
PE
57462007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5747
5748 * GNUmakefile: Switch to coreutils's version.
5749 * bootstrap: Likewise.
5750 * Makefile.cfg: Adjust to new GNUmakefile.
5751 * README-hacking: Likewise.
5752
5753 Import from gnulib:
5754
5755 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5756 Bruno Haible <bruno@clisp.org>
5757
5758 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5759 and is a script that invokes bison. Tighten the code. Add comments.
5760
922bdd7f
JD
57612007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5762
5763 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5764 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5765 * doc/bison.texinfo (Decl Summary): Fix.
5766 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5767 * tests/input.at (Boolean %define variables): Update output.
5768 * tests/skeletons.at (%define boolean variables: invalid skeleton
5769 defaults): Rename to...
5770 (%define Boolean variables: invalid skeleton defaults): ... this and
5771 update output.
5772
1b17b01d
JD
57732007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5774
5775 In impure push mode, don't allow more than one yypstate to be allocated
5776 since multiple impure parsers would corrupt yynerrs.
5777 * data/push.c (yypstate_allocated): New static global variable
5778 initialized to 0.
5779 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5780 exhaustion if yypstate_allocated is 1, but still return 2.
5781 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5782 already 1. Otherwise, set it to 1.
5783 (yypstate_delete): Set it to 0.
5784 * tests/push.at (Push Parsing: Multiple impure instances): New test
5785 case.
5786
9987d1b3
JD
57872007-08-17 Bob Rossi <bob@brasko.net>
5788
5789 * doc/bison.texinfo (Push Decl): Document the push parser.
5790 (Table of Symbols): Ditto.
5791 (Pure Decl): Ditto.
5792 (Decl Summary): Ditto.
5793 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5794 Parser Create Function, Parser Delete Function):
5795 Add new push parser symbols.
5796 (Table of Symbols): Document push-parser, push-pull-parser,
5797 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5798
f16b0819
PE
57992007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5800
5801 Update to GPLv3.
5802 * doc/gpl-3.0.texi: New file.
5803 * doc/gpl.texi: Remove.
5804 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5805 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5806 * README-hacking, TODO, bootstrap, bootstrap.conf:
5807 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5808 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5809 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5810 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5811 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5812 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5813 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5814 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5815 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5816 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5817 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5818 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5819 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5820 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5821 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5822 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5823 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5824 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5825 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5826 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5827 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5828 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5829 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5830 * src/complain.c, src/complain.h, src/conflicts.c:
5831 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5832 * src/files.h, src/flex-scanner.h, src/getargs.c:
5833 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5834 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5835 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5836 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5837 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5838 * src/print.c, src/print.h, src/print_graph.c:
5839 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5840 * src/reduce.h, src/relation.c, src/relation.h:
5841 * src/revision.h, src/scan-code.h, src/scan-code.l:
5842 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5843 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5844 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5845 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5846 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5847 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5848 * tests/existing.at, tests/glr-regression.at:
5849 * tests/headers.at, tests/input.at, tests/java.at:
5850 * tests/local.at, tests/output.at, tests/push.at:
5851 * tests/reduce.at, tests/regression.at, tests/sets.at:
5852 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5853 * tests/torture.at:
5854 Update to GPLv3.
5855
728c4be2
JD
58562007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5857
5858 Get rid of broken %no-parser, -n, and --no-parser implementation and
5859 documentation.
5860 * TODO: Don't mention them.
5861 * doc/bison.1: Likewise.
5862 * doc/bison.texinfo (Decl Summary): Likewise.
5863 (Bison Options): Likewise.
5864 (Option Cross Key): Likewise.
5865 * src/getargs.c (no_parser_flag): Remove global variable.
5866 (usage): Don't print description of -n and --no-parser.
5867 (long_options): Remove --no-parser entry here.
5868 (getargs): Remove -n case in the switch here.
5869 * src/getargs.h (no_parser_flag): Remove extern.
5870 * tests/regression.at (Web2c Actions): Remove comment that mentions
5871 --no-parser.
5872
5d31a216
JD
58732007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5874
5875 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5876 name user variables starting with `yy'. Just pass NULL instead of a
5877 dummy local &yylval to yypush_parse.
5878 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5879 starting with `yy'.
5880
a2ea208d
JD
58812007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5882
5883 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5884 true since it's then always used regardless of whether yyoverflow is
5885 defined. Reported by Christian Burger at
5886 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5887 * THANKS: Add Christian Burger.
5888
91661ebb
JD
5889 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5890 node names: say "Decl Summary" not "Bison Declaration Summary".
5891
cbd50549
JD
58922007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5893
5894 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5895 determine whether this function has already complained about an invalid
5896 value for a %define boolean variable, don't check whether Bison has
5897 ever examined the value. As written, the check was a tautology.
5898 Instead, record and check for this complaint using a separate muscle.
5899
eb1b0740
JD
59002007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5901
5902 Fix push parsing memory leak reported by Brandon Lucia at
5903 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5904 * THANKS: Add Brandon Lucia.
5905 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5906 but the parse never completed and thus freed it.
5907 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5908 * tests/testsuite.at: Include push.at.
5909 * test/push.at: New.
5910 (Push Parsing: Memory Leak for Early Deletion): New test case.
5911
9d774aff
JD
59122007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5913
5914 Improve handling of multiple S/R conflicts in the same state and of S/R
5915 conflicts involving multiple reductions.
5916 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5917 set for a state here or Bison will abort if it is reassigned on a
5918 later conflicted reduction in the same state.
5919 Similarly, don't finalize and assign the solved conflicts report here
5920 or it will be lost if it is reassigned on a later conflicted reduction
5921 in the same state.
5922 (set_conflicts): Instead, assign them both here after all S/R conflicts
5923 in the state have been fully examined.
5924 * src/print.c (shift_set): Rename to...
5925 (no_reduce_set): ... this.
5926 (print_reductions): Update for rename, and add %nonassoc error action
5927 tokens to no_reduce_set so that, when printing the first remaining
5928 reduction on an error action token, the reduction is enclosed in
5929 brackets.
5930 (print_results): Update for rename.
5931 * tests/conflicts.at (Solved conflicts report for multiple reductions
5932 in a state): New test case.
5933 (%nonassoc error actions for multiple reductions in a state): New test
5934 case.
5935
5936 * src/main.c (main): Don't depend on C99 features.
5937
10159d2a
JD
59382007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5939
5940 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
5941 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5942 uniwidth.
10159d2a 5943
953b3935
JD
59442007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
5945
5946 * bootstrap (slurp): Create target directories that don't exist.
5947 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
5948
6ce2d93a
JD
59492007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5950
5951 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
5952 than item number.
5953 * closure.c (closure): Likewise.
5954 * state.h (reductions): Comment sorting of rules.
5955 (state): Comment sorting of items.
5956
ce3448d5
JD
59572007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
5958
5959 Fix C++ test cases after recent Gnulib changes. Discussed starting at
5960 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
5961 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
5962 definition in order to avoid Gnulib headers since we don't use config.h
5963 here.
5964 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
5965 rather than AT_DATA so that config.h is included.
5966
8a86eef0
JD
59672007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
5968
5969 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
5970 instead of fprintf. Guard these functions with #if YYDEBUG instead of
5971 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
5972 and so that YYFPRINTF is guaranteed to be defined here.
5973
b1a81613
JD
59742007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5975
5976 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
5977 with...
5978 (muscle_percent_define_check_values): ... this more helpful function.
5979 Again, it's not used yet, but it will be.
5980 * src/muscle_tab.h: Likewise.
5981
71b61d4d
JD
5982 Improve some comments in parser table construction.
5983 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
5984 (generate_states): Don't mention ruleset, which is internal to closure.
5985 * src/closure.c (closure): Explain sorting of core and itemset, which
5986 is required for this function to behave correctly.
5987 * src/closure.h (closure): Mention sorting.
5988
2a6b783d
JD
59892007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
5990
5991 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5992 move the check for disabled transitions to an aver since conflict
5993 resolution hasn't happened yet.
5994
5995 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5996 labels a state as inconsistent just because it has error transitions.
5997 The original form of this check appeared in revision 1.1 of lalr.c,
5998 which was committed on 1991-12-21. Now (at least), changing the
5999 consistency label on such a state appears to have no useful effect in
6000 any of the places it is examined, which I enumerate below. The key
6001 point to understanding each item in this enumeration is that a state
6002 with an error transition is labelled consistent in the first place only
6003 if it has no rules, so the check cannot matter for states that have
6004 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6005 to try to identify its conflicts, and a state must have *rules* to have
6006 conflicts. (2) Labelling a state as inconsistent will affect how
6007 action_row sets the default *rule* for the state. (3) Labelling a
6008 state as inconsistent will cause build_relations to add lookback edges
6009 to *rules* in that state.
6010 * src/state.h (struct state): Word the comment for member consistent
6011 more carefully.
6012
14462c2b
JD
60132007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6014
6015 Don't depend on C99 features.
6016 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6017 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6018 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6019 * src/state.c (state_mark_reachable_states): Fix for-loop.
6020 (state_remove_unreachable_states): Fix for-loop.
6021
6022 Don't widen struct state with member reachable just to temporarily
6023 record reachability. Instead, use a local bitset.
6024 * src/state.h (struct state): Remove member.
6025 * src/state.c (state_new): Don't initialize it.
6026 (state_mark_reachable_states): Rename to...
6027 (state_record_reachable_states): ... this, and use bitset.
6028 (state_remove_unreachable_states): Use bitset.
6029
5a43d418
JD
60302007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6031
6032 * src/Makefile.am (yacc): Quote target action commands properly so
6033 that the yacc script isn't corrupt. Reported by Hans Aberg at
6034 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6035
0c650a20
JD
6036 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6037 the case of pure parsers. Reported by Frans Englich at
6038 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6039 * THANKS: Add Frans Englich.
6040
61fee93e
JD
6041 * NEWS (2.3a+): In the %code entry, reference section `Bison
6042 Declaration Summary' from the manual now since the %code summary has
6043 moved there.
6044 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6045 in the rules section must be terminated by semicolons.
6046
f124d423
JD
60472007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6048
6049 Extend the front-end API for %define variables to more completely
6050 mirror the back-end. This will be useful in the future.
6051 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6052 Update comments to mention the new front-end counterparts of these
6053 macros.
6054 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6055 for muscle_string_decode and muscle_location_decode.
6056 (muscle_string_decode): New static function.
6057 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6058 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6059 functions.
6060 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6061 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6062 implementation more closely.
6063 (muscle_percent_define_invalid_value): New function.
6064 * src/muscle_tab.h (muscle_percent_define_get,
6065 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6066 Prototype.
6067
75ad86ee
JD
60682007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6069
6070 * NEWS (2.3a+): Mention yesterday's state-removal change.
6071 (2.3a): Remove the %language entry, which was added after 2.3a.
6072 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6073 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6074 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6075 tests/existing.at: Update copyright date.
6076
5967f0cf
JD
60772007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6078
6079 If conflict resolution makes states unreachable, remove those states,
6080 report rules that are then unused, and don't report conflicts in those
6081 states.
6082 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6083 New global function.
6084 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6085 function.
6086 * src/main.c (main): After conflict resolution, remove the unreachable
6087 states and update all data structures that reference states by number.
6088 * src/state.c (state_new): Initialize each state's reachable member to
6089 false.
6090 (state_mark_reachable_states): New static function.
6091 (state_remove_unreachable_states): New global function.
6092 * src/state.h (struct state): Add member bool reachable.
6093 (state_remove_unreachable_states): Prototype.
6094 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6095 New test case.
6096 * tests/existing.at (GNU pic Grammar): Update test case output now that
6097 an unused rule is discovered.
6098
b09f4f48
JD
60992007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6100
6101 Minor code cleanup in parser table construction.
6102 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6103 (new_itemsets, save_reductions): Update for rename to nitemset.
6104 * src/closure.c (nritemset): Rename to...
6105 (nitemset): ... this since the "r" appears to meaningless and isn't
6106 used in the comments.
6107 (closure): Update for rename.
6108 * src/closure.h (nritemset): Update extern to...
6109 (nitemset): ... this.
6110 * src/lalr.c (LA): Fix a typo in comments.
6111 * src/print.c (print_core): Update for rename to nitemset.
6112 * src/print_graph.c (print_graph): Likewise.
6113 * src/state.h: Fix some typos in header comments.
6114
bbb44d83
PE
61152007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6116
9b33de72
PE
6117 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6118 still sticks to ASCII. Sorry!
6119
bbb44d83
PE
6120 * README-hacking: New file, taken mostly from coreutils, with changes
6121 for Bison. Contains much of the contents of:
6122 * README-cvs: Remove.
6123 * bootstrap: Sync from gnulib.
6124 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6125 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6126
29553547
JD
61272007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6128
6129 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6130 Setzer.
6131 (Java Differences): Fix some typos.
6132 * THANKS: Add Sebastian Setzer.
6133
01b477c6
PB
61342007-03-07 Paolo Bonzini <bonzini@gnu.org>
6135
730739e4
AD
6136 * data/java.m4 (b4_single_class_if): Remove.
6137 (b4_abstract_if): Look at "%define abstract".
6138 (b4_lexer_if): New.
6139 (b4_union_name): Rename...
6140 (b4_yystype): ... to this. Map to "%define stype".
6141 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6142 b4_maybe_throws): Fix quoting.
6143 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6144 * data/lalr1.java (Lexer interface): Always define.
6145 (Lexer interface within parser class): Remove.
6146 (YYLexer class): New, used when "%code lexer" is present.
6147 (constructor): When "%code lexer" is used, pass %lex-param
6148 to the lexer constructor.
6149 (yylex, yyparse): Remove %lex-param from method invocations
6150 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6151
6152 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6153 abstract". Rename "%define union_name" to "%define stype".
6154 Rename method names according to previous patch.
6155 (Java Scanner Interface): Describe "%code lexer" instead of
6156 "%pure-parser" and "%define single_class".
6157 (Java Differences): Mention "%code lexer".
6158
6159 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6160 Include scanner here, using macros from tests/local.at.
6161 (AT_DATA_CALC_Y): Remove final argument.
6162 (_AT_CHECK_JAVA_CALC): Likewise.
6163 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6164 of %locations and %error-verbose.
6165 (main): Test with and without %lex-param.
6166 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6167 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 6168
122bea3a
JMG
61692007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6170
6171 DJGPP spefic issue. Inhibit the use of disallowed characters for
6172 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6173 and concern testsuite case 46.
6174 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6175 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6176 * djgpp/config.bat: Inhibit the use of disallowed characters.
6177
9611cfa2
JD
61782007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6179
6180 Miscellaneous %define and %code cleanup.
6181 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6182 values are interpreted.
6183 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6184 documentation a little more.
6185 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6186 muscle_percent_define_insert, muscle_percent_code_grow): New
6187 functions/macros.
6188 * src/muscle_tab.h (muscle_percent_define_insert,
6189 muscle_percent_code_grow): Prototype.
6190 * src/parse-gram.y (prologue_declaration): Use
6191 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6192 %define and %code directives.
6193
6194 Make it easy to share %define boolean variables between the front-end
6195 and back-end. Though not used yet, this will be useful in the future.
6196 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6197 Bison uses of names rather than just skeleton uses of names.
6198 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6199 b4_percent_define_skeleton_variables(VARIABLE) to
6200 b4_percent_define_bison_variables(VARIABLE).
6201 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6202 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6203 b4_percent_code_bison_qualifiers(QUALIFIER).
6204 (b4_check_user_names_wrap): Update for renames.
6205 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6206 muscle_percent_define_default): New functions mimicking
6207 b4_percent_define_flag_if and b4_percent_define_default.
6208
6209 For %define variables, report locations for invalid values and
bbb44d83 6210 redefinitions.
9611cfa2
JD
6211 * data/bison.m4 (b4_percent_define_flag_if): Read
6212 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6213 value for VARIABLE.
6214 (b4_percent_define_default): Save a special location in
6215 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6216 must later be reported as invalid.
6217 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6218 functions.
6219 (muscle_percent_define_insert): Record the location of VARIABLE in
6220 muscle percent_define_loc(VARIABLE), and use it to report the previous
6221 location for a redefinition.
6222 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6223 (muscle_percent_define_default): Update like b4_percent_define_default.
6224 (muscle_grow_user_name_list): Rename to...
6225 (muscle_user_name_list_grow): ... this for consistency and use
6226 muscle_location_grow.
6227 * src/muscle_tab.h (muscle_location_grow): Prototype.
6228 * tests/input.at (%define errors): Update expected output.
6229 * tests/skeletons.at (%define boolean variables: invalid skeleton
6230 defaults): New test case.
6231
0bf92491
JD
62322007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6233
6234 * src/print.c (lookahead_set, state_default_rule): Remove.
6235 (print_reductions): Replace state_default_rule invocation with
6236 equivalent use of yydefact, which was computed in token_actions in
6237 tables.c.
6238 (print_results): Don't allocate lookahead_set.
6239
d3b12988
PB
62402007-02-27 Paolo Bonzini <bonzini@gnu.org>
6241
6242 * data/lalr1.java: Prefix all private members with yy.
6243
f57a7536
JD
62442007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6245
6246 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 6247 Sebastien Fricker at
f57a7536 6248 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 6249 * THANKS: Add Sebastien Fricker.
f57a7536
JD
6250 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6251 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6252 accept a variable number of arguments.
6253
6404a5bf
JD
62542007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6255
6256 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6257
e4e09639
JMG
62582007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6259
6260 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6261 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6262 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6263
d7e0a1a7
PE
62642007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6265
6266 Undo my 2007-02-07 change, switching back to the c-strcase module
6267 introduced in the 2007-02-03 change. Bruno Haible reported that
6268 the 2007-02-07 change would be dangerous in Turkish if we add a
6269 language whose name contains "i", since "i" is not lowercase "I"
6270 in Turkish.
6271 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6272 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6273 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6274 * m4/.cvsignore: Remove strcase.m4.
6275 * src/getargs.c: Revert 2007-02-07 change, as follows.
6276 Include c-strcase.h.
6277 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6278
deee93a1
JD
62792007-02-11 Bruno Haible <bruno@clisp.org>
6280
6281 Enable the Java related testsuite tests when the only Java compiler
6282 found is a gcj < 4.3. Discussed at
6283 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6284 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6285
574add85
JD
62862007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6287
6288 * data/Makefile.am: Update copyright date.
6289 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6290 yypstate_new returns NULL.
6291 (yypstate_new): Return NULL if malloc does.
6292 * src/reader.c (packgram): Move translation of rule actions from the
6293 beginning of packgram to...
6294 (check_and_convert_grammar): ... here right before packgram is invoked
6295 so it's easier to write more complete comments, and remove redundant
6296 code.
6297
e785ccf7
JD
62982007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6299
6300 As in semantic actions, make @$ in %initial-action, %destructor, and
6301 %printer imply %locations.
6302 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6303 scanning @$.
6304 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6305 (@$ in %initial-action implies %locations,
6306 @$ in %destructor implies %locations,
6307 @$ in %printer implies %locations): ... these new test cases.
6308
1cfe1ed7
PE
63092007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6310
6311 Undo most of the 2007-02-03 change, switching to the strcase module
6312 now that gnulib strcase has been fixed.
6313 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6314 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6315 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6316 * m4/.cvsignore: Add strcase.m4.
6317 * src/getargs.c: Revert 2007-02-03 change, as follows.
6318 Don't include c-strcase.h.
6319 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6320 strcasecmp has "unspecified behavior" outside the POSIX locale,
6321 but it works fine in practice if at least one argument is ASCII,
6322 as is the case in Bison.
6323
0049ec86
PB
63242007-02-07 Paolo Bonzini <bonzini@gnu.org>
6325
6326 * tests/java.at: Skip tests if only one of javac/java is present.
6327 Reported by Joel E. Denny.
6328 * tests/atlocal.in: Adjust copyright years.
6329
63302007-02-05 Paolo Bonzini <bonzini@gnu.org>
6331
6332 * data/lalr1.java (Stack): Work around old verifiers that disallow
6333 access to the private fields of an inner class, from the outer class.
6334 We can make Stack's fields public because user code doesn't have access
6335 to the instance of Stack used by parse(). Reported by Paul Eggert.
6336
2c2b7220
PE
63372007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6338
6339 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6340 the right spot for these files?
6341 * bootstrap.conf (gnulib_modules): Add c-strcase.
6342 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6343 c-strncasecmp.c.
6344 * src/getargs.c: Include c-strcase.h.
6345 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6346 to avoid unspecified behavior.
6347
b2b81dae
JD
63482007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6349
6350 * doc/bison.texinfo (Decl Summary): Correct typo.
6351
c1d19e10
PB
63522007-01-30 Paolo Bonzini <bonzini@gnu.org>
6353
6354 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6355 Complain if the value does not match empty, "true" or "false".
6356 * data/c++.m4: Adjust default definitions of %define variables.
6357 * data/java.m4: Adjust default definitions of %define variables.
6358 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6359 to above behavior.
6360 * tests/input.at (Boolean %define variables): Test new behavior.
6361
8405b70c
PB
63622007-01-29 Paolo Bonzini <bonzini@gnu.org>
6363
6364 * NEWS: Mention java.
6365 * TODO: Remove things that are done.
6366 * bootstrap.conf: Add javacomp-script and javaexec-script.
6367 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6368
6369 * data/Makefile.am: Add new files.
6370 * data/java-skel.m4: New.
6371 * data/java.m4: New.
6372 * data/lalr1.java: New.
6373
6374 * doc/bison.texinfo: Put "A Complete C++ Example" under
6375 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6376 under Other Languages.
6377
6378 * src/getargs.c (valid_languages): Add Java.
6379 * src/getargs.h (struct bison_language): Update size of string fields.
6380
6381 * tests/Makefile.am: Add java.at.
6382 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6383 * tests/java.at: New.
6384 * tests/testsuite.at: Include it.
6385
3eb82471
JD
63862007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6387
6388 Clean up.
6389 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6390 at_directive_argv arguments so these no longer have to be global
6391 variables. Also, update the implementation for the following changes.
6392 (fail_for_at_directive_too_many_args,
6393 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6394 (at_directive_name): Remove as at_directive_argv[0] will be used for
6395 this now.
6396 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6397 for the directive name.
6398 (at_directive_argc, at_directive_argv): Make these local within
6399 skel_lex instead of global.
6400 (INITIAL): Update directive start action for above changes.
6401 (SC_AT_DIRECTIVE_ARG): Rename to...
6402 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6403 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6404 (scan_skel): Move yylex_destroy to...
6405 (skel_scanner_free): ... here.
6406 * tests/skeletons.at (installed skeleton file name): Rename to...
6407 (installed skeleton file names): ... this.
6408
148d66d8
JD
64092007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6410
6411 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6412 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6413 Summary" not "Directives".
6414 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6415 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6416 since the former is now the more complete one.
6417 (Prologue Alternatives): Likewise and do the same for %defines.
6418 (Table of Symbols): Add summary of %code, add summary of %define, and
6419 move full %code documentation to...
6420 (Decl Summary): ... here for consistency with other entries in these
6421 sections.
6422 Move %define entry in order to keep this list alphabetized.
6423 Reword %define entry a little to put less emphasis on the skeleton
6424 concept, which most users shouldn't have to think about.
6425
665f0c24
PE
64262007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6427
6428 Adjust to recent gnulib changes.
6429 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6430 Add string.h, string_.h, unistd_.h, wchar_.h.
6431 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6432 * src/system.h: Don't include <stpcpy.h>; this is now done by
6433 <string.h>.
6434
592d0b1e
PB
64352007-01-23 Paolo Bonzini <bonzini@gnu.org>
6436
6437 Simplify implementation of unqualified %code, implement macros for
6438 uniform treatment of boolean %define flags. Document %define.
6439 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6440 b4_percent_code_ifdef): New.
6441 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6442 * data/c++.m4: Define default value for global_tokens_and_yystype.
6443 * data/glr.cc: Likewise.
6444 * data/location.cc: Use b4_percent_define_flag_if.
6445
148d66d8 6446 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
6447
6448 * src/parse-gram.y (Unqualified %code): Change muscle name to
6449 b4_percent_code().
6450 (content.opt): Default to empty.
6451
a7867f53
JD
64522007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6453
6454 Implement support for relative and absolute skeleton file names.
6455 Discussed starting at
6456 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6457 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6458 (Bison Options): Document in --skeleton entry.
6459 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6460 full_skeleton can't necessarily hold all of pkgdatadir.
6461 If the specified skeleton file name contains a `/', don't prepend
6462 pkgdatadir.
6463 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6464 file name contains a `/', prepend the grammar file directory.
6465 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6466 * skeletons.at: New file.
6467 (relative skeleton file names): New test case.
6468 (installed skeleton file names): New test case.
6469 * tests/testsuite.at: Include skeletons.at.
6470
6471 * bootstrap: Update copyright to 2007.
6472
830c9b18
PB
64732007-01-17 Paolo Bonzini <bonzini@gnu.org>
6474
6475 * bootstrap: Remove occurrences of .#bootmp from the files.
6476
a8c2e813
AD
64772007-01-17 Akim Demaille <akim@epita.fr>
6478
6479 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6480 nonterminals.
6481 Use per-type %printer.
6482
279cabb6
JD
64832007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6484
6485 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6486 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6487 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6488 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6489 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6490 tests/glr-regression.at, tests/input.at, tests/local.at,
6491 tests/output.at, tests/torture.at: Update copyright to 2007.
6492
bb32f4f2
AD
64932007-01-16 Akim Demaille <akim@epita.fr>
6494
6495 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6496 error code.
6497 (Calc++ Scanner): Exit with failure if we can't open the input
6498 file.
6499 Accept "-" standing for stdin.
6500 (Calc++ Top Level): Print the result only if the parsing was
6501 successful.
6502
7cff04b5
AD
65032007-01-16 Akim Demaille <akim@epita.fr>
6504
6505 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6506
a4e25e1d
JD
65072007-01-15 Paolo Bonzini <bonzini@gnu.org>
6508 and Joel E. Denny <jdenny@ces.clemson.edu>
6509
6510 Clean up %define and %code implementation in M4 some. Most
6511 importantly, rename all related macros to be in the b4_percent_define
6512 and b4_percent_code namespaces. Also, complete support for `.' in
6513 %define variable names and %code qualifiers.
6514 * data/bison.m4 (b4_check_user_names): Check for special
6515 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6516 m4_foreach loops.
6517 (b4_get_percent_define, b4_get_percent_code): Rename to...
6518 (b4_percent_define_get, b4_percent_code_get): ... these.
6519 Extend documentation with examples.
6520 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6521 b4_percent_define_skeleton_variables and
6522 b4_percent_code_skeleton_qualifiers.
6523 Expect any value for the %define variable `foo' to be stored in the
6524 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6525 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6526 expect any unqualified %code blocks to be stored in a macro named
6527 `b4_percent_code_unqualified'.
6528 Use m4_indir so that %define variable names and %code qualifiers can
6529 contain `.', which is allowed by the grammar parser.
6530 (b4_percent_define_default): New macro to set a default value for a
6531 %define variable.
6532 (m4_wrap): Update wrapped code, and fix some underquoting.
6533 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6534 Expect grammar uses of %define variables and %code qualifiers to be
6535 defined in b4_percent_define_user_variables and
6536 b4_percent_code_user_qualifiers.
6537 * data/c++.m4: Use b4_percent_define_default rather than
6538 m4_define_default. Fix some underquoting. Skeleton usage of %define
6539 variable define_location_comparison now implies skeleton usage of
6540 %define variable filename_type.
6541 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6542 data/push.c, data/yacc.c: Update macro names.
6543 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6544 muscle names.
6545
e37c665c
JMG
65462007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6547
6548 DJGPP specific issues.
6549
6550 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6551 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6552
7d2d521f
JD
65532007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6554
6555 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6556 run parsers in all tests so that Valgrind is invoked during
6557 maintainer-check-valgrind.
6558 (Duplicate representation of merged trees): Free all semantic values.
6559 (Duplicated user destructor for lookahead): Likewise.
6560
e0ac9b4b
JD
65612007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6562
6563 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6564 command-line prefix.
6565 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6566 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6567 miss Valgrind messages.
6568 (Exploding the Stack Size with Malloc): Likewise.
6569
78143faa
JD
65702007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6571
6572 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6573 locals. Reported by Juan Manuel Guerrero at
6574 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6575 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6576 Fix some indentation also.
6577 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6578 explaining this issue.
6579
7ecec4dd
JD
65802007-01-09 Paolo Bonzini <bonzini@gnu.org>
6581 and Joel E. Denny <jdenny@ces.clemson.edu>
6582
6583 Simplify union and prologue handling, and escape union and lex/parse
6584 params with digraphs.
6585 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6586 values to the empty string since these are no longer guaranteed
6587 initialized by the front-end.
6588 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6589 braces around b4_user_stype since this is no longer done by the
6590 front-end.
6591 * src/files.c, src/files.h (pre_prologue_obstack,
6592 post_prologue_obstack): Remove.
6593 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6594 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6595 with digraphs. This fixes lex params and parse params.
6596 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6597 * src/output.c (prepare): Remove muscle insertion of the prologues.
6598 (output): Remove freeing of pre_prologue_obstack and
6599 post_prologue_obstack.
6600 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6601 than prologue_augment for prologue parsing so you don't need prologue
6602 obstacks.
5c80250c
JD
6603 (grammar_declaration): For %union RHS, use `braceless' instead of
6604 "{...}" so that braces are already stripped and code is escaped with
6605 digraphs.
7ecec4dd
JD
6606 * src/reader.c (prologue_augment): Remove.
6607 (reader): Remove initialization of pre_prologue_obstack and
6608 post_prologue_obstack.
6609 * src/reader.h (prologue_augment): Remove.
6610
6611 * data/c.m4: Remove stray parenthesis.
6612
16dc6a9e
JD
66132007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6614
6615 Remove quotes from variables names in %define directives and from
6616 qualifiers in %code directives, and restrict the characters that are
6617 allowed in them to M4-friendly ones. For %define, continue to support
6618 the quoted form as a deprecated feature. Discussed starting at
6619 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6620 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6621 %code.
6622 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
6623 (Decl Summary): In %defines entry, update mention of `%code requires'
6624 and `%code provides'.
16dc6a9e
JD
6625 (C++ Location Values): Update %define uses.
6626 (Calc++ Parser Interface): Likewise.
6627 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 6628 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
6629 * src/parse-gram.y (prologue_declaration): For %define variables, use
6630 `variable' instead of `STRING'.
6631 (grammar_declaration): For %code qualifiers, use `ID' instead of
6632 `STRING'.
6633 (variable): New nonterminal that takes an `ID' or a `STRING'.
6634 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6635 and %define uses.
6636 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6637 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6638 (%define errors): Update %define uses.
6639
e9813cd4
JD
66402007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6641
6642 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6643 instead of muscle_insert for %define values so that M4-special
6644 characters are replaced with digraphs.
6645 * tests/input.at (%define errors): Extend to check weird values.
6646
6afc30cc
JD
66472007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6648
6649 Instead of having skeletons declare all valid %define variables and
6650 %code qualifiers, provide macros that retrieve the associated values
6651 and build these lists automatically. Thus Bison will now warn when a
6652 variable or qualifier is not used by the skeleton in the current
6653 invocation regardless of whether it might sometimes be used by that
6654 skeleton in other invocations. Also, move all %define value macros to
6655 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6656 form, which is replaced by %code.
6657 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6658 (b4_check_user_names): ... this, and change the series of valid name
6659 arguments to a single list argument for names used in the skeleton
6660 similar to the existing list argument for names used in the grammar.
6661 Warn instead of complaining.
6662 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6663 values and %code code, to format %code code properly, and to build
6664 lists of all %define variables and %code qualifiers used in the
6665 skeleton: b4_skeleton_percent_define_variables and
6666 b4_skeleton_percent_code_qualifiers.
6667 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6668 Remove, and...
6669 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6670 the skeleton names lists can finish building first. In place of
6671 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6672 expect the lists b4_user_percent_define_variables and
6673 b4_user_percent_code_qualifiers.
6674 * data/c++.m4: Where setting default values for b4_parser_class_name,
6675 b4_location_type, b4_filename_type, b4_namespace, and
6676 b4_define_location_comparison, update their names to the
6677 b4_percent_define_ namespace.
6678 * data/glr.c: Don't use b4_check_percent_define_variables and
6679 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6680 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6681 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 6682 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
6683 * data/location.cc: Use b4_get_percent_define.
6684 * data/push.c: Don't use b4_check_percent_define_variables and
6685 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6686 * data/yacc.c: Likewise, and don't call m4_exit in
6687 b4_use_push_for_pull_if or m4_wrap code will never execute.
6688 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6689 Rename to...
6690 (muscle_grow_user_name_list): ... this for consistency with the
6691 terminology used in bison.m4.
6692 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6693 %define variable names, and rename muscle used_percent_define_variables
6694 to user_percent_define_variables.
6695 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6696 user_percent_code_qualifiers.
6697 (content): Remove.
6698 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6699 {CODE} form is no longer accepted.
6700 * tests/input.at (Reject bad %code qualifiers): Rename to...
6701 (Reject unused %code qualifiers): ... this, and update test output.
6702 (%define error): Update test output.
6703
7eb8a0bc
JD
67042007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6705
6706 Check for unrecognized %define variables similar to checking for
6707 unrecognized %code qualifiers. Check for redefined %define variables.
6708 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6709 generalizes...
6710 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6711 (b4_check_percent_define_variables): New, also wraps it.
6712 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6713 variables using b4_check_percent_define_variables.
6714 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6715 all those exercised in the test suite and all those listed in the
6716 `Default values' section of c++.m4. Are there others?
6717 * data/push.c, data/yacc.c: Declare no valid %define variables.
6718 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6719 similar to muscle_find, but it works even when the muscle stores a
6720 const value.
6721 (muscle_grow_used_name_list): New function for constructing the used
6722 name list muscles that b4_check_for_unrecognized_names requires.
6723 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6724 %define'd more than once. Define the b4_used_percent_define_variables
6725 muscle with muscle_grow_used_name_list.
6726 (grammar_declaration): Abbreviate %code code with
6727 muscle_grow_used_name_list.
6728 * tests/input.at (%define errors): New.
6729
3fc65ead
JD
67302007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6731
6732 Provide warn_at, complain_at, and fatal_at function callbacks to the
6733 skeletons, and use this for %code qualifier complaints.
6734 * data/bison.m4 (b4_error_at): New, invoked by...
6735 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6736 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6737 @fatal_at(...@) directives.
6738 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6739 qualifiers in b4_used_percent_code_qualifiers and to use
6740 b4_complain_at.
6741 * src/location.c, src/location.h (boundary_set_from_string): New global
6742 function.
6743 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6744 function.
6745 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6746 to b4_used_percent_code_qualifiers.
6747 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6748 function.
6749 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6750 (lineno): Rename to...
6751 (out_lineno): ... this so I don't misunderstand it again.
6752 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6753 here; these newlines are in the input but not the output file.
6754 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6755 (at_directive_perform): ... this new static function, and add handling
6756 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6757 directives.
6758 * tests/input.at (Reject bad %code qualifiers): Update test output with
6759 locations and extend.
6760
6761 * tests/output.at (Output file name: [, Output file name: ]): Remove
6762 bogus comment about these tests failing.
6763
1c7b7e1d
JD
67642007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6765
6766 Clean up b4_check_percent_code_qualifiers a little.
6767 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6768 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6769 documentation and add examples.
6770 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6771 qualifiers here.
6772
08af01c2
JD
67732007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6774
6775 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6776 unreliable -- especially when they're hidden inside another macro.
6777 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6778 data/c.m4: Remove m4_divert(-1).
6779 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6780 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6781 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 6782 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
6783 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6784 pushed and popped by m4sugar, should be first on the stack.
6785
6786 Provide warn, complain, and fatal function callbacks to the skeletons.
6787 This provides more flexibility than m4_fatal, improves the error
6788 message format, and captures messages for translation. Discussed
6789 starting at
6790 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6791 * data/bison.m4 (b4_error): New, invoked by...
6792 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6793 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6794 directives. Because these M4 macros might be called when the current
6795 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6796 the previous removal of uses of m4_divert, which caused trouble.
6797 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6798 m4_fatal to report unrecognized %code qualifiers.
6799 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6800 push parser requests.
6801 * data/glr.c: Use b4_complain instead of m4_fatal to report
6802 non-deterministic push parser requests.
6803 Update @output usage to @output(...@) form.
6804 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6805 report missing %defines. Update @output usage to @output(...@) form.
6806 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6807 @output(...@) form.
6808 * src/main.c (main): Invoke skel_scanner_free.
6809 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6810 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6811 obstack_for_string from flex-scanner.h.
6812 (YY_DECL): Use to declare skel_lex static.
6813 (decode_at_digraphs): Remove; now handled in the new
6814 SC_AT_DIRECTIVE_ARG start condition.
6815 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6816 functions.
6817 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6818 at_directive_argv): New static globals.
6819 (INITIAL): Use fail_for_invalid_at.
6820 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6821 recognize the start of a generalized `@directive(...@)' form and
6822 start...
6823 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6824 directive args (using the new obstack_for_string), to decode the
6825 contained @ diagraphs, and to perform the directive. It recognizes
6826 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6827 @output(...@).
6828 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6829 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6830 `@,'.
6831 (scan_skel): Initialize obstack_for_string on the first call.
6832 (skel_scanner_free): New function to free obstack_for_string.
6833 * tests/input.at (Reject bad %code qualifiers): Update test output.
6834
8e0a5e9e
JD
68352007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6836
6837 Consolidate the 4 prologue alternative directives (%code, %requires,
6838 %provides, and %code-top) into a single %code directive with an
6839 optional qualifier field. Discussed at
6840 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6841 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6842 alternatives.
6843 * doc/bison.texinfo (Prologue Alternatives): Update.
6844 (Decl Summary): Update to %code "requires" and %code "provides".
6845 (Calc++ Parser): Update to %code "requires".
148d66d8 6846 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
6847 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6848 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6849 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6850 which are skeleton-specific.
6851 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6852 declare what %code qualifiers it supports and to complain if any other
6853 qualifiers were used in the grammar.
6854 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6855 and b4_user_code([b4_percent_code_provides]) in place of
6856 b4_user_requires and b4_user_provides.
6857 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6858 Add b4_user_code([b4_percent_code_top]) and
6859 b4_user_code([b4_percent_code]).
6860 Invoke b4_check_percent_code_qualifiers.
6861 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6862 PERCENT_REQUIRES): Remove.
6863 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6864 %requires. Rewrite the %code RHS as the unqualified form defining the
6865 muscle b4_percent_code. Add another RHS for the qualified %code form,
6866 which defines muscles of the form b4_percent_code_QUALIFIER and the
6867 b4_used_percent_code_qualifiers muscle.
6868 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6869 PERCENT_REQUIRES): Remove.
6870 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6871 %code "requires" and %code "provides".
6872 * tests/input.at (Reject bad %code qualifiers): New.
6873
95021767
JD
68742007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6875
6876 Use the new code_props interface for destructors and printers.
6877 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6878 printer_location members, and change the type of the destructor and
6879 printer members to code_props.
6880 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6881 symbol_printer_get, semantic_type_destructor_set,
6882 semantic_type_printer_set, default_tagged_destructor_set,
6883 default_tagless_destructor_set, default_tagged_printer_set,
6884 default_tagless_printer_set): Use code_props in arguments and return
6885 types in place of char const * and location.
6886 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6887 since the locations are now contained in the return of
6888 symbol_destructor_get and symbol_printer_get.
6889 * src/output.c (symbol_destructors_output, symbol_printers_output):
6890 Replace with...
6891 (symbol_code_props_output): ... this to eliminate duplicate code.
6892 (output_skeleton): Update to use symbol_code_props_output.
6893 * src/reader.c (symbol_should_be_used): Update use of
6894 symbol_destructor_get.
6895 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6896 Update uses of the various _destructor_set and _printer_set functions.
6897 * src/symtab.c: (default_tagged_destructor_location,
6898 default_tagless_destructor_location, default_tagged_printer_location,
6899 default_tagless_printer_location): Remove since we...
6900 (default_tagged_destructor, default_tagless_destructor,
6901 default_tagged_printer, default_tagless_printer): ... change the type
6902 of these to code_props.
6903 (symbol_new, semantic_type_new, symbol_destructor_set,
6904 semantic_type_destructor_set, symbol_destructor_get,
6905 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6906 symbol_check_alias_consistency, default_tagged_destructor_set,
6907 default_tagless_destructor_set, default_tagged_printer_set,
6908 default_tagless_printer_set): Update.
6909 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6910 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6911 code_props members.
6912 (symbol_print): Use SYMBOL_CODE_PRINT.
6913
f6857bbf
JD
69142007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6915
6916 Use the new code_props interface for rule actions.
6917 * src/symlist.h (symbol_list): Replace action, action_location, and
6918 used members with a code_props action_props member.
6919 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6920 grammar_midrule_action, grammar_current_rule_merge_set,
6921 grammar_current_rule_symbol_append, packgram): Update.
6922 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6923 * src/scan-code.l (handle_action_dollar): Update.
6924 (translate_rule_action): Remove, no longer used.
6925 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6926
7c0c6181
JD
69272007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6928
6929 Use the new code_props interface in parse-gram.y.
6930 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6931 Update all uses of translate_* functions to use the new code_props
6932 interface and to use gram_scanner_last_string_free and
6933 code_scanner_last_string_free where possible.
6934 (grammar_declaration): symbol_list_destructor_set and
6935 symbol_list_printer_set now perform the translation, so don't do it
6936 here. Use gram_scanner_last_string_free where possible.
6937 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6938 translate_code): Remove, no longer used.
6939 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6940 symbol_list_printer_set): Perform code translation here rather than
6941 depending on the caller to do so.
6942
6943 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6944 * src/scan-gram.h (gram_last_string): Remove declaration.
6945 * src/scan-gram.l (last_string): Declare it static.
6946
28e52c0d
JD
69472007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6948
6949 Encapsulate code properties and related functionality for the various
6950 destructors, printers, and actions into a code_props structure and
6951 interface. This patch merely implements code_props in scan-code.h and
6952 scan-code.l. Future patches will rewrite other modules to use it.
6953 Discussed starting at
6954 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
6955 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
6956 consistently initialize const structs that have an empty location
6957 field.
6958 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
6959 to ensure consistency.
6960 * src/scan-code.h (code_props): New structure.
6961 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
6962 function, macro, and const global variable for initializing a
6963 code_props with no code.
6964 (code_props_plain_init, code_props_symbol_action_init,
6965 code_props_rule_action_init, code_props_translate_code): The rest of
6966 the new code_props functional interface. Among other things, the init
6967 functions set the code_props kind field so that
6968 code_props_translate_code will know whether to behave like
6969 translate_symbol_action, translate_rule_action, or translate_code.
6970 These old translate functions must remain until all other modules are
6971 updated to use the new code_props interface.
6972 (code_scanner_last_string_free): New function similar to
6973 gram_scanner_last_string_free.
6974 (code_scanner_free): Add documentation.
6975 * src/scan-code.l: Implement the new interface.
6976 (code_lex): Make it static, add a code_props* argument, and remove the
6977 rule argument.
6978 (last_string): New static global similar to the one in scan-gram.l.
6979 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
6980 instead of rule.
6981 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
6982 code_props since Bison may one day use this information for destructors
6983 and printers.
6984 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
6985 (handle_action_dollar): Use symbol_list_n_get and set used flag
6986 directly since symbol_list_n_used_set is removed.
6987 (translate_action): Add a code_props* argument and remove the rule,
6988 action, and location arguments. Pass the code_props* on to code_lex.
6989 (translate_rule_action, translate_symbol_action, translate_code):
6990 Rewrite as wrappers around the new code_props interface.
6991 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6992 it would eventually need to break the encapsulation of code_props.
6993
96034983
JD
69942007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6995
6996 * etc/.cvsignore: New.
6997
945e396c
JD
69982007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6999
7000 Add maintainer-push-check to run maintainer-check using push parsing in
7001 place of pull parsing where available.
7002 * Makefile.am (maintainer-push-check): New.
7003 * data/bison.m4 (b4_use_push_for_pull_if): New.
7004 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7005 appropriately based on their existing values.
7006 (yypush_parse): Don't print push-parser-specific diagnostics if push
7007 parsing is being used in place of pull parsing.
7008 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7009 push.c.
7010 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7011 variable, and insert b4_use_push_for_pull_flag into muscles.
7012 * tests/Makefile.am (maintainer-push-check): New.
7013
7d596384
JD
70142006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7015
7016 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7017 (whether successful or failed) so that yypush_parse can be invoked
7018 again to start a new parse using the same yypstate.
7019 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7020 check multiple yypull_parse invocations on the same yypstate. For pull
7021 mode, extend to check multiple yyparse invocations.
7022 (Exploding the Stack Size with Alloca): Extend to try with
7023 %push-pull-parser.
7024 (Exploding the Stack Size with Malloc): Likewise.
7025
7026 * tests/calc.at (Simple LALR Calculator): Don't specify
7027 %skeleton "push.c" since %push-pull-parser implies that now.
7028 * tests/headers.at (export YYLTYPE): Don't check for the push
7029 declarations. Otherwise, this test case can't be used to see if push
7030 mode can truly emulate pull mode.
7031 * tests/input.at (Torturing the Scanner): Likewise.
7032 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7033 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7034 AT_YACC_IF, which now includes the case of push mode since %skeleton
7035 need not be used for push mode. This will be more intuitive once
7036 push.c is renamed to yacc.c.
7037
7172e23e
JD
70382006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7039
7040 For push mode, convert yyparse from a macro to a function, invoke yylex
7041 instead of passing a yylexp argument to yypull_parse, and don't
7042 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7043 Discussed starting at
7044 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7045 * data/bison.m4 (b4_pull_if): New.
7046 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7047 * data/push.c: Improve M4 quoting a little.
7048 (b4_generate_macro_args, b4_parenthesize): Remove.
7049 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7050 any time a pull parser is requested.
7051 Don't #define this as a wrapper around yypull_parse. Instead, when
7052 both push and pull are requested, make it a function that does that
7053 same thing.
7054 (yypull_parse): If there's a b4_prefix, #define this to
7055 b4_prefix[pull_parse] when both push and pull are requested.
7056 Don't define this as a function unless both push and pull are
7057 requested.
7058 Remove the yylexp argument and hard-code yylex invocation instead.
7059 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7060 %push-parser.
7061 * src/getargs.c (pull_parser): New global initialized to true.
7062 * getargs.h (pull_parser): extern it.
7063 * src/output.c (prepare): Insert pull_flag muscle.
7064 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7065 (prologue_declaration): Set both push_parser and pull_parser = true for
7066 %push-pull-parser. Set push_parser = true and pull_parser = false for
7067 %push-parser.
7068 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7069 %push-parser since there's no backward-compatibility concern here.
7070 Scan %push-pull-parser.
7071 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7072 instead of %push-parser.
7073 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7074 prototype it in the module that calls yyparse.
7075 * tests/input.at (Torturing the Scanner): Likewise.
7076 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7077
2e7944cb
JD
70782006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7079
7080 Update etc/bench.pl. Optimize push mode a little (the yyn change
7081 deserves most of the credit).
7082 * Makefile.am (SUBDIRS): Add etc subdirectory.
7083 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7084 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7085 yytoken, yyval, and yyloc declarations to...
7086 (yyparse or yypush_parse): ... here to improve performance. For
7087 yypush_parse invocations after the first, be sure to assign yyn its old
7088 value again.
7089 (yypstate_new): Don't bother initializing the yyresult field since the
7090 initial value isn't used.
7091 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7092 remove the #define that, in push mode, set it to yyps->NAME.
7093 * etc/Makefile.am: New.
7094 * etc/bench.pl: Remove and build it instead from...
7095 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7096 "tests/bison" from the build directory by default rather than just
7097 invoking "bison" from $PATH.
7098 (calc_grammar): Update push parser code: don't declare yylval globally,
7099 don't define yyparse_wrapper, and don't #define yyparse.
7100 (bench_grammar): Update to check all working combinations of yacc.c,
7101 push.c, impure, pure, pull, and push.
7102
c3d50342
JD
71032006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7104
7105 For push mode, add pull wrappers around yypush_parse.
7106 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7107 (yypull_parse): New function wrapping yypush_parse.
7108 (yyparse): New #define wrapping yypull_parse.
7109 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7110 is declared.
7111 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7112 prototype yylex in the module that calls yyparse, and don't prototype
7113 yyparse there. Otherwise, the yyparse expansion won't compile.
7114 * tests/input.at (Torturing the Scanner): Likewise.
7115
94ebeba5
JD
71162006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7117
7118 Enable push parsers to operate in impure mode. Thus, %push-parser no
7119 longer implies %pure-parser. The point of this change is to move
7120 towards being able to test the push parser code by running the entire
7121 test suite as if %push-parser had been declared.
7122 * data/push.c (yypush_parse): For impure mode, remove the
7123 yypushed_char, yypushed_val, and yypushed_loc arguments.
7124 Instead, declare these as local variables initialized to the global
7125 yychar, yylval, and yylloc.
7126 For the first yypush_parse invocation only, restore the initial values
7127 of these global variables when it's time to read a token since they
7128 have been overwritten.
7129 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7130 %push-parser.
7131 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7132 %pure-parser along with %push-parser since this test case was designed
7133 for pure push parsers.
7134 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7135 (AT_YACC_OR_PUSH_IF): New.
7136 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7137 add a note that it's still wrong for some cases (as it has been for a
7138 while).
7139 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7140 %push-parser no longer implies %pure-parser.
7141
a0633178
JD
71422006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7143
7144 Remove some unnecessary differences between the pull parser code and
7145 the push parser code. This patch enables yynerrs in push mode.
7146 * data/push.c: Reformat M4 a little.
7147 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7148 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7149 because push mode is on. Instead, if pure mode is on, move yynerrs
7150 to...
7151 (b4_declare_parser_state_variables): ... here.
7152 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7153 to yyps->NAME so it can be used in yypush_parse.
7154 (yypush_parse): Don't omit uses of yynerrs in push mode.
7155
8646b6a3
JD
71562006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7157
7158 Fix bug such that the first pushed token's value and location are
7159 sometimes overwritten (sometimes by %initial-action) before being used.
7160 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7161 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7162 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7163 more closely mimic the pull parser logic.
7164 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7165 time to read a token, which is after any initialization of yylval and
7166 yylloc.
7167 (gottoken): Rename label to...
7168 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7169 user namespace.
7170
9baf4d74
JD
71712006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7172
7173 Rearrange initialization of the parser state variables so that the
7174 skeleton doesn't have to have a copy for pull mode and another for push
7175 mode. This patch also fixes at least a bug such that yylloc was not
7176 initialized (with b4_location_initial_line and
7177 b4_location_initial_column) upon calling yypush_parse. However, that
7178 initialization now overwrites the first token's location;
7179 %initial-action assigning @$ already did the same thing, and both bugs
7180 will be fixed in a later patch.
7181 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7182 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7183 yyss, yyvs, yyls, and yystacksize.
7184 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7185 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7186 yylsp.
7187 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7188 yyps->NAME so it can be used in yypush_parse.
7189 (yyparse or yypush_parse): For yypush_parse, don't print the
7190 "Starting parse" diagnostic for invocations after the first.
7191 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7192 yypush_parse, only do it for the first invocation.
7193 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7194 initialization to occur in yypush_parse but only on the first
7195 invocation.
7196
23522164
JD
71972006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7198
7199 * data/push.c: Add CPP guards around push parser declarations in both
7200 the header and the code file.
7201 In the code file, move the push parser declarations to the same place
7202 they appear in the header file.
7203 Clean up the M4 some, especially the inconsistent underquoting in
7204 some b4_c_function_def and b4_c_function_decl uses.
7205
bb010fe5
JD
72062006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7207
7208 Encapsulate the push parser state variables into an M4 macro so the
7209 push skeleton doesn't have to list them again for pull mode's yyparse.
7210 For push mode, remove yypush_parse's local equivalents of these
7211 variables to eliminate unnecessary copying between the two sets at
7212 run-time. This patch also fixes at least a bug related to multiple
7213 %initial-action invocations in push mode.
7214 * data/push.c (b4_declare_parser_variables): Rename to...
7215 (b4_declare_scanner_communication_variables): ... this for clarity and
7216 update both uses.
7217 (b4_declare_yyparse_variables): Remove and move its contents to the one
7218 spot where it was invoked.
7219 (b4_declare_parser_state_variables): New macro containing the parser
7220 state variables required by push mode.
7221 (struct yypstate): Replace all fields but yynew with
7222 b4_declare_parser_state_variables.
7223 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7224 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7225 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7226 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7227 parser state variable declarations with
7228 b4_declare_parser_state_variables.
7229 Don't initialize parser state variables when calling yypush_parse since
7230 yypstate_new already does that.
7231 Invoke the user's initial action only upon the first yypush_parse
7232 invocation.
7233 Remove all code that copies between the local parser state variables
7234 and the yypstate.
7235
2d212f8c
JD
72362006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7237
7238 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7239 prevent a name collision in a future patch where these names will
7240 sometimes be #define'd.
7241 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7242 since it no longer has the same name as the existing argument.
7243 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7244
e6e704dc
JD
72452006-12-19 Paolo Bonzini <bonzini@gnu.org>
7246 and Joel E. Denny <jdenny@ces.clemson.edu>
7247
7248 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7249 that the argument is case-insensitive, and there's no `=' here.
7250 For the %skeleton entry, mention that %language is better.
7251 (Bison Options): Likewise for --language and --skeleton. Move the
7252 --skeleton entry so that the `Tuning the parser' section is sorted
7253 alphabetically on long options.
7254 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7255 %language directive in detail here; cross-reference the %language
7256 documentation instead.
7257 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7258 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 7259 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
7260 * examples/extexi (normalize): Instead of replacing every %require
7261 argument with the current Bison version, just substitute for
7262 `@value{VERSION}'. This guarantees that we're testing what actually
7263 appears in the documentation.
7264 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7265 rather than `@VERSION@'.
7266
0e021770
PE
72672006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7268
fd575f05
PE
7269 * NEWS: Reword the %language news a bit, and put it earlier.
7270
0e021770
PE
7271 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7272 Rewrite to simplify the logic.
7273 (language_argmatch): Likewise.
fd575f05
PE
7274 (program_name): We now own this var.
7275 * src/getargs.h (struct bison_language): Use char[] rather than
7276 const char *.
0e021770
PE
7277
7278 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7279 Java is supported.
7280 * src/complain.c (program_name): Remove decl; no longer needed.
7281 * src/main.c (program_name): Remove; now belongs to getargs.
7282
72832006-12-18 Paolo Bonzini <bonzini@gnu.org>
7284
7285 * NEWS: Document %language.
7286
7287 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7288
7289 * data/c-skel.m4, data/c++-skel.m4: New files.
7290 * data/glr.c: Complain on push parsers.
7291
7292 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7293 over %skeleton.
148d66d8 7294 (Decl Summary): Document %language and %skeleton.
0e021770
PE
7295 (Command line): Document -L.
7296
7297 * examples/extexi: Rewrite %require directive.
7298 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7299
7300 * src/files.c (compute_exts_from_gc): Look in language structure
7301 for .y extension.
7302 (compute_file_name_parts): Check whether .tab should be added.
7303 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7304 (language, skeleton_arg, language_argmatch): New.
7305 (long_options): Add --language.
7306 (getargs): Use skeleton_arg, add -L/--language.
7307 * src/getargs.h: Include location.h.
7308 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7309 * src/output.c (prepare): Pick default skeleton from struct language.
7310 Don't dispatch C skeletons here.
7311 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7312 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7313 * src/scan-gram.l ("%language"): New rule.
7314
7315 * tests/calc.at: Test %skeleton and %language.
7316 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7317 (AT_GLR_IF): Look for %skeleton "glr.cc".
7318 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7319 (AT_YACC_IF): Reject %language.
7320
5691bf57
PE
73212006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7322
db06f0ce
PE
7323 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7324 since it wasn't used; only the typedef name 'semantic_type' is needed.
7325 Also, omit trailing white space.
7326
5691bf57
PE
7327 * bootstrap: Sync from coreutils.
7328 (gnulib_extra_files): Add build-aux/announce.gen.
7329 (slurp): Adjust .gitignore files like .cvsignore files.
7330 * build-aux/announce-gen: Remove from CVS, since bootstrap
7331 now creates this.
7332
791934e4
JD
73332006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7334
7335 Make %push-parser imply %pure-parser. This fixes several bugs; see
7336 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7337 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7338 pure_parser = true.
7339 * data/push.c: Don't bother testing b4_push_if when deciding whether
7340 to expand b4_declare_parser_variables globally.
7341 (yypush_parse): Likewise in here.
7342
7343 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7344 (yy_reduce_print): Reformat M4 for readability.
7345
ee5abb37
JD
73462006-12-15 Bob Rossi <bob@brasko.net>
7347 and Joel Denny <jdenny@ces.clemson.edu>
7348
7349 * data/push.c (yypstate): Add typedef, and update all uses of
7350 struct yypstate to just yypstate.
7351 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7352
16ca01f9
JD
73532006-12-14 Bob Rossi <bob@brasko.net>
7354
7355 * data/push.c (yypush_parse): Declare prototype regardless of
7356 %locations option.
7357
ab8e7e1a
JD
73582006-12-14 Bob Rossi <bob@brasko.net>
7359
7360 * data/push.c (yyparse): Remove the prototype and the #define when in
7361 push-parser mode.
7362
9bf32be3
JD
73632006-12-13 Bob Rossi <bob@brasko.net>
7364
7365 * data/push.c (yypstate_init): Rename to...
7366 (yypstate_new): ... this and use b4_c_function_def.
7367 (yypstate_delete): New.
7368 (yypush_parse): Change parameters yynval and yynlloc to be const.
7369 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7370 yypstate_delete functions.
7371
f02e2948
JD
73722006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7373
7374 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7375 strange test case titles. Reported by Bob Rossi.
7376
38eb7751
PE
73772006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7378
7379 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7380 of potential ambiguities in GLR grammers.
7381
bd9d212b
JD
73822006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7383
7384 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7385 `bison ', use m4_index instead of m4_substr since chopping up a string
7386 containing M4-special characters causes problems here.
7387
7388 Fix a couple of bugs related to special characters in user-specified
7389 file names, and make it easier for skeletons to compute output file
7390 names with the same file name prefix as Bison-computed output file
7391 names.
7392 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7393 b4_parser_file_name and b4_spec_defines_file instead of
7394 @output_parser_name@ and @output_header_name@, which are now redundant.
7395 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7396 b4_parser_file_name, b4_spec_defines_file, and the new
7397 @basename(FILENAME@) instead of @output_parser_name@ and
7398 @output_header_name@, which inappropriately escaped the file names as
7399 C string literals.
7400 * src/files.c (all_but_ext): Remove static qualifier.
7401 (compute_output_file_names): Move `free (all_but_ext)' to...
7402 (output_file_names_free): ... here since all_but_ext is needed later.
7403 * src/files.h (all_but_ext): Extern.
7404 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7405 exactly what MUSCLE_INSERT_STRING used to do.
7406 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7407 characters are escaped properly.
7408 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7409 all_but_ext.
7410 For pkgdatadir muscle, maintain previous functionality by using
7411 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7412 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7413 digraphs would never be expanded. Hopefully no one has M4-special
7414 characters in his Bison installation path.
7415 * src/scan-skel.l: Don't parse @output_header_name@ and
7416 @output_parser_name@ anymore since they're now redundant.
7417 In @output, use decode_at_digraphs.
7418 Parse a new @basename command that invokes last_component.
7419 (decode_at_digraphs): New.
7420 (BASE_QPUTS): Remove unused.
7421 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7422 (Output file name): New tests.
7423
3f7ca628
JD
74242006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7425
7426 Warn about output files that are generated by the skeletons and that
7427 conflict with other output files.
7428 * data/glr.c: Don't generate the header file here when glr.cc does.
7429 * src/files.c (file_names, file_names_count): New static globals.
7430 (compute_output_file_names): Invoke output_file_name_check for files
7431 not generated by the skeletons and remove existing checks.
7432 (output_file_name_check): New function that warns about conflicting
7433 output file names.
7434 (output_file_names_free): Free file_names.
7435 * src/files.h (output_file_name_check): Declare.
7436 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7437 the skeletons.
7438 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7439 (Conflicting output files): New tests.
7440
178e123e
PE
74412006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7442
7443 * doc/bison.texinfo: Fix a couple of typos.
7444
74452006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
7446
7447 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7448 Rename to...
7449 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7450 update all uses.
7451 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7452 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7453 local pv.
7454 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7455 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7456
ea17f233
JD
74572006-12-07 Bob Rossi <bob@brasko.net>
7458 and Joel Denny <jdenny@ces.clemson.edu>
7459
7460 * data/push.c (yypvarsinit): Change return type from void* to struct
7461 yypvars*. No longer cast to void* on return.
7462 (struct yypvars): Remove yylen since it need not be remembered between
7463 yypushparse invocations.
7464 (yypushparse): Don't copy between yylen and pv->yylen.
7465
55a30bda
JD
74662006-12-05 Bob Rossi <bob@brasko.net>
7467
7468 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7469 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7470 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7471 (struct yypvars): Remove b4_declare_parser_variables.
7472 (yypvarsinit): Remove init code for removed variables.
7473 (global scope): Do not declare b4_declare_parser_variables if
7474 push or pure mode.
7475 (yypushparse): Add b4_declare_parser_variables.
7476 Init new local variables, and remove init code for removed
7477 yypvars variables.
7478 (yyparse): Delete.
7479 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7480 and yyparse for other modes.
7481 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7482 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7483 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7484 (AT_PURE_LEX_IF): True if pure or push parser.
7485
85894313
JD
74862006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7487
7488 Document Yacc prologue alternatives and default %destructor's and
7489 %printer's as experimental. Don't mention Java yet. Discussed at
7490 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7491 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7492 (2.3a): Annotate this entry to say the old forms of these features were
7493 also experimental.
7494 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 7495 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
7496 of Java (we'll want this back eventually).
7497
02975b9a
JD
74982006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7499
7500 Support a file name argument to %defines. Deprecate `=' in
7501 %file-prefix, %name-prefix, and %output. Discussed at
7502 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7503 * NEWS (2.3a+): Mention.
148d66d8 7504 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
7505 form of %defines, and remove `=' from entries for %file-prefix,
7506 %name-prefix, and %output.
7507 * src/parse-gram.y (prologue_declaration): Implement.
7508 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7509 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7510 all but one occurrence of %name-prefix.
7511 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7512 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7513 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7514 occurrence of each of %file-prefix and %output. Add check for %defines
7515 with argument.
7516 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7517 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7518 Remove the `=' from %output.
7519
287b314e
JD
75202006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7521
7522 Don't escape $ in test case titles since Autoconf 2.61 now does that
7523 correctly.
7524 * tests/actions.at (Default %printer and %destructor are not for error
7525 or $undefined): Here.
7526 (Default %printer and %destructor are not for $accept): Here.
7527 * tests/input.at (Invalid $n and @n): Here.
7528
3ebecc24
JD
75292006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7530
7531 Rename <!> to <>. Discussed starting at
7532 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7533 * NEWS (2.3a+): Update.
148d66d8 7534 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
7535 Update.
7536 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7537 * src/scan-gram.l (INITIAL): Implement.
7538 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7539 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7540 comment.
7541 * tests/actions.at (Default tagless %printer and %destructor,
7542 Default tagged and per-type %printer and %destructor,
7543 Default %printer and %destructor are not for error or $undefined,
7544 Default %printer and %destructor are not for $accept,
7545 Default %printer and %destructor for mid-rule values): Update.
7546 * tests/input.at (Default %printer and %destructor redeclared,
7547 Unused values with default %destructor): Update.
7548
26b8a438
JD
75492006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7550
7551 Don't let %prec take a nonterminal.
7552 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7553 token.
7554 * tests/input.at (%prec takes a token): New test checking that %prec
7555 won't take a nonterminal.
7556
07c39ae9
JD
75572006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7558
405d53b7
JD
7559 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7560 it was double-quoted.
07c39ae9
JD
7561 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7562 grammar is maintained with Bison's highest standards.
7563 * src/getargs.c: Fix some typos in Doxygen comments.
7564
580b8926
JD
75652006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7566
7567 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7568 later. Reported by Paul Eggert in
7569 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7570 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7571 * src/scan-code.l (translate_action): Don't bother invoking
7572 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7573 (code_scanner_free): Instead of invoking
7574 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7575 which frees more.
7576 * src/scan-gram.l (gram_scanner_free): Likewise.
7577 * src/scan-skel.l (scan_skel): Likewise.
7578
4502eadc
JD
75792006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7580
7581 * src/files.c (tr): Change return type to void.
7582 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7583 has been called previously for the same key.
7584 (muscle_find): Return storage instead of value so that
7585 --enable-gcc-warnings doesn't produce warnings that the return discards
7586 const. aver that the value and storage are the same since storage
7587 could potentially be NULL when value is not.
7588 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7589 same as 0.
7590
7746c8f6
PE
75912006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7592
7593 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7594 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7595 us a slightly cleaner distribution, and also works.
7596 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7597 gnulib changes.
7598
eb095650
PE
75992006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7600 and Paul Eggert <eggert@cs.ucla.edu>
7601
7602 Don't let Bison leak memory except when it complains.
7603 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7604 (spec_defines_file, dir_prefix): Now char *, not const char *,
7605 since they are freed.
7606 * src/files.c: Likewise.
7607 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7608 Likewise.
7609 (tr): Now operates in-place. All uses changed.
7610 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7611 values.
7612 (compute_file_name_parts, compute_output_file_names): Don't store
7613 read-only data in variables that will be freed.
7614 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7615 src_extension, and header_extension.
7616 (output_file_names_free): New public function to free
7617 spec_verbose_file, spec_graph_file, spec_defines_file,
7618 parser_file_name, and dir_prefix.
7619 * src/getargs.c (getargs): Don't store read-only data in variables that
7620 will be freed.
7621 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7622 (which previously existed but was unused), and quotearg_free.
7623 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7624 * src/muscle_tab.c: Likewise.
7625 (muscle_entry): Make the value char const *,
7626 and add a new storage member that is char * and can be freed.
7627 (muscle_entry_free): New private function.
7628 (muscle_init): Use it instead of free.
7629 (muscle_insert, muscle_grow): Update and use new storage member.
7630 (muscle_code_grow): Free the string passed to muscle_grow
7631 since it's not needed anymore.
7632 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7633 add a new `char *code' member.
7634 ("{...}"): Declare semantic type as code.
7635 * src/scan-code.h (translate_rule_action):
7636 (translate_symbol_action, translate_code, translate_action): Return
7637 `char const *' rather than `char *' since external code should not free
7638 these strings.
7639 * src/scan-code.l: Likewise.
7640 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7641 which is "{...}" in the parser.
7642 * tests/Makefile.am (maintainer-check-valgrind): Set
7643 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7644 Valgrind.
7645 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7646 complain.
7647 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7648 expecting a non-zero exit status sets --leak-check=summary and
7649 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7650 this case, and we don't want to hear about it.
7651
ac564be4
PE
76522006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7653
7654 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7655 instead of from the template, to simplify configuration a bit.
7656 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7657 and m4/wint_t.m4, as they are needed with the latest gnulib.
7658
17bd8a73
JD
76592006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7660
7661 Disable unset/unused mid-rule value warnings by default, and recognize
7662 --warnings=midrule-values to enable them. Discussed starting at
7663 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7664 * NEWS (2.3a+): Mention.
7665 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7666 warnings): Add entry for midrule-values subargument.
7667 * src/reader.c (symbol_should_be_used): Don't return true just because
7668 the value is a set/used mid-rule value unless
7669 --warnings=midrule-values was specified.
7670 * tests/input.at (Unused values, Unused values before symbol
7671 declarations): Run tests with and without --warnings=midrule-values.
7672
7673 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7674 than LIST_FREE directly.
7675
89eb3c76
JD
76762006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7677
7678 Finish implementing --warnings=error, which should not be implied by
7679 --warnings=all (or by its synonyms -W and --warnings without
7680 subarguments).
7681 * src/complain.c (set_warning_issued): New function to report that
7682 warnings are being treated as errors and to record an error if so.
7683 Invoke...
7684 (warn_at, warn): ... here.
7685 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7686 "error - warnings are errors" does not appear above "all - all of the
7687 above".
7688 (getargs): For -W and --warnings without subarguments, don't let
7689 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7690 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7691
ba7560e2
JD
76922006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7693
7694 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7695 empty subargument list. For example: `bison --warnings= parser.y'.
7696
31283fc3
JD
76972006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7698
7699 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7700 the parser header file so that gcc doesn't warn.
7701
12e35840
JD
77022006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7703
7704 Split the default %destructor/%printer into two kinds: <*> and <!>.
7705 Discussed starting at
7706 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7707 * NEWS (2.3a+): Mention.
7708 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7709 previous change today related to mid-rules.
148d66d8 7710 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 7711 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
7712 (TYPE_TAG_ANY): Add as <*>.
7713 (TYPE_TAG_NONE): Add as <!>.
7714 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7715 for <*> and <!>.
7716 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7717 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7718 * src/symlist.c (symbol_list_default_new): Split into tagged and
7719 tagless versions.
7720 (symbol_list_destructor_set, symbol_list_printer_set): Split
7721 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7722 SYMLIST_DEFAULT_TAGLESS.
7723 * src/symlist.h: Update symbol_list_default*_new prototypes.
7724 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7725 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7726 * src/symtab.c (default_destructor, default_destructor_location,
7727 default_printer, default_printer_location): Split each into tagged and
7728 tagless versions.
7729 (symbol_destructor_get, symbol_destructor_location_get,
7730 symbol_printer_get, symbol_printer_location_get): Implement tagged
7731 default and tagless default cases.
7732 (default_destructor_set, default_printer_set): Split each into tagged
7733 and tagless versions.
7734 * src/symtab.h: Update prototypes.
7735 * tests/actions.at (Default %printer and %destructor): Rename to...
7736 (Default tagless %printer and %destructor): ... this, and extend.
7737 (Per-type %printer and %destructor): Rename to...
7738 (Default tagged and per-type %printer and %destructor): ... this, and
7739 extend.
7740 (Default %printer and %destructor for user-defined end token): Extend.
7741 (Default %printer and %destructor are not for error or $undefined):
7742 Update.
7743 (Default %printer and %destructor are not for $accept): Update.
7744 (Default %printer and %destructor for mid-rule values): Extend.
7745 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7746 (Unused values with default %destructor): Extend.
7747
f91b1629
JD
77482006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7749
7750 Don't apply the default %destructor/%printer to an unreferenced midrule
7751 value. Mentioned at
7752 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7753 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7754 like $@n instead of just @n so that the default %destructor/%printer
7755 logic doesn't see them as user-defined symbols.
7756 (symbol_is_dummy): Check for both forms of the name.
7757 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7758 name for which the midrule value is referenced in any action.
7759 * tests/actions.at (Default %printer and %destructor for mid-rule
7760 values): New test.
7761 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7762 for change to dummy symbol names.
7763
519d0004
JD
77642006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7765
7766 Warn about unset midrule $$ if the corresponding $n is used.
7767 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7768 $n usage.
7769 (packgram): Before invoking grammar_rule_check on any rule, make sure
7770 all actions have already been scanned in order to set `used' flags.
7771 Otherwise, checking that a midrule's $$ is set will not always work
7772 properly because the midrule check must forward-reference the midrule's
7773 parent rule.
7774 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7775 warning.
7776
a501eca9
JD
77772006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7778
7779 More improvements to the documentation of the prologue alternatives:
7780 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7781 Bison manual.
7782 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7783 some text to clarify the relative importance of the new directives and
7784 to show how these directives may be viewed as code labels.
7785
2cbe6b7f
JD
77862006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7787
7788 Similar to the recently removed %before-header, add %code-top as the
7789 alternative to the pre-prologue. Mentioned at
7790 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7791 Also, let the prologue alternatives appear in the grammar section.
7792 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7793 (prologue_declaration): Move the existing prologue alternatives to...
7794 (grammar_declaration): ... here and add %code-top.
7795 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7796
7797 Clean up and extend documentation for the prologue alternatives.
7798 * NEWS (2.3a+): Describe prologue alternatives.
7799 * doc/bison.texinfo (Prologue): Move discussion of prologue
7800 alternatives to...
7801 (Prologue Alternatives): ... this new section, and extend it to discuss
7802 all 4 directives in detail.
148d66d8
JD
7803 (Table of Symbols): Clean up discussion of prologue alternatives and
7804 add %code-top.
2cbe6b7f 7805
e557d3ea
JMG
78062006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7807
7808 DJGPP specific issues.
7809
7810 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7811 config.bat accordingly.
7812 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7813 * djgpp/config.site: Likewise.
7814
136a0f76
PB
78152006-10-16 Paolo Bonzini <bonzini@gnu.org>
7816
27bd5d67
PB
7817 Replace %*-header with %provides, %requires, %code. See discussion at
7818 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7819
136a0f76
PB
7820 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7821 (b4_user_start_header): Remove.
7822 * data/glr.c: Use new macros instead of b4_*start_header
7823 and b4_*end_header.
7824 * data/glr.cc: Likewise.
7825 * data/lalr1.cc: Likewise.
7826 * data/push.c: Likewise.
7827 * data/yacc.c: Likewise.
7828
7829 * doc/bison.texinfo: Remove %before-header, rename
7830 %{start,end,after}-header to %requires, %provides, %code.
7831
7832 * src/parse-gram.y: Likewise (also rename token names accordingly).
7833 * src/scan-gram.l: Likewise.
7834 * tests/actions.at: Likewise.
7835
10f429ef
PE
78362006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7837
7838 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7839 Problem reported by Joel E. Denny.
7840
78412006-10-14 Jim Meyering <jim@meyering.net>
7842
7843 (Sync from coreutils.)
7844 Work also when the working directory (with e.g. coreutils sources)
7845 is version controlled with git, rather than CVS.
7846 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7847 rather than CVS.
7848 In messages and comments, say e.g., "checked-out sources",
7849 rather than "CVS sources".
7850 (version_controlled_file): New function. Work for git as well as
7851 for CVS. Don't use grep's -q option.
7852 (slurp): Call it here, in place of CVS-specific code.
7853
c4bd5bf7
JD
78542006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7855
7856 Fix testsuite for ./configure --enable-gcc-warnings:
7857 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7858 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7859 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7860 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7861 * test/regression.at (Diagnostic that expects two alternatives):
7862 Likewise.
7863
46356ea4
PE
78642006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7865
231ed89a
PE
7866 * bootstrap.conf (gnulib_modules): Add config-h.
7867 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7868 worry about HAVE_CONFIG_H.
7869 * lib/abitset.c: Likewise.
7870 * lib/bitset.c: Likewise.
7871 * lib/bitset_stats.c: Likewise.
7872 * lib/bitsetv-print.c: Likewise.
7873 * lib/bitsetv.c: Likewise.
7874 * lib/ebitset.c: Likewise.
7875 * lib/get-errno.c: Likewise.
7876 * lib/lbitset.c: Likewise.
7877 * lib/subpipe.c: Likewise.
7878 * lib/timevar.c: Likewise.
7879 * lib/vbitset.c: Likewise.
7880 * lib/bitset.c: Include "bitset.h" first, to test interface.
7881 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7882 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7883 * lib/bitsetv.c: Include "bitsetv.h" first.
7884 * lib/get-errno.c: Include "get-errno.h" first.
7885 * m4/.cvsignore: Add config-h.m4.
7886 * tests/actions.at (Default %printer and %destructor for ...):
7887 Adjust expected line numbers in output to reflect removal of #if
7888 HAVE_CONFIG_H lines.
7889 * tests/glr-regression.at (Missed %merge type warnings when ...):
7890 Likewise.
7891 * tests/regression.at (Braced code in declaration in rules section):
7892 Likewise.
7893 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7894 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7895 Include <config.h> unconditionally.
7896
46356ea4
PE
7897 * bootstrap: Sync from coreutils, as follows:
7898
7899 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7900
7901 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7902 variable was sometimes used without being initialized. This
7903 messed up the installation of the INSTALL file in some cases.
7904
7905 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7906
7907 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7908 --copy. Inspired by a suggestion from Bruno Haible.
7909
7910 2006-10-03 Jim Meyering <jim@meyering.net>
7911
7912 * bootstrap: Undo last change to this file, since now gnulib-tool
7913 sticks with the automake default in generating dependencies.
7914
dd4bf078
PE
79152006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7916
cf2a5f7c
PE
7917 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7918 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7919
7920 * doc/bison.1: Add copyright notice.
7921
7922 * data/glr.c: Don't include <stdarg.h>; not used.
7923
35fe0834
PE
7924 * NEWS: The -g and --graph options now output graphs in Graphviz
7925 DOT format, not VCG format.
7926 * doc/bison.1: Likewise.
7927 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
7928 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7929 of this change in
7930 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
7931 * TODO: Remove Graphviz entry.
7932 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7933 remove vcg.c, vcg.h, vcg_defaults.h.
7934 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7935 * src/graphviz.c, src/graphviz.h: New files.
7936 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7937 * src/files.h: Make comment more generic.
7938 * src/main.c (main): Likewise.
7939 * src/print_graph.h: Likewise.
7940 * src/getargs.c (usage): Make usage description more generic.
7941 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7942 (static_graph, fgraph): Remove. All uses changed to pass
7943 arguments instead of sharing a static var.
7944 (print_core, print_actions, print_state, print_graph):
7945 Output graphviz format rather than VCG format.
7946 * tests/.cvsignore: Remove *.vcg; add *.dot.
7947 * tests/output.at: Expect *.dot files, not *.vcg files.
7948
dd4bf078
PE
7949 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
7950 accommodates the 2006-10-08 change.
7951
efdd7421
PE
79522006-10-11 Bob Rossi <bob@brasko.net>
7953
7954 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
7955 (b4_yyssa, b4_yyerror_range): New macros.
7956 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
7957 (yypvarsinit): Remove init of removed fields.
7958 (yypushparse): Remove use of removed fields; use new macros instead.
7959
96a1981a
PE
79602006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7961
7962 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
7963 in a push parser. Reindent slightly to match yacc.c better.
7964
79652006-10-11 Bob Rossi <bob@brasko.net>
7966
46356ea4
PE
7967 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
7968 yymsg_alloc fields.
7969 (yypvarsinit, yypushparse): Remove init of removed fields.
7970 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 7971
c1630a8b
PE
79722006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7973
7974 * THANKS: Add Paolo Bonzini and Bob Rossi.
7975
90b9908d
PB
79762006-10-08 Paolo Bonzini <bonzini@gnu.org>
7977
7978 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
7979 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
7980 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
7981 b4_define_user_cde and uses): Remove.
7982 (b4_comment, b4_prefix, b4_sync_start): New.
7983 * data/bison.m4: New file, with most of the content removed from c.m4.
7984 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
7985 * src/output.c (output_skeleton): Pass bison.m4.
7986 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
7987 only if specified.
7988
cf806753
PE
79892006-10-05 Paul Eggert <eggert@cs.ucla.edu>
7990
7991 Fix test failure reported by Tom Lane in
7992 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7993 and try to make such failures easier to catch in the future.
7994 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7995 that's now the caller's responsibility.
7996 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7997 Set yychar = YYEOF if it's negative.
7998 * tests/actions.at (yylex): Abort if asked to read past EOF.
7999 * tests/conflicts.at (yylex): Likewise.
8000 * tests/cxx-type.at (yylex): Likewise.
8001 * tests/glr-regression.at (yylex): Likewise.
8002 * tests/input.at (yylex): Likewise.
8003 * tests/regression.at (yylex): Likewise.
8004 * tests/torture.at (yylex): Likewise.
8005
0e2f006a
PE
80062006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8007
8008 Fix problems with translating English-language diagnostics.
8009 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8010 respect to bison-runtime pot generation. The YY_ stuff
8011 wasn't being captured.
8012 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8013 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8014 * runtime-po/POTFILES.in: Add data/push.c.
8015
e3ddc1e3
PE
80162006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8017
8018 Merge bootstrap changes from coreutils.
8019
8020 2006-09-28 Jim Meyering <jim@meyering.net>
8021
8022 Automatically generated dependencies are important even
8023 when all of the sources in a directory come from gnulib.
8024 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8025 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8026
8027 2006-09-23 Jim Meyering <jim@meyering.net>
8028
8029 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8030
8031 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8032
8033 * bootstrap: Add support for --force.
8034 (usage): New function. Describe usage less tersely.
8035 (CVS_only_file): New var.
8036
01e972b3
PE
80372006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8038
8039 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8040 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8041 Adjust white space and comments to match GNU style better.
8042
c63d3e90
PE
80432006-09-20 Bob Rossi <bob@brasko.net>
8044
8045 * data/push.c (yyresult_get): Remove function.
8046 (YYPUSH_MORE): Add #define.
8047 (yypushparse): Modify return value.
8048
e70f46d1
PE
80492006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8050
8051 * stamp-h.in: Remove; no longer needed.
8052 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8053 Remove config.h, config.hin, intl (no longer created).
8054 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8055 stamp-h1.
8056
8057 Sync bootstrap from coreutils, as follows:
8058
8059 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8060
8061 * bootstrap (symlink_to_gnulib): New function.
8062 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8063 to copies-of-gnulib.
8064 (cp_mark_as_generated, slurp, gnulib_files):
8065 Avoid making a copy if it's the same as the old version.
8066 (gnulib_files): Add support for this variable (used by Bison).
8067
a92be413
PE
80682006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8069
8070 * src/getargs.c (usage): Rework to use conventions similar to
8071 coreutils, to make translation a bit easier and the code a bit
8072 smaller. Problem reported by Tim Van Holder.
8073
4f82b42a
PE
80742006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8075
3b2942e6
PE
8076 Use some of gnulib's new modules, taken from coreutils.
8077
8078 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8079 * bootstrap.conf: New file.
8080 (gnulib_modules): Add configmake, inttypes, unistd.
8081 (XGETTEXT_OPTIONS): Add complain, complain_at,
8082 fatal, fatal_at, warn, warn_at, unexpected_end.
8083 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8084 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8085 (gl_EARLY): Add.
8086 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8087 (gl_INIT): Add
8088 (GNULIB_AUTOCONF_SNIPPET): Remove.
8089 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8090 the pickiest.
8091 * lib/.cvsignore: Add inttypes_.h.
8092 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8093 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8094 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8095 no-longer-necessary initializations.
8096 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8097 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8098 use the unistd module.
8099 * src/system.h: Likewise.
8100 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8101 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8102 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8103 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8104 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8105 * src/system.h: Include inttypes.h unconditionally, now that we
8106 use the inttypes module. Don't bother to include stdint.h, since
8107 inttypes.h now does that for us.
8108 (LOCALEDIR): Remove, now that we use the configmake module.
8109 * src/getargs.c: Include configmake.h.
8110 * src/main.c: Likewise.
8111 * src/output.c: Likewise.
8112 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8113 not from $abs_top_builddir, since config.h moved.
8114
8115
4f82b42a
PE
8116 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8117 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8118
8119 * src/parse-gram.y (symbol_declaration): Don't put statements
8120 before declarations; it's not portable to C89.
8121 * src/scan-code.l (handle_action_at): Likewise.
8122
8123 * src/scan-code.l: Always initialize braces_level; the old code
8124 left it uninitialized and therefore had undefined behavior.
8125
8126 Don't attempt to redefine 'assert', since it runs afoul of
8127 systems where standard headers (mistakenly) include <assert.h>.
8128 Instead, define and use our own alternative, called 'aver'.
8129 * src/reader.c: Don't include assert.h, since we no longer
8130 use assert.
8131 * src/scan-code.l: Likewise.
8132 * src/system.h (assert): Remove, replacing with....
8133 (aver): New function, taking a bool arg. All uses changed.
8134 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8135 not merely an integer.
8136
31c10e38
PE
81372006-09-15 Bob Rossi <bob@brasko.net>
8138
d6bdb90a
JD
8139 Add support for push parsing. Based on the original work of
8140 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
8141 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8142 * data/c.m4 (YYPUSH): New.
8143 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
d6bdb90a 8144 * data/push.c: New file.
31c10e38
PE
8145 * src/getargs.c (push_parser): New var.
8146 * src/getargs.h (push_parser): New declaration.
8147 * src/output.c (prepare): Add macro insertion of `push_flag'.
8148 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8149 (prologue_declaration): Parse %push-parser.
8150 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8151 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8152 list of removed lines from the traces observed.
8153 (AT_CHECK_CALC_LALR): Added push parser tests.
8154
fa7b79c0
PE
81552006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8156
21fe08ca
PE
8157 * NEWS: Version 2.3a.
8158 * configure.ac (AC_INIT): Likewise.
8159
e8ec4d9b
PE
8160 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8161 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8162 due to header ordering dependencies. I don't know why the #define
8163 was there.
8164
fa7b79c0
PE
8165 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8166 runtime cost when YYDEBUG is not defined, and so that some tests
8167 that used to fail now work. Problem and initial suggestion by
8168 Paolo Bonzini.
8169 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8170 * data/glr.cc (b4_parser_class_name):
8171 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8172 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8173 (yydebug_) [YYDEBUG]: New member.
8174 (yycdebug_): Now defined only if YYDEBUG.
8175 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8176 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8177 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8178 if YYYDEBUG.
8179 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8180 Define only if YYDEBUG.
8181 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8182 set_debug_level.
8183 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8184 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8185 AT_CHECK_CALC_GLR_CC that are working now.
8186
4ec13d60
PE
81872006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8188
8189 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8190 We don't need them in glr.cc, and glr.c defines them.
8191 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8192 assumes that defining it to anything is the same as defining
8193 it to 1. Problem reported by Paolo Bonzini.
8194
8e1687ae
PE
81952006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8196
8197 * data/c.m4 (b4_null, b4_case): Define.
8198 * src/output.c (prepare_symbols): Use b4_null.
8199 (user_actions_output): Use b4_case.
8200
3dc5e96b
PE
82012006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8202
aef3da86
PE
8203 * data/glr.c (b4_shared_declarations): Put start-header first,
8204 before any #includes that we generate, so that feature-test
8205 macros work. Problem reported by Michael Deutschmann in
8206 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8207 * data/lalr1.cc: Likewise.
8208 * doc/bison.texinfo (Prologue): Document that feature-test macros
8209 should be defined before any Bison declarations.
8210 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8211 that depend on location.hh after, not before, Bison decls, since
8212 we now include location.hh after the first user prologue.
8213
3dc5e96b
PE
8214 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8215 Sander Brandenburg in
8216 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8217 Also, fix minor white space and comment issues.
aef3da86
PE
8218 (Prologue): Mention that it's better to define feature-test macros
8219 before Bison declarations. Problem reported by Michael Deutschmann.
8220
8221 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8222 by Jim Meyering.
8223 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8224 This adjusts to recent gnulib changes.
3dc5e96b 8225
b2a0b7ca
JD
82262006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8227
8228 Finish implementation of per-type %destructor/%printer. Discussed
8229 starting at
8230 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8231 and
8232 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8233 * NEWS (2.3+): Add a description of this feature to the default
8234 %destructor/%printer description.
8235 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8236 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8237 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8238 list node contains a semantic type.
8239 * src/symtab.c, src/symtab.h: Extend with a table that associates
8240 semantic types with their %destructor's and %printer's.
8241 (semantic_type_from_uniqstr, semantic_type_get,
8242 semantic_type_destructor_set, semantic_type_printer_set): New functions
8243 composing the public interface of that table.
8244 (symbol_destructor_get, symbol_destructor_location_get,
8245 symbol_printer_get, symbol_printer_location_get): If there's no
8246 per-symbol %destructor/%printer, look up the per-type before trying
8247 the default.
8248 * tests/actions.at (Per-type %printer and %destructor): New test case.
8249 * tests/input.at (Default %printer and %destructor redeclared):
8250 Extend to check that multiple occurrences of %symbol-default in a
8251 single %destructor/%printer declaration is an error.
8252 (Per-type %printer and %destructor redeclared, Unused values with
8253 per-type %destructor): New test cases.
8254
3be03b13
JD
82552006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8256
8257 Require default %destructor/%printer to be declared using
8258 %symbol-default instead of an empty symbol list, and start working on
8259 new per-type %destructor/%printer. Discussed at
8260 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8261 * NEWS (2.3+): Add %symbol-default to example.
8262 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 8263 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
8264 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8265 (generic_symlist, generic_symlist_item): New nonterminals for creating
8266 a list in which each item is a symbol, semantic type, or
8267 %symbol-default.
8268 (grammar_declaration): Use generic_symlist in %destructor and %printer
8269 declarations instead of symbols.1 or an empty list.
8270 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8271 for changes to symbol_list.
8272 * src/reader.c: Update for changes to symbol_list.
8273 * src/scan-code.l: Likewise.
8274 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8275 * src/symlist.c, src/symlist.h: Extend such that a list node may
8276 represent a semantic type or a %symbol-default in addition to just an
8277 ordinary symbol. Add switched functions for setting %destructor's and
8278 %printer's.
8279 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8280 %destructor/%printer declarations.
8281
3508ce36
JD
82822006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8283
8284 Whether the default %destructor/%printer applies to a particular symbol
8285 isn't a question of whether the user *declares* that symbol (in %token,
8286 for example). It's a question of whether the user by any means
8287 *defines* the symbol at all (by simply using a char token, for
8288 example). $end is defined by Bison whereas any other token with token
8289 number 0 is defined by the user. The error token is always defined by
8290 Bison regardless of whether the user declares it with %token, but we
8291 may one day let the user define error as a nonterminal instead.
8292 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8293 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8294 the meaning of "user-defined".
8295 * tests/actions.at (Default %printer and %destructor for user-declared
8296 end token): Rename to...
8297 (Default %printer and %destructor for user-defined end token): ...
8298 this.
8299
8300 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8301 computation of whether to apply the default, don't maintain a list of
8302 every Bison-defined symbol. Instead, just check for a first character
8303 of '$', which a user symbol cannot have, and check for the error token.
8304
9350499c
JD
83052006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8306
8307 Don't apply the default %destructor or %printer to the error token,
8308 $undefined, or $accept. This change fits the general rule that the
8309 default %destructor and %printer are only for user-declared symbols,
8310 and it solves several difficulties that are described in the new test
8311 cases listed below.
8312 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8313 * tests/actions.at (Default %printer and %destructor are not for error
8314 or $undefined, Default %printer and %destructor are not for $accept):
8315 New test cases.
8316
4d7370cb
JD
83172006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8318
8319 Allow %start after the first rule.
8320 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8321 when parsing the first rule.
8322 (check_and_convert_grammar): Search for it here after all grammar
8323 declarations have been parsed. Skip midrules, which have dummy LHS
8324 nonterminals.
8325 * src/symtab.c (symbol_is_dummy): New function.
8326 * src/symtab.h (symbol_is_dummy): Declare it.
8327 * tests/input.at (%start after first rule): New test.
8328
6d0ef4ec
JD
83292006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8330
8331 Redo some of the previous commit: add back the ability to use
8332 non-aliased/undeclared string literals since it might be useful to
8333 those declaring %token-table.
8334 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8335 commit: don't worry about complaints from symbols_pack.
8336 * src/symtab.c (symbol_new, symbol_class_set,
8337 symbol_check_alias_consistency): Undo changes in previous commit: count
8338 each string literal as a new symbol and token, assign it a symbol
8339 number, and don't complain about non-aliased string literals.
8340 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8341 and token counts but does still set aliased tokens to the same number,
8342 symbol_pack_processor now leaves empty slots in the symbols array.
8343 Remove those slots.
8344 * tests/regression.at (Undeclared string literal): Remove test case
8345 added in previous commit since non-aliased string literals are allowed
8346 again.
8347 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8348 remove unnecessary string literal declarations.
8349 * tests/sets.at (Firsts): Likewise.
8350
965537bc
JD
83512006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8352
8353 Don't allow an undeclared string literal, but allow a string literal to
8354 be used before its declaration.
8355 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8356 symbols_pack complained.
8357 * src/symtab.c (symbol_new): Don't count a string literal as a new
8358 symbol.
8359 (symbol_class_set): Don't count a string literal as a new token, and
8360 don't assign it a symbol number since symbol_make_alias does that.
8361 (symbol_make_alias): It's not necessary to decrement the symbol and
8362 token counts anymore. Don't assume that an alias declaration occurs
8363 before any uses of the identifier or string, and thus don't assert that
8364 one of them has the highest symbol number so far.
8365 (symbol_check_alias_consistency): Complain if there's a string literal
8366 that wasn't declared as an alias.
8367 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8368 symbol_pack asserts that every token has been assigned a symbol number
8369 although undeclared string literals have not.
8370 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 8371 string literal): New test cases.
965537bc
JD
8372 (Characters Escapes, Web2c Actions): Declare string literals as
8373 aliases.
8374 * tests/sets.at (Firsts): Likewise.
8375
47aee066
JD
83762006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8377
8378 In the grammar scanner, STRING_FINISH unclosed constructs and return
8379 them to the parser in order to improve error messages.
8380 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8381 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8382 * tests/input.at (Unclosed constructs): New test case.
8383 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8384 seen.
8385
8386 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8387 unused global.
8388
1f6b3679
JD
83892006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8390
8391 Handle string aliases for character tokens correctly.
8392 * src/symtab.c (symbol_user_token_number_set): If the token has an
8393 alias, check and set its alias's user token number instead of its own,
8394 which is set to indicate the alias. Previously, every occurrence of
8395 the character token in the grammar overwrote that alias indicator with
8396 the character code.
8397 * tests/input.at (String aliases for character tokens): New test.
8398
219741d8
JD
83992006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8400
8401 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8402
11daa4e7
PE
84032006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8404
8405 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8406 to prevent failures when building on older platforms.
8407 Check for autopoint failure.
8408 Set XGETTEXT_OPTIONS to values that check for C format strings,
8409 so that translators are warned about them (this also helps
8410 prevent core dumps).
8411
8412 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8413 function, since it simplifies our code a bit.
8414
8415 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8416 rather than -W, so we don't get bogus warnings about sign comparisons.
8417 Add -Wpointer-arith, since that warning is useful (it reports code
8418 that does not conform to C89 and that some compilers reject).
8419 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8420 since it's no longer needed.
8421
f9bfc42a
JD
84222006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8423
8424 Clean up scanners a bit.
8425 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8426 definitions so gcc won't warn when obstack_for_string is unused.
8427 * src/scan-code.l: config.h and system.h are already #include'd by
8428 scan-code-c.c, so get rid of them here.
8429 * src/scan-gram.l: Likewise.
8430 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8431 definitions rather than duplicating the rest of it.
8432 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8433
06e8700a
JD
84342006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8435
8436 Suppress signed/unsigned comparison warnings for yycheck.
8437 * data/c.m4 (b4_safest_int_type): New macro.
8438 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8439 a signed int type, cast it to b4_safest_int_type first.
8440 * data/yacc.c: Likewise.
8441 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8442 also overwritten.
8443
9c437126
PE
84442006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8445
8446 * doc/bison.texinfo: Fix some typos.
8447
284d8a13
PE
84482006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8449
8450 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8451 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8452
8453 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8454 the latest gnulib does this a different way.
8455 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8456 translation was patched, so stop omitting it.
8457
ec5479ce
JD
84582006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8459
8460 Enable declaration of default %printer/%destructor. Make the parser
8461 use these for all user-declared grammar symbols for which the user does
8462 not declare a specific %printer/%destructor. Thus, the parser uses it
8463 for token 0 if the user declares it but not if Bison generates it as
8464 $end. Discussed starting at
8465 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8466 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8467 and
8468 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8469 * NEWS (2.3+): Mention.
8470 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8471 declare a %destructor for a mid-rule's semantic value. It's just
8472 impossible to declare one specific to it.
8473 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8474 code. Describe default %destructor form.
8475 * src/parse-gram.y (grammar_declaration): Parse default
8476 %printer/%destructor declarations.
8477 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8478 and symbol_destructor_location_get rather than accessing the destructor
8479 and destructor_location members of struct symbol.
8480 (symbol_printers_output): Likewise but for %printer's.
8481 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8482 again.
8483 * src/symtab.c (default_destructor, default_destructor_location,
8484 default_printer, default_printer_location): New static global
8485 variables to record the default %destructor and %printer.
8486 (symbol_destructor_get, symbol_destructor_location_get,
8487 symbol_printer_get, symbol_printer_location_get): New functions to
8488 compute the appropriate %destructor and %printer for a symbol.
8489 (default_destructor_set, default_printer_set): New functions to set the
8490 default %destructor and %printer.
8491 * src/symtab.h: Prototype all those new functions.
8492 * tests/actions.at (Default %printer and %destructor): New test to
8493 check that the right %printer and %destructor are called, that they're
8494 not called for $end, and that $$ and @$ work correctly.
8495 (Default %printer and %destructor for user-declared end token): New
8496 test to check that the default %printer and %destructor are called for
8497 a user-declared end token.
8498 * tests/input.at (Default %printer and %destructor redeclared, Unused
8499 values with default %destructor): New tests to check related grammar
8500 warnings and errors.
8501
868d2d96
JD
85022006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8503
8504 Clean up handling of %destructor for the end token (token 0).
8505 Discussed starting at
8506 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8507 and
8508 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8509
8510 Make the skeletons consistent in how they pop the end token and invoke
8511 its %destructor.
8512 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8513 state, which has token number 0, since this would invoke the
8514 %destructor for the end token.
8515 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8516 until after shifting the end token, or else it won't be popped.
8517 * data/yacc.c (yyparse): Likewise.
8518
8519 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8520 it's the end token. Upon termination, destroy an unshifted lookahead
8521 even when it's the end token.
8522 * data/lalr1.cc (yy::parser::parse): Likewise.
8523 * data/yacc.c (yyparse): Likewise.
8524
8525 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8526 value warnings for the end token when the user gives the end token a
8527 %destructor.
8528
8529 * tests/actions.at (Printers and Destructors): Test all the above.
8530
62a9592d
PE
85312006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8532
8533 Update to latest gnulib and gettext versions.
8534 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8535 Add fopen-safer.
8536 (gnulib_files): Add m4/warning.m4. Don't worry about files
8537 overwritten by autopoint.
8538 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8539 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8540 rejects them.
8541 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8542 so that we can remove the intl files at a better time.
8543 (intl_files_to_remove): Remove aclocal.m4, since it gets
8544 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8545 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8546 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8547 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8548 Remove datarootdir hack; no longer needed.
8549 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8550 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8551 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8552 strdup.h.
8553 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8554 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8555
10d6970f
PE
85562006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8557
8558 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8559 it with --assume-autoconf='latest-stable'.
8560
50a33993
JD
85612006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8562
8563 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8564 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8565 YYSTYPE' and `{'.
8566 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8567 those from muscle_tab.c since the old ones are misleading.
8568
2ce4ed68
AD
85692006-07-13 Akim Demaille <akim@epita.fr>
8570
8571 Support %define "KEY" {VALUE}.
8572 * src/scan-code.h, src/scan-code.l (translate_action)
8573 (translate_rule_action, translate_symbol_action, translate_code):
8574 Return char *, not const char *.
8575 * src/parse-gram.y (declaration): Rename as...
8576 (prologue_declaration): this.
8577 (string_content): Remove this nonterminal, use STRING.
8578 (braceless, content, content.opt): New nonterminal.
8579 Use them.
8580 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8581 as value.
8582 * src/scan-gram.l (getargs.h): Don't include it.
8583
db7e5eb5
PE
85842006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8585
8586 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8587 rather than a for-loop that declares a local bool variable. This
8588 should work around a compatibility problem with a Cray x1e C++
8589 compiler reported by Hung Nguyen in
8590 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8591 The for-loop was introduced in the 2004-11-17 change but I don't
8592 know why it was needed.
8593
a5d80ba5
AD
85942006-07-12 Akim Demaille <akim@epita.fr>
8595
8596 * data/c.m4: Comment changes.
8597
23eb2a69
AD
85982006-07-10 Akim Demaille <akim@lrde.epita.fr>
8599
8600 * src/complain.c (error_message, ERROR_MESSAGE): New.
8601 To factor...
8602 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8603 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8604
ddc8ede1
PE
86052006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8606
8607 * NEWS: Instead of %union, you can define and use your own union type
8608 YYSTYPE if your grammar contains at least one <type> tag.
8609 Your YYSTYPE need not be a macro; it can be a typedef.
8610 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8611 (Union Decl, Decl Summary): Document this.
8612 * data/glr.c (YYSTYPE): Implement this.
8613 * data/glr.cc (YYSTYPE): Likewise.
8614 * data/lalr1.cc (YYSTYPE): Likewise.
8615 * data/yacc.c (YYSTYPE): Likewise.
8616 * src/output.c (prepare): Output tag_seen_flag.
8617 * src/parse-gram.y (declaration, grammar_declaration):
8618 Use 'union_seen' rather than 'typed' to determine whether
8619 %union has been seen, since grammars can now be typed without
8620 %union.
8621 (symbol_declaration, type.opt, symbol_def):
8622 Keep track of whether a tag has been seen.
8623 * src/reader.c (union_seen, tag_seen): New vars.
8624 (typed): remove.
8625 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8626 * src/scan-code.l (untyped_var_seen): New variable.
8627 (handle_action_dollar): Adjust to above changes.
8628 (handle_action_dollar, handle_action_at):
8629 Improve overflow checking for outlandish numbers.
8630 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8631 avoid new diagnostics generated by above changes.
8632 * tests/regression.at (YYSTYPE typedef): Add test to check
8633 for type tags without %union.
8634
8635 * src/symlist.c (symbol_list_length): Return int, not unsigned
8636 int, since callers expect int. This may need to get revisited
8637 once we have proper integer overflow checking.
8638
8639 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8640 object is now static.
8641
8642 * src/getargs.c (flags_argmatch): Return void, not int,
8643 to pacify ./configure --enable-gcc-warnings.
8644
8645 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8646 since last_string is already defined to FLEX_PREFIX (last_string).
8647
7b42569e
AD
86482006-07-09 Akim Demaille <akim@lrde.epita.fr>
8649
8650 Implement --warnings/-W.
8651 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8652 replaced by...
8653 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8654 Adjust callers.
8655 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8656 (warnings_args, warnings_types): New.
8657 (getargs, short_options, long_options): Accept -W/--warnings.
8658 Sort the options by alphabetical order, upper case letter right
8659 before its lower case.
8660
3b452f4e
JD
86612006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8662
8663 Change %merge result type clash warnings to errors. Discussed at
8664 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8665 * src/reader.c (record_merge_function_type): Use complain_at.
8666 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8667 declared later): Update test case results.
8668
b8a41559
AD
86692006-07-09 Akim Demaille <akim@lrde.epita.fr>
8670
8671 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8672 to be in alphabetical order.
8673 (trace_args): Spelling fixes.
8674
cd9e1ba2
PE
86752006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8676
8677 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8678 so they don't collide with user-defined macros.
8679 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8680 this was never guaranteed, and now that we're using gnulib stdint,
8681 which defines int_fast16_t to long int, the problem is exposed.
8682
cb48f191
PE
86832006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8684
b8445a15
PE
8685 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8686 need the full POSIX semantics (and weren't implementing them
8687 anyway).
8688
cb48f191
PE
8689 Adjust to Autoconf 2.60 and today's gnulib.
8690 * bootstrap (gnulib_modules): Add stdint.
8691 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8692 no longer copies it.
8693 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8694 since stdint needs the former and wcwidth (which is now required
8695 by mbswidth) needs the latter.
8696 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8697 work around a compatibility glitch between gettext 0.14.6 and
8698 Autoconf 2.60.
8699 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8700 Do not check for uintptr_t, since new stdint module does the right
8701 thing.
8702 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8703 Add stdint.h, stdint_.h, wcwidth.h.
8704 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8705 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8706 stdint.m4, wchar_t.m4, wcwidth.m4.
8707 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8708 usual order for ../lib/*.h files.
8709 (file_name_split): Use last_component, not base_name, to adjust
8710 to gnulib changes.
8711 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8712 for ../lib/*.h files.
8713 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8714 Define unconditionally, since we now assume the stdint module.
8715 * src/scan-skel.l: Include <dirname.h>.
8716 (BASE_QPUTS): Use last_component, not base_name.
8717 * src/system.h: Include <unlocked-io.h> in the usual order
8718 for ../lib/*.h files. Include <stdint.h> unconditionally,
8719 since we now use the stdint module.
8720 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8721 HAVE_UINTPTR_T, since we now use the stdint module.
8722 (base_name): Remove decl, since files now include <dirname.h>
8723 to get the decl.
8724
cd48d21d
AD
87252006-07-08 Akim Demaille <akim@lrde.epita.fr>
8726
8727 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8728 New, default to 1.
8729 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8730 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8731 default.
8732 * tests/calc.at: Adjust.
8733
8ec0a172
AD
87342006-07-08 Akim Demaille <akim@lrde.epita.fr>
8735
b8445a15 8736 * data/c.m4 (b4_basename): New.
8ec0a172
AD
8737 (b4_syncline): Also output the location of its invocation (from
8738 the skeleton).
8739 (b4_user_action, b4_define_user_action, b4_user_actions)
8740 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8741 (b4_user_stype): New.
8742 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8743
4a678af8
JD
87442006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8745
8746 In the grammar file, the first column is 1 not 0 on the first line as
8747 on every other line.
8748 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8749 * tests/input.at (Torturing the Scanner): Update output.
8750
8751 * src/scan-gram.l (scanner_cursor): Declare it static.
8752
dd60572a
JD
87532006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8754
8755 In warnings, say "previous declaration" rather than "first
8756 declaration".
8757 * src/symtab.c (redeclaration): Do that here.
8758 * src/reader.c (record_merge_function_type): In the case of a result
8759 type clash, report the previous declaration rather than the very first
8760 one in the grammar file.
8761 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8762 declared later): Add a third declaration to check this behavior.
8763 * tests/input.at (Incompatible Aliases): Update output.
8764
2073e1b6
AD
87652006-06-27 Akim Demaille <akim@epita.fr>
8766
8767 * doc/Doxyfile.in: New.
8768 * doc/Makefile.am: Use it.
8769 * src/lalr.h, src/symtab.h: Initial doxygenation.
8770
8ee5b538
JD
87712006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8772
8773 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
8774 declared after the %merge. This continues the effort of the previous
8775 patch.
8ee5b538
JD
8776 * src/reader.c (get_merge_function): Don't set the merger type yet.
8777 (record_merge_function_type): New function for setting the merger type
8778 and checking for clashes.
8779 (grammar_current_rule_merge_set): Set the location of the %merge for
8780 the current rule.
8781 (packgram): Invoke record_merge_function_type for each rule now that
8782 all symbol type declarations have been parsed.
8783 * src/reader.h (merger_list.type_declaration_location): New member
8784 storing the location of the first %merge from which the type for this
8785 merging function was derived.
8786 * src/symlist.h (symbol_list.merger_declaration_location): New member
8787 storing the location of a rule's %merge, if any.
8788 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8789 declared later): New test to catch the error fixed by the above patch.
8790
ffa4ba3a
JD
87912006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8792
8793 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
8794 declarations appear after the rules. Discussed at
8795 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8796 and
8797 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8798 Don't mistake the type of $$ in a midrule to be that of its parent
8799 rule's $$.
ffa4ba3a
JD
8800 * src/reader.c (grammar_current_rule_end): Don't invoke
8801 grammar_rule_check yet since not all symbol declarations may have been
8802 parsed yet.
8803 (grammar_midrule_action): Likewise.
8804 Don't record whether the midrule's $$ has been used yet since actions
8805 haven't been translated yet.
8806 Record the midrule's parent rule and its RHS index within the parent
8807 rule.
8808 (grammar_current_rule_action_append): Don't translate the action yet
8809 since not all symbol declarations may have been parsed yet and, thus,
8810 warnings about types for $$, $n, @$, and @n can't be reported yet.
8811 (packgram): Translate the action and invoke grammar_rule_check now that
8812 all symbol declarations have been parsed.
8813 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8814 after parsing the entire grammar file, the symbol list here in the case
8815 of a midrule is actually the midrule's empty RHS, so reference its
8816 parent rule's RHS where necessary.
8817 On the other hand, now that you can already know it's a midrule, you
8818 aren't forced to think $$ has the same type as its parent rule's $$.
8819 (handle_action_at): In the case of a midrule, reference the parent rule
8820 where necessary.
8821 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8822 members.
8823 (symbol_list_length): Now that this is invoked after all rules have
8824 been parsed, a NULL symbol (rather than a NULL symbol list node)
8825 terminates a rule. symbol_list_print already does this correctly.
8826 * src/symlist.h (symbol_list.midrule_parent_rule,
8827 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8828 remember their relationships with their parents.
8829 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8830 fixed by the above patch.
8831 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8832 implementing...
8833 (Unused values): ... this old test case and...
8834 (Unused values before symbol declarations): ... this new test case.
8835 This one is the same as `Unused values' except that all symbol
8836 declarations appear after the rules in order to catch the rest of the
8837 errors fixed by the above patch.
8838
e256e17f
JD
88392006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8840
300a1930
JD
8841 More cleanup.
8842 * src/reader.c (current_rule): Declare it static since it's no longer
8843 used outside this file.
8844 (grammar_current_rule_action_append): Remove redundant arguments from
8845 translate_rule_action invocation.
8846 * src/reader.h (current_rule): Remove this unused extern.
8847 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8848 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 8849
381ecb06
JD
88502006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8851
8852 Clean up yesterday's patch.
8853 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8854 to...
8855 * src/reader.c (grammar_current_rule_action_append): ... here for
8856 consistency with grammar_current_rule_symbol_append.
8857 * tests/regression.at (Braced code in declaration in rules section):
8858 Make yyerror and yylex static as usual.
8859
4210cd0b
JD
88602006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8861
8862 Fix bug that mistakes braced code in a declaration in the rules section
8863 to be a rule action. Mentioned at
8864 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8865 * src/scan-gram.l: Move midrule action detection from the start of the
8866 scanning of any braced code to...
8867 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8868 action. For readability, use $2 and @2 rather than the equivalent
8869 global variables.
8870 * tests/regression.at (Braced code in declaration in rules section):
8871 New test to catch the error fixed by the above patch.
8872
8873 Work on code readability some.
8874 * src/scan-code.l (current_rule): Get rid of this misleading and
8875 redundant declaration: it's actually extern'ed in reader.h.
8876 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8877 translate_action): Add a rule argument and use it instead of the global
8878 current_rule.
8879 (translate_rule_action): This already receives current_rule through an
8880 argument, so pass it on to translate_action instead of assigning
8881 current_rule to current_rule.
8882 (translate_symbol_action, translate_code): Pass rule = NULL to
8883 translate_action.
8884
34f98f46
JD
88852006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8886
8887 Rename %before-definitions to %start-header and %after-definitions to
8888 %end-header. Don't use these declarations to separate pre-prologue
8889 blocks from post-prologue blocks. Add new order-independent
8890 declarations %before-header and %after-header as alternatives to the
8891 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8892 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8893 * NEWS (2.3+): Update for these changes.
8894 * data/glr.c (b4_before_definitions): Update to...
8895 (b4_start_header): ... this.
8896 (b4_after_definitions): Update to...
8897 (b4_end_header): ... this.
8898 * data/glr.cc: Likewise.
8899 * data/lalr1.cc: Likewise.
8900 * data/yacc.c: Likewise.
8901 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8902 prologue blocks with %*-header declarations.
8903 (Calc++ Parser): Likewise.
91661ebb 8904 (Decl Summary): Update names.
148d66d8 8905 (Table of Symbols): Update description.
34f98f46
JD
8906 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8907 (PERCENT_END_HEADER): ... this.
8908 (PERCENT_BEFORE_DEFINITIONS): Update to...
8909 (PERCENT_START_HEADER): ... this.
8910 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8911 (declaration): Update token names and m4 macro names.
8912 When parsing %end-header and %start-header, invoke translate_code
8913 before muscle_code_grow, and no longer set global booleans to remember
8914 whether these declarations have been seen.
8915 Parse new %after-header and %before-header.
8916 * src/reader.c (before_definitions, after_definitions): Remove.
8917 (prologue_augment): Accept a new bool argument to specify whether to
8918 augment the pre-prologue or post-prologue.
8919 * src/reader.h (before_definitions, after_definitions): Remove these
8920 extern's.
8921 (prologue_augment): Add new bool argument.
8922 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8923 (PERCENT_END_HEADER): ... this.
8924 (PERCENT_BEFORE_DEFINITIONS): Update to...
8925 (PERCENT_START_HEADER): ... this.
8926 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8927 * tests/actions.at (Printers and Destructors): Update names.
8928
31b2b07e
JD
89292006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8930
8931 Add comparison operators for C++ location classes. Discussed at
8932 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8933 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8934 declaration indicating whether filename_type has an operator==. If
8935 filename_type is `std::string', it defaults to `1', `0' otherwise.
8936 * data/location.cc: Iff b4_define_location_comparison is `1', add
8937 operator== and operator!= for class position and for class location.
8938
8939 Some minor fixes.
8940 * src/scan-action.l: Remove unused file.
8941 * src/symtab.c (symbol_printer_set): Use printer_location not
8942 destructor_location.
8943 * src/symtab.h (struct symbol): Replace incorrect source comment for
8944 printer members.
8945 * tests/input.at (Incompatible Aliases): Update output with correct
8946 printer location.
8947
9bc0dd67
JD
89482006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
8949
8950 Don't put the pre-prologue in the header file. For the yacc.c code
8951 file and the glr.c header and code files, move the pre-prologue before
8952 the token definitions. Add new %before-definitions and
8953 %after-definitions to declare code that will go in both the header file
8954 and code file. Discussed at
8955 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
8956 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
8957 and
8958 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
8959 * NEWS (2.3+): Describe these changes.
8960 * data/glr.c (b4_pre_prologue): Move from within to before...
8961 (b4_shared_declarations): ... this.
8962 Add new b4_before_definitions before b4_token_enums.
8963 Add new b4_after_definitions at the end.
8964 * data/glr.cc (b4_pre_prologue): Replace with...
8965 (b4_before_definitions): ... this in the header file.
8966 (b4_after_definitions): New near the end of the header file.
8967 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
8968 code file right before including the header file.
8969 (b4_before_definitions): New in the previous position of
8970 b4_pre_prologue in the header file.
8971 (b4_after_definitions): New near the end of the header file.
8972 * data/yacc.c: Clean up some m4 quoting especially in the header file.
8973 (b4_token_enums_defines): In the code file, move to right before
8974 YYSTYPE for consistency with the header file.
8975 (b4_before_definitions): New right before b4_token_enums_defines in
8976 both the header and code file.
8977 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
8978 header and code file.
8979 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
8980 of prologues for %union dependencies.
91661ebb
JD
8981 (Decl Summary): In %defines description, mention the effect of
8982 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
8983 (Calc++ Parser): Forward declare driver in a %before-definitions rather
8984 than in the pre-prologue so that make check succeeds.
148d66d8 8985 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
8986 %after-definitions.
8987 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
8988 %before-definitions.
8989 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
8990 (declaration): Parse those declarations and append to
8991 b4_before_definitions and b4_after_definitions, respectively.
8992 * src/reader.c (before_definitions, after_definitions): New bools to
8993 track whether those declarations have been seen.
8994 (prologue_augment): Add to the post-prologue if %union,
8995 %before-definitions, or %after-definitions has been seen.
8996 * src/reader.h (before_definitions, after_definitions): New extern's.
8997 * src/scan-gram.l: Scan the new declarations.
8998 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8999 prologue block in a %before-definitions or a %after-definitions based
9000 on whether the %union is declared.
9001 * tests/regression.at (Early token definitions with --yacc, Early token
9002 definitions without --yacc): Move tests for token definitions into the
9003 post-prologue since token names are no longer defined in the
9004 pre-prologue.
9005
203b9274
AD
90062006-06-20 Akim Demaille <akim@epita.fr>
9007
9008 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9009 (symbol_get): Use it.
9010 * src/parse-gram.y: Use it.
9011
a7ee59cf
JD
90122006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9013
9014 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9015 build succeeds when configured with --enable-gcc-warnings.
9016
5a2baae7
PE
90172006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9018
33ad1a9c
PE
9019 * src/parse-gram.y (char_name): New function.
9020 (CHAR, STRING, string_content): For %printer, properly escape.
9021 (ID): Prefer fputs to fprintf.
9022 (id): Reindent to be consistent with other rules.
9023 Properly quote char.
9024
5a2baae7
PE
9025 The Translation Project changed its way of publishing translations
9026 to maintainers. I haven't received any responses to my request
9027 for supporting the old way, or for documenting the new way. I
9028 have modified 'bootstrap' to use screen scraping
9029 (in this case, HTML scraping). This is unreliable and inelegant,
9030 but I don't see any better way. Yuck.
9031 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9032 (get_translations): New function, which uses HTML scraping to
9033 deduce locations of latest translations.
9034 Use this function to grab both bison and bison-runtime .po files.
9035 Don't bother priming the pump for the runtime-po domain any more,
9036 as it's now translated better than bison is.
9037
58d7a1a1
AD
90382006-06-19 Akim Demaille <akim@epita.fr>
9039
9040 * src/scan-gram.l: No longer "parse" things after `%union' until
9041 `{'. Rather, return a single "%union" token.
9042 No longer make symbols: return strings, and leave the conversion
9043 to symbols to the parser.
9044 (SC_PRE_CODE, token_type): Remove.
9045 * src/parse-gram.y (%union): New field `character'.
9046 Sort tokens.
9047 (CHAR): New token.
9048 (ID, ID_COLON): Now that the scanner no longer makes them
9049 identifiers, adjust all uses to invoke symbol_get.
9050 (id_colon): New, wraps the conversion from string to symbol.
9051 (%union): Accept a possible union_name.
9052 (symbol): Now can be a char.
9053 * data/c.m4 (b4_union_name): Leave a default value.
9054 * data/glr.c, data/yacc.c: Use it.
9055
b931235e
JD
90562006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9057
9058 For associating token numbers with token names for "yacc.c", don't use
9059 #define statements unless `--yacc' is specified; always use enum
9060 yytokentype. Most important discussions start at:
9061 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9062 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9063 and
9064 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9065 * NEWS (2.3+): Mention.
9066 * data/c.m4 (b4_yacc_if): New.
9067 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9068 token #define's.
9069 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9070 on token name definitions.
9071 * src/getargs.c (usage): Capitalize `Yacc' in English.
9072 * src/output.c (prepare): Define b4_yacc_flag.
9073 * tests/regression.at (Early token definitions): Test that tokens names
9074 are defined before the pre-prologue not just before the post-prologue.
9075 Remove this test case and copy to...
9076 (Early token definitions with --yacc): ... this to test #define's.
9077 (Early token definitions without --yacc): ... and this to test enums.
9078
9e6e7ed2
PE
90792006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9080
9081 * NEWS: Reword the post-2.3 change to not be so optimistic about
9082 removing the old "look-ahead" spelling.
9083 Update previous look-ahead/lookahead change reports.
9084 * REFERENCES: look-ahead -> lookahead (since that's
9085 what he actually wrote).
9086 * doc/refcard.tex: look ahead -> lookahead,
9087 look-ahead -> lookahead
9088
742e4900
JD
90892006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9090
9091 For consistency, use `lookahead' instead of `look-ahead' or
9092 `look_ahead'. Discussed starting at
9093 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9094 and then at
9095 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9096 * NEWS: For the next release, note the change to `--report'.
9097 * TODO, doc/bison.1: Update English.
9098 * doc/bison.texinfo: Update English.
9099 (Understanding Your Parser, Bison Options): Document as
9100 `--report=lookahead' rather than `--report=look-ahead'.
9101 * src/conflicts.c: Update English in comments.
9102 (lookahead_set): Rename from look_ahead_set.
9103 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9104 (resolve_sr_conflict): Rename local look_ahead_tokens to
9105 lookahead_tokens, and update other uses.
9106 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9107 count_rr_conflicts, conflicts_free): Update uses.
9108 * src/getargs.c (report_args): Move "lookahead" before alternate
9109 spellings.
9110 (report_types): Update uses.
9111 (usage): For `--report' usage description, state `lookahead' spelling
9112 rather than `look-ahead'.
9113 * src/getargs.h (report.report_lookahead_tokens): Rename from
9114 report_look_ahead_tokens.
9115 * src/lalr.c: Update English in comments.
9116 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9117 (state_lookahead_tokens_count): Rename from
9118 state_look_ahead_tokens_count.
9119 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9120 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9121 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9122 Update other uses.
9123 Update English in output.
9124 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9125 * src/print.c: Update English in comments.
9126 (lookahead_set): Rename from look_ahead_set.
9127 (print_reduction): Rename argument lookahead_token from
9128 look_ahead_token.
9129 (print_core, state_default_rule, print_reductions, print_results):
9130 Update uses.
9131 * src/print_graph.c: Update English in comments.
9132 (print_core): Update uses.
9133 * src/state.c: Update English in comments.
9134 (reductions_new): Update uses.
9135 (state_rule_lookahead_tokens_print): Rename from
9136 state_rule_look_ahead_tokens_print, and update other uses.
9137 * src/state.h: Update English in comments.
9138 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9139 (state_rule_lookahead_tokens_print): Rename from
9140 state_rule_look_ahead_tokens_print.
9141 * src/tables.c: Update English in comments.
9142 (conflict_row, action_row): Update uses.
9143 * tests/glr-regression.at
9144 (Incorrect lookahead during deterministic GLR,
9145 Incorrect lookahead during nondeterministic GLR): Rename
9146 print_look_ahead to print_lookahead.
9147 * tests/torture.at: Update English in comments.
9148 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9149 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9150 (Many lookahead tokens): Update uses.
9151 * data/glr.c: Update English in comments.
9152 * lalr1.cc: Likewise.
9153 * yacc.c: Likewise.
9154 * src/conflicts.h: Likewise.
9155 * src/lalr.h: Likewise.
9156 * src/main.c: Likewise.
9157 * src/output.c: Likewise.
9158 * src/parse-gram.c: Likewise.
9159 * src/tables.h: Likewise.
9160 * tests/calc.at: Likewise.
9161
3c40d0b5
JD
91622006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9163
9164 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9165
5d278082
PE
91662006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9167
9168 * TODO: Add request from Nelson H. F. Beebe to be able to install
9169 Bison without installing the yacc script.
9170
9e668899
JD
91712006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9172
9173 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9174 and yytext if they're already #define'd.
9175 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9176 * src/scan-code-c.c: ... here.
9177 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9178 <config.h>.
9179
0c8e079f
JD
91802006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9181
9182 Get Bison to build again when configured with --enable-gcc-warnings.
9183 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9184 missing #include's.
9185 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9186 loc argument as it shadows a global.
9187 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9188 invocation.
9189
9190 * src/.cvsignore: Add scan-code.c.
9191
2346344a
AD
91922006-06-07 Akim Demaille <akim@epita.fr>
9193
9194 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9195 to...
9196 * src/scan-code.l: here.
9197 * tests/input.at (Torturing the Scanner): Fix another location
9198 error.
9199
4862bdfd
AD
92002006-06-07 Akim Demaille <akim@epita.fr>
9201
9202 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9203
e9071366
AD
92042006-06-06 Akim Demaille <akim@epita.fr>
9205
9206 Extract the parsing of user actions from the grammar scanner.
9207 As a consequence, the relation between the grammar scanner and
9208 parser is much simpler. We can also split "composite tokens" back
9209 into simple tokens.
9210 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9211 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9212 rename as...
9213 * src/location.h, src/location.c (add_column_width)
9214 (location_compute): these.
9215 Fix the column count: the initial column is 0.
9216 (location_print): Be robust to ending column being 0.
9217 * src/location.h (boundary_set): New.
9218 * src/main.c: Adjust to scanner_free being renamed as
9219 gram_scanner_free.
9220 * src/output.c: Include scan-code.h.
9221 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9222 Use boundary_set.
9223 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9224 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9225 which is now, again, a separate token.
9226 Adjust all dependencies.
9227 Whereever actions with $ and @ are used, use translate_code.
9228 (action): Remove this nonterminal which is now useless.
9229 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9230 (grammar_current_rule_action_append): Use translate_code.
9231 (packgram): Bound check ruleno, itemno, and rule_length.
9232 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9233 (last_string, last_braced_code_loc, max_left_semantic_context)
9234 (scanner_initialize, scanner_free, scanner_last_string_free)
9235 (gram_out, gram_lineno, YY_DECL_): Move to...
9236 * src/scan-gram.h: this new file.
9237 (YY_DECL): Rename as...
9238 (GRAM_DECL): this.
9239 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9240 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9241 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9242 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9243 Move these declarations, and...
9244 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9245 these to...
9246 * src/flex-scanner.h: this new file.
9247 * src/scan-gram.l (rule_length, rule_length_overflow)
9248 (increment_rule_length): Remove.
9249 (last_braced_code_loc): Rename as...
9250 (gram_last_braced_code_loc): this.
9251 Adjust to the changes of the parser.
9252 Move all the handling of $ and @ into...
9253 * src/scan-code.l: here.
9254 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9255 (handle_action_dollar, handle_action_at): Move to...
9256 * src/scan-code.l: here.
9257 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9258 scan-code.h, scan-code-c.c, scan-gram.h.
9259 (EXTRA_bison_SOURCES): Add scan-code.l.
9260 (BUILT_SOURCES): Add scan-code.c.
9261 (yacc): Be robust to white spaces.
9262
9263 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9264 * tests/regression.at: Adjust the column numbers.
9265 * tests/regression.at: Adjust the error message.
7891a7c4 9266
184e42f0
JD
92672006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9268
9269 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9270 Use Akim's wording from
9271 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9272
7891a7c4
JD
92732006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9274
9275 Between Bison releases, manually append `+' to the previous Bison
9276 release number, and use that as a signal to automatically print the
9277 ChangeLog's CVS Id keyword from --version. Discussed starting at
9278 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9279 * ChangeLog: Add Id header.
9280 * configure.ac (AC_INIT): Append `+' to `2.3'.
9281 * src/.cvsignore: Add revision.c.
9282 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9283 (BUILT_SOURCES): Add revision.c.
9284 (revision.c): New target rule. This file defines a new global variable
9285 named revision. It initializes it with either the Id from ChangeLog
9286 or, if VERSION doesn't contain `+', with the empty string.
9287 * src/getargs.c (version): Print the value of revision.
9288 * src/revision.h: Extern revision.
9289
4ad3ed84
PE
92902006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9291
9292 * NEWS: Version 2.3.
9293 * configure.ac (AC_INIT): Likewise.
9294
02103984
PE
92952006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9296
9297 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9298 with no arguments, not as an object-like macro. This is for
9299 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9300 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9301 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9302 Document this.
9303
2c08afa5
JD
93042006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9305
9306 * src/getargs.c (usage): Back out yesterday's modification of the
9307 --help output so that we don't have to wait for translation before
9308 releasing 2.3.
9309
6077da58
PE
93102006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9311
9312 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9313 Problem reported by Akim Demaille.
9314
2a26b6c2
JD
93152006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9316
9317 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9318
aefef0d6
PE
93192006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9320
9321 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9322 generated source code. Problem reported by Frans Englich in
9323 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9324
fcd8e201
PE
93252006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9326
9327 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9328 shell, not within 'make', so that 'make' by an ordinary builder
9329 (using GNU make) does not worry about configuring gzip. This also
9330 works around a bug reported independently by Keith Thompson and by
9331 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9332 stderr rather than stdout, messing up the build logs.
9333
7b5cdcbd
JD
93342006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9335
9336 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9337 to make sure that YYID will never be unused. This fixes a 'make
9338 maintainer-check' failure caused by the recent changes to the 'Trivial
9339 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9340 not used.
9341 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9342
5ad0a449
JD
93432006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9344
9345 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9346 state before an empty RHS is always resolved here. Only the location
9347 of that state is guaranteed to be resolved, and that's enough. This
9348 fixes the remaining bug reported by Derek M. Jones in
9349 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9350 * tests/glr-regression.at (Uninitialized location when reporting
9351 ambiguity): Test the above case.
9352 Also, the embedded comments in this test case claim it checks the case
9353 of an empty RHS that has inherited the initial location. However, the
9354 corresponding LHS was already resolved, so yyresolveLocations didn't
9355 actually have reason to modify it. Fix this by forcing
9356 nondeterministic operation at the beginning of the parse.
9357
50cce58e
PE
93582006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9359
9360 * data/c.m4 (b4_yy_symbol_print_generate):
9361 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9362 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9363 of the bugs reported today by Derek M Jones in
9364 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9365 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9366 defined to be a type name without parens or brackets.
9367 (Location Type): Similarly for YYLTYPE.
9368 * tests/regression.at (Trivial grammars): Put in a test for this
9369 bug that will be caught by 'make maintainer-check' (though not,
9370 alas, by 'make check' unless your compiler is picky).
9371
ab8d9dc5
PE
93722006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9373
0d2c8934 9374 * NEWS: Version 2.2.
ab8d9dc5
PE
9375 * configure.ac (AC_INIT): Likewise.
9376
9138c575
JD
93772006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9378
9379 * data/glr.c (yyreportTree): Make room in yystates for the state
9380 preceding the RHS. This fixes the segmentation fault reported by Derek
9381 M. Jones in
9382 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9383 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9384 to the user. Reported for yyreportTree by Derek M. Jones later in the
9385 same thread.
9386 * THANKS: Add Derek M. Jones.
9387 Update my email address.
9388 Fix typo in Steve Murphy's name.
9389
276f48df
PE
93902006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9391
d6645148
PE
9392 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9393 checking against YYLAST that caused the parser to miss a potential
9394 alternative in its diagnostic.
9395 Problem reported by Maria Jose Moron Fernandez in
9396 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9397 * data/lalr1.cc (yysyntax_error_): Likewise.
9398 * data/yacc.c (yysyntax_error): Likewise.
9399 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9400 tokens, in case we run into an older C compiler.
9401 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9402 Use them to check for the off-by-one error fixed above.
9403
276f48df
PE
9404 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9405 YYSIZE_T, not size_t.
9406 * tests/regression.at (Trivial grammars): New test, to catch
9407 the error fixed by the above patch.
9408
cd8b5791
AD
94092006-05-14 Akim Demaille <akim@lrde.epita.fr>
9410
9411 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9412 scheme.
9413 Reported by Steve Murphy.
9414
34376418
AD
94152006-05-14 Akim Demaille <akim@lrde.epita.fr>
9416
9417 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9418 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9419
327afc7c
AD
94202006-05-14 Akim Demaille <akim@lrde.epita.fr>
9421
9422 Implement --trace=m4.
9423 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9424 * src/output.c (output_skeleton): When set, pass -dV to m4.
9425
9426 Factor the handling of flags in m4.
9427 * src/output.c (prepare): Rename the muscle names debug, defines,
9428 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9429 * data/c.m4: Adjust.
9430 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9431 Use b4_define_flag_if to define other b4_FLAG_if macros.
9432 (b4_location_if): As a consequence, rename as...
9433 (b4_locations_if): this, for consistency.
9434 Adjust all the skeletons.
9435
ba9ecd19
AD
94362006-05-14 Akim Demaille <akim@lrde.epita.fr>
9437
9438 * etc/bench.pm: Shorten bench names.
9439
4e83ea15
AD
94402006-05-14 Akim Demaille <akim@lrde.epita.fr>
9441
9442 * src/output.h, src/output.c (error_verbose): Move to...
9443 * src/getargs.h, src/getargs.c: here.
9444 Sort the flags.
9445 Adjust dependencies.
9446
6e93d810
PE
94472006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9448
9449 * data/c.m4 (b4_copyright): Put the special exception for Bison
9450 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
9451 uses changed. Suggested by Akim Demaille. Also, wrap the
9452 copyright notice, in case it is longer than 80 columns. Replace
9453 comma by newline after title.
6e93d810 9454
eaea13f5
PE
94552006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9456
9457 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9458 incompatibility, not a bug. Mention that it wasn't fixed as of
9459 flex 2.5.33.
9460
3cf084ec
AD
94612006-05-11 Akim Demaille <akim@lrde.epita.fr>
9462
9463 * examples/extexi: Enforce the precedence of concatenation over
9464 >>.
0a9f1c7d 9465 Reported by Tommy Nordgren.
3cf084ec 9466
32c96bd7
AD
94672006-05-11 Akim Demaille <akim@lrde.epita.fr>
9468
9469 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9470 with the member "token".
f94705b2 9471 Reported by Martin Nylin.
32c96bd7 9472
eaea13f5
PE
94732006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9474
9475 * data/glr.c: Switch to Bison 2.2 special-exception language in
9476 the copyright notice. Use more-regular format for titles and
9477 copyright notices.
9478 * data/glr.cc: Likewise.
9479 * data/location.cc: Likewise.
9480 * data/yacc.cc: Likewise.
9481 * doc/bison.texinfo (Conditions): Document this.
9482 * NEWS: likewise. Upgrade version to 2.2.
9483
6e2d1146
AD
94842006-04-27 Akim Demaille <akim@lrde.epita.fr>
9485
9486 * data/glr.cc: Remove dead code.
9487
47671055
PE
94882006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9489
9490 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9491 that variable and the line breaks the bootstrap. Problem reported
9492 by Juan M. Guerrero.
9493
ed2e6384
AD
94942006-04-24 Akim Demaille <akim@lrde.epita.fr>
9495
9496 * doc/bison.texinfo (Multiple start-symbols): New.
9497
3cedc2dc
AD
94982006-04-24 Akim Demaille <akim@lrde.epita.fr>
9499
9500 * etc/README, etc/bench.pl: New.
9501
b2ddc3f3
AD
95022006-04-03 Akim Demaille <akim@lrde.epita.fr>
9503
9504 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9505 rule.
9506 Reported by Mickael Labau.
9507 * tests/input.at (Torturing the Scanner): Test it.
9508
91e3ac9a
PE
95092006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9510
9511 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9512 Problem reported by Bob Rossi.
9513
95142006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9515
9516 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9517 and didn't really work.
9518 For the index, use @ifnotinfo, not @iftex.
9519 Minor cleanups of spacing and terminology.
9520
5cf61e93
AD
95212006-03-12 Akim Demaille <akim@lrde.epita.fr>
9522
9523 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9524 of AT_NAME_PREFIX when %name-prefix is not used.
9525
aa08666d
AD
95262006-03-12 Akim Demaille <akim@lrde.epita.fr>
9527
9528 Apply --prefix to C++ skeletons too: they change the namespace.
9529 The test suite already exercize these cases.
9530 * data/c++.m4 (b4_namespace): New.
9531 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9532 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9533 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9534 * doc/bison.texinfo: Document it.
9535 (Option Cross Key): Use @multitable in all formats. It looks
9536 nicer, even in TeX outputs.
9537 (Rules): Use the same code whatever the output type is.
9538 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9539 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9540 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 9541
45567173
AD
95422006-03-10 Akim Demaille <akim@lrde.epita.fr>
9543
9544 * TODO: Remove dead items.
9545
e9d8f881 95462006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
9547
9548 * doc/FAQ: Remove, merged into...
9549 * doc/bison.texinfo (FAQ): this.
9550 * doc/Makefile.am (EXTRA_DIST): Adjust.
9551
c095d689
AD
95522006-03-10 Akim Demaille <akim@lrde.epita.fr>
9553
9554 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9555 even if empty.
9556 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9557 * doc/bison.texinfo (Calc++ Scanner): Use it.
9558
6e0f8287
PE
95592006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9560
9561 Fix two nits reported by twlevo, plus one more that I discovered.
9562
9563 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9564 this is the usual Bison style.
9565 * src/location.h (location_print): Likewise.
9566
9567 * src/reader.h (token_name): Likewise.
9568
d6b771c3
PE
95692006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9570
9571 Fix some nits reported by twlevo.
9572 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9573 and "POSIX". Use more-modern syntax for URLs. Mention C++
9574 and ask for Java. Don't hardwire OS version numbers. Add
9575 copyright notice.
9576 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9577 * src/conflicts.c (solved_conflicts_obstack): Now static.
9578
1e137b71
JD
95792006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9580
9581 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9582 page. Say "you can use it" not "you may use it" as on the web page;
9583 we're describing capabilities not granting permission.
9584
73f2e47e
PE
95852006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9586
6d05403d
PE
9587 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9588 shadowing warnings. Use usual patter for iterating through RHS.
9589 * tests/glr-regression.at
9590 (Uninitialized location when reporting ambiguity):
9591 Modify yylex so that it uses its argument, rather than trying
9592 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9593 const char -> char const.
9594
73f2e47e
PE
9595 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9596 Don't use tabs inside commands; it messes up 'ps'.
9597 Problem reported by twlevo.
9598
8710fc41
JD
95992006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9600
9601 * tests/glr-regression.at (Uninitialized location when reporting
9602 ambiguity): New test case.
9603 * data/glr.c (yyresolveLocations): New function, which uses
9604 YYLLOC_DEFAULT.
9605 (yyresolveValue): Invoke yyresolveLocations before reporting an
9606 ambiguity.
9607 * doc/bison.texinfo (Default Action for Locations): Note
9608 YYLLOC_DEFAULT's usage for ambiguity locations.
9609 (GLR Semantic Actions): Cross-reference those notes.
9610
ae952af2
JD
96112006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9612
9613 * tests/glr-regression.at (Leaked semantic values when reporting
9614 ambiguity): Remove unnecessary union and type declarations.
9615 (Leaked lookahead after nondeterministic parse syntax error): New test
9616 case.
9617 * data/glr.c (yyparse): Check for zero stacks remaining before
9618 attempting to shift the lookahead so that you don't lose it.
9619
35ee866a
JD
96202006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9621
9622 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9623 * tests/glr-regression.at (Leaked semantic values when reporting
9624 ambiguity): New test case.
9625 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9626 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9627 now unnecessary yystackp parameter.
9628 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9629 destructors can be called.
9630
9631 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9632 in existing testcases.
9633
520181ab
JD
96342006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9635
9636 Don't leak semantic values for parent RHS when a user action cuts the
9637 parser, and clean up related code a bit.
9638 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
9639 cuts parse): Rename to...
9640 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
9641 for leaked parent RHS values.
9642 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9643 between an unresolved state (non-empty chain of semantic options) and
9644 an incomplete one (signaled by an empty chain).
ae952af2 9645 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
9646 successfully or unsuccessfully resolved yyGLRState to...
9647 (yyresolveValue): ... here so that yyresolveValue always leaves a
9648 yyGLRState with consistent data and thus is easier to understand.
9649 Remove the yyvalp and yylocp parameters since they are always just
9650 taken from the yys parameter. When reporting a discarded merged value
9651 in debugging output, note that it is incompletely merged. Document the
9652 interface.
9653 (yyresolveAction): If resolving any of the RHS states fails, destroy
9654 them all rather than leaking them. Thus, as long as user actions are
9655 written to clean up the RHS correctly, yyresolveAction always cleans up
9656 the RHS of a semantic option. Document the interface.
9657
18d9185c
PE
96582006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9659
9660 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9661 led to a segmentation fault in GNU Pascal. Problem reported
9662 by Waldek Hebisch.
9663
841a7737
JD
96642006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9665
9666 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9667 mid-rule action inside a nonterminal symbol in order to declare a
9668 destructor for its semantic value.
9669
fc3f467f
PE
96702006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9671
9672 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9673 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9674 __cplusplus && ! defined _STDLIB_H && !
9675 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9676 defined free))]: Include <stdlib.h> rather than rolling our own
9677 declarations of malloc and free, to avoid problems with
9678 incompatible declarations (using 'throw') C++'s stdlib.h. This
9679 should fix Debian bug 340012
9680 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9681 reported by Guillaume Melquiond.
9682
a3af26dd
PE
96832006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9684
4d7bc38c
PE
9685 * NEWS: Clarify symbols versus types in unused-value warnings.
9686
a3af26dd
PE
9687 * configure.ac (AC_INIT): Bump version number.
9688
4e26c69e
PE
96892006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9690
9691 * NEWS: Version 2.1a.
9692 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9693 since C99 requires this.
9694
498e897c
PE
96952006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9696
9697 * m4/c-working.m4: New file.
9698 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9699
57bb17ca
PE
97002006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9701
9702 * Makefile.maint: Merge from coreutils.
9703
0be105dc
PE
97042006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9705
9706 More portability fixes for problems summarized by Nelson H. F. Beebe.
9707
9708 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9709 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9710 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9711 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9712 messes up because C++ code is compiled in 32-bit mode but linked
9713 in 64-bit mode.
9714
6fc0c024
PE
97152006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9716
9717 More portability fixes for problems summarized by Nelson H. F. Beebe.
9718
7870f699
PE
9719 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9720 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9721
6fc0c024
PE
9722 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9723 nodist_PROGRAMS, since we don't need to actually compile the
9724 example if we're just doing a plain 'make'. This avoids bothering
9725 the installer unnecessarily about problems due to weird C++
9726 compilers.
9727
fe6c2fde
PE
97282006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9729
9730 More portability fixes for problems summarized by Nelson H. F. Beebe.
9731
9732 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9733 than #include "...", and compile with -I'.'. The old method was
9734 not portable, according to Posix and the C standard, and it does
9735 not work with Sun C 5.7, where previous #line directives affect
9736 the working directory used in later #include "..." directives.
9737
927b425b
JMG
97382006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9739
9740 Various DJGGP specific issues in /djgpp
9741
d9735e9e
PE
97422006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9743
9744 More portability fixes for problems summarized by Nelson H. F. Beebe.
9745
9746 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9747 '#include <map>' works and that you can apply ++ to iterators.
9748
5a6755af
PE
97492006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9750
67a0dc4f
PE
9751 Work around portability problems summarized by Nelson H. F. Beebe in
9752 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9753
8c86f0ef
PE
9754 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9755 that '#include <string>' works.
9756
de35dd59
PE
9757 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9758 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9759 "warning: sorry: semantics of inline function static data `const
9760 unsigned char translate_table[262]' are wrong (you'll wind up with
9761 multiple copies)".
9762
67a0dc4f
PE
9763 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9764 or, xor to not_, and_, or_, and xor_, respectively. This works
9765 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9766 random system header somewhere that includes the equivalent of
9767 <iso646.h>.
9768
5a6755af
PE
9769 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9770 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 9771 Suite Version 2.0.
5a6755af 9772
3f001415
JD
97732006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9774
9775 During deterministic GLR operation, user actions should be able to
9776 influence the parse by changing yychar. To make this easier to fix and
9777 to make glr.c easier to evolve in general, don't maintain yytoken in
9778 parallel with yychar; just compute yytoken when needed.
9779 * tests/glr-regression.at (Incorrect lookahead during deterministic
9780 GLR): Check that setting yychar in a user action has the intended
9781 effect.
9782 * data/glr.c (yyGLRStack): Remove yytokenp member.
9783 (yyclearin): Don't set *yytokenp.
9784 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9785 yychar rather than *yytokenp to determine the current lookahead.
9786 Compute yytoken locally when needed.
9787 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9788 point to.
9789
9790 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9791 after `--report' documentation.
9792
e2a8c0f5
PE
97932006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9794
9795 * src/parse-gram.y (grammar_declaration): Location of printer
9796 symbol is @1, not list->location. Bug reported by twlevo.
9797 * tests/input.at (Incompatible Aliases): Adjust to above change.
9798
6b702268
PE
97992006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9800
27622431
PE
9801 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9802 all the test at once. This makes the output easier to read in the
9803 normal case.
9804
6b702268
PE
9805 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9806 got from <http://bro-ids.org/download.html>. The bug is that
9807 when two actions appeared in succession, the second one was
9808 scanned before the first one was added to the grammar rule
9809 as a midrule action. Bison then output the incorrect warning
9810 "parse.y:905.17-906.36: warning: unused value: $3".
9811 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9812 associated with a value.
9813 (rhs): Don't invoke grammar_current_rule_action_append.
9814 (action): Invoke it here instead.
9815 * src/reader.c (grammar_midrule_action): Now extern.
9816 (grammar_current_rule_action_append): Don't invoke
9817 grammar_midrule_action; that is now the scanner's job.
9818 * src/reader.h (last_string, last_braced_code_loc):
9819 (grammar_midrule_action): New decls.
9820 * src/scan-gram.l (last_string): Now extern, sigh.
9821 (last_braced_code_loc): New extern variable.
9822 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9823 rule already has an action.
9824 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9825 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9826 Add some tests to check that the above changes fixed the bug.
9827
d40ba6c2
PE
98282006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9829
9830 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9831 All used changed. Check whether the symbol has a destructor,
9832 not whether it is typed.
9833 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9834 that the values are still reported as unused. All line numbers
9835 adjusted.
9836
401aace6
PE
98372006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9838
9839 Work around a bug in bro 0.8, which underparenthesizes its
9840 definition of YYLLOC_DEFAULT.
9841 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9842 their arguments.
9843 * data/lalr1.cc: Likewise.
9844 * data/yacc.cc: Likewise.
9845
06f01bc4
PE
98462006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9847
401aace6
PE
9848 Work around a bug in Pike 7.0, and give the Pike folks a
9849 better way to override the usual int widths.
9850 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9851 user can override the types.
9852 (short): #undef, to work around a bug in Pike 7.0.
9853 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9854 (union yyalloc.yyss): Use yytype_int16 rather than short.
9855 All uses changed.
9856 (yysigned_char): Remove.
9857 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9858 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9859 * tests/regression.at (Web2c Actions): Adjust to above changes.
9860
9861 * src/reader.c (check_and_convert_grammar): New function.
9862 (reader): Close the input file even if something went wrong during
9863 parsing. Minor file descriptor leak reported by twlevo.
9864
06f01bc4
PE
9865 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9866 to pacify gcc -Wswitch-default.
9867 * src/scan-gram.l (adjust_location): Use a default: break; case
9868 to pacify gcc -Wswitch-default.
9869 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9870 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9871 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9872 Move these decls to scan-skel.l, since they don't need to be
9873 visible elsewhere.
9874 * src/scan-skel.l: Accept the above decls.
9875 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9876 is used.
9877
02650b7f
PE
98782006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9879
9880 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9881 since we don't want to insist on a version number at the start
9882 of the changelog every time.
9883 * Makefile.maint: Sync from coreutils a bit better.
9884 (sc_trailing_blank): Renamed from sc_trailing_space.
9885 All uses changed.
9886 (sc_no_if_have_config_h, sc_require_config_h):
9887 (sc_prohibit_assert_without_use): New rules.
9888 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9889 (sc_dd_max_sym_length): Fix leading spaces in rule.
9890 (sc_system_h_headers): Prefix with @.
9891 (sc_useless_cpp_parens, m4-check): Output line numbers.
9892 (changelog-check): Allow version only in head.
9893 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9894 satisfy new Makefile.maint rule.
9895 * data/glr.c: Likewise.
9896 * data/glr.cc: Likewise.
9897 * data/lalr1.cc: Likewise.
9898 * data/yacc.c: Likewise.
9899 * lib/ebitsetv.c: Likewise.
9900 * lib/lbitset.c: Likewise.
9901 * lib/subpipe.c: Likewise.
9902 * lib/timevar.c: Likewise.
9903 * src/system.h: Likewise.
9904 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9905 * djgpp/Makefile.maint: Add copyright notice.
9906 * djgpp/README.in: Likewise.
9907 * djgpp/config.bat: Likewise.
9908 * djgpp/config.site: Likewise.
9909 * djgpp/config_h.sed: Likewise.
9910 * djgpp/djunpack.bat: Likewise.
9911 * djgpp/config.sed: Fix copyright notice to match standard format.
9912 * djgpp/subpipe.h: Likewise.
9913 * lib/bitsetv-print.c: Likewise.
9914 * lib/bitsetv.c: Likewise.
9915 * lib/subpipe.h: Likewise.
9916 * lib/timevar.c: Likewise.
9917 * lib/timevar.h: Likewise.
9918 * djgpp/subpipe.c: Use standard recipe for config.h.
9919 * lib/abitset.c: Likewise.
9920 * lib/bitset.c: Likewise.
9921 * lib/bitset_stats.c: Likewise.
9922 * lib/bitsetv-print.c: Likewise.
9923 * lib/bitsetv.c: Likewise.
9924 * lib/ebitsetv.c: Likewise.
9925 * lib/get-errno.c: Likewise.
9926 * lib/lbitset.c: Likewise.
9927 * lib/subpipe.c: Likewise.
9928 * lib/timevar.c: Likewise.
9929 * lib/vbitset.c: Likewise.
9930 * tests/local.at: Likewise.
9931 * src/scan-gram.l: Don't include verify.h, since system.h does
9932 that for us.
9933 * .x-sc_require_config_h: New file.
9934 * .x-sc_unmarked_diagnostics: New file.
9935
287c78f6
PE
99362006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9937
287c78f6
PE
9938 Be a bit more systematic about using 'abort'.
9939 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9940 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9941 Put 'default: abort ();' before some other case, to satisfy older
9942 pedantic compilers.
9943 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9944 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
9945 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
9946 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
9947 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
9948 (get_decision_str, get_orientation_str, get_node_alignment_str):
9949 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
9950 (get_linestyle_str, get_arrowstyle_str): Likewise.
9951 * src/conflicts.c (resolve_sr_conflict):
9952 Use a default case rather than one for the one remaining enum
9953 value, to catch invalid enum values as well.
9954 * src/lalr.c (set_goto_map, map_goto):
9955 Prefer "assert (FOO);" to "if (!FOO) abort ();".
9956 * src/nullable.c (nullable_compute, token_definitions_output):
9957 Likewise.
9958 * src/reader.c (packgram, reader): Likewise.
9959 * src/state.c (transitions_to, state_new, state_reduction_find):
9960 Likewise.
9961 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
9962 (symbol_pack): Likewise.
9963 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
9964 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
9965 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
9966 * src/system.h: Don't include <assert.h>.
9967 (assert): New macro.
9968
9969 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
9970 (Destructor Decl, Parser Function, Pure Calling):
9971 Describe rules for braces inside C code more carefully.
287c78f6 9972
c66dfadd
PE
99732006-01-19 Paul Eggert <eggert@cs.ucla.edu>
9974
c21493b8
PE
9975 Fix some porting glitches found by Nelson H. F. Beebe.
9976 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
9977 compilers that don't understand that abort () does not return.
9978 * src/state.c (transitions_to): Likewise.
9979 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9980 that '#include <cstdlib>' works.
9981 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
9982 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
9983 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
9984 for the benefit of some pre-C99 compilers.
9985
b6e3facf
PE
9986 * bootstrap: Undo changes to gnulib files that autoreconf made.
9987
c66dfadd
PE
9988 Minor fixups to get 'make maintainer-check' to work.
9989 * configure.ac: Don't use -Wnested-externs, as it's incompatible
9990 with the new verify.h implementation.
9991 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
9992 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
9993 * data/yacc.c (YYUSE): Likewise.
9994 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9995 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9996 * src/parse-gram.y (declaration): Don't pass a string constant
9997 to a function that expects char *, since GCC might complain
9998 about the constant value.
9999 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10000 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10001 before #defining them.
10002 * tests/glr-regression.at
10003 (Incorrectly initialized location for empty right-hand side in GLR):
10004 In yyerror, use the msg arg.
10005 (Corrupted semantic options if user action cuts parse):
10006 (Incorrect lookahead during deterministic GLR):
10007 (Incorrect lookahead during nondeterministic GLR):
10008 Don't name a local var 'index'; it shadows string.h's 'index'.
10009
ed94ef2a
AD
100102006-01-19 Akim Demaille <akim@epita.fr>
10011
10012 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10013 location, not just parts of it.
10014
e9ad4aec
PE
100152006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10016
d6ca7905
PE
10017 * NEWS: Document the fact that multiple %unions are now allowed.
10018 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
10019 * TODO: This feature is now implemented, so remove it from
10020 the wishlist.
d6ca7905 10021
ef1b70e0
PE
10022 * Makefile.maint: Merge with coreutils Makefile.maint.
10023 (CVS_LIST): Use build-aux version if available.
10024 (VERSION_REGEXP): New macro.
10025 (syntax-check-rules): Add sc_no_if_have_config_h,
10026 sc_prohibit_assert_without_use, sc_require_config_h,
10027 sc_useless_cpp_parens.
10028 (sc_obsolete_symbols): Check for O_NDELAY.
10029 (sc_dd_max_sym_length): Track coreutils.
10030 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10031 (sc_useless_cpp_parens): New rule.
10032 (news-date-check): Look for version or today's date.
10033 (changelog-check): Don't require version number near head.
10034 (copyright-check): Use current year instead of hardwiring 2005.
10035 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10036 (announcement): Add --gpg-key-ID.
10037
10038 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10039 with "file system".
10040
2073ce56 10041 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
10042 array. Problem reported by twlevo.
10043 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10044 * src/lalr.c (build_relations): Rely on new sentinel.
10045 * src/gram.c (gram_free): Adjust to new sentinel.
10046
b7691f15
JD
100472006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10048
10049 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10050 yylookaheadNeeds. All uses updated.
10051 (yysplitStack): Rename local yynewLookaheadStatuses to
10052 yynewLookaheadNeeds.
10053 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10054 GLR): In comments, change `lookahead status' to `lookahead need'.
10055
ddee1b06
PH
100562006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10057
10058 * data/glr.c (yysplitStack): A little stylistic rewrite.
10059
12f4614d
PH
100602006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10061
10062 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10063
32c29292
JD
100642006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10065
10066 * doc/bison.texinfo: Fix some typos.
10067 (GLR Semantic Actions): New subsection discussing special
10068 considerations because GLR semantic actions might be deferred.
10069 (Actions): Mention look-ahead usage of yylval.
10070 (Actions and Locations): Mention look-ahead usage of yylloc.
10071 (Special Features for Use in Actions): Add YYEOF entry and mention it
10072 in the yychar entry.
10073 In the yychar entry, remove mention of the local yychar case (pure
10074 parser) since this is irrelevant information when writing semantic
148d66d8 10075 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
10076 yychar is otherwise described as an external variable.
10077 In the yychar entry, don't call it the `current' look-ahead since it
10078 isn't when semantic actions are deferred.
10079 In the yychar and yyclearin entries, add note about deferred semantic
10080 actions.
10081 Add yylloc and yylval entries discussing look-ahead usage.
10082 (Look-Ahead Tokens): When discussing yychar, don't call it the
10083 `current' look-ahead, and do mention yylval and yylloc.
10084 (Error Recovery): Cross-reference `Action Features' when mentioning
10085 yyclearin.
148d66d8 10086 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
10087 look-ahead.
10088 In the yylloc and yylval entries, mention look-ahead usage.
10089
de366a2f 100902006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
10091
10092 * tests/glr-regression.at: Update copyright year to 2006.
10093
bf70fa87
JD
100942006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10095
10096 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10097 use during nondeterministic operation to track which stacks have
10098 actually needed the current lookahead.
10099 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10100 Allocate, deallocate, resize, and otherwise shuffle space for
10101 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10102 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10103 appropriately during nondeterministic operation.
10104 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10105 members to store the current lookahead to be used by the deferred
10106 user action.
10107 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10108 from which the RHS is taken. Set the lookahead members of the new
10109 yySemanticOption according to the lookahead status for stack yyk.
10110 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10111 yyaddDeferredAction.
10112 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10113 members of yySemanticOption before invoking yyuserAction, and then set
10114 them back to their current values afterward.
10115 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10116 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10117 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10118 titles for consistency.
10119 (Leaked merged semantic value if user action cuts parse): In order to
10120 suppress lint warnings, use arguments in merge function, and assign
10121 char value < 128 in main.
10122 (Incorrect lookahead during deterministic GLR): New test case.
10123 (Incorrect lookahead during nondeterministic GLR): New test case.
10124
05449a2c
JD
101252006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10126
de366a2f 10127 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
10128 !yyvaluep as signal that no semantic value is available to print.
10129 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10130 to print a semantic value.
10131
4158e0a1 101322006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 10133
4158e0a1
JD
10134 * tests/glr-regression.at: For consistency with my newer test cases,
10135 don't thank myself.
10136
d659304d
JD
101372006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10138
10139 * data/glr.c (yyresolveValue): When merging semantic options, if at
10140 least one user action succeeds but a later one cuts the parse, then
10141 destroy the semantic value before returning rather than leaking it.
10142 (yyresolveStates): If a user action cuts the parse and thus
10143 yyresolveValue fails, ignore the (unset) semantic value rather than
10144 corrupting the yyGLRState, and empty the semantic options list since
10145 the user actions should have called all necessary destructors.
10146 Simplify code with YYCHK.
10147 * tests/glr-regression.at (Corrupted semantic options if user action
10148 cuts parse): New test case.
10149 (Undesirable destructors if user action cuts parse): New test case.
10150 Before applying any of this patch, this test case never actually failed
10151 for me... but only because the corrupted semantic options usually
10152 masked this bug.
10153 (Leaked merged semantic value if user action cuts parse): New test
10154 case.
10155
6ec2c0f2
AD
101562006-01-05 Akim Demaille <akim@epita.fr>
10157
10158 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10159
1b9c21fb
PE
101602006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10161
10162 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10163 _MSC_VER. Problem reported by Cenzato Marco.
10164 (b4_c_function_def): Use it.
10165 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10166 b4_c_modern.
10167 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10168 than rolling our own.
10169
84866159
AD
101702006-01-04 Akim Demaille <akim@epita.fr>
10171
10172 Also warn about non-used mid-rule values.
10173 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10174 member.
10175 (symbol_list_new): Adjust.
10176 * src/reader.c (symbol_typed_p): New.
10177 (grammar_rule_check): Use it.
10178 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10179 Check its rule.
10180 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10181 Use it.
10182 * tests/actions.at (Exotic Dollars): Adjust.
10183
378f4bd8
AD
101842006-01-04 Akim Demaille <akim@epita.fr>
10185
10186 * src/reader.c (grammar_midrule_action): If $$ is set in a
10187 mid-rule, move the `used' bit to its lhs.
10188 * tests/input.at (Unused values): New.
10189 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10190
e2a21b6f
PE
101912006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10192
54662697
PE
10193 * doc/bison.texinfo (Bison Options): Say more accurately what
10194 --yacc does.
10195 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10196 about declarations in the grammar when in Yacc mode, as POSIX does
10197 not require a diagnostic when the grammar uses extensions.
10198
10199 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10200
073f9288
PE
10201 Warn about dubious constructions like "%token T T".
10202 Reported by twlevo.
10203 * src/symtab.h (struct symbol.declared): New member.
10204 * src/symtab.c (symbol_new): Initialize it to false.
10205 (symbol_class_set): New arg DECLARING, specifying whether
10206 this is a declaration that we want to warn about, if there
10207 is more than one of them. All uses changed.
10208
1221b78a
PE
10209 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10210 Allow multiple %union directives, whose contents concatenate.
10211 * src/parse-gram.y (grammar_declaration): Likewise.
10212 Use muscle_code_grow, so that we don't need stype_line any more.
10213 All uses changed.
10214
10215 * src/muscle_tab.c (muscle_grow): Fix comment.
10216
e2a21b6f
PE
10217 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10218 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10219 Update copyright year to 2006.
10220
8f7e3cf9
AD
102212006-01-03 Akim Demaille <akim@epita.fr>
10222
10223 Have glr.cc pass (some of) the calc.at tests.
10224 * data/glr.cc (b4_parse_param_orig): New.
10225 (b4_parse_param): Improve its definition, and bound it more
10226 clearly in the skeleton.
10227 (b4_epilogue): Append, instead of prepending, in order to keep
10228 #line consistency.
10229 Simplify the generation of auxiliary functions: locations and
10230 purity are mandated.
10231 (b4_global_tokens_and_yystype): Honor it.
10232 * data/location.cc (c++.m4): Don't include it.
10233 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10234 and AT_SKEL_CC_IF.
10235 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10236 AT_LALR1_CC_IF.
10237 Be sure to initialize the first position's filename.
10238 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10239 mandated anyway.
10240 (AT_CHECK_CALC_GLR_CC): New.
10241 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10242
3953ed88
AD
102432006-01-02 Akim Demaille <akim@epita.fr>
10244
10245 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10246 c.m4.
0a96ba81 10247 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
10248 * data/glr.cc: Do not include stack.hh.
10249
9ecafbbf
AD
102502006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10251
10252 * data/glr.c: Reformat whitespace with tabs.
10253 (b4_lpure_formals): Remove this unused m4 macro.
10254 * tests/cxx-type.at: Reformat whitespace with tabs.
10255 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10256 since it's a member. Rename type to isNterm for clarity.
10257
c4d497a0
AD
102582005-12-29 Akim <akim@sulaco.local>
10259
10260 Let glr.cc catch up with symbol_value_print.
10261 * data/glr.cc (b4_yysymprint_generate): Replace by...
10262 (b4_yy_symbol_print_generate): this.
10263 (yy_symbol_print, yy_symbol_value_print): Declare them.
10264
4517da37
PE
102652005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10266
10267 * src/location.h (boundary): Note that a line or column equal
10268 to INT_MAX indicates an overflow.
10269 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10270 (rule_length_overflow, increment_rule_length, add_column_width):
10271 New functions.
10272 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10273 (<SC_BRACED_CODE>"}"):
10274 Use increment_rule_length rather than incrementing it by hand.
10275 (adjust_location, handle_syncline): Diagnose overflow.
10276 (handle_action_dollar, handle_action_at):
10277 Fix bug with monstrosities like $-2147483648.
10278 Remove now-unnecessary checks.
10279 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10280 (convert_ucn_to_byte): Verify assumptions.
10281 (handle_syncline): New arg LOC. All callers changed.
10282 Don't store through a value derived from char const * pointer.
10283
10284 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10285 GCC warnings.
10286
e3233bf6
PE
102872005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10288
10289 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10290 Remove unnecessary forward static decls.
10291
8f3596a6
AD
102922005-12-27 Akim Demaille <akim@epita.fr>
10293
10294 * src/reader.c (grammar_current_rule_check): Also check that $$
10295 is used.
10296 Take the rule to check as argument, hence rename as...
10297 (grammar_rule_check): this.
10298 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10299 Rename as...
10300 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10301 (grammar_midrule_action, grammar_symbol_append): Now static.
10302 * tests/torture.at (input): Don't rely on the default action
10303 being always performed.
10304 * tests/calc.at: "Set" $$ even when the action is "cut" with
10305 YYERROR or other.
10306 * tests/actions.at (Exotic Dollars): Instead of using unused
10307 values, check that the warning is issued.
10308
721be13c
PE
103092005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10310
10311 * NEWS: Improve wording for unused-value warnings.
10312
a0af42fc
AD
103132005-12-22 Akim Demaille <akim@epita.fr>
10314
10315 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10316 (b4_yysymprint_generate): Rename as...
10317 (b4_yy_symbol_print_generate): this.
10318 Generate yy_symbol_print instead of yysymprint.
10319 Generate also yy_symbol_value_print, and use it.
10320
affac613
AD
103212005-12-22 Akim Demaille <akim@epita.fr>
10322
721be13c 10323 * NEWS: Warn about unused values.
affac613
AD
10324 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10325 a `used' member.
10326 (symbol_list_n_get, symbol_list_n_used_set): New.
10327 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10328 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10329 * src/reader.c (grammar_current_rule_check): Check that values are
10330 used.
10331 * src/symtab.c (symbol_print): Accept 0.
10332 * tests/existing.at: Remove the type information.
10333 Empty the actions.
10334 Remove useless actions (beware of mid-rule actions: perl -000
10335 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10336 * tests/actions.at (Exotic Dollars): Use unused values.
10337 * tests/calc.at: Likewise.
10338 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10339 Likewise.
10340
10341 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10342 rule_useful_p.
10343
9d9b8b70
PE
103442005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10345
8bb4c753
PE
10346 Undo 2005-12-01 tentative license wording change. The wording is
10347 still being reviewed by the lawyers, and we don't want to wait for
10348 them before publishing a test release. For now, revert to the
10349 previous wording.
10350 * NEWS: Undo 2005-12-01 change.
10351 * data/glr.c: Revert to previous license wording.
10352 * data/glr.cc: Likewise.
10353 * data/lalr1.cc: Likewise.
10354 * data/location.cc: Likewise.
10355 * data/yacc.c: Likewise.
10356
9d9b8b70
PE
10357 * NEWS: Reword %destructor vs YYABORT etc.
10358 * data/glr.c: Use American spacing, for consistency.
10359 * data/glr.cc: Likewise.
10360 * data/lalr1.cc: Likewise.
10361 * data/yacc.c: Likewise.
10362 * data/yacc.c: Reformat comments slightly.
10363 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10364 for consistency. Fix some spelling errors and reword recently-included
10365 text slightly.
10366 * tests/cxx-type.at: Cast results of malloc, for C++.
10367
2c3b392a
AD
103682005-12-21 Joel E. Denny <address@hidden>
10369
10370 * tests/cxx-type.at: Construct a tree, count the parents of shared
10371 nodes, and free each node once and only once. Previously, the memory
10372 for semantic values was leaked instead.
10373
d6cff4dc
AD
103742005-12-21 Joel E. Denny <address@hidden>
10375
10376 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10377 (yylval, yylloc): If pure, #define to yystackp->yyval and
10378 yystackp->yyloc similar to yychar and yynerrs.
10379 (yyparse): If pure, remove local yylval and yylloc. Add local
10380 yystackp to accommodate pure definitions of yylval and yylloc.
10381 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10382 yylvalp and yyllocp to &yylval and &yylloc.
10383 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10384 namespace. Previously, nerrs and char were missing, but lval and lloc
10385 weren't necessary.
10386 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10387 yylvalp and yyllocp parameters since, if pure, these are now always
10388 accessible through yystackp. If not pure, they are still accessible
10389 globally.
10390 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10391 `if (YYID (N))' to pacify lint.
10392
a85284cf
AD
103932005-12-21 Akim Demaille <akim@epita.fr>
10394
10395 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10396 destroy the RHS symbols of a rule.
10397 * data/yacc.c (yylen): Initialize to 0.
10398 Keep its value to the number of items to possibly shift.
10399 In particular, a regular successful parse that ends on YYFINAL by
10400 a (internal) YYACCEPT must not have yylen != 0.
10401 (yyerrorlab, yyreturn): Pop the RHS.
10402 Reorder a bit to emphasize the `shifting' bits of code.
10403 (YYPOPSTACK): Now accept a number of items to pop.
10404 * data/lalr1.cc: Likewise.
10405 * data/glr.c: Formatting changes.
10406 Use goto instead of fall through.
10407 * doc/bison.texinfo (Destructor Decl): Complete.
10408
d508c281
JMG
104092005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10410
10411 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10412 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10413 * djgpp/config.bat: Replace every occurence of the file name
10414 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10415 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10416 * djgpp/config.sed: Replace every occurence of the file name
10417 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10418 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10419 * djgpp/djunpack.bat: DJGPP specific file.
10420 * djgpp/fnchange.lst: DJGPP specific file.
10421 * djgpp/README.in: Add new information about how to unpack the bison
10422 source on MSDOS and other systems which have 8.3 file name restrictions
10423 using djunpack.bat and fnchange.lst.
10424
3e7a2cd9
PE
104252005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10426
10427 * bootstrap (build_cvs_prefix): Remove; unused.
10428 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10429 when getting gnulib.
10430
104312005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10432
10433 * data/glr.c: Reorder typedef declarations for structs to match order
10434 of struct declarations.
10435 Rename yystack everywhere to yystackp except in yyparse where it's not
10436 a pointer.
10437 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10438 consistency.
10439 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10440 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10441 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10442 lint.
10443
877519f8
PE
104442005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10445
0eca5a39
PE
10446 * tests/sets.at (Accept): Fix typos in regular expression used to
10447 sed out the final state number.
10448
2cec9080
PE
10449 Work around portability problem on Solaris 10: flex-generated
10450 files include <stdio.h> before <config.h>, which messes up
10451 because the latter defines __EXTENSIONS__. Address the problem
10452 by creating two new little files that include <config.h> first,
10453 then include the flex-generated files. Rewrite everyone else
10454 to include <config.h> first, as well.
10455 * lib/timevar.c: Always include "config.h".
10456 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10457 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10458 (EXTRA_bison_SOURCES): New macro.
10459 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10460 * src/system.h: Don't include config.h.
10461 * src/LR0.c: Include <config.h> first.
10462 * src/assoc.c: Likewise.
10463 * src/closure.c: Likewise.
10464 * src/complain.c: Likewise.
10465 * src/conflicts.c: Likewise.
10466 * src/derives.c: Likewise.
10467 * src/files.c: Likewise.
10468 * src/getargs.c: Likewise.
10469 * src/gram.c: Likewise.
10470 * src/lalr.c: Likewise.
10471 * src/location.c: Likewise.
10472 * src/main.c: Likewise.
10473 * src/muscle_tab.c: Likewise.
10474 * src/nullable.c: Likewise.
10475 * src/output.c: Likewise.
10476 * src/parse-gram.y: Likewise.
10477 * src/print.c: Likewise.
10478 * src/print_graph.c: Likewise.
10479 * src/reader.c: Likewise.
10480 * src/reduce.c: Likewise.
10481 * src/relation.c: Likewise.
10482 * src/state.c: Likewise.
10483 * src/symlist.c: Likewise.
10484 * src/symtab.c: Likewise.
10485 * src/tables.c: Likewise.
10486 * src/uniqstr.c: Likewise.
10487 * src/vcg.c: Likewise.
10488
877519f8
PE
10489 * src/parse-gram.y: Fix minor problems uncovered by lint.
10490 (current_lhs, current_lhs_location): Now static.
10491 (current_assoc): Remove unused variable.
10492
10493 Cleanups so that Bison-generated parsers have less lint.
10494 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10495 Prepend /*ARGSUSED*/, for lint's sake.
10496 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10497 definition if 'lint' is defined.
10498 (YYID): New macro (or function, if lint).
10499 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10500 * data/yacc.c: Likewise.
10501 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10502 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10503 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10504 is C++ only.
10505 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10506 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10507 Use YYID(0) rather than 0, for lint.
10508 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10509 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10510
f5228370
PE
105112005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10512
10513 * tests/glr-regression.at
10514 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10515 Close memory leak reported by twlevo.
10516
69ce078b
PE
105172005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10518
6ff99711
PE
10519 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10520 all stacks.
10521 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
10522 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10523 New test case.
10524 (Duplicated user destructor for lookahead): This test now is expected
10525 to succeed.
10526
af3412cd
PE
105272005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10528
32b5b719 10529 * NEWS: Document the following change.
af3412cd
PE
10530 * data/yacc.c: Say "parser skeleton" rather than "file", since
10531 it's no longer just a file.
10532 * data/glr.c: Grant a special exception for C GLR parsers, that
10533 reads like the already-existing exception for C LALR(1) parsers.
10534 * data/glr.cc: Likewise.
10535 * data/lalr1.cc: Likewise.
10536 * data/location.cc: Likewise.
10537 * data/yacc.c: Reword the "written by" statement to clarify that
10538 it was the parser skeleton, not the entire output file.
10539 * data/glr.c: Written by Paul Hilfinger.
10540 * data/glr.cc: Written by Akim Demaille.
10541 * data/lalr1.cc: Likewise.
10542
035aa4a0
PE
105432005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10544
d9963c85
PE
10545 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10546 Fix typos in previous change that broke 'make check'.
10547 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10548 supported in C.
10549 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10550 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10551 We can revert this once things settle down.
10552
035aa4a0
PE
10553 * src/conflicts.c (conflicts_print): Don't print file name twice
10554 when %expect fails because there were no conflicts.
10555 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10556 change.
10557 * tests/conflicts.at (%expect not enough, %expect too much):
10558 (%expect with reduce conflicts): Adjust to new behavior.
10559
105602005-11-18 Akim Demaille <akim@epita.fr>
10561
10562 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10563 errors.
10564 * NEWS: Document this.
10565 * doc/bison.texinfo (Expect Decl): Likewise.
10566
d1ff7a7c
AD
105672005-11-16 Akim Demaille <akim@epita.fr>
10568
10569 Generalize the display of semantic values and locations in traces.
10570 * data/glr.c (yy_reduce_print): Fix indices (again).
10571 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10572 literal integers.
10573 * data/lalr1.cc (yyreduce_print): Rename as...
10574 (yy_reduce_print): this.
10575 Display values and locations.
10576 * data/yacc.c (yy_reduce_print): Likewise.
10577 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10578 (yysymprint): Move higher to be visible from yy_reduce_print).
10579 (yyparse): Adjust.
10580 * tests/calc.at: Adjust the expected length of the traces.
10581
6de5398d
AD
105822005-11-14 Akim Demaille <akim@epita.fr>
10583
10584 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10585 from 1 to N, while values and location start at 0.
10586 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10587
a1373f55
AD
105882005-11-14 Akim Demaille <akim@epita.fr>
10589
10590 * data/glr.c (yy_reduce_print): Fix the $ number.
10591
613d8952
AD
105922005-11-14 Akim Demaille <akim@epita.fr>
10593
10594 "Use" parse parameters.
10595 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10596 * data/glr.c, data/glr.cc: Use them.
10597 * data/glr.c (YYUSE): Have a C++ definition that supports
10598 non-pointer types.
10599
b2741627
AD
106002005-11-14 Akim Demaille <akim@epita.fr>
10601
10602 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10603
5059b5c8
AD
106042005-11-14 Akim Demaille <akim@epita.fr>
10605
42249483
AD
10606 * data/glr.cc: New.
10607 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 10608
4626a15d
AD
106092005-11-12 Akim Demaille <akim@epita.fr>
10610
10611 Let position and location be PODs.
10612 * data/location.cc (position::initialize, location::initialize): New.
10613 (position::position, location::location): Define only if
10614 b4_location_constructors is defined.
10615 * data/lalr1.cc (b4_location_constructors): Define it for backward
10616 compatibility.
10617 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10618
106192005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
10620
10621 * data/lalr1.cc: Move the body of the ctor and dtor into the
10622 parser file (instead of the header).
10623 Wrap the implementations in a "namespace yy".
10624
106252005-11-12 Akim Demaille <akim@epita.fr>
10626
10627 Have glr.c include its header file when created.
10628 * data/glr.c (b4_shared_declarations): New.
10629 Output them verbatim in the parser if !%defines, otherwise
10630 output then in the header file, and include it instead.
10631
1989d947
AD
106322005-11-11 Akim Demaille <akim@epita.fr>
10633
10634 * data/glr.c: Comment changes.
10635
106362005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
10637
10638 When yydebug, report semantic and location values for reductions.
10639 * data/glr.c (yy_reduce_print): Report the semantic values and the
10640 locations.
10641 (YY_REDUCE_PRINT): Adjust.
10642 (yyglrReduce): Use them.
10643 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10644 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10645 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10646 traces.
10647
02998094
AD
106482005-11-10 Akim Demaille <akim@epita.fr>
10649
10650 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10651 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10652 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10653
5210672f
PE
106542005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10655
10656 * m4/cxx.m4, examples/Makefile.am: Don't build
10657 examples/calc++ if no C++ compiler is available. (trivial change)
10658
a8991a1d
AD
106592005-11-09 Akim Demaille <akim@epita.fr>
10660
10661 * src/scan-skel.l: Use a couple of asserts.
10662
36b5e963
AD
106632005-11-03 Akim Demaille <akim@epita.fr>
10664
10665 In some (weird) cases, the final state number is incorrect.
10666 Reported by Alexandre Duret-Lutz.
10667 * src/LR0.c (state_list_append): Remove the computation of
10668 final_state.
10669 (save_reductions): Do it here.
10670 (get_state): Alpha conversion.
10671 (generate_states): Use a for loop.
10672 * src/gram.h (item_number_is_rule_number)
10673 (item_number_is_symbol_number): New.
10674 * src/state.c: Use assert.
10675 * src/system.h: Include assert.h.
10676 * tests/sets.at (Accept): New.
10677
44e7ead1
PH
106782005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10679
10680 * data/glr.c (yyfill): Adjust comment.
36b5e963 10681 (yyresolveAction): Initialize default location properly
44e7ead1
PH
10682 for empty right-hand sides.
10683 (yydoAction): Ditto.
10684 Add comment explaining apparently dead code.
36b5e963
AD
10685 * tests/glr-regression.at
10686 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 10687 New test.
36b5e963 10688
e10a80ee
PE
106892005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10690
10691 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10692 gnulib when interrupted. This fixes some race conditions and
10693 works around some portability problems (one noted by Paul
10694 Hilfinger).
10695
067b32ee
AD
106962005-10-22 Akim <akim@epita.fr>
10697
10698 * Makefile.cfg: Adjust to config -> build-aux.
10699 Reported by twledo.
10700
4b367315
AD
107012005-10-21 Akim Demaille <akim@epita.fr>
10702
10703 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10704 the %parse-params.
10705 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10706 * data/yacc.c (b4_Pure_if): Rename as...
10707 (b4_yacc_pure_if): this.
10708 (YY_SYMBOL_PRINT, yyparse): Adjust.
10709 * doc/bison.texinfo: Formatting changes.
10710
24cc23d9
AD
107112005-10-21 Akim Demaille <akim@epita.fr>
10712
10713 Finish the transition config -> build-aux.
10714 * configure.ac, Makefile.am: Use build-aux.
10715 * config/prev-version, config/announce-gen, config/Makefile.am:
10716 Move to...
10717 * build-aux/prev-version, build-aux/announce-gen,
10718 * build-aux/Makefile.am: here.
10719
d4476375
AD
107202005-10-14 Akim Demaille <akim@epita.fr>
10721
10722 * examples/calc++/test: Use set -x only when VERBOSE.
10723
302c0aee
PE
107242005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10725
10726 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10727 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10728
7625ec2c
AD
107292005-10-13 Akim Demaille <akim@epita.fr>
10730
10731 * src/scan-skel.l: Output the base name parts of the parser and
10732 header file names.
302c0aee 10733 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
10734 additional checks.
10735 Use this to exercise C++ outputs in subdirs.
10736 Reported by Oleg Smolsky.
10737
ba0fe3c7
PE
107382005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10739
10740 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10741 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10742 Problem reported by John P. Hartmann.
10743 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10744 already defined it.
10745
9b8a5ce0
AD
107462005-10-12 Akim Demaille <akim@epita.fr>
10747
10748 * src/parse-gram.y (version_check): Exit 63 to please missing
10749 (stands for "version mismatch).
10750 * tests/input.at, doc/bison.texinfo: Adjust.
10751
4f6e011e
PE
107522005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10753
10754 Work around portability problems with Visual Age C compiler
10755 (xlc and xlC_r) reported by John P. Hartmann.
10756 * data/location.cc (initial_column, initial_line): Remove.
10757 All uses replaced by 0 and 1.
10758 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10759 that xlc complains about.
10760 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 10761 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 10762 as __STDC__.
4d7aa45e
PE
10763 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10764 __STDC_VERSION__. Use it everywhere instead of looking at
10765 __STDC__ and __cplusplus.
4f6e011e 10766
a1b3bf8c
AD
107672005-10-10 Akim Demaille <akim@epita.fr>
10768
10769 * examples/calc++/test: Be quiet unless VERBOSE.
10770
412e44aa
PE
107712005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10772
2a4647a3
PE
10773 * data/c.m4 (yydestruct, yysymprint):
10774 Use YYUSE instead of casting to void.
10775 * data/glr.c (YYUSE): New macro.
10776 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10777 Use it instead of rolling our own.
10778 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10779 (YYCHK1):
10780 Use /*CONSTCOND*/ to suppress lint warnings.
10781 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10782 (YY_STACK_PRINT): Use 'false' not '0'.
10783 (YYUSE): New macro.
10784 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10785 * data/yacc.c (YYUSE): New macro.
10786 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10787 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10788 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10789
10790
412e44aa
PE
10791 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10792 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10793
88c6637f
PE
107942005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10795
2f4f028d
PE
10796 Undo the parts of the unlocked-I/O change that substituted
10797 putc or puts for printf. This might hurt performance a bit,
10798 but some people prefer the printf style.
10799 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10800 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10801 All uses replaced by YYFPRINTF and YYDPRINTF.
10802 * data/yacc.c: Likewise.
10803 * lib/bitset.c (bitset_print): Likewise.
10804 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10805 putc and puts.
10806 * lib/lbitset.c (debug_lbitset): Likewise.
10807 * src/closure.c (print_firsts, print_fderives): Likewise.
10808 * src/gram.c (grammar_dump): Likewise.
10809 * src/lalr.c (look_ahead_tokens_print): Likewise.
10810 * src/output.c (escaped_output): Likewise.
10811 (user_actions_output): Break apart two printfs.
10812 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10813 * src/reduce.c (reduce_print): Likewise.
10814 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10815 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10816
88c6637f
PE
10817 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10818 Use assignments rather than casts-to-void to suppress
10819 unused-variable warnings. This pacifies 'lint'.
10820 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10821 unused-variable warnings.
10822
fb32e373
JMG
108232005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10824
10825 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10826
edb8f44f
PE
108272005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10828
fb9c0b33
PE
10829 Use unlocked I/O for a minor performance improvement on hosts like
10830 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10831 is to use the gnlib unlocked-io module, and to prefer putc and
10832 puts to printf when either will work (since the latter doesn't
10833 come in an unlocked flavor).
10834 * bootstrap (gnulib_modules): Add unlocked-io.
10835 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10836 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10837 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10838 and similarly for puts and putc and printf.
10839 * data/yacc.c: Likewise.
10840 * lib/bitset.c (bitset_print): Likewise.
10841 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10842 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10843 to printf.
10844 * lib/lbitset.c (debug_lbitset): Likewise.
10845 * src/closure.c (print_firsts, print_fderives): Likewise.
10846 * src/gram.c (grammar_dump): Likewise.
10847 * src/lalr.c (look_ahead_tokens_print): Likewise.
10848 * src/output.c (escaped_output): Likewise.
10849 (user_actions_output): Coalesce two printfs.
2f4f028d 10850 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
10851 * src/reduce.c (reduce_print): Likewise.
10852 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 10853 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 10854
edb8f44f
PE
10855 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10856 this confuses xgettext.
10857
b50d2359
AD
108582005-10-02 Akim Demaille <akim@epita.fr>
10859
10860 * bootstrap (gnulib_modules): Add strverscmp.
10861 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10862 * m4/.cvsignore: Add strverscmp.m4.
10863 * src/parse-gram.y (%require): New token, new rule.
10864 (version_check): New.
10865 * src/scan-gram.l (%require): Adjust.
10866 * tests/input.at (AT_REQUIRE): New.
10867 Use it.
10868 * doc/bison.texinfo (Require Decl): New.
10869 (Calc++ Parser): Use %require.
10870
21667f64
AD
108712005-10-02 Akim Demaille <akim@epita.fr>
10872
10873 * data/location.cc: New.
10874
2b81e969
AD
108752005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10876 Akim Demaille <akim@epita.fr>
10877
10878 Make sure -odir/foo.cc creates dir/location.hh etc.
10879 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10880 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10881 (spec_defines_file): Now const.
10882 (dir_prefix): New.
10883 (short_base_name): Remove.
10884 * src/files.c: Adjust.
10885 (dirname.h): Include.
10886 (base_name): Don't prototype it.
10887 (finput): Remove, duplicates gram_in.
10888 (full_base_name, short_base_name): Replace by...
10889 (all_but_ext, all_but_tab_ext): these.
10890 (compute_base_names): Rename as...
10891 (compute_file_name_parts): this.
10892 Update to compute the new variables, including dir_prefix.
10893 Adjust dependencies.
10894 * src/output.c (prepare): Output them.
10895 * src/reader.c: Adjust to use gram_in, not finput.
10896 * src/scan-skel.l (@dir_prefix@): New.
10897
ad6a9b97
JMG
108982005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10899
10900 * lib/subpipe.c: New function end_of_output_subpipe() added
10901 to allow support for non-posix systems. This is a no-op function
10902 for posix systems.
10903
10904 * lib/subpipe.h: New function end_of_output_subpipe() added
10905 to allow support for non-posix systems. This is a no-op function
10906 for posix systems.
10907
10908 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10909 handle the lack of pipe/fork functionality on non-posix systems.
10910
10911 * djgpp/Makefile.maint: DJGPP specific file.
10912
10913 * djgpp/README.in: DJGPP specific file.
10914
10915 * djgpp/config.bat: DJGPP specific configuration file.
10916
10917 * djgpp/config.sed: DJGPP specific configuration file.
10918
10919 * djgpp/config.site: DJGPP specific configuration file.
10920
10921 * djgpp/config_h.sed: DJGPP specific configuration file.
10922
10923 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10924
10925 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10926
fc695704
AD
109272005-10-02 Akim Demaille <akim@epita.fr>
10928
10929 * data/location.cc: New, extract from...
10930 * data/lalr1.cc: here.
10931 (location.hh): Include it after the user prologue, in case the
10932 filename type is defined by the user.
10933 Forward declation location and position before the pre-prologue.
10934 (yyresult_): Rename as...
10935 (yyresult): this, it's a local variable, not an attribute.
10936 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10937
109382005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
10939
10940 * examples/extexi: Restore the #line generation.
10941
fb9712a9
AD
109422005-09-30 Akim Demaille <akim@epita.fr>,
10943 Alexandre Duret-Lutz <adl@gnu.org>
10944
10945 Move the token type and YYSTYPE in the parser class.
10946 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
10947 (parser::token): New, from the moved free definition of tokens.
10948 (parser::semantic_value): Now a full definition instead of an
10949 indirection to YYSTYPE.
10950 (b4_post_prologue): No longer included in the header file, but
10951 in the implementation file.
10952 * doc/bison.texi (C+ Language Interface): Update.
10953 * src/parse-gram.y: Support unary %define.
10954 * tests/actions.at: Define global_tokens_and_yystype for backward
10955 compatibility until we update the tests.
10956 * tests/calc.at: Idem.
10957 (first_line, first_column, last_line, last_column): Define for lalr1.cc
10958 to simplify the code.
10959
55f0c7b1
PE
109602005-09-29 Paul Eggert <eggert@cs.ucla.edu>
10961
10962 Port to SunOS 4.1.4, which lacks strtoul and strerror.
10963 Ah, the good old days! Problem reported by Peter Klein.
10964 * bootstrap (gnulib_modules): Add strerror, strtoul.
10965 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
10966 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
10967
fb9712a9 109682005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
10969
10970 * data/c.m4 (b4_error_verbose_if): New.
10971 * data/lalr1.cc: Use it.
10972 (YYERROR_VERBOSE_IF): Remove.
10973 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
10974 parser members, replaced by...
10975 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
10976 local variables.
10977 (yysyntax_error_): Takes the state number as argument.
10978 (yyreduce_print_): Use the argument yyrule, not the former
10979 attribute yyn_.
10980
8a6f72f3
PE
109812005-09-26 Paul Eggert <eggert@cs.ucla.edu>
10982
10983 * bootstrap (gnulib_modules): Add verify.
10984 * lib/.cvsignore: Add verify.h.
10985 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
10986 * src/system.h (verify): Remove.
10987 Include verify.h instead.
10988 * src/tables.c (tables_generate): Use new API for 'verify'.
10989
0d50976f
PE
109902005-09-21 Paul Eggert <eggert@cs.ucla.edu>
10991
ebc3737e
PE
10992 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
10993 local variables whose names begin with 'yy'.
10994 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10995 Trivial changes from Joel E. Denny.
10996
0d50976f
PE
10997 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10998 it itself.
10999 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11000 don't use alloca any more.
11001
11002 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11003 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 11004 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
11005 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11006 to match yacc.c, to test more hosts.
11007
a05b79df
PE
110082005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11009
55289366
PE
11010 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11011 doesn't affect behavior.
11012 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11013 Solaris, AIX, MSC.
11014 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11015 This works a bit better with glibc, if user code has already included
11016 stdlib.h.
11017 * doc/bison.texinfo (Bison Parser): Document that users can't
11018 arbitrarily use malloc and free for other purposes. Document
11019 that <alloca.h> and <malloc.h> might be included.
11020 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11021 user must declare alloca.
11022
a05b79df
PE
11023 * HACKING (release): Forwarn the Translation Project about
11024 stable releses.
11025
3ab2ca22
AD
110262005-09-20 Akim Demaille <akim@epita.fr>
11027
11028 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11029
a9739e7c
PE
110302005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11031
a702593e
PE
11032 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11033 (YYSTACK_ALLOC_MAXIMUM): Use it.
11034 (yysyntax_error): New function.
11035 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11036 multiple syntax errors are reported, and alloca is being used.
11037 Instead, reallocate buffers twice as big each time, so that
11038 we waste at most half the allocated memory. Start with a small
11039 (128-byte) buffer that will suffice in most cases anyway.
11040 Use yysyntax_error to do most of the work.
11041
11042 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11043 yynerrs is the number of errors reported, not the number of
11044 errors encountered.
11045
a9739e7c
PE
11046 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11047 Mark it as expected to fail.
11048 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11049 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11050 Don't start user-code symbols with "yy", to avoid name space problems.
11051
f479c6c6
AD
110522005-09-19 Akim Demaille <akim@epita.fr>
11053
11054 Remove the traits, failed experiment.
11055 It never proved useful, and anyway because of the current
11056 definition, it was not possible to have several specialization of
11057 this traits, making it useless.
11058 * data/lalr1.cc (yy:traits): Remove.
11059 Inline its definitions in the parser class.
11060
e2586f82
AD
110612005-09-19 Akim Demaille <akim@epita.fr>
11062
11063 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11064 least Mac OSX with a /usr/local install of gettext.
11065
2e8cf949
AD
110662005-09-19 Akim Demaille <akim@epita.fr>
11067
11068 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11069 and yytoken for similarity with the other skeletons.
11070
c7fb0b90
AD
110712005-09-19 Akim Demaille <akim@epita.fr>
11072
4e26c69e 11073 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 11074
1bd0deda
PE
110752005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11076
11077 * NEWS: Version 2.1.
11078
11079 * NEWS: Remove notice of yytname change, since it was never in an
11080 official release.
11081 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11082 diagnostic.
11083 * src/output.c (prepare): Likewise.
11084 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11085 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11086 is not defined. This is an awful hack, but it's enough for now.
11087 All callers changed.
11088 * tests/glr-regression-at (make_value): Args are const pointers now,
11089 to avoid GCC warning.
11090 (Duplicated user destructor for lookahead): New test. Currently
11091 skipped. It fails on my host but I'm not sure it'll always fail.
11092
110932005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
11094
11095 * src/symtab.h (struct symbol): Declare the printer and destructor
11096 as const, to avoid accidental calls to free.
11097 (symbol_destructor_set, symbol_printer_set): Adjust.
11098 * src/symtab.c: Adjust.
11099
1bd0deda 111002005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
11101
11102 * data/c.m4 (b4_token_enums): New.
11103 (b4_token_defines): Rename as...
11104 (b4_token_enums_defines): this.
11105 (b4_token_defines): New, output only the #defines.
11106 * data/yacc.c, data/glr.c: Adjust.
11107 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11108 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11109 as default values.
11110
dbcdae2d
AD
111112005-09-16 Akim Demaille <akim@epita.fr>
11112
11113 * data/lalr1.cc (yylex_): Remove, inline its code.
11114 (yyreport_syntax_error_): Remove, replaced by...
11115 (yysyntax_error_): this which returns a string and leaves to the
11116 caller the call to the users' error function.
11117 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11118 Move from members of the parser object...
11119 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11120 to local variables of the parse function.
11121
70d8f291
AD
111222005-09-16 Akim Demaille <akim@epita.fr>
11123
11124 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11125 since it's in Bison's name space.
11126
b47dbebe
PE
111272005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11128
ae199bf1
PE
11129 * data/glr.c (yyresolveValue): Add default case to pacify
11130 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11131
b47dbebe
PE
11132 * NEWS: Document when yyparse started to return 2.
11133 * doc/bison.texinfo (Parser Function): Document when yyparse
11134 returns 2.
11135
11136 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11137 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11138 changed.
11139 (class position): file_name -> filename (reverting). All uses changed.
11140
111412005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11142
11143 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11144 do anything if $@ exists. This reverts part of the 2005-07-07
11145 patch.
11146
00292f66
PE
111472005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11148
11149 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11150 contains obsolete information and isn't worth distributing as a
11151 separate file anyway.
11152 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11153 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11154 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11155 (yyparse): Abort if user code uses longjmp to throw an unexpected
11156 value.
11157
a420f962
PE
111582005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11159
00292f66
PE
11160 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11161 Suggested by twlevo@xs4all.nl.
11162
127287e9
PE
11163 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11164 This avoids a diagnostic from gcc -Wswitch-enum.
11165 Problem reported by twlevo@xs4all.nl.
11166
a420f962
PE
11167 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11168 standards. Use "file name" or "file" or "name", depending on
11169 the context.
11170 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11171 not to hack/foo.tab.c.
11172 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
11173 * data/glr.c: b4_filename -> b4_file_name.
11174 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11175 All uses changed.
11176 (class position): filename -> file_name. All uses changed.
11177 * data/yacc.c: b4_filename -> b4_file_name.
11178 * lib/bitset.h: filename -> file_name in local vars.
11179 * lib/bitset_stats.c: Likewise.
11180 * src/files.c: Likewise.
11181 * src/scan-skel.l ("@output ".*\n): Likewise.
11182 * src/files.c (file_name_split): Renamed from filename_split.
11183 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
11184
111852005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11186
11187 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11188 to accommodate latest gnulib.
11189
11190 * tests/glr-regression.at (Duplicate representation of merged trees):
11191 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11192
11193 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11194 needed.
11195
42a6501d
PE
111962005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11197
11198 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11199 All uses changed. Invoke user destructor after an error during a
11200 split parse (trivial change from Joel E. Denny).
11201
11202 * tests/glr-regression.at
11203 (User destructor after an error during a split parse): New test case.
11204 Problem reported by Joel E. Denny in:
11205 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11206
ef9a1faf
PE
112072005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11208
5b4aaf78
PE
11209 * README-cvs: Give URLs for recommended tools.
11210 Mention Gzip version problem, and bootstrapping issues.
11211 Remove troubleshooting section, as it's somewhat obsolete.
11212
b5240ba5
PE
11213 * bootstrap (no_cache): New var, to accommodate different wget
11214 variants. Use it instead of '-C off'. Problem reported by
11215 twlevo@xs4all.nl.
11216
ef9a1faf
PE
11217 * data/glr.c (yydestroyStackItem): New function.
11218 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11219 debugging information. Problem reported by Joel E. Denny.
11220
e6efa9da
AD
112212005-08-25 Akim Demaille <akim@epita.fr>
11222
11223 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11224
adc90f13
PE
112252005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11226
11227 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11228 Don't invoke destructor on unresolved entries.
11229 * tests/glr-regression.at
11230 (User destructor for unresolved GLR semantic value): New test case.
11231 Problem reported by Joel E. Denny in:
11232 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11233
f9315de5
PE
112342005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11235
15d29c1f
PE
11236 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11237 Add strnlen.c.
11238 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11239 lib-prefix.m4, po.m4.
11240
dd5f2af2
PE
11241 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11242 in yydestruct diagnostic, since it might not be an error.
11243 Problem reported by Joel Denny near end of
11244 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 11245 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
11246 * data/yacc.c (yyreturn): Likewise.
11247 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11248
11249 * src/files.c: Remove obsolete FIXME comment.
11250
11251 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11252 with the other templates, and to fix bogus run-on messages such
11253 as the one reported at the end of
11254 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11255 All callers changed to avoid the newline.
11256 (yyprocessOneStack): Output two lines rather than one, to accommodate
11257 the above change. This changes the debug output format slightly.
11258
f9315de5
PE
11259 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11260 reported by Joel E. Denny in
11261 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11262 (trivial change).
11263 * tests/glr-regression.at (Duplicate representation of merged trees):
11264 New test, from Joel E. Denny in:
11265 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11266 * THANKS: Add Joel E. Denny.
11267
11268 * configure.ac (AC_INIT): Bump to 2.0c.
11269
04098407
PE
112702005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11271
11272 * NEWS: Version 2.0b.
11273
ca5d2013
PE
11274 * Makefile.am (SUBDIRS): Put examples before tests, so that
11275 "make check" doesn't finish with "All 1 tests passed".
11276
3d54b576
PE
11277 * tests/regression.at (Token definitions): Don't rely on
11278 AT_PARSER_CHECK for data that contains backslashes. It currently
11279 uses 'echo', and 'echo' isn't portable if its argument contains
11280 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11281 that the byte '\0xff' is not printable in the C locale; it is,
11282 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11283 not printable, so use '\0x81' to test.
11284
d53ae497
PE
11285 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11286 version of GCC, since the macro is used with non-GCC compilers.
11287
fc01665e
PE
11288 Fix core dump reported by Pablo De Napoli in
11289 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11290 * tests/regression.at (Invalid inputs with {}): New test.
11291 * src/parse-gram.y (token_name): Translate type before using
11292 it as an index.
11293
04098407
PE
11294 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11295 the user's name space. All uses changed to __attribute__
11296 ((__unused__)).
11297 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11298 Add __attribute__ ((__noreturn__)).
11299
11300 * etc/clcommit: Remove. We weren't using it, and it failed
11301 "make maintainer-distcheck".
11302 * Makefile.maint: Merge from coreutils.
11303 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11304 (syntax-check-rules): Change list of rules as described below.
11305 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11306 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11307 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11308 (sc_trailing_space): New rules.
11309 (sc_xalloc_h_in_src): Remove.
11310 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11311 (sc_space_tab, sc_error_exit_success, sc_changelog):
11312 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11313 (makefile-check, po-check, author_mark_check):
11314 (makefile_path_separator_check, copyright-check):
11315 Use grep -n, to make it easier to find violations.
11316 Use CVS_LIST and CVS_LIST_EXCEPT.
11317 (header_regexp, h_re): Remove.
11318 (dd_c): New macro.
11319 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11320 (my-distcheck): Use more-modern GCC flags.
11321 (signatures, %.asc): Remove.
11322 (rel-files, announcement): Remove signatures.
11323 Restore old updating code, even though we don't use it, so
11324 that we're the same as coreutils.
11325 (alpha, beta, major): Depend on news-date-check.
11326 Make the upload commands.
11327
11328 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11329 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11330 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11331 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11332 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11333 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11334 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11335 * tests/sets.at: Likewise.
11336
11337 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11338 we comment out the Autoconf version number.
11339 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11340 it's error-prone and "make maintainer-distcheck" rejects it.
11341
11342 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11343 Indent calls to "error" to pacify "make maintainer-distcheck",
11344 when the calls are not intended to be translated.
11345 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11346
11347 * src/Makefile.am (DEFS): Use +=, to pacify
11348 "make maintainer-distcheck".
11349 (bison_SOURCES): Add scan-skel.h.
11350 (sc_tight_scope): New rule, from coreutils.
11351
11352 * src/files.c (src_extension, header_extension):
11353 Now static, not extern.
11354 * src/getargs.c (short_options): Likewise.
11355 * src/muscle_tab.c (muscle_table): Likewise.
11356 * src/parse-gram.y (current_class, current_type, current_prec):
11357 Likewise.
11358 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11359 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11360 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11361 void, to avoid warning when NLS is disabled.
11362 * src/output.c: Include scan-skel.h.
11363 (scan_skel): Remove decl, since scan-skel.h does this.
11364 (output_skeleton):
11365 Indent calls to "error" to pacify "make maintainer-distcheck".
11366 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11367 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11368 "make maintainer-distcheck".
11369 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11370 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11371 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11372 (skel_lex_destroy, scan_skel): Move these decls to...
11373 * src/scan-skel.h: New file.
11374 * src/uniqstr.c (uniqstr_assert):
11375 Indent calls to "error" to pacify "make maintainer-distcheck".
11376
11377 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11378 not @VAR@.
11379
11380 * tests/torture.at: Revamp to avoid misuse of atoi that
11381 "make maintainer-distcheck" complained about.
11382
11383 * examples/extexi (message): Don't print a message more than once,
11384 and omit line-number decoration that makes Emacs compile think
11385 that informative messages are worth worrying about.
11386
113872005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11388
11389 * configure.ac: Update version number.
11390
11391 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11392 accidentally.
11393 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11394 autogenerated by the maintainer.
11395 * examples/calc++/.cvsignore: Add *.yy.
11396
11397 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11398 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11399 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11400
11401 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11402
11403 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11404 from maintainer-distcheck about casting the argument of 'free'.
11405
11406 * NEWS: Mention recent yytname changes.
11407 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11408
11409 * bootstrap: For translations that have not yet been upgraded to
11410 the new runtime-po domain, prime the pump by extracting the
11411 relevant strings from the obsolete translations. This code can be
11412 removed once the bison-runtime domain has been translated by each
11413 team.
11414
11415 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11416 now that token names are already quoted.
11417
11418 Fix problem reported by Anthony Heading.
11419 * data/glr.c (YYTOKEN_TABLE): New macro.
11420 (yytname): Define if YYTOKEN_TABLE.
11421 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11422 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11423 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11424 * src/output.c (prepare_symbols): Output token_table_flag.
11425
0ffda363
PE
114262005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11427
11428 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11429 again if the first call fails.
11430
11431 * data/glr.c (yytnamerr): New function.
11432 (yyreportSyntaxError): Use it to dequote most string literals.
11433 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11434 with other skeletons. All uses changed.
11435 (yytnameerr_): New function.
11436 (yyreport_syntax_error): Use it to dequote most string literals.
11437 * data/yacc.c (yytnamerr): New function.
11438 (yyerrlab): Use it to decode most string literals.
11439 * doc/bison.texinfo (Decl Summary, Calling Convention):
11440 Clarify quoting convention of yytname.
11441 * src/output.c (prepare_symbols): Quote all names. This undoes
11442 the 2005-04-17 change, which is now accomplished (mostly) via
11443 changes in the parsers as described above.
11444 * tests/regression.at (Token definitions, Web2c Actions):
11445 Undo most 2005-04-17 change here, too.
11446
114472005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11448
11449 Fix more problems reported by twlevo@xs4all.nl.
11450 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11451 remove trailing spaces. This loses the exit status of ./types,
11452 and isn't needed since ./types shouldn't be emitting trailing
11453 spaces.
11454 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11455 as the stack isn't valid in that case.
11456
11457 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11458 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11459 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11460 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11461 is used.
11462 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11463 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11464 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11465 Likewise.
11466
11467 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11468 overly-picky compilers that reject 'char *foo = "bar";'.
11469
11470 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11471 to FILE * parameter, not to stderr. This fixes a typo introduced
11472 in the 2005-07-12 change.
11473
11474 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11475 warnings from GCC 4.
11476
11477 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11478 (yyglrShiftDefer, yysplitStack):
11479 Remove unused parameters b4_pure_formals. All uses changed.
11480 (yyglrShift): Remove unused parameters b4_user_formals.
11481 All uses changed.
11482 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11483
6100a9aa
PE
114842005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11485
258b75ca
PE
11486 Destructor cleanups and regularization among the three skeletons.
11487 * NEWS: Document the behavior changes.
11488 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11489 stack before failing, as the cleanup code will do it for us now.
11490 * data/lalr1.cc (yyerrlab): Likewise.
11491 * data/glr.c (yyparse): Pop everything off the stack before
11492 freeing it, so that destructors get called properly.
11493 * data/lalr1.cc (yyreturn): Likewise.
11494 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11495 This is more consistent.
11496 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11497 why destructors might be called. 1.875 -> 2.1.
11498 (Destructor Decl, Decl Summary, Table of Symbols):
11499 Some English-language cleanups for %destructor.
11500 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11501 Add output line for destructor of start symbol.
11502 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11503 because of that same extra output line.
11504
1a059451
PE
11505 * NEWS: Document minor wording changes in diagnostics of
11506 Bison-generated parsers.
11507 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11508 Remove unused formals. All uses changed.
11509 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11510 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11511 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11512 Rename yyoverflowab to yyexhaustedlab.
11513 When memory exhaustion occurs during syntax-error reporting,
11514 report it separately rather than in a single diagnostic; this
11515 eases translation.
11516 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11517 (Memory Exhausted): Renamed from Parser Stack Overflow.
11518 Revamp wording slightly to prefer "memory exhaustion".
11519 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11520
97460c78
PE
11521 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11522
30757c8c
PE
11523 Add i18n support to the GLR skeleton. Partially fix the C++
11524 skeleton; a C++ expert needs to finish this. Remove debugging
11525 msgids; there's little point to having them translated, since they
11526 can be understood only by someone who can read the
11527 (English-language) source code.
11528
11529 Generate runtime-po/bison-runtime.pot automatically, so that we
11530 don't have to worry about garbage getting in that file. We'll
11531 make sure after the next official release that old msgids don't
11532 get lost. See
11533 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11534
11535 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11536 Now auto-generated.
11537 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11538 Fix typos in explanations of the runtime file.
11539 * bootstrap: Change gettext keyword from YYI18N to YY_.
11540 Use standard Makefile.in.in in runtime-po, since we'll arrange
11541 for backward-compatible bison-runtime.po files in a different way.
11542 * data/glr.c (YY_): New macro, from yacc.c.
11543 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11544 Translate messages intended for users.
11545 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11546 the wording in the other skeletons. We don't know that the memory
11547 is virtual.
11548 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11549 Use same method that yacc.c uses.
11550 Don't translate debugging messages.
11551 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11552 it doesn't work (yet), and requires C++ expertise to fix.
11553 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11554 Move defn to a more logical place, to be consistent with other
11555 skeletons.
11556 Don't translate debugging messages.
11557 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11558 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11559 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11560 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11561
ac8c5689
PE
11562 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11563 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11564 void, not int.
11565 * tests/glr-regression.at (Badly Collapsed GLR States):
11566 Likewise.
11567 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11568 yylex should return 0 at EOF rather than aborting.
11569
6100a9aa
PE
11570 Improve tests for stack overflow in GLR parser.
11571 Problem reported by twlevo@xs4all.nl.
11572 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11573 All uses removed.
11574 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11575 can handle the problem.
11576 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11577 (yyparse): New local variable yyresult to record the result.
11578 Use result of setjmp to set it, rather than storing itinto
11579 struct.
11580 (yyDone): Remove label.
11581 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11582 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11583 if YYABORT is used).
11584 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11585 yyparse status; put status > 1 into diagnostic.
11586 Check that status==2 works.
11587 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11588 Use exit status 3 for failure to open (which shouldn't happen).
11589
15f40952
PE
115902005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11591
67fd79c4
PE
11592 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11593 1 on syntax error; just let yyparse do its thing.
11594 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11595 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11596 (Exploding the Stack Size with Alloca):
11597 (Exploding the Stack Size with Malloc):
11598 Expect exit status 2, not 1, since the parser is supposed to blow
11599 its stack. Problem reported by twlevo@xs4all.nl.
11600
15f40952
PE
11601 * data/glr.c (yyparse): Don't assume that the initial calls
11602 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11603 Print a stack-overflow message and fail instead.
11604 Initialize the line-number information before creating the stack,
11605 so that the stack-overflow message can report line zero safely.
11606
f32c66b5
PE
116072005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11608
a22ff96f 11609 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
11610 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11611 (yyuserMerge): Provide a default case if b4_mergers is empty.
11612 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11613 * tests/glr-regression.at
11614 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 11615 Add casts to pacify C++ compilers.
1beb0b24
PE
11616 * tests/glr-regression.at (Improper merging of GLR delayed action
11617 sets): Declare yylex before using it.
f32c66b5 11618 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
11619 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11620 test for valgrind; valgrind is independent of g++.
11621 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11622 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11623 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11624 Use a destructor, so that we can expand the stack. Change
11625 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 11626
d741bd1b
PE
116272005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11628
11629 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11630 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11631
0410a6e0
PE
116322005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11633
11634 * PACKAGING: New file, suggested by Bruno Haible and taken from
11635 similar wording in gettext's PACKAGING file.
11636 * NEWS: Mention PACKAGING.
11637 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11638
f7ab6a50
PE
116392005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11640
baf785db 11641 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
11642 * bootstrap: Get runtime translations into runtime-po.
11643 Create runtime-po files automatically, if possible.
11644 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11645 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11646 does not infringe on the user's name space.
11647 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11648 * doc/bison.texinfo (Internationalization): Revamp the English
11649 and Texinfo syntax a bit, to try to make it clearer.
11650 (Bison Options, Option Cross Key): Mention --print-localedir.
11651 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11652 YYENABLE_NLS. Quote a bit more.
11653 * runtime-po/.cvsignore: New file.
11654 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11655 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11656 * runtime-po/quot.sed: Likewise.
11657 * runtime-po/boldquot.sed: Likewise.
11658 * runtime-po/en@quot.header: Likewise.
11659 * runtime-po/en@boldquot.header: Likewise.
11660 * runtime-po/insert-header.sin: Likewise.
11661 * runtime-po/remove-potcdate.sin: Likewise.
11662 * runtime-po/Makevars: Likewise.
11663 * runtime-po/LINGUAS: Likewise.
11664 * runtime-po/de.po: Likewise; we will rely on the translation project
11665 to maintain this, so "bootstrap" should get it.
0410a6e0 11666 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
11667 its value.
11668 * src/main.c (main): Bind the bison-runtime domain, too.
11669
116702005-07-12 Bruno Haible <bruno@clisp.org>
11671
11672 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11673 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11674 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11675 * runtime-po: New directory.
11676 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11677 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11678 * runtime-po/Rules-quot: New file, copied from po/.
11679 * runtime-po/quot.sed: Likewise.
11680 * runtime-po/boldquot.sed: Likewise.
11681 * runtime-po/en@quot.header: Likewise.
11682 * runtime-po/en@boldquot.header: Likewise.
11683 * runtime-po/insert-header.sin: Likewise.
11684 * runtime-po/remove-potcdate.sin: Likewise.
11685 * runtime-po/Makevars: New file.
11686 * runtime-po/POTFILES.in: New file.
11687 * runtime-po/LINGUAS: New file.
11688 * runtime-po/bison-runtime.pot: New file.
11689 * runtime-po/de.po: New file.
11690 * m4/bison.m4: New file.
11691 * Makefile.am (SUBDIRS): Add runtime-po.
11692 (aclocaldir, aclocal_DATA): New variables.
11693 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11694 Define aclocaldir.
11695 * src/getargs.c (usage): Document --print-localedir option.
11696 (PRINT_LOCALEDIR_OPTION): New enum item.
11697 (long_options): Add --print-localedir option.
11698 (getargs): Handle --print-localedir option.
11699 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11700 (Internationalization): New section.
11701
22dda0f0
AD
117022005-07-12 Akim Demaille <akim@epita.fr>
11703
11704 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11705 for consistency with the rest of the code.
11706 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11707 Add separators.
11708
82b248ad
AD
117092005-07-12 Akim Demaille <akim@epita.fr>
11710
11711 * src/parse-gram.y: Use %printer instead of YYPRINT.
11712
fa0e9314
AD
117132005-07-12 Akim Demaille <akim@epita.fr>
11714
867a3e00
AD
11715 * src/symtab.h, src/symtab.c (symbol_print): New.
11716 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11717 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11718
117192005-07-12 Akim Demaille <akim@epita.fr>
11720
11721 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
11722 b4_at_dollar and b4_dollar_dollar.
11723
e054b190
PE
117242005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11725
11726 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11727 and Pennello's paper.
11728
34160ec4
PE
117292005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11730
407d4a75
PE
11731 * data/yacc.c (yyparse): Undo previous patch. Instead,
11732 set yylsp[0] and yyvsp[0] only if the initial action
11733 sets yylloc and yylval, respectively.
11734
34160ec4
PE
11735 * data/yacc.c (yyparse): In the initial action, set
11736 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11737 This avoids the use of undefined variables if the initial
11738 action does not set yylloc and/or yylval.
11739
c3d5a4a7
PE
117402005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11741
b34d96c1
PE
11742 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11743 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11744 Remove from CVS. These files are automatically generated.
11745 * examples/extexi: Clarify that this file is now part of Bison,
11746 not GNU M4, and that it works with any POSIX-compatible Awk.
11747 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11748 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11749 so that we also get calc++-parser.yy. Geneate it.
11750 Use $(AWK), not gawk, since any conforming Awk will do.
11751 Put comment before action, since older 'make' can't handle comment
11752 in action.
11753 $(BUILT_SOURCES): List all built sources, not just some of them.
11754 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11755 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11756 $($(calc_sources_generated)): Remove unnecessary test for existence
11757 of target. (This had a shell syntax error anyway; a stray "x".)
11758 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11759 calc++-parser.yy.
11760 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11761
c3d5a4a7
PE
11762 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11763 implied by the other modules.
11764
828c373b
AD
117652005-07-06 Akim Demaille <akim@epita.fr>
11766
11767 Bind examples/calc++ to the package.
11768 * examples/calc++/Makefile: Remove, replaced by...
11769 * examples/calc++/Makefile.am: ... this new file.
11770 * examples/calc++/test: Remove input.
11771 * examples/calc++/compile: Remove.
11772 * examples/Makefile.am: New.
11773 * configure.ac, Makefile.am: Adjust.
11774 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11775
63cb01d6
PE
117762005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11777
fd2df2ed
PE
11778 * data/glr.c (yyFail): Drastically simplify; since the format argument
11779 never had any % directives, we can simply pass it to yyerror.
11780 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11781 be modified later, as that is the usual style in glr.c.
11782 Problems reported by Paul Hilfinger.
11783
63cb01d6
PE
11784 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11785 and size overflow errors.
11786 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11787 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11788 (YYSIZEMAX): New macro.
11789 (yystpcpy): New function, taken from yacc.c.
11790 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11791 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11792 so that we don't have to maintain their signatures.
11793 (yyFail): Check for buffer overflow, by using vsnprintf rather
11794 than vsprintf. Allocate a bigger buffer if possible.
11795 Report an error if buffer allocation fails.
11796 (yyStackOverflow): New function.
11797 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11798 the initialization was successful. It might fail if storage was
11799 exhausted.
11800 (yyexpandGLRStack): Add more checks for storage allocation failure.
11801 Use yyStackOverflow to report failures.
11802 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11803 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11804 Don't assume stack number fits in int.
11805 (yysplitStack): Check for storage allocation failure.
11806 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11807 can print diagnostics on storage allocation failure. All callers
11808 changed.
11809 (yyresolveValue): Use yybool for boolean.
11810 (yyreportSyntaxError): Check for size-calculation overflow.
11811 This code is taken from yacc.c.
11812 (yyparse): Check for storage allocation errors when allocating
11813 the initial stack.
11814
1c59e0a1
AD
118152005-07-05 Akim Demaille <akim@epita.fr>
11816
11817 Extract calc++ from the documentation.
11818 * doc/bison.texinfo (Calc++): Add the extraction marks.
11819 * examples/extexi: New, from the aborted GNU Programming 2E.
11820 Separate the different paragraph of a file with empty lines.
11821 * examples/Makefile: Use it to extract the whole calc++ example.
11822
8a0adb01
AD
118232005-06-24 Akim Demaille <akim@epita.fr>
11824
11825 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11826 class typedefs.
11827
12545799
AD
118282005-06-22 Akim Demaille <akim@epita.fr>
11829
11830 * doc/bison.texinfo (C++ Language Interface): First stab.
11831 (C++ Parsers): Remove.
11832
99be0235
AD
118332005-06-22 Akim Demaille <akim@epita.fr>
11834
11835 * data/lalr1.cc (yylex_): Honor %lex-param.
11836
0ffd4fd1
AD
118372005-06-22 Akim Demaille <akim@epita.fr>
11838
11839 Start a set of simple examples.
11840 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11841 * examples/calc++/calc++-driver.hh,
11842 * examples/calc++/calc++-parser.yy,
11843 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11844 * examples/calc++/compile, examples/calc++/test: New.
11845
0925ebb4
PE
118462005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11847
11848 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11849 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11850 which stems from the 2005-05-27 patch.
11851
43d3b664
PH
118522005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11853
11854 * data/glr.c: Modify treatment of unused parameters to permit use
11855 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11856
3062864d
PE
118572005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11858
11859 Fix infringement on user name space reported by Janos Zoltan Szabo.
11860 * data/yacc.c (yyparse): strlen -> yystrlen.
11861
989b5b8e
AD
118622005-05-30 Akim Demaille <akim@epita.fr>
11863
11864 * data/lalr1.cc (_): New.
11865 Translate the various messages.
11866
bedf57f5
PE
118672005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11868
11869 Fix infringement on user name space reported by Bruno Haible.
11870 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11871 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11872 the user's name space.
11873 (alloca): Include <stdlib.h> to get it, if it's not built in.
11874 (YYMALLOC, YYFREE): Define only if needed.
11875 (malloc, free): Declare, but only if needed, as this infringes on
11876 the user name space.
11877
4d1801f1
PE
118782005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11879
11880 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11881 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11882 with %d format.
11883 * lib/ebitset.c (min, max): Undef before defining.
11884 * lib/vbitset.c (min, max): Likewise.
11885 * lib/subpipe.c (create_subpipe): Save local variables in case
11886 vfork clobbers them.
11887
118882005-05-24 Bruno Haible <bruno@clisp.org>
11889
11890 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11891 error message syntax used by gcc-4.0.
11892
b94a9e1e
PE
118932005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11894
85ac3861
PE
11895 * README: Mention m4 1.4.3. Remove obsolete advice about
11896 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11897
b94a9e1e
PE
11898 * bootstrap: Remove workaround for problem I encountered with
11899 gettext 0.14.1; it seems to be fixed now.
11900
51c30d21
PE
119012005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11902
009ce67d
PE
11903 * NEWS: Version 2.0a.
11904
f2a97c62
PE
11905 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11906 the previous change.
11907
c8775f93
PE
11908 Various maintainer cleanups.
11909 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11910 conftest*, for benefit of CVS commands run at the same time as
11911 "configure". Add build-aux, since "bootstrap" now creates it and
11912 its subfiles.
11913 * Makefile.cfg (move_if_change): Remove.
11914 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11915 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11916 (po_repo, do-po-update, po-update, wget_files, get-targets):
11917 (config.guess-url_prefix, config.sub-url_prefix):
11918 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11919 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11920 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11921 Remove.
11922 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11923 this is now the recommended name.
11924 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11925 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11926 ylwrap. These files now go into build-aux.
11927 * config/move-if-change: Remove.
11928 * config/prev-version.txt: Bump from 1.75 to 2.0.
11929
3ea5f0ec
PE
11930 * bootstrap: Add stdio-safer, unistd-safer modules.
11931 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11932 we don't need it).
11933 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11934 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11935 * lib/subpipe.c: Include "unistd-safer.h".
11936 (create_subpipe): Make sure all the newly-created
11937 file descriptors are > 2, so that diagnostics don't
11938 get sent down them (which might cause Bison to hang, in theory).
11939 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11940 * src/files.c (xfopen): Use fopen_safer, not fopen.
11941
51c30d21
PE
11942 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11943 yesterday's yacc.c fix.
11944
cea1469d
PE
119452005-05-21 Paul Eggert <eggert@cs.ucla.edu>
11946
3ea5f0ec
PE
11947 * data/glr.c, data/lalr1.cc: Update copyright date.
11948
cea1469d
PE
11949 Fix a destructor bug reported by Wolfgang Spraul in
11950 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
11951 * data/yacc.c (yyabortlab): Don't call destructor, and
11952 don't set yychar to EMPTY.
11953 (yyoverflowlab): Don't call destructor.
11954 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
11955 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
11956 since we no longer output the message "discarding lookahead token
11957 end of input ()".
11958
5e6f62f2
PH
119592005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11960
11961 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
11962 fix a small glitch in debugging output.
11963 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
11964 after YY_SYMBOL_PRINT where needed.
11965
11966 (struct yyGLRState): Add some comments.
11967 (struct yySemanticOption): Add some comments.
11968 (union yyGLRStackItem): Add comment.
11969
11970 (yymergeOptionSets): Correct this to properly perform the union,
11971 avoiding infinite reported by Michael Rosien.
11972 Update comment.
11973
11974 * tests/glr-regression.at: Add test for GLR merging error reported
11975 by M. Rosien.
cea1469d 11976
0fb669f9
PE
119772005-05-13 Paul Eggert <eggert@cs.ucla.edu>
11978
11979 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
11980 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
11981 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
11982 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
11983 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
11984 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
11985 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
11986 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
11987 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
11988 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
11989 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
11990 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
11991 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
11992 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
11993 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
11994 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11995 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11996 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11997 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11998 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11999 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12000 src/output.h, src/parse-gram.c, src/parse-gram.h,
12001 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12002 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12003 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12004 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12005 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12006 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12007 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12008 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12009 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12010 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12011 tests/reduce.at, tests/regression.at, tests/sets.at,
12012 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12013 Update FSF postal mail address.
12014
51f4735e
PE
120152005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12016
12017 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12018 Problem reported by Ralf Menzel.
12019
80ce3401
PE
120202005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12021
12022 * tests/actions.at: Test that stack overflow invokes destructors.
12023 From Marcus Holland-Moritz.
12024 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12025 from here....
12026 (yyreturn): to here. That way, destructors are called properly
12027 even if the stack overflows, or the user calls YYACCEPT or
12028 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12029 (yyoverflowlab): Destroy the lookahead.
12030
120312005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12032
12033 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12034
72f000b0
PE
120352005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12036
12037 * NEWS: Bison-generated C parsers no longer quote literal strings
12038 associated with tokens.
12039 * src/output.c (prepare_symbols): Don't escape strings,
12040 since users don't want to see C escapes.
12041 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12042 in diagnostics.
c19683bb 12043 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
12044 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12045
1094323f
PE
120462005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12047
12048 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12049 the data size is known to be too small and we can't increase it.
12050 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12051
ca407bdf
PE
120522005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12053
12054 * src/parse-gram.y: Include quotearg.h.
12055 (string_as_id): Quote $1 before using it as a key, since the
12056 lexer no longer quotes it for us.
12057 (string_content): Don't strip quotes, since lexer no longer
12058 quotes it for us.
12059 * src/scan-gram.l: Include quotearg.h.
12060 ("\""): Omit quote.
12061 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12062 a key, since the rest of the lexer doesn't quote it.
12063 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12064 * tests/regression.at (Token definitions): Check for backslashes
12065 in token strings.
12066
12067 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12068 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12069 (yyparse): Revamp code to generate long syntax error message, to
12070 make it easier to translate, and to avoid problems with arithmetic
12071 overflow. Change "virtual memory" to "memory" in diagnostic, since
12072 we don't know whether the memory is virtual.
12073
1ce59070
PE
120742005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12075
12076 * NEWS: Bison-generated C parsers now use the _ macro to
12077 translate strings.
12078 * data/yacc.c (_) [!defined _]: New macro.
12079 All English strings wrapped inside this macro.
12080 * doc/bison.texinfo (Bison Parser): Document _.
12081 * po/POTFILES.in: Include src/parse-gram.c, since it now
12082 includes translateable strings that parse-gram.y doesn't.
12083
a749a695
PE
120842005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12085
12086 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12087 reverting the 2004-10-11 change to this function.
12088 (symbol_check_alias_consistency): Don't call symbol_type_set
12089 if the type name is already correct.
12090 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12091
8fb1053b
PE
120922005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12093
12094 * tests/regression.at (Token definitions): Don't use a token named
12095 c, as that generates a "#define c ..." that runs afoul of buggy
12096 stdlib.h that uses the identifier c as a member of struct
12097 drand48_data. Problem reported by Horst Wente.
12098
ff498c4a
PE
120992005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12100
12101 * bootstrap: Change translation URL from
12102 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12103 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12104 redirection glitches. Problem reported by twlevo@xs4all.nl.
12105
65211d70
PE
121062005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12107
12108 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12109 after operands; POSIX says this isn't portable for the c99 command.
12110
9577fb1f
PE
121112005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12112
12113 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12114 immediately if a data overrun has occurred; this may help us track
12115 down what may be a spurious failure on MacOS.
12116
78b178f7
PE
121172005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12118
a2599d0f
PE
12119 Respond to problems reported by twlevo@xs4all.nl.
12120
12121 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12122
78b178f7
PE
12123 * src/vcg.h: Comment fix.
12124 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12125 (G_CMAX): Change to -1 instead of INT_MAX.
12126
12127 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 12128
7296e729
PE
121292005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12130
12131 * src/tables.c (state_number_to_vector_number): Put it inside an
12132 "#if 0", since it's not currently used. Problem reported by
12133 Roland McGrath.
12134
05ac60f3
PE
121352005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12136
12137 * src/output.c (escaped_output): Renamed from
12138 escaped_file_name_output, since we now use it for symbol tags as
12139 well. All uses changed.
12140 (symbol_destructors_output, symbol_printers_output):
12141 Escape symbol tags too.
12142 Problem reported by Matyas Forstner in
12143 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12144
12145 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12146 not needed.
12147 * src/output.c (user_actions_output, token_definitions_output,
12148 symbol_destructors_output, symbol_printers_output): Likewise.
12149 * src/reader.c (prologue_augment): Likewise.
12150 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12151
12152 * src/vcg.c (output_edge): Don't quote linestyle arg.
12153 Problem reported by twlevo@xs4all.nl.
12154
7eb453ac
PE
121552005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12156
12157 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12158 example, reported by Derek M Jones. Also, make the example even
12159 more outrageous, to better illustrate how bad the problem is.
12160
4c04c52a
PE
121612005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12162
12163 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12164 putsym. Typo reported by Sebastian Piping.
12165
a61e1620
PE
121662005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12167
12168 * doc/bison.texinfo (Language and Grammar): some -> same
12169 (Epilogue): int he -> in the
12170 Typos reported by Sebastian Piping via Justin Pence.
12171
9ec93868
PE
121722005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12173
12174 * tests/glr-regression.at (Improper handling of embedded actions
12175 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12176 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12177 with dollar signs in test names.
12178 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12179 for a similar reason.
12180
73ce7e7e
PE
121812005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12182
12183 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12184 wants to redefine G_VIEW.
12185
2e72b98e
PE
121862005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12187
12188 * src/vcg.c (get_view_str): Remove case for normal_view.
12189 Problem reported by twlevo@xs4all.nl.
12190
e0d634e5
PE
121912005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12192
ccf830a4
PE
12193 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12194 Problem reported by twlevo@xs4all.nl.
12195
e0d634e5
PE
12196 * doc/bison.texinfo: Change @dircategory from "GNU programming
12197 tools" to "Software development". Requested by Richard Stallman
12198 via Karl Berry.
12199
7bbc8cb0
PE
122002005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12201
12202 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12203 Problem reported by twlevo@xs4all.nl.
12204
08b770bc
PE
122052005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12206
12207 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12208 keyword; it's not needed with modern compilers, and it doesn't
12209 affect correctness with older compilers. Suggested by
12210 twlevo@xs4all.nl.
12211
95f22ad2
PE
122122005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12213
12214 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12215 gcc -Wswitch-default.
12216 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12217 * data/yacc.c (yyparse): Likewise.
12218
d229d15c
PE
122192005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12220
12221 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12222 already. Let config.h define any nonstandard values.
12223
ecadd90f
PE
122242005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12225
12226 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12227 for the benefit of slower hosts. Problem reported by
12228 Nelson H. F. Beebe.
12229
213744b5
PE
122302005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12231
12232 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12233 being defined and not used.
12234 * data/lalr1.cc (yyparse): Likewise.
12235 Use "if (false)" rather than "if (0)".
12236
249d3236
PE
122372005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12238
12239 * TODO: Mention that we should allow NUL bytes in tokens.
12240
987cc1fb
PE
122412005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12242
12243 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12244 Problem reported by Hans Aberg.
12245
08fe02d9
PE
122462005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12247
12248 * src/getargs.c (version): Happy new year; update overall
12249 program copyright date from 2004 to 2005.
12250
12251 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12252 Problem reported by Hans Aberg.
12253 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12254 (Output file names.): Add a test for the case when standard output
12255 is closed.
12256
010c0266
PE
122572004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12258
12259 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12260 to fix an oversight in the Bison 2.0 manual.
12261
da12206a
PE
122622004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12263
12264 * NEWS: Version 2.0. Reformat the existing news items since
12265 1.875, so that related items are grouped together.
3a4734aa 12266 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
12267 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12268
c935d934
PE
12269 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12270 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12271 otherwise, we're not testing alloca. Unfortunately there's no
12272 simple way to consult HAVE_ALLOCA here.
12273
da12206a
PE
12274 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12275 for yymsg, too.
12276
12277 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12278 hand. This avoids a warning about comparing int to size_t when
12279 GCC warnings are enabled.
12280
0a2c5137
PE
122812004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12282
d7e14fc0
PE
12283 * NEWS: Bison-generated parsers no longer default to using the
12284 alloca function (when available) to extend the parser stack, due
12285 to widespread problems in unchecked stack-overflow detection.
12286 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12287 responsibility to set it to a positive value. This lets the user
12288 specify a value that is not a preprocessor constant.
12289 * data/yacc.c (YYMAXDEPTH): Likewise.
12290 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12291 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12292 to be a compile-time constant. However, explain the constraints on it.
12293 Also, explain the constraints on YYINITDEPTH.
12294 (Table of Symbols): Explain that alloca is no longer the default.
12295 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12296 to 1.
12297
0a2c5137
PE
12298 * doc/bison.texinfo (Location Default Action): Mention that n must
12299 be zero when k is zero. Suggested by Frank Heckenbach.
12300
e019c247
AD
123012004-12-22 Akim Demaille <akim@epita.fr>
12302
12303 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12304 (parser::state_type, parser::semantic_type, parser::location_type):
12305 Private, not public.
12306 (parser::parse): Return ints, not bool.
12307 Returning a bool introduces a problem: 0 corresponds to false, and
12308 it seems weird to return false on success. Returning true changes
12309 the conventions for yyparse.
12310 Alternatively we could return void and send an exception.
12311 There is no clear consensus (yet?).
12312 (state_stack, semantic_stack, location_stack): Rename as...
12313 (state_stack_type, semantic_stack_type, location_stack_type): these.
12314 Private, not public.
12315 * tests/c++.at: New.
12316 * tests/testsuite.at, tests/Makefile.am: Adjust.
12317
72731bb7
AD
123182004-12-21 Akim Demaille <akim@epita.fr>
12319
12320 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12321
9a0d8bec
AD
123222004-12-21 Akim Demaille <akim@epita.fr>
12323
12324 Don't impose std::string for filenames.
12325
12326 * data/lalr1.cc (b4_filename_type): New.
12327 (position::filename): Use it.
12328 (parser.hh): Move the inclusion of stack.hh and location.hh below
12329 the user code, so that needed headers for the filename type can be
12330 included first.
72731bb7
AD
12331 Forward declare them before the user code.
12332 * tests/Makefile.am (check-local, installcheck-local): Pass
12333 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 12334
99880de5
AD
123352004-12-20 Akim Demaille <akim@epita.fr>
12336
12337 Use more STL like names: my_class instead of MyClass.
12338
12339 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12340 (SemanticStack, SemanticType, StateStack, StateType)
12341 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12342 (Parser::value): Rename as...
12343 (location_stack, location_type, rhs_number_type, semantic_stack)
12344 (semantic_type, state_stack, state_type, token_number_type, stack)
12345 (slice, traits, parser::yylloc, parser::yylval): these.
12346
12347 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12348
9bec482e
PE
123492004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12350
12351 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12352 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12353
f6fbd3da
PE
123542004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12355
12356 Remove uses of 'short int' and 'unsigned short int'. This raises
12357 some arbitrary limits. It uses more memory but nowadays that's
12358 not much of an issue.
12359
12360 This change does not affect the generated parsers; that's a different
12361 task, as some users will want to conserve memory there.
12362
12363 Ideally we should use size_t to represent all object counts, and
12364 something like ptrdiff_t to represent signed differences of object
12365 counts; but that will require more code-cleanup than I have the
12366 time to do right now.
12367
12368 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12369 Use size_t, not int or short int, to count objects.
12370 * src/closure.c (nritemset, closure): Likewise.
12371 * src/closure.h (nritemset, closure): Likewise.
12372 * src/nullable.c (nullable_compute): Likewise.
12373 * src/print.c (print_core): Likewise.
12374 * src/print_graph.c (print_core): Likewise.
12375 * src/state.c (state_compare, state_hash): Likewise.
12376 * src/state.h (struct state): Likewise.
12377 * src/tables.c (default_goto, goto_actions): Likewise.
12378
12379 * src/gram.h (rule_number, rule): Use int, not short int.
12380 * src/output.c (prepare_rules): Likewise.
12381 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12382 errs, reductions): Likewise.
12383 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12384 Likewise.
12385 * src/tables.c (vector_number, tally, action_number,
12386 ACTION_NUMBER_MINIMUM): Likewise.
12387 * src/output.c (muscle_insert_short_int_table): Remove.
12388
efeed023
AD
123892004-12-17 Akim Demaille <akim@epita.fr>
12390
12391 * data/lalr1.cc: Extensive Doxygenation.
12392 (error_): Rename as...
12393 (error): this, since it is visible to the user.
12394 Adjust callers.
12395 (Parser::message): Now an automatic variable from...
12396 (Parser::yyreport_syntax_error_): here.
12397 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12398 Parser::error.
12399 * tests/input.at: Escape $.
12400
bc82c5a5
PE
124012004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12402
12403 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12404 Parenthesize rhs to avoid obscure problems with mistakes like
12405 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12406 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12407 b4_rhs_location): Likewise.
12408 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12409 b4_rhs_location): Likewise.
12410
fd19f271
AD
124112004-12-16 Akim Demaille <akim@epita.fr>
12412
12413 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12414 yacc.c: be sure to stay within yycheck_.
12415 * tests/actions.at: Re-enable C++ tests.
12416
10454ea4
AD
124172004-12-16 Akim Demaille <akim@epita.fr>
12418
12419 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12420 real.
12421
c5b95ccf
AD
124222004-12-16 Akim Demaille <akim@epita.fr>
12423
12424 Use #define to handle the %name-prefix.
12425
12426 * data/glr.c, data/yacc.c: Comment changes.
12427 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12428 so that one can refer to yylex in the parser file, and have it
12429 renamed, as is the case with other skeletons.
12430
617a8f12
AD
124312004-12-16 Akim Demaille <akim@epita.fr>
12432
12433 Move lalr1.cc internals into yy*.
12434
12435 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12436 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12437 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12438 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12439 (empty_, final_, terror_, errcode_, ntokens_)
12440 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12441 (looka_, ilooka_, error_range_, nerrs_):
12442 Rename as...
12443 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12444 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12445 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12446 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12447 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12448 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12449 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12450 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12451 these.
12452
1e547e6e
PE
124532004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12454
12455 Fix some problems reported by twlevo at xs4all.
12456 * src/symtab.c (symbol_new): Report an error if the input grammar
12457 contains too many symbols. This is better than calling abort() later.
12458 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12459 (struct node, struct graph):
12460 Rename member expand to stretch. All uses changed.
12461 (struct graph): Remove member layoutalgorithm. All uses removed.
12462 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12463 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12464 All uses changed.
12465 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12466
735d6bd4
AD
124672004-12-15 Akim Demaille <akim@epita.fr>
12468
12469 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12470 Add more Doxygen comments.
12471 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12472 (report_syntax_error_, translate_): Rename as...
12473 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12474 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12475
2e1f5829
AD
124762004-12-15 Akim Demaille <akim@epita.fr>
12477
12478 * data/lalr1.cc (lex_): Rename as...
12479 (yylex_): this.
12480 Move the trace here.
12481 Take the %name-prefix into account.
12482 Reported by Alexandre Duret-Lutz.
12483
a3cb6248
AD
124842004-12-15 Akim Demaille <akim@epita.fr>
12485
12486 Simplify the C++ parser constructor.
12487
12488 * data/lalr1.cc (debug_): Rename as...
12489 (yydebug_): so that the parser's internals are always in the yy*
12490 pseudo namespace.
12491 Adjust uses.
12492 (b4_parse_param_decl): Remove the leading comma as it is now only
12493 called as unique argument list.
12494 (Parser::Parser): Remove the constructor accepting a location and
12495 an initial debugging level.
12496 Remove from the other ctor the argument for the debugging level.
12497 (debug_level_type, debug_level, set_debug_level): New.
12498
12499 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12500 constructor calls.
12501
07fed891
AD
125022004-12-15 Akim Demaille <akim@epita.fr>
12503
12504 Remove b4_root related material: failure experiment
a3cb6248 12505 (which goal was to allow to derive from a class).
07fed891
AD
12506
12507 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12508 definitions and uses.
12509
e603eaa5
PE
125102004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12511
12512 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12513 not 2, since it's not portable to subtract 1 from the start of an
12514 array. The new item 0 is never set or used. All uses changed.
12515
12516 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12517 the default definition of YYLLOC_DEFAULT. Problem reported
12518 by Frank Heckenbach.
12519
fafb007d
PE
125202004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12521
12522 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12523 the normal case and one for the error case. Just use the
12524 first one uniformly. Problem reported by Frank Heckenbach.
12525 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12526 use exactly the same macro in both places.
12527 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12528 so that the normal-case YYRHSLOC works for the error case too.
12529 All uses changed.
12530 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12531 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12532 * doc/bison.texinfo (Location Default Action): Don't claim that
12533 we have an array of locations. Use the same macro for both glr
12534 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12535 the index is 0.
12536
48814dcd
PE
125372004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12538
a4e1a53b
PE
12539 * HACKING: Update email addresses to send announcements to.
12540
48814dcd
PE
12541 * configure.ac (AC_INIT): Bump version to 1.875f.
12542
337116ba
PE
125432004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12544
12545 * NEWS: Version 1.875e.
12546 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12547
12548 * src/scan-skel.l: Include "complain.h", for "fatal".
12549
12550 * src/relation.h (relation_print, relation_digraph):
12551 Relation sizes are of type relation_node, not size_t (this is
12552 merely a doc fix, since the two types are equivalent).
12553 (relation_transpose): Relation sizes are of type relation_node,
12554 not int.
12555 * src/relation.c: Likewise.
12556 (top, infinity): Now of type relation_node, not int.
12557 (traverse, relation_transpose): Use relation_node, not int.
12558
12559 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12560 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12561 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12562
12563 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 12564 specifying whether the test should be skipped. Use it tp
337116ba 12565 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 12566 fail on some hosts, and should be skipped.
337116ba 12567
da2a7671
PE
125682004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12569
12570 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12571 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12572 unless otherwise specified below.
12573
12574 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12575 to allocate kernel_base, kernel_items, kernel_size, since
12576 they needn't be initialized to 0.
12577 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12578 * src/closure.c (new_closure): Likewise, for itemset.
12579 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12580 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12581 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12582 (build_relations): Likewise for edge, states1, includes.
12583 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12584 * src/reader.c (packgram): Likewise, for ritem, rules.
12585 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12586 * src/relation.c (relation_digraph): Likewise for VERTICES.
12587 (relation_transpose): Likewise for new_R, end_R.
12588 * src/symtab.c (symbols_token_translations_init): Likewise for
12589 token_translations.
12590 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12591 (token_actions): Likewise for yydefact, actrow, conflrow,
12592 conflict_list.
12593 (save_column): Likewise for froms[symno], tos[symno].
12594 (goto_actions): Likewise for state_count.
12595 (pack_table): Likewise for base, pos, check.
12596 (tables_generate): Likewise for width.
12597
12598 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12599 for initial core. Just have a separate core, so we needn't worry
12600 about whether kernel_size and kernel_base are initialized.
12601
12602 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12603 kernel_size, kernel_items): Remove unnecessary initialization.
12604 * src/conflicts.c (conflicts): Likewise.
12605 * src/derives.c (derives): Likewise.
12606 * src/muscle_tablc (muscle_insert): Likewise.
12607 * src/relation.c (relation_digraph): Likewise.
12608 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12609 conflrow, conflict_table, conflict_list, table, check):
12610 Likewise.
12611
12612 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12613 This is because all callers pass unsigned int.
12614 * src/closure.h (new_closure): Likewise.
12615
12616 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12617 (build_relations): Initialize includes[i] in all cases.
12618 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12619 and rules[ruleno].precsym. Initialize members in order.
12620 * src/relation.c (relation_transpose): Always initialize new_R[i]
12621 and end_R[i].
12622 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12623
12624 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12625 conflict_list[0] was always 0, but now it isn't initialized.
12626
12627 * src/table.c (table_grow): When conflict_table grew, the grown
12628 area wasn't cleared. Fix this.
12629
12630 * lib/.cvsignore: Add strdup.c, strdup.h.
12631 * m4/.cvsignore: Add strdup.m4.
12632
00baeeac
PE
126332004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12634
12635 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12636 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12637 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12638 ngotos + 1 without checking for overflow.
12639 (build_relations): Use END_NODE, not -1, to denote end of edges.
12640 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12641 build_relations): Use goto_number, not int, for goto numbers.
12642 * src/tables.c (save_column, default_goto): Likewise.
12643
be3d9d42
AD
126442004-11-23 Akim Demaille <akim@epita.fr>
12645
12646 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12647 of #defining from yystype.
12648 Don't typedef yystype, C++ does not need it.
12649 This lets it possible to forward declare it as union.
12650
78e526d5
PE
126512004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12652
12653 * bootstrap (gnulib_modules): Add extensions.
12654 Problem reported by Jim Meyering.
12655
afbb696d
PE
126562004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12657
12658 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12659 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12660 src/system.h, src/tables.c: XFREE -> free, to accommodate
12661 recent change to gnulib xalloc.h.
78e526d5 12662 Problem reported by Jim Meyering.
afbb696d 12663
c1f8f16a
AD
126642004-11-17 Akim Demaille <akim@epita.fr>
12665
12666 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12667
db7e5eb5 126682004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
12669 Alexandre Duret-Lutz <adl@gnu.org>
12670
12671 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12672 changes.
12673 (YYCDEBUG): Adjust.
12674 Use it instead of cdebug_.
12675 (Parser::debug_stream, Parser::set_debug_stream): New.
12676 (Parser::symprint_): Define cdebug_ for temporary backward
12677 compatibility.
12678 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12679 debug_stream ().
12680
68e11668
AD
126812004-11-17 Akim Demaille <akim@epita.fr>
12682
12683 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12684 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12685 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12686 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12687
97cbc73e
PE
126882004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12689
12690 * data/glr.c (yyloc_default): Remove; not used.
12691 Problem reported by Frank Heckenbach.
12692
e342c3be
AD
126932004-10-25 Akim Demaille <akim@epita.fr>
12694
12695 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12696 Introduce another definition to address simple location arrays.
12697 (yyGLRStack): New member: yyerror_range.
12698 (yyrecoverSyntaxError, yyparse): Update it.
12699 (yyrecoverSyntaxError): Use it when shifting the error token to
12700 have an accurate range, equivalent to the one computed by both
12701 yacc.c and lalr1.cc.
12702 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12703 that column numbers start at column 0, as per GNU Coding
12704 Standards, the others tests, and the doc.
12705 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12706 Adjust to the above change (first column is 0).
12707 And adjust the location of the "<error>", now covering the whole
12708 line.
12709
93602feb 127102004-10-22 Akim Demaille <akim@epita.fr>
04098407 12711 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
12712
12713 Remove some arbitrary limits on goto numbers and relations.
12714 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12715 initial values, since they're never used.
12716 (set_goto_map): ngotos is now unsigned, so test for overflow
12717 by seeing whether it wraps around to zero.
12718 * src/lalr.h (goto_number): Now size_t, not short int.
12719 (GOTO_NUMBER_MAXIMUM): Remove.
12720 * src/relation.c (relation_print, traverse, relation_transpose):
12721 Check for END_NODE rather than looking at sign.
12722 * src/relation.h (END_NODE): New macro.
12723 (relation_node): Now size_t, not short int.
12724
dba08b04
PE
127252004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12726
12727 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12728 keyword, not an identifier. Problem reported by Baron Schwartz in
12729 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12730
df09ef2e
AD
127312004-10-11 Akim Demaille <akim@epita.fr>
12732
12733 * src/symtab.c (symbol_check_alias_consistency): Also check
12734 type names, destructors, and printers.
12735 Reported by Alexandre Duret-Lutz.
12736 Recode the handling of associativity and precedence in terms
12737 of symbol_precedence_set.
12738 Accept no redeclaration at all, not even equal to the previous
12739 value.
12740 (redeclaration): New.
12741 Use it to factor redeclaration complaints.
12742 (symbol_make_alias): Don't set the type of the alias, let
12743 symbol_check_alias_consistency do it as for other features.
12744 * src/symtab.h (symbol): Add new member prec_location, and
12745 type_location.
12746 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12747 * tests/input.at (Incompatible Aliases): New.
12748
146bc99d
PE
127492004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12750
12751 .cvsignore fixes to accommodate gnulib changes,
12752 and the practice of naming build directories "_build".
12753 * .cvsignore: Add "_*". Sort.
12754 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12755 * m4/.cvsignore: Add "*_gl.m4".
12756
e503aa60
AD
127572004-10-06 Akim Demaille <akim@epita.fr>
12758
12759 * src/parse-gram.y (add_param): Fix the truncation of trailing
12760 spaces.
12761
b4a20338
AD
127622004-10-05 Akim Demaille <akim@epita.fr>
12763
12764 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12765 whether the reducion was empty or not. This leaves room to
12766 improve the use of YYLLOC_DEFAULT in such a case.
12767 lalr1.cc is still experimental, so changing this is acceptable.
12768 And finally, there are probably not many users who changed the
12769 handling of locations in GLR, so changing is admissible too.
12770
12771 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12772 empty reduction, set @$ to an empty location ending the previously
12773 stacked symbol.
12774 Adjust uses to make sure the code is triggered on empty
12775 reductions.
12776 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12777 expected output: empty reductions have empty locations.
12778
f85a5e6f
AD
127792004-09-29 Akim Demaille <akim@epita.fr>
12780
12781 * data/lalr1.cc: Move towards a more standard C++ coding style
12782 for templates: Class < T > -> Class<T>.
12783
b203fc2c
AD
127842004-09-29 Akim Demaille <akim@epita.fr>
12785
12786 * data/lalr1.cc: Reinstall the former ctor, for sake of
12787 compatibility, but warn it will be removed.
12788 Move towards a more standard C++ coding style (i.e., type *var ->
12789 type* var).
12790
5b7e1e73
PE
127912004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12792
3fee967f
PE
12793 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12794 since it's less likely to work if NULs are involved in the future.
5b7e1e73 12795
0dcca5c2
AD
127962004-09-27 Akim Demaille <akim@epita.fr>
12797
12798 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12799
6dde1c82
AD
128002004-09-27 Akim Demaille <akim@epita.fr>
12801
12802 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 12803 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
12804 and argument names.
12805 (b4_cc_constructor_call): Likewise.
12806
b233d555
AD
128072004-09-24 Akim Demaille <akim@epita.fr>
12808
12809 * src/parse-gram.y (add_param): Strip the leading and trailing
12810 blanks from a formal argument declaration.
12811 (YY_LOCATION_PRINT): New.
12812
619404e3
AD
128132004-09-24 Akim Demaille <akim@epita.fr>
12814
12815 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12816 after the location.
12817
dd8d9022
AD
128182004-09-24 Akim Demaille <akim@epita.fr>
12819
12820 * doc/bison.texinfo (Table of Symbols): Sort.
12821
0092f063
AD
128222004-09-21 Akim Demaille <akim@epita.fr>
12823
12824 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12825 the useless parentheses.
12826 Suggested by Paul Eggert.
12827
451364ed
AD
128282004-09-20 Akim Demaille <akim@epita.fr>
12829
12830 Let the initial-action act on the look-ahead, and use it for the
12831 "initial push" (corresponding to an hypothetical beginning-of-file).
12832 And let lalr1.cc honor %initial-action.
12833
12834 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12835 example.
12836 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12837 (Parser::Parser): Remove the ctor that used to initialize it.
12838 (Parser::parse): Like in the other skeletons, issue the "starting
12839 parse" message before any action.
12840 Honor %initial-action.
12841 Initialize the stacks with the lookahead.
12842 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12843 look-ahead.
12844 Push them in the stacks.
12845 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12846
18d192f0
AD
128472004-09-20 Akim Demaille <akim@epita.fr>
12848
12849 * doc/bison.texinfo (Initial Action Decl): New.
12850
b8458aa5
AD
128512004-09-20 Akim Demaille <akim@epita.fr>
12852
12853 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12854 clearer criterion to define it.
12855 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12856 When reducing on an empty RHS, use the latest stacked location as
12857 location.
12858 yylloc is not always available.
12859 * data/glr.c: Likewise.
12860 Also, honor initial-actions.
12861
3fc16193
AD
128622004-09-20 Akim Demaille <akim@epita.fr>
12863
12864 * data/yacc.c (YY_LOCATION_PRINT): New.
12865 Define when we know YYLTYPE's structure, i.e., when the default
12866 YYLLOC_DEFAULT is used.
12867 * data/c.m4 (b4_yysymprint_generate): Use it.
12868 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12869 value of the result.
12870 (error_start_): Replace with...
12871 (error_range_): this location array.
12872 This allows to replace code relying on the implementation of
12873 locations by portable code.
12874 * data/yacc.c (yylerrsp): Replace with...
12875 (yyerror_range): this.
12876 Every time a token is popped, update yyerror_range[0], to have an
12877 accurate location for the error token.
12878 * data/glr.c (YY_LOCATION_PRINT): New.
12879 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12880 deference a pointer.
12881 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12882 report the location in %printers.
12883
12884 * src/scan-skel.l: Instead of abort, report error messages to ease
12885 understanding skeleton scanning failures.
12886
ecfe33e7
AD
128872004-09-16 Akim Demaille <akim@epita.fr>
12888
12889 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12890 (iterator, const_iterator): these, to be more in the C++ spirit.
12891 Also, return reverse iterators so that when displaying the stack
12892 we display its bottom first.
12893 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12894 from yacc.c.
12895 We should probably use vector here though.
12896
1576d44d
AD
128972004-09-16 Akim Demaille <akim@epita.fr>
12898
12899 Have more complete shift traces.
12900
12901 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12902 to report Shifts instead of ad hoc YYDPRINTF invocations,
12903 including for the error token.
12904 * data/lalr1.cc (symprint_): Output the location.
12905 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12906 output the location within the %printer.
12907 Activate GLR tests, at least to make sure they compile properly.
12908 They still don't pass though.
12909 * tests/calc.at: Adjust expect verbose output, since now "Entering
12910 state..." is on a different line than the "Shifting" message.
12911
9c66f418
AD
129122004-09-08 Akim Demaille <akim@epita.fr>
12913
12914 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12915 Bison directive from the Bison file to the invocation of this
12916 macro, so that these directives are passed to
12917 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12918 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12919 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12920 the extra Bison directives instead of the whole series.
12921 Change the grammar so that there are recoverable errors, and
12922 unrecoverable errors. Now we can have the parser give up before
12923 consuming the whole input. As a result we now can observe that
12924 the lookahead is freed when needed.
12925 Change the parser source to parse argv[1] instead of a hard coded
12926 string.
12927 Simplify yylex, and give a value and location to EOF.
12928 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12929 passed directives already coded in the file.
12930 Add some tests to check the location of "error".
12931 For some tests, the C++ parser is correct, and not yacc.c.
12932 For other tests, they provide different, but unsatisfying, values,
12933 so keep the C++ value so that at least one parser is "correct"
12934 according to the test suite.
12935 (Actions after errors): Remove, this is subsumed by the
12936 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12937
52d5733f
AD
129382004-09-06 Akim Demaille <akim@epita.fr>
12939
12940 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 12941 (Parser::pop): New.
52d5733f
AD
12942 Use it.
12943
a0e68930
AD
129442004-09-06 Akim Demaille <akim@epita.fr>
12945
12946 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
12947 argument, an informative message.
12948 Call YY_SYMBOL_PRINT.
12949 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
12950 * data/lalr1.cc (destruct_): Likewise.
12951 In addition, no longer depend on b4_yysymprint_generate and
12952 b4_yydestruct_generate to generate these functions, do it "by
12953 hand".
12954
e757bb10
AD
129552004-09-03 Akim Demaille <akim@epita.fr>
12956
12957 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
12958 invoked, yydestruct the lookahead.
12959 * tests/calc.at (Calculator $1): Update the expected lengths of
12960 traces: there is an added line for the discarded lookahead.
12961 * doc/bison.texinfo (Destructor Decl): Some rewording.
12962 Define "discarded" symbols.
12963
0fe1f06d
AD
129642004-09-02 Akim Demaille <akim@epita.fr>
12965
12966 * data/lalr1.cc (translate_, destruct_): No reason to be static.
12967
284acc8b
AD
129682004-09-02 Akim Demaille <akim@epita.fr>
12969
12970 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
12971 (YYDSYMPRINTF): Rename as...
12972 (YY_SYMBOL_PRINT): this.
12973 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
12974 two.
12975 Use it instead of direct symprint_ calls.
12976 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
12977 one.
12978
a5eb1ed2
AD
129792004-09-02 Akim Demaille <akim@epita.fr>
12980
b7c72fe1
AD
12981 * data/lalr1.cc (b4_yysymprint_generate): New.
12982 (symprint_): New member function, defined when YYDEBUG.
12983 Use it consistently instead of token/nterm debugging output by
12984 hand.
a5eb1ed2
AD
12985 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
12986 %printer calls to use cdebug_ when using lalr1.cc.
12987
417141dd
AD
129882004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
12989
12990 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
12991 with #ifdef YYDEBUG.
12992
2fa09258
AD
129932004-08-26 Akim Demaille <akim@epita.fr>
12994
12995 * doc/bison.texinfo (Implementing Loops): Rename as...
12996 (Implementing Gotos/Loops): this.
12997
9378b508
PE
129982004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12999
13000 Adjust to latest gnulib.
13001 * bootstrap (gnulib_modules): Add xalloc-die.
13002 Set LC_ALL=C so that file names sort consistently.
13003 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13004 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13005 uintmax_t.m4, ulonglong.m4.
13006 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13007 po.m4 since we are now using _gl.m4 instead.
13008
87a8ad5c
PE
130092004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13010
13011 * src/scan-action.l: Remove. Scanning of semantic actions is
13012 handled in scan-gram.l.
13013
dca81a78
PE
130142004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13015
13016 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13017
13018 * src/location.h (struct): The file member is a uniqstr.
13019 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13020
c9cbf7c5
PE
130212004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13022
13023 Fix bug with non-%union parsers that have printers or destructors,
13024 which led to a Bison core dump. Reported by Peter Fales in
13025 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 13026
c9cbf7c5
PE
13027 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13028 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13029 not to our own type.
13030 * src/output.c (symbol_destructors_output, symbol_printers_output):
13031 Don't assume %union.
13032 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13033 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13034 UNION-FLAG. All callers changed.
13035 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13036 Use type char, not unsigned int, when declaring an array of char;
13037 this lets us remove a cast.
13038 (Printers and Destructors): Add non-%union test cases.
13039
fa7e68c3
PE
130402004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13041
13042 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13043 GLR writeups. E.g., avoid frenchspacing and the future tense,
13044 change "lookahead" to "look-ahead", and change "wrt" to "with
13045 respect to".
2fa09258 13046
fa7e68c3
PE
130472004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13048
13049 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13050 New sections, split off from the GLR Parsers section. Put the new
13051 Simple GLR Parser near the start of the GLR section, for clarity.
13052 Rewrite connective text.
13053
99a9344e
PE
130542004-06-21 Frank Heckenbach <frank@g-n-u.de>
13055
13056 * doc/bison.texinfo (Simple GLR Parsers): New section.
13057
8dd162d3
PE
130582004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13059
13060 * NEWS, TODO, doc/bison.texinfo:
13061 Use "look-ahead" instead of "lookahead", to be consistent.
13062 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13063 while we're fixing "look-ahead".
13064 * src/conflicts.c (shift_set): Renamed from shiftset.
13065 (look_ahead_set): Renamed from lookaheadset.
13066 * src/print.c: Likewise.
13067 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13068 name for "lookahead".
13069 (report_types, usage): Likewise.
13070 * src/getargs.h (report_look_ahead_tokens): Renamed from
13071 report_lookaheads.
13072 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13073 compute_lookaheads.
13074 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13075 (look_ahead_tokens_print): Renamed from lookaheads_print.
13076 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13077 state_rule_lookaheads_print.
13078 * src/state.h: Likewise.
13079 (reductions.look_ahead_tokens): Renamed from lookaheads.
13080 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13081 AT_DATA_LOOKAHEADS_GRAMMAR.
13082
57a90331
PE
130832004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13084
13085 * README: Update location of patched M4 distribution.
13086
8ed3234a
PE
130872004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13088
13089 Don't assume the C++ compiler takes the same arguments as the C compiler
13090 (trivial change).
13091 * configure.ac (O0CXXFLAGS): New var.
13092 * tests/atlocal.in (CXXFLAGS): Use it.
13093
07971983
PE
130942004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13095
13096 Fix some "make check" problems with C++ reported by
13097 Albert Chin-A-Young for Tru64 C++ in this thread:
13098 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13099
13100 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13101 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13102 Output to a .cc file for C++, not to a .c file.
13103 * tests/calc.at (AT_CHECK_CALC): Likewise.
13104 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13105 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13106
29058652
PE
131072004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13108
13109 * tests/calc.at, tests/actions.at: Workaround for SGI
13110 C++ compiler. (trivial change)
13111
62cb8a99
PE
131122004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13113
fd418816
PE
13114 Spent a few hours checking out which prerequisite versions the
13115 current sources actually require. I went all the way back to
13116 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13117 a seemingly endless set of combinations of versions more recent
13118 than that. The bottom line is that the current sources require
13119 fairly recent versions of the build tools, and it'll be some work
13120 to change this.
13121 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13122 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13123 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13124 Add comments explaining why those particular versions are
13125 currently needed.
2fa09258 13126
62cb8a99
PE
13127 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13128 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 13129 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
13130
13131 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13132 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13133
caa52c10
PE
131342004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13135
13136 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13137 0.11.5. Suggested by Bruno Haible.
13138 * bootstrap: Remove gettext version checking.
13139
13140 * doc/bison.texinfo (Decl Summary): Also mention that %union
13141 can depend on prerequisite types. Problem reported by Tim
13142 Van Holder.
13143
4bfd5e4e
PE
131442004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13145
2cef3017
PE
13146 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13147 * README-alpha: Don't tell people not to package this.
13148
b9c85d5c
PE
13149 * bootstrap: Don't assume $(...) works; use `...` instead.
13150 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13151 gettext better.
13152
4bfd5e4e
PE
13153 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13154 put into the -d output file, and mention what to do if YYSTYPE is
13155 defined as a macro.
13156
6a36ff94
PE
131572004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13158
6712933e
PE
13159 Undo change made earlier today: it caused autopoint to not bring
13160 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13161 autopoint's.
13162
13163 * bootstrap: Check that gettext version matches what's in
13164 configure.ac. Warn users to ignore robots.txt ERROR 404.
13165 * bootstrap: Undo today's earlier change (logged below).
13166 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 13167
6a36ff94
PE
13168 The gettext version checking is causing more trouble than it's
13169 curing; remove it. Problem reported by Paul Hilfinger.
13170
13171 * bootstrap: Issue a warning that one can expect a message
13172 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13173 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13174
209ea708
PE
131752004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13176
13177 Ensure that the C++ compiler used for testing actually works on a
13178 simple test program; if not, skip the C++-related tests. Problem
13179 reported by Vin Shelton in:
161a71f3 13180 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
13181
13182 * m4/cxx.m4: New file.
13183 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13184 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13185 * tests/local.at (AT_COMPILE_CXX): Use it.
13186
41ca2549
PE
131872004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13188
383e69dc
PE
13189 * data/glr.c (yylloc): Output this macro even if locations are not
13190 being generated, as the GLR parser needs it even in that case.
13191 Problem reported by Troy A. Johnson
13192 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13193
41ca2549
PE
13194 * configure.ac (AC_INIT): Update to 1.875e.
13195
e476c87d
PE
131962004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13197
13198 * NEWS: Version 1.875d.
13199 * configure.ac (AC_INIT): Likewise.
13200 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13201
13202 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13203 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13204 lalr1.cc runs afoul of the first, and the last two are no longer
13205 supported by GCC 3.4.0.
13206 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13207 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13208
233a88ad
PE
132092004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13210
13211 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13212 unsigned int, for compatibility with latest gnulib hash module.
13213 * src/state.c (state_hash, state_hasher): Likewise.
13214 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13215 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 13216
12ffdd28
PE
132172004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13218
13219 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13220
13221 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13222 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13223 character and string literals.
13224 (unexpected_end): New function.
13225 (unexpected_eof): Use it.
13226 (unexpected_newline): New function.
13227 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13228 actions.
e476c87d 13229
12ffdd28
PE
13230 * NEWS: Document %expect-rr.
13231
13232 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13233 Fix typo by replacing $1 with $option.
13234 Remove more 'intl'-related files.
9668e2be 13235 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
13236
13237 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13238 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13239 strtoul.c.
13240 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13241 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13242 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13243 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13244 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13245 * src/.cvsignore: Add *.output.
13246
13247 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13248 gets copied to the output file.
e476c87d 13249
1f65350a
PE
132502004-04-28 Paul Eggert <eggert@twinsun.com>
13251
13252 Get files from the gnulib and po repositories, instead of relying
13253 on them being in our CVS. Upgrade to latest versions of gnulib
13254 and Automake.
13255
13256 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13257 * bootstrap: Bootstrap from gnulib and po repositories.
13258 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13259 * README-cvs: Document these changes. Remove version numbers from
13260 mentions of build tools, since they change so often. Mention Flex.
13261
13262 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13263 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
13264 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13265 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 13266 does this for us.
12ffdd28
PE
13267 (AC_ISC_POSIX): Remove; we no longer support this
13268 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
13269 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13270 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13271 Do not check for C89 headers, except for locale.h which is used
13272 by the Yacc library and must port to K&R hosts.
13273 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13274 Do not check for C89 functions, except for setlocale which is
13275 used by the Yacc library.
13276 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13277 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13278 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13279 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13280 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13281 AM_GNU_GETTEXT): Remove; now done by:
13282 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13283 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13284 for us.
13285
13286 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13287 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13288 Define to empty, as gnulib.mk will do the rest for us.
13289 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13290 for us.
13291 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13292 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13293
13294 * src/files.c: Include gnulib's xstrndup.h.
13295
13296 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13297 (REALLOC): Use xnrealloc, for likewise.
13298 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13299 (strnlen, memrchr): Remove decls; functions no longer used.
13300 Include <stpcpy.h>.
13301
13302 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13303 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13304 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13305 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13306 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13307 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13308 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13309 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13310 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13311 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13312 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13313 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13314 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13315 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13316 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13317 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13318 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13319 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13320 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13321 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13322 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13323 Remove, as these files are now generated automatically
13324 by bootstrap or automake.
13325
13326 * po/ChangeLog: Remove: all but one entry was a duplicate
13327 of this file, and I moved that 2000-11-02 entry here.
13328
13329 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13330 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13331 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13332 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13333 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13334 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13335 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13336 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13337 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13338 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13339 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13340 xstrndup.h.
13341 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13342 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13343 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13344 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13345 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13346 * src/.cvsignore: Remove *_.c.
13347
13348
13349 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13350 support it. (The latest stable gzip doesn't.)
13351
133522004-04-27 Paul Eggert <eggert@twinsun.com>
13353
13354 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13355 case, as stos_ is now used by destructors due to the 2004-02-09
13356 change.
13357
13358 Remove more K&R C support.
13359 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13360 * lib/subpipe.c (errno): Remove decl.
13361 Include <stdlib.h> unconditionally.
13362 (EXIT_FAILURE): Remove macro.
13363 * src/complain.c (vfprintf, strerror): Remove.
13364 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13365 unconditionally.
13366 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13367 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13368 (strchr, strspn, memchr): Remove decls.
13369 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13370 unconditionally. Do not declare perror.
13371 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13372 unconditionally.
13373
13374 * src/complain.c (_): Remove useless defn, as system.h defines this.
13375
13376 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13377 with latest obstack.h.
13378 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13379 to procedure types, as obstack.h now does that for us.
13380 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13381
13382 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13383 so that this include file can stand alone.
13384 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13385 does this now. Include subpipe.h first after config.h, to
13386 test whether it can stand alone.
13387
13388 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13389 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13390 unused declaration.
13391
13392 * tests/synclines.at (%union synch line): Put a dummy member in
13393 the union, because empty unions aren't allowed in C. Caught
13394 by GCC 3.4.0.
13395
4f16766c
PE
133962004-04-13 Jim Meyering <jim@meyering.net>
13397
13398 * src/conflicts.c (conflicts_print): Correct format string typo:
13399 use `%%' to produce literal `%'. (trivial change)
13400
779e7ceb
PE
134012004-03-30 Paul Eggert <eggert@twinsun.com>
13402
13403 * src/getargs.c (version): Update copyright year to 2004.
13404
13405 * data/c.m4 (b4_int_type): Use 'short int' rather than
13406 'short', and similarly for 'long', 'unsigned', etc.
13407 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13408 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13409 yy_yypstack, yydumpstack): Likewise.
13410 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13411 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13412 Likewise.
13413 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13414 yy_stack_print, yyparse): Likewise.
13415 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13416 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13417 * lib/bitset.c (bitset_print): Likewise.
13418 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13419 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13420 * lib/bitsetv.c (bitsetv_dump): Likewise.
13421 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13422 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13423 Likewise.
13424 * src/LR0.c (allocate_itemsets): Likewise.
13425 * src/gram.h (rule_number, rule): Likewise.
13426 * src/lalr.h (goto_number): Likewise.
13427 * src/nullable.c (nullable_compute): Likewise.
13428 * src/output.c (prepare_rules): Likewise.
13429 * src/relation.c (relation_print, relation_digraph): Likewise.
13430 * src/relation.h (relation_node): Likewise.
13431 * src/state.h (state_number, transitions, errs, reductions,
13432 struct state): Likewise.
13433 * src/symtab.h (symbol_number, struct symbol): Likewise.
13434 * src/tables.c (vector_number, tally, action_number,
13435 default_goto, goto_actions): Likewise.
13436 * tests/existing.at (GNU Cim Grammar): Likewise.
13437 * tests/regression.at (Web2c Actions): Likewise.
13438
13439 * src/output.c (muscle_insert_short_int_table): Renamed from
13440 muscle_insert_short_table. All uses changed.
13441
d6328241
PH
134422004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13443
13444 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13445 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13446 Add %expect-rr rule.
4f16766c 13447
d6328241
PH
13448 * src/scan-gram.l: Recognize %expect-rr.
13449
4f16766c 13450 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 13451 expected_conflicts.
4f16766c 13452 (expected_rr_conflicts): Declare.
d6328241
PH
13453
13454 * src/conflicts.c (expected_sr_conflicts): Rename from
13455 expected_conflicts.
13456 (expected_rr_conflicts): Define.
13457 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13458 for GLR parsers.
13459 Use expected_sr_conflicts in place of expected_conflicts.
13460 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 13461
d6328241 13462 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 13463
1452af69
PE
134642004-03-08 Paul Eggert <eggert@gnu.org>
13465
13466 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 13467 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
13468
13469 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13470 in lalr1.cc.
13471 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13472 * src/scan-gram.l (scan_integer): New function.
13473 ({int}): Use it.
13474 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13475 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13476 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13477 Say "long int", not "long", for uniformity with GNU style.
13478
006d217d
PE
134792004-02-25 Paul Eggert <eggert@twinsun.com>
13480
13481 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13482 compilers. This fixes a problem with Intel's C++ compiler being
13483 chatty, reported by Guido Trentalancia in
161a71f3 13484 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 13485
c2729758
ADL
134862004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13487
13488 Support %destructor and merge error locations in lalr1.cc.
13489
13490 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13491 (Parser::stos_): Define unconditionally.
13492 (Parser::destruct_): New method. Generate its body with
13493 b4_yydestruct_generate.
13494 (Parser::error_start_): New attribute.
13495 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13496 token which are discarded.
13497 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13498 error_start_ when erroneous token are discarded.
13499 (Parser::parse) <yyerrlab1>: Compute the location of the error
13500 token so that it covers all the discarded tokens.
13501 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13502 it can be called with `%skeleton "lalr1.cc"', and do that.
13503
dd0e0635
PE
135042004-02-02 Paul Eggert <eggert@twinsun.com>
13505
13506 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13507 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13508 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13509 There's no need to mention top_builddir since Automake does that
13510 for us.
13511 (INCLUDES): Remove, as Automake says it's obsolescent.
13512 Contents migrated into AM_CPPFLAGS as described above.
13513 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13514
135152004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13516
13517 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13518 (yyreportSyntaxError): Handle case where lookahead token is
13519 YYEMPTY.
13520
be16239b
PH
135212004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13522
13523 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13524 resulting parsers are compilable with C++.
13525
5fa90832
PE
135262003-12-23 Paul Eggert <eggert@twinsun.com>
13527
13528 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13529 * src/output.c (output_skeleton): Rename local var.
13530 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13531 Bison tokens, as this runs afoul of the 2003-10-07 change that
13532 disallowed NUL bytes in character constants or string literals.
13533
13534 * tests/local.at: Require Autoconf 2.59's Autotest.
13535 * tests/testsuite.at: Don't include local.at, since we now assume
13536 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13537 including it.
13538 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13539 multiple inclusion warnings.
dd0e0635 13540
b165c324
AD
135412003-12-02 Akim Demaille <akim@epita.fr>
13542
13543 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13544 conditions.
13545 From Bruno Haible.
13546
26e06a21
ADL
135472003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13548
13549 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13550
92ac3705
PE
135512003-10-07 Paul Eggert <eggert@twinsun.com>
13552
6a5ecb38
PE
13553 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13554 if testsuite doesn't exist.
13555
92ac3705
PE
13556 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13557 literals, unfortunately.
13558 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13559 Complain about NUL bytes in character constants or string literals.
13560
91d2c560
PE
135612003-10-05 Paul Eggert <eggert@twinsun.com>
13562
13563 * NEWS: Don't document %no-default-prec, as it's still
13564 too experimental.
13565 * doc/bison.texinfo: Document %no-default-prec only if
13566 the defaultprec flag is set. Normally it's not.
13567
0cc3da3a
PE
135682003-10-04 Paul Eggert <eggert@twinsun.com>
13569
13570 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13571 non-modifiable lvalue, instead of a modifiable one.
13572 * doc/bison.texinfo (Actions): Document that $$ can
13573 be assigned to. Do not claim that $$ and $N are
13574 array element references: user code should not rely on this.
13575
22fccf95
PE
135762003-10-01 Paul Eggert <eggert@twinsun.com>
13577
13578 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13579 (grammar_declaration): Use it.
13580 * src/scan-gram.l: New token %no-default-prec.
13581 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13582 * NEWS, doc/bison.texinfo: Document the above.
13583
fc8f2965
AD
135842003-10-01 Akim Demaille <akim@epita.fr>
13585
13586 VCG no longer supports long_straight_phase.
13587
13588 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13589 * src/print_graph.c (print_graph): Adjust.
13590
39a06c25
PE
135912003-09-30 Frank Heckenbach <frank@g-n-u.de>
13592 and Paul Eggert <eggert@twinsun.com>
13593
13594 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13595 Table of Symbols): Document %default-prec.
13596 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13597 (grammar_declaration): Set default_prec on %default-prec.
13598 * src/scan-gram.l (%default-prec): New token.
13599 * src/reader.h (default_prec): New flag.
13600 * src/reader.c: Likewise.
13601 (packgram): Handle it.
13602 * tests/conflicts.at (%default-prec without %prec,
13603 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 13604
39a06c25
PE
136052003-09-30 Paul Eggert <eggert@twinsun.com>
13606
13607 * tests/testsuite.at: Include local.at, not input.at, fixing
13608 a typo in the 2003-08-25 patch.
13609
62b6aef9
AD
136102003-08-27 Akim Demaille <akim@epita.fr>
13611
13612 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13613 GCC warnings.
13614
89e1cc61
AD
136152003-08-26 Akim Demaille <akim@epita.fr>
13616
13617 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13618 "<\#" to avoid magic from Gnus when posting parts of this script.
13619
a08460b0
AD
136202003-08-26 Akim Demaille <akim@epita.fr>
13621
13622 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13623 (Parser::parse): here.
13624 Adjust: nerrs and errstatus is now replaced by...
13625 (Parser::nerrs_, Parser::errstatus_): New.
13626
603f1cfd
AD
136272003-08-25 Akim Demaille <akim@epita.fr>
13628
13629 * config/announce-gen, Makefile.cfg: New.
13630 * Makefile.am: Adjust.
13631 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13632 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13633
cd3684cf
AD
136342003-08-25 Akim Demaille <akim@epita.fr>
13635
13636 When reducing initial empty rules, Bison parser read an initial
13637 location that is not defined. This results in garbage, and that
13638 affects Bison's own parser. Therefore we need (i) to extend Bison
13639 to support a means to initialize this location, and (ii) to use
13640 this CVS Bison to fix CVS Bison's parser.
13641
13642 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13643 with...
13644 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13645 * src/parse-gram.y: Adjust.
13646 (%initial-action): New.
13647 (%error-verbose): Since we require CVS Bison, there is no reason
13648 not to use it.
13649 * src/scan-gram.l: Adjust.
13650 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13651 * data/yacc.c (yyparse): Use b4_initial_action.
13652
4e03e201
AD
136532003-08-25 Akim Demaille <akim@epita.fr>
13654
13655 * doc/bison.texinfo: Don't promote stdout for error messages.
13656
8c182d05
AD
136572003-08-25 Akim Demaille <akim@epita.fr>
13658
13659 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13660 From Alexandre Duret-Lutz.
13661
6a60c4cf
PE
136622003-08-25 Akim Demaille <akim@epita.fr>
13663
13664 Version 1.875c.
13665
25f66e1a
AD
136662003-08-25 Akim Demaille <akim@epita.fr>
13667
13668 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13669 Use them.
13670
5348bfbe
AD
136712003-08-25 Akim Demaille <akim@epita.fr>
13672
13673 * data/lalr1.cc (Parser::reduce_print_): New.
13674 Use it.
13675
47301314
AD
136762003-08-25 Akim Demaille <akim@epita.fr>
13677
13678 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13679 error recovery loops. This patch is based on
161a71f3 13680 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
13681 Also, augment the similarity between lalr1.cc and yacc.c.
13682 Note: the locations of error recovery rules are not correct yet.
13683
13684 * data/lalr1.cc: Comment changes to augment the similarity between
13685 lalr1.cc and yacc.c.
13686 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13687 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13688 yyerrlab), when hitting EOF, pop the whole stack here instead of
13689 merely falling thru the default error handling mechanism.
13690 (yyerrorlab): New label, with the old contents of YYERROR,
13691 plus the following change: pop the stack of rhs corresponding
13692 to the production that invoked YYERROR. That is how Yacc
13693 behaves (required by POSIX).
13694 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13695 fail.
13696
1f7a61ff
AD
136972003-08-25 Akim Demaille <akim@epita.fr>
13698
13699 Tune local.at so that people can "autom4te -l autotest calc.at -o
13700 calc" for instance, to extract a sub test suite.
13701
13702 * tests/testsuite.at: Move the initialization, Autotest version
13703 requirement, and AT_TESTED invocation into...
13704 * tests/local.at: here.
13705 * tests/testsuite.at: Include it for compatibility with Autoconf
13706 2.57.
13707 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13708 be ignore.
13709
327b5b56
PE
137102003-08-04 Paul Eggert <eggert@twinsun.com>
13711
13712 Rework code slightly to avoid gcc -Wtraditional warnings.
13713 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13714 The returned value is now stored in *YY0. All callers changed.
13715 * src/output.c (merge_output): Adjust to the above change.
13716
0051e3ed
PE
137172003-07-26 Paul Eggert <eggert@twinsun.com>
13718
13719 * data/glr.c (YYASSERT): New macro.
13720 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13721 yyresolveStates, yyprocessOneStack):
13722 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13723 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 13724
137437c6
PE
137252003-07-25 Paul Eggert <eggert@twinsun.com>
13726
5b620e06
PE
13727 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13728 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 13729 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
13730 by Frank Heckenbach, though I have omitted the structure-initialization
13731 part of his glr-knr.diff patch since I recall that the Portable
13732 C Compiler didn't require that change.
13733
137437c6
PE
13734 Let the user specify how to allocate and free memory.
13735 Derived from a suggestion by Frank Heckenbach in
161a71f3 13736 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
13737 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13738 All uses of free, malloc, realloc changed to use these macros,
13739 and unnecessary casts removed.
13740 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13741
ddb85ca5
PE
137422003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13743
13744 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13745 use s.empty() rather than s == "" to test for empty string; see
161a71f3 13746 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
13747 (trivial change)
13748
39910e09
AD
137492003-06-25 Akim Demaille <akim@epita.fr>
13750
13751 * config/depcomp, config/install-sh: Update from masters.
13752
0ae99356
PE
137532003-06-20 Paul Eggert <eggert@twinsun.com>
13754
13755 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13756 and return properly parenthesized result.
13757 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13758 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13759 Remove unnecessary parentheses from uses.
13760 * doc/bison.texinfo (Location Default Action): Describe the
13761 conventions for parentheses.
13762
cd05d13c
PE
137632003-06-19 Paul Eggert <eggert@twinsun.com>
13764
81fd08ca
PE
13765 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13766 yyreportTree): Do not assume that size_t is the same width as int,
13767 when printing sizes. Print sizes using an unsigned format.
13768 Problem reported by Frank Heckenbach in
161a71f3 13769 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 13770
cd05d13c
PE
13771 Port to Forte Developer 7 C compiler.
13772 * data/glr.c (struct YYLTYPE): If locations are not being used,
13773 declare a single dummy member, as empty structs do not conform
13774 to the C standard.
13775 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13776 the Forte Developer 7 C compiler complains that end-of-loop
13777 code is not reached.
13778
4dcf140b
PE
137792003-06-17 Paul Eggert <eggert@twinsun.com>
13780
13781 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13782 avoid warnings from picky compilers about redefinition of PARAMS.
13783
8dd76bee
PE
137842003-06-17 Paul Eggert <eggert@twinsun.com>
13785
13786 Version 1.875b.
13787
13788 * NEWS: Document 1.875b.
13789
13790 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13791 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13792 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13793 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13794 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13795 per recent gettext manual's suggestion.
13796 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13797 Use prototypes, not old-style definitions.
13798 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13799 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13800 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13801 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13802 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13803 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13804 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13805 vbitset_or_and_cmp, vbitset_copy): Likewise.
13806
13807 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13808 Do not include <stdlib.h>.
13809 (PARAMS): Define unconditionally for C89.
13810 (ATTRIBUTE_NORETURN): Remove.
13811 (ATTRIBUTE_UNUSED): Define unconditionally.
13812
13813 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 13814 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
13815 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13816 * lib/vbitset.c, lib/vbitset.h: New files.
13817 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13818 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13819 from libbitset.
13820
13821 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13822 `How Can I Reset @code{yyparse}', since texinfo does not allow
13823 arbitrary @ in node names.
13824
13825 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13826 shouldn't be needed according to the gettext 0.12.1 documentation
13827 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 13828 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 13829 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 13830 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 13831
8dd76bee
PE
13832 * lib/.cvsignore: Add stdbool.h.
13833 * m4/.cvsignore: Add nls.m4, po.m4.
13834
13835 Upgrade to CVS gnulib.
13836 * stdbool_.h: File renamed from stdbool.h.in.
13837 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13838 AC_HEADER_STDBOOL.
13839 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13840 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13841 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13842 (MOSTLYCLEANFILES): New var.
13843 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13844 (stdbool.h): New rule.
13845 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13846 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13847 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13848 m4/quote.m4: Upgrade to today's gnulib.
13849
13850 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13851 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13852 the tests right now.
13853 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13854 yyerror are declared before use; C99 requires this.
13855
25005f6a
PH
138562003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13857
13858 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13859 first.
13860 (yyrecoverSyntaxError): Correct the logic for setting and testing
13861 yyerrState.
13862 Correct comment on handling EOF.
13863 Allow states with only a default reduction, rather than failing
8dd76bee 13864 (I can't quite reconstruct why these were not allowed before).
25005f6a 13865
137437c6 13866 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 13867 buffer overruns, corrupting state.
8dd76bee
PE
13868
13869 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
13870 definition.
13871 * src/reader.h (max_left_semantic_context): New variable declaration.
13872 * src/scan-gram.l (max_left_semantic_context): Define.
13873 (handle_action_dollar): Update max_left_semantic_context.
13874 * data/glr.c (YYMAXLEFT): New definition.
13875 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13876 (yyresolveAction): Ditto.
13877
13878 Fixes to problems with location handling in GLR parsers reported by
13879 Frank Heckenbach (2003/06/05).
13880
13881 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13882 (YYRHSLOC): Add parentheses, and define only if locations used.
13883 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13884 locations not used.
13885 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13886 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 13887
25005f6a
PH
13888 * tests/cxx-type.at: Exercise location information; update tests
13889 to differentiate output with and without locations.
8dd76bee 13890 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
13891 because default YYLTYPE not yet defined.
13892 Change semantic actions to compute strings, rather than printing
13893 them directly (to test proper passing of semantics values). Change
13894 output to prefix notation and update test data and expected results.
13895 (yylex): Track locations.
13896 (stmtMerge): Return value rather than printing, and include arguments
13897 in value.
8dd76bee 13898
711f40b7
PE
138992003-06-03 Paul Eggert <eggert@twinsun.com>
13900
13901 Avoid warnings generated by GCC 2.95.4 when Bison is
13902 configured with --enable-gcc-warnings.
13903 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13904 yy::]b4_parser_class_name[::translate_,
13905 yy::Stack::operator[] (unsigned),
13906 yy::Stack::operator[] (unsigned) const,
13907 yy::Slice::operator[] (unsigned),
13908 yy::Slice::operator[] (unsigned) const):
13909 Rename local vars to avoid warnings.
13910 * tests/glr-regression.at (Improper handling of embedded actions
13911 and $-N in GLR parsers): Remove unused local variable from yylex.
13912 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13913 (void) as arg when not pure, since we now assume C89 when building
13914 Bison. Pacify GCC by using parameter.
13915
ac695f7d
PE
139162003-06-02 Paul Eggert <eggert@twinsun.com>
13917
13918 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13919 yy::Location::lines, yy::Location::columns): Rename arguments
13920 to avoid shadowing; this removes a warning generated by GCC 3.3.
13921
26ec81e0
PE
139222003-06-01 Paul Eggert <eggert@twinsun.com>
13923
13924 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13925 to g++, as GCC 3.3 complains if you do it.
13926 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13927 everything that WARNING_CFLAGS has, except omit warnings
13928 not suitable for C++.
13929 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13930 * tests/atlocal.in (CXXFLAGS): New var.
13931 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13932
13933 Fix a GLR parser bug I reported in February; see
161a71f3 13934 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
13935 The problem was that GLR parsers did not conform to the C standard,
13936 because actions like { $1 = $2 + $3; } expanded to expressions
13937 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13938 to a local variable. The C standard says that expressions
13939 like (var = f ()) + (var = f ()) have undefined behavior.
13940 Another problem was that GCC sometimes issues warnings that
13941 yyfill and its parameters are unused.
13942
13943 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13944 as possibly unused.
13945 (yyfill): New function.
13946 (YYFILL): Use it.
13947 (yyuserAction): Change type of yynormal to bool, so that it matches
13948 the new yyfill signature. Mark it as possibly unused.
13949
13950
13951 Follow up on a bug I reported in February, where a Bison-generated
13952 parser can loop. Provide a test case and a fix for yacc.c. I
13953 don't have a fix for lalr1.cc or for glr.c, unfortunately.
13954 The original bug report is in:
161a71f3 13955 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
13956
13957 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
13958 macro's size was becoming unwieldy.
13959 (yyerrlab): Do not discard an empty lookahead symbol, as this
13960 might destroy garbage.
13961 (yyerrorlab): New label, with the old contents of YYERROR,
13962 plus the following change: pop the stack of rhs corresponding
13963 to the production that invoked YYERROR. That is how Yacc
13964 behaves, and POSIX requires this behavior.
13965 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
13966 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
13967 Define 'alarm' to do nothing if unistd.h is not available.
13968 Add a new rule "exp: '-' error;" to test the above change to
13969 data/yacc.c. Use 'alarm' to abort any test taking longer than
13970 10 seconds, as it's probably looping.
13971 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
13972 Also, the new yacc.c generates two fewer diagnostics for an
13973 existing test.
13974
d0829076
PE
139752003-05-24 Paul Eggert <eggert@twinsun.com>
13976
c6ae27df
PE
13977 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
13978 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
13979 This fixes a problem reported by John Bowman when the Compaq/HP
13980 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
13981 -ansi -Wall -gall).
13982 * data/yacc.c (union yyalloc): Likewise.
13983 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 13984
d0829076
PE
13985 Switch from 'int' to 'bool' where that makes sense.
13986
13987 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
13988 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
13989 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
13990 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
13991 Return or accept bool, not int. All callers changed.
13992 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
13993 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
13994 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13995 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13996 bitset_or_and_cmp_): Likewise.
13997 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13998 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13999 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14000 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14001 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14002 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14003 bitset_stats_or_and_cmp): Likewise.
14004 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14005 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14006 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14007 ebitset_xor_cmp): Likewise.
14008 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14009 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14010 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14011 lbitset_xor_cmp): Likewise.
14012 * lib/bbitset.h: Include <stdbool.h>.
14013 (struct bitset_vtable): The following members now return bool, not
14014 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14015 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14016 or_and_cmp).
14017 * src/conflicts.c (count_rr_conflicts): Likewise.
14018 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14019 All uses changed.
14020 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14021 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14022 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14023 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14024 graph_flag): Likewise.
14025 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14026 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14027 graph_flag): Likewise.
14028 * src/output.c (error_verbose): Likewise.
14029 * src/output.h (error_verbose): Likewise.
14030 * src/reader.c (start_flag, typed): Likewise.
14031 * src/reader.h (typed): Likewise.
14032 * src/getargs.c (LOCATIONS_OPTION): New constant.
14033 (long_options, getargs): Use it.
14034 * src/lalr.c (build_relations): Use bool, not int.
14035 * src/nullable.c (nullable_compute): Likewise.
14036 * src/print.c (print_reductions): Likewise.
14037 * src/tables.c (action_row, pack_vector): Likewise.
14038 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14039 * src/output.c (prepare): Use it.
14040 * src/output.c (token_definitions_output,
14041 symbol_destructors_output, symbol_destructors_output): Use string,
14042 not boolean integer, to keep track of whether to output separator.
14043 * src/print_graph.c (print_core): Likewise.
14044 * src/state.c (state_rule_lookaheads_print): Likewise.
14045
14046 * config/install-sh: Sync from automake 1.7.5.
14047
6b2584b7
PE
140482003-05-14 Paul Eggert <eggert@twinsun.com>
14049
14050 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14051 semicolon after a grammar declaration, in the interest of possible
14052 future changes to the Bison input language.
14053 Do not allow a stray semicolon at the start of the grammar.
14054 (rhses.1): Allow one or more semicolons after any rule, including
14055 just before "|" as required by POSIX.
14056 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14057 grammar.
14058
caf37a36
ADL
140592003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14060
14061 %parse-param support for lalr1.cc.
14062
14063 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14064 b4_cc_constructor_calls, b4_cc_constructor_call,
14065 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14066 definitions.
14067 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14068 parse-param arguments.
14069 (yy::b4_parser_class_name): Declare instance variables to
14070 hold parse-param arguments.
14071 * tests/calc.at: s/value/semantic_value/ because value clashes
14072 with a member of yy::b4_parser_class_name. Adjust C++ code
14073 to handle %parse-param. Enable %parse-param test in C++.
14074
3ab37077
PE
140752003-05-12 Paul Eggert <eggert@twinsun.com>
14076
14077 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14078 English a bit. Fix fclose typo. Change "const char" to "char
14079 const", and use ANSI C rather than K&R for "main". Suggest
14080 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14081 and suggest yy_switch_to_buffer.
14082
140832003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
14084
14085 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14086 C89. This avoids a diagnostic on compilers that define __STDC__
14087 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 14088 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 14089
e743727f
PE
140902003-05-03 Paul Eggert <eggert@twinsun.com>
14091
14092 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14093 Do not overrun array bounds.
14094 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 14095 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 14096
916708d5
AD
140972003-04-29 Akim Demaille <akim@epita.fr>
14098
14099 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14100 * src/getargs.c, src/getargs.h: here, as bool, not int.
14101 (nondeterministic_parser): New.
14102 * src/parse-gram.y, src/scan-gram.l: Support
14103 %nondeterministic-parser.
14104 * src/output.c (prepare): Use nondeterministic_parser instead
14105 of glr_parser where appropriate.
14106 * src/tables.c (conflict_row, action_row, save_row)
14107 (token_actions, token_actions, pack_vector): Ditto.
14108
a06ea4aa
AD
141092003-04-29 Akim Demaille <akim@epita.fr>
14110
14111 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14112
211074ca
AD
141132003-04-29 Akim Demaille <akim@epita.fr>
14114
14115 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14116 with %pure-parser and %locations to exercise the patch from Yakov
14117 Markovitch below.
14118
6175ffe3
PE
141192003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14120
14121 * data/yacc.c: (b4_lex_param): Corrected for the case where
14122 %lex-param is provided and %pure-parser isn't.
14123
b1e95857
PE
141242003-04-27 Paul Eggert <eggert@twinsun.com>
14125
14126 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 14127 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
14128 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14129 if it is not defined.
14130 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14131
acda9df6
PE
141322003-04-26 Paul Eggert <eggert@twinsun.com>
14133
3470c57b
PE
14134 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14135 Declare to be of type suitable for the ninf value itself, not of
14136 type suitable for the corresponding table, since the latter might
14137 be unsigned but the ninf value might be negative. This fixes a
14138 bug reported by Alexandre Duret-Lutz in
161a71f3 14139 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 14140
acda9df6
PE
14141 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14142 invokes it. We shouldn't invoke it twice because it will attempt
14143 to put error.o in the archive twice. This fixes a glitch reported
14144 by Martin Mokrejs in
161a71f3 14145 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 14146
b5250f26
PE
141472003-04-21 Paul Eggert <eggert@twinsun.com>
14148
14149 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14150 to gnulib.
14151
089ac0f1
PE
141522003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14153
14154 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14155 Fix obvious typo that results in uncompilable GLR parsers
14156 when both %pure-parser and %locations are used. (trivial change)
14157
5ededac6
PE
141582003-04-17 Paul Eggert <eggert@twinsun.com>
14159
1b8f2fff
PE
14160 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14161 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14162 Do not insert the expected token via unput, as this runs afoul
14163 of a POSIX-compatibility bug in flex 2.5.31.
14164 All uses changed to BEGIN the parent state,
14165 since we no longer insert the expected token via unput.
14166 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14167 that is no longer emitted after the above change.
14168
5ededac6
PE
14169 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14170 the first one. This change is from Paul Hilfinger, and it fixes
14171 regression reported by Werner Lemberg in
161a71f3 14172 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
14173
14174 (resolve_sr_conflict): Don't invoke state_errs_set
14175 unless one or more tokens have been explicitly made errors.
14176 Otherwise, the above change causes Bison to abort.
14177
14178 * tests/existing.at (GNU pic Grammar): New test case, taken from
14179 Lemberg's email.
14180
b8be9132
AD
141812003-03-31 Akim Demaille <akim@epita.fr>
14182
14183 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14184
d423d460
AD
141852003-03-31 Akim Demaille <akim@epita.fr>
14186
14187 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14188 output.
14189
c7e441b4
AD
141902003-03-31 Akim Demaille <akim@epita.fr>
14191
14192 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14193 From Paul Hilfinger.
14194
231897ad
AD
141952003-03-29 Akim Demaille <akim@epita.fr>
14196
14197 * m4/error.m4: Do not put under dynamic conditions some code which
14198 expansion is under static control.
14199
5b066063
AD
142002003-03-29 Akim Demaille <akim@epita.fr>
14201
14202 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14203
22a74fec
AD
142042003-03-29 Akim Demaille <akim@epita.fr>
14205
14206 * doc/bison.texinfo (Strings are Destroyed): New.
14207
0eee27e7
PE
142082003-03-13 Paul Eggert <eggert@twinsun.com>
14209
14210 * .cvsignore: Add configure.lineno.
14211 * src/.cvsignore: Add yacc.
14212 * tests/.cvsignore: Add testsuite.log.
14213 * doc/fdl.texi: Sync with latest FSF version.
14214
f61aad93
PE
142152003-03-12 Paul Eggert <eggert@twinsun.com>
14216
537636c7
PE
14217 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14218 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14219 cursor, instead of leaving it undefined. This fixes a bug
14220 reported by Tim Van Holder in
161a71f3 14221 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
14222 * tests/input.at (Torturing the Scanner): Test the scanner on
14223 an empty input file, which was Tim Van Holder's test case.
14224
14225 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14226 <sys/resource.h> can be included, include sys/time.h and
14227 sys/times.h first, if available. This works around the SunOS
14228 4.1.4 porting bug reported by Bruce Becker in
161a71f3 14229 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
14230
14231 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14232 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14233 AC_HEADER_SYS_WAIT.
14234
f61aad93
PE
14235 Merge changes from gnulib. This was prompted because the CVS
14236 snapshot didn't build on Solaris 7 due to strnlen problems.
14237
14238 These changes need to be merged back into gnulib:
14239 * lib/hash.c: Include <stdbool.h> unconditionally.
14240 * m4/onceonly.m4 (m4_quote): New macro.
14241 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14242 Quote AC_FOREACH variable-expansions properly.
14243 The 2003-01-03 obstack.h change also needs merging.
14244 {end of changes requiring merging}
5b066063 14245
f61aad93
PE
14246 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14247 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14248 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14249 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14250 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14251 New files, imported from gnulib.
14252 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14253 above.
14254
14255 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14256 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14257 gnulib sources.
14258
14259 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14260 Add.
14261 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14262 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14263 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14264 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14265 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14266 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14267 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14268 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14269 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14270 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14271 (jm_PREREQ_ARGMATCH): Remove.
14272 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14273 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14274
14275 * src/system.h: Include <stdbool.h> unconditionally.
14276
14277 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14278 assuming at least C89 in the bitset code for some time now.
14279
d2ffe116
AD
142802003-03-03 Akim Demaille <akim@epita.fr>
14281
14282 * ro.po: New.
14283
052826fd
AD
142842003-03-02 Akim Demaille <akim@epita.fr>
14285
14286 * doc/bison.texinfo (Table of Symbols): Reactivate the
14287 documentation for %lex-param, and %parse-param.
14288
c4749565
AD
142892003-03-02 Akim Demaille <akim@epita.fr>
14290
14291 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14292 generate verbose error messages.
14293 Use the number of tokens as an upper bound in yytname, as it
14294 cannot be a non terminal.
14295
d5286af1
AD
142962003-03-02 Akim Demaille <akim@epita.fr>
14297
14298 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14299 message.
14300
22e304a6
AD
143012003-03-02 Akim Demaille <akim@epita.fr>
14302
22e304a6
AD
14303 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14304 Use them to exercise yycheck overrun.
14305 Based on Andrew Suffield's grammar.
14306
67a25fed
AD
143072003-03-02 Akim Demaille <akim@epita.fr>
14308
14309 Create tests/local.at for Bison generic testing macros.
14310
14311 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14312 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14313 This new file.
14314 * tests/calc.at (AT_CHECK_CALC): Adjust.
14315 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14316 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14317 * tests/local.at: here.
14318 (AT_COMPILE_CXX): Tags the tests using it as c++.
14319 Ignore the test if CXX is not functional.
14320
9c2b381f
PE
143212003-03-01 Paul Eggert <eggert@twinsun.com>
14322
14323 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14324 not loc->end, since loc->end might contain garbage and this leads
14325 to undefined behavior on some platforms.
14326 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14327 depend on *loc, so that the reader doesn't give the the false
14328 impression that *loc is initialized.
14329 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14330 does not survive the return.
14331
0433ba88
AD
143322003-03-01 Akim Demaille <akim@epita.fr>
14333
14334 * src/scan-gram.l (code_start): Always initialize it when entering
14335 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14336 yylex invocation. An alternative would be making it static, but
14337 then it starts with the second %%'s beginning, instead of its end.
14338
b305ea69
PE
143392003-02-28 Paul Eggert <eggert@twinsun.com>
14340
14341 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14342 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 14343 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 14344
c3d25e01
PE
143452003-02-26 Paul Eggert <eggert@twinsun.com>
14346
14347 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14348 Remove Sequent/Pyramid discussion (nobody uses them any more).
14349 Merge VMS and MS-DOS discussion; these ports may well be dead
14350 but let's keep mentioning them for now. Put <> around email
14351 addresses. Add copyright notice.
14352
c267ffbc
PE
143532003-02-24 Paul Eggert <eggert@twinsun.com>
14354
14355 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14356 to avoid collision with flex use of yylineno.
14357 Problem reported by Bruce Lilly in
161a71f3 14358 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
14359 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14360 * data/yacc.c (yy_reduce_print): Likewise.
14361
14362 * config/depcomp: Sync with Automake 1.7.3.
14363
f939fc12
AD
143642003-02-21 Akim Demaille <akim@epita.fr>
14365
14366 * data/lalr1.cc: Use temporary variables instead of casts to
14367 change integer types.
14368 Suggested by Paul Eggert.
14369
95923bd6
AD
143702003-02-21 Akim Demaille <akim@epita.fr>
14371
14372 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14373 to avoid confusions with lalr1.cc's notion of Position.
14374 Suggested by Paul Eggert.
14375
2cdc240e
AD
143762003-02-20 Akim Demaille <akim@epita.fr>
14377
14378 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14379 before initial_columns.
14380 (location.hh): Use consistent variable names when defining the
14381 operator<<.
14382 Use "last" so that we subtract from Positions, not from unsigned.
14383
5d003116
AD
143842003-02-20 Akim Demaille <akim@epita.fr>
14385
14386 * data/lalr1.cc (position.hh): New subfile, including the extended
14387 and Doxygen'ed documentation of class Position.
14388 (location.hh): Use it.
14389 Document a` la Doxygen.
ba1ecc07 14390 With the help of Benoit Perrot.
5d003116 14391
d02b25f9
AD
143922003-02-20 Akim Demaille <akim@epita.fr>
14393
14394 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14395 AT_YACC_IF.
14396 Redefine AT_YYERROR_SEES_LOC_IF using it.
14397 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14398 not defined.
14399 Don't use the location in yy::Parser::error_ and
14400 yy::Parser::print_ when not %locations.
14401 Activate more lalr1.cc tests.
14402
0d1c3a04
AD
144032003-02-19 Akim Demaille <akim@epita.fr>
14404
14405 * data/lalr1.cc: When displaying a line number, be sure to make it
14406 an int.
14407
60a777aa
AD
144082003-02-19 Akim Demaille <akim@epita.fr>
14409
14410 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14411 Remove, useless.
14412 (YYABORT, YYACCEPT, YYERROR): New.
14413 * tests/calc.at: Renable the lalr1.cc test.
14414
0b86fc41
AD
144152003-02-19 Akim Demaille <akim@epita.fr>
14416
14417 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14418 error recovery, mixing with/without pops and discarding of the
14419 lookahead.
14420 Exercise YYERROR.
14421 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14422
da99a5dc
PE
144232003-02-17 Paul Eggert <eggert@twinsun.com>
14424
14425 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14426 * tests/testsuite.at (AT_COMPILE): Use them.
14427 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 14428 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 14429
93b8c255
PE
144302003-02-12 Paul Eggert <eggert@twinsun.com>
14431
14432 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14433 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 14434 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
14435 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14436 Check for malloc failure, for consistency with yacc.c.
14437 (yytname_size): Remove, for consistency with yacc.c.
14438
14439 The bug still remains in data/lalr1.cc, as I didn't have time
14440 to fix it there.
14441
7548fed2
AD
144422003-02-06 Akim Demaille <akim@epita.fr>
14443
14444 * configure.ac (GXX): Rename as...
14445 (CXX): this, to keep the original Autoconf semantics.
14446 Require 2.57.
14447 * data/lalr1.cc: Fix b4_copyright invocations.
14448 If YYDEBUG is not defined, don't depend upon name_ being defined.
14449 (location.hh): Include string and iostream.
14450 (Position::filename): New member.
14451 (Position::Position ()): New.
14452 (operator<< (Position)): New.
14453 (operator- (Position, int)): New.
14454 (Location::first, Location::last): Rename as...
14455 (Location::begin, Location::end): these, to mock the conventional
14456 iterator names.
14457 (operator<< (Location)): New.
14458 * tests/atlocal.in (CXX): New.
14459 * tests/testsuite.at (AT_COMPILE_CXX): New.
14460 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14461 locations in a more synthetic way.
14462 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14463 lalr1.cc is used.
14464 Adjust the C locations to match those from Emacs: first column is
14465 column 0.
14466 Change all the expected results.
14467 Conform to the GCS: simplify the locations when applicable.
14468 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14469 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14470 these CPP macros with the m4 macros new defined by...
14471 (AT_CHECK_PUSHDEFS): this, i.e.:
14472 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 14473 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
14474 New macros.
14475 (AT_CHECK_POPDEFS): Undefine them.
14476 (AT_CHECK_CALC_LALR1_CC): New.
14477 Use it for the first lalr1.cc test.
14478
43a176ef
AD
144792003-02-04 Akim Demaille <akim@epita.fr>
14480
14481 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14482 Location as is defined.
14483
fc049e9c
AD
144842003-02-04 Akim Demaille <akim@epita.fr>
14485
14486 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14487 name_ being defined.
14488
a737b216
PE
144892003-02-03 Paul Eggert <eggert@twinsun.com>
14490
14491 * src/gram.h (start_symbol): Remove unused decl.
14492
14493 Use more-consistent naming conventions for local vars.
14494
14495 * src/derives.c (derives_compute): Change type of local var from
14496 int to rule_number.
14497 * src/gram.c (grammar_rules_partial_print): Likewise.
14498 * src/print.c (print_core): Likewise.
14499 * src/reduce.c (reduce_grammar_tables): Likewise.
14500
14501 * src/gram.c (grammar_dump): Change name of item_number *
14502 local var from r to rp.
14503 * src/nullable.c (nullable_compute): Likewise.
14504
14505 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14506
14507 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14508 for symbol or symbol_number var.
14509 * src/reader.c (grammar_start_symbol_set): Likewise.
14510 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14511 Likewise.
14512 * src/state.c (transitions_to): Likewise.
14513 * src/state.h: Likewise.
14514 * src/tables.c (symbol_number_to_vector_number): Likewise.
14515
14516 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14517 char * var.
14518
14519 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14520 var.
14521
14522 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14523 var.
14524
14525 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14526 Use str, not s, for char * var. Use ch, not c, for character var.
14527 Use size for size var.
14528
14529 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14530 char * var.
14531 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14532 uniqstr var.
14533 * src/uniqstr.h: Likewise.
14534
14535 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14536 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14537 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14538 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14539 param to have same name as that of enum, so that we don't use
14540 "s" to stand for a non-state.
14541
68e93ad5
AD
145422003-02-02 Akim Demaille <akim@epita.fr>
14543
14544 * src/scan-skel.l: Scan more than one inert character per yylex
14545 invocation.
14546
92898986
PE
145472003-02-01 Paul Eggert <eggert@twinsun.com>
14548
14549 Version 1.875a.
14550
1d9d5d71
PE
14551 * po/LINGUAS: Add ms.
14552
0435d061
AD
145532003-01-30 Akim Demaille <akim@epita.fr>
14554
14555 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14556
6029a57f
PH
145572003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14558
14559 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14560 of $1.
0435d061
AD
14561
14562 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 14563 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 14564 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 14565
6029a57f
PH
14566 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14567 (b4_rhs_location): Ditto.
0435d061 14568 (yyfill): New function to copy from stack tree into array
6029a57f 14569 incrementally.
0435d061
AD
14570 (yyuserAction): Modify to allow incremental move of semantic values
14571 to rhs array when in GLR mode.
14572 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
14573 as needed.
14574 Remove dummy use of yystack, as there is now a guaranteed use.
14575 (yydoAction): Modify to allow incremental move of semantic values
14576 to rhs array when in GLR mode.
14577 (yyresolveAction): Ditto.
14578 (yyglrShiftDefer): Update comment.
0435d061 14579 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
14580 (yyglrReduce): Ditto.
14581 (yydoAction): Ditto
0435d061 14582
6029a57f
PH
14583 * tests/glr-regr1.at: Rename to ...
14584 * tests/glr-regression.at: Add new regression test for the problems
14585 described above (adapted from S. Eken).
14586 Update copyright notice.
14587 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14588 * tests/Makefile.am: Ditto.
14589
6cee6297
PE
145902003-01-28 Paul Eggert <eggert@twinsun.com>
14591
14592 * data/lalr1.cc: Do not use @output_header_name@ unless
14593 b4_defines_flag is set. This fixes two bugs reported by
14594 Tim Van Holder in
161a71f3
PE
14595 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14596 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 14597
b2a836b5
PE
145982003-01-21 Paul Eggert <eggert@twinsun.com>
14599
14600 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14601 we don't need to worry about yyerrlab1 being reported as an
14602 "unused label" by non-GCC C compilers. The downside is that if
14603 locations are used then a couple of statements are duplicated each
14604 time YYERROR is invoked, but the upside is that the warnings
14605 should vanish.
14606 (yyerrlab1): Move code to YERROR.
14607 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14608 This reverts some of the 2002-12-27 change.
14609
4196b931
PE
146102003-01-17 Paul Eggert <eggert@twinsun.com>
14611
14612 * src/output.c (symbol_printers_output): Fix typo that led
14613 to core dump. Problem reported by Antonio Rus in
161a71f3 14614 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 14615
3ae831b4
AD
146162003-01-13 Akim Demaille <akim@epita.fr>,
14617 Quoc Peyrot <chojin@lrde.epita.fr>,
14618 Robert Anisko <anisko_r@lrde.epita.fr>
14619
14620 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14621 when the stacks contain one element, as the loop would otherwise
14622 free the last state, and then use the top state (the one we just
14623 popped). This means that the initial elements will not be freed
14624 explicitly, as is the case in yacc.c; it is not a problem, as
14625 these elements have fake values.
14626
e3aa65c5
PE
146272003-01-11 Paul Eggert <eggert@twinsun.com>
14628
14629 * NEWS: %expect-violations are now just warnings, reverting
14630 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14631 bootstrapping problem reported by Matthias Klose; see
161a71f3 14632 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
14633 * src/conflicts.c (conflicts_print): Likewise.
14634 * tests/conflicts.at (%expect not enough, %expect too much,
14635 %expect with reduce conflicts): Likewise.
14636 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14637 that the warning is enabled if the number of conflicts changes
14638 (not necessarily increases).
14639
14640 * src/getargs.c (version): Update copyright year.
14641
f0057011
AD
146422003-01-09 Akim Demaille <akim@epita.fr>
14643
14644 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14645
1ee6d2a0
PE
146462003-01-08 Paul Eggert <eggert@twinsun.com>
14647
14648 * Makefile.maint (WGETFLAGS):
14649 New macro, containing "-C off" to disable proxy caches.
14650 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14651 (rel-check): Use $(WGET) instead of wget.
14652
d4fd77c4
PE
146532003-01-06 Paul Eggert <eggert@twinsun.com>
14654
14655 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14656 the GLR paper of Scott, Johnstone and Hussain.
14657
464c6927
PE
146582003-01-04 Paul Eggert <eggert@twinsun.com>
14659
d600ee67
PE
14660 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14661 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14662 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14663 (EXTRA_LIBRARIES): New var, for liby.a.
14664 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14665 (EXTRA_SCRIPTS): New var, for yacc.
14666
464c6927
PE
14667 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14668 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14669 Problem reported by Nelson H. F. Beebe.
14670
146712003-01-03 Paul Eggert <eggert@twinsun.com>
14672
14673 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14674 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14675 when compiling Bison 1.875's `bitset bset = obstack_alloc
14676 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14677
14678 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14679 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14680 grow to a huge size with typical invocation.
d600ee67 14681
464c6927
PE
14682 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14683 Use the pattern recommended by Autoconf 2.57, except also protect
14684 against double-definition.
14685 * src/system.h: Likewise.
14686 Portability issues reported by Nelson H. F. Beebe.
d600ee67 14687
464c6927
PE
14688 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14689 All uses changed. Provide a definition in both C and C++.
14690 (yytrue, yyfalse): Define even if defined (__cplusplus).
14691
14692 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14693 Reported by Nelson H. F. Beebe.
d600ee67 14694
464c6927
PE
14695 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14696
0f42c7d5
PE
146972003-01-02 Paul Eggert <eggert@twinsun.com>
14698
14699 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14700 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14701 Bug reported by Nelson H. F. Beebe.
14702
dc546b0f
PE
147032003-01-01 Paul Eggert <eggert@twinsun.com>
14704
14705 * Version 1.875.
14706
2c09b6a7
PE
147072002-12-30 Paul Eggert <eggert@twinsun.com>
14708
14709 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14710 Moved here from...
14711 (<INITIAL>","): Here. This causes stray "," to be treated
14712 more uniformly.
14713
dc546b0f 14714 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
14715 last brace in braced code when not in Yacc mode, for compatibility
14716 with Bison 1.35. This resurrects the 2001-12-15 patch to
14717 src/reader.c.
14718
14719 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14720 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14721
535c0f63
PE
147222002-12-28 Paul Eggert <eggert@twinsun.com>
14723
14724 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14725 that of SYM's type. This fixes Debian bug 168069, reported by
14726 Thomas Olsson.
d600ee67 14727
963fcc17
PE
147282002-12-28 Paul Eggert <eggert@twinsun.com>
14729
14730 Version 1.75f.
14731
14732 Switch back to the Yacc style of conflict reports, undoing some
14733 of the 2002-07-30 change.
14734 * doc/bison.texinfo (Understanding): Use Yacc style for
14735 conflict reports. Also, use new way of locating rules.
14736 * src/conflicts.c (conflict_report):
14737 Renamed from conflict_report_yacc, removing the old
14738 'conflict_report'. Translate the entire conflict report at once,
14739 so that we don't assume that "," has the same interpretation in
14740 all languages.
14741 (conflicts_output): Use Yacc-style conflict report for each state,
14742 instead of our more-complicated style.
14743 (conflicts_print): Use Yacc-style conflict report, except print
14744 the input file name when not emulating Yacc.
14745 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14746 Conflicted Reduction, %expect not enough, %expect too much,
14747 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14748 * tests/existing.at (GNU Cim Grammar): Likewise.
14749 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14750
14751 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14752 fatal): Don't invoke fflush; it's not needed and it might even be
14753 harmful for stdout, as stdout might not be open.
14754 * src/reduce.c (reduce_print): Likewise.
14755
b1efe548
PE
147562002-12-27 Paul Eggert <eggert@twinsun.com>
14757
14758 Fix a bug where error locations were not being recorded correctly.
14759 This problem was originally reported by Paul Hilfinger in
161a71f3 14760 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
14761
14762 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14763 top of the location stack's error locations.
14764 (yyerrlab): Set it. When discarding a token, push its location
14765 onto yylerrsp so that we don't lose track of the error's end.
14766 (yyerrlab1): Now is only the target of YYERROR, so that we can
14767 properly record the location of the action that failed. For GCC
14768 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14769 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14770 (yyerrlab2): New label, which yyerrlab now falls through to.
14771 Compute the error's location by applying YYLLOC_DEFAULT to
14772 the locations of all the symbols that went into the error.
14773 * doc/bison.texinfo (Location Default Action): Mention that
14774 YYLLOC_DEFAULT is also invoked for syntax errors.
14775 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14776 Error locations include the locations of all the tokens that were
14777 discarded, not just the last token.
d600ee67 14778
983c5c2c
PE
147792002-12-26 Paul Eggert <eggert@twinsun.com>
14780
b1efe548
PE
14781 * src/files.c: Include quote.h.
14782 (compute_output_file_names): Warn if we detect conflicting
14783 outputs to the same file. This should catch the misunderstanding
14784 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14785
14786 * src/conflicts.c (conflicts_print): If the user specifies
14787 "%expect N", report an error if there are any reduce/reduce
14788 conflicts. This is what the manual says should happen.
14789 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14790 * tests/conflicts.at (%expect with reduce conflicts): New test.
14791
983c5c2c
PE
14792 Don't use m4_include on relative file names, as it doesn't work as
14793 desired if there happens to be a file with that name under ".".
d600ee67 14794
983c5c2c
PE
14795 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14796 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14797 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14798 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14799 * src/output.c (output_skeleton): Use full path names when
14800 specifying a file to include; don't rely on include path, as
14801 it's unreliable when the working file contains a file with
14802 that name.
d600ee67 14803
983c5c2c
PE
148042002-12-25 Paul Eggert <eggert@twinsun.com>
14805
14806 Remove obsolete references to bison.simple and bison.hairy.
14807 Problem mentioned by Aubin Mahe in
161a71f3 14808 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
14809 * data/glr.c: Comment fix.
14810 * doc/bison.1: Remove references. Also, mention "yacc".
14811
14812 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14813 with -g option.
14814
14815 * src/parse-gram.y (declaration): Use enum "report_states" rather
14816 than its numeric value 1.
14817
14818 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14819 opening a new one. This fixes Debian bug 165349, reported by
14820 Bruce Stephens.
14821
23f2d9dc
PE
148222002-12-24 Paul Eggert <eggert@twinsun.com>
14823
14824 Version 1.75e.
14825
14826 * Makefile.maint (cvs-update): Don't assume that the shell
14827 supports $(...), as Solaris sh doesn't.
14828
14829 * src/parse-gram.y (lloc_default): Remove test for empty
14830 nonterminals at the end, since it didn't change the result.
14831
148322002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
14833
14834 If the user does not define YYSTYPE as a macro, Bison now declares it
14835 using typedef instead of defining it as a macro. POSIX requires this.
14836 For consistency, YYLTYPE is also declared instead of defined.
14837
14838 %union directives can now have a tag before the `{', e.g., the
14839 directive `%union foo {...}' now generates the C code
14840 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14841 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14842 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14843 instead of `yyltype'.
14844
14845 `yystype' and `yyltype' are now obsolescent macros instead of being
14846 typedefs or tags; they are no longer documented and will be
14847 withdrawn in a future release.
14848
14849 * data/glr.c (b4_location_type): Remove.
14850 (YYSTYPE): Renamed from yystype.
14851 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14852 (struct YYLTYPE): Renamed from struct yyltype.
14853 (YYLTYPE): Renamed from yyltype.
14854 (yyltype, yystype): New (and obsolescent) macros,
14855 for backward compatibility.
14856 * data/yacc.c: Likewise.
14857
14858 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14859 does not specify a union tag. This is for compatibility with
14860 Solaris 9 yacc.
14861
14862 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14863 const *, since it is now modified by stripping surrounding { }.
14864 (current_braced_code): Remove.
14865 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14866 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14867 trailing " {...}". Now of type <chars>.
14868 (grammar_declaration): Adjust to bundled tokens.
14869 (code_content): Remove; stripping is now done by add_param.
14870 (print_token_value): Print contents of bundled tokens.
14871 (token_name): New function.
14872
14873 * src/reader.h (braced_code, current_braced_code): Remove.
14874 (token_name): New decl.
14875
14876 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14877 token_type, not braced_code code_kind. All uses changed.
14878 (SC_PRE_CODE): New state, for scanning after a keyword that
14879 has (or usually has) an immediately-following braced code.
14880 (token_type): New local var, to keep track of which token type
14881 to return when scanning braced code.
14882 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 14883 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
14884 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14885 instead of returning a token type immediately.
14886 (<INITIAL>"{"): Set token type.
14887 (<SC_BRACED_CODE>"}"): Use it.
14888 (handle_action_dollar, handle_action_at): Now returns bool
14889 indicating success. Fail if ! current_rule; this prevents a core dump.
14890 (handle_symbol_code_dollar, handle_symbol_code_at):
14891 Remove; merge body into caller.
14892 (handle_dollar, handle_at): Complain in invalid contexts.
14893
14894 * NEWS, doc/bison.texinfo: Document the above.
14895 * NEWS: Fix years and program names in copyright notice.
14896
879ca4f8
PE
148972002-12-17 Paul Eggert <eggert@twinsun.com>
14898
14899 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14900 Reporting, Table of Symbols): Omit mentions of %lex-param and
14901 %parse-param from the documentation for now.
14902
1c5fe69d
PE
149032002-12-15 Paul Eggert <eggert@twinsun.com>
14904
14905 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14906 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14907 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
14908 disagreed with the Bison documentation. Bug
14909 reported by Andrew Walrond.
d600ee67 14910
1c5fe69d
PE
14911 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14912 as the caller now does that.
14913 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14914 (YYEMPTY): Parenthesize right hand side, since others use it.
14915 (yyparse): Don't assume that our generated code is the only code
14916 that sets yychar.
14917
d1de5372
PE
149182002-12-13 Paul Eggert <eggert@twinsun.com>
14919
14920 Version 1.75d.
14921
14922 POSIX requires a "yacc" command.
14923 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14924 (MOSTLYCLEANFILES): Add yacc.
14925 (yacc): New rule.
1c5fe69d 14926 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
14927 as an alias for bison y.
14928
14929 * po/LINGUAS: Add da.
d600ee67 14930
d1de5372
PE
14931 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14932 problem with latest <getopt.h>.
14933 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14934
14935 * doc/fdl.texi: Upgrade to 1.2.
14936 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14937 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14938 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14939 gnulib.
14940 * config/install-sh: Sync with autotools.
14941
14942 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 14943 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
14944 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
14945 locations are requested.
14946 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
14947 locations are requested.
14948
d0f3fe23
PE
149492002-12-12 Paul Eggert <eggert@twinsun.com>
14950
14951 Remove unportable casts and storage allocation tricks.
14952 While we're at it, remove almost all casts, since they
14953 usually aren't needed and are a sign of trouble.
14954
14955 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
14956
14957 * src/derives.c (derives_compute): Do not subtract NTOKENS from
14958 the pointer DSET returned by malloc; this isn't portable.
14959 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
14960 Similarly for DERIVES.
14961 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
14962 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
14963 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
14964
14965 * src/derives.c (derives_compute): Do not bother invoking
14966 int_of_rule_number, since rule numbers are integers.
14967
14968 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
14969 rather than XMALLOC (char, N).
14970
14971 * src/files.c (filename_split): Rewrite to avoid cast.
14972
14973 * src/gram.h (symbol_number_as_item_number,
14974 item_number_as_symbol_number, rule_number_as_item_number,
14975 item_number_as_rule_number):
14976 Now inline functions rather than macros, to avoid casts.
14977 * src/state.h (state_number_as_int): Likewise.
14978 * src/tables.c (state_number_to_vector_number,
14979 symbol_number_to_vector_number): Likewise.
14980
14981 * src/gram.h (int_of_rule_number): Remove; no longer used.
14982
14983 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
14984 since the resulting storage is always stored into.
14985
14986 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
14987 where it's needed.
14988
14989 * src/muscle_tab.c (muscle_m4_output):
14990 Now inline. Return bool, not int.
14991 * src/state.c (state_compare): Likewise.
14992 * src/symtab.c (symbol_check_defined,
14993 symbol_check_alias_consistency, symbol_pack, symbol_translation,
14994 hash_compare_symbol, hash_symbol):
14995 Likewise.
14996 * src/uniqstr.c (uniqstr_print): Likewise.
14997 * src/muscle_tab.c (muscle_m4_output_processor):
14998 New function, to avoid casts.
14999 * src/state.c (state_comparator, stage_hasher): Likewise.
15000 * src/symtab.c (symbol_check_defined_processor,
15001 symbol_check_alias_consistency_processor, symbol_pack_processor,
15002 symbol_translation_processor, hash_symbol_comparator,
15003 hash_symbol_hasher): Likewise.
15004 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15005 * src/muscle_tab.c (muscles_m4_output):
15006 Use new functions instead of casting old functions unportably.
15007 * src/state.c (state_hash_new): Likewise.
15008 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15009 symbols_token_translations_init):
15010 Likewise.
15011 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15012
15013 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15014 var instead of casting to long, to avoid casts.
15015 (prepare_states): Use MALLOC rather than alloca, so that we don't
15016 have to worry about alloca.
15017 * src/state.c (state_hash_lookup): Likewise.
15018
15019 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15020 local var instead of casting to unsigned char, to avoid casts.
15021
15022 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15023 STATE_ALLOC): Remove.
15024 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15025 rather than calloc, and use offsetof to avoid allocating slightly
15026 too much storage.
15027 (state_new): Initialize all members.
15028
15029 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15030
15031 * src/symtab.c (symbol_free): Remove; unused.
15032 (symbol_get): Remove cast in lhs of assignment.
15033 (symbols_do): Now static. Accept generic arguments, not
15034 hashing-related ones.
15035
15036 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15037 (symbol_processor): Remove.
15038 (symbols_do): Remove decl; now static.
15039
15040 * src/system.h (alloca): Remove; decl no longer needed.
15041 (<stddef.h>): Include, for offsetof.
15042 (<inttypes.>, <stdint.h>): Include if available.
15043 (uintptr_t): New type, if system lacks it.
15044 (CALLOC, MALLOC, REALLOC): New macros.
15045 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15046 new macros.
15047
15048 * src/tables.c (table_size): Now int, to pacify GCC.
15049 (table_grow, table_ninf_remap): Use signed table size.
15050 (save_row): Don't bother initializing locals when not needed.
15051 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15052 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15053
15054 * src/vcg.h: Correct misspellings.
15055
15056 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15057
15058
15059 * src/getargs.c (getargs): Don't assume EOF == -1.
15060
26b4a969
PE
150612002-12-09 Paul Eggert <eggert@twinsun.com>
15062
15063 Change identifier spellings to avoid collisions with names
15064 that are reserved by POSIX.
15065
15066 Don't use names ending in _t, since POSIX reserves them.
15067 For consistency, remove _e and _s endings -- they're weren't
15068 needed to remove ambiguity. All uses changed.
15069 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15070 turn was just renamed from struniq_t.
15071 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15072 which in turn was just renamed from struniq_processor_t.
15073 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15074 in turn was renamed from hash_compare_struniq_t.
15075 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15076 (state_list): Renamed from state_list_t.
15077 * src/assoc.h (assoc): Renamed from assoc_t.
15078 * src/conflicts.c (enum conflict_resolution): Renamed from
15079 enum conflict_resolution_e.
15080 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15081 (rule_list): Renamed from rule_list_t.
15082 * src/getargs.h (enum trace): Renamed from enum trace_e.
15083 (enum report): Renamed from enum report_e.
15084 * src/gram.h (item_number): Renamed from item_number_t.
15085 (rule_number): Renamed from rule_number_t.
15086 (struct rule_s): Remove the "rule_s" part; not used.
15087 (rule): Renamed from rule_t.
15088 (rule_filter): Renamed from rule_filter_t.
15089 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15090 (goto_list): Renamed from goto_list_t.
15091 * src/lalr.h (goto_number): Renamed from goto_number_t.
15092 * src/location.h (location): Renamed from location_t.
15093 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15094 and moved here from:
15095 * src/muscle_tab.h (muscle_entry_t): here.
15096 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15097 (rule_list): Renamed from rule_list_t.
15098 * src/print_graph.c (static_graph): Renamed from graph.
15099 * src/reader.h (braced_code): Renamed from braced_code_t.
15100 Remove brace_code_e tag.
15101 * src/relation.h (relation_node): Renamed from relation_node_t.
15102 (relation_nodes): Renamed from relation_nodes_t.
15103 (relation): Renamed from relation_t.
15104 * src/state.h (state_number): Renamed from state_number_t.
15105 (struct state): Renamed from struct state_s.
15106 (state): Renamed from state_t.
15107 (transitions): Renamed from transitions_t. Unused (and
15108 misspelled) transtion_s tag removed.
15109 (errs): Renamed from errs_t. Unused errs_s tag removed.
15110 (reductions): Renamed from reductions_t. Unused tag
15111 reductions_s removed.
15112 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15113 (struct symbol_list): Renamed from struct symbol_list_s.
15114 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15115 (struct symbol): Renamed from struct symbol_s.
15116 (symbol): Renamed from symbol_t.
15117 * src/tables.c (vector_number): Renamed from vector_number_t.
15118 (action_number): Renamed from action_t.
15119 * src/tables.h (base_number): Renamed from base_t.
15120 * src/vcg.h (enum color): Renamed from enum color_e.
15121 (enum textmode): Renamed from enum textmode_e.
15122 (enum shape): Renamed from enum shape_e.
15123 (struct colorentry): Renamed from struct colorentry_s.
15124 (struct classname): Renamed from struct classname_s.
15125 (struct infoname): Renamed from struct infoname_s.
15126 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15127 (enum decision): Renamed from enum decision_e.
15128 (enum orientation): Renamed from enum orientation_e.
15129 (enum alignment): Renamed from enum alignment_e.
15130 (enum arrow_mode): Renamed from enum arrow_mode_e.
15131 (enum crossing_type): Renamed from enum crossing_type_e.
15132 (enum view): Renamed from enum view_e.
15133 (struct node): Renamed from struct node_s.
15134 (node): Renamed from node_t.
15135 (enum linestyle): Renamed from enum linestyle_e.
15136 (enum arrowstyle): Renamed from enum arrowstyle_e.
15137 (struct edge): Renamed from struct edge.
15138 (edge): Renamed from edge_t.
15139 (struct graph): Renamed from struct graph_s.
15140 (graph): Renamed from graph_t.
15141 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15142 Rename value_t -> value.
15143 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15144 value_t_as_yystype -> value_as_yystype.
15145
15146 Don't include <errno.h> in the mainstream code, since it
15147 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15148 * lib/get-errno.c, lib/get-errno.h: New files.
15149 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15150 get-errno.c.
15151 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15152 * src/output.c (output_skeleton): Likewise.
15153 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15154 instead of errno.
15155 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15156 Likewise.
15157 (handle_action_dollar, handle_action_at): Likewise.
15158 * src/system.h: Do not include <errno.h>.
15159 (TAB_EXT): Renamed from EXT_TAB.
15160 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15161
15162 Avoid str[a-z]*, since <string.h> reserves that name space.
15163 Change all instances of "struniq" in names to "uniqstr", and
15164 likewise for "STRUNIQ" and "UNIQSTR".
15165 * src/uniqstr.c: Renamed from src/struniq.c.
15166 * src/uniqstr.h: Renamed from src/struniq.h.
15167 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15168 * src/files.c (strsuffix): Remove; unused.
15169 (concat2): Renamed from stringappend. Now static.
15170 * src/files.h (strsuffix, stringappend): Remove; unused.
15171 * src/parse-gram.y (<chars>): Renamed from <string>.
15172 (<uniqstr>): Renamed from <struniq>.
15173 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15174 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15175 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15176 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15177 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15178 (N_EXPAND): Renamed from N_STRETCH.
15179
15180 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15181 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15182 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15183 Remove; unused.
15184 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15185 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15186 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15187 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15188 (BASE_MAXIMUM): Renamed from BASE_MAX.
15189 (BASE_MINIMUM): Renamed from BASE_MIN.
15190 (ACTION_MAX): Remove; unused.
15191 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15192 Unnecessary casts removed from above defines.
15193
15194
15195 Fix misspelling in names.
15196 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15197 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15198 G_NODE_ALIGNEMENT.
15199
15200
15201 * lib/timevar.c (timevar_report): Renamed from time_report,
15202 for consistency with other names.
15203 * lib/timevar.h (timevar_report): New decl.
15204 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15205
15206
15207 Sort include-file uses.
15208
15209 Reorder all include files under src to be in the order "system.h".
15210 then the ../lib include files in angle brackets (alphabetized),
15211 then the . include files in double-quotes (alphabetized). Fix
15212 dependency breakages encountered in this process, as follows:
15213 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15214 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15215 * src/state.h: Include "symtab.h".
15216
996b1c7e
PE
152172002-12-08 Paul Eggert <eggert@twinsun.com>
15218
15219 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15220 since this causes problems when __file__ contains character
15221 sequences like "@" that are treated specially by src/scan-skel.l.
15222 Instead, just use the file's basename. This fixes the bug
15223 reported by Martin Mokrejs in
161a71f3 15224 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 15225
e19c4e5d
PE
152262002-12-06 Paul Eggert <eggert@twinsun.com>
15227
15228 Add support for rules that do not have trailing semicolons, as
15229 POSIX requires. Improve the quality of locations in Bison
15230 diagnostics.
26b4a969 15231
e19c4e5d
PE
15232 * src/location.c: Include <quotearg.h>.
15233 (empty_location): Now const.
15234 (location_print): New function. Follow the recommendation of the
15235 GNU Coding Standards for locations that span file boundaries.
15236 * src/location.h: Do not include <quotearg.h>; no longer needed.
15237 (boundary): New type.
15238 (location_t): Use it. This allows locations to span file boundaries.
15239 All member uses changed: file -> start.file or end.file (as needed),
15240 first_line -> start.line, first_column -> start.column,
15241 last_line -> end.line, last_column -> end.column.
15242 (equal_boundaries): New function.
15243 (LOCATION_RESET, LOCATION_STEP): Remove.
15244 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15245 (empty_location): Now const.
15246 (location_print): New decl.
15247 * src/parse-gram.y (lloc_default): New function, which handles
15248 empty locations more accurately.
15249 (YYLLOC_DEFAULT): Use it.
15250 (%token COLON): Remove.
15251 (%token ID_COLON): New token.
26b4a969 15252 (rules): Use it.
e19c4e5d
PE
15253 (declarations, rules): Remove trailing semicolon.
15254 (declaration, rules_or_grammar_declaration):
15255 Allow empty (";") declaration.
15256 (symbol_def): Remove empty actions; no longer needed.
15257 (rules_or_grammar_declaration): Remove trailing semicolon.
15258 (semi_colon.opt): Remove.
15259 * src/reader.h: Include location.h.
15260 (scanner_cursor): New decl.
15261 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15262 rolling our own.
15263 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15264 of *loc.
15265 (STEP): Remove. No longer needed, now that adjust_location does
15266 the work. All uses removed.
15267 (scanner_cursor): New var.
15268 (adjust_location): Renamed from extend_location. It now sets
15269 *loc and adjusts the scanner cursor. All uses changed.
15270 Don't bother testing for CR.
15271 (handle_syncline): Remove location arg; now updates scanner cursor.
15272 All callers changed.
15273 (unexpected_end_of_file): Now accepts start boundary of token or
15274 comment, not location. All callers changed. Update scanner cursor,
15275 not the location.
15276 (SC_AFTER_IDENTIFIER): New state.
15277 (context_state): Renamed from c_context. All uses changed.
15278 (id_loc, code_start, token_start): New local vars.
15279 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15280 processing of Yacc white space and equivalents here.
15281 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15282 instead of returning ID immediately, since we need to search for
15283 a subsequent colon.
15284 (<INITIAL>"'", "\""): Save token_start.
15285 (<INITIAL>"%{", "{", "%%"): Save code_start.
15286 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15287 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15288 BEGIN context_state at end, not INITIAL.
15289 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15290 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15291 Return correct token start.
15292 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15293 the start of a character, string or multiline comment is found.
15294 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15295 Reduction): Adjust reported locations to match the more-precise
15296 results now expected.
15297 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15298 * tests/reduce.at (Useless Rules, Reduced Automaton,
15299 Underivable Rules): Likewise.
15300 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15301 or "|"' now that so many other tokens are allowed by the new grammar.
15302
15303 * src/complain.h (current_file): Remove duplicate decl;
15304 current_file is now owned by files.h.
15305 * src/complain.c, src/scan-gram.l: Include files.h.
15306
153072002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 15308
e19c4e5d
PE
15309 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15310 promotes to int; it might be unsigned int.
15311 * data/yacc.c (yy_reduce_print): Likewise.
15312
15313 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15314 be #defined in the prologue, not in the Bison declarations.
15315 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 15316
b64755e3
PE
153172002-12-02 Paul Eggert <eggert@twinsun.com>
15318
15319 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15320 * lib/strtoul.c: New file, from gnulib.
15321 This fixes a porting bug reported by Peter Klein in
161a71f3 15322 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 15323
6e746484
PE
153242002-11-30 Paul Eggert <eggert@twinsun.com>
15325
b64755e3
PE
15326 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15327 and put only a forward declaration in the prologue. This is for
15328 consistency with the other scanner helper functions.
15329
6ba55592
PE
15330 Type clashes now generate warnings, not errors, since it
15331 appears that POSIX may allow some grammars with type clashes.
15332 * src/reader.c (grammar_current_rule_check): Warn about
15333 type clashes instead of complaining.
15334 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15335
6e746484
PE
15336 Add Yacc library, since POSIX requires it.
15337 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15338 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15339 * lib/main.c, lib/yyerror.c: New files.
15340
15341 gram_error can be static; it need not be extern.
15342 * src/reader.h (gram_error): Remove decl.
15343 * src/parse-gram.y (gram_error): Now static. Add static decl.
15344 (print_token_value): Omit parameter names from forward decl,
15345 for consistency.
15346
88510f9c
PE
153472002-11-29 Paul Eggert <eggert@twinsun.com>
15348
6e746484
PE
15349 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15350 be declared before being used. E.g., one should typically
15351 declare them in the prologue. Use GNU coding style in examples.
15352 Put "const" consistently after the type it modifies. Mention
15353 that C99 supports "inline". Mention that yyerror traditionally
15354 returns "int".
15355
88510f9c
PE
15356 %parse-param and %lex-param now take just one argument, the
15357 declaration; the argument name is deduced from the declaration.
15358
15359 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15360 Reporting, Table of Symbols): Document this.
15361 * src/parse-gram.y (add_param): New function.
15362 (COMMA): Remove.
15363 (declaration): Implement new rule for %parse-param and %lex-param.
15364 * src/scan-gram.l: "," now elicits a warning, rather than being
15365 a token; this is more compatible with byacc.
15366 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15367
bb92250c
PE
153682002-11-27 Paul Eggert <eggert@twinsun.com>
15369
15370 Rename identifiers to avoid real and potential collisions.
15371
15372 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15373 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 15374 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
15375 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15376 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15377 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15378 All uses changed.
15379 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15380 The name "yycontrol" violates the name space rules, and this stuff
15381 wasn't being used anyway.
15382 (input): Remove action; this stuff wasn't being used.
15383 (gram_error): Rename local variable yylloc -> loc.
15384 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15385 (YY_DECL): Don't use "yy" at start of local variables.
15386 All uses changed, e.g., yylloc -> loc.
15387 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15388 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15389 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15390 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15391
15392 * src/parse-gram.y (gram_error): loc is now const *.
15393 * src/reader.h (gram_error): Likewise.
15394
3af4feb2
PE
153952002-11-24 Paul Eggert <eggert@twinsun.com>
15396
15397 Version 1.75c.
15398
15399 * tests/actions.at (Actions after errors): Use an output format
15400 more similar to that of the Printers and Destructors test.
15401 Test the position of the ';' token too.
15402 (Printers and Destructors): Likewise.
15403 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15404 unnecessarily alarming people when the test fails.
15405
15406 * data/yacc.c (yyerrlab1): Move this label down, so that the
15407 parser does not discard the lookahead token if the user code
15408 invokes YYERROR. This change is required for POSIX conformance.
15409
15410 * lib/error.c: Sync with gnulib.
15411
154122002-11-22 Paul Eggert <eggert@twinsun.com>
15413
15414 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15415 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15416 * lib/xmalloc.c: Likewise.
26b4a969 15417
58004308
PE
154182002-11-20 Paul Eggert <eggert@twinsun.com>
15419
15420 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15421
154222002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 15423
58004308
PE
15424 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15425 should use `if (! x) abort ();' rather than `assert (x);', and
15426 anyway it's one less thing to worry about configuring.
15427
15428 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15429 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15430 and replace all instances of assert with abort.
15431 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15432 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15433
15434 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15435 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15436 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15437 hash_find_entry, hash_rehash, hash_insert): Likewise.
15438 * src/conflicts.c (resolve_sr_conflict): Likewise.
15439 * src/lalr.c (set_goto_map, map_goto): Likewise.
15440 * src/nullable.c (nullable_compute): Likewise.
15441 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15442 * src/reader.c (packgram, reader): Likewise.
15443 * src/state.c (state_new, state_free, state_transitions_set,
15444 state_reduction_find): Likewise.
15445 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15446 symbol_pack): Likewise.
15447 * src/tables.c (conflict_row, pack_vector): Likewise.
15448 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15449 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15450 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15451 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15452
15453 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15454 (ARGMATCH_CONSTRAINT): New macro.
15455 (ARGMATCH_ASSERT): Use it.
15456
15457 * src/system.h (verify): New macro.
15458 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15459 rather than assert.
15460 * src/tables.c (tables_generate): Likewise.
15461
15462 * src/struniq.c (struniq_assert): Now returns void, and aborts
15463 if the assertion is false.
15464 (struniq_assert_p): Remove.
15465 * src/struniq.h: Likewise.
15466
76ae8198
PE
154672002-11-18 Paul Eggert <eggert@twinsun.com>
15468
15469 * data/glr.c (yygetLRActions): Replace `yyindex' with
15470 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15471 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 15472 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 15473
d3c4e709
AD
154742002-11-18 Akim Demaille <akim@epita.fr>
15475
15476 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15477 space.
15478 From Tim Van Holder.
15479
8d8a7238
PE
154802002-11-17 Paul Eggert <eggert@twinsun.com>
15481
15482 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15483 to "SyntaxError" for consistency with my 2002-11-15 change.
15484
15485 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15486 not define to {}, since this breaks the common use of `YYDPRINTF
15487 ((...));' if a single statement is desired (e.g. before `else').
15488 Work around GCC warnings by surrounding corresponding calls with
15489 {} if needed.
15490 (yyhasResolvedValue): Remove unused function.
15491 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15492 loop body.
15493 (yyreportSyntaxError): Renamed from yyreportParseError.
15494 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15495 All uses changed.
15496 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15497 extern when possible. Remove unused initializations.
15498
b0937b22
AD
154992002-11-16 Akim Demaille <akim@epita.fr>
15500
15501 Augment the similarity between GLR and LALR traces.
15502
15503 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15504 (YY_REDUCE_PRINT): New.
15505 (yyparse): Use them.
15506 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15507 YYDPRINT here.
15508 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15509 state reached after the reduction/recovery, since...
15510 (yyparse, yyprocessOneStack): Report the state we are entering in.
15511
c5e3e510
AD
155122002-11-16 Akim Demaille <akim@epita.fr>
15513
15514 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15515 Add support for --trace=skeleton.
15516 * src/scan-skel.l: %option debug.
15517 Scan strings of non-@ or \n instead of character by character.
15518 (scan_skel): Handle trace_skeleton.
15519 (QPUTS): New.
15520 (@output_parser_name@, @output_header_name@): ``Restore'' their
15521 support (used to be M4 macros).
15522 * data/yacc.c: Quote larger chunks, a la glr.c.
15523 * data/lalr1.cc: Likewise.
15524 The header guards are no longer available, so use some other
15525 string than `YYLSP_NEEDED'.
15526
4c6cc1db
AD
155272002-11-16 Akim Demaille <akim@epita.fr>
15528
15529 Make the ``Printers and Destructors'' test more verbose, taking
15530 `yacc.c''s behavior as (possibly wrong) reference.
15531
15532 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15533 instead of fprint on stdout.
15534 Set and report the last_line of the symbols.
15535 Consistently display values and locations.
15536
6d9e8019
PE
155372002-11-16 Paul Eggert <eggert@twinsun.com>
15538
15539 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15540
6e649e65
PE
155412002-11-15 Paul Eggert <eggert@twinsun.com>
15542
b25d88f6
PE
15543 * tests/actions.at (Actions after errors): New test case.
15544
6e649e65
PE
15545 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15546 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15547 tests/action.at, tests/calc.at, tests/conflicts.at,
15548 tests/cxx-type.at, tests/regression.at:
15549 "parse error" -> "syntax error" for POSIX compatibility.
15550 "parsing stack overflow..." -> "parser stack overflow" so
15551 that code matches Bison documentation.
15552
0f39aab9
AD
155532002-11-15 Akim Demaille <akim@epita.fr>
15554
15555 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15556 take two BRACED_CODE, not two string_content.
15557 Free the scanner's obstack when we are done.
15558 (code_content): New.
15559 * tests/calc.at: Adjust.
15560 * doc/bison.texinfo: Adjust.
15561 Also, make sure to include the `,' for these declarations.
15562
761c1926
AD
155632002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15564
15565 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15566 definition; avoids potential autoreconf problems.
15567
b0f98b10
AD
155682002-11-15 Akim Demaille <akim@epita.fr>
15569
15570 Always check the value returned by yyparse.
15571
15572 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15573 returned by yyparse.
15574 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15575 Adjust calls.
15576 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15577 returned by yyparse.
15578
970785f1
PH
155792002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15580
15581 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15582 on input.at test.
15583
8fcc7db1
PE
155842002-11-14 Paul Eggert <eggert@twinsun.com>
15585
7ec1b48e
PE
15586 * src/output.c (output_skeleton): Call xfopen instead of
15587 duplicating xfopen's body.
15588
cfff7583 15589 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 15590 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 15591
8fcc7db1
PE
15592 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15593 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15594 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15595 file twice in the grammar, as an extra check.
15596
15597 * tests/input.at (Torturing the Scanner): Surround the
15598 backslash-newline tests with "#if 0", to make it less likely that
15599 we'll run into compiler bugs. Bring back solitary \ inside
15600 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 15601 test backslash-newline in C character constant.
8fcc7db1 15602
4e8d992c
AD
156032002-11-14 Akim Demaille <akim@epita.fr>
15604
15605 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15606 status of the compiler.
f32b346d 15607 Calling `exit 1' is no longer needed.
4e8d992c
AD
15608 Reported by Nelson H. F. Beebe.
15609
9501dc6e
AD
156102002-11-14 Akim Demaille <akim@epita.fr>
15611
15612 * tests/atlocal.in (CPPFLAGS): We have config.h.
15613 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15614 New.
15615 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15616 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15617 * tests/regression.at, tests/torture.at: Use them for all the
15618 grammars that are to be compiled.
15619 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15620 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15621 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15622
18b519c0
AD
156232002-11-14 Akim Demaille <akim@epita.fr>
15624
15625 * doc/bison.texinfo: Various formatting changes (alignments in
15626 samples, additional @group/@end group, GCS in samples.
15627 Use @deffn instead of simple @table to define the directives,
15628 macros, variables etc.
15629
9a86cdb9
PE
156302002-11-13 Paul Eggert <eggert@twinsun.com>
15631
daa33def 15632 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 15633 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 15634
daa33def 15635 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 15636 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
15637 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15638 * tests/headers.at (export YYLTYPE): Likewise.
15639
15640 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 15641 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 15642
9a86cdb9
PE
15643 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15644 comments, since they're not portable. Use GNU coding style.
15645
9c1e26bd
AD
156462002-11-13 Akim Demaille <akim@epita.fr>
15647
15648 * data/yacc.c: Leave bigger chunks of quoted text.
15649 (YYDSYMPRINTF): New.
15650 Use it to report symbol activities.
15651 * data/glr.c (YYDSYMPRINTF): New.
15652 Use it.
15653
87f721cc
PE
156542002-11-12 Paul Eggert <eggert@twinsun.com>
15655
15656 Version 1.75b.
15657
15658 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15659 (yyglrReduce): Return yyok, not 0.
15660 This should avoid the enumerated-type warnings reported
464c6927 15661 by Nelson H. F. Beebe in
161a71f3 15662 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
15663
15664 * lib/bbitset.h (BITSET_INLINE): Remove.
15665 * lib/bitset.h [! BITSET_INLINE]: Remove.
15666 (bitset_set, bitset_reset, bitset_test): Rename local vars
15667 to avoid shadowing warnings by GCC.
15668
15669 * data/glr.c (inline): Remove #define. It's the user's
15670 responsibility to #define it away, just like 'const'.
464c6927 15671 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 15672 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 15673
87f721cc
PE
15674 * Makefile.maint (po-check): Scan .l and .y files instead of the
15675 .c and the .h files that they generate. This fixes the bug
15676 reported by Tim Van Holder in:
161a71f3 15677 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
15678 Look for N_ as well as for _. Try to avoid matching #define for
15679 N_ and _.
15680 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15681 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15682 * src/scan-gram.l: Revamp regular expressions so that " and '
15683 do not confuse xgettext.
15684
15685 * src/struniq.h (struniq_new): Do not declare the return type
15686 to be 'const'; this violates the C standard.
15687 * src/struniq.c (struniq_new): Likewise.
15688
be14ade5
AD
156892002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15690
15691 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15692 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15693 linker.
15694
05291fbc
AD
156952002-11-12 Akim Demaille <akim@epita.fr>
15696
15697 * Makefile.maint: Sync with Autoconf:
15698 (local_updates): New.
15699
1f5fd52e
AD
157002002-11-12 Akim Demaille <akim@epita.fr>
15701
15702 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15703
283f1e64
AD
157042002-11-12 Akim Demaille <akim@epita.fr>
15705
15706 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15707 locations.
15708
886b69d1
AD
157092002-11-12 Akim Demaille <akim@epita.fr>
15710
15711 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15712 not yyvalue.
15713
3df37415
AD
157142002-11-12 Akim Demaille <akim@epita.fr>
15715
15716 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15717 Use it to test the GLR parser.
15718
7bd6c77e
AD
157192002-11-12 Akim Demaille <akim@epita.fr>
15720
15721 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15722 defines it.
15723 * data/glr.c (yystos): New.
15724 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15725 (YYDSYMPRINT): New.
15726 (yyval): Don't define it, it is handled via M4.
15727 (yyrecoverParseError): Free verbosely the discarded symbols.
15728 * data/yacc.c (yysymprint): Remove, rather...
15729 (b4_yysymprint_generate): invoke.
15730 * data/c.m4 (b4_yysymprint_generate): New.
15731 Accept pointers as arguments, as opposed to the version from
15732 yacc.c.
15733 (b4_yydestruct_generate): Likewise.
15734 * tests/cations.at (Printers and Destructors): Use Bison directives
15735 instead of CPP macros.
15736 Don't rely on internal details.
15737
b0400cc6
AD
157382002-11-12 Akim Demaille <akim@epita.fr>
15739
15740 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15741 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15742 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15743 it against YYEMPTY and so forth), work on yytoken (i.e., set
15744 it to YYEMPTY etc.).
15745 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15746 (b4_symbol_actions): Remove.
15747 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15748 for 0, end-of-input.
15749
72f889cc
AD
157502002-11-12 Akim Demaille <akim@epita.fr>
15751
15752 * doc/bison.texinfo (Destructor Decl): New.
15753
b1ae9233
AD
157542002-11-12 Akim Demaille <akim@epita.fr>
15755
15756 * src/tables.c (tables_generate): Use free for pointers that
15757 cannot be NULL, not XFREE.
15758 (pack_vector): Use assert, not fatal, for bound violations.
15759 * src/state.c (state_new): Likewise.
15760 * src/reader.c (reader): Likewise.
15761 * src/lalr.c (set_goto_map): Likewise.
72f889cc 15762 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
15763 the file name.
15764
7ec2d4cd
AD
157652002-11-12 Akim Demaille <akim@epita.fr>
15766
15767 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15768 Restore.
15769 * src/scan-gram.l (last_string): Is global to the file, not to
15770 yylex.
15771 * src/parse-gram.y (input): Don't append the epilogue here,
15772 (epilogue.opt): do it here, and free the scanner's obstack.
15773 * src/reader.c (epilogue_set): Rename as...
15774 (epilogue_augment): this.
15775 * data/c.m4 (b4_epilogue): Defaults to empty.
15776
573a6cd3
AD
157772002-11-12 Akim Demaille <akim@epita.fr>
15778
15779 * src/getargs.c (long_options): Remove duplicates.
15780 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15781 Remove.
15782 * doc/bison.rnh: Remove.
15783 * doc/bison.texinfo (VMS Invocation): Remove.
15784
95612cfa
AD
157852002-11-12 Akim Demaille <akim@epita.fr>
15786
15787 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15788 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15789
15790 Use struniq for symbols.
15791
15792 * src/symtab.h (symbol_t): The tag member is a struniq.
15793 (symbol_type_set): Adjust.
15794 * src/symtab.c (symbol_new): Takes a struniq.
15795 (symbol_free): Don't free the tag member.
15796 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15797 (hash_compare_symbol, hash_symbol): these.
15798 Use the fact that tags as struniqs.
15799 (symbol_get): Use struniq_new.
15800 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15801 Returns a strniq.
15802 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15803 and type members are struniqs.
15804 * src/reader.c (get_merge_function)
15805 (grammar_current_rule_merge_set): Adjust.
15806 (TYPE, current_type): Are struniq.
15807
15808 Use struniq for file names.
15809
15810 * src/files.h, src/files.c (infile): Split into...
15811 (grammar_file, current_file): these.
15812 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15813 * src/reduce.c (reduce_print): Likewise.
15814 * src/getargs.c (getargs): Likewise.
15815 * src/complain.h, src/complain.c: Likewise.
15816 * src/main.c (main): Call struniqs_new early enough to use it for
15817 file names.
15818 Don't free the input file name.
15819
3e6656f9
AD
158202002-11-12 Akim Demaille <akim@epita.fr>
15821
15822 * src/symtab.c (symbol_free): Remove dead deactivated code:
15823 type_name are properly removed.
15824 Don't use XFREE to free items that cannot be NULL.
15825 * src/struniq.h, src/struniq.c: New.
15826 * src/main.c (main): Initialize/free struniqs.
15827 * src/parse-gram.y (%union): Add astruniq member.
15828 (yyprint): Adjust.
15829 * src/scan-gram.l (<{tag}>): Return a struniq.
15830 Free the obstack bit that used to store it.
15831 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15832
7672019c
PE
158332002-11-11 Paul Eggert <eggert@twinsun.com>
15834
15835 Revamp to fix many (but not all) of the C- and M4-related quoting
15836 problems. Among other things, this fixes the Bison bug reported
15837 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 15838 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
15839
15840 Use new @ escapes consistently. Represent brackets with @{ and @}
15841 rather than @<:@ and @:>@, since this works a bit better with dumb
15842 editors like vi. Represent @ with @@, since @ is now consistently
15843 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15844 __ofile__, to avoid unexpected expansions. Similarly, use @output
15845 rather than #output.
15846
15847 * data/c.m4 (b4_copyright): Omit file name from comment, since
15848 the file name could contain "*/".
15849 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15850 be quoted. All uses changed.
15851
15852 * data/glr.c: Use new @ escapes consistently.
15853 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15854 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15855 Remove, since they couldn't handle arbitrary characters in file
15856 names.
15857 * data/lalr1.cc: Likewise.
15858 * data/yacc.c: Likewise.
15859
15860 * src/files.c (output_infix): Remove; all uses removed.
15861 * src/files.h: Likewise.
15862
15863 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15864 mishandled funny characters in file names, and anyway it isn't
15865 needed any more.
15866 * data/yacc.c: Likewise.
15867 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15868
15869 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15870 * data/yacc.c: Likewise.
15871
15872 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15873 strings now.
15874 (muscle_init): Quote filename as a C string.
15875 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15876 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15877 * src/output.c (escaped_file_name_output): New function.
15878 (prepare_symbols): Quote tokens for M4.
15879 (prepare): Don't insert output_infix, output_prefix,
15880 output_parser_name, output_header_name; this is now down by scan-skel.
15881 Insert skeleton as a C string.
15882
15883 * src/output.c (user_actions_output, symbol_destructors_output,
15884 symbol_printers_output): Quote filenames for C and M4.
15885 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15886
15887 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15888 escapes other than \\ and \'; this simplifies the code.
15889 (<SC_STRING>): Likewise, for \\ and \".
15890 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15891 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15892 Use new escapes @{ and @} for [ and ].
15893
15894 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15895 them with auto vars.
15896 Switch to new escape scheme, where @ is the escape character uniformly.
15897 Abort if a stray escape character is found. Avoid unbounded input
15898 buffer when parsing non-escaped text.
15899
15900 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15901 __oline__, #output, $@, and @{ do not have unintended meanings.
15902
acea4f3b
PE
159032002-11-09 Paul Eggert <eggert@twinsun.com>
15904
15905 Fix the test failure due to GCC warnings described in
161a71f3 15906 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
15907 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15908 evaluate to 0 if it's impossible for NINF to be in the respective
15909 table.
15910 (yygetLRActions, yyrecoverParseError): Use them.
15911
15912 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15913 counted in the token inserted at end of file. Now takes
15914 location_t *, not location_t, so that the location can be
15915 adjusted. All uses changed.
15916
15917 * tests/regression.at (Invalid inputs): Adjust wording in
15918 diagnostic to match the new behavior.
15919
15920 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15921 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15922 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15923 abort ();'. This reduces the runtime of the "Many lookaheads"
15924 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15925 GCC 3.2.
15926
20ef1ad5
PE
159272002-11-07 Paul Eggert <eggert@twinsun.com>
15928
15929 * src/parse-gram.y (CHARACTER): Remove unused token.
15930 All uses removed.
15931
15932 * src/scan-gram.l: Remove stack option. We no longer use the
15933 stack, since the stack was never deeper than 1; instead, use the
15934 new auto var c_context to record the stacked value.
15935
15936 Remove nounput option. At an unexpected end of file, we now unput
15937 the minimal input necessary to end cleanly; this simplifies the
15938 code.
15939
15940 Avoid unbounded token sizes where this is easy.
15941
15942 (unexpected_end_of_file): New function.
15943 Use it to systematize the error message on unexpected EOF.
15944 (last-string): Now auto, not static.
15945 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
15946 (scanner_last_string_free): Remove; not used.
15947 (percent_percent_count): Move decl to just before use.
15948 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
15949 not the (never otherwised-used) CHARACTER.
15950
93724f13
AD
159512002-11-07 Akim Demaille <akim@epita.fr>
15952
15953 Let yyerror always receive the msg as last argument, so that
15954 yyerror can be variadic.
15955
15956 * data/yacc.c (b4_yyerror_args): New.
15957 Use it when calling yyerror.
15958 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
15959 Use it when calling yyerror.
15960 * doc/bison.texinfo (Error Reporting): Adjust.
15961 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
15962 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
15963
6e40b4eb
AD
159642002-11-06 Akim Demaille <akim@epita.fr>
15965
15966 #line should have quoted strings.
15967 Ideally, this should be done by m4_quotearg.
15968
15969 * src/scan-skel.l: Include quotearg.h.
15970 Quote __ofile__.
15971 * src/output.c (symbol_printers_output)
15972 (symbol_destructors_output): Quote the file name.
15973
2dfbfc12
AD
159742002-11-06 Akim Demaille <akim@epita.fr>
15975
15976 * tests/regression.at (Invalid inputs): Adjust to the recent
15977 messages.
15978
437c2d80
AD
159792002-11-06 Akim Demaille <akim@epita.fr>
15980
15981 Restore --no-lines.
15982 Reported by Jim Kent.
15983
15984 * data/c.m4 (b4_syncline): New.
15985 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
15986 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
15987 * src/output.c (user_actions_output): Likewise.
15988 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 15989 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 15990
900c5db5
AD
159912002-11-06 Akim Demaille <akim@epita.fr>
15992
15993 * src/main.c (main): Free `infile'.
15994 * src/scan-gram.l (handle_syncline): New.
15995 Recognize `#line'.
15996 * src/output.c (user_actions_output, symbol_destructors_output)
15997 (symbol_printers_output): Use the location's file name, not
15998 infile.
15999 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16000
e183b123 160012002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 16002
e183b123 16003 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 16004 either has GLR conflict entries.
e183b123 16005
193eb6b7
PE
160062002-11-05 Paul Eggert <eggert@twinsun.com>
16007
e183b123
PE
16008 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16009 "integer out of range" rather than "invalid value".
16010 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16011 accordingly.
16012
193eb6b7
PE
16013 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16014 Also, remove one static variable in the scanner.
16015
16016 * src/scan-gram.l (braces_level): Now auto, not static.
16017 Initialize to zero if the compiler is being picky.
16018 (INITIAL): Clear braces_level instead of incrementing it.
16019 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16020 as POSIX 1003.1-2001 requires.
16021 * src/system.h (IF_LINT): New macro, taken from coreutils.
16022 * configure.ac: Define "lint" if --enable-gcc-warnings.
16023
29c01725
AD
160242002-11-05 Akim Demaille <akim@epita.fr>
16025
16026 * src/scan-gram.l: When it starts with `%', complain about the
16027 whole directive, not just that `invalid character: %'.
16028
8aeac3ca
AD
160292002-11-04 Akim Demaille <akim@epita.fr>
16030
16031 * Makefile.maint: Update from Autoconf.
16032 (update, cvs-update, po-update, do-po-update): New.
16033
793a58bb
AD
160342002-11-04 Akim Demaille <akim@epita.fr>
16035
16036 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16037 and yyerror.
16038 Have yyerror `use' its arguments.
16039 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16040 returns true when location & yacc & pure & parse-param.
16041 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16042
c4d720cd
AD
160432002-11-04 Akim Demaille <akim@epita.fr>
16044
16045 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16046 clashes.
16047 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16048 font-lock-mode.
16049 Use complain_at.
16050 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16051 slot 0.
16052
613a0dc5
PE
160532002-11-03 Paul Eggert <eggert@twinsun.com>
16054
16055 * src/reader.c (get_merge_function, grammar_current_rule_check):
16056 Use consistent diagnostics for reporting type name clashes.
16057 Quote the types with <>, for consistency with Yacc.
16058 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16059
2a8d363a
AD
160602002-11-03 Akim Demaille <akim@epita.fr>
16061
16062 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16063 New.
16064 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16065 (b4_parse_param): Remove.
16066 Use b4_identification.
16067 Propagate b4_pure_args where needed to pass them to yyerror.
16068 * data/glr.m4 (b4_parse_param): Remove.
16069 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16070 (b4_lpure_formals): New.
16071 Use b4_identification.
16072 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16073 b4_user_formals and b4_user_args.
16074 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16075 (yyreportAmbiguity): When using a pure parser, also need
16076 the location, and the parse-params.
16077 Adjust callers.
16078 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16079 When using a pure parser, also need the parse-params.
16080 Adjust callers.
16081 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16082 (%pure-parser + %parse-param) LALR and GLR parsers.
16083 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16084 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16085 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16086 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16087 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16088 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16089 * doc/bison.texinfo: Untabify the whole file.
16090 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16091 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16092 (Error Reporting): Adjust to these new directives.
16093 Document %error-verbose, deprecate YYERROR_VERBOSE.
16094
9e32add8
AD
160952002-11-03 Akim Demaille <akim@epita.fr>
16096
16097 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16098 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16099 command line options.
16100 * tests/cxx-type.at: Formatting changes.
16101
b02d90a5
PE
161022002-11-03 Paul Eggert <eggert@twinsun.com>
16103
16104 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16105 to count columns correctly, and to check for invalid inputs.
9e32add8 16106
b02d90a5
PE
16107 Use mbsnwidth to count columns correctly. Account for tabs, too.
16108 Include mbswidth.h.
16109 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16110 (extend_location): New function.
16111 (YY_LINES): Remove.
16112
16113 Handle CRLF in C code rather than in Lex code.
16114 (YY_INPUT): New macro.
16115 (no_cr_read): New function.
16116
16117 Scan UCNs, even though we don't fully handle them yet.
16118 (convert_ucn_to_byte): New function.
16119
16120 Handle backslash-newline correctly in C code.
16121 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16122 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16123 all uses changed.
16124 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16125 Use {splice} wherever C allows backslash-newline.
16126 YY_STEP after space, newline, vertical-tab.
16127 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 16128
b02d90a5
PE
16129 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16130
16131 ({int}, handle_action_dollar, handle_action_at): Check for integer
16132 overflow.
9e32add8 16133
b02d90a5
PE
16134 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16135
16136 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16137 as well as \000. Check for UCHAR_MAX, not 255.
16138 Allow \x with an arbitrary positive number of digits, as in C.
16139 Check for overflow here.
16140 Allow \? and UCNs, for compatibility with C.
16141
16142 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16143 with quote slot used by complain_at.
16144
16145 * tests/input.at: Add tests for backslash-newline, m4 quotes
16146 in symbols, long literals, and funny escapes in strings.
16147
16148 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16149 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16150 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16151 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16152 * m4/mbswidth.m4: New file, from GNU coreutils.
16153
16154 * doc/bison.texinfo (Grammar Outline): Document // comments.
16155 (Symbols): Document that trigraphs have no special meaning in Bison,
16156 nor is backslash-newline allowed.
16157 (Actions): Document that trigraphs have no special meaning.
16158
16159 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16160 no longer used.
16161
161622002-11-02 Paul Eggert <eggert@twinsun.com>
16163
16164 * src/reader.c: Don't include quote.h; not needed.
16165 (get_merge_function): Reword warning to be consistent with
16166 type clash diagnostic in grammar_current_rule_check.
16167
16168 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16169 bug in trigraph handling.
16170
16171 * src/output.c (prepare_symbols): When printing token names,
16172 escape "[" as "@<:@" and likewise for "]".
16173
16174 * src/system.h (errno): Remove declaration, as we are now
16175 assuming C89 or better, and C89 guarantees errno.
16176
762b212b
PE
161772002-10-30 Paul Eggert <eggert@twinsun.com>
16178
16179 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16180 Check for close failures.
16181 * src/files.h (xfclose): Return void, not int, since it always
16182 returned zero.
16183 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16184 indicates one.
16185 * src/output.c (output_skeleton): Use xfclose rather than fclose
16186 and ferror. xfclose now checks ferror.
16187
16188 * data/glr.c (YYLEFTMOST_STATE): Remove.
16189 (yyreportTree): Use a stack-based leftmost state. This avoids
16190 our continuing battles with bogus warnings about initializers.
16191
56100c60
AD
161922002-10-30 Akim Demaille <akim@epita.fr>
16193
16194 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16195 #if.
16196
51b4a04c
PH
161972002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16198
16199 * tests/glr-regr1.at: New test for reported regressions.
16200 * tests/testsuite.at: Add glr-regr1.at test.
16201 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 16202
bf1ebda2
PE
162032002-10-24 Paul Eggert <eggert@twinsun.com>
16204
5c16c6b1
PE
16205 Version 1.75a.
16206
bf1ebda2
PE
16207 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16208 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16209 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16210 Don't assume strdup exists; POSIX says its an XSI extension.
16211 Check for buffer overflow on input.
16212
b526ee61
AD
162132002-10-24 Akim Demaille <akim@epita.fr>
16214
16215 * src/output.c (output_skeleton): Don't disable M4sugar comments
16216 too soon: it results in comments being expanded.
16217 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16218 first output.
16219
f1886bb2
AD
162202002-10-24 Akim Demaille <akim@epita.fr>
16221
16222 * data/yacc.c (m4_int_type): New.
16223 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16224 char' as only yacc.c wants K&R portability.
16225 * data/glr.c (yysigned_char): Remove.
16226 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16227 Reported by Quoc Peyrot.
16228
c5576256
PE
162292002-10-23 Paul Eggert <eggert@twinsun.com>
16230
16231 * src/main.c (main): With --trace=time, report times even if a
16232 non-fatal error occurs. Formerly, the times were reported in some
16233 such cases but not in others.
16234 * src/reader.c (reader): Just return if a complaint has been issued,
16235 instead of exiting, so that 'main' can report times.
16236
27b0ffea
AD
162372002-10-22 Akim Demaille <akim@epita.fr>
16238
16239 * src/system.h: Include sys/types.
16240 Reported by Bert Deknuydt.
16241
223a7883
PE
162422002-10-23 Paul Eggert <eggert@twinsun.com>
16243
16244 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16245 Suggested by Art Haas.
16246
162472002-10-22 Paul Eggert <eggert@twinsun.com>
16248
16249 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16250 decl; not needed any more.
16251 * src/main.c (main): Use return to exit, undoing yesterday's change.
16252 The last OS that we could find where this wouldn't work is
16253 SunOS 3.5, and that's too old to worry about now.
16254
16255 * data/glr.c (struct yyltype): Define members even when not
16256 doing locations. This is more consistent with yacc.c, and it
16257 works around the following bug reports:
161a71f3
PE
16258 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16259 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 16260
223a7883
PE
16261 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16262 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16263 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16264
8b76775a
AD
162652002-10-22 Akim Demaille <akim@epita.fr>
16266
16267 * data/README: New.
16268
6db10d14
PE
162692002-10-21 Paul Eggert <eggert@twinsun.com>
16270
16271 Be consistent about 'bool'; the old code used an enum in one
16272 module and an int in another, and this violates the C standard.
16273 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16274 * configure.ac (AC_HEADER_STDBOOL): Add.
16275 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16276 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16277 * src/symtab.c (hash_compare_symbol_t): Likewise.
16278 * src/system.h (bool, false, true): Use a definition consistent
16279 with ../lib/hash.c. All uses changed.
16280
16281 * src/complain.c (warning_issued): Renamed from warn_message_count,
16282 so that we needn't worry about integer overflow (!).
16283 Now of type bool. All uses changed.
16284 (complaint_issued): Renamed from complain_message_count; likewise.
16285
16286 * src/main.c (main): Use exit to exit with failure.
27b0ffea 16287
6db10d14
PE
16288 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16289 rather than 1 and 0.
16290 * src/main.c (main): Likewise.
16291 * src/getargs.c (getargs): Likewise.
16292 * src/reader.c (reader): Likewise.
16293
16294 * src/getarg.c (getargs): Remove duplicate code for
16295 "Try `bison --help'".
16296
16297 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16298 What was that "2" for?
16299
16300 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16301 * src/getargs.c (usage): Likewise.
16302
16303 * src/getargs.c (getargs): When there are too few operands, report
16304 the last one. When there are too many, report the first extra
16305 one. This is how diffutils does it.
16306
92a060fd
PE
163072002-10-20 Paul Eggert <eggert@twinsun.com>
16308
16309 Remove K&R vestiges.
16310 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16311 * src/complain.c (VA_START): Remove. Assume prototypes.
16312 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16313 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16314 fatal): Assume prototypes.
16315 * src/complain.h: Assume prototypes.
16316 * src/system.h (PARAMS): Remove.
16317 Include <limits.h> unconditionally, since it's guaranteeed even
16318 for a freestanding C89 compiler.
16319 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16320 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 16321
e7cb57c0
AD
163222002-10-20 Akim Demaille <akim@epita.fr>
16323
16324 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16325 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16326 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16327 (yyresolveStates, yyresolveAction, yyresolveStack)
16328 (yyprocessOneStack): Use them.
16329 (yy_reduce_print): New.
16330 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16331
0245f82d
AD
163322002-10-20 Akim Demaille <akim@epita.fr>
16333
16334 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16335 arguments and output `void'.
16336 (b4_c_function): Rename as...
16337 (b4_c_function_def): this.
16338 (b4_c_function_decl, b4_c_ansi_function_def)
16339 (b4_c_ansi_function_decl): New.
16340 Change the interpretation of the arguments: before `int, foo', now
16341 `int foo, foo'.
16342 * data/yacc.c (yyparse): Prototype and define thanks to these.
16343 Adjust b4_c_function_def uses.
16344 * data/glr.c (yyparse): Likewise, but ANSI only.
16345
39912f52
AD
163462002-10-20 Akim Demaille <akim@epita.fr>
16347
16348 * src/output.c (prepare): Move the definition of `tokens_number',
16349 `nterms_number', `undef_token_number', `user_token_number_max'
16350 to...
16351 (prepare_tokens): Here.
16352 (prepare_tokens): Rename as...
16353 (prepare_symbols): this.
16354 (prepare): Move the definition of `rules_number' to...
16355 (prepare_rules): here.
16356 (prepare): Move the definition of `last', `final_state_number',
16357 `states_number' to...
16358 (prepare_states): here.
16359 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16360
20c1e2ad
AD
163612002-10-20 Akim Demaille <akim@epita.fr>
16362
16363 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16364
21964f43
AD
163652002-10-20 Akim Demaille <akim@epita.fr>
16366
16367 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16368 * data/c.m4: here.
16369
66d30cd4
AD
163702002-10-20 Akim Demaille <akim@epita.fr>
16371
16372 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16373 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16374 `pair'.
16375 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16376 `name' to...
16377 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16378 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16379 These.
16380
95f2c9fe
PE
163812002-10-19 Paul Eggert <eggert@twinsun.com>
16382
16383 Do not create a temporary file, as that involves security and
16384 cleanup headaches. Instead, use a pair of pipes.
16385 Derived from a suggestion by Florian Krohm.
16386 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16387 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16388 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16389 (BISON_PREREQ_SUBPIPE): Add.
16390 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16391 Add subpipe.h, subpipe.c.
16392 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16393 * po/POTFILES.in: Add lib/subpipe.c.
16394 * src/output.c: Include "subpipe.h".
16395 (m4_invoke): Remove decl.
16396 (scan_skel): New decl.
16397 (output_skeleton): Use pipe rather than temporary file for m4 input.
16398 Check that m4sugar.m4 is readable, to avoid deadlock.
16399 Check for pipe I/O error.
16400 * src/scan-skel.l (readpipe): Remove decl.
16401 (scan_skel): New function, to be used in place of m4_invoke.
16402 Read from stream rather than file.
66d30cd4 16403
95f2c9fe
PE
16404 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16405 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16406 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16407 this generates a more-accurate value anyway.
16408
16409 * lib/timevar.c (timervar_accumulate): Rename locals to
16410 avoid confusion with similarly-named more-global.
16411 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16412
16413 * src/output.c (prepare): Use xstrdup to convert char const *
16414 to char *, to avoid GCC warning.
16415
c19988b7
AD
164162002-10-19 Akim Demaille <akim@epita.fr>
16417
16418 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16419 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16420 Use them to have `calc.y' ready for %pure-parser.
16421 * data/yacc.c (YYLEX): Pass a yylex return type to
16422 b4_c_function_call.
16423
ae7453f2
AD
164242002-10-19 Akim Demaille <akim@epita.fr>
16425
16426 Prototype support of %lex-param and %parse-param.
16427
16428 * src/parse-gram.y: Add the definition of the %lex-param and
16429 %parse-param tokens, plus their rules.
16430 Drop the `_' version of %glr-parser.
16431 Add the "," token.
16432 * src/scan-gram.l (INITIAL): Scan them.
16433 * src/muscle_tab.c: Comment changes.
16434 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16435 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16436 (muscle_entry_s): The `value' member is no longer const.
16437 Adjust all dependencies.
16438 * src/muscle_tab.c (muscle_init): Adjust: use
16439 MUSCLE_INSERT_STRING.
16440 Initialize the obstack earlier.
16441 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16442 (muscle_pair_list_grow): New.
16443 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16444 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16445 * tests/calc.at: Use %locations, not --locations.
16446 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16447
0e575721
AD
164482002-10-19 Akim Demaille <akim@epita.fr>
16449
16450 * src/getargs.c (usage): Take status as argument and exit
16451 accordingly.
16452 Report the traditional `Try ... --help' message when status != 0.
16453 (usage, version): Don't take a FILE * as arg, it is pointless.
16454 (getargs): When there is an incorrect number of arguments, make it
16455 an error, and report it GNUlically thanks to `usage ()'.
16456
724ce7f5
PE
164572002-10-18 Paul Eggert <eggert@twinsun.com>
16458
3a781eb2
PE
16459 * data/glr.c (yyreportParseError): Don't assume that sprintf
16460 yields the length of the printed string, as this is not true
16461 on SunOS 4.1.4. Reported by Peter Klein.
16462
724ce7f5
PE
16463 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16464 * tests/conflicts.at (%nonassoc and eof): Likewise.
16465 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16466
473d0a75
AD
164672002-10-17 Akim Demaille <akim@epita.fr>
16468
16469 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16470 * src/getargs.c (trace_types, trace_args): Adjust.
16471 * src/reader.c (grammar_current_rule_prec_set)
16472 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16473 Standardize error messages.
16474 And s/@prec/%prec/!
16475 (reader): Use trace_flag to enable scanner/parser debugging,
16476 instead of an adhoc scheme.
16477 * src/scan-gram.l: Remove trailing debugging code.
16478
e76d2469
PE
164792002-10-16 Paul Eggert <eggert@twinsun.com>
16480
93e2236a
PE
16481 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16482 MUSCLE_TAB_H.
16483
e76d2469
PE
16484 * NEWS: Officially drop support for building Bison with K&R C,
16485 since it didn't work anyway and it's not worth worrying about.
16486 * Makefile.maint (wget_files): Remove ansi2knr.c.
16487 (ansi2knr.c-url_prefix): Remove.
16488 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16489 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16490 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16491
5bd1c419
PE
164922002-10-15 Paul Eggert <eggert@twinsun.com>
16493
16494 Stop using the "enum_" trick for K&R-style function definitions;
16495 it confused me, and I was the author! Instead, assume that people
16496 who want to use K&R C compilers (when using these modules in GCC,
16497 perhaps?) will run ansi2knr.
16498
16499 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16500 All uses of "enum_" changed to "enum ".
16501 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16502 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 16503
5bd1c419
PE
16504 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16505 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16506 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16507 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16508 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16509 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16510 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16511 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16512 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16513 Use function prototypes; this removes the need for declaring
16514 static functions simply to provide their prototypes.
16515 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16516 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16517 bitset_count_, bitset_create, bitset_dump, bitset_first,
16518 bitset_free, bitset_init, bitset_last, bitset_next,
16519 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16520 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16521 bitset_print, bitset_release_memory, bitset_toggle_,
16522 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16523 debug_bitset): Likewise.
16524 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16525 * lib/bitset_stats.c (bitset_log_histogram_print,
16526 bitset_percent_histogram_print, bitset_stats_and,
16527 bitset_stats_and_cmp, bitset_stats_and_or,
16528 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16529 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16530 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16531 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16532 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16533 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16534 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16535 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16536 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16537 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16538 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16539 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16540 bitset_stats_zero): Likewise.
16541 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16542 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16543 bitsetv_dump, debug_bitsetv): Likewise.
16544 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16545 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16546 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16547 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16548 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16549 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16550 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16551 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16552 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16553 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16554 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16555 Likewise.
16556 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16557 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16558 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16559 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16560 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16561 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16562 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16563 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16564 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16565 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16566 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 16567
ae26e1f0
AD
165682002-10-14 Akim Demaille <akim@epita.fr>
16569
16570 Version 1.75.
16571
d43baf71
AD
165722002-10-14 Akim Demaille <akim@epita.fr>
16573
16574 * tests/Makefile.am (maintainer-check-posix): New.
16575
7ebc83e3
AD
165762002-10-14 Akim Demaille <akim@epita.fr>
16577
16578 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16579 member.
16580
05846dae
AD
165812002-10-14 Akim Demaille <akim@epita.fr>
16582
16583 * src/tables.c (table_ninf_remap): base -> tab.
16584 Reported by Matt Rosing.
16585
1318e37d
PE
165862002-10-14 Paul Eggert <eggert@twinsun.com>
16587
447fbb17
PE
16588 * tests/action.at, tests/calc.at, tests/conflicts.at,
16589 tests/cxx-type.at, tests/headers.at, tests/input.at,
16590 tests/regression.at, tests/synclines.at, tests/torture.at:
16591 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16592 so that the tests still work even if POSIXLY_CORRECT is set.
16593 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 16594
1318e37d
PE
16595 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16596 for portability to K&R hosts. Fix typo: signed char is guaranteed
16597 only to 127, not to 128.
16598 * data/glr.c (yysigned_char): New type.
16599 * data/yacc.c (yysigned_char): Likewise.
16600 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16601
cc0f0794
PE
166022002-10-13 Paul Eggert <eggert@twinsun.com>
16603
5038f418
PE
16604 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16605 true due to limited range of data type" warning from GCC.
16606
cc0f0794
PE
16607 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16608 by wrapping enum yytokentype's definition inside #ifndef
16609 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16610
6fed0802
AD
166112002-10-13 Akim Demaille <akim@epita.fr>
16612
16613 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16614 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16615
32f0598d
AD
166162002-10-13 Akim Demaille <akim@epita.fr>
16617
16618 * Makefile.maint: Update from Autoconf 2.54.
16619 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16620
7ea9a33f
AD
166212002-10-13 Akim Demaille <akim@epita.fr>
16622
16623 * src/print.c (print_state): Separate the list of solved conflicts
16624 from the other items.
16625 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16626
ea99527d
AD
166272002-10-13 Akim Demaille <akim@epita.fr>
16628
16629 Let nondeterministic skeletons be usable with deterministic
16630 tables.
16631
16632 With the patch, GAWK compiled by GCC without -O2 passes its test
16633 suite using a GLR parser driven by LALR tables. It fails with -O2
16634 because `struct stat' gives two different answers on my machine:
16635 88 (definition of an auto var) and later 96 (memset on this var).
16636 Hence the stack is badly corrumpted. The headers inclusion is to
16637 blame: if I move the awk.h inclusion before GLR's system header
16638 inclusion, the two struct stat have the same size.
16639
16640 * src/tables.c (pack_table): Always create conflict_table.
16641 (token_actions): Always create conflict_list.
16642 * data/glr.c (YYFLAG): Remove, unused.
16643
f377f69f
AD
166442002-10-13 Akim Demaille <akim@epita.fr>
16645
16646 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16647 (O0FLAGS): New.
16648 (VALGRIND, GXX): New.
16649 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16650 * tests/bison.in: Run $PREBISON a pre-command.
16651 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16652 (maintainer-check-g++): New.
16653 * Makefile.am (maintainer-check): New.
16654
2a1fe6ed
AD
166552002-10-13 Akim Demaille <akim@epita.fr>
16656
16657 * data/glr.c: Formatting changes.
16658 Tweak some trace messages to match yacc.c's.
16659
f50adbbd
AD
166602002-10-13 Akim Demaille <akim@epita.fr>
16661
16662 GLR parsers sometimes raise parse errors instead of performing the
16663 default reduction.
16664 Reported by Charles-Henry de Boysson.
16665
16666 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 16667 check the length of the traces when %glr.
f50adbbd
AD
16668 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16669 GLR's traces.
16670 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16671 Test GLR parsers.
16672 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16673 (yyltype): Remove the yy prefix from the member names.
16674 (yytable): Complete its comment.
16675 (yygetLRActions): Map error action number from YYTABLE from
16676 YYTABLE_NINF to 0.
16677 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16678 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16679 not satisfying as we could compare an YYACTION computed from
16680 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16681 only value for error actions.
16682 (yyreportParseError): In verbose parse error messages, don't issue
16683 `error' in the list of expected tokens.
16684 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16685 next action to perform to match glr.c's decoding.
16686 (yytable): Complete its comment.
16687
bcbad5b9
PE
166882002-10-13 Paul Eggert <eggert@twinsun.com>
16689
16690 Fix problem reported by Henrik Grubbstroem in
161a71f3 16691 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
16692 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16693 because the Bison parser reads the second action before reducing
16694 the first one.
16695 * src/scan-gram.l (rule_length): New static var.
16696 Use it to keep track of the rule length in the scanner, since
16697 we can't expect the parser to be in lock-step sync with the scanner.
16698 (handle_action_dollar, handle_action_at): Use this var.
16699 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 16700
14904b89
PE
167012002-10-12 Paul Eggert <eggert@twinsun.com>
16702
1fe611e5
PE
16703 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16704 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16705 Include <sys/time.h> when checking for clock_t and struct tms.
16706 Use same include order as source.
16707 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 16708 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 16709
1fe611e5
PE
16710 * lib/timevar.c: Update copyright date and clarify comments.
16711 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 16712
1fe611e5
PE
16713 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16714 GCC version as of today, then merge Bison's changes.
16715 Change "GCC" to "Bison" in copyright notice. timevar.def's
16716 author is Akim, so change that too.
16717
98194095
PE
16718 * src/reader.c (grammar_current_rule_check):
16719 Don't worry about the default action if $$ is untyped.
16720 Prevents bogus warnings reported by Jim Gifford in
161a71f3 16721 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 16722
14904b89
PE
16723 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16724 * data/glr.c, data/lalr1.cc, data/yacc.c:
16725 Output token definitions before the first part of user declarations.
16726 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 16727 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 16728
ff6dca18
PE
167292002-10-11 Paul Eggert <eggert@twinsun.com>
16730
16731 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16732 (yyparse): here. This undoes some of the 2002-07-25 change.
16733 Compatibility problem reported by Ralf S. Engelschall with
16734 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16735
eb714592
AD
167362002-10-11 Akim Demaille <akim@epita.fr>
16737
16738 * tests/regression.at Characters Escapes): New.
16739 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16740 characters.
16741 Reported by Jan Nieuwenhuizen.
16742
b7195100
AD
167432002-10-11 Akim Demaille <akim@epita.fr>
16744
16745 * po/id.po: New.
16746
f28a0f2d
PE
167472002-10-10 Paul Eggert <eggert@twinsun.com>
16748
16749 Portability fixes for bitsets; this also avoids several GCC
16750 warnings.
16751
16752 * lib/abitset.c: Include <stddef.h>, for offsetof.
16753 * lib/lbitset.c: Likewise.
16754
16755 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16756 properly for vectors of objects. Do not assume that adding a
16757 header size to a multiple of a word size yields a value that is
16758 properly aligned for the whole union.
16759 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16760
16761 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16762 unique names for structures.
16763 * lib/ebitset.c (ebitset_bytes): Likewise.
16764 * lib/lbitset.c (lbitset_bytes): Likewise.
16765
16766 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16767 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16768 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16769 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16770 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16771 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16772 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16773 to improve the type-checking that GCC can do.
16774 * lib/bitset.c (bitset_op4_cmp): Likewise.
16775 * lib/bitset_stats.c (bitset_stats_count,
16776 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16777 bitset_stats_copy, bitset_stats_disjoint_p,
16778 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16779 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16780 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16781 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16782 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16783 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16784 bitset_stats_or_and_cmp): Likewise.
16785 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16786 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16787 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16788 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16789
16790 * lib/abitset.h: Include bitset.h, not bbitset.h.
16791 * lib/ebitset.h: Likewise.
16792 * lib/lbitset.h: Likewise.
16793
16794 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16795 All instances of parameters of type enum bitset_opts are now of
16796 type enum_bitset_opts, to conform to the C Standard, and similarly
16797 for enum_bitset_type.
16798 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16799 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16800
16801 Do not use "struct bitset_struct" to mean different things in
16802 different modules. Not only is this confusing, it violates
16803 the C Standard, which requires that structure types in different
16804 modules must be compatible if one is to be passed to the other.
16805 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16806 All instances of "struct bitset_struct *" replaced with "bitset".
16807 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16808 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16809 struct lbitset_struct, struct bitset_stats_struct): New types.
16810 All uses of struct bitset_struct changed to union bitset_union,
16811 etc.
ba0fe3c7 16812 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
16813 struct bitset_struct): Remove.
16814 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16815 struct bitset_struct): Remove.
16816 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16817 bitset_struct): Remove.
16818 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16819 Likewise.
16820
16821 Do not call a function of type T using a call that assumes the
16822 function is of a different type U. Standard C requires that a
16823 function must be called with a type that is compatible with its
16824 definition.
16825 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16826 New decls.
16827 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16828 New functions.
16829 * lib/ebitset.c (PFV): Remove.
16830 * lib/lbitset.c (PFV): Likewise.
16831 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16832 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16833 decls.
16834 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16835 (ebitset_vtable): Use them.
16836 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16837 lbitset_xor): New functions.
16838 (lbitset_vtable): Use them.
16839
16840 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16841 Declare.
16842
16843 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16844 GCC warning.
16845 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16846 Use offsetof, for simplicity.
16847
6fbe4984
PE
168482002-10-06 Paul Eggert <eggert@twinsun.com>
16849
16850 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16851 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 16852 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
16853 which was inadvertently undone by the 2002-09-30 patch.
16854 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16855 the same width as int.
16856
420f93c8
PE
168572002-10-04 Paul Eggert <eggert@twinsun.com>
16858
16859 Version 1.50.
16860
16861 * configure.ac (AC_INIT), NEWS: Increment version number.
16862
16863 * doc/bison.texinfo: Minor spelling, grammar, and white space
16864 fixes.
16865 (Symbols): Mention that any negative value returned from yylex
16866 signifies end-of-input. Warn about negative chars. Mention
16867 the portable Standard C character set.
16868
16869 The GNU coding standard says CFLAGS and YFLAGS are reserved
16870 for the installer to set.
16871 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16872 * src/Makefile.am (AM_CFLAGS): Likewise.
16873 (AM_YFLAGS): Renamed from YFLAGS.
16874
16875 Fix some MAX and MIN problems.
16876 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16877 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16878 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16879 * src/reader.c (reader): Use it.
16880
16881 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16882 POSIX 1003.1-2001 has removed fgrep.
16883
168842002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16885
16886 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16887 interpreted as signed.
16888 * lib/ebitset.c (ebitset_list): Fix bug.
16889
ff68026d
PE
168902002-10-01 Paul Eggert <eggert@twinsun.com>
16891
16892 More fixes for 64-bit hosts and large bitsets.
16893
16894 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16895 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16896 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16897 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16898 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16899 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16900 bitset_count_): Likewise.
16901 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16902 bitset_first, bitset_last): Likewise.
16903 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16904 bitset_stats_list_reverse, bitset_stats_size,
16905 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16906 Likewise.
16907 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16908 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16909 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16910 bitsetv_reflexive_transitive_closure): Likewise.
16911 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16912 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16913 Likewise.
16914 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16915 Likewise.
420f93c8 16916
ff68026d
PE
16917 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16918 Use size_t, not unsigned int, to count bytes.
16919 * lib/abitset.h (abitset_bytes): Likewise.
16920 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16921 Likewise.
16922 * lib/bitset.h (bitset_bytes): Likewise.
16923 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16924 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16925 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16926 * lib/ebitset.c (ebitset_bytes): Likewise.
16927 * lib/ebitset.h (ebitset_bytes): Likewise.
16928 * lib/lbitset.c (lbitset_bytes): Likewise.
16929 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 16930
ff68026d
PE
16931 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16932 abitset_subset_p, abitset_disjoint_p, abitset_and,
16933 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16934 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16935 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16936 abitset_or_and, abitset_or_and_cmp):
16937 Use bitset_windex instead of unsigned int.
16938 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16939 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16940 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16941 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16942 Likewise.
16943 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 16944
ff68026d
PE
16945 * lib/bitset.c (bitset_print):
16946 Use proper printf formats for widths of integer types.
16947 * lib/bitset_stats.c (bitset_percent_histogram_print,
16948 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
16949 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16950 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16951 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 16952
ff68026d
PE
16953 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
16954 BITSET_SIZE_MAX): New macros.
16955 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
16956 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
16957 to BITSET_WINDEX_MAX.
16958
16959 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
16960 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
16961 since we now return the bitset_bindex type (not int).
16962
16963 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
16964 when computing sizes.
16965 * lib/ebitset.c (ebitset_elts_grow): Likewise.
16966
16967 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
16968 and avoid cast to unsigned.
16969
6aa452a6
AD
169702002-09-30 Akim Demaille <akim@epita.fr>
16971
16972 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
16973 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
16974 Updates from Michael Hayes.
16975
927f7817
AD
169762002-09-30 Art Haas <ahaas@neosoft.com>
16977
16978 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
16979 invocations.
16980 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
16981 defined.
16982
9738f41e
AD
169832002-09-27 Akim Demaille <akim@epita.fr>
16984
16985 Version 1.49c.
16986
a5c75d7f
AD
169872002-09-27 Akim Demaille <akim@epita.fr>
16988
16989 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
16990 (Because of AC_LIBSOURCE).
16991
8280e179
AD
169922002-09-27 Akim Demaille <akim@epita.fr>
16993
16994 Playing with Autoscan.
16995
16996 * configure.ac: Remove the old LIBOBJ tweaks.
16997 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16998 * lib/strrchr.c: New.
16999 * lib/strtol.c: New, from the Coreutils 4.5.1.
17000
ae64af35
AD
170012002-09-27 Akim Demaille <akim@epita.fr>
17002
17003 Playing with Autoscan.
17004
17005 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17006 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17007 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17008 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17009 Coreutils 4.5.1.
17010
d1a1114f
AD
170112002-09-24 Akim Demaille <akim@epita.fr>
17012
17013 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17014 (Frequently Asked Questions, Parser Stack Overflow): New.
17015
b906441c
AD
170162002-09-13 Akim Demaille <akim@epita.fr>
17017
17018 Playing with autoscan.
17019
17020 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17021 * src/files.c (skeleton_find): Remove, unused.
17022 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17023 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17024
bd701811
AD
170252002-09-13 Akim Demaille <akim@epita.fr>
17026
17027 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17028 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17029
e0a13e7b
AD
170302002-09-13 Akim Demaille <akim@epita.fr>
17031
17032 * configure.ac: Require 2.54.
17033 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17034 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17035 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17036 Remove, provided by Autoconf macros.
17037
c97011bf
AD
170382002-09-12 Akim Demaille <akim@epita.fr>
17039
17040 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17041
d862b1be
AD
170422002-09-12 Akim Demaille <akim@epita.fr>
17043
17044 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17045 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17046 Reported by Martin Mokrejs.
17047
3d38c03a
AD
170482002-09-10 Akim Demaille <akim@epita.fr>
17049
17050 * src/parse-gram.y: Associate a human readable string to each
17051 token type.
17052 * tests/regression.at (Invalid inputs): Adjust.
17053
b6347355
AD
170542002-09-10 Gary V. Vaughan <gary@gnu.org>
17055
17056 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17057 with an Autoconf-2.5x style configure.ac.
17058
09ba4ab2
PE
170592002-09-06 Paul Eggert <eggert@twinsun.com>
17060
17061 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17062 exception applies only to yacc.c. This is a modification of a
17063 patch originally suggested by Akim Demaille.
17064
21846f69
AD
170652002-09-06 Akim Demaille <akim@epita.fr>
17066
09ba4ab2
PE
17067 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17068 here to...
17069 * data/yacc.c: here.
17070
21846f69
AD
17071 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17072 LocationType.
17073 (b4_ltype): Default to yy::Location from location.hh.
17074
c0ad8bf3
AD
170752002-09-04 Jim Meyering <jim@meyering.net>
17076
17077 * data/yacc.c: Guard the declaration of yytoknum also with
17078 `#ifdef YYPRINT', so it is declared only when used.
17079
3a93251e
AD
170802002-09-04 Akim Demaille <akim@epita.fr>
17081
17082 * configure.in: Rename as...
17083 * configure.ac: this.
17084 Bump to 1.49c.
17085
427c0dda
AD
170862002-09-04 Akim Demaille <akim@epita.fr>
17087
17088 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17089 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17090 translate maintainer only messages.
17091
6a254321
PE
170922002-08-12 Paul Eggert <eggert@twinsun.com>
17093
645e30d1
PE
17094 Version 1.49b.
17095
6a254321
PE
17096 * Makefile.am (SUBDIRS): Remove intl.
17097 (DISTCLEANFILES): Remove.
17098 * NEWS: Mention that GNU M4 is now required. Clarify what is
17099 meant by "larger grammars". Mention the pt_BR translation.
17100 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17101 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17102 Bump version from 0.11.2 to 0.11.5.
17103 (BISON_PREREQ_STAGE): Remove.
17104 (AM_GNU_GETTEXT): Use external gettext.
17105 (AC_OUTPUT): Remove intl/Makefile.
17106
17107 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17108
17109 * data/glr.c: Include string.h, for strlen.
17110 (yyreportParseError): Use size_t for yysize.
17111 (yy_yypstack): No longer nested inside yypstates, as nested
17112 functions are not portable. Do not assume size_t is the
17113 same width as int.
17114 (yypstates): Do not assume that ptrdiff_t is the same width
17115 as int, and similarly for yyposn and YYINDEX.
17116
17117 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17118
17119 * lib/Makefile.am (INCLUDES): Do not include from the intl
17120 directory, which has been removed.
17121 * src/Makefile.am (INCLUDES): Likewise.
17122
17123 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17124 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17125 New vars.
17126
17127 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17128 * tests/Makefile.am (EXTRA_DIST): Likewise.
17129
17130 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17131 Do not assume that bitset_windex is the same width as unsigned.
17132
17133 * lib/abitset.c (abitset_unused_clear): Do not assume that
17134 bitset_word is the same width as int.
17135 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17136 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17137 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17138 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17139 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17140
17141 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17142 portability to one's complement hosts!).
17143 * lib/ebitset.c (ebitset_op1): Likewise.
17144 * lib/lbitset.c (lbitset_op1): Likewise.
17145
17146 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17147 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17148 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17149 Sync with fileutils.
17150 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17151 lib/gettext.h: Sync with diffutils.
17152
17153 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17154 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17155
17156 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17157 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17158 check for void *.
17159
17160 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17161 size_t; the old version tried to do this but casted improperly.
17162 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17163 (bitset_test): Now returns int, not unsigned long.
17164
17165 * lib/bitset_stats.c: Include "gettext.h".
17166 (_): New macro.
17167 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17168 name locals "index", as it generates unnecessary warnings on some
17169 hosts that have an "index" function.
17170
17171 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17172 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17173 they need translation.
17174 * src/LR0.c (state_list_append, new_itemsets, get_state,
17175 append_states, generate_states): Likewise.
17176 * src/assoc.c (assoc_to_string): Likewise.
17177 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17178 * src/gram.c (grammar_dump): Likewise.
17179 * src/injections.c (injections_compute): Likewise.
17180 * src/lalr.c (lookaheads_print): Likewise.
17181 * src/relation.c (relation_transpose): Likewise.
17182 * src/scan-gram.l: Likewise.
17183 * src/tables.c (table_grow, pack_vector): Likewise.
17184
17185 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17186 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17187 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17188 * m4/mbstate_t.m4: Sync with fileutils.
17189 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17190
17191 * po/LINGUAS: Add pt_BR.
17192 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17193 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17194 lib/timevar.c.
17195 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17196 manual recommends.
17197 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17198
17199 * src/complain.c (strerror_r): Remove decl; not needed.
17200 (strerror): Use same pattern as ../lib/error.c.
17201
17202 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17203
17204 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17205
17206 * src/main.c (main): Cast result of bindtextdomain and textdomain
17207 to void, to avoid a GCC warning when --disable-nls is in effect.
17208
17209 * src/scan-gram.l: Use strings rather than escapes when possible,
17210 to minimize the number of warnings from xgettext.
17211 (handle_action_dollar, handle_action_at): Don't use isdigit,
17212 as it mishandles negative chars and it may not work as expected
17213 outside the C locale.
17214
17215 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17216 this is a GCC extension and is not portable to other compilers.
17217
17218 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17219 Do not include <ctype.h>; no longer needed.
17220 Do not include <malloc.h>; no longer needed (and generates
17221 warnings on OpenBSD 3.0).
17222
17223 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17224 it's not portable.
17225
17226 * tests/regression.at: Do not use 'cc -c input.c -o input';
17227 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17228
17229 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17230 exit status as failure, not just exit status 1. Sun C exits
17231 with status 2 sometimes.
17232
17233 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17234 Use it for the two large tests.
17235
c8f002c7
AD
172362002-08-02 Akim Demaille <akim@epita.fr>
17237
17238 * src/conflicts.c (conflicts_output): Don't output rules never
17239 reduced here, since anyway that computation doesn't work.
17240 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17241 (rule_useless_p, rule_never_reduced_p): New.
17242 (grammar_rules_partial_print): Use a filter instead of a range.
17243 Display the title only if needed.
17244 (grammar_rules_print): Adjust.
17245 (grammar_rules_never_reduced_report): New.
17246 * src/tables.c (action_row): Move the computation of rules never
17247 reduced to...
17248 (token_actions): here.
17249 * src/main.c (main): Make the parser before making the report, so
17250 that rules never reduced are computed.
17251 Call grammar_rules_never_reduced_report.
17252 * src/print.c (print_results): Report rules never reduced.
17253 * tests/conflicts.at, tests/reduce.at: Adjust.
17254
cd08e51e
AD
172552002-08-01 Akim Demaille <akim@epita.fr>
17256
17257 Instead of attaching lookaheads and duplicating the rules being
17258 reduced by a state, attach the lookaheads to the reductions.
17259
17260 * src/state.h (state_t): Remove the `lookaheads',
17261 `lookaheads_rule' member.
17262 (reductions_t): Add a `lookaheads' member.
17263 Use a regular array for the `rules'.
17264 * src/state.c (reductions_new): Initialize the lookaheads member
17265 to 0.
17266 (state_rule_lookaheads_print): Adjust.
17267 * src/state.h, src/state.c (state_reductions_find): New.
17268 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17269 (count_rr_conflicts): Adjust.
17270 * src/lalr.c (LArule): Remove.
17271 (add_lookback_edge): Adjust.
17272 (state_lookaheads_count): New.
17273 (states_lookaheads_initialize): Merge into...
17274 (initialize_LA): this.
17275 (lalr_free): Adjust.
17276 * src/main.c (main): Don't free nullable and derives too early: it
17277 is used by --verbose.
17278 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17279
bb0027a9
AD
172802002-08-01 Akim Demaille <akim@epita.fr>
17281
17282 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17283 `rule_number_t**'.
17284 (set_derives, free_derives): Rename as...
17285 (derives_compute, derives_free): this.
17286 Adjust all dependencies.
17287 * src/nullable.c (set_nullable, free_nullable): Rename as...
17288 (nullable_compute, nullable_free): these.
17289 (rule_list_t): Store rule_t *, not rule_number_t.
17290 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17291 pointers, instead of their numbers.
17292 * src/main.c (main): Call nullable_free, and derives_free earlier,
17293 as they were lo longer used.
17294
3325ddc4
AD
172952002-08-01 Akim Demaille <akim@epita.fr>
17296
17297 * lib/timevar.c (get_time): Include children time.
17298 * src/lalr.h (LA, LArule): Don't export them: used with the
17299 state_t.
17300 * src/lalr.c (LA, LArule): Static.
17301 * src/lalr.h, src/lalr.c (lalr_free): New.
17302 * src/main.c (main): Call it.
17303 * src/tables.c (pack_vector): Check whether loc is >= to the
17304 table_size, not >.
17305 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17306 (tables_generate): do it, since that's also it which allocates
17307 them.
17308 Don't free LA and LArule, main does.
17309
c6f1a33c
AD
173102002-07-31 Akim Demaille <akim@epita.fr>
17311
17312 Separate parser tables computation and output.
17313
17314 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17315 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17316 (yydefgoto, yydefact, high): Move to...
17317 * src/tables.h, src/tables.c: here.
17318 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17319 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17320 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17321 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17322 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17323 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17324 (action_row, save_row, token_actions, save_column, default_goto)
17325 (goto_actions, sort_actions, matching_state, pack_vector)
17326 (table_ninf_remap, pack_table, prepare_actions): Move to...
17327 * src/tables.c: here.
17328 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17329 * src/output.c (token_actions, output_base, output_conflicts)
17330 (output_check): Merge into...
17331 (prepare_actions): this.
17332 (actions_output): Rename as...
17333 (user_actions_output): this.
17334 * src/main.c (main): Call tables_generate and tables_free.
17335
1509d42f
AD
173362002-07-31 Akim Demaille <akim@epita.fr>
17337
17338 Steal GCC's --time-report support.
17339
17340 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17341 stolen/adjusted from GCC.
17342 * m4/stage.m4: Remove time related checks.
17343 * m4/timevar.m4: New.
17344 * configure.in: Adjust.
17345 * src/system.h: Adjust to using timevar.h.
17346 * src/getargs.h, src/getargs.c: Support trace_time for
17347 --trace=time.
17348 * src/main.c (stage): Remove.
17349 (main): Replace `stage' invocations with timevar calls.
17350 * src/output.c: Insert pertinent timevar calls.
17351
273a74fa
AD
173522002-07-31 Akim Demaille <akim@epita.fr>
17353
17354 Let --trace have arguments.
17355
17356 * src/getargs.h (enum trace_e): New.
17357 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17358 (long_options, short_options): --trace/-T takes an optional
17359 argument.
17360 Change all the uses of trace_flag to reflect the new flags.
17361 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17362
17363 Strengthen `stage' portability.
17364
17365 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17366 * configure.in: Use it.
17367 Don't check for malloc.h and sys/times.h.
17368 * src/system.h: Include them when appropriate.
17369 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17370 times and struct tms are available.
17371
217598da
AD
173722002-07-30 Akim Demaille <akim@epita.fr>
17373
17374 In verbose parse error message, don't report `error' as an
17375 expected token.
17376 * tests/actions.at (Printers and Destructors): Adjust.
17377 * tests/calc.at (Calculator $1): Adjust.
17378 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17379 error message, do not report the parser accepts the error token in
17380 that state.
17381
52489d44
AD
173822002-07-30 Akim Demaille <akim@epita.fr>
17383
17384 Normalize conflict related messages.
17385
17386 * src/complain.h, src/complain.c (warn, complain): New.
17387 * src/conflicts.c (conflicts_print): Use them.
17388 (conflict_report_yacc): New, extracted from...
17389 (conflicts_print): here.
17390 * tests/conflicts.at, tests/existing.at: Adjust.
17391
e8832397
AD
173922002-07-30 Akim Demaille <akim@epita.fr>
17393
17394 Report rules which are never reduced by the parser: those hidden
17395 by conflicts.
17396
17397 * src/LR0.c (save_reductions): Don't make the final state too
17398 different: save its reduction (accept) instead of having a state
17399 without any action (no shift or goto, no reduce).
17400 Note: the final state is now a ``regular'' state, i.e., the
17401 parsers now contain `reduce 0' as default reduction.
17402 Nevertheless, since they decide to `accept' when yystate =
17403 final_state, they still will not reduce rule 0.
17404 * src/print.c (print_actions, print_reduction): Adjust.
17405 * src/output.c (action_row): Track reduced rules.
17406 (token_actions): Report rules never reduced.
17407 * tests/conflicts.at, tests/regression.at: Adjust.
17408
caf23d24
AD
174092002-07-30 Akim Demaille <akim@epita.fr>
17410
17411 `stage' was accidently included in a previous patch.
17412 Initiate its autoconfiscation.
17413
17414 * configure.in: Look for malloc.h and sys/times.h.
17415 * src/main.c (stage): Adjust.
17416 Report only when trace_flag.
17417
640748ee
AD
174182002-07-29 Akim Demaille <akim@epita.fr>
17419
17420 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17421 state_number_t.
17422 (errs_t): symbol_t*, not symbol_number_t.
17423 (reductions_t): rule_t*, not rule_number_t.
17424 (FOR_EACH_SHIFT): New.
17425 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17426 * src/print.c, src/print_graph.c: Adjust.
17427
88bce5a2
AD
174282002-07-29 Akim Demaille <akim@epita.fr>
17429
17430 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17431
17432 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17433 (endtoken, accept): these.
17434 * src/reader.c (reader): Set endtoken's default tag to "$end".
17435 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17436 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17437 Adjust.
17438
1bfb97db
AD
174392002-07-29 Akim Demaille <akim@epita.fr>
17440
17441 * src/reduce.c (reduce_grammar): When the language is empty,
17442 complain about the start symbol, not the axiom.
17443 Use its location.
17444 * tests/reduce.at (Empty Language): New.
17445
fc5734fe
AD
174462002-07-26 Akim Demaille <akim@epita.fr>
17447
17448 * src/reader.h, src/reader.c (gram_error): ... can't get
17449 yycontrol without making too strong assumptions on the parser
17450 itself.
17451 * src/output.c (prepare_tokens): Use the real 0th value of
17452 token_translations instead of `0'.
17453 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17454 visible here.
17455 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17456 for the time being: %locations ought to provide it to yyerror.
17457
3650b4b8
AD
174582002-07-25 Akim Demaille <akim@epita.fr>
17459
17460 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17461 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17462 * tests/regression.at (Web2c Actions): Adjust.
17463
4b3d3a8e
AD
174642002-07-25 Akim Demaille <akim@epita.fr>
17465
17466 Stop storing rules from 1 to nrules + 1.
17467
17468 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17469 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17470 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17471 Iterate from 0 to nrules.
17472 Use rule_number_as_item_number and item_number_as_rule_number.
17473 Adjust to `derive' now containing possibly 0.
17474 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17475 Handle the `- 1' part in rule numbers from/to item numbers.
17476 * src/conflicts.c (log_resolution): Fix the message which reversed
17477 shift and reduce.
17478 * src/output.c (action_row): Initialize default_rule to -1.
17479 (token_actions): Adjust.
17480 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17481 expected output.
17482 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17483
4a2a22f4
AD
174842002-07-25 Akim Demaille <akim@epita.fr>
17485
17486 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17487 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17488 (b4_c_knr_arg_decl): New.
17489 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17490 yyreport_parse_error.
17491
b8df3223
AD
174922002-07-25 Akim Demaille <akim@epita.fr>
17493
17494 * data/yacc.c (yyreport_parse_error): New, extracted from...
17495 (yyparse): here.
17496 (yydestruct, yysymprint): Move above yyparse.
17497 Be K&R compliant.
17498
a762e609
AD
174992002-07-25 Akim Demaille <akim@epita.fr>
17500
17501 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17502 replace...
17503 (b4_sint_type, b4_uint_type): these.
17504 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17505 * tests/regression.at (Web2c Actions): Adjust.
17506
12b0043a
AD
175072002-07-25 Akim Demaille <akim@epita.fr>
17508
17509 * src/gram.h (TIEM_NUMBER_MAX): New.
17510 (item_number_of_rule_number, rule_number_of_item_number): Rename
17511 as...
17512 (rule_number_as_item_number, item_number_as_rule_number): these.
17513 Adjust dependencies.
17514 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17515 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17516 (symbol_number_to_vector_number): New.
17517 (order): Of vector_number_t* type.
17518 (base_t, BASE_MAX, BASE_MIN): New.
17519 (froms, tos, width, pos, check): Of base_t type.
17520 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17521 (actrow): Of action_number_t type.
17522 (conflrow): Of unsigned int type.
17523 (table_ninf, base_ninf): New.
17524 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17525 (muscle_insert_int_table, muscle_insert_base_table)
17526 (muscle_insert_rule_number_table): New.
17527 (prepare_tokens): Output `toknum' as int_table.
17528 (action_row): Returns a rule_number_t.
17529 Use ACTION_MIN, not SHRT_MIN.
17530 (token_actions): yydefact is rule_number_t*.
17531 (table_ninf_remap): New.
17532 (pack_table): Use it for `base' and `table'.
17533 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17534 replaced with...
17535 (YYPACT_NINF, YYTABLE_NINF): these.
17536 (yypact, yytable): Compute their types instead of hard-coded
17537 `short'.
17538 * tests/regression.at (Web2c Actions): Adjust.
17539
5dde258a
AD
175402002-07-19 Akim Demaille <akim@epita.fr>
17541
17542 * src/scan-gram.l (id): Can start with an underscore.
17543
a945ec39
AD
175442002-07-16 Akim Demaille <akim@epita.fr>
17545
17546 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17547 Adjust all former `associativity' dependencies.
17548 * src/symtab.c (symbol_new): Default associativity is `undef', not
17549 `right'.
17550 (symbol_check_alias_consistence): Adjust.
17551
fae437e8
AD
175522002-07-09 Akim Demaille <akim@epita.fr>
17553
17554 * doc/bison.texinfo: Properly set the ``header'' part.
17555 Use @dircategory ``GNU programming tools'' as per Texinfo's
17556 documentation.
17557 Use @copying.
17558
1a715ef2
AD
175592002-07-09 Akim Demaille <akim@epita.fr>
17560
17561 * lib/quotearg.h: Protect against multiple inclusions.
17562 * src/location.h (location_t): Add a `file' member.
17563 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17564 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17565 `error_one_per_line' support.
17566
a5d50994
AD
175672002-07-09 Akim Demaille <akim@epita.fr>
17568
17569 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17570 * src/reader.c (lineno): Remove.
17571 Adjust all dependencies.
17572 (get_merge_function): Take a location and use complain_at.
17573 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17574 * tests/regression.at (Invalid inputs, Mixing %token styles):
17575 Adjust.
17576
b275314e
AD
175772002-07-09 Akim Demaille <akim@epita.fr>
17578
17579 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17580 recovery rule, and forbid extensions when --yacc.
17581 (gram_error): Use complain_at.
17582 * src/reader.c (reader): Exit if there were parse errors.
17583
865b9df1
AD
175842002-07-09 Akim Demaille <akim@epita.fr>
17585
17586 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17587 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17588 Reported by R Blake <blakers@mac.com>.
17589
c76e14da
AD
175902002-07-09 Akim Demaille <akim@epita.fr>
17591
17592 * data/yacc.c: Output the copyright notive in the header.
17593
7db2ed2d
AD
175942002-07-03 Akim Demaille <akim@epita.fr>
17595
17596 * src/output.c (froms, tos): Are state_number_t.
17597 (save_column): sp, sp1, and sp2 are state_number_t.
17598 (prepare): Rename `final' as `final_state_number', `nnts' as
17599 `nterms_number', `nrules' as `rules_number', `nstates' as
17600 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17601 unused.
17602 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17603 * data/lalr1.cc (nsym_): Remove, unused.
17604
e68e0410
AD
176052002-07-03 Akim Demaille <akim@epita.fr>
17606
17607 * src/lalr.h, src/lalr.c (goto_number_t): New.
17608 * src/lalr.c (goto_list_t): New.
17609 Propagate them.
17610 * src/nullable.c (rule_list_t): New.
17611 Propagate.
17612 * src/types.h: Remove.
17613
e1a4f3a4
AD
176142002-07-03 Akim Demaille <akim@epita.fr>
17615
17616 * src/closure.c (print_fderives): Use rule_rhs_print.
17617 * src/derives.c (print_derives): Use rule_rhs_print.
17618 (rule_list_t): New, replaces `shorts'.
17619 (set_derives): Add comments.
17620 * tests/sets.at (Nullable, Firsts): Adjust.
17621
536545f3
AD
176222002-07-03 Akim Demaille <akim@epita.fr>
17623
17624 * src/output.c (prepare_actions): Free `tally' and `width'.
17625 (prepare_actions): Allocate and free `order'.
17626 * src/symtab.c (symbols_free): Free `symbols'.
17627 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17628 * src/output.c (m4_invoke): Move to...
17629 * src/scan-skel.l: here.
17630 (<<EOF>>): Close yyout, and free its name.
17631
8b752b00
AD
176322002-07-03 Akim Demaille <akim@epita.fr>
17633
17634 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17635
17636 * src/LR0.c (new_state): Merge into...
17637 (state_list_append): this.
17638 (new_states): Merge into...
17639 (generate_states): here.
17640 (set_states): Don't ensure a proper `errs' state member here, do it...
17641 * src/conflicts.c (conflicts_solve): here.
17642 * src/state.h, src/state.c: Comment changes.
17643 (state_t): Rename member `shifts' as `transitions'.
17644 Adjust all dependencies.
17645 (errs_new): For consistency, also take the values as argument.
17646 (errs_dup): Remove.
17647 (state_errs_set): New.
17648 (state_reductions_set, state_transitions_set): Assert that no
17649 previous value was assigned.
17650 (state_free): New.
17651 (states_free): Use it.
17652 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17653 temporary storage: use `errs' and `nerrs' as elsewhere.
17654 (set_conflicts): Allocate and free this `errs'.
17655
613f5e1a
AD
176562002-07-02 Akim Demaille <akim@epita.fr>
17657
17658 * lib/libiberty.h: New.
17659 * lib: Update the bitset implementation from upstream.
17660 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17661 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17662 * src/main.c: Adjust bitset stats calls.
17663
26e0cadc
PE
176642002-07-01 Paul Eggert <eggert@twinsun.com>
17665
17666 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17667 char, so that negative chars don't collide with $.
17668
1154cced
AD
176692002-06-30 Akim Demaille <akim@epita.fr>
17670
17671 Have the GLR tests be `warning' checked, and fix the warnings.
17672
17673 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17674 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17675 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17676 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17677 (yyaddDeferredAction): static.
17678 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17679 (yyreportParseError): yyprefix is const.
17680 yytokenp is used only when verbose.
17681 (yy__GNUC__): Replace with __GNUC__.
17682 (yypdumpstack): yyi is size_t.
17683 (yypreference): Un-yy local variables and arguments, to avoid
17684 clashes with `yyr1'. Anyway, we are not in the user name space.
17685 (yytname_size): be an int, as is compared with ints.
17686 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17687 Use them.
17688 * tests/cxx-gram.at: Use quotation to protect $1.
17689 Use AT_COMPILE to enable warnings hunts.
17690 Prototype yylex and yyerror.
17691 `Use' argc.
17692 Include `string.h', not `strings.h'.
17693 Produce and prototype stmtMerge only when used.
17694 yylex takes a location.
17695
97650f4e
AD
176962002-06-30 Akim Demaille <akim@epita.fr>
17697
17698 We spend a lot of time in quotearg, in particular when --verbose.
17699
17700 * src/symtab.c (symbol_get): Store a quoted version of the key.
17701 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17702 Adjust all callers.
17703
d2576365
AD
177042002-06-30 Akim Demaille <akim@epita.fr>
17705
17706 * src/state.h (reductions_t): Rename member `nreds' as num.
17707 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17708 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17709
ccaf65bc
AD
177102002-06-30 Akim Demaille <akim@epita.fr>
17711
17712 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17713 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17714 (shifts_to): Rename as...
17715 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17716 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17717 (TRANSITION_IS_DISABLED, transitions_to): these.
17718
87675353
AD
177192002-06-30 Akim Demaille <akim@epita.fr>
17720
17721 * src/print.c (print_shifts, print_gotos): Merge into...
17722 (print_transitions): this.
17723 (print_transitions, print_errs, print_reductions): Align the
17724 lookaheads columns.
17725 (print_core, print_transitions, print_errs, print_state,
17726 print_grammar): Output empty lines separator before, not after.
17727 (state_default_rule_compute): Rename as...
17728 (state_default_rule): this.
17729 * tests/conflicts.at (Defaulted Conflicted Reduction),
17730 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17731 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17732
ce4ccb4b
AD
177332002-06-30 Akim Demaille <akim@epita.fr>
17734
17735 Display items as we display rules.
17736
17737 * src/gram.h, src/gram.c (rule_lhs_print): New.
17738 * src/gram.c (grammar_rules_partial_print): Use it.
17739 * src/print.c (print_core): Likewise.
17740 * tests/conflicts.at (Defaulted Conflicted Reduction),
17741 (Unresolved SR Conflicts): Adjust.
17742 (Unresolved SR Conflicts): Adjust and rename as...
17743 (Resolved SR Conflicts): this, as was meant.
17744 * tests/regression.at (Web2c Report): Adjust.
17745
bc933ef1
AD
177462002-06-30 Akim Demaille <akim@epita.fr>
17747
17748 * src/print.c (state_default_rule_compute): New, extracted from...
17749 (print_reductions): here.
17750 Pessimize, but clarify the code.
17751 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17752
53d4308d
AD
177532002-06-30 Akim Demaille <akim@epita.fr>
17754
17755 * src/output.c (action_row): Let default_rule be always a rule
17756 number.
17757
574fb2d5
AD
177582002-06-30 Akim Demaille <akim@epita.fr>
17759
17760 * src/closure.c (print_firsts, print_fderives, closure):
17761 Use BITSET_EXECUTE.
17762 * src/lalr.c (lookaheads_print): Likewise.
17763 * src/state.c (state_rule_lookaheads_print): Likewise.
17764 * src/print_graph.c (print_core): Likewise.
17765 * src/print.c (print_reductions): Likewise.
17766 * src/output.c (action_row): Likewise.
17767 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17768
05811fd7
AD
177692002-06-30 Akim Demaille <akim@epita.fr>
17770
17771 * src/print_graph.c: Use report_flag.
17772
0e4d5753
AD
177732002-06-30 Akim Demaille <akim@epita.fr>
17774
17775 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17776 to...
17777 * src/relation.h, src/relation.c (traverse, relation_digraph)
17778 (relation_print, relation_transpose): New.
17779
24c7d800
AD
177802002-06-30 Akim Demaille <akim@epita.fr>
17781
17782 * src/state.h, src/state.c (shifts_to): New.
17783 * src/lalr.c (build_relations): Use it.
17784
9222837b
AD
177852002-06-30 Akim Demaille <akim@epita.fr>
17786
17787 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17788 (item_number_of_rule_number, rule_number_of_item_number): New.
17789 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17790 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17791 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17792 Propagate their use.
17793 Much remains to be done, in particular wrt `shorts' from types.h.
17794
260008e5
AD
177952002-06-30 Akim Demaille <akim@epita.fr>
17796
17797 * src/symtab.c (symbol_new): Initialize the `printer' member.
17798
8a731ca8
AD
177992002-06-30 Akim Demaille <akim@epita.fr>
17800
17801 * src/LR0.c (save_reductions): Remove, replaced by...
17802 * src/state.h, src/state.c (state_reductions_set): New.
17803 (reductions, errs): Rename as...
17804 (reductions_t, errs_t): these.
17805 Adjust all dependencies.
17806
32e1e0a4
AD
178072002-06-30 Akim Demaille <akim@epita.fr>
17808
17809 * src/LR0.c (state_list_t, state_list_append): New.
17810 (first_state, last_state): Now symbol_list_t.
17811 (this_state): Remove.
17812 (new_itemsets, append_states, save_reductions): Take a state_t as
17813 argument.
17814 (set_states, generate_states): Adjust.
17815 (save_shifts): Remove, replaced by...
17816 * src/state.h, src/state.c (state_shifts_set): New.
17817 (shifts): Rename as...
17818 (shifts_t): this.
17819 Adjust all dependencies.
17820 * src/state.h (state_t): Remove the `next' member.
17821
e5fb6710
AD
178222002-06-30 Akim Demaille <akim@epita.fr>
17823
17824 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17825 escaped in slot 0.
17826
c7ca99d4
AD
178272002-06-30 Akim Demaille <akim@epita.fr>
17828
17829 Use hash.h for the state hash table.
17830
17831 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17832 (allocate_storage): Use state_hash_new.
17833 (free_storage): Use state_hash_free.
17834 (new_state, get_state): Adjust.
17835 * src/lalr.h, src/lalr.c (states): Move to...
17836 * src/states.h (state_t): Remove the `link' member, no longer
17837 used.
17838 * src/states.h, src/states.c: here.
17839 (state_hash_new, state_hash_free, state_hash_lookup)
17840 (state_hash_insert, states_free): New.
17841 * src/states.c (state_table, state_compare, state_hash): New.
17842 * src/output.c (output_actions): Do not free states now, since we
17843 still need to know the final_state number in `prepare', called
17844 afterwards. Do it...
17845 * src/main.c (main): here: call states_free after `output'.
17846
df0e7316
AD
178472002-06-30 Akim Demaille <akim@epita.fr>
17848
17849 * src/state.h, src/state.c (state_new): New, extracted from...
17850 * src/LR0.c (new_state): here.
17851 * src/state.h (STATE_ALLOC): Move to...
17852 * src/state.c: here.
17853 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17854 * src/state.h, src/state.c: here.
17855
39f41916
AD
178562002-06-30 Akim Demaille <akim@epita.fr>
17857
17858 * src/reader.c (gensym): Rename as...
17859 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17860 (getsym): Rename as...
17861 (symbol_get): this.
17862
d57650a5
AD
178632002-06-30 Akim Demaille <akim@epita.fr>
17864
17865 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17866 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17867 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17868 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17869
5a08f1ce
AD
178702002-06-30 Akim Demaille <akim@epita.fr>
17871
17872 Make the test suite pass with warnings checked.
17873
17874 * tests/actions.at (Printers and Destructors): Improve.
17875 Avoid unsigned vs. signed issues.
17876 * tests/calc.at: Don't exercise the scanner here, do it...
17877 * tests/input.at (Torturing the Scanner): here.
17878
720623af
PH
178792002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17880
88e7e941 17881 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
17882 reorganize first lines parallel to yacc.c.
17883
fb8135fa
AD
178842002-06-28 Akim Demaille <akim@epita.fr>
17885
17886 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17887 (b4_token_enum, b4_token_defines): New, factored from...
17888 * data/lalr1.cc, data/yacc.c, glr.c: here.
17889
41442480
AD
178902002-06-28 Akim Demaille <akim@epita.fr>
17891
17892 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17893 unused variables.
17894 * src/output.c (merger_output): static.
17895
e0e5bf84
AD
178962002-06-28 Akim Demaille <akim@epita.fr>
17897
ba0fe3c7 17898 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
17899 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17900 pacify GCC.
17901 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 17902
676385e2
PH
179032002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17904
17905 Accumulated changelog for new GLR parsing features.
17906
6a254321 17907 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
17908 conflicts_total_count.
17909 * src/conflicts.h: Ditto.
17910 * src/output.c (token_actions): Use the new name.
17911 (output_conflicts): Change conflp => conflict_list_heads, and
17912 confl => conflict_list for better readability.
17913 * data/glr.c: Use the new names.
17914 * NEWS: Add self to GLR announcement.
e0e5bf84 17915
676385e2
PH
17916 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17917
17918 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17919 Akim Demaille.
17920
17921 * data/bison.glr: Change name to glr.c
17922 * data/glr.c: Renamed from bison.glr.
17923 * data/Makefile.am: Add glr.c
e0e5bf84
AD
17924
17925 * src/getargs.c:
17926
676385e2 17927 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 17928 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 17929
676385e2
PH
17930 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17931
17932 * data/bison.glr: Be sure to restore the
17933 current #line when returning to the skeleton contents after having
17934 exposed the input file's #line.
17935
17936 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17937
17938 * data/bison.glr: Bring up to date with changes to bison.simple.
17939
17940 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17941
17942 * data/bison.glr: Correct definitions that use b4_prefix.
17943 Various reformatting.
17944 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
17945 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
17946 yytokenp argument; now part of stack.
17947 (yychar): Define to behave as documented.
17948 (yyclearin): Ditto.
e0e5bf84 17949
676385e2
PH
17950 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17951
17952 * src/reader.h: Add declaration for free_merger_functions.
17953
17954 * src/reader.c (merge_functions): New variable.
17955 (get_merge_function): New function.
17956 (free_merger_functions): New function.
17957 (readgram): Check for %prec that is not followed by a symbol.
17958 Handle %dprec and %merge declarations.
17959 (packgram): Initialize dprec and merger fields in rules array.
17960
17961 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
17962 conflict_list_cnt, conflict_list_free): New variables.
17963 (table_grow): Also grow conflict_table.
e0e5bf84 17964 (prepare_rules): Output dprec and merger tables.
676385e2 17965 (conflict_row): New function.
e0e5bf84 17966 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
17967 default reduction in conflicted states for GLR parser so that there
17968 are spaces for the conflict lists.
17969 (save_row): Also save conflict information.
17970 (token_actions): Allocate conflict list.
17971 (merger_output): New function.
17972 (pack_vector): Pack conflict table, too.
17973 (output_conflicts): New function to output yyconflp and yyconfl.
17974 (output_check): Allocate conflict_tos.
17975 (output_actions): Output conflict tables, also.
17976 (output_skeleton): Output b4_mergers definition.
17977 (prepare): Output b4_max_rhs_length definition.
17978 Use 'bison.glr' as default skeleton for GLR parsers.
17979
17980 * src/gram.c (glr_parser): New flag.
17981 (grammar_free): Call free_merger_functions.
17982
17983 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
17984 all pairs of conflicting reductions, rather than just all tokens
17985 causing conflicts. Needed to size conflict tables.
e0e5bf84 17986 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
17987 interface.
17988 (conflicts_print): Ditto.
17989 (count_total_conflicts): New function.
17990
17991 * src/reader.h (merger_list): New type.
17992 (merge_functions): New variable.
17993
17994 * src/lex.h (tok_dprec, tok_merge): New token types.
17995
17996 * src/gram.h (rule_s): Add dprec and merger fields.
17997 (glr_parser): New flag.
17998
17999 * src/conflicts.h (count_total_conflicts): New function.
18000
18001 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18002
18003 * doc/bison.texinfo (Generalized LR Parsing): New section.
18004 (GLR Parsers): New section.
18005 (Language and Grammar): Mention GLR parsing.
18006 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18007 Correct typo ("tge" -> "the").
18008
18009 * data/bison.glr: New skeleton for GLR parsing.
18010
18011 * tests/cxx-gram.at: New tests for GLR parsing.
18012
18013 * tests/testsuite.at: Include cxx-gram.at.
18014
18015 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 18016
676385e2
PH
18017 * src/parse-gram.y:
18018
18019 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18020
18021 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 18022
b5480d74 180232002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
18024
18025 * src/options.h, src/options.c: Remove.
18026 * src/getargs.c (short_options, long_options): New.
18027
60491a94
AD
180282002-06-27 Akim Demaille <akim@epita.fr>
18029
18030 * data/bison.simple, data/bison.c++: Rename as...
18031 * data/yacc.c, data/lalr1.cc: these.
18032 * doc/bison.texinfo (Environment Variables): Remove.
18033
9be0c25b
AD
180342002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18035
18036 * src/getargs.c (report_argmatch): Initialize strtok().
18037
1ae72863
AD
180382002-06-20 Akim Demaille <akim@epita.fr>
18039
18040 * data/bison.simple (b4_symbol_actions): New, replaces...
18041 (b4_symbol_destructor, b4_symbol_printer): these.
18042 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18043 user token numbers.
18044
87542d29
AD
180452002-06-20 Akim Demaille <akim@epita.fr>
18046
18047 * data/bison.simple (yydestructor): Rename as...
18048 (yydestruct): this.
18049
1a31ed21
AD
180502002-06-20 Akim Demaille <akim@epita.fr>
18051
18052 * src/symtab.h, src/symtab.c (symbol_type_set)
18053 (symbol_destructor_set, symbol_precedence_set): The location is
18054 the last argument.
18055 Adjust all callers.
18056
e776192e
AD
180572002-06-20 Akim Demaille <akim@epita.fr>
18058
18059 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18060 internals.
18061 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18062 Takes a location.
18063 * src/symtab.h, src/symtab.c (symbol_class_set)
18064 (symbol_user_token_number_set): Likewise.
18065 Adjust all callers.
18066 Promote complain_at.
18067 * tests/input.at (Type Clashes): Adjust.
18068
5c1180b3
AD
180692002-06-20 Akim Demaille <akim@epita.fr>
18070
18071 * data/bison.simple (YYLEX): Fix the declaration when
18072 %pure-parser.
18073
e3170060
AD
180742002-06-20 Akim Demaille <akim@epita.fr>
18075
18076 * data/bison.simple (yysymprint): Don't print the token number,
18077 just its name.
18078 * tests/actions.at (Destructors): Rename as...
18079 (Printers and Destructors): this.
18080 Also exercise %printer.
18081
253862fd
AD
180822002-06-20 Akim Demaille <akim@epita.fr>
18083
18084 * data/bison.simple (YYDSYMPRINT): New.
18085 Use it to remove many of the #if YYDEBUG/if (yydebug).
18086
366eea36
AD
180872002-06-20 Akim Demaille <akim@epita.fr>
18088
18089 * src/symtab.h, src/symtab.c (symbol_t): printer and
18090 printer_location are new members.
18091 (symbol_printer_set): New.
18092 * src/parse-gram.y (PERCENT_PRINTER): New token.
18093 Handle its associated rule.
18094 * src/scan-gram.l: Adjust.
18095 (handle_destructor_at, handle_destructor_dollar): Rename as...
18096 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18097 * src/output.c (symbol_printers_output): New.
18098 (output_skeleton): Call it.
18099 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18100 since there are already many grammar files with a user `yyprint'.
18101 Replace the calls to YYPRINT to calls to yysymprint.
18102 * tests/calc.at: Adjust.
18103 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18104 taking advantage of parser very internal details (stack size!).
18105
4f25ebb0
AD
181062002-06-20 Akim Demaille <akim@epita.fr>
18107
18108 * src/scan-gram.l: Complete the scanner with the missing patterns
18109 to pacify Flex.
18110 Use `quote' and `symbol_tag_get' where appropriate.
18111
93b68a0e
AD
181122002-06-19 Akim Demaille <akim@epita.fr>
18113
18114 * tests/actions.at (Destructors): Augment to test locations.
18115 * data/bison.simple (yydestructor): Pass it the current location
18116 if locations are enabled.
18117 Prototype only when __STDC__ or C++.
18118 Change the argument names to move into the yy name space: there is
18119 user code here.
18120
58612f1d
AD
181212002-06-19 Akim Demaille <akim@epita.fr>
18122
74310291
AD
18123 * data/bison.simple (b4_pure_if): New.
18124 Use it instead of #ifdef YYPURE.
18125
181262002-06-19 Akim Demaille <akim@epita.fr>
18127
18128 * data/bison.simple (b4_location_if): New.
58612f1d
AD
18129 Use it instead of #ifdef YYLSP_NEEDED.
18130
f25bfb75
AD
181312002-06-19 Akim Demaille <akim@epita.fr>
18132
18133 Prepare @$ in %destructor, but currently don't bind it in the
18134 skeleton, as %location use is not cleaned up yet.
18135
18136 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18137 (handle_action_at): New.
18138 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18139 a braced_code_t and a location as additional arguments.
18140 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18141 unquote one when outputting `b4_dollar_dollar'.
18142 Adjust callers.
18143 * data/bison.simple (b4_eval): Remove.
18144 (b4_symbol_destructor): Adjust.
18145 * tests/input.at (Invalid @n): Adjust.
18146
c732d2c6
AD
181472002-06-19 Zack Weinberg <zack@codesourcery.com>
18148
18149 * doc/bison.texinfo: Document ability to have multiple
18150 prologue sections.
18151
8c165d89
AD
181522002-06-18 Akim Demaille <akim@epita.fr>
18153
18154 * src/files.c (compute_base_names): When computing the output file
18155 names from the input file name, strip the directory part.
18156
ca98bf57
AD
181572002-06-18 Akim Demaille <akim@epita.fr>
18158
18159 * data/bison.simple.new: Comment changes.
18160 Reported by Andreas Schwab.
18161
0bfb02ff
AD
181622002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18163
18164 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18165 there are no `label `yyoverflowlab' defined but not used' warnings
18166 when yyoverflow is defined.
18167
24c0aad7
AD
181682002-06-18 Akim Demaille <akim@epita.fr>
18169
18170 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18171 new member.
18172 (symbol_destructor_set): Adjust.
18173 * src/output.c (symbol_destructors_output): Output the destructor
18174 locations.
18175 Output the symbol name.
18176 * data/bison.simple (b4_symbol_destructor): Adjust.
18177
5719c109
AD
181782002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18179 and Akim Demaille <akim@epita.fr>
18180
18181 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18182 what's left on the stack when the error recovery hits EOF.
18183 * tests/actions.at (Destructors): Complete to exercise this case.
18184
9280d3ef
AD
181852002-06-17 Akim Demaille <akim@epita.fr>
18186
18187 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18188 arguments is really empty, not only equal to `[]'.
18189 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18190 member.
18191 (symbol_destructor_set): New.
18192 * src/output.c (symbol_destructors_output): New.
18193 * src/reader.h (brace_code_t, current_braced_code): New.
18194 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18195 (handle_dollar): Rename as...
18196 (handle_action_dollar): this.
18197 (handle_destructor_dollar): New.
18198 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18199 (grammar_declaration): Use it.
18200 * data/bison.simple (yystos): Is always defined.
18201 (yydestructor): New.
18202 * tests/actions.at (Destructors): New.
18203 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18204
dafdc66f
AD
182052002-06-17 Akim Demaille <akim@epita.fr>
18206
18207 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18208 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18209 rule_length only when needed.
18210 * src/output.c (actions_output, token_definitions_output): Output
18211 the full M4 block.
18212 * src/symtab.c: Don't access directly to the symbol tag, use
18213 symbol_tag_get.
18214 * src/parse-gram.y: Use symbol_list_free.
18215
56c47203
AD
182162002-06-17 Akim Demaille <akim@epita.fr>
18217
18218 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18219 (symbol_list_prepend, get_type_name): Move to...
18220 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18221 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18222 Adjust all callers.
18223 (symbol_list_free): New.
18224 * src/scan-gram.l (handle_dollar): Takes a location.
18225 * tests/input.at (Invalid $n): Adjust.
18226
1e0bab92
AD
182272002-06-17 Akim Demaille <akim@epita.fr>
18228
18229 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18230 (symbol_list_prepend): New.
18231 * src/parse-gram.y (%union): `list' is a new member.
18232 (symbols.1): New, replaces...
18233 (terms_to_prec.1, nterms_to_type.1): these.
18234 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18235 Take a location as additional argument.
18236 Adjust all callers.
18237
04e60654
AD
182382002-06-15 Akim Demaille <akim@epita.fr>
18239
18240 * src/parse-gram.y: Move %token in the declaration section so that
18241 we don't depend upon CVS Bison.
18242
10e5b8bd
AD
182432002-06-15 Akim Demaille <akim@epita.fr>
18244
18245 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18246 * src/print.c (print_core): Use it.
18247
9801d40c
AD
182482002-06-15 Akim Demaille <akim@epita.fr>
18249
18250 * src/conflicts.c (log_resolution): Accept the rule involved in
18251 the sr conflicts instead of the lookahead number that points to
18252 that rule.
18253 (flush_reduce): Accept the current lookahead vector as argument,
18254 instead of the index in LA.
18255 (resolve_sr_conflict): Accept the current number of lookahead
18256 bitset to consider for the STATE, instead of the index in LA.
18257 (set_conflicts): Adjust.
18258 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18259
c0263492
AD
182602002-06-15 Akim Demaille <akim@epita.fr>
18261
18262 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18263 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18264 Adjust all dependencies.
18265 * src/lalr.c (initialize_lookaheads): Split into...
18266 (states_lookaheads_count, states_lookaheads_initialize): these.
18267 (lalr): Adjust.
18268
9757c359
AD
182692002-06-15 Akim Demaille <akim@epita.fr>
18270
18271 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18272 out of...
18273 (grammar_rules_print): here.
18274 * src/reduce.c (reduce_output): Use it.
18275 * tests/reduce.at (Useless Rules, Reduced Automaton)
18276 (Underivable Rules): Adjust.
18277
6b98e4b5
AD
182782002-06-15 Akim Demaille <akim@epita.fr>
18279
18280 Copy BYacc's nice way to report the grammar.
18281
18282 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18283 New.
18284 Don't print the rules' location, it is confusing and useless.
18285 (rule_print): Use grammar_rhs_print.
18286 * src/print.c (print_grammar): Use grammar_rules_print.
18287
6b98e4b5
AD
182882002-06-15 Akim Demaille <akim@epita.fr>
18289
18290 Complete and rationalize `useless thing' warnings.
18291
18292 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18293 (symbol_tag_print): New.
18294 Use them everywhere in place of accessing directly the tag member.
18295 * src/gram.h, src/gram.c (rule_print): New.
18296 Use it where a rule used to be printed `by hand'.
18297 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18298 (reduce_grammar_tables): Report the useless rules.
18299 (reduce_print): Useless things are a warning, not an error.
18300 Report it as such.
18301 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18302 (Reduced Automaton, Underivable Rules): Adjust.
18303 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18304 * tests/conflicts.at (Unresolved SR Conflicts)
18305 (Solved SR Conflicts): Adjust.
18306
ee000ba4
AD
183072002-06-15 Akim Demaille <akim@epita.fr>
18308
18309 Let symbols have a location.
18310
18311 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18312 (getsym): Adjust.
18313 Adjust all callers.
18314 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18315 Use location_t, not int.
18316 * src/symtab.c (symbol_check_defined): Take advantage of the
18317 location.
18318 * tests/regression.at (Invalid inputs): Adjust.
18319
8efe435c
AD
183202002-06-15 Akim Demaille <akim@epita.fr>
18321
18322 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18323 (input): Don't try to initialize yylloc here, do it in the
18324 scanner.
18325 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18326 * src/gram.h (rule_t): Change line and action_line into location
18327 and action_location, of location_t type.
18328 Adjust all dependencies.
18329 * src/location.h, src/location.c (empty_location): New.
18330 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18331 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18332 (grammar_current_rule_symbol_append)
18333 (grammar_current_rule_action_append): Expect a location as argument.
18334 * src/reader.c (grammar_midrule_action): Adjust to attach an
18335 action's location as dummy symbol location.
18336 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18337 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18338 the line numbers.
18339
1921f1d7
AD
183402002-06-14 Akim Demaille <akim@epita.fr>
18341
18342 Grammar declarations may be found in the grammar section.
18343
18344 * src/parse-gram.y (rules_or_grammar_declaration): New.
18345 (declarations): Each declaration may end with a semicolon, not
18346 just...
18347 (grammar_declaration): `"%union"'.
18348 (grammar): Branch to rules_or_grammar_declaration.
18349
4515534c
AD
183502002-06-14 Akim Demaille <akim@epita.fr>
18351
18352 * src/main.c (main): Invoke scanner_free.
18353
f958596b
AD
183542002-06-14 Akim Demaille <akim@epita.fr>
18355
18356 * src/output.c (m4_invoke): Extracted from...
18357 (output_skeleton): here.
18358 Free tempfile.
18359
2c569025
AD
183602002-06-14 Akim Demaille <akim@epita.fr>
18361
18362 * src/parse-gram.y (directives, directive, gram)
18363 (grammar_directives, precedence_directives, precedence_directive):
18364 Rename as...
18365 (declarations, declaration, grammar, grammar_declaration)
18366 (precedence_declaration, precedence_declarator): these.
18367 (symbol_declaration): New.
18368
592e8d4d
AD
183692002-06-14 Akim Demaille <akim@epita.fr>
18370
18371 * src/files.c (action_obstack): Remove, unused.
18372 (output_obstack): Remove it, and all its dependencies, as it is no
18373 longer needed.
18374 * src/reader.c (epilogue_set): Build the epilogue in the
18375 muscle_obstack.
18376 * src/output.h, src/output.c (muscle_obstack): Move to...
18377 * src/muscle_tab.h, src/muscle_tab.h: here.
18378 (muscle_init): Initialize muscle_obstack.
18379 (muscle_free): New.
18380 * src/main.c (main): Call it.
18381
0c15323d
AD
183822002-06-14 Akim Demaille <akim@epita.fr>
18383
18384 * src/location.h: New, extracted from...
18385 * src/reader.h: here.
18386 * src/Makefile.am (noinst_HEADERS): Merge into
18387 (bison_SOURCES): this.
18388 Add location.h.
18389 * src/parse-gram.y: Use location_t instead of Bison's.
18390 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18391 Use location_t instead of ints.
18392
e96c9728
AD
183932002-06-14 Akim Demaille <akim@epita.fr>
18394
18395 * data/bison.simple, data/bison.c++: Be sure to restore the
18396 current #line when returning to the skeleton contents after having
18397 exposed the input file's #line.
18398
75d1fe16
AD
183992002-06-12 Akim Demaille <akim@epita.fr>
18400
18401 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18402 eager.
18403 * tests/actions.at (Exotic Dollars): New.
18404
6c35d22c
AD
184052002-06-12 Akim Demaille <akim@epita.fr>
18406
18407 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18408 ['"/] too eagerly.
18409 * tests/input.at (Torturing the Scanner): New.
18410
1d6412ad
AD
184112002-06-11 Akim Demaille <akim@epita.fr>
18412
18413 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18414 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18415 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18416 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18417 * src/reader.c (reader): Use it.
18418
4cdb01db
AD
184192002-06-11 Akim Demaille <akim@epita.fr>
18420
18421 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18422 Adjust all callers.
18423 (scanner_last_string_free): New.
18424
44995b2e
AD
184252002-06-11 Akim Demaille <akim@epita.fr>
18426
18427 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18428 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18429 (last_string, YY_OBS_FREE): New.
18430 Use them when returning an ID.
18431
e9955c83
AD
184322002-06-11 Akim Demaille <akim@epita.fr>
18433
18434 Have Bison grammars parsed by a Bison grammar.
18435
18436 * src/reader.c, src/reader.h (prologue_augment): New.
18437 * src/reader.c (copy_definition): Remove.
18438
18439 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18440 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18441 (grammar_current_rule_prec_set, grammar_current_rule_check)
18442 (grammar_current_rule_symbol_append)
18443 (grammar_current_rule_action_append): Export.
18444 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18445 (symbol_list_action_append): Remove.
18446 Hook the routines from reader.
18447 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18448 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18449
18450 * src/reader.c (read_declarations): Remove, unused.
18451
18452 * src/parse-gram.y: Handle the epilogue.
18453 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18454 (grammar_start_symbol_set): this.
18455 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18456 * src/reader.c (readgram): Remove, unused.
18457 (reader): Adjust to insert eoftoken and axiom where appropriate.
18458
18459 * src/reader.c (copy_dollar): Replace with...
18460 * src/scan-gram.h (handle_dollar): this.
18461 * src/parse-gram.y: Remove `%thong'.
18462
18463 * src/reader.c (copy_at): Replace with...
18464 * src/scan-gram.h (handle_at): this.
18465
18466 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18467 New.
18468
18469 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18470 time being.
18471
18472 * src/reader.h, src/reader.c (grammar_rule_end): New.
18473
18474 * src/parse.y (current_type, current_class): New.
18475 Implement `%nterm', `%token' support.
18476 Merge `%term' into `%token'.
18477 (string_as_id): New.
18478 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18479 type name.
18480
18481 * src/parse-gram.y: Be sure to handle properly the beginning of
18482 rules.
18483
18484 * src/parse-gram.y: Handle %type.
18485 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18486
18487 * src/parse-gram.y: More directives support.
18488 * src/options.c: No longer handle source directives.
18489
18490 * src/parse-gram.y: Fix %output.
18491
18492 * src/parse-gram.y: Handle %union.
18493 Use the prologue locations.
18494 * src/reader.c (parse_union_decl): Remove.
18495
18496 * src/reader.h, src/reader.c (epilogue_set): New.
18497 * src/parse-gram.y: Use it.
18498
18499 * data/bison.simple, data/bison.c++: b4_stype is now either not
18500 defined, then default to int, or to the contents of %union,
18501 without `union' itself.
18502 Adjust.
18503 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18504
18505 * src/output.c (actions_output): Don't output braces, as they are
18506 already handled by the scanner.
18507
18508 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18509 characters to themselves.
18510
18511 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18512 that the epilogue has a proper #line.
18513
18514 * src/parse-gram.y: Handle precedence/associativity.
18515
18516 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18517 a terminal.
18518 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18519 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18520 at all to define terminals that cannot be emitted.
18521
18522 * src/scan-gram.l: Escape M4 characters.
18523
18524 * src/scan-gram.l: Working properly with escapes in user
18525 strings/characters.
18526
18527 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18528 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18529 grammar.
18530 Use more modest sizes, as for the time being the parser does not
18531 release memory, and therefore the process swallows a huge amount
18532 of memory.
18533
18534 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18535 stricter %token grammar.
18536
18537 * src/symtab.h (associativity): Add `undef_assoc'.
18538 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18539 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18540
18541 * tests/regression.at (Invalid %directive): Remove, as it is now
18542 meaningless.
18543 (Invalid inputs): Adjust to the new error messages.
18544 (Token definitions): The new grammar doesn't allow too many
18545 eccentricities.
18546
18547 * src/lex.h, src/lex.c: Remove.
18548 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18549 (copy_character, copy_string2, copy_string, copy_identifier)
18550 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18551 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18552 (parse_action): Remove.
18553 * po/POTFILES.in: Adjust.
18554
2e047461
AD
185552002-06-11 Akim Demaille <akim@epita.fr>
18556
cd05d13c 18557 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
18558 rule's action member: return the action as a string.
18559 Don't require `rule_length' as an argument: compute it.
18560 (grammar_current_rule_symbol_append)
18561 (grammar_current_rule_action_append): New, eved out from
18562 (readgram): here.
18563 Remove `action_flag', `rulelength', unused now.
18564
9af3fbce
AD
185652002-06-11 Akim Demaille <akim@epita.fr>
18566
18567 * src/reader.c (grammar_current_rule_prec_set).
18568 (grammar_current_rule_check): New, eved out from...
18569 (readgram): here.
18570 Remove `xaction', `first_rhs': useless.
18571 * tests/input.at (Type clashes): New.
18572 * tests/existing.at (GNU Cim Grammar): Adjust.
18573
1485e106
AD
185742002-06-11 Akim Demaille <akim@epita.fr>
18575
18576 * src/reader.c (grammar_midrule_action): New, Eved out from
18577 (readgram): here.
18578
da4160c3
AD
185792002-06-11 Akim Demaille <akim@epita.fr>
18580
18581 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18582 New.
18583 (readgram): Use them as replacement of inlined code, crule and
18584 crule1.
18585
f6d0f937
AD
185862002-06-11 Akim Demaille <akim@epita.fr>
18587
18588 * src/reader.c (grammar_end, grammar_symbol_append): New.
18589 (readgram): Use them.
18590 Make the use of `p' as local as possible.
18591
69078d4b
AD
185922002-06-10 Akim Demaille <akim@epita.fr>
18593
18594 GCJ's parser requires the tokens to be defined before the prologue.
18595
18596 * data/bison.simple: Output the token definition before the user's
18597 prologue.
18598 * tests/regression.at (Braces parsing, Duplicate string)
18599 (Mixing %token styles): Check the output from bison.
18600 (Early token definitions): New.
18601
5e424082
AD
186022002-06-10 Akim Demaille <akim@epita.fr>
18603
18604 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18605 assigning twice the same user number to a token, so that we can
18606 use it in...
18607 * src/lex.c (lex): here.
18608 Also use `symbol_class_set' instead of hand written code.
18609 * src/reader.c (parse_assoc_decl): Likewise.
18610
44536b35
AD
186112002-06-10 Akim Demaille <akim@epita.fr>
18612
18613 * src/symtab.c, src/symtab.c (symbol_class_set)
18614 (symbol_user_token_number_set): New.
18615 * src/reader.c (parse_token_decl): Use them.
18616 Use a switch instead of ifs.
18617 Use a single argument.
18618
8b9f2372
AD
186192002-06-10 Akim Demaille <akim@epita.fr>
18620
18621 Remove `%thong' support as it is undocumented, unused, duplicates
18622 `%token's job, and creates useless e-mail traffic with people who
18623 want to know what it is, why it is undocumented, unused, and
18624 duplicates `%token's job.
18625
18626 * src/reader.c (parse_thong_decl): Remove.
18627 * src/options.c (option_table): Remove "thong".
18628 * src/lex.h (tok_thong): Remove.
18629
3ae2b51f
AD
186302002-06-10 Akim Demaille <akim@epita.fr>
18631
18632 * src/symtab.c, src/symtab.c (symbol_type_set)
18633 (symbol_precedence_set): New.
18634 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18635 (value_components_used): Remove, unused.
18636
2f1afb73
AD
186372002-06-09 Akim Demaille <akim@epita.fr>
18638
18639 Move symbols handling code out of the reader.
18640
18641 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18642 (axiom): Move to...
18643 * src/symtab.h, src/symtab.c: here.
18644
18645 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18646 * src/reader.c (startval): Rename as...
18647 * src/symtab.h, src/symtab.c (startsymbol): this.
18648 * src/reader.c: Adjust.
18649
18650 * src/reader.c (symbol_check_defined, symbol_make_alias)
18651 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18652 (token_translations_init)
18653 Move to...
18654 * src/symtab.c: here.
18655 * src/reader.c (packsymbols): Move to...
18656 * src/symtab.h, src/symtab.c (symbols_pack): here.
18657 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18658 argument.
18659
e9bca3ad
AD
186602002-06-03 Akim Demaille <akim@epita.fr>
18661
18662 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18663 then statements.
18664
86eff183
AD
186652002-06-03 Akim Demaille <akim@epita.fr>
18666
18667 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18668 structs with non literals.
18669 * src/scan-skel.l: never-interactive.
18670 * src/conflicts.c (enum conflict_resolution_e): No trailing
18671 comma.
18672 * src/getargs.c (usage): Split long literal strings.
18673 Reported by Hans Aberg.
18674
717be197
AD
186752002-05-28 Akim Demaille <akim@epita.fr>
18676
18677 * data/bison.c++: Use C++ ostreams.
18678 (cdebug_): New member.
18679
670ddffd
AD
186802002-05-28 Akim Demaille <akim@epita.fr>
18681
18682 * src/output.c (output_skeleton): Be sure to allocate enough room
18683 for `/' _and_ for `\0' in full_skeleton.
18684
769b430f
AD
186852002-05-28 Akim Demaille <akim@epita.fr>
18686
18687 * data/bison.c++: Catch up with bison.simple:
18688 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18689 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18690 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18691 and popping traces.
18692
7067cb36
PH
186932002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18694
18695 * src/output.c (output_skeleton): Put an explicit path in front of
18696 the skeleton file name, rather than relying on the -I directory,
18697 to partially alleviate effects of having a skeleton file lying around
18698 in the current directory.
769b430f 18699
4a713ec2
PH
187002002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18701
769b430f 18702 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
18703 obstack_printf should be obstack_fgrow1.
18704
b408954b
AD
187052002-05-26 Akim Demaille <akim@epita.fr>
18706
18707 * src/state.h (state_t): `solved_conflicts' is a new member.
18708 * src/LR0.c (new_state): Set it to 0.
18709 * src/conflicts.h, src/conflicts.c (print_conflicts)
18710 (free_conflicts, solve_conflicts): Rename as...
18711 (conflicts_print, conflicts_free, conflicts_solve): these.
18712 Adjust callers.
18713 * src/conflicts.c (enum conflict_resolution_e)
18714 (solved_conflicts_obstack): New, used by...
18715 (log_resolution): this.
18716 Adjust to attach the conflict resolution to each state.
18717 Complete the description with the precedence/associativity
18718 information.
18719 (resolve_sr_conflict): Adjust.
18720 * src/print.c (print_state): Output its solved_conflicts.
18721 * tests/conflicts.at (Unresolved SR Conflicts)
18722 (Solved SR Conflicts): Exercise --report=all.
18723
a49aecd5
AD
187242002-05-26 Akim Demaille <akim@epita.fr>
18725
18726 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18727 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18728 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18729 (token_number_t, item_number_as_token_number)
18730 (token_number_as_item_number, muscle_insert_token_number_table):
18731 Rename as...
18732 (symbol_number_t, item_number_as_symbol_number)
18733 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18734 these, since it is more appropriate.
18735
5504898e
AD
187362002-05-26 Akim Demaille <akim@epita.fr>
18737
18738 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18739 `Error:' lines.
18740 * data/bison.simple (yystos) [YYDEBUG]: New.
18741 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18742 error recovery.
18743 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18744
ec3bc396
AD
187452002-05-25 Akim Demaille <akim@epita.fr>
18746
18747 * doc/bison.texinfo (Debugging): Split into...
18748 (Tracing): this new section, its former contents, and...
18749 (Understanding): this new section.
18750 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18751 by...
18752 (report_flag): this.
18753 Adjust all dependencies.
18754 (report_args, report_types, report_argmatch): New.
18755 (usage, getargs): Report/support -r, --report.
18756 * src/options.h
18757 (struct option_table_struct): Rename as..,
18758 (struct option_table_s): this.
18759 Rename the `set_flag' member to `flag' to match with getopt_long's
18760 struct.
18761 * src/options.c (option_table): Split verbose into an entry for
18762 %verbose, and another for --verbose.
18763 Support --report/-r, so remove -r from the obsolete --raw.
18764 * src/print.c: Attach full item sets and lookaheads reports to
18765 report_flag instead of trace_flag.
18766 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18767
78df8250
PE
187682002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18769 and Paul Eggert <eggert@twinsun.com>
769b430f 18770
78df8250
PE
18771 * data/bison.simple (yyparse): Correct error handling to conform to
18772 POSIX and yacc. Specifically, after syntax error is discovered,
18773 do not reduce further before shifting the error token.
18774 Clean up the code a bit by removing the labels yyerrdefault,
18775 yyerrhandle, yyerrpop.
18776 * NEWS: Document the above.
18777
c0c9ea05
PH
187782002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18779
18780 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18781 type; it isn't always big enough, since it doesn't necessarily
18782 include non-terminals.
769b430f 18783 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
18784 the latter can be removed.
18785 (yy_token_number_type): Remove, only one use.
18786 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18787 don't use TokenNumberType as element type.
769b430f 18788
c0c9ea05
PH
18789 * tests/regression.at: Modify expected output to agree with change
18790 to yyr1 and yytranslate.
769b430f 18791
6390a83f
FK
187922002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18793
18794 * src/reader.c (parse_action): Use copy_character instead of
18795 obstack_1grow.
18796
db7c8e9a
AD
187972002-05-13 Akim Demaille <akim@epita.fr>
18798
18799 * tests/regression.at (Token definitions): Prototype yylex and
18800 yyerror.
18801
fcc61800
PH
188022002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18803
158c687b 18804 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
18805 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18806 32-bit arithmetic.
18807 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18808
5683e9b2
AD
188092002-05-07 Akim Demaille <akim@epita.fr>
18810
18811 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18812 avoid GCC warnings.
18813
0c2d3f4c
AD
188142002-05-07 Akim Demaille <akim@epita.fr>
18815
18816 Kill GCC warnings.
18817
18818 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18819 over the RHS of each rule.
18820 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18821 * src/state.h (state_t): Member `nitems' is unsigned short.
18822 * src/LR0.c (get_state): Adjust.
18823 * src/reader.c (packgram): Likewise.
18824 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18825 `Type'.
18826 (muscle_insert_int_table): Remove, unused.
18827 (prepare_rules): Remove `max'.
18828
1565b720
AD
188292002-05-06 Akim Demaille <akim@epita.fr>
18830
18831 * src/closure.c (print_firsts): Display of the symbol tags.
18832 (bitmatrix_print): Move to...
18833 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18834 here.
18835 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18836
cfaee611
AD
188372002-05-06 Akim Demaille <akim@epita.fr>
18838
18839 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18840 hash_do_for_each.
18841
458be8e0
AD
188422002-05-06 Akim Demaille <akim@epita.fr>
18843
18844 * src/LR0.c (new_state, get_state): Instead of using the global
18845 `kernel_size' and `kernel_base', have two new arguments:
18846 `core_size' and `core'.
18847 Adjust callers.
18848
a900a624
AD
188492002-05-06 Akim Demaille <akim@epita.fr>
18850
18851 * src/reader.c (packgram): No longer end `ritem' with a 0
18852 sentinel: it is not used.
18853
d4e7d3a1
AD
188542002-05-05 Akim Demaille <akim@epita.fr>
18855
18856 New experimental feature: display the lookaheads in the report and
18857 graph.
18858
18859 * src/print (print_core): When --trace-flag, display the rules
18860 lookaheads.
18861 * src/print_graph.c (print_core): Likewise.
18862 Swap the arguments.
18863 Adjust caller.
18864
39ceb25b
AD
188652002-05-05 Akim Demaille <akim@epita.fr>
18866
18867 * tests/torture.at (Many lookaheads): New test.
18868
5372019f
AD
188692002-05-05 Akim Demaille <akim@epita.fr>
18870
18871 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18872 (GENERATE_MUSCLE_INSERT_TABLE): this.
18873 (output_int_table, output_unsigned_int_table, output_short_table)
18874 (output_token_number_table, output_item_number_table): Replace with...
18875 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18876 (muscle_insert_short_table, muscle_insert_token_number_table)
18877 (muscle_insert_item_number_table): these.
18878 Adjust all callers.
18879 (prepare_tokens): Don't free `translations', since...
18880 * src/reader.h, src/reader.c (grammar_free): do it.
18881 Move to...
18882 * src/gram.h, src/gram.c (grammar_free): here.
18883 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18884 b4_translate_max.
18885
5df5f6d5
AD
188862002-05-05 Akim Demaille <akim@epita.fr>
18887
18888 * src/output.c (output_unsigned_int_table): New.
18889 (prepare_rules): `i' is unsigned.
18890 `prhs', `rline', `r2' are unsigned int.
18891 Rename muscle `rhs_number_max' as `rhs_max'.
18892 Output muscles `prhs_max', `rline_max', and `r2_max'.
18893 Free rline and r1.
18894 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18895 to compute types instead of constant types.
18896 * tests/regression.at (Web2c Actions): Adjust.
18897
b87f8b21
AD
188982002-05-04 Akim Demaille <akim@epita.fr>
18899
18900 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18901 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18902 Adjust dependencies.
18903 * src/output.c (token_definitions_output): Be sure not to output a
18904 `#define 'a'' when fed with `%token 'a' "a"'.
18905 * tests/regression.at (Token definitions): New.
18906
8bb936e4
PE
189072002-05-03 Paul Eggert <eggert@twinsun.com>
18908
18909 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18910 for K&R C.
18911
189122002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18913
18914 * Makefile.am (SUBDIRS): Remove intl.
18915 (EXTRA_DIST): Add config/config.rpath.
18916
53c71a12
AD
189172002-05-03 Akim Demaille <akim@epita.fr>
18918
18919 * data/bison.simple (m4_if): Don't output empty enums.
18920 And actually, output valid enum definitions :(.
18921
289dd0cf
AD
189222002-05-03 Akim Demaille <akim@epita.fr>
18923
18924 * configure.bat: Remove, completely obsolete.
18925 * Makefile.am (EXTRA_DIST): Adjust.
18926 Don't distribute config.rpath...
18927 * config/Makefile.am (EXTRA_DIST): Do it.
18928
db85e524
AD
189292002-05-03 Akim Demaille <akim@epita.fr>
18930
18931 * configure.in (GETTEXT_VERSION): New.
18932 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18933
83ccf991
AD
189342002-05-03 Akim Demaille <akim@epita.fr>
18935
18936 * data/bison.simple (b4_token_enum): New.
18937 (b4_token_defines): Use it to output tokens both as #define and
18938 enums.
18939 Suggested by Paul Eggert.
18940 * src/output.c (token_definitions_output): Don't output spurious
18941 white spaces.
18942
1f418995
AD
189432002-05-03 Akim Demaille <akim@epita.fr>
18944
18945 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18946
45119f04
RA
189472002-05-02 Robert Anisko <robert@lrde.epita.fr>
18948
18949 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
18950 Update the stack class, give a try to deque as the default container.
18951
b2d52318
AD
189522002-05-02 Akim Demaille <akim@epita.fr>
18953
18954 * data/bison.simple (yyparse): Do not implement @$ = @1.
18955 (YYLLOC_DEFAULT): Adjust to do it.
18956 * doc/bison.texinfo (Location Default Action): Fix.
18957
3a8b4109
AD
189582002-05-02 Akim Demaille <akim@epita.fr>
18959
18960 * src/reader.c (parse_braces): Merge into...
18961 (parse_action): this.
18962
84614e13
AD
189632002-05-02 Akim Demaille <akim@epita.fr>
18964
18965 * configure.in (ALL_LINGUAS): Remove.
18966 * po/LINGUAS, hr.po: New.
18967
fdbcd8e2
AD
189682002-05-02 Akim Demaille <akim@epita.fr>
18969
18970 Remove the so called hairy (semantic) parsers.
18971
18972 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
18973 * src/gram.h, src/gram.c (semantic_parser): Remove.
18974 (rule_t): Remove the guard and guard_line members.
18975 * src/lex.h (token_t): remove tok_guard.
18976 * src/options.c (option_table): Remove %guard and %semantic_parser
18977 support.
18978 * src/output.c, src/output.h (guards_output): Remove.
18979 (prepare): Adjust.
18980 (token_definitions_output): Don't output the `T'
18981 tokens (???).
18982 (output_skeleton): Don't output the guards.
18983 * src/files.c, src/files.c (attrsfile): Remove.
18984 * src/reader.c (symbol_list): Remove the guard and guard_line
18985 members.
18986 Adjust dependencies.
18987 (parse_guard): Remove.
18988 * data/bison.hairy: Remove.
18989 * doc/bison.texinfo (Environment Variables): Remove occurrences of
18990 BISON_HAIRY.
18991
82b6cb3f
AD
189922002-05-02 Akim Demaille <akim@epita.fr>
18993
18994 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18995 (parse_guard): Rename the formal argument `stack_offset' as
18996 `rule_length', which is more readable.
18997 Adjust callers.
18998 (copy_at, copy_dollar): Instead of outputting the hard coded
18999 values of $$, $n and so forth, output invocation to b4_lhs_value,
19000 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
19001 Note: this patch partially drops `semantic-parser' support: it
19002 always does `rule_length - n', where semantic parsers ought to
19003 always use `-n'.
82b6cb3f
AD
19004 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19005 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19006
6cbfbcc5
AD
190072002-05-02 Akim Demaille <akim@epita.fr>
19008
19009 * configure.in (AC_INIT): Bump to 1.49b.
19010 (AM_INIT_AUTOMAKE): Short invocation.
19011
b8548114
AD
190122002-05-02 Akim Demaille <akim@epita.fr>
19013
19014 Version 1.49a.
19015
c20cd1fa
AD
190162002-05-01 Akim Demaille <akim@epita.fr>
19017
19018 * src/skeleton.h: Remove.
19019
8a9566d4
AD
190202002-05-01 Akim Demaille <akim@epita.fr>
19021
19022 * src/skeleton.h: Fix the #endif.
19023 Reported by Magnus Fromreide.
19024
8c6d399a
PE
190252002-04-26 Paul Eggert <eggert@twinsun.com>
19026
19027 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19028 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 19029 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 19030
2b7ed18a
RA
190312002-04-25 Robert Anisko <robert@lrde.epita.fr>
19032
19033 * src/scan-skel.l: Postprocess quadrigraphs.
19034
19035 * src/reader.c (copy_character): New function, used to output
19036 single characters while replacing `[' and `]' with quadrigraphs, to
19037 avoid troubles with M4 quotes.
19038 (copy_comment): Output characters with copy_character.
19039 (read_additionnal_code): Likewise.
19040 (copy_string2): Likewise.
19041 (copy_definition): Likewise.
19042
19043 * tests/calc.at: Exercise M4 quoting.
19044
34a89c50
AD
190452002-04-25 Akim Demaille <akim@epita.fr>
19046
19047 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19048 between `!' and the command.
19049 Reported by Paul Eggert.
19050
0dd1580a
RA
190512002-04-24 Robert Anisko <robert@lrde.epita.fr>
19052
19053 * tests/calc.at: Exercise prologue splitting.
19054
19055 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19056 `b4_post_prologue' instead of `b4_prologue'.
19057
19058 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19059 muscles.
19060 (output): Free pre_prologue_obstack and post_prologue_obstack.
19061 * src/files.h, src/files.c (attrs_obstack): Remove.
19062 (pre_prologue_obstack, post_prologue_obstack): New.
19063 * src/reader.c (copy_definition): Add a parameter to specify the
19064 obstack to fill, instead of using attrs_obstack unconditionally.
19065 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19066 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19067
83c1796f
PE
190682002-04-23 Paul Eggert <eggert@twinsun.com>
19069
19070 * data/bison.simple: Remove unnecessary commentary and white
19071 space differences from 1_29-branch.
19072 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19073
19074 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19075 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19076 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19077 constructors or destructors.
19078
19079 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19080
1207eeac
AD
190812002-04-23 Akim Demaille <akim@epita.fr>
19082
19083 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19084 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19085 location with columns.
19086 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19087 All reported by Paul Eggert.
19088
78ab8f67
AD
190892002-04-22 Akim Demaille <akim@epita.fr>
19090
19091 * src/reduce.c (dump_grammar): Move to...
19092 * src/gram.h, src/gram.c (grammar_dump): here.
19093 Be sure to separate long item numbers.
19094 Don't read the members of a rule's prec if its nil.
19095
133c20e2
AD
190962002-04-22 Akim Demaille <akim@epita.fr>
19097
19098 * src/output.c (table_size, table_grow): New.
19099 (MAXTABLE): Remove, replace uses with table_size.
19100 (pack_vector): Instead of dying when the table is too big, grow it.
19101
9515e8a7
AD
191022002-04-22 Akim Demaille <akim@epita.fr>
19103
19104 * data/bison.simple (yyr1): Its type is that of a token number.
19105 * data/bison.c++ (r1_): Likewise.
19106 * tests/regression.at (Web2c Actions): Adjust.
19107
23c5a174
AD
191082002-04-22 Akim Demaille <akim@epita.fr>
19109
19110 * src/reader.c (token_translations_init): 256 is now the default
19111 value for the error token, i.e., it will be assigned another
19112 number if the user assigned 256 to one of her tokens.
19113 (reader): Don't force 256 to error.
19114 * doc/bison.texinfo (Symbols): Adjust.
19115 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19116 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19117 etc. instead of 10, 20, 30 (which was used to `jump' over error
19118 (256) and undefined (2)).
19119
5fbb0954
AD
191202002-04-22 Akim Demaille <akim@epita.fr>
19121
19122 Propagate more token_number_t.
19123
19124 * src/gram.h (token_number_as_item_number)
19125 (item_number_as_token_number): New.
19126 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19127 Use it to create output_item_number_table and
19128 output_token_number_table.
19129 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19130 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19131 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19132 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19133
4f940944
AD
191342002-04-22 Akim Demaille <akim@epita.fr>
19135
19136 * src/output.h, src/output.c (get_lines_number): Remove.
19137
3ded9a63
AD
191382002-04-19 Akim Demaille <akim@epita.fr>
19139
19140 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19141 as Lex/Flex'.
19142 (Debugging): More details about enabling the debugging features.
19143 (Table of Symbols): Describe $$, $n, @$, and @n.
19144 Suggested by Tim Josling.
19145
e0c471a9
AD
191462002-04-19 Akim Demaille <akim@epita.fr>
19147
19148 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19149
fecc10cd
AD
191502002-04-10 Akim Demaille <akim@epita.fr>
19151
19152 * src/system.h: Rely on HAVE_LIMITS_H.
19153 Suggested by Paul Eggert.
19154
51dec47b
AD
191552002-04-09 Akim Demaille <akim@epita.fr>
19156
19157 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19158 full stderr, and strip it according to the bison options, instead
19159 of composing the error message from different bits.
19160 This makes it easier to check for several error messages.
19161 Adjust all the invocations.
19162 Add an invocation exercising the error token.
19163 Add an invocation demonstrating a stupid error message.
19164 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19165 Adjust the tests.
19166 Error message are for stderr, not stdout.
19167
007a50a4
AD
191682002-04-09 Akim Demaille <akim@epita.fr>
19169
19170 * src/gram.h, src/gram.c (error_token_number): Remove, use
19171 errtoken->number.
19172 * src/reader.c (reader): Don't specify the user token number (2)
19173 for $undefined, as it uselessly prevents using it.
19174 * src/gram.h (token_number_t): Move to...
19175 * src/symtab.h: here.
19176 (state_t.number): Is a token_number_t.
19177 * src/print.c, src/reader.c: Use undeftoken->number instead of
19178 hard coded 2.
19179 (Even though this 2 is not the same as above: the number of the
19180 undeftoken remains being 2, it is its user token number which
19181 might not be 2).
19182 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19183 `user_token_number_max'.
19184 Output `undef_token_number'.
19185 * data/bison.simple, data/bison.c++: Use them.
19186 Be sure to map invalid yylex return values to
19187 `undef_token_number'. This saves us from gratuitous SEGV.
19188
19189 * tests/conflicts.at (Solved SR Conflicts)
19190 (Unresolved SR Conflicts): Adjust.
19191 * tests/regression.at (Web2c Actions): Adjust.
19192
06446ccf
AD
191932002-04-08 Akim Demaille <akim@epita.fr>
19194
19195 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19196 Adding #line.
19197 Remove the duplicate `typedefs'.
19198 (RhsNumberType): Fix the declaration and various other typos.
19199 Use __ofile__.
19200 * data/bison.simple: Use __ofile__.
19201 * src/scan-skel.l: Handle __ofile__.
19202
62a3e4f0
AD
192032002-04-08 Akim Demaille <akim@epita.fr>
19204
19205 * src/gram.h (item_number_t): New, the type of item numbers in
19206 RITEM. Note that it must be able to code symbol numbers as
19207 positive number, and the negation of rule numbers as negative
19208 numbers.
19209 Adjust all dependencies (pretty many).
19210 * src/reduce.c (rule): Remove this `short *' pointer: use
19211 item_number_t.
19212 * src/system.h (MINSHORT, MAXSHORT): Remove.
19213 Include `limits.h'.
19214 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19215 (shortcpy): Remove.
19216 (MAXTABLE): Move to...
19217 * src/output.c (MAXTABLE): here.
19218 (prepare_rules): Use output_int_table to output rhs.
19219 * data/bison.simple, data/bison.c++: Adjust.
19220 * tests/torture.at (Big triangle): Move the limit from 254 to
19221 500.
19222 * tests/regression.at (Web2c Actions): Ajust.
19223
19224 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19225 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19226 passes, but produces negative #line number, once fixed, GCC is
19227 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19228 C), it passes.
19229 * src/state.h (state_h): Code input lines on ints, not shorts.
19230
bb88b0fc
AD
192312002-04-08 Akim Demaille <akim@epita.fr>
19232
19233 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19234 and then the grammar.
19235
9a636f47
AD
192362002-04-08 Akim Demaille <akim@epita.fr>
19237
19238 * src/system.h: No longer using strndup.
19239
680e8701
AD
192402002-04-07 Akim Demaille <akim@epita.fr>
19241
19242 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19243 * src/output.c (output_table_data): Return the longest number.
19244 (prepare_tokens): Output `token_number_max').
19245 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19246 New.
19247 Use them to define yy_token_number_type/TokenNumberType.
19248 Use this type for yytranslate.
19249 * tests/torture.at (Big triangle): Push the limit from 124 to
19250 253.
19251 * tests/regression.at (Web2c Actions): Adjust.
19252
817e9f41
AD
192532002-04-07 Akim Demaille <akim@epita.fr>
19254
19255 * tests/torture.at (Big triangle): New.
19256 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19257 * tests/existing.at: here.
19258
5123689b
AD
192592002-04-07 Akim Demaille <akim@epita.fr>
19260
19261 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19262 nritems.
19263 Adjust dependencies.
19264
f3849179
AD
192652002-04-07 Akim Demaille <akim@epita.fr>
19266
19267 * src/reader.c: Normalize increments to prefix form.
19268
bd02036a
AD
192692002-04-07 Akim Demaille <akim@epita.fr>
19270
19271 * src/reader.c, symtab.c: Remove debugging code.
19272
db8837cb
AD
192732002-04-07 Akim Demaille <akim@epita.fr>
19274
19275 Rename all the `bucket's as `symbol_t'.
19276
19277 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19278 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19279 * src/symtab.c, src/symtab.h (bucket): Rename as...
19280 (symbol_t): this.
19281 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19282 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19283 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19284 (buckets_new, buckets_free, buckets_do): Rename as...
19285 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19286 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19287 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19288 (symbols_new, symbols_free, symbols_do): these.
19289
72a23c97
AD
192902002-04-07 Akim Demaille <akim@epita.fr>
19291
19292 Use lib/hash for the symbol table.
19293
19294 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19295 EOF.
19296 * src/lex.c (lex): Set the `number' member of new terminals.
19297 * src/reader.c (bucket_check_defined, bucket_make_alias)
19298 (bucket_check_alias_consistence, bucket_translation): New.
19299 (reader, grammar_free, readgram, token_translations_init)
19300 (packsymbols): Adjust.
19301 (reader): Number the predefined tokens.
19302 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19303 for predefined tokens.
19304 * src/symtab.h (bucket): Remove all the hash table related
19305 members.
19306 * src/symtab.c (symtab): Replace by...
19307 (bucket_table): this.
19308 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19309 (buckets_new, buckets_do): New.
19310
280a38c3
AD
193112002-04-07 Akim Demaille <akim@epita.fr>
19312
19313 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19314 (start_symbol, max_user_token_number, semantic_parser)
19315 (error_token_number): Initialize.
19316 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19317 Initialize.
19318 (reader): Don't.
19319 (errtoken, eoftoken, undeftoken, axiom): Extern.
19320
03b31c0c
AD
193212002-04-07 Akim Demaille <akim@epita.fr>
19322
19323 * src/gram.h (rule_s): prec and precsym are now pointers
19324 to the bucket giving the priority/associativity.
19325 Member `associativity' removed: useless.
19326 * src/reduce.c, src/conflicts.c: Adjust.
19327
8b3df748
AD
193282002-04-07 Akim Demaille <akim@epita.fr>
19329
19330 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19331 Properly escape the symbols' TAG when outputting them.
19332
e601aa1d
AD
193332002-04-07 Akim Demaille <akim@epita.fr>
19334
19335 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19336
b0299a2e
AD
193372002-04-07 Akim Demaille <akim@epita.fr>
19338
19339 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19340 (LArule): this, which is an array to rule_t*.
19341 * src/print.c, src/conflicts.c: Adjust.
19342
d7e1f00c
AD
193432002-04-07 Akim Demaille <akim@epita.fr>
19344
19345 * src/gram.h (rule_t): Rename `number' as `user_number'.
19346 `number' is a new member.
19347 Adjust dependencies.
19348 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19349
cc9305dd
AD
193502002-04-07 Akim Demaille <akim@epita.fr>
19351
19352 As a result of the previous patch, it is no longer needed
19353 to reorder ritem itself.
19354
19355 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19356
b0940840
AD
193572002-04-07 Akim Demaille <akim@epita.fr>
19358
19359 Be sure never to walk through RITEMS, but use only data related to
19360 the rules themselves. RITEMS should be banished.
19361
19362 * src/output.c (output_token_translations): Rename as...
19363 (prepare_tokens): this.
19364 In addition to `translate', prepare the muscles `tname' and
19365 `toknum', which were handled by...
19366 (output_rule_data): this.
19367 Remove, and move the remainder of its outputs into...
19368 (prepare_rules): this new routines, which also merges content from
19369 (output_gram): this.
19370 (prepare_rules): Be sure never to walk through RITEMS.
19371 (output_stos): Rename as...
19372 (prepare_stos): this.
19373 (output): Always invoke prepare_states, after all, just don't use it
19374 in the output if you don't need it.
19375
643a5994
AD
193762002-04-07 Akim Demaille <akim@epita.fr>
19377
19378 * src/LR0.c (new_state): Display `nstates' as the name of the
19379 newly created state.
19380 Adjust to initialize first_state and last_state if needed.
19381 Be sure to distinguish the initial from the final state.
19382 (new_states): Create the itemset of the initial state, and use
19383 new_state.
19384 * src/closure.c (closure): Now that the initial state has its
19385 items properly set, there is no need for a special case when
19386 creating `ruleset'.
19387
19388 As a result, now the rule 0, reducing to $axiom, is visible in the
19389 outputs. Adjust the test suite.
19390
19391 * tests/conflicts.at (Solved SR Conflicts)
19392 (Unresolved SR Conflicts): Adjust.
19393 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19394 * tests/conflicts.at (S/R in initial): New.
19395
b4c4ccc2
AD
193962002-04-07 Akim Demaille <akim@epita.fr>
19397
19398 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19399 the RHS of the rules.
19400 * src/output.c (output_gram): Likewise.
19401
bba97eb2
AD
194022002-04-07 Akim Demaille <akim@epita.fr>
19403
19404 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19405 bucket.
19406 Adjust all dependencies.
19407 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19408 `number' of the buckets too.
19409 * src/gram.h: Include `symtab.h'.
19410 (associativity): Move to...
19411 * src/symtab.h: here.
19412 No longer include `gram.h'.
19413
c3b407f4
AD
194142002-04-07 Akim Demaille <akim@epita.fr>
19415
19416 * src/gram.h, src/gram.c (rules_rhs_length): New.
19417 (ritem_longest_rhs): Use it.
19418 * src/gram.h (rule_t): `number' is a new member.
19419 * src/reader.c (packgram): Set it.
19420 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19421 the end of `rules', and count them out of `nrules'.
19422 (reduce_output, dump_grammar): Adjust.
19423 * src/print.c (print_grammar): It is no longer needed to check for
19424 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19425 * tests/reduce.at (Reduced Automaton): New test.
19426
11652ab3
AD
194272002-04-07 Akim Demaille <akim@epita.fr>
19428
19429 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19430 lacking `+ 1' to nrules, Bison reported as useless a token if it
19431 was used solely to set the precedence of the last rule...
19432
26b23c1a
AD
194332002-04-07 Akim Demaille <akim@epita.fr>
19434
19435 * data/bison.c++, data/bison.simple: Don't output the current file
19436 name in #line, to avoid useless diffs between two identical
19437 outputs under different names.
19438
18bcecb0
AD
194392002-04-07 Akim Demaille <akim@epita.fr>
19440
19441 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19442 Normalize loops to using `< nrules + 1', not `<= nrules'.
19443
fa770c86
AD
194442002-04-07 Akim Demaille <akim@epita.fr>
19445
19446 * TODO: Update.
19447
d9b739c3
AD
194482002-04-07 Akim Demaille <akim@epita.fr>
19449
19450 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19451 bucket.value as bucket.number.
19452
99013900
AD
194532002-04-07 Akim Demaille <akim@epita.fr>
19454
19455 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19456 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19457 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19458 RHS, instead of being an index in RITEMS.
19459
e966383b
PE
194602002-04-04 Paul Eggert <eggert@twinsun.com>
19461
19462 * doc/bison.texinfo: Update copyright date.
19463 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19464 (Symbols): Warn about running Bison in one character set,
19465 but compiling and/or running in an incompatible one.
19466 Warn about character code 256, too.
19467
194682002-04-03 Paul Eggert <eggert@twinsun.com>
19469
19470 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19471 YYERROR_VERBOSE is nonzero, not whether it is defined.
19472
19473 Merge changes from bison-1_29-branch.
c307773e 19474
8d6c48b9
PE
194752002-03-20 Paul Eggert <eggert@twinsun.com>
19476
19477 Merge fixes from Debian bison_1.34-1.diff.
19478
19479 * configure.in (AC_PREREQ): 2.53.
19480
e53c6322
AD
194812002-03-20 Akim Demaille <akim@epita.fr>
19482
19483 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19484
9ffbeca7
PE
194852002-03-19 Paul Eggert <eggert@twinsun.com>
19486
21db0b2a
PE
19487 * src/bison.simple (YYCOPY): New macro.
19488 (YYSTACK_RELOCATE): Use it.
19489 Remove Type arg; no longer needed. All callers changed.
19490 (yymemcpy): Remove; no longer needed.
19491
9ffbeca7
PE
19492 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19493 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19494
642cb8f8
AD
194952002-03-19 Akim Demaille <akim@epita.fr>
19496
19497 Test and fix the #line outputs.
19498
19499 * tests/atlocal.at (GCC): New.
19500 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 19501 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
19502 (Action synch line, Epilogue synch line): New tests.
19503 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19504 * data/bison.simple, data/bison.c++: Use it.
19505
3c31a486
AD
195062002-03-19 Akim Demaille <akim@epita.fr>
19507
19508 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19509 (Solved SR Conflicts, %expect not enough, %expect right)
19510 (%expect too much): Move to...
19511 * tests/conflicts.at: this new file.
19512
0d8bed56
AD
195132002-03-19 Akim Demaille <akim@epita.fr>
19514
19515 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19516 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19517 that we can move to enums for instance.
19518 * src/output.c (token_definitions_output): Output a list of
19519 `token-name, token-number' instead of the #define.
19520 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19521
9208d17f
AD
195222002-03-14 Akim Demaille <akim@epita.fr>
19523
19524 Use Gettext 0.11.1.
19525
af27eacb
RA
195262002-03-09 Robert Anisko <robert@lrde.epita.fr>
19527
19528 * data/bison.c++: Make the user able to add members to the generated
19529 parser by subclassing.
19530
9101a310
RA
195312002-03-05 Robert Anisko <robert@lrde.epita.fr>
19532
19533 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19534 a character.
19535 Reported by Nicolas Tisserand and Nicolas Burrus.
19536
fff9bf0b
RA
195372002-03-04 Robert Anisko <robert@lrde.epita.fr>
19538
19539 * src/reader.c: Warn about lacking semi-colons, do not complain.
19540
64dba31e
RA
195412002-03-04 Robert Anisko <robert@lrde.epita.fr>
19542
19543 * data/bison.c++: Remove a debug line.
19544
374f5a14
RA
195452002-03-04 Robert Anisko <robert@lrde.epita.fr>
19546
19547 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19548 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19549 provide a default implementation.
19550
bfcf1f3a
AD
195512002-03-04 Akim Demaille <akim@epita.fr>
19552
19553 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19554 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19555 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19556 * tests/semantic.at (Parsing Guards): Similarly.
19557 * src/reader.at (readgram): Complain if the last rule is not ended
19558 with a semi-colon.
19559
65ccf9fc
AD
195602002-03-04 Akim Demaille <akim@epita.fr>
19561
19562 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19563 * src/closure.c: here.
19564 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19565 RTC.
19566 * src/warshall.h, src/warshall.c: Remove.
19567 * tests/sets.at (Broken Closure): Adjust.
19568
d0039cbc
AD
195692002-03-04 Akim Demaille <akim@epita.fr>
19570
19571 * src/output.c (output_skeleton): tempdir is const.
19572 bytes_read is unused.
19573
345cea78
AD
195742002-03-04 Akim Demaille <akim@epita.fr>
19575
19576 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19577 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19578 Update.
19579 From Michael Hayes.
19580
564801f7
AD
195812002-03-04 Akim Demaille <akim@epita.fr>
19582
19583 * src/closure.c (closure): `r' is unused.
19584
e5352bc7
AD
195852002-03-04 Akim Demaille <akim@epita.fr>
19586
19587 * tests/sets.at (Broken Closure): Add the ending `;'.
19588 * src/reader.at (readgram): Complain if a rule is not ended with a
19589 semi-colon.
19590
914feea9
AD
195912002-03-04 Akim Demaille <akim@epita.fr>
19592
19593 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19594 (count_sr_conflicts): Use bitset_count.
19595 * src/reduce.c (inaccessable_symbols): Ditto.
19596 (bits_size): Remove.
19597 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19598
f0250de6
AD
195992002-03-04 Akim Demaille <akim@epita.fr>
19600
19601 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19602 * src/reduce.c: Remove the `bitset_zero's following the
19603 `bitset_create's, as now it is performed by the latter.
19604
ef017502
AD
196052002-03-04 Akim Demaille <akim@epita.fr>
19606
19607 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19608 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19609 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19610 latest sources from Michael.
19611
76514394
AD
196122002-03-04 Akim Demaille <akim@epita.fr>
19613
19614 * src/output.c (output): Don't free the grammar.
19615 * src/reader.c (grammar_free): New.
19616 * src/main.c (main): Call it and don't free symtab here.
19617
55024580
AD
196182002-03-04 Akim Demaille <akim@epita.fr>
19619
19620 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19621 before returning.
19622 Reported by Benoit Perrot.
19623
f9abaa2c
AD
196242002-03-04 Akim Demaille <akim@epita.fr>
19625
19626 Use bitset operations when possible, not loops over bits.
19627
19628 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19629 bitset_or.
19630 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19631 * src/reduce.c (useless_nonterminals): Formatting changes.
19632 * src/warshall.c (TC): Use bitset_or.
19633
0e721e75
AD
196342002-03-04 Akim Demaille <akim@epita.fr>
19635
19636 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19637 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19638 Ditto.
19639
0fb1ffb1
AD
196402002-03-04 Akim Demaille <akim@epita.fr>
19641
19642 * src/lalr.c (F): Now a bitset*.
19643 Adjust all dependencies.
19644
b86796bf
AD
196452002-03-04 Akim Demaille <akim@epita.fr>
19646
19647 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19648 Adjust all dependencies.
19649
602bbf31
AD
196502002-03-04 Akim Demaille <akim@epita.fr>
19651
19652 * src/L0.c, src/LR0.h (nstates): Be size_t.
19653 Adjust comparisons (signed vs unsigned).
19654 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19655 bitset*.
19656 Adjust all dependencies.
19657
d8a0245c
AD
196582002-03-04 Akim Demaille <akim@epita.fr>
19659
19660 * src/closure.c (firsts): Now, also a bitset.
19661 Adjust all dependencies.
19662 (varsetsize): Remove, now unused.
19663 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19664
34ba9743
AD
196652002-03-04 Akim Demaille <akim@epita.fr>
19666
19667 * src/print.c: Convert to use bitset.h, not hand coded iterations
19668 over ints.
19669
ed86e78c
AD
196702002-03-04 Akim Demaille <akim@epita.fr>
19671
19672 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19673
dfdb1797
AD
196742002-03-04 Akim Demaille <akim@epita.fr>
19675
19676 * src/closure.c (ruleset): Be a bitset.
19677 (rulesetsize): Remove.
19678
7086e707
AD
196792002-03-04 Akim Demaille <akim@epita.fr>
19680
19681 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19682 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19683 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19684 * src/closure.c (fderives): Be an array of bitsets.
19685
98254360
RA
196862002-02-28 Robert Anisko <robert@lrde.epita.fr>
19687
19688 * data/bison.c++: Merge the two generated headers. Insert a copyright
19689 notice in each output file.
19690
a75c057f
AD
196912002-02-28 Akim Demaille <akim@epita.fr>
19692
19693 * data/bison.c++: Copy the prologue of bison.simple to fetch
19694 useful M4 definitions, such as b4_header_guard.
19695
06b00abc
AD
196962002-02-25 Akim Demaille <akim@epita.fr>
19697
19698 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
19699 translator friendly scheme for the bgr
19700 copyright notice.
06b00abc 19701
70e7d534
AD
197022002-02-25 Akim Demaille <akim@epita.fr>
19703
19704 * src/output.c (header_output): Remove, now handled completely via
19705 M4.
19706
abe017f6
AD
197072002-02-25 Akim Demaille <akim@epita.fr>
19708
19709 * m4/m4.m4: New, from CVS Autoconf.
19710 * configure.in: Invoke it.
19711 * src/output.c (output_skeleton): Use its result instead of the
19712 hard coded name.
19713
381fb12e
AD
197142002-02-25 Akim Demaille <akim@epita.fr>
19715
19716 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19717 Fileutils 4.1.5.
19718 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19719 * src/output.c (output_skeleton): Use mkstemp to create a real
19720 temporary file.
19721 Move the filling of `skeleton' and its muscle to...
19722 (prepare): here.
19723 (output): Move the definition of the prologue muscle to...
19724 (prepare): here.
19725 * src/system.h (DEFAULT_TMPDIR): New.
19726
6f38107f
PE
197272002-02-14 Paul Eggert <eggert@twinsun.com>
19728
19729 Remove the support for C++ namespace cleanliness; it was
19730 causing more problems than it was curing, since it didn't work
19731 properly on some nonstandard C++ compilers. This can wait
19732 for a proper C++ parser.
19733
19734 * NEWS: Document this.
19735 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19736 of C++, as it's treated like C now.
19737 * src/bison.simple (YYSTD): Remove.
19738 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19739 Treat C++ just like Standard C instead of trying to support
19740 namespace cleanliness.
19741
80cce3da
AD
197422002-02-14 Akim Demaille <akim@epita.fr>
19743
19744 * tests/regression.at (else): Adjust to Andreas' change.
19745
842e8679
AD
197462002-02-14 Akim Demaille <akim@epita.fr>
19747
19748 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19749
4bda3f10
AD
197502002-02-13 Andreas Schwab <schwab@suse.de>
19751
19752 * src/output.c (output_rule_data): Don't output NULL, it might
19753 not be defined yet.
19754
4162fa07 197552002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 19756
4162fa07
RA
19757 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19758 (Copyright notice): Update.
b418ecd8 19759
bd16a5dc
AD
197602002-02-11 Akim Demaille <akim@epita.fr>
19761
19762 * tests/regression.at (%nonassoc and eof): Don't include
19763 nonportable headers.
19764
8d69a1a3
RA
197652002-02-08 Robert Anisko <robert@lrde.epita.fr>
19766
19767 * data/bison.c++: Correct error recovery. Make the user able to
19768 initialize the starting location.
19769
9b2d0677
AD
197702002-02-07 Akim Demaille <akim@epita.fr>
19771
19772 * tests/input.at: New.
19773
69e2658b
RA
197742002-02-07 Robert Anisko <robert@lrde.epita.fr>
19775
19776 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 19777 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
19778 directives around tables only needed for debugging.
19779
4aacc3a7
RA
197802002-02-07 Robert Anisko <robert@lrde.epita.fr>
19781
19782 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19783 C++ parsers.
19784 (yy::b4_name::parse): Use print_.
19785
762a801e
RA
197862002-02-07 Robert Anisko <robert@lrde.epita.fr>
19787
19788 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19789
4bb2bc3f
RA
197902002-02-07 Robert Anisko <robert@lrde.epita.fr>
19791
19792 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19793 C++ parsers.
19794 (yy::b4_name::parse): Build verbose error messages, and use error_.
19795
6b45a3ca
RA
197962002-02-06 Robert Anisko <robert@lrde.epita.fr>
19797
19798 * data/bison.c++: Fix m4 quoting in comments.
19799
50997c6e
RA
198002002-02-06 Robert Anisko <robert@lrde.epita.fr>
19801
19802 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19803 not expanded by m4.
19804
3f3eed27
AD
198052002-02-05 Akim Demaille <akim@epita.fr>
19806
19807 * data/bison.c++: Adjust to the M4 back end.
19808 More is certainly needed.
19809
be2a1a68
AD
198102002-02-05 Akim Demaille <akim@epita.fr>
19811
19812 Give a try to M4 as a back end.
19813
19814 * lib/readpipe.c: New, from wdiff.
19815 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19816 BISON_HAIRY.
19817 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19818 specific values. Now it is m4 that performs the lookup.
19819 * src/parse-skel.y: Remove.
19820 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19821 * src/output.c (actions_output, guards_output)
19822 (token_definitions_output): No longer keeps track of the output
19823 line number, hence remove the second argument.
19824 (guards_output): Check against the guard member of a rule, not the
19825 action member.
19826 Adjust callers.
19827 (output_skeleton): Don't look for the skeleton location, let m4 do
19828 that.
19829 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19830 file will be used.
19831 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19832 (prepare): Given that for the time being changesyntax is not
19833 usable in M4, rename the muscles using `-' to `_'.
19834 Define `defines_flag', `output_parser_name' and `output_header_name'.
19835 * src/output.h (actions_output, guards_output)
19836 (token_definitions_output): Adjust prototypes.
19837 * src/scan-skel.l: Instead of scanning the skeletons, it now
19838 processes the output of m4: `__oline__' and `#output'.
19839 * data/bison.simple: Adjust to be used by M4(sugar).
19840 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19841 to date.
19842 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19843 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19844 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19845 shamelessly stolen from CVS Autoconf.
19846
beda758b
AD
198472002-02-05 Akim Demaille <akim@epita.fr>
19848
19849 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19850 * configure.in: Check for the declarations of free and malloc.
19851 * src/muscle_tab.c: Adjust.
19852
5ece6d43
AD
198532002-02-05 Akim Demaille <akim@epita.fr>
19854
19855 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19856 which have no values.
19857
5bb18f9a
AD
198582002-02-05 Akim Demaille <akim@epita.fr>
19859
19860 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19861 * data/: here.
19862
894dd62e
PE
198632002-01-29 Paul Eggert <eggert@twinsun.com>
19864
19865 * src/bison.simple (YYSIZE_T): Do not define merely because
19866 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19867 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19868
82841af7
AD
198692002-01-27 Akim Demaille <akim@epita.fr>
19870
19871 Fix `%nonassoc and eof'.
19872
19873 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19874 which were not properly copied! Replace
19875 memcpy (res->errs, src->errs, src->nerrs);
19876 with
19877 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19878 !!!
19879 * tests/regression.at (%nonassoc and eof): Adjust to newest
19880 Autotest: `.' is not in the PATH.
19881
318b76e9
AD
198822002-01-27 Akim Demaille <akim@epita.fr>
19883
19884 * tests/sets.at (AT_EXTRACT_SETS): New.
19885 (Nullable): Use it.
19886 (Firsts): New.
19887
30d2f3d5
AD
198882002-01-26 Akim Demaille <akim@epita.fr>
19889
19890 * tests/actions.at, tests/calc.at, tests/headers.at,
19891 * tests/torture.at: Adjust to the newest Autotest which no longer
19892 forces `.' in the PATH.
19893
30f8c395
AD
198942002-01-25 Akim Demaille <akim@epita.fr>
19895
19896 * tests/regression.at (%nonassoc and eof): New.
19897 Suggested by Robert Anisko.
19898
29ae55f1
AD
198992002-01-24 Akim Demaille <akim@epita.fr>
19900
19901 Bison dumps core when trying to complain about broken input files.
19902 Reported by Cris van Pelt.
19903
19904 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19905 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19906 into...
19907 (Invalid inputs): Strengthen: exercise parse_percent_token.
19908
2b548aa6
RA
199092002-01-24 Robert Anisko <robert.anisko@epita.fr>
19910
19911 * src/Makefile.am: Add bison.c++.
19912 * src/bison.c++: New skeleton.
19913
bb0146c2
AD
199142002-01-21 Paolo Bonzini <bonzini@gnu.org>
19915
19916 * po/it.po: New.
19917
bec30531
AD
199182002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19919
19920 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19921
fc6edc45
MA
199222002-01-20 Marc Autret <marc@gnu.org>
19923
19924 * src/files.c (compute_output_file_names): Fix
19925
5e5d5415
MA
199262002-01-20 Marc Autret <marc@gnu.org>
19927
19928 * tests/output.at: New test.
19929 * src/files.c (compute_base_names): Don't map extensions when
19930 the YACC flag is set, use defaults.
19931 Reported by Evgeny Stambulchik.
19932
44ea3fbd
MA
199332002-01-20 Marc Autret <marc@gnu.org>
19934
ba0fe3c7
PE
19935 * src/system.h: Need to define __attribute__ away for non-GCC
19936 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
19937 Suggested by Albert Chin-A-Young.
19938
338963d1
TVH
199392002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19940
19941 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19942 canonical definition.
19943 * src/system.h: Use the canonical definition for PARAMS (avoids
19944 a conflict with the macro from lib/hash.h).
19945
c57b2479
AD
199462002-01-11 Akim Demaille <akim@epita.fr>
19947
19948 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 19949 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 19950
b85810ae
AD
199512002-01-09 Akim Demaille <akim@epita.fr>
19952
19953 * src/files.c, src/files.h (output_infix): New.
19954 (tab_extension): Remove.
19955 (compute_base_names): Compute the former, drop the latter.
19956 * src/output.c (prepare): Insert the muscles `output-infix', and
19957 `output-suffix'.
19958 * src/parse-skel.y (string, string.1): New.
19959 (section.header): Use it.
19960 (section.yacc): Remove.
19961 (prefix): Remove too.
19962 * src/scan-skel.l: Adjust.
19963 * src/bison.simple, src/bison.hairy: Adjust.
19964
cae60122
AD
199652002-01-09 Akim Demaille <akim@epita.fr>
19966
19967 * configure.in (WERROR_CFLAGS): Compute it.
19968 * src/Makefile.am (CFLAGS): Pass it.
19969 * tests/atlocal.in (CFLAGS): Idem.
19970 * src/files.c: Fix a few warnings.
19971 (get_extension_index): Remove, unused.
19972
ae404801
AD
199732002-01-08 Akim Demaille <akim@epita.fr>
19974
19975 * src/getargs.c (AS_FILE_NAME): New.
19976 (getargs): Use it to convert DOSish file names.
19977 * src/files.c (base_name): Rename as full_base_name to avoid
19978 clashes with `base_name ()'.
19979 (filename_split): New.
19980 (compute_base_names): N-th rewrite, using filename_split.
19981
22312b71
AD
199822002-01-08 Akim Demaille <akim@epita.fr>
19983
19984 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
19985 New, stolen from the Fileutils 4.1.
19986 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19987 * configure.in: Check for the presence of memrchr, and of its
19988 prototype.
19989
a67cef01
TVH
199902002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
19991
19992 * lib/hash.h (__P): Added definition for this macro.
19993 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
19994 BUILT_SOURCES, to ensure they are generated first.
19995 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19996 %error-verbose to allow bootstrapping with bison 1.30x.
19997
2b25d624
AD
199982002-01-06 Akim Demaille <akim@epita.fr>
19999
20000 * src/reader.c (parse_braces): Don't fetch the next char, the
20001 convention is to fetch on entry.
20002 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20003 'switch' without a following semicolon.
20004 * tests/regression.at (braces parsing): New.
20005
3460813b
AD
200062002-01-06 Akim Demaille <akim@epita.fr>
20007
20008 Bison is dead wrong in its RR conflict reports.
20009
20010 * tests/torture.at (GNU Cim Grammar): New.
20011 * src/conflicts.c (count_rr_conflicts): Fix.
20012
73784c64
AD
200132002-01-06 Akim Demaille <akim@epita.fr>
20014
20015 Creating package.m4 from configure.ac causes too many problems.
20016
20017 * tests/Makefile.am (package.m4): Create it by hand,
20018 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20019
25d81090
AD
200202002-01-06 Akim Demaille <akim@epita.fr>
20021
20022 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20023 skeleton.h.
20024
a9b8959e
PE
200252002-01-04 Paul Eggert <eggert@twinsun.com>
20026
20027 * doc/bison.texinfo (Debugging):
20028 Remove YYSTDERR; it's no longer defined or used.
20029 Also, s/cstdio.h/cstdio/.
20030
25d81090
AD
200312002-01-03 Akim Demaille <akim@epita.fr>
20032
20033 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20034
1109455c
AD
200352002-01-03 Akim Demaille <akim@epita.fr>
20036
20037 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20038 tracing code to --trace, wait for a better --trace option, with
20039 args.
20040
7ea5e977
AD
200412002-01-03 Akim Demaille <akim@epita.fr>
20042
20043 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20044 The ISO C++ standard is extremely clear about it: stderr is
20045 considered a macro, not a regular symbol (see table 94 `Header
20046 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20047 Therefore std:: does not apply to it. It still does with fprintf.
20048 Also, s/cstdio.h/cstdio/.
20049
fab5b110
AD
200502002-01-03 Akim Demaille <akim@epita.fr>
20051
20052 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20053 for non system headers.
20054
aed7fd9b
AD
200552002-01-02 Akim Demaille <akim@epita.fr>
20056
20057 Equip the skeleton chain with location tracking, runtime trace,
20058 pure parser and scanner.
20059
20060 * src/parse-skel.y: Request a pure parser, locations, and prefix
20061 renaming.
20062 (%union): Having several members with the same type does not help
20063 type mismatches, simplify.
20064 (YYPRINT, yyprint): New.
20065 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20066 (skel_error): this.
20067 Handle locations.
20068 * src/scan-skel.l: Adjust to these changes.
20069 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20070 (LOCATION_PRINT, skel_control_t): New.
20071
24fad99e
AD
200722001-12-30 Akim Demaille <akim@epita.fr>
20073
20074 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20075 replace `gb' with BLANKS.
20076 * src/scan-skel.l: Adjust.
20077
a4b36db4
AD
200782001-12-30 Akim Demaille <akim@epita.fr>
20079
20080 * src/system.h: We don't need nor want bcopy.
20081 Throw away MS-DOS crap: we don't need getpid.
20082 * configure.in: We don't need strndup. It was even causing
20083 problems: because Flex includes the headers *before* us,
20084 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20085 not visible.
20086 * lib/xstrndup.c: New.
20087 * src/scan-skel.l: Use it.
20088 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20089 * src/parse-skel.y: Use %directives instead of #defines.
20090
1239777d
AD
200912001-12-30 Akim Demaille <akim@epita.fr>
20092
20093 * src/skeleton.h: New.
20094 * src/output.c (output_parser, output_master_parser): Remove, dead
20095 code.
20096 * src/output.h (get_lines_number, actions_output, guards_output)
20097 (token_definitions_output): Prototype them.
20098 * src/parse-skel.y: Add the license notice.
20099 Include output.h and skeleton.h.
20100 (process_skeleton): Returns void, and takes a single parameter.
20101 * src/scan-skel.l: Add the license notice.
20102 Include skeleton.h.
20103 Don't use %option yylineno: it seems that then Flex imagines
20104 REJECT has been used, and therefore it won't reallocate its
20105 buffers (which makes no other sense to me than a bug). It results
20106 in warnings for `unused: yy_flex_realloc'.
20107
9b3add5b
RA
201082001-12-30 Robert Anisko <robert.anisko@epita.fr>
20109
20110 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20111 (MUSCLE_INSERT_PREFIX): ...to there.
20112 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20113 (MUSCLE_INSERT_PREFIX): Move from here...
20114
20115 * src/bison.hairy: Add a section directive. Put braces around muscle
20116 names. This parser skeleton is still broken, but Bison should not
20117 choke on a bad muscle 'syntax'.
20118 * src/bison.simple: Add a section directive. Put braces around muscle
20119 names.
20120
20121 * src/files.h (strsuffix, stringappend): Add declarations.
20122 (tab_extension): Add declaration.
20123 (short_base_name): Add declaration.
20124
20125 * src/files.c (strsuffix, stringappend): No longer static. These
20126 functions are used in the skeleton parser.
20127 (tab_extension): New.
20128 (compute_base_names): Use the computations done in this function
fab5b110 20129 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
20130 names.
20131 (short_base_name): No longer static.
20132
20133 * src/output.c (output_skeleton): New.
20134 (output): Disable call to output_master_parser, and give a try to
20135 a new skeleton handling system.
20136 (guards_output, actions_output): No longer static.
20137 (token_definitions_output, get_lines_number): No longer static.
20138
20139 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20140
fab5b110 20141 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
20142 parse-skel.y.
20143
20144 * src/parse-skel.y: New file.
20145 * src/scan-skel.l: New file.
20146
b5b61c61
AD
201472001-12-29 Akim Demaille <akim@epita.fr>
20148
20149 %name-prefix is broken.
20150
20151 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20152 Adjust all dependencies.
20153 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20154 %name-prefix.
20155
20156 Renaming yylval but not yylloc is not consistent. Now we do.
20157
20158 * src/bison.simple: Prefix yylloc if used.
20159 * doc/bison.texinfo (Decl Summary): Document that.
20160
8c9a50be
AD
201612001-12-29 Akim Demaille <akim@epita.fr>
20162
20163 * doc/bison.texinfo: Promote `%long-directive' over
20164 `%long_directive'.
20165 Remove all references to fixed-output-files, yacc is enough.
20166
d99361e6
AD
201672001-12-29 Akim Demaille <akim@epita.fr>
20168
20169 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20170 user prologue. These are defaults.
20171 * tests/actions.at (Mid-rule actions): Make sure the user can
20172 define YYDEBUG and YYERROR_VERBOSE.
20173
b9cecb91
AD
201742001-12-29 Akim Demaille <akim@epita.fr>
20175
20176 * src/output.c (header_output): Don't forget to export YYLTYPE and
20177 yylloc.
20178 * tests/headers.at (export YYLTYPE): New, make sure it does.
20179 * tests/regression.at (%union and --defines, Invalid CPP headers):
20180 Move to...
20181 * tests/headers.at: here.
20182
aea13e97
AD
201832001-12-29 Akim Demaille <akim@epita.fr>
20184
20185 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20186
931394cb
AD
201872001-12-29 Akim Demaille <akim@epita.fr>
20188
20189 * tests/actions.at (Mid-rule actions): Output on a single line
20190 instead of several.
20191
704a47c4
AD
201922001-12-29 Akim Demaille <akim@epita.fr>
20193
20194 * doc/bison.texinfo: Formatting changes.
20195
091e20bb
AD
201962001-12-29 Akim Demaille <akim@epita.fr>
20197
20198 Don't store the token defs in a muscle, just be ready to output it
20199 on command. Now possible via `symbols'. Fixes a memory leak.
20200
20201 * src/output.c (token_definitions_output): New.
20202 (output_parser, header_output): Use it.
20203 * src/reader.c (symbols_save): Remove.
20204
cce71710
AD
202052001-12-29 Akim Demaille <akim@epita.fr>
20206
20207 * src/bison.simple: Do not provide a default for YYSTYPE and
20208 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20209 default.
20210
82c035a8
AD
202112001-12-29 Akim Demaille <akim@epita.fr>
20212
20213 Mid-rule actions are simply... ignored!
20214
20215 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20216 the empty-rule associated to the dummy symbol, not to the host
20217 rule.
20218 * tests/actions.at (Mid-rule actions): New.
20219
8419d367
AD
202202001-12-29 Akim Demaille <akim@epita.fr>
20221
20222 Memory leak.
20223
20224 * src/reader.c (reader): Free grammar.
20225
375d5806
AD
202262001-12-29 Akim Demaille <akim@epita.fr>
20227
20228 Memory leak.
20229
20230 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20231 since it allocates it for each state, although only one is needed.
20232 (allocate_storage): Do it here.
20233
f51cb8ff
AD
202342001-12-29 Akim Demaille <akim@epita.fr>
20235
20236 * src/options.h, src/options.c (create_long_option_table): Rename
20237 as...
20238 (long_option_table_new): this, with a clearer prototype.
20239 (percent_table): Remove, unused,
20240 * src/getargs.c (getargs): Adjust.
20241
29e88316
AD
202422001-12-29 Akim Demaille <akim@epita.fr>
20243
20244 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20245 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20246 as states.
20247
b9f71f19
AD
202482001-12-29 Akim Demaille <akim@epita.fr>
20249
20250 * src/lalr.c (build_relations): Rename `states' as `states1'.
20251 Sorry, I don't understand exactly what it is, no better name...
20252
1a2b5d37
AD
202532001-12-29 Akim Demaille <akim@epita.fr>
20254
20255 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20256 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20257 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20258 as rules.
20259
1cca533e
AD
202602001-12-29 Akim Demaille <akim@epita.fr>
20261
20262 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20263 ago.
20264
c03ae966
AD
202652001-12-29 Akim Demaille <akim@epita.fr>
20266
20267 * src/reader.c, src/reader.h (user_toknums): Remove.
20268 Adjust all users to use symbols[i]->user_token_number.
20269
5a670b1e
AD
202702001-12-29 Akim Demaille <akim@epita.fr>
20271
20272 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20273 Adjust all users to use symbols[i]->prec or ->assoc.
20274
ad949da9
AD
202752001-12-29 Akim Demaille <akim@epita.fr>
20276
20277 * src/reader.c, src/reader.h (tags): Remove.
20278 Adjust all users to use symbols[i]->tag.
20279
0e78e603
AD
202802001-12-29 Akim Demaille <akim@epita.fr>
20281
20282 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20283 and rule_table.
20284 * src/reader.c (packsymbols): Fill this table.
20285 Drop sprec.
20286 * src/conflicts.c (resolve_sr_conflict): Adjust.
20287 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20288 single table.
20289 Use symbols[i]->tag instead of tags[i].
20290
213e640e
AD
202912001-12-29 Akim Demaille <akim@epita.fr>
20292
20293 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20294 In addition, put a comment in there, to replace...
20295 * tests/regression.at (%union and C comments): Remove.
20296
e7b8bef1
AD
202972001-12-29 Akim Demaille <akim@epita.fr>
20298
20299 * tests/regression.at (Web2c Actions): Blindly move the actual
20300 output as expected output. The contents *seem* right to me, but I
20301 can't pretend reading perfectly parser tables... Nonetheless, all
20302 the other tests pass correctly, the table look OK, even though the
20303 presence of `$axiom' is to be noted: AFAICS it is useless (but
20304 harmless).
20305
b68e7744
AD
203062001-12-29 Akim Demaille <akim@epita.fr>
20307
20308 * src/reader.c (readgram): Don't add the rule 0 if there were no
20309 rules read. In other words, add it _after_ having performed
20310 grammar sanity checks.
20311 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20312
78d5bae9
AD
203132001-12-29 Akim Demaille <akim@epita.fr>
20314
20315 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20316 visible, and some states have now a different number.
20317
ff442794
AD
203182001-12-29 Akim Demaille <akim@epita.fr>
20319
20320 * src/reader.c (readgram): Bind the initial rule's lineno to that
20321 of the first rule.
20322 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20323 (Solved SR Conflicts): Adjust rule 0's line number.
20324
610ab194
AD
203252001-12-29 Akim Demaille <akim@epita.fr>
20326
20327 Fix the `GAWK Grammar' failure.
20328
20329 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20330 the reductions of the first state which was mistakenly confused
20331 with the final state because precisely final_state was initialized
20332 to 0.
20333 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20334 now noticed by Bison.
20335 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20336 have a reduction on $default.
20337
29d29c8f
AD
203382001-12-29 Akim Demaille <akim@epita.fr>
20339
20340 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20341 rule line numbers.
20342 * src/closure.c (print_closure): Likewise.
20343 * src/derives.c (print_derives): Likewise.
20344 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20345 now.
20346
7c6b64d0
AD
203472001-12-29 Akim Demaille <akim@epita.fr>
20348
20349 * src/lalr.c (lookaheads_print): New.
20350 (lalr): Call it when --trace-flag.
20351 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20352 are dumped.
20353
3d4daee3
AD
203542001-12-29 Akim Demaille <akim@epita.fr>
20355
20356 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20357 when walking through ritem, even via rule->rhs.
20358 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20359 (useful_production, useless_nonterminals): Likewise.
20360 (reduce_grammar_tables): Likewise, plus update nritems.
20361 * src/nullable.c (set_nullable): Likewise.
20362 * src/lalr.c (build_relations): Likewise.
20363 * tests/sets.at (Nullable): Adjust.
20364 Fortunately, now, the $axiom is no longer nullable.
20365
9e7f6bbd
AD
203662001-12-29 Akim Demaille <akim@epita.fr>
20367
20368 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20369 the 0-sentinel.
20370 * src/gram.c (ritem_longest_rhs): Likewise.
20371 * src/reduce.c (nonterminals_reduce): Likewise.
20372 * src/print_graph.c (print_graph): Likewise.
20373 * src/output.c (output_rule_data): Likewise.
20374 * src/nullable.c (set_nullable): Likewise.
20375
255ef638
AD
203762001-12-29 Akim Demaille <akim@epita.fr>
20377
20378 * src/output.c: Comment changes.
20379
0d8a7363
AD
203802001-12-27 Paul Eggert <eggert@twinsun.com>
20381
20382 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20383 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20384 Sparc, as they were causing more porting problems than the
20385 (minor) performance improvement was worth.
20386
20387 Also, catch up with 1.31's YYSTD.
20388
3db472b9
AD
203892001-12-27 Akim Demaille <akim@epita.fr>
20390
20391 * src/output.c (output_gram): Rely on nritems, not the
20392 0-sentinel. See below.
20393 Use -1 as separator, not 0.
20394 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20395 Rely on -1 as separator in yyrhs, instead of 0.
20396 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20397 twice `Now at end of input', therefore there are two lines less to
20398 expect.
20399
b365aa05
AD
204002001-12-27 Akim Demaille <akim@epita.fr>
20401
20402 * tests/regression.at (Unresolved SR Conflicts):
20403 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20404 below.
20405
30171f79
AD
204062001-12-27 Akim Demaille <akim@epita.fr>
20407
20408 * src/LR0.c (new_state): Recognize the final state by the fact it
20409 is reached by eoftoken.
20410 (insert_start_shifting_state, insert_eof_shifting_state)
20411 (insert_accepting_state, augment_automaton): Remove, since now
20412 these states are automatically computed from the initial state.
20413 (generate_states): Adjust.
20414 * src/print.c: When reporting a rule number to the user, substract
20415 1, so that the axiom rule is rule 0, and the first user rule is 1.
20416 * src/reduce.c: Likewise.
20417 * src/print_graph.c (print_core): For the time being, just as for
20418 the report, depend upon --trace-flags to dump the full set of
20419 items.
20420 * src/reader.c (readgram): Once the grammar read, insert the rule
20421 0: `$axiom: START-SYMBOL $'.
20422 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20423 number of the states has changed (the final state is no longer
20424 necessarily the last), catch up.
20425
75142d45
AD
204262001-12-27 Akim Demaille <akim@epita.fr>
20427
20428 Try to make the use of the eoftoken valid. Given that its value
20429 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20430 is used instead of > 0 where appropriate, (ii), depend upon nritems
20431 instead of the 0-sentinel.
20432
20433 * src/gram.h, src/gram.c (nritems): New.
20434 Expected to be duplication of nitems, but for the time being...
20435 * src/reader.c (packgram): Assert nritems and nitems are equal.
20436 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20437 * src/closure.c (print_closure, print_fderives): Likewise.
20438 * src/gram.c (ritem_print): Likewise.
20439 * src/print.c (print_core, print_grammar): Likewise.
20440 * src/print_graph.c: Likewise.
20441
b7c49edf
AD
204422001-12-27 Akim Demaille <akim@epita.fr>
20443
20444 * src/main.c (main): If there are complains after grammar
20445 reductions, then output the report anyway if requested, then die.
20446 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20447 * src/reader.c (eoftoken): New.
20448 (parse_token_decl): If the token being defined has value `0', it
20449 is the eoftoken.
20450 (packsymbols): No longer hack `tags' to insert `$' by hand.
20451 Be sure to preserve the value of the eoftoken.
20452 (reader): Make sure eoftoken is defined.
20453 Initialize nsyms to 0: now eoftoken is created just like the others.
20454 * src/print.c (print_grammar): Don't special case the eof token.
20455 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20456 lie anyway, albeit pleasant.
20457 * tests/calc.at: Exercise error messages with eoftoken.
20458 Change the grammar so that empty input is invalid.
20459 Adjust expectations.
20460 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20461
ec2da99f
AD
204622001-12-27 Akim Demaille <akim@epita.fr>
20463
20464 * configure.in: Check the protos of strchr ans strspn.
20465 Replace strchr if needed.
20466 * src/system.h: Provide the protos of strchr, strspn and memchr if
20467 missing.
20468 * lib/strchr.c: New.
20469 * src/reader.c (symbols_save): Use strchr.
20470
8adfa272
AD
204712001-12-27 Akim Demaille <akim@epita.fr>
20472
20473 * src/print.c, src/print_graph.c (escape): New.
20474 Use it to quote the TAGS outputs.
20475 * src/print_graph.c (print_state): Now errors are in red, and
20476 reductions in green.
20477 Prefer high to wide: output the state number on a line of its own.
20478
80dac38c
AD
204792001-12-27 Akim Demaille <akim@epita.fr>
20480
20481 * src/state.h, src/state.c (reductions_new): New.
20482 * src/LR0.c (set_state_table): Let all the states have a
20483 `reductions', even if reduced to 0.
20484 (save_reductions): Adjust.
20485 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20486 * src/print.c (print_reductions, print_actions): Adjust.
20487 * src/output.c (action_row): Adjust.
20488
2cec70b9
AD
204892001-12-27 Akim Demaille <akim@epita.fr>
20490
20491 * src/state.h, src/state.c (errs_new, errs_dup): New.
20492 * src/LR0.c (set_state_table): Let all the states have an errs,
20493 even if reduced to 0.
20494 * src/print.c (print_errs, print_reductions): Adjust.
20495 * src/output.c (output_actions, action_row): Adjust.
20496 * src/conflicts.c (resolve_sr_conflict): Adjust.
20497
13ca549a
AD
204982001-12-27 Akim Demaille <akim@epita.fr>
20499
20500 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20501
5092aba5
AD
205022001-12-27 Akim Demaille <akim@epita.fr>
20503
20504 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20505 * src/print.c: here.
20506 (lookaheadset, shiftset): New, used as additional storage by
20507 print_reductions.
20508 (print_results): Adjust.
20509 (print_shifts, print_gotos, print_errs): New, extracted from...
20510 (print_actions): here.
20511 * src/print_graph.c (print_actions): Remove dead code.
20512
11e2beca
AD
205132001-12-27 Akim Demaille <akim@epita.fr>
20514
20515 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20516 `$n' and `@n'.
20517
dac3c910
AD
205182001-12-27 Akim Demaille <akim@epita.fr>
20519
20520 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20521 (build_relations): Adjust.
20522
d0b0fefa
AD
205232001-12-27 Akim Demaille <akim@epita.fr>
20524
20525 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20526 duplication.
20527
adc8c848
AD
205282001-12-27 Akim Demaille <akim@epita.fr>
20529
20530 * src/reader.c (packgram): Catch nitems overflows.
20531
14d293ac
AD
205322001-12-27 Akim Demaille <akim@epita.fr>
20533
20534 * src/files.c, src/files.h (guard_obstack): Remove.
20535 * src/output.c (output): Adjust.
20536 * src/reader.c (parse_braces): New, factoring...
20537 (copy_action, copy_guard): these two which are renamed as...
20538 (parse_action, parse_guard): these.
20539 As a voluntary consequence, using braces around guards is now
20540 mandatory.
20541
f499b062
AD
205422001-12-27 Akim Demaille <akim@epita.fr>
20543
20544 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20545 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20546 members.
20547 (symbol_list_new): Adjust.
20548 (copy_action): action_line is the first line, not the last.
20549 (copy_guard): Just as for actions, store the `action' only, not
20550 the switch/case/break flesh.
20551 Don't parse the user action that might follow the guard, let...
20552 (readgram): do it, i.e., now, there can be an action after a
20553 guard.
20554 In other words the guard is just explicitly optional.
20555 (packgram): Adjust.
20556 * src/output.c (guards_output): New.
20557 (output_parser): Call it when needed.
20558 (output): Also free the guard and attrs obstacks.
20559 * src/files.c, src/files.h (obstack_save): Remove.
20560 (output_files): Remove.
20561 As a result, if one needs the former `.act' file, using an
20562 appropriate skeleton which requires actions and guards is now
20563 required.
20564 * src/main.c (main): Adjust.
20565 * tests/semantic.at: New.
20566 * tests/regression.at: Use `input.y' as input file name.
20567 Avoid 8+3 problems by requiring input.c when the test needs the
20568 parser.
20569
d945f5cd
AD
205702001-12-27 Akim Demaille <akim@epita.fr>
20571
20572 * src/reader.c (symbol_list_new): Be sure to initialize all the
20573 fields.
20574
d200e455
AD
205752001-12-27 Akim Demaille <akim@epita.fr>
20576
20577 All the hacks using a final pseudo state are now useless.
20578
20579 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20580 * src/lalr.c (nLA): New.
20581 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20582 instead of lookaheadsp from the pseudo state (nstate + 1).
20583
f9507c28
AD
205842001-12-27 Akim Demaille <akim@epita.fr>
20585
20586 * src/output.c (action_row, token_actions): Use a state_t instead
20587 of a integer, and nlookaheads instead of the following state's
20588 lookaheadsp.
20589
065fbd27
AD
205902001-12-27 Akim Demaille <akim@epita.fr>
20591
20592 * src/conflicts.c (log_resolution, flush_shift)
20593 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20594 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20595 (conflicts_print, print_reductions): Use a state_t instead of an
20596 integer when referring to a state.
20597 As much as possible, depend upon nlookaheads, instead of the
20598 `lookaheadsp' member of the following state (since lookaheads of
20599 successive states are successive, the difference between state n + 1
20600 and n served as the number of lookaheads for state n).
20601 * src/lalr.c (add_lookback_edge): Likewise.
20602 * src/print.c (print_core, print_actions, print_state)
20603 (print_results): Likewise.
20604 * src/print_graph.c (print_core, print_actions, print_state)
20605 (print_graph): Likewise.
20606 * src/conflicts.h: Adjust.
20607
1b177bd7
AD
206082001-12-27 Akim Demaille <akim@epita.fr>
20609
20610 * src/bison.hairy: Formatting/comment changes.
20611 ANSIfy.
20612 Remove `register' indications.
20613 Add plenty of `static'.
20614
7742ddeb
AD
206152001-12-27 Akim Demaille <akim@epita.fr>
20616
20617 * src/output.c (prepare): Drop the muscle `ntbase' which
20618 duplicates ntokens.
20619 * src/bison.simple: Formatting/comment changes.
20620 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20621 is an undocumented synonym.
20622
1fa14068
AD
206232001-12-22 Akim Demaille <akim@epita.fr>
20624
20625 * src/output.c (output_table_data): Change the prototype to use
20626 `int' for array ranges: some invocations do pass an int, not a
20627 short.
20628 Reported by Wayne Green.
20629
b9752825
AD
206302001-12-22 Akim Demaille <akim@epita.fr>
20631
20632 Some actions of web2c.y are improperly triggered.
20633 Reported by Mike Castle.
20634
20635 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20636 * tests/regression.at (Web2c): Rename as...
20637 (Web2c Report): this.
20638 (Web2c Actions): New.
20639
776209d6
AD
206402001-12-22 Akim Demaille <akim@epita.fr>
20641
20642 Reductions in web2c.y are improperly reported.
20643 Reported by Mike Castle.
20644
20645 * src/conflicts.c (print_reductions): Fix.
20646 * tests/regression.at (Web2c): New.
20647
275fc3ad
AD
206482001-12-18 Akim Demaille <akim@epita.fr>
20649
20650 Some host fail on `assert (!"foo")', which expands to
20651 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20652 Reported by Nelson Beebee.
20653
20654 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20655 `#define it_succeeded 0' and `assert (it_succeeded)'.
20656
897668ee
MA
206572001-12-17 Marc Autret <autret_m@epita.fr>
20658
20659 * src/bison.simple: Don't hard code the skeleton line and filename.
20660 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20661 New line counter 'skeleton_line' (skeleton-line muscle).
20662
ab3399e0
PE
206632001-12-17 Paul Eggert <eggert@twinsun.com>
20664
20665 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20666 YYDEBUG must be defined to a nonzero value.
20667
20668 * src/bison.simple (yytname): Do not assume that the user defines
20669 YYDEBUG to a properly parenthesized expression.
20670
3877f72b
AD
206712001-12-17 Akim Demaille <akim@epita.fr>
20672
20673 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20674 nlookaheads is a new member.
20675 Adjust all users.
20676 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20677 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20678 state.
776209d6 20679
331dbc1b
AD
206802001-12-17 Akim Demaille <akim@epita.fr>
20681
20682 * src/files.h, src/files.c (open_files, close_files): Remove.
20683 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20684 let...
20685 * src/reader.c (reader): Do it.
776209d6 20686
be750e4c
AD
206872001-12-17 Akim Demaille <akim@epita.fr>
20688
20689 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 20690
709ae8c6
AD
206912001-12-17 Akim Demaille <akim@epita.fr>
20692
20693 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20694 (flush_reduce): New.
20695 (resolve_sr_conflict): Adjust.
776209d6 20696
f87685c3
AD
206972001-12-17 Akim Demaille <akim@epita.fr>
20698
20699 * src/output.c (output_obstack): Be static and rename as...
20700 (format_obstack): this, to avoid any confusion with files.c's
20701 output_obstack.
20702 * src/reader.h (muscle_obstack): Move to...
20703 * src/output.h: here, since it's defined in output.c.
20704
837491d8
AD
207052001-12-17 Akim Demaille <akim@epita.fr>
20706
20707 * src/output.c (action_row, save_column, default_goto)
20708 (sort_actions, matching_state, pack_vector): Better variable
20709 locality.
20710
796d61fb
AD
207112001-12-17 Akim Demaille <akim@epita.fr>
20712
20713 * src/output.c: Various formatting changes.
776209d6 20714
64d15509
AD
207152001-12-17 Akim Demaille <akim@epita.fr>
20716
20717 * src/files.c (output_files): Free the output_obstack.
20718 * src/main.c (main): Call print and print_graph conditionally.
20719 * src/print.c (print): Work unconditionally.
20720 * src/print_graph.c (print_graph): Work unconditionally.
20721 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20722
fbc8ecb7
MA
207232001-12-16 Marc Autret <autret_m@epita.fr>
20724
20725 * src/output.c (actions_output): Fix. When we use %no-lines,
20726 there is one less line per action.
20727
f0440388
MA
207282001-12-16 Marc Autret <autret_m@epita.fr>
20729
20730 * src/bison.simple: Remove a useless #line directive.
20731 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20732 * src/output.c (get_lines_number): New.
776209d6 20733 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
20734 output muscles.
20735 Fix line numbering.
20736 (actions_output): Computes the number of lines taken by actions.
20737 (output_master_parser): Insert new skeleton which is the name of
20738 the output parser file name.
20739
a79986b8
MA
207402001-12-15 Marc Autret <autret_m@epita.fr>
20741
20742 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20743
4ec8e00f
MA
207442001-12-15 Marc Autret <autret_m@epita.fr>
20745
20746 * src/output.c (output_gram): Keep track of the hairy one.
20747
1a4648ff
AD
207482001-12-15 Akim Demaille <akim@epita.fr>
20749
20750 Make `make distcheck' work.
20751
20752 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20753 system.h which uses libgettext.h.
20754
9c2c67e6
AD
207552001-12-15 Akim Demaille <akim@epita.fr>
20756
20757 * src/nullable.c (set_nullable): Useless rules must be skipped,
20758 otherwise, since we range over their symbols, we might look at a
20759 nonterminal which no longer ``exists'', i.e., it is not counted in
20760 `nvars', hence we overflow our arrays.
20761
93ede233
AD
207622001-12-15 Akim Demaille <akim@epita.fr>
20763
20764 The header can also be produced directly, without any obstack!
20765 Yahoo!
20766
20767 * src/files.c, src/files.h (defines_obstack): Remove.
20768 (compute_header_macro): Global.
20769 (defines_obstack_save): Remove.
20770 * src/reader.c (parse_union_decl): No longer output to
20771 defines_obstack: its content can be found in the `stype' muscle
20772 anyway.
20773 (output_token_translations): Merge into...
20774 (symbols_output): this.
20775 Rename as...
20776 (symbols_save): this.
20777 (reader): Adjust.
20778 * src/output.c (header_output): New.
20779 (output): Call it.
20780
2666f928
AD
207812001-12-15 Akim Demaille <akim@epita.fr>
20782
20783 * src/reader.c (parse_union_decl): Instead of handling two obstack
20784 simultaneously, use one to define the `stype' muscle, and use the
20785 value of the latter to fill defines_obstack.
20786 (copy_comment): Remove.
20787 (copy_comment2): Work for a single obstack.
20788 Rename as...
20789 (copy_comment): this.
20790
428046f8
AD
207912001-12-15 Akim Demaille <akim@epita.fr>
20792
20793 * src/lex.c, src/lex.h (xgetc): No longer static.
20794 * src/reader.c (parse_union_decl): Revamp.
20795
ea52d706
AD
207962001-12-15 Akim Demaille <akim@epita.fr>
20797
20798 Still making progress in separating Bison into (i) input, (ii)
20799 process, (iii) output: now we can directly output the parser file
20800 without using table_obstack at all.
20801
20802 * src/files.c, src/files.h (table_obstack): Bye bye.
20803 (parser_file_name): New.
20804 * src/files.c (compute_output_file_names): Compute it.
20805 * src/output.c (actions_output, output_parser)
20806 (output_master_parser): To a file instead of an obstack.
20807
3f96f4dc
AD
208082001-12-15 Akim Demaille <akim@epita.fr>
20809
20810 Attach actions to rules, instead of pre-outputting them to
20811 actions_obstack.
20812
20813 * src/gram.h (rule_t): action and action_line are new members.
20814 * src/reader.c (symbol_list): Likewise.
20815 (copy_action): Save the actions within the rule.
20816 (packgram): Save them in rule_table.
20817 * src/output.c (actions_output): New.
20818 (output_parser): Use it on `%%actions'.
20819 (output_rule_data): Don't free rule_table.
20820 (output): Do it.
20821 (prepare): Don't save the `action' muscle.
20822 * src/bison.simple: s/%%action/%%actions/.
20823
51576fb3
AD
208242001-12-15 Akim Demaille <akim@epita.fr>
20825
20826 * src/reader.c (copy_action): When --yacc, don't append a `;'
20827 to the user action: let it fail if lacking.
dee049eb 20828 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 20829
2648a72d
AD
208302001-12-14 Akim Demaille <akim@epita.fr>
20831
20832 * src/lex.c (literalchar): Simply return the char you decoded, non
20833 longer mess around with obstacks and int pointers.
20834 Adjust all callers.
20835
92790e5b
AD
208362001-12-14 Akim Demaille <akim@epita.fr>
20837
20838 * src/lex.c (literalchar): Don't escape the special characters,
20839 just decode them, and keep them as char (before, eol was output as
20840 the 2 char string `\n' etc.).
20841 * src/output.c (output_rule_data): Use quotearg to output the
20842 token strings.
20843
927c1557
PE
208442001-12-13 Paul Eggert <eggert@twinsun.com>
20845
20846 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20847 Do not infringe on the global user namespace when using C++.
20848 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20849 All uses of `fprintf' and `stderr' changed.
20850
20851 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20852
ed8e1f68
AD
208532001-12-13 Akim Demaille <akim@epita.fr>
20854
20855 The computation of nullable is broken: it doesn't handle empty
20856 RHS's properly.
20857
20858 * tests/torture.at (GNU AWK Grammar): New.
20859 * tests/sets.at (Nullable): New.
20860 * src/nullable.c (set_nullable): Instead of blindly looping over
20861 `ritems', loop over the rules, and then over their rhs's.
20862
20863 Work around Autotest bugs.
20864
20865 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20866 frame, because Autotest understand lines starting with a `+' as
20867 traces from the shell. Then, they are not processed properly.
20868 Admittedly an Autotest bug, but we don't have time to wait for
20869 Autotest to catch up.
20870 * tests/regression.at (Broken Closure): Adjust to the new table
20871 frames.
20872 Move to...
20873 * tests/sets.at: here.
20874
cb581495
AD
208752001-12-13 Akim Demaille <akim@epita.fr>
20876
20877 * src/closure.c (closure): Use nrules instead of playing tricks
20878 with BITS_PER_WORD.
20879
2e729273
AD
208802001-12-13 Akim Demaille <akim@epita.fr>
20881
20882 * src/print.c (print_actions): Output the handling of `$' as the
20883 traces do: shifting the token EOF. Before EOF was treated as a
20884 nonterminal.
20885 * tests/regression.at: Adjust some tests.
20886 * src/print_graph.c (print_core): Complete the set of items via
20887 closure. The next-to-final and final states are still unsatisfying,
20888 but that's to be addressed elsewhere.
20889 No longer output the rule numbers, but do output the state number.
20890 A single loop for the shifts + gotos is enough, but picked a
20891 distinct color for each.
20892 (print_graph): Initialize and finalize closure.
20893
107f7dfb
AD
208942001-12-13 Akim Demaille <akim@epita.fr>
20895
20896 * src/reader.c (readgram): Remove dead code, an strip useless
20897 braces.
20898 (get_type): Remove, unused.
20899
9b53a24f
AD
209002001-12-12 Akim Demaille <akim@epita.fr>
20901
20902 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20903 on that of lib/error.c.
20904
dbfb6dcd
AD
209052001-12-12 Akim Demaille <akim@epita.fr>
20906
20907 Some hosts don't like `/' in includes.
20908
20909 * src/system.h: Include libgettext.h without qualifying the path.
20910 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20911 $(top_srcdir).
20912
c25fb648
MA
209132001-12-11 Marc Autret <autret_m@epita.fr>
20914
20915 * src/output.c (output_parser): Remove useless muscle.
20916
710ddc4f
MA
209172001-12-11 Marc Autret <autret_m@epita.fr>
20918
20919 * src/bison.simple: Remove #line just before %%epilogue. It
20920 is now handled in ...
20921 * src/reader.c (read_additionnal_code): Add the output of a
20922 #line for the epilogue.
20923
e83d80b8
MA
209242001-12-10 Marc Autret <autret_m@epita.fr>
20925
927c1557 20926 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
20927 replace precedent remove.
20928 * src/bison.simple: Remove #line before %%prologue because
20929 %%input-line is wrong at this time.
20930
971d5158
MA
209312001-12-10 Marc Autret <autret_m@epita.fr>
20932
20933 * src/reader.c (symbols_output): Clean up.
927c1557 20934 * src/output.c (output_gram, output): Clean up.
971d5158 20935
5edafffd
AD
209362001-12-10 Akim Demaille <akim@epita.fr>
20937
20938 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20939 * src/LR0.c (set_state_table): here.
20940 * src/lalr.c (lalr): Call it.
20941
0279f8e9
AD
209422001-12-10 Akim Demaille <akim@epita.fr>
20943
20944 * src/state.h (shifts): Remove the `number' member: shifts are
20945 attached to state, hence no longer need to be labelled with a
20946 state number.
20947
190c4f5f
AD
209482001-12-10 Akim Demaille <akim@epita.fr>
20949
20950 Now that states have a complete set of members, the linked list of
20951 shifts is useless: just fill directly the state's shifts member.
20952
20953 * src/state.h (shifts): Remove the `next' member.
20954 * src/LR0.c (first_state, last_state): Remove.
20955 Adjust the callers.
20956 (augment_automaton): Don't look for the shifts that must be added
20957 a shift on EOF: it is those of the state we looked for! But now,
20958 since shifts are attached, it is no longer needed to looking
20959 merely by its id: its number.
20960
2a73b93d
AD
209612001-12-10 Akim Demaille <akim@epita.fr>
20962
20963 * src/LR0.c (augment_automaton): Better variable locality.
20964 Remove an impossible branch: if there is a state corresponding to
20965 the start symbol being shifted, then there is shift for the start
20966 symbol from the initial state.
20967
74392f6a
AD
209682001-12-10 Akim Demaille <akim@epita.fr>
20969
20970 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
20971 only when appropriate: when insert_start_shifting_state' is not
20972 invoked.
20973 * tests/regression.at (Rule Line Numbers): Adjust.
20974
37c82725
AD
209752001-12-10 Akim Demaille <akim@epita.fr>
20976
20977 * src/LR0.c (augment_automaton): Now that all states have shifts,
20978 merge the two cases addition shifts to the initial state.
20979
6a164e0c
AD
209802001-12-10 Akim Demaille <akim@epita.fr>
20981
20982 * src/lalr.c (set_state_table): Move to...
20983 * src/LR0.c: here.
20984 * src/lalr.c (lalr): Don't call it...
20985 * src/LR0.c (generate_states): do it.
20986 * src/LR0.h (first_state): Remove, only the table is used.
20987
7215de24
AD
209882001-12-10 Akim Demaille <akim@epita.fr>
20989
20990 * src/LR0.h (first_shift, first_reduction): Remove.
20991 * src/lalr.c: Don't use first_shift: find shifts through the
20992 states.
20993
80e25d4d
AD
209942001-12-10 Akim Demaille <akim@epita.fr>
20995
20996 * src/LR0.c: Attach shifts to states as soon as they are
20997 computed.
20998 * src/lalr.c (set_state_table): Instead of assigning shifts to
20999 state, just assert that the mapping was properly done.
21000
0ab3728b
AD
210012001-12-10 Akim Demaille <akim@epita.fr>
21002
21003 * src/LR0.c (insert_start_shift): Rename as...
21004 (insert_start_shifting_state): this.
21005 (insert_eof_shifting_state, insert_accepting_state): New.
21006 (augment_automaton): Adjust.
21007 Better locality of the variables.
21008 When looking if the start_symbol is shifted from the initial
21009 state, using `while (... symbol != start_symbol ...)' sounds
21010 better than `while (... symbol < start_symbol ...)': If fail
21011 to see how the order between symbols could be relevant!
21012
78af9bbc
AD
210132001-12-10 Akim Demaille <akim@epita.fr>
21014
21015 * src/getargs.h: Don't declare `spec_name_prefix' and
21016 `spec_file_prefix', declared by src/files.h.
21017 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21018 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21019 * src/output.c (prepare): Adjust.
21020 * src/reader.c (symbols_output): Likewise.
21021 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21022
bdef2a41
AD
210232001-12-10 Akim Demaille <akim@epita.fr>
21024
21025 * src/muscle_tab.c (muscle_init): NULL is a better default than
21026 `"0"'.
21027
3735969c
AD
210282001-12-10 Akim Demaille <akim@epita.fr>
21029
21030 * src/reader.c (reader): Calling symbols_output once is enough.
21031
49701457
AD
210322001-12-10 Akim Demaille <akim@epita.fr>
21033
21034 Now that states have a complete set of members, the linked list of
21035 reductions is useless: just fill directly the state's reductions
21036 member.
21037
21038 * src/state.h (struct reductions): Remove member `number' and
21039 `next'.
21040 * src/LR0.c (first_reduction, last_reduction): Remove.
21041 (save_reductions): Don't link the new reductions, store them in
21042 this_state.
21043 * src/lalr.c (set_state_table): No need to attach reductions to
21044 states, it's already done.
21045 * src/output.c (output_actions): No longer free the shifts, then
21046 the reductions, then the states: free all the states and their
21047 members.
21048
0edad749
AD
210492001-12-10 Akim Demaille <akim@epita.fr>
21050
21051 * src/options.c (OPTN, DRTV, BOTH): New.
21052 (option_table): Use them.
21053
0edad749
AD
21054 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21055 the job of system.h.
21056 * src/options.c: Don't include stdio.h and xalloc.h for the same
21057 reasons.
21058
5449dd0f
AD
210592001-12-10 Akim Demaille <akim@epita.fr>
21060
21061 * src/output.c (output, prepare): Make sure the values of the
21062 muscles `action' and `prologue' are 0-terminated.
21063
a870c567
AD
210642001-12-10 Akim Demaille <akim@epita.fr>
21065
21066 Clean up GCC warnings.
21067
21068 * src/reader.c (copy_action): `buf' is not used.
21069 (parse_skel_decl): Be static.
21070 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21071 * src/options.h (create_long_option_table): Have a real prototype.
21072 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21073 (hash_delete_at): Return const void *.
21074 Adjust casts to preserve the const.
21075
80df8768
AD
210762001-12-10 Akim Demaille <akim@epita.fr>
21077
21078 * configure.in: Require 2.52g.
21079 M4 is not needed, but AUTOM4TE is.
21080 * m4/m4.m4: Remove.
21081 * tests/Makefile.am: Adjust.
21082
f693ad14
AD
210832001-12-10 Akim Demaille <akim@epita.fr>
21084
21085 One structure for states is enough, even though theoretically
21086 there are LR(0) states and LALR(1) states.
21087
21088 * src/lalr.h (state_t): Remove.
21089 (state_table): Be state_t **, not state_t *.
21090 * src/state.h (core, CORE_ALLOC): Rename as...
21091 (state_t, STATE_ALLOC): this.
21092 Add the LALR(1) members: shifts, reductions, errs.
21093 * src/LR0.c (state_table): Rename as...
21094 (state_hash): this, to avoid name clashes with the global
21095 `state_table'.
21096 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21097 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21098
74ffbcb6
AD
210992001-12-10 Akim Demaille <akim@epita.fr>
21100
21101 Bison dumps core on bash.y.
21102 Reported by Pascal Bart.
21103
21104 * src/warshall.c (bitmatrix_print): New.
21105 (TC): Use it.
ba0fe3c7 21106 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
21107 j must be the outer loop.
21108 * tests/regression.at (Broken Closure): New.
21109
07708e19
AD
211102001-12-05 Akim Demaille <akim@epita.fr>
21111
21112 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21113 its argument.
ba1ecc07 21114 Reported by Peter Hamorsky.
07708e19 21115
92b16366
AD
211162001-12-05 Akim Demaille <akim@epita.fr>
21117
21118 * src/conflicts.c (err_table): Remove.
21119 (resolve_sr_conflict): Adjust.
21120 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21121 Rename as...
21122 (state_t.reductions, state_t.shifts): this.
21123
076ab033
AD
211242001-12-05 Akim Demaille <akim@epita.fr>
21125
21126 * src/reduce.c (reduce_grammar_tables): No longer disable the
21127 removal of useless rules via CPP but via `if (0)', so that the
21128 compiler still check the code is valid.
21129 For instance, it should have noticed `rline' no longer exists: use
21130 the `line' member of rule_t.
21131 * src/gram.c (dummy, rline): Remove, unused.
21132
3843c413
AD
211332001-12-05 Akim Demaille <akim@epita.fr>
21134
21135 * src/output.c (pack_vector): Use assert, not berror.
21136 * src/main.c (berror): Remove, unused.
21137
43168960
AD
211382001-12-05 Akim Demaille <akim@epita.fr>
21139
21140 New experimental feature: if --verbose --trace output all the
21141 items of a state, not only its kernel.
21142
21143 * src/print.c (print_core): If `trace_flag', then invoke closure
21144 before outputting the items of the state (print_core is no longer
21145 a correct name them).
21146 (print_results): Invoke new_closure/free_closure if needed.
21147
b2872512
AD
211482001-12-05 Akim Demaille <akim@epita.fr>
21149
21150 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21151 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21152 (nitemset): for consistency with the rest of the project.
21153
23cbcc6c
AD
211542001-12-05 Akim Demaille <akim@epita.fr>
21155
21156 * src/closure.c (print_closure): Improve.
21157 (closure): Use it for printing input and output.
21158
03ec521c
AD
211592001-12-05 Akim Demaille <akim@epita.fr>
21160
21161 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21162 indexed by nonterminals.
21163
3a7456dd
AD
211642001-12-05 Akim Demaille <akim@epita.fr>
21165
21166 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21167 what it was!).
21168 * src/warshall.h: Remove accidental duplication of the content.
21169
1cbcf2e7
AD
211702001-12-05 Akim Demaille <akim@epita.fr>
21171
21172 * src/closure.c (set_fderives): De-obfuscate.
21173
84182270
AD
211742001-12-05 Akim Demaille <akim@epita.fr>
21175
21176 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21177
3f6f053c
AD
211782001-12-05 Akim Demaille <akim@epita.fr>
21179
21180 * src/closure.c (set_firsts): De-obfuscate.
21181
7a5350ba
AD
211822001-12-05 Akim Demaille <akim@epita.fr>
21183
21184 * src/output.c (action_row): De-obfuscate
21185 using the good o' techniques: arrays not pointers, variable
21186 locality, BITISSET, RESETBIT etc.
21187
d954473d
AD
211882001-12-05 Akim Demaille <akim@epita.fr>
21189
21190 Pessimize the code to simplify it: from now on, all the states
21191 have a valid SHIFTS, which NSHIFTS is possibly 0.
21192
21193 * src/LR0.c (shifts_new): Be global and move to..
21194 * src/state.c, src/state.h: here.
21195 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21196 * src/print_graph: Adjust.
21197
9839bbe5
AD
211982001-12-05 Akim Demaille <akim@epita.fr>
21199
21200 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21201 * src/conflicts.c: Use it.
21202 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21203 incorrectly ``simplified''.
21204
9f136c07
AD
212052001-12-05 Akim Demaille <akim@epita.fr>
21206
21207 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21208 using the good o' techniques: arrays not pointers, variable
21209 locality, BITISSET, RESETBIT etc.
21210
b608206e
AD
212112001-12-05 Akim Demaille <akim@epita.fr>
21212
21213 * src/state.h (SHIFT_SYMBOL): New.
21214 * src/conflicts.c: Use it to deobfuscate.
21215
52afa962
AD
212162001-12-05 Akim Demaille <akim@epita.fr>
21217
21218 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21219 (print_reductions): De-obfuscate using the good o' techniques:
21220 arrays not pointers, variable locality, BITISSET.
21221
e74dc321
AD
212222001-12-05 Akim Demaille <akim@epita.fr>
21223
21224 * src/conflicts.c (print_reductions): Arrays, not pointers.
21225 Use BITISSET.
21226
768fca83
AD
212272001-12-05 Akim Demaille <akim@epita.fr>
21228
21229 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21230
a17e599f
AD
212312001-12-05 Akim Demaille <akim@epita.fr>
21232
21233 * src/conflicts.c (print_reductions): Improve variable locality.
21234
a04bc341
AD
212352001-12-05 Akim Demaille <akim@epita.fr>
21236
21237 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21238
c8ea038e
AD
212392001-12-05 Akim Demaille <akim@epita.fr>
21240
21241 * src/conflicts.c (print_reductions): Improve variable locality.
21242
aa2aab3c
AD
212432001-12-05 Akim Demaille <akim@epita.fr>
21244
21245 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21246 * src/lalr.c: Use them.
21247
b178c8cc
AD
212482001-12-05 Akim Demaille <akim@epita.fr>
21249
21250 * src/LR0.c (augment_automaton): Formatting changes.
21251 Better variable locality.
21252
f67d13aa
AD
212532001-12-05 Akim Demaille <akim@epita.fr>
21254
21255 * src/lalr.c (matrix_print): New.
21256 (transpose): Use it.
21257 Use arrays instead of pointers.
21258
c2713865
AD
212592001-12-05 Akim Demaille <akim@epita.fr>
21260
21261 * src/lalr.c (maxrhs): Move to...
21262 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21263 * src/lalr.c (build_relations): Adjust.
21264
9887c18a
AD
212652001-12-05 Akim Demaille <akim@epita.fr>
21266
21267 * src/lalr.c (transpose): Free the memory allocated to the
21268 argument, as it is replaced by the results by the unique caller.
21269 (build_relations): Merely invoke transpose: it handles the memory
21270 deallocation.
21271 Improve variable locality.
21272 Avoid variables used as mere abbreviations.
21273 (compute_lookaheads): Use arrays instead of pointers.
21274
4d4f699c
AD
212752001-12-05 Akim Demaille <akim@epita.fr>
21276
21277 * src/lalr.c (initialize_F): Improve variable locality.
21278 Avoid variables used as mere abbreviations.
21279
80a69750
AD
212802001-12-05 Akim Demaille <akim@epita.fr>
21281
21282 * src/derives.c (print_derives): Display the ruleno.
21283 * src/lalr.c (initialize_F, transpose): Better variable locality
21284 to improve readability.
21285 Avoid variables used as mere abbreviations.
21286
fe961097
AD
212872001-12-05 Akim Demaille <akim@epita.fr>
21288
21289 * src/lalr.c (traverse): Use arrays instead of pointers.
21290
e3e4e814
AD
212912001-12-05 Akim Demaille <akim@epita.fr>
21292
21293 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21294 the handling of squeue.
21295 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21296
630e182b
AD
212972001-12-05 Akim Demaille <akim@epita.fr>
21298
21299 Because useless nonterminals are now kept alive (instead of being
21300 `destroyed'), we now sometimes examine them, and store information
21301 related to them. Hence we need to know their number, and adjust
21302 memory allocations.
21303
21304 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21305 static.
21306 * src/LR0.c (allocate_itemsets): The memory allocated to
21307 `symbol_count' was used for two different purpose: once to count
21308 the number of occurrences of each symbol, and later reassigned to
21309 `shift_symbol', containing the symbol that can be shifted from a
21310 given state.
21311 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21312 only, and...
21313 (new_itemsets): Allocate `shift_symbol' here.
21314 (allocate_itemsets): symbol_count includes useless nonterminals.
21315 Make room for them.
21316 (free_storage): Use `free', not `XFREE', for pointers that cannot
21317 be null.
21318
81b51460
AD
213192001-12-05 Akim Demaille <akim@epita.fr>
21320
21321 * src/nullable.c (set_nullable): Deobfuscate the handling of
21322 ritem.
21323 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21324
3067fbef
AD
213252001-12-05 Akim Demaille <akim@epita.fr>
21326
21327 * src/gram.c, src/gram.h (ritem_print): New.
21328 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21329 (This useless function was defined only to work around VMS linkers
21330 that can't handle compilation units with variables only).
21331 * src/reduce.c (dump_grammar): Use it to trace the construction of
21332 ritem.
21333
c2bea5f9
PE
213342001-12-04 Paul Eggert <eggert@twinsun.com>
21335
7d27c823
PE
21336 * src/bison.simple (union yyalloc): Change member names
21337 to be the same as the stack names.
21338 (yyparse): yyptr is now union yyalloc *, not char *.
21339 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21340 and may generate better code on some machines.
c2bea5f9
PE
21341 (yystpcpy): Use prototype if __STDC__ is defined, not just
21342 if __cplusplus is defined.
35687a9d 21343
2c8a9dfa
AD
213442001-11-30 Akim Demaille <akim@epita.fr>
21345
21346 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21347 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21348 Gettext doesn't compile cleanly, and dies with -Werror.
21349 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21350 Include WARNING_CFLAGS here.
21351 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21352 before being defined.
21353
f4e421e6
AD
213542001-11-27 Paul Eggert <eggert@twinsun.com>
21355
21356 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21357 First arg is int, not unsigned.
21358 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21359 (SIZE_MAX, UINT_MAX): New macros.
21360 (quotearg_n_options): Abort if N is negative.
21361 Avoid overflow check on hosts where size_t is 64 bits and int
21362 is 32 bits, as overflow is impossible there.
21363 Fix off-by-one typo that caused unnecessary reallocation.
21364
7093d0f5
AD
213652001-11-29 Paul Eggert <eggert@twinsun.com>
21366
21367 Name space cleanup in generated parser.
21368
21369 * doc/bison.texinfo (Bison Parser): Discuss system headers
21370 and their effect on the user name space.
21371
21372 * src/bison.simple:
21373 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21374 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21375 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21376
21377 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21378 on user names when possible.
21379
21380 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21381 Simplify test for whather <alloca.h> exists.
21382
21383 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21384
21385 (<stdio.h>): Include if YYDEBUG.
21386
21387 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21388 ! defined (yyoverflow) && ! defined (yymemcpy).
21389
21390 (yymemcpy, yyparse): Rename local variables as needed so that
21391 they all begin with 'yy'.
21392
21393 (yystrlen, yystpcpy): New functions.
21394
21395 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21396 All uses changed.
21397
21398 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21399 instead of relying on string.h functions. Use YYSTACK_ALLOC
21400 and YYSTACK_FREE instead of malloc and free.
21401
fd51e5ff
AD
214022001-11-30 Akim Demaille <akim@epita.fr>
21403
21404 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21405 before their first uses.
21406 (YYBISON, YYPURE): Move to the top of the output.
21407
7d13ff5f
AD
214082001-11-30 Akim Demaille <akim@epita.fr>
21409
21410 * tests/reduce.at (Useless Nonterminals): Fix.
21411
892a3995
AD
214122001-11-30 Akim Demaille <akim@epita.fr>
21413
21414 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21415 if body instead of `;' to pacify GCC's warnings.
21416
68f1e3ed
AD
214172001-11-30 Akim Demaille <akim@epita.fr>
21418
21419 Instead of mapping the LHS of unused rules to -1, keep the LHS
21420 valid, but flag the rules as invalid.
21421
21422 * src/gram.h (rule_t): `useful' is a new member.
21423 * src/print.c (print_grammar): Adjust.
21424 * src/derives.c (set_derives): Likewise.
21425 * src/reader.c (packgram, reduce_output): Likewise.
21426 * src/reduce.c (reduce_grammar_tables): Likewise.
21427 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21428
d2d1b42b
AD
214292001-11-30 Akim Demaille <akim@epita.fr>
21430
21431 * src/reduce.c (reduce_output): Formatting changes.
21432 * src/print.c (print_results, print_grammar): Likewise.
21433 * tests/regression.at (Rule Line Numbers)
21434 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21435
760b53a8
AD
214362001-11-30 Akim Demaille <akim@epita.fr>
21437
21438 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21439 useless nonterminals, move them at the end of the symbol arrays.
21440 (reduce_output): Adjust.
21441 * tests/reduce.at (Useless Nonterminals): Adjust.
21442
00238958
AD
214432001-11-30 Akim Demaille <akim@epita.fr>
21444
21445 * src/reduce.c: Various comment/formatting changes.
21446 (nonterminals_reduce): New, extracted from...
21447 (reduce_grammar_tables): here.
21448 (reduce_grammar): Call nonterminals_reduce.
21449
396452de
PE
214502001-11-29 Paul Eggert <eggert@twinsun.com>
21451
21452 * src/bison.simple (YYSTACK_REALLOC): Remove.
21453 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21454 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21455 New macros.
21456 (union yyalloc): New type.
21457 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21458 an arbitrary restriction on hosts where size_t is wider than int.
21459
21460 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21461 a parser stack overflow. Allocate just one block of memory for all
21462 three stacks, instead of allocating three blocks; this typically is
21463 faster and reduces fragmentation.
21464
21465 Do not limit the number of items in the stack to a value that fits
21466 in 'int', as this is an arbitrary limit on hosts with 64-bit
21467 size_t and 32-bit int.
21468
147e184c
MA
214692001-11-29 Marc Autret <autret_m@epita.fr>
21470
21471 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21472 of defining YYERROR_VERBOSE.
21473 [AT_DATA]: $4 is now out of C declarations in the prologue.
21474
426cf563
MA
214752001-11-28 Marc Autret <autret_m@epita.fr>
21476
21477 * src/reader.c (parse_dquoted_param): New.
21478 (parse_skel_decl): Use it.
21479 * src/lex.h: Add its prototype.
21480 * src/lex.c (literalchar): Become not static.
21481
c7925b99
MA
214822001-11-28 Marc Autret <autret_m@epita.fr>
21483
21484 * src/output.h: And put its extern declaration here.
21485 * src/output.c (error_verbose): Define here.
21486 (prepare): Echo name modification.
21487 * src/getargs.h: Clean its extern declaration.
21488 * src/getargs.c (error_verbose_flag): Remove.
21489 (getargs): Remove case 'e'.
21490 * src/options.c (option_table): 'error-verbose' is now seen as simple
21491 percent option.
21492 Include output.h.
21493
21494 * src/reader.c (read_declarations): Remove case tok_include.
21495 (parse_include_decl): Remove.
21496 * src/lex.h (token_t): Remove tok_include.
21497 * src/options.c (option_table): 'include' is now a simple command line
21498 option.
21499
5b5d1929
MA
215002001-11-28 Marc Autret <autret_m@epita.fr>
21501
21502 * src/bison.simple: Adjust muscle names.
21503 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21504 * src/output.c (prepare): s/_/-/ for the muscles names.
21505 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21506
8850be4b
MA
215072001-11-28 Marc Autret <autret_m@epita.fr>
21508
21509 * src/bison.simple: Fix debug.
21510 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21511
4a38e613
AD
215122001-11-28 Akim Demaille <akim@epita.fr>
21513
21514 * src/LR0.c (shifts_new): New.
21515 (save_shifts, insert_start_shift, augment_automaton): Use it.
21516
4b35e1c1
AD
215172001-11-28 Akim Demaille <akim@epita.fr>
21518
21519 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21520 keep ruleno only.
21521
d2b04478
AD
215222001-11-28 Akim Demaille <akim@epita.fr>
21523
21524 * src/closure.c (closure): Instead of looping over word in array
21525 then bits in words, loop over bits in array.
21526
2c4c30aa
AD
215272001-11-28 Akim Demaille <akim@epita.fr>
21528
21529 * src/closure.c (closure): No longer optimize the special case
21530 where all the bits of `ruleset[r]' are set to 0, to make the code
21531 clearer.
21532
576890b7
AD
215332001-11-28 Akim Demaille <akim@epita.fr>
21534
21535 * src/closure.c (closure): `r' and `c' are new variables, used to
21536 de-obfuscate accesses to RULESET and CORE.
21537
cb487d7d
AD
215382001-11-28 Akim Demaille <akim@epita.fr>
21539
21540 * src/reduce.c (reduce_print): Use ngettext.
21541 (dump_grammar): Improve the trace accuracy.
21542
6013d43f
AD
215432001-11-28 Akim Demaille <akim@epita.fr>
21544
21545 * src/reduce.c (dump_grammar): Don't translate trace messages.
21546
cb4956ee
AD
215472001-11-28 Akim Demaille <akim@epita.fr>
21548
21549 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21550 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21551 as all tags are free'ed afterwards.
21552 From Enrico Scholz.
21553
648185ab
PE
215542001-11-27 Paul Eggert <eggert@twinsun.com>
21555
21556 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21557 use alloca when we didn't want to, and vice versa.
21558
68254a03
MA
215592001-11-27 Marc Autret <autret_m@epita.fr>
21560
9113b58f
AD
21561 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21562 initialization.
68254a03
MA
21563 * src/output.c (prepare): Remove its update.
21564
04d843a2
MA
215652001-11-27 Marc Autret <autret_m@epita.fr>
21566
21567 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21568 Use %error-verbose.
21569
d2079671 215702001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
21571
21572 * src/bison.simple: Remove YYERROR_VERBOSE using.
21573 Use %%error_verbose.
21574 (yyparse): Likewise.
21575 * src/output.c (prepare): Give its final value.
21576 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21577 * src/getargs.h: Add its extern declaration.
21578 * src/getargs.c (error_verbose_flag): New int.
21579 (getargs): Update to catch new case.
21580 * src/options.c (option_table): 'error-verbose' is a new option.
21581 (shortopts): Update.
21582
e0327bc8
AD
215832001-11-27 Akim Demaille <akim@epita.fr>
21584
21585 * src/system.h: Use intl/libgettext.h.
21586 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21587
000f1a3c
AD
215882001-11-27 Akim Demaille <akim@epita.fr>
21589
21590 * tests/torture.at (Exploding the Stack Size with Malloc):
21591 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21592
26cfe0be
AD
215932001-11-27 Akim Demaille <akim@epita.fr>
21594
21595 * src/files.c: Include error.h.
21596 Reported by Hans Aberg.
21597
f6bd5427
MA
215982001-11-26 Marc Autret <autret_m@epita.fr>
21599
d2079671 21600 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
21601 (read_declarations): Add case tok_include.
21602 * src/getargs.h (include): Add its extern definition.
21603 * src/getargs.c (include): New const char *.
21604 (getargs): Add case '-I'.
21605 * src/options.c (option_table): Add include as command line and
21606 percent option.
21607 * src/lex.h (token_t): Add tok_include.
21608
2ca209c1
AD
216092001-11-26 Akim Demaille <akim@epita.fr>
21610
21611 * src/reader.c (readgram): Make sure rules for mid-rule actions
21612 have a lineno equal to that of their host rule.
21613 Reported by Hans Aberg.
21614 * tests/regression.at (Rule Line Numbers): New.
21615
0e41b407
AD
216162001-11-26 Akim Demaille <akim@epita.fr>
21617
21618 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21619 size_ts.
21620
216212001-11-26 Akim Demaille <akim@epita.fr>
21622
21623 * src/complain.c, src/complain.h (error): Remove, provided by
21624 lib/error.[ch].
21625
e0c40012
AD
216262001-11-26 Akim Demaille <akim@epita.fr>
21627
21628 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21629 issue an error message.
21630 * tests/regression.at (Invalid %directive): New.
21631 Reported by Hans Aberg.
21632
5e147124
AD
216332001-11-26 Akim Demaille <akim@epita.fr>
21634
21635 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21636 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21637
a034c8b8
AD
216382001-11-26 Akim Demaille <akim@epita.fr>
21639
21640 * src/conflicts.c (conflicts_print): Don't complain at all when
21641 there are no reduce/reduce conflicts, and as many shift/reduce
21642 conflicts as expected.
21643 * tests/regression.at (%expect right): Adjust.
21644
c64a20f3
AD
216452001-11-23 Akim Demaille <akim@epita.fr>
21646
21647 * lib/alloca.c: Update, from fileutils.
21648
5b0d29bb
AD
216492001-11-23 Akim Demaille <akim@epita.fr>
21650
21651 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21652
722c4bfe
AD
216532001-11-23 Akim Demaille <akim@epita.fr>
21654
21655 * src/system.h: Include alloca.h.
21656 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21657
6255b435
AD
216582001-11-23 Akim Demaille <akim@epita.fr>
21659
21660 * src/print_graph.c (print_actions): Remove `rule', unused.
21661 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21662 pacify GCC's signed < unsigned warnings.
21663 * src/closure.c (itemsetsize): Likewise.
21664 * src/reader.c (symbol_list_new): Static.
21665
b29b2ed5
AD
216662001-11-23 Akim Demaille <akim@epita.fr>
21667
21668 Attaching lineno to buckets is stupid, since only one copy of each
21669 symbol is kept, only the line of the first occurrence is kept too.
21670
21671 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21672 * src/reader.c (rline_allocated): Remove, unused.
21673 (symbol_list): Have a `line' member.
21674 (symbol_list_new): New.
21675 (readgram): Use it.
21676 * src/print.c (print_grammar): Output the rule line numbers.
21677 * tests/regression.at (Solved SR Conflicts)
21678 (Unresolved SR Conflicts): Adjust.
21679 Reported by Hans Aberg.
21680
a81b1d4a
MA
216812001-11-22 Marc Autret <autret_m@epita.fr>
21682
21683 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21684
c1ecb3c1
MA
216852001-11-22 Marc Autret <autret_m@epita.fr>
21686
21687 * src/muscle_tab.c (muscle_init): Remove initialization of
21688 skeleton muscle.
21689 * src/output.c (output_master_parser): Do it here.
21690
fbe01355
AD
216912001-11-20 Akim Demaille <akim@epita.fr>
21692
21693 * po/sv.po: New.
21694 * configure.in (ALL_LINGUAS): Adjust.
21695 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21696 longer contains strings to translate.
21697
81e895c0
AD
216982001-11-19 Akim Demaille <akim@epita.fr>
21699
21700 * src/conflicts.c (conflicts_print): Add a missing \n.
21701
6bb1878b
AD
217022001-11-19 Akim Demaille <akim@epita.fr>
21703
21704 * src/nullable.c (nullable_print): New.
21705 (set_nullable): Call it when tracing.
21706 Better locality of variables.
21707
d9ec2d07
AD
217082001-11-19 Akim Demaille <akim@epita.fr>
21709
21710 * src/print.c (print_actions): Better locality of variables.
21711
720e5c1b
AD
217122001-11-19 Akim Demaille <akim@epita.fr>
21713
21714 * src/derives.c (print_derives): Fix and enrich.
21715 * src/closure.c (print_fderives): Likewise.
21716
fb908786
AD
217172001-11-19 Akim Demaille <akim@epita.fr>
21718
21719 * src/closure.c (itemsetend): Remove, replaced with...
21720 (itemsetsize): new.
21721
125ecb56
AD
217222001-11-19 Akim Demaille <akim@epita.fr>
21723
21724 * src/LR0.c (kernel_end): Remove, replaced with...
21725 (kernel_size): new.
21726
d8cf039f
AD
217272001-11-19 Akim Demaille <akim@epita.fr>
21728
21729 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21730 to clarify.
21731
7bec0760
AD
217322001-11-19 Akim Demaille <akim@epita.fr>
21733
21734 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21735
c87d4863
AD
217362001-11-19 Akim Demaille <akim@epita.fr>
21737
21738 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21739 trace messages.
21740 * src/LR0.c: Likewise.
21741 (allocate_itemsets): Use arrays instead of pointers to clarify.
21742
9bfe901c
AD
217432001-11-19 Akim Demaille <akim@epita.fr>
21744
21745 * src/getargs.c (statistics_flag): Replace with...
21746 (trace_flag): New.
21747 (longopts): Accept --trace instead of --statistics.
21748 * src/getargs.h, src/options.c: Adjust.
21749 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21750 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21751
97db7bd4
AD
217522001-11-19 Akim Demaille <akim@epita.fr>
21753
cc72668c 21754 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
21755 pointers to clarify the code.
21756 (save_reductions, save_shifts): Factor common parts of alternatives.
21757
2c5f66ed
AD
217582001-11-19 Akim Demaille <akim@epita.fr>
21759
21760 * src/LR0.c (new_state, get_state): Complete TRACE code.
21761 * src/closure.c: Include `reader.h' to get `tags', needed by the
21762 trace code.
21763 Rename the conditional DEBUG as TRACE.
21764 Output consistently TRACEs to stderr, not stdout.
21765 * src/derives.c: Likewise.
21766 * src/reduce.c: (inaccessable_symbols): Using if is better style
21767 than goto.
21768 Use `#if TRACE' instead of `#if 0' for tracing code.
21769
300f275f
AD
217702001-11-19 Akim Demaille <akim@epita.fr>
21771
21772 * src/system.h (LIST_FREE, shortcpy): New.
21773 * src/LR0.c: Use them.
21774 * src/output.c (free_itemsets, free_reductions, free_shifts):
21775 Remove, replaced by LIST_FREE.
21776
f59c437a
AD
217772001-11-19 Akim Demaille <akim@epita.fr>
21778
21779 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21780 (REDUCTIONS_ALLOC): New.
21781 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21782 allocation.
21783
6986fd9e
AD
217842001-11-19 Akim Demaille <akim@epita.fr>
21785
21786 * src/LR0.c (new_state): Complete trace code.
21787 * src/nullable.c (set_nullable): Don't translate traces.
21788
4bc30f78
AD
217892001-11-19 Akim Demaille <akim@epita.fr>
21790
21791 * src/print_graph.c (print_core): Better locality of variables.
21792 * src/print.c (print_core): Likewise.
21793
08a946e0
AD
217942001-11-19 Akim Demaille <akim@epita.fr>
21795
21796 * src/vcg.c: You do the output, so you are responsible of the
21797 handling of VCG syntax, in particular: use quotearg.
21798 * src/print_graph.c: Don't.
21799 (print_actions): Don't output the actions as part of the nodes,
21800 since that's the job of the edges.
21801 (print_state): Don't output by hand: fill the node description,
9bfe901c 21802 and ask for its output.
08a946e0 21803
f0473484
AD
218042001-11-19 Akim Demaille <akim@epita.fr>
21805
cc72668c
AD
21806 * src/bison.simple (yyparse): When verbosely reporting an error,
21807 no longer put additional quotes around token names.
f0473484
AD
21808 * tests/calc.at: Adjust.
21809
e41dc700
AD
218102001-11-19 Akim Demaille <akim@epita.fr>
21811
21812 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21813 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21814 * src/output.c: Adjust.
21815
652a871c
AD
218162001-11-19 Akim Demaille <akim@epita.fr>
21817
21818 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21819 (rule_t): this.
21820 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21821
b2ed6e58
AD
218222001-11-19 Akim Demaille <akim@epita.fr>
21823
21824 * src/gram.h (rule_t): New.
21825 (rule_table): New.
21826 (rrhs, rlhs): Remove, part of state_t.
21827 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21828 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21829 * src/reader.c, src/reduce.c: Adjust.
21830
edad7067
AD
218312001-11-19 Akim Demaille <akim@epita.fr>
21832
21833 * src/reader.c (symbols_output): New, extracted from...
21834 (packsymbols): Here.
21835 (reader): Call it.
21836
3feec034
AD
218372001-11-19 Akim Demaille <akim@epita.fr>
21838
21839 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21840 (maxrhs): this new function.
21841
ddcd5fdf
AD
218422001-11-19 Akim Demaille <akim@epita.fr>
21843
cc72668c 21844 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
21845 Adjust.
21846
bb527fc2
AD
218472001-11-19 Akim Demaille <akim@epita.fr>
21848
cc72668c 21849 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
21850 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21851 * src/lalr.c: Adjust.
21852
a845a697
AD
218532001-11-19 Akim Demaille <akim@epita.fr>
21854
21855 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21856 (set_state_table): handle the `lookaheads' members.
21857
f004bf6a
AD
218582001-11-19 Akim Demaille <akim@epita.fr>
21859
cc72668c
AD
21860 * src/lalr.h (lookaheads): Removed array, whose contents is now
21861 a member of...
f004bf6a
AD
21862 (state_t): this structure.
21863 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21864 Adjust.
21865
de326cc0
AD
218662001-11-19 Akim Demaille <akim@epita.fr>
21867
cc72668c
AD
21868 * src/lalr.h (consistent): Removed array, whose contents is now
21869 a member of...
de326cc0
AD
21870 (state_t): this structure.
21871 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21872 Adjust.
21873
90b4416b
AD
218742001-11-19 Akim Demaille <akim@epita.fr>
21875
cc72668c
AD
21876 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21877 contents are now members of...
90b4416b
AD
21878 (state_t): this structure.
21879 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21880 Adjust.
21881
9703cc49
AD
218822001-11-19 Akim Demaille <akim@epita.fr>
21883
21884 * src/lalr.h (state_t): New.
21885 (state_table): Be a state_t * instead of a core **.
21886 (accessing_symbol): Remove, part of state_t.
21887 * src/lalr.c: Adjust.
21888 (set_accessing_symbol): Merge into...
21889 (set_state_table): this.
21890 * src/print_graph.c, src/conflicts.c: Adjust.
21891
d803322e
AD
218922001-11-14 Akim Demaille <akim@epita.fr>
21893
21894 * tests/calc.at, tests/output.at, tests/regression.at,
21895 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21896 now the tests are run in private dirs, therefore AC_CLEANUP and
21897 family can be simplified to 0-ary.
21898 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21899 use abs. path to find config.h.
21900 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21901 stderr, there can be way too much random noise.
21902 Instead pass -Werror to GCC and rely on the exit status.
21903 Reported by Wolfram Wagner.
21904
3d76b07d
AD
219052001-11-14 Akim Demaille <akim@epita.fr>
21906
21907 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21908 defined only if yyoverflow is defined, to avoid `warning: unused
21909 variable `yyvs1''.
21910 Reported by The Test Suite.
21911
09b503c8
AD
219122001-11-14 Akim Demaille <akim@epita.fr>
21913
21914 * src/print.c: Include reduce.h.
21915 Reported by Hans Aberg.
21916
219172001-11-14 Akim Demaille <akim@epita.fr>
21918
21919 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21920 Revert a previous patch: these are really const.
21921 * src/conflicts.c (conflict_report): Additional useless pair of
21922 braces to pacify GCC's warnings for `if () if () {} else {}'.
21923 * src/lex.c (parse_percent_token): Replace equal_offset with
21924 arg_offset.
21925 arg is const.
21926 Be sure to strdup `arg' when used, since there is no reason for
21927 token_buffer not to change.
21928
0f37a994
AD
219292001-11-14 Akim Demaille <akim@epita.fr>
21930
21931 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21932 definition.
21933 * src/main.c (main): Use them.
21934 Suggested by Hans Aberg.
21935
d39d93b8
AD
219362001-11-12 Akim Demaille <akim@epita.fr>
21937
21938 * src/system.h (ngettext): Now that we use ngettext, be sure to
21939 provide a default definition when NLS are not used.
21940
9edcd895
AD
219412001-11-12 Akim Demaille <akim@epita.fr>
21942
21943 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21944 Use @kbd to denote user input.
21945 (Language and Grammar): ANSIfy the example.
21946 Adjust its layout for info/notinfo.
21947 (Location Tracking Calc): Output error messages to stderr.
21948 Output locations in a more GNUtically correct way.
21949 Fix a couple of Englishos.
21950 Adjust @group/@end group pairs.
21951
7da99ede
AD
219522001-11-12 Akim Demaille <akim@epita.fr>
21953
e3aa65c5 21954 %expect was not functioning at all.
7da99ede
AD
21955
21956 * src/conflicts.c (expected_conflicts): Set to -1.
21957 (conflict_report): Use ngettext.
21958 (conflicts_print): Check %expect and make its violation an error.
21959 * doc/bison.texinfo (Expect Decl): Adjust.
21960 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
21961 * tests/regression.at (%expect not enough, %expect right)
21962 (%expect too much): New.
21963
ba9dda1a
AD
219642001-11-12 Akim Demaille <akim@epita.fr>
21965
21966 * tests/regression.at (Conflicts): Rename as...
21967 (Unresolved SR Conflicts): this.
21968 (Solved SR Conflicts): New.
21969
337c5bd1
AD
219702001-11-12 Akim Demaille <akim@epita.fr>
21971
21972 * src/reduce.c (print_results): Rename as...
21973 (reduce_output): This.
21974 Output to OUT, passed as argument, instead of output_obstack.
21975 (dump_grammar): Likewise.
21976 (reduce_free): New.
21977 Also free V1.
21978 (reduce_grammar): No longer call reduce_output, since...
21979 * src/print.c (print_results): do it.
21980 * src/main.c (main): Call reduce_free;
21981
c73a41af
AD
219822001-11-12 Akim Demaille <akim@epita.fr>
21983
21984 * src/conflicts.c (print_reductions): Accept OUT as argument.
21985 Output to it, not to output_obstack.
21986 * src/print.c (print_actions): Adjust.
21987
0df87bb6
AD
219882001-11-12 Akim Demaille <akim@epita.fr>
21989
21990 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
21991 the result instead of using...
21992 (src_total, rrc_total, src_count, rrc_count): Remove.
21993 (any_conflicts): Remove.
21994 (print_conflicts): Split into...
21995 (conflicts_print, conflicts_output): New.
21996 * src/conflicts.h: Adjust.
21997 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 21998 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
21999 * tests/regression.at (Conflicts): New.
22000 Reported by Tom Lane.
22001
e4d3d4de
AD
220022001-11-12 Akim Demaille <akim@epita.fr>
22003
22004 * tests/regression.at (Invalid input): Remove, duplicate with
22005 ``Invalid input: 1''.
22006
6d7d248e
AD
220072001-11-12 Akim Demaille <akim@epita.fr>
22008
22009 * tests/torture.at (AT_DATA_STACK_TORTURE)
22010 (Exploding the Stack Size with Alloca)
22011 (Exploding the Stack Size with Malloc): New.
22012
e9e4c321
AD
220132001-11-12 Akim Demaille <akim@epita.fr>
22014
22015 * src/bison.simple (YYSTACK_REALLOC): New.
22016 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 22017 Reported by Per Allansson.
e9e4c321 22018
5f7e0832
AD
220192001-11-12 Pascal Bart <pascal.bart@epita.fr>
22020
22021 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22022 define CPP macro, which substitute YYSTYPE by yystype.
22023 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22024 with yyltype/YYLTYPE. This allows inclusion of the generated
22025 header within the parser if the compiler, such as GGC, accepts
22026 multiple equivalent #defines.
22027 From Akim.
22028
e3f1699f
AD
220292001-11-05 Akim Demaille <akim@epita.fr>
22030
22031 * src/reader.c (symbols_output): New, extracted from...
22032 (packsymbols): here.
22033 (reader): Adjust.
22034
65be0866
AD
220352001-11-05 Akim Demaille <akim@epita.fr>
22036
22037 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22038
e4d910bf
AD
220392001-11-05 Akim Demaille <akim@epita.fr>
22040
22041 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22042 pattern.
22043
951366c1
AD
220442001-11-05 Akim Demaille <akim@epita.fr>
22045
22046 * src/options.h (struct option_table_struct): set_flags is void*.
22047 * src/options.c (longopts): Support `--output' and `%output'.
22048 (usage): Adjust.
22049 * src/lex.h (tok_setopt): Remove, replaced with...
22050 (tok_intopt, tok_stropt): these new guys.
22051 * src/lex.c (getopt.h): Not needed.
22052 (token_buffer, unlexed_token_buffer): Not const.
22053 (percent_table): Promote `-' over `_' in directive names.
22054 Active `%name-prefix', `file-prefix', and `output'.
22055 (parse_percent_token): Accept possible arguments to directives.
22056 Promote `-' over `_' in directive names.
22057
d8988b2f
AD
220582001-11-04 Akim Demaille <akim@epita.fr>
22059
22060 * doc/bison.texinfo (Decl Summary): Split the list into
22061 `directives for grammars' and `directives for bison'.
22062 Sort'em.
22063 Add description of `%name-prefix', `file-prefix', and `output'.
22064 Promote `-' over `_' in directive names.
22065 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22066 Simplify the description of `--name-prefix'.
22067 Promote `-' over `_' in directive names.
22068 Promote `--output' over `--output-file'.
22069 Fix the description of `--defines'.
22070 * tests/output.at: Exercise %file-prefix and %output.
22071
6468d18e
AD
220722001-11-02 Akim Demaille <akim@epita.fr>
22073
22074 * doc/refcard.tex: Update.
22075
6b7e85b9
AD
220762001-11-02 Akim Demaille <akim@epita.fr>
22077
22078 * src/symtab.h (SUNDEF): New.
22079 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22080 stand for `uninitialized', instead of 0.
22081 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22082 * src/lex.c (lex): Adjust.
22083
22084 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22085 Number it 0.
22086 Let yylex return it instead of a plain 0.
22087 Reported by Dick Streefland.
22088
cd5aafcf
AD
220892001-11-02 Akim Demaille <akim@epita.fr>
22090
22091 * tests/regression.at (Mixing %token styles): New test.
22092
037ca2f1
AD
220932001-11-02 Akim Demaille <akim@epita.fr>
22094
22095 * src/reader.c (parse_thong_decl): Formatting changes.
22096 (token_translations_init): New, extracted from...
22097 (packsymbols): Here.
22098 Adjust.
22099
270a173c
AD
221002001-11-01 Akim Demaille <akim@epita.fr>
22101
22102 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22103 Check that `9foo.y' produces correct cpp guards.
22104 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22105 guards.
22106 Reported by Wwp.
22107
561f9a30
AD
221082001-11-01 Akim Demaille <akim@epita.fr>
22109
22110 * tests/regression.at (Invalid input: 2): New.
22111 * src/lex.c (unlexed_token_buffer): New.
22112 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22113 too.
22114 Reported by Wwp.
22115
f987e9d2
AD
221162001-11-01 Akim Demaille <akim@epita.fr>
22117
22118 * tests/calc.at: Catch up with 1.30.
22119 * configure.in: Bump to 1.49a.
22120 Adjust to newer Autotest.
22121
0846f581
PB
221222001-10-19 Pascal Bart <pascal.bart@epita.fr>
22123
22124 * src/conflicts.c: Move global variables rrc_total and src_total ...
22125 (print_conflicts): here.
22126 * src/output.c (output): Free global variable user_toknums.
22127 * src/lex.c (token_obstack): Become static.
22128
3c1a79b3
AD
221292001-10-18 Akim Demaille <akim@epita.fr>
22130
22131 * tests/atlocal.in (GCC): Add.
22132 * tests/calc.at: s/m4_match/m4_bmatch/.
22133 s/m4_patsubst/m4_bpatsubst/.
22134 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22135 * configure.in: AC_SUBST(GCC).
22136
5d52e7d0
MA
221372001-10-14 Marc Autret <autret_m@epita.fr>
22138
22139 * src/options.c (create_long_option_table): Fix.
22140
631aa1d3
AD
221412001-10-10 Akim Demaille <akim@epita.fr>
22142
22143 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22144
f6ec6d13
AD
221452001-10-04 Akim Demaille <akim@epita.fr>
22146
22147 * src/reader.c (parse_union_decl): Push the caracters in
22148 union_obstack, not attrs_obstack.
22149
342b8b6e
AD
221502001-10-04 Akim Demaille <akim@epita.fr>
22151
22152 Merge in the branch 1.29.
22153
22154 * src/reader.c (packsymbols): Use a temporary obstack for
22155 `%%tokendef', since output_stack is already used elsewhere.
22156
22157 2001-10-02 Akim Demaille <akim@epita.fr>
22158
22159 Bump 1.29d.
22160
22161 2001-10-02 Akim Demaille <akim@epita.fr>
22162
22163 Version 1.29c.
22164
22165 2001-10-02 Akim Demaille <akim@epita.fr>
22166
22167 * tests/regression.at (Invalid CPP headers): New.
22168 From Alexander Belopolsky.
22169 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22170
22171 2001-10-02 Akim Demaille <akim@epita.fr>
22172
22173 * tests/regression.at (Invalid input): New.
22174 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22175 Reported by Shura.
22176
22177 2001-10-02 Akim Demaille <akim@epita.fr>
22178
22179 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22180
22181 2001-10-02 Akim Demaille <akim@epita.fr>
22182
22183 * src/output.c (output_parser): Assert `skeleton'.
22184 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22185 systems.
22186 From Shura.
22187
22188 2001-10-01 Marc Autret <autret_m@epita.fr>
22189
22190 * src/lex.h: Echo modifications.
22191 * src/lex.c (unlex): Parameter is now token_t.
22192 From Hans Aberg.
22193
22194 2001-10-01 Marc Autret <autret_m@epita.fr>
22195
22196 * src/main.c: Include lex.h.
22197 From Hans Aberg.
22198
22199 2001-09-29 Akim Demaille <akim@epita.fr>
22200
22201 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22202
22203 2001-09-28 Akim Demaille <akim@epita.fr>
22204
22205 * tests/testsuite.at: Update to newer Autotest.
22206 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22207
22208 2001-09-27 Akim Demaille <akim@epita.fr>
22209
22210 Position independent wrapper.
22211
22212 * tests/bison: Remove.
22213 * tests/bison.in: New.
22214 * configure.in: Adjust.
22215
22216 2001-09-27 Paul Eggert <eggert@twinsun.com>
22217
22218 Port quotearg fixes from tar 1.13.24.
22219
22220 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22221 tm to be declared.
22222 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22223 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22224
22225 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22226 * m4/mbrtowc.m4: New file.
22227 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22228 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22229
22230 2001-09-27 Akim Demaille <akim@epita.fr>
22231
22232 Bump to 1.29c.
22233
22234 2001-09-27 Akim Demaille <akim@epita.fr>
22235
22236 Version 1.29b.
22237
22238 2001-09-25 Akim Demaille <akim@epita.fr>
22239
22240 * src/system.h: Include `xalloc.h'.
22241 Remove it from the C files.
22242 * src/files.c (output_files): Free the obstacks.
22243 * src/lex.c (init_lex): Rename as...
22244 (lex_init): this.
22245 (lex_free): New.
22246 * src/main.c (main): Use it.
22247
22248 2001-09-24 Marc Autret <autret_m@epita.fr>
22249
22250 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22251 to output informations in fout (FILE*).
22252 (open_graph, close_graph): Likewise.
22253 (output_graph, output_edge, output_node): Likewise.
22254 * src/vcg.h: Update function prototypes.
22255 * src/print_graph.c (print_graph): Open output graph file.
22256 (print_actions): Adjust.
22257 * src/files.h: Remove extern declaration.
22258 * src/files.c: Remove graph_obstack declaration.
22259 (open_files): Remove graph_obstack initialization.
22260 (output_files): Remove graph_obstack saving.
22261
22262 2001-09-24 Marc Autret <autret_m@epita.fr>
22263
22264 * src/files.c (compute_output_file_names): Fix.
22265
22266 2001-09-24 Marc Autret <autret_m@epita.fr>,
22267 Akim Demaille <akim@epita.fr>
22268
22269 * src/reader.c (reader): Remove call to free_symtab ().
22270 * src/main.c (main): Call it here.
22271 Include symtab.h.
22272 * src/conflicts.c (initialize_conflicts): Rename as...
22273 (solve_conflicts): this.
22274 * src/print.c (print_core, print_actions, print_state)
22275 (print_grammar): Dump to a file instead a `output_obstack'.
22276 (print_results): Dump `output_obstack', and then proceed with the
22277 FILE *.
22278 * src/files.c (compute_output_file_names, close_files): New.
22279 (output_files): Adjust.
22280 * src/main.c (main): Adjust.
22281
22282 2001-09-23 Marc Autret <autret_m@epita.fr>
22283
22284 * src/files.c (compute_header_macro): Computes header macro name
22285 from spec_defines_file when given.
22286
22287 2001-09-23 Marc Autret <autret_m@epita.fr>
22288
22289 * src/files.c (output_files): Add default extensions.
22290
22291 2001-09-22 Akim Demaille <akim@epita.fr>
22292
22293 * src/conflicts.c (finalize_conflicts): Rename as...
22294 (free_conflicts): this.
22295
22296 2001-09-22 Akim Demaille <akim@epita.fr>
22297
22298 * src/gram.c (gram_free): Rename back as...
22299 (dummy): this.
22300 (output_token_translations): Free `token_translations'.
22301 * src/symtab.c (free_symtab): Free the tag field.
22302
22303 2001-09-22 Akim Demaille <akim@epita.fr>
22304
22305 Remove `translations' as it is always set to true.
22306
22307 * src/gram.h: Adjust.
22308 * src/reader.c (packsymbols, parse_token_decl): Adjust
22309 * src/print.c (print_grammar): Adjust.
22310 * src/output.c (output_token_translations): Adjust.
22311 * src/lex.c (lex): Adjust.
22312 * src/gram.c: Be sure the set pointers to NULL.
22313 (dummy): Rename as...
22314 (gram_free): this.
22315
22316 2001-09-22 Akim Demaille <akim@epita.fr>
22317
22318 * configure.in: Invoke AM_LIB_DMALLOC.
22319 * src/system.h: Use dmalloc.
22320 * src/LR0.c: Be sure to have pointers initialized to NULL.
22321 (allocate_itemsets): Allocate kernel_items only if needed.
22322
22323 2001-09-22 Akim Demaille <akim@epita.fr>
22324
22325 * configure.in: Bump to 1.29b.
22326 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22327 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22328 need xmalloc.c in calc.y.
22329 From Pascal Bart.
22330
22331 2001-09-21 Akim Demaille <akim@epita.fr>
22332
22333 Version 1.29a.
22334 * Makefile.maint, config/config.guess, config/config.sub,
22335 * config/missing: Update from masters.
22336 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22337 upon package.m4.
22338 * configure.in (ALL_LINGUAS): Add `tr'.
22339
22340 2001-09-21 Akim Demaille <akim@epita.fr>
22341
22342 * tests/Makefile.am (package.m4): Move to...
22343 ($(srcdir)/$(TESTSUITE)): here.
22344
22345 2001-09-20 Akim Demaille <akim@epita.fr>
22346
22347 * src/complain.c: No longer try to be standalone: use system.h.
22348 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22349 * src/complain.h: Likewise.
22350 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22351 Remove the unused variable `n'.
22352 From Albert Chin-A-Young.
22353
22354 2001-09-18 Marc Autret <autret_m@epita.fr>
22355
22356 * doc/bison.1: Update.
22357 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22358 descriptions.
22359 (Option Cross Key): Update.
22360 Add --graph.
22361
22362 2001-09-18 Marc Autret <autret_m@epita.fr>
22363
22364 * tests/regression.at: New test (comment in %union).
22365
22366 2001-09-18 Marc Autret <autret_m@epita.fr>
22367
22368 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22369 do that.
22370 Reported by Keith Browne.
22371
22372 2001-09-18 Marc Autret <autret_m@epita.fr>
22373
22374 * tests/output.at: Add tests for --defines and --graph.
22375
22376 2001-09-18 Marc Autret <autret_m@epita.fr>
22377
22378 * tests/output.at: Removes tests of %{header,src}_extension features.
22379
22380 2001-09-18 Akim Demaille <akim@epita.fr>
22381
22382 * tests/Makefile.am (package.m4): New.
22383 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22384 (_AT_CHECK_CALC_ERROR): Likewise.
22385 Factor the `, ' part of verbose error messages.
22386
22387 2001-09-18 Marc Autret <autret_m@epita.fr>
22388
22389 * src/getargs.c (longopts): Declare --defines and --graph as options
22390 with optional arguments.
22391 * src/files.h: Add extern declarations.
22392 * src/files.c (spec_graph_file, spec_defines_file): New.
22393 (output_files): Update.
22394 Remove CPP-outed code.
22395
22396 2001-09-18 Marc Autret <autret_m@epita.fr>
22397
22398 Turn off %{source,header}_extension feature.
22399
22400 * src/files.c (compute_exts_from_gf): Update.
22401 (compute_exts_from_src): Update.
22402 (output_files): CPP-out useless code.
22403 * src/files.h: Remove {header,source}_extension extern declarations.
22404 * src/reader.c (parse_dquoted_param): CPP-out.
22405 (parse_header_extension_decl): Remove.
22406 (parse_source_extension_decl): Remove.
22407 (read_declarations): Remove cases tok_{hdrext,srcext}.
22408 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22409 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22410
22411 2001-09-10 Akim Demaille <akim@epita.fr>
22412
22413 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22414 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22415 (AT_CHECK_OUTPUT): this.
22416 Merely check ls' exit status, its output is useless.
22417
22418 2001-09-10 Akim Demaille <akim@epita.fr>
22419
22420 * tests/calc.at: Use m4_match.
22421 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22422
22423 2001-09-10 Marc Autret <autret_m@epita.fr>,
22424 Akim Demaille <akim@epita.fr>
22425
22426 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22427 enum color_e.
22428 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22429 to `normal'.
22430 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22431 * src/lex.h: Adjust prototype.
22432 (token_t): Add `tok_undef'.
22433 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22434 (parse_percent_token): Now returns token_t.
22435 Add default statement in switch.
22436 (lex): Separate `c' as an input variable, from the token_t result
22437 part.
22438 (unlexed): Is a token_t.
22439
22440 2001-09-10 Akim Demaille <akim@epita.fr>
22441
22442 * configure.in: Bump to 1.29a.
22443
22444 2001-09-07 Akim Demaille <akim@epita.fr>
22445
22446 Version 1.29.
22447
22448 2001-08-30 Akim Demaille <akim@epita.fr>
22449
22450 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22451 * m4/atconfig.m4: Remove.
22452 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22453 * tests/bison: New.
22454 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22455 m4_if, m4_patsubst, and m4_regexp.
22456 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22457 `input' file instead of echo.
22458
22459 2001-08-29 Akim Demaille <akim@epita.fr>
22460
22461 Bump to 1.28e.
22462
22463 2001-08-29 Akim Demaille <akim@epita.fr>
22464
22465 Version 1.28d.
22466
22467 2001-08-29 Paul Eggert <eggert@twinsun.com>
22468
22469 * src/bison.simple (yyparse): Don't take the address of an
22470 item before the start of an array, as that doesn't conform to
22471 the C Standard.
22472
22473 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22474
22475 * doc/bison.texinfo (Location Tracking Calc): New node.
22476
22477 2001-08-29 Paul Eggert <eggert@twinsun.com>
22478
22479 * src/output.c (output): Do not define const, as this now
22480 causes more problems than it cures.
22481
22482 2001-08-29 Akim Demaille <akim@epita.fr>
22483
22484 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22485 the nodes.
22486 Be sure to tag the `detailmenu'.
22487
22488 2001-08-29 Akim Demaille <akim@epita.fr>
22489
22490 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22491 download in a tmp dir.
22492
22493 2001-08-28 Marc Autret <autret_m@epita.fr>
22494
22495 * config/depcomp: New file.
22496
22497 2001-08-28 Marc Autret <autret_m@epita.fr>
22498
22499 * doc/bison.1 (mandoc): Adjust.
22500 From Juan Manuel Guerrero.
22501
22502 2001-08-28 Marc Autret <autret_m@epita.fr>
22503
22504 * src/print_graph.c (print_state): Fix.
22505
22506 2001-08-27 Marc Autret <autret_m@epita.fr>
22507
22508 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22509 char * members.
22510 Echo modifications to the functions prototypes.
22511 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22512
22513 2001-08-27 Marc Autret <autret_m@epita.fr>
22514
22515 * src/vcg.c: Include `xalloc.h'.
22516 (add_colorentry): New.
22517 (add_classname): New.
22518 (add_infoname): New.
22519 * src/vcg.h: Add new prototypes.
22520
22521 2001-08-27 Akim Demaille <akim@epita.fr>
22522
22523 * Makefile.maint: Sync. again with CVS Autoconf.
22524
22525 2001-08-27 Akim Demaille <akim@epita.fr>
22526
22527 * Makefile.maint: Formatting changes.
22528 (po-update, cvs-update, update): New targets.
22529 (AMTAR): Remove.
22530
22531 2001-08-27 Akim Demaille <akim@epita.fr>
22532
22533 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22534 * Makefile.maint: Sync. with CVS Autoconf.
22535
22536 2001-08-27 Marc Autret <autret_m@epita.fr>
22537
22538 * src/vcg.h (struct infoname_s): New.
22539 (struct colorentry_s): New.
22540 (graph_s): New fields {vertical,horizontal}_order in structure.
22541 Add `infoname' field.
22542 Add `colorentry' field;
22543 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22544 (G_HORIZONTAL_ORDER): New.
22545 (G_INFONAME): New.
22546 (G_COLORENTRY): New.
22547 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22548 Add output of `infoname'.
22549 Add output of `colorentry'.
22550
22551 2001-08-27 Marc Autret <autret_m@epita.fr>
22552
22553 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22554 This one shadowed a global parameter.
22555
22556 2001-08-24 Marc Autret <autret_m@epita.fr>
22557
22558 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22559 instead of `unsigned'.
22560 (print_state): Do not call obstack_object_size () in obstack_grow ()
22561 to avoid macro variables shadowing.
22562
22563 2001-08-23 Marc Autret <autret_m@epita.fr>
22564
22565 * src/lex.c (percent_table): Typo: s/naem/name/.
22566 Add graph option.
22567 Normalize new options declarations.
22568
22569 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22570
22571 * tests/suite.at: Exercise %header_extension and %source_extension.
22572
22573 2001-08-16 Marc Autret <autret_m@epita.fr>
22574
22575 * src/reader.c (parse_dquoted_param): New.
22576 (parse_header_extension_decl): Use it.
22577 (parse_source_extension_decl): Likewise.
22578
22579 2001-08-16 Marc Autret <autret_m@epita.fr>
22580
22581 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22582 (get_xxxx_str): Use assert () instead of complain ().
22583 Remove return invokations in default cases.
22584 (get_decision_str): Modify default behaviour. Remove second argument.
22585 Echo modifications on calls.
22586 (output_graph): Fix.
22587
22588 2001-08-16 Marc Autret <autret_m@epita.fr>
22589
22590 * src/getargs.c (usage): Update with ``-g, --graph''.
22591
22592 2001-08-16 Marc Autret <autret_m@epita.fr>
22593
22594 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22595 (Option Cross Key): Likewise.
22596 * doc/bison.1: Update.
22597
1c8c2190
PB
225982001-09-25 Pascal Bart <pascal.bart@epita.fr>
22599
22600 * src/output.c (output_master_parser): Don't finish action_obstack.
22601 (output_parser): Don't care about the muscle action, here.
22602 (prepare): Copy the action_obstack in the action muscle.
22603 (output): Free action_obstack.
22604
180d45ba
PB
226052001-09-23 Pascal Bart <pascal.bart@epita.fr>
22606
22607 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22608 will contain `%union' declaration.
22609 (parse_union_decl): Delete #line directive output.
22610 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22611 informations about %union.
22612 (parse_union_decl): Copy the union_obstack in the muscle stype.
22613 * src/bison.simple: Add new #line directive.
22614 Add typdef %%stype YYSTYPE.
22615
c51d1a19
PB
226162001-09-23 Pascal Bart <pascal.bart@epita.fr>
22617
22618 * src/bison.simple: Add new `#line' directive.
22619
6f9344da
PB
226202001-09-22 Pascal Bart <pascal.bart@epita.fr>
22621
22622 * src/bison.simple: New `#line' directive.
22623 * src/output.c (output_parser): Support new dynamic muscle input_line.
22624
652def80
MA
226252001-09-22 Marc Autret <autret_m@epita.fr>
22626
22627 * src/output.c (output_master_parser): New.
22628 (output_parser): Be more re-entrant.
22629
25b222fa
MA
226302001-09-21 Marc Autret <autret_m@epita.fr>
22631
22632 * src/reader.c (copy_definition, parse_union_decl): Update and use
22633 `linef' muscle.
22634 (copy_action): Likewise.
22635 Use obstack_1grow ().
22636 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22637
6bc35ae5
MA
226382001-09-21 Marc Autret <autret_m@epita.fr>
22639
22640 * src/options.c (option_table): Adjust.
22641 * src/lex.c (parse_percent_token): Fix.
22642
c0629aa1
PB
226432001-09-20 Pascal Bart <pascal.bart@epita.fr>
22644
22645 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 22646
82b6d266
PB
226472001-09-20 Pascal Bart <pascal.bart@epita.fr>
22648
22649 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22650 is now an option_table_struct*.
22651 (option_strcmp): New function option_strcmp.
22652 (parse_percent_token): Call option_strcmp.
22653 * src/getargs.c (xalloc.h, options.h): Include it.
22654 (getargs): Call create_long_option_table.
22655 (getargs): Free longopts at the end of the function.
22656 (shortopts): Move in options.c.
22657 * src/options.c (create_long_option_table): New function. Convert
22658 information from option_table to option structure.
22659 * src/reader.c (options.h): Include it.
22660
22661 * src/Makefile.am: Adjust.
22662 * src/options.c (option_table): Create from longopts and percent_table.
22663 * src/getargs.c (longopts): Delete.
22664 * src/lex.c (struct percent_table_struct): Delete.
22665 (percent_table): Delete.
22666 (options.h): Include it.
22667 * src/options.c: Create.
22668 * src/options.h: Create.
22669 Declare enum opt_access_e.
22670 Define struct option_table_struct.
22671
75f5aaea
MA
226722001-09-20 Marc Autret <autret_m@epita.fr>
22673
22674 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22675 sections of Bison.
22676
f508cb0a
PB
226772001-09-19 Pascal Bart <pascal.bart@epita.fr>
22678
22679 * src/bison.simple: s/%%filename/%%skeleton.
22680 * src/muscle_tab.c (getargs.h): Include it.
22681 (muscle_init): Insert new muscle skeleton.
22682
13105fc1
PB
226832001-09-18 Pascal Bart <pascal.bart@epita.fr>
22684
22685 * src/output.c (output_parser): Delete unused variable actions_dumped.
22686
b0c4483e
PB
226872001-09-07 Pascal Bart <pascal.bart@epita.fr>
22688
22689 * src/output.c (output): Delete call to reader_output_yylsp.
22690 * src/reader.c (reader): Likewise.
ba0fe3c7 22691 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 22692
11d82f03
MA
226932001-09-02 Marc Autret <autret_m@epita.fr>
22694
22695 * src/reader.c: Include muscle_tab.h.
22696 (parse_union_decl): Update.
22697 (parse_macro_decl): Rename parse_muscle_decl.
22698 Update to use renamed functions and variable.
22699 (read_declarations, copy_action, read_additionnal_code, : Updated
22700 with correct variables and functions names.
22701 (packsymbols, reader): Likewise.
342b8b6e 22702
11d82f03 22703 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 22704
11d82f03
MA
22705 * src/output.c: Include muscle_tab.h
22706 In all functions using macro_insert, change by using muscle_insert ().
22707 (macro_obstack): Rename muscle_obstack.
22708 Echo modifications in the whole file.
22709 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22710 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22711 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22712
22713 * src/muscle_tab.h: Update double inclusion macros.
22714 (macro_entry_s): Rename muscle_entry_s.
22715 Update prototypes.
342b8b6e 22716
11d82f03
MA
22717 * src/muscle_tab.c: Include muscle_tab.h.
22718 Rename macro_tabble to muscle_table.
22719 (mhash1, mhash2, mcmp): Use muscle_entry.
22720 (macro_init): Rename muscle_init. Update.
22721 (macro_insert): Rename muscle_insert. Update.
22722 (macro_find): Rename muscle_find. Update.
22723
22724 * src/main.c: Include muscle_tab.h.
22725 (main): Call muscle_init ().
22726 * src/Makefile.am (bison_SOURCES): Echo modifications.
22727
93a37297
MA
227282001-09-02 Marc Autret <autret_m@epita.fr>
22729
f753cd62 22730 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 22731
f753cd62
MA
22732 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22733
227342001-09-02 Marc Autret <autret_m@epita.fr>
22735
22736 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 22737
682d48cd
PB
227382001-09-01 Pascal Bart <pascal.bart@epita.fr>
22739
342b8b6e 22740 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
22741 filename.
22742
087c8fda
MA
227432001-09-01 Marc Autret <autret_m@epita.fr>
22744
22745 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22746 to an explicit value to activate the feature. We do it here.
22747
dda680cb
PB
227482001-08-31 Pascal Bart <pascal.bart@epita.fr>
22749
22750 * src/output.c (prepare): Delete the `filename' muscule insertion.
22751 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22752 (parse_union_decl): Likewise.
22753 * src/macrotab.c (macro_init): Initialize filename by infile.
22754
9e644e64
MA
227552001-08-31 Marc Autret <autret_m@epita.fr>
22756
22757 * src/bison.simple (YYLSP_NEEDED): New definition.
22758 * src/output.c (prepare): Add macro insertion of `locations_flag'
22759
17da6427
PB
227602001-08-31 Pascal Bart <pascal.bart@epita.fr>
22761
22762 * src/output.c (prepare): Delete insertion of previous muscles,
22763 and insert the `prefix' muscles.
22764 * src/macrotab.c (macro_init): Likewise.
22765 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 22766 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
22767 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22768 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 22769 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
22770 name_prefix.
22771
e8cb70b9
PB
227722001-08-31 Pascal Bart <pascal.bart@epita.fr>
22773
22774 * src/main.c (main): Standardize.
22775 * src/output.c (output_table_data, output_parser): Likewise.
22776 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22777
63c2d5de
MA
227782001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22779
342b8b6e 22780 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
22781 %%epilogue.
22782 * src/output.c (output): Rename %%declarations to %%prologue.
22783 * src/bison.simple: Echo modifications.
342b8b6e 22784
d8cb5183
MA
227852001-08-31 Marc Autret <autret_m@epita.fr>
22786
22787 * src/reader.c (readgram): CleanUp.
22788 (output_token_defines): Likewise.
22789 (packsymbols): Likewise.
22790 (reader): Likewise.
22791 * src/output.c (output): CPP-out useless code.
22792
6c686258
PB
227932001-08-31 Pascal Bart <pascal.bart@epita.fr>
22794
342b8b6e 22795 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
22796 output_trailers and output_headers.
22797 * src/output.h: Remove obsolete functions prototypes of output_headers
22798 and output_trailers.
22799
8f451ef7
PB
228002001-08-30 Pascal Bart <pascal.bart@epita.fr>
22801
22802 * src/main.c: Include macrotab.h.
342b8b6e 22803 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
22804 Adjust functions prototypes.
22805 * src/macrotab.c (macro_insert): Constify key and value.
22806 (macro_find): Constify key.
22807 (macro_insert): Include 'xalloc.h'
22808 (macro_insert): Use XMALLOC.
22809 (macro_find): Constify return value.
22810 * src/output.c (output_table_data): Rename table to table_data.
22811 (output_parser): Constify macro_key, macro_value.
22812
997b6fd0 228132001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
22814
22815 * src/reader.c (parse_skel_decl): New.
342b8b6e 22816 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
22817 * src/lex.h (token_t): New token `tok_skel'.
22818 * src/lex.c (percent_table): Add skeleton option entry.
22819 Standardize.
22820
ff48177d
MA
228212001-08-29 Marc Autret <autret_m@epita.fr>
22822
22823 * src/bison.simple: Add %%user_code directive at the end.
22824 * src/reader.c (read_additionnal_code): New.
22825 (reader): Use it.
22826 * src/output.c (output_program): Remove.
22827 (output): Update.
22828
b33160bf
MA
228292001-08-28 Marc Autret <autret_m@epita.fr>
22830
22831 * src/output.c (output_actions): Clean up.
4e5caae2 22832 (output_gram): CPP-out useless code.
b33160bf
MA
22833 * src/reader.c (reader): Clean up, CPP-out useless code.
22834
d1a2daf7
PB
228352001-08-28 Pascal Bart <pascal.bart@epita.fr>
22836
342b8b6e 22837 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 22838 directive.
d1a2daf7
PB
22839 * src/bison.simple: Add `%%definitions'.
22840
2b763dfe
MA
228412001-08-28 Marc Autret <autret_m@epita.fr>
22842
22843 * config/depcomp: New file.
22844
f1a87ef6
PE
228452001-08-27 Paul Eggert <eggert@twinsun.com>
22846
22847 * src/bison.simple (yyparse): Don't take the address of an
22848 item before the start of an array, as that doesn't conform to
22849 the C Standard.
22850
82e236e2
RA
228512001-08-27 Robert Anisko <robert.anisko@epita.fr>
22852
f1a87ef6 22853 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
22854 obstack. It was done too late here.
22855
22856 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22857 completely wrong.
22858 (reader): Initialize the macro obstack here, since we need it to grow
22859 '%define' directives.
22860
22861 * src/reader.h: Declare the macro obstack as extern.
22862
b0cfa28a
RA
228632001-08-27 Robert Anisko <robert.anisko@epita.fr>
22864
22865 * src/output.c (output_parser): Fix. Store single '%' characters in
22866 the output obstack instead of throwing them away.
22867
6fc74234
AD
228682001-08-27 Akim Demaille <akim@epita.fr>
22869
22870 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22871
9c76d118
RA
228722001-08-25 Robert Anisko <robert.anisko@epita.fr>
22873
22874 * lib/Makefile.am: Adjust.
22875
a8289c62
RA
228762001-08-25 Robert Anisko <robert.anisko@epita.fr>
22877
22878 * src/bison.simple: Update and add '%%' directives.
22879
b6610515
RA
228802001-08-25 Robert Anisko <robert.anisko@epita.fr>
22881
22882 * src/reader.c (reader): Remove calls to 'output_headers' and
22883 'output_trailers'. Remove some C output.
22884 (readgram): Disable a piece of code that was writing a default
22885 definition for 'YYSTYPE'.
22886 (reader_output_yylsp): Remove.
22887 (packsymbols): Output token defintions to a macro.
22888 (copy_definition): Disable C output.
6fc74234 22889
b6610515
RA
22890 * src/reader.c (parse_macro_decl): New function used to parse macro
22891 declarations.
22892 (copy_string2): Put the body of copy_string into this new function.
22893 Add a parameter to let the caller choose whether he wants to copy the
22894 string delimiters or not.
22895 (copy_string): Be a simple call to copy_string2 with the last argument
22896 bound to true.
22897 (read_declarations): Add case for macro definition.
22898 (copy_identifier): New.
6fc74234 22899 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
22900 rather than lex.
22901
26f609ff
RA
229022001-08-25 Robert Anisko <robert.anisko@epita.fr>
22903
22904 * src/output.c (prepare): Add prefixed names.
22905 (output_parser): Output semantic actions.
22906 (output_parser): Fix bug on '%%line' directives.
6fc74234 22907
26f609ff
RA
22908 * src/output.c (output_headers): Remove. The C code printed by this
22909 function should now be in the skeletons.
22910 (output_trailers): Remove.
22911 (output): Disable call to 'reader_output_yylsp'.
22912 (output_rule_data): Do not output tables to the table obstack.
22913
22914 * src/output.c: Remove some C dedicated output.
22915 Improve the use of macro and output obstacks.
22916 (output_defines): Remove.
6fc74234 22917
26f609ff
RA
22918 * src/output.c (output_token_translations): Associate 'translate'
22919 table with a macro. No output to the table obstack.
22920 (output_gram): Same for 'rhs' and 'prhs'.
22921 (output_stos): Same for 'stos'.
22922 (output_rule_data): Same for 'r1' and 'r2'.
22923 (token_actions): Same for 'defact'.
22924 (goto_actions): Same for 'defgoto'.
22925 (output_base): Same for 'pact' and 'pgoto'.
22926 (output_table): Same for 'table'.
22927 (output_check): Same for 'check'.
6fc74234 22928
26f609ff
RA
22929 * src/output.c (output_table_data): New function.
22930 (output_short_table): Remove.
22931 (output_short_or_char_table): Remove.
6fc74234 22932
26f609ff
RA
22933 * src/output.c (output_parser): Replace most of the skeleton copy code
22934 with something new. Skeletons are now processed character by character
22935 rather than line by line, and Bison looks for '%%' macros. This is the
22936 first step in making Bison's output process (a lot) more flexible.
22937 (output_parser): Use the macro table.
22938
6f43b113
RA
229392001-08-25 Robert Anisko <robert.anisko@epita.fr>
22940
22941 * src/main.c (main): Initialize the macro table.
22942
dd3127cf
RA
229432001-08-25 Robert Anisko <robert.anisko@epita.fr>
22944
22945 * src/lex.c (percent_table): Add tok_define.
22946 * src/lex.h: Add tok_define.
22947
aa321494
RA
229482001-08-25 Robert Anisko <robert.anisko@epita.fr>
22949
22950 * src/macrotab.c: New file.
22951 * src/macrotab.h: New file.
22952 * src/Makefile.am: Update.
22953
68bd3b6b
RA
229542001-08-25 Robert Anisko <robert.anisko@epita.fr>
22955
22956 * lib/hash.c: New file.
22957 * lib/hash.h: New file.
22958 * lib/Makefile.am: Update.
22959
45f8dd1e
AD
229602001-08-15 Akim Demaille <akim@epita.fr>
22961
22962 Version 1.28c.
22963
40a64a7a 229642001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
22965
22966 * src/reader.c (readgram): Indent output macro YYSTYPE.
22967 (packsymbols): Likewise.
22968 (output_token_defines): Likewise.
22969 * src/files.c: Standardize.
22970 (compute_header_macro): New.
22971 (defines_obstack_save): New. Use compute_header_macro.
22972 (output_files): Update. Use defines_obstack_save.
22973
f9a8293a
AD
229742001-08-15 Akim Demaille <akim@epita.fr>
22975
22976 * doc/bison.texinfo (Table of Symbols): Document
22977 YYSTACK_USE_ALLOCA.
22978
150ca7a7
AD
229792001-08-15 Akim Demaille <akim@epita.fr>
22980
22981 * missing: Update from CVS Automake.
22982 * config/config.guess, config/config.sub, config/texinfo.tex:
22983 Update from gnu.org.
22984
69b5cec4
AD
229852001-08-15 Akim Demaille <akim@epita.fr>
22986
22987 * Makefile.maint: Sync with CVS Autoconf.
22988
f2b5126e
PB
229892001-08-14 Pascal Bart <pascal.bart@epita.fr>
22990
69b5cec4 22991 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
22992 `fdl.texi'.
22993 * doc/fdl.texi: Add to package.
22994
4ecbf796
MA
229952001-08-14 Marc Autret <autret_m@epita.fr>
22996
22997 Turn on %{source,header}_extension features.
22998
69b5cec4 22999 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
23000 source_extension.
23001 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 23002 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
23003 between options.
23004
95fb5662
MA
230052001-08-14 Marc Autret <autret_m@epita.fr>
23006
23007 * src/files.c (compute_base_names): Add extensions computing when
23008 `--file-prefix' used.
23009 Standardize function calls.
23010
78d09da9
MA
230112001-08-13 Marc Autret <autret_m@epita.fr>
23012
69b5cec4 23013 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
23014 defining it (defined but null disables alloca).
23015
5a009f2c
MA
230162001-08-13 Marc Autret <autret_m@epita.fr>
23017
23018 * src/bison.simple (_yy_memcpy): CPP reformat.
23019
1e41465a
PB
230202001-08-13 Pascal Bart <pascal.bart@epita.fr>
23021
23022 * tests/atconfig.in (CPPFLAGS): Fix.
23023
c67a198d
PB
230242001-08-10 Pascal Bart <pascal.bart@epita.fr>
23025
79282c6c 23026 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
23027 `gpl.texi'.
23028 * doc/gpl.texi: Add to package.
23029
09a6de7e
MA
230302001-08-10 Marc Autret <autret_m@epita.fr>
23031
23032 * src/print_graph.h: Fix.
23033 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23034
b77b9ee0
AD
230352001-08-10 Akim Demaille <akim@epita.fr>
23036
23037 * src/system.h: Provide default declarations for stpcpy, strndup,
23038 and strnlen.
23039
3e259915
MA
230402001-08-10 Robert Anisko <anisko_r@epita.fr>
23041
23042 * doc/bison.texinfo (Locations): Update @$ stuff.
23043
ca96bc2d
MA
230442001-08-09 Robert Anisko <anisko_r@epita.fr>
23045
23046 * src/bison.simple (YYLLOC_DEFAULT): Update.
23047 (yyparse): Adjust.
23048
fdc6758b
MA
230492001-08-08 Marc Autret <autret_m@epita.fr>
23050
b77b9ee0 23051 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
23052 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23053 Reported by Fabrice Bauzac.
957d4dbf 23054
600cad3b
MA
230552001-08-08 Marc Autret <autret_m@epita.fr>
23056
23057 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23058 * src/vcg.c (output_node): Fix.
23059 * src/vcg.h: Cleanup.
23060 * src/print_graph.c: Add comments.
b77b9ee0 23061 (node_output_size): New global variable. Simplify the formatting of
600cad3b 23062 the VCG graph output.
b77b9ee0 23063 (print_actions): Unused code is now used. It notifies the final state
600cad3b 23064 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 23065 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
23066 blue.
23067 Get the current node name and node_obstack by argument.
23068 (node_obstack): New variable.
23069 (print_state): Manage node_obstack.
23070 (print_core): Use node_obstack given by argument.
23071 A node is not only computed here but in print_actions also.
23072 (print_graph): CPP out useless code instead of commenting it.
23073
976e528f
AD
230742001-08-07 Pascal Bart <pascal.bart@epita.fr>
23075
23076 * tests/atconfig.in (CPPFLAGS): Fix.
23077
20e8e5ca
AD
230782001-08-07 Akim Demaille <akim@epita.fr>
23079
23080 * src/print_graph.c (quote): New.
23081 (print_core): Use it.
23082
957d4dbf 230832001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 23084
3e3da797
AD
23085 * src/vcg.c (complain.h): Include it.
23086 Unepitaize `return' invocations.
c4b66126 23087 [NDEBUG] (main): Remove.
79282c6c 23088 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
23089 * src/files.c (open_files): Initialize graph_obstack.
23090 * src/print_graph.c (print_actions): CPP out useless code.
23091 (print_core): Don't output the last `\n' in labels.
23092 Use `quote'.
23093 * src/files.c (output_files): Output the VCG file.
23094 * src/main.c (main): Invoke print_graph ();
3e3da797 23095
957d4dbf 230962001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
23097
23098 Automaton VCG graph output.
23099 Using option ``-g'' or long option ``--graph'', you can generate
23100 a gram_filename.vcg file containing a VCG description of the LALR (1)
23101 automaton of your grammar.
23102
23103 * src/main.c: Call to print_graph() function.
23104 * src/getargs.h: Update.
23105 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23106 (graph_flag): New flag.
23107 (longopts): Update.
23108 (getargs): Add case `g'.
23109 * src/files.c (graph_obstack): New obstack struct.
23110 (open_files): Initialize new obstack.
23111 (output_files): Saves graph_obstack if required.
23112 * src/files.h (graph_obstack): New extern declaration.
23113 * src/Makefile.am: Add new source files.
23114
927c1557 231152001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
23116
23117 * src/print_graph.c, src/print_graph.h (graph): New.
23118 * src/vcg.h: New file.
23119 * src/vcg.c: New file, VCG graph handling.
23120
7333d403
AD
231212001-08-06 Marc Autret <autret_m@epita.fr>
23122
23123 Add of %source_extension and %header_extension which specify
23124 the source or/and the header output file extension.
23125
23126 * src/files.c (compute_base_names): Remove initialisation of
23127 src_extension and header_extension.
23128 (compute_exts_from_gf): Update.
23129 (compute_exts_from_src): Update.
23130 (output_files): Update.
23131 * src/reader.c (parse_header_extension_decl): New.
23132 (parse_source_extension_decl): New.
23133 (read_declarations): New case statements for the new tokens.
23134 * src/lex.c (percent_table): Add entries for %source_extension
23135 and %header_extension.
23136 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23137
84163231
AD
231382001-08-06 Marc Autret <autret_m@epita.fr>
23139
23140 * configure.in: Bump to 1.28c.
23141 * doc/bison.texinfo: Texinfo thingies.
23142
8303fc42
AD
231432001-08-04 Pascal Bart <pascal.bart@epita.fr>
23144
23145 * tests/atconfig.in (CPPFLAGS): Add.
23146 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23147
70a84437
AD
231482001-08-03 Akim Demaille <akim@epita.fr>
23149
23150 Version 1.28b.
23151
2ce10144
AD
231522001-08-03 Akim Demaille <akim@epita.fr>
23153
23154 * tests/Makefile.am (check-local): Ship testsuite.
23155 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23156 Include `string.h'.
23157
1e3e4bc1
AD
231582001-08-03 Akim Demaille <akim@epita.fr>
23159
23160 * configure.in: Try using -Wformat when compiling.
23161
42b45b7f
AD
231622001-08-03 Akim Demaille <akim@epita.fr>
23163
23164 * configure.in: Bump to 1.28b.
23165
8f13fe33
AD
231662001-08-03 Akim Demaille <akim@epita.fr>
23167
23168 * src/complain.c: Adjust strerror_r portability issues.
23169
b37ba92c
AD
231702001-08-03 Akim Demaille <akim@epita.fr>
23171
23172 Version 1.28a.
23173
b0ce6046
AD
231742001-08-03 Akim Demaille <akim@epita.fr>
23175
23176 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23177 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23178 * src/getargs.c: Include complain.h.
23179 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23180 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23181
d01c415b
AD
231822001-08-03 Akim Demaille <akim@epita.fr>
23183
23184 * src/reader.c (readgram): Display hidden chars in error messages.
23185
459dd1a6
AD
231862001-08-03 Akim Demaille <akim@epita.fr>
23187
23188 Update to gettext 0.10.39.
23189
53b74c0c
AD
231902001-08-03 Akim Demaille <akim@epita.fr>
23191
23192 * lib/strspn.c: New.
23193
234a3be3
AD
231942001-08-01 Marc Autret <autret_m@epita.fr>
23195
23196 * doc/bison.texinfo: Update.
23197 * doc/bison.1 (mandoc): Update.
23198 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23199 * src/files.c: Support output files extensions computing.
23200 (src_extension): New static variable.
23201 (header_extension): New static variable.
23202 (tr): New function.
23203 (get_extension_index): New function, gets the index of an extension
23204 filename in a string.
23205 (compute_exts_from_gf): New function, computes extensions from the
23206 grammar file extension.
23207 (compute_exts_from_src): New functions, computes extensions from the
23208 C source file extension, file given by ``-o'' option.
23209 (compute_base_names): Update.
23210 (output_files): Update.
23211
847bf1f5
AD
232122001-08-01 Robert Anisko <anisko_r@epita.fr>
23213
d995fee7 23214 * doc/bison.texi: Document @$.
847bf1f5
AD
23215 (Locations): New section.
23216
d074a105
AD
232172001-07-18 Akim Demaille <akim@epita.fr>
23218
23219 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23220 * config/prev-version.txt, config/move-if-change: New.
23221 * Makefile.am: Adjust.
23222
3419715d
AD
232232001-07-08 Pascal Bart <pascal.bart@epita.fr>
23224
23225 * src/bison.simple (yyparse): Suppress warning `comparaison
23226 between signed and unsigned'.
23227
62ab6972
AD
232282001-07-05 Pascal Bart <pascal.bart@epita.fr>
23229
23230 * src/getargs.h (raw_flag): Remove.
23231 * src/getargs.c: Die on `-r'/`--raw'.
23232 * src/lex.c (parse_percent_token): Die on `%raw'.
23233 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23234 * tests/calc.at: Suppress test with option `--raw'.
23235
1e24cc5b
AD
232362001-07-14 Akim Demaille <akim@epita.fr>
23237
23238 * config/: New.
23239 * configure.in: Require Autoconf 2.50.
23240 Update to gettext 0.10.38.
23241
32dfccf8
AD
232422001-03-16 Akim Demaille <akim@epita.fr>
23243
23244 * doc/bison.texinfo: ANSIfy the examples.
23245
cd5bd6ac
AD
232462001-03-16 Akim Demaille <akim@epita.fr>
23247
23248 * getargs.c (skeleton): New variable.
23249 (longopts): --skeleton is a new option.
23250 (shortopts, getargs): -S is a new option.
23251 * getargs.h: Declare skeleton.
23252 * output.c (output_parser): Use it.
23253
5141b016
AD
232542001-03-16 Akim Demaille <akim@epita.fr>
23255
23256 * m4/strerror_r.m4: New.
23257 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23258 * lib/error.h, lib/error.c: Update.
23259
447992b9
AD
232602001-03-16 Akim Demaille <akim@epita.fr>
23261
23262 * src/getargs.c (longopts): Clean up.
23263
274d42ce
AD
232642001-02-21 Akim Demaille <akim@epita.fr>
23265
23266 * src/reader.c (gensym): `gensym_count' is your own.
23267 Use a static buf to create the symbol name, as token_buffer is no
23268 longer a buffer.
23269
22c821f3
AD
232702001-02-08 Akim Demaille <akim@epita.fr>
23271
23272 * src/conflicts.c (conflict_report): Be sure not to append to res
23273 between two calls, which could happen if both first sprintf were
23274 skipped, but not the first cp += strlen.
23275
18569462
AD
232762001-02-08 Akim Demaille <akim@epita.fr>
23277
23278 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23279 New, from fileutils 4.0.37.
23280 * configure.in: Require Autoconf 2.49c. I took some time before
23281 making this decision. This is the only way out for portability
23282 issues in Bison, it would mean way too much duplicate effort to
23283 import in Bison features implemented in 2.49c since 2.13.
23284 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23285
0d8f3c8a
AD
232862001-02-02 Akim Demaille <akim@epita.fr>
23287
23288 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 23289 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 23290
f17bcd1f
AD
232912001-01-19 Akim Demaille <akim@epita.fr>
23292
23293 Get rid of the ad hoc handling of token_buffer in the scanner: use
23294 the obstacks.
23295
23296 * src/lex.c (token_obstack): New.
23297 (init_lex): Initialize it. No longer call...
23298 (grow_token_buffer): this. Remove it.
23299 Adjust all the places which used it to use the obstack.
23300
511e79b3
AD
233012001-01-19 Akim Demaille <akim@epita.fr>
23302
23303 * src/lex.h: Rename all the tokens:
23304 s/\bENDFILE\b/tok_eof/g;
23305 s/\bIDENTIFIER\b/tok_identifier/g;
23306 etc.
23307 Let them be enums, not #define, to ease debugging.
23308 Adjust all the code.
23309
0d6508ef
AD
233102001-01-18 Akim Demaille <akim@epita.fr>
23311
23312 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23313 * src/lex.c (maxtoken, grow_token_buffer): Static.
23314
6deb4447
AD
233152001-01-18 Akim Demaille <akim@epita.fr>
23316
23317 Since we now use obstacks, more % directives can be enabled.
23318
23319 * src/lex.c (percent_table): Also accept `%yacc',
23320 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23321 `%debug'.
23322 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23323 instead of returning a token.
23324 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23325 * src/reader.c (read_declarations): Adjust.
23326 * src/files.c (open_files): Don't call `compute_base_names', don't
23327 compute `attrsfile' since they depend upon data which might be
23328 *in* the input file now.
23329 (output_files): Do it here.
23330 * src/output.c (output_headers): Document the fact that this patch
23331 introduces a guaranteed SEGV for semantic parsers.
23332 * doc/bison.texinfo: Document them.
23333 * tests/suite.at: Exercise these %options.
23334
ff4423cc
AD
233352000-12-20 Akim Demaille <akim@epita.fr>
23336
23337 Also handle the output file (--verbose) with obstacks.
23338
23339 * files.c (foutput): Remove.
23340 (output_obstack): New.
23341 Adjust all dependencies.
23342 * src/conflicts.c: Return a string.
23343 * src/system.h (obstack_grow_string): Rename as...
23344 (obstack_sgrow): this. Be ready to work with non literals.
23345 (obstack_fgrow4): New.
23346
956dba3a
AD
233472000-12-20 Akim Demaille <akim@epita.fr>
23348
23349 * src/files.c (open_files): Fix the computation of short_base_name
23350 in the case of `-o foo.tab.c'.
23351
337bab46
AD
233522000-12-20 Akim Demaille <akim@epita.fr>
23353
23354 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23355 (copy_dollar): Now that everything uses obstacks, get rid of the
23356 FILE * parameters.
23357
5d3214b8
AD
233582000-12-20 Akim Demaille <akim@epita.fr>
23359
23360 * src/files.c (open_files): Actually the `.output' file is based
23361 on the short_base_name, not base_name.
23362 * tests/suite.at (Checking output file names): Adjust.
23363
29092a57
AD
233642000-12-20 Akim Demaille <akim@epita.fr>
23365
23366 * src/bison.s1: Remove, we now use directly...
23367 * src/bison.simple: this.
23368 * src/Makefile.am: Use pkgdata instead of data.
23369
ea5607fd
AD
233702000-12-20 Akim Demaille <akim@epita.fr>
23371
23372 * src/files.c (guard_obstack): New.
23373 (open_files): Initialize it.
23374 (output_files): Dump it...
23375 * src/files.h: Export it.
23376 * src/reader.c (copy_guard): Use it.
23377
27110317
AD
233782000-12-19 Akim Demaille <akim@epita.fr>
23379
23380 * src/files.c (outfile, defsfile, actfile): Removed as global
23381 vars.
23382 (open_files): Don't compute them.
23383 (output_files): Adjust.
23384 (base_name, short_base_name): Be global.
23385 Adjust dependencies.
23386
19c50364
AD
233872000-12-19 Akim Demaille <akim@epita.fr>
23388
23389 * src/files.c (strsuffix): New.
23390 (stringappend): Be just like strcat but allocate.
23391 (base_names): Eve out from open_files.
23392 Try to simplify the rather hairy computation of base_name and
23393 short_base_name.
23394 (open_files): Use it.
23395 * tests/suite.at (Checking output file names): New test.
23396
573c1d9f
AD
233972000-12-19 Akim Demaille <akim@epita.fr>
23398
23399 * src/system.h (obstack_grow_literal_string): Rename as...
23400 (obstack_grow_string): this.
23401 * src/output.c (output_parser): Recognize `%% actions' instead of
23402 `$'.
23403 * src/bison.s1: s/$/%% actions/.
23404 * src/bison.hairy: Likewise.
23405
ef7ddedd
AD
234062000-12-19 Akim Demaille <akim@epita.fr>
23407
23408 * src/output.c (output_parser): Compute the `#line' lines when
23409 there are.
23410 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23411 Suggested by Hans Aberg.
23412
ff61dabd
AD
234132000-12-19 Akim Demaille <akim@epita.fr>
23414
23415 Let the handling of the skeleton files be local to the procedures
23416 that use it.
23417
23418 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23419 longer static.
23420 (fparser, open_extra_files): Remove.
23421 (open_files, output_files): Don't take care of fparser.
23422 * src/files.h: Adjust.
23423 * src/output.c (output_parser): Open and close the file to the
23424 skeleton.
23425 * src/reader.c (read_declarations): When %semantic_parser, open
23426 fguard.
23427
55b96341
AD
234282000-12-19 Akim Demaille <akim@epita.fr>
23429
23430 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23431 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23432
358c15b7
AD
234332000-12-19 Akim Demaille <akim@epita.fr>
23434
23435 * src/files.c (open_files): Yipee! We no longer need all the code
23436 looking for `/tmp' since we have no tmp file.
23437
7de3329e
AD
234382000-12-19 Akim Demaille <akim@epita.fr>
23439
23440 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23441 New macros.
23442 * src/files.c (open_files): Less dependency on MSDOS etc.
23443
3abcd459
AD
234442000-12-14 Akim Demaille <akim@epita.fr>
23445
23446 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23447 Provide a default definition.
23448 Use it when executing the default @ action.
23449 * src/reader.c (reader_output_yylsp): No longer include
23450 `timestamp' and `text' in the default YYLTYPE.
23451
2a91a95e
AD
234522000-12-12 Akim Demaille <akim@epita.fr>
23453
23454 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23455 (copy_guard): Quote the file names.
23456 Reported by Laurent Mascherpa.
23457
14d3eb9b
AD
234582000-12-12 Akim Demaille <akim@epita.fr>
23459
23460 * src/output.c (output_headers, output_program, output): Be sure
23461 to escape special characters when outputting filenames.
23462 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23463 (output_headers): Don't depend on them, Use ACTSTR.
23464
d7045ec6
AD
234652000-11-17 Akim Demaille <akim@epita.fr>
23466
23467 * lib/obstack.h: Formatting changes.
23468 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23469 prevents type checking.
23470 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23471 cast the value to (void *): assigning a `foo *' to a `void *'
23472 variable is valid.
23473 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23474 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23475 append characters.
23476
6fd54b73
AD
234772000-11-17 Akim Demaille <akim@epita.fr>
23478
23479 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23480 as...
23481 (suite.m4, regression.m4, calc.m4): these.
23482 * tests/atgeneral.m4: Update from CVS Autoconf.
23483
4c50eae6
AD
234842000-11-17 Akim Demaille <akim@epita.fr>
23485
23486 * tests/regression.m4 (%union and --defines): New test,
23487 demonstrating a current bug in the obstack implementation.
23488
a35f64ea
AD
234892000-11-17 Akim Demaille <akim@epita.fr>
23490
23491 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23492 macros.
23493 Use them to declare the variables which are global or local to
23494 `yyparse'.
23495
7de23534
AD
234962000-11-17 Akim Demaille <akim@epita.fr>
23497
23498 * acconfig.h: Remove, no longer used.
23499
aa7815f5
AD
235002000-11-07 Akim Demaille <akim@epita.fr>
23501
23502 * src: s/Copyright (C)/Copyright/g.
23503
5af1f549
AD
235042000-11-07 Akim Demaille <akim@epita.fr>
23505
23506 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23507 defining.
23508 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23509
553e2b22
AD
235102000-11-07 Akim Demaille <akim@epita.fr>
23511
23512 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23513 Merge in a single CPP if/else.
23514
8a4f41d6
AD
235152000-11-07 Akim Demaille <akim@epita.fr>
23516
23517 * src/output.c (output): Remove useless variables.
23518 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23519 argument `data' for consistency with the prototypes.
23520 Qualify it `const'.
23521 (obstack_copy, obstack_copy0): Rename the second argument as
23522 `address' for consistency. Qualify it `const'.
23523 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23524 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23525 `const' their input argument (`data' or `address').
23526 Adjust the corresponding macros to include `const' in casts.
23527
095a3fb5
AD
235282000-11-03 Akim Demaille <akim@epita.fr>
23529
23530 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23531 s/PFILE1/BISON_HAIRY/.
23532 Adjust dependencies.
23533
d1cdce7c
AD
235342000-11-03 Akim Demaille <akim@epita.fr>
23535
090c5ebf 23536 For some reason, this was not applied.
d1cdce7c
AD
23537
23538 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23539 `unlink': it's no longer used.
23540
9311529b
AD
235412000-11-03 Akim Demaille <akim@epita.fr>
23542
23543 * src/files.c (skeleton_find): New function, eved out of...
23544 (open_files, open_extra_files): here.
23545
d8880f69
AD
235462000-11-03 Akim Demaille <akim@epita.fr>
23547
23548 Don't use `atexit'.
23549
23550 * src/files.c (obstack_save): New function.
23551 (done): Rename as...
23552 (output_files): this.
23553 Use `obstack_save'.
23554 * src/main.c (main): Don't use `atexit' to register `done', since
23555 it no longer has to remove tmp files, just call `output_files'
23556 when there are no errors.
23557
0dbb648e
AD
235582000-11-02 Akim Demaille <akim@epita.fr>
23559
23560 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23561 `unlink': it's no longer used.
23562 * src/files.h: Formatting changes.
23563
896fe5c1
AD
235642000-11-02 Akim Demaille <akim@epita.fr>
23565
23566 Remove the last uses of mktemp and unlink/delete.
23567
23568 * src/files.c (fdefines, ftable): Removed.
23569 (defines_ostack, table_obstack): New.
23570 Adjust dependencies of the former into uses of the latter.
23571 * src/output.c (output_short_or_char_table, output_short_table):
23572 Convert to using obstacks.
23573 * src/reader.c (copy_comment2): Accept one FILE * and two
23574 obstacks.
23575 (output_token_defines, reader_output_yylsp): Use obstacks.
23576 * src/system.h (obstack_fgrow3): New.
1f65350a 23577 * po/POTFILES.in: Adjust.
896fe5c1 23578
dd60faec
AD
235792000-11-01 Akim Demaille <akim@epita.fr>
23580
23581 Change each use of `fattrs' into a use of `attrs_obstack'.
23582
23583 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23584 * src/files.c (fattrs): Remove.
23585 (attrs_obstack): New.
23586 Adjust all dependencies.
23587 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23588
8c7ebe49
AD
235892000-11-01 Akim Demaille <akim@epita.fr>
23590
23591 Introduce obstacks.
23592 Change each use of `faction' into a use of `action_obstack'.
23593
23594 * lib/obstack.h, lib/obstack.c: New files.
23595 * src/files.c (faction): Remove.
23596 (action_obstack): New.
23597 Adjust all dependencies.
23598
77aee789
AD
235992000-10-20 Akim Demaille <akim@epita.fr>
23600
23601 * lib/quote.h (PARAMS): New macro. Use it.
23602
43591cec
AD
236032000-10-16 Akim Demaille <akim@epita.fr>
23604
23605 * src/output.c (output_short_or_char_table): New function.
23606 (output_short_table, output_token_translations): Use it.
23607 (goto_actions): Use output_short_table.
23608
1e9798d5
AD
236092000-10-16 Akim Demaille <akim@epita.fr>
23610
23611 * src/symtab.c (bucket_new): New function.
23612 (getsym): Use it.
23613
23614 * src/output.c (output_short_table): New argument to display the
23615 comment associated with the table.
23616 Adjust dependencies.
23617 (output_gram): Use it.
23618 (output_rule_data): Nicer output layout for YYTNAME.
23619
f282676b
AD
236202000-10-16 Akim Demaille <akim@epita.fr>
23621
23622 * src/lex.c (read_typename): New function.
23623 (lex): Use it.
23624 * src/reader.c (copy_dollar): Likewise.
23625
550a72a3
AD
236262000-10-16 Akim Demaille <akim@epita.fr>
23627
23628 * src/reader.c (copy_comment2): Expect the input stream to be on
23629 the `/' which is suspected to open a comment, instead of being
23630 called after `//' or `/*' was read.
23631 (copy_comment, copy_definition, parse_union_decl, copy_action)
23632 (copy_guard): Adjust.
23633
131e2fef
AD
236342000-10-16 Akim Demaille <akim@epita.fr>
23635
23636 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23637 `read_signed_integer'.
23638
79282c5a
AD
236392000-10-16 Akim Demaille <akim@epita.fr>
23640
23641 * src/reader.c (copy_dollar): New function.
23642 (copy_guard, copy_action): Use it.
23643
ff4a34be
AD
236442000-10-16 Akim Demaille <akim@epita.fr>
23645
23646 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23647 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23648 New files, from Fileutils 4.0.27.
23649 * src/main.c (printable_version): Remove.
23650 * src/lex.c, src/reader.c: Use `quote'.
23651
236522000-10-04 Akim Demaille <akim@epita.fr>
23653
23654 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23655
14ded682
AD
236562000-10-04 Akim Demaille <akim@epita.fr>
23657
23658 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23659
8e03724b
AD
236602000-10-04 Akim Demaille <akim@epita.fr>
23661
23662 When a literal string is used to define two different tokens,
23663 `bison -v' segfaults.
23664 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23665
23666 * tests/regression.m4: New file.
23667 Include the core of the sample provided by Piotr Gackiewicz.
23668 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23669 properly.
23670
a9e64249
AD
236712000-10-04 Akim Demaille <akim@epita.fr>
23672
23673 * src/reader.c (parse_expect_decl): Keep `count' within the size
23674 of `buffer'.
23675 From Neil Booth.
23676
da9abf43
AD
236772000-10-02 Paul Eggert <eggert@twinsun.com>
23678
23679 * bison.s1 (yyparse): Assign the default value
23680 unconditionally, to avoid a GCC warning and make the parser a
23681 tad smaller.
23682
c33638bb
AD
236832000-10-02 Akim Demaille <akim@epita.fr>
23684
23685 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23686 options.
23687
444c570a
AD
236882000-10-02 Akim Demaille <akim@epita.fr>
23689
23690 * src/derives.c, src/print.c, src/reduce.c: To ease the
23691 translation, move some `\n' out of the translated strings.
23692
89cab50d
AD
236932000-10-02 Akim Demaille <akim@epita.fr>
23694
23695 The location tracking mechanism is precious for parse error
23696 messages. Nevertheless, it is enabled only when `@n' is used in
23697 the grammar, which is a different issue (you can use it in error
23698 message, but not in the grammar per se). Therefore, there should
23699 be another means to enable it.
23700
23701 * src/getargs.c (getargs): Support `--locations'.
23702 (usage): Report it.
23703 * src/getargs.h (locationsflag): Export it.
23704 * src/lex.c (percent_table): Support `%locations'.
23705 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23706 with `locationsflag'.
23707 * doc/bison.texinfo: Document `--locations' and `%locations'.
23708 Sort the options.
23709 * tests/calc.m4: Test it.
23710
23711 For regularity of the names, replace each
23712 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23713 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23714 In addition replace each `flag' with `_flag'.
23715
d6c2cba0
AD
237162000-10-02 Akim Demaille <akim@epita.fr>
23717
23718 Also test parse error messages, including with YYERROR_VERBOSE.
23719
23720 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23721 associative).
23722 Use it to check the computations.
23723 Use it to check `nonassoc' is honored.
23724 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23725 `--yyerror-verbose'.
23726 (_AT_CHECK_CALC): Adjust to this option.
23727 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23728
5a35a6cb
AD
237292000-10-02 Akim Demaille <akim@epita.fr>
23730
23731 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23732 the latter demonstrates a flaw in the handling of non debugging
23733 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23734 was used in order to simplify:
23735
23736 #if YYDEBUG
23737 if (yydebug)
23738 {
23739 ...
23740 }
23741 #endif
23742
23743 into
23744
23745 if (yydebug)
23746 {
23747 ...
23748 }
23749
23750 unfortunately this leads to a CPP conflict when
23751 `--name-prefix=foo' is used since it produces `#define yydebug
23752 foodebug'.
23753
23754 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23755 (YYDPRINTF): New macro.
23756 Spread its use.
23757 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23758 the bison options.
23759 Also test `--verbose', `--defines' and `--name-prefix'.
23760
71da9eea
AD
237612000-10-02 Akim Demaille <akim@epita.fr>
23762
23763 Improve the readability of the produced parsers.
23764
23765 * src/bison.s1: Formatting changes.
23766 Improve the comment related to the `$' mark.
23767 (yydefault): Don't fall through to `yyresume': `goto' there.
23768 * src/output.c (output_parser): When the `$' is met, skip the end
23769 of its line.
23770 New variable, `number_of_dollar_signs', to check there's exactly
23771 one `$' in the parser skeleton.
23772
95e36146
AD
237732000-10-02 Akim Demaille <akim@epita.fr>
23774
23775 * lib/xstrdup.c: New file, from the fileutils.
23776 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23777 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23778 instead of strlen + xmalloc + strcpy.
23779 * src/symtab.c (copys): Remove, use xstrdup instead.
23780
d7020c20
AD
237812000-10-02 Akim Demaille <akim@epita.fr>
23782
23783 * src/gram.h (associativity): New enum type which replaces the
23784 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23785 `right_assoc', `left_assoc' and `non_assoc'.
23786 Adjust all dependencies.
23787 * src/reader.c: Formatting changes.
23788 (LTYPESTR): Don't define it, use it as a literal in
23789 `reader_output_yylsp'.
23790 * src/symtab.h (symbol_class): New enum type which replaces the
23791 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23792 `sunknown', `stoken and `snterm'.
23793
1916f98e
AD
237942000-10-02 Akim Demaille <akim@epita.fr>
23795
23796 * src/getargs.c (fixed_outfiles): Rename as...
23797 (yaccflag): for consistency and accuracy.
23798 Adjust dependencies.
23799
d7913476
AD
238002000-10-02 Akim Demaille <akim@epita.fr>
23801
23802 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23803 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23804 difficult and introduced a lot of core dump. It turns out that
23805 Bison used an implementation of `xmalloc' based on `calloc', and
23806 at various places it does depend upon the initialization to 0. I
23807 have not tried to isolate the pertinent places, and all the former
23808 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23809 someone should address this issue.
23810
23811 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23812 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23813 files.
23814 Adjust dependencies.
23815 * src/warshall.h: New file.
23816 Propagate.
23817
340ef489
AD
238182000-10-02 Akim Demaille <akim@epita.fr>
23819
23820 Various anti-`extern in *.c' changes.
23821
23822 * src/system.h: Include `assert.h'.
23823
b2ca4022
AD
238242000-10-02 Akim Demaille <akim@epita.fr>
23825
23826 * src/state.h (nstates, final_state, first_state, first_shift)
23827 (first_reduction): Move their exportation from here...
23828 * src/LR0.h: to here.
23829 Adjust dependencies.
23830 * src/getargs.c (statisticsflag): New variable.
23831 Add support for `--statistics'.
23832 Adjust dependencies.
23833
23834 Remove a lot of now useless `extern' statements in most files.
23835
403b315b
AD
238362000-10-02 Akim Demaille <akim@epita.fr>
23837
23838 * src/LR0.h: New file.
23839 Propagate its use.
23840
07a58c13
AD
238412000-10-02 Akim Demaille <akim@epita.fr>
23842
23843 * src/print.h: New file.
23844 Propagate its use.
23845 * src/print.c: Formatting and ordering changes.
23846 (verbose, terse): Replace with...
23847 (print_results): this new function.
23848 Adjust dependencies.
23849
0619caf0
AD
238502000-10-02 Akim Demaille <akim@epita.fr>
23851
23852 * src/conflicts.c (conflict_report): New function.
23853 (conflict_log, verbose_conflict_log): Replace with...
23854 (print_conflicts): this function.
23855 Adjust dependencies.
23856 * src/conflicts.h: New file.
23857 Propagate its inclusion.
23858
3519ec76
AD
238592000-10-02 Akim Demaille <akim@epita.fr>
23860
23861 * src/nullable.h: New file.
23862 Propagate its inclusion.
23863 * src/nullable.c: Formatting changes.
23864
015acc48
AD
238652000-10-02 Akim Demaille <akim@epita.fr>
23866
23867 * src/reduce.h: New file.
23868 Propagate its inclusion.
23869 * src/reduce.c: Topological sort and other formatting changes.
23870 (bool, TRUE, FALSE): Move their definition to...
23871 * src/system.h: here.
23872
8963a27b
AD
238732000-10-02 Akim Demaille <akim@epita.fr>
23874
23875 * src/files.c: Formatting changes.
23876 (tryopen, tryclose, openfiles): Rename as...
23877 (xfopen, xfclose, open_files): this.
23878 (stringappend): static.
23879 * src/files.h: Complete the list of exported symbols.
23880 Propagate its use.
23881
a70083a3
AD
238822000-10-02 Akim Demaille <akim@epita.fr>
23883
23884 * src/reader.h: New file.
23885 Propagate its use instead of tedious list of `extern' and
23886 prototypes.
23887 * src/reader.c: Formatting changes, topological sort,
23888 s/register//.
23889
abadc117
AD
238902000-10-02 Akim Demaille <akim@epita.fr>
23891
23892 * src/lex.h: Prototype `lex.c' exported functions.
23893 * src/reader.c: Adjust.
23894 * src/lex.c: Formatting changes.
23895 (safegetc): Rename as...
23896 (xgetc): this.
23897
720d742f
AD
238982000-10-02 Akim Demaille <akim@epita.fr>
23899
23900 * src/lalr.h: New file.
23901 Propagate its inclusion instead of prototypes and `extern'.
23902 * src/lalr.c: Formatting changes, topological sorting etc.
23903
f2acea59
AD
239042000-10-02 Akim Demaille <akim@epita.fr>
23905
23906 * src/output.c (token_actions): Introduce a temporary array,
23907 YYDEFACT, that makes it possible for this function to use
23908 output_short_table.
23909
d019d655
AD
239102000-10-02 Akim Demaille <akim@epita.fr>
23911
23912 `user_toknums' is output as a `short[]' in `output.c', while it is
23913 defined as a `int[]' in `reader.c'. For consistency with the
23914 other output tables, `user_toknums' is now defined as a table of
23915 shorts.
23916
23917 * src/reader.c (user_toknums): Be a short table instead of an int
23918 table.
23919 Adjust dependencies.
23920
23921 Factor the short table outputs.
23922
23923 * src/output.c (output_short_table): New function.
23924 * src/output.c (output_gram, output_stos, output_rule_data)
23925 (output_base, output_table, output_check): Use it.
23926
6c89f1c1
AD
239272000-10-02 Akim Demaille <akim@epita.fr>
23928
23929 * src/output.c (output): Topological sort of the functions, in
23930 order to get rid of the `static' prototypes.
23931 No longer use `register'.
23932 * src/output.h: New file.
23933 Propagate its inclusion in files explicitly prototyping functions
23934 from output.c.
23935
d9efd181
AD
239362000-09-21 Akim Demaille <akim@epita.fr>
23937
23938 * src/atgeneral.m4: Update from Autoconf.
23939
c29240e7 239402000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
23941
23942 * src/closure.h: New file.
23943 * src/closure.c: Formatting changes, topological sort over the
23944 functions, use of closure.h.
23945 (initialize_closure, finalize_closure): Rename as...
23946 (new_closure, free_closure): these. Adjust dependencies.
23947 * src/LR0.c: Formatting changes, topological sort, use of
23948 cloture.h.
23949 (initialize_states): Rename as...
23950 (new_states): this.
23951 * src/Makefile.am (noinst_HEADERS): Adjust.
23952
499daa50
AD
239532000-09-20 Akim Demaille <akim@epita.fr>
23954
23955 * src/acconfig.h: Don't protect config.h against multiple
23956 inclusion.
23957 Don't define PARAMS.
23958 * src/system.h: Define PARAMS.
23959 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
23960 purpose of config.h. system.h must not try to fix wrong
23961 definitions in config.h.
23962
cc84fd5d
AD
239632000-09-20 Akim Demaille <akim@epita.fr>
23964
23965 * src/derives.h: New file.
23966 * src/main.c, src/derives.h: Use it.
23967 Formatting changes.
23968 * src/Makefile.am (noinst_HEADERS): Adjust.
23969
db5b3a89
AD
239702000-09-20 Akim Demaille <akim@epita.fr>
23971
23972 * tests/atgeneral.m4: Update from Autoconf.
23973 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
23974 (AT_CHECK_CALC): New macros.
23975 Use these macros to test bison with options `', `--raw',
23976 `--debug', `--yacc', `--yacc --debug'.
23977
ceed8467
AD
239782000-09-19 Akim Demaille <akim@epita.fr>
23979
23980 * src/output.c: Formatting changes.
23981 * src/machine.h: Remove, leaving its contents in...
23982 * src/system.h: here.
23983 Include stdio.h.
23984 Adjust all dependencies on stdio.h and machine.h.
23985 * src/getargs.h: New file.
23986 Let all `extern' declarations about getargs.c be replaced with
23987 inclusion of `getargs.h'.
23988 * src/Makefile.am (noinst_HEADERS): Adjust.
23989
23990 * tests/calc.m4 (yyin): Be initialized in main, not on the global
23991 scope.
23992 (yyerror): Returns void, not int.
23993 * doc/bison.texinfo: Formatting changes.
23994
05a1d24b
AD
239952000-09-19 Akim Demaille <akim@epita.fr>
23996
23997 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23998 portable.
23999
cbd25751
AD
240002000-09-18 Akim Demaille <akim@epita.fr>
24001
24002 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24003 * src/Makefile.am (INCLUDES): Don't.
24004 Be ready to fetch headers in lib/.
24005
13863333
AD
240062000-09-18 Akim Demaille <akim@epita.fr>
24007
24008 * doc/bison.texinfo: Update the copyright.
24009 ANSIfy and GNUify the examples.
24010 Remove the old menu.
24011
0d533154
AD
240122000-09-18 Akim Demaille <akim@epita.fr>
24013
24014 First set of tests: use the `calc' example from the documentation.
24015
24016 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24017 is defined only when YYDEBUG is.
24018 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24019 * src/files.c (tryopen, tryclose): Formatting changes.
24020 Move to the top and be static.
24021 * src/reader.c (read_signed_integer): Likewise.
24022 * tests/calc.m4: New file.
24023 * Makefile.am, suite.m4: Adjust.
24024 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24025
e79137ac
AD
240262000-09-18 Akim Demaille <akim@epita.fr>
24027
24028 Add support for an Autotest test suite for Bison.
24029
24030 * m4/m4.m4, m4/atconfig.m4: New files.
24031 * m4/Makefile.am (EXTRA_DIST): Adjust.
24032 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24033 files.
24034 * src/getargs.c: Display a more standard --version message.
24035 * src/reader.c (reader): Formatting changes.
24036 No longer depend upon VERSION_STRING.
24037 * configure.in: No longer use `dnl'.
24038 Set up the test suite and the new directory `tests/.
24039 (VERSION_STRING): Remove.
24040
27821bff
AD
240412000-04-14 Akim Demaille <akim@epita.fr>
24042
24043 * src/reader.c (copy_comment2): New function, same as former
24044 `copy_comment', but outputs into two FILE *.
24045 (copy_comment): Use it.
24046 (parse_union_decl): Use it.
24047 (get_type, parse_start_decl): Use the same `invalid' message.
24048 (parse_start_decl, parse_union_decl): Use the same `multiple'
24049 message.
24050 (parse_union_decl, copy_guard, copy_action): Use the same
24051 `unmatched' message.
24052 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24053
cfe5fbc0
AD
240542000-03-31 Akim Demaille <akim@epita.fr>
24055
24056 * src/files.c (tryopen, tryclose): Move to the top.
24057 Be static.
24058
cb7db13e
AD
240592000-03-31 Akim Demaille <akim@epita.fr>
24060
24061 * src/main.c (main): Don't call `done', exit does it.
24062
a0f6b076
AD
240632000-03-31 Akim Demaille <akim@epita.fr>
24064
36281465
AD
24065 * allocate.c: s/return (foo)/return foo/.
24066 * lalr.c: Likewise.
24067 * LR0.c: Likewise.
24068 * output.c: Likewise.
24069 * reader.c: Likewise.
24070 * symtab.c: Likewise.
24071 * vmsgetargs.c: Likewise.
24072
240732000-03-31 Akim Demaille <akim@epita.fr>
24074
24075 Clean up the error reporting functions.
a0f6b076
AD
24076
24077 * src/report.c: New file.
24078 * src/report.h: Likewise.
24079 * src/Makefile.am: Adjust.
24080 * m4/error.m4: New file.
24081 * m4/Makefile.am: Adjust.
24082 * configure.in (jm_PREREQ_ERROR): Call it.
24083 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24084 Remove.
24085 (fatal, fatals): Remove. All callers use complain.c::fatal.
24086 (warn, warni, warns, warnss, warnss): Remove. All callers use
24087 complain.c::complain.
24088 (toomany): Remove, use fatal instead.
24089 * src/files.c (done): No argument, use complain_message_count.
24090 * src/main.c (main): Register `done' to `atexit'.
24091
24092 * src/getargs.c (usage): More `fputs', less `fprintf'.
24093
18539825
AD
240942000-03-28 Akim Demaille <akim@epita.fr>
24095
24096 * lib/: New directory.
24097 * Makefile.am (SUBDIRS): Adjust.
24098 * configure.in: Adjust.
24099 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24100 useless.
24101 * src/alloca.c: Moved to lib/.
24102 * src/getopt.c: Likewise.
24103 * src/getopt1.c: Likewise.
24104 * src/getopt.h: Likewise.
24105 * src/ansi2knr.c: Likewise.
24106 * src/ansi2knr.1: Likewise.
24107 * src/Makefile.am: Adjust.
24108 * lib/Makefile.am: New file.
24109
9f306f2a
AD
241102000-03-28 Akim Demaille <akim@epita.fr>
24111
24112 * src/getargs.c (usage): Refresh the help message.
24113
0ba347b6
AD
241142000-03-17 Akim Demaille <akim@epita.fr>
24115
24116 * src/getopt1.c: Updated from textutils 2.0e
24117 * src/getopt.c: Likewise.
24118 * src/getopt.h: Likewise.
24119
dbe7f271
AD
241202000-03-17 Akim Demaille <akim@epita.fr>
24121
24122 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24123 the file name, not the whole `#line LINE FILE'.
24124
75bbe78d
AD
241252000-03-17 Akim Demaille <akim@epita.fr>
24126
24127 On syntax errors, report the token on which we choked.
24128
aa5fd0ee
AD
24129 * src/bison.s1 (yyparse): In the label yyerrlab, when
24130 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 24131
7b306f52
AD
241322000-03-17 Akim Demaille <akim@epita.fr>
24133
aa5fd0ee 24134 * src/reader.c (copy_at): New function.
7b306f52
AD
24135 (copy_guard): Use it.
24136 (copy_action): Use it.
24137
e87b5700
AD
241382000-03-17 Akim Demaille <akim@epita.fr>
24139
24140 Be kind to translators, save some useless translations.
24141
aa5fd0ee 24142 * src/main.c (banner): New function.
e87b5700
AD
24143 (fatal_banner): Use it.
24144 (warn_banner): Use it.
24145
ae3c3164
AD
241462000-03-17 Akim Demaille <akim@epita.fr>
24147
aa5fd0ee
AD
24148 * src/reader.c (copy_definition): Use copy_string and
24149 copy_comment. Removed now unused `match', `ended',
24150 `cplus_comment'.
ae3c3164
AD
24151 (copy_comment, copy_string): Moved, to be visible from
24152 copy_definition.
24153
4dc58e7c
AD
241542000-03-17 Akim Demaille <akim@epita.fr>
24155
aa5fd0ee
AD
24156 * src/reader.c (copy_string): Declare `static inline'. No
24157 problems with inline, since it is checked by configure.
4dc58e7c
AD
24158 (copy_comment): Likewise.
24159
0a6384c4
AD
241602000-03-17 Akim Demaille <akim@epita.fr>
24161
aa5fd0ee 24162 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 24163
3cef001a
AD
241642000-03-17 Akim Demaille <akim@epita.fr>
24165
aa5fd0ee 24166 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
24167 (copy_action): Use it. Removed now unused `match', `ended',
24168 `cplus_comment'.
24169 (copy_guard): Likewise.
24170
ca36d2ef
AD
241712000-03-17 Akim Demaille <akim@epita.fr>
24172
aa5fd0ee 24173 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
24174 (copy_action): Use it.
24175 (copy_guard): Likewise.
24176
6666f98f
AD
241772000-03-17 Akim Demaille <akim@epita.fr>
24178
24179 Change the handling of @s so that they behave exactly like $s.
24180 There is now a pseudo variable @$ (readble and writable), location
24181 of the lhs of the rule (by default ranging from the location of
24182 the first symbol of the rhs, to the location of the last symbol,
24183 or, if the rhs is empty, YYLLOC).
24184
24185 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24186 yyval.
24187 (yyparse): When providing a default semantic action, provide a
24188 default location action.
24189 (after the $): No longer change `*YYLSP', just stack YYLOC the
24190 same way you stack YYVAL.
24191 * src/reader.c (read_declarations): Use warns.
24192 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24193 (copy_action, case '@'): Likewise.
24194 Use a standard error message, to save useless work from
24195 translators.
24196
41aca2e0
AD
241972000-03-17 Akim Demaille <akim@epita.fr>
24198
aa5fd0ee
AD
24199 * src/bison.s1: Formatting and cosmetics changes.
24200 * src/reader.c: Likewise.
41aca2e0
AD
24201 Update the Copyright notice.
24202
dc08c1d5
AD
242032000-03-17 Akim Demaille <akim@epita.fr>
24204
aa5fd0ee
AD
24205 * src/bison.s1 (#line): All set to `#line' only, since the
24206 Makefile now handles them.
dc08c1d5 24207
9ee3c97b
AD
242082000-03-16 Akim Demaille <akim@epita.fr>
24209
24210 * src/output.c (output_rule_data): Output the documentation of
24211 some of the tables.
24212 (Copyright notice): Update.
24213 Formatting changes.
24214
0de741ca
AD
242152000-03-16 Akim Demaille <akim@epita.fr>
24216
24217 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24218 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24219 One `#if YYDEBUG' remains, since it uses variables which are
24220 defined only if `YYDEBUG != 0'.
24221
bb10be54
AD
242222000-03-16 Akim Demaille <akim@epita.fr>
24223
24224 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24225 and related variables so that the similarities are highlighted.
24226
b07b484a
AD
242272000-03-16 Akim Demaille <akim@epita.fr>
24228
24229 * src/bison.s1: Properly indent CPP directives.
24230
361f60b3
AD
242312000-03-16 Akim Demaille <akim@epita.fr>
24232
24233 * src/bison.s1: Properly indent the `alloca' CPP section.
24234
8c44d3ec
AD
242352000-03-16 Akim Demaille <akim@epita.fr>
24236
24237 Do not hard code values of directories in `configure.in'.
24238 Update the `configure' tool chain.
24239
24240 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24241 src/makefile.am.
24242 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24243 (AC_OUTPUT): Add m4/Makefile.
24244 Bump to bison 1.28a, 1.29 has never been released.
24245 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24246 handled via src/Makefile.am.
24247 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24248 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24249 autoheader.
24250 * Makefile.am (SUBDIRS): Add m4.
24251 (ACLOCAL_AM_FLAGS): New variable.
24252 (AUTOMAKE_OPTIONS): Add check-news.
24253 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24254 the proper line number and file name.
24255 (DEFS): Propagate the location of bison library files and of the
24256 locale files.
24257 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24258 builddir.
24259 * acinclude.m4: Remove, replaced by the directory m4.
24260 * m4/Makefile.am (EXTRA_DIST): New variable.
24261 * m4/gettext.m4: New file, from the fileutils.
24262 * m4/lcmessage.m4: Likewise
24263 * m4/progtest.m4: Likewise.
24264 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24265
f95997e7
AD
242662000-03-10 Akim Demaille <akim@epita.fr>
24267
24268 * src/closure.c:
24269 Formatting changes of various comments.
24270 Respect the GNU coding standards at various places.
24271 Don't use `_()' when no translation is needed.
24272
242731999-12-13 Jesse Thilo <jthilo@gnu.org>
24274
24275 * src/files.c:
24276 OS/2 honors TMPDIR environment variable.
24277
242781999-12-13 Jesse Thilo <jthilo@gnu.org>
24279
24280 * doc/bison.texinfo: Tweaked spelling and grammar.
24281 Updated ISBN.
24282 Removed reference to price of printed copy.
24283 Mention BISON_SIMPLE and BISON_HAIRY.
24284
242851999-12-13 Jesse Thilo <jthilo@gnu.org>
24286
24287 * configure.in, NEWS:
24288 Bison 1.29 released.
24289
242901999-10-27 Jesse Thilo <jthilo@gnu.org>
24291
24292 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24293 Added reference card.
24294
242951999-07-26 Jesse Thilo <jthilo@gnu.org>
24296
24297 * po/ru.po: Added Russian translation.
24298
242991999-07-26 Jesse Thilo <jthilo@gnu.org>
24300
24301 * configure.in: Added Russian translation.
24302
243031999-07-06 Jesse Thilo <jthilo@gnu.org>
24304
24305 * configure.in, NEWS, README:
24306 Released version 1.28.
24307
243081999-06-14 Jesse Thilo <jthilo@gnu.org>
24309
24310 * src/system.h:
24311 Squashed redefinition warning on some systems.
24312
24313 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24314 Have configure build version string instead of relying on ANSI string
24315 concatentation.
24316
243171999-06-14 Jesse Thilo <jthilo@gnu.org>
24318
24319 * po/POTFILES.in: Got rid of version.c.
24320
243211999-06-14 Jesse Thilo <jthilo@gnu.org>
24322
24323 * acconfig.h, configure.in:
24324 Have configure build version string instead of relying on ANSI string
24325 concatentation.
24326
243271999-06-08 Jesse Thilo <jthilo@gnu.org>
24328
24329 * doc/bison.1:
24330 Dropped mention of `+' for long-named options.
24331
243321999-05-30 Jesse Thilo <jthilo@gnu.org>
24333
24334 * src/files.c: Added <unistd.h> for unlink().
24335
24336 * src/Makefile.am, src/system.h:
24337 I18n fixes.
24338
243391999-05-30 Jesse Thilo <jthilo@gnu.org>
24340
24341 * README: Added a FAQ list.
24342
24343 * configure.in, acconfig.h:
24344 I18n fixes.
24345
243461999-05-30 Jesse Thilo <jthilo@gnu.org>
24347
24348 * doc/FAQ, doc/Makefile.am:
24349 Added a FAQ list.
24350
243511999-05-19 Jesse Thilo <jthilo@gnu.org>
24352
24353 * src/alloc.h, src/symtab.h, src/version.c:
24354 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24355
243561999-04-18 Jesse Thilo <jthilo@gnu.org>
24357
24358 * src/.cvsignore, src/Makefile.am:
24359 Reorganized: sources in `src', documentation in `doc'.
24360
24361 * src/lex.c (literalchar):
24362 fixed the code for escaping double quotes (thanks
24363 Jonathan Czisny.)
24364
243651999-04-18 Jesse Thilo <jthilo@gnu.org>
24366
24367 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24368 Adjusted paths to reflect directory reorganization.
24369
243701999-04-18 Jesse Thilo <jthilo@gnu.org>
24371
24372 * doc/.cvsignore, doc/Makefile.am:
24373 Reorganized: sources in `src', documentation in `doc'.
24374
243751999-04-18 Jesse Thilo <jthilo@gnu.org>
24376
24377 * configure.in:
24378 Updated AC_INIT file to reflect directory reorganization.
24379
24380 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24381 Reorganized: sources in `src', documentation in `doc'.
24382
243831999-04-13 Jesse Thilo <jthilo@gnu.org>
24384
24385 * src/allocate.c:
24386 Don't declare calloc() and realloc() if not necessary.
24387
243881999-04-13 Jesse Thilo <jthilo@gnu.org>
24389
24390 * configure.in, acconfig.h, acinclude.m4:
24391 Don't declare calloc() and realloc() if not necessary.
24392
243931999-03-23 Jesse Thilo <jthilo@gnu.org>
24394
24395 * po/.cvsignore: Added i18n support.
24396
243971999-03-23 Jesse Thilo <jthilo@gnu.org>
24398
24399 * acconfig.h, configure.in, Makefile.am:
24400 Added i18n support.
24401
244021999-03-22 Jesse Thilo <jthilo@gnu.org>
24403
24404 * src/bison.s1: Fixed #line numbers.
24405
244061999-03-15 Jesse Thilo <jthilo@gnu.org>
24407
24408 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24409 Added PO files from Translation Project.
24410
244111999-03-03 Jesse Thilo <jthilo@gnu.org>
24412
24413 * Makefile.am:
24414 Added support for non-ANSI compilers (ansi2knr).
24415
244161999-02-16 Jesse Thilo <jthilo@gnu.org>
24417
24418 * configure.in: Bumped version number to 1.27.
24419
24420 * Makefile.am:
24421 Added `bison.simple' to list of files removed by `make distclean'.
24422
244231999-02-12 Jesse Thilo <jthilo@gnu.org>
24424
24425 * src/files.c, src/files.h:
24426 Defined locations of parser files in config.h instead of Makefile.
24427
244281999-02-12 Jesse Thilo <jthilo@gnu.org>
24429
24430 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24431 Defined locations of parser files in config.h instead of Makefile.
24432
244331999-02-09 Jesse Thilo <jthilo@gnu.org>
24434
24435 * Makefile.am:
24436 Removed inappropriate use of $< macro.
24437
244381999-02-05 Jesse Thilo <jthilo@gnu.org>
24439
24440 * po/Makefile.in.in, po/POTFILES.in:
24441 Add `po' directory skeleton.
24442
244431999-01-27 Jesse Thilo <jthilo@gnu.org>
24444
24445 * README: Document help-bison list.
24446
24447 * configure.in: Add check for mkstemp().
24448
244491999-01-20 Jesse Thilo <jthilo@gnu.org>
24450
24451 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24452 Hush a few compiler warnings.
24453
24454 * src/files.c:
24455 Add tryclose(), which verifies that fclose was successful.
24456 Hush a couple of compiler warnings.
24457
244581999-01-20 Jesse Thilo <jthilo@gnu.org>
24459
24460 * Makefile.am, OChangeLog:
24461 ChangeLog is now automatically generated. Include the old version as
24462 OChangeLog.
24463
244641999-01-14 Jesse Thilo <jthilo@gnu.org>
24465
24466 * 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:
24467 Update FSF address.
24468
244691999-01-14 Jesse Thilo <jthilo@gnu.org>
24470
24471 * doc/bison.texinfo: Fix formatting glitch.
24472
24473 * doc/bison.texinfo: Update FSF address.
24474
244751999-01-14 Jesse Thilo <jthilo@gnu.org>
24476
24477 * acconfig.h: Update FSF address.
24478
244791999-01-08 Jesse Thilo <jthilo@gnu.org>
24480
24481 * src/system.h:
24482 Don't define PACKAGE here, since config.h defines it.
24483
244841998-12-30 Jesse Thilo <jthilo@gnu.org>
24485
24486 * src/reader.c: Update copyright date.
24487
24488 * src/main.c:
24489 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24490 favor of output directly to stderr (avoids buffer overruns).
24491
24492 * src/reader.c: Some checks for premature EOF.
24493
24494 * 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:
24495 Use prototypes if the compiler understands them.
24496
24497 * src/files.c: Honor TMPDIR on Unix hosts.
24498 Use prototypes if the compiler understands them.
24499
24500 * src/reader.c:
24501 Fix a couple of buffer overrun bugs.
24502 Use prototypes if the compiler understands them.
24503
24504 * src/system.h: Include unistd.h and ctype.h.
24505 Use #ifdef instead of #if for NLS symbols.
24506
245071998-12-30 Jesse Thilo <jthilo@gnu.org>
24508
24509 * doc/bison.texinfo:
24510 Delete comment "consider using @set for edition number, etc..." since
24511 we now are doing so.
24512
245131998-12-30 Jesse Thilo <jthilo@gnu.org>
24514
24515 * configure.in:
24516 Use prototypes if the compiler understands them.
24517
24518 * NEWS: Document 1.26 highlights.
24519
24520 * Makefile.am: Require Automake 1.3 or later.
24521
24522 * acconfig.h:
24523 Use prototypes if the compiler understands them.
24524
245251998-12-29 Jesse Thilo <jthilo@gnu.org>
24526
24527 * src/version.c:
24528 Use VERSION symbol from automake for version number.
24529
245301998-12-29 Jesse Thilo <jthilo@gnu.org>
24531
24532 * acconfig.h, configure.in, version.cin:
24533 Use VERSION symbol from automake for version number.
24534
245351998-11-28 Jesse Thilo <jthilo@gnu.org>
24536
24537 * Makefile.am:
24538 Distribute original version of simple parser (bison.s1), not built
24539 version (bison.simple).
24540
245411998-11-28 Jesse Thilo <jthilo@gnu.org>
24542
24543 * doc/bison.texinfo: Add info dir entry.
24544
24545 * doc/bison.texinfo:
24546 Let automake put version number into documentation.
24547
245481998-11-26 Jesse Thilo <jthilo@gnu.org>
24549
24550 * src/bison.cld, src/build.com, src/vmshlp.mar:
24551 Add non-RCS files from /gd/gnu/bison.
24552
245531998-11-26 Jesse Thilo <jthilo@gnu.org>
24554
24555 * doc/bison.1:
24556 Document the BISON_HAIRY and BISON_SIMPLE variables.
24557
245581998-11-25 Jesse Thilo <jthilo@gnu.org>
24559
24560 * src/version.c: Build version.c automatically.
24561
24562 * src/reader.c:
24563 Fix token numbering (used to start at 258, not 257).
24564
24565 * src/system.h: Include config.h.
24566
24567 * src/getargs.c: Update bug report address.
24568
24569 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24570 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24571
245721998-11-25 Jesse Thilo <jthilo@gnu.org>
24573
24574 * Makefile.am:
24575 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24576
24577 * configure.in, version.cin:
24578 Build version.c automatically.
24579
24580 * AUTHORS: Add AUTHORS file.
24581
24582 * README: Update bug report address.
24583
24584 * bison.simple:
24585 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24586
24587 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24588 Add automake stuff.
24589
245901998-11-25 Jesse Thilo <jthilo@gnu.org>
24591
24592 * doc/bison.texinfo: Clean up some formatting.
24593
245941998-05-05 Richard Stallman <rms@gnu.org>
24595
24596 * doc/bison.texinfo:
24597 Explain better why to make a pure parser.
24598
245991998-01-05 Richard Stallman <rms@gnu.org>
24600
24601 * src/files.c (openfiles):
24602 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24603 find a temporary directory, if possible. Do not unlink files while
24604 they are open.
24605
246061997-08-25 Richard Stallman <rms@gnu.org>
24607
24608 * src/reader.c (stack_offset;):
24609 Change some warni to warns.
24610
24611 * src/lex.c (literalchar): Use warns, not warni.
24612
246131997-06-28 Richard Stallman <rms@gnu.org>
24614
24615 * src/bison.s1: Add a Bison version comment.
24616
24617 * src/main.c (fatal, warn, berror):
24618 Use program_name.
24619
246201997-06-28 Richard Stallman <rms@gnu.org>
24621
24622 * Makefile.in (bison_version): New variable.
24623 (dist): Use that variable.
24624 (bison.s1): Substitute the Bison version into bison.simple.
24625
24626 * bison.simple: Add a Bison version comment.
24627
246281997-06-18 Richard Stallman <rms@gnu.org>
24629
24630 * src/main.c (fatal, warn, berror):
24631 Make error messages standard.
24632 (toomany): Improve error message text.
24633
24634 * 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:
24635 new.h renamed to alloc.h.
24636
246371997-06-18 Richard Stallman <rms@gnu.org>
24638
24639 * Makefile.in: new.h renamed to alloc.h.
24640
246411997-05-24 Richard Stallman <rms@gnu.org>
24642
24643 * src/lex.c (literalchar):
24644 Fix the code for escaping \, " and '.
24645
24646 (lex): Avoid trouble when there are many chars
24647 to discard in a char literal with just several chars in it.
24648
246491997-05-17 Richard Stallman <rms@gnu.org>
24650
24651 * src/bison.s1:
24652 Use malloc, if using alloca is troublesome.
24653 (YYSTACK_USE_ALLOCA): New flag macro.
24654 Define it for some systems and compilers.
24655 (YYSTACK_ALLOC): New macro.
24656 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24657 If it was malloc'd, free it.
24658
246591997-05-17 Richard Stallman <rms@gnu.org>
24660
24661 * bison.simple:
24662 Use malloc, if using alloca is troublesome.
24663 (YYSTACK_USE_ALLOCA): New flag macro.
24664 Define it for some systems and compilers.
24665 (YYSTACK_ALLOC): New macro.
24666 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24667 If it was malloc'd, free it.
24668
246691997-04-23 Richard Stallman <rms@gnu.org>
24670
24671 * src/bison.s1:
24672 (alloca) [__hpux]: Always define as __builtin_alloca.
24673
246741997-04-23 Richard Stallman <rms@gnu.org>
24675
24676 * bison.simple:
24677 (alloca) [__hpux]: Always define as __builtin_alloca.
24678
246791997-04-22 Richard Stallman <rms@gnu.org>
24680
24681 * src/bison.s1:
24682 [__hpux]: Include alloca.h (right for HPUX 10)
24683 instead of declaring alloca (right for HPUX 9).
24684
24685 * src/bison.s1 (__yy_memcpy):
24686 Declare arg `count' as unsigned int.
24687 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24688
246891997-04-22 Richard Stallman <rms@gnu.org>
24690
24691 * bison.simple:
24692 [__hpux]: Include alloca.h (right for HPUX 10)
24693 instead of declaring alloca (right for HPUX 9).
24694
24695 * bison.simple (__yy_memcpy):
24696 Declare arg `count' as unsigned int.
24697 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24698
246991997-01-03 Richard Stallman <rms@gnu.org>
24700
24701 * src/allocate.c: [__STDC__ or _MSC_VER]:
24702 Declare calloc and realloc to return void *.
24703
247041997-01-02 Richard Stallman <rms@gnu.org>
24705
24706 * src/system.h:
24707 [_MSC_VER]: Include stdlib.h and process.h.
24708 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24709
24710 * src/main.c (main): Return FAILURE as a value.
24711 (printable_version): Declare arg as int, not char.
24712
247131997-01-02 Richard Stallman <rms@gnu.org>
24714
24715 * Makefile.in (dist):
24716 Explicitly check for symlinks, and copy them.
24717
247181996-12-19 Richard Stallman <rms@gnu.org>
24719
24720 * src/files.c:
24721 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24722
247231996-12-18 Paul Eggert <eggert@gnu.org>
24724
24725 * src/bison.s1 (yyparse):
24726 If __GNUC__ and YYPARSE_PARAM are both defined,
24727 declare yyparse to have a void * argument.
24728
247291996-12-18 Paul Eggert <eggert@gnu.org>
24730
24731 * bison.simple (yyparse):
24732 If __GNUC__ and YYPARSE_PARAM are both defined,
24733 declare yyparse to have a void * argument.
24734
247351996-12-17 Richard Stallman <rms@gnu.org>
24736
24737 * src/reduce.c (nbits): Add some casts.
24738
247391996-08-12 Richard Stallman <rms@gnu.org>
24740
24741 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24742
247431996-08-12 Richard Stallman <rms@gnu.org>
24744
24745 * bison.simple: Test _MSDOS as well as _MSDOS_.
24746
247471996-07-31 Richard Stallman <rms@gnu.org>
24748
24749 * src/bison.s1:
24750 [__sun && __i386]: Include alloca.h.
24751
247521996-07-31 Richard Stallman <rms@gnu.org>
24753
24754 * bison.simple:
24755 [__sun && __i386]: Include alloca.h.
24756
247571996-07-30 Richard Stallman <rms@gnu.org>
24758
24759 * src/bison.s1: Comment change.
24760
24761 * src/bison.s1: Test _MSDOS_, not MSDOS.
24762
247631996-07-30 Richard Stallman <rms@gnu.org>
24764
24765 * bison.simple: Comment change.
24766
24767 * bison.simple: Test _MSDOS_, not MSDOS.
24768
247691996-06-01 Richard Stallman <rms@gnu.org>
24770
24771 * 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:
24772 Insert `_' macro around many string constants.
24773
24774 * src/main.c:
24775 Insert `_' macro around many string constants.
24776
24777 (main): Call setlocale, bindtextdomain and textdomain.
24778
24779 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24780 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24781 [ENABLE_NLS]: Include libintl.h.
24782 [ENABLE_NLS] (gettext): Define.
24783 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24784 (N_, PACKAGE, LOCALEDIR): New macros.
24785
247861996-06-01 Richard Stallman <rms@gnu.org>
24787
24788 * POTFILES.in: New file.
24789
24790 * Makefile.in (allocate.o):
24791 Define target explicitly.
24792
24793 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24794 (LDFLAGS): Set to @LDFLAGS@.
24795 (configure): Run autoconf only if preceding `cd' succeeds.
24796 (bison.s1): Redirect output to temporary file then move the
24797 temporary to the target, rather than redirecting directly to bison.s1.
24798 (clean): Remove config.status and config.log.
24799 (distclean): Don't remove config.status here.
24800
248011996-05-12 Richard Stallman <rms@gnu.org>
24802
24803 * src/bison.s1:
24804 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24805
248061996-05-12 Richard Stallman <rms@gnu.org>
24807
24808 * bison.simple:
24809 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24810
248111996-05-11 Richard Stallman <rms@gnu.org>
24812
24813 * src/bison.s1 (__yy_memcpy):
24814 Really reorder the args, as was supposedly done on Feb 14 1995.
24815 (yyparse): Calls changed accordingly.
24816
248171996-05-11 Richard Stallman <rms@gnu.org>
24818
24819 * Makefile.in (dist): Don't use $(srcdir).
24820
24821 * bison.simple (__yy_memcpy):
24822 Really reorder the args, as was supposedly done on Feb 14 1995.
24823 (yyparse): Calls changed accordingly.
24824
248251996-01-27 Richard Stallman <rms@gnu.org>
24826
24827 * src/output.c (output_rule_data):
24828 Test YYERROR_VERBOSE in the conditional
24829 around the definition of ttyname.
24830
248311995-12-29 Richard Stallman <rms@gnu.org>
24832
24833 * src/bison.s1:
24834 Fix line numbers in #line commands.
24835
248361995-12-29 Richard Stallman <rms@gnu.org>
24837
24838 * bison.simple:
24839 Fix line numbers in #line commands.
24840
248411995-12-27 Richard Stallman <rms@gnu.org>
24842
24843 * src/bison.s1 (YYPARSE_PARAM_DECL):
24844 In C++, make it always null.
24845 (YYPARSE_PARAM_ARG): New macro.
24846 (yyparse): Use YYPARSE_PARAM_ARG.
24847
248481995-12-27 Richard Stallman <rms@gnu.org>
24849
24850 * bison.simple (YYPARSE_PARAM_DECL):
24851 In C++, make it always null.
24852 (YYPARSE_PARAM_ARG): New macro.
24853 (yyparse): Use YYPARSE_PARAM_ARG.
24854
248551995-11-29 Richard Stallman <rms@gnu.org>
24856
24857 * doc/bison.texinfo:
24858 Describe literal string tokens, %raw, %no_lines, %token_table.
24859
248601995-11-29 Daniel Hagerty <hag@gnu.org>
24861
24862 * doc/bison.texinfo: Fixed update date
24863
248641995-10-16 Richard Stallman <rms@gnu.org>
24865
24866 * src/version.c: Version 1.25.
24867
248681995-10-16 Richard Stallman <rms@gnu.org>
24869
24870 * NEWS: *** empty log message ***
24871
248721995-10-16 Richard Stallman <rms@gnu.org>
24873
24874 * doc/bison.1, doc/bison.rnh:
24875 Add new options.
24876
248771995-10-15 Richard Stallman <rms@gnu.org>
24878
24879 * src/vmsgetargs.c, src/getargs.c:
24880 Added -n, -k, and -raw switches.
24881 (noparserflag, toknumflag, rawtoknumflag): New variables.
24882
24883 * src/symtab.h (SALIAS):
24884 New #define for adding aliases to %token.
24885 (struct bucket): Added `alias' field.
24886
24887 * src/reduce.c (reduce_grammar):
24888 Revise error message.
24889 (print_notices): Remove final `.' from error message.
24890
24891 * src/reader.c (reader_output_yylsp):
24892 New function.
24893 (readgram): Use `#if 0' around code that accepted %command
24894 inside grammar rules: The documentation doesn't allow it,
24895 and it will fail since the %command processors scan for the next %.
24896 (parse_token_decl): Extended the %token
24897 declaration to allow a multi-character symbol as an alias.
24898 (parse_thong_decl): New function.
24899 (read_declarations): Added %thong declarations.
24900 (read_declarations): Handle NOOP to deal with allowing
24901 % declarations as another means to specify the flags.
24902 (readgram): Allow %prec prior to semantics embedded in a rule.
24903 (skip_to_char, read_declarations, copy_definition)
24904 (parse_token_decl, parse_start_decl, parse_type_decl)
24905 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24906 (get_type_name, copy_guard, copy_action, readgram)
24907 (get_type, packsymbols): Revised most error messages.
24908 Changed `fatal' to `warnxxx' to avoid aborting for error.
24909 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24910 (read_declarations): Improve the error message for
24911 an invalid character. Do not abort.
24912 (read_declarations, copy_guard, copy_action): Use
24913 printable_version to avoid unprintable characters in printed output.
24914 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24915 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24916 Allow the type of a non-terminal can be given
24917 more than once, as long as all specifications give the same type.
24918
24919 * src/output.c:
24920 (output_headers, output_trailers, output, output_gram)
24921 (output_rule_data): Implement noparserflag variable.
24922 Implement toknumflag variable.
24923 (output): Call reader_output_yylsp to output LTYPESTR.
24924
24925 * src/main.c (main):
24926 If reader sees an error, don't process the grammar.
24927 (fatals): Updated to not use VARARGS1.
24928 (printable_version, int_to_string, warn, warni, warns, warnss)
24929 (warnsss): New error reporting functions. Avoid abort for error.
24930
24931 * src/lex.h:
24932 Added THONG and NOOP for alias processing.
24933 Added SETOPT for the new code that allows setting options with %flags.
24934
24935 * src/lex.c:
24936 Include getopt.h. Add some extern decls.
24937 (safegetc): New function to deal with EOF gracefully.
24938 (literalchar); new function to deal with reading \ escapes.
24939 (lex): Use literalchar.
24940 (lex): Implemented "..." tokens.
24941 (literalchar, lex, parse_percent_token): Made tokenbuffer
24942 always contain the token. This includes growing the token
24943 buffer while reading an integer.
24944 (parse_percent_token): Replaced if-else statement with percent_table.
24945 (parse_percent_token): Added % declarations as another
24946 way to specify the flags -n, -l, and -r. Also added hooks for
24947 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
24948 major changes to files.c.
24949 (lex) Retain in the incoming stream a character following
24950 an incorrect '/'.
24951 (skip_white_space, lex): Revised most error messages
24952 and changed fatal to warn to avoid aborting.
24953 (percent_table): Added %thong declarations.
24954
24955 * src/gram.h: Comment changes.
24956
24957 * src/files.c (openfiles, open_extra_files, done):
24958 Add faction flag
24959 and actfile file. Handle noparserflag. Both for -n switch.
24960
24961 * src/conflicts.c (resolve_sr_conflict):
24962 Remove use of alloca.
24963
249641995-06-01 Jim Meyering <meyering@gnu.org>
24965
24966 * doc/bison.texinfo: *** empty log message ***
24967
249681995-05-06 Richard Stallman <rms@gnu.org>
24969
24970 * src/bison.s1: Comment change.
24971
249721995-05-06 Richard Stallman <rms@gnu.org>
24973
24974 * bison.simple: Comment change.
24975
249761995-05-03 Richard Stallman <rms@gnu.org>
24977
24978 * src/version.c: Version now 1.24.
24979
24980 * src/bison.s1: Change distribution terms.
24981
24982 * src/version.c: Version now 1.23.
24983
249841995-05-03 Richard Stallman <rms@gnu.org>
24985
24986 * doc/bison.texinfo:
24987 Rewrite "Conditions for Using Bison".
24988 Update version to 1.24.
24989
249901995-05-03 Richard Stallman <rms@gnu.org>
24991
24992 * bison.simple: Change distribution terms.
24993
249941995-02-23 Richard Stallman <rms@gnu.org>
24995
24996 * src/files.c: Test __VMS_POSIX as well as VMS.
24997
249981995-02-14 Jim Meyering <meyering@gnu.org>
24999
25000 * src/bison.s1 (__yy_memcpy):
25001 Renamed from __yy_bcopy to avoid
25002 confusion. Reverse FROM and TO arguments to be consistent with
25003 those of memcpy.
25004
250051995-02-14 Jim Meyering <meyering@gnu.org>
25006
25007 * bison.simple (__yy_memcpy):
25008 Renamed from __yy_bcopy to avoid
25009 confusion. Reverse FROM and TO arguments to be consistent with
25010 those of memcpy.
25011
250121994-11-10 David J. MacKenzie <djm@gnu.org>
25013
25014 * NEWS: reformat
25015
25016 * NEWS: New file.
25017
25018 * Makefile.in (DISTFILES): Include NEWS.
25019
25020 * Makefile.in (DISTFILES):
25021 Include install-sh, not install.sh.
25022
25023 * configure.in: Update to Autoconf v2 macro names.
25024
250251994-10-05 David J. MacKenzie <djm@gnu.org>
25026
25027 * Makefile.in: fix typo
25028
25029 * Makefile.in (prefix, exec_prefix):
25030 Let configure set them.
25031
250321994-09-28 David J. MacKenzie <djm@gnu.org>
25033
25034 * Makefile.in: Set datadir to $(prefix)/share.
25035
250361994-09-15 Richard Stallman <rms@gnu.org>
25037
25038 * src/bison.s1:
25039 Update copyright notice and GPL version.
25040
250411994-09-15 Richard Stallman <rms@gnu.org>
25042
25043 * bison.simple:
25044 Update copyright notice and GPL version.
25045
250461994-07-12 Richard Stallman <rms@gnu.org>
25047
25048 * src/reduce.c, src/reader.c:
25049 entered into RCS
25050
250511994-05-05 David J. MacKenzie <djm@gnu.org>
25052
25053 * Makefile.in: entered into RCS
25054
250551994-03-26 Richard Stallman <rms@gnu.org>
25056
25057 * src/bison.s1: entered into RCS
25058
250591994-03-26 Richard Stallman <rms@gnu.org>
25060
25061 * bison.simple: entered into RCS
25062
250631994-03-25 Richard Stallman <rms@gnu.org>
25064
25065 * src/main.c: entered into RCS
25066
250671994-03-24 Richard Stallman <rms@gnu.org>
25068
25069 * src/conflicts.c: entered into RCS
25070
250711994-01-02 Richard Stallman <rms@gnu.org>
25072
25073 * Makefile.in: *** empty log message ***
25074
250751993-11-21 Richard Stallman <rms@gnu.org>
25076
25077 * src/bison.s1: *** empty log message ***
25078
250791993-11-21 Richard Stallman <rms@gnu.org>
25080
25081 * doc/bison.texinfo: entered into RCS
25082
25083 * doc/bison.texinfo: *** empty log message ***
25084
250851993-11-21 Richard Stallman <rms@gnu.org>
25086
25087 * bison.simple: *** empty log message ***
25088
250891993-10-25 David J. MacKenzie <djm@gnu.org>
25090
25091 * doc/bison.texinfo: *** empty log message ***
25092
250931993-10-19 Richard Stallman <rms@gnu.org>
25094
25095 * src/bison.s1: *** empty log message ***
25096
250971993-10-19 Richard Stallman <rms@gnu.org>
25098
25099 * bison.simple: *** empty log message ***
25100
251011993-10-14 Richard Stallman <rms@gnu.org>
25102
25103 * src/bison.s1: *** empty log message ***
25104
251051993-10-14 Richard Stallman <rms@gnu.org>
25106
25107 * bison.simple: *** empty log message ***
25108
251091993-09-14 David J. MacKenzie <djm@gnu.org>
25110
25111 * doc/bison.texinfo: *** empty log message ***
25112
251131993-09-13 Noah Friedman <friedman@gnu.org>
25114
25115 * Makefile.in: *** empty log message ***
25116
251171993-09-10 Richard Stallman <rms@gnu.org>
25118
25119 * src/conflicts.c: *** empty log message ***
25120
25121 * src/system.h: entered into RCS
25122
251231993-09-10 Richard Stallman <rms@gnu.org>
25124
25125 * doc/bison.1: entered into RCS
25126
251271993-09-06 Noah Friedman <friedman@gnu.org>
25128
25129 * src/version.c: entered into RCS
25130
251311993-09-06 Noah Friedman <friedman@gnu.org>
25132
25133 * Makefile.in: *** empty log message ***
25134
251351993-07-30 David J. MacKenzie <djm@gnu.org>
25136
25137 * Makefile.in: *** empty log message ***
25138
251391993-07-24 Richard Stallman <rms@gnu.org>
25140
25141 * src/bison.s1: *** empty log message ***
25142
251431993-07-24 Richard Stallman <rms@gnu.org>
25144
25145 * bison.simple: *** empty log message ***
25146
251471993-07-08 David J. MacKenzie <djm@gnu.org>
25148
25149 * Makefile.in: *** empty log message ***
25150
251511993-07-04 Richard Stallman <rms@gnu.org>
25152
25153 * src/bison.s1: *** empty log message ***
25154
251551993-07-04 Richard Stallman <rms@gnu.org>
25156
25157 * bison.simple: *** empty log message ***
25158
251591993-06-26 David J. MacKenzie <djm@gnu.org>
25160
25161 * src/getargs.c: entered into RCS
25162
251631993-06-26 David J. MacKenzie <djm@gnu.org>
25164
25165 * doc/bison.texinfo: *** empty log message ***
25166
25167 * doc/bison.1: New file.
25168
251691993-06-25 Richard Stallman <rms@gnu.org>
25170
25171 * src/getargs.c: New file.
25172
251731993-06-16 Richard Stallman <rms@gnu.org>
25174
25175 * src/bison.s1: *** empty log message ***
25176
251771993-06-16 Richard Stallman <rms@gnu.org>
25178
25179 * bison.simple: *** empty log message ***
25180
251811993-06-03 Richard Stallman <rms@gnu.org>
25182
25183 * src/bison.s1: New file.
25184
251851993-06-03 Richard Stallman <rms@gnu.org>
25186
25187 * doc/bison.texinfo: *** empty log message ***
25188
251891993-06-03 Richard Stallman <rms@gnu.org>
25190
25191 * bison.simple: New file.
25192
251931993-05-19 Richard Stallman <rms@gnu.org>
25194
25195 * doc/bison.texinfo: New file.
25196
251971993-05-07 Noah Friedman <friedman@gnu.org>
25198
25199 * Makefile.in: *** empty log message ***
25200
252011993-04-28 Noah Friedman <friedman@gnu.org>
25202
25203 * src/reader.c: *** empty log message ***
25204
252051993-04-23 Noah Friedman <friedman@gnu.org>
25206
25207 * src/alloc.h: entered into RCS
25208
252091993-04-20 David J. MacKenzie <djm@gnu.org>
25210
25211 * src/version.c: *** empty log message ***
25212
25213 * src/files.c, src/allocate.c:
25214 entered into RCS
25215
25216 * src/reader.c: *** empty log message ***
25217
25218 * src/lex.c: entered into RCS
25219
25220 * src/conflicts.c: New file.
25221
25222 * src/symtab.c: entered into RCS
25223
25224 * src/alloc.h: New file.
25225
25226 * src/LR0.c: entered into RCS
25227
252281993-04-18 Noah Friedman <friedman@gnu.org>
25229
25230 * src/reader.c: New file.
25231
25232 * src/version.c: *** empty log message ***
25233
252341993-04-18 Noah Friedman <friedman@gnu.org>
25235
25236 * Makefile.in: *** empty log message ***
25237
252381993-04-17 Noah Friedman <friedman@gnu.org>
25239
25240 * Makefile.in: *** empty log message ***
25241
252421993-04-15 Richard Stallman <rms@gnu.org>
25243
25244 * src/main.c, src/files.c:
25245 New file.
25246
252471993-04-15 Noah Friedman <friedman@gnu.org>
25248
25249 * configure.in: entered into RCS
25250
25251 * configure.in: *** empty log message ***
25252
25253 * configure.in: New file.
25254
252551993-04-14 Richard Stallman <rms@gnu.org>
25256
25257 * Makefile.in: New file.
25258
252591993-04-13 Richard Stallman <rms@gnu.org>
25260
25261 * src/version.c: New file.
25262
252631993-03-25 Richard Stallman <rms@gnu.org>
25264
25265 * src/output.c: entered into RCS
25266
252671992-09-25 Richard Stallman <rms@gnu.org>
25268
25269 * configure.bat: entered into RCS
25270
252711992-06-22 Richard Stallman <rms@gnu.org>
25272
25273 * src/vmsgetargs.c: entered into RCS
25274
252751992-06-22 Richard Stallman <rms@gnu.org>
25276
25277 * doc/bison.rnh: entered into RCS
25278
252791992-04-20 David J. MacKenzie <djm@gnu.org>
25280
25281 * README: entered into RCS
25282
252831992-01-22 Richard Stallman <rms@gnu.org>
25284
25285 * src/machine.h: entered into RCS
25286
252871991-12-21 Richard Stallman <rms@gnu.org>
25288
25289 * src/lalr.c, src/closure.c:
25290 entered into RCS
25291
252921991-12-20 Richard Stallman <rms@gnu.org>
25293
25294 * src/state.h: entered into RCS
25295
252961991-12-18 Richard Stallman <rms@gnu.org>
25297
25298 * src/print.c, src/nullable.c, src/derives.c:
25299 entered into RCS
25300
253011991-11-03 David J. MacKenzie <djm@gnu.org>
25302
25303 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25304 entered into RCS
25305
253061988-09-09 Richard Stallman <rms@gnu.org>
25307
25308 * src/bison.hairy: entered into RCS
25309
253101987-12-16 Richard Stallman <rms@gnu.org>
25311
25312 * REFERENCES: entered into RCS
dc546b0f 25313
f294a2c2 25314
04098407 25315 -----
f294a2c2 25316
e141f4d4
JD
25317 Copyright (C) 1987-1988, 1991-2010 Free Software Foundation,
25318 Inc.
f294a2c2 25319
04098407
PE
25320 Copying and distribution of this file, with or without
25321 modification, are permitted provided the copyright notice and this
25322 notice are preserved.